mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
159 lines
1.4 MiB
159 lines
1.4 MiB
var HK=Object.defineProperty;var WK=(e,t,n)=>t in e?HK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var xw=(e,t,n)=>(WK(e,typeof t!="symbol"?t+"":t,n),n),ww=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var ae=(e,t,n)=>(ww(e,t,"read from private field"),n?n.call(e):t.get(e)),Zn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},aa=(e,t,n,r)=>(ww(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Np=(e,t,n,r)=>({set _(i){aa(e,t,i,n)},get _(){return ae(e,t,r)}}),ms=(e,t,n)=>(ww(e,t,"access private method"),n);function UN(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const o=Object.getOwnPropertyDescriptor(r,i);o&&Object.defineProperty(e,i,o.get?o:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var yt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function hS(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var VN={exports:{}},pS={},GN={exports:{}},Lt={};/**
|
||
* @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 G0=Symbol.for("react.element"),KK=Symbol.for("react.portal"),QK=Symbol.for("react.fragment"),XK=Symbol.for("react.strict_mode"),YK=Symbol.for("react.profiler"),ZK=Symbol.for("react.provider"),JK=Symbol.for("react.context"),eQ=Symbol.for("react.forward_ref"),tQ=Symbol.for("react.suspense"),nQ=Symbol.for("react.memo"),rQ=Symbol.for("react.lazy"),jP=Symbol.iterator;function iQ(e){return e===null||typeof e!="object"?null:(e=jP&&e[jP]||e["@@iterator"],typeof e=="function"?e:null)}var qN={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},HN=Object.assign,WN={};function dp(e,t,n){this.props=e,this.context=t,this.refs=WN,this.updater=n||qN}dp.prototype.isReactComponent={};dp.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};dp.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function KN(){}KN.prototype=dp.prototype;function KT(e,t,n){this.props=e,this.context=t,this.refs=WN,this.updater=n||qN}var QT=KT.prototype=new KN;QT.constructor=KT;HN(QT,dp.prototype);QT.isPureReactComponent=!0;var UP=Array.isArray,QN=Object.prototype.hasOwnProperty,XT={current:null},XN={key:!0,ref:!0,__self:!0,__source:!0};function YN(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)QN.call(t,r)&&!XN.hasOwnProperty(r)&&(i[r]=t[r]);var s=arguments.length-2;if(s===1)i.children=n;else if(1<s){for(var l=Array(s),u=0;u<s;u++)l[u]=arguments[u+2];i.children=l}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)i[r]===void 0&&(i[r]=s[r]);return{$$typeof:G0,type:e,key:o,ref:a,props:i,_owner:XT.current}}function oQ(e,t){return{$$typeof:G0,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function YT(e){return typeof e=="object"&&e!==null&&e.$$typeof===G0}function aQ(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var VP=/\/+/g;function Cw(e,t){return typeof e=="object"&&e!==null&&e.key!=null?aQ(""+e.key):t.toString(36)}function b1(e,t,n,r,i){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case G0:case KK:a=!0}}if(a)return a=e,i=i(a),e=r===""?"."+Cw(a,0):r,UP(i)?(n="",e!=null&&(n=e.replace(VP,"$&/")+"/"),b1(i,t,n,"",function(u){return u})):i!=null&&(YT(i)&&(i=oQ(i,n+(!i.key||a&&a.key===i.key?"":(""+i.key).replace(VP,"$&/")+"/")+e)),t.push(i)),1;if(a=0,r=r===""?".":r+":",UP(e))for(var s=0;s<e.length;s++){o=e[s];var l=r+Cw(o,s);a+=b1(o,t,n,l,i)}else if(l=iQ(e),typeof l=="function")for(e=l.call(e),s=0;!(o=e.next()).done;)o=o.value,l=r+Cw(o,s++),a+=b1(o,t,n,l,i);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function Gy(e,t,n){if(e==null)return e;var r=[],i=0;return b1(e,r,"","",function(o){return t.call(n,o,i++)}),r}function sQ(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var lo={current:null},_1={transition:null},lQ={ReactCurrentDispatcher:lo,ReactCurrentBatchConfig:_1,ReactCurrentOwner:XT};Lt.Children={map:Gy,forEach:function(e,t,n){Gy(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Gy(e,function(){t++}),t},toArray:function(e){return Gy(e,function(t){return t})||[]},only:function(e){if(!YT(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Lt.Component=dp;Lt.Fragment=QK;Lt.Profiler=YK;Lt.PureComponent=KT;Lt.StrictMode=XK;Lt.Suspense=tQ;Lt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=lQ;Lt.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=HN({},e.props),i=e.key,o=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,a=XT.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var s=e.type.defaultProps;for(l in t)QN.call(t,l)&&!XN.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&s!==void 0?s[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){s=Array(l);for(var u=0;u<l;u++)s[u]=arguments[u+2];r.children=s}return{$$typeof:G0,type:e.type,key:i,ref:o,props:r,_owner:a}};Lt.createContext=function(e){return e={$$typeof:JK,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:ZK,_context:e},e.Consumer=e};Lt.createElement=YN;Lt.createFactory=function(e){var t=YN.bind(null,e);return t.type=e,t};Lt.createRef=function(){return{current:null}};Lt.forwardRef=function(e){return{$$typeof:eQ,render:e}};Lt.isValidElement=YT;Lt.lazy=function(e){return{$$typeof:rQ,_payload:{_status:-1,_result:e},_init:sQ}};Lt.memo=function(e,t){return{$$typeof:nQ,type:e,compare:t===void 0?null:t}};Lt.startTransition=function(e){var t=_1.transition;_1.transition={};try{e()}finally{_1.transition=t}};Lt.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Lt.useCallback=function(e,t){return lo.current.useCallback(e,t)};Lt.useContext=function(e){return lo.current.useContext(e)};Lt.useDebugValue=function(){};Lt.useDeferredValue=function(e){return lo.current.useDeferredValue(e)};Lt.useEffect=function(e,t){return lo.current.useEffect(e,t)};Lt.useId=function(){return lo.current.useId()};Lt.useImperativeHandle=function(e,t,n){return lo.current.useImperativeHandle(e,t,n)};Lt.useInsertionEffect=function(e,t){return lo.current.useInsertionEffect(e,t)};Lt.useLayoutEffect=function(e,t){return lo.current.useLayoutEffect(e,t)};Lt.useMemo=function(e,t){return lo.current.useMemo(e,t)};Lt.useReducer=function(e,t,n){return lo.current.useReducer(e,t,n)};Lt.useRef=function(e){return lo.current.useRef(e)};Lt.useState=function(e){return lo.current.useState(e)};Lt.useSyncExternalStore=function(e,t,n){return lo.current.useSyncExternalStore(e,t,n)};Lt.useTransition=function(){return lo.current.useTransition()};Lt.version="18.2.0";GN.exports=Lt;var I=GN.exports;const Tn=mc(I),GP=UN({__proto__:null,default:Tn},[I]);/**
|
||
* @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 uQ=I,cQ=Symbol.for("react.element"),dQ=Symbol.for("react.fragment"),fQ=Object.prototype.hasOwnProperty,hQ=uQ.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,pQ={key:!0,ref:!0,__self:!0,__source:!0};function ZN(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)fQ.call(t,r)&&!pQ.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:cQ,type:e,key:o,ref:a,props:i,_owner:hQ.current}}pS.Fragment=dQ;pS.jsx=ZN;pS.jsxs=ZN;VN.exports=pS;var W=VN.exports,q5={},JN={exports:{}},ta={},e$={exports:{}},t$={};/**
|
||
* @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(e){function t(M,R){var N=M.length;M.push(R);e:for(;0<N;){var B=N-1>>>1,U=M[B];if(0<i(U,R))M[B]=R,M[N]=U,N=B;else break e}}function n(M){return M.length===0?null:M[0]}function r(M){if(M.length===0)return null;var R=M[0],N=M.pop();if(N!==R){M[0]=N;e:for(var B=0,U=M.length,G=U>>>1;B<G;){var Z=2*(B+1)-1,ee=M[Z],J=Z+1,j=M[J];if(0>i(ee,N))J<U&&0>i(j,ee)?(M[B]=j,M[J]=N,B=J):(M[B]=ee,M[Z]=N,B=Z);else if(J<U&&0>i(j,N))M[B]=j,M[J]=N,B=J;else break e}}return R}function i(M,R){var N=M.sortIndex-R.sortIndex;return N!==0?N:M.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,d=null,f=3,h=!1,p=!1,m=!1,_=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function g(M){for(var R=n(u);R!==null;){if(R.callback===null)r(u);else if(R.startTime<=M)r(u),R.sortIndex=R.expirationTime,t(l,R);else break;R=n(u)}}function v(M){if(m=!1,g(M),!p)if(n(l)!==null)p=!0,D(S);else{var R=n(u);R!==null&&L(v,R.startTime-M)}}function S(M,R){p=!1,m&&(m=!1,b(C),C=-1),h=!0;var N=f;try{for(g(R),d=n(l);d!==null&&(!(d.expirationTime>R)||M&&!P());){var B=d.callback;if(typeof B=="function"){d.callback=null,f=d.priorityLevel;var U=B(d.expirationTime<=R);R=e.unstable_now(),typeof U=="function"?d.callback=U:d===n(l)&&r(l),g(R)}else r(l);d=n(l)}if(d!==null)var G=!0;else{var Z=n(u);Z!==null&&L(v,Z.startTime-R),G=!1}return G}finally{d=null,f=N,h=!1}}var w=!1,x=null,C=-1,k=5,T=-1;function P(){return!(e.unstable_now()-T<k)}function $(){if(x!==null){var M=e.unstable_now();T=M;var R=!0;try{R=x(!0,M)}finally{R?O():(w=!1,x=null)}}else w=!1}var O;if(typeof y=="function")O=function(){y($)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,A=E.port2;E.port1.onmessage=$,O=function(){A.postMessage(null)}}else O=function(){_($,0)};function D(M){x=M,w||(w=!0,O())}function L(M,R){C=_(function(){M(e.unstable_now())},R)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(M){M.callback=null},e.unstable_continueExecution=function(){p||h||(p=!0,D(S))},e.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<M?Math.floor(1e3/M):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(M){switch(f){case 1:case 2:case 3:var R=3;break;default:R=f}var N=f;f=R;try{return M()}finally{f=N}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(M,R){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var N=f;f=M;try{return R()}finally{f=N}},e.unstable_scheduleCallback=function(M,R,N){var B=e.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?B+N:B):N=B,M){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=N+U,M={id:c++,callback:R,priorityLevel:M,startTime:N,expirationTime:U,sortIndex:-1},N>B?(M.sortIndex=N,t(u,M),n(l)===null&&M===n(u)&&(m?(b(C),C=-1):m=!0,L(v,N-B))):(M.sortIndex=U,t(l,M),p||h||(p=!0,D(S))),M},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(M){var R=f;return function(){var N=f;f=R;try{return M.apply(this,arguments)}finally{f=N}}}})(t$);e$.exports=t$;var gQ=e$.exports;/**
|
||
* @license React
|
||
* react-dom.production.min.js
|
||
*
|
||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var n$=I,Yo=gQ;function le(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r$=new Set,um={};function Bd(e,t){Mh(e,t),Mh(e+"Capture",t)}function Mh(e,t){for(um[e]=t,e=0;e<t.length;e++)r$.add(t[e])}var jl=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),H5=Object.prototype.hasOwnProperty,mQ=/^[: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]*$/,qP={},HP={};function yQ(e){return H5.call(HP,e)?!0:H5.call(qP,e)?!1:mQ.test(e)?HP[e]=!0:(qP[e]=!0,!1)}function vQ(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function bQ(e,t,n,r){if(t===null||typeof t>"u"||vQ(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function uo(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var Ri={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ri[e]=new uo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ri[t]=new uo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ri[e]=new uo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ri[e]=new uo(e,2,!1,e,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(e){Ri[e]=new uo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ri[e]=new uo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ri[e]=new uo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ri[e]=new uo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ri[e]=new uo(e,5,!1,e.toLowerCase(),null,!1,!1)});var ZT=/[\-:]([a-z])/g;function JT(e){return e[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(e){var t=e.replace(ZT,JT);Ri[t]=new uo(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ZT,JT);Ri[t]=new uo(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ZT,JT);Ri[t]=new uo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ri[e]=new uo(e,1,!1,e.toLowerCase(),null,!1,!1)});Ri.xlinkHref=new uo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ri[e]=new uo(e,1,!1,e.toLowerCase(),null,!0,!0)});function e4(e,t,n,r){var i=Ri.hasOwnProperty(t)?Ri[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(bQ(t,n,i,r)&&(n=null),r||i===null?yQ(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Yl=n$.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,qy=Symbol.for("react.element"),Af=Symbol.for("react.portal"),Pf=Symbol.for("react.fragment"),t4=Symbol.for("react.strict_mode"),W5=Symbol.for("react.profiler"),i$=Symbol.for("react.provider"),o$=Symbol.for("react.context"),n4=Symbol.for("react.forward_ref"),K5=Symbol.for("react.suspense"),Q5=Symbol.for("react.suspense_list"),r4=Symbol.for("react.memo"),vu=Symbol.for("react.lazy"),a$=Symbol.for("react.offscreen"),WP=Symbol.iterator;function $p(e){return e===null||typeof e!="object"?null:(e=WP&&e[WP]||e["@@iterator"],typeof e=="function"?e:null)}var dr=Object.assign,Ew;function hg(e){if(Ew===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ew=t&&t[1]||""}return`
|
||
`+Ew+e}var Tw=!1;function kw(e,t){if(!e||Tw)return"";Tw=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var i=u.stack.split(`
|
||
`),o=r.stack.split(`
|
||
`),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(a!==1||s!==1)do if(a--,s--,0>s||i[a]!==o[s]){var l=`
|
||
`+i[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{Tw=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?hg(e):""}function _Q(e){switch(e.tag){case 5:return hg(e.type);case 16:return hg("Lazy");case 13:return hg("Suspense");case 19:return hg("SuspenseList");case 0:case 2:case 15:return e=kw(e.type,!1),e;case 11:return e=kw(e.type.render,!1),e;case 1:return e=kw(e.type,!0),e;default:return""}}function X5(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Pf:return"Fragment";case Af:return"Portal";case W5:return"Profiler";case t4:return"StrictMode";case K5:return"Suspense";case Q5:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case o$:return(e.displayName||"Context")+".Consumer";case i$:return(e._context.displayName||"Context")+".Provider";case n4:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case r4:return t=e.displayName||null,t!==null?t:X5(e.type)||"Memo";case vu:t=e._payload,e=e._init;try{return X5(e(t))}catch{}}return null}function SQ(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return X5(t);case 8:return t===t4?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ec(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function s$(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function xQ(e){var t=s$(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Hy(e){e._valueTracker||(e._valueTracker=xQ(e))}function l$(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=s$(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function fb(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Y5(e,t){var n=t.checked;return dr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function KP(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ec(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function u$(e,t){t=t.checked,t!=null&&e4(e,"checked",t,!1)}function Z5(e,t){u$(e,t);var n=ec(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?J5(e,t.type,n):t.hasOwnProperty("defaultValue")&&J5(e,t.type,ec(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function QP(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function J5(e,t,n){(t!=="number"||fb(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var pg=Array.isArray;function Zf(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ec(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function e3(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(le(91));return dr({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function XP(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(le(92));if(pg(n)){if(1<n.length)throw Error(le(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:ec(n)}}function c$(e,t){var n=ec(t.value),r=ec(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function YP(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function d$(e){switch(e){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 t3(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?d$(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Wy,f$=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Wy=Wy||document.createElement("div"),Wy.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Wy.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function cm(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Mg={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},wQ=["Webkit","ms","Moz","O"];Object.keys(Mg).forEach(function(e){wQ.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mg[t]=Mg[e]})});function h$(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Mg.hasOwnProperty(e)&&Mg[e]?(""+t).trim():t+"px"}function p$(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=h$(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var CQ=dr({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 n3(e,t){if(t){if(CQ[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(le(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(le(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(le(61))}if(t.style!=null&&typeof t.style!="object")throw Error(le(62))}}function r3(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 i3=null;function i4(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var o3=null,Jf=null,eh=null;function ZP(e){if(e=W0(e)){if(typeof o3!="function")throw Error(le(280));var t=e.stateNode;t&&(t=bS(t),o3(e.stateNode,e.type,t))}}function g$(e){Jf?eh?eh.push(e):eh=[e]:Jf=e}function m$(){if(Jf){var e=Jf,t=eh;if(eh=Jf=null,ZP(e),t)for(e=0;e<t.length;e++)ZP(t[e])}}function y$(e,t){return e(t)}function v$(){}var Aw=!1;function b$(e,t,n){if(Aw)return e(t,n);Aw=!0;try{return y$(e,t,n)}finally{Aw=!1,(Jf!==null||eh!==null)&&(v$(),m$())}}function dm(e,t){var n=e.stateNode;if(n===null)return null;var r=bS(n);if(r===null)return null;n=r[t];e:switch(t){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)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(le(231,t,typeof n));return n}var a3=!1;if(jl)try{var Dp={};Object.defineProperty(Dp,"passive",{get:function(){a3=!0}}),window.addEventListener("test",Dp,Dp),window.removeEventListener("test",Dp,Dp)}catch{a3=!1}function EQ(e,t,n,r,i,o,a,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Ng=!1,hb=null,pb=!1,s3=null,TQ={onError:function(e){Ng=!0,hb=e}};function kQ(e,t,n,r,i,o,a,s,l){Ng=!1,hb=null,EQ.apply(TQ,arguments)}function AQ(e,t,n,r,i,o,a,s,l){if(kQ.apply(this,arguments),Ng){if(Ng){var u=hb;Ng=!1,hb=null}else throw Error(le(198));pb||(pb=!0,s3=u)}}function zd(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function _$(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function JP(e){if(zd(e)!==e)throw Error(le(188))}function PQ(e){var t=e.alternate;if(!t){if(t=zd(e),t===null)throw Error(le(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return JP(i),e;if(o===r)return JP(i),t;o=o.sibling}throw Error(le(188))}if(n.return!==r.return)n=i,r=o;else{for(var a=!1,s=i.child;s;){if(s===n){a=!0,n=i,r=o;break}if(s===r){a=!0,r=i,n=o;break}s=s.sibling}if(!a){for(s=o.child;s;){if(s===n){a=!0,n=o,r=i;break}if(s===r){a=!0,r=o,n=i;break}s=s.sibling}if(!a)throw Error(le(189))}}if(n.alternate!==r)throw Error(le(190))}if(n.tag!==3)throw Error(le(188));return n.stateNode.current===n?e:t}function S$(e){return e=PQ(e),e!==null?x$(e):null}function x$(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=x$(e);if(t!==null)return t;e=e.sibling}return null}var w$=Yo.unstable_scheduleCallback,e6=Yo.unstable_cancelCallback,IQ=Yo.unstable_shouldYield,RQ=Yo.unstable_requestPaint,Er=Yo.unstable_now,OQ=Yo.unstable_getCurrentPriorityLevel,o4=Yo.unstable_ImmediatePriority,C$=Yo.unstable_UserBlockingPriority,gb=Yo.unstable_NormalPriority,MQ=Yo.unstable_LowPriority,E$=Yo.unstable_IdlePriority,gS=null,Bs=null;function NQ(e){if(Bs&&typeof Bs.onCommitFiberRoot=="function")try{Bs.onCommitFiberRoot(gS,e,void 0,(e.current.flags&128)===128)}catch{}}var es=Math.clz32?Math.clz32:LQ,$Q=Math.log,DQ=Math.LN2;function LQ(e){return e>>>=0,e===0?32:31-($Q(e)/DQ|0)|0}var Ky=64,Qy=4194304;function gg(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function mb(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~i;s!==0?r=gg(s):(o&=a,o!==0&&(r=gg(o)))}else a=n&~i,a!==0?r=gg(a):o!==0&&(r=gg(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-es(t),i=1<<n,r|=e[n],t&=~i;return r}function FQ(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 BQ(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var a=31-es(o),s=1<<a,l=i[a];l===-1?(!(s&n)||s&r)&&(i[a]=FQ(s,t)):l<=t&&(e.expiredLanes|=s),o&=~s}}function l3(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function T$(){var e=Ky;return Ky<<=1,!(Ky&4194240)&&(Ky=64),e}function Pw(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function q0(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-es(t),e[t]=n}function zQ(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-es(n),o=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~o}}function a4(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-es(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var yn=0;function k$(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var A$,s4,P$,I$,R$,u3=!1,Xy=[],Fu=null,Bu=null,zu=null,fm=new Map,hm=new Map,Cu=[],jQ="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 t6(e,t){switch(e){case"focusin":case"focusout":Fu=null;break;case"dragenter":case"dragleave":Bu=null;break;case"mouseover":case"mouseout":zu=null;break;case"pointerover":case"pointerout":fm.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":hm.delete(t.pointerId)}}function Lp(e,t,n,r,i,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},t!==null&&(t=W0(t),t!==null&&s4(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function UQ(e,t,n,r,i){switch(t){case"focusin":return Fu=Lp(Fu,e,t,n,r,i),!0;case"dragenter":return Bu=Lp(Bu,e,t,n,r,i),!0;case"mouseover":return zu=Lp(zu,e,t,n,r,i),!0;case"pointerover":var o=i.pointerId;return fm.set(o,Lp(fm.get(o)||null,e,t,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,hm.set(o,Lp(hm.get(o)||null,e,t,n,r,i)),!0}return!1}function O$(e){var t=Zc(e.target);if(t!==null){var n=zd(t);if(n!==null){if(t=n.tag,t===13){if(t=_$(n),t!==null){e.blockedOn=t,R$(e.priority,function(){P$(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function S1(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=c3(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);i3=r,n.target.dispatchEvent(r),i3=null}else return t=W0(n),t!==null&&s4(t),e.blockedOn=n,!1;t.shift()}return!0}function n6(e,t,n){S1(e)&&n.delete(t)}function VQ(){u3=!1,Fu!==null&&S1(Fu)&&(Fu=null),Bu!==null&&S1(Bu)&&(Bu=null),zu!==null&&S1(zu)&&(zu=null),fm.forEach(n6),hm.forEach(n6)}function Fp(e,t){e.blockedOn===t&&(e.blockedOn=null,u3||(u3=!0,Yo.unstable_scheduleCallback(Yo.unstable_NormalPriority,VQ)))}function pm(e){function t(i){return Fp(i,e)}if(0<Xy.length){Fp(Xy[0],e);for(var n=1;n<Xy.length;n++){var r=Xy[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Fu!==null&&Fp(Fu,e),Bu!==null&&Fp(Bu,e),zu!==null&&Fp(zu,e),fm.forEach(t),hm.forEach(t),n=0;n<Cu.length;n++)r=Cu[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Cu.length&&(n=Cu[0],n.blockedOn===null);)O$(n),n.blockedOn===null&&Cu.shift()}var th=Yl.ReactCurrentBatchConfig,yb=!0;function GQ(e,t,n,r){var i=yn,o=th.transition;th.transition=null;try{yn=1,l4(e,t,n,r)}finally{yn=i,th.transition=o}}function qQ(e,t,n,r){var i=yn,o=th.transition;th.transition=null;try{yn=4,l4(e,t,n,r)}finally{yn=i,th.transition=o}}function l4(e,t,n,r){if(yb){var i=c3(e,t,n,r);if(i===null)Bw(e,t,r,vb,n),t6(e,r);else if(UQ(i,e,t,n,r))r.stopPropagation();else if(t6(e,r),t&4&&-1<jQ.indexOf(e)){for(;i!==null;){var o=W0(i);if(o!==null&&A$(o),o=c3(e,t,n,r),o===null&&Bw(e,t,r,vb,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else Bw(e,t,r,null,n)}}var vb=null;function c3(e,t,n,r){if(vb=null,e=i4(r),e=Zc(e),e!==null)if(t=zd(e),t===null)e=null;else if(n=t.tag,n===13){if(e=_$(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return vb=e,null}function M$(e){switch(e){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(OQ()){case o4:return 1;case C$:return 4;case gb:case MQ:return 16;case E$:return 536870912;default:return 16}default:return 16}}var Ou=null,u4=null,x1=null;function N$(){if(x1)return x1;var e,t=u4,n=t.length,r,i="value"in Ou?Ou.value:Ou.textContent,o=i.length;for(e=0;e<n&&t[e]===i[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===i[o-r];r++);return x1=i.slice(e,1<r?1-r:void 0)}function w1(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Yy(){return!0}function r6(){return!1}function na(e){function t(n,r,i,o,a){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=a,this.currentTarget=null;for(var s in e)e.hasOwnProperty(s)&&(n=e[s],this[s]=n?n(o):o[s]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Yy:r6,this.isPropagationStopped=r6,this}return dr(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Yy)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Yy)},persist:function(){},isPersistent:Yy}),t}var fp={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},c4=na(fp),H0=dr({},fp,{view:0,detail:0}),HQ=na(H0),Iw,Rw,Bp,mS=dr({},H0,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:d4,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Bp&&(Bp&&e.type==="mousemove"?(Iw=e.screenX-Bp.screenX,Rw=e.screenY-Bp.screenY):Rw=Iw=0,Bp=e),Iw)},movementY:function(e){return"movementY"in e?e.movementY:Rw}}),i6=na(mS),WQ=dr({},mS,{dataTransfer:0}),KQ=na(WQ),QQ=dr({},H0,{relatedTarget:0}),Ow=na(QQ),XQ=dr({},fp,{animationName:0,elapsedTime:0,pseudoElement:0}),YQ=na(XQ),ZQ=dr({},fp,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),JQ=na(ZQ),eX=dr({},fp,{data:0}),o6=na(eX),tX={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nX={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"},rX={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function iX(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rX[e])?!!t[e]:!1}function d4(){return iX}var oX=dr({},H0,{key:function(e){if(e.key){var t=tX[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=w1(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?nX[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:d4,charCode:function(e){return e.type==="keypress"?w1(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?w1(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),aX=na(oX),sX=dr({},mS,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),a6=na(sX),lX=dr({},H0,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:d4}),uX=na(lX),cX=dr({},fp,{propertyName:0,elapsedTime:0,pseudoElement:0}),dX=na(cX),fX=dr({},mS,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),hX=na(fX),pX=[9,13,27,32],f4=jl&&"CompositionEvent"in window,$g=null;jl&&"documentMode"in document&&($g=document.documentMode);var gX=jl&&"TextEvent"in window&&!$g,$$=jl&&(!f4||$g&&8<$g&&11>=$g),s6=String.fromCharCode(32),l6=!1;function D$(e,t){switch(e){case"keyup":return pX.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function L$(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var If=!1;function mX(e,t){switch(e){case"compositionend":return L$(t);case"keypress":return t.which!==32?null:(l6=!0,s6);case"textInput":return e=t.data,e===s6&&l6?null:e;default:return null}}function yX(e,t){if(If)return e==="compositionend"||!f4&&D$(e,t)?(e=N$(),x1=u4=Ou=null,If=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return $$&&t.locale!=="ko"?null:t.data;default:return null}}var vX={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 u6(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!vX[e.type]:t==="textarea"}function F$(e,t,n,r){g$(r),t=bb(t,"onChange"),0<t.length&&(n=new c4("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Dg=null,gm=null;function bX(e){Q$(e,0)}function yS(e){var t=Mf(e);if(l$(t))return e}function _X(e,t){if(e==="change")return t}var B$=!1;if(jl){var Mw;if(jl){var Nw="oninput"in document;if(!Nw){var c6=document.createElement("div");c6.setAttribute("oninput","return;"),Nw=typeof c6.oninput=="function"}Mw=Nw}else Mw=!1;B$=Mw&&(!document.documentMode||9<document.documentMode)}function d6(){Dg&&(Dg.detachEvent("onpropertychange",z$),gm=Dg=null)}function z$(e){if(e.propertyName==="value"&&yS(gm)){var t=[];F$(t,gm,e,i4(e)),b$(bX,t)}}function SX(e,t,n){e==="focusin"?(d6(),Dg=t,gm=n,Dg.attachEvent("onpropertychange",z$)):e==="focusout"&&d6()}function xX(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return yS(gm)}function wX(e,t){if(e==="click")return yS(t)}function CX(e,t){if(e==="input"||e==="change")return yS(t)}function EX(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var as=typeof Object.is=="function"?Object.is:EX;function mm(e,t){if(as(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!H5.call(t,i)||!as(e[i],t[i]))return!1}return!0}function f6(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function h6(e,t){var n=f6(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=f6(n)}}function j$(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?j$(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function U$(){for(var e=window,t=fb();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=fb(e.document)}return t}function h4(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function TX(e){var t=U$(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&j$(n.ownerDocument.documentElement,n)){if(r!==null&&h4(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=h6(n,o);var a=h6(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var kX=jl&&"documentMode"in document&&11>=document.documentMode,Rf=null,d3=null,Lg=null,f3=!1;function p6(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;f3||Rf==null||Rf!==fb(r)||(r=Rf,"selectionStart"in r&&h4(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}),Lg&&mm(Lg,r)||(Lg=r,r=bb(d3,"onSelect"),0<r.length&&(t=new c4("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Rf)))}function Zy(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Of={animationend:Zy("Animation","AnimationEnd"),animationiteration:Zy("Animation","AnimationIteration"),animationstart:Zy("Animation","AnimationStart"),transitionend:Zy("Transition","TransitionEnd")},$w={},V$={};jl&&(V$=document.createElement("div").style,"AnimationEvent"in window||(delete Of.animationend.animation,delete Of.animationiteration.animation,delete Of.animationstart.animation),"TransitionEvent"in window||delete Of.transitionend.transition);function vS(e){if($w[e])return $w[e];if(!Of[e])return e;var t=Of[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in V$)return $w[e]=t[n];return e}var G$=vS("animationend"),q$=vS("animationiteration"),H$=vS("animationstart"),W$=vS("transitionend"),K$=new Map,g6="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 yc(e,t){K$.set(e,t),Bd(t,[e])}for(var Dw=0;Dw<g6.length;Dw++){var Lw=g6[Dw],AX=Lw.toLowerCase(),PX=Lw[0].toUpperCase()+Lw.slice(1);yc(AX,"on"+PX)}yc(G$,"onAnimationEnd");yc(q$,"onAnimationIteration");yc(H$,"onAnimationStart");yc("dblclick","onDoubleClick");yc("focusin","onFocus");yc("focusout","onBlur");yc(W$,"onTransitionEnd");Mh("onMouseEnter",["mouseout","mouseover"]);Mh("onMouseLeave",["mouseout","mouseover"]);Mh("onPointerEnter",["pointerout","pointerover"]);Mh("onPointerLeave",["pointerout","pointerover"]);Bd("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Bd("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Bd("onBeforeInput",["compositionend","keypress","textInput","paste"]);Bd("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Bd("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Bd("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mg="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(" "),IX=new Set("cancel close invalid load scroll toggle".split(" ").concat(mg));function m6(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,AQ(r,t,void 0,e),e.currentTarget=null}function Q$(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var o=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==o&&i.isPropagationStopped())break e;m6(i,s,u),o=l}else for(a=0;a<r.length;a++){if(s=r[a],l=s.instance,u=s.currentTarget,s=s.listener,l!==o&&i.isPropagationStopped())break e;m6(i,s,u),o=l}}}if(pb)throw e=s3,pb=!1,s3=null,e}function Un(e,t){var n=t[y3];n===void 0&&(n=t[y3]=new Set);var r=e+"__bubble";n.has(r)||(X$(t,e,2,!1),n.add(r))}function Fw(e,t,n){var r=0;t&&(r|=4),X$(n,e,r,t)}var Jy="_reactListening"+Math.random().toString(36).slice(2);function ym(e){if(!e[Jy]){e[Jy]=!0,r$.forEach(function(n){n!=="selectionchange"&&(IX.has(n)||Fw(n,!1,e),Fw(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Jy]||(t[Jy]=!0,Fw("selectionchange",!1,t))}}function X$(e,t,n,r){switch(M$(t)){case 1:var i=GQ;break;case 4:i=qQ;break;default:i=l4}n=i.bind(null,t,n,e),i=void 0,!a3||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Bw(e,t,n,r,i){var o=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(a===4)for(a=r.return;a!==null;){var l=a.tag;if((l===3||l===4)&&(l=a.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;a=a.return}for(;s!==null;){if(a=Zc(s),a===null)return;if(l=a.tag,l===5||l===6){r=o=a;continue e}s=s.parentNode}}r=r.return}b$(function(){var u=o,c=i4(n),d=[];e:{var f=K$.get(e);if(f!==void 0){var h=c4,p=e;switch(e){case"keypress":if(w1(n)===0)break e;case"keydown":case"keyup":h=aX;break;case"focusin":p="focus",h=Ow;break;case"focusout":p="blur",h=Ow;break;case"beforeblur":case"afterblur":h=Ow;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":h=i6;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=KQ;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=uX;break;case G$:case q$:case H$:h=YQ;break;case W$:h=dX;break;case"scroll":h=HQ;break;case"wheel":h=hX;break;case"copy":case"cut":case"paste":h=JQ;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=a6}var m=(t&4)!==0,_=!m&&e==="scroll",b=m?f!==null?f+"Capture":null:f;m=[];for(var y=u,g;y!==null;){g=y;var v=g.stateNode;if(g.tag===5&&v!==null&&(g=v,b!==null&&(v=dm(y,b),v!=null&&m.push(vm(y,v,g)))),_)break;y=y.return}0<m.length&&(f=new h(f,p,null,n,c),d.push({event:f,listeners:m}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",f&&n!==i3&&(p=n.relatedTarget||n.fromElement)&&(Zc(p)||p[Ul]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(p=n.relatedTarget||n.toElement,h=u,p=p?Zc(p):null,p!==null&&(_=zd(p),p!==_||p.tag!==5&&p.tag!==6)&&(p=null)):(h=null,p=u),h!==p)){if(m=i6,v="onMouseLeave",b="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(m=a6,v="onPointerLeave",b="onPointerEnter",y="pointer"),_=h==null?f:Mf(h),g=p==null?f:Mf(p),f=new m(v,y+"leave",h,n,c),f.target=_,f.relatedTarget=g,v=null,Zc(c)===u&&(m=new m(b,y+"enter",p,n,c),m.target=g,m.relatedTarget=_,v=m),_=v,h&&p)t:{for(m=h,b=p,y=0,g=m;g;g=of(g))y++;for(g=0,v=b;v;v=of(v))g++;for(;0<y-g;)m=of(m),y--;for(;0<g-y;)b=of(b),g--;for(;y--;){if(m===b||b!==null&&m===b.alternate)break t;m=of(m),b=of(b)}m=null}else m=null;h!==null&&y6(d,f,h,m,!1),p!==null&&_!==null&&y6(d,_,p,m,!0)}}e:{if(f=u?Mf(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var S=_X;else if(u6(f))if(B$)S=CX;else{S=xX;var w=SX}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(S=wX);if(S&&(S=S(e,u))){F$(d,S,n,c);break e}w&&w(e,f,u),e==="focusout"&&(w=f._wrapperState)&&w.controlled&&f.type==="number"&&J5(f,"number",f.value)}switch(w=u?Mf(u):window,e){case"focusin":(u6(w)||w.contentEditable==="true")&&(Rf=w,d3=u,Lg=null);break;case"focusout":Lg=d3=Rf=null;break;case"mousedown":f3=!0;break;case"contextmenu":case"mouseup":case"dragend":f3=!1,p6(d,n,c);break;case"selectionchange":if(kX)break;case"keydown":case"keyup":p6(d,n,c)}var x;if(f4)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else If?D$(e,n)&&(C="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(C="onCompositionStart");C&&($$&&n.locale!=="ko"&&(If||C!=="onCompositionStart"?C==="onCompositionEnd"&&If&&(x=N$()):(Ou=c,u4="value"in Ou?Ou.value:Ou.textContent,If=!0)),w=bb(u,C),0<w.length&&(C=new o6(C,e,null,n,c),d.push({event:C,listeners:w}),x?C.data=x:(x=L$(n),x!==null&&(C.data=x)))),(x=gX?mX(e,n):yX(e,n))&&(u=bb(u,"onBeforeInput"),0<u.length&&(c=new o6("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=x))}Q$(d,t)})}function vm(e,t,n){return{instance:e,listener:t,currentTarget:n}}function bb(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=dm(e,n),o!=null&&r.unshift(vm(e,o,i)),o=dm(e,t),o!=null&&r.push(vm(e,o,i))),e=e.return}return r}function of(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function y6(e,t,n,r,i){for(var o=t._reactName,a=[];n!==null&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(l!==null&&l===r)break;s.tag===5&&u!==null&&(s=u,i?(l=dm(n,o),l!=null&&a.unshift(vm(n,l,s))):i||(l=dm(n,o),l!=null&&a.push(vm(n,l,s)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var RX=/\r\n?/g,OX=/\u0000|\uFFFD/g;function v6(e){return(typeof e=="string"?e:""+e).replace(RX,`
|
||
`).replace(OX,"")}function ev(e,t,n){if(t=v6(t),v6(e)!==t&&n)throw Error(le(425))}function _b(){}var h3=null,p3=null;function g3(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var m3=typeof setTimeout=="function"?setTimeout:void 0,MX=typeof clearTimeout=="function"?clearTimeout:void 0,b6=typeof Promise=="function"?Promise:void 0,NX=typeof queueMicrotask=="function"?queueMicrotask:typeof b6<"u"?function(e){return b6.resolve(null).then(e).catch($X)}:m3;function $X(e){setTimeout(function(){throw e})}function zw(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),pm(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);pm(t)}function ju(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function _6(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var hp=Math.random().toString(36).slice(2),Is="__reactFiber$"+hp,bm="__reactProps$"+hp,Ul="__reactContainer$"+hp,y3="__reactEvents$"+hp,DX="__reactListeners$"+hp,LX="__reactHandles$"+hp;function Zc(e){var t=e[Is];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ul]||n[Is]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=_6(e);e!==null;){if(n=e[Is])return n;e=_6(e)}return t}e=n,n=e.parentNode}return null}function W0(e){return e=e[Is]||e[Ul],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Mf(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(le(33))}function bS(e){return e[bm]||null}var v3=[],Nf=-1;function vc(e){return{current:e}}function Qn(e){0>Nf||(e.current=v3[Nf],v3[Nf]=null,Nf--)}function $n(e,t){Nf++,v3[Nf]=e.current,e.current=t}var tc={},Wi=vc(tc),To=vc(!1),xd=tc;function Nh(e,t){var n=e.type.contextTypes;if(!n)return tc;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ko(e){return e=e.childContextTypes,e!=null}function Sb(){Qn(To),Qn(Wi)}function S6(e,t,n){if(Wi.current!==tc)throw Error(le(168));$n(Wi,t),$n(To,n)}function Y$(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(le(108,SQ(e)||"Unknown",i));return dr({},n,r)}function xb(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||tc,xd=Wi.current,$n(Wi,e),$n(To,To.current),!0}function x6(e,t,n){var r=e.stateNode;if(!r)throw Error(le(169));n?(e=Y$(e,t,xd),r.__reactInternalMemoizedMergedChildContext=e,Qn(To),Qn(Wi),$n(Wi,e)):Qn(To),$n(To,n)}var bl=null,_S=!1,jw=!1;function Z$(e){bl===null?bl=[e]:bl.push(e)}function FX(e){_S=!0,Z$(e)}function bc(){if(!jw&&bl!==null){jw=!0;var e=0,t=yn;try{var n=bl;for(yn=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}bl=null,_S=!1}catch(i){throw bl!==null&&(bl=bl.slice(e+1)),w$(o4,bc),i}finally{yn=t,jw=!1}}return null}var $f=[],Df=0,wb=null,Cb=0,ga=[],ma=0,wd=null,Pl=1,Il="";function zc(e,t){$f[Df++]=Cb,$f[Df++]=wb,wb=e,Cb=t}function J$(e,t,n){ga[ma++]=Pl,ga[ma++]=Il,ga[ma++]=wd,wd=e;var r=Pl;e=Il;var i=32-es(r)-1;r&=~(1<<i),n+=1;var o=32-es(t)+i;if(30<o){var a=i-i%5;o=(r&(1<<a)-1).toString(32),r>>=a,i-=a,Pl=1<<32-es(t)+i|n<<i|r,Il=o+e}else Pl=1<<o|n<<i|r,Il=e}function p4(e){e.return!==null&&(zc(e,1),J$(e,1,0))}function g4(e){for(;e===wb;)wb=$f[--Df],$f[Df]=null,Cb=$f[--Df],$f[Df]=null;for(;e===wd;)wd=ga[--ma],ga[ma]=null,Il=ga[--ma],ga[ma]=null,Pl=ga[--ma],ga[ma]=null}var Ko=null,Ho=null,nr=!1,Ha=null;function eD(e,t){var n=ba(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function w6(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ko=e,Ho=ju(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ko=e,Ho=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=wd!==null?{id:Pl,overflow:Il}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ba(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ko=e,Ho=null,!0):!1;default:return!1}}function b3(e){return(e.mode&1)!==0&&(e.flags&128)===0}function _3(e){if(nr){var t=Ho;if(t){var n=t;if(!w6(e,t)){if(b3(e))throw Error(le(418));t=ju(n.nextSibling);var r=Ko;t&&w6(e,t)?eD(r,n):(e.flags=e.flags&-4097|2,nr=!1,Ko=e)}}else{if(b3(e))throw Error(le(418));e.flags=e.flags&-4097|2,nr=!1,Ko=e}}}function C6(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ko=e}function tv(e){if(e!==Ko)return!1;if(!nr)return C6(e),nr=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!g3(e.type,e.memoizedProps)),t&&(t=Ho)){if(b3(e))throw tD(),Error(le(418));for(;t;)eD(e,t),t=ju(t.nextSibling)}if(C6(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(le(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ho=ju(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ho=null}}else Ho=Ko?ju(e.stateNode.nextSibling):null;return!0}function tD(){for(var e=Ho;e;)e=ju(e.nextSibling)}function $h(){Ho=Ko=null,nr=!1}function m4(e){Ha===null?Ha=[e]:Ha.push(e)}var BX=Yl.ReactCurrentBatchConfig;function Ua(e,t){if(e&&e.defaultProps){t=dr({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Eb=vc(null),Tb=null,Lf=null,y4=null;function v4(){y4=Lf=Tb=null}function b4(e){var t=Eb.current;Qn(Eb),e._currentValue=t}function S3(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function nh(e,t){Tb=e,y4=Lf=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(xo=!0),e.firstContext=null)}function xa(e){var t=e._currentValue;if(y4!==e)if(e={context:e,memoizedValue:t,next:null},Lf===null){if(Tb===null)throw Error(le(308));Lf=e,Tb.dependencies={lanes:0,firstContext:e}}else Lf=Lf.next=e;return t}var Jc=null;function _4(e){Jc===null?Jc=[e]:Jc.push(e)}function nD(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,_4(t)):(n.next=i.next,i.next=n),t.interleaved=n,Vl(e,r)}function Vl(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var bu=!1;function S4(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function rD(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Nl(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Uu(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ht&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Vl(e,n)}return i=r.interleaved,i===null?(t.next=t,_4(r)):(t.next=i.next,i.next=t),r.interleaved=t,Vl(e,n)}function C1(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,a4(e,n)}}function E6(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function kb(e,t,n,r){var i=e.updateQueue;bu=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,a===null?o=u:a.next=u,a=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==a&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(o!==null){var d=i.baseState;a=0,c=u=l=null,s=o;do{var f=s.lane,h=s.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var p=e,m=s;switch(f=t,h=n,m.tag){case 1:if(p=m.payload,typeof p=="function"){d=p.call(h,d,f);break e}d=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=m.payload,f=typeof p=="function"?p.call(h,d,f):p,f==null)break e;d=dr({},d,f);break e;case 2:bu=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else h={eventTime:h,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,a|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Ed|=a,e.lanes=a,e.memoizedState=d}}function T6(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(le(191,i));i.call(r)}}}var iD=new n$.Component().refs;function x3(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:dr({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var SS={isMounted:function(e){return(e=e._reactInternals)?zd(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=io(),i=Gu(e),o=Nl(r,i);o.payload=t,n!=null&&(o.callback=n),t=Uu(e,o,i),t!==null&&(ts(t,e,i,r),C1(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=io(),i=Gu(e),o=Nl(r,i);o.tag=1,o.payload=t,n!=null&&(o.callback=n),t=Uu(e,o,i),t!==null&&(ts(t,e,i,r),C1(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=io(),r=Gu(e),i=Nl(n,r);i.tag=2,t!=null&&(i.callback=t),t=Uu(e,i,r),t!==null&&(ts(t,e,r,n),C1(t,e,r))}};function k6(e,t,n,r,i,o,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,o,a):t.prototype&&t.prototype.isPureReactComponent?!mm(n,r)||!mm(i,o):!0}function oD(e,t,n){var r=!1,i=tc,o=t.contextType;return typeof o=="object"&&o!==null?o=xa(o):(i=ko(t)?xd:Wi.current,r=t.contextTypes,o=(r=r!=null)?Nh(e,i):tc),t=new t(n,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=SS,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function A6(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&SS.enqueueReplaceState(t,t.state,null)}function w3(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=iD,S4(e);var o=t.contextType;typeof o=="object"&&o!==null?i.context=xa(o):(o=ko(t)?xd:Wi.current,i.context=Nh(e,o)),i.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(x3(e,t,o,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&SS.enqueueReplaceState(i,i.state,null),kb(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function zp(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(le(309));var r=n.stateNode}if(!r)throw Error(le(147,e));var i=r,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(a){var s=i.refs;s===iD&&(s=i.refs={}),a===null?delete s[o]:s[o]=a},t._stringRef=o,t)}if(typeof e!="string")throw Error(le(284));if(!n._owner)throw Error(le(290,e))}return e}function nv(e,t){throw e=Object.prototype.toString.call(t),Error(le(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function P6(e){var t=e._init;return t(e._payload)}function aD(e){function t(b,y){if(e){var g=b.deletions;g===null?(b.deletions=[y],b.flags|=16):g.push(y)}}function n(b,y){if(!e)return null;for(;y!==null;)t(b,y),y=y.sibling;return null}function r(b,y){for(b=new Map;y!==null;)y.key!==null?b.set(y.key,y):b.set(y.index,y),y=y.sibling;return b}function i(b,y){return b=qu(b,y),b.index=0,b.sibling=null,b}function o(b,y,g){return b.index=g,e?(g=b.alternate,g!==null?(g=g.index,g<y?(b.flags|=2,y):g):(b.flags|=2,y)):(b.flags|=1048576,y)}function a(b){return e&&b.alternate===null&&(b.flags|=2),b}function s(b,y,g,v){return y===null||y.tag!==6?(y=Kw(g,b.mode,v),y.return=b,y):(y=i(y,g),y.return=b,y)}function l(b,y,g,v){var S=g.type;return S===Pf?c(b,y,g.props.children,v,g.key):y!==null&&(y.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===vu&&P6(S)===y.type)?(v=i(y,g.props),v.ref=zp(b,y,g),v.return=b,v):(v=I1(g.type,g.key,g.props,null,b.mode,v),v.ref=zp(b,y,g),v.return=b,v)}function u(b,y,g,v){return y===null||y.tag!==4||y.stateNode.containerInfo!==g.containerInfo||y.stateNode.implementation!==g.implementation?(y=Qw(g,b.mode,v),y.return=b,y):(y=i(y,g.children||[]),y.return=b,y)}function c(b,y,g,v,S){return y===null||y.tag!==7?(y=fd(g,b.mode,v,S),y.return=b,y):(y=i(y,g),y.return=b,y)}function d(b,y,g){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Kw(""+y,b.mode,g),y.return=b,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case qy:return g=I1(y.type,y.key,y.props,null,b.mode,g),g.ref=zp(b,null,y),g.return=b,g;case Af:return y=Qw(y,b.mode,g),y.return=b,y;case vu:var v=y._init;return d(b,v(y._payload),g)}if(pg(y)||$p(y))return y=fd(y,b.mode,g,null),y.return=b,y;nv(b,y)}return null}function f(b,y,g,v){var S=y!==null?y.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return S!==null?null:s(b,y,""+g,v);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case qy:return g.key===S?l(b,y,g,v):null;case Af:return g.key===S?u(b,y,g,v):null;case vu:return S=g._init,f(b,y,S(g._payload),v)}if(pg(g)||$p(g))return S!==null?null:c(b,y,g,v,null);nv(b,g)}return null}function h(b,y,g,v,S){if(typeof v=="string"&&v!==""||typeof v=="number")return b=b.get(g)||null,s(y,b,""+v,S);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case qy:return b=b.get(v.key===null?g:v.key)||null,l(y,b,v,S);case Af:return b=b.get(v.key===null?g:v.key)||null,u(y,b,v,S);case vu:var w=v._init;return h(b,y,g,w(v._payload),S)}if(pg(v)||$p(v))return b=b.get(g)||null,c(y,b,v,S,null);nv(y,v)}return null}function p(b,y,g,v){for(var S=null,w=null,x=y,C=y=0,k=null;x!==null&&C<g.length;C++){x.index>C?(k=x,x=null):k=x.sibling;var T=f(b,x,g[C],v);if(T===null){x===null&&(x=k);break}e&&x&&T.alternate===null&&t(b,x),y=o(T,y,C),w===null?S=T:w.sibling=T,w=T,x=k}if(C===g.length)return n(b,x),nr&&zc(b,C),S;if(x===null){for(;C<g.length;C++)x=d(b,g[C],v),x!==null&&(y=o(x,y,C),w===null?S=x:w.sibling=x,w=x);return nr&&zc(b,C),S}for(x=r(b,x);C<g.length;C++)k=h(x,b,C,g[C],v),k!==null&&(e&&k.alternate!==null&&x.delete(k.key===null?C:k.key),y=o(k,y,C),w===null?S=k:w.sibling=k,w=k);return e&&x.forEach(function(P){return t(b,P)}),nr&&zc(b,C),S}function m(b,y,g,v){var S=$p(g);if(typeof S!="function")throw Error(le(150));if(g=S.call(g),g==null)throw Error(le(151));for(var w=S=null,x=y,C=y=0,k=null,T=g.next();x!==null&&!T.done;C++,T=g.next()){x.index>C?(k=x,x=null):k=x.sibling;var P=f(b,x,T.value,v);if(P===null){x===null&&(x=k);break}e&&x&&P.alternate===null&&t(b,x),y=o(P,y,C),w===null?S=P:w.sibling=P,w=P,x=k}if(T.done)return n(b,x),nr&&zc(b,C),S;if(x===null){for(;!T.done;C++,T=g.next())T=d(b,T.value,v),T!==null&&(y=o(T,y,C),w===null?S=T:w.sibling=T,w=T);return nr&&zc(b,C),S}for(x=r(b,x);!T.done;C++,T=g.next())T=h(x,b,C,T.value,v),T!==null&&(e&&T.alternate!==null&&x.delete(T.key===null?C:T.key),y=o(T,y,C),w===null?S=T:w.sibling=T,w=T);return e&&x.forEach(function($){return t(b,$)}),nr&&zc(b,C),S}function _(b,y,g,v){if(typeof g=="object"&&g!==null&&g.type===Pf&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case qy:e:{for(var S=g.key,w=y;w!==null;){if(w.key===S){if(S=g.type,S===Pf){if(w.tag===7){n(b,w.sibling),y=i(w,g.props.children),y.return=b,b=y;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===vu&&P6(S)===w.type){n(b,w.sibling),y=i(w,g.props),y.ref=zp(b,w,g),y.return=b,b=y;break e}n(b,w);break}else t(b,w);w=w.sibling}g.type===Pf?(y=fd(g.props.children,b.mode,v,g.key),y.return=b,b=y):(v=I1(g.type,g.key,g.props,null,b.mode,v),v.ref=zp(b,y,g),v.return=b,b=v)}return a(b);case Af:e:{for(w=g.key;y!==null;){if(y.key===w)if(y.tag===4&&y.stateNode.containerInfo===g.containerInfo&&y.stateNode.implementation===g.implementation){n(b,y.sibling),y=i(y,g.children||[]),y.return=b,b=y;break e}else{n(b,y);break}else t(b,y);y=y.sibling}y=Qw(g,b.mode,v),y.return=b,b=y}return a(b);case vu:return w=g._init,_(b,y,w(g._payload),v)}if(pg(g))return p(b,y,g,v);if($p(g))return m(b,y,g,v);nv(b,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,y!==null&&y.tag===6?(n(b,y.sibling),y=i(y,g),y.return=b,b=y):(n(b,y),y=Kw(g,b.mode,v),y.return=b,b=y),a(b)):n(b,y)}return _}var Dh=aD(!0),sD=aD(!1),K0={},zs=vc(K0),_m=vc(K0),Sm=vc(K0);function ed(e){if(e===K0)throw Error(le(174));return e}function x4(e,t){switch($n(Sm,t),$n(_m,e),$n(zs,K0),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:t3(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=t3(t,e)}Qn(zs),$n(zs,t)}function Lh(){Qn(zs),Qn(_m),Qn(Sm)}function lD(e){ed(Sm.current);var t=ed(zs.current),n=t3(t,e.type);t!==n&&($n(_m,e),$n(zs,n))}function w4(e){_m.current===e&&(Qn(zs),Qn(_m))}var lr=vc(0);function Ab(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Uw=[];function C4(){for(var e=0;e<Uw.length;e++)Uw[e]._workInProgressVersionPrimary=null;Uw.length=0}var E1=Yl.ReactCurrentDispatcher,Vw=Yl.ReactCurrentBatchConfig,Cd=0,cr=null,qr=null,ui=null,Pb=!1,Fg=!1,xm=0,zX=0;function Li(){throw Error(le(321))}function E4(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!as(e[n],t[n]))return!1;return!0}function T4(e,t,n,r,i,o){if(Cd=o,cr=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,E1.current=e===null||e.memoizedState===null?GX:qX,e=n(r,i),Fg){o=0;do{if(Fg=!1,xm=0,25<=o)throw Error(le(301));o+=1,ui=qr=null,t.updateQueue=null,E1.current=HX,e=n(r,i)}while(Fg)}if(E1.current=Ib,t=qr!==null&&qr.next!==null,Cd=0,ui=qr=cr=null,Pb=!1,t)throw Error(le(300));return e}function k4(){var e=xm!==0;return xm=0,e}function xs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ui===null?cr.memoizedState=ui=e:ui=ui.next=e,ui}function wa(){if(qr===null){var e=cr.alternate;e=e!==null?e.memoizedState:null}else e=qr.next;var t=ui===null?cr.memoizedState:ui.next;if(t!==null)ui=t,qr=e;else{if(e===null)throw Error(le(310));qr=e,e={memoizedState:qr.memoizedState,baseState:qr.baseState,baseQueue:qr.baseQueue,queue:qr.queue,next:null},ui===null?cr.memoizedState=ui=e:ui=ui.next=e}return ui}function wm(e,t){return typeof t=="function"?t(e):t}function Gw(e){var t=wa(),n=t.queue;if(n===null)throw Error(le(311));n.lastRenderedReducer=e;var r=qr,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var s=a=null,l=null,u=o;do{var c=u.lane;if((Cd&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(s=l=d,a=r):l=l.next=d,cr.lanes|=c,Ed|=c}u=u.next}while(u!==null&&u!==o);l===null?a=r:l.next=s,as(r,t.memoizedState)||(xo=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do o=i.lane,cr.lanes|=o,Ed|=o,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function qw(e){var t=wa(),n=t.queue;if(n===null)throw Error(le(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var a=i=i.next;do o=e(o,a.action),a=a.next;while(a!==i);as(o,t.memoizedState)||(xo=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function uD(){}function cD(e,t){var n=cr,r=wa(),i=t(),o=!as(r.memoizedState,i);if(o&&(r.memoizedState=i,xo=!0),r=r.queue,A4(hD.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||ui!==null&&ui.memoizedState.tag&1){if(n.flags|=2048,Cm(9,fD.bind(null,n,r,i,t),void 0,null),fi===null)throw Error(le(349));Cd&30||dD(n,t,i)}return i}function dD(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=cr.updateQueue,t===null?(t={lastEffect:null,stores:null},cr.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function fD(e,t,n,r){t.value=n,t.getSnapshot=r,pD(t)&&gD(e)}function hD(e,t,n){return n(function(){pD(t)&&gD(e)})}function pD(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!as(e,n)}catch{return!0}}function gD(e){var t=Vl(e,1);t!==null&&ts(t,e,1,-1)}function I6(e){var t=xs();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:wm,lastRenderedState:e},t.queue=e,e=e.dispatch=VX.bind(null,cr,e),[t.memoizedState,e]}function Cm(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=cr.updateQueue,t===null?(t={lastEffect:null,stores:null},cr.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function mD(){return wa().memoizedState}function T1(e,t,n,r){var i=xs();cr.flags|=e,i.memoizedState=Cm(1|t,n,void 0,r===void 0?null:r)}function xS(e,t,n,r){var i=wa();r=r===void 0?null:r;var o=void 0;if(qr!==null){var a=qr.memoizedState;if(o=a.destroy,r!==null&&E4(r,a.deps)){i.memoizedState=Cm(t,n,o,r);return}}cr.flags|=e,i.memoizedState=Cm(1|t,n,o,r)}function R6(e,t){return T1(8390656,8,e,t)}function A4(e,t){return xS(2048,8,e,t)}function yD(e,t){return xS(4,2,e,t)}function vD(e,t){return xS(4,4,e,t)}function bD(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function _D(e,t,n){return n=n!=null?n.concat([e]):null,xS(4,4,bD.bind(null,t,e),n)}function P4(){}function SD(e,t){var n=wa();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&E4(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function xD(e,t){var n=wa();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&E4(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function wD(e,t,n){return Cd&21?(as(n,t)||(n=T$(),cr.lanes|=n,Ed|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,xo=!0),e.memoizedState=n)}function jX(e,t){var n=yn;yn=n!==0&&4>n?n:4,e(!0);var r=Vw.transition;Vw.transition={};try{e(!1),t()}finally{yn=n,Vw.transition=r}}function CD(){return wa().memoizedState}function UX(e,t,n){var r=Gu(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},ED(e))TD(t,n);else if(n=nD(e,t,n,r),n!==null){var i=io();ts(n,e,r,i),kD(n,t,r)}}function VX(e,t,n){var r=Gu(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(ED(e))TD(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,s=o(a,n);if(i.hasEagerState=!0,i.eagerState=s,as(s,a)){var l=t.interleaved;l===null?(i.next=i,_4(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=nD(e,t,i,r),n!==null&&(i=io(),ts(n,e,r,i),kD(n,t,r))}}function ED(e){var t=e.alternate;return e===cr||t!==null&&t===cr}function TD(e,t){Fg=Pb=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function kD(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,a4(e,n)}}var Ib={readContext:xa,useCallback:Li,useContext:Li,useEffect:Li,useImperativeHandle:Li,useInsertionEffect:Li,useLayoutEffect:Li,useMemo:Li,useReducer:Li,useRef:Li,useState:Li,useDebugValue:Li,useDeferredValue:Li,useTransition:Li,useMutableSource:Li,useSyncExternalStore:Li,useId:Li,unstable_isNewReconciler:!1},GX={readContext:xa,useCallback:function(e,t){return xs().memoizedState=[e,t===void 0?null:t],e},useContext:xa,useEffect:R6,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,T1(4194308,4,bD.bind(null,t,e),n)},useLayoutEffect:function(e,t){return T1(4194308,4,e,t)},useInsertionEffect:function(e,t){return T1(4,2,e,t)},useMemo:function(e,t){var n=xs();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=xs();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=UX.bind(null,cr,e),[r.memoizedState,e]},useRef:function(e){var t=xs();return e={current:e},t.memoizedState=e},useState:I6,useDebugValue:P4,useDeferredValue:function(e){return xs().memoizedState=e},useTransition:function(){var e=I6(!1),t=e[0];return e=jX.bind(null,e[1]),xs().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=cr,i=xs();if(nr){if(n===void 0)throw Error(le(407));n=n()}else{if(n=t(),fi===null)throw Error(le(349));Cd&30||dD(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,R6(hD.bind(null,r,o,e),[e]),r.flags|=2048,Cm(9,fD.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=xs(),t=fi.identifierPrefix;if(nr){var n=Il,r=Pl;n=(r&~(1<<32-es(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=xm++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=zX++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},qX={readContext:xa,useCallback:SD,useContext:xa,useEffect:A4,useImperativeHandle:_D,useInsertionEffect:yD,useLayoutEffect:vD,useMemo:xD,useReducer:Gw,useRef:mD,useState:function(){return Gw(wm)},useDebugValue:P4,useDeferredValue:function(e){var t=wa();return wD(t,qr.memoizedState,e)},useTransition:function(){var e=Gw(wm)[0],t=wa().memoizedState;return[e,t]},useMutableSource:uD,useSyncExternalStore:cD,useId:CD,unstable_isNewReconciler:!1},HX={readContext:xa,useCallback:SD,useContext:xa,useEffect:A4,useImperativeHandle:_D,useInsertionEffect:yD,useLayoutEffect:vD,useMemo:xD,useReducer:qw,useRef:mD,useState:function(){return qw(wm)},useDebugValue:P4,useDeferredValue:function(e){var t=wa();return qr===null?t.memoizedState=e:wD(t,qr.memoizedState,e)},useTransition:function(){var e=qw(wm)[0],t=wa().memoizedState;return[e,t]},useMutableSource:uD,useSyncExternalStore:cD,useId:CD,unstable_isNewReconciler:!1};function Fh(e,t){try{var n="",r=t;do n+=_Q(r),r=r.return;while(r);var i=n}catch(o){i=`
|
||
Error generating stack: `+o.message+`
|
||
`+o.stack}return{value:e,source:t,stack:i,digest:null}}function Hw(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function C3(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var WX=typeof WeakMap=="function"?WeakMap:Map;function AD(e,t,n){n=Nl(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ob||(Ob=!0,N3=r),C3(e,t)},n}function PD(e,t,n){n=Nl(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){C3(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){C3(e,t),typeof r!="function"&&(Vu===null?Vu=new Set([this]):Vu.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function O6(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new WX;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=sY.bind(null,e,t,n),t.then(e,e))}function M6(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function N6(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Nl(-1,1),t.tag=2,Uu(n,t,1))),n.lanes|=1),e)}var KX=Yl.ReactCurrentOwner,xo=!1;function to(e,t,n,r){t.child=e===null?sD(t,null,n,r):Dh(t,e.child,n,r)}function $6(e,t,n,r,i){n=n.render;var o=t.ref;return nh(t,i),r=T4(e,t,n,r,o,i),n=k4(),e!==null&&!xo?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Gl(e,t,i)):(nr&&n&&p4(t),t.flags|=1,to(e,t,r,i),t.child)}function D6(e,t,n,r,i){if(e===null){var o=n.type;return typeof o=="function"&&!L4(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,ID(e,t,o,r,i)):(e=I1(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&i)){var a=o.memoizedProps;if(n=n.compare,n=n!==null?n:mm,n(a,r)&&e.ref===t.ref)return Gl(e,t,i)}return t.flags|=1,e=qu(o,r),e.ref=t.ref,e.return=t,t.child=e}function ID(e,t,n,r,i){if(e!==null){var o=e.memoizedProps;if(mm(o,r)&&e.ref===t.ref)if(xo=!1,t.pendingProps=r=o,(e.lanes&i)!==0)e.flags&131072&&(xo=!0);else return t.lanes=e.lanes,Gl(e,t,i)}return E3(e,t,n,r,i)}function RD(e,t,n){var r=t.pendingProps,i=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},$n(Bf,Uo),Uo|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,$n(Bf,Uo),Uo|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,$n(Bf,Uo),Uo|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,$n(Bf,Uo),Uo|=r;return to(e,t,i,n),t.child}function OD(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function E3(e,t,n,r,i){var o=ko(n)?xd:Wi.current;return o=Nh(t,o),nh(t,i),n=T4(e,t,n,r,o,i),r=k4(),e!==null&&!xo?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Gl(e,t,i)):(nr&&r&&p4(t),t.flags|=1,to(e,t,n,i),t.child)}function L6(e,t,n,r,i){if(ko(n)){var o=!0;xb(t)}else o=!1;if(nh(t,i),t.stateNode===null)k1(e,t),oD(t,n,r),w3(t,n,r,i),r=!0;else if(e===null){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=xa(u):(u=ko(n)?xd:Wi.current,u=Nh(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==r||l!==u)&&A6(t,a,r,u),bu=!1;var f=t.memoizedState;a.state=f,kb(t,r,a,i),l=t.memoizedState,s!==r||f!==l||To.current||bu?(typeof c=="function"&&(x3(t,n,c,r),l=t.memoizedState),(s=bu||k6(t,n,s,r,f,l,u))?(d||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,rD(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Ua(t.type,s),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,typeof l=="object"&&l!==null?l=xa(l):(l=ko(n)?xd:Wi.current,l=Nh(t,l));var h=n.getDerivedStateFromProps;(c=typeof h=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(s!==d||f!==l)&&A6(t,a,r,l),bu=!1,f=t.memoizedState,a.state=f,kb(t,r,a,i);var p=t.memoizedState;s!==d||f!==p||To.current||bu?(typeof h=="function"&&(x3(t,n,h,r),p=t.memoizedState),(u=bu||k6(t,n,u,r,f,p,l)||!1)?(c||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,p,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,p,l)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=u):(typeof a.componentDidUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return T3(e,t,n,r,o,i)}function T3(e,t,n,r,i,o){OD(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return i&&x6(t,n,!1),Gl(e,t,o);r=t.stateNode,KX.current=t;var s=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Dh(t,e.child,null,o),t.child=Dh(t,null,s,o)):to(e,t,s,o),t.memoizedState=r.state,i&&x6(t,n,!0),t.child}function MD(e){var t=e.stateNode;t.pendingContext?S6(e,t.pendingContext,t.pendingContext!==t.context):t.context&&S6(e,t.context,!1),x4(e,t.containerInfo)}function F6(e,t,n,r,i){return $h(),m4(i),t.flags|=256,to(e,t,n,r),t.child}var k3={dehydrated:null,treeContext:null,retryLane:0};function A3(e){return{baseLanes:e,cachePool:null,transitions:null}}function ND(e,t,n){var r=t.pendingProps,i=lr.current,o=!1,a=(t.flags&128)!==0,s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),$n(lr,i&1),e===null)return _3(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,o?(r=t.mode,o=t.child,a={mode:"hidden",children:a},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=a):o=ES(a,r,0,null),e=fd(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=A3(n),t.memoizedState=k3,e):I4(t,a));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return QX(e,t,a,r,s,i,n);if(o){o=r.fallback,a=t.mode,i=e.child,s=i.sibling;var l={mode:"hidden",children:r.children};return!(a&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=qu(i,l),r.subtreeFlags=i.subtreeFlags&14680064),s!==null?o=qu(s,o):(o=fd(o,a,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,a=e.child.memoizedState,a=a===null?A3(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},o.memoizedState=a,o.childLanes=e.childLanes&~n,t.memoizedState=k3,r}return o=e.child,e=o.sibling,r=qu(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function I4(e,t){return t=ES({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function rv(e,t,n,r){return r!==null&&m4(r),Dh(t,e.child,null,n),e=I4(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function QX(e,t,n,r,i,o,a){if(n)return t.flags&256?(t.flags&=-257,r=Hw(Error(le(422))),rv(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,i=t.mode,r=ES({mode:"visible",children:r.children},i,0,null),o=fd(o,i,a,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&Dh(t,e.child,null,a),t.child.memoizedState=A3(a),t.memoizedState=k3,o);if(!(t.mode&1))return rv(e,t,a,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var s=r.dgst;return r=s,o=Error(le(419)),r=Hw(o,r,void 0),rv(e,t,a,r)}if(s=(a&e.childLanes)!==0,xo||s){if(r=fi,r!==null){switch(a&-a){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|a)?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,Vl(e,i),ts(r,e,i,-1))}return D4(),r=Hw(Error(le(421))),rv(e,t,a,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=lY.bind(null,e),i._reactRetry=t,null):(e=o.treeContext,Ho=ju(i.nextSibling),Ko=t,nr=!0,Ha=null,e!==null&&(ga[ma++]=Pl,ga[ma++]=Il,ga[ma++]=wd,Pl=e.id,Il=e.overflow,wd=t),t=I4(t,r.children),t.flags|=4096,t)}function B6(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),S3(e.return,t,n)}function Ww(e,t,n,r,i){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function $D(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(to(e,t,r.children,n),r=lr.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&B6(e,n,t);else if(e.tag===19)B6(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if($n(lr,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Ab(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ww(t,!1,i,n,o);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ab(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ww(t,!0,n,null,o);break;case"together":Ww(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function k1(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Gl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ed|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(le(153));if(t.child!==null){for(e=t.child,n=qu(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=qu(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function XX(e,t,n){switch(t.tag){case 3:MD(t),$h();break;case 5:lD(t);break;case 1:ko(t.type)&&xb(t);break;case 4:x4(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;$n(Eb,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?($n(lr,lr.current&1),t.flags|=128,null):n&t.child.childLanes?ND(e,t,n):($n(lr,lr.current&1),e=Gl(e,t,n),e!==null?e.sibling:null);$n(lr,lr.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return $D(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),$n(lr,lr.current),r)break;return null;case 22:case 23:return t.lanes=0,RD(e,t,n)}return Gl(e,t,n)}var DD,P3,LD,FD;DD=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};P3=function(){};LD=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,ed(zs.current);var o=null;switch(n){case"input":i=Y5(e,i),r=Y5(e,r),o=[];break;case"select":i=dr({},i,{value:void 0}),r=dr({},r,{value:void 0}),o=[];break;case"textarea":i=e3(e,i),r=e3(e,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=_b)}n3(n,r);var a;n=null;for(u in i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(a in s)s.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(um.hasOwnProperty(u)?o||(o=[]):(o=o||[]).push(u,null));for(u in r){var l=r[u];if(s=i!=null?i[u]:void 0,r.hasOwnProperty(u)&&l!==s&&(l!=null||s!=null))if(u==="style")if(s){for(a in s)!s.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in l)l.hasOwnProperty(a)&&s[a]!==l[a]&&(n||(n={}),n[a]=l[a])}else n||(o||(o=[]),o.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(o=o||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(um.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Un("scroll",e),o||s===l||(o=[])):(o=o||[]).push(u,l))}n&&(o=o||[]).push("style",n);var u=o;(t.updateQueue=u)&&(t.flags|=4)}};FD=function(e,t,n,r){n!==r&&(t.flags|=4)};function jp(e,t){if(!nr)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Fi(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function YX(e,t,n){var r=t.pendingProps;switch(g4(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fi(t),null;case 1:return ko(t.type)&&Sb(),Fi(t),null;case 3:return r=t.stateNode,Lh(),Qn(To),Qn(Wi),C4(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(tv(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ha!==null&&(L3(Ha),Ha=null))),P3(e,t),Fi(t),null;case 5:w4(t);var i=ed(Sm.current);if(n=t.type,e!==null&&t.stateNode!=null)LD(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(le(166));return Fi(t),null}if(e=ed(zs.current),tv(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Is]=t,r[bm]=o,e=(t.mode&1)!==0,n){case"dialog":Un("cancel",r),Un("close",r);break;case"iframe":case"object":case"embed":Un("load",r);break;case"video":case"audio":for(i=0;i<mg.length;i++)Un(mg[i],r);break;case"source":Un("error",r);break;case"img":case"image":case"link":Un("error",r),Un("load",r);break;case"details":Un("toggle",r);break;case"input":KP(r,o),Un("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},Un("invalid",r);break;case"textarea":XP(r,o),Un("invalid",r)}n3(n,o),i=null;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];a==="children"?typeof s=="string"?r.textContent!==s&&(o.suppressHydrationWarning!==!0&&ev(r.textContent,s,e),i=["children",s]):typeof s=="number"&&r.textContent!==""+s&&(o.suppressHydrationWarning!==!0&&ev(r.textContent,s,e),i=["children",""+s]):um.hasOwnProperty(a)&&s!=null&&a==="onScroll"&&Un("scroll",r)}switch(n){case"input":Hy(r),QP(r,o,!0);break;case"textarea":Hy(r),YP(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=_b)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=d$(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Is]=t,e[bm]=r,DD(e,t,!1,!1),t.stateNode=e;e:{switch(a=r3(n,r),n){case"dialog":Un("cancel",e),Un("close",e),i=r;break;case"iframe":case"object":case"embed":Un("load",e),i=r;break;case"video":case"audio":for(i=0;i<mg.length;i++)Un(mg[i],e);i=r;break;case"source":Un("error",e),i=r;break;case"img":case"image":case"link":Un("error",e),Un("load",e),i=r;break;case"details":Un("toggle",e),i=r;break;case"input":KP(e,r),i=Y5(e,r),Un("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=dr({},r,{value:void 0}),Un("invalid",e);break;case"textarea":XP(e,r),i=e3(e,r),Un("invalid",e);break;default:i=r}n3(n,i),s=i;for(o in s)if(s.hasOwnProperty(o)){var l=s[o];o==="style"?p$(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&f$(e,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&cm(e,l):typeof l=="number"&&cm(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(um.hasOwnProperty(o)?l!=null&&o==="onScroll"&&Un("scroll",e):l!=null&&e4(e,o,l,a))}switch(n){case"input":Hy(e),QP(e,r,!1);break;case"textarea":Hy(e),YP(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ec(r.value));break;case"select":e.multiple=!!r.multiple,o=r.value,o!=null?Zf(e,!!r.multiple,o,!1):r.defaultValue!=null&&Zf(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=_b)}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&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Fi(t),null;case 6:if(e&&t.stateNode!=null)FD(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(le(166));if(n=ed(Sm.current),ed(zs.current),tv(t)){if(r=t.stateNode,n=t.memoizedProps,r[Is]=t,(o=r.nodeValue!==n)&&(e=Ko,e!==null))switch(e.tag){case 3:ev(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ev(r.nodeValue,n,(e.mode&1)!==0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Is]=t,t.stateNode=r}return Fi(t),null;case 13:if(Qn(lr),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(nr&&Ho!==null&&t.mode&1&&!(t.flags&128))tD(),$h(),t.flags|=98560,o=!1;else if(o=tv(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(le(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(le(317));o[Is]=t}else $h(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fi(t),o=!1}else Ha!==null&&(L3(Ha),Ha=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||lr.current&1?Kr===0&&(Kr=3):D4())),t.updateQueue!==null&&(t.flags|=4),Fi(t),null);case 4:return Lh(),P3(e,t),e===null&&ym(t.stateNode.containerInfo),Fi(t),null;case 10:return b4(t.type._context),Fi(t),null;case 17:return ko(t.type)&&Sb(),Fi(t),null;case 19:if(Qn(lr),o=t.memoizedState,o===null)return Fi(t),null;if(r=(t.flags&128)!==0,a=o.rendering,a===null)if(r)jp(o,!1);else{if(Kr!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Ab(e),a!==null){for(t.flags|=128,jp(o,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,a=o.alternate,a===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=a.childLanes,o.lanes=a.lanes,o.child=a.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=a.memoizedProps,o.memoizedState=a.memoizedState,o.updateQueue=a.updateQueue,o.type=a.type,e=a.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return $n(lr,lr.current&1|2),t.child}e=e.sibling}o.tail!==null&&Er()>Bh&&(t.flags|=128,r=!0,jp(o,!1),t.lanes=4194304)}else{if(!r)if(e=Ab(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),jp(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!nr)return Fi(t),null}else 2*Er()-o.renderingStartTime>Bh&&n!==1073741824&&(t.flags|=128,r=!0,jp(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Er(),t.sibling=null,n=lr.current,$n(lr,r?n&1|2:n&1),t):(Fi(t),null);case 22:case 23:return $4(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Uo&1073741824&&(Fi(t),t.subtreeFlags&6&&(t.flags|=8192)):Fi(t),null;case 24:return null;case 25:return null}throw Error(le(156,t.tag))}function ZX(e,t){switch(g4(t),t.tag){case 1:return ko(t.type)&&Sb(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Lh(),Qn(To),Qn(Wi),C4(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return w4(t),null;case 13:if(Qn(lr),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(le(340));$h()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Qn(lr),null;case 4:return Lh(),null;case 10:return b4(t.type._context),null;case 22:case 23:return $4(),null;case 24:return null;default:return null}}var iv=!1,Gi=!1,JX=typeof WeakSet=="function"?WeakSet:Set,De=null;function Ff(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){mr(e,t,r)}else n.current=null}function I3(e,t,n){try{n()}catch(r){mr(e,t,r)}}var z6=!1;function eY(e,t){if(h3=yb,e=U$(),h4(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(s=a+i),d!==o||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===n&&++u===i&&(s=a),f===o&&++c===r&&(l=a),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(p3={focusedElem:e,selectionRange:n},yb=!1,De=t;De!==null;)if(t=De,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,De=e;else for(;De!==null;){t=De;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var m=p.memoizedProps,_=p.memoizedState,b=t.stateNode,y=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:Ua(t.type,m),_);b.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(le(163))}}catch(v){mr(t,t.return,v)}if(e=t.sibling,e!==null){e.return=t.return,De=e;break}De=t.return}return p=z6,z6=!1,p}function Bg(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&I3(t,n,o)}i=i.next}while(i!==r)}}function wS(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function R3(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function BD(e){var t=e.alternate;t!==null&&(e.alternate=null,BD(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Is],delete t[bm],delete t[y3],delete t[DX],delete t[LX])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function zD(e){return e.tag===5||e.tag===3||e.tag===4}function j6(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||zD(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function O3(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=_b));else if(r!==4&&(e=e.child,e!==null))for(O3(e,t,n),e=e.sibling;e!==null;)O3(e,t,n),e=e.sibling}function M3(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(M3(e,t,n),e=e.sibling;e!==null;)M3(e,t,n),e=e.sibling}var wi=null,Ga=!1;function lu(e,t,n){for(n=n.child;n!==null;)jD(e,t,n),n=n.sibling}function jD(e,t,n){if(Bs&&typeof Bs.onCommitFiberUnmount=="function")try{Bs.onCommitFiberUnmount(gS,n)}catch{}switch(n.tag){case 5:Gi||Ff(n,t);case 6:var r=wi,i=Ga;wi=null,lu(e,t,n),wi=r,Ga=i,wi!==null&&(Ga?(e=wi,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):wi.removeChild(n.stateNode));break;case 18:wi!==null&&(Ga?(e=wi,n=n.stateNode,e.nodeType===8?zw(e.parentNode,n):e.nodeType===1&&zw(e,n),pm(e)):zw(wi,n.stateNode));break;case 4:r=wi,i=Ga,wi=n.stateNode.containerInfo,Ga=!0,lu(e,t,n),wi=r,Ga=i;break;case 0:case 11:case 14:case 15:if(!Gi&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&I3(n,t,a),i=i.next}while(i!==r)}lu(e,t,n);break;case 1:if(!Gi&&(Ff(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){mr(n,t,s)}lu(e,t,n);break;case 21:lu(e,t,n);break;case 22:n.mode&1?(Gi=(r=Gi)||n.memoizedState!==null,lu(e,t,n),Gi=r):lu(e,t,n);break;default:lu(e,t,n)}}function U6(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new JX),t.forEach(function(r){var i=uY.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Ba(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=e,a=t,s=a;e:for(;s!==null;){switch(s.tag){case 5:wi=s.stateNode,Ga=!1;break e;case 3:wi=s.stateNode.containerInfo,Ga=!0;break e;case 4:wi=s.stateNode.containerInfo,Ga=!0;break e}s=s.return}if(wi===null)throw Error(le(160));jD(o,a,i),wi=null,Ga=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(u){mr(i,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)UD(t,e),t=t.sibling}function UD(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ba(t,e),ys(e),r&4){try{Bg(3,e,e.return),wS(3,e)}catch(m){mr(e,e.return,m)}try{Bg(5,e,e.return)}catch(m){mr(e,e.return,m)}}break;case 1:Ba(t,e),ys(e),r&512&&n!==null&&Ff(n,n.return);break;case 5:if(Ba(t,e),ys(e),r&512&&n!==null&&Ff(n,n.return),e.flags&32){var i=e.stateNode;try{cm(i,"")}catch(m){mr(e,e.return,m)}}if(r&4&&(i=e.stateNode,i!=null)){var o=e.memoizedProps,a=n!==null?n.memoizedProps:o,s=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{s==="input"&&o.type==="radio"&&o.name!=null&&u$(i,o),r3(s,a);var u=r3(s,o);for(a=0;a<l.length;a+=2){var c=l[a],d=l[a+1];c==="style"?p$(i,d):c==="dangerouslySetInnerHTML"?f$(i,d):c==="children"?cm(i,d):e4(i,c,d,u)}switch(s){case"input":Z5(i,o);break;case"textarea":c$(i,o);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var h=o.value;h!=null?Zf(i,!!o.multiple,h,!1):f!==!!o.multiple&&(o.defaultValue!=null?Zf(i,!!o.multiple,o.defaultValue,!0):Zf(i,!!o.multiple,o.multiple?[]:"",!1))}i[bm]=o}catch(m){mr(e,e.return,m)}}break;case 6:if(Ba(t,e),ys(e),r&4){if(e.stateNode===null)throw Error(le(162));i=e.stateNode,o=e.memoizedProps;try{i.nodeValue=o}catch(m){mr(e,e.return,m)}}break;case 3:if(Ba(t,e),ys(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{pm(t.containerInfo)}catch(m){mr(e,e.return,m)}break;case 4:Ba(t,e),ys(e);break;case 13:Ba(t,e),ys(e),i=e.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(M4=Er())),r&4&&U6(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Gi=(u=Gi)||c,Ba(t,e),Gi=u):Ba(t,e),ys(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(De=e,c=e.child;c!==null;){for(d=De=c;De!==null;){switch(f=De,h=f.child,f.tag){case 0:case 11:case 14:case 15:Bg(4,f,f.return);break;case 1:Ff(f,f.return);var p=f.stateNode;if(typeof p.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(m){mr(r,n,m)}}break;case 5:Ff(f,f.return);break;case 22:if(f.memoizedState!==null){G6(d);continue}}h!==null?(h.return=f,De=h):G6(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{i=d.stateNode,u?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(s=d.stateNode,l=d.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,s.style.display=h$("display",a))}catch(m){mr(e,e.return,m)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(m){mr(e,e.return,m)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Ba(t,e),ys(e),r&4&&U6(e);break;case 21:break;default:Ba(t,e),ys(e)}}function ys(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(zD(n)){var r=n;break e}n=n.return}throw Error(le(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(cm(i,""),r.flags&=-33);var o=j6(e);M3(e,o,i);break;case 3:case 4:var a=r.stateNode.containerInfo,s=j6(e);O3(e,s,a);break;default:throw Error(le(161))}}catch(l){mr(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function tY(e,t,n){De=e,VD(e)}function VD(e,t,n){for(var r=(e.mode&1)!==0;De!==null;){var i=De,o=i.child;if(i.tag===22&&r){var a=i.memoizedState!==null||iv;if(!a){var s=i.alternate,l=s!==null&&s.memoizedState!==null||Gi;s=iv;var u=Gi;if(iv=a,(Gi=l)&&!u)for(De=i;De!==null;)a=De,l=a.child,a.tag===22&&a.memoizedState!==null?q6(i):l!==null?(l.return=a,De=l):q6(i);for(;o!==null;)De=o,VD(o),o=o.sibling;De=i,iv=s,Gi=u}V6(e)}else i.subtreeFlags&8772&&o!==null?(o.return=i,De=o):V6(e)}}function V6(e){for(;De!==null;){var t=De;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Gi||wS(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Gi)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Ua(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&T6(t,o,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}T6(t,a,n)}break;case 5:var s=t.stateNode;if(n===null&&t.flags&4){n=s;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&pm(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(le(163))}Gi||t.flags&512&&R3(t)}catch(f){mr(t,t.return,f)}}if(t===e){De=null;break}if(n=t.sibling,n!==null){n.return=t.return,De=n;break}De=t.return}}function G6(e){for(;De!==null;){var t=De;if(t===e){De=null;break}var n=t.sibling;if(n!==null){n.return=t.return,De=n;break}De=t.return}}function q6(e){for(;De!==null;){var t=De;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{wS(4,t)}catch(l){mr(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){mr(t,i,l)}}var o=t.return;try{R3(t)}catch(l){mr(t,o,l)}break;case 5:var a=t.return;try{R3(t)}catch(l){mr(t,a,l)}}}catch(l){mr(t,t.return,l)}if(t===e){De=null;break}var s=t.sibling;if(s!==null){s.return=t.return,De=s;break}De=t.return}}var nY=Math.ceil,Rb=Yl.ReactCurrentDispatcher,R4=Yl.ReactCurrentOwner,Sa=Yl.ReactCurrentBatchConfig,Ht=0,fi=null,Lr=null,Pi=0,Uo=0,Bf=vc(0),Kr=0,Em=null,Ed=0,CS=0,O4=0,zg=null,bo=null,M4=0,Bh=1/0,yl=null,Ob=!1,N3=null,Vu=null,ov=!1,Mu=null,Mb=0,jg=0,$3=null,A1=-1,P1=0;function io(){return Ht&6?Er():A1!==-1?A1:A1=Er()}function Gu(e){return e.mode&1?Ht&2&&Pi!==0?Pi&-Pi:BX.transition!==null?(P1===0&&(P1=T$()),P1):(e=yn,e!==0||(e=window.event,e=e===void 0?16:M$(e.type)),e):1}function ts(e,t,n,r){if(50<jg)throw jg=0,$3=null,Error(le(185));q0(e,n,r),(!(Ht&2)||e!==fi)&&(e===fi&&(!(Ht&2)&&(CS|=n),Kr===4&&Eu(e,Pi)),Ao(e,r),n===1&&Ht===0&&!(t.mode&1)&&(Bh=Er()+500,_S&&bc()))}function Ao(e,t){var n=e.callbackNode;BQ(e,t);var r=mb(e,e===fi?Pi:0);if(r===0)n!==null&&e6(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&e6(n),t===1)e.tag===0?FX(H6.bind(null,e)):Z$(H6.bind(null,e)),NX(function(){!(Ht&6)&&bc()}),n=null;else{switch(k$(r)){case 1:n=o4;break;case 4:n=C$;break;case 16:n=gb;break;case 536870912:n=E$;break;default:n=gb}n=YD(n,GD.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function GD(e,t){if(A1=-1,P1=0,Ht&6)throw Error(le(327));var n=e.callbackNode;if(rh()&&e.callbackNode!==n)return null;var r=mb(e,e===fi?Pi:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Nb(e,r);else{t=r;var i=Ht;Ht|=2;var o=HD();(fi!==e||Pi!==t)&&(yl=null,Bh=Er()+500,dd(e,t));do try{oY();break}catch(s){qD(e,s)}while(1);v4(),Rb.current=o,Ht=i,Lr!==null?t=0:(fi=null,Pi=0,t=Kr)}if(t!==0){if(t===2&&(i=l3(e),i!==0&&(r=i,t=D3(e,i))),t===1)throw n=Em,dd(e,0),Eu(e,r),Ao(e,Er()),n;if(t===6)Eu(e,r);else{if(i=e.current.alternate,!(r&30)&&!rY(i)&&(t=Nb(e,r),t===2&&(o=l3(e),o!==0&&(r=o,t=D3(e,o))),t===1))throw n=Em,dd(e,0),Eu(e,r),Ao(e,Er()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(le(345));case 2:jc(e,bo,yl);break;case 3:if(Eu(e,r),(r&130023424)===r&&(t=M4+500-Er(),10<t)){if(mb(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){io(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=m3(jc.bind(null,e,bo,yl),t);break}jc(e,bo,yl);break;case 4:if(Eu(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var a=31-es(r);o=1<<a,a=t[a],a>i&&(i=a),r&=~o}if(r=i,r=Er()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*nY(r/1960))-r,10<r){e.timeoutHandle=m3(jc.bind(null,e,bo,yl),r);break}jc(e,bo,yl);break;case 5:jc(e,bo,yl);break;default:throw Error(le(329))}}}return Ao(e,Er()),e.callbackNode===n?GD.bind(null,e):null}function D3(e,t){var n=zg;return e.current.memoizedState.isDehydrated&&(dd(e,t).flags|=256),e=Nb(e,t),e!==2&&(t=bo,bo=n,t!==null&&L3(t)),e}function L3(e){bo===null?bo=e:bo.push.apply(bo,e)}function rY(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!as(o(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Eu(e,t){for(t&=~O4,t&=~CS,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-es(t),r=1<<n;e[n]=-1,t&=~r}}function H6(e){if(Ht&6)throw Error(le(327));rh();var t=mb(e,0);if(!(t&1))return Ao(e,Er()),null;var n=Nb(e,t);if(e.tag!==0&&n===2){var r=l3(e);r!==0&&(t=r,n=D3(e,r))}if(n===1)throw n=Em,dd(e,0),Eu(e,t),Ao(e,Er()),n;if(n===6)throw Error(le(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,jc(e,bo,yl),Ao(e,Er()),null}function N4(e,t){var n=Ht;Ht|=1;try{return e(t)}finally{Ht=n,Ht===0&&(Bh=Er()+500,_S&&bc())}}function Td(e){Mu!==null&&Mu.tag===0&&!(Ht&6)&&rh();var t=Ht;Ht|=1;var n=Sa.transition,r=yn;try{if(Sa.transition=null,yn=1,e)return e()}finally{yn=r,Sa.transition=n,Ht=t,!(Ht&6)&&bc()}}function $4(){Uo=Bf.current,Qn(Bf)}function dd(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,MX(n)),Lr!==null)for(n=Lr.return;n!==null;){var r=n;switch(g4(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Sb();break;case 3:Lh(),Qn(To),Qn(Wi),C4();break;case 5:w4(r);break;case 4:Lh();break;case 13:Qn(lr);break;case 19:Qn(lr);break;case 10:b4(r.type._context);break;case 22:case 23:$4()}n=n.return}if(fi=e,Lr=e=qu(e.current,null),Pi=Uo=t,Kr=0,Em=null,O4=CS=Ed=0,bo=zg=null,Jc!==null){for(t=0;t<Jc.length;t++)if(n=Jc[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var a=o.next;o.next=i,r.next=a}n.pending=r}Jc=null}return e}function qD(e,t){do{var n=Lr;try{if(v4(),E1.current=Ib,Pb){for(var r=cr.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Pb=!1}if(Cd=0,ui=qr=cr=null,Fg=!1,xm=0,R4.current=null,n===null||n.return===null){Kr=1,Em=t,Lr=null;break}e:{var o=e,a=n.return,s=n,l=t;if(t=Pi,s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=s,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=M6(a);if(h!==null){h.flags&=-257,N6(h,a,s,o,t),h.mode&1&&O6(o,u,t),t=h,l=u;var p=t.updateQueue;if(p===null){var m=new Set;m.add(l),t.updateQueue=m}else p.add(l);break e}else{if(!(t&1)){O6(o,u,t),D4();break e}l=Error(le(426))}}else if(nr&&s.mode&1){var _=M6(a);if(_!==null){!(_.flags&65536)&&(_.flags|=256),N6(_,a,s,o,t),m4(Fh(l,s));break e}}o=l=Fh(l,s),Kr!==4&&(Kr=2),zg===null?zg=[o]:zg.push(o),o=a;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var b=AD(o,l,t);E6(o,b);break e;case 1:s=l;var y=o.type,g=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Vu===null||!Vu.has(g)))){o.flags|=65536,t&=-t,o.lanes|=t;var v=PD(o,s,t);E6(o,v);break e}}o=o.return}while(o!==null)}KD(n)}catch(S){t=S,Lr===n&&n!==null&&(Lr=n=n.return);continue}break}while(1)}function HD(){var e=Rb.current;return Rb.current=Ib,e===null?Ib:e}function D4(){(Kr===0||Kr===3||Kr===2)&&(Kr=4),fi===null||!(Ed&268435455)&&!(CS&268435455)||Eu(fi,Pi)}function Nb(e,t){var n=Ht;Ht|=2;var r=HD();(fi!==e||Pi!==t)&&(yl=null,dd(e,t));do try{iY();break}catch(i){qD(e,i)}while(1);if(v4(),Ht=n,Rb.current=r,Lr!==null)throw Error(le(261));return fi=null,Pi=0,Kr}function iY(){for(;Lr!==null;)WD(Lr)}function oY(){for(;Lr!==null&&!IQ();)WD(Lr)}function WD(e){var t=XD(e.alternate,e,Uo);e.memoizedProps=e.pendingProps,t===null?KD(e):Lr=t,R4.current=null}function KD(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=ZX(n,t),n!==null){n.flags&=32767,Lr=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Kr=6,Lr=null;return}}else if(n=YX(n,t,Uo),n!==null){Lr=n;return}if(t=t.sibling,t!==null){Lr=t;return}Lr=t=e}while(t!==null);Kr===0&&(Kr=5)}function jc(e,t,n){var r=yn,i=Sa.transition;try{Sa.transition=null,yn=1,aY(e,t,n,r)}finally{Sa.transition=i,yn=r}return null}function aY(e,t,n,r){do rh();while(Mu!==null);if(Ht&6)throw Error(le(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(le(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(zQ(e,o),e===fi&&(Lr=fi=null,Pi=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||ov||(ov=!0,YD(gb,function(){return rh(),null})),o=(n.flags&15990)!==0,n.subtreeFlags&15990||o){o=Sa.transition,Sa.transition=null;var a=yn;yn=1;var s=Ht;Ht|=4,R4.current=null,eY(e,n),UD(n,e),TX(p3),yb=!!h3,p3=h3=null,e.current=n,tY(n),RQ(),Ht=s,yn=a,Sa.transition=o}else e.current=n;if(ov&&(ov=!1,Mu=e,Mb=i),o=e.pendingLanes,o===0&&(Vu=null),NQ(n.stateNode),Ao(e,Er()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Ob)throw Ob=!1,e=N3,N3=null,e;return Mb&1&&e.tag!==0&&rh(),o=e.pendingLanes,o&1?e===$3?jg++:(jg=0,$3=e):jg=0,bc(),null}function rh(){if(Mu!==null){var e=k$(Mb),t=Sa.transition,n=yn;try{if(Sa.transition=null,yn=16>e?16:e,Mu===null)var r=!1;else{if(e=Mu,Mu=null,Mb=0,Ht&6)throw Error(le(331));var i=Ht;for(Ht|=4,De=e.current;De!==null;){var o=De,a=o.child;if(De.flags&16){var s=o.deletions;if(s!==null){for(var l=0;l<s.length;l++){var u=s[l];for(De=u;De!==null;){var c=De;switch(c.tag){case 0:case 11:case 15:Bg(8,c,o)}var d=c.child;if(d!==null)d.return=c,De=d;else for(;De!==null;){c=De;var f=c.sibling,h=c.return;if(BD(c),c===u){De=null;break}if(f!==null){f.return=h,De=f;break}De=h}}}var p=o.alternate;if(p!==null){var m=p.child;if(m!==null){p.child=null;do{var _=m.sibling;m.sibling=null,m=_}while(m!==null)}}De=o}}if(o.subtreeFlags&2064&&a!==null)a.return=o,De=a;else e:for(;De!==null;){if(o=De,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Bg(9,o,o.return)}var b=o.sibling;if(b!==null){b.return=o.return,De=b;break e}De=o.return}}var y=e.current;for(De=y;De!==null;){a=De;var g=a.child;if(a.subtreeFlags&2064&&g!==null)g.return=a,De=g;else e:for(a=y;De!==null;){if(s=De,s.flags&2048)try{switch(s.tag){case 0:case 11:case 15:wS(9,s)}}catch(S){mr(s,s.return,S)}if(s===a){De=null;break e}var v=s.sibling;if(v!==null){v.return=s.return,De=v;break e}De=s.return}}if(Ht=i,bc(),Bs&&typeof Bs.onPostCommitFiberRoot=="function")try{Bs.onPostCommitFiberRoot(gS,e)}catch{}r=!0}return r}finally{yn=n,Sa.transition=t}}return!1}function W6(e,t,n){t=Fh(n,t),t=AD(e,t,1),e=Uu(e,t,1),t=io(),e!==null&&(q0(e,1,t),Ao(e,t))}function mr(e,t,n){if(e.tag===3)W6(e,e,n);else for(;t!==null;){if(t.tag===3){W6(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Vu===null||!Vu.has(r))){e=Fh(n,e),e=PD(t,e,1),t=Uu(t,e,1),e=io(),t!==null&&(q0(t,1,e),Ao(t,e));break}}t=t.return}}function sY(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=io(),e.pingedLanes|=e.suspendedLanes&n,fi===e&&(Pi&n)===n&&(Kr===4||Kr===3&&(Pi&130023424)===Pi&&500>Er()-M4?dd(e,0):O4|=n),Ao(e,t)}function QD(e,t){t===0&&(e.mode&1?(t=Qy,Qy<<=1,!(Qy&130023424)&&(Qy=4194304)):t=1);var n=io();e=Vl(e,t),e!==null&&(q0(e,t,n),Ao(e,n))}function lY(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),QD(e,n)}function uY(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(le(314))}r!==null&&r.delete(t),QD(e,n)}var XD;XD=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||To.current)xo=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return xo=!1,XX(e,t,n);xo=!!(e.flags&131072)}else xo=!1,nr&&t.flags&1048576&&J$(t,Cb,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;k1(e,t),e=t.pendingProps;var i=Nh(t,Wi.current);nh(t,n),i=T4(null,t,r,e,i,n);var o=k4();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ko(r)?(o=!0,xb(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,S4(t),i.updater=SS,t.stateNode=i,i._reactInternals=t,w3(t,r,e,n),t=T3(null,t,r,!0,o,n)):(t.tag=0,nr&&o&&p4(t),to(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(k1(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=dY(r),e=Ua(r,e),i){case 0:t=E3(null,t,r,e,n);break e;case 1:t=L6(null,t,r,e,n);break e;case 11:t=$6(null,t,r,e,n);break e;case 14:t=D6(null,t,r,Ua(r.type,e),n);break e}throw Error(le(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ua(r,i),E3(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ua(r,i),L6(e,t,r,i,n);case 3:e:{if(MD(t),e===null)throw Error(le(387));r=t.pendingProps,o=t.memoizedState,i=o.element,rD(e,t),kb(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Fh(Error(le(423)),t),t=F6(e,t,r,n,i);break e}else if(r!==i){i=Fh(Error(le(424)),t),t=F6(e,t,r,n,i);break e}else for(Ho=ju(t.stateNode.containerInfo.firstChild),Ko=t,nr=!0,Ha=null,n=sD(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if($h(),r===i){t=Gl(e,t,n);break e}to(e,t,r,n)}t=t.child}return t;case 5:return lD(t),e===null&&_3(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,g3(r,i)?a=null:o!==null&&g3(r,o)&&(t.flags|=32),OD(e,t),to(e,t,a,n),t.child;case 6:return e===null&&_3(t),null;case 13:return ND(e,t,n);case 4:return x4(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Dh(t,null,r,n):to(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ua(r,i),$6(e,t,r,i,n);case 7:return to(e,t,t.pendingProps,n),t.child;case 8:return to(e,t,t.pendingProps.children,n),t.child;case 12:return to(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,$n(Eb,r._currentValue),r._currentValue=a,o!==null)if(as(o.value,a)){if(o.children===i.children&&!To.current){t=Gl(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var s=o.dependencies;if(s!==null){a=o.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Nl(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),S3(o.return,n,t),s.lanes|=n;break}l=l.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(le(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),S3(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}to(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,nh(t,n),i=xa(i),r=r(i),t.flags|=1,to(e,t,r,n),t.child;case 14:return r=t.type,i=Ua(r,t.pendingProps),i=Ua(r.type,i),D6(e,t,r,i,n);case 15:return ID(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ua(r,i),k1(e,t),t.tag=1,ko(r)?(e=!0,xb(t)):e=!1,nh(t,n),oD(t,r,i),w3(t,r,i,n),T3(null,t,r,!0,e,n);case 19:return $D(e,t,n);case 22:return RD(e,t,n)}throw Error(le(156,t.tag))};function YD(e,t){return w$(e,t)}function cY(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,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 ba(e,t,n,r){return new cY(e,t,n,r)}function L4(e){return e=e.prototype,!(!e||!e.isReactComponent)}function dY(e){if(typeof e=="function")return L4(e)?1:0;if(e!=null){if(e=e.$$typeof,e===n4)return 11;if(e===r4)return 14}return 2}function qu(e,t){var n=e.alternate;return n===null?(n=ba(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function I1(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")L4(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Pf:return fd(n.children,i,o,t);case t4:a=8,i|=8;break;case W5:return e=ba(12,n,t,i|2),e.elementType=W5,e.lanes=o,e;case K5:return e=ba(13,n,t,i),e.elementType=K5,e.lanes=o,e;case Q5:return e=ba(19,n,t,i),e.elementType=Q5,e.lanes=o,e;case a$:return ES(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case i$:a=10;break e;case o$:a=9;break e;case n4:a=11;break e;case r4:a=14;break e;case vu:a=16,r=null;break e}throw Error(le(130,e==null?e:typeof e,""))}return t=ba(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function fd(e,t,n,r){return e=ba(7,e,r,t),e.lanes=n,e}function ES(e,t,n,r){return e=ba(22,e,r,t),e.elementType=a$,e.lanes=n,e.stateNode={isHidden:!1},e}function Kw(e,t,n){return e=ba(6,e,null,t),e.lanes=n,e}function Qw(e,t,n){return t=ba(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function fY(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Pw(0),this.expirationTimes=Pw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pw(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function F4(e,t,n,r,i,o,a,s,l){return e=new fY(e,t,n,s,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=ba(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},S4(o),e}function hY(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Af,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function ZD(e){if(!e)return tc;e=e._reactInternals;e:{if(zd(e)!==e||e.tag!==1)throw Error(le(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(ko(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(le(171))}if(e.tag===1){var n=e.type;if(ko(n))return Y$(e,n,t)}return t}function JD(e,t,n,r,i,o,a,s,l){return e=F4(n,r,!0,e,i,o,a,s,l),e.context=ZD(null),n=e.current,r=io(),i=Gu(n),o=Nl(r,i),o.callback=t??null,Uu(n,o,i),e.current.lanes=i,q0(e,i,r),Ao(e,r),e}function TS(e,t,n,r){var i=t.current,o=io(),a=Gu(i);return n=ZD(n),t.context===null?t.context=n:t.pendingContext=n,t=Nl(o,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Uu(i,t,a),e!==null&&(ts(e,i,a,o),C1(e,i,a)),a}function $b(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function K6(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function B4(e,t){K6(e,t),(e=e.alternate)&&K6(e,t)}function pY(){return null}var eL=typeof reportError=="function"?reportError:function(e){console.error(e)};function z4(e){this._internalRoot=e}kS.prototype.render=z4.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(le(409));TS(e,t,null,null)};kS.prototype.unmount=z4.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Td(function(){TS(null,e,null,null)}),t[Ul]=null}};function kS(e){this._internalRoot=e}kS.prototype.unstable_scheduleHydration=function(e){if(e){var t=I$();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Cu.length&&t!==0&&t<Cu[n].priority;n++);Cu.splice(n,0,e),n===0&&O$(e)}};function j4(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function AS(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Q6(){}function gY(e,t,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var u=$b(a);o.call(u)}}var a=JD(t,r,e,0,null,!1,!1,"",Q6);return e._reactRootContainer=a,e[Ul]=a.current,ym(e.nodeType===8?e.parentNode:e),Td(),a}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var s=r;r=function(){var u=$b(l);s.call(u)}}var l=F4(e,0,!1,null,null,!1,!1,"",Q6);return e._reactRootContainer=l,e[Ul]=l.current,ym(e.nodeType===8?e.parentNode:e),Td(function(){TS(t,l,n,r)}),l}function PS(e,t,n,r,i){var o=n._reactRootContainer;if(o){var a=o;if(typeof i=="function"){var s=i;i=function(){var l=$b(a);s.call(l)}}TS(t,a,e,i)}else a=gY(n,t,e,i,r);return $b(a)}A$=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=gg(t.pendingLanes);n!==0&&(a4(t,n|1),Ao(t,Er()),!(Ht&6)&&(Bh=Er()+500,bc()))}break;case 13:Td(function(){var r=Vl(e,1);if(r!==null){var i=io();ts(r,e,1,i)}}),B4(e,1)}};s4=function(e){if(e.tag===13){var t=Vl(e,134217728);if(t!==null){var n=io();ts(t,e,134217728,n)}B4(e,134217728)}};P$=function(e){if(e.tag===13){var t=Gu(e),n=Vl(e,t);if(n!==null){var r=io();ts(n,e,t,r)}B4(e,t)}};I$=function(){return yn};R$=function(e,t){var n=yn;try{return yn=e,t()}finally{yn=n}};o3=function(e,t,n){switch(t){case"input":if(Z5(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=bS(r);if(!i)throw Error(le(90));l$(r),Z5(r,i)}}}break;case"textarea":c$(e,n);break;case"select":t=n.value,t!=null&&Zf(e,!!n.multiple,t,!1)}};y$=N4;v$=Td;var mY={usingClientEntryPoint:!1,Events:[W0,Mf,bS,g$,m$,N4]},Up={findFiberByHostInstance:Zc,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},yY={bundleType:Up.bundleType,version:Up.version,rendererPackageName:Up.rendererPackageName,rendererConfig:Up.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Yl.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=S$(e),e===null?null:e.stateNode},findFiberByHostInstance:Up.findFiberByHostInstance||pY,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 av=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!av.isDisabled&&av.supportsFiber)try{gS=av.inject(yY),Bs=av}catch{}}ta.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=mY;ta.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!j4(t))throw Error(le(200));return hY(e,t,null,n)};ta.createRoot=function(e,t){if(!j4(e))throw Error(le(299));var n=!1,r="",i=eL;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=F4(e,1,!1,null,null,n,!1,r,i),e[Ul]=t.current,ym(e.nodeType===8?e.parentNode:e),new z4(t)};ta.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(le(188)):(e=Object.keys(e).join(","),Error(le(268,e)));return e=S$(t),e=e===null?null:e.stateNode,e};ta.flushSync=function(e){return Td(e)};ta.hydrate=function(e,t,n){if(!AS(t))throw Error(le(200));return PS(null,e,t,!0,n)};ta.hydrateRoot=function(e,t,n){if(!j4(e))throw Error(le(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",a=eL;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=JD(t,null,e,1,n??null,i,!1,o,a),e[Ul]=t.current,ym(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new kS(t)};ta.render=function(e,t,n){if(!AS(t))throw Error(le(200));return PS(null,e,t,!1,n)};ta.unmountComponentAtNode=function(e){if(!AS(e))throw Error(le(40));return e._reactRootContainer?(Td(function(){PS(null,null,e,!1,function(){e._reactRootContainer=null,e[Ul]=null})}),!0):!1};ta.unstable_batchedUpdates=N4;ta.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!AS(n))throw Error(le(200));if(e==null||e._reactInternals===void 0)throw Error(le(38));return PS(e,t,n,!1,r)};ta.version="18.2.0-next-9e3b772b8-20220608";function tL(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tL)}catch(e){console.error(e)}}tL(),JN.exports=ta;var Vo=JN.exports;const iUe=mc(Vo);var X6=Vo;q5.createRoot=X6.createRoot,q5.hydrateRoot=X6.hydrateRoot;const vY="modulepreload",bY=function(e,t){return new URL(e,t).href},Y6={},nL=function(t,n,r){if(!n||n.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=bY(o,r),o in Y6)return;Y6[o]=!0;const a=o.endsWith(".css"),s=a?'[rel="stylesheet"]':"";if(!!r)for(let c=i.length-1;c>=0;c--){const d=i[c];if(d.href===o&&(!a||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${s}`))return;const u=document.createElement("link");if(u.rel=a?"stylesheet":vY,a||(u.as="script",u.crossOrigin=""),u.href=o,document.head.appendChild(u),a)return new Promise((c,d)=>{u.addEventListener("load",c),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t()).catch(o=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o})};function di(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map(function(i){return"'"+i+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ao(e){return!!e&&!!e[St]}function Po(e){var t;return!!e&&(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)===kY}(e)||Array.isArray(e)||!!e[ih]||!!(!((t=e.constructor)===null||t===void 0)&&t[ih])||IS(e)||RS(e))}function U4(e){return ao(e)||di(23,e),e[St].t}function ql(e,t,n){n===void 0&&(n=!1),nc(e)===0?(n?Object.keys:oh)(e).forEach(function(r){n&&typeof r=="symbol"||t(r,e[r],e)}):e.forEach(function(r,i){return t(i,r,e)})}function nc(e){var t=e[St];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:IS(e)?2:RS(e)?3:0}function Hu(e,t){return nc(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function R1(e,t){return nc(e)===2?e.get(t):e[t]}function rL(e,t,n){var r=nc(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function iL(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function IS(e){return EY&&e instanceof Map}function RS(e){return TY&&e instanceof Set}function ii(e){return e.o||e.t}function V4(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=aL(e);delete t[St];for(var n=oh(t),r=0;r<n.length;r++){var i=n[r],o=t[i];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function Q0(e,t){return t===void 0&&(t=!1),G4(e)||ao(e)||!Po(e)||(nc(e)>1&&(e.set=e.add=e.clear=e.delete=_Y),Object.freeze(e),t&&ql(e,function(n,r){return Q0(r,!0)},!0)),e}function _Y(){di(2)}function G4(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function js(e){var t=B3[e];return t||di(18,e),t}function q4(e,t){B3[e]||(B3[e]=t)}function Tm(){return Am}function Xw(e,t){t&&(js("Patches"),e.u=[],e.s=[],e.v=t)}function Db(e){F3(e),e.p.forEach(SY),e.p=null}function F3(e){e===Am&&(Am=e.l)}function Z6(e){return Am={p:[],l:Am,h:e,m:!0,_:0}}function SY(e){var t=e[St];t.i===0||t.i===1?t.j():t.g=!0}function Yw(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.O||js("ES5").S(t,e,r),r?(n[St].P&&(Db(t),di(4)),Po(e)&&(e=Lb(t,e),t.l||Fb(t,e)),t.u&&js("Patches").M(n[St].t,e,t.u,t.s)):e=Lb(t,n,[]),Db(t),t.u&&t.v(t.u,t.s),e!==MS?e:void 0}function Lb(e,t,n){if(G4(t))return t;var r=t[St];if(!r)return ql(t,function(s,l){return J6(e,r,t,s,l,n)},!0),t;if(r.A!==e)return t;if(!r.P)return Fb(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=V4(r.k):r.o,o=i,a=!1;r.i===3&&(o=new Set(i),i.clear(),a=!0),ql(o,function(s,l){return J6(e,r,i,s,l,n,a)}),Fb(e,i,!1),n&&e.u&&js("Patches").N(r,n,e.u,e.s)}return r.o}function J6(e,t,n,r,i,o,a){if(ao(i)){var s=Lb(e,i,o&&t&&t.i!==3&&!Hu(t.R,r)?o.concat(r):void 0);if(rL(n,r,s),!ao(s))return;e.m=!1}else a&&n.add(i);if(Po(i)&&!G4(i)){if(!e.h.D&&e._<1)return;Lb(e,i),t&&t.A.l||Fb(e,i)}}function Fb(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&Q0(t,n)}function Zw(e,t){var n=e[St];return(n?ii(n):e)[t]}function e8(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function _o(e){e.P||(e.P=!0,e.l&&_o(e.l))}function Jw(e){e.o||(e.o=V4(e.t))}function km(e,t,n){var r=IS(t)?js("MapSet").F(t,n):RS(t)?js("MapSet").T(t,n):e.O?function(i,o){var a=Array.isArray(i),s={i:a?1:0,A:o?o.A:Tm(),P:!1,I:!1,R:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=s,u=Pm;a&&(l=[s],u=yg);var c=Proxy.revocable(l,u),d=c.revoke,f=c.proxy;return s.k=f,s.j=d,f}(t,n):js("ES5").J(t,n);return(n?n.A:Tm()).p.push(r),r}function OS(e){return ao(e)||di(22,e),function t(n){if(!Po(n))return n;var r,i=n[St],o=nc(n);if(i){if(!i.P&&(i.i<4||!js("ES5").K(i)))return i.t;i.I=!0,r=t8(n,o),i.I=!1}else r=t8(n,o);return ql(r,function(a,s){i&&R1(i.t,a)===s||rL(r,a,t(s))}),o===3?new Set(r):r}(e)}function t8(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return V4(e)}function H4(){function e(o,a){var s=i[o];return s?s.enumerable=a:i[o]=s={configurable:!0,enumerable:a,get:function(){var l=this[St];return Pm.get(l,o)},set:function(l){var u=this[St];Pm.set(u,o,l)}},s}function t(o){for(var a=o.length-1;a>=0;a--){var s=o[a][St];if(!s.P)switch(s.i){case 5:r(s)&&_o(s);break;case 4:n(s)&&_o(s)}}}function n(o){for(var a=o.t,s=o.k,l=oh(s),u=l.length-1;u>=0;u--){var c=l[u];if(c!==St){var d=a[c];if(d===void 0&&!Hu(a,c))return!0;var f=s[c],h=f&&f[St];if(h?h.t!==d:!iL(f,d))return!0}}var p=!!a[St];return l.length!==oh(a).length+(p?0:1)}function r(o){var a=o.k;if(a.length!==o.t.length)return!0;var s=Object.getOwnPropertyDescriptor(a,a.length-1);if(s&&!s.get)return!0;for(var l=0;l<a.length;l++)if(!a.hasOwnProperty(l))return!0;return!1}var i={};q4("ES5",{J:function(o,a){var s=Array.isArray(o),l=function(c,d){if(c){for(var f=Array(d.length),h=0;h<d.length;h++)Object.defineProperty(f,""+h,e(h,!0));return f}var p=aL(d);delete p[St];for(var m=oh(p),_=0;_<m.length;_++){var b=m[_];p[b]=e(b,c||!!p[b].enumerable)}return Object.create(Object.getPrototypeOf(d),p)}(s,o),u={i:s?5:4,A:a?a.A:Tm(),P:!1,I:!1,R:{},l:a,t:o,k:l,o:null,g:!1,C:!1};return Object.defineProperty(l,St,{value:u,writable:!0}),l},S:function(o,a,s){s?ao(a)&&a[St].A===o&&t(o.p):(o.u&&function l(u){if(u&&typeof u=="object"){var c=u[St];if(c){var d=c.t,f=c.k,h=c.R,p=c.i;if(p===4)ql(f,function(g){g!==St&&(d[g]!==void 0||Hu(d,g)?h[g]||l(f[g]):(h[g]=!0,_o(c)))}),ql(d,function(g){f[g]!==void 0||Hu(f,g)||(h[g]=!1,_o(c))});else if(p===5){if(r(c)&&(_o(c),h.length=!0),f.length<d.length)for(var m=f.length;m<d.length;m++)h[m]=!1;else for(var _=d.length;_<f.length;_++)h[_]=!0;for(var b=Math.min(f.length,d.length),y=0;y<b;y++)f.hasOwnProperty(y)||(h[y]=!0),h[y]===void 0&&l(f[y])}}}}(o.p[0]),t(o.p))},K:function(o){return o.i===4?n(o):r(o)}})}function W4(){function e(r){if(!Po(r))return r;if(Array.isArray(r))return r.map(e);if(IS(r))return new Map(Array.from(r.entries()).map(function(a){return[a[0],e(a[1])]}));if(RS(r))return new Set(Array.from(r).map(e));var i=Object.create(Object.getPrototypeOf(r));for(var o in r)i[o]=e(r[o]);return Hu(r,ih)&&(i[ih]=r[ih]),i}function t(r){return ao(r)?e(r):r}var n="add";q4("Patches",{$:function(r,i){return i.forEach(function(o){for(var a=o.path,s=o.op,l=r,u=0;u<a.length-1;u++){var c=nc(l),d=a[u];typeof d!="string"&&typeof d!="number"&&(d=""+d),c!==0&&c!==1||d!=="__proto__"&&d!=="constructor"||di(24),typeof l=="function"&&d==="prototype"&&di(24),typeof(l=R1(l,d))!="object"&&di(15,a.join("/"))}var f=nc(l),h=e(o.value),p=a[a.length-1];switch(s){case"replace":switch(f){case 2:return l.set(p,h);case 3:di(16);default:return l[p]=h}case n:switch(f){case 1:return p==="-"?l.push(h):l.splice(p,0,h);case 2:return l.set(p,h);case 3:return l.add(h);default:return l[p]=h}case"remove":switch(f){case 1:return l.splice(p,1);case 2:return l.delete(p);case 3:return l.delete(o.value);default:return delete l[p]}default:di(17,s)}}),r},N:function(r,i,o,a){switch(r.i){case 0:case 4:case 2:return function(s,l,u,c){var d=s.t,f=s.o;ql(s.R,function(h,p){var m=R1(d,h),_=R1(f,h),b=p?Hu(d,h)?"replace":n:"remove";if(m!==_||b!=="replace"){var y=l.concat(h);u.push(b==="remove"?{op:b,path:y}:{op:b,path:y,value:_}),c.push(b===n?{op:"remove",path:y}:b==="remove"?{op:n,path:y,value:t(m)}:{op:"replace",path:y,value:t(m)})}})}(r,i,o,a);case 5:case 1:return function(s,l,u,c){var d=s.t,f=s.R,h=s.o;if(h.length<d.length){var p=[h,d];d=p[0],h=p[1];var m=[c,u];u=m[0],c=m[1]}for(var _=0;_<d.length;_++)if(f[_]&&h[_]!==d[_]){var b=l.concat([_]);u.push({op:"replace",path:b,value:t(h[_])}),c.push({op:"replace",path:b,value:t(d[_])})}for(var y=d.length;y<h.length;y++){var g=l.concat([y]);u.push({op:n,path:g,value:t(h[y])})}d.length<h.length&&c.push({op:"replace",path:l.concat(["length"]),value:d.length})}(r,i,o,a);case 3:return function(s,l,u,c){var d=s.t,f=s.o,h=0;d.forEach(function(p){if(!f.has(p)){var m=l.concat([h]);u.push({op:"remove",path:m,value:p}),c.unshift({op:n,path:m,value:p})}h++}),h=0,f.forEach(function(p){if(!d.has(p)){var m=l.concat([h]);u.push({op:n,path:m,value:p}),c.unshift({op:"remove",path:m,value:p})}h++})}(r,i,o,a)}},M:function(r,i,o,a){o.push({op:"replace",path:[],value:i===MS?void 0:i}),a.push({op:"replace",path:[],value:r})}})}function oL(){function e(s,l){function u(){this.constructor=s}i(s,l),s.prototype=(u.prototype=l.prototype,new u)}function t(s){s.o||(s.R=new Map,s.o=new Map(s.t))}function n(s){s.o||(s.o=new Set,s.t.forEach(function(l){if(Po(l)){var u=km(s.A.h,l,s);s.p.set(l,u),s.o.add(u)}else s.o.add(l)}))}function r(s){s.g&&di(3,JSON.stringify(ii(s)))}var i=function(s,l){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,c){u.__proto__=c}||function(u,c){for(var d in c)c.hasOwnProperty(d)&&(u[d]=c[d])})(s,l)},o=function(){function s(u,c){return this[St]={i:2,l:c,A:c?c.A:Tm(),P:!1,I:!1,o:void 0,R:void 0,t:u,k:this,C:!1,g:!1},this}e(s,Map);var l=s.prototype;return Object.defineProperty(l,"size",{get:function(){return ii(this[St]).size}}),l.has=function(u){return ii(this[St]).has(u)},l.set=function(u,c){var d=this[St];return r(d),ii(d).has(u)&&ii(d).get(u)===c||(t(d),_o(d),d.R.set(u,!0),d.o.set(u,c),d.R.set(u,!0)),this},l.delete=function(u){if(!this.has(u))return!1;var c=this[St];return r(c),t(c),_o(c),c.t.has(u)?c.R.set(u,!1):c.R.delete(u),c.o.delete(u),!0},l.clear=function(){var u=this[St];r(u),ii(u).size&&(t(u),_o(u),u.R=new Map,ql(u.t,function(c){u.R.set(c,!1)}),u.o.clear())},l.forEach=function(u,c){var d=this;ii(this[St]).forEach(function(f,h){u.call(c,d.get(h),h,d)})},l.get=function(u){var c=this[St];r(c);var d=ii(c).get(u);if(c.I||!Po(d)||d!==c.t.get(u))return d;var f=km(c.A.h,d,c);return t(c),c.o.set(u,f),f},l.keys=function(){return ii(this[St]).keys()},l.values=function(){var u,c=this,d=this.keys();return(u={})[sv]=function(){return c.values()},u.next=function(){var f=d.next();return f.done?f:{done:!1,value:c.get(f.value)}},u},l.entries=function(){var u,c=this,d=this.keys();return(u={})[sv]=function(){return c.entries()},u.next=function(){var f=d.next();if(f.done)return f;var h=c.get(f.value);return{done:!1,value:[f.value,h]}},u},l[sv]=function(){return this.entries()},s}(),a=function(){function s(u,c){return this[St]={i:3,l:c,A:c?c.A:Tm(),P:!1,I:!1,o:void 0,t:u,k:this,p:new Map,g:!1,C:!1},this}e(s,Set);var l=s.prototype;return Object.defineProperty(l,"size",{get:function(){return ii(this[St]).size}}),l.has=function(u){var c=this[St];return r(c),c.o?!!c.o.has(u)||!(!c.p.has(u)||!c.o.has(c.p.get(u))):c.t.has(u)},l.add=function(u){var c=this[St];return r(c),this.has(u)||(n(c),_o(c),c.o.add(u)),this},l.delete=function(u){if(!this.has(u))return!1;var c=this[St];return r(c),n(c),_o(c),c.o.delete(u)||!!c.p.has(u)&&c.o.delete(c.p.get(u))},l.clear=function(){var u=this[St];r(u),ii(u).size&&(n(u),_o(u),u.o.clear())},l.values=function(){var u=this[St];return r(u),n(u),u.o.values()},l.entries=function(){var u=this[St];return r(u),n(u),u.o.entries()},l.keys=function(){return this.values()},l[sv]=function(){return this.values()},l.forEach=function(u,c){for(var d=this.values(),f=d.next();!f.done;)u.call(c,f.value,f.value,this),f=d.next()},s}();q4("MapSet",{F:function(s,l){return new o(s,l)},T:function(s,l){return new a(s,l)}})}function xY(){H4(),oL(),W4()}function wY(e){return e}function CY(e){return e}var n8,Am,K4=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",EY=typeof Map<"u",TY=typeof Set<"u",r8=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",MS=K4?Symbol.for("immer-nothing"):((n8={})["immer-nothing"]=!0,n8),ih=K4?Symbol.for("immer-draftable"):"__$immer_draftable",St=K4?Symbol.for("immer-state"):"__$immer_state",sv=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",kY=""+Object.prototype.constructor,oh=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,aL=Object.getOwnPropertyDescriptors||function(e){var t={};return oh(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},B3={},Pm={get:function(e,t){if(t===St)return e;var n=ii(e);if(!Hu(n,t))return function(i,o,a){var s,l=e8(o,a);return l?"value"in l?l.value:(s=l.get)===null||s===void 0?void 0:s.call(i.k):void 0}(e,n,t);var r=n[t];return e.I||!Po(r)?r:r===Zw(e.t,t)?(Jw(e),e.o[t]=km(e.A.h,r,e)):r},has:function(e,t){return t in ii(e)},ownKeys:function(e){return Reflect.ownKeys(ii(e))},set:function(e,t,n){var r=e8(ii(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var i=Zw(ii(e),t),o=i==null?void 0:i[St];if(o&&o.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(iL(n,i)&&(n!==void 0||Hu(e.t,t)))return!0;Jw(e),_o(e)}return e.o[t]===n&&(n!==void 0||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return Zw(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,Jw(e),_o(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=ii(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){di(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){di(12)}},yg={};ql(Pm,function(e,t){yg[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),yg.deleteProperty=function(e,t){return yg.set.call(this,e,t,void 0)},yg.set=function(e,t,n){return Pm.set.call(this,e[0],t,n,e[0])};var sL=function(){function e(n){var r=this;this.O=r8,this.D=!0,this.produce=function(i,o,a){if(typeof i=="function"&&typeof o!="function"){var s=o;o=i;var l=r;return function(m){var _=this;m===void 0&&(m=s);for(var b=arguments.length,y=Array(b>1?b-1:0),g=1;g<b;g++)y[g-1]=arguments[g];return l.produce(m,function(v){var S;return(S=o).call.apply(S,[_,v].concat(y))})}}var u;if(typeof o!="function"&&di(6),a!==void 0&&typeof a!="function"&&di(7),Po(i)){var c=Z6(r),d=km(r,i,void 0),f=!0;try{u=o(d),f=!1}finally{f?Db(c):F3(c)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(m){return Xw(c,a),Yw(m,c)},function(m){throw Db(c),m}):(Xw(c,a),Yw(u,c))}if(!i||typeof i!="object"){if((u=o(i))===void 0&&(u=i),u===MS&&(u=void 0),r.D&&Q0(u,!0),a){var h=[],p=[];js("Patches").M(i,u,h,p),a(h,p)}return u}di(21,i)},this.produceWithPatches=function(i,o){if(typeof i=="function")return function(u){for(var c=arguments.length,d=Array(c>1?c-1:0),f=1;f<c;f++)d[f-1]=arguments[f];return r.produceWithPatches(u,function(h){return i.apply(void 0,[h].concat(d))})};var a,s,l=r.produce(i,o,function(u,c){a=u,s=c});return typeof Promise<"u"&&l instanceof Promise?l.then(function(u){return[u,a,s]}):[l,a,s]},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 t=e.prototype;return t.createDraft=function(n){Po(n)||di(8),ao(n)&&(n=OS(n));var r=Z6(this),i=km(this,n,void 0);return i[St].C=!0,F3(r),i},t.finishDraft=function(n,r){var i=n&&n[St],o=i.A;return Xw(o,r),Yw(void 0,o)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!r8&&di(20),this.O=n},t.applyPatches=function(n,r){var i;for(i=r.length-1;i>=0;i--){var o=r[i];if(o.path.length===0&&o.op==="replace"){n=o.value;break}}i>-1&&(r=r.slice(i+1));var a=js("Patches").$;return ao(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),Zo=new sL,lL=Zo.produce,Q4=Zo.produceWithPatches.bind(Zo),AY=Zo.setAutoFreeze.bind(Zo),PY=Zo.setUseProxies.bind(Zo),z3=Zo.applyPatches.bind(Zo),IY=Zo.createDraft.bind(Zo),RY=Zo.finishDraft.bind(Zo);const _c=lL,OY=Object.freeze(Object.defineProperty({__proto__:null,Immer:sL,applyPatches:z3,castDraft:wY,castImmutable:CY,createDraft:IY,current:OS,default:_c,enableAllPlugins:xY,enableES5:H4,enableMapSet:oL,enablePatches:W4,finishDraft:RY,freeze:Q0,immerable:ih,isDraft:ao,isDraftable:Po,nothing:MS,original:U4,produce:lL,produceWithPatches:Q4,setAutoFreeze:AY,setUseProxies:PY},Symbol.toStringTag,{value:"Module"}));function Im(e){"@babel/helpers - typeof";return Im=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Im(e)}function MY(e,t){if(Im(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Im(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function NY(e){var t=MY(e,"string");return Im(t)==="symbol"?t:String(t)}function $Y(e,t,n){return t=NY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i8(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function o8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?i8(Object(n),!0).forEach(function(r){$Y(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i8(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ci(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var a8=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),eC=function(){return Math.random().toString(36).substring(7).split("").join(".")},zh={INIT:"@@redux/INIT"+eC(),REPLACE:"@@redux/REPLACE"+eC(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+eC()}};function DY(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function X0(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Ci(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Ci(1));return n(X0)(e,t)}if(typeof e!="function")throw new Error(Ci(2));var i=e,o=t,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function c(){if(l)throw new Error(Ci(3));return o}function d(m){if(typeof m!="function")throw new Error(Ci(4));if(l)throw new Error(Ci(5));var _=!0;return u(),s.push(m),function(){if(_){if(l)throw new Error(Ci(6));_=!1,u();var y=s.indexOf(m);s.splice(y,1),a=null}}}function f(m){if(!DY(m))throw new Error(Ci(7));if(typeof m.type>"u")throw new Error(Ci(8));if(l)throw new Error(Ci(9));try{l=!0,o=i(o,m)}finally{l=!1}for(var _=a=s,b=0;b<_.length;b++){var y=_[b];y()}return m}function h(m){if(typeof m!="function")throw new Error(Ci(10));i=m,f({type:zh.REPLACE})}function p(){var m,_=d;return m={subscribe:function(y){if(typeof y!="object"||y===null)throw new Error(Ci(11));function g(){y.next&&y.next(c())}g();var v=_(g);return{unsubscribe:v}}},m[a8]=function(){return this},m}return f({type:zh.INIT}),r={dispatch:f,subscribe:d,getState:c,replaceReducer:h},r[a8]=p,r}var uL=X0;function LY(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:zh.INIT});if(typeof r>"u")throw new Error(Ci(12));if(typeof n(void 0,{type:zh.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ci(13))})}function pp(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r];typeof e[i]=="function"&&(n[i]=e[i])}var o=Object.keys(n),a;try{LY(n)}catch(s){a=s}return function(l,u){if(l===void 0&&(l={}),a)throw a;for(var c=!1,d={},f=0;f<o.length;f++){var h=o[f],p=n[h],m=l[h],_=p(m,u);if(typeof _>"u")throw u&&u.type,new Error(Ci(14));d[h]=_,c=c||_!==m}return c=c||o.length!==Object.keys(l).length,c?d:l}}function s8(e,t){return function(){return t(e.apply(this,arguments))}}function cL(e,t){if(typeof e=="function")return s8(e,t);if(typeof e!="object"||e===null)throw new Error(Ci(16));var n={};for(var r in e){var i=e[r];typeof i=="function"&&(n[r]=s8(i,t))}return n}function jh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length===0?function(r){return r}:t.length===1?t[0]:t.reduce(function(r,i){return function(){return r(i.apply(void 0,arguments))}})}function X4(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return function(){var i=r.apply(void 0,arguments),o=function(){throw new Error(Ci(15))},a={getState:i.getState,dispatch:function(){return o.apply(void 0,arguments)}},s=t.map(function(l){return l(a)});return o=jh.apply(void 0,s)(i.dispatch),o8(o8({},i),{},{dispatch:o})}}}const FY=Object.freeze(Object.defineProperty({__proto__:null,__DO_NOT_USE__ActionTypes:zh,applyMiddleware:X4,bindActionCreators:cL,combineReducers:pp,compose:jh,createStore:X0,legacy_createStore:uL},Symbol.toStringTag,{value:"Module"}));var Bb="NOT_FOUND";function BY(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:Bb},put:function(r,i){t={key:r,value:i}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function zY(e,t){var n=[];function r(s){var l=n.findIndex(function(c){return t(s,c.key)});if(l>-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return Bb}function i(s,l){r(s)===Bb&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function o(){return n}function a(){n=[]}return{get:r,put:i,getEntries:o,clear:a}}var dL=function(t,n){return t===n};function jY(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var i=n.length,o=0;o<i;o++)if(!e(n[o],r[o]))return!1;return!0}}function zb(e,t){var n=typeof t=="object"?t:{equalityCheck:t},r=n.equalityCheck,i=r===void 0?dL:r,o=n.maxSize,a=o===void 0?1:o,s=n.resultEqualityCheck,l=jY(i),u=a===1?BY(l):zY(a,l);function c(){var d=u.get(arguments);if(d===Bb){if(d=e.apply(null,arguments),s){var f=u.getEntries(),h=f.find(function(p){return s(p.value,d)});h&&(d=h.value)}u.put(arguments,d)}return d}return c.clearCache=function(){return u.clear()},c}function UY(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(r){return typeof r=="function"})){var n=t.map(function(r){return typeof r=="function"?"function "+(r.name||"unnamed")+"()":typeof r}).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function fL(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var u=0,c,d={memoizeOptions:void 0},f=s.pop();if(typeof f=="object"&&(d=f,f=s.pop()),typeof f!="function")throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof f+"]");var h=d,p=h.memoizeOptions,m=p===void 0?n:p,_=Array.isArray(m)?m:[m],b=UY(s),y=e.apply(void 0,[function(){return u++,f.apply(null,arguments)}].concat(_)),g=e(function(){for(var S=[],w=b.length,x=0;x<w;x++)S.push(b[x].apply(null,arguments));return c=y.apply(null,S),c});return Object.assign(g,{resultFunc:f,memoizedResultFunc:y,dependencies:b,lastResult:function(){return c},recomputations:function(){return u},resetRecomputations:function(){return u=0}}),g};return i}var Ii=fL(zb),VY=function(t,n){if(n===void 0&&(n=Ii),typeof t!="object")throw new Error("createStructuredSelector expects first argument to be an object "+("where each property is a selector, instead received a "+typeof t));var r=Object.keys(t),i=n(r.map(function(o){return t[o]}),function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];return a.reduce(function(l,u,c){return l[r[c]]=u,l},{})});return i};const GY=Object.freeze(Object.defineProperty({__proto__:null,createSelector:Ii,createSelectorCreator:fL,createStructuredSelector:VY,defaultEqualityCheck:dL,defaultMemoize:zb},Symbol.toStringTag,{value:"Module"}));function hL(e){var t=function(r){var i=r.dispatch,o=r.getState;return function(a){return function(s){return typeof s=="function"?s(i,o,e):a(s)}}};return t}var pL=hL();pL.withExtraArgument=hL;const l8=pL;var gL=globalThis&&globalThis.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Y0=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},rc=globalThis&&globalThis.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},qY=Object.defineProperty,HY=Object.defineProperties,WY=Object.getOwnPropertyDescriptors,u8=Object.getOwnPropertySymbols,KY=Object.prototype.hasOwnProperty,QY=Object.prototype.propertyIsEnumerable,c8=function(e,t,n){return t in e?qY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},wo=function(e,t){for(var n in t||(t={}))KY.call(t,n)&&c8(e,n,t[n]);if(u8)for(var r=0,i=u8(t);r<i.length;r++){var n=i[r];QY.call(t,n)&&c8(e,n,t[n])}return e},tC=function(e,t){return HY(e,WY(t))},Z0=function(e,t,n){return new Promise(function(r,i){var o=function(l){try{s(n.next(l))}catch(u){i(u)}},a=function(l){try{s(n.throw(l))}catch(u){i(u)}},s=function(l){return l.done?r(l.value):Promise.resolve(l.value).then(o,a)};s((n=n.apply(e,t)).next())})},pl=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Ii.apply(void 0,e),r=function(i){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return n.apply(void 0,rc([ao(i)?OS(i):i],o))};return r},XY=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?jh:jh.apply(null,arguments)};function ss(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var n=t;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return t===n}var mL=function(e){gL(t,e);function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.prototype.concat.apply(this,n)},t.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(t.bind.apply(t,rc([void 0],n[0].concat(this)))):new(t.bind.apply(t,rc([void 0],n.concat(this))))},t}(Array),yL=function(e){gL(t,e);function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=e.apply(this,n)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.prototype.concat.apply(this,n)},t.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(t.bind.apply(t,rc([void 0],n[0].concat(this)))):new(t.bind.apply(t,rc([void 0],n.concat(this))))},t}(Array);function j3(e){return Po(e)?_c(e,function(){}):e}function YY(e){return typeof e!="object"||e==null||Object.isFrozen(e)}function ZY(e){return function(){return function(t){return function(n){return t(n)}}}}function vL(e){var t=typeof e;return e==null||t==="string"||t==="boolean"||t==="number"||Array.isArray(e)||ss(e)}function bL(e,t,n,r,i,o){t===void 0&&(t=""),n===void 0&&(n=vL),i===void 0&&(i=[]);var a;if(!n(e))return{keyPath:t||"<root>",value:e};if(typeof e!="object"||e===null||o!=null&&o.has(e))return!1;for(var s=r!=null?r(e):Object.entries(e),l=i.length>0,u=function(_,b){var y=t?t+"."+_:_;if(l){var g=i.some(function(v){return v instanceof RegExp?v.test(y):y===v});if(g)return"continue"}if(!n(b))return{value:{keyPath:y,value:b}};if(typeof b=="object"&&(a=bL(b,y,n,r,i,o),a))return{value:a}},c=0,d=s;c<d.length;c++){var f=d[c],h=f[0],p=f[1],m=u(h,p);if(typeof m=="object")return m.value}return o&&_L(e)&&o.add(e),!1}function _L(e){if(!Object.isFrozen(e))return!1;for(var t=0,n=Object.values(e);t<n.length;t++){var r=n[t];if(!(typeof r!="object"||r===null)&&!_L(r))return!1}return!0}function JY(e){return function(){return function(t){return function(n){return t(n)}}}}function eZ(e){return typeof e=="boolean"}function tZ(){return function(t){return SL(t)}}function SL(e){e===void 0&&(e={});var t=e.thunk,n=t===void 0?!0:t;e.immutableCheck,e.serializableCheck;var r=new mL;return n&&(eZ(n)?r.push(l8):r.push(l8.withExtraArgument(n.extraArgument))),r}var nZ=!0;function xL(e){var t=tZ(),n=e||{},r=n.reducer,i=r===void 0?void 0:r,o=n.middleware,a=o===void 0?t():o,s=n.devTools,l=s===void 0?!0:s,u=n.preloadedState,c=u===void 0?void 0:u,d=n.enhancers,f=d===void 0?void 0:d,h;if(typeof i=="function")h=i;else if(ss(i))h=pp(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 p=a;typeof p=="function"&&(p=p(t));var m=X4.apply(void 0,p),_=jh;l&&(_=XY(wo({trace:!nZ},typeof l=="object"&&l)));var b=new yL(m),y=b;Array.isArray(f)?y=rc([m],f):typeof f=="function"&&(y=f(b));var g=_.apply(void 0,y);return X0(h,c,g)}function Ne(e,t){function n(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(t){var o=t.apply(void 0,r);if(!o)throw new Error("prepareAction did not return an object");return wo(wo({type:e,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:e,payload:r[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(r){return r.type===e},n}function Y4(e){return ss(e)&&"type"in e}function wL(e){return Y4(e)&&typeof e.type=="string"&&Object.keys(e).every(rZ)}function rZ(e){return["type","payload","error","meta"].indexOf(e)>-1}function iZ(e){return""+e}function CL(e){var t={},n=[],r,i={addCase:function(o,a){var s=typeof o=="string"?o:o.type;if(s in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[s]=a,i},addMatcher:function(o,a){return n.push({matcher:o,reducer:a}),i},addDefaultCase:function(o){return r=o,i}};return e(i),[t,n,r]}function oZ(e){return typeof e=="function"}function EL(e,t,n,r){n===void 0&&(n=[]);var i=typeof t=="function"?CL(t):[t,n,r],o=i[0],a=i[1],s=i[2],l;if(oZ(e))l=function(){return j3(e())};else{var u=j3(e);l=function(){return u}}function c(d,f){d===void 0&&(d=l());var h=rc([o[f.type]],a.filter(function(p){var m=p.matcher;return m(f)}).map(function(p){var m=p.reducer;return m}));return h.filter(function(p){return!!p}).length===0&&(h=[s]),h.reduce(function(p,m){if(m)if(ao(p)){var _=p,b=m(_,f);return b===void 0?p:b}else{if(Po(p))return _c(p,function(y){return m(y,f)});var b=m(p,f);if(b===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return b}return p},d)}return c.getInitialState=l,c}function aZ(e,t){return e+"/"+t}function rr(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");typeof process<"u";var n=typeof e.initialState=="function"?e.initialState:j3(e.initialState),r=e.reducers||{},i=Object.keys(r),o={},a={},s={};i.forEach(function(c){var d=r[c],f=aZ(t,c),h,p;"reducer"in d?(h=d.reducer,p=d.prepare):h=d,o[c]=h,a[f]=h,s[c]=p?Ne(f,p):Ne(f)});function l(){var c=typeof e.extraReducers=="function"?CL(e.extraReducers):[e.extraReducers],d=c[0],f=d===void 0?{}:d,h=c[1],p=h===void 0?[]:h,m=c[2],_=m===void 0?void 0:m,b=wo(wo({},f),a);return EL(n,function(y){for(var g in b)y.addCase(g,b[g]);for(var v=0,S=p;v<S.length;v++){var w=S[v];y.addMatcher(w.matcher,w.reducer)}_&&y.addDefaultCase(_)})}var u;return{name:t,reducer:function(c,d){return u||(u=l()),u(c,d)},actions:s,caseReducers:o,getInitialState:function(){return u||(u=l()),u.getInitialState()}}}function sZ(){return{ids:[],entities:{}}}function lZ(){function e(t){return t===void 0&&(t={}),Object.assign(sZ(),t)}return{getInitialState:e}}function uZ(){function e(t){var n=function(u){return u.ids},r=function(u){return u.entities},i=pl(n,r,function(u,c){return u.map(function(d){return c[d]})}),o=function(u,c){return c},a=function(u,c){return u[c]},s=pl(n,function(u){return u.length});if(!t)return{selectIds:n,selectEntities:r,selectAll:i,selectTotal:s,selectById:pl(r,o,a)};var l=pl(t,r);return{selectIds:pl(t,n),selectEntities:l,selectAll:pl(t,i),selectTotal:pl(t,s),selectById:pl(l,o,a)}}return{getSelectors:e}}function cZ(e){var t=wr(function(n,r){return e(r)});return function(r){return t(r,void 0)}}function wr(e){return function(n,r){function i(a){return wL(a)}var o=function(a){i(r)?e(r.payload,a):e(r,a)};return ao(n)?(o(n),n):_c(n,o)}}function Ug(e,t){var n=t(e);return n}function hd(e){return Array.isArray(e)||(e=Object.values(e)),e}function TL(e,t,n){e=hd(e);for(var r=[],i=[],o=0,a=e;o<a.length;o++){var s=a[o],l=Ug(s,t);l in n.entities?i.push({id:l,changes:s}):r.push(s)}return[r,i]}function kL(e){function t(p,m){var _=Ug(p,e);_ in m.entities||(m.ids.push(_),m.entities[_]=p)}function n(p,m){p=hd(p);for(var _=0,b=p;_<b.length;_++){var y=b[_];t(y,m)}}function r(p,m){var _=Ug(p,e);_ in m.entities||m.ids.push(_),m.entities[_]=p}function i(p,m){p=hd(p);for(var _=0,b=p;_<b.length;_++){var y=b[_];r(y,m)}}function o(p,m){p=hd(p),m.ids=[],m.entities={},n(p,m)}function a(p,m){return s([p],m)}function s(p,m){var _=!1;p.forEach(function(b){b in m.entities&&(delete m.entities[b],_=!0)}),_&&(m.ids=m.ids.filter(function(b){return b in m.entities}))}function l(p){Object.assign(p,{ids:[],entities:{}})}function u(p,m,_){var b=_.entities[m.id],y=Object.assign({},b,m.changes),g=Ug(y,e),v=g!==m.id;return v&&(p[m.id]=g,delete _.entities[m.id]),_.entities[g]=y,v}function c(p,m){return d([p],m)}function d(p,m){var _={},b={};p.forEach(function(v){v.id in m.entities&&(b[v.id]={id:v.id,changes:wo(wo({},b[v.id]?b[v.id].changes:null),v.changes)})}),p=Object.values(b);var y=p.length>0;if(y){var g=p.filter(function(v){return u(_,v,m)}).length>0;g&&(m.ids=Object.keys(m.entities))}}function f(p,m){return h([p],m)}function h(p,m){var _=TL(p,e,m),b=_[0],y=_[1];d(y,m),n(b,m)}return{removeAll:cZ(l),addOne:wr(t),addMany:wr(n),setOne:wr(r),setMany:wr(i),setAll:wr(o),updateOne:wr(c),updateMany:wr(d),upsertOne:wr(f),upsertMany:wr(h),removeOne:wr(a),removeMany:wr(s)}}function dZ(e,t){var n=kL(e),r=n.removeOne,i=n.removeMany,o=n.removeAll;function a(y,g){return s([y],g)}function s(y,g){y=hd(y);var v=y.filter(function(S){return!(Ug(S,e)in g.entities)});v.length!==0&&_(v,g)}function l(y,g){return u([y],g)}function u(y,g){y=hd(y),y.length!==0&&_(y,g)}function c(y,g){y=hd(y),g.entities={},g.ids=[],s(y,g)}function d(y,g){return f([y],g)}function f(y,g){for(var v=!1,S=0,w=y;S<w.length;S++){var x=w[S],C=g.entities[x.id];if(C){v=!0,Object.assign(C,x.changes);var k=e(C);x.id!==k&&(delete g.entities[x.id],g.entities[k]=C)}}v&&b(g)}function h(y,g){return p([y],g)}function p(y,g){var v=TL(y,e,g),S=v[0],w=v[1];f(w,g),s(S,g)}function m(y,g){if(y.length!==g.length)return!1;for(var v=0;v<y.length&&v<g.length;v++)if(y[v]!==g[v])return!1;return!0}function _(y,g){y.forEach(function(v){g.entities[e(v)]=v}),b(g)}function b(y){var g=Object.values(y.entities);g.sort(t);var v=g.map(e),S=y.ids;m(S,v)||(y.ids=v)}return{removeOne:r,removeMany:i,removeAll:o,addOne:wr(a),updateOne:wr(d),upsertOne:wr(h),setOne:wr(l),setMany:wr(u),setAll:wr(c),addMany:wr(s),updateMany:wr(f),upsertMany:wr(p)}}function ds(e){e===void 0&&(e={});var t=wo({sortComparer:!1,selectId:function(s){return s.id}},e),n=t.selectId,r=t.sortComparer,i=lZ(),o=uZ(),a=r?dZ(n,r):kL(n);return wo(wo(wo({selectId:n,sortComparer:r},i),o),a)}var fZ="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",NS=function(e){e===void 0&&(e=21);for(var t="",n=e;n--;)t+=fZ[Math.random()*64|0];return t},hZ=["name","message","stack","code"],nC=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),d8=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),AL=function(e){if(typeof e=="object"&&e!==null){for(var t={},n=0,r=hZ;n<r.length;n++){var i=r[n];typeof e[i]=="string"&&(t[i]=e[i])}return t}return{message:String(e)}},jb=function(){function e(t,n,r){var i=Ne(t+"/fulfilled",function(u,c,d,f){return{payload:u,meta:tC(wo({},f||{}),{arg:d,requestId:c,requestStatus:"fulfilled"})}}),o=Ne(t+"/pending",function(u,c,d){return{payload:void 0,meta:tC(wo({},d||{}),{arg:c,requestId:u,requestStatus:"pending"})}}),a=Ne(t+"/rejected",function(u,c,d,f,h){return{payload:f,error:(r&&r.serializeError||AL)(u||"Rejected"),meta:tC(wo({},h||{}),{arg:d,requestId:c,rejectedWithValue:!!f,requestStatus:"rejected",aborted:(u==null?void 0:u.name)==="AbortError",condition:(u==null?void 0:u.name)==="ConditionError"})}}),s=typeof AbortController<"u"?AbortController:function(){function u(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return u.prototype.abort=function(){},u}();function l(u){return function(c,d,f){var h=r!=null&&r.idGenerator?r.idGenerator(u):NS(),p=new s,m;function _(y){m=y,p.abort()}var b=function(){return Z0(this,null,function(){var y,g,v,S,w,x,C;return Y0(this,function(k){switch(k.label){case 0:return k.trys.push([0,4,,5]),S=(y=r==null?void 0:r.condition)==null?void 0:y.call(r,u,{getState:d,extra:f}),pZ(S)?[4,S]:[3,2];case 1:S=k.sent(),k.label=2;case 2:if(S===!1||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return w=new Promise(function(T,P){return p.signal.addEventListener("abort",function(){return P({name:"AbortError",message:m||"Aborted"})})}),c(o(h,u,(g=r==null?void 0:r.getPendingMeta)==null?void 0:g.call(r,{requestId:h,arg:u},{getState:d,extra:f}))),[4,Promise.race([w,Promise.resolve(n(u,{dispatch:c,getState:d,extra:f,requestId:h,signal:p.signal,abort:_,rejectWithValue:function(T,P){return new nC(T,P)},fulfillWithValue:function(T,P){return new d8(T,P)}})).then(function(T){if(T instanceof nC)throw T;return T instanceof d8?i(T.payload,h,u,T.meta):i(T,h,u)})])];case 3:return v=k.sent(),[3,5];case 4:return x=k.sent(),v=x instanceof nC?a(null,h,u,x.payload,x.meta):a(x,h,u),[3,5];case 5:return C=r&&!r.dispatchConditionRejection&&a.match(v)&&v.meta.condition,C||c(v),[2,v]}})})}();return Object.assign(b,{abort:_,requestId:h,arg:u,unwrap:function(){return b.then(PL)}})}}return Object.assign(l,{pending:o,rejected:a,fulfilled:i,typePrefix:t})}return e.withTypes=function(){return e},e}();function PL(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function pZ(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var gZ=function(e){return e&&typeof e.match=="function"},IL=function(e,t){return gZ(e)?e.match(t):e(t)};function $o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return e.some(function(r){return IL(r,n)})}}function ah(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(n){return e.every(function(r){return IL(r,n)})}}function $S(e,t){if(!e||!e.meta)return!1;var n=typeof e.meta.requestId=="string",r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function J0(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function DS(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return $S(n,["pending"])}:J0(e)?function(n){var r=e.map(function(o){return o.pending}),i=$o.apply(void 0,r);return i(n)}:DS()(e[0])}function Uh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return $S(n,["rejected"])}:J0(e)?function(n){var r=e.map(function(o){return o.rejected}),i=$o.apply(void 0,r);return i(n)}:Uh()(e[0])}function ey(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(r){return r&&r.meta&&r.meta.rejectedWithValue};return e.length===0?function(r){var i=ah(Uh.apply(void 0,e),n);return i(r)}:J0(e)?function(r){var i=ah(Uh.apply(void 0,e),n);return i(r)}:ey()(e[0])}function Sc(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return $S(n,["fulfilled"])}:J0(e)?function(n){var r=e.map(function(o){return o.fulfilled}),i=$o.apply(void 0,r);return i(n)}:Sc()(e[0])}function Ub(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.length===0?function(n){return $S(n,["pending","fulfilled","rejected"])}:J0(e)?function(n){for(var r=[],i=0,o=e;i<o.length;i++){var a=o[i];r.push(a.pending,a.rejected,a.fulfilled)}var s=$o.apply(void 0,r);return s(n)}:Ub()(e[0])}var Z4=function(e,t){if(typeof e!="function")throw new TypeError(t+" is not a function")},U3=function(){},RL=function(e,t){return t===void 0&&(t=U3),e.catch(t),e},OL=function(e,t){return e.addEventListener("abort",t,{once:!0}),function(){return e.removeEventListener("abort",t)}},sh=function(e,t){var n=e.signal;n.aborted||("reason"in n||Object.defineProperty(n,"reason",{enumerable:!0,value:t,configurable:!0,writable:!0}),e.abort(t))},mZ="task",ML="listener",NL="completed",J4="cancelled",yZ="task-"+J4,vZ="task-"+NL,$L=ML+"-"+J4,bZ=ML+"-"+NL,ty=function(){function e(t){this.code=t,this.name="TaskAbortError",this.message=mZ+" "+J4+" (reason: "+t+")"}return e}(),lh=function(e){if(e.aborted)throw new ty(e.reason)};function DL(e,t){var n=U3;return new Promise(function(r,i){var o=function(){return i(new ty(e.reason))};if(e.aborted){o();return}n=OL(e,o),t.finally(function(){return n()}).then(r,i)}).finally(function(){n=U3})}var _Z=function(e,t){return Z0(void 0,null,function(){var n,r;return Y0(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,4,5]),[4,Promise.resolve()];case 1:return i.sent(),[4,e()];case 2:return n=i.sent(),[2,{status:"ok",value:n}];case 3:return r=i.sent(),[2,{status:r instanceof ty?"cancelled":"rejected",error:r}];case 4:return t==null||t(),[7];case 5:return[2]}})})},Vb=function(e){return function(t){return RL(DL(e,t).then(function(n){return lh(e),n}))}},LL=function(e){var t=Vb(e);return function(n){return t(new Promise(function(r){return setTimeout(r,n)}))}},SZ=Object.assign,f8={},ny="listenerMiddleware",xZ=function(e){var t=function(n){return OL(e,function(){return sh(n,e.reason)})};return function(n){Z4(n,"taskExecutor");var r=new AbortController;t(r);var i=_Z(function(){return Z0(void 0,null,function(){var o;return Y0(this,function(a){switch(a.label){case 0:return lh(e),lh(r.signal),[4,n({pause:Vb(r.signal),delay:LL(r.signal),signal:r.signal})];case 1:return o=a.sent(),lh(r.signal),[2,o]}})})},function(){return sh(r,vZ)});return{result:Vb(e)(i),cancel:function(){sh(r,yZ)}}}},wZ=function(e,t){var n=function(r,i){return Z0(void 0,null,function(){var o,a,s,l;return Y0(this,function(u){switch(u.label){case 0:lh(t),o=function(){},a=new Promise(function(c,d){var f=e({predicate:r,effect:function(h,p){p.unsubscribe(),c([h,p.getState(),p.getOriginalState()])}});o=function(){f(),d()}}),s=[a],i!=null&&s.push(new Promise(function(c){return setTimeout(c,i,null)})),u.label=1;case 1:return u.trys.push([1,,3,4]),[4,DL(t,Promise.race(s))];case 2:return l=u.sent(),lh(t),[2,l];case 3:return o(),[7];case 4:return[2]}})})};return function(r,i){return RL(n(r,i))}},FL=function(e){var t=e.type,n=e.actionCreator,r=e.matcher,i=e.predicate,o=e.effect;if(t)i=Ne(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error("Creating or removing a listener requires one of the known fields for matching an action");return Z4(o,"options.listener"),{predicate:i,type:t,effect:o}},CZ=function(e){var t=FL(e),n=t.type,r=t.predicate,i=t.effect,o=NS(),a={id:o,effect:i,type:n,predicate:r,pending:new Set,unsubscribe:function(){throw new Error("Unsubscribe not initialized")}};return a},V3=function(e){e.pending.forEach(function(t){sh(t,$L)})},EZ=function(e){return function(){e.forEach(V3),e.clear()}},h8=function(e,t,n){try{e(t,n)}catch(r){setTimeout(function(){throw r},0)}},BL=Ne(ny+"/add"),zL=Ne(ny+"/removeAll"),jL=Ne(ny+"/remove"),TZ=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];console.error.apply(console,rc([ny+"/error"],e))};function UL(e){var t=this;e===void 0&&(e={});var n=new Map,r=e.extra,i=e.onError,o=i===void 0?TZ:i;Z4(o,"onError");var a=function(h){return h.unsubscribe=function(){return n.delete(h.id)},n.set(h.id,h),function(p){h.unsubscribe(),p!=null&&p.cancelActive&&V3(h)}},s=function(h){for(var p=0,m=Array.from(n.values());p<m.length;p++){var _=m[p];if(h(_))return _}},l=function(h){var p=s(function(m){return m.effect===h.effect});return p||(p=CZ(h)),a(p)},u=function(h){var p=FL(h),m=p.type,_=p.effect,b=p.predicate,y=s(function(g){var v=typeof m=="string"?g.type===m:g.predicate===b;return v&&g.effect===_});return y&&(y.unsubscribe(),h.cancelActive&&V3(y)),!!y},c=function(h,p,m,_){return Z0(t,null,function(){var b,y,g;return Y0(this,function(v){switch(v.label){case 0:b=new AbortController,y=wZ(l,b.signal),v.label=1;case 1:return v.trys.push([1,3,4,5]),h.pending.add(b),[4,Promise.resolve(h.effect(p,SZ({},m,{getOriginalState:_,condition:function(S,w){return y(S,w).then(Boolean)},take:y,delay:LL(b.signal),pause:Vb(b.signal),extra:r,signal:b.signal,fork:xZ(b.signal),unsubscribe:h.unsubscribe,subscribe:function(){n.set(h.id,h)},cancelActiveListeners:function(){h.pending.forEach(function(S,w,x){S!==b&&(sh(S,$L),x.delete(S))})}})))];case 2:return v.sent(),[3,5];case 3:return g=v.sent(),g instanceof ty||h8(o,g,{raisedBy:"effect"}),[3,5];case 4:return sh(b,bZ),h.pending.delete(b),[7];case 5:return[2]}})})},d=EZ(n),f=function(h){return function(p){return function(m){if(!Y4(m))return p(m);if(BL.match(m))return l(m.payload);if(zL.match(m)){d();return}if(jL.match(m))return u(m.payload);var _=h.getState(),b=function(){if(_===f8)throw new Error(ny+": getOriginalState can only be called synchronously");return _},y;try{if(y=p(m),n.size>0)for(var g=h.getState(),v=Array.from(n.values()),S=0,w=v;S<w.length;S++){var x=w[S],C=!1;try{C=x.predicate(m,g,_)}catch(k){C=!1,h8(o,k,{raisedBy:"predicate"})}C&&c(x,m,h,b)}}finally{_=f8}return y}}};return{middleware:f,startListening:l,stopListening:u,clearListeners:d}}var td="RTK_autoBatch",O1=function(){return function(e){var t;return{payload:e,meta:(t={},t[td]=!0,t)}}},p8,kZ=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(p8||(p8=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},VL=function(e){return function(t){setTimeout(t,e)}},AZ=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:VL(10),GL=function(e){return e===void 0&&(e={type:"raf"}),function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=t.apply(void 0,n),o=!0,a=!1,s=!1,l=new Set,u=e.type==="tick"?kZ:e.type==="raf"?AZ:e.type==="callback"?e.queueNotification:VL(e.timeout),c=function(){s=!1,a&&(a=!1,l.forEach(function(d){return d()}))};return Object.assign({},i,{subscribe:function(d){var f=function(){return o&&d()},h=i.subscribe(f);return l.add(d),function(){h(),l.delete(d)}},dispatch:function(d){var f;try{return o=!((f=d==null?void 0:d.meta)!=null&&f[td]),a=!o,a&&(s||(s=!0,u(c))),i.dispatch(d)}finally{o=!0}}})}}};H4();const PZ=Object.freeze(Object.defineProperty({__proto__:null,EnhancerArray:yL,MiddlewareArray:mL,SHOULD_AUTOBATCH:td,TaskAbortError:ty,__DO_NOT_USE__ActionTypes:zh,addListener:BL,applyMiddleware:X4,autoBatchEnhancer:GL,bindActionCreators:cL,clearAllListeners:zL,combineReducers:pp,compose:jh,configureStore:xL,createAction:Ne,createAsyncThunk:jb,createDraftSafeSelector:pl,createEntityAdapter:ds,createImmutableStateInvariantMiddleware:ZY,createListenerMiddleware:UL,createNextState:_c,createReducer:EL,createSelector:Ii,createSerializableStateInvariantMiddleware:JY,createSlice:rr,createStore:X0,current:OS,findNonSerializableValue:bL,freeze:Q0,getDefaultMiddleware:SL,getType:iZ,isAction:Y4,isAllOf:ah,isAnyOf:$o,isAsyncThunkAction:Ub,isDraft:ao,isFluxStandardAction:wL,isFulfilled:Sc,isImmutableDefault:YY,isPending:DS,isPlain:vL,isPlainObject:ss,isRejected:Uh,isRejectedWithValue:ey,legacy_createStore:uL,miniSerializeError:AL,nanoid:NS,original:U4,prepareAutoBatched:O1,removeListener:jL,unwrapResult:PL},Symbol.toStringTag,{value:"Module"})),lv=(e,t)=>Math.floor(e/t)*t,Wa=(e,t)=>Math.round(e/t)*t;var IZ=typeof global=="object"&&global&&global.Object===Object&&global;const qL=IZ;var RZ=typeof self=="object"&&self&&self.Object===Object&&self,OZ=qL||RZ||Function("return this")();const tl=OZ;var MZ=tl.Symbol;const Ca=MZ;var HL=Object.prototype,NZ=HL.hasOwnProperty,$Z=HL.toString,Vp=Ca?Ca.toStringTag:void 0;function DZ(e){var t=NZ.call(e,Vp),n=e[Vp];try{e[Vp]=void 0;var r=!0}catch{}var i=$Z.call(e);return r&&(t?e[Vp]=n:delete e[Vp]),i}var LZ=Object.prototype,FZ=LZ.toString;function BZ(e){return FZ.call(e)}var zZ="[object Null]",jZ="[object Undefined]",g8=Ca?Ca.toStringTag:void 0;function fs(e){return e==null?e===void 0?jZ:zZ:g8&&g8 in Object(e)?DZ(e):BZ(e)}function Io(e){return e!=null&&typeof e=="object"}var UZ="[object Symbol]";function LS(e){return typeof e=="symbol"||Io(e)&&fs(e)==UZ}function WL(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var VZ=Array.isArray;const Yr=VZ;var GZ=1/0,m8=Ca?Ca.prototype:void 0,y8=m8?m8.toString:void 0;function Gb(e){if(typeof e=="string")return e;if(Yr(e))return WL(e,Gb)+"";if(LS(e))return y8?y8.call(e):"";var t=e+"";return t=="0"&&1/e==-GZ?"-0":t}var qZ=/\s/;function HZ(e){for(var t=e.length;t--&&qZ.test(e.charAt(t)););return t}var WZ=/^\s+/;function KZ(e){return e&&e.slice(0,HZ(e)+1).replace(WZ,"")}function Ro(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var v8=0/0,QZ=/^[-+]0x[0-9a-f]+$/i,XZ=/^0b[01]+$/i,YZ=/^0o[0-7]+$/i,ZZ=parseInt;function M1(e){if(typeof e=="number")return e;if(LS(e))return v8;if(Ro(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ro(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=KZ(e);var n=XZ.test(e);return n||YZ.test(e)?ZZ(e.slice(2),n?2:8):QZ.test(e)?v8:+e}var b8=1/0,JZ=17976931348623157e292;function uh(e){if(!e)return e===0?e:0;if(e=M1(e),e===b8||e===-b8){var t=e<0?-1:1;return t*JZ}return e===e?e:0}function KL(e){var t=uh(e),n=t%1;return t===t?n?t-n:t:0}function FS(e){return e}var eJ="[object AsyncFunction]",tJ="[object Function]",nJ="[object GeneratorFunction]",rJ="[object Proxy]";function ek(e){if(!Ro(e))return!1;var t=fs(e);return t==tJ||t==nJ||t==eJ||t==rJ}var iJ=tl["__core-js_shared__"];const rC=iJ;var _8=function(){var e=/[^.]+$/.exec(rC&&rC.keys&&rC.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function oJ(e){return!!_8&&_8 in e}var aJ=Function.prototype,sJ=aJ.toString;function jd(e){if(e!=null){try{return sJ.call(e)}catch{}try{return e+""}catch{}}return""}var lJ=/[\\^$.*+?()[\]{}|]/g,uJ=/^\[object .+?Constructor\]$/,cJ=Function.prototype,dJ=Object.prototype,fJ=cJ.toString,hJ=dJ.hasOwnProperty,pJ=RegExp("^"+fJ.call(hJ).replace(lJ,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function gJ(e){if(!Ro(e)||oJ(e))return!1;var t=ek(e)?pJ:uJ;return t.test(jd(e))}function mJ(e,t){return e==null?void 0:e[t]}function Ud(e,t){var n=mJ(e,t);return gJ(n)?n:void 0}var yJ=Ud(tl,"WeakMap");const G3=yJ;var S8=Object.create,vJ=function(){function e(){}return function(t){if(!Ro(t))return{};if(S8)return S8(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();const bJ=vJ;function QL(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function _J(){}function XL(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var SJ=800,xJ=16,wJ=Date.now;function CJ(e){var t=0,n=0;return function(){var r=wJ(),i=xJ-(r-n);if(n=r,i>0){if(++t>=SJ)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function EJ(e){return function(){return e}}var TJ=function(){try{var e=Ud(Object,"defineProperty");return e({},"",{}),e}catch{}}();const qb=TJ;var kJ=qb?function(e,t){return qb(e,"toString",{configurable:!0,enumerable:!1,value:EJ(t),writable:!0})}:FS;const AJ=kJ;var PJ=CJ(AJ);const YL=PJ;function ZL(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function IJ(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function RJ(e){return e!==e}function OJ(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function MJ(e,t,n){return t===t?OJ(e,t,n):IJ(e,RJ,n)}function NJ(e,t){var n=e==null?0:e.length;return!!n&&MJ(e,t,0)>-1}var $J=9007199254740991,DJ=/^(?:0|[1-9]\d*)$/;function tk(e,t){var n=typeof e;return t=t??$J,!!t&&(n=="number"||n!="symbol"&&DJ.test(e))&&e>-1&&e%1==0&&e<t}function BS(e,t,n){t=="__proto__"&&qb?qb(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ry(e,t){return e===t||e!==e&&t!==t}var LJ=Object.prototype,FJ=LJ.hasOwnProperty;function JL(e,t,n){var r=e[t];(!(FJ.call(e,t)&&ry(r,n))||n===void 0&&!(t in e))&&BS(e,t,n)}function gp(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=r?r(n[s],e[s],s,n,e):void 0;l===void 0&&(l=e[s]),i?BS(n,s,l):JL(n,s,l)}return n}var x8=Math.max;function eF(e,t,n){return t=x8(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=x8(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),QL(e,this,s)}}function tF(e,t){return YL(eF(e,t,FS),e+"")}var BJ=9007199254740991;function nk(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=BJ}function mp(e){return e!=null&&nk(e.length)&&!ek(e)}function zS(e,t,n){if(!Ro(n))return!1;var r=typeof t;return(r=="number"?mp(n)&&tk(t,n.length):r=="string"&&t in n)?ry(n[t],e):!1}function nF(e){return tF(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&zS(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,o)}return t})}var zJ=Object.prototype;function rk(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||zJ;return e===n}function jJ(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var UJ="[object Arguments]";function w8(e){return Io(e)&&fs(e)==UJ}var rF=Object.prototype,VJ=rF.hasOwnProperty,GJ=rF.propertyIsEnumerable,qJ=w8(function(){return arguments}())?w8:function(e){return Io(e)&&VJ.call(e,"callee")&&!GJ.call(e,"callee")};const Rm=qJ;function HJ(){return!1}var iF=typeof exports=="object"&&exports&&!exports.nodeType&&exports,C8=iF&&typeof module=="object"&&module&&!module.nodeType&&module,WJ=C8&&C8.exports===iF,E8=WJ?tl.Buffer:void 0,KJ=E8?E8.isBuffer:void 0,QJ=KJ||HJ;const Om=QJ;var XJ="[object Arguments]",YJ="[object Array]",ZJ="[object Boolean]",JJ="[object Date]",eee="[object Error]",tee="[object Function]",nee="[object Map]",ree="[object Number]",iee="[object Object]",oee="[object RegExp]",aee="[object Set]",see="[object String]",lee="[object WeakMap]",uee="[object ArrayBuffer]",cee="[object DataView]",dee="[object Float32Array]",fee="[object Float64Array]",hee="[object Int8Array]",pee="[object Int16Array]",gee="[object Int32Array]",mee="[object Uint8Array]",yee="[object Uint8ClampedArray]",vee="[object Uint16Array]",bee="[object Uint32Array]",qn={};qn[dee]=qn[fee]=qn[hee]=qn[pee]=qn[gee]=qn[mee]=qn[yee]=qn[vee]=qn[bee]=!0;qn[XJ]=qn[YJ]=qn[uee]=qn[ZJ]=qn[cee]=qn[JJ]=qn[eee]=qn[tee]=qn[nee]=qn[ree]=qn[iee]=qn[oee]=qn[aee]=qn[see]=qn[lee]=!1;function _ee(e){return Io(e)&&nk(e.length)&&!!qn[fs(e)]}function jS(e){return function(t){return e(t)}}var oF=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Vg=oF&&typeof module=="object"&&module&&!module.nodeType&&module,See=Vg&&Vg.exports===oF,iC=See&&qL.process,xee=function(){try{var e=Vg&&Vg.require&&Vg.require("util").types;return e||iC&&iC.binding&&iC.binding("util")}catch{}}();const ic=xee;var T8=ic&&ic.isTypedArray,wee=T8?jS(T8):_ee;const ik=wee;var Cee=Object.prototype,Eee=Cee.hasOwnProperty;function aF(e,t){var n=Yr(e),r=!n&&Rm(e),i=!n&&!r&&Om(e),o=!n&&!r&&!i&&ik(e),a=n||r||i||o,s=a?jJ(e.length,String):[],l=s.length;for(var u in e)(t||Eee.call(e,u))&&!(a&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||tk(u,l)))&&s.push(u);return s}function sF(e,t){return function(n){return e(t(n))}}var Tee=sF(Object.keys,Object);const kee=Tee;var Aee=Object.prototype,Pee=Aee.hasOwnProperty;function lF(e){if(!rk(e))return kee(e);var t=[];for(var n in Object(e))Pee.call(e,n)&&n!="constructor"&&t.push(n);return t}function iy(e){return mp(e)?aF(e):lF(e)}function Iee(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Ree=Object.prototype,Oee=Ree.hasOwnProperty;function Mee(e){if(!Ro(e))return Iee(e);var t=rk(e),n=[];for(var r in e)r=="constructor"&&(t||!Oee.call(e,r))||n.push(r);return n}function oy(e){return mp(e)?aF(e,!0):Mee(e)}var Nee=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$ee=/^\w*$/;function ok(e,t){if(Yr(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||LS(e)?!0:$ee.test(e)||!Nee.test(e)||t!=null&&e in Object(t)}var Dee=Ud(Object,"create");const Mm=Dee;function Lee(){this.__data__=Mm?Mm(null):{},this.size=0}function Fee(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Bee="__lodash_hash_undefined__",zee=Object.prototype,jee=zee.hasOwnProperty;function Uee(e){var t=this.__data__;if(Mm){var n=t[e];return n===Bee?void 0:n}return jee.call(t,e)?t[e]:void 0}var Vee=Object.prototype,Gee=Vee.hasOwnProperty;function qee(e){var t=this.__data__;return Mm?t[e]!==void 0:Gee.call(t,e)}var Hee="__lodash_hash_undefined__";function Wee(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Mm&&t===void 0?Hee:t,this}function kd(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}kd.prototype.clear=Lee;kd.prototype.delete=Fee;kd.prototype.get=Uee;kd.prototype.has=qee;kd.prototype.set=Wee;function Kee(){this.__data__=[],this.size=0}function US(e,t){for(var n=e.length;n--;)if(ry(e[n][0],t))return n;return-1}var Qee=Array.prototype,Xee=Qee.splice;function Yee(e){var t=this.__data__,n=US(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Xee.call(t,n,1),--this.size,!0}function Zee(e){var t=this.__data__,n=US(t,e);return n<0?void 0:t[n][1]}function Jee(e){return US(this.__data__,e)>-1}function ete(e,t){var n=this.__data__,r=US(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Zl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Zl.prototype.clear=Kee;Zl.prototype.delete=Yee;Zl.prototype.get=Zee;Zl.prototype.has=Jee;Zl.prototype.set=ete;var tte=Ud(tl,"Map");const Nm=tte;function nte(){this.size=0,this.__data__={hash:new kd,map:new(Nm||Zl),string:new kd}}function rte(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function VS(e,t){var n=e.__data__;return rte(t)?n[typeof t=="string"?"string":"hash"]:n.map}function ite(e){var t=VS(this,e).delete(e);return this.size-=t?1:0,t}function ote(e){return VS(this,e).get(e)}function ate(e){return VS(this,e).has(e)}function ste(e,t){var n=VS(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Jl(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Jl.prototype.clear=nte;Jl.prototype.delete=ite;Jl.prototype.get=ote;Jl.prototype.has=ate;Jl.prototype.set=ste;var lte="Expected a function";function ak(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(lte);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(ak.Cache||Jl),n}ak.Cache=Jl;var ute=500;function cte(e){var t=ak(e,function(r){return n.size===ute&&n.clear(),r}),n=t.cache;return t}var dte=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fte=/\\(\\)?/g,hte=cte(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(dte,function(n,r,i,o){t.push(i?o.replace(fte,"$1"):r||n)}),t});const pte=hte;function Vh(e){return e==null?"":Gb(e)}function GS(e,t){return Yr(e)?e:ok(e,t)?[e]:pte(Vh(e))}var gte=1/0;function ay(e){if(typeof e=="string"||LS(e))return e;var t=e+"";return t=="0"&&1/e==-gte?"-0":t}function sk(e,t){t=GS(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[ay(t[n++])];return n&&n==r?e:void 0}function ch(e,t,n){var r=e==null?void 0:sk(e,t);return r===void 0?n:r}function lk(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var k8=Ca?Ca.isConcatSpreadable:void 0;function mte(e){return Yr(e)||Rm(e)||!!(k8&&e&&e[k8])}function uF(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=mte),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?uF(s,t-1,n,r,i):lk(i,s):r||(i[i.length]=s)}return i}function yte(e){var t=e==null?0:e.length;return t?uF(e,1):[]}function vte(e){return YL(eF(e,void 0,yte),e+"")}var bte=sF(Object.getPrototypeOf,Object);const uk=bte;var _te="[object Object]",Ste=Function.prototype,xte=Object.prototype,cF=Ste.toString,wte=xte.hasOwnProperty,Cte=cF.call(Object);function dF(e){if(!Io(e)||fs(e)!=_te)return!1;var t=uk(e);if(t===null)return!0;var n=wte.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&cF.call(n)==Cte}function fF(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}function hF(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:fF(e,t,n)}var Ete="\\ud800-\\udfff",Tte="\\u0300-\\u036f",kte="\\ufe20-\\ufe2f",Ate="\\u20d0-\\u20ff",Pte=Tte+kte+Ate,Ite="\\ufe0e\\ufe0f",Rte="\\u200d",Ote=RegExp("["+Rte+Ete+Pte+Ite+"]");function qS(e){return Ote.test(e)}function Mte(e){return e.split("")}var pF="\\ud800-\\udfff",Nte="\\u0300-\\u036f",$te="\\ufe20-\\ufe2f",Dte="\\u20d0-\\u20ff",Lte=Nte+$te+Dte,Fte="\\ufe0e\\ufe0f",Bte="["+pF+"]",q3="["+Lte+"]",H3="\\ud83c[\\udffb-\\udfff]",zte="(?:"+q3+"|"+H3+")",gF="[^"+pF+"]",mF="(?:\\ud83c[\\udde6-\\uddff]){2}",yF="[\\ud800-\\udbff][\\udc00-\\udfff]",jte="\\u200d",vF=zte+"?",bF="["+Fte+"]?",Ute="(?:"+jte+"(?:"+[gF,mF,yF].join("|")+")"+bF+vF+")*",Vte=bF+vF+Ute,Gte="(?:"+[gF+q3+"?",q3,mF,yF,Bte].join("|")+")",qte=RegExp(H3+"(?="+H3+")|"+Gte+Vte,"g");function Hte(e){return e.match(qte)||[]}function _F(e){return qS(e)?Hte(e):Mte(e)}function Wte(e){return function(t){t=Vh(t);var n=qS(t)?_F(t):void 0,r=n?n[0]:t.charAt(0),i=n?hF(n,1).join(""):t.slice(1);return r[e]()+i}}var Kte=Wte("toUpperCase");const SF=Kte;function xF(e,t,n,r){var i=-1,o=e==null?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function Qte(e){return function(t){return e==null?void 0:e[t]}}var Xte={À:"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"},Yte=Qte(Xte);const Zte=Yte;var Jte=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ene="\\u0300-\\u036f",tne="\\ufe20-\\ufe2f",nne="\\u20d0-\\u20ff",rne=ene+tne+nne,ine="["+rne+"]",one=RegExp(ine,"g");function ane(e){return e=Vh(e),e&&e.replace(Jte,Zte).replace(one,"")}var sne=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function lne(e){return e.match(sne)||[]}var une=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function cne(e){return une.test(e)}var wF="\\ud800-\\udfff",dne="\\u0300-\\u036f",fne="\\ufe20-\\ufe2f",hne="\\u20d0-\\u20ff",pne=dne+fne+hne,CF="\\u2700-\\u27bf",EF="a-z\\xdf-\\xf6\\xf8-\\xff",gne="\\xac\\xb1\\xd7\\xf7",mne="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",yne="\\u2000-\\u206f",vne=" \\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",TF="A-Z\\xc0-\\xd6\\xd8-\\xde",bne="\\ufe0e\\ufe0f",kF=gne+mne+yne+vne,AF="['’]",A8="["+kF+"]",_ne="["+pne+"]",PF="\\d+",Sne="["+CF+"]",IF="["+EF+"]",RF="[^"+wF+kF+PF+CF+EF+TF+"]",xne="\\ud83c[\\udffb-\\udfff]",wne="(?:"+_ne+"|"+xne+")",Cne="[^"+wF+"]",OF="(?:\\ud83c[\\udde6-\\uddff]){2}",MF="[\\ud800-\\udbff][\\udc00-\\udfff]",xf="["+TF+"]",Ene="\\u200d",P8="(?:"+IF+"|"+RF+")",Tne="(?:"+xf+"|"+RF+")",I8="(?:"+AF+"(?:d|ll|m|re|s|t|ve))?",R8="(?:"+AF+"(?:D|LL|M|RE|S|T|VE))?",NF=wne+"?",$F="["+bne+"]?",kne="(?:"+Ene+"(?:"+[Cne,OF,MF].join("|")+")"+$F+NF+")*",Ane="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pne="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ine=$F+NF+kne,Rne="(?:"+[Sne,OF,MF].join("|")+")"+Ine,One=RegExp([xf+"?"+IF+"+"+I8+"(?="+[A8,xf,"$"].join("|")+")",Tne+"+"+R8+"(?="+[A8,xf+P8,"$"].join("|")+")",xf+"?"+P8+"+"+I8,xf+"+"+R8,Pne,Ane,PF,Rne].join("|"),"g");function Mne(e){return e.match(One)||[]}function Nne(e,t,n){return e=Vh(e),t=n?void 0:t,t===void 0?cne(e)?Mne(e):lne(e):e.match(t)||[]}var $ne="['’]",Dne=RegExp($ne,"g");function Lne(e){return function(t){return xF(Nne(ane(t).replace(Dne,"")),e,"")}}function Fne(e,t,n){return e===e&&(n!==void 0&&(e=e<=n?e:n),t!==void 0&&(e=e>=t?e:t)),e}function Nu(e,t,n){return n===void 0&&(n=t,t=void 0),n!==void 0&&(n=M1(n),n=n===n?n:0),t!==void 0&&(t=M1(t),t=t===t?t:0),Fne(M1(e),t,n)}function Bne(){this.__data__=new Zl,this.size=0}function zne(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function jne(e){return this.__data__.get(e)}function Une(e){return this.__data__.has(e)}var Vne=200;function Gne(e,t){var n=this.__data__;if(n instanceof Zl){var r=n.__data__;if(!Nm||r.length<Vne-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Jl(r)}return n.set(e,t),this.size=n.size,this}function ns(e){var t=this.__data__=new Zl(e);this.size=t.size}ns.prototype.clear=Bne;ns.prototype.delete=zne;ns.prototype.get=jne;ns.prototype.has=Une;ns.prototype.set=Gne;function qne(e,t){return e&&gp(t,iy(t),e)}function Hne(e,t){return e&&gp(t,oy(t),e)}var DF=typeof exports=="object"&&exports&&!exports.nodeType&&exports,O8=DF&&typeof module=="object"&&module&&!module.nodeType&&module,Wne=O8&&O8.exports===DF,M8=Wne?tl.Buffer:void 0,N8=M8?M8.allocUnsafe:void 0;function LF(e,t){if(t)return e.slice();var n=e.length,r=N8?N8(n):new e.constructor(n);return e.copy(r),r}function FF(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function BF(){return[]}var Kne=Object.prototype,Qne=Kne.propertyIsEnumerable,$8=Object.getOwnPropertySymbols,Xne=$8?function(e){return e==null?[]:(e=Object(e),FF($8(e),function(t){return Qne.call(e,t)}))}:BF;const ck=Xne;function Yne(e,t){return gp(e,ck(e),t)}var Zne=Object.getOwnPropertySymbols,Jne=Zne?function(e){for(var t=[];e;)lk(t,ck(e)),e=uk(e);return t}:BF;const zF=Jne;function ere(e,t){return gp(e,zF(e),t)}function jF(e,t,n){var r=t(e);return Yr(e)?r:lk(r,n(e))}function W3(e){return jF(e,iy,ck)}function UF(e){return jF(e,oy,zF)}var tre=Ud(tl,"DataView");const K3=tre;var nre=Ud(tl,"Promise");const Q3=nre;var rre=Ud(tl,"Set");const dh=rre;var D8="[object Map]",ire="[object Object]",L8="[object Promise]",F8="[object Set]",B8="[object WeakMap]",z8="[object DataView]",ore=jd(K3),are=jd(Nm),sre=jd(Q3),lre=jd(dh),ure=jd(G3),Uc=fs;(K3&&Uc(new K3(new ArrayBuffer(1)))!=z8||Nm&&Uc(new Nm)!=D8||Q3&&Uc(Q3.resolve())!=L8||dh&&Uc(new dh)!=F8||G3&&Uc(new G3)!=B8)&&(Uc=function(e){var t=fs(e),n=t==ire?e.constructor:void 0,r=n?jd(n):"";if(r)switch(r){case ore:return z8;case are:return D8;case sre:return L8;case lre:return F8;case ure:return B8}return t});const Gh=Uc;var cre=Object.prototype,dre=cre.hasOwnProperty;function fre(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&dre.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var hre=tl.Uint8Array;const Hb=hre;function dk(e){var t=new e.constructor(e.byteLength);return new Hb(t).set(new Hb(e)),t}function pre(e,t){var n=t?dk(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var gre=/\w*$/;function mre(e){var t=new e.constructor(e.source,gre.exec(e));return t.lastIndex=e.lastIndex,t}var j8=Ca?Ca.prototype:void 0,U8=j8?j8.valueOf:void 0;function yre(e){return U8?Object(U8.call(e)):{}}function VF(e,t){var n=t?dk(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var vre="[object Boolean]",bre="[object Date]",_re="[object Map]",Sre="[object Number]",xre="[object RegExp]",wre="[object Set]",Cre="[object String]",Ere="[object Symbol]",Tre="[object ArrayBuffer]",kre="[object DataView]",Are="[object Float32Array]",Pre="[object Float64Array]",Ire="[object Int8Array]",Rre="[object Int16Array]",Ore="[object Int32Array]",Mre="[object Uint8Array]",Nre="[object Uint8ClampedArray]",$re="[object Uint16Array]",Dre="[object Uint32Array]";function Lre(e,t,n){var r=e.constructor;switch(t){case Tre:return dk(e);case vre:case bre:return new r(+e);case kre:return pre(e,n);case Are:case Pre:case Ire:case Rre:case Ore:case Mre:case Nre:case $re:case Dre:return VF(e,n);case _re:return new r;case Sre:case Cre:return new r(e);case xre:return mre(e);case wre:return new r;case Ere:return yre(e)}}function GF(e){return typeof e.constructor=="function"&&!rk(e)?bJ(uk(e)):{}}var Fre="[object Map]";function Bre(e){return Io(e)&&Gh(e)==Fre}var V8=ic&&ic.isMap,zre=V8?jS(V8):Bre;const jre=zre;var Ure="[object Set]";function Vre(e){return Io(e)&&Gh(e)==Ure}var G8=ic&&ic.isSet,Gre=G8?jS(G8):Vre;const qre=Gre;var Hre=1,Wre=2,Kre=4,qF="[object Arguments]",Qre="[object Array]",Xre="[object Boolean]",Yre="[object Date]",Zre="[object Error]",HF="[object Function]",Jre="[object GeneratorFunction]",eie="[object Map]",tie="[object Number]",WF="[object Object]",nie="[object RegExp]",rie="[object Set]",iie="[object String]",oie="[object Symbol]",aie="[object WeakMap]",sie="[object ArrayBuffer]",lie="[object DataView]",uie="[object Float32Array]",cie="[object Float64Array]",die="[object Int8Array]",fie="[object Int16Array]",hie="[object Int32Array]",pie="[object Uint8Array]",gie="[object Uint8ClampedArray]",mie="[object Uint16Array]",yie="[object Uint32Array]",On={};On[qF]=On[Qre]=On[sie]=On[lie]=On[Xre]=On[Yre]=On[uie]=On[cie]=On[die]=On[fie]=On[hie]=On[eie]=On[tie]=On[WF]=On[nie]=On[rie]=On[iie]=On[oie]=On[pie]=On[gie]=On[mie]=On[yie]=!0;On[Zre]=On[HF]=On[aie]=!1;function Gg(e,t,n,r,i,o){var a,s=t&Hre,l=t&Wre,u=t&Kre;if(n&&(a=i?n(e,r,i,o):n(e)),a!==void 0)return a;if(!Ro(e))return e;var c=Yr(e);if(c){if(a=fre(e),!s)return XL(e,a)}else{var d=Gh(e),f=d==HF||d==Jre;if(Om(e))return LF(e,s);if(d==WF||d==qF||f&&!i){if(a=l||f?{}:GF(e),!s)return l?ere(e,Hne(a,e)):Yne(e,qne(a,e))}else{if(!On[d])return i?e:{};a=Lre(e,d,s)}}o||(o=new ns);var h=o.get(e);if(h)return h;o.set(e,a),qre(e)?e.forEach(function(_){a.add(Gg(_,t,n,_,e,o))}):jre(e)&&e.forEach(function(_,b){a.set(b,Gg(_,t,n,b,e,o))});var p=u?l?UF:W3:l?oy:iy,m=c?void 0:p(e);return ZL(m||e,function(_,b){m&&(b=_,_=e[b]),JL(a,b,Gg(_,t,n,b,e,o))}),a}var vie=1,bie=4;function Cn(e){return Gg(e,vie|bie)}var _ie="__lodash_hash_undefined__";function Sie(e){return this.__data__.set(e,_ie),this}function xie(e){return this.__data__.has(e)}function $m(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Jl;++t<n;)this.add(e[t])}$m.prototype.add=$m.prototype.push=Sie;$m.prototype.has=xie;function KF(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function QF(e,t){return e.has(t)}var wie=1,Cie=2;function XF(e,t,n,r,i,o){var a=n&wie,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,h=n&Cie?new $m:void 0;for(o.set(e,t),o.set(t,e);++d<s;){var p=e[d],m=t[d];if(r)var _=a?r(m,p,d,t,e,o):r(p,m,d,e,t,o);if(_!==void 0){if(_)continue;f=!1;break}if(h){if(!KF(t,function(b,y){if(!QF(h,y)&&(p===b||i(p,b,n,r,o)))return h.push(y)})){f=!1;break}}else if(!(p===m||i(p,m,n,r,o))){f=!1;break}}return o.delete(e),o.delete(t),f}function Eie(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function fk(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Tie=1,kie=2,Aie="[object Boolean]",Pie="[object Date]",Iie="[object Error]",Rie="[object Map]",Oie="[object Number]",Mie="[object RegExp]",Nie="[object Set]",$ie="[object String]",Die="[object Symbol]",Lie="[object ArrayBuffer]",Fie="[object DataView]",q8=Ca?Ca.prototype:void 0,oC=q8?q8.valueOf:void 0;function Bie(e,t,n,r,i,o,a){switch(n){case Fie:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Lie:return!(e.byteLength!=t.byteLength||!o(new Hb(e),new Hb(t)));case Aie:case Pie:case Oie:return ry(+e,+t);case Iie:return e.name==t.name&&e.message==t.message;case Mie:case $ie:return e==t+"";case Rie:var s=Eie;case Nie:var l=r&Tie;if(s||(s=fk),e.size!=t.size&&!l)return!1;var u=a.get(e);if(u)return u==t;r|=kie,a.set(e,t);var c=XF(s(e),s(t),r,i,o,a);return a.delete(e),c;case Die:if(oC)return oC.call(e)==oC.call(t)}return!1}var zie=1,jie=Object.prototype,Uie=jie.hasOwnProperty;function Vie(e,t,n,r,i,o){var a=n&zie,s=W3(e),l=s.length,u=W3(t),c=u.length;if(l!=c&&!a)return!1;for(var d=l;d--;){var f=s[d];if(!(a?f in t:Uie.call(t,f)))return!1}var h=o.get(e),p=o.get(t);if(h&&p)return h==t&&p==e;var m=!0;o.set(e,t),o.set(t,e);for(var _=a;++d<l;){f=s[d];var b=e[f],y=t[f];if(r)var g=a?r(y,b,f,t,e,o):r(b,y,f,e,t,o);if(!(g===void 0?b===y||i(b,y,n,r,o):g)){m=!1;break}_||(_=f=="constructor")}if(m&&!_){var v=e.constructor,S=t.constructor;v!=S&&"constructor"in e&&"constructor"in t&&!(typeof v=="function"&&v instanceof v&&typeof S=="function"&&S instanceof S)&&(m=!1)}return o.delete(e),o.delete(t),m}var Gie=1,H8="[object Arguments]",W8="[object Array]",uv="[object Object]",qie=Object.prototype,K8=qie.hasOwnProperty;function Hie(e,t,n,r,i,o){var a=Yr(e),s=Yr(t),l=a?W8:Gh(e),u=s?W8:Gh(t);l=l==H8?uv:l,u=u==H8?uv:u;var c=l==uv,d=u==uv,f=l==u;if(f&&Om(e)){if(!Om(t))return!1;a=!0,c=!1}if(f&&!c)return o||(o=new ns),a||ik(e)?XF(e,t,n,r,i,o):Bie(e,t,l,n,r,i,o);if(!(n&Gie)){var h=c&&K8.call(e,"__wrapped__"),p=d&&K8.call(t,"__wrapped__");if(h||p){var m=h?e.value():e,_=p?t.value():t;return o||(o=new ns),i(m,_,n,r,o)}}return f?(o||(o=new ns),Vie(e,t,n,r,i,o)):!1}function HS(e,t,n,r,i){return e===t?!0:e==null||t==null||!Io(e)&&!Io(t)?e!==e&&t!==t:Hie(e,t,n,r,HS,i)}var Wie=1,Kie=2;function Qie(e,t,n,r){var i=n.length,o=i,a=!r;if(e==null)return!o;for(e=Object(e);i--;){var s=n[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){s=n[i];var l=s[0],u=e[l],c=s[1];if(a&&s[2]){if(u===void 0&&!(l in e))return!1}else{var d=new ns;if(r)var f=r(u,c,l,e,t,d);if(!(f===void 0?HS(c,u,Wie|Kie,r,d):f))return!1}}return!0}function YF(e){return e===e&&!Ro(e)}function Xie(e){for(var t=iy(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,YF(i)]}return t}function ZF(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function Yie(e){var t=Xie(e);return t.length==1&&t[0][2]?ZF(t[0][0],t[0][1]):function(n){return n===e||Qie(n,e,t)}}function Zie(e,t){return e!=null&&t in Object(e)}function JF(e,t,n){t=GS(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var a=ay(t[r]);if(!(o=e!=null&&n(e,a)))break;e=e[a]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&nk(i)&&tk(a,i)&&(Yr(e)||Rm(e)))}function Jie(e,t){return e!=null&&JF(e,t,Zie)}var eoe=1,toe=2;function noe(e,t){return ok(e)&&YF(t)?ZF(ay(e),t):function(n){var r=ch(n,e);return r===void 0&&r===t?Jie(n,e):HS(t,r,eoe|toe)}}function eB(e){return function(t){return t==null?void 0:t[e]}}function roe(e){return function(t){return sk(t,e)}}function ioe(e){return ok(e)?eB(ay(e)):roe(e)}function sy(e){return typeof e=="function"?e:e==null?FS:typeof e=="object"?Yr(e)?noe(e[0],e[1]):Yie(e):ioe(e)}function ooe(e,t,n,r){for(var i=-1,o=e==null?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function aoe(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++i];if(n(o[l],l,o)===!1)break}return t}}var soe=aoe();const tB=soe;function loe(e,t){return e&&tB(e,t,iy)}function uoe(e,t){return function(n,r){if(n==null)return n;if(!mp(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=Object(n);(t?o--:++o<i)&&r(a[o],o,a)!==!1;);return n}}var coe=uoe(loe);const ly=coe;function doe(e,t,n,r){return ly(e,function(i,o,a){t(r,i,n(i),a)}),r}function foe(e,t){return function(n,r){var i=Yr(n)?ooe:doe,o=t?t():{};return i(n,e,sy(r),o)}}function X3(e,t,n){(n!==void 0&&!ry(e[t],n)||n===void 0&&!(t in e))&&BS(e,t,n)}function hoe(e){return Io(e)&&mp(e)}function Y3(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function poe(e){return gp(e,oy(e))}function goe(e,t,n,r,i,o,a){var s=Y3(e,n),l=Y3(t,n),u=a.get(l);if(u){X3(e,n,u);return}var c=o?o(s,l,n+"",e,t,a):void 0,d=c===void 0;if(d){var f=Yr(l),h=!f&&Om(l),p=!f&&!h&&ik(l);c=l,f||h||p?Yr(s)?c=s:hoe(s)?c=XL(s):h?(d=!1,c=LF(l,!0)):p?(d=!1,c=VF(l,!0)):c=[]:dF(l)||Rm(l)?(c=s,Rm(s)?c=poe(s):(!Ro(s)||ek(s))&&(c=GF(l))):d=!1}d&&(a.set(l,c),i(c,l,r,o,a),a.delete(l)),X3(e,n,c)}function WS(e,t,n,r,i){e!==t&&tB(t,function(o,a){if(i||(i=new ns),Ro(o))goe(e,t,a,n,WS,r,i);else{var s=r?r(Y3(e,a),o,a+"",e,t,i):void 0;s===void 0&&(s=o),X3(e,a,s)}},oy)}function nB(e,t,n,r,i,o){return Ro(e)&&Ro(t)&&(o.set(t,e),WS(e,t,void 0,nB,o),o.delete(t)),e}var moe=nF(function(e,t,n,r){WS(e,t,n,r)});const yoe=moe;var voe=tF(function(e){return e.push(void 0,nB),QL(yoe,void 0,e)});const boe=voe;function _oe(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function Soe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function xoe(e){return typeof e=="function"?e:FS}function Ea(e,t){var n=Yr(e)?ZL:ly;return n(e,xoe(t))}function woe(e,t){var n=[];return ly(e,function(r,i,o){t(r,i,o)&&n.push(r)}),n}function Coe(e,t){var n=Yr(e)?FF:woe;return n(e,sy(t))}var Eoe=Object.prototype,Toe=Eoe.hasOwnProperty;function koe(e,t){return e!=null&&Toe.call(e,t)}function Aoe(e,t){return e!=null&&JF(e,t,koe)}var Poe="[object String]";function hk(e){return typeof e=="string"||!Yr(e)&&Io(e)&&fs(e)==Poe}function Ioe(e,t){return t.length<2?e:sk(e,fF(t,0,-1))}var Roe="[object Boolean]";function Ooe(e){return e===!0||e===!1||Io(e)&&fs(e)==Roe}function pk(e,t){return HS(e,t)}function Moe(e){return typeof e=="number"&&e==KL(e)}var Noe="[object Number]";function rB(e){return typeof e=="number"||Io(e)&&fs(e)==Noe}var $oe="[object RegExp]";function Doe(e){return Io(e)&&fs(e)==$oe}var Q8=ic&&ic.isRegExp,Loe=Q8?jS(Q8):Doe;const Foe=Loe;var Boe=foe(function(e,t,n){BS(e,n,t)});const gk=Boe;var zoe=nF(function(e,t,n){WS(e,t,n)});const joe=zoe;function iB(e,t){return t=GS(t,e),e=Ioe(e,t),e==null||delete e[ay(Soe(t))]}function Uoe(e){return dF(e)?void 0:e}var Voe=1,Goe=2,qoe=4,Hoe=vte(function(e,t){var n={};if(e==null)return n;var r=!1;t=WL(t,function(o){return o=GS(o,e),r||(r=o.length>1),o}),gp(e,UF(e),n),r&&(n=Gg(n,Voe|Goe|qoe,Uoe));for(var i=t.length;i--;)iB(n,t[i]);return n});const KS=Hoe;var Woe=eB("length");const Koe=Woe;var oB="\\ud800-\\udfff",Qoe="\\u0300-\\u036f",Xoe="\\ufe20-\\ufe2f",Yoe="\\u20d0-\\u20ff",Zoe=Qoe+Xoe+Yoe,Joe="\\ufe0e\\ufe0f",eae="["+oB+"]",Z3="["+Zoe+"]",J3="\\ud83c[\\udffb-\\udfff]",tae="(?:"+Z3+"|"+J3+")",aB="[^"+oB+"]",sB="(?:\\ud83c[\\udde6-\\uddff]){2}",lB="[\\ud800-\\udbff][\\udc00-\\udfff]",nae="\\u200d",uB=tae+"?",cB="["+Joe+"]?",rae="(?:"+nae+"(?:"+[aB,sB,lB].join("|")+")"+cB+uB+")*",iae=cB+uB+rae,oae="(?:"+[aB+Z3+"?",Z3,sB,lB,eae].join("|")+")",X8=RegExp(J3+"(?="+J3+")|"+oae+iae,"g");function aae(e){for(var t=X8.lastIndex=0;X8.test(e);)++t;return t}function dB(e){return qS(e)?aae(e):Koe(e)}var sae=Math.floor,lae=Math.random;function uae(e,t){return e+sae(lae()*(t-e+1))}var cae=parseFloat,dae=Math.min,fae=Math.random;function hae(e,t,n){if(n&&typeof n!="boolean"&&zS(e,t,n)&&(t=n=void 0),n===void 0&&(typeof t=="boolean"?(n=t,t=void 0):typeof e=="boolean"&&(n=e,e=void 0)),e===void 0&&t===void 0?(e=0,t=1):(e=uh(e),t===void 0?(t=e,e=0):t=uh(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=fae();return dae(e+i*(t-e+cae("1e-"+((i+"").length-1))),t)}return uae(e,t)}var pae=Math.ceil,gae=Math.max;function mae(e,t,n,r){for(var i=-1,o=gae(pae((t-e)/(n||1)),0),a=Array(o);o--;)a[r?o:++i]=e,e+=n;return a}function yae(e){return function(t,n,r){return r&&typeof r!="number"&&zS(t,n,r)&&(n=r=void 0),t=uh(t),n===void 0?(n=t,t=0):n=uh(n),r=r===void 0?t<n?1:-1:uh(r),mae(t,n,r,e)}}var vae=yae();const bae=vae;function _ae(e,t,n,r,i){return i(e,function(o,a,s){n=r?(r=!1,o):t(n,o,a,s)}),n}function eE(e,t,n){var r=Yr(e)?xF:_ae,i=arguments.length<3;return r(e,sy(t),n,i,ly)}var Sae="[object Map]",xae="[object Set]";function QS(e){if(e==null)return 0;if(mp(e))return hk(e)?dB(e):e.length;var t=Gh(e);return t==Sae||t==xae?e.size:lF(e).length}function wae(e,t){var n;return ly(e,function(r,i,o){return n=t(r,i,o),!n}),!!n}function zf(e,t,n){var r=Yr(e)?KF:wae;return n&&zS(e,t,n)&&(t=void 0),r(e,sy(t))}var Cae=Lne(function(e,t,n){return e+(n?" ":"")+SF(t)});const Eae=Cae;var Tae=30,kae="...",Aae=/\w*$/;function Y8(e,t){var n=Tae,r=kae;if(Ro(t)){var i="separator"in t?t.separator:i;n="length"in t?KL(t.length):n,r="omission"in t?Gb(t.omission):r}e=Vh(e);var o=e.length;if(qS(e)){var a=_F(e);o=a.length}if(n>=o)return e;var s=n-dB(r);if(s<1)return r;var l=a?hF(a,0,s).join(""):e.slice(0,s);if(i===void 0)return l+r;if(a&&(s+=l.length-s),Foe(i)){if(e.slice(s).search(i)){var u,c=l;for(i.global||(i=RegExp(i.source,Vh(Aae.exec(i))+"g")),i.lastIndex=0;u=i.exec(c);)var d=u.index;l=l.slice(0,d===void 0?s:d)}}else if(e.indexOf(Gb(i),s)!=s){var f=l.lastIndexOf(i);f>-1&&(l=l.slice(0,f))}return l+r}var Pae=1/0,Iae=dh&&1/fk(new dh([,-0]))[1]==Pae?function(e){return new dh(e)}:_J;const Rae=Iae;var Oae=200;function Mae(e,t,n){var r=-1,i=NJ,o=e.length,a=!0,s=[],l=s;if(n)a=!1,i=_oe;else if(o>=Oae){var u=t?null:Rae(e);if(u)return fk(u);a=!1,i=QF,l=new $m}else l=t?[]:s;e:for(;++r<o;){var c=e[r],d=t?t(c):c;if(c=n||c!==0?c:0,a&&d===d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),s.push(c)}else i(l,d,n)||(l!==s&&l.push(d),s.push(c))}return s}function tE(e,t){return e&&e.length?Mae(e,sy(t)):[]}function Z8(e,t){return e==null?!0:iB(e,t)}const fB={shouldUpdateImagesOnConnect:!1,shouldFetchMetadataFromApi:!1,disabledTabs:[],disabledFeatures:["lightbox","faceRestore","batches"],disabledSDFeatures:["variation","symmetry","hires","perlinNoise","noiseThreshold"],nodesAllowlist:void 0,nodesDenylist:void 0,canRestoreDeletedImagesFromBin:!0,sd:{disabledControlNetModels:[],disabledControlNetProcessors:[],iterations:{initial:1,min:1,sliderMax:1e3,inputMax:1e4,fineStep:1,coarseStep:1},width:{initial:512,min:64,sliderMax:1536,inputMax:4096,fineStep:8,coarseStep:64},height:{initial:512,min:64,sliderMax:1536,inputMax:4096,fineStep:8,coarseStep:64},steps:{initial:30,min:1,sliderMax:100,inputMax:500,fineStep:1,coarseStep:1},guidance:{initial:7,min:1,sliderMax:20,inputMax:200,fineStep:.1,coarseStep:.5},img2imgStrength:{initial:.7,min:0,sliderMax:1,inputMax:1,fineStep:.01,coarseStep:.05},dynamicPrompts:{maxPrompts:{initial:100,min:1,sliderMax:1e3,inputMax:1e4}}}},hB=rr({name:"config",initialState:fB,reducers:{configChanged:(e,t)=>{joe(e,t.payload)}}}),{configChanged:Nae}=hB.actions,$ae=hB.reducer,oUe={any:"Any","sd-1":"Stable Diffusion 1.x","sd-2":"Stable Diffusion 2.x",sdxl:"Stable Diffusion XL","sdxl-refiner":"Stable Diffusion XL Refiner"},aUe={any:"Any","sd-1":"SD1","sd-2":"SD2",sdxl:"SDXL","sdxl-refiner":"SDXLR"},Dae={any:{maxClip:0,markers:[]},"sd-1":{maxClip:12,markers:[0,1,2,3,4,8,12]},"sd-2":{maxClip:24,markers:[0,1,2,3,5,10,15,20,24]},sdxl:{maxClip:24,markers:[0,1,2,3,5,10,15,20,24]},"sdxl-refiner":{maxClip:24,markers:[0,1,2,3,5,10,15,20,24]}},sUe={lycoris:"LyCORIS",diffusers:"Diffusers"},Lae=0,qg=4294967295;var Yt;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(const s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Yt||(Yt={}));var nE;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(nE||(nE={}));const Re=Yt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Tu=e=>{switch(typeof e){case"undefined":return Re.undefined;case"string":return Re.string;case"number":return isNaN(e)?Re.nan:Re.number;case"boolean":return Re.boolean;case"function":return Re.function;case"bigint":return Re.bigint;case"symbol":return Re.symbol;case"object":return Array.isArray(e)?Re.array:e===null?Re.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Re.promise:typeof Map<"u"&&e instanceof Map?Re.map:typeof Set<"u"&&e instanceof Set?Re.set:typeof Date<"u"&&e instanceof Date?Re.date:Re.object;default:return Re.unknown}},he=Yt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Fae=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class rs extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,l=0;for(;l<a.path.length;){const u=a.path[l];l===a.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(n(a))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Yt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}rs.create=e=>new rs(e);const Dm=(e,t)=>{let n;switch(e.code){case he.invalid_type:e.received===Re.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case he.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Yt.jsonStringifyReplacer)}`;break;case he.unrecognized_keys:n=`Unrecognized key(s) in object: ${Yt.joinValues(e.keys,", ")}`;break;case he.invalid_union:n="Invalid input";break;case he.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Yt.joinValues(e.options)}`;break;case he.invalid_enum_value:n=`Invalid enum value. Expected ${Yt.joinValues(e.options)}, received '${e.received}'`;break;case he.invalid_arguments:n="Invalid function arguments";break;case he.invalid_return_type:n="Invalid function return type";break;case he.invalid_date:n="Invalid date";break;case he.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Yt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case he.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case he.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case he.custom:n="Invalid input";break;case he.invalid_intersection_types:n="Intersection results could not be merged";break;case he.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case he.not_finite:n="Number must be finite";break;default:n=t.defaultError,Yt.assertNever(e)}return{message:n}};let pB=Dm;function Bae(e){pB=e}function Wb(){return pB}const Kb=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let s="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)s=u(a,{data:t,defaultError:s}).message;return{...i,path:o,message:i.message||s}},zae=[];function Me(e,t){const n=Kb({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Wb(),Dm].filter(r=>!!r)});e.common.issues.push(n)}class Ki{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return vt;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return Ki.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return vt;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const vt=Object.freeze({status:"aborted"}),gB=e=>({status:"dirty",value:e}),so=e=>({status:"valid",value:e}),rE=e=>e.status==="aborted",iE=e=>e.status==="dirty",Lm=e=>e.status==="valid",Qb=e=>typeof Promise<"u"&&e instanceof Promise;var rt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(rt||(rt={}));class Xs{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const J8=(e,t)=>{if(Lm(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new rs(e.common.issues);return this._error=n,this._error}}};function xt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(a,s)=>a.code!=="invalid_type"?{message:s.defaultError}:typeof s.data>"u"?{message:r??s.defaultError}:{message:n??s.defaultError},description:i}}class Et{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Tu(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Tu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Ki,ctx:{common:t.parent.common,data:t.data,parsedType:Tu(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Qb(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Tu(t)},o=this._parseSync({data:t,path:i.path,parent:i});return J8(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Tu(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(Qb(i)?i:Promise.resolve(i));return J8(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),s=()=>o.addIssue({code:he.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new ls({schema:this,typeName:lt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return $l.create(this,this._def)}nullable(){return Id.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return is.create(this,this._def)}promise(){return Hh.create(this,this._def)}or(t){return jm.create([this,t],this._def)}and(t){return Um.create(this,t,this._def)}transform(t){return new ls({...xt(this._def),schema:this,typeName:lt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Wm({...xt(this._def),innerType:this,defaultValue:n,typeName:lt.ZodDefault})}brand(){return new yB({typeName:lt.ZodBranded,type:this,...xt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Jb({...xt(this._def),innerType:this,catchValue:n,typeName:lt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return uy.create(this,t)}readonly(){return t_.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const jae=/^c[^\s-]{8,}$/i,Uae=/^[a-z][a-z0-9]*$/,Vae=/[0-9A-HJKMNP-TV-Z]{26}/,Gae=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,qae=/^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Hae=/^(\p{Extended_Pictographic}|\p{Emoji_Component})+$/u,Wae=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Kae=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Qae=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Xae(e,t){return!!((t==="v4"||!t)&&Wae.test(e)||(t==="v6"||!t)&&Kae.test(e))}class Za extends Et{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(i=>t.test(i),{validation:n,code:he.invalid_string,...rt.errToObj(r)}),this.nonempty=t=>this.min(1,rt.errToObj(t)),this.trim=()=>new Za({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new Za({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new Za({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Re.string){const o=this._getOrReturnCtx(t);return Me(o,{code:he.invalid_type,expected:Re.string,received:o.parsedType}),vt}const r=new Ki;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),Me(i,{code:he.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),Me(i,{code:he.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const a=t.data.length>o.value,s=t.data.length<o.value;(a||s)&&(i=this._getOrReturnCtx(t,i),a?Me(i,{code:he.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&Me(i,{code:he.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")qae.test(t.data)||(i=this._getOrReturnCtx(t,i),Me(i,{validation:"email",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Hae.test(t.data)||(i=this._getOrReturnCtx(t,i),Me(i,{validation:"emoji",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Gae.test(t.data)||(i=this._getOrReturnCtx(t,i),Me(i,{validation:"uuid",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")jae.test(t.data)||(i=this._getOrReturnCtx(t,i),Me(i,{validation:"cuid",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Uae.test(t.data)||(i=this._getOrReturnCtx(t,i),Me(i,{validation:"cuid2",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")Vae.test(t.data)||(i=this._getOrReturnCtx(t,i),Me(i,{validation:"ulid",code:he.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Me(i,{validation:"url",code:he.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Me(i,{validation:"regex",code:he.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),Me(i,{code:he.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),Me(i,{code:he.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),Me(i,{code:he.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?Qae(o).test(t.data)||(i=this._getOrReturnCtx(t,i),Me(i,{code:he.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="ip"?Xae(t.data,o.version)||(i=this._getOrReturnCtx(t,i),Me(i,{validation:"ip",code:he.invalid_string,message:o.message}),r.dirty()):Yt.assertNever(o);return{status:r.value,value:t.data}}_addCheck(t){return new Za({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...rt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...rt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...rt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...rt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...rt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...rt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...rt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...rt.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...rt.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...rt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...rt.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...rt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...rt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...rt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...rt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...rt.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Za.create=e=>{var t;return new Za({checks:[],typeName:lt.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...xt(e)})};function Yae(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class oc extends Et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Re.number){const o=this._getOrReturnCtx(t);return Me(o,{code:he.invalid_type,expected:Re.number,received:o.parsedType}),vt}let r;const i=new Ki;for(const o of this._def.checks)o.kind==="int"?Yt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Me(r,{code:he.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Me(r,{code:he.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Me(r,{code:he.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Yae(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),Me(r,{code:he.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Me(r,{code:he.not_finite,message:o.message}),i.dirty()):Yt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,rt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,rt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,rt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,rt.toString(n))}setLimit(t,n,r,i){return new oc({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:rt.toString(i)}]})}_addCheck(t){return new oc({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:rt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:rt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:rt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:rt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:rt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:rt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:rt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:rt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:rt.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Yt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}oc.create=e=>new oc({checks:[],typeName:lt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...xt(e)});class ac extends Et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Re.bigint){const o=this._getOrReturnCtx(t);return Me(o,{code:he.invalid_type,expected:Re.bigint,received:o.parsedType}),vt}let r;const i=new Ki;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),Me(r,{code:he.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),Me(r,{code:he.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Me(r,{code:he.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Yt.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,rt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,rt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,rt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,rt.toString(n))}setLimit(t,n,r,i){return new ac({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:rt.toString(i)}]})}_addCheck(t){return new ac({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:rt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:rt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:rt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:rt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:rt.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}ac.create=e=>{var t;return new ac({checks:[],typeName:lt.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...xt(e)})};class Fm extends Et{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Re.boolean){const r=this._getOrReturnCtx(t);return Me(r,{code:he.invalid_type,expected:Re.boolean,received:r.parsedType}),vt}return so(t.data)}}Fm.create=e=>new Fm({typeName:lt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...xt(e)});class Ad extends Et{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Re.date){const o=this._getOrReturnCtx(t);return Me(o,{code:he.invalid_type,expected:Re.date,received:o.parsedType}),vt}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return Me(o,{code:he.invalid_date}),vt}const r=new Ki;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),Me(i,{code:he.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),Me(i,{code:he.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):Yt.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Ad({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:rt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:rt.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Ad.create=e=>new Ad({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:lt.ZodDate,...xt(e)});class Xb extends Et{_parse(t){if(this._getType(t)!==Re.symbol){const r=this._getOrReturnCtx(t);return Me(r,{code:he.invalid_type,expected:Re.symbol,received:r.parsedType}),vt}return so(t.data)}}Xb.create=e=>new Xb({typeName:lt.ZodSymbol,...xt(e)});class Bm extends Et{_parse(t){if(this._getType(t)!==Re.undefined){const r=this._getOrReturnCtx(t);return Me(r,{code:he.invalid_type,expected:Re.undefined,received:r.parsedType}),vt}return so(t.data)}}Bm.create=e=>new Bm({typeName:lt.ZodUndefined,...xt(e)});class zm extends Et{_parse(t){if(this._getType(t)!==Re.null){const r=this._getOrReturnCtx(t);return Me(r,{code:he.invalid_type,expected:Re.null,received:r.parsedType}),vt}return so(t.data)}}zm.create=e=>new zm({typeName:lt.ZodNull,...xt(e)});class qh extends Et{constructor(){super(...arguments),this._any=!0}_parse(t){return so(t.data)}}qh.create=e=>new qh({typeName:lt.ZodAny,...xt(e)});class pd extends Et{constructor(){super(...arguments),this._unknown=!0}_parse(t){return so(t.data)}}pd.create=e=>new pd({typeName:lt.ZodUnknown,...xt(e)});class Hl extends Et{_parse(t){const n=this._getOrReturnCtx(t);return Me(n,{code:he.invalid_type,expected:Re.never,received:n.parsedType}),vt}}Hl.create=e=>new Hl({typeName:lt.ZodNever,...xt(e)});class Yb extends Et{_parse(t){if(this._getType(t)!==Re.undefined){const r=this._getOrReturnCtx(t);return Me(r,{code:he.invalid_type,expected:Re.void,received:r.parsedType}),vt}return so(t.data)}}Yb.create=e=>new Yb({typeName:lt.ZodVoid,...xt(e)});class is extends Et{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Re.array)return Me(n,{code:he.invalid_type,expected:Re.array,received:n.parsedType}),vt;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(a||s)&&(Me(n,{code:a?he.too_big:he.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Me(n,{code:he.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Me(n,{code:he.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>i.type._parseAsync(new Xs(n,a,n.path,s)))).then(a=>Ki.mergeArray(r,a));const o=[...n.data].map((a,s)=>i.type._parseSync(new Xs(n,a,n.path,s)));return Ki.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new is({...this._def,minLength:{value:t,message:rt.toString(n)}})}max(t,n){return new is({...this._def,maxLength:{value:t,message:rt.toString(n)}})}length(t,n){return new is({...this._def,exactLength:{value:t,message:rt.toString(n)}})}nonempty(t){return this.min(1,t)}}is.create=(e,t)=>new is({type:e,minLength:null,maxLength:null,exactLength:null,typeName:lt.ZodArray,...xt(t)});function wf(e){if(e instanceof sr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=$l.create(wf(r))}return new sr({...e._def,shape:()=>t})}else return e instanceof is?new is({...e._def,type:wf(e.element)}):e instanceof $l?$l.create(wf(e.unwrap())):e instanceof Id?Id.create(wf(e.unwrap())):e instanceof Ys?Ys.create(e.items.map(t=>wf(t))):e}class sr extends Et{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Yt.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Re.object){const u=this._getOrReturnCtx(t);return Me(u,{code:he.invalid_type,expected:Re.object,received:u.parsedType}),vt}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof Hl&&this._def.unknownKeys==="strip"))for(const u in i.data)a.includes(u)||s.push(u);const l=[];for(const u of a){const c=o[u],d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Xs(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof Hl){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of s)l.push({key:{status:"valid",value:c},value:{status:"valid",value:i.data[c]}});else if(u==="strict")s.length>0&&(Me(i,{code:he.unrecognized_keys,keys:s}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of s){const d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Xs(i,d,i.path,c)),alwaysSet:c in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const d=await c.key;u.push({key:d,value:await c.value,alwaysSet:c.alwaysSet})}return u}).then(u=>Ki.mergeObjectSync(r,u)):Ki.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return rt.errToObj,new sr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,s;const l=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=rt.errToObj(t).message)!==null&&s!==void 0?s:l}:{message:l}}}:{}})}strip(){return new sr({...this._def,unknownKeys:"strip"})}passthrough(){return new sr({...this._def,unknownKeys:"passthrough"})}extend(t){return new sr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new sr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:lt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new sr({...this._def,catchall:t})}pick(t){const n={};return Yt.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new sr({...this._def,shape:()=>n})}omit(t){const n={};return Yt.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new sr({...this._def,shape:()=>n})}deepPartial(){return wf(this)}partial(t){const n={};return Yt.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new sr({...this._def,shape:()=>n})}required(t){const n={};return Yt.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof $l;)o=o._def.innerType;n[r]=o}}),new sr({...this._def,shape:()=>n})}keyof(){return mB(Yt.objectKeys(this.shape))}}sr.create=(e,t)=>new sr({shape:()=>e,unknownKeys:"strip",catchall:Hl.create(),typeName:lt.ZodObject,...xt(t)});sr.strictCreate=(e,t)=>new sr({shape:()=>e,unknownKeys:"strict",catchall:Hl.create(),typeName:lt.ZodObject,...xt(t)});sr.lazycreate=(e,t)=>new sr({shape:e,unknownKeys:"strip",catchall:Hl.create(),typeName:lt.ZodObject,...xt(t)});class jm extends Et{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(s=>new rs(s.ctx.common.issues));return Me(n,{code:he.invalid_union,unionErrors:a}),vt}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(l=>new rs(l));return Me(n,{code:he.invalid_union,unionErrors:s}),vt}}get options(){return this._def.options}}jm.create=(e,t)=>new jm({options:e,typeName:lt.ZodUnion,...xt(t)});const N1=e=>e instanceof Gm?N1(e.schema):e instanceof ls?N1(e.innerType()):e instanceof qm?[e.value]:e instanceof sc?e.options:e instanceof Hm?Object.keys(e.enum):e instanceof Wm?N1(e._def.innerType):e instanceof Bm?[void 0]:e instanceof zm?[null]:null;class XS extends Et{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Re.object)return Me(n,{code:he.invalid_type,expected:Re.object,received:n.parsedType}),vt;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(Me(n,{code:he.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),vt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const a=N1(o.shape[t]);if(!a)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const s of a){if(i.has(s))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(s)}`);i.set(s,o)}}return new XS({typeName:lt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...xt(r)})}}function oE(e,t){const n=Tu(e),r=Tu(t);if(e===t)return{valid:!0,data:e};if(n===Re.object&&r===Re.object){const i=Yt.objectKeys(t),o=Yt.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(const s of o){const l=oE(e[s],t[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(n===Re.array&&r===Re.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const a=e[o],s=t[o],l=oE(a,s);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===Re.date&&r===Re.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Um extends Et{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(rE(o)||rE(a))return vt;const s=oE(o.value,a.value);return s.valid?((iE(o)||iE(a))&&n.dirty(),{status:n.value,value:s.data}):(Me(r,{code:he.invalid_intersection_types}),vt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Um.create=(e,t,n)=>new Um({left:e,right:t,typeName:lt.ZodIntersection,...xt(n)});class Ys extends Et{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Re.array)return Me(r,{code:he.invalid_type,expected:Re.array,received:r.parsedType}),vt;if(r.data.length<this._def.items.length)return Me(r,{code:he.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),vt;!this._def.rest&&r.data.length>this._def.items.length&&(Me(r,{code:he.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((a,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new Xs(r,a,r.path,s)):null}).filter(a=>!!a);return r.common.async?Promise.all(o).then(a=>Ki.mergeArray(n,a)):Ki.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Ys({...this._def,rest:t})}}Ys.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ys({items:e,typeName:lt.ZodTuple,rest:null,...xt(t)})};class Vm extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Re.object)return Me(r,{code:he.invalid_type,expected:Re.object,received:r.parsedType}),vt;const i=[],o=this._def.keyType,a=this._def.valueType;for(const s in r.data)i.push({key:o._parse(new Xs(r,s,r.path,s)),value:a._parse(new Xs(r,r.data[s],r.path,s))});return r.common.async?Ki.mergeObjectAsync(n,i):Ki.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Et?new Vm({keyType:t,valueType:n,typeName:lt.ZodRecord,...xt(r)}):new Vm({keyType:Za.create(),valueType:t,typeName:lt.ZodRecord,...xt(n)})}}class Zb extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Re.map)return Me(r,{code:he.invalid_type,expected:Re.map,received:r.parsedType}),vt;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([s,l],u)=>({key:i._parse(new Xs(r,s,r.path,[u,"key"])),value:o._parse(new Xs(r,l,r.path,[u,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of a){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return vt;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const l of a){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return vt;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(u.value,c.value)}return{status:n.value,value:s}}}}Zb.create=(e,t,n)=>new Zb({valueType:t,keyType:e,typeName:lt.ZodMap,...xt(n)});class Pd extends Et{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Re.set)return Me(r,{code:he.invalid_type,expected:Re.set,received:r.parsedType}),vt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Me(r,{code:he.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Me(r,{code:he.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(l){const u=new Set;for(const c of l){if(c.status==="aborted")return vt;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const s=[...r.data.values()].map((l,u)=>o._parse(new Xs(r,l,r.path,u)));return r.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(t,n){return new Pd({...this._def,minSize:{value:t,message:rt.toString(n)}})}max(t,n){return new Pd({...this._def,maxSize:{value:t,message:rt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Pd.create=(e,t)=>new Pd({valueType:e,minSize:null,maxSize:null,typeName:lt.ZodSet,...xt(t)});class fh extends Et{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Re.function)return Me(n,{code:he.invalid_type,expected:Re.function,received:n.parsedType}),vt;function r(s,l){return Kb({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Wb(),Dm].filter(u=>!!u),issueData:{code:he.invalid_arguments,argumentsError:l}})}function i(s,l){return Kb({data:s,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Wb(),Dm].filter(u=>!!u),issueData:{code:he.invalid_return_type,returnTypeError:l}})}const o={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof Hh){const s=this;return so(async function(...l){const u=new rs([]),c=await s._def.args.parseAsync(l,o).catch(h=>{throw u.addIssue(r(l,h)),u}),d=await Reflect.apply(a,this,c);return await s._def.returns._def.type.parseAsync(d,o).catch(h=>{throw u.addIssue(i(d,h)),u})})}else{const s=this;return so(function(...l){const u=s._def.args.safeParse(l,o);if(!u.success)throw new rs([r(l,u.error)]);const c=Reflect.apply(a,this,u.data),d=s._def.returns.safeParse(c,o);if(!d.success)throw new rs([i(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new fh({...this._def,args:Ys.create(t).rest(pd.create())})}returns(t){return new fh({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new fh({args:t||Ys.create([]).rest(pd.create()),returns:n||pd.create(),typeName:lt.ZodFunction,...xt(r)})}}class Gm extends Et{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Gm.create=(e,t)=>new Gm({getter:e,typeName:lt.ZodLazy,...xt(t)});class qm extends Et{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Me(n,{received:n.data,code:he.invalid_literal,expected:this._def.value}),vt}return{status:"valid",value:t.data}}get value(){return this._def.value}}qm.create=(e,t)=>new qm({value:e,typeName:lt.ZodLiteral,...xt(t)});function mB(e,t){return new sc({values:e,typeName:lt.ZodEnum,...xt(t)})}class sc extends Et{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Me(n,{expected:Yt.joinValues(r),received:n.parsedType,code:he.invalid_type}),vt}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return Me(n,{received:n.data,code:he.invalid_enum_value,options:r}),vt}return so(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return sc.create(t)}exclude(t){return sc.create(this.options.filter(n=>!t.includes(n)))}}sc.create=mB;class Hm extends Et{_parse(t){const n=Yt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Re.string&&r.parsedType!==Re.number){const i=Yt.objectValues(n);return Me(r,{expected:Yt.joinValues(i),received:r.parsedType,code:he.invalid_type}),vt}if(n.indexOf(t.data)===-1){const i=Yt.objectValues(n);return Me(r,{received:r.data,code:he.invalid_enum_value,options:i}),vt}return so(t.data)}get enum(){return this._def.values}}Hm.create=(e,t)=>new Hm({values:e,typeName:lt.ZodNativeEnum,...xt(t)});class Hh extends Et{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Re.promise&&n.common.async===!1)return Me(n,{code:he.invalid_type,expected:Re.promise,received:n.parsedType}),vt;const r=n.parsedType===Re.promise?n.data:Promise.resolve(n.data);return so(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Hh.create=(e,t)=>new Hh({type:e,typeName:lt.ZodPromise,...xt(t)});class ls extends Et{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===lt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:a=>{Me(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const a=i.transform(r.data,o);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(a).then(s=>this._def.schema._parseAsync({data:s,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}if(i.type==="refinement"){const a=s=>{const l=i.refinement(s,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?vt:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?vt:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Lm(a))return a;const s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Lm(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:n.value,value:s})):a);Yt.assertNever(i)}}ls.create=(e,t,n)=>new ls({schema:e,typeName:lt.ZodEffects,effect:t,...xt(n)});ls.createWithPreprocess=(e,t,n)=>new ls({schema:t,effect:{type:"preprocess",transform:e},typeName:lt.ZodEffects,...xt(n)});class $l extends Et{_parse(t){return this._getType(t)===Re.undefined?so(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}$l.create=(e,t)=>new $l({innerType:e,typeName:lt.ZodOptional,...xt(t)});class Id extends Et{_parse(t){return this._getType(t)===Re.null?so(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Id.create=(e,t)=>new Id({innerType:e,typeName:lt.ZodNullable,...xt(t)});class Wm extends Et{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Re.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Wm.create=(e,t)=>new Wm({innerType:e,typeName:lt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...xt(t)});class Jb extends Et{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Qb(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new rs(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new rs(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Jb.create=(e,t)=>new Jb({innerType:e,typeName:lt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...xt(t)});class e_ extends Et{_parse(t){if(this._getType(t)!==Re.nan){const r=this._getOrReturnCtx(t);return Me(r,{code:he.invalid_type,expected:Re.nan,received:r.parsedType}),vt}return{status:"valid",value:t.data}}}e_.create=e=>new e_({typeName:lt.ZodNaN,...xt(e)});const Zae=Symbol("zod_brand");class yB extends Et{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class uy extends Et{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?vt:o.status==="dirty"?(n.dirty(),gB(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?vt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new uy({in:t,out:n,typeName:lt.ZodPipeline})}}class t_ extends Et{_parse(t){const n=this._def.innerType._parse(t);return Lm(n)&&(n.value=Object.freeze(n.value)),n}}t_.create=(e,t)=>new t_({innerType:e,typeName:lt.ZodReadonly,...xt(t)});const vB=(e,t={},n)=>e?qh.create().superRefine((r,i)=>{var o,a;if(!e(r)){const s=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(a=(o=s.fatal)!==null&&o!==void 0?o:n)!==null&&a!==void 0?a:!0,u=typeof s=="string"?{message:s}:s;i.addIssue({code:"custom",...u,fatal:l})}}):qh.create(),Jae={object:sr.lazycreate};var lt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(lt||(lt={}));const ese=(e,t={message:`Input not instance of ${e.name}`})=>vB(n=>n instanceof e,t),bB=Za.create,_B=oc.create,tse=e_.create,nse=ac.create,SB=Fm.create,rse=Ad.create,ise=Xb.create,ose=Bm.create,ase=zm.create,sse=qh.create,lse=pd.create,use=Hl.create,cse=Yb.create,dse=is.create,fse=sr.create,hse=sr.strictCreate,pse=jm.create,gse=XS.create,mse=Um.create,yse=Ys.create,vse=Vm.create,bse=Zb.create,_se=Pd.create,Sse=fh.create,xse=Gm.create,wse=qm.create,Cse=sc.create,Ese=Hm.create,Tse=Hh.create,eI=ls.create,kse=$l.create,Ase=Id.create,Pse=ls.createWithPreprocess,Ise=uy.create,Rse=()=>bB().optional(),Ose=()=>_B().optional(),Mse=()=>SB().optional(),Nse={string:e=>Za.create({...e,coerce:!0}),number:e=>oc.create({...e,coerce:!0}),boolean:e=>Fm.create({...e,coerce:!0}),bigint:e=>ac.create({...e,coerce:!0}),date:e=>Ad.create({...e,coerce:!0})},$se=vt;var z=Object.freeze({__proto__:null,defaultErrorMap:Dm,setErrorMap:Bae,getErrorMap:Wb,makeIssue:Kb,EMPTY_PATH:zae,addIssueToContext:Me,ParseStatus:Ki,INVALID:vt,DIRTY:gB,OK:so,isAborted:rE,isDirty:iE,isValid:Lm,isAsync:Qb,get util(){return Yt},get objectUtil(){return nE},ZodParsedType:Re,getParsedType:Tu,ZodType:Et,ZodString:Za,ZodNumber:oc,ZodBigInt:ac,ZodBoolean:Fm,ZodDate:Ad,ZodSymbol:Xb,ZodUndefined:Bm,ZodNull:zm,ZodAny:qh,ZodUnknown:pd,ZodNever:Hl,ZodVoid:Yb,ZodArray:is,ZodObject:sr,ZodUnion:jm,ZodDiscriminatedUnion:XS,ZodIntersection:Um,ZodTuple:Ys,ZodRecord:Vm,ZodMap:Zb,ZodSet:Pd,ZodFunction:fh,ZodLazy:Gm,ZodLiteral:qm,ZodEnum:sc,ZodNativeEnum:Hm,ZodPromise:Hh,ZodEffects:ls,ZodTransformer:ls,ZodOptional:$l,ZodNullable:Id,ZodDefault:Wm,ZodCatch:Jb,ZodNaN:e_,BRAND:Zae,ZodBranded:yB,ZodPipeline:uy,ZodReadonly:t_,custom:vB,Schema:Et,ZodSchema:Et,late:Jae,get ZodFirstPartyTypeKind(){return lt},coerce:Nse,any:sse,array:dse,bigint:nse,boolean:SB,date:rse,discriminatedUnion:gse,effect:eI,enum:Cse,function:Sse,instanceof:ese,intersection:mse,lazy:xse,literal:wse,map:bse,nan:tse,nativeEnum:Ese,never:use,null:ase,nullable:Ase,number:_B,object:fse,oboolean:Mse,onumber:Ose,optional:kse,ostring:Rse,pipeline:Ise,preprocess:Pse,promise:Tse,record:vse,set:_se,strictObject:hse,string:bB,symbol:ise,transformer:eI,tuple:yse,undefined:ose,union:pse,unknown:lse,void:cse,NEVER:$se,ZodIssueCode:he,quotelessJson:Fae,ZodError:rs});const Dse=z.string(),lUe=e=>Dse.safeParse(e).success,Lse=z.string(),uUe=e=>Lse.safeParse(e).success,Fse=z.string(),cUe=e=>Fse.safeParse(e).success,Bse=z.string(),dUe=e=>Bse.safeParse(e).success,zse=z.number().int().min(1),fUe=e=>zse.safeParse(e).success,jse=z.number().min(1),hUe=e=>jse.safeParse(e).success,xB=z.enum(["euler","deis","ddim","ddpm","dpmpp_2s","dpmpp_2m","dpmpp_2m_sde","dpmpp_sde","heun","kdpm_2","lms","pndm","unipc","euler_k","dpmpp_2s_k","dpmpp_2m_k","dpmpp_2m_sde_k","dpmpp_sde_k","heun_k","lms_k","euler_a","kdpm_2_a"]),pUe=e=>xB.safeParse(e).success,gUe={euler:"Euler",deis:"DEIS",ddim:"DDIM",ddpm:"DDPM",dpmpp_sde:"DPM++ SDE",dpmpp_2s:"DPM++ 2S",dpmpp_2m:"DPM++ 2M",dpmpp_2m_sde:"DPM++ 2M SDE",heun:"Heun",kdpm_2:"KDPM 2",lms:"LMS",pndm:"PNDM",unipc:"UniPC",euler_k:"Euler Karras",dpmpp_sde_k:"DPM++ SDE Karras",dpmpp_2s_k:"DPM++ 2S Karras",dpmpp_2m_k:"DPM++ 2M Karras",dpmpp_2m_sde_k:"DPM++ 2M SDE Karras",heun_k:"Heun Karras",lms_k:"LMS Karras",euler_a:"Euler Ancestral",kdpm_2_a:"KDPM 2 Ancestral"},Use=z.number().int().min(0).max(qg),mUe=e=>Use.safeParse(e).success,Vse=z.number().multipleOf(8).min(64),yUe=e=>Vse.safeParse(e).success,Gse=z.number().multipleOf(8).min(64),vUe=e=>Gse.safeParse(e).success,xc=z.enum(["any","sd-1","sd-2","sdxl","sdxl-refiner"]),YS=z.object({model_name:z.string().min(1),base_model:xc,model_type:z.literal("main")}),bUe=e=>YS.safeParse(e).success,mk=z.object({model_name:z.string().min(1),base_model:z.literal("sdxl-refiner"),model_type:z.literal("main")}),_Ue=e=>mk.safeParse(e).success,wB=z.object({model_name:z.string().min(1),base_model:xc,model_type:z.literal("onnx")}),cy=z.union([YS,wB]),qse=z.object({model_name:z.string().min(1),base_model:xc}),Hse=z.object({model_name:z.string().min(1),base_model:xc}),SUe=e=>Hse.safeParse(e).success,Wse=z.object({model_name:z.string().min(1),base_model:xc}),xUe=e=>Wse.safeParse(e).success,Kse=z.object({model_name:z.string().min(1),base_model:xc}),wUe=z.object({model_name:z.string().min(1),base_model:xc}),CUe=e=>Kse.safeParse(e).success,Qse=z.number().min(0).max(1),EUe=e=>Qse.safeParse(e).success;z.enum(["fp16","fp32"]);const Xse=z.number().min(1).max(10),TUe=e=>Xse.safeParse(e).success,Yse=z.number().min(1).max(10),kUe=e=>Yse.safeParse(e).success,Zse=z.number().min(0).max(1),AUe=e=>Zse.safeParse(e).success;z.enum(["box","gaussian"]);z.enum(["unmasked","mask","edge"]);const yk={cfgScale:7.5,height:512,img2imgStrength:.75,infillMethod:"patchmatch",iterations:1,perlin:0,positivePrompt:"",negativePrompt:"",scheduler:"euler",maskBlur:16,maskBlurMethod:"box",canvasCoherenceMode:"unmasked",canvasCoherenceSteps:20,canvasCoherenceStrength:.3,seed:0,seedWeights:"",shouldFitToWidthHeight:!0,shouldGenerateVariations:!1,shouldRandomizeSeed:!0,steps:50,threshold:0,infillTileSize:32,infillPatchmatchDownscaleSize:1,variationAmount:.1,width:512,shouldUseSymmetry:!1,horizontalSymmetrySteps:0,verticalSymmetrySteps:0,model:null,vae:null,vaePrecision:"fp32",seamlessXAxis:!1,seamlessYAxis:!1,clipSkip:0,shouldUseCpuNoise:!0,shouldShowAdvancedOptions:!1,aspectRatio:null,shouldLockAspectRatio:!1},Jse=yk,CB=rr({name:"generation",initialState:Jse,reducers:{setPositivePrompt:(e,t)=>{e.positivePrompt=t.payload},setNegativePrompt:(e,t)=>{e.negativePrompt=t.payload},setIterations:(e,t)=>{e.iterations=t.payload},setSteps:(e,t)=>{e.steps=t.payload},clampSymmetrySteps:e=>{e.horizontalSymmetrySteps=Nu(e.horizontalSymmetrySteps,0,e.steps),e.verticalSymmetrySteps=Nu(e.verticalSymmetrySteps,0,e.steps)},setCfgScale:(e,t)=>{e.cfgScale=t.payload},setThreshold:(e,t)=>{e.threshold=t.payload},setPerlin:(e,t)=>{e.perlin=t.payload},setHeight:(e,t)=>{e.height=t.payload},setWidth:(e,t)=>{e.width=t.payload},toggleSize:e=>{const[t,n]=[e.width,e.height];e.width=n,e.height=t},setScheduler:(e,t)=>{e.scheduler=t.payload},setSeed:(e,t)=>{e.seed=t.payload,e.shouldRandomizeSeed=!1},setImg2imgStrength:(e,t)=>{e.img2imgStrength=t.payload},setSeamlessXAxis:(e,t)=>{e.seamlessXAxis=t.payload},setSeamlessYAxis:(e,t)=>{e.seamlessYAxis=t.payload},setShouldFitToWidthHeight:(e,t)=>{e.shouldFitToWidthHeight=t.payload},resetSeed:e=>{e.seed=-1},setShouldGenerateVariations:(e,t)=>{e.shouldGenerateVariations=t.payload},setVariationAmount:(e,t)=>{e.variationAmount=t.payload},setSeedWeights:(e,t)=>{e.seedWeights=t.payload,e.shouldGenerateVariations=!0,e.variationAmount=0},resetParametersState:e=>({...e,...yk}),setShouldRandomizeSeed:(e,t)=>{e.shouldRandomizeSeed=t.payload},clearInitialImage:e=>{e.initialImage=void 0},setMaskBlur:(e,t)=>{e.maskBlur=t.payload},setMaskBlurMethod:(e,t)=>{e.maskBlurMethod=t.payload},setCanvasCoherenceMode:(e,t)=>{e.canvasCoherenceMode=t.payload},setCanvasCoherenceSteps:(e,t)=>{e.canvasCoherenceSteps=t.payload},setCanvasCoherenceStrength:(e,t)=>{e.canvasCoherenceStrength=t.payload},setInfillMethod:(e,t)=>{e.infillMethod=t.payload},setInfillTileSize:(e,t)=>{e.infillTileSize=t.payload},setInfillPatchmatchDownscaleSize:(e,t)=>{e.infillPatchmatchDownscaleSize=t.payload},setShouldUseSymmetry:(e,t)=>{e.shouldUseSymmetry=t.payload},setHorizontalSymmetrySteps:(e,t)=>{e.horizontalSymmetrySteps=t.payload},setVerticalSymmetrySteps:(e,t)=>{e.verticalSymmetrySteps=t.payload},initialImageChanged:(e,t)=>{const{image_name:n,width:r,height:i}=t.payload;e.initialImage={imageName:n,width:r,height:i}},modelChanged:(e,t)=>{if(e.model=t.payload,e.model===null)return;const{maxClip:n}=Dae[e.model.base_model];e.clipSkip=Nu(e.clipSkip,0,n)},vaeSelected:(e,t)=>{e.vae=t.payload},vaePrecisionChanged:(e,t)=>{e.vaePrecision=t.payload},setClipSkip:(e,t)=>{e.clipSkip=t.payload},shouldUseCpuNoiseChanged:(e,t)=>{e.shouldUseCpuNoise=t.payload},setAspectRatio:(e,t)=>{const n=t.payload;e.aspectRatio=n,n&&(e.height=Wa(e.width/n,8))},setShouldLockAspectRatio:(e,t)=>{e.shouldLockAspectRatio=t.payload}},extraReducers:e=>{e.addCase(Nae,(t,n)=>{var i;const r=(i=n.payload.sd)==null?void 0:i.defaultModel;if(r&&!t.model){const[o,a,s]=r.split("/"),l=YS.safeParse({model_name:s,base_model:o,model_type:a});l.success&&(t.model=l.data)}})}}),{clampSymmetrySteps:PUe,clearInitialImage:vk,resetParametersState:IUe,resetSeed:RUe,setCfgScale:OUe,setWidth:tI,setHeight:nI,toggleSize:MUe,setImg2imgStrength:NUe,setInfillMethod:ele,setIterations:$Ue,setPerlin:DUe,setPositivePrompt:tle,setNegativePrompt:LUe,setScheduler:FUe,setMaskBlur:BUe,setMaskBlurMethod:zUe,setCanvasCoherenceMode:jUe,setCanvasCoherenceSteps:UUe,setCanvasCoherenceStrength:VUe,setSeed:GUe,setSeedWeights:qUe,setShouldFitToWidthHeight:HUe,setShouldGenerateVariations:WUe,setShouldRandomizeSeed:KUe,setSteps:QUe,setThreshold:XUe,setInfillTileSize:YUe,setInfillPatchmatchDownscaleSize:ZUe,setVariationAmount:JUe,setShouldUseSymmetry:eVe,setHorizontalSymmetrySteps:tVe,setVerticalSymmetrySteps:nVe,initialImageChanged:ZS,modelChanged:$u,vaeSelected:EB,setSeamlessXAxis:rVe,setSeamlessYAxis:iVe,setClipSkip:oVe,shouldUseCpuNoiseChanged:aVe,setAspectRatio:nle,setShouldLockAspectRatio:sVe,vaePrecisionChanged:lVe}=CB.actions,rle=CB.reducer,cv=(e,t,n,r,i,o,a)=>{const s=Math.floor(e/2-(n+i/2)*a),l=Math.floor(t/2-(r+o/2)*a);return{x:s,y:l}},dv=(e,t,n,r,i=.95)=>{const o=e*i/n,a=t*i/r,s=Math.min(1,Math.min(o,a));return s||1},uVe=.999,cVe=.1,dVe=20,fv=.95,fVe=30,hVe=10,ile=e=>({x:Math.floor(e.x),y:Math.floor(e.y)}),af=e=>{const{width:t,height:n}=e,r={width:t,height:n},i=512*512,o=t/n;let a=t*n,s=448;for(;a<i;)if(s+=64,t===n){r.width=512,r.height=512;break}else o>1?(r.width=s,r.height=Wa(s/o,64)):o<1&&(r.height=s,r.width=Wa(s*o,64)),a=r.width*r.height;return r},ole=e=>({width:Wa(e.width,64),height:Wa(e.height,64)}),pVe=[{label:"Base",value:"base"},{label:"Mask",value:"mask"}],gVe=[{label:"None",value:"none"},{label:"Auto",value:"auto"},{label:"Manual",value:"manual"}],TB=e=>e.kind==="line"&&e.layer==="mask",mVe=e=>e.kind==="line"&&e.layer==="base",ale=e=>e.kind==="image"&&e.layer==="base",yVe=e=>e.kind==="fillRect"&&e.layer==="base",vVe=e=>e.kind==="eraseRect"&&e.layer==="base",sle=e=>e.kind==="line",vg={objects:[],stagingArea:{images:[],selectedImageIndex:-1}},kB={boundingBoxCoordinates:{x:0,y:0},boundingBoxDimensions:{width:512,height:512},boundingBoxPreviewFill:{r:0,g:0,b:0,a:.5},boundingBoxScaleMethod:"none",brushColor:{r:90,g:90,b:255,a:1},brushSize:50,colorPickerColor:{r:90,g:90,b:255,a:1},cursorPosition:null,futureLayerStates:[],isDrawing:!1,isMaskEnabled:!0,isMouseOverBoundingBox:!1,isMoveBoundingBoxKeyHeld:!1,isMoveStageKeyHeld:!1,isMovingBoundingBox:!1,isMovingStage:!1,isTransformingBoundingBox:!1,layer:"base",layerState:vg,maskColor:{r:255,g:90,b:90,a:1},maxHistory:128,minimumStageScale:1,pastLayerStates:[],scaledBoundingBoxDimensions:{width:512,height:512},shouldAntialias:!0,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",batchIds:[]},AB=rr({name:"canvas",initialState:kB,reducers:{setTool:(e,t)=>{const n=t.payload;e.tool=t.payload,n!=="move"&&(e.isTransformingBoundingBox=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1)},setLayer:(e,t)=>{e.layer=t.payload},toggleTool:e=>{const t=e.tool;t!=="move"&&(e.tool=t==="brush"?"eraser":"brush")},setMaskColor:(e,t)=>{e.maskColor=t.payload},setBrushColor:(e,t)=>{e.brushColor=t.payload},setBrushSize:(e,t)=>{e.brushSize=t.payload},clearMask:e=>{e.pastLayerStates.push(Cn(e.layerState)),e.layerState.objects=e.layerState.objects.filter(t=>!TB(t)),e.futureLayerStates=[],e.shouldPreserveMaskedArea=!1},toggleShouldInvertMask:e=>{e.shouldPreserveMaskedArea=!e.shouldPreserveMaskedArea},toggleShouldShowMask:e=>{e.isMaskEnabled=!e.isMaskEnabled},setShouldPreserveMaskedArea:(e,t)=>{e.shouldPreserveMaskedArea=t.payload},setIsMaskEnabled:(e,t)=>{e.isMaskEnabled=t.payload,e.layer=t.payload?"mask":"base"},setShouldShowCheckboardTransparency:(e,t)=>{e.shouldShowCheckboardTransparency=t.payload},setShouldShowBrushPreview:(e,t)=>{e.shouldShowBrushPreview=t.payload},setShouldShowBrush:(e,t)=>{e.shouldShowBrush=t.payload},setCursorPosition:(e,t)=>{e.cursorPosition=t.payload},setInitialCanvasImage:(e,t)=>{const n=t.payload,{width:r,height:i}=n,{stageDimensions:o}=e,a={width:lv(Nu(r,64,512),64),height:lv(Nu(i,64,512),64)},s={x:Wa(r/2-a.width/2,64),y:Wa(i/2-a.height/2,64)};if(e.boundingBoxScaleMethod==="auto"){const c=af(a);e.scaledBoundingBoxDimensions=c}e.boundingBoxDimensions=a,e.boundingBoxCoordinates=s,e.pastLayerStates.push(Cn(e.layerState)),e.layerState={...Cn(vg),objects:[{kind:"image",layer:"base",x:0,y:0,width:r,height:i,imageName:n.image_name}]},e.futureLayerStates=[],e.batchIds=[];const l=dv(o.width,o.height,r,i,fv),u=cv(o.width,o.height,0,0,r,i,l);e.stageScale=l,e.stageCoordinates=u},setBoundingBoxDimensions:(e,t)=>{const n=ole(t.payload);if(e.boundingBoxDimensions=n,e.boundingBoxScaleMethod==="auto"){const r=af(n);e.scaledBoundingBoxDimensions=r}},flipBoundingBoxAxes:e=>{const[t,n]=[e.boundingBoxDimensions.width,e.boundingBoxDimensions.height],[r,i]=[e.scaledBoundingBoxDimensions.width,e.scaledBoundingBoxDimensions.height];e.boundingBoxDimensions={width:n,height:t},e.scaledBoundingBoxDimensions={width:i,height:r}},setBoundingBoxCoordinates:(e,t)=>{e.boundingBoxCoordinates=ile(t.payload)},setStageCoordinates:(e,t)=>{e.stageCoordinates=t.payload},setBoundingBoxPreviewFill:(e,t)=>{e.boundingBoxPreviewFill=t.payload},setStageScale:(e,t)=>{e.stageScale=t.payload},setShouldDarkenOutsideBoundingBox:(e,t)=>{e.shouldDarkenOutsideBoundingBox=t.payload},setIsDrawing:(e,t)=>{e.isDrawing=t.payload},clearCanvasHistory:e=>{e.pastLayerStates=[],e.futureLayerStates=[]},setShouldLockBoundingBox:(e,t)=>{e.shouldLockBoundingBox=t.payload},toggleShouldLockBoundingBox:e=>{e.shouldLockBoundingBox=!e.shouldLockBoundingBox},setShouldShowBoundingBox:(e,t)=>{e.shouldShowBoundingBox=t.payload},setIsTransformingBoundingBox:(e,t)=>{e.isTransformingBoundingBox=t.payload},setIsMovingBoundingBox:(e,t)=>{e.isMovingBoundingBox=t.payload},setIsMouseOverBoundingBox:(e,t)=>{e.isMouseOverBoundingBox=t.payload},setIsMoveBoundingBoxKeyHeld:(e,t)=>{e.isMoveBoundingBoxKeyHeld=t.payload},setIsMoveStageKeyHeld:(e,t)=>{e.isMoveStageKeyHeld=t.payload},canvasBatchIdAdded:(e,t)=>{e.batchIds.push(t.payload)},canvasBatchIdsReset:e=>{e.batchIds=[]},stagingAreaInitialized:(e,t)=>{const{boundingBox:n}=t.payload;e.layerState.stagingArea={boundingBox:n,images:[],selectedImageIndex:-1}},addImageToStagingArea:(e,t)=>{const n=t.payload;!n||!e.layerState.stagingArea.boundingBox||(e.pastLayerStates.push(Cn(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea.images.push({kind:"image",layer:"base",...e.layerState.stagingArea.boundingBox,imageName:n.image_name}),e.layerState.stagingArea.selectedImageIndex=e.layerState.stagingArea.images.length-1,e.futureLayerStates=[])},discardStagedImages:e=>{e.pastLayerStates.push(Cn(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.stagingArea=Cn(Cn(vg)).stagingArea,e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0,e.batchIds=[]},addFillRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n,brushColor:r}=e;e.pastLayerStates.push(Cn(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"fillRect",layer:"base",...t,...n,color:r}),e.futureLayerStates=[]},addEraseRect:e=>{const{boundingBoxCoordinates:t,boundingBoxDimensions:n}=e;e.pastLayerStates.push(Cn(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState.objects.push({kind:"eraseRect",layer:"base",...t,...n}),e.futureLayerStates=[]},addLine:(e,t)=>{const{tool:n,layer:r,brushColor:i,brushSize:o,shouldRestrictStrokesToBox:a}=e;if(n==="move"||n==="colorPicker")return;const s=o/2,l=r==="base"&&n==="brush"?{color:i}:{};e.pastLayerStates.push(Cn(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const u={kind:"line",layer:r,tool:n,strokeWidth:s,points:t.payload,...l};a&&(u.clip={...e.boundingBoxCoordinates,...e.boundingBoxDimensions}),e.layerState.objects.push(u),e.futureLayerStates=[]},addPointToCurrentLine:(e,t)=>{const n=e.layerState.objects.findLast(sle);n&&n.points.push(...t.payload)},undo:e=>{const t=e.pastLayerStates.pop();t&&(e.futureLayerStates.unshift(Cn(e.layerState)),e.futureLayerStates.length>e.maxHistory&&e.futureLayerStates.pop(),e.layerState=t)},redo:e=>{const t=e.futureLayerStates.shift();t&&(e.pastLayerStates.push(Cn(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift(),e.layerState=t)},setShouldShowGrid:(e,t)=>{e.shouldShowGrid=t.payload},setIsMovingStage:(e,t)=>{e.isMovingStage=t.payload},setShouldSnapToGrid:(e,t)=>{e.shouldSnapToGrid=t.payload},setShouldAutoSave:(e,t)=>{e.shouldAutoSave=t.payload},setShouldShowIntermediates:(e,t)=>{e.shouldShowIntermediates=t.payload},resetCanvas:e=>{e.pastLayerStates.push(Cn(e.layerState)),e.layerState=Cn(vg),e.futureLayerStates=[],e.batchIds=[]},canvasResized:(e,t)=>{const{width:n,height:r}=t.payload,i={width:Math.floor(n),height:Math.floor(r)};if(e.stageDimensions=i,!e.layerState.objects.find(ale)){const o=dv(i.width,i.height,512,512,fv),a=cv(i.width,i.height,0,0,512,512,o),s={width:512,height:512};if(e.stageScale=o,e.stageCoordinates=a,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=s,e.boundingBoxScaleMethod==="auto"){const l=af(s);e.scaledBoundingBoxDimensions=l}}},resetCanvasView:(e,t)=>{const{contentRect:n,shouldScaleTo1:r}=t.payload,{stageDimensions:{width:i,height:o}}=e,{x:a,y:s,width:l,height:u}=n;if(l!==0&&u!==0){const c=r?1:dv(i,o,l,u,fv),d=cv(i,o,a,s,l,u,c);e.stageScale=c,e.stageCoordinates=d}else{const c=dv(i,o,512,512,fv),d=cv(i,o,0,0,512,512,c),f={width:512,height:512};if(e.stageScale=c,e.stageCoordinates=d,e.boundingBoxCoordinates={x:0,y:0},e.boundingBoxDimensions=f,e.boundingBoxScaleMethod==="auto"){const h=af(f);e.scaledBoundingBoxDimensions=h}}},nextStagingAreaImage:e=>{if(!e.layerState.stagingArea.images.length)return;const t=e.layerState.stagingArea.selectedImageIndex+1,n=e.layerState.stagingArea.images.length-1;e.layerState.stagingArea.selectedImageIndex=t>n?0:t},prevStagingAreaImage:e=>{if(!e.layerState.stagingArea.images.length)return;const t=e.layerState.stagingArea.selectedImageIndex-1,n=e.layerState.stagingArea.images.length-1;e.layerState.stagingArea.selectedImageIndex=t<0?n:t},commitStagingAreaImage:e=>{if(!e.layerState.stagingArea.images.length)return;const{images:t,selectedImageIndex:n}=e.layerState.stagingArea;e.pastLayerStates.push(Cn(e.layerState)),e.pastLayerStates.length>e.maxHistory&&e.pastLayerStates.shift();const r=t[n];r&&e.layerState.objects.push({...r}),e.layerState.stagingArea=Cn(vg).stagingArea,e.futureLayerStates=[],e.shouldShowStagingOutline=!0,e.shouldShowStagingImage=!0,e.batchIds=[]},fitBoundingBoxToStage:e=>{const{boundingBoxDimensions:t,boundingBoxCoordinates:n,stageDimensions:r,stageScale:i}=e,o=r.width/i,a=r.height/i;if(n.x<0||n.x+t.width>o||n.y<0||n.y+t.height>a){const s={width:lv(Nu(o,64,512),64),height:lv(Nu(a,64,512),64)},l={x:Wa(o/2-s.width/2,64),y:Wa(a/2-s.height/2,64)};if(e.boundingBoxDimensions=s,e.boundingBoxCoordinates=l,e.boundingBoxScaleMethod==="auto"){const u=af(s);e.scaledBoundingBoxDimensions=u}}},setBoundingBoxScaleMethod:(e,t)=>{if(e.boundingBoxScaleMethod=t.payload,t.payload==="auto"){const n=af(e.boundingBoxDimensions);e.scaledBoundingBoxDimensions=n}},setScaledBoundingBoxDimensions:(e,t)=>{e.scaledBoundingBoxDimensions=t.payload},setShouldShowStagingImage:(e,t)=>{e.shouldShowStagingImage=t.payload},setShouldShowStagingOutline:(e,t)=>{e.shouldShowStagingOutline=t.payload},setShouldShowCanvasDebugInfo:(e,t)=>{e.shouldShowCanvasDebugInfo=t.payload},setShouldRestrictStrokesToBox:(e,t)=>{e.shouldRestrictStrokesToBox=t.payload},setShouldAntialias:(e,t)=>{e.shouldAntialias=t.payload},setShouldCropToBoundingBoxOnSave:(e,t)=>{e.shouldCropToBoundingBoxOnSave=t.payload},setColorPickerColor:(e,t)=>{e.colorPickerColor=t.payload},commitColorPickerColor:e=>{e.brushColor={...e.colorPickerColor,a:e.brushColor.a},e.tool="brush"},setMergedCanvas:(e,t)=>{e.pastLayerStates.push(Cn(e.layerState)),e.futureLayerStates=[],e.layerState.objects=[t.payload]},resetCanvasInteractionState:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMoveBoundingBoxKeyHeld=!1,e.isMoveStageKeyHeld=!1,e.isMovingBoundingBox=!1,e.isMovingStage=!1,e.isTransformingBoundingBox=!1},mouseLeftCanvas:e=>{e.cursorPosition=null,e.isDrawing=!1,e.isMouseOverBoundingBox=!1,e.isMovingBoundingBox=!1,e.isTransformingBoundingBox=!1}},extraReducers:e=>{e.addCase(nle,(t,n)=>{const r=n.payload;r&&(t.boundingBoxDimensions.height=Wa(t.boundingBoxDimensions.width/r,64),t.scaledBoundingBoxDimensions.height=Wa(t.scaledBoundingBoxDimensions.width/r,64))})}}),{addEraseRect:bVe,addFillRect:_Ve,addImageToStagingArea:lle,addLine:SVe,addPointToCurrentLine:xVe,clearCanvasHistory:wVe,clearMask:CVe,commitColorPickerColor:EVe,commitStagingAreaImage:ule,discardStagedImages:cle,fitBoundingBoxToStage:TVe,mouseLeftCanvas:kVe,nextStagingAreaImage:AVe,prevStagingAreaImage:PVe,redo:IVe,resetCanvas:bk,resetCanvasInteractionState:RVe,resetCanvasView:OVe,setBoundingBoxCoordinates:MVe,setBoundingBoxDimensions:rI,setBoundingBoxPreviewFill:NVe,setBoundingBoxScaleMethod:$Ve,flipBoundingBoxAxes:DVe,setBrushColor:LVe,setBrushSize:FVe,setColorPickerColor:BVe,setCursorPosition:zVe,setInitialCanvasImage:PB,setIsDrawing:jVe,setIsMaskEnabled:UVe,setIsMouseOverBoundingBox:VVe,setIsMoveBoundingBoxKeyHeld:GVe,setIsMoveStageKeyHeld:qVe,setIsMovingBoundingBox:HVe,setIsMovingStage:WVe,setIsTransformingBoundingBox:KVe,setLayer:QVe,setMaskColor:XVe,setMergedCanvas:dle,setShouldAutoSave:YVe,setShouldCropToBoundingBoxOnSave:ZVe,setShouldDarkenOutsideBoundingBox:JVe,setShouldLockBoundingBox:eGe,setShouldPreserveMaskedArea:tGe,setShouldShowBoundingBox:nGe,setShouldShowBrush:rGe,setShouldShowBrushPreview:iGe,setShouldShowCanvasDebugInfo:oGe,setShouldShowCheckboardTransparency:aGe,setShouldShowGrid:sGe,setShouldShowIntermediates:lGe,setShouldShowStagingImage:uGe,setShouldShowStagingOutline:cGe,setShouldSnapToGrid:dGe,setStageCoordinates:fGe,setStageScale:hGe,setTool:pGe,toggleShouldLockBoundingBox:gGe,toggleTool:mGe,undo:yGe,setScaledBoundingBoxDimensions:vGe,setShouldRestrictStrokesToBox:bGe,stagingAreaInitialized:fle,setShouldAntialias:_Ge,canvasResized:SGe,canvasBatchIdAdded:hle,canvasBatchIdsReset:ple}=AB.actions,gle=AB.reducer,mle={isModalOpen:!1,imagesToChange:[]},IB=rr({name:"changeBoardModal",initialState:mle,reducers:{isModalOpenChanged:(e,t)=>{e.isModalOpen=t.payload},imagesToChangeSelected:(e,t)=>{e.imagesToChange=t.payload},changeBoardReset:e=>{e.imagesToChange=[],e.isModalOpen=!1}}}),{isModalOpenChanged:xGe,imagesToChangeSelected:wGe,changeBoardReset:CGe}=IB.actions,yle=IB.reducer;var RB={exports:{}},OB={};const Fo=hS(PZ),Gp=hS(OY),vle=hS(GY);(function(e){var t,n,r=yt&&yt.__generator||function(H,te){var re,de,oe,je,Ge={label:0,sent:function(){if(1&oe[0])throw oe[1];return oe[1]},trys:[],ops:[]};return je={next:ut(0),throw:ut(1),return:ut(2)},typeof Symbol=="function"&&(je[Symbol.iterator]=function(){return this}),je;function ut($e){return function(qe){return function(Ie){if(re)throw new TypeError("Generator is already executing.");for(;Ge;)try{if(re=1,de&&(oe=2&Ie[0]?de.return:Ie[0]?de.throw||((oe=de.return)&&oe.call(de),0):de.next)&&!(oe=oe.call(de,Ie[1])).done)return oe;switch(de=0,oe&&(Ie=[2&Ie[0],oe.value]),Ie[0]){case 0:case 1:oe=Ie;break;case 4:return Ge.label++,{value:Ie[1],done:!1};case 5:Ge.label++,de=Ie[1],Ie=[0];continue;case 7:Ie=Ge.ops.pop(),Ge.trys.pop();continue;default:if(!((oe=(oe=Ge.trys).length>0&&oe[oe.length-1])||Ie[0]!==6&&Ie[0]!==2)){Ge=0;continue}if(Ie[0]===3&&(!oe||Ie[1]>oe[0]&&Ie[1]<oe[3])){Ge.label=Ie[1];break}if(Ie[0]===6&&Ge.label<oe[1]){Ge.label=oe[1],oe=Ie;break}if(oe&&Ge.label<oe[2]){Ge.label=oe[2],Ge.ops.push(Ie);break}oe[2]&&Ge.ops.pop(),Ge.trys.pop();continue}Ie=te.call(H,Ge)}catch(ie){Ie=[6,ie],de=0}finally{re=oe=0}if(5&Ie[0])throw Ie[1];return{value:Ie[0]?Ie[1]:void 0,done:!0}}([$e,qe])}}},i=yt&&yt.__spreadArray||function(H,te){for(var re=0,de=te.length,oe=H.length;re<de;re++,oe++)H[oe]=te[re];return H},o=Object.create,a=Object.defineProperty,s=Object.defineProperties,l=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,m=function(H,te,re){return te in H?a(H,te,{enumerable:!0,configurable:!0,writable:!0,value:re}):H[te]=re},_=function(H,te){for(var re in te||(te={}))h.call(te,re)&&m(H,re,te[re]);if(d)for(var de=0,oe=d(te);de<oe.length;de++)p.call(te,re=oe[de])&&m(H,re,te[re]);return H},b=function(H,te){return s(H,u(te))},y=function(H){return a(H,"__esModule",{value:!0})},g=function(H,te){var re={};for(var de in H)h.call(H,de)&&te.indexOf(de)<0&&(re[de]=H[de]);if(H!=null&&d)for(var oe=0,je=d(H);oe<je.length;oe++)te.indexOf(de=je[oe])<0&&p.call(H,de)&&(re[de]=H[de]);return re},v=function(H){return function(te,re,de){if(re&&typeof re=="object"||typeof re=="function")for(var oe=function(ut){h.call(te,ut)||ut==="default"||a(te,ut,{get:function(){return re[ut]},enumerable:!(de=l(re,ut))||de.enumerable})},je=0,Ge=c(re);je<Ge.length;je++)oe(Ge[je]);return te}(y(a(H!=null?o(f(H)):{},"default",H&&H.__esModule&&"default"in H?{get:function(){return H.default},enumerable:!0}:{value:H,enumerable:!0})),H)},S=function(H,te,re){return new Promise(function(de,oe){var je=function($e){try{ut(re.next($e))}catch(qe){oe(qe)}},Ge=function($e){try{ut(re.throw($e))}catch(qe){oe(qe)}},ut=function($e){return $e.done?de($e.value):Promise.resolve($e.value).then(je,Ge)};ut((re=re.apply(H,te)).next())})};y(e),function(H,te){for(var re in te)a(H,re,{get:te[re],enumerable:!0})}(e,{QueryStatus:function(){return t},buildCreateApi:function(){return po},copyWithStructuralSharing:function(){return C},coreModule:function(){return ri},createApi:function(){return ll},defaultSerializeQueryArgs:function(){return Qi},fakeBaseQuery:function(){return al},fetchBaseQuery:function(){return E},retry:function(){return M},setupListeners:function(){return ee},skipSelector:function(){return Br},skipToken:function(){return pr}}),(n=t||(t={})).uninitialized="uninitialized",n.pending="pending",n.fulfilled="fulfilled",n.rejected="rejected";var w=function(H){return[].concat.apply([],H)},x=v(Fo).isPlainObject;function C(H,te){if(H===te||!(x(H)&&x(te)||Array.isArray(H)&&Array.isArray(te)))return te;for(var re=Object.keys(te),de=Object.keys(H),oe=re.length===de.length,je=Array.isArray(te)?[]:{},Ge=0,ut=re;Ge<ut.length;Ge++){var $e=ut[Ge];je[$e]=C(H[$e],te[$e]),oe&&(oe=H[$e]===je[$e])}return oe?H:je}var k=v(Fo),T=function(){for(var H=[],te=0;te<arguments.length;te++)H[te]=arguments[te];return fetch.apply(void 0,H)},P=function(H){return H.status>=200&&H.status<=299},$=function(H){return/ion\/(vnd\.api\+)?json/.test(H.get("content-type")||"")};function O(H){if(!(0,k.isPlainObject)(H))return H;for(var te=_({},H),re=0,de=Object.entries(te);re<de.length;re++){var oe=de[re];oe[1]===void 0&&delete te[oe[0]]}return te}function E(H){var te=this;H===void 0&&(H={});var re=H.baseUrl,de=H.prepareHeaders,oe=de===void 0?function(wt){return wt}:de,je=H.fetchFn,Ge=je===void 0?T:je,ut=H.paramsSerializer,$e=H.isJsonContentType,qe=$e===void 0?$:$e,Ie=H.jsonContentType,ie=Ie===void 0?"application/json":Ie,Se=H.jsonReplacer,Ye=H.timeout,Ze=H.responseHandler,ct=H.validateStatus,dt=g(H,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&Ge===T&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(wt,Tt){return S(te,null,function(){var dn,fn,$i,Lo,Di,Sr,vi,Xn,mo,Fa,it,hn,rn,or,xr,bi,Sn,Nt,Wt,xn,on,mn,xe,Je,Ue,ke,He,ft,Ve,we,ue,Ee,fe,ge,Ce,et;return r(this,function(Qe){switch(Qe.label){case 0:return dn=Tt.signal,fn=Tt.getState,$i=Tt.extra,Lo=Tt.endpoint,Di=Tt.forced,Sr=Tt.type,mo=(Xn=typeof wt=="string"?{url:wt}:wt).url,it=(Fa=Xn.headers)===void 0?new Headers(dt.headers):Fa,rn=(hn=Xn.params)===void 0?void 0:hn,xr=(or=Xn.responseHandler)===void 0?Ze??"json":or,Sn=(bi=Xn.validateStatus)===void 0?ct??P:bi,Wt=(Nt=Xn.timeout)===void 0?Ye:Nt,xn=g(Xn,["url","headers","params","responseHandler","validateStatus","timeout"]),on=_(b(_({},dt),{signal:dn}),xn),it=new Headers(O(it)),mn=on,[4,oe(it,{getState:fn,extra:$i,endpoint:Lo,forced:Di,type:Sr})];case 1:mn.headers=Qe.sent()||it,xe=function(Ae){return typeof Ae=="object"&&((0,k.isPlainObject)(Ae)||Array.isArray(Ae)||typeof Ae.toJSON=="function")},!on.headers.has("content-type")&&xe(on.body)&&on.headers.set("content-type",ie),xe(on.body)&&qe(on.headers)&&(on.body=JSON.stringify(on.body,Se)),rn&&(Je=~mo.indexOf("?")?"&":"?",Ue=ut?ut(rn):new URLSearchParams(O(rn)),mo+=Je+Ue),mo=function(Ae,kt){if(!Ae)return kt;if(!kt)return Ae;if(function(Gt){return new RegExp("(^|:)//").test(Gt)}(kt))return kt;var Ut=Ae.endsWith("/")||!kt.startsWith("?")?"/":"";return Ae=function(Gt){return Gt.replace(/\/$/,"")}(Ae),""+Ae+Ut+function(Gt){return Gt.replace(/^\//,"")}(kt)}(re,mo),ke=new Request(mo,on),He=ke.clone(),vi={request:He},Ve=!1,we=Wt&&setTimeout(function(){Ve=!0,Tt.abort()},Wt),Qe.label=2;case 2:return Qe.trys.push([2,4,5,6]),[4,Ge(ke)];case 3:return ft=Qe.sent(),[3,6];case 4:return ue=Qe.sent(),[2,{error:{status:Ve?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ue)},meta:vi}];case 5:return we&&clearTimeout(we),[7];case 6:Ee=ft.clone(),vi.response=Ee,ge="",Qe.label=7;case 7:return Qe.trys.push([7,9,,10]),[4,Promise.all([_t(ft,xr).then(function(Ae){return fe=Ae},function(Ae){return Ce=Ae}),Ee.text().then(function(Ae){return ge=Ae},function(){})])];case 8:if(Qe.sent(),Ce)throw Ce;return[3,10];case 9:return et=Qe.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:ft.status,data:ge,error:String(et)},meta:vi}];case 10:return[2,Sn(ft,fe)?{data:fe,meta:vi}:{error:{status:ft.status,data:fe},meta:vi}]}})})};function _t(wt,Tt){return S(this,null,function(){var dn;return r(this,function(fn){switch(fn.label){case 0:return typeof Tt=="function"?[2,Tt(wt)]:(Tt==="content-type"&&(Tt=qe(wt.headers)?"json":"text"),Tt!=="json"?[3,2]:[4,wt.text()]);case 1:return[2,(dn=fn.sent()).length?JSON.parse(dn):null];case 2:return[2,wt.text()]}})})}}var A=function(H,te){te===void 0&&(te=void 0),this.value=H,this.meta=te};function D(H,te){return H===void 0&&(H=0),te===void 0&&(te=5),S(this,null,function(){var re,de;return r(this,function(oe){switch(oe.label){case 0:return re=Math.min(H,te),de=~~((Math.random()+.4)*(300<<re)),[4,new Promise(function(je){return setTimeout(function(Ge){return je(Ge)},de)})];case 1:return oe.sent(),[2]}})})}var L={},M=Object.assign(function(H,te){return function(re,de,oe){return S(void 0,null,function(){var je,Ge,ut,$e,qe,Ie,ie;return r(this,function(Se){switch(Se.label){case 0:je=[5,(te||L).maxRetries,(oe||L).maxRetries].filter(function(Ye){return Ye!==void 0}),Ge=je.slice(-1)[0],ut=function(Ye,Ze,ct){return ct.attempt<=Ge},$e=_(_({maxRetries:Ge,backoff:D,retryCondition:ut},te),oe),qe=0,Se.label=1;case 1:Se.label=2;case 2:return Se.trys.push([2,4,,6]),[4,H(re,de,oe)];case 3:if((Ie=Se.sent()).error)throw new A(Ie);return[2,Ie];case 4:if(ie=Se.sent(),qe++,ie.throwImmediately){if(ie instanceof A)return[2,ie.value];throw ie}return ie instanceof A&&!$e.retryCondition(ie.value.error,re,{attempt:qe,baseQueryApi:de,extraOptions:oe})?[2,ie.value]:[4,$e.backoff(qe,$e.maxRetries)];case 5:return Se.sent(),[3,6];case 6:return[3,1];case 7:return[2]}})})}},{fail:function(H){throw Object.assign(new A({error:H}),{throwImmediately:!0})}}),R=v(Fo),N=(0,R.createAction)("__rtkq/focused"),B=(0,R.createAction)("__rtkq/unfocused"),U=(0,R.createAction)("__rtkq/online"),G=(0,R.createAction)("__rtkq/offline"),Z=!1;function ee(H,te){return te?te(H,{onFocus:N,onFocusLost:B,onOffline:G,onOnline:U}):(re=function(){return H(N())},de=function(){return H(U())},oe=function(){return H(G())},je=function(){window.document.visibilityState==="visible"?re():H(B())},Z||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",je,!1),window.addEventListener("focus",re,!1),window.addEventListener("online",de,!1),window.addEventListener("offline",oe,!1),Z=!0),function(){window.removeEventListener("focus",re),window.removeEventListener("visibilitychange",je),window.removeEventListener("online",de),window.removeEventListener("offline",oe),Z=!1});var re,de,oe,je}var J,j,Q=v(Fo);function ne(H){return H.type===J.query}function se(H,te,re,de,oe,je){return typeof H=="function"?H(te,re,de,oe).map(ye).map(je):Array.isArray(H)?H.map(ye).map(je):[]}function ye(H){return typeof H=="string"?{type:H}:H}(j=J||(J={})).query="query",j.mutation="mutation";var ce=v(Fo);function bt(H){return H!=null}var ot=Symbol("forceQueryFn"),ze=function(H){return typeof H[ot]=="function"},mt=v(Fo),Pe=v(Gp),en=v(Fo);function Pr(H){return H}function Ln(H,te,re,de){return se(re[H.meta.arg.endpointName][te],(0,mt.isFulfilled)(H)?H.payload:void 0,(0,mt.isRejectedWithValue)(H)?H.payload:void 0,H.meta.arg.originalArgs,"baseQueryMeta"in H.meta?H.meta.baseQueryMeta:void 0,de)}var An=v(Gp),tn=v(Gp);function Fn(H,te,re){var de=H[te];de&&re(de)}function Ir(H){var te;return(te="arg"in H?H.arg.fixedCacheKey:H.fixedCacheKey)!=null?te:H.requestId}function ho(H,te,re){var de=H[Ir(te)];de&&re(de)}var ei={},pr=Symbol.for("RTKQ/skipToken"),Br=pr,ti={status:t.uninitialized},Bn=(0,Q.createNextState)(ti,function(){}),_n=(0,Q.createNextState)(ti,function(){}),Mi=v(Fo),gi=WeakMap?new WeakMap:void 0,Qi=function(H){var te=H.endpointName,re=H.queryArgs,de="",oe=gi==null?void 0:gi.get(re);if(typeof oe=="string")de=oe;else{var je=JSON.stringify(re,function(Ge,ut){return(0,Mi.isPlainObject)(ut)?Object.keys(ut).sort().reduce(function($e,qe){return $e[qe]=ut[qe],$e},{}):ut});(0,Mi.isPlainObject)(re)&&(gi==null||gi.set(re,je)),de=je}return te+"("+de+")"},Da=v(Fo),Rr=v(vle);function po(){for(var H=[],te=0;te<arguments.length;te++)H[te]=arguments[te];return function(re){var de=(0,Rr.defaultMemoize)(function($e){var qe,Ie;return(Ie=re.extractRehydrationInfo)==null?void 0:Ie.call(re,$e,{reducerPath:(qe=re.reducerPath)!=null?qe:"api"})}),oe=b(_({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},re),{extractRehydrationInfo:de,serializeQueryArgs:function($e){var qe=Qi;if("serializeQueryArgs"in $e.endpointDefinition){var Ie=$e.endpointDefinition.serializeQueryArgs;qe=function(ie){var Se=Ie(ie);return typeof Se=="string"?Se:Qi(b(_({},ie),{queryArgs:Se}))}}else re.serializeQueryArgs&&(qe=re.serializeQueryArgs);return qe($e)},tagTypes:i([],re.tagTypes||[])}),je={endpointDefinitions:{},batch:function($e){$e()},apiUid:(0,Da.nanoid)(),extractRehydrationInfo:de,hasRehydrationInfo:(0,Rr.defaultMemoize)(function($e){return de($e)!=null})},Ge={injectEndpoints:function($e){for(var qe=$e.endpoints({query:function(_t){return b(_({},_t),{type:J.query})},mutation:function(_t){return b(_({},_t),{type:J.mutation})}}),Ie=0,ie=Object.entries(qe);Ie<ie.length;Ie++){var Se=ie[Ie],Ye=Se[0],Ze=Se[1];if($e.overrideExisting||!(Ye in je.endpointDefinitions)){je.endpointDefinitions[Ye]=Ze;for(var ct=0,dt=ut;ct<dt.length;ct++)dt[ct].injectEndpoint(Ye,Ze)}}return Ge},enhanceEndpoints:function($e){var qe=$e.addTagTypes,Ie=$e.endpoints;if(qe)for(var ie=0,Se=qe;ie<Se.length;ie++){var Ye=Se[ie];oe.tagTypes.includes(Ye)||oe.tagTypes.push(Ye)}if(Ie)for(var Ze=0,ct=Object.entries(Ie);Ze<ct.length;Ze++){var dt=ct[Ze],_t=dt[0],wt=dt[1];typeof wt=="function"?wt(je.endpointDefinitions[_t]):Object.assign(je.endpointDefinitions[_t]||{},wt)}return Ge}},ut=H.map(function($e){return $e.init(Ge,oe,je)});return Ge.injectEndpoints({endpoints:re.endpoints})}}function al(){return function(){throw new Error("When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.")}}var Do,sl=v(Fo),zn=function(H){var te=H.reducerPath,re=H.api,de=H.context,oe=H.internalState,je=re.internalActions,Ge=je.removeQueryResult,ut=je.unsubscribeQueryResult;function $e(ie){var Se=oe.currentSubscriptions[ie];return!!Se&&!function(Ye){for(var Ze in Ye)return!1;return!0}(Se)}var qe={};function Ie(ie,Se,Ye,Ze){var ct,dt=de.endpointDefinitions[Se],_t=(ct=dt==null?void 0:dt.keepUnusedDataFor)!=null?ct:Ze.keepUnusedDataFor;if(_t!==1/0){var wt=Math.max(0,Math.min(_t,2147482647e-3));if(!$e(ie)){var Tt=qe[ie];Tt&&clearTimeout(Tt),qe[ie]=setTimeout(function(){$e(ie)||Ye.dispatch(Ge({queryCacheKey:ie})),delete qe[ie]},1e3*wt)}}}return function(ie,Se,Ye){var Ze;if(ut.match(ie)){var ct=Se.getState()[te];Ie(Di=ie.payload.queryCacheKey,(Ze=ct.queries[Di])==null?void 0:Ze.endpointName,Se,ct.config)}if(re.util.resetApiState.match(ie))for(var dt=0,_t=Object.entries(qe);dt<_t.length;dt++){var wt=_t[dt],Tt=wt[0],dn=wt[1];dn&&clearTimeout(dn),delete qe[Tt]}if(de.hasRehydrationInfo(ie)){ct=Se.getState()[te];for(var fn=de.extractRehydrationInfo(ie).queries,$i=0,Lo=Object.entries(fn);$i<Lo.length;$i++){var Di,Sr=Lo[$i],vi=Sr[1];Ie(Di=Sr[0],vi==null?void 0:vi.endpointName,Se,ct.config)}}}},nn=v(Fo),zr=function(H){var te=H.reducerPath,re=H.context,de=H.context.endpointDefinitions,oe=H.mutationThunk,je=H.api,Ge=H.assertTagType,ut=H.refetchQuery,$e=je.internalActions.removeQueryResult,qe=(0,nn.isAnyOf)((0,nn.isFulfilled)(oe),(0,nn.isRejectedWithValue)(oe));function Ie(ie,Se){var Ye=Se.getState(),Ze=Ye[te],ct=je.util.selectInvalidatedBy(Ye,ie);re.batch(function(){for(var dt,_t=0,wt=Array.from(ct.values());_t<wt.length;_t++){var Tt=wt[_t].queryCacheKey,dn=Ze.queries[Tt],fn=(dt=Ze.subscriptions[Tt])!=null?dt:{};dn&&(Object.keys(fn).length===0?Se.dispatch($e({queryCacheKey:Tt})):dn.status!==t.uninitialized&&Se.dispatch(ut(dn,Tt)))}})}return function(ie,Se){qe(ie)&&Ie(Ln(ie,"invalidatesTags",de,Ge),Se),je.util.invalidateTags.match(ie)&&Ie(se(ie.payload,void 0,void 0,void 0,void 0,Ge),Se)}},Or=function(H){var te=H.reducerPath,re=H.queryThunk,de=H.api,oe=H.refetchQuery,je=H.internalState,Ge={};function ut(ie,Se){var Ye=ie.queryCacheKey,Ze=Se.getState()[te].queries[Ye];if(Ze&&Ze.status!==t.uninitialized){var ct=Ie(je.currentSubscriptions[Ye]);if(Number.isFinite(ct)){var dt=Ge[Ye];dt!=null&&dt.timeout&&(clearTimeout(dt.timeout),dt.timeout=void 0);var _t=Date.now()+ct,wt=Ge[Ye]={nextPollTimestamp:_t,pollingInterval:ct,timeout:setTimeout(function(){wt.timeout=void 0,Se.dispatch(oe(Ze,Ye))},ct)}}}}function $e(ie,Se){var Ye=ie.queryCacheKey,Ze=Se.getState()[te].queries[Ye];if(Ze&&Ze.status!==t.uninitialized){var ct=Ie(je.currentSubscriptions[Ye]);if(Number.isFinite(ct)){var dt=Ge[Ye],_t=Date.now()+ct;(!dt||_t<dt.nextPollTimestamp)&&ut({queryCacheKey:Ye},Se)}else qe(Ye)}}function qe(ie){var Se=Ge[ie];Se!=null&&Se.timeout&&clearTimeout(Se.timeout),delete Ge[ie]}function Ie(ie){ie===void 0&&(ie={});var Se=Number.POSITIVE_INFINITY;for(var Ye in ie)ie[Ye].pollingInterval&&(Se=Math.min(ie[Ye].pollingInterval,Se));return Se}return function(ie,Se){(de.internalActions.updateSubscriptionOptions.match(ie)||de.internalActions.unsubscribeQueryResult.match(ie))&&$e(ie.payload,Se),(re.pending.match(ie)||re.rejected.match(ie)&&ie.meta.condition)&&$e(ie.meta.arg,Se),(re.fulfilled.match(ie)||re.rejected.match(ie)&&!ie.meta.condition)&&ut(ie.meta.arg,Se),de.util.resetApiState.match(ie)&&function(){for(var Ye=0,Ze=Object.keys(Ge);Ye<Ze.length;Ye++)qe(Ze[Ye])}()}},Mr=v(Fo),ni=new Error("Promise never resolved before cacheEntryRemoved."),Ni=function(H){var te=H.api,re=H.reducerPath,de=H.context,oe=H.queryThunk,je=H.mutationThunk,Ge=(0,Mr.isAsyncThunkAction)(oe),ut=(0,Mr.isAsyncThunkAction)(je),$e=(0,Mr.isFulfilled)(oe,je),qe={};function Ie(ie,Se,Ye,Ze,ct){var dt=de.endpointDefinitions[ie],_t=dt==null?void 0:dt.onCacheEntryAdded;if(_t){var wt={},Tt=new Promise(function(Sr){wt.cacheEntryRemoved=Sr}),dn=Promise.race([new Promise(function(Sr){wt.valueResolved=Sr}),Tt.then(function(){throw ni})]);dn.catch(function(){}),qe[Ye]=wt;var fn=te.endpoints[ie].select(dt.type===J.query?Se:Ye),$i=Ze.dispatch(function(Sr,vi,Xn){return Xn}),Lo=b(_({},Ze),{getCacheEntry:function(){return fn(Ze.getState())},requestId:ct,extra:$i,updateCachedData:dt.type===J.query?function(Sr){return Ze.dispatch(te.util.updateQueryData(ie,Se,Sr))}:void 0,cacheDataLoaded:dn,cacheEntryRemoved:Tt}),Di=_t(Se,Lo);Promise.resolve(Di).catch(function(Sr){if(Sr!==ni)throw Sr})}}return function(ie,Se,Ye){var Ze=function(fn){return Ge(fn)?fn.meta.arg.queryCacheKey:ut(fn)?fn.meta.requestId:te.internalActions.removeQueryResult.match(fn)?fn.payload.queryCacheKey:te.internalActions.removeMutationResult.match(fn)?Ir(fn.payload):""}(ie);if(oe.pending.match(ie)){var ct=Ye[re].queries[Ze],dt=Se.getState()[re].queries[Ze];!ct&&dt&&Ie(ie.meta.arg.endpointName,ie.meta.arg.originalArgs,Ze,Se,ie.meta.requestId)}else if(je.pending.match(ie))(dt=Se.getState()[re].mutations[Ze])&&Ie(ie.meta.arg.endpointName,ie.meta.arg.originalArgs,Ze,Se,ie.meta.requestId);else if($e(ie))(dn=qe[Ze])!=null&&dn.valueResolved&&(dn.valueResolved({data:ie.payload,meta:ie.meta.baseQueryMeta}),delete dn.valueResolved);else if(te.internalActions.removeQueryResult.match(ie)||te.internalActions.removeMutationResult.match(ie))(dn=qe[Ze])&&(delete qe[Ze],dn.cacheEntryRemoved());else if(te.util.resetApiState.match(ie))for(var _t=0,wt=Object.entries(qe);_t<wt.length;_t++){var Tt=wt[_t],dn=Tt[1];delete qe[Tt[0]],dn.cacheEntryRemoved()}}},go=v(Fo),mi=function(H){var te=H.api,re=H.context,de=H.queryThunk,oe=H.mutationThunk,je=(0,go.isPending)(de,oe),Ge=(0,go.isRejected)(de,oe),ut=(0,go.isFulfilled)(de,oe),$e={};return function(qe,Ie){var ie,Se,Ye;if(je(qe)){var Ze=qe.meta,ct=Ze.requestId,dt=Ze.arg,_t=dt.endpointName,wt=dt.originalArgs,Tt=re.endpointDefinitions[_t],dn=Tt==null?void 0:Tt.onQueryStarted;if(dn){var fn={},$i=new Promise(function(Fa,it){fn.resolve=Fa,fn.reject=it});$i.catch(function(){}),$e[ct]=fn;var Lo=te.endpoints[_t].select(Tt.type===J.query?wt:ct),Di=Ie.dispatch(function(Fa,it,hn){return hn}),Sr=b(_({},Ie),{getCacheEntry:function(){return Lo(Ie.getState())},requestId:ct,extra:Di,updateCachedData:Tt.type===J.query?function(Fa){return Ie.dispatch(te.util.updateQueryData(_t,wt,Fa))}:void 0,queryFulfilled:$i});dn(wt,Sr)}}else if(ut(qe)){var vi=qe.meta,Xn=vi.baseQueryMeta;(ie=$e[ct=vi.requestId])==null||ie.resolve({data:qe.payload,meta:Xn}),delete $e[ct]}else if(Ge(qe)){var mo=qe.meta;Xn=mo.baseQueryMeta,(Ye=$e[ct=mo.requestId])==null||Ye.reject({error:(Se=qe.payload)!=null?Se:qe.error,isUnhandledError:!mo.rejectedWithValue,meta:Xn}),delete $e[ct]}}},jr=function(H){var te=H.api,re=H.context.apiUid;return function(de,oe){te.util.resetApiState.match(de)&&oe.dispatch(te.internalActions.middlewareRegistered(re))}},La=v(Gp),gs=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof yt<"u"?yt:globalThis):function(H){return(Do||(Do=Promise.resolve())).then(H).catch(function(te){return setTimeout(function(){throw te},0)})};function yi(H){for(var te=[],re=1;re<arguments.length;re++)te[re-1]=arguments[re];Object.assign.apply(Object,i([H],te))}var ou=v(Gp),oa=Symbol(),ri=function(){return{name:oa,init:function(H,te,re){var de=te.baseQuery,oe=te.reducerPath,je=te.serializeQueryArgs,Ge=te.keepUnusedDataFor,ut=te.refetchOnMountOrArgChange,$e=te.refetchOnFocus,qe=te.refetchOnReconnect;(0,ou.enablePatches)();var Ie=function(it){return it};Object.assign(H,{reducerPath:oe,endpoints:{},internalActions:{onOnline:U,onOffline:G,onFocus:N,onFocusLost:B},util:{}});var ie=function(it){var hn=this,rn=it.reducerPath,or=it.baseQuery,xr=it.context.endpointDefinitions,bi=it.serializeQueryArgs,Sn=it.api,Nt=function(xe,Je){return S(hn,[xe,Je],function(Ue,ke){var He,ft,Ve,we,ue,Ee,fe,ge,Ce,et,Qe,Ae,kt,Ut=ke.signal,Gt=ke.abort,ar=ke.rejectWithValue,gr=ke.fulfillWithValue,jn=ke.dispatch,Pn=ke.getState,Xi=ke.extra;return r(this,function(F){switch(F.label){case 0:He=xr[Ue.endpointName],F.label=1;case 1:return F.trys.push([1,8,,13]),ft=Pr,Ve=void 0,we={signal:Ut,abort:Gt,dispatch:jn,getState:Pn,extra:Xi,endpoint:Ue.endpointName,type:Ue.type,forced:Ue.type==="query"?Wt(Ue,Pn()):void 0},(ue=Ue.type==="query"?Ue[ot]:void 0)?(Ve=ue(),[3,6]):[3,2];case 2:return He.query?[4,or(He.query(Ue.originalArgs),we,He.extraOptions)]:[3,4];case 3:return Ve=F.sent(),He.transformResponse&&(ft=He.transformResponse),[3,6];case 4:return[4,He.queryFn(Ue.originalArgs,we,He.extraOptions,function(V){return or(V,we,He.extraOptions)})];case 5:Ve=F.sent(),F.label=6;case 6:if(Ve.error)throw new A(Ve.error,Ve.meta);return Ee=gr,[4,ft(Ve.data,Ve.meta,Ue.originalArgs)];case 7:return[2,Ee.apply(void 0,[F.sent(),(Ae={fulfilledTimeStamp:Date.now(),baseQueryMeta:Ve.meta},Ae[en.SHOULD_AUTOBATCH]=!0,Ae)])];case 8:if(fe=F.sent(),!((ge=fe)instanceof A))return[3,12];Ce=Pr,He.query&&He.transformErrorResponse&&(Ce=He.transformErrorResponse),F.label=9;case 9:return F.trys.push([9,11,,12]),et=ar,[4,Ce(ge.value,ge.meta,Ue.originalArgs)];case 10:return[2,et.apply(void 0,[F.sent(),(kt={baseQueryMeta:ge.meta},kt[en.SHOULD_AUTOBATCH]=!0,kt)])];case 11:return Qe=F.sent(),ge=Qe,[3,12];case 12:throw console.error(ge),ge;case 13:return[2]}})})};function Wt(xe,Je){var Ue,ke,He,ft,Ve=(ke=(Ue=Je[rn])==null?void 0:Ue.queries)==null?void 0:ke[xe.queryCacheKey],we=(He=Je[rn])==null?void 0:He.config.refetchOnMountOrArgChange,ue=Ve==null?void 0:Ve.fulfilledTimeStamp,Ee=(ft=xe.forceRefetch)!=null?ft:xe.subscribe&&we;return!!Ee&&(Ee===!0||(Number(new Date)-Number(ue))/1e3>=Ee)}var xn=(0,en.createAsyncThunk)(rn+"/executeQuery",Nt,{getPendingMeta:function(){var xe;return(xe={startedTimeStamp:Date.now()})[en.SHOULD_AUTOBATCH]=!0,xe},condition:function(xe,Je){var Ue,ke,He,ft=(0,Je.getState)(),Ve=(ke=(Ue=ft[rn])==null?void 0:Ue.queries)==null?void 0:ke[xe.queryCacheKey],we=Ve==null?void 0:Ve.fulfilledTimeStamp,ue=xe.originalArgs,Ee=Ve==null?void 0:Ve.originalArgs,fe=xr[xe.endpointName];return!(!ze(xe)&&((Ve==null?void 0:Ve.status)==="pending"||!Wt(xe,ft)&&(!ne(fe)||!((He=fe==null?void 0:fe.forceRefetch)!=null&&He.call(fe,{currentArg:ue,previousArg:Ee,endpointState:Ve,state:ft})))&&we))},dispatchConditionRejection:!0}),on=(0,en.createAsyncThunk)(rn+"/executeMutation",Nt,{getPendingMeta:function(){var xe;return(xe={startedTimeStamp:Date.now()})[en.SHOULD_AUTOBATCH]=!0,xe}});function mn(xe){return function(Je){var Ue,ke;return((ke=(Ue=Je==null?void 0:Je.meta)==null?void 0:Ue.arg)==null?void 0:ke.endpointName)===xe}}return{queryThunk:xn,mutationThunk:on,prefetch:function(xe,Je,Ue){return function(ke,He){var ft=function(fe){return"force"in fe}(Ue)&&Ue.force,Ve=function(fe){return"ifOlderThan"in fe}(Ue)&&Ue.ifOlderThan,we=function(fe){return fe===void 0&&(fe=!0),Sn.endpoints[xe].initiate(Je,{forceRefetch:fe})},ue=Sn.endpoints[xe].select(Je)(He());if(ft)ke(we());else if(Ve){var Ee=ue==null?void 0:ue.fulfilledTimeStamp;if(!Ee)return void ke(we());(Number(new Date)-Number(new Date(Ee)))/1e3>=Ve&&ke(we())}else ke(we(!1))}},updateQueryData:function(xe,Je,Ue){return function(ke,He){var ft,Ve,we=Sn.endpoints[xe].select(Je)(He()),ue={patches:[],inversePatches:[],undo:function(){return ke(Sn.util.patchQueryData(xe,Je,ue.inversePatches))}};if(we.status===t.uninitialized)return ue;if("data"in we)if((0,Pe.isDraftable)(we.data)){var Ee=(0,Pe.produceWithPatches)(we.data,Ue),fe=Ee[2];(ft=ue.patches).push.apply(ft,Ee[1]),(Ve=ue.inversePatches).push.apply(Ve,fe)}else{var ge=Ue(we.data);ue.patches.push({op:"replace",path:[],value:ge}),ue.inversePatches.push({op:"replace",path:[],value:we.data})}return ke(Sn.util.patchQueryData(xe,Je,ue.patches)),ue}},upsertQueryData:function(xe,Je,Ue){return function(ke){var He;return ke(Sn.endpoints[xe].initiate(Je,((He={subscribe:!1,forceRefetch:!0})[ot]=function(){return{data:Ue}},He)))}},patchQueryData:function(xe,Je,Ue){return function(ke){ke(Sn.internalActions.queryResultPatched({queryCacheKey:bi({queryArgs:Je,endpointDefinition:xr[xe],endpointName:xe}),patches:Ue}))}},buildMatchThunkActions:function(xe,Je){return{matchPending:(0,mt.isAllOf)((0,mt.isPending)(xe),mn(Je)),matchFulfilled:(0,mt.isAllOf)((0,mt.isFulfilled)(xe),mn(Je)),matchRejected:(0,mt.isAllOf)((0,mt.isRejected)(xe),mn(Je))}}}}({baseQuery:de,reducerPath:oe,context:re,api:H,serializeQueryArgs:je}),Se=ie.queryThunk,Ye=ie.mutationThunk,Ze=ie.patchQueryData,ct=ie.updateQueryData,dt=ie.upsertQueryData,_t=ie.prefetch,wt=ie.buildMatchThunkActions,Tt=function(it){var hn=it.reducerPath,rn=it.queryThunk,or=it.mutationThunk,xr=it.context,bi=xr.endpointDefinitions,Sn=xr.apiUid,Nt=xr.extractRehydrationInfo,Wt=xr.hasRehydrationInfo,xn=it.assertTagType,on=it.config,mn=(0,ce.createAction)(hn+"/resetApiState"),xe=(0,ce.createSlice)({name:hn+"/queries",initialState:ei,reducers:{removeQueryResult:{reducer:function(we,ue){delete we[ue.payload.queryCacheKey]},prepare:(0,ce.prepareAutoBatched)()},queryResultPatched:function(we,ue){var Ee=ue.payload,fe=Ee.patches;Fn(we,Ee.queryCacheKey,function(ge){ge.data=(0,tn.applyPatches)(ge.data,fe.concat())})}},extraReducers:function(we){we.addCase(rn.pending,function(ue,Ee){var fe,ge=Ee.meta,Ce=Ee.meta.arg,et=ze(Ce);(Ce.subscribe||et)&&(ue[fe=Ce.queryCacheKey]!=null||(ue[fe]={status:t.uninitialized,endpointName:Ce.endpointName})),Fn(ue,Ce.queryCacheKey,function(Qe){Qe.status=t.pending,Qe.requestId=et&&Qe.requestId?Qe.requestId:ge.requestId,Ce.originalArgs!==void 0&&(Qe.originalArgs=Ce.originalArgs),Qe.startedTimeStamp=ge.startedTimeStamp})}).addCase(rn.fulfilled,function(ue,Ee){var fe=Ee.meta,ge=Ee.payload;Fn(ue,fe.arg.queryCacheKey,function(Ce){var et;if(Ce.requestId===fe.requestId||ze(fe.arg)){var Qe=bi[fe.arg.endpointName].merge;if(Ce.status=t.fulfilled,Qe)if(Ce.data!==void 0){var Ae=fe.fulfilledTimeStamp,kt=fe.arg,Ut=fe.baseQueryMeta,Gt=fe.requestId,ar=(0,ce.createNextState)(Ce.data,function(gr){return Qe(gr,ge,{arg:kt.originalArgs,baseQueryMeta:Ut,fulfilledTimeStamp:Ae,requestId:Gt})});Ce.data=ar}else Ce.data=ge;else Ce.data=(et=bi[fe.arg.endpointName].structuralSharing)==null||et?C((0,An.isDraft)(Ce.data)?(0,tn.original)(Ce.data):Ce.data,ge):ge;delete Ce.error,Ce.fulfilledTimeStamp=fe.fulfilledTimeStamp}})}).addCase(rn.rejected,function(ue,Ee){var fe=Ee.meta,ge=fe.condition,Ce=fe.requestId,et=Ee.error,Qe=Ee.payload;Fn(ue,fe.arg.queryCacheKey,function(Ae){if(!ge){if(Ae.requestId!==Ce)return;Ae.status=t.rejected,Ae.error=Qe??et}})}).addMatcher(Wt,function(ue,Ee){for(var fe=Nt(Ee).queries,ge=0,Ce=Object.entries(fe);ge<Ce.length;ge++){var et=Ce[ge],Qe=et[1];(Qe==null?void 0:Qe.status)!==t.fulfilled&&(Qe==null?void 0:Qe.status)!==t.rejected||(ue[et[0]]=Qe)}})}}),Je=(0,ce.createSlice)({name:hn+"/mutations",initialState:ei,reducers:{removeMutationResult:{reducer:function(we,ue){var Ee=Ir(ue.payload);Ee in we&&delete we[Ee]},prepare:(0,ce.prepareAutoBatched)()}},extraReducers:function(we){we.addCase(or.pending,function(ue,Ee){var fe=Ee.meta,ge=fe.requestId,Ce=fe.arg,et=fe.startedTimeStamp;Ce.track&&(ue[Ir(Ee.meta)]={requestId:ge,status:t.pending,endpointName:Ce.endpointName,startedTimeStamp:et})}).addCase(or.fulfilled,function(ue,Ee){var fe=Ee.payload,ge=Ee.meta;ge.arg.track&&ho(ue,ge,function(Ce){Ce.requestId===ge.requestId&&(Ce.status=t.fulfilled,Ce.data=fe,Ce.fulfilledTimeStamp=ge.fulfilledTimeStamp)})}).addCase(or.rejected,function(ue,Ee){var fe=Ee.payload,ge=Ee.error,Ce=Ee.meta;Ce.arg.track&&ho(ue,Ce,function(et){et.requestId===Ce.requestId&&(et.status=t.rejected,et.error=fe??ge)})}).addMatcher(Wt,function(ue,Ee){for(var fe=Nt(Ee).mutations,ge=0,Ce=Object.entries(fe);ge<Ce.length;ge++){var et=Ce[ge],Qe=et[0],Ae=et[1];(Ae==null?void 0:Ae.status)!==t.fulfilled&&(Ae==null?void 0:Ae.status)!==t.rejected||Qe===(Ae==null?void 0:Ae.requestId)||(ue[Qe]=Ae)}})}}),Ue=(0,ce.createSlice)({name:hn+"/invalidation",initialState:ei,reducers:{},extraReducers:function(we){we.addCase(xe.actions.removeQueryResult,function(ue,Ee){for(var fe=Ee.payload.queryCacheKey,ge=0,Ce=Object.values(ue);ge<Ce.length;ge++)for(var et=0,Qe=Object.values(Ce[ge]);et<Qe.length;et++){var Ae=Qe[et],kt=Ae.indexOf(fe);kt!==-1&&Ae.splice(kt,1)}}).addMatcher(Wt,function(ue,Ee){for(var fe,ge,Ce,et,Qe=Nt(Ee).provided,Ae=0,kt=Object.entries(Qe);Ae<kt.length;Ae++)for(var Ut=kt[Ae],Gt=Ut[0],ar=0,gr=Object.entries(Ut[1]);ar<gr.length;ar++)for(var jn=gr[ar],Pn=jn[0],Xi=jn[1],F=(et=(ge=(fe=ue[Gt])!=null?fe:ue[Gt]={})[Ce=Pn||"__internal_without_id"])!=null?et:ge[Ce]=[],V=0,X=Xi;V<X.length;V++){var pe=X[V];F.includes(pe)||F.push(pe)}}).addMatcher((0,ce.isAnyOf)((0,ce.isFulfilled)(rn),(0,ce.isRejectedWithValue)(rn)),function(ue,Ee){for(var fe,ge,Ce,et,Qe=Ln(Ee,"providesTags",bi,xn),Ae=Ee.meta.arg.queryCacheKey,kt=0,Ut=Object.values(ue);kt<Ut.length;kt++)for(var Gt=0,ar=Object.values(Ut[kt]);Gt<ar.length;Gt++){var gr=ar[Gt],jn=gr.indexOf(Ae);jn!==-1&&gr.splice(jn,1)}for(var Pn=0,Xi=Qe;Pn<Xi.length;Pn++){var F=Xi[Pn],V=F.type,X=F.id,pe=(et=(ge=(fe=ue[V])!=null?fe:ue[V]={})[Ce=X||"__internal_without_id"])!=null?et:ge[Ce]=[];pe.includes(Ae)||pe.push(Ae)}})}}),ke=(0,ce.createSlice)({name:hn+"/subscriptions",initialState:ei,reducers:{updateSubscriptionOptions:function(we,ue){},unsubscribeQueryResult:function(we,ue){},internal_probeSubscription:function(we,ue){}}}),He=(0,ce.createSlice)({name:hn+"/internalSubscriptions",initialState:ei,reducers:{subscriptionsUpdated:{reducer:function(we,ue){return(0,tn.applyPatches)(we,ue.payload)},prepare:(0,ce.prepareAutoBatched)()}}}),ft=(0,ce.createSlice)({name:hn+"/config",initialState:_({online:typeof navigator>"u"||navigator.onLine===void 0||navigator.onLine,focused:typeof document>"u"||document.visibilityState!=="hidden",middlewareRegistered:!1},on),reducers:{middlewareRegistered:function(we,ue){we.middlewareRegistered=we.middlewareRegistered!=="conflict"&&Sn===ue.payload||"conflict"}},extraReducers:function(we){we.addCase(U,function(ue){ue.online=!0}).addCase(G,function(ue){ue.online=!1}).addCase(N,function(ue){ue.focused=!0}).addCase(B,function(ue){ue.focused=!1}).addMatcher(Wt,function(ue){return _({},ue)})}}),Ve=(0,ce.combineReducers)({queries:xe.reducer,mutations:Je.reducer,provided:Ue.reducer,subscriptions:He.reducer,config:ft.reducer});return{reducer:function(we,ue){return Ve(mn.match(ue)?void 0:we,ue)},actions:b(_(_(_(_(_({},ft.actions),xe.actions),ke.actions),He.actions),Je.actions),{unsubscribeMutationResult:Je.actions.removeMutationResult,resetApiState:mn})}}({context:re,queryThunk:Se,mutationThunk:Ye,reducerPath:oe,assertTagType:Ie,config:{refetchOnFocus:$e,refetchOnReconnect:qe,refetchOnMountOrArgChange:ut,keepUnusedDataFor:Ge,reducerPath:oe}}),dn=Tt.reducer,fn=Tt.actions;yi(H.util,{patchQueryData:Ze,updateQueryData:ct,upsertQueryData:dt,prefetch:_t,resetApiState:fn.resetApiState}),yi(H.internalActions,fn);var $i=function(it){var hn=it.reducerPath,rn=it.queryThunk,or=it.api,xr=it.context,bi=xr.apiUid,Sn={invalidateTags:(0,sl.createAction)(hn+"/invalidateTags")},Nt=[jr,zn,zr,Or,Ni,mi];return{middleware:function(xn){var on=!1,mn=b(_({},it),{internalState:{currentSubscriptions:{}},refetchQuery:Wt}),xe=Nt.map(function(ke){return ke(mn)}),Je=function(ke){var He=ke.api,ft=ke.queryThunk,Ve=ke.internalState,we=He.reducerPath+"/subscriptions",ue=null,Ee=!1,fe=He.internalActions,ge=fe.updateSubscriptionOptions,Ce=fe.unsubscribeQueryResult;return function(et,Qe){var Ae,kt;if(ue||(ue=JSON.parse(JSON.stringify(Ve.currentSubscriptions))),He.util.resetApiState.match(et))return ue=Ve.currentSubscriptions={},[!0,!1];if(He.internalActions.internal_probeSubscription.match(et)){var Ut=et.payload;return[!1,!!((Ae=Ve.currentSubscriptions[Ut.queryCacheKey])!=null&&Ae[Ut.requestId])]}var Gt=function(jn,Pn){var Xi,F,V,X,pe,Ct,pn,In,It;if(ge.match(Pn)){var wn=Pn.payload,_i=wn.queryCacheKey,Yn=wn.requestId;return(Xi=jn==null?void 0:jn[_i])!=null&&Xi[Yn]&&(jn[_i][Yn]=wn.options),!0}if(Ce.match(Pn)){var au=Pn.payload;return Yn=au.requestId,jn[_i=au.queryCacheKey]&&delete jn[_i][Yn],!0}if(He.internalActions.removeQueryResult.match(Pn))return delete jn[Pn.payload.queryCacheKey],!0;if(ft.pending.match(Pn)){var tf=Pn.meta;if(Yn=tf.requestId,(rf=tf.arg).subscribe)return(su=(V=jn[F=rf.queryCacheKey])!=null?V:jn[F]={})[Yn]=(pe=(X=rf.subscriptionOptions)!=null?X:su[Yn])!=null?pe:{},!0}if(ft.rejected.match(Pn)){var su,nf=Pn.meta,rf=nf.arg;if(Yn=nf.requestId,nf.condition&&rf.subscribe)return(su=(pn=jn[Ct=rf.queryCacheKey])!=null?pn:jn[Ct]={})[Yn]=(It=(In=rf.subscriptionOptions)!=null?In:su[Yn])!=null?It:{},!0}return!1}(Ve.currentSubscriptions,et);if(Gt){Ee||(gs(function(){var jn=JSON.parse(JSON.stringify(Ve.currentSubscriptions)),Pn=(0,La.produceWithPatches)(ue,function(){return jn});Qe.next(He.internalActions.subscriptionsUpdated(Pn[1])),ue=jn,Ee=!1}),Ee=!0);var ar=!!((kt=et.type)!=null&&kt.startsWith(we)),gr=ft.rejected.match(et)&&et.meta.condition&&!!et.meta.arg.subscribe;return[!ar&&!gr,!1]}return[!0,!1]}}(mn),Ue=function(ke){var He=ke.reducerPath,ft=ke.context,Ve=ke.refetchQuery,we=ke.internalState,ue=ke.api.internalActions.removeQueryResult;function Ee(fe,ge){var Ce=fe.getState()[He],et=Ce.queries,Qe=we.currentSubscriptions;ft.batch(function(){for(var Ae=0,kt=Object.keys(Qe);Ae<kt.length;Ae++){var Ut=kt[Ae],Gt=et[Ut],ar=Qe[Ut];ar&&Gt&&(Object.values(ar).some(function(gr){return gr[ge]===!0})||Object.values(ar).every(function(gr){return gr[ge]===void 0})&&Ce.config[ge])&&(Object.keys(ar).length===0?fe.dispatch(ue({queryCacheKey:Ut})):Gt.status!==t.uninitialized&&fe.dispatch(Ve(Gt,Ut)))}})}return function(fe,ge){N.match(fe)&&Ee(ge,"refetchOnFocus"),U.match(fe)&&Ee(ge,"refetchOnReconnect")}}(mn);return function(ke){return function(He){on||(on=!0,xn.dispatch(or.internalActions.middlewareRegistered(bi)));var ft,Ve=b(_({},xn),{next:ke}),we=xn.getState(),ue=Je(He,Ve,we),Ee=ue[1];if(ft=ue[0]?ke(He):Ee,xn.getState()[hn]&&(Ue(He,Ve,we),function(Ce){return!!Ce&&typeof Ce.type=="string"&&Ce.type.startsWith(hn+"/")}(He)||xr.hasRehydrationInfo(He)))for(var fe=0,ge=xe;fe<ge.length;fe++)(0,ge[fe])(He,Ve,we);return ft}}},actions:Sn};function Wt(xn,on,mn){return mn===void 0&&(mn={}),rn(_({type:"query",endpointName:xn.endpointName,originalArgs:xn.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:on},mn))}}({reducerPath:oe,context:re,queryThunk:Se,mutationThunk:Ye,api:H,assertTagType:Ie}),Lo=$i.middleware;yi(H.util,$i.actions),yi(H,{reducer:dn,middleware:Lo});var Di=function(it){var hn=it.serializeQueryArgs,rn=it.reducerPath,or=function(Nt){return Bn},xr=function(Nt){return _n};return{buildQuerySelector:function(Nt,Wt){return function(xn){var on=hn({queryArgs:xn,endpointDefinition:Wt,endpointName:Nt});return(0,Q.createSelector)(xn===pr?or:function(mn){var xe,Je,Ue;return(Ue=(Je=(xe=Sn(mn))==null?void 0:xe.queries)==null?void 0:Je[on])!=null?Ue:Bn},bi)}},buildMutationSelector:function(){return function(Nt){var Wt,xn;return xn=typeof Nt=="object"?(Wt=Ir(Nt))!=null?Wt:pr:Nt,(0,Q.createSelector)(xn===pr?xr:function(on){var mn,xe,Je;return(Je=(xe=(mn=Sn(on))==null?void 0:mn.mutations)==null?void 0:xe[xn])!=null?Je:_n},bi)}},selectInvalidatedBy:function(Nt,Wt){for(var xn,on=Nt[rn],mn=new Set,xe=0,Je=Wt.map(ye);xe<Je.length;xe++){var Ue=Je[xe],ke=on.provided[Ue.type];if(ke)for(var He=0,ft=(xn=Ue.id!==void 0?ke[Ue.id]:w(Object.values(ke)))!=null?xn:[];He<ft.length;He++)mn.add(ft[He])}return w(Array.from(mn.values()).map(function(Ve){var we=on.queries[Ve];return we?[{queryCacheKey:Ve,endpointName:we.endpointName,originalArgs:we.originalArgs}]:[]}))}};function bi(Nt){return _(_({},Nt),{status:Wt=Nt.status,isUninitialized:Wt===t.uninitialized,isLoading:Wt===t.pending,isSuccess:Wt===t.fulfilled,isError:Wt===t.rejected});var Wt}function Sn(Nt){return Nt[rn]}}({serializeQueryArgs:je,reducerPath:oe}),Sr=Di.buildQuerySelector,vi=Di.buildMutationSelector;yi(H.util,{selectInvalidatedBy:Di.selectInvalidatedBy});var Xn=function(it){var hn=it.serializeQueryArgs,rn=it.queryThunk,or=it.mutationThunk,xr=it.api,bi=it.context,Sn=new Map,Nt=new Map,Wt=xr.internalActions,xn=Wt.unsubscribeQueryResult,on=Wt.removeMutationResult,mn=Wt.updateSubscriptionOptions;return{buildInitiateQuery:function(xe,Je){var Ue=function(ke,He){var ft=He===void 0?{}:He,Ve=ft.subscribe,we=Ve===void 0||Ve,ue=ft.forceRefetch,Ee=ft.subscriptionOptions,fe=ft[ot];return function(ge,Ce){var et,Qe,Ae=hn({queryArgs:ke,endpointDefinition:Je,endpointName:xe}),kt=rn(((et={type:"query",subscribe:we,forceRefetch:ue,subscriptionOptions:Ee,endpointName:xe,originalArgs:ke,queryCacheKey:Ae})[ot]=fe,et)),Ut=xr.endpoints[xe].select(ke),Gt=ge(kt),ar=Ut(Ce()),gr=Gt.requestId,jn=Gt.abort,Pn=ar.requestId!==gr,Xi=(Qe=Sn.get(ge))==null?void 0:Qe[Ae],F=function(){return Ut(Ce())},V=Object.assign(fe?Gt.then(F):Pn&&!Xi?Promise.resolve(ar):Promise.all([Xi,Gt]).then(F),{arg:ke,requestId:gr,subscriptionOptions:Ee,queryCacheKey:Ae,abort:jn,unwrap:function(){return S(this,null,function(){var pe;return r(this,function(Ct){switch(Ct.label){case 0:return[4,V];case 1:if((pe=Ct.sent()).isError)throw pe.error;return[2,pe.data]}})})},refetch:function(){return ge(Ue(ke,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){we&&ge(xn({queryCacheKey:Ae,requestId:gr}))},updateSubscriptionOptions:function(pe){V.subscriptionOptions=pe,ge(mn({endpointName:xe,requestId:gr,queryCacheKey:Ae,options:pe}))}});if(!Xi&&!Pn&&!fe){var X=Sn.get(ge)||{};X[Ae]=V,Sn.set(ge,X),V.then(function(){delete X[Ae],Object.keys(X).length||Sn.delete(ge)})}return V}};return Ue},buildInitiateMutation:function(xe){return function(Je,Ue){var ke=Ue===void 0?{}:Ue,He=ke.track,ft=He===void 0||He,Ve=ke.fixedCacheKey;return function(we,ue){var Ee=or({type:"mutation",endpointName:xe,originalArgs:Je,track:ft,fixedCacheKey:Ve}),fe=we(Ee),ge=fe.requestId,Ce=fe.abort,et=fe.unwrap,Qe=fe.unwrap().then(function(Gt){return{data:Gt}}).catch(function(Gt){return{error:Gt}}),Ae=function(){we(on({requestId:ge,fixedCacheKey:Ve}))},kt=Object.assign(Qe,{arg:fe.arg,requestId:ge,abort:Ce,unwrap:et,unsubscribe:Ae,reset:Ae}),Ut=Nt.get(we)||{};return Nt.set(we,Ut),Ut[ge]=kt,kt.then(function(){delete Ut[ge],Object.keys(Ut).length||Nt.delete(we)}),Ve&&(Ut[Ve]=kt,kt.then(function(){Ut[Ve]===kt&&(delete Ut[Ve],Object.keys(Ut).length||Nt.delete(we))})),kt}}},getRunningQueryThunk:function(xe,Je){return function(Ue){var ke,He=hn({queryArgs:Je,endpointDefinition:bi.endpointDefinitions[xe],endpointName:xe});return(ke=Sn.get(Ue))==null?void 0:ke[He]}},getRunningMutationThunk:function(xe,Je){return function(Ue){var ke;return(ke=Nt.get(Ue))==null?void 0:ke[Je]}},getRunningQueriesThunk:function(){return function(xe){return Object.values(Sn.get(xe)||{}).filter(bt)}},getRunningMutationsThunk:function(){return function(xe){return Object.values(Nt.get(xe)||{}).filter(bt)}},getRunningOperationPromises:function(){var xe=function(Je){return Array.from(Je.values()).flatMap(function(Ue){return Ue?Object.values(Ue):[]})};return i(i([],xe(Sn)),xe(Nt)).filter(bt)},removalWarning:function(){throw new Error(`This method had to be removed due to a conceptual bug in RTK.
|
||
Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.
|
||
See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.`)}}}({queryThunk:Se,mutationThunk:Ye,api:H,serializeQueryArgs:je,context:re}),mo=Xn.buildInitiateQuery,Fa=Xn.buildInitiateMutation;return yi(H.util,{getRunningOperationPromises:Xn.getRunningOperationPromises,getRunningOperationPromise:Xn.removalWarning,getRunningMutationThunk:Xn.getRunningMutationThunk,getRunningMutationsThunk:Xn.getRunningMutationsThunk,getRunningQueryThunk:Xn.getRunningQueryThunk,getRunningQueriesThunk:Xn.getRunningQueriesThunk}),{name:oa,injectEndpoint:function(it,hn){var rn,or=H;(rn=or.endpoints)[it]!=null||(rn[it]={}),ne(hn)?yi(or.endpoints[it],{name:it,select:Sr(it,hn),initiate:mo(it,hn)},wt(Se,it)):hn.type===J.mutation&&yi(or.endpoints[it],{name:it,select:vi(),initiate:Fa(it)},wt(Ye,it))}}}}},ll=po(ri())})(OB);RB.exports=OB;var ble=RB.exports;const oi=["general"],Ji=["control","mask","user","other"],_le=100,hv=20;let Yi=[],nl=(e,t)=>{let n=[],r={get(){return r.lc||r.listen(()=>{})(),r.value},l:t||0,lc:0,listen(i,o){return r.lc=n.push(i,o||r.l)/2,()=>{let a=n.indexOf(i);~a&&(n.splice(a,2),r.lc--,r.lc||r.off())}},notify(i){let o=!Yi.length;for(let a=0;a<n.length;a+=2)Yi.push(n[a],r.value,i,n[a+1]);if(o){for(let a=0;a<Yi.length;a+=4){let s=!1;for(let l=a+7;l<Yi.length;l+=4)if(Yi[l]<Yi[a+3]){s=!0;break}s?Yi.push(Yi[a],Yi[a+1],Yi[a+2],Yi[a+3]):Yi[a](Yi[a+1],Yi[a+2])}Yi.length=0}},off(){},set(i){r.value!==i&&(r.value=i,r.notify())},subscribe(i,o){let a=r.listen(i,o);return i(r.value),a},value:e};return r};const Sle=5,pv=6,gv=10;let xle=(e,t,n,r)=>(e.events=e.events||{},e.events[n+gv]||(e.events[n+gv]=r(i=>{e.events[n].reduceRight((o,a)=>(a(o),o),{shared:{},...i})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let i=e.events[n],o=i.indexOf(t);i.splice(o,1),i.length||(delete e.events[n],e.events[n+gv](),delete e.events[n+gv])}),wle=1e3,Cle=(e,t)=>xle(e,r=>{let i=t(r);i&&e.events[pv].push(i)},Sle,r=>{let i=e.listen;e.listen=(...a)=>(!e.lc&&!e.active&&(e.active=!0,r()),i(...a));let o=e.off;return e.events[pv]=[],e.off=()=>{o(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let a of e.events[pv])a();e.events[pv]=[]}},wle)},()=>{e.listen=i,e.off=o}}),Ele=(e,t)=>{Array.isArray(e)||(e=[e]);let n,r=()=>{let o=e.map(a=>a.get());(n===void 0||o.some((a,s)=>a!==n[s]))&&(n=o,i.set(t(...o)))},i=nl(void 0,Math.max(...e.map(o=>o.l))+1);return Cle(i,()=>{let o=e.map(a=>a.listen(r,i.l));return r(),()=>{for(let a of o)a()}}),i};const MB=nl(),Tle={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class n_{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||Tle,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new n_(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new n_(this.logger,t)}}var $s=new n_;class JS{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]=this.observers[r]||[],this.observers[r].push(n)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(r=>r!==n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.observers[t]&&[].concat(this.observers[t]).forEach(a=>{a(...r)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(a=>{a.apply(a,[t,...r])})}}function qp(){let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n}function iI(e){return e==null?"":""+e}function kle(e,t,n){e.forEach(r=>{t[r]&&(n[r]=t[r])})}function _k(e,t,n){function r(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function i(){return!e||typeof e=="string"}const o=typeof t!="string"?[].concat(t):t.split(".");for(;o.length>1;){if(i())return{};const a=r(o.shift());!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return i()?{}:{obj:e,k:r(o.shift())}}function oI(e,t,n){const{obj:r,k:i}=_k(e,t,Object);r[i]=n}function Ale(e,t,n,r){const{obj:i,k:o}=_k(e,t,Object);i[o]=i[o]||[],r&&(i[o]=i[o].concat(n)),r||i[o].push(n)}function r_(e,t){const{obj:n,k:r}=_k(e,t);if(n)return n[r]}function Ple(e,t,n){const r=r_(e,n);return r!==void 0?r:r_(t,n)}function NB(e,t,n){for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):NB(e[r],t[r],n):e[r]=t[r]);return e}function sf(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Ile={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function Rle(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>Ile[t]):e}const Ole=[" ",",","?","!",";"];function Mle(e,t,n){t=t||"",n=n||"";const r=Ole.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const i=new RegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!i.test(e);if(!o){const a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}function i_(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let i=e;for(let o=0;o<r.length;++o){if(!i||typeof i[r[o]]=="string"&&o+1<r.length)return;if(i[r[o]]===void 0){let a=2,s=r.slice(o,o+a).join(n),l=i[s];for(;l===void 0&&r.length>o+a;)a++,s=r.slice(o,o+a).join(n),l=i[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}const u=r.slice(o+a).join(n);return u?i_(l,u,n):void 0}i=i[r[o]]}return i}function o_(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class aI extends JS{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s=[t,n];r&&typeof r!="string"&&(s=s.concat(r)),r&&typeof r=="string"&&(s=s.concat(o?r.split(o):r)),t.indexOf(".")>-1&&(s=t.split("."));const l=r_(this.data,s);return l||!a||typeof r!="string"?l:i_(this.data&&this.data[t]&&this.data[t][n],r,o)}addResource(t,n,r,i){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let s=[t,n];r&&(s=s.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(s=t.split("."),i=n,n=s[1]),this.addNamespaces(n),oI(this.data,s,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const o in r)(typeof r[o]=="string"||Object.prototype.toString.apply(r[o])==="[object Array]")&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),i=r,r=n,n=s[1]),this.addNamespaces(n);let l=r_(this.data,s)||{};i?NB(l,r,o):l={...l,...r},oI(this.data,s,l),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var $B={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{this.processors[o]&&(t=this.processors[o].process(t,n,r,i))}),t}};const sI={};class a_ extends JS{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),kle(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=$s.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Mle(t,r,i);if(a&&!s){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:o};const u=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),t=u.join(i)}return typeof o=="string"&&(o=[o]),{key:t,namespaces:o}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:a,namespaces:s}=this.extractFromKey(t[t.length-1],n),l=s[s.length-1],u=n.lng||this.language,c=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(c){const v=n.nsSeparator||this.options.nsSeparator;return i?{res:`${l}${v}${a}`,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l}:`${l}${v}${a}`}return i?{res:a,usedKey:a,exactUsedKey:a,usedLng:u,usedNS:l}:a}const d=this.resolve(t,n);let f=d&&d.res;const h=d&&d.usedKey||a,p=d&&d.exactUsedKey||a,m=Object.prototype.toString.apply(f),_=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject;if(y&&f&&(typeof f!="string"&&typeof f!="boolean"&&typeof f!="number")&&_.indexOf(m)<0&&!(typeof b=="string"&&m==="[object Array]")){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const v=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,f,{...n,ns:s}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(d.res=v,d):v}if(o){const v=m==="[object Array]",S=v?[]:{},w=v?p:h;for(const x in f)if(Object.prototype.hasOwnProperty.call(f,x)){const C=`${w}${o}${x}`;S[x]=this.translate(C,{...n,joinArrays:!1,ns:s}),S[x]===C&&(S[x]=f[x])}f=S}}else if(y&&typeof b=="string"&&m==="[object Array]")f=f.join(b),f&&(f=this.extendTranslation(f,t,n,r));else{let v=!1,S=!1;const w=n.count!==void 0&&typeof n.count!="string",x=a_.hasDefaultValue(n),C=w?this.pluralResolver.getSuffix(u,n.count,n):"",k=n.ordinal&&w?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",T=n[`defaultValue${C}`]||n[`defaultValue${k}`]||n.defaultValue;!this.isValidLookup(f)&&x&&(v=!0,f=T),this.isValidLookup(f)||(S=!0,f=a);const $=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&S?void 0:f,O=x&&T!==f&&this.options.updateMissing;if(S||v||O){if(this.logger.log(O?"updateKey":"missingKey",u,l,a,O?T:f),o){const L=this.resolve(a,{...n,keySeparator:!1});L&&L.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.")}let E=[];const A=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&A&&A[0])for(let L=0;L<A.length;L++)E.push(A[L]);else this.options.saveMissingTo==="all"?E=this.languageUtils.toResolveHierarchy(n.lng||this.language):E.push(n.lng||this.language);const D=(L,M,R)=>{const N=x&&R!==f?R:$;this.options.missingKeyHandler?this.options.missingKeyHandler(L,l,M,N,O,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(L,l,M,N,O,n),this.emit("missingKey",L,l,M,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?E.forEach(L=>{this.pluralResolver.getSuffixes(L,n).forEach(M=>{D([L],a+M,n[`defaultValue${M}`]||T)})}):D(E,a,T))}f=this.extendTranslation(f,t,n,d,r),S&&f===a&&this.options.appendNamespaceToMissingKey&&(f=`${l}:${a}`),(S||v)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${a}`:a,v?f:void 0):f=this.options.parseMissingKeyHandler(f))}return i?(d.res=f,d):f}extendTranslation(t,n,r,i,o){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(u){const f=t.match(this.interpolator.nestingRegexp);c=f&&f.length}let d=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),t=this.interpolator.interpolate(t,d,r.lng||this.language,r),u){const f=t.match(this.interpolator.nestingRegexp),h=f&&f.length;c<h&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&i&&i.res&&(r.lng=i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var f=arguments.length,h=new Array(f),p=0;p<f;p++)h[p]=arguments[p];return o&&o[0]===h[0]&&!r.context?(a.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${n[0]}`),null):a.translate(...h,n)},r)),r.interpolation&&this.interpolator.reset()}const s=r.postProcess||this.options.postProcess,l=typeof s=="string"?[s]:s;return t!=null&&l&&l.length&&r.applyPostProcessor!==!1&&(t=$B.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:i,...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,i,o,a,s;return typeof t=="string"&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),c=u.key;i=c;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const f=n.count!==void 0&&typeof n.count!="string",h=f&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),p=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",m=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(_=>{this.isValidLookup(r)||(s=_,!sI[`${m[0]}-${_}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(s)&&(sI[`${m[0]}-${_}`]=!0,this.logger.warn(`key "${i}" for languages "${m.join(", ")}" won't get resolved as namespace "${s}" 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!!!")),m.forEach(b=>{if(this.isValidLookup(r))return;a=b;const y=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(y,c,b,_,n);else{let v;f&&(v=this.pluralResolver.getSuffix(b,n.count,n));const S=`${this.options.pluralSeparator}zero`,w=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(y.push(c+v),n.ordinal&&v.indexOf(w)===0&&y.push(c+v.replace(w,this.options.pluralSeparator)),h&&y.push(c+S)),p){const x=`${c}${this.options.contextSeparator}${n.context}`;y.push(x),f&&(y.push(x+v),n.ordinal&&v.indexOf(w)===0&&y.push(x+v.replace(w,this.options.pluralSeparator)),h&&y.push(x+S))}}let g;for(;g=y.pop();)this.isValidLookup(r)||(o=g,r=this.getResource(b,_,g,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}function aC(e){return e.charAt(0).toUpperCase()+e.slice(1)}class lI{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=$s.create("languageUtils")}getScriptPartFromCode(t){if(t=o_(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=o_(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(i=>i.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=aC(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=aC(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=aC(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&o.indexOf(i)===0)return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),i=[],o=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):typeof t=="string"&&o(this.formatLanguageCode(t)),r.forEach(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}let Nle=[{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}],$le={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return 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 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 e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}};const Dle=["v1","v2","v3"],Lle=["v4"],uI={zero:0,one:1,two:2,few:3,many:4,other:5};function Fle(){const e={};return Nle.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:$le[t.fc]}})}),e}class Ble{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=$s.create("pluralResolver"),(!this.options.compatibilityJSON||Lle.includes(this.options.compatibilityJSON))&&(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=Fle()}addRule(t,n){this.rules[t]=n}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(o_(t),{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((i,o)=>uI[i]-uI[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):r.numbers.map(i=>this.getSuffix(t,i,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const i=this.getRule(t,r);return i?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:this.getSuffixRetroCompatible(i,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let i=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(i===2?i="plural":i===1&&(i=""));const o=()=>this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString();return this.options.compatibilityJSON==="v1"?i===1?"":typeof i=="number"?`_plural_${i.toString()}`:o():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!Dle.includes(this.options.compatibilityJSON)}}function cI(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=Ple(e,t,n);return!o&&i&&typeof n=="string"&&(o=i_(e,n,r),o===void 0&&(o=i_(t,n,r))),o}class zle{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=$s.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const n=t.interpolation;this.escape=n.escape!==void 0?n.escape:Rle,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?sf(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?sf(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?sf(n.nestingPrefix):n.nestingPrefixEscaped||sf("$t("),this.nestingSuffix=n.nestingSuffix?sf(n.nestingSuffix):n.nestingSuffixEscaped||sf(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const n=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(n,"g");const r=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(r,"g")}interpolate(t,n,r,i){let o,a,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(p){return p.replace(/\$/g,"$$$$")}const c=p=>{if(p.indexOf(this.formatSeparator)<0){const y=cI(n,l,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(y,void 0,r,{...i,...n,interpolationkey:p}):y}const m=p.split(this.formatSeparator),_=m.shift().trim(),b=m.join(this.formatSeparator).trim();return this.format(cI(n,l,_,this.options.keySeparator,this.options.ignoreJSONStructure),b,r,{...i,...n,interpolationkey:_})};this.resetRegExp();const d=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,f=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>u(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?u(this.escape(p)):u(p)}].forEach(p=>{for(s=0;o=p.regex.exec(t);){const m=o[1].trim();if(a=c(m),a===void 0)if(typeof d=="function"){const b=d(t,o,i);a=typeof b=="string"?b:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))a="";else if(f){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${t}`),a="";else typeof a!="string"&&!this.useRawValueToEscape&&(a=iI(a));const _=p.safeValue(a);if(t=t.replace(o[0],_),f?(p.regex.lastIndex+=a.length,p.regex.lastIndex-=o[0].length):p.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i,o,a;function s(l,u){const c=this.nestingOptionsSeparator;if(l.indexOf(c)<0)return l;const d=l.split(new RegExp(`${c}[ ]*{`));let f=`{${d[1]}`;l=d[0],f=this.interpolate(f,a);const h=f.match(/'/g),p=f.match(/"/g);(h&&h.length%2===0&&!p||p.length%2!==0)&&(f=f.replace(/'/g,'"'));try{a=JSON.parse(f),u&&(a={...u,...a})}catch(m){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,m),`${l}${c}${f}`}return delete a.defaultValue,l}for(;i=this.nestingRegexp.exec(t);){let l=[];a={...r},a=a.replace&&typeof a.replace!="string"?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;let u=!1;if(i[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(i[1])){const c=i[1].split(this.formatSeparator).map(d=>d.trim());i[1]=c.shift(),l=c,u=!0}if(o=n(s.call(this,i[1].trim(),a),a),o&&i[0]===t&&typeof o!="string")return o;typeof o!="string"&&(o=iI(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),u&&(o=l.reduce((c,d)=>this.format(c,d,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}function jle(e){let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(a=>{if(!a)return;const[s,...l]=a.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,"");n[s.trim()]||(n[s.trim()]=u),u==="false"&&(n[s.trim()]=!1),u==="true"&&(n[s.trim()]=!0),isNaN(u)||(n[s.trim()]=parseInt(u,10))})}return{formatName:t,formatOptions:n}}function lf(e){const t={};return function(r,i,o){const a=i+JSON.stringify(o);let s=t[a];return s||(s=e(o_(i),o),t[a]=s),s(r)}}class Ule{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=$s.create("formatter"),this.options=t,this.formats={number:lf((n,r)=>{const i=new Intl.NumberFormat(n,{...r});return o=>i.format(o)}),currency:lf((n,r)=>{const i=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>i.format(o)}),datetime:lf((n,r)=>{const i=new Intl.DateTimeFormat(n,{...r});return o=>i.format(o)}),relativetime:lf((n,r)=>{const i=new Intl.RelativeTimeFormat(n,{...r});return o=>i.format(o,r.range||"day")}),list:lf((n,r)=>{const i=new Intl.ListFormat(n,{...r});return o=>i.format(o)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=lf(n)}format(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((s,l)=>{const{formatName:u,formatOptions:c}=jle(l);if(this.formats[u]){let d=s;try{const f=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},h=f.locale||f.lng||i.locale||i.lng||r;d=this.formats[u](s,h,{...c,...i,...f})}catch(f){this.logger.warn(f)}return d}else this.logger.warn(`there was no format function for ${u}`);return s},t)}}function Vle(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class Gle extends JS{constructor(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=$s.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,i.backend,i)}queueLoad(t,n,r,i){const o={},a={},s={},l={};return t.forEach(u=>{let c=!0;n.forEach(d=>{const f=`${u}|${d}`;!r.reload&&this.store.hasResourceBundle(u,d)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?a[f]===void 0&&(a[f]=!0):(this.state[f]=1,c=!1,a[f]===void 0&&(a[f]=!0),o[f]===void 0&&(o[f]=!0),l[d]===void 0&&(l[d]=!0)))}),c||(s[u]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const i=t.split("|"),o=i[0],a=i[1];n&&this.emit("failedLoading",o,a,n),r&&this.store.addResourceBundle(o,a,r),this.state[t]=n?-1:2;const s={};this.queue.forEach(l=>{Ale(l.loaded,[o],a),Vle(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{s[u]||(s[u]={});const c=l.loaded[u];c.length&&c.forEach(d=>{s[u][d]===void 0&&(s[u][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:a});return}this.readingCalls++;const s=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(u&&c&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,o*2,a)},o);return}a(u,c)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(t,n);u&&typeof u.then=="function"?u.then(c=>s(null,c)).catch(s):s(null,u)}catch(u){s(u)}return}return l(t,n,s)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=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."),i&&i();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,a),!a&&s&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,s),this.loaded(t,a,s)})}saveMissing(t,n,r,i,o){let a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" 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(!(r==null||r==="")){if(this.backend&&this.backend.create){const l={...a,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let c;u.length===5?c=u(t,n,r,i,l):c=u(t,n,r,i),c&&typeof c.then=="function"?c.then(d=>s(null,d)).catch(s):s(null,c)}catch(c){s(c)}else u(t,n,r,i,s,l)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}function dI(){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:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){let n={};if(typeof t[1]=="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(i=>{n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:(e,t,n,r)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function fI(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function mv(){}function qle(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}class Km extends JS{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=fI(t),this.services={},this.logger=$s,this.modules={external:[]},qle(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const i=dI();this.options={...i,...this.options,...fI(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...i.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function o(c){return c?typeof c=="function"?new c:c:null}if(!this.options.isClone){this.modules.logger?$s.init(o(this.modules.logger),this.options):$s.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=Ule);const d=new lI(this.options);this.store=new aI(this.options.resources,this.options);const f=this.services;f.logger=$s,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new Ble(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(f.formatter=o(c),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new zle(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Gle(o(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(h){for(var p=arguments.length,m=new Array(p>1?p-1:0),_=1;_<p;_++)m[_-1]=arguments[_];t.emit(h,...m)}),this.modules.languageDetector&&(f.languageDetector=o(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=o(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new a_(this.services,this.options),this.translator.on("*",function(h){for(var p=arguments.length,m=new Array(p>1?p-1:0),_=1;_<p;_++)m[_-1]=arguments[_];t.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,r||(r=mv),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(c=>{this[c]=function(){return t.store[c](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=function(){return t.store[c](...arguments),t}});const l=qp(),u=()=>{const c=(d,f)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),r(d,f)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),l}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mv;const i=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(i&&i.toLowerCase()==="cimode")return r();const o=[],a=s=>{if(!s)return;this.services.languageUtils.toResolveHierarchy(s).forEach(u=>{o.indexOf(u)<0&&o.push(u)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload&&this.options.preload.forEach(s=>a(s)),this.services.backendConnector.load(o,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(s)})}else r(null)}reloadResources(t,n,r){const i=qp();return t||(t=this.languages),n||(n=this.options.ns),r||(r=mv),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&$B.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const i=qp();this.emit("languageChanging",t);const o=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},a=(l,u)=>{u?(o(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,i.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},s=l=>{!t&&!l&&this.services.languageDetector&&(l=[]);const u=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);u&&(this.language||o(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,c=>{a(c,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(t),i}getFixedT(t,n,r){var i=this;const o=function(a,s){let l;if(typeof s!="object"){for(var u=arguments.length,c=new Array(u>2?u-2:0),d=2;d<u;d++)c[d-2]=arguments[d];l=i.options.overloadTranslationOptionHandler([a,s].concat(c))}else l={...s};l.lng=l.lng||o.lng,l.lngs=l.lngs||o.lngs,l.ns=l.ns||o.ns,l.keyPrefix=l.keyPrefix||r||o.keyPrefix;const f=i.options.keySeparator||".";let h;return l.keyPrefix&&Array.isArray(a)?h=a.map(p=>`${l.keyPrefix}${f}${p}`):h=l.keyPrefix?`${l.keyPrefix}${f}${a}`:a,i.t(h,l)};return typeof t=="string"?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=r,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=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;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const u=this.services.backendConnector.state[`${s}|${l}`];return u===-1||u===2};if(n.precheck){const s=n.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!i||a(o,t)))}loadNamespaces(t,n){const r=qp();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=qp();typeof t=="string"&&(t=[t]);const i=this.options.preload||[],o=t.filter(a=>i.indexOf(a)<0);return o.length?(this.options.preload=i.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["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"],r=this.services&&this.services.languageUtils||new lI(dI());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Km(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:mv;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new Km(i);return(t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(s=>{o[s]=this[s]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r&&(o.store=new aI(this.store.data,i),o.services.resourceStore=o.store),o.translator=new a_(o.services,i),o.translator.on("*",function(s){for(var l=arguments.length,u=new Array(l>1?l-1:0),c=1;c<l;c++)u[c-1]=arguments[c];o.emit(s,...u)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const be=Km.createInstance();be.createInstance=Km.createInstance;be.createInstance;be.dir;be.init;be.loadResources;be.reloadResources;be.use;be.changeLanguage;be.getFixedT;const Y=be.t;be.exists;be.setDefaultNamespace;be.hasLoadedNamespace;be.loadNamespaces;be.loadLanguages;const DB=z.enum(["BoardField","boolean","BooleanCollection","BooleanPolymorphic","ClipField","Collection","CollectionItem","ColorCollection","ColorField","ColorPolymorphic","ConditioningCollection","ConditioningField","ConditioningPolymorphic","ControlCollection","ControlField","ControlNetModelField","ControlPolymorphic","DenoiseMaskField","enum","float","FloatCollection","FloatPolymorphic","ImageCollection","ImageField","ImagePolymorphic","integer","IntegerCollection","IntegerPolymorphic","IPAdapterCollection","IPAdapterField","IPAdapterModelField","IPAdapterPolymorphic","LatentsCollection","LatentsField","LatentsPolymorphic","LoRAModelField","MainModelField","ONNXModelField","Scheduler","SDXLMainModelField","SDXLRefinerModelField","string","StringCollection","StringPolymorphic","T2IAdapterCollection","T2IAdapterField","T2IAdapterModelField","T2IAdapterPolymorphic","UNetField","VaeField","VaeModelField"]),Hle=z.enum(["WorkflowField","IsIntermediate","MetadataField"]),hI=e=>DB.safeParse(e).success||Hle.safeParse(e).success;z.enum(["connection","direct","any"]);const LB=z.object({id:z.string().trim().min(1),name:z.string().trim().min(1),type:DB}),Wle=LB.extend({fieldKind:z.literal("output")}),at=LB.extend({fieldKind:z.literal("input"),label:z.string()}),eu=z.object({model_name:z.string().trim().min(1),base_model:xc}),yp=z.object({image_name:z.string().trim().min(1)}),Kle=z.object({board_id:z.string().trim().min(1)}),s_=z.object({latents_name:z.string().trim().min(1),seed:z.number().int().optional()}),l_=z.object({conditioning_name:z.string().trim().min(1)}),Qle=z.object({mask_name:z.string().trim().min(1),masked_latents_name:z.string().trim().min(1).optional()}),Xle=at.extend({type:z.literal("integer"),value:z.number().int().optional()}),Yle=at.extend({type:z.literal("IntegerCollection"),value:z.array(z.number().int()).optional()}),Zle=at.extend({type:z.literal("IntegerPolymorphic"),value:z.number().int().optional()}),Jle=at.extend({type:z.literal("float"),value:z.number().optional()}),eue=at.extend({type:z.literal("FloatCollection"),value:z.array(z.number()).optional()}),tue=at.extend({type:z.literal("FloatPolymorphic"),value:z.number().optional()}),nue=at.extend({type:z.literal("string"),value:z.string().optional()}),rue=at.extend({type:z.literal("StringCollection"),value:z.array(z.string()).optional()}),iue=at.extend({type:z.literal("StringPolymorphic"),value:z.string().optional()}),oue=at.extend({type:z.literal("boolean"),value:z.boolean().optional()}),aue=at.extend({type:z.literal("BooleanCollection"),value:z.array(z.boolean()).optional()}),sue=at.extend({type:z.literal("BooleanPolymorphic"),value:z.boolean().optional()}),lue=at.extend({type:z.literal("enum"),value:z.string().optional()}),uue=at.extend({type:z.literal("LatentsField"),value:s_.optional()}),cue=at.extend({type:z.literal("LatentsCollection"),value:z.array(s_).optional()}),due=at.extend({type:z.literal("LatentsPolymorphic"),value:z.union([s_,z.array(s_)]).optional()}),fue=at.extend({type:z.literal("DenoiseMaskField"),value:Qle.optional()}),hue=at.extend({type:z.literal("ConditioningField"),value:l_.optional()}),pue=at.extend({type:z.literal("ConditioningCollection"),value:z.array(l_).optional()}),gue=at.extend({type:z.literal("ConditioningPolymorphic"),value:z.union([l_,z.array(l_)]).optional()}),mue=eu,Qm=z.object({image:yp,control_model:mue,control_weight:z.union([z.number(),z.array(z.number())]).optional(),begin_step_percent:z.number().optional(),end_step_percent:z.number().optional(),control_mode:z.enum(["balanced","more_prompt","more_control","unbalanced"]).optional(),resize_mode:z.enum(["just_resize","crop_resize","fill_resize","just_resize_simple"]).optional()}),yue=at.extend({type:z.literal("ControlField"),value:Qm.optional()}),vue=at.extend({type:z.literal("ControlPolymorphic"),value:z.union([Qm,z.array(Qm)]).optional()}),bue=at.extend({type:z.literal("ControlCollection"),value:z.array(Qm).optional()}),FB=eu,Xm=z.object({image:yp,ip_adapter_model:FB,weight:z.number(),begin_step_percent:z.number().optional(),end_step_percent:z.number().optional()}),_ue=at.extend({type:z.literal("IPAdapterField"),value:Xm.optional()}),Sue=at.extend({type:z.literal("IPAdapterPolymorphic"),value:z.union([Xm,z.array(Xm)]).optional()}),xue=at.extend({type:z.literal("IPAdapterCollection"),value:z.array(Xm).optional()}),wue=eu,u_=z.object({image:yp,t2i_adapter_model:wue,weight:z.union([z.number(),z.array(z.number())]).optional(),begin_step_percent:z.number().optional(),end_step_percent:z.number().optional(),resize_mode:z.enum(["just_resize","crop_resize","fill_resize","just_resize_simple"]).optional()}),Cue=at.extend({type:z.literal("T2IAdapterField"),value:u_.optional()}),Eue=at.extend({type:z.literal("T2IAdapterPolymorphic"),value:z.union([u_,z.array(u_)]).optional()}),Tue=at.extend({type:z.literal("T2IAdapterCollection"),value:z.array(u_).optional()}),kue=z.enum(["onnx","main","vae","lora","controlnet","embedding"]),Aue=z.enum(["unet","text_encoder","text_encoder_2","tokenizer","tokenizer_2","vae","vae_decoder","vae_encoder","scheduler","safety_checker"]),Wh=eu.extend({model_type:kue,submodel:Aue.optional()}),BB=Wh.extend({weight:z.number().optional()}),Pue=z.object({unet:Wh,scheduler:Wh,loras:z.array(BB)}),Iue=at.extend({type:z.literal("UNetField"),value:Pue.optional()}),Rue=z.object({tokenizer:Wh,text_encoder:Wh,skipped_layers:z.number(),loras:z.array(BB)}),Oue=at.extend({type:z.literal("ClipField"),value:Rue.optional()}),Mue=z.object({vae:Wh}),Nue=at.extend({type:z.literal("VaeField"),value:Mue.optional()}),$ue=at.extend({type:z.literal("ImageField"),value:yp.optional()}),Due=at.extend({type:z.literal("BoardField"),value:Kle.optional()}),Lue=at.extend({type:z.literal("ImagePolymorphic"),value:yp.optional()}),Fue=at.extend({type:z.literal("ImageCollection"),value:z.array(yp).optional()}),Bue=at.extend({type:z.literal("MainModelField"),value:cy.optional()}),zue=at.extend({type:z.literal("SDXLMainModelField"),value:cy.optional()}),jue=at.extend({type:z.literal("SDXLRefinerModelField"),value:cy.optional()}),zB=eu,Uue=at.extend({type:z.literal("VaeModelField"),value:zB.optional()}),jB=eu,Vue=at.extend({type:z.literal("LoRAModelField"),value:jB.optional()}),Gue=eu,que=at.extend({type:z.literal("ControlNetModelField"),value:Gue.optional()}),Hue=eu,Wue=at.extend({type:z.literal("IPAdapterModelField"),value:Hue.optional()}),Kue=eu,Que=at.extend({type:z.literal("T2IAdapterModelField"),value:Kue.optional()}),Xue=at.extend({type:z.literal("Collection"),value:z.array(z.any()).optional()}),Yue=at.extend({type:z.literal("CollectionItem"),value:z.any().optional()}),c_=z.object({r:z.number().int().min(0).max(255),g:z.number().int().min(0).max(255),b:z.number().int().min(0).max(255),a:z.number().int().min(0).max(255)}),Zue=at.extend({type:z.literal("ColorField"),value:c_.optional()}),Jue=at.extend({type:z.literal("ColorCollection"),value:z.array(c_).optional()}),ece=at.extend({type:z.literal("ColorPolymorphic"),value:z.union([c_,z.array(c_)]).optional()}),tce=at.extend({type:z.literal("Scheduler"),value:xB.optional()}),nce=z.discriminatedUnion("type",[Due,aue,oue,sue,Oue,Xue,Yue,Zue,Jue,ece,hue,pue,gue,yue,que,bue,vue,fue,lue,eue,Jle,tue,Fue,Lue,$ue,Yle,Zle,Xle,_ue,Wue,xue,Sue,uue,cue,due,Vue,Bue,tce,zue,jue,rue,iue,nue,Cue,Que,Tue,Eue,Iue,Nue,Uue]),EGe=e=>!!(e&&e.fieldKind==="input"),TGe=e=>!!(e&&e.fieldKind==="input"),rce=e=>!!(e&&!("$ref"in e)),pI=e=>!!(e&&!("$ref"in e)&&e.type==="array"),yv=e=>!!(e&&!("$ref"in e)&&e.type!=="array"),Hp=e=>!!(e&&"$ref"in e),ice=e=>"class"in e&&e.class==="invocation",oce=e=>"class"in e&&e.class==="output",gI=e=>!("$ref"in e),ace=z.object({lora:jB.deepPartial(),weight:z.number()}),sce=Qm.deepPartial(),lce=Xm.deepPartial(),UB=z.object({app_version:z.string().nullish().catch(null),generation_mode:z.string().nullish().catch(null),created_by:z.string().nullish().catch(null),positive_prompt:z.string().nullish().catch(null),negative_prompt:z.string().nullish().catch(null),width:z.number().int().nullish().catch(null),height:z.number().int().nullish().catch(null),seed:z.number().int().nullish().catch(null),rand_device:z.string().nullish().catch(null),cfg_scale:z.number().nullish().catch(null),steps:z.number().int().nullish().catch(null),scheduler:z.string().nullish().catch(null),clip_skip:z.number().int().nullish().catch(null),model:z.union([YS.deepPartial(),wB.deepPartial()]).nullish().catch(null),controlnets:z.array(sce).nullish().catch(null),ipAdapters:z.array(lce).nullish().catch(null),loras:z.array(ace).nullish().catch(null),vae:zB.nullish().catch(null),strength:z.number().nullish().catch(null),init_image:z.string().nullish().catch(null),positive_style_prompt:z.string().nullish().catch(null),negative_style_prompt:z.string().nullish().catch(null),refiner_model:mk.deepPartial().nullish().catch(null),refiner_cfg_scale:z.number().nullish().catch(null),refiner_steps:z.number().int().nullish().catch(null),refiner_scheduler:z.string().nullish().catch(null),refiner_positive_aesthetic_score:z.number().nullish().catch(null),refiner_negative_aesthetic_score:z.number().nullish().catch(null),refiner_start:z.number().nullish().catch(null)}).passthrough(),Sk=z.string().refine(e=>{const[t,n,r]=e.split(".");return t!==void 0&&Number.isInteger(Number(t))&&n!==void 0&&Number.isInteger(Number(n))&&r!==void 0&&Number.isInteger(Number(r))});Sk.transform(e=>{const[t,n,r]=e.split(".");return{major:Number(t),minor:Number(n),patch:Number(r)}});const mI=z.object({id:z.string().trim().min(1),type:z.string().trim().min(1),inputs:z.record(nce),outputs:z.record(Wle),label:z.string(),isOpen:z.boolean(),notes:z.string(),embedWorkflow:z.boolean(),isIntermediate:z.boolean(),useCache:z.boolean().optional(),version:Sk.optional()}),uce=z.preprocess(e=>{var t;try{const n=mI.parse(e);if(!Aoe(n,"useCache")){const r=(t=MB.get())==null?void 0:t.getState().nodes.nodeTemplates,i=r==null?void 0:r[n.type];let o=!0;i&&(o=i.useCache),Object.assign(n,{useCache:o})}return n}catch{return e}},mI.extend({useCache:z.boolean()})),cce=z.object({id:z.string().trim().min(1),type:z.literal("notes"),label:z.string(),isOpen:z.boolean(),notes:z.string()}),VB=z.object({x:z.number(),y:z.number()}).default({x:0,y:0}),d_=z.number().gt(0).nullish(),GB=z.object({id:z.string().trim().min(1),type:z.literal("invocation"),data:uce,width:d_,height:d_,position:VB}),aE=e=>GB.safeParse(e).success,dce=z.object({id:z.string().trim().min(1),type:z.literal("notes"),data:cce,width:d_,height:d_,position:VB}),qB=z.discriminatedUnion("type",[GB,dce]),fce=z.object({source:z.string().trim().min(1),sourceHandle:z.string().trim().min(1),target:z.string().trim().min(1),targetHandle:z.string().trim().min(1),id:z.string().trim().min(1),type:z.literal("default")}),hce=z.object({source:z.string().trim().min(1),target:z.string().trim().min(1),id:z.string().trim().min(1),type:z.literal("collapsed")}),HB=z.union([fce,hce]),pce=z.object({nodeId:z.string().trim().min(1),fieldName:z.string().trim().min(1)}),gce="1.0.0",WB=z.object({name:z.string().default(""),author:z.string().default(""),description:z.string().default(""),version:z.string().default(""),contact:z.string().default(""),tags:z.string().default(""),notes:z.string().default(""),nodes:z.array(qB).default([]),edges:z.array(HB).default([]),exposedFields:z.array(pce).default([]),meta:z.object({version:Sk}).default({version:gce})});WB.transform(e=>{const{nodes:t,edges:n}=e,r=[],i=t.filter(aE),o=gk(i,"id");return n.forEach((a,s)=>{const l=o[a.source],u=o[a.target],c=[];if(l?a.type==="default"&&!(a.sourceHandle in l.data.outputs)&&c.push(`${be.t("nodes.outputField")}"${a.source}.${a.sourceHandle}" ${be.t("nodes.doesNotExist")}`):c.push(`${be.t("nodes.outputNode")} ${a.source} ${be.t("nodes.doesNotExist")}`),u?a.type==="default"&&!(a.targetHandle in u.data.inputs)&&c.push(`${be.t("nodes.inputField")} "${a.target}.${a.targetHandle}" ${be.t("nodes.doesNotExist")}`):c.push(`${be.t("nodes.inputNode")} ${a.target} ${be.t("nodes.doesNotExist")}`),c.length){delete n[s];const d=a.type==="default"?a.sourceHandle:a.source,f=a.type==="default"?a.targetHandle:a.target;r.push({message:`${be.t("nodes.edge")} "${d} -> ${f}" ${be.t("nodes.skipped")}`,issues:c,data:a})}}),{workflow:e,warnings:r}});const Ur=e=>!!(e&&e.type==="invocation"),kGe=e=>!!(e&&!["notes","current_image"].includes(e.type)),yI=e=>!!(e&&e.type==="notes");var Wc=(e=>(e[e.PENDING=0]="PENDING",e[e.IN_PROGRESS=1]="IN_PROGRESS",e[e.COMPLETED=2]="COMPLETED",e[e.FAILED=3]="FAILED",e))(Wc||{});/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const mce=4,vI=0,bI=1,yce=2;function vp(e){let t=e.length;for(;--t>=0;)e[t]=0}const vce=0,KB=1,bce=2,_ce=3,Sce=258,xk=29,dy=256,Ym=dy+1+xk,hh=30,wk=19,QB=2*Ym+1,nd=15,sC=16,xce=7,Ck=256,XB=16,YB=17,ZB=18,sE=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),$1=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),wce=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),JB=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Cce=512,_l=new Array((Ym+2)*2);vp(_l);const Hg=new Array(hh*2);vp(Hg);const Zm=new Array(Cce);vp(Zm);const Jm=new Array(Sce-_ce+1);vp(Jm);const Ek=new Array(xk);vp(Ek);const f_=new Array(hh);vp(f_);function lC(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}let ez,tz,nz;function uC(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const rz=e=>e<256?Zm[e]:Zm[256+(e>>>7)],e0=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},Co=(e,t,n)=>{e.bi_valid>sC-n?(e.bi_buf|=t<<e.bi_valid&65535,e0(e,e.bi_buf),e.bi_buf=t>>sC-e.bi_valid,e.bi_valid+=n-sC):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},Rs=(e,t,n)=>{Co(e,n[t*2],n[t*2+1])},iz=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},Ece=e=>{e.bi_valid===16?(e0(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Tce=(e,t)=>{const n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,l=t.stat_desc.max_length;let u,c,d,f,h,p,m=0;for(f=0;f<=nd;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,u=e.heap_max+1;u<QB;u++)c=e.heap[u],f=n[n[c*2+1]*2+1]+1,f>l&&(f=l,m++),n[c*2+1]=f,!(c>r)&&(e.bl_count[f]++,h=0,c>=s&&(h=a[c-s]),p=n[c*2],e.opt_len+=p*(f+h),o&&(e.static_len+=p*(i[c*2+1]+h)));if(m!==0){do{for(f=l-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[l]--,m-=2}while(m>0);for(f=l;f!==0;f--)for(c=e.bl_count[f];c!==0;)d=e.heap[--u],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),c--)}},oz=(e,t,n)=>{const r=new Array(nd+1);let i=0,o,a;for(o=1;o<=nd;o++)i=i+n[o-1]<<1,r[o]=i;for(a=0;a<=t;a++){let s=e[a*2+1];s!==0&&(e[a*2]=iz(r[s]++,s))}},kce=()=>{let e,t,n,r,i;const o=new Array(nd+1);for(n=0,r=0;r<xk-1;r++)for(Ek[r]=n,e=0;e<1<<sE[r];e++)Jm[n++]=r;for(Jm[n-1]=r,i=0,r=0;r<16;r++)for(f_[r]=i,e=0;e<1<<$1[r];e++)Zm[i++]=r;for(i>>=7;r<hh;r++)for(f_[r]=i<<7,e=0;e<1<<$1[r]-7;e++)Zm[256+i++]=r;for(t=0;t<=nd;t++)o[t]=0;for(e=0;e<=143;)_l[e*2+1]=8,e++,o[8]++;for(;e<=255;)_l[e*2+1]=9,e++,o[9]++;for(;e<=279;)_l[e*2+1]=7,e++,o[7]++;for(;e<=287;)_l[e*2+1]=8,e++,o[8]++;for(oz(_l,Ym+1,o),e=0;e<hh;e++)Hg[e*2+1]=5,Hg[e*2]=iz(e,5);ez=new lC(_l,sE,dy+1,Ym,nd),tz=new lC(Hg,$1,0,hh,nd),nz=new lC(new Array(0),wce,0,wk,xce)},az=e=>{let t;for(t=0;t<Ym;t++)e.dyn_ltree[t*2]=0;for(t=0;t<hh;t++)e.dyn_dtree[t*2]=0;for(t=0;t<wk;t++)e.bl_tree[t*2]=0;e.dyn_ltree[Ck*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},sz=e=>{e.bi_valid>8?e0(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},_I=(e,t,n,r)=>{const i=t*2,o=n*2;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]},cC=(e,t,n)=>{const r=e.heap[n];let i=n<<1;for(;i<=e.heap_len&&(i<e.heap_len&&_I(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!_I(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},SI=(e,t,n)=>{let r,i,o=0,a,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+o++]&255,r+=(e.pending_buf[e.sym_buf+o++]&255)<<8,i=e.pending_buf[e.sym_buf+o++],r===0?Rs(e,i,t):(a=Jm[i],Rs(e,a+dy+1,t),s=sE[a],s!==0&&(i-=Ek[a],Co(e,i,s)),r--,a=rz(r),Rs(e,a,n),s=$1[a],s!==0&&(r-=f_[a],Co(e,r,s)));while(o<e.sym_next);Rs(e,Ck,t)},lE=(e,t)=>{const n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let a,s,l=-1,u;for(e.heap_len=0,e.heap_max=QB,a=0;a<o;a++)n[a*2]!==0?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):n[a*2+1]=0;for(;e.heap_len<2;)u=e.heap[++e.heap_len]=l<2?++l:0,n[u*2]=1,e.depth[u]=0,e.opt_len--,i&&(e.static_len-=r[u*2+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)cC(e,n,a);u=o;do a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],cC(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,n[u*2]=n[a*2]+n[s*2],e.depth[u]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,n[a*2+1]=n[s*2+1]=u,e.heap[1]=u++,cC(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Tce(e,t),oz(n,l,e.bl_count)},xI=(e,t,n)=>{let r,i=-1,o,a=t[0*2+1],s=0,l=7,u=4;for(a===0&&(l=138,u=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)o=a,a=t[(r+1)*2+1],!(++s<l&&o===a)&&(s<u?e.bl_tree[o*2]+=s:o!==0?(o!==i&&e.bl_tree[o*2]++,e.bl_tree[XB*2]++):s<=10?e.bl_tree[YB*2]++:e.bl_tree[ZB*2]++,s=0,i=o,a===0?(l=138,u=3):o===a?(l=6,u=3):(l=7,u=4))},wI=(e,t,n)=>{let r,i=-1,o,a=t[0*2+1],s=0,l=7,u=4;for(a===0&&(l=138,u=3),r=0;r<=n;r++)if(o=a,a=t[(r+1)*2+1],!(++s<l&&o===a)){if(s<u)do Rs(e,o,e.bl_tree);while(--s!==0);else o!==0?(o!==i&&(Rs(e,o,e.bl_tree),s--),Rs(e,XB,e.bl_tree),Co(e,s-3,2)):s<=10?(Rs(e,YB,e.bl_tree),Co(e,s-3,3)):(Rs(e,ZB,e.bl_tree),Co(e,s-11,7));s=0,i=o,a===0?(l=138,u=3):o===a?(l=6,u=3):(l=7,u=4)}},Ace=e=>{let t;for(xI(e,e.dyn_ltree,e.l_desc.max_code),xI(e,e.dyn_dtree,e.d_desc.max_code),lE(e,e.bl_desc),t=wk-1;t>=3&&e.bl_tree[JB[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},Pce=(e,t,n,r)=>{let i;for(Co(e,t-257,5),Co(e,n-1,5),Co(e,r-4,4),i=0;i<r;i++)Co(e,e.bl_tree[JB[i]*2+1],3);wI(e,e.dyn_ltree,t-1),wI(e,e.dyn_dtree,n-1)},Ice=e=>{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return vI;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return bI;for(n=32;n<dy;n++)if(e.dyn_ltree[n*2]!==0)return bI;return vI};let CI=!1;const Rce=e=>{CI||(kce(),CI=!0),e.l_desc=new uC(e.dyn_ltree,ez),e.d_desc=new uC(e.dyn_dtree,tz),e.bl_desc=new uC(e.bl_tree,nz),e.bi_buf=0,e.bi_valid=0,az(e)},lz=(e,t,n,r)=>{Co(e,(vce<<1)+(r?1:0),3),sz(e),e0(e,n),e0(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},Oce=e=>{Co(e,KB<<1,3),Rs(e,Ck,_l),Ece(e)},Mce=(e,t,n,r)=>{let i,o,a=0;e.level>0?(e.strm.data_type===yce&&(e.strm.data_type=Ice(e)),lE(e,e.l_desc),lE(e,e.d_desc),a=Ace(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=n+5,n+4<=i&&t!==-1?lz(e,t,n,r):e.strategy===mce||o===i?(Co(e,(KB<<1)+(r?1:0),3),SI(e,_l,Hg)):(Co(e,(bce<<1)+(r?1:0),3),Pce(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),SI(e,e.dyn_ltree,e.dyn_dtree)),az(e),r&&sz(e)},Nce=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(Jm[n]+dy+1)*2]++,e.dyn_dtree[rz(t)*2]++),e.sym_next===e.sym_end);var $ce=Rce,Dce=lz,Lce=Mce,Fce=Nce,Bce=Oce,zce={_tr_init:$ce,_tr_stored_block:Dce,_tr_flush_block:Lce,_tr_tally:Fce,_tr_align:Bce};const jce=(e,t,n,r)=>{let i=e&65535|0,o=e>>>16&65535|0,a=0;for(;n!==0;){a=n>2e3?2e3:n,n-=a;do i=i+t[r++]|0,o=o+i|0;while(--a);i%=65521,o%=65521}return i|o<<16|0};var t0=jce;const Uce=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},Vce=new Uint32Array(Uce()),Gce=(e,t,n,r)=>{const i=Vce,o=r+n;e^=-1;for(let a=r;a<o;a++)e=e>>>8^i[(e^t[a])&255];return e^-1};var si=Gce,Kh={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},fy={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:qce,_tr_stored_block:uE,_tr_flush_block:Hce,_tr_tally:Wu,_tr_align:Wce}=zce,{Z_NO_FLUSH:Ku,Z_PARTIAL_FLUSH:Kce,Z_FULL_FLUSH:Qce,Z_FINISH:va,Z_BLOCK:EI,Z_OK:Ei,Z_STREAM_END:TI,Z_STREAM_ERROR:Us,Z_DATA_ERROR:Xce,Z_BUF_ERROR:dC,Z_DEFAULT_COMPRESSION:Yce,Z_FILTERED:Zce,Z_HUFFMAN_ONLY:vv,Z_RLE:Jce,Z_FIXED:ede,Z_DEFAULT_STRATEGY:tde,Z_UNKNOWN:nde,Z_DEFLATED:e2}=fy,rde=9,ide=15,ode=8,ade=29,sde=256,cE=sde+1+ade,lde=30,ude=19,cde=2*cE+1,dde=15,zt=3,Du=258,Vs=Du+zt+1,fde=32,Qh=42,Tk=57,dE=69,fE=73,hE=91,pE=103,rd=113,bg=666,no=1,bp=2,Rd=3,_p=4,hde=3,id=(e,t)=>(e.msg=Kh[t],t),kI=e=>e*2-(e>4?9:0),ku=e=>{let t=e.length;for(;--t>=0;)e[t]=0},pde=e=>{let t,n,r,i=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=i?n-i:0;while(--t);t=i,r=t;do n=e.prev[--r],e.prev[r]=n>=i?n-i:0;while(--t)};let gde=(e,t,n)=>(t<<e.hash_shift^n)&e.hash_mask,Qu=gde;const Bo=e=>{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},Wo=(e,t)=>{Hce(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Bo(e.strm)},an=(e,t)=>{e.pending_buf[e.pending++]=t},Wp=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},gE=(e,t,n,r)=>{let i=e.avail_in;return i>r&&(i=r),i===0?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),e.state.wrap===1?e.adler=t0(e.adler,t,i,n):e.state.wrap===2&&(e.adler=si(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)},uz=(e,t)=>{let n=e.max_chain_length,r=e.strstart,i,o,a=e.prev_length,s=e.nice_match;const l=e.strstart>e.w_size-Vs?e.strstart-(e.w_size-Vs):0,u=e.window,c=e.w_mask,d=e.prev,f=e.strstart+Du;let h=u[r+a-1],p=u[r+a];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(i=t,!(u[i+a]!==p||u[i+a-1]!==h||u[i]!==u[r]||u[++i]!==u[r+1])){r+=2,i++;do;while(u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&u[++r]===u[++i]&&r<f);if(o=Du-(f-r),r=f-Du,o>a){if(e.match_start=t,a=o,o>=s)break;h=u[r+a-1],p=u[r+a]}}while((t=d[t&c])>l&&--n!==0);return a<=e.lookahead?a:e.lookahead},Xh=e=>{const t=e.w_size;let n,r,i;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Vs)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),pde(e),r+=t),e.strm.avail_in===0)break;if(n=gE(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=zt)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=Qu(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=Qu(e,e.ins_h,e.window[i+zt-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<zt)););}while(e.lookahead<Vs&&e.strm.avail_in!==0)},cz=(e,t)=>{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,i,o,a=0,s=e.strm.avail_in;do{if(r=65535,o=e.bi_valid+42>>3,e.strm.avail_out<o||(o=e.strm.avail_out-o,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>o&&(r=o),r<n&&(r===0&&t!==va||t===Ku||r!==i+e.strm.avail_in)))break;a=t===va&&r===i+e.strm.avail_in?1:0,uE(e,0,0,a),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,Bo(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(gE(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(a===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?_p:t!==Ku&&t!==va&&e.strm.avail_in===0&&e.strstart===e.block_start?bp:(o=e.window_size-e.strstart,e.strm.avail_in>o&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(gE(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water<e.strstart&&(e.high_water=e.strstart),o=e.bi_valid+42>>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,n=o>e.w_size?e.w_size:o,i=e.strstart-e.block_start,(i>=n||(i||t===va)&&t!==Ku&&e.strm.avail_in===0&&i<=o)&&(r=i>o?o:i,a=t===va&&e.strm.avail_in===0&&r===i?1:0,uE(e,e.block_start,r,a),e.block_start+=r,Bo(e.strm)),a?Rd:no)},fC=(e,t)=>{let n,r;for(;;){if(e.lookahead<Vs){if(Xh(e),e.lookahead<Vs&&t===Ku)return no;if(e.lookahead===0)break}if(n=0,e.lookahead>=zt&&(e.ins_h=Qu(e,e.ins_h,e.window[e.strstart+zt-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-Vs&&(e.match_length=uz(e,n)),e.match_length>=zt)if(r=Wu(e,e.strstart-e.match_start,e.match_length-zt),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=zt){e.match_length--;do e.strstart++,e.ins_h=Qu(e,e.ins_h,e.window[e.strstart+zt-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Qu(e,e.ins_h,e.window[e.strstart+1]);else r=Wu(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Wo(e,!1),e.strm.avail_out===0))return no}return e.insert=e.strstart<zt-1?e.strstart:zt-1,t===va?(Wo(e,!0),e.strm.avail_out===0?Rd:_p):e.sym_next&&(Wo(e,!1),e.strm.avail_out===0)?no:bp},uf=(e,t)=>{let n,r,i;for(;;){if(e.lookahead<Vs){if(Xh(e),e.lookahead<Vs&&t===Ku)return no;if(e.lookahead===0)break}if(n=0,e.lookahead>=zt&&(e.ins_h=Qu(e,e.ins_h,e.window[e.strstart+zt-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=zt-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-Vs&&(e.match_length=uz(e,n),e.match_length<=5&&(e.strategy===Zce||e.match_length===zt&&e.strstart-e.match_start>4096)&&(e.match_length=zt-1)),e.prev_length>=zt&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-zt,r=Wu(e,e.strstart-1-e.prev_match,e.prev_length-zt),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=i&&(e.ins_h=Qu(e,e.ins_h,e.window[e.strstart+zt-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=zt-1,e.strstart++,r&&(Wo(e,!1),e.strm.avail_out===0))return no}else if(e.match_available){if(r=Wu(e,0,e.window[e.strstart-1]),r&&Wo(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return no}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Wu(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<zt-1?e.strstart:zt-1,t===va?(Wo(e,!0),e.strm.avail_out===0?Rd:_p):e.sym_next&&(Wo(e,!1),e.strm.avail_out===0)?no:bp},mde=(e,t)=>{let n,r,i,o;const a=e.window;for(;;){if(e.lookahead<=Du){if(Xh(e),e.lookahead<=Du&&t===Ku)return no;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=zt&&e.strstart>0&&(i=e.strstart-1,r=a[i],r===a[++i]&&r===a[++i]&&r===a[++i])){o=e.strstart+Du;do;while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<o);e.match_length=Du-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=zt?(n=Wu(e,1,e.match_length-zt),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=Wu(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Wo(e,!1),e.strm.avail_out===0))return no}return e.insert=0,t===va?(Wo(e,!0),e.strm.avail_out===0?Rd:_p):e.sym_next&&(Wo(e,!1),e.strm.avail_out===0)?no:bp},yde=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(Xh(e),e.lookahead===0)){if(t===Ku)return no;break}if(e.match_length=0,n=Wu(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Wo(e,!1),e.strm.avail_out===0))return no}return e.insert=0,t===va?(Wo(e,!0),e.strm.avail_out===0?Rd:_p):e.sym_next&&(Wo(e,!1),e.strm.avail_out===0)?no:bp};function vs(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}const _g=[new vs(0,0,0,0,cz),new vs(4,4,8,4,fC),new vs(4,5,16,8,fC),new vs(4,6,32,32,fC),new vs(4,4,16,16,uf),new vs(8,16,32,32,uf),new vs(8,16,128,128,uf),new vs(8,32,128,256,uf),new vs(32,128,258,1024,uf),new vs(32,258,258,4096,uf)],vde=e=>{e.window_size=2*e.w_size,ku(e.head),e.max_lazy_match=_g[e.level].max_lazy,e.good_match=_g[e.level].good_length,e.nice_match=_g[e.level].nice_length,e.max_chain_length=_g[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=zt-1,e.match_available=0,e.ins_h=0};function bde(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=e2,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(cde*2),this.dyn_dtree=new Uint16Array((2*lde+1)*2),this.bl_tree=new Uint16Array((2*ude+1)*2),ku(this.dyn_ltree),ku(this.dyn_dtree),ku(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(dde+1),this.heap=new Uint16Array(2*cE+1),ku(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*cE+1),ku(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const hy=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Qh&&t.status!==Tk&&t.status!==dE&&t.status!==fE&&t.status!==hE&&t.status!==pE&&t.status!==rd&&t.status!==bg?1:0},dz=e=>{if(hy(e))return id(e,Us);e.total_in=e.total_out=0,e.data_type=nde;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?Tk:t.wrap?Qh:rd,e.adler=t.wrap===2?0:1,t.last_flush=-2,qce(t),Ei},fz=e=>{const t=dz(e);return t===Ei&&vde(e.state),t},_de=(e,t)=>hy(e)||e.state.wrap!==2?Us:(e.state.gzhead=t,Ei),hz=(e,t,n,r,i,o)=>{if(!e)return Us;let a=1;if(t===Yce&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>rde||n!==e2||r<8||r>15||t<0||t>9||o<0||o>ede||r===8&&a!==1)return id(e,Us);r===8&&(r=9);const s=new bde;return e.state=s,s.strm=e,s.status=Qh,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+zt-1)/zt),s.window=new Uint8Array(s.w_size*2),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=s.lit_bufsize*4,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=(s.lit_bufsize-1)*3,s.level=t,s.strategy=o,s.method=n,fz(e)},Sde=(e,t)=>hz(e,t,e2,ide,ode,tde),xde=(e,t)=>{if(hy(e)||t>EI||t<0)return e?id(e,Us):Us;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===bg&&t!==va)return id(e,e.avail_out===0?dC:Us);const r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(Bo(e),e.avail_out===0)return n.last_flush=-1,Ei}else if(e.avail_in===0&&kI(t)<=kI(r)&&t!==va)return id(e,dC);if(n.status===bg&&e.avail_in!==0)return id(e,dC);if(n.status===Qh&&n.wrap===0&&(n.status=rd),n.status===Qh){let i=e2+(n.w_bits-8<<4)<<8,o=-1;if(n.strategy>=vv||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,i|=o<<6,n.strstart!==0&&(i|=fde),i+=31-i%31,Wp(n,i),n.strstart!==0&&(Wp(n,e.adler>>>16),Wp(n,e.adler&65535)),e.adler=1,n.status=rd,Bo(e),n.pending!==0)return n.last_flush=-1,Ei}if(n.status===Tk){if(e.adler=0,an(n,31),an(n,139),an(n,8),n.gzhead)an(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),an(n,n.gzhead.time&255),an(n,n.gzhead.time>>8&255),an(n,n.gzhead.time>>16&255),an(n,n.gzhead.time>>24&255),an(n,n.level===9?2:n.strategy>=vv||n.level<2?4:0),an(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(an(n,n.gzhead.extra.length&255),an(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=si(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=dE;else if(an(n,0),an(n,0),an(n,0),an(n,0),an(n,0),an(n,n.level===9?2:n.strategy>=vv||n.level<2?4:0),an(n,hde),n.status=rd,Bo(e),n.pending!==0)return n.last_flush=-1,Ei}if(n.status===dE){if(n.gzhead.extra){let i=n.pending,o=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+o>n.pending_buf_size;){let s=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(e.adler=si(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=s,Bo(e),n.pending!==0)return n.last_flush=-1,Ei;i=0,o-=s}let a=new Uint8Array(n.gzhead.extra);n.pending_buf.set(a.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending+=o,n.gzhead.hcrc&&n.pending>i&&(e.adler=si(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=fE}if(n.status===fE){if(n.gzhead.name){let i=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=si(e.adler,n.pending_buf,n.pending-i,i)),Bo(e),n.pending!==0)return n.last_flush=-1,Ei;i=0}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,an(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=si(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=hE}if(n.status===hE){if(n.gzhead.comment){let i=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>i&&(e.adler=si(e.adler,n.pending_buf,n.pending-i,i)),Bo(e),n.pending!==0)return n.last_flush=-1,Ei;i=0}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,an(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>i&&(e.adler=si(e.adler,n.pending_buf,n.pending-i,i))}n.status=pE}if(n.status===pE){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Bo(e),n.pending!==0))return n.last_flush=-1,Ei;an(n,e.adler&255),an(n,e.adler>>8&255),e.adler=0}if(n.status=rd,Bo(e),n.pending!==0)return n.last_flush=-1,Ei}if(e.avail_in!==0||n.lookahead!==0||t!==Ku&&n.status!==bg){let i=n.level===0?cz(n,t):n.strategy===vv?yde(n,t):n.strategy===Jce?mde(n,t):_g[n.level].func(n,t);if((i===Rd||i===_p)&&(n.status=bg),i===no||i===Rd)return e.avail_out===0&&(n.last_flush=-1),Ei;if(i===bp&&(t===Kce?Wce(n):t!==EI&&(uE(n,0,0,!1),t===Qce&&(ku(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Bo(e),e.avail_out===0))return n.last_flush=-1,Ei}return t!==va?Ei:n.wrap<=0?TI:(n.wrap===2?(an(n,e.adler&255),an(n,e.adler>>8&255),an(n,e.adler>>16&255),an(n,e.adler>>24&255),an(n,e.total_in&255),an(n,e.total_in>>8&255),an(n,e.total_in>>16&255),an(n,e.total_in>>24&255)):(Wp(n,e.adler>>>16),Wp(n,e.adler&65535)),Bo(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?Ei:TI)},wde=e=>{if(hy(e))return Us;const t=e.state.status;return e.state=null,t===rd?id(e,Xce):Ei},Cde=(e,t)=>{let n=t.length;if(hy(e))return Us;const r=e.state,i=r.wrap;if(i===2||i===1&&r.status!==Qh||r.lookahead)return Us;if(i===1&&(e.adler=t0(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){i===0&&(ku(r.head),r.strstart=0,r.block_start=0,r.insert=0);let l=new Uint8Array(r.w_size);l.set(t.subarray(n-r.w_size,n),0),t=l,n=r.w_size}const o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,Xh(r);r.lookahead>=zt;){let l=r.strstart,u=r.lookahead-(zt-1);do r.ins_h=Qu(r,r.ins_h,r.window[l+zt-1]),r.prev[l&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=l,l++;while(--u);r.strstart=l,r.lookahead=zt-1,Xh(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=zt-1,r.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,r.wrap=i,Ei};var Ede=Sde,Tde=hz,kde=fz,Ade=dz,Pde=_de,Ide=xde,Rde=wde,Ode=Cde,Mde="pako deflate (from Nodeca project)",Wg={deflateInit:Ede,deflateInit2:Tde,deflateReset:kde,deflateResetKeep:Ade,deflateSetHeader:Pde,deflate:Ide,deflateEnd:Rde,deflateSetDictionary:Ode,deflateInfo:Mde};const Nde=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var $de=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)Nde(n,r)&&(e[r]=n[r])}}return e},Dde=e=>{let t=0;for(let r=0,i=e.length;r<i;r++)t+=e[r].length;const n=new Uint8Array(t);for(let r=0,i=0,o=e.length;r<o;r++){let a=e[r];n.set(a,i),i+=a.length}return n},t2={assign:$de,flattenChunks:Dde};let pz=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{pz=!1}const n0=new Uint8Array(256);for(let e=0;e<256;e++)n0[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;n0[254]=n0[254]=1;var Lde=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,i,o,a=e.length,s=0;for(i=0;i<a;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<a&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),o=0,i=0;o<s;i++)n=e.charCodeAt(i),(n&64512)===55296&&i+1<a&&(r=e.charCodeAt(i+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),i++)),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|n&63):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|n&63):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|n&63);return t};const Fde=(e,t)=>{if(t<65534&&e.subarray&&pz)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n};var Bde=(e,t)=>{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,i;const o=new Array(n*2);for(i=0,r=0;r<n;){let a=e[r++];if(a<128){o[i++]=a;continue}let s=n0[a];if(s>4){o[i++]=65533,r+=s-1;continue}for(a&=s===2?31:s===3?15:7;s>1&&r<n;)a=a<<6|e[r++]&63,s--;if(s>1){o[i++]=65533;continue}a<65536?o[i++]=a:(a-=65536,o[i++]=55296|a>>10&1023,o[i++]=56320|a&1023)}return Fde(o,i)},zde=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+n0[e[n]]>t?n:t},r0={string2buf:Lde,buf2string:Bde,utf8border:zde};function jde(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var gz=jde;const mz=Object.prototype.toString,{Z_NO_FLUSH:Ude,Z_SYNC_FLUSH:Vde,Z_FULL_FLUSH:Gde,Z_FINISH:qde,Z_OK:h_,Z_STREAM_END:Hde,Z_DEFAULT_COMPRESSION:Wde,Z_DEFAULT_STRATEGY:Kde,Z_DEFLATED:Qde}=fy;function kk(e){this.options=t2.assign({level:Wde,method:Qde,chunkSize:16384,windowBits:15,memLevel:8,strategy:Kde},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new gz,this.strm.avail_out=0;let n=Wg.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==h_)throw new Error(Kh[n]);if(t.header&&Wg.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=r0.string2buf(t.dictionary):mz.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=Wg.deflateSetDictionary(this.strm,r),n!==h_)throw new Error(Kh[n]);this._dict_set=!0}}kk.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let i,o;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?qde:Ude,typeof e=="string"?n.input=r0.string2buf(e):mz.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(o===Vde||o===Gde)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(i=Wg.deflate(n,o),i===Hde)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),i=Wg.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===h_;if(n.avail_out===0){this.onData(n.output);continue}if(o>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};kk.prototype.onData=function(e){this.chunks.push(e)};kk.prototype.onEnd=function(e){e===h_&&(this.result=t2.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const bv=16209,Xde=16191;var Yde=function(t,n){let r,i,o,a,s,l,u,c,d,f,h,p,m,_,b,y,g,v,S,w,x,C,k,T;const P=t.state;r=t.next_in,k=t.input,i=r+(t.avail_in-5),o=t.next_out,T=t.output,a=o-(n-t.avail_out),s=o+(t.avail_out-257),l=P.dmax,u=P.wsize,c=P.whave,d=P.wnext,f=P.window,h=P.hold,p=P.bits,m=P.lencode,_=P.distcode,b=(1<<P.lenbits)-1,y=(1<<P.distbits)-1;e:do{p<15&&(h+=k[r++]<<p,p+=8,h+=k[r++]<<p,p+=8),g=m[h&b];t:for(;;){if(v=g>>>24,h>>>=v,p-=v,v=g>>>16&255,v===0)T[o++]=g&65535;else if(v&16){S=g&65535,v&=15,v&&(p<v&&(h+=k[r++]<<p,p+=8),S+=h&(1<<v)-1,h>>>=v,p-=v),p<15&&(h+=k[r++]<<p,p+=8,h+=k[r++]<<p,p+=8),g=_[h&y];n:for(;;){if(v=g>>>24,h>>>=v,p-=v,v=g>>>16&255,v&16){if(w=g&65535,v&=15,p<v&&(h+=k[r++]<<p,p+=8,p<v&&(h+=k[r++]<<p,p+=8)),w+=h&(1<<v)-1,w>l){t.msg="invalid distance too far back",P.mode=bv;break e}if(h>>>=v,p-=v,v=o-a,w>v){if(v=w-v,v>c&&P.sane){t.msg="invalid distance too far back",P.mode=bv;break e}if(x=0,C=f,d===0){if(x+=u-v,v<S){S-=v;do T[o++]=f[x++];while(--v);x=o-w,C=T}}else if(d<v){if(x+=u+d-v,v-=d,v<S){S-=v;do T[o++]=f[x++];while(--v);if(x=0,d<S){v=d,S-=v;do T[o++]=f[x++];while(--v);x=o-w,C=T}}}else if(x+=d-v,v<S){S-=v;do T[o++]=f[x++];while(--v);x=o-w,C=T}for(;S>2;)T[o++]=C[x++],T[o++]=C[x++],T[o++]=C[x++],S-=3;S&&(T[o++]=C[x++],S>1&&(T[o++]=C[x++]))}else{x=o-w;do T[o++]=T[x++],T[o++]=T[x++],T[o++]=T[x++],S-=3;while(S>2);S&&(T[o++]=T[x++],S>1&&(T[o++]=T[x++]))}}else if(v&64){t.msg="invalid distance code",P.mode=bv;break e}else{g=_[(g&65535)+(h&(1<<v)-1)];continue n}break}}else if(v&64)if(v&32){P.mode=Xde;break e}else{t.msg="invalid literal/length code",P.mode=bv;break e}else{g=m[(g&65535)+(h&(1<<v)-1)];continue t}break}}while(r<i&&o<s);S=p>>3,r-=S,p-=S<<3,h&=(1<<p)-1,t.next_in=r,t.next_out=o,t.avail_in=r<i?5+(i-r):5-(r-i),t.avail_out=o<s?257+(s-o):257-(o-s),P.hold=h,P.bits=p};const cf=15,AI=852,PI=592,II=0,hC=1,RI=2,Zde=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Jde=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),efe=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),tfe=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),nfe=(e,t,n,r,i,o,a,s)=>{const l=s.bits;let u=0,c=0,d=0,f=0,h=0,p=0,m=0,_=0,b=0,y=0,g,v,S,w,x,C=null,k;const T=new Uint16Array(cf+1),P=new Uint16Array(cf+1);let $=null,O,E,A;for(u=0;u<=cf;u++)T[u]=0;for(c=0;c<r;c++)T[t[n+c]]++;for(h=l,f=cf;f>=1&&T[f]===0;f--);if(h>f&&(h=f),f===0)return i[o++]=1<<24|64<<16|0,i[o++]=1<<24|64<<16|0,s.bits=1,0;for(d=1;d<f&&T[d]===0;d++);for(h<d&&(h=d),_=1,u=1;u<=cf;u++)if(_<<=1,_-=T[u],_<0)return-1;if(_>0&&(e===II||f!==1))return-1;for(P[1]=0,u=1;u<cf;u++)P[u+1]=P[u]+T[u];for(c=0;c<r;c++)t[n+c]!==0&&(a[P[t[n+c]]++]=c);if(e===II?(C=$=a,k=20):e===hC?(C=Zde,$=Jde,k=257):(C=efe,$=tfe,k=0),y=0,c=0,u=d,x=o,p=h,m=0,S=-1,b=1<<h,w=b-1,e===hC&&b>AI||e===RI&&b>PI)return 1;for(;;){O=u-m,a[c]+1<k?(E=0,A=a[c]):a[c]>=k?(E=$[a[c]-k],A=C[a[c]-k]):(E=32+64,A=0),g=1<<u-m,v=1<<p,d=v;do v-=g,i[x+(y>>m)+v]=O<<24|E<<16|A|0;while(v!==0);for(g=1<<u-1;y&g;)g>>=1;if(g!==0?(y&=g-1,y+=g):y=0,c++,--T[u]===0){if(u===f)break;u=t[n+a[c]]}if(u>h&&(y&w)!==S){for(m===0&&(m=h),x+=d,p=u-m,_=1<<p;p+m<f&&(_-=T[p+m],!(_<=0));)p++,_<<=1;if(b+=1<<p,e===hC&&b>AI||e===RI&&b>PI)return 1;S=y&w,i[S]=h<<24|p<<16|x-o|0}}return y!==0&&(i[x+y]=u-m<<24|64<<16|0),s.bits=h,0};var Kg=nfe;const rfe=0,yz=1,vz=2,{Z_FINISH:OI,Z_BLOCK:ife,Z_TREES:_v,Z_OK:Od,Z_STREAM_END:ofe,Z_NEED_DICT:afe,Z_STREAM_ERROR:Ta,Z_DATA_ERROR:bz,Z_MEM_ERROR:_z,Z_BUF_ERROR:sfe,Z_DEFLATED:MI}=fy,n2=16180,NI=16181,$I=16182,DI=16183,LI=16184,FI=16185,BI=16186,zI=16187,jI=16188,UI=16189,p_=16190,ul=16191,pC=16192,VI=16193,gC=16194,GI=16195,qI=16196,HI=16197,WI=16198,Sv=16199,xv=16200,KI=16201,QI=16202,XI=16203,YI=16204,ZI=16205,mC=16206,JI=16207,eR=16208,Jn=16209,Sz=16210,xz=16211,lfe=852,ufe=592,cfe=15,dfe=cfe,tR=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function ffe(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Vd=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<n2||t.mode>xz?1:0},wz=e=>{if(Vd(e))return Ta;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=n2,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(lfe),t.distcode=t.distdyn=new Int32Array(ufe),t.sane=1,t.back=-1,Od},Cz=e=>{if(Vd(e))return Ta;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,wz(e)},Ez=(e,t)=>{let n;if(Vd(e))return Ta;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Ta:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,Cz(e))},Tz=(e,t)=>{if(!e)return Ta;const n=new ffe;e.state=n,n.strm=e,n.window=null,n.mode=n2;const r=Ez(e,t);return r!==Od&&(e.state=null),r},hfe=e=>Tz(e,dfe);let nR=!0,yC,vC;const pfe=e=>{if(nR){yC=new Int32Array(512),vC=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Kg(yz,e.lens,0,288,yC,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Kg(vz,e.lens,0,32,vC,0,e.work,{bits:5}),nR=!1}e.lencode=yC,e.lenbits=9,e.distcode=vC,e.distbits=5},kz=(e,t,n,r)=>{let i;const o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),r>=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>r&&(i=r),o.window.set(t.subarray(n-r,n-r+i),o.wnext),r-=i,r?(o.window.set(t.subarray(n-r,n),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0},gfe=(e,t)=>{let n,r,i,o,a,s,l,u,c,d,f,h,p,m,_=0,b,y,g,v,S,w,x,C;const k=new Uint8Array(4);let T,P;const $=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Vd(e)||!e.output||!e.input&&e.avail_in!==0)return Ta;n=e.state,n.mode===ul&&(n.mode=pC),a=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,u=n.hold,c=n.bits,d=s,f=l,C=Od;e:for(;;)switch(n.mode){case n2:if(n.wrap===0){n.mode=pC;break}for(;c<16;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(n.wrap&2&&u===35615){n.wbits===0&&(n.wbits=15),n.check=0,k[0]=u&255,k[1]=u>>>8&255,n.check=si(n.check,k,2,0),u=0,c=0,n.mode=NI;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",n.mode=Jn;break}if((u&15)!==MI){e.msg="unknown compression method",n.mode=Jn;break}if(u>>>=4,c-=4,x=(u&15)+8,n.wbits===0&&(n.wbits=x),x>15||x>n.wbits){e.msg="invalid window size",n.mode=Jn;break}n.dmax=1<<n.wbits,n.flags=0,e.adler=n.check=1,n.mode=u&512?UI:ul,u=0,c=0;break;case NI:for(;c<16;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(n.flags=u,(n.flags&255)!==MI){e.msg="unknown compression method",n.mode=Jn;break}if(n.flags&57344){e.msg="unknown header flags set",n.mode=Jn;break}n.head&&(n.head.text=u>>8&1),n.flags&512&&n.wrap&4&&(k[0]=u&255,k[1]=u>>>8&255,n.check=si(n.check,k,2,0)),u=0,c=0,n.mode=$I;case $I:for(;c<32;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}n.head&&(n.head.time=u),n.flags&512&&n.wrap&4&&(k[0]=u&255,k[1]=u>>>8&255,k[2]=u>>>16&255,k[3]=u>>>24&255,n.check=si(n.check,k,4,0)),u=0,c=0,n.mode=DI;case DI:for(;c<16;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}n.head&&(n.head.xflags=u&255,n.head.os=u>>8),n.flags&512&&n.wrap&4&&(k[0]=u&255,k[1]=u>>>8&255,n.check=si(n.check,k,2,0)),u=0,c=0,n.mode=LI;case LI:if(n.flags&1024){for(;c<16;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}n.length=u,n.head&&(n.head.extra_len=u),n.flags&512&&n.wrap&4&&(k[0]=u&255,k[1]=u>>>8&255,n.check=si(n.check,k,2,0)),u=0,c=0}else n.head&&(n.head.extra=null);n.mode=FI;case FI:if(n.flags&1024&&(h=n.length,h>s&&(h=s),h&&(n.head&&(x=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(o,o+h),x)),n.flags&512&&n.wrap&4&&(n.check=si(n.check,r,h,o)),s-=h,o+=h,n.length-=h),n.length))break e;n.length=0,n.mode=BI;case BI:if(n.flags&2048){if(s===0)break e;h=0;do x=r[o+h++],n.head&&x&&n.length<65536&&(n.head.name+=String.fromCharCode(x));while(x&&h<s);if(n.flags&512&&n.wrap&4&&(n.check=si(n.check,r,h,o)),s-=h,o+=h,x)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=zI;case zI:if(n.flags&4096){if(s===0)break e;h=0;do x=r[o+h++],n.head&&x&&n.length<65536&&(n.head.comment+=String.fromCharCode(x));while(x&&h<s);if(n.flags&512&&n.wrap&4&&(n.check=si(n.check,r,h,o)),s-=h,o+=h,x)break e}else n.head&&(n.head.comment=null);n.mode=jI;case jI:if(n.flags&512){for(;c<16;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(n.wrap&4&&u!==(n.check&65535)){e.msg="header crc mismatch",n.mode=Jn;break}u=0,c=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=ul;break;case UI:for(;c<32;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}e.adler=n.check=tR(u),u=0,c=0,n.mode=p_;case p_:if(n.havedict===0)return e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,n.hold=u,n.bits=c,afe;e.adler=n.check=1,n.mode=ul;case ul:if(t===ife||t===_v)break e;case pC:if(n.last){u>>>=c&7,c-=c&7,n.mode=mC;break}for(;c<3;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}switch(n.last=u&1,u>>>=1,c-=1,u&3){case 0:n.mode=VI;break;case 1:if(pfe(n),n.mode=Sv,t===_v){u>>>=2,c-=2;break e}break;case 2:n.mode=qI;break;case 3:e.msg="invalid block type",n.mode=Jn}u>>>=2,c-=2;break;case VI:for(u>>>=c&7,c-=c&7;c<32;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if((u&65535)!==(u>>>16^65535)){e.msg="invalid stored block lengths",n.mode=Jn;break}if(n.length=u&65535,u=0,c=0,n.mode=gC,t===_v)break e;case gC:n.mode=GI;case GI:if(h=n.length,h){if(h>s&&(h=s),h>l&&(h=l),h===0)break e;i.set(r.subarray(o,o+h),a),s-=h,o+=h,l-=h,a+=h,n.length-=h;break}n.mode=ul;break;case qI:for(;c<14;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(n.nlen=(u&31)+257,u>>>=5,c-=5,n.ndist=(u&31)+1,u>>>=5,c-=5,n.ncode=(u&15)+4,u>>>=4,c-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=Jn;break}n.have=0,n.mode=HI;case HI:for(;n.have<n.ncode;){for(;c<3;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}n.lens[$[n.have++]]=u&7,u>>>=3,c-=3}for(;n.have<19;)n.lens[$[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,T={bits:n.lenbits},C=Kg(rfe,n.lens,0,19,n.lencode,0,n.work,T),n.lenbits=T.bits,C){e.msg="invalid code lengths set",n.mode=Jn;break}n.have=0,n.mode=WI;case WI:for(;n.have<n.nlen+n.ndist;){for(;_=n.lencode[u&(1<<n.lenbits)-1],b=_>>>24,y=_>>>16&255,g=_&65535,!(b<=c);){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(g<16)u>>>=b,c-=b,n.lens[n.have++]=g;else{if(g===16){for(P=b+2;c<P;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(u>>>=b,c-=b,n.have===0){e.msg="invalid bit length repeat",n.mode=Jn;break}x=n.lens[n.have-1],h=3+(u&3),u>>>=2,c-=2}else if(g===17){for(P=b+3;c<P;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}u>>>=b,c-=b,x=0,h=3+(u&7),u>>>=3,c-=3}else{for(P=b+7;c<P;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}u>>>=b,c-=b,x=0,h=11+(u&127),u>>>=7,c-=7}if(n.have+h>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=Jn;break}for(;h--;)n.lens[n.have++]=x}}if(n.mode===Jn)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=Jn;break}if(n.lenbits=9,T={bits:n.lenbits},C=Kg(yz,n.lens,0,n.nlen,n.lencode,0,n.work,T),n.lenbits=T.bits,C){e.msg="invalid literal/lengths set",n.mode=Jn;break}if(n.distbits=6,n.distcode=n.distdyn,T={bits:n.distbits},C=Kg(vz,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,T),n.distbits=T.bits,C){e.msg="invalid distances set",n.mode=Jn;break}if(n.mode=Sv,t===_v)break e;case Sv:n.mode=xv;case xv:if(s>=6&&l>=258){e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,n.hold=u,n.bits=c,Yde(e,f),a=e.next_out,i=e.output,l=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,u=n.hold,c=n.bits,n.mode===ul&&(n.back=-1);break}for(n.back=0;_=n.lencode[u&(1<<n.lenbits)-1],b=_>>>24,y=_>>>16&255,g=_&65535,!(b<=c);){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(y&&!(y&240)){for(v=b,S=y,w=g;_=n.lencode[w+((u&(1<<v+S)-1)>>v)],b=_>>>24,y=_>>>16&255,g=_&65535,!(v+b<=c);){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}u>>>=v,c-=v,n.back+=v}if(u>>>=b,c-=b,n.back+=b,n.length=g,y===0){n.mode=ZI;break}if(y&32){n.back=-1,n.mode=ul;break}if(y&64){e.msg="invalid literal/length code",n.mode=Jn;break}n.extra=y&15,n.mode=KI;case KI:if(n.extra){for(P=n.extra;c<P;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}n.length+=u&(1<<n.extra)-1,u>>>=n.extra,c-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=QI;case QI:for(;_=n.distcode[u&(1<<n.distbits)-1],b=_>>>24,y=_>>>16&255,g=_&65535,!(b<=c);){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(!(y&240)){for(v=b,S=y,w=g;_=n.distcode[w+((u&(1<<v+S)-1)>>v)],b=_>>>24,y=_>>>16&255,g=_&65535,!(v+b<=c);){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}u>>>=v,c-=v,n.back+=v}if(u>>>=b,c-=b,n.back+=b,y&64){e.msg="invalid distance code",n.mode=Jn;break}n.offset=g,n.extra=y&15,n.mode=XI;case XI:if(n.extra){for(P=n.extra;c<P;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}n.offset+=u&(1<<n.extra)-1,u>>>=n.extra,c-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=Jn;break}n.mode=YI;case YI:if(l===0)break e;if(h=f-l,n.offset>h){if(h=n.offset-h,h>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=Jn;break}h>n.wnext?(h-=n.wnext,p=n.wsize-h):p=n.wnext-h,h>n.length&&(h=n.length),m=n.window}else m=i,p=a-n.offset,h=n.length;h>l&&(h=l),l-=h,n.length-=h;do i[a++]=m[p++];while(--h);n.length===0&&(n.mode=xv);break;case ZI:if(l===0)break e;i[a++]=n.length,l--,n.mode=xv;break;case mC:if(n.wrap){for(;c<32;){if(s===0)break e;s--,u|=r[o++]<<c,c+=8}if(f-=l,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?si(n.check,i,f,a-f):t0(n.check,i,f,a-f)),f=l,n.wrap&4&&(n.flags?u:tR(u))!==n.check){e.msg="incorrect data check",n.mode=Jn;break}u=0,c=0}n.mode=JI;case JI:if(n.wrap&&n.flags){for(;c<32;){if(s===0)break e;s--,u+=r[o++]<<c,c+=8}if(n.wrap&4&&u!==(n.total&4294967295)){e.msg="incorrect length check",n.mode=Jn;break}u=0,c=0}n.mode=eR;case eR:C=ofe;break e;case Jn:C=bz;break e;case Sz:return _z;case xz:default:return Ta}return e.next_out=a,e.avail_out=l,e.next_in=o,e.avail_in=s,n.hold=u,n.bits=c,(n.wsize||f!==e.avail_out&&n.mode<Jn&&(n.mode<mC||t!==OI))&&kz(e,e.output,e.next_out,f-e.avail_out),d-=e.avail_in,f-=e.avail_out,e.total_in+=d,e.total_out+=f,n.total+=f,n.wrap&4&&f&&(e.adler=n.check=n.flags?si(n.check,i,f,e.next_out-f):t0(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(n.mode===ul?128:0)+(n.mode===Sv||n.mode===gC?256:0),(d===0&&f===0||t===OI)&&C===Od&&(C=sfe),C},mfe=e=>{if(Vd(e))return Ta;let t=e.state;return t.window&&(t.window=null),e.state=null,Od},yfe=(e,t)=>{if(Vd(e))return Ta;const n=e.state;return n.wrap&2?(n.head=t,t.done=!1,Od):Ta},vfe=(e,t)=>{const n=t.length;let r,i,o;return Vd(e)||(r=e.state,r.wrap!==0&&r.mode!==p_)?Ta:r.mode===p_&&(i=1,i=t0(i,t,n,0),i!==r.check)?bz:(o=kz(e,t,n,n),o?(r.mode=Sz,_z):(r.havedict=1,Od))};var bfe=Cz,_fe=Ez,Sfe=wz,xfe=hfe,wfe=Tz,Cfe=gfe,Efe=mfe,Tfe=yfe,kfe=vfe,Afe="pako inflate (from Nodeca project)",Sl={inflateReset:bfe,inflateReset2:_fe,inflateResetKeep:Sfe,inflateInit:xfe,inflateInit2:wfe,inflate:Cfe,inflateEnd:Efe,inflateGetHeader:Tfe,inflateSetDictionary:kfe,inflateInfo:Afe};function Pfe(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Ife=Pfe;const Az=Object.prototype.toString,{Z_NO_FLUSH:Rfe,Z_FINISH:Ofe,Z_OK:i0,Z_STREAM_END:bC,Z_NEED_DICT:_C,Z_STREAM_ERROR:Mfe,Z_DATA_ERROR:rR,Z_MEM_ERROR:Nfe}=fy;function py(e){this.options=t2.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new gz,this.strm.avail_out=0;let n=Sl.inflateInit2(this.strm,t.windowBits);if(n!==i0)throw new Error(Kh[n]);if(this.header=new Ife,Sl.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=r0.string2buf(t.dictionary):Az.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Sl.inflateSetDictionary(this.strm,t.dictionary),n!==i0)))throw new Error(Kh[n])}py.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,i=this.options.dictionary;let o,a,s;if(this.ended)return!1;for(t===~~t?a=t:a=t===!0?Ofe:Rfe,Az.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),o=Sl.inflate(n,a),o===_C&&i&&(o=Sl.inflateSetDictionary(n,i),o===i0?o=Sl.inflate(n,a):o===rR&&(o=_C));n.avail_in>0&&o===bC&&n.state.wrap>0&&e[n.next_in]!==0;)Sl.inflateReset(n),o=Sl.inflate(n,a);switch(o){case Mfe:case rR:case _C:case Nfe:return this.onEnd(o),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||o===bC))if(this.options.to==="string"){let l=r0.utf8border(n.output,n.next_out),u=n.next_out-l,c=r0.buf2string(n.output,l);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(l,l+u),0),this.onData(c)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(o===i0&&s===0)){if(o===bC)return o=Sl.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};py.prototype.onData=function(e){this.chunks.push(e)};py.prototype.onEnd=function(e){e===i0&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=t2.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ak(e,t){const n=new py(t);if(n.push(e),n.err)throw n.msg||Kh[n.err];return n.result}function $fe(e,t){return t=t||{},t.raw=!0,Ak(e,t)}var Dfe=py,Lfe=Ak,Ffe=$fe,Bfe=Ak,zfe=fy,jfe={Inflate:Dfe,inflate:Lfe,inflateRaw:Ffe,ungzip:Bfe,constants:zfe};const{Inflate:AGe,inflate:Ufe,inflateRaw:PGe,ungzip:IGe}=jfe;var Pz=Ufe;const Iz=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=3988292384^t>>>1:t=t>>>1;Iz[e]=t}function Vfe(e){let t=-1;for(let n=0;n<e.length;n++)t=Iz[(t^e[n])&255]^t>>>8;return t^-1}var er;(function(e){e[e.GRAYSCALE=0]="GRAYSCALE",e[e.TRUE_COLOR=2]="TRUE_COLOR",e[e.PALETTE=3]="PALETTE",e[e.GRAYSCALE_WITH_ALPHA=4]="GRAYSCALE_WITH_ALPHA",e[e.TRUE_COLOR_WITH_ALPHA=6]="TRUE_COLOR_WITH_ALPHA"})(er||(er={}));const Gfe={[er.GRAYSCALE]:1,[er.TRUE_COLOR]:3,[er.PALETTE]:1,[er.GRAYSCALE_WITH_ALPHA]:2,[er.TRUE_COLOR_WITH_ALPHA]:4},qfe=1;var Go;(function(e){e[e.NONE=0]="NONE",e[e.SUB=1]="SUB",e[e.UP=2]="UP",e[e.AVERAGE=3]="AVERAGE",e[e.PAETH=4]="PAETH"})(Go||(Go={}));const Hfe={[Go.NONE](e){return e},[Go.SUB](e,t){const n=new Uint8Array(e.length);for(let r=0;r<e.length;r++){const i=n[r-t]||0;n[r]=e[r]+i}return n},[Go.UP](e,t,n){const r=new Uint8Array(e.length);for(let i=0;i<e.length;i++){const o=n[i]||0;r[i]=o+e[i]}return r},[Go.AVERAGE](e,t,n){const r=new Uint8Array(e.length);for(let i=0;i<e.length;i++){const o=r[i-t]||0,a=n[i]||0,s=o+a>>1;r[i]=e[i]+s}return r},[Go.PAETH](e,t,n){const r=new Uint8Array(e.length);for(let i=0;i<e.length;i++){const o=r[i-t]||0,a=n[i],s=n[i-t]||0,l=Rz(o,a,s);r[i]=e[i]+l}return r}};Go.NONE+"",Go.SUB+"",Go.UP+"",Go.AVERAGE+"",Go.PAETH+"";function Rz(e,t,n){const r=e+t-n,i=Math.abs(r-e),o=Math.abs(r-t),a=Math.abs(r-n);return i<=o&&i<=a?e:o<=a?t:n}function li(e,t,n){if(t===n)return e;const r=2**t-1,i=2**n-1;return Math.round(e*i/r)}function Wfe(e,t){const n=[];let r=0;for(;r<e.length;)if(t===1){const i=e[r++];n.push(i>>7&1,i>>6&1,i>>5&1,i>>4&1,i>>3&1,i>>2&1,i>>1&1,i&1)}else if(t===2){const i=e[r++];n.push(i>>6&3,i>>4&3,i>>2&3,i&3)}else if(t===4){const i=e[r++];n.push(i>>4&15,i&15)}else if(t===8){const i=e[r++];n.push(i)}else if(t===16)n.push(e[r++]<<8|e[r++]);else throw new Error("Unsupported depth: "+t);return n}const Oz=[{x:[0],y:[0]},{x:[4],y:[0]},{x:[0,4],y:[4]},{x:[2,6],y:[0,4]},{x:[0,2,4,6],y:[2,6]},{x:[1,3,5,7],y:[0,2,4,6]},{x:[0,1,2,3,4,5,6,7],y:[1,3,5,7]}];function Kfe(e,t,n){if(!e)return[{passWidth:t,passHeight:n,passIndex:0}];const r=[];return Oz.forEach(function({x:i,y:o},a){const s=t%8,l=n%8,u=t-s>>3,c=n-l>>3;let d=u*i.length;for(let h=0;h<i.length&&i[h]<s;h++)d++;let f=c*o.length;for(let h=0;h<o.length&&o[h]<l;h++)f++;d&&f&&r.push({passWidth:d,passHeight:f,passIndex:a})}),r}function Qfe(e,t,n,r,i){if(!e)return t*i+r<<2;const o=Oz[n],a=r%o.x.length,s=i%o.y.length,l=(r-a)/o.x.length,u=(i-s)/o.y.length,c=o.x[a],d=o.y[s];return t*((u<<3)+d)+(l<<3)+c<<2}function Xfe(e,t,n,r,i,o,a,s){let l=[];const u=Pz(e),c=Kfe(t,r,i),f=Gfe[n]*o,h=f>>3||1;let p=0,m=new Uint8Array;for(let _=0;_<c.length;_++){const{passWidth:b,passHeight:y,passIndex:g}=c[_];for(let v=0;v<y;v++){let P=function(){if(n===er.GRAYSCALE){const $=li(T[k++],o,8);return[$,$,$,255]}if(n===er.TRUE_COLOR)return[li(T[k++],o,8),li(T[k++],o,8),li(T[k++],o,8),255];if(n===er.PALETTE){const $=T[k++];if(!a)throw new Error("Mising chunk: PLTE");return a[$]}if(n===er.GRAYSCALE_WITH_ALPHA){const $=li(T[k++],o,8);return[$,$,$,li(T[k++],o,8)]}if(n===er.TRUE_COLOR_WITH_ALPHA)return[li(T[k++],o,8),li(T[k++],o,8),li(T[k++],o,8),li(T[k++],o,8)];throw new Error("Unsupported color type: "+n)};const S=(b*f+7>>3)+qfe,w=u[p];if(!(w in Go))throw new Error("Unsupported filter type: "+w);const x=Hfe[w],C=x(u.slice(p+1,p+S),h,m);m=C;let k=0;const T=Wfe(C,o);for(let $=0;$<b;$++){const O=P();s&&O[0]===s[0]&&O[1]===s[1]&&O[2]===s[2]&&(O[3]=0);const E=Qfe(t,r,g,$,v);for(let A=0;A<O.length;A++)l[E+A]=O[A]}p+=S}}return l}const SC=[137,80,78,71,13,10,26,10],Yfe=1e5;function xC(e){let t=0,n="";for(;t<e.length;){let r=e[t++];if(r>127)if(r>191&&r<224){if(t>=e.length)throw new Error("UTF-8 decode: incomplete 2-byte sequence");r=(r&31)<<6|e[t++]&63}else if(r>223&&r<240){if(t+1>=e.length)throw new Error("UTF-8 decode: incomplete 3-byte sequence");r=(r&15)<<12|(e[t++]&63)<<6|e[t++]&63}else if(r>239&&r<248){if(t+2>=e.length)throw new Error("UTF-8 decode: incomplete 4-byte sequence");r=(r&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63}else throw new Error("UTF-8 decode: unknown multibyte start 0x"+r.toString(16)+" at index "+(t-1));if(r<=65535)n+=String.fromCharCode(r);else if(r<=1114111)r-=65536,n+=String.fromCharCode(r>>10|55296),n+=String.fromCharCode(r&1023|56320);else throw new Error("UTF-8 decode: code point 0x"+r.toString(16)+" exceeds UTF-16 reach")}return n}function Zfe(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}const uu=1e5;function Jfe(e){const t=new Uint8Array(e);let n=new Uint8Array;const r={width:0,height:0,depth:0,colorType:0,compression:0,interlace:0,filter:0,data:[]};let i=0;function o(){return t[i++]<<24|t[i++]<<16|t[i++]<<8|t[i++]}function a(){return t[i++]<<8|t[i++]}function s(){return t[i++]}function l(){const M=[];let R=0;for(;(R=t[i++])!==0;)M.push(R);return new Uint8Array(M)}function u(M){const R=i+M;let N="";for(;i<R;){const B=s();if(B===0)break;N+=String.fromCharCode(B)}return N}function c(M){let R="";for(;i<M;){const N=s();R+=String.fromCharCode(N)}return R}function d(M){const R=t.slice(i,M);return i=M,Pz(R)}function f(){let M="";for(const R=i+4;i<R;i++)M+=String.fromCharCode(t[i]);return M}for(;i<SC.length;i++)if(t[i]!==SC[i])throw new Error(`Invalid file signature, at position ${i}: ${t[i]} !== ${SC[i]}`);const h={IHDR:p,PLTE:m,IDAT:_,IEND:b,tRNS:y,cHRM:g,gAMA:v,iCCP:S,sBIT:w,sRGB:x,tEXt:C,zTXt:k,iTXt:T,bKGD:P,hIST:$,pHYs:O,sPLT:E,tIME:A};function p(){r.width=o(),r.height=o(),r.depth=s();const M=s();if(!(M in er))throw new Error("Unsupported color type: "+M);r.colorType=M,r.compression=s(),r.filter=s(),r.interlace=s()}function m(M){const R=[];for(let N=0;N<M;N+=3)R.push([t[i++],t[i++],t[i++],255]);r.palette=R}function _(M){n=Zfe(n,t.slice(i,i+M)),i+=M}function b(M){i+=M}function y(M){if(r.colorType===er.GRAYSCALE){const R=li(t[i++]<<8|t[i++],r.depth,8);r.transparent=[R,R,R,255]}else if(r.colorType===er.TRUE_COLOR)r.transparent=[li(t[i++]<<8|t[i++],r.depth,8),li(t[i++]<<8|t[i++],r.depth,8),li(t[i++]<<8|t[i++],r.depth,8),255];else if(r.colorType===er.PALETTE){if(!r.palette)throw new Error("Missing chunk: PLTE");for(let R=0;R<M;R++)r.palette[R][3]=t[i++]}}function g(){r.chromaticities={white:{x:o()/uu,y:o()/uu},red:{x:o()/uu,y:o()/uu},green:{x:o()/uu,y:o()/uu},blue:{x:o()/uu,y:o()/uu}}}function v(){r.gamma=o()/Yfe}function S(M){const R=i+M,N=u(80);s();const B=d(R);r.icc={name:N,profile:Array.from(B)}}function w(){if(r.colorType===er.GRAYSCALE){const M=s();r.significantBits=[M,M,M,r.depth]}else if(r.colorType===er.TRUE_COLOR||r.colorType===er.PALETTE)r.significantBits=[s(),s(),s(),r.depth];else if(r.colorType===er.GRAYSCALE_WITH_ALPHA){const M=s();r.significantBits=[M,M,M,s()]}else r.colorType===er.TRUE_COLOR_WITH_ALPHA&&(r.significantBits=[s(),s(),s(),s()])}function x(){r.sRGB=s()}function C(M){const R=i+M,N=u(80),B=c(R);r.text||(r.text={}),r.text[N]=B}function k(M){const R=i+M,N=u(80);s();const B=d(R);let U="";for(let G=0;G<B.length;G++)U+=String.fromCharCode(B[G]);r.compressedText||(r.compressedText={}),r.compressedText[N]=U}function T(M){const R=i+M,N=u(80),B=s();s();const U=u(1/0),G=xC(l());let Z="";if(B===0)Z=xC(t.slice(i,R)),i=R;else{const ee=d(R);Z=xC(ee)}r.internationalText||(r.internationalText={}),r.internationalText[N]={languageTag:U,translatedKeyword:G,text:Z}}function P(){if((r.colorType&3)===er.GRAYSCALE){const M=li(t[i++]<<8|t[i++],r.depth,8);r.background=[M,M,M,255]}else if((r.colorType&3)===er.TRUE_COLOR)r.background=[li(t[i++]<<8|t[i++],r.depth,8),li(t[i++]<<8|t[i++],r.depth,8),li(t[i++]<<8|t[i++],r.depth,8),255];else if(r.colorType===er.PALETTE){if(!r.palette)throw new Error("Missing chunk: PLTE");r.background=r.palette[t[i++]]}}function $(M){const R=i+M,N=[];for(;i<R;)N.push(a());r.histogram=N}function O(){const M=o(),R=o(),N=s();r.physicalDimensions={pixelPerUnitX:M,pixelPerUnitY:R,unit:N}}function E(M){const R=i+M,N=u(80),B=s(),U=[];if(B===8)for(;i<R;)U.push([s(),s(),s(),s(),a()]);else if(B===16)for(;i<R;)U.push([a(),a(),a(),a(),a()]);r.suggestedPalette={name:N,depth:B,palette:U}}function A(){const M=a(),R=s(),N=s(),B=s(),U=s(),G=s();r.lastModificationTime=Date.UTC(M,R-1,N,B,U,G)}function D(){const M=i,R=o(),N=f();h[N]?h[N](R):(N.charCodeAt(0)&32,i+=R),L(M,R)}function L(M,R){const N=o(),B=Vfe(t.slice(M+4,M+8+R));if(N!==B)throw new Error("Crc32 error: calculated "+B+", expected "+N);i<t.length&&D()}return D(),r.data=Xfe(n,r.interlace,r.colorType,r.width,r.height,r.depth,r.palette,r.transparent),r}var Mz={},r2={},i2={};Object.defineProperty(i2,"__esModule",{value:!0});i2.createLogMethods=void 0;var ehe=function(){return{debug:console.debug.bind(console),error:console.error.bind(console),fatal:console.error.bind(console),info:console.info.bind(console),trace:console.debug.bind(console),warn:console.warn.bind(console)}};i2.createLogMethods=ehe;var Pk={},o2={};Object.defineProperty(o2,"__esModule",{value:!0});o2.boolean=void 0;const the=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1"].includes(e.trim().toLowerCase());case"[object Number]":return e.valueOf()===1;case"[object Boolean]":return e.valueOf();default:return!1}};o2.boolean=the;var a2={};Object.defineProperty(a2,"__esModule",{value:!0});a2.isBooleanable=void 0;const nhe=function(e){switch(Object.prototype.toString.call(e)){case"[object String]":return["true","t","yes","y","on","1","false","f","no","n","off","0"].includes(e.trim().toLowerCase());case"[object Number]":return[0,1].includes(e.valueOf());case"[object Boolean]":return!0;default:return!1}};a2.isBooleanable=nhe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isBooleanable=e.boolean=void 0;const t=o2;Object.defineProperty(e,"boolean",{enumerable:!0,get:function(){return t.boolean}});const n=a2;Object.defineProperty(e,"isBooleanable",{enumerable:!0,get:function(){return n.isBooleanable}})})(Pk);var iR=Object.prototype.toString,Nz=function(t){var n=iR.call(t),r=n==="[object Arguments]";return r||(r=n!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&iR.call(t.callee)==="[object Function]"),r},wC,oR;function rhe(){if(oR)return wC;oR=1;var e;if(!Object.keys){var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Nz,i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),a=i.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(f){var h=f.constructor;return h&&h.prototype===f},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},c=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&t.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{l(window[f])}catch{return!0}}catch{return!0}return!1}(),d=function(f){if(typeof window>"u"||!c)return l(f);try{return l(f)}catch{return!1}};e=function(h){var p=h!==null&&typeof h=="object",m=n.call(h)==="[object Function]",_=r(h),b=p&&n.call(h)==="[object String]",y=[];if(!p&&!m&&!_)throw new TypeError("Object.keys called on a non-object");var g=a&&m;if(b&&h.length>0&&!t.call(h,0))for(var v=0;v<h.length;++v)y.push(String(v));if(_&&h.length>0)for(var S=0;S<h.length;++S)y.push(String(S));else for(var w in h)!(g&&w==="prototype")&&t.call(h,w)&&y.push(String(w));if(o)for(var x=d(h),C=0;C<s.length;++C)!(x&&s[C]==="constructor")&&t.call(h,s[C])&&y.push(s[C]);return y}}return wC=e,wC}var ihe=Array.prototype.slice,ohe=Nz,aR=Object.keys,D1=aR?function(t){return aR(t)}:rhe(),sR=Object.keys;D1.shim=function(){if(Object.keys){var t=function(){var n=Object.keys(arguments);return n&&n.length===arguments.length}(1,2);t||(Object.keys=function(r){return ohe(r)?sR(ihe.call(r)):sR(r)})}else Object.keys=D1;return Object.keys||D1};var ahe=D1,she=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;t[n]=i;for(n in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,n);if(a.value!==i||a.enumerable!==!0)return!1}return!0},lR=typeof Symbol<"u"&&Symbol,lhe=she,uhe=function(){return typeof lR!="function"||typeof Symbol!="function"||typeof lR("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:lhe()},uR={foo:{}},che=Object,dhe=function(){return{__proto__:uR}.foo===uR.foo&&!({__proto__:null}instanceof che)},fhe="Function.prototype.bind called on incompatible ",CC=Array.prototype.slice,hhe=Object.prototype.toString,phe="[object Function]",ghe=function(t){var n=this;if(typeof n!="function"||hhe.call(n)!==phe)throw new TypeError(fhe+n);for(var r=CC.call(arguments,1),i,o=function(){if(this instanceof i){var c=n.apply(this,r.concat(CC.call(arguments)));return Object(c)===c?c:this}else return n.apply(t,r.concat(CC.call(arguments)))},a=Math.max(0,n.length-r.length),s=[],l=0;l<a;l++)s.push("$"+l);if(i=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(o),n.prototype){var u=function(){};u.prototype=n.prototype,i.prototype=new u,u.prototype=null}return i},mhe=ghe,$z=Function.prototype.bind||mhe,yhe=$z,vhe=yhe.call(Function.call,Object.prototype.hasOwnProperty),Dt,Yh=SyntaxError,Dz=Function,ph=TypeError,EC=function(e){try{return Dz('"use strict"; return ('+e+").constructor;")()}catch{}},gd=Object.getOwnPropertyDescriptor;if(gd)try{gd({},"")}catch{gd=null}var TC=function(){throw new ph},bhe=gd?function(){try{return arguments.callee,TC}catch{try{return gd(arguments,"callee").get}catch{return TC}}}():TC,df=uhe(),_he=dhe(),ai=Object.getPrototypeOf||(_he?function(e){return e.__proto__}:null),Cf={},She=typeof Uint8Array>"u"||!ai?Dt:ai(Uint8Array),md={"%AggregateError%":typeof AggregateError>"u"?Dt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Dt:ArrayBuffer,"%ArrayIteratorPrototype%":df&&ai?ai([][Symbol.iterator]()):Dt,"%AsyncFromSyncIteratorPrototype%":Dt,"%AsyncFunction%":Cf,"%AsyncGenerator%":Cf,"%AsyncGeneratorFunction%":Cf,"%AsyncIteratorPrototype%":Cf,"%Atomics%":typeof Atomics>"u"?Dt:Atomics,"%BigInt%":typeof BigInt>"u"?Dt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Dt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Dt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Dt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?Dt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Dt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Dt:FinalizationRegistry,"%Function%":Dz,"%GeneratorFunction%":Cf,"%Int8Array%":typeof Int8Array>"u"?Dt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Dt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Dt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":df&&ai?ai(ai([][Symbol.iterator]())):Dt,"%JSON%":typeof JSON=="object"?JSON:Dt,"%Map%":typeof Map>"u"?Dt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!df||!ai?Dt:ai(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Dt:Promise,"%Proxy%":typeof Proxy>"u"?Dt:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?Dt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Dt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!df||!ai?Dt:ai(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Dt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":df&&ai?ai(""[Symbol.iterator]()):Dt,"%Symbol%":df?Symbol:Dt,"%SyntaxError%":Yh,"%ThrowTypeError%":bhe,"%TypedArray%":She,"%TypeError%":ph,"%Uint8Array%":typeof Uint8Array>"u"?Dt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Dt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Dt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Dt:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?Dt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Dt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Dt:WeakSet};if(ai)try{null.error}catch(e){var xhe=ai(ai(e));md["%Error.prototype%"]=xhe}var whe=function e(t){var n;if(t==="%AsyncFunction%")n=EC("async function () {}");else if(t==="%GeneratorFunction%")n=EC("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=EC("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&ai&&(n=ai(i.prototype))}return md[t]=n,n},cR={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},gy=$z,g_=vhe,Che=gy.call(Function.call,Array.prototype.concat),Ehe=gy.call(Function.apply,Array.prototype.splice),dR=gy.call(Function.call,String.prototype.replace),m_=gy.call(Function.call,String.prototype.slice),The=gy.call(Function.call,RegExp.prototype.exec),khe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ahe=/\\(\\)?/g,Phe=function(t){var n=m_(t,0,1),r=m_(t,-1);if(n==="%"&&r!=="%")throw new Yh("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new Yh("invalid intrinsic syntax, expected opening `%`");var i=[];return dR(t,khe,function(o,a,s,l){i[i.length]=s?dR(l,Ahe,"$1"):a||o}),i},Ihe=function(t,n){var r=t,i;if(g_(cR,r)&&(i=cR[r],r="%"+i[0]+"%"),g_(md,r)){var o=md[r];if(o===Cf&&(o=whe(r)),typeof o>"u"&&!n)throw new ph("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:o}}throw new Yh("intrinsic "+t+" does not exist!")},Rhe=function(t,n){if(typeof t!="string"||t.length===0)throw new ph("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new ph('"allowMissing" argument must be a boolean');if(The(/^%?[^%]*%?$/,t)===null)throw new Yh("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=Phe(t),i=r.length>0?r[0]:"",o=Ihe("%"+i+"%",n),a=o.name,s=o.value,l=!1,u=o.alias;u&&(i=u[0],Ehe(r,Che([0,1],u)));for(var c=1,d=!0;c<r.length;c+=1){var f=r[c],h=m_(f,0,1),p=m_(f,-1);if((h==='"'||h==="'"||h==="`"||p==='"'||p==="'"||p==="`")&&h!==p)throw new Yh("property names with quotes must have matching quotes");if((f==="constructor"||!d)&&(l=!0),i+="."+f,a="%"+i+"%",g_(md,a))s=md[a];else if(s!=null){if(!(f in s)){if(!n)throw new ph("base intrinsic for "+t+" exists, but the property is not available.");return}if(gd&&c+1>=r.length){var m=gd(s,f);d=!!m,d&&"get"in m&&!("originalValue"in m.get)?s=m.get:s=s[f]}else d=g_(s,f),s=s[f];d&&!l&&(md[a]=s)}}return s},Ohe=Rhe,mE=Ohe("%Object.defineProperty%",!0),yE=function(){if(mE)try{return mE({},"a",{value:1}),!0}catch{return!1}return!1};yE.hasArrayLengthDefineBug=function(){if(!yE())return null;try{return mE([],"length",{value:1}).length!==1}catch{return!0}};var Mhe=yE,Nhe=ahe,$he=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Dhe=Object.prototype.toString,Lhe=Array.prototype.concat,Lz=Object.defineProperty,Fhe=function(e){return typeof e=="function"&&Dhe.call(e)==="[object Function]"},Bhe=Mhe(),Fz=Lz&&Bhe,zhe=function(e,t,n,r){if(t in e){if(r===!0){if(e[t]===n)return}else if(!Fhe(r)||!r())return}Fz?Lz(e,t,{configurable:!0,enumerable:!1,value:n,writable:!0}):e[t]=n},Bz=function(e,t){var n=arguments.length>2?arguments[2]:{},r=Nhe(t);$he&&(r=Lhe.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;i+=1)zhe(e,r[i],t[r[i]],n[r[i]])};Bz.supportsDescriptors=!!Fz;var zz=Bz,L1={exports:{}};typeof self<"u"?L1.exports=self:typeof window<"u"?L1.exports=window:L1.exports=Function("return this")();var jz=L1.exports,jhe=jz,Uz=function(){return typeof yt!="object"||!yt||yt.Math!==Math||yt.Array!==Array?jhe:yt},Uhe=zz,Vhe=Uz,Ghe=function(){var t=Vhe();if(Uhe.supportsDescriptors){var n=Object.getOwnPropertyDescriptor(t,"globalThis");(!n||n.configurable&&(n.enumerable||!n.writable||globalThis!==t))&&Object.defineProperty(t,"globalThis",{configurable:!0,enumerable:!1,value:t,writable:!0})}else(typeof globalThis!="object"||globalThis!==t)&&(t.globalThis=t);return t},qhe=zz,Hhe=jz,Vz=Uz,Whe=Ghe,Khe=Vz(),Gz=function(){return Khe};qhe(Gz,{getPolyfill:Vz,implementation:Hhe,shim:Whe});var Ik=Gz,qz={},my={},Rk={},s2={},l2={};Object.defineProperty(l2,"__esModule",{value:!0});l2.convertWildcardToRegex=void 0;var Qhe=/\*+/g,Xhe=function(e){return new RegExp(e.replace(Qhe,"(.+?)"))};l2.convertWildcardToRegex=Xhe;var yy={};Object.defineProperty(yy,"__esModule",{value:!0});yy.escapeRegexString=void 0;var Yhe=/[$()*+.?[\\\]^{|}]/g,Zhe=/-/g,Jhe=function(e){return e.replace(Yhe,"\\$&").replace(Zhe,"\\x2d")};yy.escapeRegexString=Jhe;var u2={};Object.defineProperty(u2,"__esModule",{value:!0});u2.parseRegex=void 0;var epe=/(\/?)(.+)\1([a-z]*)/,tpe=/^(?!.*?(.).*?\1)[AJUXgimsux]+$/,npe=function(e){var t=epe.exec(e);if(!t)throw new Error("Invalid RegExp.");return t[3]&&!tpe.test(t[3])?new RegExp(e):new RegExp(t[2],t[3])};u2.parseRegex=npe;Object.defineProperty(s2,"__esModule",{value:!0});s2.createStringTest=void 0;var rpe=l2,ipe=yy,ope=u2,kC=function(e,t){var n;return e[t]?n=e[t]:n=e[t]=(0,ope.parseRegex)(t),function(r){var i,o;return(o=(i=r.match(n))===null||i===void 0?void 0:i[0])!==null&&o!==void 0?o:!1}},ape=function(e,t){if(t.type!=="Tag")throw new Error("Expected a tag expression.");var n=t.expression;if(n.type==="RangeExpression")throw new Error("Unexpected range expression.");if(n.type==="RegexExpression")return kC(e,n.value);if(n.type!=="LiteralExpression")throw new Error("Expected a literal expression.");var r=String(n.value);return r.includes("*")&&n.quoted===!1?kC(e,String((0,rpe.convertWildcardToRegex)(r))+(n.quoted?"u":"ui")):kC(e,"/("+(0,ipe.escapeRegexString)(r)+")/"+(n.quoted?"u":"ui"))};s2.createStringTest=ape;var c2={};Object.defineProperty(c2,"__esModule",{value:!0});c2.testComparisonRange=void 0;var spe=function(e,t,n){switch(n){case":=":return t===e;case":>":return t>e;case":<":return t<e;case":>=":return t>=e;case":<=":return t<=e;default:throw new Error("Unimplemented comparison operator: ".concat(n))}};c2.testComparisonRange=spe;var d2={};Object.defineProperty(d2,"__esModule",{value:!0});d2.testRange=void 0;var lpe=function(e,t){return typeof e=="number"?!(e<t.min||e===t.min&&!t.minInclusive||e>t.max||e===t.max&&!t.maxInclusive):!1};d2.testRange=lpe;(function(e){var t=yt&&yt.__assign||function(){return t=Object.assign||function(c){for(var d,f=1,h=arguments.length;f<h;f++){d=arguments[f];for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}return c},t.apply(this,arguments)},n=yt&&yt.__spreadArray||function(c,d,f){if(f||arguments.length===2)for(var h=0,p=d.length,m;h<p;h++)(m||!(h in d))&&(m||(m=Array.prototype.slice.call(d,0,h)),m[h]=d[h]);return c.concat(m||Array.prototype.slice.call(d))};Object.defineProperty(e,"__esModule",{value:!0}),e.internalFilter=void 0;var r=s2,i=c2,o=d2,a=function(c){if(c.type!=="Tag")throw new Error("Expected a tag expression.");var d=c.expression;if(d.type==="RangeExpression")return function(m){return(0,o.testRange)(m,d.range)};if(d.type==="EmptyExpression")return function(){return!1};var f=d.value;if(c.operator&&c.operator.operator!==":"){var h=c.operator;if(typeof f!="number")throw new TypeError("Expected a number.");return function(m){return typeof m!="number"?!1:(0,i.testComparisonRange)(f,m,h.operator)}}else{if(typeof f=="boolean")return function(m){return m===f};if(f===null)return function(m){return m===null};var p=(0,r.createStringTest)({},c);return function(m){return p(String(m))}}},s=function(c,d,f,h,p){if(Array.isArray(d)){for(var m=!1,_=0,b=0,y=d;b<y.length;b++){var g=y[b];if(s(c,g,f,n(n([],h,!0),[String(_++)],!1),p)){if(f)return!0;m=!0}}return m}else if(typeof d=="object"&&d!==null){var m=!1;for(var v in d)if(s(c,d[v],f,n(n([],h,!0),[v],!1),p)){if(f)return!0;m=!0}return m}if(c.type!=="Tag")throw new Error("Expected a tag expression.");if(!c.test)throw new Error("Expected test to be defined.");var S=c.test(d);return S?(p.push(t(t({},typeof S=="string"&&{keyword:S}),{path:h.join(".")})),!0):!!S},l=function(c,d,f,h,p){if(d.type!=="Tag")throw new Error("Expected a tag expression.");if(d.test||(d.test=a(d)),d.field.type==="ImplicitField"){var m=!1;for(var _ in c)if(s(t(t({},d),{field:{location:{end:-1,start:-1},name:_,quoted:!0,quotes:"double",type:"Field"}}),c[_],f,n(n([],h,!0),[_],!1),p)){if(f)return!0;m=!0}return m}if(d.field.name in c)return s(d,c[d.field.name],f,h,p);if(d.getValue&&d.field.path)return s(d,d.getValue(c),f,d.field.path,p);if(d.field.path){for(var b=c,y=0,g=d.field.path;y<g.length;y++){var v=g[y];if(typeof b!="object"||b===null)return!1;if(v in b)b=b[v];else return!1}return s(d,b,f,d.field.path,p)}else return!1},u=function(c,d,f,h,p){if(f===void 0&&(f=!0),h===void 0&&(h=[]),p===void 0&&(p=[]),c.type==="Tag")return d.filter(function(y){return l(y,c,f,c.field.type==="ImplicitField"?h:n(n([],h,!0),[c.field.name],!1),p)});if(c.type==="UnaryOperator"){var m=(0,e.internalFilter)(c.operand,d,f,h,[]);return d.filter(function(y){return!m.includes(y)})}if(!c.left)throw new Error("Expected left to be defined.");var _=(0,e.internalFilter)(c.left,d,f,h,p);if(!c.right)throw new Error("Expected right to be defined.");if(c.type!=="LogicalExpression")throw new Error("Expected a tag expression.");if(c.operator.operator==="OR"){var b=(0,e.internalFilter)(c.right,d,f,h,p);return Array.from(new Set(n(n([],_,!0),b,!0)))}else if(c.operator.operator==="AND")return(0,e.internalFilter)(c.right,_,f,h,p);throw new Error("Unexpected state.")};e.internalFilter=u})(Rk);Object.defineProperty(my,"__esModule",{value:!0});my.filter=void 0;var upe=Rk,cpe=function(e,t){return(0,upe.internalFilter)(e,t)};my.filter=cpe;var f2={};Object.defineProperty(f2,"__esModule",{value:!0});f2.highlight=void 0;var dpe=yy,fpe=Rk,hpe=function(e,t){var n=[];(0,fpe.internalFilter)(e,[t],!1,[],n);for(var r=[],i=function(l){var u=r.find(function(c){return c.path===l.path});u||(u={keywords:[],path:l.path},r.push(u)),l.keyword&&u.keywords.push(l.keyword)},o=0,a=n;o<a.length;o++){var s=a[o];i(s)}return r.map(function(l){return l.keywords.length>0?{path:l.path,query:new RegExp("("+l.keywords.map(function(u){return(0,dpe.escapeRegexString)(u.trim())}).join("|")+")")}:{path:l.path}})};f2.highlight=hpe;var h2={},Hz={exports:{}};(function(e){(function(t,n){e.exports?e.exports=n():t.nearley=n()})(yt,function(){function t(u,c,d){return this.id=++t.highestId,this.name=u,this.symbols=c,this.postprocess=d,this}t.highestId=0,t.prototype.toString=function(u){var c=typeof u>"u"?this.symbols.map(l).join(" "):this.symbols.slice(0,u).map(l).join(" ")+" ● "+this.symbols.slice(u).map(l).join(" ");return this.name+" → "+c};function n(u,c,d,f){this.rule=u,this.dot=c,this.reference=d,this.data=[],this.wantedBy=f,this.isComplete=this.dot===u.symbols.length}n.prototype.toString=function(){return"{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0)},n.prototype.nextState=function(u){var c=new n(this.rule,this.dot+1,this.reference,this.wantedBy);return c.left=this,c.right=u,c.isComplete&&(c.data=c.build(),c.right=void 0),c},n.prototype.build=function(){var u=[],c=this;do u.push(c.right.data),c=c.left;while(c.left);return u.reverse(),u},n.prototype.finish=function(){this.rule.postprocess&&(this.data=this.rule.postprocess(this.data,this.reference,a.fail))};function r(u,c){this.grammar=u,this.index=c,this.states=[],this.wants={},this.scannable=[],this.completed={}}r.prototype.process=function(u){for(var c=this.states,d=this.wants,f=this.completed,h=0;h<c.length;h++){var p=c[h];if(p.isComplete){if(p.finish(),p.data!==a.fail){for(var m=p.wantedBy,_=m.length;_--;){var b=m[_];this.complete(b,p)}if(p.reference===this.index){var y=p.rule.name;(this.completed[y]=this.completed[y]||[]).push(p)}}}else{var y=p.rule.symbols[p.dot];if(typeof y!="string"){this.scannable.push(p);continue}if(d[y]){if(d[y].push(p),f.hasOwnProperty(y))for(var g=f[y],_=0;_<g.length;_++){var v=g[_];this.complete(p,v)}}else d[y]=[p],this.predict(y)}}},r.prototype.predict=function(u){for(var c=this.grammar.byName[u]||[],d=0;d<c.length;d++){var f=c[d],h=this.wants[u],p=new n(f,0,this.index,h);this.states.push(p)}},r.prototype.complete=function(u,c){var d=u.nextState(c);this.states.push(d)};function i(u,c){this.rules=u,this.start=c||this.rules[0].name;var d=this.byName={};this.rules.forEach(function(f){d.hasOwnProperty(f.name)||(d[f.name]=[]),d[f.name].push(f)})}i.fromCompiled=function(f,c){var d=f.Lexer;f.ParserStart&&(c=f.ParserStart,f=f.ParserRules);var f=f.map(function(p){return new t(p.name,p.symbols,p.postprocess)}),h=new i(f,c);return h.lexer=d,h};function o(){this.reset("")}o.prototype.reset=function(u,c){this.buffer=u,this.index=0,this.line=c?c.line:1,this.lastLineBreak=c?-c.col:0},o.prototype.next=function(){if(this.index<this.buffer.length){var u=this.buffer[this.index++];return u===`
|
||
`&&(this.line+=1,this.lastLineBreak=this.index),{value:u}}},o.prototype.save=function(){return{line:this.line,col:this.index-this.lastLineBreak}},o.prototype.formatError=function(u,c){var d=this.buffer;if(typeof d=="string"){var f=d.split(`
|
||
`).slice(Math.max(0,this.line-5),this.line),h=d.indexOf(`
|
||
`,this.index);h===-1&&(h=d.length);var p=this.index-this.lastLineBreak,m=String(this.line).length;return c+=" at line "+this.line+" col "+p+`:
|
||
|
||
`,c+=f.map(function(b,y){return _(this.line-f.length+y+1,m)+" "+b},this).join(`
|
||
`),c+=`
|
||
`+_("",m+p)+`^
|
||
`,c}else return c+" at index "+(this.index-1);function _(b,y){var g=String(b);return Array(y-g.length+1).join(" ")+g}};function a(u,c,d){if(u instanceof i)var f=u,d=c;else var f=i.fromCompiled(u,c);this.grammar=f,this.options={keepHistory:!1,lexer:f.lexer||new o};for(var h in d||{})this.options[h]=d[h];this.lexer=this.options.lexer,this.lexerState=void 0;var p=new r(f,0);this.table=[p],p.wants[f.start]=[],p.predict(f.start),p.process(),this.current=0}a.fail={},a.prototype.feed=function(u){var c=this.lexer;c.reset(u,this.lexerState);for(var d;;){try{if(d=c.next(),!d)break}catch(x){var m=new r(this.grammar,this.current+1);this.table.push(m);var f=new Error(this.reportLexerError(x));throw f.offset=this.current,f.token=x.token,f}var h=this.table[this.current];this.options.keepHistory||delete this.table[this.current-1];var p=this.current+1,m=new r(this.grammar,p);this.table.push(m);for(var _=d.text!==void 0?d.text:d.value,b=c.constructor===o?d.value:d,y=h.scannable,g=y.length;g--;){var v=y[g],S=v.rule.symbols[v.dot];if(S.test?S.test(b):S.type?S.type===d.type:S.literal===_){var w=v.nextState({data:b,token:d,isToken:!0,reference:p-1});m.states.push(w)}}if(m.process(),m.states.length===0){var f=new Error(this.reportError(d));throw f.offset=this.current,f.token=d,f}this.options.keepHistory&&(h.lexerState=c.save()),this.current++}return h&&(this.lexerState=c.save()),this.results=this.finish(),this},a.prototype.reportLexerError=function(u){var c,d,f=u.token;return f?(c="input "+JSON.stringify(f.text[0])+" (lexer error)",d=this.lexer.formatError(f,"Syntax error")):(c="input (lexer error)",d=u.message),this.reportErrorCommon(d,c)},a.prototype.reportError=function(u){var c=(u.type?u.type+" token: ":"")+JSON.stringify(u.value!==void 0?u.value:u),d=this.lexer.formatError(u,"Syntax error");return this.reportErrorCommon(d,c)},a.prototype.reportErrorCommon=function(u,c){var d=[];d.push(u);var f=this.table.length-2,h=this.table[f],p=h.states.filter(function(_){var b=_.rule.symbols[_.dot];return b&&typeof b!="string"});if(p.length===0)d.push("Unexpected "+c+`. I did not expect any more input. Here is the state of my parse table:
|
||
`),this.displayStateStack(h.states,d);else{d.push("Unexpected "+c+`. Instead, I was expecting to see one of the following:
|
||
`);var m=p.map(function(_){return this.buildFirstStateStack(_,[])||[_]},this);m.forEach(function(_){var b=_[0],y=b.rule.symbols[b.dot],g=this.getSymbolDisplay(y);d.push("A "+g+" based on:"),this.displayStateStack(_,d)},this)}return d.push(""),d.join(`
|
||
`)},a.prototype.displayStateStack=function(u,c){for(var d,f=0,h=0;h<u.length;h++){var p=u[h],m=p.rule.toString(p.dot);m===d?f++:(f>0&&c.push(" ^ "+f+" more lines identical to this"),f=0,c.push(" "+m)),d=m}},a.prototype.getSymbolDisplay=function(u){return s(u)},a.prototype.buildFirstStateStack=function(u,c){if(c.indexOf(u)!==-1)return null;if(u.wantedBy.length===0)return[u];var d=u.wantedBy[0],f=[u].concat(c),h=this.buildFirstStateStack(d,f);return h===null?null:[u].concat(h)},a.prototype.save=function(){var u=this.table[this.current];return u.lexerState=this.lexerState,u},a.prototype.restore=function(u){var c=u.index;this.current=c,this.table[c]=u,this.table.splice(c+1),this.lexerState=u.lexerState,this.results=this.finish()},a.prototype.rewind=function(u){if(!this.options.keepHistory)throw new Error("set option `keepHistory` to enable rewinding");this.restore(this.table[u])},a.prototype.finish=function(){var u=[],c=this.grammar.start,d=this.table[this.table.length-1];return d.states.forEach(function(f){f.rule.name===c&&f.dot===f.rule.symbols.length&&f.reference===0&&f.data!==a.fail&&u.push(f)}),u.map(function(f){return f.data})};function s(u){var c=typeof u;if(c==="string")return u;if(c==="object"){if(u.literal)return JSON.stringify(u.literal);if(u instanceof RegExp)return"character matching "+u;if(u.type)return u.type+" token";if(u.test)return"token matching "+String(u.test);throw new Error("Unknown symbol type: "+u)}}function l(u){var c=typeof u;if(c==="string")return u;if(c==="object"){if(u.literal)return JSON.stringify(u.literal);if(u instanceof RegExp)return u.toString();if(u.type)return"%"+u.type;if(u.test)return"<"+String(u.test)+">";throw new Error("Unknown symbol type: "+u)}}return{Parser:a,Grammar:i,Rule:t}})})(Hz);var ppe=Hz.exports,Md={},Wz={},wc={};wc.__esModule=void 0;wc.__esModule=!0;var gpe=typeof Object.setPrototypeOf=="function",mpe=typeof Object.getPrototypeOf=="function",ype=typeof Object.defineProperty=="function",vpe=typeof Object.create=="function",bpe=typeof Object.prototype.hasOwnProperty=="function",_pe=function(t,n){gpe?Object.setPrototypeOf(t,n):t.__proto__=n};wc.setPrototypeOf=_pe;var Spe=function(t){return mpe?Object.getPrototypeOf(t):t.__proto__||t.prototype};wc.getPrototypeOf=Spe;var fR=!1,xpe=function e(t,n,r){if(ype&&!fR)try{Object.defineProperty(t,n,r)}catch{fR=!0,e(t,n,r)}else t[n]=r.value};wc.defineProperty=xpe;var Kz=function(t,n){return bpe?t.hasOwnProperty(t,n):t[n]===void 0};wc.hasOwnProperty=Kz;var wpe=function(t,n){if(vpe)return Object.create(t,n);var r=function(){};r.prototype=t;var i=new r;if(typeof n>"u")return i;if(typeof n=="null")throw new Error("PropertyDescriptors must not be null.");if(typeof n=="object")for(var o in n)Kz(n,o)&&(i[o]=n[o].value);return i};wc.objectCreate=wpe;(function(e){e.__esModule=void 0,e.__esModule=!0;var t=wc,n=t.setPrototypeOf,r=t.getPrototypeOf,i=t.defineProperty,o=t.objectCreate,a=new Error().toString()==="[object Error]",s="";function l(u){var c=this.constructor,d=c.name||function(){var _=c.toString().match(/^function\s*([^\s(]+)/);return _===null?s||"Error":_[1]}(),f=d==="Error",h=f?s:d,p=Error.apply(this,arguments);if(n(p,r(this)),!(p instanceof c)||!(p instanceof l)){var p=this;Error.apply(this,arguments),i(p,"message",{configurable:!0,enumerable:!1,value:u,writable:!0})}if(i(p,"name",{configurable:!0,enumerable:!1,value:h,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(p,f?l:c),p.stack===void 0){var m=new Error(u);m.name=p.name,p.stack=m.stack}return a&&i(p,"toString",{configurable:!0,enumerable:!1,value:function(){return(this.name||"Error")+(typeof this.message>"u"?"":": "+this.message)},writable:!0}),p}s=l.name||"ExtendableError",l.prototype=o(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}}),e.ExtendableError=l,e.default=e.ExtendableError})(Wz);var Qz=yt&&yt.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Md,"__esModule",{value:!0});Md.SyntaxError=Md.LiqeError=void 0;var Cpe=Wz,Xz=function(e){Qz(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(Cpe.ExtendableError);Md.LiqeError=Xz;var Epe=function(e){Qz(t,e);function t(n,r,i,o){var a=e.call(this,n)||this;return a.message=n,a.offset=r,a.line=i,a.column=o,a}return t}(Xz);Md.SyntaxError=Epe;var Ok={},y_=yt&&yt.__assign||function(){return y_=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},y_.apply(this,arguments)};Object.defineProperty(Ok,"__esModule",{value:!0});function cl(e){return e[0]}var Tpe={Lexer:void 0,ParserRules:[{name:"main",symbols:["_","logical_expression","_"],postprocess:function(e){return e[1]}},{name:"_$ebnf$1",symbols:[]},{name:"_$ebnf$1",symbols:["_$ebnf$1","whitespace_character"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"_",symbols:["_$ebnf$1"],postprocess:function(e){return e[0].length}},{name:"__$ebnf$1",symbols:["whitespace_character"]},{name:"__$ebnf$1",symbols:["__$ebnf$1","whitespace_character"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"__",symbols:["__$ebnf$1"],postprocess:function(e){return e[0].length}},{name:"whitespace_character",symbols:[/[ \t\n\v\f]/],postprocess:cl},{name:"decimal$ebnf$1",symbols:[{literal:"-"}],postprocess:cl},{name:"decimal$ebnf$1",symbols:[],postprocess:function(){return null}},{name:"decimal$ebnf$2",symbols:[/[0-9]/]},{name:"decimal$ebnf$2",symbols:["decimal$ebnf$2",/[0-9]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"decimal$ebnf$3$subexpression$1$ebnf$1",symbols:[/[0-9]/]},{name:"decimal$ebnf$3$subexpression$1$ebnf$1",symbols:["decimal$ebnf$3$subexpression$1$ebnf$1",/[0-9]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"decimal$ebnf$3$subexpression$1",symbols:[{literal:"."},"decimal$ebnf$3$subexpression$1$ebnf$1"]},{name:"decimal$ebnf$3",symbols:["decimal$ebnf$3$subexpression$1"],postprocess:cl},{name:"decimal$ebnf$3",symbols:[],postprocess:function(){return null}},{name:"decimal",symbols:["decimal$ebnf$1","decimal$ebnf$2","decimal$ebnf$3"],postprocess:function(e){return parseFloat((e[0]||"")+e[1].join("")+(e[2]?"."+e[2][1].join(""):""))}},{name:"dqstring$ebnf$1",symbols:[]},{name:"dqstring$ebnf$1",symbols:["dqstring$ebnf$1","dstrchar"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"dqstring",symbols:[{literal:'"'},"dqstring$ebnf$1",{literal:'"'}],postprocess:function(e){return e[1].join("")}},{name:"sqstring$ebnf$1",symbols:[]},{name:"sqstring$ebnf$1",symbols:["sqstring$ebnf$1","sstrchar"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"sqstring",symbols:[{literal:"'"},"sqstring$ebnf$1",{literal:"'"}],postprocess:function(e){return e[1].join("")}},{name:"dstrchar",symbols:[/[^\\"\n]/],postprocess:cl},{name:"dstrchar",symbols:[{literal:"\\"},"strescape"],postprocess:function(e){return JSON.parse('"'+e.join("")+'"')}},{name:"sstrchar",symbols:[/[^\\'\n]/],postprocess:cl},{name:"sstrchar",symbols:[{literal:"\\"},"strescape"],postprocess:function(e){return JSON.parse('"'+e.join("")+'"')}},{name:"sstrchar$string$1",symbols:[{literal:"\\"},{literal:"'"}],postprocess:function(e){return e.join("")}},{name:"sstrchar",symbols:["sstrchar$string$1"],postprocess:function(){return"'"}},{name:"strescape",symbols:[/["\\/bfnrt]/],postprocess:cl},{name:"strescape",symbols:[{literal:"u"},/[a-fA-F0-9]/,/[a-fA-F0-9]/,/[a-fA-F0-9]/,/[a-fA-F0-9]/],postprocess:function(e){return e.join("")}},{name:"logical_expression",symbols:["two_op_logical_expression"],postprocess:cl},{name:"two_op_logical_expression",symbols:["pre_two_op_logical_expression","boolean_operator","post_one_op_logical_expression"],postprocess:function(e){return{type:"LogicalExpression",location:{start:e[0].location.start,end:e[2].location.end},operator:e[1],left:e[0],right:e[2]}}},{name:"two_op_logical_expression",symbols:["pre_two_op_implicit_logical_expression","__","post_one_op_implicit_logical_expression"],postprocess:function(e){return{type:"LogicalExpression",location:{start:e[0].location.start,end:e[2].location.end},operator:{operator:"AND",type:"ImplicitBooleanOperator"},left:e[0],right:e[2]}}},{name:"two_op_logical_expression",symbols:["one_op_logical_expression"],postprocess:function(e){return e[0]}},{name:"pre_two_op_implicit_logical_expression",symbols:["two_op_logical_expression"],postprocess:function(e){return e[0]}},{name:"pre_two_op_implicit_logical_expression",symbols:["parentheses_open","_","two_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[4].location.start+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"post_one_op_implicit_logical_expression",symbols:["one_op_logical_expression"],postprocess:function(e){return e[0]}},{name:"post_one_op_implicit_logical_expression",symbols:["parentheses_open","_","one_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[4].location.start+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"pre_two_op_logical_expression",symbols:["two_op_logical_expression","__"],postprocess:function(e){return e[0]}},{name:"pre_two_op_logical_expression",symbols:["parentheses_open","_","two_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[4].location.start+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"one_op_logical_expression",symbols:["parentheses_open","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[2].location.start+1},type:"ParenthesizedExpression",expression:{type:"EmptyExpression",location:{start:e[0].location.start+1,end:e[0].location.start+1}}}}},{name:"one_op_logical_expression",symbols:["parentheses_open","_","two_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location.start,end:e[4].location.start+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"one_op_logical_expression$string$1",symbols:[{literal:"N"},{literal:"O"},{literal:"T"}],postprocess:function(e){return e.join("")}},{name:"one_op_logical_expression",symbols:["one_op_logical_expression$string$1","post_boolean_primary"],postprocess:function(e,t){return{type:"UnaryOperator",operator:"NOT",operand:e[1],location:{start:t,end:e[1].location.end}}}},{name:"one_op_logical_expression",symbols:[{literal:"-"},"boolean_primary"],postprocess:function(e,t){return{type:"UnaryOperator",operator:"-",operand:e[1],location:{start:t,end:e[1].location.end}}}},{name:"one_op_logical_expression",symbols:["boolean_primary"],postprocess:function(e){return e[0]}},{name:"post_one_op_logical_expression",symbols:["__","one_op_logical_expression"],postprocess:function(e){return e[1]}},{name:"post_one_op_logical_expression",symbols:["parentheses_open","_","one_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[0].location,end:e[4].location+1},type:"ParenthesizedExpression",expression:e[2]}}},{name:"parentheses_open",symbols:[{literal:"("}],postprocess:function(e,t){return{location:{start:t}}}},{name:"parentheses_close",symbols:[{literal:")"}],postprocess:function(e,t){return{location:{start:t}}}},{name:"boolean_operator$string$1",symbols:[{literal:"O"},{literal:"R"}],postprocess:function(e){return e.join("")}},{name:"boolean_operator",symbols:["boolean_operator$string$1"],postprocess:function(e,t){return{location:{start:t,end:t+2},operator:"OR",type:"BooleanOperator"}}},{name:"boolean_operator$string$2",symbols:[{literal:"A"},{literal:"N"},{literal:"D"}],postprocess:function(e){return e.join("")}},{name:"boolean_operator",symbols:["boolean_operator$string$2"],postprocess:function(e,t){return{location:{start:t,end:t+3},operator:"AND",type:"BooleanOperator"}}},{name:"boolean_primary",symbols:["tag_expression"],postprocess:cl},{name:"post_boolean_primary",symbols:["__","parentheses_open","_","two_op_logical_expression","_","parentheses_close"],postprocess:function(e){return{location:{start:e[1].location.start,end:e[5].location.start+1},type:"ParenthesizedExpression",expression:e[3]}}},{name:"post_boolean_primary",symbols:["__","boolean_primary"],postprocess:function(e){return e[1]}},{name:"tag_expression",symbols:["field","comparison_operator","expression"],postprocess:function(e,t){var n={type:"Field",name:e[0].name,path:e[0].name.split(".").filter(Boolean),quoted:e[0].quoted,quotes:e[0].quotes,location:e[0].location};return e[0].quotes||delete n.quotes,y_({location:{start:t,end:e[2].expression.location.end},field:n,operator:e[1]},e[2])}},{name:"tag_expression",symbols:["field","comparison_operator"],postprocess:function(e,t){var n={type:"Field",name:e[0].name,path:e[0].name.split(".").filter(Boolean),quoted:e[0].quoted,quotes:e[0].quotes,location:e[0].location};return e[0].quotes||delete n.quotes,{type:"Tag",location:{start:t,end:e[1].location.end},field:n,operator:e[1],expression:{type:"EmptyExpression",location:{start:e[1].location.end,end:e[1].location.end}}}}},{name:"tag_expression",symbols:["expression"],postprocess:function(e,t){return y_({location:{start:t,end:e[0].expression.location.end},field:{type:"ImplicitField"}},e[0])}},{name:"field$ebnf$1",symbols:[]},{name:"field$ebnf$1",symbols:["field$ebnf$1",/[a-zA-Z\d_$.]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"field",symbols:[/[_a-zA-Z$]/,"field$ebnf$1"],postprocess:function(e,t){return{type:"LiteralExpression",name:e[0]+e[1].join(""),quoted:!1,location:{start:t,end:t+(e[0]+e[1].join("")).length}}}},{name:"field",symbols:["sqstring"],postprocess:function(e,t){return{type:"LiteralExpression",name:e[0],quoted:!0,quotes:"single",location:{start:t,end:t+e[0].length+2}}}},{name:"field",symbols:["dqstring"],postprocess:function(e,t){return{type:"LiteralExpression",name:e[0],quoted:!0,quotes:"double",location:{start:t,end:t+e[0].length+2}}}},{name:"expression",symbols:["decimal"],postprocess:function(e,t){return{type:"Tag",expression:{location:{start:t,end:t+e.join("").length},type:"LiteralExpression",quoted:!1,value:Number(e.join(""))}}}},{name:"expression",symbols:["regex"],postprocess:function(e,t){return{type:"Tag",expression:{location:{start:t,end:t+e.join("").length},type:"RegexExpression",value:e.join("")}}}},{name:"expression",symbols:["range"],postprocess:function(e){return e[0]}},{name:"expression",symbols:["unquoted_value"],postprocess:function(e,t,n){var r=e.join("");if(e[0]==="AND"||e[0]==="OR"||e[0]==="NOT")return n;var i;return r==="true"?i=!0:r==="false"?i=!1:r==="null"?i=null:i=r,{type:"Tag",expression:{location:{start:t,end:t+r.length},type:"LiteralExpression",quoted:!1,value:i}}}},{name:"expression",symbols:["sqstring"],postprocess:function(e,t){return{type:"Tag",expression:{location:{start:t,end:t+e.join("").length+2},type:"LiteralExpression",quoted:!0,quotes:"single",value:e.join("")}}}},{name:"expression",symbols:["dqstring"],postprocess:function(e,t){return{type:"Tag",expression:{location:{start:t,end:t+e.join("").length+2},type:"LiteralExpression",quoted:!0,quotes:"double",value:e.join("")}}}},{name:"range$string$1",symbols:[{literal:" "},{literal:"T"},{literal:"O"},{literal:" "}],postprocess:function(e){return e.join("")}},{name:"range",symbols:["range_open","decimal","range$string$1","decimal","range_close"],postprocess:function(e,t){return{location:{start:t},type:"Tag",expression:{location:{start:e[0].location.start,end:e[4].location.start+1},type:"RangeExpression",range:{min:e[1],minInclusive:e[0].inclusive,maxInclusive:e[4].inclusive,max:e[3]}}}}},{name:"range_open",symbols:[{literal:"["}],postprocess:function(e,t){return{location:{start:t},inclusive:!0}}},{name:"range_open",symbols:[{literal:"{"}],postprocess:function(e,t){return{location:{start:t},inclusive:!1}}},{name:"range_close",symbols:[{literal:"]"}],postprocess:function(e,t){return{location:{start:t},inclusive:!0}}},{name:"range_close",symbols:[{literal:"}"}],postprocess:function(e,t){return{location:{start:t},inclusive:!1}}},{name:"comparison_operator$subexpression$1",symbols:[{literal:":"}]},{name:"comparison_operator$subexpression$1$string$1",symbols:[{literal:":"},{literal:"="}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$1"]},{name:"comparison_operator$subexpression$1$string$2",symbols:[{literal:":"},{literal:">"}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$2"]},{name:"comparison_operator$subexpression$1$string$3",symbols:[{literal:":"},{literal:"<"}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$3"]},{name:"comparison_operator$subexpression$1$string$4",symbols:[{literal:":"},{literal:">"},{literal:"="}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$4"]},{name:"comparison_operator$subexpression$1$string$5",symbols:[{literal:":"},{literal:"<"},{literal:"="}],postprocess:function(e){return e.join("")}},{name:"comparison_operator$subexpression$1",symbols:["comparison_operator$subexpression$1$string$5"]},{name:"comparison_operator",symbols:["comparison_operator$subexpression$1"],postprocess:function(e,t){return{location:{start:t,end:t+e[0][0].length},type:"ComparisonOperator",operator:e[0][0]}}},{name:"regex",symbols:["regex_body","regex_flags"],postprocess:function(e){return e.join("")}},{name:"regex_body$ebnf$1",symbols:[]},{name:"regex_body$ebnf$1",symbols:["regex_body$ebnf$1","regex_body_char"],postprocess:function(e){return e[0].concat([e[1]])}},{name:"regex_body",symbols:[{literal:"/"},"regex_body$ebnf$1",{literal:"/"}],postprocess:function(e){return"/"+e[1].join("")+"/"}},{name:"regex_body_char",symbols:[/[^\\]/],postprocess:cl},{name:"regex_body_char",symbols:[{literal:"\\"},/[^\\]/],postprocess:function(e){return"\\"+e[1]}},{name:"regex_flags",symbols:[]},{name:"regex_flags$ebnf$1",symbols:[/[gmiyusd]/]},{name:"regex_flags$ebnf$1",symbols:["regex_flags$ebnf$1",/[gmiyusd]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"regex_flags",symbols:["regex_flags$ebnf$1"],postprocess:function(e){return e[0].join("")}},{name:"unquoted_value$ebnf$1",symbols:[]},{name:"unquoted_value$ebnf$1",symbols:["unquoted_value$ebnf$1",/[a-zA-Z\.\-_*@#$]/],postprocess:function(e){return e[0].concat([e[1]])}},{name:"unquoted_value",symbols:[/[a-zA-Z_*@#$]/,"unquoted_value$ebnf$1"],postprocess:function(e){return e[0]+e[1].join("")}}],ParserStart:"main"};Ok.default=Tpe;var Yz={},p2={},vy={};Object.defineProperty(vy,"__esModule",{value:!0});vy.isSafePath=void 0;var kpe=/^(\.(?:[_a-zA-Z][a-zA-Z\d_]*|\0|[1-9]\d*))+$/u,Ape=function(e){return kpe.test(e)};vy.isSafePath=Ape;Object.defineProperty(p2,"__esModule",{value:!0});p2.createGetValueFunctionBody=void 0;var Ppe=vy,Ipe=function(e){if(!(0,Ppe.isSafePath)(e))throw new Error("Unsafe path.");var t="return subject"+e;return t.replace(/(\.(\d+))/g,".[$2]").replace(/\./g,"?.")};p2.createGetValueFunctionBody=Ipe;(function(e){var t=yt&&yt.__assign||function(){return t=Object.assign||function(o){for(var a,s=1,l=arguments.length;s<l;s++){a=arguments[s];for(var u in a)Object.prototype.hasOwnProperty.call(a,u)&&(o[u]=a[u])}return o},t.apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0}),e.hydrateAst=void 0;var n=p2,r=vy,i=function(o){var a=t({},o);return o.type==="Tag"&&o.field.type==="Field"&&"field"in o&&(0,r.isSafePath)(o.field.name)&&(a.getValue=new Function("subject",(0,n.createGetValueFunctionBody)(o.field.name))),"left"in o&&(a.left=(0,e.hydrateAst)(o.left)),"right"in o&&(a.right=(0,e.hydrateAst)(o.right)),"operand"in o&&(a.operand=(0,e.hydrateAst)(o.operand)),a};e.hydrateAst=i})(Yz);var Zz=yt&&yt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(h2,"__esModule",{value:!0});h2.parse=void 0;var Jz=Zz(ppe),Rpe=Md,Ope=Zz(Ok),Mpe=Yz,Npe=Jz.default.Grammar.fromCompiled(Ope.default),$pe=/Syntax error at line (?<line>\d+) col (?<column>\d+)/,Dpe=function(e){if(e.trim()==="")return{location:{end:0,start:0},type:"EmptyExpression"};var t=new Jz.default.Parser(Npe),n;try{n=t.feed(e).results}catch(o){if(typeof(o==null?void 0:o.message)=="string"&&typeof(o==null?void 0:o.offset)=="number"){var r=o.message.match($pe);throw r?new Rpe.SyntaxError("Syntax error at line ".concat(r.groups.line," column ").concat(r.groups.column),o.offset,Number(r.groups.line),Number(r.groups.column)):o}throw o}if(n.length===0)throw new Error("Found no parsings.");if(n.length>1)throw new Error("Ambiguous results.");var i=(0,Mpe.hydrateAst)(n[0]);return i};h2.parse=Dpe;var g2={};Object.defineProperty(g2,"__esModule",{value:!0});g2.test=void 0;var Lpe=my,Fpe=function(e,t){return(0,Lpe.filter)(e,[t]).length===1};g2.test=Fpe;var ej={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=void 0;var t=function(o,a){return a==="double"?'"'.concat(o,'"'):a==="single"?"'".concat(o,"'"):o},n=function(o){if(o.type==="LiteralExpression")return o.quoted&&typeof o.value=="string"?t(o.value,o.quotes):String(o.value);if(o.type==="RegexExpression")return String(o.value);if(o.type==="RangeExpression"){var a=o.range,s=a.min,l=a.max,u=a.minInclusive,c=a.maxInclusive;return"".concat(u?"[":"{").concat(s," TO ").concat(l).concat(c?"]":"}")}if(o.type==="EmptyExpression")return"";throw new Error("Unexpected AST type.")},r=function(o){if(o.type!=="Tag")throw new Error("Expected a tag expression.");var a=o.field,s=o.expression,l=o.operator;if(a.type==="ImplicitField")return n(s);var u=a.quoted?t(a.name,a.quotes):a.name,c=" ".repeat(s.location.start-l.location.end);return u+l.operator+c+n(s)},i=function(o){if(o.type==="ParenthesizedExpression"){if(!("location"in o.expression))throw new Error("Expected location in expression.");if(!o.location.end)throw new Error("Expected location end.");var a=" ".repeat(o.expression.location.start-(o.location.start+1)),s=" ".repeat(o.location.end-o.expression.location.end-1);return"(".concat(a).concat((0,e.serialize)(o.expression)).concat(s,")")}if(o.type==="Tag")return r(o);if(o.type==="LogicalExpression"){var l="";return o.operator.type==="BooleanOperator"?(l+=" ".repeat(o.operator.location.start-o.left.location.end),l+=o.operator.operator,l+=" ".repeat(o.right.location.start-o.operator.location.end)):l=" ".repeat(o.right.location.start-o.left.location.end),"".concat((0,e.serialize)(o.left)).concat(l).concat((0,e.serialize)(o.right))}if(o.type==="UnaryOperator")return(o.operator==="NOT"?"NOT ":o.operator)+(0,e.serialize)(o.operand);if(o.type==="EmptyExpression")return"";throw new Error("Unexpected AST type.")};e.serialize=i})(ej);var m2={};Object.defineProperty(m2,"__esModule",{value:!0});m2.isSafeUnquotedExpression=void 0;var Bpe=function(e){return/^[#$*@A-Z_a-z][#$*.@A-Z_a-z-]*$/.test(e)};m2.isSafeUnquotedExpression=Bpe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.isSafeUnquotedExpression=e.serialize=e.SyntaxError=e.LiqeError=e.test=e.parse=e.highlight=e.filter=void 0;var t=my;Object.defineProperty(e,"filter",{enumerable:!0,get:function(){return t.filter}});var n=f2;Object.defineProperty(e,"highlight",{enumerable:!0,get:function(){return n.highlight}});var r=h2;Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return r.parse}});var i=g2;Object.defineProperty(e,"test",{enumerable:!0,get:function(){return i.test}});var o=Md;Object.defineProperty(e,"LiqeError",{enumerable:!0,get:function(){return o.LiqeError}}),Object.defineProperty(e,"SyntaxError",{enumerable:!0,get:function(){return o.SyntaxError}});var a=ej;Object.defineProperty(e,"serialize",{enumerable:!0,get:function(){return a.serialize}});var s=m2;Object.defineProperty(e,"isSafeUnquotedExpression",{enumerable:!0,get:function(){return s.isSafeUnquotedExpression}})})(qz);var by={},tj={},Nd={};Object.defineProperty(Nd,"__esModule",{value:!0});Nd.ROARR_LOG_FORMAT_VERSION=Nd.ROARR_VERSION=void 0;Nd.ROARR_VERSION="5.0.0";Nd.ROARR_LOG_FORMAT_VERSION="2.0.0";var _y={};Object.defineProperty(_y,"__esModule",{value:!0});_y.logLevels=void 0;_y.logLevels={debug:20,error:50,fatal:60,info:30,trace:10,warn:40};var nj={},y2={};Object.defineProperty(y2,"__esModule",{value:!0});y2.hasOwnProperty=void 0;const zpe=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);y2.hasOwnProperty=zpe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.hasOwnProperty=void 0;var t=y2;Object.defineProperty(e,"hasOwnProperty",{enumerable:!0,get:function(){return t.hasOwnProperty}})})(nj);var rj={},v2={},b2={};Object.defineProperty(b2,"__esModule",{value:!0});b2.tokenize=void 0;const jpe=/(?:%(?<flag>([+0-]|-\+))?(?<width>\d+)?(?<position>\d+\$)?(?<precision>\.\d+)?(?<conversion>[%BCESb-iosux]))|(\\%)/g,Upe=e=>{let t;const n=[];let r=0,i=0,o=null;for(;(t=jpe.exec(e))!==null;){t.index>i&&(o={literal:e.slice(i,t.index),type:"literal"},n.push(o));const a=t[0];i=t.index+a.length,a==="\\%"||a==="%%"?o&&o.type==="literal"?o.literal+="%":(o={literal:"%",type:"literal"},n.push(o)):t.groups&&(o={conversion:t.groups.conversion,flag:t.groups.flag||null,placeholder:a,position:t.groups.position?Number.parseInt(t.groups.position,10)-1:r++,precision:t.groups.precision?Number.parseInt(t.groups.precision.slice(1),10):null,type:"placeholder",width:t.groups.width?Number.parseInt(t.groups.width,10):null},n.push(o))}return i<=e.length-1&&(o&&o.type==="literal"?o.literal+=e.slice(i):n.push({literal:e.slice(i),type:"literal"})),n};b2.tokenize=Upe;Object.defineProperty(v2,"__esModule",{value:!0});v2.createPrintf=void 0;const hR=Pk,Vpe=b2,Gpe=(e,t)=>t.placeholder,qpe=e=>{var t;const n=(o,a,s)=>s==="-"?o.padEnd(a," "):s==="-+"?((Number(o)>=0?"+":"")+o).padEnd(a," "):s==="+"?((Number(o)>=0?"+":"")+o).padStart(a," "):s==="0"?o.padStart(a,"0"):o.padStart(a," "),r=(t=e==null?void 0:e.formatUnboundExpression)!==null&&t!==void 0?t:Gpe,i={};return(o,...a)=>{let s=i[o];s||(s=i[o]=Vpe.tokenize(o));let l="";for(const u of s)if(u.type==="literal")l+=u.literal;else{let c=a[u.position];if(c===void 0)l+=r(o,u,a);else if(u.conversion==="b")l+=hR.boolean(c)?"true":"false";else if(u.conversion==="B")l+=hR.boolean(c)?"TRUE":"FALSE";else if(u.conversion==="c")l+=c;else if(u.conversion==="C")l+=String(c).toUpperCase();else if(u.conversion==="i"||u.conversion==="d")c=String(Math.trunc(c)),u.width!==null&&(c=n(c,u.width,u.flag)),l+=c;else if(u.conversion==="e")l+=Number(c).toExponential();else if(u.conversion==="E")l+=Number(c).toExponential().toUpperCase();else if(u.conversion==="f")u.precision!==null&&(c=Number(c).toFixed(u.precision)),u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=c;else if(u.conversion==="o")l+=(Number.parseInt(String(c),10)>>>0).toString(8);else if(u.conversion==="s")u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=c;else if(u.conversion==="S")u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=String(c).toUpperCase();else if(u.conversion==="u")l+=Number.parseInt(String(c),10)>>>0;else if(u.conversion==="x")c=(Number.parseInt(String(c),10)>>>0).toString(16),u.width!==null&&(c=n(String(c),u.width,u.flag)),l+=c;else throw new Error("Unknown format specifier.")}return l}};v2.createPrintf=qpe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.printf=e.createPrintf=void 0;const t=v2;Object.defineProperty(e,"createPrintf",{enumerable:!0,get:function(){return t.createPrintf}}),e.printf=t.createPrintf()})(rj);var vE={exports:{}};(function(e,t){const{hasOwnProperty:n}=Object.prototype,r=_();r.configure=_,r.stringify=r,r.default=r,t.stringify=r,t.configure=_,e.exports=r;const i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function o(b){return b.length<5e3&&!i.test(b)?`"${b}"`:JSON.stringify(b)}function a(b){if(b.length>200)return b.sort();for(let y=1;y<b.length;y++){const g=b[y];let v=y;for(;v!==0&&b[v-1]>g;)b[v]=b[v-1],v--;b[v]=g}return b}const s=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function l(b){return s.call(b)!==void 0&&b.length!==0}function u(b,y,g){b.length<g&&(g=b.length);const v=y===","?"":" ";let S=`"0":${v}${b[0]}`;for(let w=1;w<g;w++)S+=`${y}"${w}":${v}${b[w]}`;return S}function c(b){if(n.call(b,"circularValue")){const y=b.circularValue;if(typeof y=="string")return`"${y}"`;if(y==null)return y;if(y===Error||y===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function d(b,y){let g;if(n.call(b,y)&&(g=b[y],typeof g!="boolean"))throw new TypeError(`The "${y}" argument must be of type boolean`);return g===void 0?!0:g}function f(b,y){let g;if(n.call(b,y)){if(g=b[y],typeof g!="number")throw new TypeError(`The "${y}" argument must be of type number`);if(!Number.isInteger(g))throw new TypeError(`The "${y}" argument must be an integer`);if(g<1)throw new RangeError(`The "${y}" argument must be >= 1`)}return g===void 0?1/0:g}function h(b){return b===1?"1 item":`${b} items`}function p(b){const y=new Set;for(const g of b)(typeof g=="string"||typeof g=="number")&&y.add(String(g));return y}function m(b){if(n.call(b,"strict")){const y=b.strict;if(typeof y!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(y)return g=>{let v=`Object can not safely be stringified. Received type ${typeof g}`;throw typeof g!="function"&&(v+=` (${g.toString()})`),new Error(v)}}}function _(b){b={...b};const y=m(b);y&&(b.bigint===void 0&&(b.bigint=!1),"circularValue"in b||(b.circularValue=Error));const g=c(b),v=d(b,"bigint"),S=d(b,"deterministic"),w=f(b,"maximumDepth"),x=f(b,"maximumBreadth");function C(O,E,A,D,L,M){let R=E[O];switch(typeof R=="object"&&R!==null&&typeof R.toJSON=="function"&&(R=R.toJSON(O)),R=D.call(E,O,R),typeof R){case"string":return o(R);case"object":{if(R===null)return"null";if(A.indexOf(R)!==-1)return g;let N="",B=",";const U=M;if(Array.isArray(R)){if(R.length===0)return"[]";if(w<A.length+1)return'"[Array]"';A.push(R),L!==""&&(M+=L,N+=`
|
||
${M}`,B=`,
|
||
${M}`);const Q=Math.min(R.length,x);let ne=0;for(;ne<Q-1;ne++){const ye=C(String(ne),R,A,D,L,M);N+=ye!==void 0?ye:"null",N+=B}const se=C(String(ne),R,A,D,L,M);if(N+=se!==void 0?se:"null",R.length-1>x){const ye=R.length-x-1;N+=`${B}"... ${h(ye)} not stringified"`}return L!==""&&(N+=`
|
||
${U}`),A.pop(),`[${N}]`}let G=Object.keys(R);const Z=G.length;if(Z===0)return"{}";if(w<A.length+1)return'"[Object]"';let ee="",J="";L!==""&&(M+=L,B=`,
|
||
${M}`,ee=" ");const j=Math.min(Z,x);S&&!l(R)&&(G=a(G)),A.push(R);for(let Q=0;Q<j;Q++){const ne=G[Q],se=C(ne,R,A,D,L,M);se!==void 0&&(N+=`${J}${o(ne)}:${ee}${se}`,J=B)}if(Z>x){const Q=Z-x;N+=`${J}"...":${ee}"${h(Q)} not stringified"`,J=B}return L!==""&&J.length>1&&(N=`
|
||
${M}${N}
|
||
${U}`),A.pop(),`{${N}}`}case"number":return isFinite(R)?String(R):y?y(R):"null";case"boolean":return R===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(R);default:return y?y(R):void 0}}function k(O,E,A,D,L,M){switch(typeof E=="object"&&E!==null&&typeof E.toJSON=="function"&&(E=E.toJSON(O)),typeof E){case"string":return o(E);case"object":{if(E===null)return"null";if(A.indexOf(E)!==-1)return g;const R=M;let N="",B=",";if(Array.isArray(E)){if(E.length===0)return"[]";if(w<A.length+1)return'"[Array]"';A.push(E),L!==""&&(M+=L,N+=`
|
||
${M}`,B=`,
|
||
${M}`);const Z=Math.min(E.length,x);let ee=0;for(;ee<Z-1;ee++){const j=k(String(ee),E[ee],A,D,L,M);N+=j!==void 0?j:"null",N+=B}const J=k(String(ee),E[ee],A,D,L,M);if(N+=J!==void 0?J:"null",E.length-1>x){const j=E.length-x-1;N+=`${B}"... ${h(j)} not stringified"`}return L!==""&&(N+=`
|
||
${R}`),A.pop(),`[${N}]`}A.push(E);let U="";L!==""&&(M+=L,B=`,
|
||
${M}`,U=" ");let G="";for(const Z of D){const ee=k(Z,E[Z],A,D,L,M);ee!==void 0&&(N+=`${G}${o(Z)}:${U}${ee}`,G=B)}return L!==""&&G.length>1&&(N=`
|
||
${M}${N}
|
||
${R}`),A.pop(),`{${N}}`}case"number":return isFinite(E)?String(E):y?y(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(E);default:return y?y(E):void 0}}function T(O,E,A,D,L){switch(typeof E){case"string":return o(E);case"object":{if(E===null)return"null";if(typeof E.toJSON=="function"){if(E=E.toJSON(O),typeof E!="object")return T(O,E,A,D,L);if(E===null)return"null"}if(A.indexOf(E)!==-1)return g;const M=L;if(Array.isArray(E)){if(E.length===0)return"[]";if(w<A.length+1)return'"[Array]"';A.push(E),L+=D;let ee=`
|
||
${L}`;const J=`,
|
||
${L}`,j=Math.min(E.length,x);let Q=0;for(;Q<j-1;Q++){const se=T(String(Q),E[Q],A,D,L);ee+=se!==void 0?se:"null",ee+=J}const ne=T(String(Q),E[Q],A,D,L);if(ee+=ne!==void 0?ne:"null",E.length-1>x){const se=E.length-x-1;ee+=`${J}"... ${h(se)} not stringified"`}return ee+=`
|
||
${M}`,A.pop(),`[${ee}]`}let R=Object.keys(E);const N=R.length;if(N===0)return"{}";if(w<A.length+1)return'"[Object]"';L+=D;const B=`,
|
||
${L}`;let U="",G="",Z=Math.min(N,x);l(E)&&(U+=u(E,B,x),R=R.slice(E.length),Z-=E.length,G=B),S&&(R=a(R)),A.push(E);for(let ee=0;ee<Z;ee++){const J=R[ee],j=T(J,E[J],A,D,L);j!==void 0&&(U+=`${G}${o(J)}: ${j}`,G=B)}if(N>x){const ee=N-x;U+=`${G}"...": "${h(ee)} not stringified"`,G=B}return G!==""&&(U=`
|
||
${L}${U}
|
||
${M}`),A.pop(),`{${U}}`}case"number":return isFinite(E)?String(E):y?y(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(E);default:return y?y(E):void 0}}function P(O,E,A){switch(typeof E){case"string":return o(E);case"object":{if(E===null)return"null";if(typeof E.toJSON=="function"){if(E=E.toJSON(O),typeof E!="object")return P(O,E,A);if(E===null)return"null"}if(A.indexOf(E)!==-1)return g;let D="";if(Array.isArray(E)){if(E.length===0)return"[]";if(w<A.length+1)return'"[Array]"';A.push(E);const B=Math.min(E.length,x);let U=0;for(;U<B-1;U++){const Z=P(String(U),E[U],A);D+=Z!==void 0?Z:"null",D+=","}const G=P(String(U),E[U],A);if(D+=G!==void 0?G:"null",E.length-1>x){const Z=E.length-x-1;D+=`,"... ${h(Z)} not stringified"`}return A.pop(),`[${D}]`}let L=Object.keys(E);const M=L.length;if(M===0)return"{}";if(w<A.length+1)return'"[Object]"';let R="",N=Math.min(M,x);l(E)&&(D+=u(E,",",x),L=L.slice(E.length),N-=E.length,R=","),S&&(L=a(L)),A.push(E);for(let B=0;B<N;B++){const U=L[B],G=P(U,E[U],A);G!==void 0&&(D+=`${R}${o(U)}:${G}`,R=",")}if(M>x){const B=M-x;D+=`${R}"...":"${h(B)} not stringified"`}return A.pop(),`{${D}}`}case"number":return isFinite(E)?String(E):y?y(E):"null";case"boolean":return E===!0?"true":"false";case"undefined":return;case"bigint":if(v)return String(E);default:return y?y(E):void 0}}function $(O,E,A){if(arguments.length>1){let D="";if(typeof A=="number"?D=" ".repeat(Math.min(A,10)):typeof A=="string"&&(D=A.slice(0,10)),E!=null){if(typeof E=="function")return C("",{"":O},[],E,D,"");if(Array.isArray(E))return k("",O,[],p(E),D,"")}if(D.length!==0)return T("",O,[],D,"")}return P("",O,[])}return $}})(vE,vE.exports);var Hpe=vE.exports;(function(e){var t=yt&&yt.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(e,"__esModule",{value:!0}),e.createLogger=void 0;const n=Nd,r=_y,i=nj,o=rj,a=t(Ik),s=t(Hpe);let l=!1;const u=(0,a.default)(),c=()=>u.ROARR,d=()=>({messageContext:{},transforms:[]}),f=()=>{const g=c().asyncLocalStorage;if(!g)throw new Error("AsyncLocalContext is unavailable.");const v=g.getStore();return v||d()},h=()=>!!c().asyncLocalStorage,p=()=>{if(h()){const g=f();return(0,i.hasOwnProperty)(g,"sequenceRoot")&&(0,i.hasOwnProperty)(g,"sequence")&&typeof g.sequence=="number"?String(g.sequenceRoot)+"."+String(g.sequence++):String(c().sequence++)}return String(c().sequence++)},m=(g,v)=>(S,w,x,C,k,T,P,$,O,E)=>{g.child({logLevel:v})(S,w,x,C,k,T,P,$,O,E)},_=1e3,b=(g,v)=>(S,w,x,C,k,T,P,$,O,E)=>{const A=(0,s.default)({a:S,b:w,c:x,d:C,e:k,f:T,g:P,h:$,i:O,j:E,logLevel:v});if(!A)throw new Error("Expected key to be a string");const D=c().onceLog;D.has(A)||(D.add(A),D.size>_&&D.clear(),g.child({logLevel:v})(S,w,x,C,k,T,P,$,O,E))},y=(g,v={},S=[])=>{const w=(x,C,k,T,P,$,O,E,A,D)=>{const L=Date.now(),M=p();let R;h()?R=f():R=d();let N,B;if(typeof x=="string"?N={...R.messageContext,...v}:N={...R.messageContext,...v,...x},typeof x=="string"&&C===void 0)B=x;else if(typeof x=="string"){if(!x.includes("%"))throw new Error("When a string parameter is followed by other arguments, then it is assumed that you are attempting to format a message using printf syntax. You either forgot to add printf bindings or if you meant to add context to the log message, pass them in an object as the first parameter.");B=(0,o.printf)(x,C,k,T,P,$,O,E,A,D)}else{let G=C;if(typeof C!="string")if(C===void 0)G="";else throw new TypeError("Message must be a string. Received "+typeof C+".");B=(0,o.printf)(G,k,T,P,$,O,E,A,D)}let U={context:N,message:B,sequence:M,time:L,version:n.ROARR_LOG_FORMAT_VERSION};for(const G of[...R.transforms,...S])if(U=G(U),typeof U!="object"||U===null)throw new Error("Message transform function must return a message object.");g(U)};return w.child=x=>{let C;return h()?C=f():C=d(),typeof x=="function"?(0,e.createLogger)(g,{...C.messageContext,...v,...x},[x,...S]):(0,e.createLogger)(g,{...C.messageContext,...v,...x},S)},w.getContext=()=>{let x;return h()?x=f():x=d(),{...x.messageContext,...v}},w.adopt=async(x,C)=>{if(!h())return l===!1&&(l=!0,g({context:{logLevel:r.logLevels.warn,package:"roarr"},message:"async_hooks are unavailable; Roarr.adopt will not function as expected",sequence:p(),time:Date.now(),version:n.ROARR_LOG_FORMAT_VERSION})),x();const k=f();let T;(0,i.hasOwnProperty)(k,"sequenceRoot")&&(0,i.hasOwnProperty)(k,"sequence")&&typeof k.sequence=="number"?T=k.sequenceRoot+"."+String(k.sequence++):T=String(c().sequence++);let P={...k.messageContext};const $=[...k.transforms];typeof C=="function"?$.push(C):P={...P,...C};const O=c().asyncLocalStorage;if(!O)throw new Error("Async local context unavailable.");return O.run({messageContext:P,sequence:0,sequenceRoot:T,transforms:$},()=>x())},w.debug=m(w,r.logLevels.debug),w.debugOnce=b(w,r.logLevels.debug),w.error=m(w,r.logLevels.error),w.errorOnce=b(w,r.logLevels.error),w.fatal=m(w,r.logLevels.fatal),w.fatalOnce=b(w,r.logLevels.fatal),w.info=m(w,r.logLevels.info),w.infoOnce=b(w,r.logLevels.info),w.trace=m(w,r.logLevels.trace),w.traceOnce=b(w,r.logLevels.trace),w.warn=m(w,r.logLevels.warn),w.warnOnce=b(w,r.logLevels.warn),w};e.createLogger=y})(tj);var _2={},Wpe=function(t,n){for(var r=t.split("."),i=n.split("."),o=0;o<3;o++){var a=Number(r[o]),s=Number(i[o]);if(a>s)return 1;if(s>a)return-1;if(!isNaN(a)&&isNaN(s))return 1;if(isNaN(a)&&!isNaN(s))return-1}return 0},Kpe=yt&&yt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_2,"__esModule",{value:!0});_2.createRoarrInitialGlobalStateBrowser=void 0;const pR=Nd,gR=Kpe(Wpe),Qpe=e=>{const t=(e.versions||[]).concat();return t.length>1&&t.sort(gR.default),t.includes(pR.ROARR_VERSION)||t.push(pR.ROARR_VERSION),t.sort(gR.default),{sequence:0,...e,versions:t}};_2.createRoarrInitialGlobalStateBrowser=Qpe;var S2={};Object.defineProperty(S2,"__esModule",{value:!0});S2.getLogLevelName=void 0;const Xpe=e=>e<=10?"trace":e<=20?"debug":e<=30?"info":e<=40?"warn":e<=50?"error":"fatal";S2.getLogLevelName=Xpe;(function(e){var t=yt&&yt.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(e,"__esModule",{value:!0}),e.getLogLevelName=e.logLevels=e.Roarr=e.ROARR=void 0;const n=tj,r=_2,o=(0,t(Ik).default)(),a=(0,r.createRoarrInitialGlobalStateBrowser)(o.ROARR||{});e.ROARR=a,o.ROARR=a;const s=d=>JSON.stringify(d),l=(0,n.createLogger)(d=>{var f;a.write&&a.write(((f=a.serializeMessage)!==null&&f!==void 0?f:s)(d))});e.Roarr=l;var u=_y;Object.defineProperty(e,"logLevels",{enumerable:!0,get:function(){return u.logLevels}});var c=S2;Object.defineProperty(e,"getLogLevelName",{enumerable:!0,get:function(){return c.getLogLevelName}})})(by);var Ype=yt&&yt.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Zpe=yt&&yt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r2,"__esModule",{value:!0});r2.createLogWriter=void 0;var Jpe=i2,ege=Pk,tge=Zpe(Ik),ij=qz,nge=by,mR=(0,tge.default)(),rge={debug:{backgroundColor:"#712bde",color:"#fff"},error:{backgroundColor:"#f05033",color:"#fff"},fatal:{backgroundColor:"#f05033",color:"#fff"},info:{backgroundColor:"#3174f1",color:"#fff"},trace:{backgroundColor:"#666",color:"#fff"},warn:{backgroundColor:"#f5a623",color:"#000"}},ige={debug:{color:"#8367d3"},error:{color:"#ff1a1a"},fatal:{color:"#ff1a1a"},info:{color:"#3291ff"},trace:{color:"#999"},warn:{color:"#f7b955"}},oge=function(e){var t=e.getItem("ROARR_FILTER");return t?(0,ij.parse)(t):null},age=function(e){var t,n;e===void 0&&(e={});var r=(t=e==null?void 0:e.storage)!==null&&t!==void 0?t:mR.localStorage,i=(n=e==null?void 0:e.logMethods)!==null&&n!==void 0?n:(0,Jpe.createLogMethods)();if(!r&&!mR.localStorage)return console.warn("initiated Roarr browser log writer in non-browser context"),function(){};if(!(0,ege.boolean)(r.getItem("ROARR_LOG")))return function(){};var o=oge(r);return function(a){var s=JSON.parse(a),l=s.context,u=l.logLevel,c=l.namespace,d=Ype(l,["logLevel","namespace"]);if(!(o&&!(0,ij.test)(o,s))){var f=(0,nge.getLogLevelName)(Number(u)),h=i[f],p=rge[f],m=`
|
||
background-color: `.concat(p.backgroundColor,`;
|
||
color: `).concat(p.color,`;
|
||
font-weight: bold;
|
||
`),_=`
|
||
color: `.concat(ige[f].color,`;
|
||
`),b=`
|
||
color: inherit;
|
||
`;Object.keys(d).length>0?h("%c ".concat(f," %c").concat(c?" [".concat(String(c),"]:"):"","%c ").concat(s.message," %O"),m,_,b,d):h("%c ".concat(f," %c").concat(c?" [".concat(String(c),"]:"):"","%c ").concat(s.message),m,_,b)}}};r2.createLogWriter=age;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createLogWriter=void 0;var t=r2;Object.defineProperty(e,"createLogWriter",{enumerable:!0,get:function(){return t.createLogWriter}})})(Mz);by.ROARR.write=Mz.createLogWriter();const oj={};by.Roarr.child(oj);const x2=nl(by.Roarr.child(oj)),_e=e=>x2.get().child({namespace:e}),RGe=["trace","debug","info","warn","error","fatal"],OGe={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Xt=e=>{try{return JSON.parse(JSON.stringify(e))}catch{return"Error parsing object"}},sge=async e=>{const t={},n=await e.arrayBuffer(),r=Jfe(n).text,i=ch(r,"invokeai_metadata");if(i){const a=UB.safeParse(JSON.parse(i));a.success?t.metadata=a.data:_e("system").error({error:Xt(a.error)},"Problem reading metadata from image")}const o=ch(r,"invokeai_workflow");if(o){const a=WB.safeParse(JSON.parse(o));a.success?t.workflow=a.data:_e("system").error({error:Xt(a.error)},"Problem reading workflow from image")}return t};var v_=globalThis&&globalThis.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},b_=globalThis&&globalThis.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},lge=Object.defineProperty,uge=Object.defineProperties,cge=Object.getOwnPropertyDescriptors,__=Object.getOwnPropertySymbols,aj=Object.prototype.hasOwnProperty,sj=Object.prototype.propertyIsEnumerable,yR=function(e,t,n){return t in e?lge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Cr=function(e,t){for(var n in t||(t={}))aj.call(t,n)&&yR(e,n,t[n]);if(__)for(var r=0,i=__(t);r<i.length;r++){var n=i[r];sj.call(t,n)&&yR(e,n,t[n])}return e},Ds=function(e,t){return uge(e,cge(t))},vR=function(e,t){var n={};for(var r in e)aj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&__)for(var i=0,o=__(e);i<o.length;i++){var r=o[i];t.indexOf(r)<0&&sj.call(e,r)&&(n[r]=e[r])}return n},S_=function(e,t,n){return new Promise(function(r,i){var o=function(l){try{s(n.next(l))}catch(u){i(u)}},a=function(l){try{s(n.throw(l))}catch(u){i(u)}},s=function(l){return l.done?r(l.value):Promise.resolve(l.value).then(o,a)};s((n=n.apply(e,t)).next())})},tr;(function(e){e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected"})(tr||(tr={}));function dge(e){return{status:e,isUninitialized:e===tr.uninitialized,isLoading:e===tr.pending,isSuccess:e===tr.fulfilled,isError:e===tr.rejected}}function fge(e){return new RegExp("(^|:)//").test(e)}var hge=function(e){return e.replace(/\/$/,"")},pge=function(e){return e.replace(/^\//,"")};function gge(e,t){if(!e)return t;if(!t)return e;if(fge(t))return t;var n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=hge(e),t=pge(t),""+e+n+t}var bR=function(e){return[].concat.apply([],e)};function mge(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}function yge(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}var _R=ss;function lj(e,t){if(e===t||!(_R(e)&&_R(t)||Array.isArray(e)&&Array.isArray(t)))return t;for(var n=Object.keys(t),r=Object.keys(e),i=n.length===r.length,o=Array.isArray(t)?[]:{},a=0,s=n;a<s.length;a++){var l=s[a];o[l]=lj(e[l],t[l]),i&&(i=e[l]===o[l])}return i?e:o}var SR=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fetch.apply(void 0,e)},vge=function(e){return e.status>=200&&e.status<=299},bge=function(e){return/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"")};function xR(e){if(!ss(e))return e;for(var t=Cr({},e),n=0,r=Object.entries(t);n<r.length;n++){var i=r[n],o=i[0],a=i[1];a===void 0&&delete t[o]}return t}function _ge(e){var t=this;e===void 0&&(e={});var n=e,r=n.baseUrl,i=n.prepareHeaders,o=i===void 0?function(g){return g}:i,a=n.fetchFn,s=a===void 0?SR:a,l=n.paramsSerializer,u=n.isJsonContentType,c=u===void 0?bge:u,d=n.jsonContentType,f=d===void 0?"application/json":d,h=n.jsonReplacer,p=n.timeout,m=n.responseHandler,_=n.validateStatus,b=vR(n,["baseUrl","prepareHeaders","fetchFn","paramsSerializer","isJsonContentType","jsonContentType","jsonReplacer","timeout","responseHandler","validateStatus"]);return typeof fetch>"u"&&s===SR&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),function(g,v){return S_(t,null,function(){var S,w,x,C,k,T,P,$,O,E,A,D,L,M,R,N,B,U,G,Z,ee,J,j,Q,ne,se,ye,ce,bt,ot,ze,mt,Pe,en,Pr,Ln;return v_(this,function(An){switch(An.label){case 0:return S=v.signal,w=v.getState,x=v.extra,C=v.endpoint,k=v.forced,T=v.type,$=typeof g=="string"?{url:g}:g,O=$.url,E=$.headers,A=E===void 0?new Headers(b.headers):E,D=$.params,L=D===void 0?void 0:D,M=$.responseHandler,R=M===void 0?m??"json":M,N=$.validateStatus,B=N===void 0?_??vge:N,U=$.timeout,G=U===void 0?p:U,Z=vR($,["url","headers","params","responseHandler","validateStatus","timeout"]),ee=Cr(Ds(Cr({},b),{signal:S}),Z),A=new Headers(xR(A)),J=ee,[4,o(A,{getState:w,extra:x,endpoint:C,forced:k,type:T})];case 1:J.headers=An.sent()||A,j=function(tn){return typeof tn=="object"&&(ss(tn)||Array.isArray(tn)||typeof tn.toJSON=="function")},!ee.headers.has("content-type")&&j(ee.body)&&ee.headers.set("content-type",f),j(ee.body)&&c(ee.headers)&&(ee.body=JSON.stringify(ee.body,h)),L&&(Q=~O.indexOf("?")?"&":"?",ne=l?l(L):new URLSearchParams(xR(L)),O+=Q+ne),O=gge(r,O),se=new Request(O,ee),ye=se.clone(),P={request:ye},bt=!1,ot=G&&setTimeout(function(){bt=!0,v.abort()},G),An.label=2;case 2:return An.trys.push([2,4,5,6]),[4,s(se)];case 3:return ce=An.sent(),[3,6];case 4:return ze=An.sent(),[2,{error:{status:bt?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ze)},meta:P}];case 5:return ot&&clearTimeout(ot),[7];case 6:mt=ce.clone(),P.response=mt,en="",An.label=7;case 7:return An.trys.push([7,9,,10]),[4,Promise.all([y(ce,R).then(function(tn){return Pe=tn},function(tn){return Pr=tn}),mt.text().then(function(tn){return en=tn},function(){})])];case 8:if(An.sent(),Pr)throw Pr;return[3,10];case 9:return Ln=An.sent(),[2,{error:{status:"PARSING_ERROR",originalStatus:ce.status,data:en,error:String(Ln)},meta:P}];case 10:return[2,B(ce,Pe)?{data:Pe,meta:P}:{error:{status:ce.status,data:Pe},meta:P}]}})})};function y(g,v){return S_(this,null,function(){var S;return v_(this,function(w){switch(w.label){case 0:return typeof v=="function"?[2,v(g)]:(v==="content-type"&&(v=c(g.headers)?"json":"text"),v!=="json"?[3,2]:[4,g.text()]);case 1:return S=w.sent(),[2,S.length?JSON.parse(S):null];case 2:return[2,g.text()]}})})}}var wR=function(){function e(t,n){n===void 0&&(n=void 0),this.value=t,this.meta=n}return e}(),Mk=Ne("__rtkq/focused"),uj=Ne("__rtkq/unfocused"),Nk=Ne("__rtkq/online"),cj=Ne("__rtkq/offline"),Zs;(function(e){e.query="query",e.mutation="mutation"})(Zs||(Zs={}));function dj(e){return e.type===Zs.query}function Sge(e){return e.type===Zs.mutation}function fj(e,t,n,r,i,o){return xge(e)?e(t,n,r,i).map(bE).map(o):Array.isArray(e)?e.map(bE).map(o):[]}function xge(e){return typeof e=="function"}function bE(e){return typeof e=="string"?{type:e}:e}function AC(e){return e!=null}var o0=Symbol("forceQueryFn"),_E=function(e){return typeof e[o0]=="function"};function wge(e){var t=e.serializeQueryArgs,n=e.queryThunk,r=e.mutationThunk,i=e.api,o=e.context,a=new Map,s=new Map,l=i.internalActions,u=l.unsubscribeQueryResult,c=l.removeMutationResult,d=l.updateSubscriptionOptions;return{buildInitiateQuery:y,buildInitiateMutation:g,getRunningQueryThunk:p,getRunningMutationThunk:m,getRunningQueriesThunk:_,getRunningMutationsThunk:b,getRunningOperationPromises:h,removalWarning:f};function f(){throw new Error(`This method had to be removed due to a conceptual bug in RTK.
|
||
Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.
|
||
See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.`)}function h(){typeof process<"u";var v=function(S){return Array.from(S.values()).flatMap(function(w){return w?Object.values(w):[]})};return b_(b_([],v(a)),v(s)).filter(AC)}function p(v,S){return function(w){var x,C=o.endpointDefinitions[v],k=t({queryArgs:S,endpointDefinition:C,endpointName:v});return(x=a.get(w))==null?void 0:x[k]}}function m(v,S){return function(w){var x;return(x=s.get(w))==null?void 0:x[S]}}function _(){return function(v){return Object.values(a.get(v)||{}).filter(AC)}}function b(){return function(v){return Object.values(s.get(v)||{}).filter(AC)}}function y(v,S){var w=function(x,C){var k=C===void 0?{}:C,T=k.subscribe,P=T===void 0?!0:T,$=k.forceRefetch,O=k.subscriptionOptions,E=o0,A=k[E];return function(D,L){var M,R,N=t({queryArgs:x,endpointDefinition:S,endpointName:v}),B=n((M={type:"query",subscribe:P,forceRefetch:$,subscriptionOptions:O,endpointName:v,originalArgs:x,queryCacheKey:N},M[o0]=A,M)),U=i.endpoints[v].select(x),G=D(B),Z=U(L()),ee=G.requestId,J=G.abort,j=Z.requestId!==ee,Q=(R=a.get(D))==null?void 0:R[N],ne=function(){return U(L())},se=Object.assign(A?G.then(ne):j&&!Q?Promise.resolve(Z):Promise.all([Q,G]).then(ne),{arg:x,requestId:ee,subscriptionOptions:O,queryCacheKey:N,abort:J,unwrap:function(){return S_(this,null,function(){var ce;return v_(this,function(bt){switch(bt.label){case 0:return[4,se];case 1:if(ce=bt.sent(),ce.isError)throw ce.error;return[2,ce.data]}})})},refetch:function(){return D(w(x,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){P&&D(u({queryCacheKey:N,requestId:ee}))},updateSubscriptionOptions:function(ce){se.subscriptionOptions=ce,D(d({endpointName:v,requestId:ee,queryCacheKey:N,options:ce}))}});if(!Q&&!j&&!A){var ye=a.get(D)||{};ye[N]=se,a.set(D,ye),se.then(function(){delete ye[N],Object.keys(ye).length||a.delete(D)})}return se}};return w}function g(v){return function(S,w){var x=w===void 0?{}:w,C=x.track,k=C===void 0?!0:C,T=x.fixedCacheKey;return function(P,$){var O=r({type:"mutation",endpointName:v,originalArgs:S,track:k,fixedCacheKey:T}),E=P(O),A=E.requestId,D=E.abort,L=E.unwrap,M=E.unwrap().then(function(U){return{data:U}}).catch(function(U){return{error:U}}),R=function(){P(c({requestId:A,fixedCacheKey:T}))},N=Object.assign(M,{arg:E.arg,requestId:A,abort:D,unwrap:L,unsubscribe:R,reset:R}),B=s.get(P)||{};return s.set(P,B),B[A]=N,N.then(function(){delete B[A],Object.keys(B).length||s.delete(P)}),T&&(B[T]=N,N.then(function(){B[T]===N&&(delete B[T],Object.keys(B).length||s.delete(P))})),N}}}}function CR(e){return e}function Cge(e){var t=this,n=e.reducerPath,r=e.baseQuery,i=e.context.endpointDefinitions,o=e.serializeQueryArgs,a=e.api,s=function(g,v,S){return function(w){var x=i[g];w(a.internalActions.queryResultPatched({queryCacheKey:o({queryArgs:v,endpointDefinition:x,endpointName:g}),patches:S}))}},l=function(g,v,S){return function(w,x){var C,k,T=a.endpoints[g].select(v)(x()),P={patches:[],inversePatches:[],undo:function(){return w(a.util.patchQueryData(g,v,P.inversePatches))}};if(T.status===tr.uninitialized)return P;if("data"in T)if(Po(T.data)){var $=Q4(T.data,S),O=$[1],E=$[2];(C=P.patches).push.apply(C,O),(k=P.inversePatches).push.apply(k,E)}else{var A=S(T.data);P.patches.push({op:"replace",path:[],value:A}),P.inversePatches.push({op:"replace",path:[],value:T.data})}return w(a.util.patchQueryData(g,v,P.patches)),P}},u=function(g,v,S){return function(w){var x;return w(a.endpoints[g].initiate(v,(x={subscribe:!1,forceRefetch:!0},x[o0]=function(){return{data:S}},x)))}},c=function(g,v){return S_(t,[g,v],function(S,w){var x,C,k,T,P,$,O,E,A,D,L,M,R,N,B,U,G,Z,ee=w.signal,J=w.abort,j=w.rejectWithValue,Q=w.fulfillWithValue,ne=w.dispatch,se=w.getState,ye=w.extra;return v_(this,function(ce){switch(ce.label){case 0:x=i[S.endpointName],ce.label=1;case 1:return ce.trys.push([1,8,,13]),C=CR,k=void 0,T={signal:ee,abort:J,dispatch:ne,getState:se,extra:ye,endpoint:S.endpointName,type:S.type,forced:S.type==="query"?d(S,se()):void 0},P=S.type==="query"?S[o0]:void 0,P?(k=P(),[3,6]):[3,2];case 2:return x.query?[4,r(x.query(S.originalArgs),T,x.extraOptions)]:[3,4];case 3:return k=ce.sent(),x.transformResponse&&(C=x.transformResponse),[3,6];case 4:return[4,x.queryFn(S.originalArgs,T,x.extraOptions,function(bt){return r(bt,T,x.extraOptions)})];case 5:k=ce.sent(),ce.label=6;case 6:if(typeof process<"u",k.error)throw new wR(k.error,k.meta);return L=Q,[4,C(k.data,k.meta,S.originalArgs)];case 7:return[2,L.apply(void 0,[ce.sent(),(G={fulfilledTimeStamp:Date.now(),baseQueryMeta:k.meta},G[td]=!0,G)])];case 8:if(M=ce.sent(),R=M,!(R instanceof wR))return[3,12];N=CR,x.query&&x.transformErrorResponse&&(N=x.transformErrorResponse),ce.label=9;case 9:return ce.trys.push([9,11,,12]),B=j,[4,N(R.value,R.meta,S.originalArgs)];case 10:return[2,B.apply(void 0,[ce.sent(),(Z={baseQueryMeta:R.meta},Z[td]=!0,Z)])];case 11:return U=ce.sent(),R=U,[3,12];case 12:throw typeof process<"u",console.error(R),R;case 13:return[2]}})})};function d(g,v){var S,w,x,C,k=(w=(S=v[n])==null?void 0:S.queries)==null?void 0:w[g.queryCacheKey],T=(x=v[n])==null?void 0:x.config.refetchOnMountOrArgChange,P=k==null?void 0:k.fulfilledTimeStamp,$=(C=g.forceRefetch)!=null?C:g.subscribe&&T;return $?$===!0||(Number(new Date)-Number(P))/1e3>=$:!1}var f=jb(n+"/executeQuery",c,{getPendingMeta:function(){var g;return g={startedTimeStamp:Date.now()},g[td]=!0,g},condition:function(g,v){var S=v.getState,w,x,C,k=S(),T=(x=(w=k[n])==null?void 0:w.queries)==null?void 0:x[g.queryCacheKey],P=T==null?void 0:T.fulfilledTimeStamp,$=g.originalArgs,O=T==null?void 0:T.originalArgs,E=i[g.endpointName];return _E(g)?!0:(T==null?void 0:T.status)==="pending"?!1:d(g,k)||dj(E)&&((C=E==null?void 0:E.forceRefetch)!=null&&C.call(E,{currentArg:$,previousArg:O,endpointState:T,state:k}))?!0:!P},dispatchConditionRejection:!0}),h=jb(n+"/executeMutation",c,{getPendingMeta:function(){var g;return g={startedTimeStamp:Date.now()},g[td]=!0,g}}),p=function(g){return"force"in g},m=function(g){return"ifOlderThan"in g},_=function(g,v,S){return function(w,x){var C=p(S)&&S.force,k=m(S)&&S.ifOlderThan,T=function(E){return E===void 0&&(E=!0),a.endpoints[g].initiate(v,{forceRefetch:E})},P=a.endpoints[g].select(v)(x());if(C)w(T());else if(k){var $=P==null?void 0:P.fulfilledTimeStamp;if(!$){w(T());return}var O=(Number(new Date)-Number(new Date($)))/1e3>=k;O&&w(T())}else w(T(!1))}};function b(g){return function(v){var S,w;return((w=(S=v==null?void 0:v.meta)==null?void 0:S.arg)==null?void 0:w.endpointName)===g}}function y(g,v){return{matchPending:ah(DS(g),b(v)),matchFulfilled:ah(Sc(g),b(v)),matchRejected:ah(Uh(g),b(v))}}return{queryThunk:f,mutationThunk:h,prefetch:_,updateQueryData:l,upsertQueryData:u,patchQueryData:s,buildMatchThunkActions:y}}function hj(e,t,n,r){return fj(n[e.meta.arg.endpointName][t],Sc(e)?e.payload:void 0,ey(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function wv(e,t,n){var r=e[t];r&&n(r)}function a0(e){var t;return(t="arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)!=null?t:e.requestId}function ER(e,t,n){var r=e[a0(t)];r&&n(r)}var Kp={};function Ege(e){var t=e.reducerPath,n=e.queryThunk,r=e.mutationThunk,i=e.context,o=i.endpointDefinitions,a=i.apiUid,s=i.extractRehydrationInfo,l=i.hasRehydrationInfo,u=e.assertTagType,c=e.config,d=Ne(t+"/resetApiState"),f=rr({name:t+"/queries",initialState:Kp,reducers:{removeQueryResult:{reducer:function(S,w){var x=w.payload.queryCacheKey;delete S[x]},prepare:O1()},queryResultPatched:function(S,w){var x=w.payload,C=x.queryCacheKey,k=x.patches;wv(S,C,function(T){T.data=z3(T.data,k.concat())})}},extraReducers:function(S){S.addCase(n.pending,function(w,x){var C=x.meta,k=x.meta.arg,T,P,$=_E(k);(k.subscribe||$)&&((P=w[T=k.queryCacheKey])!=null||(w[T]={status:tr.uninitialized,endpointName:k.endpointName})),wv(w,k.queryCacheKey,function(O){O.status=tr.pending,O.requestId=$&&O.requestId?O.requestId:C.requestId,k.originalArgs!==void 0&&(O.originalArgs=k.originalArgs),O.startedTimeStamp=C.startedTimeStamp})}).addCase(n.fulfilled,function(w,x){var C=x.meta,k=x.payload;wv(w,C.arg.queryCacheKey,function(T){var P;if(!(T.requestId!==C.requestId&&!_E(C.arg))){var $=o[C.arg.endpointName].merge;if(T.status=tr.fulfilled,$)if(T.data!==void 0){var O=C.fulfilledTimeStamp,E=C.arg,A=C.baseQueryMeta,D=C.requestId,L=_c(T.data,function(M){return $(M,k,{arg:E.originalArgs,baseQueryMeta:A,fulfilledTimeStamp:O,requestId:D})});T.data=L}else T.data=k;else T.data=(P=o[C.arg.endpointName].structuralSharing)==null||P?lj(ao(T.data)?U4(T.data):T.data,k):k;delete T.error,T.fulfilledTimeStamp=C.fulfilledTimeStamp}})}).addCase(n.rejected,function(w,x){var C=x.meta,k=C.condition,T=C.arg,P=C.requestId,$=x.error,O=x.payload;wv(w,T.queryCacheKey,function(E){if(!k){if(E.requestId!==P)return;E.status=tr.rejected,E.error=O??$}})}).addMatcher(l,function(w,x){for(var C=s(x).queries,k=0,T=Object.entries(C);k<T.length;k++){var P=T[k],$=P[0],O=P[1];((O==null?void 0:O.status)===tr.fulfilled||(O==null?void 0:O.status)===tr.rejected)&&(w[$]=O)}})}}),h=rr({name:t+"/mutations",initialState:Kp,reducers:{removeMutationResult:{reducer:function(S,w){var x=w.payload,C=a0(x);C in S&&delete S[C]},prepare:O1()}},extraReducers:function(S){S.addCase(r.pending,function(w,x){var C=x.meta,k=x.meta,T=k.requestId,P=k.arg,$=k.startedTimeStamp;P.track&&(w[a0(C)]={requestId:T,status:tr.pending,endpointName:P.endpointName,startedTimeStamp:$})}).addCase(r.fulfilled,function(w,x){var C=x.payload,k=x.meta;k.arg.track&&ER(w,k,function(T){T.requestId===k.requestId&&(T.status=tr.fulfilled,T.data=C,T.fulfilledTimeStamp=k.fulfilledTimeStamp)})}).addCase(r.rejected,function(w,x){var C=x.payload,k=x.error,T=x.meta;T.arg.track&&ER(w,T,function(P){P.requestId===T.requestId&&(P.status=tr.rejected,P.error=C??k)})}).addMatcher(l,function(w,x){for(var C=s(x).mutations,k=0,T=Object.entries(C);k<T.length;k++){var P=T[k],$=P[0],O=P[1];((O==null?void 0:O.status)===tr.fulfilled||(O==null?void 0:O.status)===tr.rejected)&&$!==(O==null?void 0:O.requestId)&&(w[$]=O)}})}}),p=rr({name:t+"/invalidation",initialState:Kp,reducers:{},extraReducers:function(S){S.addCase(f.actions.removeQueryResult,function(w,x){for(var C=x.payload.queryCacheKey,k=0,T=Object.values(w);k<T.length;k++)for(var P=T[k],$=0,O=Object.values(P);$<O.length;$++){var E=O[$],A=E.indexOf(C);A!==-1&&E.splice(A,1)}}).addMatcher(l,function(w,x){for(var C,k,T,P,$=s(x).provided,O=0,E=Object.entries($);O<E.length;O++)for(var A=E[O],D=A[0],L=A[1],M=0,R=Object.entries(L);M<R.length;M++)for(var N=R[M],B=N[0],U=N[1],G=(P=(k=(C=w[D])!=null?C:w[D]={})[T=B||"__internal_without_id"])!=null?P:k[T]=[],Z=0,ee=U;Z<ee.length;Z++){var J=ee[Z],j=G.includes(J);j||G.push(J)}}).addMatcher($o(Sc(n),ey(n)),function(w,x){for(var C,k,T,P,$=hj(x,"providesTags",o,u),O=x.meta.arg.queryCacheKey,E=0,A=Object.values(w);E<A.length;E++)for(var D=A[E],L=0,M=Object.values(D);L<M.length;L++){var R=M[L],N=R.indexOf(O);N!==-1&&R.splice(N,1)}for(var B=0,U=$;B<U.length;B++){var G=U[B],Z=G.type,ee=G.id,J=(P=(k=(C=w[Z])!=null?C:w[Z]={})[T=ee||"__internal_without_id"])!=null?P:k[T]=[],j=J.includes(O);j||J.push(O)}})}}),m=rr({name:t+"/subscriptions",initialState:Kp,reducers:{updateSubscriptionOptions:function(S,w){},unsubscribeQueryResult:function(S,w){},internal_probeSubscription:function(S,w){}}}),_=rr({name:t+"/internalSubscriptions",initialState:Kp,reducers:{subscriptionsUpdated:{reducer:function(S,w){return z3(S,w.payload)},prepare:O1()}}}),b=rr({name:t+"/config",initialState:Cr({online:mge(),focused:yge(),middlewareRegistered:!1},c),reducers:{middlewareRegistered:function(S,w){var x=w.payload;S.middlewareRegistered=S.middlewareRegistered==="conflict"||a!==x?"conflict":!0}},extraReducers:function(S){S.addCase(Nk,function(w){w.online=!0}).addCase(cj,function(w){w.online=!1}).addCase(Mk,function(w){w.focused=!0}).addCase(uj,function(w){w.focused=!1}).addMatcher(l,function(w){return Cr({},w)})}}),y=pp({queries:f.reducer,mutations:h.reducer,provided:p.reducer,subscriptions:_.reducer,config:b.reducer}),g=function(S,w){return y(d.match(w)?void 0:S,w)},v=Ds(Cr(Cr(Cr(Cr(Cr({},b.actions),f.actions),m.actions),_.actions),h.actions),{unsubscribeMutationResult:h.actions.removeMutationResult,resetApiState:d});return{reducer:g,actions:v}}var od=Symbol.for("RTKQ/skipToken"),pj={status:tr.uninitialized},TR=_c(pj,function(){}),kR=_c(pj,function(){});function Tge(e){var t=e.serializeQueryArgs,n=e.reducerPath,r=function(c){return TR},i=function(c){return kR};return{buildQuerySelector:s,buildMutationSelector:l,selectInvalidatedBy:u};function o(c){return Cr(Cr({},c),dge(c.status))}function a(c){var d=c[n];return d}function s(c,d){return function(f){var h=t({queryArgs:f,endpointDefinition:d,endpointName:c}),p=function(_){var b,y,g;return(g=(y=(b=a(_))==null?void 0:b.queries)==null?void 0:y[h])!=null?g:TR},m=f===od?r:p;return Ii(m,o)}}function l(){return function(c){var d,f;typeof c=="object"?f=(d=a0(c))!=null?d:od:f=c;var h=function(m){var _,b,y;return(y=(b=(_=a(m))==null?void 0:_.mutations)==null?void 0:b[f])!=null?y:kR},p=f===od?i:h;return Ii(p,o)}}function u(c,d){for(var f,h=c[n],p=new Set,m=0,_=d.map(bE);m<_.length;m++){var b=_[m],y=h.provided[b.type];if(y)for(var g=(f=b.id!==void 0?y[b.id]:bR(Object.values(y)))!=null?f:[],v=0,S=g;v<S.length;v++){var w=S[v];p.add(w)}}return bR(Array.from(p.values()).map(function(x){var C=h.queries[x];return C?[{queryCacheKey:x,endpointName:C.endpointName,originalArgs:C.originalArgs}]:[]}))}}var Cv=WeakMap?new WeakMap:void 0,AR=function(e){var t=e.endpointName,n=e.queryArgs,r="",i=Cv==null?void 0:Cv.get(n);if(typeof i=="string")r=i;else{var o=JSON.stringify(n,function(a,s){return ss(s)?Object.keys(s).sort().reduce(function(l,u){return l[u]=s[u],l},{}):s});ss(n)&&(Cv==null||Cv.set(n,o)),r=o}return t+"("+r+")"};function kge(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(r){var i=zb(function(c){var d,f;return(f=r.extractRehydrationInfo)==null?void 0:f.call(r,c,{reducerPath:(d=r.reducerPath)!=null?d:"api"})}),o=Ds(Cr({reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},r),{extractRehydrationInfo:i,serializeQueryArgs:function(c){var d=AR;if("serializeQueryArgs"in c.endpointDefinition){var f=c.endpointDefinition.serializeQueryArgs;d=function(h){var p=f(h);return typeof p=="string"?p:AR(Ds(Cr({},h),{queryArgs:p}))}}else r.serializeQueryArgs&&(d=r.serializeQueryArgs);return d(c)},tagTypes:b_([],r.tagTypes||[])}),a={endpointDefinitions:{},batch:function(c){c()},apiUid:NS(),extractRehydrationInfo:i,hasRehydrationInfo:zb(function(c){return i(c)!=null})},s={injectEndpoints:u,enhanceEndpoints:function(c){var d=c.addTagTypes,f=c.endpoints;if(d)for(var h=0,p=d;h<p.length;h++){var m=p[h];o.tagTypes.includes(m)||o.tagTypes.push(m)}if(f)for(var _=0,b=Object.entries(f);_<b.length;_++){var y=b[_],g=y[0],v=y[1];typeof v=="function"?v(a.endpointDefinitions[g]):Object.assign(a.endpointDefinitions[g]||{},v)}return s}},l=e.map(function(c){return c.init(s,o,a)});function u(c){for(var d=c.endpoints({query:function(v){return Ds(Cr({},v),{type:Zs.query})},mutation:function(v){return Ds(Cr({},v),{type:Zs.mutation})}}),f=0,h=Object.entries(d);f<h.length;f++){var p=h[f],m=p[0],_=p[1];if(!c.overrideExisting&&m in a.endpointDefinitions){typeof process<"u";continue}a.endpointDefinitions[m]=_;for(var b=0,y=l;b<y.length;b++){var g=y[b];g.injectEndpoint(m,_)}}return s}return s.injectEndpoints({endpoints:r.endpoints})}}function Age(e){for(var t in e)return!1;return!0}var Pge=2147483647/1e3-1,Ige=function(e){var t=e.reducerPath,n=e.api,r=e.context,i=e.internalState,o=n.internalActions,a=o.removeQueryResult,s=o.unsubscribeQueryResult;function l(f){var h=i.currentSubscriptions[f];return!!h&&!Age(h)}var u={},c=function(f,h,p){var m;if(s.match(f)){var _=h.getState()[t],b=f.payload.queryCacheKey;d(b,(m=_.queries[b])==null?void 0:m.endpointName,h,_.config)}if(n.util.resetApiState.match(f))for(var y=0,g=Object.entries(u);y<g.length;y++){var v=g[y],S=v[0],w=v[1];w&&clearTimeout(w),delete u[S]}if(r.hasRehydrationInfo(f))for(var _=h.getState()[t],x=r.extractRehydrationInfo(f).queries,C=0,k=Object.entries(x);C<k.length;C++){var T=k[C],b=T[0],P=T[1];d(b,P==null?void 0:P.endpointName,h,_.config)}};function d(f,h,p,m){var _,b=r.endpointDefinitions[h],y=(_=b==null?void 0:b.keepUnusedDataFor)!=null?_:m.keepUnusedDataFor;if(y!==1/0){var g=Math.max(0,Math.min(y,Pge));if(!l(f)){var v=u[f];v&&clearTimeout(v),u[f]=setTimeout(function(){l(f)||p.dispatch(a({queryCacheKey:f})),delete u[f]},g*1e3)}}}return c},Rge=function(e){var t=e.reducerPath,n=e.context,r=e.context.endpointDefinitions,i=e.mutationThunk,o=e.api,a=e.assertTagType,s=e.refetchQuery,l=o.internalActions.removeQueryResult,u=$o(Sc(i),ey(i)),c=function(f,h){u(f)&&d(hj(f,"invalidatesTags",r,a),h),o.util.invalidateTags.match(f)&&d(fj(f.payload,void 0,void 0,void 0,void 0,a),h)};function d(f,h){var p=h.getState(),m=p[t],_=o.util.selectInvalidatedBy(p,f);n.batch(function(){for(var b,y=Array.from(_.values()),g=0,v=y;g<v.length;g++){var S=v[g].queryCacheKey,w=m.queries[S],x=(b=m.subscriptions[S])!=null?b:{};w&&(Object.keys(x).length===0?h.dispatch(l({queryCacheKey:S})):w.status!==tr.uninitialized&&h.dispatch(s(w,S)))}})}return c},Oge=function(e){var t=e.reducerPath,n=e.queryThunk,r=e.api,i=e.refetchQuery,o=e.internalState,a={},s=function(h,p){(r.internalActions.updateSubscriptionOptions.match(h)||r.internalActions.unsubscribeQueryResult.match(h))&&u(h.payload,p),(n.pending.match(h)||n.rejected.match(h)&&h.meta.condition)&&u(h.meta.arg,p),(n.fulfilled.match(h)||n.rejected.match(h)&&!h.meta.condition)&&l(h.meta.arg,p),r.util.resetApiState.match(h)&&d()};function l(h,p){var m=h.queryCacheKey,_=p.getState()[t],b=_.queries[m],y=o.currentSubscriptions[m];if(!(!b||b.status===tr.uninitialized)){var g=f(y);if(Number.isFinite(g)){var v=a[m];v!=null&&v.timeout&&(clearTimeout(v.timeout),v.timeout=void 0);var S=Date.now()+g,w=a[m]={nextPollTimestamp:S,pollingInterval:g,timeout:setTimeout(function(){w.timeout=void 0,p.dispatch(i(b,m))},g)}}}}function u(h,p){var m=h.queryCacheKey,_=p.getState()[t],b=_.queries[m],y=o.currentSubscriptions[m];if(!(!b||b.status===tr.uninitialized)){var g=f(y);if(!Number.isFinite(g)){c(m);return}var v=a[m],S=Date.now()+g;(!v||S<v.nextPollTimestamp)&&l({queryCacheKey:m},p)}}function c(h){var p=a[h];p!=null&&p.timeout&&clearTimeout(p.timeout),delete a[h]}function d(){for(var h=0,p=Object.keys(a);h<p.length;h++){var m=p[h];c(m)}}function f(h){h===void 0&&(h={});var p=Number.POSITIVE_INFINITY;for(var m in h)h[m].pollingInterval&&(p=Math.min(h[m].pollingInterval,p));return p}return s},Mge=function(e){var t=e.reducerPath,n=e.context,r=e.api,i=e.refetchQuery,o=e.internalState,a=r.internalActions.removeQueryResult,s=function(u,c){Mk.match(u)&&l(c,"refetchOnFocus"),Nk.match(u)&&l(c,"refetchOnReconnect")};function l(u,c){var d=u.getState()[t],f=d.queries,h=o.currentSubscriptions;n.batch(function(){for(var p=0,m=Object.keys(h);p<m.length;p++){var _=m[p],b=f[_],y=h[_];if(!(!y||!b)){var g=Object.values(y).some(function(v){return v[c]===!0})||Object.values(y).every(function(v){return v[c]===void 0})&&d.config[c];g&&(Object.keys(y).length===0?u.dispatch(a({queryCacheKey:_})):b.status!==tr.uninitialized&&u.dispatch(i(b,_)))}}})}return s},PR=new Error("Promise never resolved before cacheEntryRemoved."),Nge=function(e){var t=e.api,n=e.reducerPath,r=e.context,i=e.queryThunk,o=e.mutationThunk;e.internalState;var a=Ub(i),s=Ub(o),l=Sc(i,o),u={},c=function(h,p,m){var _=d(h);if(i.pending.match(h)){var b=m[n].queries[_],y=p.getState()[n].queries[_];!b&&y&&f(h.meta.arg.endpointName,h.meta.arg.originalArgs,_,p,h.meta.requestId)}else if(o.pending.match(h)){var y=p.getState()[n].mutations[_];y&&f(h.meta.arg.endpointName,h.meta.arg.originalArgs,_,p,h.meta.requestId)}else if(l(h)){var g=u[_];g!=null&&g.valueResolved&&(g.valueResolved({data:h.payload,meta:h.meta.baseQueryMeta}),delete g.valueResolved)}else if(t.internalActions.removeQueryResult.match(h)||t.internalActions.removeMutationResult.match(h)){var g=u[_];g&&(delete u[_],g.cacheEntryRemoved())}else if(t.util.resetApiState.match(h))for(var v=0,S=Object.entries(u);v<S.length;v++){var w=S[v],x=w[0],g=w[1];delete u[x],g.cacheEntryRemoved()}};function d(h){return a(h)?h.meta.arg.queryCacheKey:s(h)?h.meta.requestId:t.internalActions.removeQueryResult.match(h)?h.payload.queryCacheKey:t.internalActions.removeMutationResult.match(h)?a0(h.payload):""}function f(h,p,m,_,b){var y=r.endpointDefinitions[h],g=y==null?void 0:y.onCacheEntryAdded;if(g){var v={},S=new Promise(function(P){v.cacheEntryRemoved=P}),w=Promise.race([new Promise(function(P){v.valueResolved=P}),S.then(function(){throw PR})]);w.catch(function(){}),u[m]=v;var x=t.endpoints[h].select(y.type===Zs.query?p:m),C=_.dispatch(function(P,$,O){return O}),k=Ds(Cr({},_),{getCacheEntry:function(){return x(_.getState())},requestId:b,extra:C,updateCachedData:y.type===Zs.query?function(P){return _.dispatch(t.util.updateQueryData(h,p,P))}:void 0,cacheDataLoaded:w,cacheEntryRemoved:S}),T=g(p,k);Promise.resolve(T).catch(function(P){if(P!==PR)throw P})}}return c},$ge=function(e){var t=e.api,n=e.context,r=e.queryThunk,i=e.mutationThunk,o=DS(r,i),a=Uh(r,i),s=Sc(r,i),l={},u=function(c,d){var f,h,p;if(o(c)){var m=c.meta,_=m.requestId,b=m.arg,y=b.endpointName,g=b.originalArgs,v=n.endpointDefinitions[y],S=v==null?void 0:v.onQueryStarted;if(S){var w={},x=new Promise(function(A,D){w.resolve=A,w.reject=D});x.catch(function(){}),l[_]=w;var C=t.endpoints[y].select(v.type===Zs.query?g:_),k=d.dispatch(function(A,D,L){return L}),T=Ds(Cr({},d),{getCacheEntry:function(){return C(d.getState())},requestId:_,extra:k,updateCachedData:v.type===Zs.query?function(A){return d.dispatch(t.util.updateQueryData(y,g,A))}:void 0,queryFulfilled:x});S(g,T)}}else if(s(c)){var P=c.meta,_=P.requestId,$=P.baseQueryMeta;(f=l[_])==null||f.resolve({data:c.payload,meta:$}),delete l[_]}else if(a(c)){var O=c.meta,_=O.requestId,E=O.rejectedWithValue,$=O.baseQueryMeta;(p=l[_])==null||p.reject({error:(h=c.payload)!=null?h:c.error,isUnhandledError:!E,meta:$}),delete l[_]}};return u},Dge=function(e){var t=e.api,n=e.context.apiUid,r=e.reducerPath;return function(i,o){var a,s;t.util.resetApiState.match(i)&&o.dispatch(t.internalActions.middlewareRegistered(n)),typeof process<"u"}},IR,Lge=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(IR||(IR=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},Fge=function(e){var t=e.api,n=e.queryThunk,r=e.internalState,i=t.reducerPath+"/subscriptions",o=null,a=!1,s=t.internalActions,l=s.updateSubscriptionOptions,u=s.unsubscribeQueryResult,c=function(d,f){var h,p,m,_,b,y,g,v,S;if(l.match(f)){var w=f.payload,x=w.queryCacheKey,C=w.requestId,k=w.options;return(h=d==null?void 0:d[x])!=null&&h[C]&&(d[x][C]=k),!0}if(u.match(f)){var T=f.payload,x=T.queryCacheKey,C=T.requestId;return d[x]&&delete d[x][C],!0}if(t.internalActions.removeQueryResult.match(f))return delete d[f.payload.queryCacheKey],!0;if(n.pending.match(f)){var P=f.meta,$=P.arg,C=P.requestId;if($.subscribe){var O=(m=d[p=$.queryCacheKey])!=null?m:d[p]={};return O[C]=(b=(_=$.subscriptionOptions)!=null?_:O[C])!=null?b:{},!0}}if(n.rejected.match(f)){var E=f.meta,A=E.condition,$=E.arg,C=E.requestId;if(A&&$.subscribe){var O=(g=d[y=$.queryCacheKey])!=null?g:d[y]={};return O[C]=(S=(v=$.subscriptionOptions)!=null?v:O[C])!=null?S:{},!0}}return!1};return function(d,f){var h,p;if(o||(o=JSON.parse(JSON.stringify(r.currentSubscriptions))),t.util.resetApiState.match(d))return o=r.currentSubscriptions={},[!0,!1];if(t.internalActions.internal_probeSubscription.match(d)){var m=d.payload,_=m.queryCacheKey,b=m.requestId,y=!!((h=r.currentSubscriptions[_])!=null&&h[b]);return[!1,y]}var g=c(r.currentSubscriptions,d);if(g){a||(Lge(function(){var x=JSON.parse(JSON.stringify(r.currentSubscriptions)),C=Q4(o,function(){return x}),k=C[1];f.next(t.internalActions.subscriptionsUpdated(k)),o=x,a=!1}),a=!0);var v=!!((p=d.type)!=null&&p.startsWith(i)),S=n.rejected.match(d)&&d.meta.condition&&!!d.meta.arg.subscribe,w=!v&&!S;return[w,!1]}return[!0,!1]}};function Bge(e){var t=e.reducerPath,n=e.queryThunk,r=e.api,i=e.context,o=i.apiUid,a={invalidateTags:Ne(t+"/invalidateTags")},s=function(d){return!!d&&typeof d.type=="string"&&d.type.startsWith(t+"/")},l=[Dge,Ige,Rge,Oge,Nge,$ge],u=function(d){var f=!1,h={currentSubscriptions:{}},p=Ds(Cr({},e),{internalState:h,refetchQuery:c}),m=l.map(function(y){return y(p)}),_=Fge(p),b=Mge(p);return function(y){return function(g){f||(f=!0,d.dispatch(r.internalActions.middlewareRegistered(o)));var v=Ds(Cr({},d),{next:y}),S=d.getState(),w=_(g,v,S),x=w[0],C=w[1],k;if(x?k=y(g):k=C,d.getState()[t]&&(b(g,v,S),s(g)||i.hasRehydrationInfo(g)))for(var T=0,P=m;T<P.length;T++){var $=P[T];$(g,v,S)}return k}}};return{middleware:u,actions:a};function c(d,f,h){return h===void 0&&(h={}),n(Cr({type:"query",endpointName:d.endpointName,originalArgs:d.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:f},h))}}function cu(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,b_([e],t))}var RR=Symbol(),zge=function(){return{name:RR,init:function(e,t,n){var r=t.baseQuery,i=t.tagTypes,o=t.reducerPath,a=t.serializeQueryArgs,s=t.keepUnusedDataFor,l=t.refetchOnMountOrArgChange,u=t.refetchOnFocus,c=t.refetchOnReconnect;W4();var d=function(G){return typeof process<"u",G};Object.assign(e,{reducerPath:o,endpoints:{},internalActions:{onOnline:Nk,onOffline:cj,onFocus:Mk,onFocusLost:uj},util:{}});var f=Cge({baseQuery:r,reducerPath:o,context:n,api:e,serializeQueryArgs:a}),h=f.queryThunk,p=f.mutationThunk,m=f.patchQueryData,_=f.updateQueryData,b=f.upsertQueryData,y=f.prefetch,g=f.buildMatchThunkActions,v=Ege({context:n,queryThunk:h,mutationThunk:p,reducerPath:o,assertTagType:d,config:{refetchOnFocus:u,refetchOnReconnect:c,refetchOnMountOrArgChange:l,keepUnusedDataFor:s,reducerPath:o}}),S=v.reducer,w=v.actions;cu(e.util,{patchQueryData:m,updateQueryData:_,upsertQueryData:b,prefetch:y,resetApiState:w.resetApiState}),cu(e.internalActions,w);var x=Bge({reducerPath:o,context:n,queryThunk:h,mutationThunk:p,api:e,assertTagType:d}),C=x.middleware,k=x.actions;cu(e.util,k),cu(e,{reducer:S,middleware:C});var T=Tge({serializeQueryArgs:a,reducerPath:o}),P=T.buildQuerySelector,$=T.buildMutationSelector,O=T.selectInvalidatedBy;cu(e.util,{selectInvalidatedBy:O});var E=wge({queryThunk:h,mutationThunk:p,api:e,serializeQueryArgs:a,context:n}),A=E.buildInitiateQuery,D=E.buildInitiateMutation,L=E.getRunningMutationThunk,M=E.getRunningMutationsThunk,R=E.getRunningQueriesThunk,N=E.getRunningQueryThunk,B=E.getRunningOperationPromises,U=E.removalWarning;return cu(e.util,{getRunningOperationPromises:B,getRunningOperationPromise:U,getRunningMutationThunk:L,getRunningMutationsThunk:M,getRunningQueryThunk:N,getRunningQueriesThunk:R}),{name:RR,injectEndpoint:function(G,Z){var ee,J,j=e;(J=(ee=j.endpoints)[G])!=null||(ee[G]={}),dj(Z)?cu(j.endpoints[G],{name:G,select:P(G,Z),initiate:A(G,Z)},g(h,G)):Sge(Z)&&cu(j.endpoints[G],{name:G,select:$(),initiate:D(G)},g(p,G))}}}}},gj={exports:{}},mj={};/**
|
||
* @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 Zh=I;function jge(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Uge=typeof Object.is=="function"?Object.is:jge,Vge=Zh.useState,Gge=Zh.useEffect,qge=Zh.useLayoutEffect,Hge=Zh.useDebugValue;function Wge(e,t){var n=t(),r=Vge({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return qge(function(){i.value=n,i.getSnapshot=t,PC(i)&&o({inst:i})},[e,n,t]),Gge(function(){return PC(i)&&o({inst:i}),e(function(){PC(i)&&o({inst:i})})},[e]),Hge(n),n}function PC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Uge(e,n)}catch{return!0}}function Kge(e,t){return t()}var Qge=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Kge:Wge;mj.useSyncExternalStore=Zh.useSyncExternalStore!==void 0?Zh.useSyncExternalStore:Qge;gj.exports=mj;var Xge=gj.exports,yj={exports:{}},vj={};/**
|
||
* @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 w2=I,Yge=Xge;function Zge(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Jge=typeof Object.is=="function"?Object.is:Zge,eme=Yge.useSyncExternalStore,tme=w2.useRef,nme=w2.useEffect,rme=w2.useMemo,ime=w2.useDebugValue;vj.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=tme(null);if(o.current===null){var a={hasValue:!1,value:null};o.current=a}else a=o.current;o=rme(function(){function l(h){if(!u){if(u=!0,c=h,h=r(h),i!==void 0&&a.hasValue){var p=a.value;if(i(p,h))return d=p}return d=h}if(p=d,Jge(c,h))return p;var m=r(h);return i!==void 0&&i(p,m)?p:(c=h,d=m)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,n,r,i]);var s=eme(e,o[0],o[1]);return nme(function(){a.hasValue=!0,a.value=s},[s]),ime(s),s};yj.exports=vj;var bj=yj.exports;const ome=mc(bj);function ame(e){e()}let _j=ame;const sme=e=>_j=e,lme=()=>_j,OR=Symbol.for("react-redux-context"),MR=typeof globalThis<"u"?globalThis:{};function ume(){var e;if(!I.createContext)return{};const t=(e=MR[OR])!=null?e:MR[OR]=new Map;let n=t.get(I.createContext);return n||(n=I.createContext(null),t.set(I.createContext,n)),n}const lc=ume();function $k(e=lc){return function(){return I.useContext(e)}}const Sj=$k(),cme=()=>{throw new Error("uSES not initialized!")};let xj=cme;const dme=e=>{xj=e},fme=(e,t)=>e===t;function hme(e=lc){const t=e===lc?Sj:$k(e);return function(r,i={}){const{equalityFn:o=fme,stabilityCheck:a=void 0,noopCheck:s=void 0}=typeof i=="function"?{equalityFn:i}:i,{store:l,subscription:u,getServerState:c,stabilityCheck:d,noopCheck:f}=t();I.useRef(!0);const h=I.useCallback({[r.name](m){return r(m)}}[r.name],[r,d,a]),p=xj(u.addNestedSub,l.getState,c||l.getState,h,o);return I.useDebugValue(p),p}}const wj=hme();function x_(){return x_=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x_.apply(this,arguments)}var Cj={exports:{}},vn={};/** @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 hi=typeof Symbol=="function"&&Symbol.for,Dk=hi?Symbol.for("react.element"):60103,Lk=hi?Symbol.for("react.portal"):60106,C2=hi?Symbol.for("react.fragment"):60107,E2=hi?Symbol.for("react.strict_mode"):60108,T2=hi?Symbol.for("react.profiler"):60114,k2=hi?Symbol.for("react.provider"):60109,A2=hi?Symbol.for("react.context"):60110,Fk=hi?Symbol.for("react.async_mode"):60111,P2=hi?Symbol.for("react.concurrent_mode"):60111,I2=hi?Symbol.for("react.forward_ref"):60112,R2=hi?Symbol.for("react.suspense"):60113,pme=hi?Symbol.for("react.suspense_list"):60120,O2=hi?Symbol.for("react.memo"):60115,M2=hi?Symbol.for("react.lazy"):60116,gme=hi?Symbol.for("react.block"):60121,mme=hi?Symbol.for("react.fundamental"):60117,yme=hi?Symbol.for("react.responder"):60118,vme=hi?Symbol.for("react.scope"):60119;function ra(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Dk:switch(e=e.type,e){case Fk:case P2:case C2:case T2:case E2:case R2:return e;default:switch(e=e&&e.$$typeof,e){case A2:case I2:case M2:case O2:case k2:return e;default:return t}}case Lk:return t}}}function Ej(e){return ra(e)===P2}vn.AsyncMode=Fk;vn.ConcurrentMode=P2;vn.ContextConsumer=A2;vn.ContextProvider=k2;vn.Element=Dk;vn.ForwardRef=I2;vn.Fragment=C2;vn.Lazy=M2;vn.Memo=O2;vn.Portal=Lk;vn.Profiler=T2;vn.StrictMode=E2;vn.Suspense=R2;vn.isAsyncMode=function(e){return Ej(e)||ra(e)===Fk};vn.isConcurrentMode=Ej;vn.isContextConsumer=function(e){return ra(e)===A2};vn.isContextProvider=function(e){return ra(e)===k2};vn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Dk};vn.isForwardRef=function(e){return ra(e)===I2};vn.isFragment=function(e){return ra(e)===C2};vn.isLazy=function(e){return ra(e)===M2};vn.isMemo=function(e){return ra(e)===O2};vn.isPortal=function(e){return ra(e)===Lk};vn.isProfiler=function(e){return ra(e)===T2};vn.isStrictMode=function(e){return ra(e)===E2};vn.isSuspense=function(e){return ra(e)===R2};vn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===C2||e===P2||e===T2||e===E2||e===R2||e===pme||typeof e=="object"&&e!==null&&(e.$$typeof===M2||e.$$typeof===O2||e.$$typeof===k2||e.$$typeof===A2||e.$$typeof===I2||e.$$typeof===mme||e.$$typeof===yme||e.$$typeof===vme||e.$$typeof===gme)};vn.typeOf=ra;Cj.exports=vn;var bme=Cj.exports,Tj=bme,_me={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Sme={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},kj={};kj[Tj.ForwardRef]=_me;kj[Tj.Memo]=Sme;var kn={};/**
|
||
* @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 Bk=Symbol.for("react.element"),zk=Symbol.for("react.portal"),N2=Symbol.for("react.fragment"),$2=Symbol.for("react.strict_mode"),D2=Symbol.for("react.profiler"),L2=Symbol.for("react.provider"),F2=Symbol.for("react.context"),xme=Symbol.for("react.server_context"),B2=Symbol.for("react.forward_ref"),z2=Symbol.for("react.suspense"),j2=Symbol.for("react.suspense_list"),U2=Symbol.for("react.memo"),V2=Symbol.for("react.lazy"),wme=Symbol.for("react.offscreen"),Aj;Aj=Symbol.for("react.module.reference");function ka(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Bk:switch(e=e.type,e){case N2:case D2:case $2:case z2:case j2:return e;default:switch(e=e&&e.$$typeof,e){case xme:case F2:case B2:case V2:case U2:case L2:return e;default:return t}}case zk:return t}}}kn.ContextConsumer=F2;kn.ContextProvider=L2;kn.Element=Bk;kn.ForwardRef=B2;kn.Fragment=N2;kn.Lazy=V2;kn.Memo=U2;kn.Portal=zk;kn.Profiler=D2;kn.StrictMode=$2;kn.Suspense=z2;kn.SuspenseList=j2;kn.isAsyncMode=function(){return!1};kn.isConcurrentMode=function(){return!1};kn.isContextConsumer=function(e){return ka(e)===F2};kn.isContextProvider=function(e){return ka(e)===L2};kn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Bk};kn.isForwardRef=function(e){return ka(e)===B2};kn.isFragment=function(e){return ka(e)===N2};kn.isLazy=function(e){return ka(e)===V2};kn.isMemo=function(e){return ka(e)===U2};kn.isPortal=function(e){return ka(e)===zk};kn.isProfiler=function(e){return ka(e)===D2};kn.isStrictMode=function(e){return ka(e)===$2};kn.isSuspense=function(e){return ka(e)===z2};kn.isSuspenseList=function(e){return ka(e)===j2};kn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===N2||e===D2||e===$2||e===z2||e===j2||e===wme||typeof e=="object"&&e!==null&&(e.$$typeof===V2||e.$$typeof===U2||e.$$typeof===L2||e.$$typeof===F2||e.$$typeof===B2||e.$$typeof===Aj||e.getModuleId!==void 0)};kn.typeOf=ka;function Cme(){const e=lme();let t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],i=t;for(;i;)r.push(i),i=i.next;return r},subscribe(r){let i=!0,o=n={callback:r,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){!i||t===null||(i=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}const NR={notify(){},get:()=>[]};function Eme(e,t){let n,r=NR;function i(d){return l(),r.subscribe(d)}function o(){r.notify()}function a(){c.onStateChange&&c.onStateChange()}function s(){return!!n}function l(){n||(n=t?t.addNestedSub(a):e.subscribe(a),r=Cme())}function u(){n&&(n(),n=void 0,r.clear(),r=NR)}const c={addNestedSub:i,notifyNestedSubs:o,handleChangeWrapper:a,isSubscribed:s,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return c}const Tme=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",kme=Tme?I.useLayoutEffect:I.useEffect;function $R(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function w_(e,t){if($R(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!$R(e[n[i]],t[n[i]]))return!1;return!0}function Ame({store:e,context:t,children:n,serverState:r,stabilityCheck:i="once",noopCheck:o="once"}){const a=I.useMemo(()=>{const u=Eme(e);return{store:e,subscription:u,getServerState:r?()=>r:void 0,stabilityCheck:i,noopCheck:o}},[e,r,i,o]),s=I.useMemo(()=>e.getState(),[e]);kme(()=>{const{subscription:u}=a;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),s!==e.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[a,s]);const l=t||lc;return I.createElement(l.Provider,{value:a},n)}function Pj(e=lc){const t=e===lc?Sj:$k(e);return function(){const{store:r}=t();return r}}const Ij=Pj();function Pme(e=lc){const t=e===lc?Ij:Pj(e);return function(){return t().dispatch}}const Rj=Pme();dme(bj.useSyncExternalStoreWithSelector);sme(Vo.unstable_batchedUpdates);var Ime=globalThis&&globalThis.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},Rme=Object.defineProperty,Ome=Object.defineProperties,Mme=Object.getOwnPropertyDescriptors,DR=Object.getOwnPropertySymbols,Nme=Object.prototype.hasOwnProperty,$me=Object.prototype.propertyIsEnumerable,LR=function(e,t,n){return t in e?Rme(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},gl=function(e,t){for(var n in t||(t={}))Nme.call(t,n)&&LR(e,n,t[n]);if(DR)for(var r=0,i=DR(t);r<i.length;r++){var n=i[r];$me.call(t,n)&&LR(e,n,t[n])}return e},F1=function(e,t){return Ome(e,Mme(t))};function FR(e,t,n,r){var i=I.useMemo(function(){return{queryArgs:e,serialized:typeof e=="object"?t({queryArgs:e,endpointDefinition:n,endpointName:r}):e}},[e,t,n,r]),o=I.useRef(i);return I.useEffect(function(){o.current.serialized!==i.serialized&&(o.current=i)},[i]),o.current.serialized===i.serialized?o.current.queryArgs:e}var IC=Symbol();function RC(e){var t=I.useRef(e);return I.useEffect(function(){w_(t.current,e)||(t.current=e)},[e]),w_(t.current,e)?t.current:e}var Ev=WeakMap?new WeakMap:void 0,Dme=function(e){var t=e.endpointName,n=e.queryArgs,r="",i=Ev==null?void 0:Ev.get(n);if(typeof i=="string")r=i;else{var o=JSON.stringify(n,function(a,s){return ss(s)?Object.keys(s).sort().reduce(function(l,u){return l[u]=s[u],l},{}):s});ss(n)&&(Ev==null||Ev.set(n,o)),r=o}return t+"("+r+")"},Lme=typeof window<"u"&&window.document&&window.document.createElement?I.useLayoutEffect:I.useEffect,Fme=function(e){return e},Bme=function(e){return e.isUninitialized?F1(gl({},e),{isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:tr.pending}):e};function zme(e){var t=e.api,n=e.moduleOptions,r=n.batch,i=n.useDispatch,o=n.useSelector,a=n.useStore,s=n.unstable__sideEffectsInRender,l=e.serializeQueryArgs,u=e.context,c=s?function(m){return m()}:I.useEffect;return{buildQueryHooks:h,buildMutationHook:p,usePrefetch:f};function d(m,_,b){if(_!=null&&_.endpointName&&m.isUninitialized){var y=_.endpointName,g=u.endpointDefinitions[y];l({queryArgs:_.originalArgs,endpointDefinition:g,endpointName:y})===l({queryArgs:b,endpointDefinition:g,endpointName:y})&&(_=void 0)}var v=m.isSuccess?m.data:_==null?void 0:_.data;v===void 0&&(v=m.data);var S=v!==void 0,w=m.isLoading,x=!S&&w,C=m.isSuccess||w&&S;return F1(gl({},m),{data:v,currentData:m.data,isFetching:w,isLoading:x,isSuccess:C})}function f(m,_){var b=i(),y=RC(_);return I.useCallback(function(g,v){return b(t.util.prefetch(m,g,gl(gl({},y),v)))},[m,b,y])}function h(m){var _=function(g,v){var S=v===void 0?{}:v,w=S.refetchOnReconnect,x=S.refetchOnFocus,C=S.refetchOnMountOrArgChange,k=S.skip,T=k===void 0?!1:k,P=S.pollingInterval,$=P===void 0?0:P,O=t.endpoints[m].initiate,E=i(),A=FR(T?od:g,Dme,u.endpointDefinitions[m],m),D=RC({refetchOnReconnect:w,refetchOnFocus:x,pollingInterval:$}),L=I.useRef(!1),M=I.useRef(),R=M.current||{},N=R.queryCacheKey,B=R.requestId,U=!1;if(N&&B){var G=E(t.internalActions.internal_probeSubscription({queryCacheKey:N,requestId:B}));U=!!G}var Z=!U&&L.current;return c(function(){L.current=U}),c(function(){Z&&(M.current=void 0)},[Z]),c(function(){var ee,J=M.current;if(typeof process<"u",A===od){J==null||J.unsubscribe(),M.current=void 0;return}var j=(ee=M.current)==null?void 0:ee.subscriptionOptions;if(!J||J.arg!==A){J==null||J.unsubscribe();var Q=E(O(A,{subscriptionOptions:D,forceRefetch:C}));M.current=Q}else D!==j&&J.updateSubscriptionOptions(D)},[E,O,C,A,D,Z]),I.useEffect(function(){return function(){var ee;(ee=M.current)==null||ee.unsubscribe(),M.current=void 0}},[]),I.useMemo(function(){return{refetch:function(){var ee;if(!M.current)throw new Error("Cannot refetch a query that has not been started yet.");return(ee=M.current)==null?void 0:ee.refetch()}}},[])},b=function(g){var v=g===void 0?{}:g,S=v.refetchOnReconnect,w=v.refetchOnFocus,x=v.pollingInterval,C=x===void 0?0:x,k=t.endpoints[m].initiate,T=i(),P=I.useState(IC),$=P[0],O=P[1],E=I.useRef(),A=RC({refetchOnReconnect:S,refetchOnFocus:w,pollingInterval:C});c(function(){var M,R,N=(M=E.current)==null?void 0:M.subscriptionOptions;A!==N&&((R=E.current)==null||R.updateSubscriptionOptions(A))},[A]);var D=I.useRef(A);c(function(){D.current=A},[A]);var L=I.useCallback(function(M,R){R===void 0&&(R=!1);var N;return r(function(){var B;(B=E.current)==null||B.unsubscribe(),E.current=N=T(k(M,{subscriptionOptions:D.current,forceRefetch:!R})),O(M)}),N},[T,k]);return I.useEffect(function(){return function(){var M;(M=E==null?void 0:E.current)==null||M.unsubscribe()}},[]),I.useEffect(function(){$!==IC&&!E.current&&L($,!0)},[$,L]),I.useMemo(function(){return[L,$]},[L,$])},y=function(g,v){var S=v===void 0?{}:v,w=S.skip,x=w===void 0?!1:w,C=S.selectFromResult,k=t.endpoints[m].select,T=FR(x?od:g,l,u.endpointDefinitions[m],m),P=I.useRef(),$=I.useMemo(function(){return Ii([k(T),function(L,M){return M},function(L){return T}],d)},[k,T]),O=I.useMemo(function(){return C?Ii([$],C):$},[$,C]),E=o(function(L){return O(L,P.current)},w_),A=a(),D=$(A.getState(),P.current);return Lme(function(){P.current=D},[D]),E};return{useQueryState:y,useQuerySubscription:_,useLazyQuerySubscription:b,useLazyQuery:function(g){var v=b(g),S=v[0],w=v[1],x=y(w,F1(gl({},g),{skip:w===IC})),C=I.useMemo(function(){return{lastArg:w}},[w]);return I.useMemo(function(){return[S,x,C]},[S,x,C])},useQuery:function(g,v){var S=_(g,v),w=y(g,gl({selectFromResult:g===od||v!=null&&v.skip?void 0:Bme},v)),x=w.data,C=w.status,k=w.isLoading,T=w.isSuccess,P=w.isError,$=w.error;return I.useDebugValue({data:x,status:C,isLoading:k,isSuccess:T,isError:P,error:$}),I.useMemo(function(){return gl(gl({},w),S)},[w,S])}}}function p(m){return function(_){var b=_===void 0?{}:_,y=b.selectFromResult,g=y===void 0?Fme:y,v=b.fixedCacheKey,S=t.endpoints[m],w=S.select,x=S.initiate,C=i(),k=I.useState(),T=k[0],P=k[1];I.useEffect(function(){return function(){T!=null&&T.arg.fixedCacheKey||T==null||T.reset()}},[T]);var $=I.useCallback(function(J){var j=C(x(J,{fixedCacheKey:v}));return P(j),j},[C,x,v]),O=(T||{}).requestId,E=I.useMemo(function(){return Ii([w({fixedCacheKey:v,requestId:T==null?void 0:T.requestId})],g)},[w,T,g,v]),A=o(E,w_),D=v==null?T==null?void 0:T.arg.originalArgs:void 0,L=I.useCallback(function(){r(function(){T&&P(void 0),v&&C(t.internalActions.removeMutationResult({requestId:O,fixedCacheKey:v}))})},[C,v,T,O]),M=A.endpointName,R=A.data,N=A.status,B=A.isLoading,U=A.isSuccess,G=A.isError,Z=A.error;I.useDebugValue({endpointName:M,data:R,status:N,isLoading:B,isSuccess:U,isError:G,error:Z});var ee=I.useMemo(function(){return F1(gl({},A),{originalArgs:D,reset:L})},[A,D,L]);return I.useMemo(function(){return[$,ee]},[$,ee])}}}var C_;(function(e){e.query="query",e.mutation="mutation"})(C_||(C_={}));function jme(e){return e.type===C_.query}function Ume(e){return e.type===C_.mutation}function OC(e){return e.replace(e[0],e[0].toUpperCase())}function Tv(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Object.assign.apply(Object,Ime([e],t))}var Vme=Symbol(),Gme=function(e){var t=e===void 0?{}:e,n=t.batch,r=n===void 0?Vo.unstable_batchedUpdates:n,i=t.useDispatch,o=i===void 0?Rj:i,a=t.useSelector,s=a===void 0?wj:a,l=t.useStore,u=l===void 0?Ij:l,c=t.unstable__sideEffectsInRender,d=c===void 0?!1:c;return{name:Vme,init:function(f,h,p){var m=h.serializeQueryArgs,_=f,b=zme({api:f,moduleOptions:{batch:r,useDispatch:o,useSelector:s,useStore:u,unstable__sideEffectsInRender:d},serializeQueryArgs:m,context:p}),y=b.buildQueryHooks,g=b.buildMutationHook,v=b.usePrefetch;return Tv(_,{usePrefetch:v}),Tv(p,{batch:r}),{injectEndpoint:function(S,w){if(jme(w)){var x=y(S),C=x.useQuery,k=x.useLazyQuery,T=x.useLazyQuerySubscription,P=x.useQueryState,$=x.useQuerySubscription;Tv(_.endpoints[S],{useQuery:C,useLazyQuery:k,useLazyQuerySubscription:T,useQueryState:P,useQuerySubscription:$}),f["use"+OC(S)+"Query"]=C,f["useLazy"+OC(S)+"Query"]=k}else if(Ume(w)){var O=g(S);Tv(_.endpoints[S],{useMutation:O}),f["use"+OC(S)+"Mutation"]=O}}}}}},qme=kge(zge(),Gme());const Hme={"Content-Type":"application/json"},Wme=/\/*$/;function Kme(e={}){const{fetch:t=globalThis.fetch,querySerializer:n,bodySerializer:r,...i}=e;async function o(a,s){const{headers:l,body:u,params:c={},parseAs:d="json",querySerializer:f=n??Qme,bodySerializer:h=r??Xme,...p}=s||{},m=Yme(a,{baseUrl:i.baseUrl,params:c,querySerializer:f}),_=Zme(Hme,e==null?void 0:e.headers,l,c.header),b={redirect:"follow",...i,...p,headers:_};u&&(b.body=h(u)),b.body instanceof FormData&&_.delete("Content-Type");const y=await t(m,b);if(y.status===204||y.headers.get("Content-Length")==="0")return y.ok?{data:{},response:y}:{error:{},response:y};if(y.ok){let v=y.body;if(d!=="stream"){const S=y.clone();v=typeof S[d]=="function"?await S[d]():await S.text()}return{data:v,response:y}}let g={};try{g=await y.clone().json()}catch{g=await y.clone().text()}return{error:g,response:y}}return{async GET(a,s){return o(a,{...s,method:"GET"})},async PUT(a,s){return o(a,{...s,method:"PUT"})},async POST(a,s){return o(a,{...s,method:"POST"})},async DELETE(a,s){return o(a,{...s,method:"DELETE"})},async OPTIONS(a,s){return o(a,{...s,method:"OPTIONS"})},async HEAD(a,s){return o(a,{...s,method:"HEAD"})},async PATCH(a,s){return o(a,{...s,method:"PATCH"})},async TRACE(a,s){return o(a,{...s,method:"TRACE"})}}}function Qme(e){const t=new URLSearchParams;if(e&&typeof e=="object")for(const[n,r]of Object.entries(e))r!=null&&t.set(n,r);return t.toString()}function Xme(e){return JSON.stringify(e)}function Yme(e,t){let n=`${t.baseUrl?t.baseUrl.replace(Wme,""):""}${e}`;if(t.params.path)for(const[r,i]of Object.entries(t.params.path))n=n.replace(`{${r}}`,encodeURIComponent(String(i)));if(t.params.query){const r=t.querySerializer(t.params.query);r&&(n+=`?${r}`)}return n}function Zme(...e){const t=new Headers;for(const n of e){if(!n||typeof n!="object")continue;const r=n instanceof Headers?n.entries():Object.entries(n);for(const[i,o]of r)o===null?t.delete(i):o!==void 0&&t.set(i,o)}return t}const Jh=nl(),s0=nl(),l0=nl();Ele([Jh,s0,l0],(e,t,n)=>Kme({headers:{...e?{Authorization:`Bearer ${e}`}:{},...n?{"project-id":n}:{}},baseUrl:`${t??""}`}));const Jme=["Board","BoardImagesTotal","BoardAssetsTotal","Image","ImageNameList","ImageList","ImageMetadata","ImageMetadataFromFile","Model","SessionQueueItem","SessionQueueItemDTO","SessionQueueItemDTOList","SessionQueueStatus","SessionProcessorStatus","BatchStatus","InvocationCacheStatus"],Mt="LIST",e0e=async(e,t,n)=>{const r=s0.get(),i=Jh.get(),o=l0.get();return _ge({baseUrl:`${r??""}/api/v1`,prepareHeaders:s=>(i&&s.set("Authorization",`Bearer ${i}`),o&&s.set("project-id",o),s)})(e,t,n)},us=qme({baseQuery:e0e,reducerPath:"api",tagTypes:Jme,endpoints:()=>({})}),t0e=(e,t)=>{const n=new Date(e),r=new Date(t);return n>r?1:n<r?-1:0},Oj="%[a-f0-9]{2}",BR=new RegExp("("+Oj+")|([^%]+?)","gi"),zR=new RegExp("("+Oj+")+","gi");function SE(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(e.length===1)return e;t=t||1;const n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],SE(n),SE(r))}function n0e(e){try{return decodeURIComponent(e)}catch{let t=e.match(BR)||[];for(let n=1;n<t.length;n++)e=SE(t,n).join(""),t=e.match(BR)||[];return e}}function r0e(e){const t={"%FE%FF":"<22><>","%FF%FE":"<22><>"};let n=zR.exec(e);for(;n;){try{t[n[0]]=decodeURIComponent(n[0])}catch{const i=n0e(n[0]);i!==n[0]&&(t[n[0]]=i)}n=zR.exec(e)}t["%C2"]="<22>";const r=Object.keys(t);for(const i of r)e=e.replace(new RegExp(i,"g"),t[i]);return e}function i0e(e){if(typeof e!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return decodeURIComponent(e)}catch{return r0e(e)}}function Mj(e,t){if(!(typeof e=="string"&&typeof t=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e===""||t==="")return[];const n=e.indexOf(t);return n===-1?[]:[e.slice(0,n),e.slice(n+t.length)]}function o0e(e,t){const n={};if(Array.isArray(t))for(const r of t){const i=Object.getOwnPropertyDescriptor(e,r);i!=null&&i.enumerable&&Object.defineProperty(n,r,i)}else for(const r of Reflect.ownKeys(e)){const i=Object.getOwnPropertyDescriptor(e,r);if(i.enumerable){const o=e[r];t(r,o,e)&&Object.defineProperty(n,r,i)}}return n}const a0e=e=>e==null,s0e=e=>encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`),xE=Symbol("encodeFragmentIdentifier");function l0e(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const i=n.length;return r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[Nr(t,e),"[",i,"]"].join("")]:[...n,[Nr(t,e),"[",Nr(i,e),"]=",Nr(r,e)].join("")]};case"bracket":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[Nr(t,e),"[]"].join("")]:[...n,[Nr(t,e),"[]=",Nr(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,[Nr(t,e),":list="].join("")]:[...n,[Nr(t,e),":list=",Nr(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t=e.arrayFormat==="bracket-separator"?"[]=":"=";return n=>(r,i)=>i===void 0||e.skipNull&&i===null||e.skipEmptyString&&i===""?r:(i=i===null?"":i,r.length===0?[[Nr(n,e),t,Nr(i,e)].join("")]:[[r,Nr(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>r===void 0||e.skipNull&&r===null||e.skipEmptyString&&r===""?n:r===null?[...n,Nr(t,e)]:[...n,[Nr(t,e),"=",Nr(r,e)].join("")]}}function u0e(e){let t;switch(e.arrayFormat){case"index":return(n,r,i)=>{if(t=/\[(\d*)]$/.exec(n),n=n.replace(/\[\d*]$/,""),!t){i[n]=r;return}i[n]===void 0&&(i[n]={}),i[n][t[1]]=r};case"bracket":return(n,r,i)=>{if(t=/(\[])$/.exec(n),n=n.replace(/\[]$/,""),!t){i[n]=r;return}if(i[n]===void 0){i[n]=[r];return}i[n]=[...i[n],r]};case"colon-list-separator":return(n,r,i)=>{if(t=/(:list)$/.exec(n),n=n.replace(/:list$/,""),!t){i[n]=r;return}if(i[n]===void 0){i[n]=[r];return}i[n]=[...i[n],r]};case"comma":case"separator":return(n,r,i)=>{const o=typeof r=="string"&&r.includes(e.arrayFormatSeparator),a=typeof r=="string"&&!o&&xl(r,e).includes(e.arrayFormatSeparator);r=a?xl(r,e):r;const s=o||a?r.split(e.arrayFormatSeparator).map(l=>xl(l,e)):r===null?r:xl(r,e);i[n]=s};case"bracket-separator":return(n,r,i)=>{const o=/(\[])$/.test(n);if(n=n.replace(/\[]$/,""),!o){i[n]=r&&xl(r,e);return}const a=r===null?[]:r.split(e.arrayFormatSeparator).map(s=>xl(s,e));if(i[n]===void 0){i[n]=a;return}i[n]=[...i[n],...a]};default:return(n,r,i)=>{if(i[n]===void 0){i[n]=r;return}i[n]=[...[i[n]].flat(),r]}}}function Nj(e){if(typeof e!="string"||e.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function Nr(e,t){return t.encode?t.strict?s0e(e):encodeURIComponent(e):e}function xl(e,t){return t.decode?i0e(e):e}function $j(e){return Array.isArray(e)?e.sort():typeof e=="object"?$j(Object.keys(e)).sort((t,n)=>Number(t)-Number(n)).map(t=>e[t]):e}function Dj(e){const t=e.indexOf("#");return t!==-1&&(e=e.slice(0,t)),e}function c0e(e){let t="";const n=e.indexOf("#");return n!==-1&&(t=e.slice(n)),t}function jR(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&typeof e=="string"&&e.trim()!==""?e=Number(e):t.parseBooleans&&e!==null&&(e.toLowerCase()==="true"||e.toLowerCase()==="false")&&(e=e.toLowerCase()==="true"),e}function jk(e){e=Dj(e);const t=e.indexOf("?");return t===-1?"":e.slice(t+1)}function Uk(e,t){t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...t},Nj(t.arrayFormatSeparator);const n=u0e(t),r=Object.create(null);if(typeof e!="string"||(e=e.trim().replace(/^[?#&]/,""),!e))return r;for(const i of e.split("&")){if(i==="")continue;const o=t.decode?i.replace(/\+/g," "):i;let[a,s]=Mj(o,"=");a===void 0&&(a=o),s=s===void 0?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:xl(s,t),n(xl(a,t),s,r)}for(const[i,o]of Object.entries(r))if(typeof o=="object"&&o!==null)for(const[a,s]of Object.entries(o))o[a]=jR(s,t);else r[i]=jR(o,t);return t.sort===!1?r:(t.sort===!0?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce((i,o)=>{const a=r[o];return a&&typeof a=="object"&&!Array.isArray(a)?i[o]=$j(a):i[o]=a,i},Object.create(null))}function Lj(e,t){if(!e)return"";t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t},Nj(t.arrayFormatSeparator);const n=a=>t.skipNull&&a0e(e[a])||t.skipEmptyString&&e[a]==="",r=l0e(t),i={};for(const[a,s]of Object.entries(e))n(a)||(i[a]=s);const o=Object.keys(i);return t.sort!==!1&&o.sort(t.sort),o.map(a=>{const s=e[a];return s===void 0?"":s===null?Nr(a,t):Array.isArray(s)?s.length===0&&t.arrayFormat==="bracket-separator"?Nr(a,t)+"[]":s.reduce(r(a),[]).join("&"):Nr(a,t)+"="+Nr(s,t)}).filter(a=>a.length>0).join("&")}function Fj(e,t){var i;t={decode:!0,...t};let[n,r]=Mj(e,"#");return n===void 0&&(n=e),{url:((i=n==null?void 0:n.split("?"))==null?void 0:i[0])??"",query:Uk(jk(e),t),...t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:xl(r,t)}:{}}}function Bj(e,t){t={encode:!0,strict:!0,[xE]:!0,...t};const n=Dj(e.url).split("?")[0]||"",r=jk(e.url),i={...Uk(r,{sort:!1}),...e.query};let o=Lj(i,t);o&&(o=`?${o}`);let a=c0e(e.url);if(e.fragmentIdentifier){const s=new URL(n);s.hash=e.fragmentIdentifier,a=t[xE]?s.hash:`#${e.fragmentIdentifier}`}return`${n}${o}${a}`}function zj(e,t,n){n={parseFragmentIdentifier:!0,[xE]:!1,...n};const{url:r,query:i,fragmentIdentifier:o}=Fj(e,n);return Bj({url:r,query:o0e(i,t),fragmentIdentifier:o},n)}function d0e(e,t,n){const r=Array.isArray(t)?i=>!t.includes(i):(i,o)=>!t(i,o);return zj(e,r,n)}const Qg=Object.freeze(Object.defineProperty({__proto__:null,exclude:d0e,extract:jk,parse:Uk,parseUrl:Fj,pick:zj,stringify:Lj,stringifyUrl:Bj},Symbol.toStringTag,{value:"Module"})),Mc=(e,t)=>{if(!e)return!1;const n=u0.selectAll(e);if(n.length<=1)return!0;const r=[],i=[];for(let o=0;o<n.length;o++){const a=n[o];a!=null&&a.starred&&r.push(a),a!=null&&a.starred||i.push(a)}if(t.starred){const o=r[r.length-1];if(!o)return!0;const a=new Date(t.created_at),s=new Date(o.created_at);return a>=s}else{const o=i[i.length-1];if(!o)return!1;const a=new Date(t.created_at),s=new Date(o.created_at);return a>=s}},sa=e=>oi.includes(e.image_category)?oi:Ji,Gn=ds({selectId:e=>e.image_name,sortComparer:(e,t)=>e.starred&&!t.starred?-1:!e.starred&&t.starred?1:t0e(t.created_at,e.created_at)}),u0=Gn.getSelectors(),zo=e=>`images/?${Qg.stringify(e,{arrayFormat:"none"})}`,Ft=us.injectEndpoints({endpoints:e=>({listBoards:e.query({query:t=>({url:"boards/",params:t}),providesTags:t=>{const n=[{type:"Board",id:Mt}];return t&&n.push(...t.items.map(({board_id:r})=>({type:"Board",id:r}))),n}}),listAllBoards:e.query({query:()=>({url:"boards/",params:{all:!0}}),providesTags:t=>{const n=[{type:"Board",id:Mt}];return t&&n.push(...t.map(({board_id:r})=>({type:"Board",id:r}))),n}}),listAllImageNamesForBoard:e.query({query:t=>({url:`boards/${t}/image_names`}),providesTags:(t,n,r)=>[{type:"ImageNameList",id:r}],keepUnusedDataFor:0}),getBoardImagesTotal:e.query({query:t=>({url:zo({board_id:t??"none",categories:oi,is_intermediate:!1,limit:0,offset:0}),method:"GET"}),providesTags:(t,n,r)=>[{type:"BoardImagesTotal",id:r??"none"}],transformResponse:t=>({total:t.total})}),getBoardAssetsTotal:e.query({query:t=>({url:zo({board_id:t??"none",categories:Ji,is_intermediate:!1,limit:0,offset:0}),method:"GET"}),providesTags:(t,n,r)=>[{type:"BoardAssetsTotal",id:r??"none"}],transformResponse:t=>({total:t.total})}),createBoard:e.mutation({query:t=>({url:"boards/",method:"POST",params:{board_name:t}}),invalidatesTags:[{type:"Board",id:Mt}]}),updateBoard:e.mutation({query:({board_id:t,changes:n})=>({url:`boards/${t}`,method:"PATCH",body:n}),invalidatesTags:(t,n,r)=>[{type:"Board",id:r.board_id}]})})}),{useListBoardsQuery:MGe,useListAllBoardsQuery:NGe,useGetBoardImagesTotalQuery:$Ge,useGetBoardAssetsTotalQuery:DGe,useCreateBoardMutation:LGe,useUpdateBoardMutation:FGe,useListAllImageNamesForBoardQuery:BGe}=Ft,ve=us.injectEndpoints({endpoints:e=>({listImages:e.query({query:t=>({url:zo(t),method:"GET"}),providesTags:(t,n,{board_id:r,categories:i})=>[{type:"ImageList",id:zo({board_id:r,categories:i})}],serializeQueryArgs:({queryArgs:t})=>{const{board_id:n,categories:r}=t;return zo({board_id:n,categories:r})},transformResponse(t){const{items:n}=t;return Gn.addMany(Gn.getInitialState(),n)},merge:(t,n)=>{Gn.addMany(t,u0.selectAll(n))},forceRefetch({currentArg:t,previousArg:n}){return(t==null?void 0:t.offset)!==(n==null?void 0:n.offset)},async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r;u0.selectAll(i).forEach(o=>{n(ve.util.upsertQueryData("getImageDTO",o.image_name,o))})}catch{}},keepUnusedDataFor:86400}),getIntermediatesCount:e.query({query:()=>({url:zo({is_intermediate:!0})}),providesTags:["IntermediatesCount"],transformResponse:t=>t.total}),getImageDTO:e.query({query:t=>({url:`images/i/${t}`}),providesTags:(t,n,r)=>[{type:"Image",id:r}],keepUnusedDataFor:86400}),getImageMetadata:e.query({query:t=>({url:`images/i/${t}/metadata`}),providesTags:(t,n,r)=>[{type:"ImageMetadata",id:r}],keepUnusedDataFor:86400}),getImageMetadataFromFile:e.query({queryFn:async(t,n,r,i)=>{var o;if(t.shouldFetchMetadataFromApi){let a;const s=await i(`images/i/${t.image.image_name}/metadata`);if(s.data){const l=UB.safeParse((o=s.data)==null?void 0:o.metadata);l.success&&(a=l.data)}return{data:{metadata:a}}}else{const a=Jh.get(),s=l0.get(),u=await ble.fetchBaseQuery({baseUrl:"",prepareHeaders:d=>(a&&d.set("Authorization",`Bearer ${a}`),s&&d.set("project-id",s),d),responseHandler:async d=>await d.blob()})(t.image.image_url,n,r);return{data:await sge(u.data)}}},providesTags:(t,n,{image:r})=>[{type:"ImageMetadataFromFile",id:r.image_name}],keepUnusedDataFor:86400}),clearIntermediates:e.mutation({query:()=>({url:"images/clear-intermediates",method:"POST"}),invalidatesTags:["IntermediatesCount"]}),deleteImage:e.mutation({query:({image_name:t})=>({url:`images/i/${t}`,method:"DELETE"}),async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){const{image_name:i,board_id:o}=t,a=Ji.includes(t.image_category),s={board_id:o??"none",categories:sa(t)},l=[];l.push(n(ve.util.updateQueryData("listImages",s,u=>{Gn.removeOne(u,i)}))),l.push(n(Ft.util.updateQueryData(a?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",u=>{u.total=Math.max(u.total-1,0)})));try{await r}catch{l.forEach(u=>{u.undo()})}}}),deleteImages:e.mutation({query:({imageDTOs:t})=>({url:"images/delete",method:"POST",body:{image_names:t.map(r=>r.image_name)}}),async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r,o=gk(t,"image_name");i.deleted_images.forEach(a=>{const s=o[a];if(s){const l={board_id:s.board_id??"none",categories:sa(s)};n(ve.util.updateQueryData("listImages",l,c=>{Gn.removeOne(c,a)}));const u=Ji.includes(s.image_category);n(Ft.util.updateQueryData(u?"getBoardAssetsTotal":"getBoardImagesTotal",s.board_id??"none",c=>{c.total=Math.max(c.total-1,0)}))}})}catch{}}}),changeImageIsIntermediate:e.mutation({query:({imageDTO:t,is_intermediate:n})=>({url:`images/i/${t.image_name}`,method:"PATCH",body:{is_intermediate:n}}),async onQueryStarted({imageDTO:t,is_intermediate:n},{dispatch:r,queryFulfilled:i,getState:o}){const a=[];a.push(r(ve.util.updateQueryData("getImageDTO",t.image_name,u=>{Object.assign(u,{is_intermediate:n})})));const s=sa(t),l=Ji.includes(t.image_category);if(n)a.push(r(ve.util.updateQueryData("listImages",{board_id:t.board_id??"none",categories:s},u=>{Gn.removeOne(u,t.image_name)}))),a.push(r(Ft.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",u=>{u.total=Math.max(u.total-1,0)})));else{a.push(r(Ft.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",p=>{p.total+=1})));const u={board_id:t.board_id??"none",categories:s},c=ve.endpoints.listImages.select(u)(o()),{data:d}=oi.includes(t.image_category)?Ft.endpoints.getBoardImagesTotal.select(t.board_id??"none")(o()):Ft.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(o()),f=c.data&&c.data.ids.length>=((d==null?void 0:d.total)??0),h=Mc(c.data,t);(f||h)&&a.push(r(ve.util.updateQueryData("listImages",u,p=>{Gn.upsertOne(p,t)})))}try{await i}catch{a.forEach(u=>u.undo())}}}),changeImageSessionId:e.mutation({query:({imageDTO:t,session_id:n})=>({url:`images/i/${t.image_name}`,method:"PATCH",body:{session_id:n}}),async onQueryStarted({imageDTO:t,session_id:n},{dispatch:r,queryFulfilled:i}){const o=[];o.push(r(ve.util.updateQueryData("getImageDTO",t.image_name,a=>{Object.assign(a,{session_id:n})})));try{await i}catch{o.forEach(a=>a.undo())}}}),starImages:e.mutation({query:({imageDTOs:t})=>({url:"images/star",method:"POST",body:{image_names:t.map(n=>n.image_name)}}),invalidatesTags:(t,n,{imageDTOs:r})=>{if(r[0]){const i=sa(r[0]),o=r[0].board_id;return[{type:"ImageList",id:zo({board_id:o,categories:i})},{type:"Board",id:o}]}return[]},async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r,getState:i}){try{const{data:o}=await r,a=t.filter(u=>o.updated_image_names.includes(u.image_name));if(!a[0])return;const s=sa(a[0]),l=a[0].board_id;a.forEach(u=>{const{image_name:c}=u;n(ve.util.updateQueryData("getImageDTO",c,_=>{_.starred=!0}));const d={board_id:l??"none",categories:s},f=ve.endpoints.listImages.select(d)(i()),{data:h}=oi.includes(u.image_category)?Ft.endpoints.getBoardImagesTotal.select(l??"none")(i()):Ft.endpoints.getBoardAssetsTotal.select(l??"none")(i()),p=f.data&&f.data.ids.length>=((h==null?void 0:h.total)??0),m=((h==null?void 0:h.total)??0)>=hv?Mc(f.data,u):!0;(p||m)&&n(ve.util.updateQueryData("listImages",d,_=>{Gn.upsertOne(_,{...u,starred:!0})}))})}catch{}}}),unstarImages:e.mutation({query:({imageDTOs:t})=>({url:"images/unstar",method:"POST",body:{image_names:t.map(n=>n.image_name)}}),invalidatesTags:(t,n,{imageDTOs:r})=>{if(r[0]){const i=sa(r[0]),o=r[0].board_id;return[{type:"ImageList",id:zo({board_id:o,categories:i})},{type:"Board",id:o}]}return[]},async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r,getState:i}){try{const{data:o}=await r,a=t.filter(u=>o.updated_image_names.includes(u.image_name));if(!a[0])return;const s=sa(a[0]),l=a[0].board_id;a.forEach(u=>{const{image_name:c}=u;n(ve.util.updateQueryData("getImageDTO",c,_=>{_.starred=!1}));const d={board_id:l??"none",categories:s},f=ve.endpoints.listImages.select(d)(i()),{data:h}=oi.includes(u.image_category)?Ft.endpoints.getBoardImagesTotal.select(l??"none")(i()):Ft.endpoints.getBoardAssetsTotal.select(l??"none")(i()),p=f.data&&f.data.ids.length>=((h==null?void 0:h.total)??0),m=((h==null?void 0:h.total)??0)>=hv?Mc(f.data,u):!0;(p||m)&&n(ve.util.updateQueryData("listImages",d,_=>{Gn.upsertOne(_,{...u,starred:!1})}))})}catch{}}}),uploadImage:e.mutation({query:({file:t,image_category:n,is_intermediate:r,session_id:i,board_id:o,crop_visible:a})=>{const s=new FormData;return s.append("file",t),{url:"images/upload",method:"POST",body:s,params:{image_category:n,is_intermediate:r,session_id:i,board_id:o==="none"?void 0:o,crop_visible:a}}},async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r;if(i.is_intermediate)return;n(ve.util.upsertQueryData("getImageDTO",i.image_name,i));const o=sa(i);n(ve.util.updateQueryData("listImages",{board_id:i.board_id??"none",categories:o},a=>{Gn.addOne(a,i)})),n(Ft.util.updateQueryData("getBoardAssetsTotal",i.board_id??"none",a=>{a.total+=1}))}catch{}}}),deleteBoard:e.mutation({query:t=>({url:`boards/${t}`,method:"DELETE"}),invalidatesTags:()=>[{type:"Board",id:Mt},{type:"ImageList",id:zo({board_id:"none",categories:oi})},{type:"ImageList",id:zo({board_id:"none",categories:Ji})}],async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r,{deleted_board_images:o}=i;o.forEach(l=>{n(ve.util.updateQueryData("getImageDTO",l,u=>{u.board_id=void 0}))}),n(Ft.util.updateQueryData("getBoardAssetsTotal",t,l=>{l.total=0})),n(Ft.util.updateQueryData("getBoardImagesTotal",t,l=>{l.total=0}));const a=[{categories:oi},{categories:Ji}],s=o.map(l=>({id:l,changes:{board_id:void 0}}));a.forEach(l=>{n(ve.util.updateQueryData("listImages",l,u=>{Gn.updateMany(u,s)}))})}catch{}}}),deleteBoardAndImages:e.mutation({query:t=>({url:`boards/${t}`,method:"DELETE",params:{include_images:!0}}),invalidatesTags:()=>[{type:"Board",id:Mt},{type:"ImageList",id:zo({board_id:"none",categories:oi})},{type:"ImageList",id:zo({board_id:"none",categories:Ji})}],async onQueryStarted(t,{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r,{deleted_images:o}=i;[{categories:oi},{categories:Ji}].forEach(s=>{n(ve.util.updateQueryData("listImages",s,l=>{Gn.removeMany(l,o)}))}),n(Ft.util.updateQueryData("getBoardAssetsTotal",t,s=>{s.total=0})),n(Ft.util.updateQueryData("getBoardImagesTotal",t,s=>{s.total=0}))}catch{}}}),addImageToBoard:e.mutation({query:({board_id:t,imageDTO:n})=>{const{image_name:r}=n;return{url:"board_images/",method:"POST",body:{board_id:t,image_name:r}}},invalidatesTags:(t,n,{board_id:r})=>[{type:"Board",id:r}],async onQueryStarted({board_id:t,imageDTO:n},{dispatch:r,queryFulfilled:i,getState:o}){const a=[],s=sa(n),l=Ji.includes(n.image_category);if(a.push(r(ve.util.updateQueryData("getImageDTO",n.image_name,u=>{u.board_id=t}))),!n.is_intermediate){a.push(r(ve.util.updateQueryData("listImages",{board_id:n.board_id??"none",categories:s},p=>{Gn.removeOne(p,n.image_name)}))),a.push(r(Ft.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",n.board_id??"none",p=>{p.total=Math.max(p.total-1,0)}))),a.push(r(Ft.util.updateQueryData(l?"getBoardAssetsTotal":"getBoardImagesTotal",t??"none",p=>{p.total+=1})));const u={board_id:t??"none",categories:s},c=ve.endpoints.listImages.select(u)(o()),{data:d}=oi.includes(n.image_category)?Ft.endpoints.getBoardImagesTotal.select(n.board_id??"none")(o()):Ft.endpoints.getBoardAssetsTotal.select(n.board_id??"none")(o()),f=c.data&&c.data.ids.length>=((d==null?void 0:d.total)??0),h=Mc(c.data,n);(f||h)&&a.push(r(ve.util.updateQueryData("listImages",u,p=>{Gn.addOne(p,n)})))}try{await i}catch{a.forEach(u=>u.undo())}}}),removeImageFromBoard:e.mutation({query:({imageDTO:t})=>{const{image_name:n}=t;return{url:"board_images/",method:"DELETE",body:{image_name:n}}},invalidatesTags:(t,n,{imageDTO:r})=>{const{board_id:i}=r;return[{type:"Board",id:i??"none"}]},async onQueryStarted({imageDTO:t},{dispatch:n,queryFulfilled:r,getState:i}){const o=sa(t),a=[],s=Ji.includes(t.image_category);a.push(n(ve.util.updateQueryData("getImageDTO",t.image_name,h=>{h.board_id=void 0}))),a.push(n(ve.util.updateQueryData("listImages",{board_id:t.board_id??"none",categories:o},h=>{Gn.removeOne(h,t.image_name)}))),a.push(n(Ft.util.updateQueryData(s?"getBoardAssetsTotal":"getBoardImagesTotal",t.board_id??"none",h=>{h.total=Math.max(h.total-1,0)}))),a.push(n(Ft.util.updateQueryData(s?"getBoardAssetsTotal":"getBoardImagesTotal","none",h=>{h.total+=1})));const l={board_id:"none",categories:o},u=ve.endpoints.listImages.select(l)(i()),{data:c}=oi.includes(t.image_category)?Ft.endpoints.getBoardImagesTotal.select(t.board_id??"none")(i()):Ft.endpoints.getBoardAssetsTotal.select(t.board_id??"none")(i()),d=u.data&&u.data.ids.length>=((c==null?void 0:c.total)??0),f=Mc(u.data,t);(d||f)&&a.push(n(ve.util.updateQueryData("listImages",l,h=>{Gn.upsertOne(h,t)})));try{await r}catch{a.forEach(h=>h.undo())}}}),addImagesToBoard:e.mutation({query:({board_id:t,imageDTOs:n})=>({url:"board_images/batch",method:"POST",body:{image_names:n.map(r=>r.image_name),board_id:t}}),invalidatesTags:(t,n,{board_id:r})=>[{type:"Board",id:r??"none"}],async onQueryStarted({board_id:t,imageDTOs:n},{dispatch:r,queryFulfilled:i,getState:o}){try{const{data:a}=await i,{added_image_names:s}=a;s.forEach(l=>{r(ve.util.updateQueryData("getImageDTO",l,y=>{y.board_id=t==="none"?void 0:t}));const u=n.find(y=>y.image_name===l);if(!u)return;const c=sa(u),d=u.board_id,f=Ji.includes(u.image_category);r(ve.util.updateQueryData("listImages",{board_id:d??"none",categories:c},y=>{Gn.removeOne(y,u.image_name)})),r(Ft.util.updateQueryData(f?"getBoardAssetsTotal":"getBoardImagesTotal",d??"none",y=>{y.total=Math.max(y.total-1,0)})),r(Ft.util.updateQueryData(f?"getBoardAssetsTotal":"getBoardImagesTotal",t??"none",y=>{y.total+=1}));const h={board_id:t,categories:c},p=ve.endpoints.listImages.select(h)(o()),{data:m}=oi.includes(u.image_category)?Ft.endpoints.getBoardImagesTotal.select(t??"none")(o()):Ft.endpoints.getBoardAssetsTotal.select(t??"none")(o()),_=p.data&&p.data.ids.length>=((m==null?void 0:m.total)??0),b=((m==null?void 0:m.total)??0)>=hv?Mc(p.data,u):!0;(_||b)&&r(ve.util.updateQueryData("listImages",h,y=>{Gn.upsertOne(y,{...u,board_id:t})}))})}catch{}}}),removeImagesFromBoard:e.mutation({query:({imageDTOs:t})=>({url:"board_images/batch/delete",method:"POST",body:{image_names:t.map(n=>n.image_name)}}),invalidatesTags:(t,n,{imageDTOs:r})=>{const i=[],o=[];return t==null||t.removed_image_names.forEach(a=>{var l;const s=(l=r.find(u=>u.image_name===a))==null?void 0:l.board_id;!s||i.includes(s)||o.push({type:"Board",id:s})}),o},async onQueryStarted({imageDTOs:t},{dispatch:n,queryFulfilled:r,getState:i}){try{const{data:o}=await r,{removed_image_names:a}=o;a.forEach(s=>{n(ve.util.updateQueryData("getImageDTO",s,_=>{_.board_id=void 0}));const l=t.find(_=>_.image_name===s);if(!l)return;const u=sa(l),c=Ji.includes(l.image_category);n(ve.util.updateQueryData("listImages",{board_id:l.board_id??"none",categories:u},_=>{Gn.removeOne(_,l.image_name)})),n(Ft.util.updateQueryData(c?"getBoardAssetsTotal":"getBoardImagesTotal",l.board_id??"none",_=>{_.total=Math.max(_.total-1,0)})),n(Ft.util.updateQueryData(c?"getBoardAssetsTotal":"getBoardImagesTotal","none",_=>{_.total+=1}));const d={board_id:"none",categories:u},f=ve.endpoints.listImages.select(d)(i()),{data:h}=oi.includes(l.image_category)?Ft.endpoints.getBoardImagesTotal.select(l.board_id??"none")(i()):Ft.endpoints.getBoardAssetsTotal.select(l.board_id??"none")(i()),p=f.data&&f.data.ids.length>=((h==null?void 0:h.total)??0),m=((h==null?void 0:h.total)??0)>=hv?Mc(f.data,l):!0;(p||m)&&n(ve.util.updateQueryData("listImages",d,_=>{Gn.upsertOne(_,{...l,board_id:"none"})}))})}catch{}}})})}),{useGetIntermediatesCountQuery:zGe,useListImagesQuery:jGe,useLazyListImagesQuery:UGe,useGetImageDTOQuery:VGe,useGetImageMetadataQuery:GGe,useDeleteImageMutation:qGe,useDeleteImagesMutation:HGe,useUploadImageMutation:WGe,useClearIntermediatesMutation:KGe,useAddImagesToBoardMutation:QGe,useRemoveImagesFromBoardMutation:XGe,useAddImageToBoardMutation:YGe,useRemoveImageFromBoardMutation:ZGe,useChangeImageIsIntermediateMutation:JGe,useChangeImageSessionIdMutation:eqe,useDeleteBoardAndImagesMutation:tqe,useDeleteBoardMutation:nqe,useStarImagesMutation:rqe,useUnstarImagesMutation:iqe,useGetImageMetadataFromFileQuery:oqe}=ve,jj=Ne("socket/socketConnected"),Vk=Ne("socket/appSocketConnected"),Uj=Ne("socket/socketDisconnected"),Vj=Ne("socket/appSocketDisconnected"),f0e=Ne("socket/socketSubscribedSession"),h0e=Ne("socket/appSocketSubscribedSession"),p0e=Ne("socket/socketUnsubscribedSession"),g0e=Ne("socket/appSocketUnsubscribedSession"),Gj=Ne("socket/socketInvocationStarted"),Gk=Ne("socket/appSocketInvocationStarted"),qk=Ne("socket/socketInvocationComplete"),Hk=Ne("socket/appSocketInvocationComplete"),qj=Ne("socket/socketInvocationError"),G2=Ne("socket/appSocketInvocationError"),Hj=Ne("socket/socketGraphExecutionStateComplete"),Wj=Ne("socket/appSocketGraphExecutionStateComplete"),Kj=Ne("socket/socketGeneratorProgress"),Wk=Ne("socket/appSocketGeneratorProgress"),Qj=Ne("socket/socketModelLoadStarted"),Xj=Ne("socket/appSocketModelLoadStarted"),Yj=Ne("socket/socketModelLoadCompleted"),Zj=Ne("socket/appSocketModelLoadCompleted"),Jj=Ne("socket/socketSessionRetrievalError"),eU=Ne("socket/appSocketSessionRetrievalError"),tU=Ne("socket/socketInvocationRetrievalError"),nU=Ne("socket/appSocketInvocationRetrievalError"),rU=Ne("socket/socketQueueItemStatusChanged"),Kk=Ne("socket/appSocketQueueItemStatusChanged"),Qk=Ne("controlNet/imageProcessed"),Ef={none:{type:"none",get label(){return be.t("controlnet.none")},get description(){return be.t("controlnet.noneDescription")},default:{type:"none"}},canny_image_processor:{type:"canny_image_processor",get label(){return be.t("controlnet.canny")},get description(){return be.t("controlnet.cannyDescription")},default:{id:"canny_image_processor",type:"canny_image_processor",low_threshold:100,high_threshold:200}},color_map_image_processor:{type:"color_map_image_processor",get label(){return be.t("controlnet.colorMap")},get description(){return be.t("controlnet.colorMapDescription")},default:{id:"color_map_image_processor",type:"color_map_image_processor",color_map_tile_size:64}},content_shuffle_image_processor:{type:"content_shuffle_image_processor",get label(){return be.t("controlnet.contentShuffle")},get description(){return be.t("controlnet.contentShuffleDescription")},default:{id:"content_shuffle_image_processor",type:"content_shuffle_image_processor",detect_resolution:512,image_resolution:512,h:512,w:512,f:256}},hed_image_processor:{type:"hed_image_processor",get label(){return be.t("controlnet.hed")},get description(){return be.t("controlnet.hedDescription")},default:{id:"hed_image_processor",type:"hed_image_processor",detect_resolution:512,image_resolution:512,scribble:!1}},lineart_anime_image_processor:{type:"lineart_anime_image_processor",get label(){return be.t("controlnet.lineartAnime")},get description(){return be.t("controlnet.lineartAnimeDescription")},default:{id:"lineart_anime_image_processor",type:"lineart_anime_image_processor",detect_resolution:512,image_resolution:512}},lineart_image_processor:{type:"lineart_image_processor",get label(){return be.t("controlnet.lineart")},get description(){return be.t("controlnet.lineartDescription")},default:{id:"lineart_image_processor",type:"lineart_image_processor",detect_resolution:512,image_resolution:512,coarse:!1}},mediapipe_face_processor:{type:"mediapipe_face_processor",get label(){return be.t("controlnet.mediapipeFace")},get description(){return be.t("controlnet.mediapipeFaceDescription")},default:{id:"mediapipe_face_processor",type:"mediapipe_face_processor",max_faces:1,min_confidence:.5}},midas_depth_image_processor:{type:"midas_depth_image_processor",get label(){return be.t("controlnet.depthMidas")},get description(){return be.t("controlnet.depthMidasDescription")},default:{id:"midas_depth_image_processor",type:"midas_depth_image_processor",a_mult:2,bg_th:.1}},mlsd_image_processor:{type:"mlsd_image_processor",get label(){return be.t("controlnet.mlsd")},get description(){return be.t("controlnet.mlsdDescription")},default:{id:"mlsd_image_processor",type:"mlsd_image_processor",detect_resolution:512,image_resolution:512,thr_d:.1,thr_v:.1}},normalbae_image_processor:{type:"normalbae_image_processor",get label(){return be.t("controlnet.normalBae")},get description(){return be.t("controlnet.normalBaeDescription")},default:{id:"normalbae_image_processor",type:"normalbae_image_processor",detect_resolution:512,image_resolution:512}},openpose_image_processor:{type:"openpose_image_processor",get label(){return be.t("controlnet.openPose")},get description(){return be.t("controlnet.openPoseDescription")},default:{id:"openpose_image_processor",type:"openpose_image_processor",detect_resolution:512,image_resolution:512,hand_and_face:!1}},pidi_image_processor:{type:"pidi_image_processor",get label(){return be.t("controlnet.pidi")},get description(){return be.t("controlnet.pidiDescription")},default:{id:"pidi_image_processor",type:"pidi_image_processor",detect_resolution:512,image_resolution:512,scribble:!1,safe:!1}},zoe_depth_image_processor:{type:"zoe_depth_image_processor",get label(){return be.t("controlnet.depthZoe")},get description(){return be.t("controlnet.depthZoeDescription")},default:{id:"zoe_depth_image_processor",type:"zoe_depth_image_processor"}}},kv={canny:"canny_image_processor",mlsd:"mlsd_image_processor",depth:"midas_depth_image_processor",bae:"normalbae_image_processor",lineart:"lineart_image_processor",lineart_anime:"lineart_anime_image_processor",softedge:"hed_image_processor",shuffle:"content_shuffle_image_processor",openpose:"openpose_image_processor",mediapipe:"mediapipe_face_processor",pidi:"pidi_image_processor",zoe:"zoe_depth_image_processor",color:"color_map_image_processor"},UR={isEnabled:!0,model:null,weight:1,beginStepPct:0,endStepPct:1,controlMode:"balanced",resizeMode:"just_resize",controlImage:null,processedControlImage:null,processorType:"canny_image_processor",processorNode:Ef.canny_image_processor.default,shouldAutoConfig:!0},iU={adapterImage:null,model:null,weight:1,beginStepPct:0,endStepPct:1},wE={controlNets:{},isEnabled:!1,pendingControlImages:[],isIPAdapterEnabled:!1,ipAdapterInfo:{...iU}},oU=rr({name:"controlNet",initialState:wE,reducers:{isControlNetEnabledToggled:e=>{e.isEnabled=!e.isEnabled},controlNetEnabled:e=>{e.isEnabled=!0},controlNetAdded:(e,t)=>{const{controlNetId:n,controlNet:r}=t.payload;e.controlNets[n]={...r??UR,controlNetId:n}},controlNetRecalled:(e,t)=>{const n=t.payload;e.controlNets[n.controlNetId]={...n}},controlNetDuplicated:(e,t)=>{const{sourceControlNetId:n,newControlNetId:r}=t.payload,i=e.controlNets[n];if(!i)return;const o=Cn(i);o.controlNetId=r,e.controlNets[r]=o},controlNetAddedFromImage:(e,t)=>{const{controlNetId:n,controlImage:r}=t.payload;e.controlNets[n]={...UR,controlNetId:n,controlImage:r}},controlNetRemoved:(e,t)=>{const{controlNetId:n}=t.payload;delete e.controlNets[n]},controlNetIsEnabledChanged:(e,t)=>{const{controlNetId:n,isEnabled:r}=t.payload,i=e.controlNets[n];i&&(i.isEnabled=r)},controlNetImageChanged:(e,t)=>{const{controlNetId:n,controlImage:r}=t.payload,i=e.controlNets[n];i&&(i.controlImage=r,i.processedControlImage=null,r!==null&&i.processorType!=="none"&&e.pendingControlImages.push(n))},controlNetProcessedImageChanged:(e,t)=>{const{controlNetId:n,processedControlImage:r}=t.payload,i=e.controlNets[n];i&&(i.processedControlImage=r,e.pendingControlImages=e.pendingControlImages.filter(o=>o!==n))},controlNetModelChanged:(e,t)=>{const{controlNetId:n,model:r}=t.payload,i=e.controlNets[n];if(i&&(i.model=r,i.processedControlImage=null,i.shouldAutoConfig)){let o;for(const a in kv)if(r.model_name.includes(a)){o=kv[a];break}o?(i.processorType=o,i.processorNode=Ef[o].default):(i.processorType="none",i.processorNode=Ef.none.default)}},controlNetWeightChanged:(e,t)=>{const{controlNetId:n,weight:r}=t.payload,i=e.controlNets[n];i&&(i.weight=r)},controlNetBeginStepPctChanged:(e,t)=>{const{controlNetId:n,beginStepPct:r}=t.payload,i=e.controlNets[n];i&&(i.beginStepPct=r)},controlNetEndStepPctChanged:(e,t)=>{const{controlNetId:n,endStepPct:r}=t.payload,i=e.controlNets[n];i&&(i.endStepPct=r)},controlNetControlModeChanged:(e,t)=>{const{controlNetId:n,controlMode:r}=t.payload,i=e.controlNets[n];i&&(i.controlMode=r)},controlNetResizeModeChanged:(e,t)=>{const{controlNetId:n,resizeMode:r}=t.payload,i=e.controlNets[n];i&&(i.resizeMode=r)},controlNetProcessorParamsChanged:(e,t)=>{const{controlNetId:n,changes:r}=t.payload,i=e.controlNets[n];if(!i)return;const o=i.processorNode;i.processorNode={...o,...r},i.shouldAutoConfig=!1},controlNetProcessorTypeChanged:(e,t)=>{const{controlNetId:n,processorType:r}=t.payload,i=e.controlNets[n];i&&(i.processedControlImage=null,i.processorType=r,i.processorNode=Ef[r].default,i.shouldAutoConfig=!1)},controlNetAutoConfigToggled:(e,t)=>{var o;const{controlNetId:n}=t.payload,r=e.controlNets[n];if(!r)return;const i=!r.shouldAutoConfig;if(i){let a;for(const s in kv)if((o=r.model)!=null&&o.model_name.includes(s)){a=kv[s];break}a?(r.processorType=a,r.processorNode=Ef[a].default):(r.processorType="none",r.processorNode=Ef.none.default)}r.shouldAutoConfig=i},controlNetReset:()=>({...wE}),isIPAdapterEnabledChanged:(e,t)=>{e.isIPAdapterEnabled=t.payload},ipAdapterRecalled:(e,t)=>{e.ipAdapterInfo=t.payload},ipAdapterImageChanged:(e,t)=>{e.ipAdapterInfo.adapterImage=t.payload},ipAdapterWeightChanged:(e,t)=>{e.ipAdapterInfo.weight=t.payload},ipAdapterModelChanged:(e,t)=>{e.ipAdapterInfo.model=t.payload},ipAdapterBeginStepPctChanged:(e,t)=>{e.ipAdapterInfo.beginStepPct=t.payload},ipAdapterEndStepPctChanged:(e,t)=>{e.ipAdapterInfo.endStepPct=t.payload},ipAdapterStateReset:e=>{e.isIPAdapterEnabled=!1,e.ipAdapterInfo={...iU}},clearPendingControlImages:e=>{e.pendingControlImages=[]}},extraReducers:e=>{e.addCase(Qk,(t,n)=>{const r=t.controlNets[n.payload.controlNetId];r&&r.controlImage!==null&&t.pendingControlImages.push(n.payload.controlNetId)}),e.addCase(G2,t=>{t.pendingControlImages=[]}),e.addMatcher(ve.endpoints.deleteImage.matchFulfilled,(t,n)=>{const{image_name:r}=n.meta.arg.originalArgs;Ea(t.controlNets,i=>{i.controlImage===r&&(i.controlImage=null,i.processedControlImage=null),i.processedControlImage===r&&(i.processedControlImage=null)})})}}),{isControlNetEnabledToggled:aqe,controlNetEnabled:sqe,controlNetAdded:lqe,controlNetRecalled:uqe,controlNetDuplicated:cqe,controlNetAddedFromImage:dqe,controlNetRemoved:aU,controlNetImageChanged:Cc,controlNetProcessedImageChanged:Xk,controlNetIsEnabledChanged:sU,controlNetModelChanged:VR,controlNetWeightChanged:fqe,controlNetBeginStepPctChanged:hqe,controlNetEndStepPctChanged:pqe,controlNetControlModeChanged:gqe,controlNetResizeModeChanged:mqe,controlNetProcessorParamsChanged:m0e,controlNetProcessorTypeChanged:y0e,controlNetReset:v0e,controlNetAutoConfigToggled:GR,isIPAdapterEnabledChanged:lU,ipAdapterRecalled:yqe,ipAdapterImageChanged:q2,ipAdapterWeightChanged:vqe,ipAdapterModelChanged:qR,ipAdapterBeginStepPctChanged:bqe,ipAdapterEndStepPctChanged:_qe,ipAdapterStateReset:uU,clearPendingControlImages:b0e}=oU.actions,_0e=oU.reducer,S0e={imagesToDelete:[],isModalOpen:!1},cU=rr({name:"deleteImageModal",initialState:S0e,reducers:{isModalOpenChanged:(e,t)=>{e.isModalOpen=t.payload},imagesToDeleteSelected:(e,t)=>{e.imagesToDelete=t.payload},imageDeletionCanceled:e=>{e.imagesToDelete=[],e.isModalOpen=!1}}}),{isModalOpenChanged:Yk,imagesToDeleteSelected:x0e,imageDeletionCanceled:Sqe}=cU.actions,w0e=cU.reducer,Zk={maxPrompts:100,combinatorial:!0,prompts:[],parsingError:void 0,isError:!1,isLoading:!1,seedBehaviour:"PER_ITERATION"},C0e=Zk,dU=rr({name:"dynamicPrompts",initialState:C0e,reducers:{maxPromptsChanged:(e,t)=>{e.maxPrompts=t.payload},maxPromptsReset:e=>{e.maxPrompts=Zk.maxPrompts},combinatorialToggled:e=>{e.combinatorial=!e.combinatorial},promptsChanged:(e,t)=>{e.prompts=t.payload},parsingErrorChanged:(e,t)=>{e.parsingError=t.payload},isErrorChanged:(e,t)=>{e.isError=t.payload},isLoadingChanged:(e,t)=>{e.isLoading=t.payload},seedBehaviourChanged:(e,t)=>{e.seedBehaviour=t.payload}}}),{maxPromptsChanged:E0e,maxPromptsReset:T0e,combinatorialToggled:k0e,promptsChanged:A0e,parsingErrorChanged:P0e,isErrorChanged:HR,isLoadingChanged:MC,seedBehaviourChanged:xqe}=dU.actions,I0e=dU.reducer,fU={selection:[],shouldAutoSwitch:!0,autoAssignBoardOnClick:!0,autoAddBoardId:"none",galleryImageMinimumWidth:96,selectedBoardId:"none",galleryView:"images",boardSearchText:""},hU=rr({name:"gallery",initialState:fU,reducers:{imageSelected:(e,t)=>{e.selection=t.payload?[t.payload]:[]},selectionChanged:(e,t)=>{e.selection=tE(t.payload,n=>n.image_name)},shouldAutoSwitchChanged:(e,t)=>{e.shouldAutoSwitch=t.payload},setGalleryImageMinimumWidth:(e,t)=>{e.galleryImageMinimumWidth=t.payload},autoAssignBoardOnClickChanged:(e,t)=>{e.autoAssignBoardOnClick=t.payload},boardIdSelected:(e,t)=>{e.selectedBoardId=t.payload.boardId,e.galleryView="images"},autoAddBoardIdChanged:(e,t)=>{if(!t.payload){e.autoAddBoardId="none";return}e.autoAddBoardId=t.payload},galleryViewChanged:(e,t)=>{e.galleryView=t.payload},boardSearchTextChanged:(e,t)=>{e.boardSearchText=t.payload}},extraReducers:e=>{e.addMatcher(O0e,(t,n)=>{const r=n.meta.arg.originalArgs;r===t.selectedBoardId&&(t.selectedBoardId="none",t.galleryView="images"),r===t.autoAddBoardId&&(t.autoAddBoardId="none")}),e.addMatcher(Ft.endpoints.listAllBoards.matchFulfilled,(t,n)=>{const r=n.payload;t.autoAddBoardId&&(r.map(i=>i.board_id).includes(t.autoAddBoardId)||(t.autoAddBoardId="none"))})}}),{imageSelected:Gs,shouldAutoSwitchChanged:wqe,autoAssignBoardOnClickChanged:Cqe,setGalleryImageMinimumWidth:Eqe,boardIdSelected:E_,autoAddBoardIdChanged:Tqe,galleryViewChanged:CE,selectionChanged:pU,boardSearchTextChanged:kqe}=hU.actions,R0e=hU.reducer,O0e=$o(ve.endpoints.deleteBoard.matchFulfilled,ve.endpoints.deleteBoardAndImages.matchFulfilled),WR={weight:.75},M0e={loras:{}},gU=rr({name:"lora",initialState:M0e,reducers:{loraAdded:(e,t)=>{const{model_name:n,id:r,base_model:i}=t.payload;e.loras[r]={id:r,model_name:n,base_model:i,...WR}},loraRecalled:(e,t)=>{const{model_name:n,id:r,base_model:i,weight:o}=t.payload;e.loras[r]={id:r,model_name:n,base_model:i,weight:o}},loraRemoved:(e,t)=>{const n=t.payload;delete e.loras[n]},lorasCleared:e=>{e.loras={}},loraWeightChanged:(e,t)=>{const{id:n,weight:r}=t.payload,i=e.loras[n];i&&(i.weight=r)},loraWeightReset:(e,t)=>{const n=t.payload,r=e.loras[n];r&&(r.weight=WR.weight)}}}),{loraAdded:Aqe,loraRemoved:mU,loraWeightChanged:Pqe,loraWeightReset:Iqe,lorasCleared:Rqe,loraRecalled:Oqe}=gU.actions,N0e=gU.reducer;function Aa(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Aa(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}const KR=e=>{let t;const n=new Set,r=(l,u)=>{const c=typeof l=="function"?l(t):l;if(!Object.is(c,t)){const d=t;t=u??typeof c!="object"?c:Object.assign({},t,c),n.forEach(f=>f(t,d))}},i=()=>t,s={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,i,s),s},$0e=e=>e?KR(e):KR,{useSyncExternalStoreWithSelector:D0e}=ome;function yU(e,t=e.getState,n){const r=D0e(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return I.useDebugValue(r),r}const QR=(e,t)=>{const n=$0e(e),r=(i,o=t)=>yU(n,i,o);return Object.assign(r,n),r},L0e=(e,t)=>e?QR(e,t):QR;function Oo(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var F0e={value:()=>{}};function H2(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new B1(n)}function B1(e){this._=e}function B0e(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}B1.prototype=H2.prototype={constructor:B1,on:function(e,t){var n=this._,r=B0e(e+"",n),i,o=-1,a=r.length;if(arguments.length<2){for(;++o<a;)if((i=(e=r[o]).type)&&(i=z0e(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<a;)if(i=(e=r[o]).type)n[i]=XR(n[i],e.name,t);else if(t==null)for(i in n)n[i]=XR(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new B1(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,o;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,o=r.length;i<o;++i)r[i].value.apply(t,n)}};function z0e(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function XR(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=F0e,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var EE="http://www.w3.org/1999/xhtml";const YR={svg:"http://www.w3.org/2000/svg",xhtml:EE,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function W2(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),YR.hasOwnProperty(t)?{space:YR[t],local:e}:e}function j0e(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===EE&&t.documentElement.namespaceURI===EE?t.createElement(e):t.createElementNS(n,e)}}function U0e(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function vU(e){var t=W2(e);return(t.local?U0e:j0e)(t)}function V0e(){}function Jk(e){return e==null?V0e:function(){return this.querySelector(e)}}function G0e(e){typeof e!="function"&&(e=Jk(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=new Array(a),l,u,c=0;c<a;++c)(l=o[c])&&(u=e.call(l,l.__data__,c,o))&&("__data__"in l&&(u.__data__=l.__data__),s[c]=u);return new Jo(r,this._parents)}function q0e(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function H0e(){return[]}function bU(e){return e==null?H0e:function(){return this.querySelectorAll(e)}}function W0e(e){return function(){return q0e(e.apply(this,arguments))}}function K0e(e){typeof e=="function"?e=W0e(e):e=bU(e);for(var t=this._groups,n=t.length,r=[],i=[],o=0;o<n;++o)for(var a=t[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&(r.push(e.call(l,l.__data__,u,a)),i.push(l));return new Jo(r,i)}function _U(e){return function(){return this.matches(e)}}function SU(e){return function(t){return t.matches(e)}}var Q0e=Array.prototype.find;function X0e(e){return function(){return Q0e.call(this.children,e)}}function Y0e(){return this.firstElementChild}function Z0e(e){return this.select(e==null?Y0e:X0e(typeof e=="function"?e:SU(e)))}var J0e=Array.prototype.filter;function eye(){return Array.from(this.children)}function tye(e){return function(){return J0e.call(this.children,e)}}function nye(e){return this.selectAll(e==null?eye:tye(typeof e=="function"?e:SU(e)))}function rye(e){typeof e!="function"&&(e=_U(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&s.push(l);return new Jo(r,this._parents)}function xU(e){return new Array(e.length)}function iye(){return new Jo(this._enter||this._groups.map(xU),this._parents)}function T_(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}T_.prototype={constructor:T_,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function oye(e){return function(){return e}}function aye(e,t,n,r,i,o){for(var a=0,s,l=t.length,u=o.length;a<u;++a)(s=t[a])?(s.__data__=o[a],r[a]=s):n[a]=new T_(e,o[a]);for(;a<l;++a)(s=t[a])&&(i[a]=s)}function sye(e,t,n,r,i,o,a){var s,l,u=new Map,c=t.length,d=o.length,f=new Array(c),h;for(s=0;s<c;++s)(l=t[s])&&(f[s]=h=a.call(l,l.__data__,s,t)+"",u.has(h)?i[s]=l:u.set(h,l));for(s=0;s<d;++s)h=a.call(e,o[s],s,o)+"",(l=u.get(h))?(r[s]=l,l.__data__=o[s],u.delete(h)):n[s]=new T_(e,o[s]);for(s=0;s<c;++s)(l=t[s])&&u.get(f[s])===l&&(i[s]=l)}function lye(e){return e.__data__}function uye(e,t){if(!arguments.length)return Array.from(this,lye);var n=t?sye:aye,r=this._parents,i=this._groups;typeof e!="function"&&(e=oye(e));for(var o=i.length,a=new Array(o),s=new Array(o),l=new Array(o),u=0;u<o;++u){var c=r[u],d=i[u],f=d.length,h=cye(e.call(c,c&&c.__data__,u,r)),p=h.length,m=s[u]=new Array(p),_=a[u]=new Array(p),b=l[u]=new Array(f);n(c,d,m,_,b,h,t);for(var y=0,g=0,v,S;y<p;++y)if(v=m[y]){for(y>=g&&(g=y+1);!(S=_[g])&&++g<p;);v._next=S||null}}return a=new Jo(a,r),a._enter=s,a._exit=l,a}function cye(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function dye(){return new Jo(this._exit||this._groups.map(xU),this._parents)}function fye(e,t,n){var r=this.enter(),i=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?o.remove():n(o),r&&i?r.merge(i).order():i}function hye(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,o=r.length,a=Math.min(i,o),s=new Array(i),l=0;l<a;++l)for(var u=n[l],c=r[l],d=u.length,f=s[l]=new Array(d),h,p=0;p<d;++p)(h=u[p]||c[p])&&(f[p]=h);for(;l<i;++l)s[l]=n[l];return new Jo(s,this._parents)}function pye(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,o=r[i],a;--i>=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function gye(e){e||(e=mye);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a=n[o],s=a.length,l=i[o]=new Array(s),u,c=0;c<s;++c)(u=a[c])&&(l[c]=u);l.sort(t)}return new Jo(i,this._parents).order()}function mye(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function yye(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function vye(){return Array.from(this)}function bye(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null}function _ye(){let e=0;for(const t of this)++e;return e}function Sye(){return!this.node()}function xye(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],o=0,a=i.length,s;o<a;++o)(s=i[o])&&e.call(s,s.__data__,o,i);return this}function wye(e){return function(){this.removeAttribute(e)}}function Cye(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Eye(e,t){return function(){this.setAttribute(e,t)}}function Tye(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function kye(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Aye(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Pye(e,t){var n=W2(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Cye:wye:typeof t=="function"?n.local?Aye:kye:n.local?Tye:Eye)(n,t))}function wU(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Iye(e){return function(){this.style.removeProperty(e)}}function Rye(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Oye(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Mye(e,t,n){return arguments.length>1?this.each((t==null?Iye:typeof t=="function"?Oye:Rye)(e,t,n??"")):ep(this.node(),e)}function ep(e,t){return e.style.getPropertyValue(t)||wU(e).getComputedStyle(e,null).getPropertyValue(t)}function Nye(e){return function(){delete this[e]}}function $ye(e,t){return function(){this[e]=t}}function Dye(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Lye(e,t){return arguments.length>1?this.each((t==null?Nye:typeof t=="function"?Dye:$ye)(e,t)):this.node()[e]}function CU(e){return e.trim().split(/^|\s+/)}function eA(e){return e.classList||new EU(e)}function EU(e){this._node=e,this._names=CU(e.getAttribute("class")||"")}EU.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function TU(e,t){for(var n=eA(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function kU(e,t){for(var n=eA(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Fye(e){return function(){TU(this,e)}}function Bye(e){return function(){kU(this,e)}}function zye(e,t){return function(){(t.apply(this,arguments)?TU:kU)(this,e)}}function jye(e,t){var n=CU(e+"");if(arguments.length<2){for(var r=eA(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?zye:t?Fye:Bye)(n,t))}function Uye(){this.textContent=""}function Vye(e){return function(){this.textContent=e}}function Gye(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function qye(e){return arguments.length?this.each(e==null?Uye:(typeof e=="function"?Gye:Vye)(e)):this.node().textContent}function Hye(){this.innerHTML=""}function Wye(e){return function(){this.innerHTML=e}}function Kye(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Qye(e){return arguments.length?this.each(e==null?Hye:(typeof e=="function"?Kye:Wye)(e)):this.node().innerHTML}function Xye(){this.nextSibling&&this.parentNode.appendChild(this)}function Yye(){return this.each(Xye)}function Zye(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Jye(){return this.each(Zye)}function eve(e){var t=typeof e=="function"?e:vU(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function tve(){return null}function nve(e,t){var n=typeof e=="function"?e:vU(e),r=t==null?tve:typeof t=="function"?t:Jk(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function rve(){var e=this.parentNode;e&&e.removeChild(this)}function ive(){return this.each(rve)}function ove(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ave(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function sve(e){return this.select(e?ave:ove)}function lve(e){return arguments.length?this.property("__data__",e):this.node().__data__}function uve(e){return function(t){e.call(this,t,this.__data__)}}function cve(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function dve(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n<i;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function fve(e,t,n){return function(){var r=this.__on,i,o=uve(t);if(r){for(var a=0,s=r.length;a<s;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=o,i.options=n),i.value=t;return}}this.addEventListener(e.type,o,n),i={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(i):this.__on=[i]}}function hve(e,t,n){var r=cve(e+""),i,o=r.length,a;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,u=s.length,c;l<u;++l)for(i=0,c=s[l];i<o;++i)if((a=r[i]).type===c.type&&a.name===c.name)return c.value}return}for(s=t?fve:dve,i=0;i<o;++i)this.each(s(r[i],t,n));return this}function AU(e,t,n){var r=wU(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function pve(e,t){return function(){return AU(this,e,t)}}function gve(e,t){return function(){return AU(this,e,t.apply(this,arguments))}}function mve(e,t){return this.each((typeof t=="function"?gve:pve)(e,t))}function*yve(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,o=r.length,a;i<o;++i)(a=r[i])&&(yield a)}var PU=[null];function Jo(e,t){this._groups=e,this._parents=t}function Sy(){return new Jo([[document.documentElement]],PU)}function vve(){return this}Jo.prototype=Sy.prototype={constructor:Jo,select:G0e,selectAll:K0e,selectChild:Z0e,selectChildren:nye,filter:rye,data:uye,enter:iye,exit:dye,join:fye,merge:hye,selection:vve,order:pye,sort:gye,call:yye,nodes:vye,node:bye,size:_ye,empty:Sye,each:xye,attr:Pye,style:Mye,property:Lye,classed:jye,text:qye,html:Qye,raise:Yye,lower:Jye,append:eve,insert:nve,remove:ive,clone:sve,datum:lve,on:hve,dispatch:mve,[Symbol.iterator]:yve};function Ka(e){return typeof e=="string"?new Jo([[document.querySelector(e)]],[document.documentElement]):new Jo([[e]],PU)}function bve(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Cs(e,t){if(e=bve(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const _ve={passive:!1},c0={capture:!0,passive:!1};function NC(e){e.stopImmediatePropagation()}function gh(e){e.preventDefault(),e.stopImmediatePropagation()}function IU(e){var t=e.document.documentElement,n=Ka(e).on("dragstart.drag",gh,c0);"onselectstart"in t?n.on("selectstart.drag",gh,c0):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function RU(e,t){var n=e.document.documentElement,r=Ka(e).on("dragstart.drag",null);t&&(r.on("click.drag",gh,c0),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Av=e=>()=>e;function TE(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:a,y:s,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}TE.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Sve(e){return!e.ctrlKey&&!e.button}function xve(){return this.parentNode}function wve(e,t){return t??{x:e.x,y:e.y}}function Cve(){return navigator.maxTouchPoints||"ontouchstart"in this}function Eve(){var e=Sve,t=xve,n=wve,r=Cve,i={},o=H2("start","drag","end"),a=0,s,l,u,c,d=0;function f(v){v.on("mousedown.drag",h).filter(r).on("touchstart.drag",_).on("touchmove.drag",b,_ve).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(v,S){if(!(c||!e.call(this,v,S))){var w=g(this,t.call(this,v,S),v,S,"mouse");w&&(Ka(v.view).on("mousemove.drag",p,c0).on("mouseup.drag",m,c0),IU(v.view),NC(v),u=!1,s=v.clientX,l=v.clientY,w("start",v))}}function p(v){if(gh(v),!u){var S=v.clientX-s,w=v.clientY-l;u=S*S+w*w>d}i.mouse("drag",v)}function m(v){Ka(v.view).on("mousemove.drag mouseup.drag",null),RU(v.view,u),gh(v),i.mouse("end",v)}function _(v,S){if(e.call(this,v,S)){var w=v.changedTouches,x=t.call(this,v,S),C=w.length,k,T;for(k=0;k<C;++k)(T=g(this,x,v,S,w[k].identifier,w[k]))&&(NC(v),T("start",v,w[k]))}}function b(v){var S=v.changedTouches,w=S.length,x,C;for(x=0;x<w;++x)(C=i[S[x].identifier])&&(gh(v),C("drag",v,S[x]))}function y(v){var S=v.changedTouches,w=S.length,x,C;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),x=0;x<w;++x)(C=i[S[x].identifier])&&(NC(v),C("end",v,S[x]))}function g(v,S,w,x,C,k){var T=o.copy(),P=Cs(k||w,S),$,O,E;if((E=n.call(v,new TE("beforestart",{sourceEvent:w,target:f,identifier:C,active:a,x:P[0],y:P[1],dx:0,dy:0,dispatch:T}),x))!=null)return $=E.x-P[0]||0,O=E.y-P[1]||0,function A(D,L,M){var R=P,N;switch(D){case"start":i[C]=A,N=a++;break;case"end":delete i[C],--a;case"drag":P=Cs(M||L,S),N=a;break}T.call(D,v,new TE(D,{sourceEvent:L,subject:E,target:f,identifier:C,active:N,x:P[0]+$,y:P[1]+O,dx:P[0]-R[0],dy:P[1]-R[1],dispatch:T}),x)}}return f.filter=function(v){return arguments.length?(e=typeof v=="function"?v:Av(!!v),f):e},f.container=function(v){return arguments.length?(t=typeof v=="function"?v:Av(v),f):t},f.subject=function(v){return arguments.length?(n=typeof v=="function"?v:Av(v),f):n},f.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:Av(!!v),f):r},f.on=function(){var v=o.on.apply(o,arguments);return v===o?f:v},f.clickDistance=function(v){return arguments.length?(d=(v=+v)*v,f):Math.sqrt(d)},f}function tA(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function OU(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function xy(){}var d0=.7,k_=1/d0,mh="\\s*([+-]?\\d+)\\s*",f0="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",qs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Tve=/^#([0-9a-f]{3,8})$/,kve=new RegExp(`^rgb\\(${mh},${mh},${mh}\\)$`),Ave=new RegExp(`^rgb\\(${qs},${qs},${qs}\\)$`),Pve=new RegExp(`^rgba\\(${mh},${mh},${mh},${f0}\\)$`),Ive=new RegExp(`^rgba\\(${qs},${qs},${qs},${f0}\\)$`),Rve=new RegExp(`^hsl\\(${f0},${qs},${qs}\\)$`),Ove=new RegExp(`^hsla\\(${f0},${qs},${qs},${f0}\\)$`),ZR={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};tA(xy,h0,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:JR,formatHex:JR,formatHex8:Mve,formatHsl:Nve,formatRgb:e9,toString:e9});function JR(){return this.rgb().formatHex()}function Mve(){return this.rgb().formatHex8()}function Nve(){return MU(this).formatHsl()}function e9(){return this.rgb().formatRgb()}function h0(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Tve.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?t9(t):n===3?new Eo(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Pv(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Pv(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=kve.exec(e))?new Eo(t[1],t[2],t[3],1):(t=Ave.exec(e))?new Eo(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Pve.exec(e))?Pv(t[1],t[2],t[3],t[4]):(t=Ive.exec(e))?Pv(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Rve.exec(e))?i9(t[1],t[2]/100,t[3]/100,1):(t=Ove.exec(e))?i9(t[1],t[2]/100,t[3]/100,t[4]):ZR.hasOwnProperty(e)?t9(ZR[e]):e==="transparent"?new Eo(NaN,NaN,NaN,0):null}function t9(e){return new Eo(e>>16&255,e>>8&255,e&255,1)}function Pv(e,t,n,r){return r<=0&&(e=t=n=NaN),new Eo(e,t,n,r)}function $ve(e){return e instanceof xy||(e=h0(e)),e?(e=e.rgb(),new Eo(e.r,e.g,e.b,e.opacity)):new Eo}function kE(e,t,n,r){return arguments.length===1?$ve(e):new Eo(e,t,n,r??1)}function Eo(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}tA(Eo,kE,OU(xy,{brighter(e){return e=e==null?k_:Math.pow(k_,e),new Eo(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?d0:Math.pow(d0,e),new Eo(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Eo(yd(this.r),yd(this.g),yd(this.b),A_(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:n9,formatHex:n9,formatHex8:Dve,formatRgb:r9,toString:r9}));function n9(){return`#${ad(this.r)}${ad(this.g)}${ad(this.b)}`}function Dve(){return`#${ad(this.r)}${ad(this.g)}${ad(this.b)}${ad((isNaN(this.opacity)?1:this.opacity)*255)}`}function r9(){const e=A_(this.opacity);return`${e===1?"rgb(":"rgba("}${yd(this.r)}, ${yd(this.g)}, ${yd(this.b)}${e===1?")":`, ${e})`}`}function A_(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yd(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ad(e){return e=yd(e),(e<16?"0":"")+e.toString(16)}function i9(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Qa(e,t,n,r)}function MU(e){if(e instanceof Qa)return new Qa(e.h,e.s,e.l,e.opacity);if(e instanceof xy||(e=h0(e)),!e)return new Qa;if(e instanceof Qa)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(t===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-t)/s+2:a=(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new Qa(a,s,l,e.opacity)}function Lve(e,t,n,r){return arguments.length===1?MU(e):new Qa(e,t,n,r??1)}function Qa(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}tA(Qa,Lve,OU(xy,{brighter(e){return e=e==null?k_:Math.pow(k_,e),new Qa(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?d0:Math.pow(d0,e),new Qa(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Eo($C(e>=240?e-240:e+120,i,r),$C(e,i,r),$C(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Qa(o9(this.h),Iv(this.s),Iv(this.l),A_(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=A_(this.opacity);return`${e===1?"hsl(":"hsla("}${o9(this.h)}, ${Iv(this.s)*100}%, ${Iv(this.l)*100}%${e===1?")":`, ${e})`}`}}));function o9(e){return e=(e||0)%360,e<0?e+360:e}function Iv(e){return Math.max(0,Math.min(1,e||0))}function $C(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const NU=e=>()=>e;function Fve(e,t){return function(n){return e+n*t}}function Bve(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function zve(e){return(e=+e)==1?$U:function(t,n){return n-t?Bve(t,n,e):NU(isNaN(t)?n:t)}}function $U(e,t){var n=t-e;return n?Fve(e,n):NU(isNaN(e)?t:e)}const a9=function e(t){var n=zve(t);function r(i,o){var a=n((i=kE(i)).r,(o=kE(o)).r),s=n(i.g,o.g),l=n(i.b,o.b),u=$U(i.opacity,o.opacity);return function(c){return i.r=a(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=e,r}(1);function _u(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var AE=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,DC=new RegExp(AE.source,"g");function jve(e){return function(){return e}}function Uve(e){return function(t){return e(t)+""}}function Vve(e,t){var n=AE.lastIndex=DC.lastIndex=0,r,i,o,a=-1,s=[],l=[];for(e=e+"",t=t+"";(r=AE.exec(e))&&(i=DC.exec(t));)(o=i.index)>n&&(o=t.slice(n,o),s[a]?s[a]+=o:s[++a]=o),(r=r[0])===(i=i[0])?s[a]?s[a]+=i:s[++a]=i:(s[++a]=null,l.push({i:a,x:_u(r,i)})),n=DC.lastIndex;return n<t.length&&(o=t.slice(n),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?Uve(l[0].x):jve(t):(t=l.length,function(u){for(var c=0,d;c<t;++c)s[(d=l[c]).i]=d.x(u);return s.join("")})}var s9=180/Math.PI,PE={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function DU(e,t,n,r,i,o){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(t,e)*s9,skewX:Math.atan(l)*s9,scaleX:a,scaleY:s}}var Rv;function Gve(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?PE:DU(t.a,t.b,t.c,t.d,t.e,t.f)}function qve(e){return e==null||(Rv||(Rv=document.createElementNS("http://www.w3.org/2000/svg","g")),Rv.setAttribute("transform",e),!(e=Rv.transform.baseVal.consolidate()))?PE:(e=e.matrix,DU(e.a,e.b,e.c,e.d,e.e,e.f))}function LU(e,t,n,r){function i(u){return u.length?u.pop()+" ":""}function o(u,c,d,f,h,p){if(u!==d||c!==f){var m=h.push("translate(",null,t,null,n);p.push({i:m-4,x:_u(u,d)},{i:m-2,x:_u(c,f)})}else(d||f)&&h.push("translate("+d+t+f+n)}function a(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(i(d)+"rotate(",null,r)-2,x:_u(u,c)})):c&&d.push(i(d)+"rotate("+c+r)}function s(u,c,d,f){u!==c?f.push({i:d.push(i(d)+"skewX(",null,r)-2,x:_u(u,c)}):c&&d.push(i(d)+"skewX("+c+r)}function l(u,c,d,f,h,p){if(u!==d||c!==f){var m=h.push(i(h)+"scale(",null,",",null,")");p.push({i:m-4,x:_u(u,d)},{i:m-2,x:_u(c,f)})}else(d!==1||f!==1)&&h.push(i(h)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),o(u.translateX,u.translateY,c.translateX,c.translateY,d,f),a(u.rotate,c.rotate,d,f),s(u.skewX,c.skewX,d,f),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(h){for(var p=-1,m=f.length,_;++p<m;)d[(_=f[p]).i]=_.x(h);return d.join("")}}}var Hve=LU(Gve,"px, ","px)","deg)"),Wve=LU(qve,", ",")",")"),Kve=1e-12;function l9(e){return((e=Math.exp(e))+1/e)/2}function Qve(e){return((e=Math.exp(e))-1/e)/2}function Xve(e){return((e=Math.exp(2*e))-1)/(e+1)}const Yve=function e(t,n,r){function i(o,a){var s=o[0],l=o[1],u=o[2],c=a[0],d=a[1],f=a[2],h=c-s,p=d-l,m=h*h+p*p,_,b;if(m<Kve)b=Math.log(f/u)/t,_=function(x){return[s+x*h,l+x*p,u*Math.exp(t*x*b)]};else{var y=Math.sqrt(m),g=(f*f-u*u+r*m)/(2*u*n*y),v=(f*f-u*u-r*m)/(2*f*n*y),S=Math.log(Math.sqrt(g*g+1)-g),w=Math.log(Math.sqrt(v*v+1)-v);b=(w-S)/t,_=function(x){var C=x*b,k=l9(S),T=u/(n*y)*(k*Xve(t*C+S)-Qve(S));return[s+T*h,l+T*p,u*k/l9(t*C+S)]}}return _.duration=b*1e3*t/Math.SQRT2,_}return i.rho=function(o){var a=Math.max(.001,+o),s=a*a,l=s*s;return e(a,s,l)},i}(Math.SQRT2,2,4);var tp=0,Sg=0,Qp=0,FU=1e3,P_,xg,I_=0,$d=0,K2=0,p0=typeof performance=="object"&&performance.now?performance:Date,BU=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function nA(){return $d||(BU(Zve),$d=p0.now()+K2)}function Zve(){$d=0}function R_(){this._call=this._time=this._next=null}R_.prototype=zU.prototype={constructor:R_,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?nA():+n)+(t==null?0:+t),!this._next&&xg!==this&&(xg?xg._next=this:P_=this,xg=this),this._call=e,this._time=n,IE()},stop:function(){this._call&&(this._call=null,this._time=1/0,IE())}};function zU(e,t,n){var r=new R_;return r.restart(e,t,n),r}function Jve(){nA(),++tp;for(var e=P_,t;e;)(t=$d-e._time)>=0&&e._call.call(void 0,t),e=e._next;--tp}function u9(){$d=(I_=p0.now())+K2,tp=Sg=0;try{Jve()}finally{tp=0,t1e(),$d=0}}function e1e(){var e=p0.now(),t=e-I_;t>FU&&(K2-=t,I_=e)}function t1e(){for(var e,t=P_,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:P_=n);xg=e,IE(r)}function IE(e){if(!tp){Sg&&(Sg=clearTimeout(Sg));var t=e-$d;t>24?(e<1/0&&(Sg=setTimeout(u9,e-p0.now()-K2)),Qp&&(Qp=clearInterval(Qp))):(Qp||(I_=p0.now(),Qp=setInterval(e1e,FU)),tp=1,BU(u9))}}function c9(e,t,n){var r=new R_;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var n1e=H2("start","end","cancel","interrupt"),r1e=[],jU=0,d9=1,RE=2,z1=3,f9=4,OE=5,j1=6;function Q2(e,t,n,r,i,o){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;i1e(e,n,{name:t,index:r,group:i,on:n1e,tween:r1e,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:jU})}function rA(e,t){var n=hs(e,t);if(n.state>jU)throw new Error("too late; already scheduled");return n}function rl(e,t){var n=hs(e,t);if(n.state>z1)throw new Error("too late; already running");return n}function hs(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function i1e(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=zU(o,0,n.time);function o(u){n.state=d9,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}function a(u){var c,d,f,h;if(n.state!==d9)return l();for(c in r)if(h=r[c],h.name===n.name){if(h.state===z1)return c9(a);h.state===f9?(h.state=j1,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[c]):+c<t&&(h.state=j1,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[c])}if(c9(function(){n.state===z1&&(n.state=f9,n.timer.restart(s,n.delay,n.time),s(u))}),n.state=RE,n.on.call("start",e,e.__data__,n.index,n.group),n.state===RE){for(n.state=z1,i=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(h=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(i[++d]=h);i.length=d+1}}function s(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=OE,1),d=-1,f=i.length;++d<f;)i[d].call(e,c);n.state===OE&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=j1,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function U1(e,t){var n=e.__transition,r,i,o=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){o=!1;continue}i=r.state>RE&&r.state<OE,r.state=j1,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}o&&delete e.__transition}}function o1e(e){return this.each(function(){U1(this,e)})}function a1e(e,t){var n,r;return function(){var i=rl(this,e),o=i.tween;if(o!==n){r=n=o;for(var a=0,s=r.length;a<s;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}function s1e(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var o=rl(this,e),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:t,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=s;break}l===u&&i.push(s)}o.tween=i}}function l1e(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=hs(this.node(),n).tween,i=0,o=r.length,a;i<o;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?a1e:s1e)(n,e,t))}function iA(e,t,n){var r=e._id;return e.each(function(){var i=rl(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return hs(i,r).value[t]}}function UU(e,t){var n;return(typeof t=="number"?_u:t instanceof h0?a9:(n=h0(t))?(t=n,a9):Vve)(e,t)}function u1e(e){return function(){this.removeAttribute(e)}}function c1e(e){return function(){this.removeAttributeNS(e.space,e.local)}}function d1e(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}}function f1e(e,t,n){var r,i=n+"",o;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}function h1e(e,t,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttribute(e):(a=this.getAttribute(e),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s)))}}function p1e(e,t,n){var r,i,o;return function(){var a,s=n(this),l;return s==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),l=s+"",a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s)))}}function g1e(e,t){var n=W2(e),r=n==="transform"?Wve:UU;return this.attrTween(e,typeof t=="function"?(n.local?p1e:h1e)(n,r,iA(this,"attr."+e,t)):t==null?(n.local?c1e:u1e)(n):(n.local?f1e:d1e)(n,r,t))}function m1e(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function y1e(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function v1e(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&y1e(e,o)),n}return i._value=t,i}function b1e(e,t){var n,r;function i(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&m1e(e,o)),n}return i._value=t,i}function _1e(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=W2(e);return this.tween(n,(r.local?v1e:b1e)(r,t))}function S1e(e,t){return function(){rA(this,e).delay=+t.apply(this,arguments)}}function x1e(e,t){return t=+t,function(){rA(this,e).delay=t}}function w1e(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?S1e:x1e)(t,e)):hs(this.node(),t).delay}function C1e(e,t){return function(){rl(this,e).duration=+t.apply(this,arguments)}}function E1e(e,t){return t=+t,function(){rl(this,e).duration=t}}function T1e(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?C1e:E1e)(t,e)):hs(this.node(),t).duration}function k1e(e,t){if(typeof t!="function")throw new Error;return function(){rl(this,e).ease=t}}function A1e(e){var t=this._id;return arguments.length?this.each(k1e(t,e)):hs(this.node(),t).ease}function P1e(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;rl(this,e).ease=n}}function I1e(e){if(typeof e!="function")throw new Error;return this.each(P1e(this._id,e))}function R1e(e){typeof e!="function"&&(e=_U(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var o=t[i],a=o.length,s=r[i]=[],l,u=0;u<a;++u)(l=o[u])&&e.call(l,l.__data__,u,o)&&s.push(l);return new Wl(r,this._parents,this._name,this._id)}function O1e(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var l=t[s],u=n[s],c=l.length,d=a[s]=new Array(c),f,h=0;h<c;++h)(f=l[h]||u[h])&&(d[h]=f);for(;s<r;++s)a[s]=t[s];return new Wl(a,this._parents,this._name,this._id)}function M1e(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function N1e(e,t,n){var r,i,o=M1e(t)?rA:rl;return function(){var a=o(this,e),s=a.on;s!==r&&(i=(r=s).copy()).on(t,n),a.on=i}}function $1e(e,t){var n=this._id;return arguments.length<2?hs(this.node(),n).on.on(e):this.each(N1e(n,e,t))}function D1e(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function L1e(){return this.on("end.remove",D1e(this._id))}function F1e(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Jk(e));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a<i;++a)for(var s=r[a],l=s.length,u=o[a]=new Array(l),c,d,f=0;f<l;++f)(c=s[f])&&(d=e.call(c,c.__data__,f,s))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,Q2(u[f],t,n,f,u,hs(c,n)));return new Wl(o,this._parents,t,n)}function B1e(e){var t=this._name,n=this._id;typeof e!="function"&&(e=bU(e));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var l=r[s],u=l.length,c,d=0;d<u;++d)if(c=l[d]){for(var f=e.call(c,c.__data__,d,l),h,p=hs(c,n),m=0,_=f.length;m<_;++m)(h=f[m])&&Q2(h,t,n,m,f,p);o.push(f),a.push(c)}return new Wl(o,a,t,n)}var z1e=Sy.prototype.constructor;function j1e(){return new z1e(this._groups,this._parents)}function U1e(e,t){var n,r,i;return function(){var o=ep(this,e),a=(this.style.removeProperty(e),ep(this,e));return o===a?null:o===n&&a===r?i:i=t(n=o,r=a)}}function VU(e){return function(){this.style.removeProperty(e)}}function V1e(e,t,n){var r,i=n+"",o;return function(){var a=ep(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}function G1e(e,t,n){var r,i,o;return function(){var a=ep(this,e),s=n(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),ep(this,e))),a===l?null:a===r&&l===i?o:(i=l,o=t(r=a,s))}}function q1e(e,t){var n,r,i,o="style."+t,a="end."+o,s;return function(){var l=rl(this,e),u=l.on,c=l.value[o]==null?s||(s=VU(t)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(a,i=c),l.on=r}}function H1e(e,t,n){var r=(e+="")=="transform"?Hve:UU;return t==null?this.styleTween(e,U1e(e,r)).on("end.style."+e,VU(e)):typeof t=="function"?this.styleTween(e,G1e(e,r,iA(this,"style."+e,t))).each(q1e(this._id,e)):this.styleTween(e,V1e(e,r,t),n).on("end.style."+e,null)}function W1e(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function K1e(e,t,n){var r,i;function o(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&W1e(e,a,n)),r}return o._value=t,o}function Q1e(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,K1e(e,t,n??""))}function X1e(e){return function(){this.textContent=e}}function Y1e(e){return function(){var t=e(this);this.textContent=t??""}}function Z1e(e){return this.tween("text",typeof e=="function"?Y1e(iA(this,"text",e)):X1e(e==null?"":e+""))}function J1e(e){return function(t){this.textContent=e.call(this,t)}}function ebe(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&J1e(i)),t}return r._value=e,r}function tbe(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,ebe(e))}function nbe(){for(var e=this._name,t=this._id,n=GU(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)if(l=a[u]){var c=hs(l,t);Q2(l,e,n,u,a,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Wl(r,this._parents,e,n)}function rbe(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(o,a){var s={value:a},l={value:function(){--i===0&&o()}};n.each(function(){var u=rl(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),u.on=t}),i===0&&o()})}var ibe=0;function Wl(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function GU(){return++ibe}var dl=Sy.prototype;Wl.prototype={constructor:Wl,select:F1e,selectAll:B1e,selectChild:dl.selectChild,selectChildren:dl.selectChildren,filter:R1e,merge:O1e,selection:j1e,transition:nbe,call:dl.call,nodes:dl.nodes,node:dl.node,size:dl.size,empty:dl.empty,each:dl.each,on:$1e,attr:g1e,attrTween:_1e,style:H1e,styleTween:Q1e,text:Z1e,textTween:tbe,remove:L1e,tween:l1e,delay:w1e,duration:T1e,ease:A1e,easeVarying:I1e,end:rbe,[Symbol.iterator]:dl[Symbol.iterator]};function obe(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var abe={time:null,delay:0,duration:250,ease:obe};function sbe(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function lbe(e){var t,n;e instanceof Wl?(t=e._id,e=e._name):(t=GU(),(n=abe).time=nA(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a=r[o],s=a.length,l,u=0;u<s;++u)(l=a[u])&&Q2(l,e,t,u,a,n||sbe(l,t));return new Wl(r,this._parents,e,t)}Sy.prototype.interrupt=o1e;Sy.prototype.transition=lbe;const Ov=e=>()=>e;function ube(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Rl(e,t,n){this.k=e,this.x=t,this.y=n}Rl.prototype={constructor:Rl,scale:function(e){return e===1?this:new Rl(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Rl(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Xu=new Rl(1,0,0);Rl.prototype;function LC(e){e.stopImmediatePropagation()}function Xp(e){e.preventDefault(),e.stopImmediatePropagation()}function cbe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function dbe(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function h9(){return this.__zoom||Xu}function fbe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function hbe(){return navigator.maxTouchPoints||"ontouchstart"in this}function pbe(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function gbe(){var e=cbe,t=dbe,n=pbe,r=fbe,i=hbe,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],s=250,l=Yve,u=H2("start","zoom","end"),c,d,f,h=500,p=150,m=0,_=10;function b(E){E.property("__zoom",h9).on("wheel.zoom",C,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",T).filter(i).on("touchstart.zoom",P).on("touchmove.zoom",$).on("touchend.zoom touchcancel.zoom",O).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(E,A,D,L){var M=E.selection?E.selection():E;M.property("__zoom",h9),E!==M?S(E,A,D,L):M.interrupt().each(function(){w(this,arguments).event(L).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},b.scaleBy=function(E,A,D,L){b.scaleTo(E,function(){var M=this.__zoom.k,R=typeof A=="function"?A.apply(this,arguments):A;return M*R},D,L)},b.scaleTo=function(E,A,D,L){b.transform(E,function(){var M=t.apply(this,arguments),R=this.__zoom,N=D==null?v(M):typeof D=="function"?D.apply(this,arguments):D,B=R.invert(N),U=typeof A=="function"?A.apply(this,arguments):A;return n(g(y(R,U),N,B),M,a)},D,L)},b.translateBy=function(E,A,D,L){b.transform(E,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof D=="function"?D.apply(this,arguments):D),t.apply(this,arguments),a)},null,L)},b.translateTo=function(E,A,D,L,M){b.transform(E,function(){var R=t.apply(this,arguments),N=this.__zoom,B=L==null?v(R):typeof L=="function"?L.apply(this,arguments):L;return n(Xu.translate(B[0],B[1]).scale(N.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof D=="function"?-D.apply(this,arguments):-D),R,a)},L,M)};function y(E,A){return A=Math.max(o[0],Math.min(o[1],A)),A===E.k?E:new Rl(A,E.x,E.y)}function g(E,A,D){var L=A[0]-D[0]*E.k,M=A[1]-D[1]*E.k;return L===E.x&&M===E.y?E:new Rl(E.k,L,M)}function v(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function S(E,A,D,L){E.on("start.zoom",function(){w(this,arguments).event(L).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(L).end()}).tween("zoom",function(){var M=this,R=arguments,N=w(M,R).event(L),B=t.apply(M,R),U=D==null?v(B):typeof D=="function"?D.apply(M,R):D,G=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),Z=M.__zoom,ee=typeof A=="function"?A.apply(M,R):A,J=l(Z.invert(U).concat(G/Z.k),ee.invert(U).concat(G/ee.k));return function(j){if(j===1)j=ee;else{var Q=J(j),ne=G/Q[2];j=new Rl(ne,U[0]-Q[0]*ne,U[1]-Q[1]*ne)}N.zoom(null,j)}})}function w(E,A,D){return!D&&E.__zooming||new x(E,A)}function x(E,A){this.that=E,this.args=A,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,A),this.taps=0}x.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,A){return this.mouse&&E!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var A=Ka(this.that).datum();u.call(E,this.that,new ube(E,{sourceEvent:this.sourceEvent,target:b,type:E,transform:this.that.__zoom,dispatch:u}),A)}};function C(E,...A){if(!e.apply(this,arguments))return;var D=w(this,A).event(E),L=this.__zoom,M=Math.max(o[0],Math.min(o[1],L.k*Math.pow(2,r.apply(this,arguments)))),R=Cs(E);if(D.wheel)(D.mouse[0][0]!==R[0]||D.mouse[0][1]!==R[1])&&(D.mouse[1]=L.invert(D.mouse[0]=R)),clearTimeout(D.wheel);else{if(L.k===M)return;D.mouse=[R,L.invert(R)],U1(this),D.start()}Xp(E),D.wheel=setTimeout(N,p),D.zoom("mouse",n(g(y(L,M),D.mouse[0],D.mouse[1]),D.extent,a));function N(){D.wheel=null,D.end()}}function k(E,...A){if(f||!e.apply(this,arguments))return;var D=E.currentTarget,L=w(this,A,!0).event(E),M=Ka(E.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",G,!0),R=Cs(E,D),N=E.clientX,B=E.clientY;IU(E.view),LC(E),L.mouse=[R,this.__zoom.invert(R)],U1(this),L.start();function U(Z){if(Xp(Z),!L.moved){var ee=Z.clientX-N,J=Z.clientY-B;L.moved=ee*ee+J*J>m}L.event(Z).zoom("mouse",n(g(L.that.__zoom,L.mouse[0]=Cs(Z,D),L.mouse[1]),L.extent,a))}function G(Z){M.on("mousemove.zoom mouseup.zoom",null),RU(Z.view,L.moved),Xp(Z),L.event(Z).end()}}function T(E,...A){if(e.apply(this,arguments)){var D=this.__zoom,L=Cs(E.changedTouches?E.changedTouches[0]:E,this),M=D.invert(L),R=D.k*(E.shiftKey?.5:2),N=n(g(y(D,R),L,M),t.apply(this,A),a);Xp(E),s>0?Ka(this).transition().duration(s).call(S,N,L,E):Ka(this).call(b.transform,N,L,E)}}function P(E,...A){if(e.apply(this,arguments)){var D=E.touches,L=D.length,M=w(this,A,E.changedTouches.length===L).event(E),R,N,B,U;for(LC(E),N=0;N<L;++N)B=D[N],U=Cs(B,this),U=[U,this.__zoom.invert(U),B.identifier],M.touch0?!M.touch1&&M.touch0[2]!==U[2]&&(M.touch1=U,M.taps=0):(M.touch0=U,R=!0,M.taps=1+!!c);c&&(c=clearTimeout(c)),R&&(M.taps<2&&(d=U[0],c=setTimeout(function(){c=null},h)),U1(this),M.start())}}function $(E,...A){if(this.__zooming){var D=w(this,A).event(E),L=E.changedTouches,M=L.length,R,N,B,U;for(Xp(E),R=0;R<M;++R)N=L[R],B=Cs(N,this),D.touch0&&D.touch0[2]===N.identifier?D.touch0[0]=B:D.touch1&&D.touch1[2]===N.identifier&&(D.touch1[0]=B);if(N=D.that.__zoom,D.touch1){var G=D.touch0[0],Z=D.touch0[1],ee=D.touch1[0],J=D.touch1[1],j=(j=ee[0]-G[0])*j+(j=ee[1]-G[1])*j,Q=(Q=J[0]-Z[0])*Q+(Q=J[1]-Z[1])*Q;N=y(N,Math.sqrt(j/Q)),B=[(G[0]+ee[0])/2,(G[1]+ee[1])/2],U=[(Z[0]+J[0])/2,(Z[1]+J[1])/2]}else if(D.touch0)B=D.touch0[0],U=D.touch0[1];else return;D.zoom("touch",n(g(N,B,U),D.extent,a))}}function O(E,...A){if(this.__zooming){var D=w(this,A).event(E),L=E.changedTouches,M=L.length,R,N;for(LC(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),R=0;R<M;++R)N=L[R],D.touch0&&D.touch0[2]===N.identifier?delete D.touch0:D.touch1&&D.touch1[2]===N.identifier&&delete D.touch1;if(D.touch1&&!D.touch0&&(D.touch0=D.touch1,delete D.touch1),D.touch0)D.touch0[1]=this.__zoom.invert(D.touch0[0]);else if(D.end(),D.taps===2&&(N=Cs(N,this),Math.hypot(d[0]-N[0],d[1]-N[1])<_)){var B=Ka(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return b.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:Ov(+E),b):r},b.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Ov(!!E),b):e},b.touchable=function(E){return arguments.length?(i=typeof E=="function"?E:Ov(!!E),b):i},b.extent=function(E){return arguments.length?(t=typeof E=="function"?E:Ov([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),b):t},b.scaleExtent=function(E){return arguments.length?(o[0]=+E[0],o[1]=+E[1],b):[o[0],o[1]]},b.translateExtent=function(E){return arguments.length?(a[0][0]=+E[0][0],a[1][0]=+E[1][0],a[0][1]=+E[0][1],a[1][1]=+E[1][1],b):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},b.constrain=function(E){return arguments.length?(n=E,b):n},b.duration=function(E){return arguments.length?(s=+E,b):s},b.interpolate=function(E){return arguments.length?(l=E,b):l},b.on=function(){var E=u.on.apply(u,arguments);return E===u?b:E},b.clickDistance=function(E){return arguments.length?(m=(E=+E)*E,b):Math.sqrt(m)},b.tapDistance=function(E){return arguments.length?(_=+E,b):_},b}const X2=I.createContext(null),mbe=X2.Provider,Kl={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},qU=Kl.error001();function _r(e,t){const n=I.useContext(X2);if(n===null)throw new Error(qU);return yU(n,e,t)}const pi=()=>{const e=I.useContext(X2);if(e===null)throw new Error(qU);return I.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},ybe=e=>e.userSelectionActive?"none":"all";function vbe({position:e,children:t,className:n,style:r,...i}){const o=_r(ybe),a=`${e}`.split("-");return W.jsx("div",{className:Aa(["react-flow__panel",n,...a]),style:{...r,pointerEvents:o},...i,children:t})}function bbe({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:W.jsx(vbe,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:W.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const _be=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:o={},labelBgPadding:a=[2,4],labelBgBorderRadius:s=2,children:l,className:u,...c})=>{const d=I.useRef(null),[f,h]=I.useState({x:0,y:0,width:0,height:0}),p=Aa(["react-flow__edge-textwrapper",u]);return I.useEffect(()=>{if(d.current){const m=d.current.getBBox();h({x:m.x,y:m.y,width:m.width,height:m.height})}},[n]),typeof n>"u"||!n?null:W.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...c,children:[i&&W.jsx("rect",{width:f.width+2*a[0],x:-a[0],y:-a[1],height:f.height+2*a[1],className:"react-flow__edge-textbg",style:o,rx:s,ry:s}),W.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:d,style:r,children:n}),l]})};var Sbe=I.memo(_be);const oA=e=>({width:e.offsetWidth,height:e.offsetHeight}),np=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),aA=(e={x:0,y:0},t)=>({x:np(e.x,t[0][0],t[1][0]),y:np(e.y,t[0][1],t[1][1])}),p9=(e,t,n)=>e<t?np(Math.abs(e-t),1,50)/50:e>n?-np(Math.abs(e-n),1,50)/50:0,HU=(e,t)=>{const n=p9(e.x,35,t.width-35)*20,r=p9(e.y,35,t.height-35)*20;return[n,r]},WU=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},KU=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),g0=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),QU=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),g9=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Mqe=(e,t)=>QU(KU(g0(e),g0(t))),ME=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},xbe=e=>_a(e.width)&&_a(e.height)&&_a(e.x)&&_a(e.y),_a=e=>!isNaN(e)&&isFinite(e),Qr=Symbol.for("internals"),XU=["Enter"," ","Escape"],wbe=(e,t)=>{},Cbe=e=>"nativeEvent"in e;function NE(e){var i,o;const t=Cbe(e)?e.nativeEvent:e,n=((o=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:o[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const YU=e=>"clientX"in e,Yu=(e,t)=>{var o,a;const n=YU(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},O_=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},wy=({id:e,path:t,labelX:n,labelY:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h=20})=>W.jsxs(W.Fragment,{children:[W.jsx("path",{id:e,style:c,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:d,markerStart:f}),h&&W.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),i&&_a(n)&&_a(r)?W.jsx(Sbe,{x:n,y:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u}):null]});wy.displayName="BaseEdge";function Yp(e,t,n){return n===void 0?n:r=>{const i=t().edges.find(o=>o.id===e);i&&n(r,{...i})}}function ZU({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n<e?n+i:n-i,a=Math.abs(r-t)/2,s=r<t?r+a:r-a;return[o,s,i,a]}function JU({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:o,targetControlX:a,targetControlY:s}){const l=e*.125+i*.375+a*.375+n*.125,u=t*.125+o*.375+s*.375+r*.125,c=Math.abs(l-e),d=Math.abs(u-t);return[l,u,c,d]}var Dd;(function(e){e.Strict="strict",e.Loose="loose"})(Dd||(Dd={}));var sd;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(sd||(sd={}));var uc;(function(e){e.Partial="partial",e.Full="full"})(uc||(uc={}));var Au;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Au||(Au={}));var M_;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(M_||(M_={}));var tt;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(tt||(tt={}));function m9({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===tt.Left||e===tt.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function eV({sourceX:e,sourceY:t,sourcePosition:n=tt.Bottom,targetX:r,targetY:i,targetPosition:o=tt.Top}){const[a,s]=m9({pos:n,x1:e,y1:t,x2:r,y2:i}),[l,u]=m9({pos:o,x1:r,y1:i,x2:e,y2:t}),[c,d,f,h]=JU({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:s,targetControlX:l,targetControlY:u});return[`M${e},${t} C${a},${s} ${l},${u} ${r},${i}`,c,d,f,h]}const sA=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=tt.Bottom,targetPosition:o=tt.Top,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:m})=>{const[_,b,y]=eV({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o});return W.jsx(wy,{path:_,labelX:b,labelY:y,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:m})});sA.displayName="SimpleBezierEdge";const y9={[tt.Left]:{x:-1,y:0},[tt.Right]:{x:1,y:0},[tt.Top]:{x:0,y:-1},[tt.Bottom]:{x:0,y:1}},Ebe=({source:e,sourcePosition:t=tt.Bottom,target:n})=>t===tt.Left||t===tt.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},v9=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Tbe({source:e,sourcePosition:t=tt.Bottom,target:n,targetPosition:r=tt.Top,center:i,offset:o}){const a=y9[t],s=y9[r],l={x:e.x+a.x*o,y:e.y+a.y*o},u={x:n.x+s.x*o,y:n.y+s.y*o},c=Ebe({source:l,sourcePosition:t,target:u}),d=c.x!==0?"x":"y",f=c[d];let h=[],p,m;const _={x:0,y:0},b={x:0,y:0},[y,g,v,S]=ZU({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*s[d]===-1){p=i.x||y,m=i.y||g;const x=[{x:p,y:l.y},{x:p,y:u.y}],C=[{x:l.x,y:m},{x:u.x,y:m}];a[d]===f?h=d==="x"?x:C:h=d==="x"?C:x}else{const x=[{x:l.x,y:u.y}],C=[{x:u.x,y:l.y}];if(d==="x"?h=a.x===f?C:x:h=a.y===f?x:C,t===r){const O=Math.abs(e[d]-n[d]);if(O<=o){const E=Math.min(o-1,o-O);a[d]===f?_[d]=(l[d]>e[d]?-1:1)*E:b[d]=(u[d]>n[d]?-1:1)*E}}if(t!==r){const O=d==="x"?"y":"x",E=a[d]===s[O],A=l[O]>u[O],D=l[O]<u[O];(a[d]===1&&(!E&&A||E&&D)||a[d]!==1&&(!E&&D||E&&A))&&(h=d==="x"?x:C)}const k={x:l.x+_.x,y:l.y+_.y},T={x:u.x+b.x,y:u.y+b.y},P=Math.max(Math.abs(k.x-h[0].x),Math.abs(T.x-h[0].x)),$=Math.max(Math.abs(k.y-h[0].y),Math.abs(T.y-h[0].y));P>=$?(p=(k.x+T.x)/2,m=h[0].y):(p=h[0].x,m=(k.y+T.y)/2)}return[[e,{x:l.x+_.x,y:l.y+_.y},...h,{x:u.x+b.x,y:u.y+b.y},n],p,m,v,S]}function kbe(e,t,n,r){const i=Math.min(v9(e,t)/2,v9(t,n)/2,r),{x:o,y:a}=t;if(e.x===o&&o===n.x||e.y===a&&a===n.y)return`L${o} ${a}`;if(e.y===a){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${o+i*u},${a}Q ${o},${a} ${o},${a+i*c}`}const s=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${o},${a+i*l}Q ${o},${a} ${o+i*s},${a}`}function $E({sourceX:e,sourceY:t,sourcePosition:n=tt.Bottom,targetX:r,targetY:i,targetPosition:o=tt.Top,borderRadius:a=5,centerX:s,centerY:l,offset:u=20}){const[c,d,f,h,p]=Tbe({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:o,center:{x:s,y:l},offset:u});return[c.reduce((_,b,y)=>{let g="";return y>0&&y<c.length-1?g=kbe(c[y-1],b,c[y+1],a):g=`${y===0?"M":"L"}${b.x} ${b.y}`,_+=g,_},""),d,f,h,p]}const Y2=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,sourcePosition:d=tt.Bottom,targetPosition:f=tt.Top,markerEnd:h,markerStart:p,pathOptions:m,interactionWidth:_})=>{const[b,y,g]=$E({sourceX:e,sourceY:t,sourcePosition:d,targetX:n,targetY:r,targetPosition:f,borderRadius:m==null?void 0:m.borderRadius,offset:m==null?void 0:m.offset});return W.jsx(wy,{path:b,labelX:y,labelY:g,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:h,markerStart:p,interactionWidth:_})});Y2.displayName="SmoothStepEdge";const lA=I.memo(e=>{var t;return W.jsx(Y2,{...e,pathOptions:I.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});lA.displayName="StepEdge";function Abe({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,a,s]=ZU({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,a,s]}const uA=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h})=>{const[p,m,_]=Abe({sourceX:e,sourceY:t,targetX:n,targetY:r});return W.jsx(wy,{path:p,labelX:m,labelY:_,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:u,style:c,markerEnd:d,markerStart:f,interactionWidth:h})});uA.displayName="StraightEdge";function Mv(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function b9({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case tt.Left:return[t-Mv(t-r,o),n];case tt.Right:return[t+Mv(r-t,o),n];case tt.Top:return[t,n-Mv(n-i,o)];case tt.Bottom:return[t,n+Mv(i-n,o)]}}function tV({sourceX:e,sourceY:t,sourcePosition:n=tt.Bottom,targetX:r,targetY:i,targetPosition:o=tt.Top,curvature:a=.25}){const[s,l]=b9({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[u,c]=b9({pos:o,x1:r,y1:i,x2:e,y2:t,c:a}),[d,f,h,p]=JU({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:l,targetControlX:u,targetControlY:c});return[`M${e},${t} C${s},${l} ${u},${c} ${r},${i}`,d,f,h,p]}const N_=I.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=tt.Bottom,targetPosition:o=tt.Top,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,pathOptions:m,interactionWidth:_})=>{const[b,y,g]=tV({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o,curvature:m==null?void 0:m.curvature});return W.jsx(wy,{path:b,labelX:y,labelY:g,label:a,labelStyle:s,labelShowBg:l,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:_})});N_.displayName="BezierEdge";const cA=I.createContext(null),Pbe=cA.Provider;cA.Consumer;const Ibe=()=>I.useContext(cA),Rbe=e=>"id"in e&&"source"in e&&"target"in e,nV=e=>"id"in e&&!("source"in e)&&!("target"in e),Obe=(e,t,n)=>{if(!nV(e))return[];const r=n.filter(i=>i.source===e.id).map(i=>i.target);return t.filter(i=>r.includes(i.id))},Mbe=(e,t,n)=>{if(!nV(e))return[];const r=n.filter(i=>i.target===e.id).map(i=>i.source);return t.filter(i=>r.includes(i.id))},rV=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,DE=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,Nbe=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),wg=(e,t)=>{if(!e.source||!e.target)return t;let n;return Rbe(e)?n={...e}:n={...e,id:rV(e)},Nbe(n,t)?t:t.concat(n)},$be=(e,t,n,r={shouldReplaceId:!0})=>{const{id:i,...o}=e;if(!t.source||!t.target||!n.find(l=>l.id===i))return n;const s={...o,id:r.shouldReplaceId?rV(t):i,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(l=>l.id!==i).concat(s)},iV=({x:e,y:t},[n,r,i],o,[a,s])=>{const l={x:(e-n)/i,y:(t-r)/i};return o?{x:a*Math.round(l.x/a),y:s*Math.round(l.y/s)}:l},Dbe=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),yh=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],i={x:e.position.x-n,y:e.position.y-r};return{...i,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:i}},dA=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const{x:o,y:a}=yh(i,t).positionAbsolute;return KU(r,g0({x:o,y:a,width:i.width||0,height:i.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return QU(n)},oV=(e,t,[n,r,i]=[0,0,1],o=!1,a=!1,s=[0,0])=>{const l={x:(t.x-n)/i,y:(t.y-r)/i,width:t.width/i,height:t.height/i},u=[];return e.forEach(c=>{const{width:d,height:f,selectable:h=!0,hidden:p=!1}=c;if(a&&!h||p)return!1;const{positionAbsolute:m}=yh(c,s),_={x:m.x,y:m.y,width:d||0,height:f||0},b=ME(l,_),y=typeof d>"u"||typeof f>"u"||d===null||f===null,g=o&&b>0,v=(d||0)*(f||0);(y||g||b>=v||c.dragging)&&u.push(c)}),u},fA=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},aV=(e,t,n,r,i,o=.1)=>{const a=t/(e.width*(1+o)),s=n/(e.height*(1+o)),l=Math.min(a,s),u=np(l,r,i),c=e.x+e.width/2,d=e.y+e.height/2,f=t/2-c*u,h=n/2-d*u;return[f,h,u]},Vc=(e,t=0)=>e.transition().duration(t);function _9(e,t,n,r){return(t[n]||[]).reduce((i,o)=>{var a,s;return`${e.id}-${o.id}-${n}`!==r&&i.push({id:o.id||null,type:n,nodeId:e.id,x:(((a=e.positionAbsolute)==null?void 0:a.x)??0)+o.x+o.width/2,y:(((s=e.positionAbsolute)==null?void 0:s.y)??0)+o.y+o.height/2}),i},[])}function Lbe(e,t,n,r,i,o){const{x:a,y:s}=Yu(e),u=t.elementsFromPoint(a,s).find(p=>p.classList.contains("react-flow__handle"));if(u){const p=u.getAttribute("data-nodeid");if(p){const m=hA(void 0,u),_=u.getAttribute("data-handleid"),b=o({nodeId:p,id:_,type:m});if(b)return{handle:{id:_,type:m,nodeId:p,x:n.x,y:n.y},validHandleResult:b}}}let c=[],d=1/0;if(i.forEach(p=>{const m=Math.sqrt((p.x-n.x)**2+(p.y-n.y)**2);if(m<=r){const _=o(p);m<=d&&(m<d?c=[{handle:p,validHandleResult:_}]:m===d&&c.push({handle:p,validHandleResult:_}),d=m)}}),!c.length)return{handle:null,validHandleResult:sV()};if(c.length===1)return c[0];const f=c.some(({validHandleResult:p})=>p.isValid),h=c.some(({handle:p})=>p.type==="target");return c.find(({handle:p,validHandleResult:m})=>h?p.type==="target":f?m.isValid:!0)||c[0]}const Fbe={source:null,target:null,sourceHandle:null,targetHandle:null},sV=()=>({handleDomNode:null,isValid:!1,connection:Fbe,endHandle:null});function lV(e,t,n,r,i,o,a){const s=i==="target",l=a.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),u={...sV(),handleDomNode:l};if(l){const c=hA(void 0,l),d=l.getAttribute("data-nodeid"),f=l.getAttribute("data-handleid"),h=l.classList.contains("connectable"),p=l.classList.contains("connectableend"),m={source:s?d:n,sourceHandle:s?f:r,target:s?n:d,targetHandle:s?r:f};u.connection=m,h&&p&&(t===Dd.Strict?s&&c==="source"||!s&&c==="target":d!==n||f!==r)&&(u.endHandle={nodeId:d,handleId:f,type:c},u.isValid=o(m))}return u}function Bbe({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((i,o)=>{if(o[Qr]){const{handleBounds:a}=o[Qr];let s=[],l=[];a&&(s=_9(o,a,"source",`${t}-${n}-${r}`),l=_9(o,a,"target",`${t}-${n}-${r}`)),i.push(...s,...l)}return i},[])}function hA(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function FC(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function zbe(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function uV({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:i,getState:o,setState:a,isValidConnection:s,edgeUpdaterType:l,onEdgeUpdateEnd:u}){const c=WU(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:h,connectionRadius:p,onConnectStart:m,panBy:_,getNodes:b,cancelConnection:y}=o();let g=0,v;const{x:S,y:w}=Yu(e),x=c==null?void 0:c.elementFromPoint(S,w),C=hA(l,x),k=f==null?void 0:f.getBoundingClientRect();if(!k||!C)return;let T,P=Yu(e,k),$=!1,O=null,E=!1,A=null;const D=Bbe({nodes:b(),nodeId:n,handleId:t,handleType:C}),L=()=>{if(!h)return;const[N,B]=HU(P,k);_({x:N,y:B}),g=requestAnimationFrame(L)};a({connectionPosition:P,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:C,connectionStartHandle:{nodeId:n,handleId:t,type:C},connectionEndHandle:null}),m==null||m(e,{nodeId:n,handleId:t,handleType:C});function M(N){const{transform:B}=o();P=Yu(N,k);const{handle:U,validHandleResult:G}=Lbe(N,c,iV(P,B,!1,[1,1]),p,D,Z=>lV(Z,d,n,t,i?"target":"source",s,c));if(v=U,$||(L(),$=!0),A=G.handleDomNode,O=G.connection,E=G.isValid,a({connectionPosition:v&&E?Dbe({x:v.x,y:v.y},B):P,connectionStatus:zbe(!!v,E),connectionEndHandle:G.endHandle}),!v&&!E&&!A)return FC(T);O.source!==O.target&&A&&(FC(T),T=A,A.classList.add("connecting","react-flow__handle-connecting"),A.classList.toggle("valid",E),A.classList.toggle("react-flow__handle-valid",E))}function R(N){var B,U;(v||A)&&O&&E&&(r==null||r(O)),(U=(B=o()).onConnectEnd)==null||U.call(B,N),l&&(u==null||u(N)),FC(T),y(),cancelAnimationFrame(g),$=!1,E=!1,O=null,A=null,c.removeEventListener("mousemove",M),c.removeEventListener("mouseup",R),c.removeEventListener("touchmove",M),c.removeEventListener("touchend",R)}c.addEventListener("mousemove",M),c.addEventListener("mouseup",R),c.addEventListener("touchmove",M),c.addEventListener("touchend",R)}const S9=()=>!0,jbe=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),Ube=(e,t,n)=>r=>{const{connectionStartHandle:i,connectionEndHandle:o,connectionClickStartHandle:a}=r;return{connecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n||(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.handleId)===t&&(a==null?void 0:a.type)===n}},cV=I.forwardRef(({type:e="source",position:t=tt.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:a,onConnect:s,children:l,className:u,onMouseDown:c,onTouchStart:d,...f},h)=>{var k,T;const p=a||null,m=e==="target",_=pi(),b=Ibe(),{connectOnClick:y,noPanClassName:g}=_r(jbe,Oo),{connecting:v,clickConnecting:S}=_r(Ube(b,p,e),Oo);b||(T=(k=_.getState()).onError)==null||T.call(k,"010",Kl.error010());const w=P=>{const{defaultEdgeOptions:$,onConnect:O,hasDefaultEdges:E}=_.getState(),A={...$,...P};if(E){const{edges:D,setEdges:L}=_.getState();L(wg(A,D))}O==null||O(A),s==null||s(A)},x=P=>{if(!b)return;const $=YU(P);i&&($&&P.button===0||!$)&&uV({event:P,handleId:p,nodeId:b,onConnect:w,isTarget:m,getState:_.getState,setState:_.setState,isValidConnection:n||_.getState().isValidConnection||S9}),$?c==null||c(P):d==null||d(P)},C=P=>{const{onClickConnectStart:$,onClickConnectEnd:O,connectionClickStartHandle:E,connectionMode:A,isValidConnection:D}=_.getState();if(!b||!E&&!i)return;if(!E){$==null||$(P,{nodeId:b,handleId:p,handleType:e}),_.setState({connectionClickStartHandle:{nodeId:b,type:e,handleId:p}});return}const L=WU(P.target),M=n||D||S9,{connection:R,isValid:N}=lV({nodeId:b,id:p,type:e},A,E.nodeId,E.handleId||null,E.type,M,L);N&&w(R),O==null||O(P),_.setState({connectionClickStartHandle:null})};return W.jsx("div",{"data-handleid":p,"data-nodeid":b,"data-handlepos":t,"data-id":`${b}-${p}-${e}`,className:Aa(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",g,u,{source:!m,target:m,connectable:r,connectablestart:i,connectableend:o,connecting:S,connectionindicator:r&&(i&&!v||o&&v)}]),onMouseDown:x,onTouchStart:x,onClick:y?C:void 0,ref:h,...f,children:l})});cV.displayName="Handle";var $_=I.memo(cV);const dV=({data:e,isConnectable:t,targetPosition:n=tt.Top,sourcePosition:r=tt.Bottom})=>W.jsxs(W.Fragment,{children:[W.jsx($_,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,W.jsx($_,{type:"source",position:r,isConnectable:t})]});dV.displayName="DefaultNode";var LE=I.memo(dV);const fV=({data:e,isConnectable:t,sourcePosition:n=tt.Bottom})=>W.jsxs(W.Fragment,{children:[e==null?void 0:e.label,W.jsx($_,{type:"source",position:n,isConnectable:t})]});fV.displayName="InputNode";var hV=I.memo(fV);const pV=({data:e,isConnectable:t,targetPosition:n=tt.Top})=>W.jsxs(W.Fragment,{children:[W.jsx($_,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]});pV.displayName="OutputNode";var gV=I.memo(pV);const pA=()=>null;pA.displayName="GroupNode";const Vbe=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),Nv=e=>e.id;function Gbe(e,t){return Oo(e.selectedNodes.map(Nv),t.selectedNodes.map(Nv))&&Oo(e.selectedEdges.map(Nv),t.selectedEdges.map(Nv))}const mV=I.memo(({onSelectionChange:e})=>{const t=pi(),{selectedNodes:n,selectedEdges:r}=_r(Vbe,Gbe);return I.useEffect(()=>{var o,a;const i={nodes:n,edges:r};e==null||e(i),(a=(o=t.getState()).onSelectionChange)==null||a.call(o,i)},[n,r,e]),null});mV.displayName="SelectionListener";const qbe=e=>!!e.onSelectionChange;function Hbe({onSelectionChange:e}){const t=_r(qbe);return e||t?W.jsx(mV,{onSelectionChange:e}):null}const Wbe=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function ff(e,t){I.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function Ot(e,t,n){I.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const Kbe=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:i,onConnectStart:o,onConnectEnd:a,onClickConnectStart:s,onClickConnectEnd:l,nodesDraggable:u,nodesConnectable:c,nodesFocusable:d,edgesFocusable:f,edgesUpdatable:h,elevateNodesOnSelect:p,minZoom:m,maxZoom:_,nodeExtent:b,onNodesChange:y,onEdgesChange:g,elementsSelectable:v,connectionMode:S,snapGrid:w,snapToGrid:x,translateExtent:C,connectOnClick:k,defaultEdgeOptions:T,fitView:P,fitViewOptions:$,onNodesDelete:O,onEdgesDelete:E,onNodeDrag:A,onNodeDragStart:D,onNodeDragStop:L,onSelectionDrag:M,onSelectionDragStart:R,onSelectionDragStop:N,noPanClassName:B,nodeOrigin:U,rfId:G,autoPanOnConnect:Z,autoPanOnNodeDrag:ee,onError:J,connectionRadius:j,isValidConnection:Q})=>{const{setNodes:ne,setEdges:se,setDefaultNodesAndEdges:ye,setMinZoom:ce,setMaxZoom:bt,setTranslateExtent:ot,setNodeExtent:ze,reset:mt}=_r(Wbe,Oo),Pe=pi();return I.useEffect(()=>{const en=r==null?void 0:r.map(Pr=>({...Pr,...T}));return ye(n,en),()=>{mt()}},[]),Ot("defaultEdgeOptions",T,Pe.setState),Ot("connectionMode",S,Pe.setState),Ot("onConnect",i,Pe.setState),Ot("onConnectStart",o,Pe.setState),Ot("onConnectEnd",a,Pe.setState),Ot("onClickConnectStart",s,Pe.setState),Ot("onClickConnectEnd",l,Pe.setState),Ot("nodesDraggable",u,Pe.setState),Ot("nodesConnectable",c,Pe.setState),Ot("nodesFocusable",d,Pe.setState),Ot("edgesFocusable",f,Pe.setState),Ot("edgesUpdatable",h,Pe.setState),Ot("elementsSelectable",v,Pe.setState),Ot("elevateNodesOnSelect",p,Pe.setState),Ot("snapToGrid",x,Pe.setState),Ot("snapGrid",w,Pe.setState),Ot("onNodesChange",y,Pe.setState),Ot("onEdgesChange",g,Pe.setState),Ot("connectOnClick",k,Pe.setState),Ot("fitViewOnInit",P,Pe.setState),Ot("fitViewOnInitOptions",$,Pe.setState),Ot("onNodesDelete",O,Pe.setState),Ot("onEdgesDelete",E,Pe.setState),Ot("onNodeDrag",A,Pe.setState),Ot("onNodeDragStart",D,Pe.setState),Ot("onNodeDragStop",L,Pe.setState),Ot("onSelectionDrag",M,Pe.setState),Ot("onSelectionDragStart",R,Pe.setState),Ot("onSelectionDragStop",N,Pe.setState),Ot("noPanClassName",B,Pe.setState),Ot("nodeOrigin",U,Pe.setState),Ot("rfId",G,Pe.setState),Ot("autoPanOnConnect",Z,Pe.setState),Ot("autoPanOnNodeDrag",ee,Pe.setState),Ot("onError",J,Pe.setState),Ot("connectionRadius",j,Pe.setState),Ot("isValidConnection",Q,Pe.setState),ff(e,ne),ff(t,se),ff(m,ce),ff(_,bt),ff(C,ot),ff(b,ze),null},x9={display:"none"},Qbe={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},yV="react-flow__node-desc",vV="react-flow__edge-desc",Xbe="react-flow__aria-live",Ybe=e=>e.ariaLiveMessage;function Zbe({rfId:e}){const t=_r(Ybe);return W.jsx("div",{id:`${Xbe}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Qbe,children:t})}function Jbe({rfId:e,disableKeyboardA11y:t}){return W.jsxs(W.Fragment,{children:[W.jsxs("div",{id:`${yV}-${e}`,style:x9,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),W.jsx("div",{id:`${vV}-${e}`,style:x9,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&W.jsx(Zbe,{rfId:e})]})}const e_e=typeof document<"u"?document:null;var m0=(e=null,t={target:e_e})=>{const[n,r]=I.useState(!1),i=I.useRef(!1),o=I.useRef(new Set([])),[a,s]=I.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.split("+")),c=u.reduce((d,f)=>d.concat(...f),[]);return[u,c]}return[[],[]]},[e]);return I.useEffect(()=>{var l,u;if(e!==null){const c=h=>{if(i.current=h.ctrlKey||h.metaKey||h.shiftKey,!i.current&&NE(h))return!1;const p=C9(h.code,s);o.current.add(h[p]),w9(a,o.current,!1)&&(h.preventDefault(),r(!0))},d=h=>{if(!i.current&&NE(h))return!1;const p=C9(h.code,s);w9(a,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(h[p]),h.key==="Meta"&&o.current.clear(),i.current=!1},f=()=>{o.current.clear(),r(!1)};return(l=t==null?void 0:t.target)==null||l.addEventListener("keydown",c),(u=t==null?void 0:t.target)==null||u.addEventListener("keyup",d),window.addEventListener("blur",f),()=>{var h,p;(h=t==null?void 0:t.target)==null||h.removeEventListener("keydown",c),(p=t==null?void 0:t.target)==null||p.removeEventListener("keyup",d),window.removeEventListener("blur",f)}}},[e,r]),n};function w9(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function C9(e,t){return t.includes(e)?"code":"key"}function bV(e,t,n,r){var a,s;if(!e.parentNode)return n;const i=t.get(e.parentNode),o=yh(i,r);return bV(i,t,{x:(n.x??0)+o.x,y:(n.y??0)+o.y,z:(((a=i[Qr])==null?void 0:a.z)??0)>(n.z??0)?((s=i[Qr])==null?void 0:s.z)??0:n.z??0},r)}function _V(e,t,n){e.forEach(r=>{var i;if(r.parentNode&&!e.has(r.parentNode))throw new Error(`Parent node ${r.parentNode} not found`);if(r.parentNode||n!=null&&n[r.id]){const{x:o,y:a,z:s}=bV(r,e,{...r.position,z:((i=r[Qr])==null?void 0:i.z)??0},t);r.positionAbsolute={x:o,y:a},r[Qr].z=s,n!=null&&n[r.id]&&(r[Qr].isParent=!0)}})}function BC(e,t,n,r){const i=new Map,o={},a=r?1e3:0;return e.forEach(s=>{var d;const l=(_a(s.zIndex)?s.zIndex:0)+(s.selected?a:0),u=t.get(s.id),c={width:u==null?void 0:u.width,height:u==null?void 0:u.height,...s,positionAbsolute:{x:s.position.x,y:s.position.y}};s.parentNode&&(c.parentNode=s.parentNode,o[s.parentNode]=!0),Object.defineProperty(c,Qr,{enumerable:!1,value:{handleBounds:(d=u==null?void 0:u[Qr])==null?void 0:d.handleBounds,z:l}}),i.set(s.id,c)}),_V(i,n,o),i}function SV(e,t={}){const{getNodes:n,width:r,height:i,minZoom:o,maxZoom:a,d3Zoom:s,d3Selection:l,fitViewOnInitDone:u,fitViewOnInit:c,nodeOrigin:d}=e(),f=t.initial&&!u&&c;if(s&&l&&(f||!t.initial)){const p=n().filter(_=>{var y;const b=t.includeHiddenNodes?_.width&&_.height:!_.hidden;return(y=t.nodes)!=null&&y.length?b&&t.nodes.some(g=>g.id===_.id):b}),m=p.every(_=>_.width&&_.height);if(p.length>0&&m){const _=dA(p,d),[b,y,g]=aV(_,r,i,t.minZoom??o,t.maxZoom??a,t.padding??.1),v=Xu.translate(b,y).scale(g);return typeof t.duration=="number"&&t.duration>0?s.transform(Vc(l,t.duration),v):s.transform(l,v),!0}}return!1}function t_e(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[Qr]:r[Qr],selected:n.selected})}),new Map(t)}function n_e(e,t){return t.map(n=>{const r=e.find(i=>i.id===n.id);return r&&(n.selected=r.selected),n})}function $v({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:i,edges:o,onNodesChange:a,onEdgesChange:s,hasDefaultNodes:l,hasDefaultEdges:u}=n();e!=null&&e.length&&(l&&r({nodeInternals:t_e(e,i)}),a==null||a(e)),t!=null&&t.length&&(u&&r({edges:n_e(t,o)}),s==null||s(t))}const hf=()=>{},r_e={zoomIn:hf,zoomOut:hf,zoomTo:hf,getZoom:()=>1,setViewport:hf,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:hf,fitBounds:hf,project:e=>e,viewportInitialized:!1},i_e=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),o_e=()=>{const e=pi(),{d3Zoom:t,d3Selection:n}=_r(i_e,Oo);return I.useMemo(()=>n&&t?{zoomIn:i=>t.scaleBy(Vc(n,i==null?void 0:i.duration),1.2),zoomOut:i=>t.scaleBy(Vc(n,i==null?void 0:i.duration),1/1.2),zoomTo:(i,o)=>t.scaleTo(Vc(n,o==null?void 0:o.duration),i),getZoom:()=>e.getState().transform[2],setViewport:(i,o)=>{const[a,s,l]=e.getState().transform,u=Xu.translate(i.x??a,i.y??s).scale(i.zoom??l);t.transform(Vc(n,o==null?void 0:o.duration),u)},getViewport:()=>{const[i,o,a]=e.getState().transform;return{x:i,y:o,zoom:a}},fitView:i=>SV(e.getState,i),setCenter:(i,o,a)=>{const{width:s,height:l,maxZoom:u}=e.getState(),c=typeof(a==null?void 0:a.zoom)<"u"?a.zoom:u,d=s/2-i*c,f=l/2-o*c,h=Xu.translate(d,f).scale(c);t.transform(Vc(n,a==null?void 0:a.duration),h)},fitBounds:(i,o)=>{const{width:a,height:s,minZoom:l,maxZoom:u}=e.getState(),[c,d,f]=aV(i,a,s,l,u,(o==null?void 0:o.padding)??.1),h=Xu.translate(c,d).scale(f);t.transform(Vc(n,o==null?void 0:o.duration),h)},project:i=>{const{transform:o,snapToGrid:a,snapGrid:s}=e.getState();return iV(i,o,a,s)},viewportInitialized:!0}:r_e,[t,n])};function xV(){const e=o_e(),t=pi(),n=I.useCallback(()=>t.getState().getNodes().map(m=>({...m})),[]),r=I.useCallback(m=>t.getState().nodeInternals.get(m),[]),i=I.useCallback(()=>{const{edges:m=[]}=t.getState();return m.map(_=>({..._}))},[]),o=I.useCallback(m=>{const{edges:_=[]}=t.getState();return _.find(b=>b.id===m)},[]),a=I.useCallback(m=>{const{getNodes:_,setNodes:b,hasDefaultNodes:y,onNodesChange:g}=t.getState(),v=_(),S=typeof m=="function"?m(v):m;if(y)b(S);else if(g){const w=S.length===0?v.map(x=>({type:"remove",id:x.id})):S.map(x=>({item:x,type:"reset"}));g(w)}},[]),s=I.useCallback(m=>{const{edges:_=[],setEdges:b,hasDefaultEdges:y,onEdgesChange:g}=t.getState(),v=typeof m=="function"?m(_):m;if(y)b(v);else if(g){const S=v.length===0?_.map(w=>({type:"remove",id:w.id})):v.map(w=>({item:w,type:"reset"}));g(S)}},[]),l=I.useCallback(m=>{const _=Array.isArray(m)?m:[m],{getNodes:b,setNodes:y,hasDefaultNodes:g,onNodesChange:v}=t.getState();if(g){const w=[...b(),..._];y(w)}else if(v){const S=_.map(w=>({item:w,type:"add"}));v(S)}},[]),u=I.useCallback(m=>{const _=Array.isArray(m)?m:[m],{edges:b=[],setEdges:y,hasDefaultEdges:g,onEdgesChange:v}=t.getState();if(g)y([...b,..._]);else if(v){const S=_.map(w=>({item:w,type:"add"}));v(S)}},[]),c=I.useCallback(()=>{const{getNodes:m,edges:_=[],transform:b}=t.getState(),[y,g,v]=b;return{nodes:m().map(S=>({...S})),edges:_.map(S=>({...S})),viewport:{x:y,y:g,zoom:v}}},[]),d=I.useCallback(({nodes:m,edges:_})=>{const{nodeInternals:b,getNodes:y,edges:g,hasDefaultNodes:v,hasDefaultEdges:S,onNodesDelete:w,onEdgesDelete:x,onNodesChange:C,onEdgesChange:k}=t.getState(),T=(m||[]).map(A=>A.id),P=(_||[]).map(A=>A.id),$=y().reduce((A,D)=>{const L=!T.includes(D.id)&&D.parentNode&&A.find(R=>R.id===D.parentNode);return(typeof D.deletable=="boolean"?D.deletable:!0)&&(T.includes(D.id)||L)&&A.push(D),A},[]),O=g.filter(A=>typeof A.deletable=="boolean"?A.deletable:!0),E=O.filter(A=>P.includes(A.id));if($||E){const A=fA($,O),D=[...E,...A],L=D.reduce((M,R)=>(M.includes(R.id)||M.push(R.id),M),[]);if((S||v)&&(S&&t.setState({edges:g.filter(M=>!L.includes(M.id))}),v&&($.forEach(M=>{b.delete(M.id)}),t.setState({nodeInternals:new Map(b)}))),L.length>0&&(x==null||x(D),k&&k(L.map(M=>({id:M,type:"remove"})))),$.length>0&&(w==null||w($),C)){const M=$.map(R=>({id:R.id,type:"remove"}));C(M)}}},[]),f=I.useCallback(m=>{const _=xbe(m),b=_?null:t.getState().nodeInternals.get(m.id);return[_?m:g9(b),b,_]},[]),h=I.useCallback((m,_=!0,b)=>{const[y,g,v]=f(m);return y?(b||t.getState().getNodes()).filter(S=>{if(!v&&(S.id===g.id||!S.positionAbsolute))return!1;const w=g9(S),x=ME(w,y);return _&&x>0||x>=m.width*m.height}):[]},[]),p=I.useCallback((m,_,b=!0)=>{const[y]=f(m);if(!y)return!1;const g=ME(y,_);return b&&g>0||g>=m.width*m.height},[]);return I.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:i,getEdge:o,setNodes:a,setEdges:s,addNodes:l,addEdges:u,toObject:c,deleteElements:d,getIntersectingNodes:h,isNodeIntersecting:p}),[e,n,r,i,o,a,s,l,u,c,d,h,p])}var a_e=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=pi(),{deleteElements:r}=xV(),i=m0(e),o=m0(t);I.useEffect(()=>{if(i){const{edges:a,getNodes:s}=n.getState(),l=s().filter(c=>c.selected),u=a.filter(c=>c.selected);r({nodes:l,edges:u}),n.setState({nodesSelectionActive:!1})}},[i]),I.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])};function s_e(e){const t=pi();I.useEffect(()=>{let n;const r=()=>{var o,a;if(!e.current)return;const i=oA(e.current);(i.height===0||i.width===0)&&((a=(o=t.getState()).onError)==null||a.call(o,"004",Kl.error004())),t.setState({width:i.width||500,height:i.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const gA={position:"absolute",width:"100%",height:"100%",top:0,left:0},l_e=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Dv=e=>({x:e.x,y:e.y,zoom:e.k}),pf=(e,t)=>e.target.closest(`.${t}`),E9=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),T9=e=>{const t=e.ctrlKey&&O_()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},u_e=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),c_e=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:i=!0,zoomOnPinch:o=!0,panOnScroll:a=!1,panOnScrollSpeed:s=.5,panOnScrollMode:l=sd.Free,zoomOnDoubleClick:u=!0,elementsSelectable:c,panOnDrag:d=!0,defaultViewport:f,translateExtent:h,minZoom:p,maxZoom:m,zoomActivationKeyCode:_,preventScrolling:b=!0,children:y,noWheelClassName:g,noPanClassName:v})=>{const S=I.useRef(),w=pi(),x=I.useRef(!1),C=I.useRef(!1),k=I.useRef(null),T=I.useRef({x:0,y:0,zoom:0}),{d3Zoom:P,d3Selection:$,d3ZoomHandler:O,userSelectionActive:E}=_r(u_e,Oo),A=m0(_),D=I.useRef(0),L=I.useRef(!1),M=I.useRef();return s_e(k),I.useEffect(()=>{if(k.current){const R=k.current.getBoundingClientRect(),N=gbe().scaleExtent([p,m]).translateExtent(h),B=Ka(k.current).call(N),U=Xu.translate(f.x,f.y).scale(np(f.zoom,p,m)),G=[[0,0],[R.width,R.height]],Z=N.constrain()(U,G,h);N.transform(B,Z),N.wheelDelta(T9),w.setState({d3Zoom:N,d3Selection:B,d3ZoomHandler:B.on("wheel.zoom"),transform:[Z.x,Z.y,Z.k],domNode:k.current.closest(".react-flow")})}},[]),I.useEffect(()=>{$&&P&&(a&&!A&&!E?$.on("wheel.zoom",R=>{if(pf(R,g))return!1;R.preventDefault(),R.stopImmediatePropagation();const N=$.property("__zoom").k||1,B=O_();if(R.ctrlKey&&o&&B){const ne=Cs(R),se=T9(R),ye=N*Math.pow(2,se);P.scaleTo($,ye,ne,R);return}const U=R.deltaMode===1?20:1;let G=l===sd.Vertical?0:R.deltaX*U,Z=l===sd.Horizontal?0:R.deltaY*U;!B&&R.shiftKey&&l!==sd.Vertical&&(G=R.deltaY*U,Z=0),P.translateBy($,-(G/N)*s,-(Z/N)*s,{internal:!0});const ee=Dv($.property("__zoom")),{onViewportChangeStart:J,onViewportChange:j,onViewportChangeEnd:Q}=w.getState();clearTimeout(M.current),L.current||(L.current=!0,t==null||t(R,ee),J==null||J(ee)),L.current&&(e==null||e(R,ee),j==null||j(ee),M.current=setTimeout(()=>{n==null||n(R,ee),Q==null||Q(ee),L.current=!1},150))},{passive:!1}):typeof O<"u"&&$.on("wheel.zoom",function(R,N){if(!b||pf(R,g))return null;R.preventDefault(),O.call(this,R,N)},{passive:!1}))},[E,a,l,$,P,O,A,o,b,g,t,e,n]),I.useEffect(()=>{P&&P.on("start",R=>{var U,G;if(!R.sourceEvent||R.sourceEvent.internal)return null;D.current=(U=R.sourceEvent)==null?void 0:U.button;const{onViewportChangeStart:N}=w.getState(),B=Dv(R.transform);x.current=!0,T.current=B,((G=R.sourceEvent)==null?void 0:G.type)==="mousedown"&&w.setState({paneDragging:!0}),N==null||N(B),t==null||t(R.sourceEvent,B)})},[P,t]),I.useEffect(()=>{P&&(E&&!x.current?P.on("zoom",null):E||P.on("zoom",R=>{var B;const{onViewportChange:N}=w.getState();if(w.setState({transform:[R.transform.x,R.transform.y,R.transform.k]}),C.current=!!(r&&E9(d,D.current??0)),(e||N)&&!((B=R.sourceEvent)!=null&&B.internal)){const U=Dv(R.transform);N==null||N(U),e==null||e(R.sourceEvent,U)}}))},[E,P,e,d,r]),I.useEffect(()=>{P&&P.on("end",R=>{if(!R.sourceEvent||R.sourceEvent.internal)return null;const{onViewportChangeEnd:N}=w.getState();if(x.current=!1,w.setState({paneDragging:!1}),r&&E9(d,D.current??0)&&!C.current&&r(R.sourceEvent),C.current=!1,(n||N)&&l_e(T.current,R.transform)){const B=Dv(R.transform);T.current=B,clearTimeout(S.current),S.current=setTimeout(()=>{N==null||N(B),n==null||n(R.sourceEvent,B)},a?150:0)}})},[P,a,d,n,r]),I.useEffect(()=>{P&&P.filter(R=>{const N=A||i,B=o&&R.ctrlKey;if(R.button===1&&R.type==="mousedown"&&(pf(R,"react-flow__node")||pf(R,"react-flow__edge")))return!0;if(!d&&!N&&!a&&!u&&!o||E||!u&&R.type==="dblclick"||pf(R,g)&&R.type==="wheel"||pf(R,v)&&R.type!=="wheel"||!o&&R.ctrlKey&&R.type==="wheel"||!N&&!a&&!B&&R.type==="wheel"||!d&&(R.type==="mousedown"||R.type==="touchstart")||Array.isArray(d)&&!d.includes(R.button)&&(R.type==="mousedown"||R.type==="touchstart"))return!1;const U=Array.isArray(d)&&d.includes(R.button)||!R.button||R.button<=1;return(!R.ctrlKey||R.type==="wheel")&&U})},[E,P,i,o,a,u,d,c,A]),W.jsx("div",{className:"react-flow__renderer",ref:k,style:gA,children:y})},d_e=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function f_e(){const{userSelectionActive:e,userSelectionRect:t}=_r(d_e,Oo);return e&&t?W.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function k9(e,t){const n=e.find(r=>r.id===t.parentNode);if(n){const r=t.position.x+t.width-n.width,i=t.position.y+t.height-n.height;if(r>0||i>0||t.position.x<0||t.position.y<0){if(n.style={...n.style},n.style.width=n.style.width??n.width,n.style.height=n.style.height??n.height,r>0&&(n.style.width+=r),i>0&&(n.style.height+=i),t.position.x<0){const o=Math.abs(t.position.x);n.position.x=n.position.x-o,n.style.width+=o,t.position.x=0}if(t.position.y<0){const o=Math.abs(t.position.y);n.position.y=n.position.y-o,n.style.height+=o,t.position.y=0}n.width=n.style.width,n.height=n.style.height}}}function wV(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,i)=>{const o=e.filter(s=>s.id===i.id);if(o.length===0)return r.push(i),r;const a={...i};for(const s of o)if(s)switch(s.type){case"select":{a.selected=s.selected;break}case"position":{typeof s.position<"u"&&(a.position=s.position),typeof s.positionAbsolute<"u"&&(a.positionAbsolute=s.positionAbsolute),typeof s.dragging<"u"&&(a.dragging=s.dragging),a.expandParent&&k9(r,a);break}case"dimensions":{typeof s.dimensions<"u"&&(a.width=s.dimensions.width,a.height=s.dimensions.height),typeof s.updateStyle<"u"&&(a.style={...a.style||{},...s.dimensions}),typeof s.resizing=="boolean"&&(a.resizing=s.resizing),a.expandParent&&k9(r,a);break}case"remove":return r}return r.push(a),r},n)}function Gc(e,t){return wV(e,t)}function Nc(e,t){return wV(e,t)}const Su=(e,t)=>({id:e,type:"select",selected:t});function jf(e,t){return e.reduce((n,r)=>{const i=t.includes(r.id);return!r.selected&&i?(r.selected=!0,n.push(Su(r.id,!0))):r.selected&&!i&&(r.selected=!1,n.push(Su(r.id,!1))),n},[])}const zC=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},h_e=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),CV=I.memo(({isSelecting:e,selectionMode:t=uc.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:i,onPaneClick:o,onPaneContextMenu:a,onPaneScroll:s,onPaneMouseEnter:l,onPaneMouseMove:u,onPaneMouseLeave:c,children:d})=>{const f=I.useRef(null),h=pi(),p=I.useRef(0),m=I.useRef(0),_=I.useRef(),{userSelectionActive:b,elementsSelectable:y,dragging:g}=_r(h_e,Oo),v=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),p.current=0,m.current=0},S=O=>{o==null||o(O),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},w=O=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){O.preventDefault();return}a==null||a(O)},x=s?O=>s(O):void 0,C=O=>{const{resetSelectedElements:E,domNode:A}=h.getState();if(_.current=A==null?void 0:A.getBoundingClientRect(),!y||!e||O.button!==0||O.target!==f.current||!_.current)return;const{x:D,y:L}=Yu(O,_.current);E(),h.setState({userSelectionRect:{width:0,height:0,startX:D,startY:L,x:D,y:L}}),r==null||r(O)},k=O=>{const{userSelectionRect:E,nodeInternals:A,edges:D,transform:L,onNodesChange:M,onEdgesChange:R,nodeOrigin:N,getNodes:B}=h.getState();if(!e||!_.current||!E)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const U=Yu(O,_.current),G=E.startX??0,Z=E.startY??0,ee={...E,x:U.x<G?U.x:G,y:U.y<Z?U.y:Z,width:Math.abs(U.x-G),height:Math.abs(U.y-Z)},J=B(),j=oV(A,ee,L,t===uc.Partial,!0,N),Q=fA(j,D).map(se=>se.id),ne=j.map(se=>se.id);if(p.current!==ne.length){p.current=ne.length;const se=jf(J,ne);se.length&&(M==null||M(se))}if(m.current!==Q.length){m.current=Q.length;const se=jf(D,Q);se.length&&(R==null||R(se))}h.setState({userSelectionRect:ee})},T=O=>{if(O.button!==0)return;const{userSelectionRect:E}=h.getState();!b&&E&&O.target===f.current&&(S==null||S(O)),h.setState({nodesSelectionActive:p.current>0}),v(),i==null||i(O)},P=O=>{b&&(h.setState({nodesSelectionActive:p.current>0}),i==null||i(O)),v()},$=y&&(e||b);return W.jsxs("div",{className:Aa(["react-flow__pane",{dragging:g,selection:e}]),onClick:$?void 0:zC(S,f),onContextMenu:zC(w,f),onWheel:zC(x,f),onMouseEnter:$?void 0:l,onMouseDown:$?C:void 0,onMouseMove:$?k:u,onMouseUp:$?T:void 0,onMouseLeave:$?P:c,ref:f,style:gA,children:[d,W.jsx(f_e,{})]})});CV.displayName="Pane";function EV(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:EV(n,t):!1}function A9(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function p_e(e,t,n,r){return Array.from(e.values()).filter(i=>(i.selected||i.id===r)&&(!i.parentNode||!EV(i,e))&&(i.draggable||t&&typeof i.draggable>"u")).map(i=>{var o,a;return{id:i.id,position:i.position||{x:0,y:0},positionAbsolute:i.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((o=i.positionAbsolute)==null?void 0:o.x)??0),y:n.y-(((a=i.positionAbsolute)==null?void 0:a.y)??0)},delta:{x:0,y:0},extent:i.extent,parentNode:i.parentNode,width:i.width,height:i.height}})}function g_e(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function TV(e,t,n,r,i=[0,0],o){const a=g_e(e,e.extent||r);let s=a;if(e.extent==="parent")if(e.parentNode&&e.width&&e.height){const c=n.get(e.parentNode),{x:d,y:f}=yh(c,i).positionAbsolute;s=c&&_a(d)&&_a(f)&&_a(c.width)&&_a(c.height)?[[d+e.width*i[0],f+e.height*i[1]],[d+c.width-e.width+e.width*i[0],f+c.height-e.height+e.height*i[1]]]:s}else o==null||o("005",Kl.error005()),s=a;else if(e.extent&&e.parentNode){const c=n.get(e.parentNode),{x:d,y:f}=yh(c,i).positionAbsolute;s=[[e.extent[0][0]+d,e.extent[0][1]+f],[e.extent[1][0]+d,e.extent[1][1]+f]]}let l={x:0,y:0};if(e.parentNode){const c=n.get(e.parentNode);l=yh(c,i).positionAbsolute}const u=s&&s!=="parent"?aA(t,s):t;return{position:{x:u.x-l.x,y:u.y-l.y},positionAbsolute:u}}function jC({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(i=>({...n.get(i.id),position:i.position,positionAbsolute:i.positionAbsolute}));return[e?r.find(i=>i.id===e):r[0],r]}const P9=(e,t,n,r)=>{const i=t.querySelectorAll(e);if(!i||!i.length)return null;const o=Array.from(i),a=t.getBoundingClientRect(),s={x:a.width*r[0],y:a.height*r[1]};return o.map(l=>{const u=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(u.left-a.left-s.x)/n,y:(u.top-a.top-s.y)/n,...oA(l)}})};function Zp(e,t,n){return n===void 0?n:r=>{const i=t().nodeInternals.get(e);i&&n(r,{...i})}}function FE({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:a,nodeInternals:s,onError:l}=t.getState(),u=s.get(e);if(!u){l==null||l("012",Kl.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(o({nodes:[u]}),requestAnimationFrame(()=>{var c;return(c=r==null?void 0:r.current)==null?void 0:c.blur()})):i([e])}function m_e(){const e=pi();return I.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:i,snapToGrid:o}=e.getState(),a=n.touches?n.touches[0].clientX:n.clientX,s=n.touches?n.touches[0].clientY:n.clientY,l={x:(a-r[0])/r[2],y:(s-r[1])/r[2]};return{xSnapped:o?i[0]*Math.round(l.x/i[0]):l.x,ySnapped:o?i[1]*Math.round(l.y/i[1]):l.y,...l}},[])}function UC(e){return(t,n,r)=>e==null?void 0:e(t,r)}function kV({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,selectNodesOnDrag:a}){const s=pi(),[l,u]=I.useState(!1),c=I.useRef([]),d=I.useRef({x:null,y:null}),f=I.useRef(0),h=I.useRef(null),p=I.useRef({x:0,y:0}),m=I.useRef(null),_=I.useRef(!1),b=m_e();return I.useEffect(()=>{if(e!=null&&e.current){const y=Ka(e.current),g=({x:S,y:w})=>{const{nodeInternals:x,onNodeDrag:C,onSelectionDrag:k,updateNodePositions:T,nodeExtent:P,snapGrid:$,snapToGrid:O,nodeOrigin:E,onError:A}=s.getState();d.current={x:S,y:w};let D=!1,L={x:0,y:0,x2:0,y2:0};if(c.current.length>1&&P){const R=dA(c.current,E);L=g0(R)}if(c.current=c.current.map(R=>{const N={x:S-R.distance.x,y:w-R.distance.y};O&&(N.x=$[0]*Math.round(N.x/$[0]),N.y=$[1]*Math.round(N.y/$[1]));const B=[[P[0][0],P[0][1]],[P[1][0],P[1][1]]];c.current.length>1&&P&&!R.extent&&(B[0][0]=R.positionAbsolute.x-L.x+P[0][0],B[1][0]=R.positionAbsolute.x+(R.width??0)-L.x2+P[1][0],B[0][1]=R.positionAbsolute.y-L.y+P[0][1],B[1][1]=R.positionAbsolute.y+(R.height??0)-L.y2+P[1][1]);const U=TV(R,N,x,B,E,A);return D=D||R.position.x!==U.position.x||R.position.y!==U.position.y,R.position=U.position,R.positionAbsolute=U.positionAbsolute,R}),!D)return;T(c.current,!0,!0),u(!0);const M=i?C:UC(k);if(M&&m.current){const[R,N]=jC({nodeId:i,dragItems:c.current,nodeInternals:x});M(m.current,R,N)}},v=()=>{if(!h.current)return;const[S,w]=HU(p.current,h.current);if(S!==0||w!==0){const{transform:x,panBy:C}=s.getState();d.current.x=(d.current.x??0)-S/x[2],d.current.y=(d.current.y??0)-w/x[2],C({x:S,y:w})&&g(d.current)}f.current=requestAnimationFrame(v)};if(t)y.on(".drag",null);else{const S=Eve().on("start",w=>{var D;const{nodeInternals:x,multiSelectionActive:C,domNode:k,nodesDraggable:T,unselectNodesAndEdges:P,onNodeDragStart:$,onSelectionDragStart:O}=s.getState(),E=i?$:UC(O);!a&&!C&&i&&((D=x.get(i))!=null&&D.selected||P()),i&&o&&a&&FE({id:i,store:s,nodeRef:e});const A=b(w);if(d.current=A,c.current=p_e(x,T,A,i),E&&c.current){const[L,M]=jC({nodeId:i,dragItems:c.current,nodeInternals:x});E(w.sourceEvent,L,M)}h.current=(k==null?void 0:k.getBoundingClientRect())||null,p.current=Yu(w.sourceEvent,h.current)}).on("drag",w=>{const x=b(w),{autoPanOnNodeDrag:C}=s.getState();!_.current&&C&&(_.current=!0,v()),(d.current.x!==x.xSnapped||d.current.y!==x.ySnapped)&&c.current&&(m.current=w.sourceEvent,p.current=Yu(w.sourceEvent,h.current),g(x))}).on("end",w=>{if(u(!1),_.current=!1,cancelAnimationFrame(f.current),c.current){const{updateNodePositions:x,nodeInternals:C,onNodeDragStop:k,onSelectionDragStop:T}=s.getState(),P=i?k:UC(T);if(x(c.current,!1,!1),P){const[$,O]=jC({nodeId:i,dragItems:c.current,nodeInternals:C});P(w.sourceEvent,$,O)}}}).filter(w=>{const x=w.target;return!w.button&&(!n||!A9(x,`.${n}`,e))&&(!r||A9(x,r,e))});return y.call(S),()=>{y.on(".drag",null)}}}},[e,t,n,r,o,s,i,a,b]),l}function AV(){const e=pi();return I.useCallback(n=>{const{nodeInternals:r,nodeExtent:i,updateNodePositions:o,getNodes:a,snapToGrid:s,snapGrid:l,onError:u,nodesDraggable:c}=e.getState(),d=a().filter(y=>y.selected&&(y.draggable||c&&typeof y.draggable>"u")),f=s?l[0]:5,h=s?l[1]:5,p=n.isShiftPressed?4:1,m=n.x*f*p,_=n.y*h*p,b=d.map(y=>{if(y.positionAbsolute){const g={x:y.positionAbsolute.x+m,y:y.positionAbsolute.y+_};s&&(g.x=l[0]*Math.round(g.x/l[0]),g.y=l[1]*Math.round(g.y/l[1]));const{positionAbsolute:v,position:S}=TV(y,g,r,i,void 0,u);y.position=S,y.positionAbsolute=v}return y});o(b,!0,!1)},[])}const vh={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Jp=e=>{const t=({id:n,type:r,data:i,xPos:o,yPos:a,xPosOrigin:s,yPosOrigin:l,selected:u,onClick:c,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,onContextMenu:p,onDoubleClick:m,style:_,className:b,isDraggable:y,isSelectable:g,isConnectable:v,isFocusable:S,selectNodesOnDrag:w,sourcePosition:x,targetPosition:C,hidden:k,resizeObserver:T,dragHandle:P,zIndex:$,isParent:O,noDragClassName:E,noPanClassName:A,initialized:D,disableKeyboardA11y:L,ariaLabel:M,rfId:R})=>{const N=pi(),B=I.useRef(null),U=I.useRef(x),G=I.useRef(C),Z=I.useRef(r),ee=g||y||c||d||f||h,J=AV(),j=Zp(n,N.getState,d),Q=Zp(n,N.getState,f),ne=Zp(n,N.getState,h),se=Zp(n,N.getState,p),ye=Zp(n,N.getState,m),ce=ze=>{if(g&&(!w||!y)&&FE({id:n,store:N,nodeRef:B}),c){const mt=N.getState().nodeInternals.get(n);mt&&c(ze,{...mt})}},bt=ze=>{if(!NE(ze))if(XU.includes(ze.key)&&g){const mt=ze.key==="Escape";FE({id:n,store:N,unselect:mt,nodeRef:B})}else!L&&y&&u&&Object.prototype.hasOwnProperty.call(vh,ze.key)&&(N.setState({ariaLiveMessage:`Moved selected node ${ze.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~a}`}),J({x:vh[ze.key].x,y:vh[ze.key].y,isShiftPressed:ze.shiftKey}))};I.useEffect(()=>{if(B.current&&!k){const ze=B.current;return T==null||T.observe(ze),()=>T==null?void 0:T.unobserve(ze)}},[k]),I.useEffect(()=>{const ze=Z.current!==r,mt=U.current!==x,Pe=G.current!==C;B.current&&(ze||mt||Pe)&&(ze&&(Z.current=r),mt&&(U.current=x),Pe&&(G.current=C),N.getState().updateNodeDimensions([{id:n,nodeElement:B.current,forceUpdate:!0}]))},[n,r,x,C]);const ot=kV({nodeRef:B,disabled:k||!y,noDragClassName:E,handleSelector:P,nodeId:n,isSelectable:g,selectNodesOnDrag:w});return k?null:W.jsx("div",{className:Aa(["react-flow__node",`react-flow__node-${r}`,{[A]:y},b,{selected:u,selectable:g,parent:O,dragging:ot}]),ref:B,style:{zIndex:$,transform:`translate(${s}px,${l}px)`,pointerEvents:ee?"all":"none",visibility:D?"visible":"hidden",..._},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:j,onMouseMove:Q,onMouseLeave:ne,onContextMenu:se,onClick:ce,onDoubleClick:ye,onKeyDown:S?bt:void 0,tabIndex:S?0:void 0,role:S?"button":void 0,"aria-describedby":L?void 0:`${yV}-${R}`,"aria-label":M,children:W.jsx(Pbe,{value:n,children:W.jsx(e,{id:n,data:i,type:r,xPos:o,yPos:a,selected:u,isConnectable:v,sourcePosition:x,targetPosition:C,dragging:ot,dragHandle:P,zIndex:$})})})};return t.displayName="NodeWrapper",I.memo(t)};const y_e=e=>{const t=e.getNodes().filter(n=>n.selected);return{...dA(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function v_e({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=pi(),{width:i,height:o,x:a,y:s,transformString:l,userSelectionActive:u}=_r(y_e,Oo),c=AV(),d=I.useRef(null);if(I.useEffect(()=>{var p;n||(p=d.current)==null||p.focus({preventScroll:!0})},[n]),kV({nodeRef:d}),u||!i||!o)return null;const f=e?p=>{const m=r.getState().getNodes().filter(_=>_.selected);e(p,m)}:void 0,h=p=>{Object.prototype.hasOwnProperty.call(vh,p.key)&&c({x:vh[p.key].x,y:vh[p.key].y,isShiftPressed:p.shiftKey})};return W.jsx("div",{className:Aa(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:W.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:i,height:o,top:s,left:a}})})}var b_e=I.memo(v_e);const __e=e=>e.nodesSelectionActive,PV=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:a,deleteKeyCode:s,onMove:l,onMoveStart:u,onMoveEnd:c,selectionKeyCode:d,selectionOnDrag:f,selectionMode:h,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:_,panActivationKeyCode:b,zoomActivationKeyCode:y,elementsSelectable:g,zoomOnScroll:v,zoomOnPinch:S,panOnScroll:w,panOnScrollSpeed:x,panOnScrollMode:C,zoomOnDoubleClick:k,panOnDrag:T,defaultViewport:P,translateExtent:$,minZoom:O,maxZoom:E,preventScrolling:A,onSelectionContextMenu:D,noWheelClassName:L,noPanClassName:M,disableKeyboardA11y:R})=>{const N=_r(__e),B=m0(d),G=m0(b)||T,Z=B||f&&G!==!0;return a_e({deleteKeyCode:s,multiSelectionKeyCode:_}),W.jsx(c_e,{onMove:l,onMoveStart:u,onMoveEnd:c,onPaneContextMenu:o,elementsSelectable:g,zoomOnScroll:v,zoomOnPinch:S,panOnScroll:w,panOnScrollSpeed:x,panOnScrollMode:C,zoomOnDoubleClick:k,panOnDrag:!B&&G,defaultViewport:P,translateExtent:$,minZoom:O,maxZoom:E,zoomActivationKeyCode:y,preventScrolling:A,noWheelClassName:L,noPanClassName:M,children:W.jsxs(CV,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:a,panOnDrag:G,isSelecting:!!Z,selectionMode:h,children:[e,N&&W.jsx(b_e,{onSelectionContextMenu:D,noPanClassName:M,disableKeyboardA11y:R})]})})};PV.displayName="FlowRenderer";var S_e=I.memo(PV);function x_e(e){return _r(I.useCallback(n=>e?oV(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function w_e(e){const t={input:Jp(e.input||hV),default:Jp(e.default||LE),output:Jp(e.output||gV),group:Jp(e.group||pA)},n={},r=Object.keys(e).filter(i=>!["input","default","output","group"].includes(i)).reduce((i,o)=>(i[o]=Jp(e[o]||LE),i),n);return{...t,...r}}const C_e=({x:e,y:t,width:n,height:r,origin:i})=>!n||!r?{x:e,y:t}:i[0]<0||i[1]<0||i[0]>1||i[1]>1?{x:e,y:t}:{x:e-n*i[0],y:t-r*i[1]},E_e=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),IV=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,updateNodeDimensions:o,onError:a}=_r(E_e,Oo),s=x_e(e.onlyRenderVisibleElements),l=I.useRef(),u=I.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const c=new ResizeObserver(d=>{const f=d.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));o(f)});return l.current=c,c},[]);return I.useEffect(()=>()=>{var c;(c=l==null?void 0:l.current)==null||c.disconnect()},[]),W.jsx("div",{className:"react-flow__nodes",style:gA,children:s.map(c=>{var S,w;let d=c.type||"default";e.nodeTypes[d]||(a==null||a("003",Kl.error003(d)),d="default");const f=e.nodeTypes[d]||e.nodeTypes.default,h=!!(c.draggable||t&&typeof c.draggable>"u"),p=!!(c.selectable||i&&typeof c.selectable>"u"),m=!!(c.connectable||n&&typeof c.connectable>"u"),_=!!(c.focusable||r&&typeof c.focusable>"u"),b=e.nodeExtent?aA(c.positionAbsolute,e.nodeExtent):c.positionAbsolute,y=(b==null?void 0:b.x)??0,g=(b==null?void 0:b.y)??0,v=C_e({x:y,y:g,width:c.width??0,height:c.height??0,origin:e.nodeOrigin});return W.jsx(f,{id:c.id,className:c.className,style:c.style,type:d,data:c.data,sourcePosition:c.sourcePosition||tt.Bottom,targetPosition:c.targetPosition||tt.Top,hidden:c.hidden,xPos:y,yPos:g,xPosOrigin:v.x,yPosOrigin:v.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!c.selected,isDraggable:h,isSelectable:p,isConnectable:m,isFocusable:_,resizeObserver:u,dragHandle:c.dragHandle,zIndex:((S=c[Qr])==null?void 0:S.z)??0,isParent:!!((w=c[Qr])!=null&&w.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!c.width&&!!c.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:c.ariaLabel},c.id)})})};IV.displayName="NodeRenderer";var T_e=I.memo(IV);const k_e=(e,t,n)=>n===tt.Left?e-t:n===tt.Right?e+t:e,A_e=(e,t,n)=>n===tt.Top?e-t:n===tt.Bottom?e+t:e,I9="react-flow__edgeupdater",R9=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:a,type:s})=>W.jsx("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:a,className:Aa([I9,`${I9}-${s}`]),cx:k_e(t,r,e),cy:A_e(n,r,e),r,stroke:"transparent",fill:"transparent"}),P_e=()=>!0;var gf=e=>{const t=({id:n,className:r,type:i,data:o,onClick:a,onEdgeDoubleClick:s,selected:l,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,style:_,source:b,target:y,sourceX:g,sourceY:v,targetX:S,targetY:w,sourcePosition:x,targetPosition:C,elementsSelectable:k,hidden:T,sourceHandleId:P,targetHandleId:$,onContextMenu:O,onMouseEnter:E,onMouseMove:A,onMouseLeave:D,edgeUpdaterRadius:L,onEdgeUpdate:M,onEdgeUpdateStart:R,onEdgeUpdateEnd:N,markerEnd:B,markerStart:U,rfId:G,ariaLabel:Z,isFocusable:ee,isUpdatable:J,pathOptions:j,interactionWidth:Q})=>{const ne=I.useRef(null),[se,ye]=I.useState(!1),[ce,bt]=I.useState(!1),ot=pi(),ze=I.useMemo(()=>`url(#${DE(U,G)})`,[U,G]),mt=I.useMemo(()=>`url(#${DE(B,G)})`,[B,G]);if(T)return null;const Pe=Bn=>{const{edges:_n,addSelectedEdges:Mi}=ot.getState();if(k&&(ot.setState({nodesSelectionActive:!1}),Mi([n])),a){const gi=_n.find(Qi=>Qi.id===n);a(Bn,gi)}},en=Yp(n,ot.getState,s),Pr=Yp(n,ot.getState,O),Ln=Yp(n,ot.getState,E),An=Yp(n,ot.getState,A),tn=Yp(n,ot.getState,D),Fn=(Bn,_n)=>{if(Bn.button!==0)return;const{edges:Mi,isValidConnection:gi}=ot.getState(),Qi=_n?y:b,Da=(_n?$:P)||null,Rr=_n?"target":"source",po=gi||P_e,al=_n,Do=Mi.find(nn=>nn.id===n);bt(!0),R==null||R(Bn,Do,Rr);const sl=nn=>{bt(!1),N==null||N(nn,Do,Rr)};uV({event:Bn,handleId:Da,nodeId:Qi,onConnect:nn=>M==null?void 0:M(Do,nn),isTarget:al,getState:ot.getState,setState:ot.setState,isValidConnection:po,edgeUpdaterType:Rr,onEdgeUpdateEnd:sl})},Ir=Bn=>Fn(Bn,!0),ho=Bn=>Fn(Bn,!1),ei=()=>ye(!0),pr=()=>ye(!1),Br=!k&&!a,ti=Bn=>{var _n;if(XU.includes(Bn.key)&&k){const{unselectNodesAndEdges:Mi,addSelectedEdges:gi,edges:Qi}=ot.getState();Bn.key==="Escape"?((_n=ne.current)==null||_n.blur(),Mi({edges:[Qi.find(Rr=>Rr.id===n)]})):gi([n])}};return W.jsxs("g",{className:Aa(["react-flow__edge",`react-flow__edge-${i}`,r,{selected:l,animated:u,inactive:Br,updating:se}]),onClick:Pe,onDoubleClick:en,onContextMenu:Pr,onMouseEnter:Ln,onMouseMove:An,onMouseLeave:tn,onKeyDown:ee?ti:void 0,tabIndex:ee?0:void 0,role:ee?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":Z===null?void 0:Z||`Edge from ${b} to ${y}`,"aria-describedby":ee?`${vV}-${G}`:void 0,ref:ne,children:[!ce&&W.jsx(e,{id:n,source:b,target:y,selected:l,animated:u,label:c,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:p,labelBgBorderRadius:m,data:o,style:_,sourceX:g,sourceY:v,targetX:S,targetY:w,sourcePosition:x,targetPosition:C,sourceHandleId:P,targetHandleId:$,markerStart:ze,markerEnd:mt,pathOptions:j,interactionWidth:Q}),J&&W.jsxs(W.Fragment,{children:[(J==="source"||J===!0)&&W.jsx(R9,{position:x,centerX:g,centerY:v,radius:L,onMouseDown:Ir,onMouseEnter:ei,onMouseOut:pr,type:"source"}),(J==="target"||J===!0)&&W.jsx(R9,{position:C,centerX:S,centerY:w,radius:L,onMouseDown:ho,onMouseEnter:ei,onMouseOut:pr,type:"target"})]})]})};return t.displayName="EdgeWrapper",I.memo(t)};function I_e(e){const t={default:gf(e.default||N_),straight:gf(e.bezier||uA),step:gf(e.step||lA),smoothstep:gf(e.step||Y2),simplebezier:gf(e.simplebezier||sA)},n={},r=Object.keys(e).filter(i=>!["default","bezier"].includes(i)).reduce((i,o)=>(i[o]=gf(e[o]||N_),i),n);return{...t,...r}}function O9(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,i=((n==null?void 0:n.y)||0)+t.y,o=(n==null?void 0:n.width)||t.width,a=(n==null?void 0:n.height)||t.height;switch(e){case tt.Top:return{x:r+o/2,y:i};case tt.Right:return{x:r+o,y:i+a/2};case tt.Bottom:return{x:r+o/2,y:i+a};case tt.Left:return{x:r,y:i+a/2}}}function M9(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const R_e=(e,t,n,r,i,o)=>{const a=O9(n,e,t),s=O9(o,r,i);return{sourceX:a.x,sourceY:a.y,targetX:s.x,targetY:s.y}};function O_e({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:i,targetHeight:o,width:a,height:s,transform:l}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+r,t.y+o)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c=g0({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:a/l[2],height:s/l[2]}),d=Math.max(0,Math.min(c.x2,u.x2)-Math.max(c.x,u.x)),f=Math.max(0,Math.min(c.y2,u.y2)-Math.max(c.y,u.y));return Math.ceil(d*f)>0}function N9(e){var r,i,o,a,s;const t=((r=e==null?void 0:e[Qr])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.x)<"u"&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.y)<"u";return[{x:((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.x)||0,y:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const M_e=[{level:0,isMaxLevel:!0,edges:[]}];function N_e(e,t,n=!1){let r=-1;const i=e.reduce((a,s)=>{var c,d;const l=_a(s.zIndex);let u=l?s.zIndex:0;if(n){const f=t.get(s.target),h=t.get(s.source),p=s.selected||(f==null?void 0:f.selected)||(h==null?void 0:h.selected),m=Math.max(((c=h==null?void 0:h[Qr])==null?void 0:c.z)||0,((d=f==null?void 0:f[Qr])==null?void 0:d.z)||0,1e3);u=(l?s.zIndex:0)+(p?m:0)}return a[u]?a[u].push(s):a[u]=[s],r=u>r?u:r,a},{}),o=Object.entries(i).map(([a,s])=>{const l=+a;return{edges:s,level:l,isMaxLevel:l===r}});return o.length===0?M_e:o}function $_e(e,t,n){const r=_r(I.useCallback(i=>e?i.edges.filter(o=>{const a=t.get(o.source),s=t.get(o.target);return(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&O_e({sourcePos:a.positionAbsolute||{x:0,y:0},targetPos:s.positionAbsolute||{x:0,y:0},sourceWidth:a.width,sourceHeight:a.height,targetWidth:s.width,targetHeight:s.height,width:i.width,height:i.height,transform:i.transform})}):i.edges,[e,t]));return N_e(r,t,n)}const D_e=({color:e="none",strokeWidth:t=1})=>W.jsx("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:"none",points:"-5,-4 0,0 -5,4"}),L_e=({color:e="none",strokeWidth:t=1})=>W.jsx("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:e,points:"-5,-4 0,0 -5,4 -5,-4"}),$9={[M_.Arrow]:D_e,[M_.ArrowClosed]:L_e};function F_e(e){const t=pi();return I.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call($9,e)?$9[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",Kl.error009(e)),null)},[e])}const B_e=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:a,orient:s="auto-start-reverse"})=>{const l=F_e(t);return l?W.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:s,refX:"0",refY:"0",children:W.jsx(l,{color:n,strokeWidth:a})}):null},z_e=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((i,o)=>([o.markerStart,o.markerEnd].forEach(a=>{if(a&&typeof a=="object"){const s=DE(a,t);r.includes(s)||(i.push({id:s,color:a.color||e,...a}),r.push(s))}}),i),[]).sort((i,o)=>i.id.localeCompare(o.id))},RV=({defaultColor:e,rfId:t})=>{const n=_r(I.useCallback(z_e({defaultColor:e,rfId:t}),[e,t]),(r,i)=>!(r.length!==i.length||r.some((o,a)=>o.id!==i[a].id)));return W.jsx("defs",{children:n.map(r=>W.jsx(B_e,{id:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient},r.id))})};RV.displayName="MarkerDefinitions";var j_e=I.memo(RV);const U_e=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),OV=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:i,noPanClassName:o,onEdgeUpdate:a,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:u,onEdgeMouseLeave:c,onEdgeClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:h,onEdgeUpdateStart:p,onEdgeUpdateEnd:m,children:_})=>{const{edgesFocusable:b,edgesUpdatable:y,elementsSelectable:g,width:v,height:S,connectionMode:w,nodeInternals:x,onError:C}=_r(U_e,Oo),k=$_e(t,x,n);return v?W.jsxs(W.Fragment,{children:[k.map(({level:T,edges:P,isMaxLevel:$})=>W.jsxs("svg",{style:{zIndex:T},width:v,height:S,className:"react-flow__edges react-flow__container",children:[$&&W.jsx(j_e,{defaultColor:e,rfId:r}),W.jsx("g",{children:P.map(O=>{const[E,A,D]=N9(x.get(O.source)),[L,M,R]=N9(x.get(O.target));if(!D||!R)return null;let N=O.type||"default";i[N]||(C==null||C("011",Kl.error011(N)),N="default");const B=i[N]||i.default,U=w===Dd.Strict?M.target:(M.target??[]).concat(M.source??[]),G=M9(A.source,O.sourceHandle),Z=M9(U,O.targetHandle),ee=(G==null?void 0:G.position)||tt.Bottom,J=(Z==null?void 0:Z.position)||tt.Top,j=!!(O.focusable||b&&typeof O.focusable>"u"),Q=typeof a<"u"&&(O.updatable||y&&typeof O.updatable>"u");if(!G||!Z)return C==null||C("008",Kl.error008(G,O)),null;const{sourceX:ne,sourceY:se,targetX:ye,targetY:ce}=R_e(E,G,ee,L,Z,J);return W.jsx(B,{id:O.id,className:Aa([O.className,o]),type:N,data:O.data,selected:!!O.selected,animated:!!O.animated,hidden:!!O.hidden,label:O.label,labelStyle:O.labelStyle,labelShowBg:O.labelShowBg,labelBgStyle:O.labelBgStyle,labelBgPadding:O.labelBgPadding,labelBgBorderRadius:O.labelBgBorderRadius,style:O.style,source:O.source,target:O.target,sourceHandleId:O.sourceHandle,targetHandleId:O.targetHandle,markerEnd:O.markerEnd,markerStart:O.markerStart,sourceX:ne,sourceY:se,targetX:ye,targetY:ce,sourcePosition:ee,targetPosition:J,elementsSelectable:g,onEdgeUpdate:a,onContextMenu:s,onMouseEnter:l,onMouseMove:u,onMouseLeave:c,onClick:d,edgeUpdaterRadius:f,onEdgeDoubleClick:h,onEdgeUpdateStart:p,onEdgeUpdateEnd:m,rfId:r,ariaLabel:O.ariaLabel,isFocusable:j,isUpdatable:Q,pathOptions:"pathOptions"in O?O.pathOptions:void 0,interactionWidth:O.interactionWidth},O.id)})})]},T)),_]}):null};OV.displayName="EdgeRenderer";var V_e=I.memo(OV);const G_e=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function q_e({children:e}){const t=_r(G_e);return W.jsx("div",{className:"react-flow__viewport react-flow__container",style:{transform:t},children:e})}function H_e(e){const t=xV(),n=I.useRef(!1);I.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const W_e={[tt.Left]:tt.Right,[tt.Right]:tt.Left,[tt.Top]:tt.Bottom,[tt.Bottom]:tt.Top},MV=({nodeId:e,handleType:t,style:n,type:r=Au.Bezier,CustomComponent:i,connectionStatus:o})=>{var w,x,C;const{fromNode:a,handleId:s,toX:l,toY:u,connectionMode:c}=_r(I.useCallback(k=>({fromNode:k.nodeInternals.get(e),handleId:k.connectionHandleId,toX:(k.connectionPosition.x-k.transform[0])/k.transform[2],toY:(k.connectionPosition.y-k.transform[1])/k.transform[2],connectionMode:k.connectionMode}),[e]),Oo),d=(w=a==null?void 0:a[Qr])==null?void 0:w.handleBounds;let f=d==null?void 0:d[t];if(c===Dd.Loose&&(f=f||(d==null?void 0:d[t==="source"?"target":"source"])),!a||!f)return null;const h=s?f.find(k=>k.id===s):f[0],p=h?h.x+h.width/2:(a.width??0)/2,m=h?h.y+h.height/2:a.height??0,_=(((x=a.positionAbsolute)==null?void 0:x.x)??0)+p,b=(((C=a.positionAbsolute)==null?void 0:C.y)??0)+m,y=h==null?void 0:h.position,g=y?W_e[y]:null;if(!y||!g)return null;if(i)return W.jsx(i,{connectionLineType:r,connectionLineStyle:n,fromNode:a,fromHandle:h,fromX:_,fromY:b,toX:l,toY:u,fromPosition:y,toPosition:g,connectionStatus:o});let v="";const S={sourceX:_,sourceY:b,sourcePosition:y,targetX:l,targetY:u,targetPosition:g};return r===Au.Bezier?[v]=tV(S):r===Au.Step?[v]=$E({...S,borderRadius:0}):r===Au.SmoothStep?[v]=$E(S):r===Au.SimpleBezier?[v]=eV(S):v=`M${_},${b} ${l},${u}`,W.jsx("path",{d:v,fill:"none",className:"react-flow__connection-path",style:n})};MV.displayName="ConnectionLine";const K_e=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Q_e({containerStyle:e,style:t,type:n,component:r}){const{nodeId:i,handleType:o,nodesConnectable:a,width:s,height:l,connectionStatus:u}=_r(K_e,Oo);return!(i&&o&&s&&a)?null:W.jsx("svg",{style:e,width:s,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container",children:W.jsx("g",{className:Aa(["react-flow__connection",u]),children:W.jsx(MV,{nodeId:i,handleType:o,style:t,type:n,CustomComponent:r,connectionStatus:u})})})}function D9(e,t){return I.useRef(null),pi(),I.useMemo(()=>t(e),[e])}const NV=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:i,onInit:o,onNodeClick:a,onEdgeClick:s,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,onSelectionContextMenu:p,onSelectionStart:m,onSelectionEnd:_,connectionLineType:b,connectionLineStyle:y,connectionLineComponent:g,connectionLineContainerStyle:v,selectionKeyCode:S,selectionOnDrag:w,selectionMode:x,multiSelectionKeyCode:C,panActivationKeyCode:k,zoomActivationKeyCode:T,deleteKeyCode:P,onlyRenderVisibleElements:$,elementsSelectable:O,selectNodesOnDrag:E,defaultViewport:A,translateExtent:D,minZoom:L,maxZoom:M,preventScrolling:R,defaultMarkerColor:N,zoomOnScroll:B,zoomOnPinch:U,panOnScroll:G,panOnScrollSpeed:Z,panOnScrollMode:ee,zoomOnDoubleClick:J,panOnDrag:j,onPaneClick:Q,onPaneMouseEnter:ne,onPaneMouseMove:se,onPaneMouseLeave:ye,onPaneScroll:ce,onPaneContextMenu:bt,onEdgeUpdate:ot,onEdgeContextMenu:ze,onEdgeMouseEnter:mt,onEdgeMouseMove:Pe,onEdgeMouseLeave:en,edgeUpdaterRadius:Pr,onEdgeUpdateStart:Ln,onEdgeUpdateEnd:An,noDragClassName:tn,noWheelClassName:Fn,noPanClassName:Ir,elevateEdgesOnSelect:ho,disableKeyboardA11y:ei,nodeOrigin:pr,nodeExtent:Br,rfId:ti})=>{const Bn=D9(e,w_e),_n=D9(t,I_e);return H_e(o),W.jsx(S_e,{onPaneClick:Q,onPaneMouseEnter:ne,onPaneMouseMove:se,onPaneMouseLeave:ye,onPaneContextMenu:bt,onPaneScroll:ce,deleteKeyCode:P,selectionKeyCode:S,selectionOnDrag:w,selectionMode:x,onSelectionStart:m,onSelectionEnd:_,multiSelectionKeyCode:C,panActivationKeyCode:k,zoomActivationKeyCode:T,elementsSelectable:O,onMove:n,onMoveStart:r,onMoveEnd:i,zoomOnScroll:B,zoomOnPinch:U,zoomOnDoubleClick:J,panOnScroll:G,panOnScrollSpeed:Z,panOnScrollMode:ee,panOnDrag:j,defaultViewport:A,translateExtent:D,minZoom:L,maxZoom:M,onSelectionContextMenu:p,preventScrolling:R,noDragClassName:tn,noWheelClassName:Fn,noPanClassName:Ir,disableKeyboardA11y:ei,children:W.jsxs(q_e,{children:[W.jsx(V_e,{edgeTypes:_n,onEdgeClick:s,onEdgeDoubleClick:u,onEdgeUpdate:ot,onlyRenderVisibleElements:$,onEdgeContextMenu:ze,onEdgeMouseEnter:mt,onEdgeMouseMove:Pe,onEdgeMouseLeave:en,onEdgeUpdateStart:Ln,onEdgeUpdateEnd:An,edgeUpdaterRadius:Pr,defaultMarkerColor:N,noPanClassName:Ir,elevateEdgesOnSelect:!!ho,disableKeyboardA11y:ei,rfId:ti,children:W.jsx(Q_e,{style:y,type:b,component:g,containerStyle:v})}),W.jsx("div",{className:"react-flow__edgelabel-renderer"}),W.jsx(T_e,{nodeTypes:Bn,onNodeClick:a,onNodeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:f,onNodeContextMenu:h,selectNodesOnDrag:E,onlyRenderVisibleElements:$,noPanClassName:Ir,noDragClassName:tn,disableKeyboardA11y:ei,nodeOrigin:pr,nodeExtent:Br,rfId:ti})]})})};NV.displayName="GraphView";var X_e=I.memo(NV);const BE=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],du={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:BE,nodeExtent:BE,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Dd.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:wbe,isValidConnection:void 0},Y_e=()=>L0e((e,t)=>({...du,setNodes:n=>{const{nodeInternals:r,nodeOrigin:i,elevateNodesOnSelect:o}=t();e({nodeInternals:BC(n,r,i,o)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(i=>({...r,...i}))})},setDefaultNodesAndEdges:(n,r)=>{const i=typeof n<"u",o=typeof r<"u",a=i?BC(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:a,edges:o?r:[],hasDefaultNodes:i,hasDefaultEdges:o})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:i,fitViewOnInit:o,fitViewOnInitDone:a,fitViewOnInitOptions:s,domNode:l,nodeOrigin:u}=t(),c=l==null?void 0:l.querySelector(".react-flow__viewport");if(!c)return;const d=window.getComputedStyle(c),{m22:f}=new window.DOMMatrixReadOnly(d.transform),h=n.reduce((m,_)=>{const b=i.get(_.id);if(b){const y=oA(_.nodeElement);!!(y.width&&y.height&&(b.width!==y.width||b.height!==y.height||_.forceUpdate))&&(i.set(b.id,{...b,[Qr]:{...b[Qr],handleBounds:{source:P9(".source",_.nodeElement,f,u),target:P9(".target",_.nodeElement,f,u)}},...y}),m.push({id:b.id,type:"dimensions",dimensions:y}))}return m},[]);_V(i,u);const p=a||o&&!a&&SV(t,{initial:!0,...s});e({nodeInternals:new Map(i),fitViewOnInitDone:p}),(h==null?void 0:h.length)>0&&(r==null||r(h))},updateNodePositions:(n,r=!0,i=!1)=>{const{triggerNodeChanges:o}=t(),a=n.map(s=>{const l={id:s.id,type:"position",dragging:i};return r&&(l.positionAbsolute=s.positionAbsolute,l.position=s.position),l});o(a)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:i,hasDefaultNodes:o,nodeOrigin:a,getNodes:s,elevateNodesOnSelect:l}=t();if(n!=null&&n.length){if(o){const u=Gc(n,s()),c=BC(u,i,a,l);e({nodeInternals:c})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let a,s=null;r?a=n.map(l=>Su(l,!0)):(a=jf(o(),n),s=jf(i,[])),$v({changedNodes:a,changedEdges:s,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let a,s=null;r?a=n.map(l=>Su(l,!0)):(a=jf(i,n),s=jf(o(),[])),$v({changedNodes:s,changedEdges:a,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:i,getNodes:o}=t(),a=n||o(),s=r||i,l=a.map(c=>(c.selected=!1,Su(c.id,!1))),u=s.map(c=>Su(c.id,!1));$v({changedNodes:l,changedEdges:u,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:i}=t();r==null||r.scaleExtent([n,i]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:i}=t();r==null||r.scaleExtent([i,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),o=r().filter(s=>s.selected).map(s=>Su(s.id,!1)),a=n.filter(s=>s.selected).map(s=>Su(s.id,!1));$v({changedNodes:o,changedEdges:a,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(i=>{i.positionAbsolute=aA(i.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:i,height:o,d3Zoom:a,d3Selection:s,translateExtent:l}=t();if(!a||!s||!n.x&&!n.y)return!1;const u=Xu.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),c=[[0,0],[i,o]],d=a==null?void 0:a.constrain()(u,c,l);return a.transform(s,d),r[0]!==d.x||r[1]!==d.y||r[2]!==d.k},cancelConnection:()=>e({connectionNodeId:du.connectionNodeId,connectionHandleId:du.connectionHandleId,connectionHandleType:du.connectionHandleType,connectionStatus:du.connectionStatus,connectionStartHandle:du.connectionStartHandle,connectionEndHandle:du.connectionEndHandle}),reset:()=>e({...du})}),Object.is),$V=({children:e})=>{const t=I.useRef(null);return t.current||(t.current=Y_e()),W.jsx(mbe,{value:t.current,children:e})};$V.displayName="ReactFlowProvider";const DV=({children:e})=>I.useContext(X2)?W.jsx(W.Fragment,{children:e}):W.jsx($V,{children:e});DV.displayName="ReactFlowWrapper";const Z_e={input:hV,default:LE,output:gV,group:pA},J_e={default:N_,straight:uA,step:lA,smoothstep:Y2,simplebezier:sA},eSe=[0,0],tSe=[15,15],nSe={x:0,y:0,zoom:1},rSe={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},iSe=I.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o=Z_e,edgeTypes:a=J_e,onNodeClick:s,onEdgeClick:l,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:h,onConnectStart:p,onConnectEnd:m,onClickConnectStart:_,onClickConnectEnd:b,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:v,onNodeContextMenu:S,onNodeDoubleClick:w,onNodeDragStart:x,onNodeDrag:C,onNodeDragStop:k,onNodesDelete:T,onEdgesDelete:P,onSelectionChange:$,onSelectionDragStart:O,onSelectionDrag:E,onSelectionDragStop:A,onSelectionContextMenu:D,onSelectionStart:L,onSelectionEnd:M,connectionMode:R=Dd.Strict,connectionLineType:N=Au.Bezier,connectionLineStyle:B,connectionLineComponent:U,connectionLineContainerStyle:G,deleteKeyCode:Z="Backspace",selectionKeyCode:ee="Shift",selectionOnDrag:J=!1,selectionMode:j=uc.Full,panActivationKeyCode:Q="Space",multiSelectionKeyCode:ne=O_()?"Meta":"Control",zoomActivationKeyCode:se=O_()?"Meta":"Control",snapToGrid:ye=!1,snapGrid:ce=tSe,onlyRenderVisibleElements:bt=!1,selectNodesOnDrag:ot=!0,nodesDraggable:ze,nodesConnectable:mt,nodesFocusable:Pe,nodeOrigin:en=eSe,edgesFocusable:Pr,edgesUpdatable:Ln,elementsSelectable:An,defaultViewport:tn=nSe,minZoom:Fn=.5,maxZoom:Ir=2,translateExtent:ho=BE,preventScrolling:ei=!0,nodeExtent:pr,defaultMarkerColor:Br="#b1b1b7",zoomOnScroll:ti=!0,zoomOnPinch:Bn=!0,panOnScroll:_n=!1,panOnScrollSpeed:Mi=.5,panOnScrollMode:gi=sd.Free,zoomOnDoubleClick:Qi=!0,panOnDrag:Da=!0,onPaneClick:Rr,onPaneMouseEnter:po,onPaneMouseMove:al,onPaneMouseLeave:Do,onPaneScroll:sl,onPaneContextMenu:zn,children:nn,onEdgeUpdate:zr,onEdgeContextMenu:Or,onEdgeDoubleClick:Mr,onEdgeMouseEnter:ni,onEdgeMouseMove:Ni,onEdgeMouseLeave:go,onEdgeUpdateStart:mi,onEdgeUpdateEnd:jr,edgeUpdaterRadius:La=10,onNodesChange:gs,onEdgesChange:yi,noDragClassName:ou="nodrag",noWheelClassName:oa="nowheel",noPanClassName:ri="nopan",fitView:ll=!1,fitViewOptions:H,connectOnClick:te=!0,attributionPosition:re,proOptions:de,defaultEdgeOptions:oe,elevateNodesOnSelect:je=!0,elevateEdgesOnSelect:Ge=!1,disableKeyboardA11y:ut=!1,autoPanOnConnect:$e=!0,autoPanOnNodeDrag:qe=!0,connectionRadius:Ie=20,isValidConnection:ie,onError:Se,style:Ye,id:Ze,...ct},dt)=>{const _t=Ze||"1";return W.jsx("div",{...ct,style:{...Ye,...rSe},ref:dt,className:Aa(["react-flow",i]),"data-testid":"rf__wrapper",id:Ze,children:W.jsxs(DV,{children:[W.jsx(X_e,{onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onNodeClick:s,onEdgeClick:l,onNodeMouseEnter:y,onNodeMouseMove:g,onNodeMouseLeave:v,onNodeContextMenu:S,onNodeDoubleClick:w,nodeTypes:o,edgeTypes:a,connectionLineType:N,connectionLineStyle:B,connectionLineComponent:U,connectionLineContainerStyle:G,selectionKeyCode:ee,selectionOnDrag:J,selectionMode:j,deleteKeyCode:Z,multiSelectionKeyCode:ne,panActivationKeyCode:Q,zoomActivationKeyCode:se,onlyRenderVisibleElements:bt,selectNodesOnDrag:ot,defaultViewport:tn,translateExtent:ho,minZoom:Fn,maxZoom:Ir,preventScrolling:ei,zoomOnScroll:ti,zoomOnPinch:Bn,zoomOnDoubleClick:Qi,panOnScroll:_n,panOnScrollSpeed:Mi,panOnScrollMode:gi,panOnDrag:Da,onPaneClick:Rr,onPaneMouseEnter:po,onPaneMouseMove:al,onPaneMouseLeave:Do,onPaneScroll:sl,onPaneContextMenu:zn,onSelectionContextMenu:D,onSelectionStart:L,onSelectionEnd:M,onEdgeUpdate:zr,onEdgeContextMenu:Or,onEdgeDoubleClick:Mr,onEdgeMouseEnter:ni,onEdgeMouseMove:Ni,onEdgeMouseLeave:go,onEdgeUpdateStart:mi,onEdgeUpdateEnd:jr,edgeUpdaterRadius:La,defaultMarkerColor:Br,noDragClassName:ou,noWheelClassName:oa,noPanClassName:ri,elevateEdgesOnSelect:Ge,rfId:_t,disableKeyboardA11y:ut,nodeOrigin:en,nodeExtent:pr}),W.jsx(Kbe,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:p,onConnectEnd:m,onClickConnectStart:_,onClickConnectEnd:b,nodesDraggable:ze,nodesConnectable:mt,nodesFocusable:Pe,edgesFocusable:Pr,edgesUpdatable:Ln,elementsSelectable:An,elevateNodesOnSelect:je,minZoom:Fn,maxZoom:Ir,nodeExtent:pr,onNodesChange:gs,onEdgesChange:yi,snapToGrid:ye,snapGrid:ce,connectionMode:R,translateExtent:ho,connectOnClick:te,defaultEdgeOptions:oe,fitView:ll,fitViewOptions:H,onNodesDelete:T,onEdgesDelete:P,onNodeDragStart:x,onNodeDrag:C,onNodeDragStop:k,onSelectionDrag:E,onSelectionDragStart:O,onSelectionDragStop:A,noPanClassName:ri,nodeOrigin:en,rfId:_t,autoPanOnConnect:$e,autoPanOnNodeDrag:qe,onError:Se,connectionRadius:Ie,isValidConnection:ie}),W.jsx(Hbe,{onSelectionChange:$}),nn,W.jsx(bbe,{proOptions:de,position:re}),W.jsx(Jbe,{rfId:_t,disableKeyboardA11y:ut})]})})});iSe.displayName="ReactFlow";const oSe=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function Nqe({children:e}){const t=_r(oSe);return t?Vo.createPortal(e,t):null}function $qe(){const e=pi();return I.useCallback(t=>{const{domNode:n,updateNodeDimensions:r}=e.getState(),o=(Array.isArray(t)?t:[t]).reduce((a,s)=>{const l=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${s}"]`);return l&&a.push({id:s,nodeElement:l,forceUpdate:!0}),a},[]);requestAnimationFrame(()=>r(o))},[])}function aSe(){const e=[];return function(t,n){if(typeof n!="object"||n===null)return n;for(;e.length>0&&e.at(-1)!==this;)e.pop();return e.includes(n)?"[Circular]":(e.push(n),n)}}const y0=jb("nodes/receivedOpenAPISchema",async(e,{rejectWithValue:t})=>{try{const n=[window.location.origin,"openapi.json"].join("/"),i=await(await fetch(n)).json();return JSON.parse(JSON.stringify(i,aSe()))}catch(n){return t({error:n})}});let Lv;const sSe=new Uint8Array(16);function lSe(){if(!Lv&&(Lv=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Lv))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Lv(sSe)}const xi=[];for(let e=0;e<256;++e)xi.push((e+256).toString(16).slice(1));function uSe(e,t=0){return(xi[e[t+0]]+xi[e[t+1]]+xi[e[t+2]]+xi[e[t+3]]+"-"+xi[e[t+4]]+xi[e[t+5]]+"-"+xi[e[t+6]]+xi[e[t+7]]+"-"+xi[e[t+8]]+xi[e[t+9]]+"-"+xi[e[t+10]]+xi[e[t+11]]+xi[e[t+12]]+xi[e[t+13]]+xi[e[t+14]]+xi[e[t+15]]).toLowerCase()}const cSe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),L9={randomUUID:cSe};function LV(e,t,n){if(L9.randomUUID&&!t&&!e)return L9.randomUUID();e=e||{};const r=e.random||(e.rng||lSe)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return uSe(r)}const Dqe=500,Lqe=320,dSe="node-drag-handle",Fqe=["ImageField","ImageCollection"],Bqe={input:"inputs",output:"outputs"},Fv=["Collection","IntegerCollection","BooleanCollection","FloatCollection","StringCollection","ImageCollection","LatentsCollection","ConditioningCollection","ControlCollection","ColorCollection","T2IAdapterCollection","IPAdapterCollection"],Cg=["IntegerPolymorphic","BooleanPolymorphic","FloatPolymorphic","StringPolymorphic","ImagePolymorphic","LatentsPolymorphic","ConditioningPolymorphic","ControlPolymorphic","ColorPolymorphic","T2IAdapterPolymorphic","IPAdapterPolymorphic"],zqe=["IPAdapterModelField","ControlNetModelField","LoRAModelField","MainModelField","ONNXModelField","SDXLMainModelField","SDXLRefinerModelField","VaeModelField","UNetField","VaeField","ClipField","T2IAdapterModelField","IPAdapterModelField"],mA={integer:"IntegerCollection",boolean:"BooleanCollection",number:"FloatCollection",float:"FloatCollection",string:"StringCollection",ImageField:"ImageCollection",LatentsField:"LatentsCollection",ConditioningField:"ConditioningCollection",ControlField:"ControlCollection",ColorField:"ColorCollection",T2IAdapterField:"T2IAdapterCollection",IPAdapterField:"IPAdapterCollection"},fSe=e=>!!(e&&e in mA),FV={integer:"IntegerPolymorphic",boolean:"BooleanPolymorphic",number:"FloatPolymorphic",float:"FloatPolymorphic",string:"StringPolymorphic",ImageField:"ImagePolymorphic",LatentsField:"LatentsPolymorphic",ConditioningField:"ConditioningPolymorphic",ControlField:"ControlPolymorphic",ColorField:"ColorPolymorphic",T2IAdapterField:"T2IAdapterPolymorphic",IPAdapterField:"IPAdapterPolymorphic"},hSe={IntegerPolymorphic:"integer",BooleanPolymorphic:"boolean",FloatPolymorphic:"float",StringPolymorphic:"string",ImagePolymorphic:"ImageField",LatentsPolymorphic:"LatentsField",ConditioningPolymorphic:"ConditioningField",ControlPolymorphic:"ControlField",ColorPolymorphic:"ColorField",T2IAdapterPolymorphic:"T2IAdapterField",IPAdapterPolymorphic:"IPAdapterField"},jqe=["string","StringPolymorphic","boolean","BooleanPolymorphic","integer","float","FloatPolymorphic","IntegerPolymorphic","enum","ImageField","ImagePolymorphic","MainModelField","SDXLRefinerModelField","VaeModelField","LoRAModelField","ControlNetModelField","ColorField","SDXLMainModelField","Scheduler","IPAdapterModelField","BoardField","T2IAdapterModelField"],pSe=e=>!!(e&&e in FV),Uqe={boolean:{color:"green.500",description:Y("nodes.booleanDescription"),title:Y("nodes.boolean")},BooleanCollection:{color:"green.500",description:Y("nodes.booleanCollectionDescription"),title:Y("nodes.booleanCollection")},BooleanPolymorphic:{color:"green.500",description:Y("nodes.booleanPolymorphicDescription"),title:Y("nodes.booleanPolymorphic")},ClipField:{color:"green.500",description:Y("nodes.clipFieldDescription"),title:Y("nodes.clipField")},Collection:{color:"base.500",description:Y("nodes.collectionDescription"),title:Y("nodes.collection")},CollectionItem:{color:"base.500",description:Y("nodes.collectionItemDescription"),title:Y("nodes.collectionItem")},ColorCollection:{color:"pink.300",description:Y("nodes.colorCollectionDescription"),title:Y("nodes.colorCollection")},ColorField:{color:"pink.300",description:Y("nodes.colorFieldDescription"),title:Y("nodes.colorField")},ColorPolymorphic:{color:"pink.300",description:Y("nodes.colorPolymorphicDescription"),title:Y("nodes.colorPolymorphic")},ConditioningCollection:{color:"cyan.500",description:Y("nodes.conditioningCollectionDescription"),title:Y("nodes.conditioningCollection")},ConditioningField:{color:"cyan.500",description:Y("nodes.conditioningFieldDescription"),title:Y("nodes.conditioningField")},ConditioningPolymorphic:{color:"cyan.500",description:Y("nodes.conditioningPolymorphicDescription"),title:Y("nodes.conditioningPolymorphic")},ControlCollection:{color:"teal.500",description:Y("nodes.controlCollectionDescription"),title:Y("nodes.controlCollection")},ControlField:{color:"teal.500",description:Y("nodes.controlFieldDescription"),title:Y("nodes.controlField")},ControlNetModelField:{color:"teal.500",description:"TODO",title:"ControlNet"},ControlPolymorphic:{color:"teal.500",description:"Control info passed between nodes.",title:"Control Polymorphic"},DenoiseMaskField:{color:"blue.300",description:Y("nodes.denoiseMaskFieldDescription"),title:Y("nodes.denoiseMaskField")},enum:{color:"blue.500",description:Y("nodes.enumDescription"),title:Y("nodes.enum")},float:{color:"orange.500",description:Y("nodes.floatDescription"),title:Y("nodes.float")},FloatCollection:{color:"orange.500",description:Y("nodes.floatCollectionDescription"),title:Y("nodes.floatCollection")},FloatPolymorphic:{color:"orange.500",description:Y("nodes.floatPolymorphicDescription"),title:Y("nodes.floatPolymorphic")},ImageCollection:{color:"purple.500",description:Y("nodes.imageCollectionDescription"),title:Y("nodes.imageCollection")},ImageField:{color:"purple.500",description:Y("nodes.imageFieldDescription"),title:Y("nodes.imageField")},BoardField:{color:"purple.500",description:Y("nodes.imageFieldDescription"),title:Y("nodes.imageField")},ImagePolymorphic:{color:"purple.500",description:Y("nodes.imagePolymorphicDescription"),title:Y("nodes.imagePolymorphic")},integer:{color:"red.500",description:Y("nodes.integerDescription"),title:Y("nodes.integer")},IntegerCollection:{color:"red.500",description:Y("nodes.integerCollectionDescription"),title:Y("nodes.integerCollection")},IntegerPolymorphic:{color:"red.500",description:Y("nodes.integerPolymorphicDescription"),title:Y("nodes.integerPolymorphic")},IPAdapterCollection:{color:"teal.500",description:Y("nodes.ipAdapterCollectionDescription"),title:Y("nodes.ipAdapterCollection")},IPAdapterField:{color:"teal.500",description:Y("nodes.ipAdapterDescription"),title:Y("nodes.ipAdapter")},IPAdapterModelField:{color:"teal.500",description:Y("nodes.ipAdapterModelDescription"),title:Y("nodes.ipAdapterModel")},IPAdapterPolymorphic:{color:"teal.500",description:Y("nodes.ipAdapterPolymorphicDescription"),title:Y("nodes.ipAdapterPolymorphic")},LatentsCollection:{color:"pink.500",description:Y("nodes.latentsCollectionDescription"),title:Y("nodes.latentsCollection")},LatentsField:{color:"pink.500",description:Y("nodes.latentsFieldDescription"),title:Y("nodes.latentsField")},LatentsPolymorphic:{color:"pink.500",description:Y("nodes.latentsPolymorphicDescription"),title:Y("nodes.latentsPolymorphic")},LoRAModelField:{color:"teal.500",description:Y("nodes.loRAModelFieldDescription"),title:Y("nodes.loRAModelField")},MainModelField:{color:"teal.500",description:Y("nodes.mainModelFieldDescription"),title:Y("nodes.mainModelField")},ONNXModelField:{color:"teal.500",description:Y("nodes.oNNXModelFieldDescription"),title:Y("nodes.oNNXModelField")},Scheduler:{color:"base.500",description:Y("nodes.schedulerDescription"),title:Y("nodes.scheduler")},SDXLMainModelField:{color:"teal.500",description:Y("nodes.sDXLMainModelFieldDescription"),title:Y("nodes.sDXLMainModelField")},SDXLRefinerModelField:{color:"teal.500",description:Y("nodes.sDXLRefinerModelFieldDescription"),title:Y("nodes.sDXLRefinerModelField")},string:{color:"yellow.500",description:Y("nodes.stringDescription"),title:Y("nodes.string")},StringCollection:{color:"yellow.500",description:Y("nodes.stringCollectionDescription"),title:Y("nodes.stringCollection")},StringPolymorphic:{color:"yellow.500",description:Y("nodes.stringPolymorphicDescription"),title:Y("nodes.stringPolymorphic")},T2IAdapterCollection:{color:"teal.500",description:Y("nodes.t2iAdapterCollectionDescription"),title:Y("nodes.t2iAdapterCollection")},T2IAdapterField:{color:"teal.500",description:Y("nodes.t2iAdapterFieldDescription"),title:Y("nodes.t2iAdapterField")},T2IAdapterModelField:{color:"teal.500",description:"TODO",title:"T2I-Adapter"},T2IAdapterPolymorphic:{color:"teal.500",description:"T2I-Adapter info passed between nodes.",title:"T2I-Adapter Polymorphic"},UNetField:{color:"red.500",description:Y("nodes.uNetFieldDescription"),title:Y("nodes.uNetField")},VaeField:{color:"blue.500",description:Y("nodes.vaeFieldDescription"),title:Y("nodes.vaeField")},VaeModelField:{color:"teal.500",description:Y("nodes.vaeModelFieldDescription"),title:Y("nodes.vaeModelField")}},F9=(e,t,n)=>{let r=t,i=n;for(;e.find(o=>o.position.x===r&&o.position.y===i);)r=r+50,i=i+50;return{x:r,y:i}},gSe=(e,t)=>{if(e==="Collection"&&t==="Collection")return!1;if(e===t)return!0;const n=e==="CollectionItem"&&!Fv.includes(t),r=t==="CollectionItem"&&!Fv.includes(e)&&!Cg.includes(e),i=Cg.includes(t)&&(()=>{if(!Cg.includes(t))return!1;const u=hSe[t],c=mA[u];return e===u||e===c})(),o=e==="Collection"&&(Fv.includes(t)||Cg.includes(t)),a=t==="Collection"&&Fv.includes(e);return n||r||i||o||a||e==="integer"&&t==="float"||(e==="integer"||e==="float")&&t==="string"};var mSe="\0",$c="\0",B9="",vo,cd,jo,z0,Ah,Ph,ha,Ts,Iu,ks,Ru,wl,Cl,Ih,Rh,El,Va,j0,zE,zN;let ySe=(zN=class{constructor(t){Zn(this,j0);Zn(this,vo,!0);Zn(this,cd,!1);Zn(this,jo,!1);Zn(this,z0,void 0);Zn(this,Ah,()=>{});Zn(this,Ph,()=>{});Zn(this,ha,{});Zn(this,Ts,{});Zn(this,Iu,{});Zn(this,ks,{});Zn(this,Ru,{});Zn(this,wl,{});Zn(this,Cl,{});Zn(this,Ih,0);Zn(this,Rh,0);Zn(this,El,void 0);Zn(this,Va,void 0);t&&(aa(this,vo,t.hasOwnProperty("directed")?t.directed:!0),aa(this,cd,t.hasOwnProperty("multigraph")?t.multigraph:!1),aa(this,jo,t.hasOwnProperty("compound")?t.compound:!1)),ae(this,jo)&&(aa(this,El,{}),aa(this,Va,{}),ae(this,Va)[$c]={})}isDirected(){return ae(this,vo)}isMultigraph(){return ae(this,cd)}isCompound(){return ae(this,jo)}setGraph(t){return aa(this,z0,t),this}graph(){return ae(this,z0)}setDefaultNodeLabel(t){return aa(this,Ah,t),typeof t!="function"&&aa(this,Ah,()=>t),this}nodeCount(){return ae(this,Ih)}nodes(){return Object.keys(ae(this,ha))}sources(){var t=this;return this.nodes().filter(n=>Object.keys(ae(t,Ts)[n]).length===0)}sinks(){var t=this;return this.nodes().filter(n=>Object.keys(ae(t,ks)[n]).length===0)}setNodes(t,n){var r=arguments,i=this;return t.forEach(function(o){r.length>1?i.setNode(o,n):i.setNode(o)}),this}setNode(t,n){return ae(this,ha).hasOwnProperty(t)?(arguments.length>1&&(ae(this,ha)[t]=n),this):(ae(this,ha)[t]=arguments.length>1?n:ae(this,Ah).call(this,t),ae(this,jo)&&(ae(this,El)[t]=$c,ae(this,Va)[t]={},ae(this,Va)[$c][t]=!0),ae(this,Ts)[t]={},ae(this,Iu)[t]={},ae(this,ks)[t]={},ae(this,Ru)[t]={},++Np(this,Ih)._,this)}node(t){return ae(this,ha)[t]}hasNode(t){return ae(this,ha).hasOwnProperty(t)}removeNode(t){var n=this;if(ae(this,ha).hasOwnProperty(t)){var r=i=>n.removeEdge(ae(n,wl)[i]);delete ae(this,ha)[t],ae(this,jo)&&(ms(this,j0,zE).call(this,t),delete ae(this,El)[t],this.children(t).forEach(function(i){n.setParent(i)}),delete ae(this,Va)[t]),Object.keys(ae(this,Ts)[t]).forEach(r),delete ae(this,Ts)[t],delete ae(this,Iu)[t],Object.keys(ae(this,ks)[t]).forEach(r),delete ae(this,ks)[t],delete ae(this,Ru)[t],--Np(this,Ih)._}return this}setParent(t,n){if(!ae(this,jo))throw new Error("Cannot set parent in a non-compound graph");if(n===void 0)n=$c;else{n+="";for(var r=n;r!==void 0;r=this.parent(r))if(r===t)throw new Error("Setting "+n+" as parent of "+t+" would create a cycle");this.setNode(n)}return this.setNode(t),ms(this,j0,zE).call(this,t),ae(this,El)[t]=n,ae(this,Va)[n][t]=!0,this}parent(t){if(ae(this,jo)){var n=ae(this,El)[t];if(n!==$c)return n}}children(t=$c){if(ae(this,jo)){var n=ae(this,Va)[t];if(n)return Object.keys(n)}else{if(t===$c)return this.nodes();if(this.hasNode(t))return[]}}predecessors(t){var n=ae(this,Iu)[t];if(n)return Object.keys(n)}successors(t){var n=ae(this,Ru)[t];if(n)return Object.keys(n)}neighbors(t){var n=this.predecessors(t);if(n){const i=new Set(n);for(var r of this.successors(t))i.add(r);return Array.from(i.values())}}isLeaf(t){var n;return this.isDirected()?n=this.successors(t):n=this.neighbors(t),n.length===0}filterNodes(t){var n=new this.constructor({directed:ae(this,vo),multigraph:ae(this,cd),compound:ae(this,jo)});n.setGraph(this.graph());var r=this;Object.entries(ae(this,ha)).forEach(function([a,s]){t(a)&&n.setNode(a,s)}),Object.values(ae(this,wl)).forEach(function(a){n.hasNode(a.v)&&n.hasNode(a.w)&&n.setEdge(a,r.edge(a))});var i={};function o(a){var s=r.parent(a);return s===void 0||n.hasNode(s)?(i[a]=s,s):s in i?i[s]:o(s)}return ae(this,jo)&&n.nodes().forEach(a=>n.setParent(a,o(a))),n}setDefaultEdgeLabel(t){return aa(this,Ph,t),typeof t!="function"&&aa(this,Ph,()=>t),this}edgeCount(){return ae(this,Rh)}edges(){return Object.values(ae(this,wl))}setPath(t,n){var r=this,i=arguments;return t.reduce(function(o,a){return i.length>1?r.setEdge(o,a,n):r.setEdge(o,a),a}),this}setEdge(){var t,n,r,i,o=!1,a=arguments[0];typeof a=="object"&&a!==null&&"v"in a?(t=a.v,n=a.w,r=a.name,arguments.length===2&&(i=arguments[1],o=!0)):(t=a,n=arguments[1],r=arguments[3],arguments.length>2&&(i=arguments[2],o=!0)),t=""+t,n=""+n,r!==void 0&&(r=""+r);var s=Eg(ae(this,vo),t,n,r);if(ae(this,Cl).hasOwnProperty(s))return o&&(ae(this,Cl)[s]=i),this;if(r!==void 0&&!ae(this,cd))throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(t),this.setNode(n),ae(this,Cl)[s]=o?i:ae(this,Ph).call(this,t,n,r);var l=vSe(ae(this,vo),t,n,r);return t=l.v,n=l.w,Object.freeze(l),ae(this,wl)[s]=l,z9(ae(this,Iu)[n],t),z9(ae(this,Ru)[t],n),ae(this,Ts)[n][s]=l,ae(this,ks)[t][s]=l,Np(this,Rh)._++,this}edge(t,n,r){var i=arguments.length===1?VC(ae(this,vo),arguments[0]):Eg(ae(this,vo),t,n,r);return ae(this,Cl)[i]}edgeAsObj(){const t=this.edge(...arguments);return typeof t!="object"?{label:t}:t}hasEdge(t,n,r){var i=arguments.length===1?VC(ae(this,vo),arguments[0]):Eg(ae(this,vo),t,n,r);return ae(this,Cl).hasOwnProperty(i)}removeEdge(t,n,r){var i=arguments.length===1?VC(ae(this,vo),arguments[0]):Eg(ae(this,vo),t,n,r),o=ae(this,wl)[i];return o&&(t=o.v,n=o.w,delete ae(this,Cl)[i],delete ae(this,wl)[i],j9(ae(this,Iu)[n],t),j9(ae(this,Ru)[t],n),delete ae(this,Ts)[n][i],delete ae(this,ks)[t][i],Np(this,Rh)._--),this}inEdges(t,n){var r=ae(this,Ts)[t];if(r){var i=Object.values(r);return n?i.filter(o=>o.v===n):i}}outEdges(t,n){var r=ae(this,ks)[t];if(r){var i=Object.values(r);return n?i.filter(o=>o.w===n):i}}nodeEdges(t,n){var r=this.inEdges(t,n);if(r)return r.concat(this.outEdges(t,n))}},vo=new WeakMap,cd=new WeakMap,jo=new WeakMap,z0=new WeakMap,Ah=new WeakMap,Ph=new WeakMap,ha=new WeakMap,Ts=new WeakMap,Iu=new WeakMap,ks=new WeakMap,Ru=new WeakMap,wl=new WeakMap,Cl=new WeakMap,Ih=new WeakMap,Rh=new WeakMap,El=new WeakMap,Va=new WeakMap,j0=new WeakSet,zE=function(t){delete ae(this,Va)[ae(this,El)[t]][t]},zN);function z9(e,t){e[t]?e[t]++:e[t]=1}function j9(e,t){--e[t]||delete e[t]}function Eg(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}return i+B9+o+B9+(r===void 0?mSe:r)}function vSe(e,t,n,r){var i=""+t,o=""+n;if(!e&&i>o){var a=i;i=o,o=a}var s={v:i,w:o};return r&&(s.name=r),s}function VC(e,t){return Eg(e,t.v,t.w,t.name)}var yA=ySe,bSe="2.1.13",_Se={Graph:yA,version:bSe},SSe=yA,xSe={write:wSe,read:TSe};function wSe(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:CSe(e),edges:ESe(e)};return e.graph()!==void 0&&(t.value=structuredClone(e.graph())),t}function CSe(e){return e.nodes().map(function(t){var n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function ESe(e){return e.edges().map(function(t){var n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function TSe(e){var t=new SSe(e.options).setGraph(e.value);return e.nodes.forEach(function(n){t.setNode(n.v,n.value),n.parent&&t.setParent(n.v,n.parent)}),e.edges.forEach(function(n){t.setEdge({v:n.v,w:n.w,name:n.name},n.value)}),t}var kSe=ASe;function ASe(e){var t={},n=[],r;function i(o){t.hasOwnProperty(o)||(t[o]=!0,r.push(o),e.successors(o).forEach(i),e.predecessors(o).forEach(i))}return e.nodes().forEach(function(o){r=[],i(o),r.length&&n.push(r)}),n}var zi,Tl,U0,jE,V0,UE,Oh,V1,jN;let PSe=(jN=class{constructor(){Zn(this,U0);Zn(this,V0);Zn(this,Oh);Zn(this,zi,[]);Zn(this,Tl,{})}size(){return ae(this,zi).length}keys(){return ae(this,zi).map(function(t){return t.key})}has(t){return ae(this,Tl).hasOwnProperty(t)}priority(t){var n=ae(this,Tl)[t];if(n!==void 0)return ae(this,zi)[n].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return ae(this,zi)[0].key}add(t,n){var r=ae(this,Tl);if(t=String(t),!r.hasOwnProperty(t)){var i=ae(this,zi),o=i.length;return r[t]=o,i.push({key:t,priority:n}),ms(this,V0,UE).call(this,o),!0}return!1}removeMin(){ms(this,Oh,V1).call(this,0,ae(this,zi).length-1);var t=ae(this,zi).pop();return delete ae(this,Tl)[t.key],ms(this,U0,jE).call(this,0),t.key}decrease(t,n){var r=ae(this,Tl)[t];if(n>ae(this,zi)[r].priority)throw new Error("New priority is greater than current priority. Key: "+t+" Old: "+ae(this,zi)[r].priority+" New: "+n);ae(this,zi)[r].priority=n,ms(this,V0,UE).call(this,r)}},zi=new WeakMap,Tl=new WeakMap,U0=new WeakSet,jE=function(t){var n=ae(this,zi),r=2*t,i=r+1,o=t;r<n.length&&(o=n[r].priority<n[o].priority?r:o,i<n.length&&(o=n[i].priority<n[o].priority?i:o),o!==t&&(ms(this,Oh,V1).call(this,t,o),ms(this,U0,jE).call(this,o)))},V0=new WeakSet,UE=function(t){for(var n=ae(this,zi),r=n[t].priority,i;t!==0&&(i=t>>1,!(n[i].priority<r));)ms(this,Oh,V1).call(this,t,i),t=i},Oh=new WeakSet,V1=function(t,n){var r=ae(this,zi),i=ae(this,Tl),o=r[t],a=r[n];r[t]=a,r[n]=o,i[a.key]=t,i[o.key]=n},jN);var BV=PSe,ISe=BV,zV=OSe,RSe=()=>1;function OSe(e,t,n,r){return MSe(e,String(t),n||RSe,r||function(i){return e.outEdges(i)})}function MSe(e,t,n,r){var i={},o=new ISe,a,s,l=function(u){var c=u.v!==a?u.v:u.w,d=i[c],f=n(u),h=s.distance+f;if(f<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+u+" Weight: "+f);h<d.distance&&(d.distance=h,d.predecessor=a,o.decrease(c,h))};for(e.nodes().forEach(function(u){var c=u===t?0:Number.POSITIVE_INFINITY;i[u]={distance:c},o.add(u,c)});o.size()>0&&(a=o.removeMin(),s=i[a],s.distance!==Number.POSITIVE_INFINITY);)r(a).forEach(l);return i}var NSe=zV,$Se=DSe;function DSe(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=NSe(e,i,t,n),r},{})}var jV=LSe;function LSe(e){var t=0,n=[],r={},i=[];function o(a){var s=r[a]={onStack:!0,lowlink:t,index:t++};if(n.push(a),e.successors(a).forEach(function(c){r.hasOwnProperty(c)?r[c].onStack&&(s.lowlink=Math.min(s.lowlink,r[c].index)):(o(c),s.lowlink=Math.min(s.lowlink,r[c].lowlink))}),s.lowlink===s.index){var l=[],u;do u=n.pop(),r[u].onStack=!1,l.push(u);while(a!==u);i.push(l)}}return e.nodes().forEach(function(a){r.hasOwnProperty(a)||o(a)}),i}var FSe=jV,BSe=zSe;function zSe(e){return FSe(e).filter(function(t){return t.length>1||t.length===1&&e.hasEdge(t[0],t[0])})}var jSe=VSe,USe=()=>1;function VSe(e,t,n){return GSe(e,t||USe,n||function(r){return e.outEdges(r)})}function GSe(e,t,n){var r={},i=e.nodes();return i.forEach(function(o){r[o]={},r[o][o]={distance:0},i.forEach(function(a){o!==a&&(r[o][a]={distance:Number.POSITIVE_INFINITY})}),n(o).forEach(function(a){var s=a.v===o?a.w:a.v,l=t(a);r[o][s]={distance:l,predecessor:o}})}),i.forEach(function(o){var a=r[o];i.forEach(function(s){var l=r[s];i.forEach(function(u){var c=l[o],d=a[u],f=l[u],h=c.distance+d.distance;h<f.distance&&(f.distance=h,f.predecessor=d.predecessor)})})}),r}function UV(e){var t={},n={},r=[];function i(o){if(n.hasOwnProperty(o))throw new VE;t.hasOwnProperty(o)||(n[o]=!0,t[o]=!0,e.predecessors(o).forEach(i),delete n[o],r.push(o))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new VE;return r}class VE extends Error{constructor(){super(...arguments)}}var VV=UV;UV.CycleException=VE;var U9=VV,qSe=HSe;function HSe(e){try{U9(e)}catch(t){if(t instanceof U9.CycleException)return!1;throw t}return!0}var GV=WSe;function WSe(e,t,n){Array.isArray(t)||(t=[t]);var r=e.isDirected()?s=>e.successors(s):s=>e.neighbors(s),i=n==="post"?KSe:QSe,o=[],a={};return t.forEach(s=>{if(!e.hasNode(s))throw new Error("Graph does not have node: "+s);i(s,r,a,o)}),o}function KSe(e,t,n,r){for(var i=[[e,!1]];i.length>0;){var o=i.pop();o[1]?r.push(o[0]):n.hasOwnProperty(o[0])||(n[o[0]]=!0,i.push([o[0],!0]),qV(t(o[0]),a=>i.push([a,!1])))}}function QSe(e,t,n,r){for(var i=[e];i.length>0;){var o=i.pop();n.hasOwnProperty(o)||(n[o]=!0,r.push(o),qV(t(o),a=>i.push(a)))}}function qV(e,t){for(var n=e.length;n--;)t(e[n],n,e);return e}var XSe=GV,YSe=ZSe;function ZSe(e,t){return XSe(e,t,"post")}var JSe=GV,e2e=t2e;function t2e(e,t){return JSe(e,t,"pre")}var n2e=yA,r2e=BV,i2e=o2e;function o2e(e,t){var n=new n2e,r={},i=new r2e,o;function a(l){var u=l.v===o?l.w:l.v,c=i.priority(u);if(c!==void 0){var d=t(l);d<c&&(r[u]=o,i.decrease(u,d))}}if(e.nodeCount()===0)return n;e.nodes().forEach(function(l){i.add(l,Number.POSITIVE_INFINITY),n.setNode(l)}),i.decrease(e.nodes()[0],0);for(var s=!1;i.size()>0;){if(o=i.removeMin(),r.hasOwnProperty(o))n.setEdge(o,r[o]);else{if(s)throw new Error("Input graph is not connected: "+e);s=!0}e.nodeEdges(o).forEach(a)}return n}var a2e={components:kSe,dijkstra:zV,dijkstraAll:$Se,findCycles:BSe,floydWarshall:jSe,isAcyclic:qSe,postorder:YSe,preorder:e2e,prim:i2e,tarjan:jV,topsort:VV},V9=_Se,s2e={Graph:V9.Graph,json:xSe,alg:a2e,version:V9.version};const G9=mc(s2e),q9=(e,t,n,r)=>{const i=new G9.Graph;return n.forEach(o=>{i.setNode(o.id)}),r.forEach(o=>{i.setEdge(o.source,o.target)}),i.setEdge(e,t),G9.alg.isAcyclic(i)},H9=(e,t,n,r,i)=>{let o=!0;return t==="source"?e.find(a=>a.target===r.id&&a.targetHandle===i.name)&&(o=!1):e.find(a=>a.source===r.id&&a.sourceHandle===i.name)&&(o=!1),gSe(n,i.type)||(o=!1),o},W9=(e,t,n,r,i,o,a)=>{if(e.id===r)return null;const s=o=="source"?e.data.inputs:e.data.outputs;if(s[i]){const l=s[i],u=o=="source"?r:e.id,c=o=="source"?e.id:r,d=o=="source"?i:l.name,f=o=="source"?l.name:i,h=q9(u,c,t,n),p=H9(n,o,a,e,l);if(h&&p)return{source:u,sourceHandle:d,target:c,targetHandle:f}}for(const l in s){const u=s[l],c=o=="source"?r:e.id,d=o=="source"?e.id:r,f=o=="source"?i:u.name,h=o=="source"?u.name:i,p=q9(c,d,t,n),m=H9(n,o,a,e,u);if(p&&m)return{source:c,sourceHandle:f,target:d,targetHandle:h}}return null},l2e="1.0.0",GC={status:Wc.PENDING,error:null,progress:null,progressImage:null,outputs:[]},GE={meta:{version:l2e},name:"",author:"",description:"",notes:"",tags:"",contact:"",version:"",exposedFields:[]},HV={nodes:[],edges:[],nodeTemplates:{},isReady:!1,connectionStartParams:null,currentConnectionFieldType:null,connectionMade:!1,modifyingEdge:!1,addNewNodePosition:null,shouldShowFieldTypeLegend:!1,shouldShowMinimapPanel:!0,shouldValidateGraph:!0,shouldAnimateEdges:!0,shouldSnapToGrid:!1,shouldColorEdges:!0,isAddNodePopoverOpen:!1,nodeOpacity:1,selectedNodes:[],selectedEdges:[],workflow:GE,nodeExecutionStates:{},viewport:{x:0,y:0,zoom:1},mouseOverField:null,mouseOverNode:null,nodesToCopy:[],edgesToCopy:[],selectionMode:uc.Partial},Zi=(e,t)=>{var l,u;const{nodeId:n,fieldName:r,value:i}=t.payload,o=e.nodes.findIndex(c=>c.id===n),a=(l=e.nodes)==null?void 0:l[o];if(!Ur(a))return;const s=(u=a.data)==null?void 0:u.inputs[r];s&&o>-1&&(s.value=i)},WV=rr({name:"nodes",initialState:HV,reducers:{nodesChanged:(e,t)=>{e.nodes=Gc(t.payload,e.nodes)},nodeAdded:(e,t)=>{var i,o;const n=t.payload,r=F9(e.nodes,((i=e.addNewNodePosition)==null?void 0:i.x)??n.position.x,((o=e.addNewNodePosition)==null?void 0:o.y)??n.position.y);if(n.position=r,n.selected=!0,e.nodes=Gc(e.nodes.map(a=>({id:a.id,type:"select",selected:!1})),e.nodes),e.edges=Nc(e.edges.map(a=>({id:a.id,type:"select",selected:!1})),e.edges),e.nodes.push(n),!!Ur(n)){if(e.nodeExecutionStates[n.id]={nodeId:n.id,...GC},e.connectionStartParams){const{nodeId:a,handleId:s,handleType:l}=e.connectionStartParams;if(a&&s&&l&&e.currentConnectionFieldType){const u=W9(n,e.nodes,e.edges,a,s,l,e.currentConnectionFieldType);u&&(e.edges=wg({...u,type:"default"},e.edges))}}e.connectionStartParams=null,e.currentConnectionFieldType=null}},edgeChangeStarted:e=>{e.modifyingEdge=!0},edgesChanged:(e,t)=>{e.edges=Nc(t.payload,e.edges)},edgeAdded:(e,t)=>{e.edges=wg(t.payload,e.edges)},edgeUpdated:(e,t)=>{const{oldEdge:n,newConnection:r}=t.payload;e.edges=$be(n,r,e.edges)},connectionStarted:(e,t)=>{var l;e.connectionStartParams=t.payload,e.connectionMade=e.modifyingEdge;const{nodeId:n,handleId:r,handleType:i}=t.payload;if(!n||!r)return;const o=e.nodes.findIndex(u=>u.id===n),a=(l=e.nodes)==null?void 0:l[o];if(!Ur(a))return;const s=i==="source"?a.data.outputs[r]:a.data.inputs[r];e.currentConnectionFieldType=(s==null?void 0:s.type)??null},connectionMade:(e,t)=>{e.currentConnectionFieldType&&(e.edges=wg({...t.payload,type:"default"},e.edges),e.connectionMade=!0)},connectionEnded:(e,t)=>{var n;if(e.connectionMade)e.connectionStartParams=null,e.currentConnectionFieldType=null;else if(e.mouseOverNode){const r=e.nodes.findIndex(o=>o.id===e.mouseOverNode),i=(n=e.nodes)==null?void 0:n[r];if(i&&e.connectionStartParams){const{nodeId:o,handleId:a,handleType:s}=e.connectionStartParams;if(o&&a&&s&&e.currentConnectionFieldType){const l=W9(i,e.nodes,e.edges,o,a,s,e.currentConnectionFieldType);l&&(e.edges=wg({...l,type:"default"},e.edges))}}e.connectionStartParams=null,e.currentConnectionFieldType=null}else e.addNewNodePosition=t.payload.cursorPosition,e.isAddNodePopoverOpen=!0;e.modifyingEdge=!1},workflowExposedFieldAdded:(e,t)=>{e.workflow.exposedFields=tE(e.workflow.exposedFields.concat(t.payload),n=>`${n.nodeId}-${n.fieldName}`)},workflowExposedFieldRemoved:(e,t)=>{e.workflow.exposedFields=e.workflow.exposedFields.filter(n=>!pk(n,t.payload))},fieldLabelChanged:(e,t)=>{const{nodeId:n,fieldName:r,label:i}=t.payload,o=e.nodes.find(s=>s.id===n);if(!Ur(o))return;const a=o.data.inputs[r];a&&(a.label=i)},nodeEmbedWorkflowChanged:(e,t)=>{var a;const{nodeId:n,embedWorkflow:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];Ur(o)&&(o.data.embedWorkflow=r)},nodeUseCacheChanged:(e,t)=>{var a;const{nodeId:n,useCache:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];Ur(o)&&(o.data.useCache=r)},nodeIsIntermediateChanged:(e,t)=>{var a;const{nodeId:n,isIntermediate:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];Ur(o)&&(o.data.isIntermediate=r)},nodeIsOpenChanged:(e,t)=>{var s;const{nodeId:n,isOpen:r}=t.payload,i=e.nodes.findIndex(l=>l.id===n),o=(s=e.nodes)==null?void 0:s[i];if(!Ur(o)&&!yI(o)||(o.data.isOpen=r,!Ur(o)))return;const a=fA([o],e.edges);if(r)a.forEach(l=>{delete l.hidden}),a.forEach(l=>{l.type==="collapsed"&&(e.edges=e.edges.filter(u=>u.id!==l.id))});else{const l=Mbe(o,e.nodes,e.edges).filter(d=>Ur(d)&&d.data.isOpen===!1),u=Obe(o,e.nodes,e.edges).filter(d=>Ur(d)&&d.data.isOpen===!1),c=[];a.forEach(d=>{var f,h;if(d.target===n&&l.find(p=>p.id===d.source)){d.hidden=!0;const p=c.find(m=>m.source===d.source&&m.target===d.target);p?p.data={count:(((f=p.data)==null?void 0:f.count)??0)+1}:c.push({id:`${d.source}-${d.target}-collapsed`,source:d.source,target:d.target,type:"collapsed",data:{count:1},updatable:!1})}if(d.source===n&&u.find(p=>p.id===d.target)){const p=c.find(m=>m.source===d.source&&m.target===d.target);d.hidden=!0,p?p.data={count:(((h=p.data)==null?void 0:h.count)??0)+1}:c.push({id:`${d.source}-${d.target}-collapsed`,source:d.source,target:d.target,type:"collapsed",data:{count:1},updatable:!1})}}),c.length&&(e.edges=Nc(c.map(d=>({type:"add",item:d})),e.edges))}},edgeDeleted:(e,t)=>{e.edges=e.edges.filter(n=>n.id!==t.payload)},edgesDeleted:(e,t)=>{const r=t.payload.filter(i=>i.type==="collapsed");if(r.length){const i=[];r.forEach(o=>{e.edges.forEach(a=>{a.source===o.source&&a.target===o.target&&i.push({id:a.id,type:"remove"})})}),e.edges=Nc(i,e.edges)}},nodesDeleted:(e,t)=>{t.payload.forEach(n=>{e.workflow.exposedFields=e.workflow.exposedFields.filter(r=>r.nodeId!==n.id),Ur(n)&&delete e.nodeExecutionStates[n.id]})},nodeLabelChanged:(e,t)=>{var a;const{nodeId:n,label:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];Ur(o)&&(o.data.label=r)},nodeNotesChanged:(e,t)=>{var a;const{nodeId:n,notes:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];Ur(o)&&(o.data.notes=r)},nodeExclusivelySelected:(e,t)=>{const n=t.payload;e.nodes=Gc(e.nodes.map(r=>({id:r.id,type:"select",selected:r.id===n})),e.nodes)},selectedNodesChanged:(e,t)=>{e.selectedNodes=t.payload},selectedEdgesChanged:(e,t)=>{e.selectedEdges=t.payload},fieldStringValueChanged:(e,t)=>{Zi(e,t)},fieldNumberValueChanged:(e,t)=>{Zi(e,t)},fieldBooleanValueChanged:(e,t)=>{Zi(e,t)},fieldBoardValueChanged:(e,t)=>{Zi(e,t)},fieldImageValueChanged:(e,t)=>{Zi(e,t)},fieldColorValueChanged:(e,t)=>{Zi(e,t)},fieldMainModelValueChanged:(e,t)=>{Zi(e,t)},fieldRefinerModelValueChanged:(e,t)=>{Zi(e,t)},fieldVaeModelValueChanged:(e,t)=>{Zi(e,t)},fieldLoRAModelValueChanged:(e,t)=>{Zi(e,t)},fieldControlNetModelValueChanged:(e,t)=>{Zi(e,t)},fieldIPAdapterModelValueChanged:(e,t)=>{Zi(e,t)},fieldT2IAdapterModelValueChanged:(e,t)=>{Zi(e,t)},fieldEnumModelValueChanged:(e,t)=>{Zi(e,t)},fieldSchedulerValueChanged:(e,t)=>{Zi(e,t)},imageCollectionFieldValueChanged:(e,t)=>{var u,c;const{nodeId:n,fieldName:r,value:i}=t.payload,o=e.nodes.findIndex(d=>d.id===n);if(o===-1)return;const a=(u=e.nodes)==null?void 0:u[o];if(!Ur(a))return;const s=(c=a.data)==null?void 0:c.inputs[r];if(!s)return;const l=Cn(s.value);if(!l){s.value=i;return}s.value=tE(l.concat(i),"image_name")},notesNodeValueChanged:(e,t)=>{var a;const{nodeId:n,value:r}=t.payload,i=e.nodes.findIndex(s=>s.id===n),o=(a=e.nodes)==null?void 0:a[i];yI(o)&&(o.data.notes=r)},shouldShowFieldTypeLegendChanged:(e,t)=>{e.shouldShowFieldTypeLegend=t.payload},shouldShowMinimapPanelChanged:(e,t)=>{e.shouldShowMinimapPanel=t.payload},nodeTemplatesBuilt:(e,t)=>{e.nodeTemplates=t.payload,e.isReady=!0},nodeEditorReset:e=>{e.nodes=[],e.edges=[],e.workflow=Cn(GE)},shouldValidateGraphChanged:(e,t)=>{e.shouldValidateGraph=t.payload},shouldAnimateEdgesChanged:(e,t)=>{e.shouldAnimateEdges=t.payload},shouldSnapToGridChanged:(e,t)=>{e.shouldSnapToGrid=t.payload},shouldColorEdgesChanged:(e,t)=>{e.shouldColorEdges=t.payload},nodeOpacityChanged:(e,t)=>{e.nodeOpacity=t.payload},workflowNameChanged:(e,t)=>{e.workflow.name=t.payload},workflowDescriptionChanged:(e,t)=>{e.workflow.description=t.payload},workflowTagsChanged:(e,t)=>{e.workflow.tags=t.payload},workflowAuthorChanged:(e,t)=>{e.workflow.author=t.payload},workflowNotesChanged:(e,t)=>{e.workflow.notes=t.payload},workflowVersionChanged:(e,t)=>{e.workflow.version=t.payload},workflowContactChanged:(e,t)=>{e.workflow.contact=t.payload},workflowLoaded:(e,t)=>{const{nodes:n,edges:r,...i}=t.payload;e.workflow=i,e.nodes=Gc(n.map(o=>({item:{...o,dragHandle:`.${dSe}`},type:"add"})),[]),e.edges=Nc(r.map(o=>({item:o,type:"add"})),[]),e.nodeExecutionStates=n.reduce((o,a)=>(o[a.id]={nodeId:a.id,...GC},o),{})},workflowReset:e=>{e.workflow=Cn(GE)},viewportChanged:(e,t)=>{e.viewport=t.payload},mouseOverFieldChanged:(e,t)=>{e.mouseOverField=t.payload},mouseOverNodeChanged:(e,t)=>{e.mouseOverNode=t.payload},selectedAll:e=>{e.nodes=Gc(e.nodes.map(t=>({id:t.id,type:"select",selected:!0})),e.nodes),e.edges=Nc(e.edges.map(t=>({id:t.id,type:"select",selected:!0})),e.edges)},selectionCopied:e=>{if(e.nodesToCopy=e.nodes.filter(t=>t.selected).map(Cn),e.edgesToCopy=e.edges.filter(t=>t.selected).map(Cn),e.nodesToCopy.length>0){const t={x:0,y:0};e.nodesToCopy.forEach(n=>{const r=.15*(n.width??0),i=.5*(n.height??0);t.x+=n.position.x+r,t.y+=n.position.y+i}),t.x/=e.nodesToCopy.length,t.y/=e.nodesToCopy.length,e.nodesToCopy.forEach(n=>{n.position.x-=t.x,n.position.y-=t.y})}},selectionPasted:(e,t)=>{const{cursorPosition:n}=t.payload,r=e.nodesToCopy.map(Cn),i=r.map(c=>c.data.id),o=e.edgesToCopy.filter(c=>i.includes(c.source)&&i.includes(c.target)).map(Cn);o.forEach(c=>c.selected=!0),r.forEach(c=>{const d=LV();o.forEach(h=>{h.source===c.data.id&&(h.source=d,h.id=h.id.replace(c.data.id,d)),h.target===c.data.id&&(h.target=d,h.id=h.id.replace(c.data.id,d))}),c.selected=!0,c.id=d,c.data.id=d;const f=F9(e.nodes,c.position.x+((n==null?void 0:n.x)??0),c.position.y+((n==null?void 0:n.y)??0));c.position=f});const a=r.map(c=>({item:c,type:"add"})),s=e.nodes.map(c=>({id:c.data.id,type:"select",selected:!1})),l=o.map(c=>({item:c,type:"add"})),u=e.edges.map(c=>({id:c.id,type:"select",selected:!1}));e.nodes=Gc(a.concat(s),e.nodes),e.edges=Nc(l.concat(u),e.edges),r.forEach(c=>{e.nodeExecutionStates[c.id]={nodeId:c.id,...GC}})},addNodePopoverOpened:e=>{e.addNewNodePosition=null,e.isAddNodePopoverOpen=!0},addNodePopoverClosed:e=>{e.isAddNodePopoverOpen=!1,e.connectionStartParams=null,e.currentConnectionFieldType=null},addNodePopoverToggled:e=>{e.isAddNodePopoverOpen=!e.isAddNodePopoverOpen},selectionModeChanged:(e,t)=>{e.selectionMode=t.payload?uc.Full:uc.Partial}},extraReducers:e=>{e.addCase(y0.pending,t=>{t.isReady=!1}),e.addCase(Gk,(t,n)=>{const{source_node_id:r}=n.payload.data,i=t.nodeExecutionStates[r];i&&(i.status=Wc.IN_PROGRESS)}),e.addCase(Hk,(t,n)=>{const{source_node_id:r,result:i}=n.payload.data,o=t.nodeExecutionStates[r];o&&(o.status=Wc.COMPLETED,o.progress!==null&&(o.progress=1),o.outputs.push(i))}),e.addCase(G2,(t,n)=>{const{source_node_id:r}=n.payload.data,i=t.nodeExecutionStates[r];i&&(i.status=Wc.FAILED,i.error=n.payload.data.error,i.progress=null,i.progressImage=null)}),e.addCase(Wk,(t,n)=>{const{source_node_id:r,step:i,total_steps:o,progress_image:a}=n.payload.data,s=t.nodeExecutionStates[r];s&&(s.status=Wc.IN_PROGRESS,s.progress=(i+1)/o,s.progressImage=a??null)}),e.addCase(Kk,(t,n)=>{["in_progress"].includes(n.payload.data.status)&&Ea(t.nodeExecutionStates,r=>{r.status=Wc.PENDING,r.error=null,r.progress=null,r.progressImage=null,r.outputs=[]})})}}),{addNodePopoverClosed:qqe,addNodePopoverOpened:Hqe,addNodePopoverToggled:Wqe,connectionEnded:Kqe,connectionMade:Qqe,connectionStarted:Xqe,edgeDeleted:Yqe,edgeChangeStarted:Zqe,edgesChanged:Jqe,edgesDeleted:eHe,edgeUpdated:tHe,fieldBoardValueChanged:nHe,fieldBooleanValueChanged:rHe,fieldColorValueChanged:iHe,fieldControlNetModelValueChanged:oHe,fieldEnumModelValueChanged:aHe,fieldImageValueChanged:Z2,fieldIPAdapterModelValueChanged:sHe,fieldT2IAdapterModelValueChanged:lHe,fieldLabelChanged:uHe,fieldLoRAModelValueChanged:cHe,fieldMainModelValueChanged:dHe,fieldNumberValueChanged:fHe,fieldRefinerModelValueChanged:hHe,fieldSchedulerValueChanged:pHe,fieldStringValueChanged:gHe,fieldVaeModelValueChanged:mHe,imageCollectionFieldValueChanged:yHe,mouseOverFieldChanged:vHe,mouseOverNodeChanged:bHe,nodeAdded:_He,nodeEditorReset:u2e,nodeEmbedWorkflowChanged:SHe,nodeExclusivelySelected:xHe,nodeIsIntermediateChanged:wHe,nodeIsOpenChanged:CHe,nodeLabelChanged:EHe,nodeNotesChanged:THe,nodeOpacityChanged:kHe,nodesChanged:AHe,nodesDeleted:PHe,nodeTemplatesBuilt:KV,nodeUseCacheChanged:IHe,notesNodeValueChanged:RHe,selectedAll:OHe,selectedEdgesChanged:MHe,selectedNodesChanged:NHe,selectionCopied:$He,selectionModeChanged:DHe,selectionPasted:LHe,shouldAnimateEdgesChanged:FHe,shouldColorEdgesChanged:BHe,shouldShowFieldTypeLegendChanged:zHe,shouldShowMinimapPanelChanged:jHe,shouldSnapToGridChanged:UHe,shouldValidateGraphChanged:VHe,viewportChanged:GHe,workflowAuthorChanged:qHe,workflowContactChanged:HHe,workflowDescriptionChanged:WHe,workflowExposedFieldAdded:c2e,workflowExposedFieldRemoved:KHe,workflowLoaded:d2e,workflowNameChanged:QHe,workflowNotesChanged:XHe,workflowTagsChanged:YHe,workflowVersionChanged:ZHe,edgeAdded:JHe}=WV.actions,f2e=WV.reducer,QV={esrganModelName:"RealESRGAN_x4plus.pth"},XV=rr({name:"postprocessing",initialState:QV,reducers:{esrganModelNameChanged:(e,t)=>{e.esrganModelName=t.payload}}}),{esrganModelNameChanged:eWe}=XV.actions,h2e=XV.reducer,YV={positiveStylePrompt:"",negativeStylePrompt:"",shouldConcatSDXLStylePrompt:!0,shouldUseSDXLRefiner:!1,sdxlImg2ImgDenoisingStrength:.7,refinerModel:null,refinerSteps:20,refinerCFGScale:7.5,refinerScheduler:"euler",refinerPositiveAestheticScore:6,refinerNegativeAestheticScore:2.5,refinerStart:.8},ZV=rr({name:"sdxl",initialState:YV,reducers:{setPositiveStylePromptSDXL:(e,t)=>{e.positiveStylePrompt=t.payload},setNegativeStylePromptSDXL:(e,t)=>{e.negativeStylePrompt=t.payload},setShouldConcatSDXLStylePrompt:(e,t)=>{e.shouldConcatSDXLStylePrompt=t.payload},setShouldUseSDXLRefiner:(e,t)=>{e.shouldUseSDXLRefiner=t.payload},setSDXLImg2ImgDenoisingStrength:(e,t)=>{e.sdxlImg2ImgDenoisingStrength=t.payload},refinerModelChanged:(e,t)=>{e.refinerModel=t.payload},setRefinerSteps:(e,t)=>{e.refinerSteps=t.payload},setRefinerCFGScale:(e,t)=>{e.refinerCFGScale=t.payload},setRefinerScheduler:(e,t)=>{e.refinerScheduler=t.payload},setRefinerPositiveAestheticScore:(e,t)=>{e.refinerPositiveAestheticScore=t.payload},setRefinerNegativeAestheticScore:(e,t)=>{e.refinerNegativeAestheticScore=t.payload},setRefinerStart:(e,t)=>{e.refinerStart=t.payload}}}),{setPositiveStylePromptSDXL:tWe,setNegativeStylePromptSDXL:nWe,setShouldConcatSDXLStylePrompt:rWe,setShouldUseSDXLRefiner:p2e,setSDXLImg2ImgDenoisingStrength:iWe,refinerModelChanged:K9,setRefinerSteps:oWe,setRefinerCFGScale:aWe,setRefinerScheduler:sWe,setRefinerPositiveAestheticScore:lWe,setRefinerNegativeAestheticScore:uWe,setRefinerStart:cWe}=ZV.actions,g2e=ZV.reducer,m2e=(e,t,n)=>t===0?0:n===2?Math.floor((e+1+1)/2)/Math.floor((t+1)/2):(e+1+1)/(t+1),Ld=e=>typeof e=="string"?{title:e,status:"info",isClosable:!0,duration:2500}:{status:"info",isClosable:!0,duration:2500,...e},JV={isInitialized:!1,isConnected:!1,shouldConfirmOnDelete:!0,enableImageDebugging:!1,toastQueue:[],denoiseProgress:null,shouldAntialiasProgressImage:!1,consoleLogLevel:"debug",shouldLogToConsole:!0,language:"en",shouldUseNSFWChecker:!1,shouldUseWatermarker:!1,shouldEnableInformationalPopovers:!1,status:"DISCONNECTED"},eG=rr({name:"system",initialState:JV,reducers:{setShouldConfirmOnDelete:(e,t)=>{e.shouldConfirmOnDelete=t.payload},setEnableImageDebugging:(e,t)=>{e.enableImageDebugging=t.payload},addToast:(e,t)=>{e.toastQueue.push(t.payload)},clearToastQueue:e=>{e.toastQueue=[]},consoleLogLevelChanged:(e,t)=>{e.consoleLogLevel=t.payload},shouldLogToConsoleChanged:(e,t)=>{e.shouldLogToConsole=t.payload},shouldAntialiasProgressImageChanged:(e,t)=>{e.shouldAntialiasProgressImage=t.payload},languageChanged:(e,t)=>{e.language=t.payload},shouldUseNSFWCheckerChanged(e,t){e.shouldUseNSFWChecker=t.payload},shouldUseWatermarkerChanged(e,t){e.shouldUseWatermarker=t.payload},setShouldEnableInformationalPopovers(e,t){e.shouldEnableInformationalPopovers=t.payload},isInitializedChanged(e,t){e.isInitialized=t.payload}},extraReducers(e){e.addCase(Vk,t=>{t.isConnected=!0,t.denoiseProgress=null,t.status="CONNECTED"}),e.addCase(Vj,t=>{t.isConnected=!1,t.denoiseProgress=null,t.status="DISCONNECTED"}),e.addCase(Gk,t=>{t.denoiseProgress=null,t.status="PROCESSING"}),e.addCase(Wk,(t,n)=>{const{step:r,total_steps:i,order:o,progress_image:a,graph_execution_state_id:s,queue_batch_id:l}=n.payload.data;t.denoiseProgress={step:r,total_steps:i,order:o,percentage:m2e(r,i,o),progress_image:a,session_id:s,batch_id:l},t.status="PROCESSING"}),e.addCase(Hk,t=>{t.denoiseProgress=null,t.status="CONNECTED"}),e.addCase(Wj,t=>{t.denoiseProgress=null,t.status="CONNECTED"}),e.addCase(Xj,t=>{t.status="LOADING_MODEL"}),e.addCase(Zj,t=>{t.status="CONNECTED"}),e.addCase(Kk,(t,n)=>{["completed","canceled","failed"].includes(n.payload.data.status)&&(t.status="CONNECTED",t.denoiseProgress=null)}),e.addMatcher(S2e,(t,n)=>{t.toastQueue.push(Ld({title:Y("toast.serverError"),status:"error",description:Eae(n.payload.data.error_type)}))})}}),{setShouldConfirmOnDelete:dWe,setEnableImageDebugging:fWe,addToast:qt,clearToastQueue:hWe,consoleLogLevelChanged:pWe,shouldLogToConsoleChanged:gWe,shouldAntialiasProgressImageChanged:mWe,languageChanged:yWe,shouldUseNSFWCheckerChanged:y2e,shouldUseWatermarkerChanged:v2e,setShouldEnableInformationalPopovers:vWe,isInitializedChanged:b2e}=eG.actions,_2e=eG.reducer,S2e=$o(G2,eU,nU),x2e={listCursor:void 0,listPriority:void 0,selectedQueueItem:void 0,resumeProcessorOnEnqueue:!0},w2e=x2e,tG=rr({name:"queue",initialState:w2e,reducers:{listCursorChanged:(e,t)=>{e.listCursor=t.payload},listPriorityChanged:(e,t)=>{e.listPriority=t.payload},listParamsReset:e=>{e.listCursor=void 0,e.listPriority=void 0},queueItemSelectionToggled:(e,t)=>{e.selectedQueueItem===t.payload?e.selectedQueueItem=void 0:e.selectedQueueItem=t.payload},resumeProcessorOnEnqueueChanged:(e,t)=>{e.resumeProcessorOnEnqueue=t.payload}}}),{listCursorChanged:bWe,listPriorityChanged:_We,listParamsReset:C2e,queueItemSelectionToggled:SWe,resumeProcessorOnEnqueueChanged:xWe}=tG.actions,E2e=tG.reducer,T2e={searchFolder:null,advancedAddScanModel:null},nG=rr({name:"modelmanager",initialState:T2e,reducers:{setSearchFolder:(e,t)=>{e.searchFolder=t.payload},setAdvancedAddScanModel:(e,t)=>{e.advancedAddScanModel=t.payload}}}),{setSearchFolder:wWe,setAdvancedAddScanModel:CWe}=nG.actions,k2e=nG.reducer,rG={shift:!1,ctrl:!1,meta:!1},iG=rr({name:"hotkeys",initialState:rG,reducers:{shiftKeyPressed:(e,t)=>{e.shift=t.payload},ctrlKeyPressed:(e,t)=>{e.ctrl=t.payload},metaKeyPressed:(e,t)=>{e.meta=t.payload}}}),{shiftKeyPressed:EWe,ctrlKeyPressed:TWe,metaKeyPressed:kWe}=iG.actions,A2e=iG.reducer,oG={activeTab:"txt2img",shouldShowImageDetails:!1,shouldUseCanvasBetaLayout:!1,shouldShowExistingModelsInSearch:!1,shouldUseSliders:!1,shouldHidePreview:!1,shouldShowProgressInViewer:!0,shouldShowEmbeddingPicker:!1,shouldAutoChangeDimensions:!1,favoriteSchedulers:[],globalContextMenuCloseTrigger:0,panels:{}},aG=rr({name:"ui",initialState:oG,reducers:{setActiveTab:(e,t)=>{e.activeTab=t.payload},setShouldShowImageDetails:(e,t)=>{e.shouldShowImageDetails=t.payload},setShouldUseCanvasBetaLayout:(e,t)=>{e.shouldUseCanvasBetaLayout=t.payload},setShouldHidePreview:(e,t)=>{e.shouldHidePreview=t.payload},setShouldShowExistingModelsInSearch:(e,t)=>{e.shouldShowExistingModelsInSearch=t.payload},setShouldUseSliders:(e,t)=>{e.shouldUseSliders=t.payload},setShouldShowProgressInViewer:(e,t)=>{e.shouldShowProgressInViewer=t.payload},favoriteSchedulersChanged:(e,t)=>{e.favoriteSchedulers=t.payload},toggleEmbeddingPicker:e=>{e.shouldShowEmbeddingPicker=!e.shouldShowEmbeddingPicker},setShouldAutoChangeDimensions:(e,t)=>{e.shouldAutoChangeDimensions=t.payload},contextMenusClosed:e=>{e.globalContextMenuCloseTrigger+=1},panelsChanged:(e,t)=>{e.panels[t.payload.name]=t.payload.value}},extraReducers(e){e.addCase(ZS,t=>{t.activeTab="img2img"})}}),{setActiveTab:sG,setShouldShowImageDetails:AWe,setShouldUseCanvasBetaLayout:PWe,setShouldShowExistingModelsInSearch:IWe,setShouldUseSliders:RWe,setShouldHidePreview:OWe,setShouldShowProgressInViewer:MWe,favoriteSchedulersChanged:NWe,toggleEmbeddingPicker:$We,setShouldAutoChangeDimensions:DWe,contextMenusClosed:LWe,panelsChanged:FWe}=aG.actions,P2e=aG.reducer,I2e=hS(FY);lG=qE=void 0;var R2e=I2e,O2e=function(){var t=[],n=[],r=void 0,i=function(u){return r=u,function(c){return function(d){return R2e.compose.apply(void 0,n)(c)(d)}}},o=function(){for(var u,c,d=arguments.length,f=Array(d),h=0;h<d;h++)f[h]=arguments[h];(u=n).push.apply(u,f.map(function(p){return p(r)})),(c=t).push.apply(c,f)},a=function(u){var c=t.findIndex(function(d){return d===u});if(c===-1){console.error("Middleware does not exist!",u);return}t=t.filter(function(d,f){return f!==c}),n=n.filter(function(d,f){return f!==c})},s=function(){n=[],t=[]};return{enhancer:i,addMiddleware:o,removeMiddleware:a,resetMiddlewares:s}},J2=O2e(),M2e=J2.enhancer,N2e=J2.addMiddleware;J2.removeMiddleware;var $2e=J2.resetMiddlewares,qE=N2e,lG=$2e,HE="@@REMEMBER_REHYDRATED",D2e="@@REMEMBER_PERSISTED";function WE(e){"@babel/helpers - typeof";return WE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},WE(e)}var uG=function(t,n){if(t===null||WE(t)!=="object")return{};for(var r=-1,i={};++r<n.length;){var o=n[r];i[o]=t[o]}return i},L2e=function(t,n){var r=0,i;return function(){for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];var l=+new Date,u=(r||l)-l;if(u<=0&&!i){r=l+n,t.apply(void 0,a);return}i&&(clearTimeout(i),i=null),i=setTimeout(function(){r=+new Date+n,t.apply(void 0,a),clearTimeout(i),i=null},u)}},F2e=function(t,n){var r;return function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];clearTimeout(r),r=setTimeout(function(){t.apply(void 0,o),r=null},n)}};function Q9(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(u){n(u);return}s.done?t(l):Promise.resolve(l).then(r,i)}function vA(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(l){Q9(o,r,i,a,s,"next",l)}function s(l){Q9(o,r,i,a,s,"throw",l)}a(void 0)})}}var B2e=function(){var e=vA(function*(t){var n=t.rememberedKeys,r=t.driver,i=t.prefix,o=t.unserialize,a=yield r.getItem("".concat(i,"rootState"));return a==null?{}:uG(o(a,"rootState"),n)});return function(n){return e.apply(this,arguments)}}(),z2e=function(){var e=vA(function*(t){var n=t.rememberedKeys,r=t.driver,i=t.prefix,o=t.unserialize,a=yield Promise.all(n.map(function(s){return r.getItem("".concat(i).concat(s))}));return n.reduce(function(s,l,u){return a[u]!==null&&a[u]!==void 0&&(s[l]=o(a[u],l)),s},{})});return function(n){return e.apply(this,arguments)}}(),j2e=function(){var e=vA(function*(t,n,r){var i=r.prefix,o=r.driver,a=r.persistWholeStore,s=r.unserialize,l={};try{var u=a?B2e:z2e;l=yield u({rememberedKeys:n,driver:o,prefix:i,unserialize:s})}catch(c){console.warn("redux-remember: rehydrate error",c)}t.dispatch({type:HE,payload:l})});return function(n,r,i){return e.apply(this,arguments)}}();function qC(e,t){return G2e(e)||V2e(e,t)||cG(e,t)||U2e()}function U2e(){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 V2e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}function G2e(e){if(Array.isArray(e))return e}function HC(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=cG(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){n=n.call(e)},n:function(){var u=n.next();return o=u.done,u},e:function(u){a=!0,s=u},f:function(){try{!o&&n.return!=null&&n.return()}finally{if(a)throw s}}}}function cG(e,t){if(e){if(typeof e=="string")return X9(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return X9(e,t)}}function X9(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function D_(e){"@babel/helpers - typeof";return D_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D_(e)}var Y9=function(t){var n;return(n=Object.prototype.toString.call(t).match(/\[object (.*)\]/))===null||n===void 0?void 0:n[1]},Z9=function(t){return/^\[object (?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)Array\]$/.test(Object.prototype.toString.call(t))},q2e=function e(t,n){if(t===n)return!0;if(D_(t)!=="object"||D_(n)!=="object"||t===null||t===void 0||n===null||n===void 0)return t!==t&&n!==n;if(t.constructor!==n.constructor)return!1;if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(Array.isArray(t)){if(t.length!==n.length)return!1;for(var r=t.length;r--!==0;)if(!e(t[r],n[r]))return!1;return!0}if(Z9(t)&&Z9(n)){if(t.byteLength!==n.byteLength)return!1;for(var i=t.byteLength;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}var o=Y9(t),a=Y9(n);if(o==="DataView"&&a==="DataView")return t.byteLength!==n.byteLength||t.byteOffset!==n.byteOffset?!1:e(t.buffer,n.buffer);if(o==="ArrayBuffer"&&a==="ArrayBuffer")return t.byteLength!==n.byteLength?!1:e(new Uint8Array(t),new Uint8Array(n));if(o==="Map"&&a==="Map"){if(t.size!==n.size)return!1;var s=HC(t.entries()),l;try{for(s.s();!(l=s.n()).done;){var u=qC(l.value,1),c=u[0];if(!n.has(c))return!1}}catch(C){s.e(C)}finally{s.f()}var d=HC(t.entries()),f;try{for(d.s();!(f=d.n()).done;){var h=qC(f.value,2),p=h[0],m=h[1];if(!e(m,n.get(p)))return!1}}catch(C){d.e(C)}finally{d.f()}return!0}if(o==="Set"&&a==="Set"){if(t.size!==n.size)return!1;var _=HC(t.entries()),b;try{for(_.s();!(b=_.n()).done;){var y=qC(b.value,1),g=y[0];if(!n.has(g))return!1}}catch(C){_.e(C)}finally{_.f()}return!0}if(o==="Date"&&a==="Date")return+t==+n;var v=Object.keys(t);if(v.length!==Object.keys(n).length)return!1;for(var S=v.length;S--!==0;)if(!Object.prototype.hasOwnProperty.call(n,v[S]))return!1;for(var w=v.length;w--!==0;){var x=v[w];if(!e(t[x],n[x]))return!1}return o!=="Object"&&a!=="Object"?t===n:!0};const bA=q2e;function J9(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(u){n(u);return}s.done?t(l):Promise.resolve(l).then(r,i)}function dG(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(l){J9(o,r,i,a,s,"next",l)}function s(l){J9(o,r,i,a,s,"throw",l)}a(void 0)})}}var H2e=function(){var e=dG(function*(t,n,r){var i=r.prefix,o=r.driver,a=r.serialize;if(!bA(t,n))return o.setItem("".concat(i,"rootState"),a(t,"rootState"))});return function(n,r,i){return e.apply(this,arguments)}}(),W2e=function(t,n,r){var i=r.prefix,o=r.driver,a=r.serialize;return Promise.all(Object.keys(t).map(function(s){return bA(t[s],n[s])?Promise.resolve():o.setItem("".concat(i).concat(s),a(t[s],s))}))},K2e=function(){var e=dG(function*(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=r.prefix,o=r.driver,a=r.persistWholeStore,s=r.serialize;try{var l=a?H2e:W2e;yield l(t,n,{prefix:i,driver:o,serialize:s})}catch(u){console.warn("redux-remember: persist error",u)}});return function(){return e.apply(this,arguments)}}();function eO(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(u){n(u);return}s.done?t(l):Promise.resolve(l).then(r,i)}function tO(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(l){eO(o,r,i,a,s,"next",l)}function s(l){eO(o,r,i,a,s,"throw",l)}a(void 0)})}}var Q2e=function(){var e=tO(function*(t,n,r){var i=r.prefix,o=r.driver,a=r.serialize,s=r.unserialize,l=r.persistThrottle,u=r.persistDebounce,c=r.persistWholeStore;yield j2e(t,n,{prefix:i,driver:o,unserialize:s,persistWholeStore:c});var d={},f=function(){var h=tO(function*(){var p=uG(t.getState(),n);yield K2e(p,d,{prefix:i,driver:o,serialize:a,persistWholeStore:c}),bA(p,d)||t.dispatch({type:D2e,payload:p}),d=p});return function(){return h.apply(this,arguments)}}();u&&u>0?t.subscribe(F2e(f,u)):t.subscribe(L2e(f,l))});return function(n,r,i){return e.apply(this,arguments)}}();const X2e=Q2e;function v0(e){"@babel/helpers - typeof";return v0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v0(e)}function nO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function WC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nO(Object(n),!0).forEach(function(r){Y2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Y2e(e,t,n){return t=Z2e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z2e(e){var t=J2e(e,"string");return v0(t)==="symbol"?t:String(t)}function J2e(e,t){if(v0(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(v0(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var exe=function(t){var n={state:{}};return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:n.state,i=arguments.length>1?arguments[1]:void 0;i.type&&(i.type==="@@INIT"||i.type.startsWith("@@redux/INIT"))&&(n.state=WC({},r));var o=typeof t=="function"?t:pp(t);switch(i.type){case HE:{var a=WC(WC({},n.state),i.payload||{});return n.state=o(a,{type:HE,payload:a}),n.state}default:return o(r,i)}}},txe=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=r.prefix,o=i===void 0?"@@remember-":i,a=r.serialize,s=a===void 0?function(_,b){return JSON.stringify(_)}:a,l=r.unserialize,u=l===void 0?function(_,b){return JSON.parse(_)}:l,c=r.persistThrottle,d=c===void 0?100:c,f=r.persistDebounce,h=r.persistWholeStore,p=h===void 0?!1:h;if(!t)throw Error("redux-remember error: driver required");if(!Array.isArray(n))throw Error("redux-remember error: rememberedKeys needs to be an array");var m=function(b){return function(y,g,v){var S=b(y,g,v);return X2e(S,n,{driver:t,prefix:o,serialize:s,unserialize:u,persistThrottle:d,persistDebounce:f,persistWholeStore:p}),S}};return m};const BWe=["chakra-ui-color-mode","i18nextLng","ROARR_FILTER","ROARR_LOG"],nxe="@@invokeai-",rxe=["cursorPosition"],ixe=["pendingControlImages"],oxe=["prompts"],axe=["selection","selectedBoardId","galleryView"],sxe=["nodeTemplates","connectionStartParams","currentConnectionFieldType","selectedNodes","selectedEdges","isReady","nodesToCopy","edgesToCopy","connectionMade","modifyingEdge","addNewNodePosition"],lxe=[],uxe=[],cxe=["isInitialized","isConnected","denoiseProgress","status"],dxe=["shouldShowImageDetails","globalContextMenuCloseTrigger","panels"],fxe={canvas:rxe,gallery:axe,generation:lxe,nodes:sxe,postprocessing:uxe,system:cxe,ui:dxe,controlNet:ixe,dynamicPrompts:oxe},hxe=(e,t)=>{const n=KS(e,fxe[t]??[]);return JSON.stringify(n)},pxe={canvas:kB,gallery:fU,generation:yk,nodes:HV,postprocessing:QV,system:JV,config:fB,ui:oG,hotkeys:rG,controlNet:wE,dynamicPrompts:Zk,sdxl:YV},gxe=(e,t)=>boe(JSON.parse(e),pxe[t]),mxe=Ne("nodes/textToImageGraphBuilt"),yxe=Ne("nodes/imageToImageGraphBuilt"),fG=Ne("nodes/canvasGraphBuilt"),vxe=Ne("nodes/nodesGraphBuilt"),bxe=$o(mxe,yxe,fG,vxe),_xe=Ne("nodes/workflowLoadRequested"),Sxe=e=>{if(bxe(e)&&e.payload.nodes){const t={};return{...e,payload:{...e.payload,nodes:t}}}return y0.fulfilled.match(e)?{...e,payload:"<OpenAPI schema omitted>"}:KV.match(e)?{...e,payload:"<Node templates omitted>"}:e},xxe=["canvas/setCursorPosition","canvas/setStageCoordinates","canvas/setStageScale","canvas/setIsDrawing","canvas/setBoundingBoxCoordinates","canvas/setBoundingBoxDimensions","canvas/setIsDrawing","canvas/addPointToCurrentLine","socket/socketGeneratorProgress","socket/appSocketGeneratorProgress","@@REMEMBER_PERSISTED"],wxe=e=>e,hG="default",Vr=nl(hG),Cxe=e=>{const t=e?Qg.stringify(e,{arrayFormat:"none"}):void 0;return t?`queue/${Vr.get()}/list?${t}`:`queue/${Vr.get()}/list`},Kc=ds({selectId:e=>e.item_id,sortComparer:(e,t)=>e.priority>t.priority?-1:e.priority<t.priority?1:e.item_id<t.item_id?-1:e.item_id>t.item_id?1:0}),Xr=us.injectEndpoints({endpoints:e=>({enqueueBatch:e.mutation({query:t=>({url:`queue/${Vr.get()}/enqueue_batch`,body:t,method:"POST"}),invalidatesTags:["SessionQueueStatus","CurrentSessionQueueItem","NextSessionQueueItem"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,eg(r)}catch{}}}),enqueueGraph:e.mutation({query:t=>({url:`queue/${Vr.get()}/enqueue_graph`,body:t,method:"POST"}),invalidatesTags:["SessionQueueStatus","CurrentSessionQueueItem","NextSessionQueueItem"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,eg(r)}catch{}}}),resumeProcessor:e.mutation({query:()=>({url:`queue/${Vr.get()}/processor/resume`,method:"PUT"}),invalidatesTags:["CurrentSessionQueueItem","SessionQueueStatus"]}),pauseProcessor:e.mutation({query:()=>({url:`queue/${Vr.get()}/processor/pause`,method:"PUT"}),invalidatesTags:["CurrentSessionQueueItem","SessionQueueStatus"]}),pruneQueue:e.mutation({query:()=>({url:`queue/${Vr.get()}/prune`,method:"PUT"}),invalidatesTags:["SessionQueueStatus","BatchStatus","SessionQueueItem","SessionQueueItemDTO"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,eg(r)}catch{}}}),clearQueue:e.mutation({query:()=>({url:`queue/${Vr.get()}/clear`,method:"PUT"}),invalidatesTags:["SessionQueueStatus","SessionProcessorStatus","BatchStatus","CurrentSessionQueueItem","NextSessionQueueItem","SessionQueueItem","SessionQueueItemDTO"],onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,eg(r)}catch{}}}),getCurrentQueueItem:e.query({query:()=>({url:`queue/${Vr.get()}/current`,method:"GET"}),providesTags:t=>{const n=["CurrentSessionQueueItem"];return t&&n.push({type:"SessionQueueItem",id:t.item_id}),n}}),getNextQueueItem:e.query({query:()=>({url:`queue/${Vr.get()}/next`,method:"GET"}),providesTags:t=>{const n=["NextSessionQueueItem"];return t&&n.push({type:"SessionQueueItem",id:t.item_id}),n}}),getQueueStatus:e.query({query:()=>({url:`queue/${Vr.get()}/status`,method:"GET"}),providesTags:["SessionQueueStatus"]}),getBatchStatus:e.query({query:({batch_id:t})=>({url:`queue/${Vr.get()}/b/${t}/status`,method:"GET"}),providesTags:t=>t?[{type:"BatchStatus",id:t.batch_id}]:[]}),getQueueItem:e.query({query:t=>({url:`queue/${Vr.get()}/i/${t}`,method:"GET"}),providesTags:t=>t?[{type:"SessionQueueItem",id:t.item_id}]:[]}),cancelQueueItem:e.mutation({query:t=>({url:`queue/${Vr.get()}/i/${t}/cancel`,method:"PUT"}),onQueryStarted:async(t,{dispatch:n,queryFulfilled:r})=>{try{const{data:i}=await r;n(Xr.util.updateQueryData("listQueueItems",void 0,o=>{Kc.updateOne(o,{id:t,changes:{status:i.status}})}))}catch{}},invalidatesTags:t=>t?[{type:"SessionQueueItem",id:t.item_id},{type:"SessionQueueItemDTO",id:t.item_id},{type:"BatchStatus",id:t.batch_id}]:[]}),cancelByBatchIds:e.mutation({query:t=>({url:`queue/${Vr.get()}/cancel_by_batch_ids`,method:"PUT",body:t}),onQueryStarted:async(t,n)=>{const{dispatch:r,queryFulfilled:i}=n;try{await i,eg(r)}catch{}},invalidatesTags:["SessionQueueItem","SessionQueueItemDTO","BatchStatus"]}),listQueueItems:e.query({query:t=>({url:Cxe(t),method:"GET"}),serializeQueryArgs:()=>`queue/${Vr.get()}/list`,transformResponse:t=>Kc.addMany(Kc.getInitialState({has_more:t.has_more}),t.items),merge:(t,n)=>{Kc.addMany(t,Kc.getSelectors().selectAll(n)),t.has_more=n.has_more},forceRefetch:({currentArg:t,previousArg:n})=>t!==n,keepUnusedDataFor:60*5})})}),{useCancelByBatchIdsMutation:zWe,useEnqueueGraphMutation:jWe,useEnqueueBatchMutation:UWe,usePauseProcessorMutation:VWe,useResumeProcessorMutation:GWe,useClearQueueMutation:qWe,usePruneQueueMutation:HWe,useGetCurrentQueueItemQuery:WWe,useGetQueueStatusQuery:KWe,useGetQueueItemQuery:QWe,useGetNextQueueItemQuery:XWe,useListQueueItemsQuery:YWe,useCancelQueueItemMutation:ZWe,useGetBatchStatusQuery:JWe}=Xr,eg=e=>{e(Xr.util.updateQueryData("listQueueItems",void 0,t=>{Kc.removeAll(t),t.has_more=!1})),e(C2e()),e(Xr.endpoints.listQueueItems.initiate(void 0))},Exe=$o(ule,cle),Txe=()=>{Fe({matcher:Exe,effect:async(e,{dispatch:t,getState:n})=>{const r=_e("canvas"),i=n(),{batchIds:o}=i.canvas;try{const a=t(Xr.endpoints.cancelByBatchIds.initiate({batch_ids:o},{fixedCacheKey:"cancelByBatchIds"})),{canceled:s}=await a.unwrap();a.reset(),s>0&&(r.debug(`Canceled ${s} canvas batches`),t(qt({title:Y("queue.cancelBatchSucceeded"),status:"success"}))),t(ple())}catch{r.error("Failed to cancel canvas batches"),t(qt({title:Y("queue.cancelBatchFailed"),status:"error"}))}}})};Ne("app/appStarted");const kxe=()=>{Fe({matcher:ve.endpoints.listImages.matchFulfilled,effect:async(e,{dispatch:t,unsubscribe:n,cancelActiveListeners:r})=>{if(e.meta.arg.queryCacheKey!==zo({board_id:"none",categories:oi}))return;r(),n();const i=e.payload;if(i.ids.length>0){const o=Gn.getSelectors().selectAll(i)[0];t(Gs(o??null))}}})},Axe=$o(Xr.endpoints.enqueueBatch.matchFulfilled,Xr.endpoints.enqueueGraph.matchFulfilled),Pxe=()=>{Fe({matcher:Axe,effect:async(e,{dispatch:t,getState:n})=>{const{data:r}=Xr.endpoints.getQueueStatus.select()(n());!r||r.processor.is_started||t(Xr.endpoints.resumeProcessor.initiate(void 0,{fixedCacheKey:"resumeProcessor"}))}})},pG=us.injectEndpoints({endpoints:e=>({getAppVersion:e.query({query:()=>({url:"app/version",method:"GET"}),providesTags:["AppVersion"],keepUnusedDataFor:864e5}),getAppConfig:e.query({query:()=>({url:"app/config",method:"GET"}),providesTags:["AppConfig"],keepUnusedDataFor:864e5}),getInvocationCacheStatus:e.query({query:()=>({url:"app/invocation_cache/status",method:"GET"}),providesTags:["InvocationCacheStatus"]}),clearInvocationCache:e.mutation({query:()=>({url:"app/invocation_cache",method:"DELETE"}),invalidatesTags:["InvocationCacheStatus"]}),enableInvocationCache:e.mutation({query:()=>({url:"app/invocation_cache/enable",method:"PUT"}),invalidatesTags:["InvocationCacheStatus"]}),disableInvocationCache:e.mutation({query:()=>({url:"app/invocation_cache/disable",method:"PUT"}),invalidatesTags:["InvocationCacheStatus"]})})}),{useGetAppVersionQuery:eKe,useGetAppConfigQuery:tKe,useClearInvocationCacheMutation:nKe,useDisableInvocationCacheMutation:rKe,useEnableInvocationCacheMutation:iKe,useGetInvocationCacheStatusQuery:oKe}=pG,Ixe=()=>{Fe({matcher:pG.endpoints.getAppConfig.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{const{infill_methods:r=[],nsfw_methods:i=[],watermarking_methods:o=[]}=e.payload,a=t().generation.infillMethod;r.includes(a)||n(ele(r[0])),i.includes("nsfw_checker")||n(y2e(!1)),o.includes("invisible_watermark")||n(v2e(!1))}})},Rxe=Ne("app/appStarted"),Oxe=()=>{Fe({actionCreator:Rxe,effect:async(e,{unsubscribe:t,cancelActiveListeners:n})=>{n(),t()}})},ex={memoizeOptions:{resultEqualityCheck:pk}},gG=(e,t)=>{var f;const{generation:n,canvas:r,nodes:i,controlNet:o}=e,a=((f=n.initialImage)==null?void 0:f.imageName)===t,s=r.layerState.objects.some(h=>h.kind==="image"&&h.imageName===t),l=i.nodes.filter(Ur).some(h=>zf(h.data.inputs,p=>{var m;return p.type==="ImageField"&&((m=p.value)==null?void 0:m.image_name)===t})),u=zf(o.controlNets,h=>h.controlImage===t||h.processedControlImage===t),c=o.ipAdapterInfo.adapterImage===t;return{isInitialImage:a,isCanvasImage:s,isNodesImage:l,isControlNetImage:u,isIPAdapterImage:c}},Mxe=Ii([e=>e],e=>{const{imagesToDelete:t}=e.deleteImageModal;return t.length?t.map(r=>gG(e,r.image_name)):[]},ex),Nxe=()=>{Fe({matcher:ve.endpoints.deleteBoardAndImages.matchFulfilled,effect:async(e,{dispatch:t,getState:n})=>{const{deleted_images:r}=e.payload;let i=!1,o=!1,a=!1,s=!1,l=!1;const u=n();r.forEach(c=>{const d=gG(u,c);d.isInitialImage&&!i&&(t(vk()),i=!0),d.isCanvasImage&&!o&&(t(bk()),o=!0),d.isNodesImage&&!a&&(t(u2e()),a=!0),d.isControlNetImage&&!s&&(t(v0e()),s=!0),d.isIPAdapterImage&&!l&&(t(uU()),l=!0)})}})},$xe=()=>{Fe({matcher:$o(E_,CE),effect:async(e,{getState:t,dispatch:n,condition:r,cancelActiveListeners:i})=>{i();const o=t(),a=E_.match(e)?e.payload.boardId:o.gallery.selectedBoardId,l=(CE.match(e)?e.payload:o.gallery.galleryView)==="images"?oi:Ji,u={board_id:a??"none",categories:l};if(await r(()=>ve.endpoints.listImages.select(u)(t()).isSuccess,5e3)){const{data:d}=ve.endpoints.listImages.select(u)(t());if(d){const f=u0.selectAll(d)[0],h=u0.selectById(d,e.payload.selectedImageName);n(Gs(h||f||null))}else n(Gs(null))}else n(Gs(null))}})},Dxe=Ne("canvas/canvasSavedToGallery"),Lxe=Ne("canvas/canvasMaskSavedToGallery"),Fxe=Ne("canvas/canvasCopiedToClipboard"),Bxe=Ne("canvas/canvasDownloadedAsImage"),zxe=Ne("canvas/canvasMerged"),jxe=Ne("canvas/stagingAreaImageSaved"),Uxe=Ne("canvas/canvasMaskToControlNet"),Vxe=Ne("canvas/canvasImageToControlNet");let mG=null,yG=null;const aKe=e=>{mG=e},tx=()=>mG,sKe=e=>{yG=e},Gxe=()=>yG,qxe=async e=>new Promise((t,n)=>{e.toBlob(r=>{if(r){t(r);return}n("Unable to create Blob")})}),L_=async(e,t)=>await qxe(e.toCanvas(t)),nx=async(e,t=!1)=>{const n=tx();if(!n)throw new Error("Problem getting base layer blob");const{shouldCropToBoundingBoxOnSave:r,boundingBoxCoordinates:i,boundingBoxDimensions:o}=e.canvas,a=n.clone();a.scale({x:1,y:1});const s=a.getAbsolutePosition(),l=r||t?{x:i.x+s.x,y:i.y+s.y,width:o.width,height:o.height}:a.getClientRect();return L_(a,l)},Hxe=(e,t="image/png")=>{navigator.clipboard.write([new ClipboardItem({[t]:e})])},Wxe=()=>{Fe({actionCreator:Fxe,effect:async(e,{dispatch:t,getState:n})=>{const r=x2.get().child({namespace:"canvasCopiedToClipboardListener"}),i=n();try{const o=nx(i);Hxe(o)}catch(o){r.error(String(o)),t(qt({title:Y("toast.problemCopyingCanvas"),description:Y("toast.problemCopyingCanvasDesc"),status:"error"}));return}t(qt({title:Y("toast.canvasCopiedClipboard"),status:"success"}))}})},Kxe=(e,t)=>{const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),r.remove()},Qxe=()=>{Fe({actionCreator:Bxe,effect:async(e,{dispatch:t,getState:n})=>{const r=x2.get().child({namespace:"canvasSavedToGalleryListener"}),i=n();let o;try{o=await nx(i)}catch(a){r.error(String(a)),t(qt({title:Y("toast.problemDownloadingCanvas"),description:Y("toast.problemDownloadingCanvasDesc"),status:"error"}));return}Kxe(o,"canvas.png"),t(qt({title:Y("toast.canvasDownloaded"),status:"success"}))}})},Xxe=()=>{Fe({actionCreator:Vxe,effect:async(e,{dispatch:t,getState:n})=>{const r=_e("canvas"),i=n();let o;try{o=await nx(i,!0)}catch(u){r.error(String(u)),t(qt({title:Y("toast.problemSavingCanvas"),description:Y("toast.problemSavingCanvasDesc"),status:"error"}));return}const{autoAddBoardId:a}=i.gallery,s=await t(ve.endpoints.uploadImage.initiate({file:new File([o],"savedCanvas.png",{type:"image/png"}),image_category:"control",is_intermediate:!1,board_id:a==="none"?void 0:a,crop_visible:!1,postUploadAction:{type:"TOAST",toastOptions:{title:Y("toast.canvasSentControlnetAssets")}}})).unwrap(),{image_name:l}=s;t(Cc({controlNetId:e.payload.controlNet.controlNetId,controlImage:l}))}})};var _A={exports:{}},rx={},vG={},Rt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e._registerNode=e.Konva=e.glob=void 0;var t=Math.PI/180;function n(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}e.glob=typeof yt<"u"?yt:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},e.Konva={_global:e.glob,version:"9.2.0",isBrowser:n(),isUnminified:/param/.test((function(i){}).toString()),dblClickWindow:400,getAngle(i){return e.Konva.angleDeg?i*t:i},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return e.Konva.DD.isDragging},isDragReady(){return!!e.Konva.DD.node},releaseCanvasOnDestroy:!0,document:e.glob.document,_injectGlobal(i){e.glob.Konva=i}};const r=i=>{e.Konva[i.prototype.getClassName()]=i};e._registerNode=r,e.Konva._injectGlobal(e.Konva)})(Rt);var fr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Util=e.Transform=void 0;const t=Rt;class n{constructor(v=[1,0,0,1,0,0]){this.dirty=!1,this.m=v&&v.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new n(this.m)}copyInto(v){v.m[0]=this.m[0],v.m[1]=this.m[1],v.m[2]=this.m[2],v.m[3]=this.m[3],v.m[4]=this.m[4],v.m[5]=this.m[5]}point(v){var S=this.m;return{x:S[0]*v.x+S[2]*v.y+S[4],y:S[1]*v.x+S[3]*v.y+S[5]}}translate(v,S){return this.m[4]+=this.m[0]*v+this.m[2]*S,this.m[5]+=this.m[1]*v+this.m[3]*S,this}scale(v,S){return this.m[0]*=v,this.m[1]*=v,this.m[2]*=S,this.m[3]*=S,this}rotate(v){var S=Math.cos(v),w=Math.sin(v),x=this.m[0]*S+this.m[2]*w,C=this.m[1]*S+this.m[3]*w,k=this.m[0]*-w+this.m[2]*S,T=this.m[1]*-w+this.m[3]*S;return this.m[0]=x,this.m[1]=C,this.m[2]=k,this.m[3]=T,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(v,S){var w=this.m[0]+this.m[2]*S,x=this.m[1]+this.m[3]*S,C=this.m[2]+this.m[0]*v,k=this.m[3]+this.m[1]*v;return this.m[0]=w,this.m[1]=x,this.m[2]=C,this.m[3]=k,this}multiply(v){var S=this.m[0]*v.m[0]+this.m[2]*v.m[1],w=this.m[1]*v.m[0]+this.m[3]*v.m[1],x=this.m[0]*v.m[2]+this.m[2]*v.m[3],C=this.m[1]*v.m[2]+this.m[3]*v.m[3],k=this.m[0]*v.m[4]+this.m[2]*v.m[5]+this.m[4],T=this.m[1]*v.m[4]+this.m[3]*v.m[5]+this.m[5];return this.m[0]=S,this.m[1]=w,this.m[2]=x,this.m[3]=C,this.m[4]=k,this.m[5]=T,this}invert(){var v=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),S=this.m[3]*v,w=-this.m[1]*v,x=-this.m[2]*v,C=this.m[0]*v,k=v*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),T=v*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=S,this.m[1]=w,this.m[2]=x,this.m[3]=C,this.m[4]=k,this.m[5]=T,this}getMatrix(){return this.m}decompose(){var v=this.m[0],S=this.m[1],w=this.m[2],x=this.m[3],C=this.m[4],k=this.m[5],T=v*x-S*w;let P={x:C,y:k,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(v!=0||S!=0){var $=Math.sqrt(v*v+S*S);P.rotation=S>0?Math.acos(v/$):-Math.acos(v/$),P.scaleX=$,P.scaleY=T/$,P.skewX=(v*w+S*x)/T,P.skewY=0}else if(w!=0||x!=0){var O=Math.sqrt(w*w+x*x);P.rotation=Math.PI/2-(x>0?Math.acos(-w/O):-Math.acos(w/O)),P.scaleX=T/O,P.scaleY=O,P.skewX=0,P.skewY=(v*w+S*x)/T}return P.rotation=e.Util._getRotation(P.rotation),P}}e.Transform=n;var r="[object Array]",i="[object Number]",o="[object String]",a="[object Boolean]",s=Math.PI/180,l=180/Math.PI,u="#",c="",d="0",f="Konva warning: ",h="Konva error: ",p="rgb(",m={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]},_=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,b=[];const y=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(g){setTimeout(g,60)};e.Util={_isElement(g){return!!(g&&g.nodeType==1)},_isFunction(g){return!!(g&&g.constructor&&g.call&&g.apply)},_isPlainObject(g){return!!g&&g.constructor===Object},_isArray(g){return Object.prototype.toString.call(g)===r},_isNumber(g){return Object.prototype.toString.call(g)===i&&!isNaN(g)&&isFinite(g)},_isString(g){return Object.prototype.toString.call(g)===o},_isBoolean(g){return Object.prototype.toString.call(g)===a},isObject(g){return g instanceof Object},isValidSelector(g){if(typeof g!="string")return!1;var v=g[0];return v==="#"||v==="."||v===v.toUpperCase()},_sign(g){return g===0||g>0?1:-1},requestAnimFrame(g){b.push(g),b.length===1&&y(function(){const v=b;b=[],v.forEach(function(S){S()})})},createCanvasElement(){var g=document.createElement("canvas");try{g.style=g.style||{}}catch{}return g},createImageElement(){return document.createElement("img")},_isInDocument(g){for(;g=g.parentNode;)if(g==document)return!0;return!1},_urlToImage(g,v){var S=e.Util.createImageElement();S.onload=function(){v(S)},S.src=g},_rgbToHex(g,v,S){return((1<<24)+(g<<16)+(v<<8)+S).toString(16).slice(1)},_hexToRgb(g){g=g.replace(u,c);var v=parseInt(g,16);return{r:v>>16&255,g:v>>8&255,b:v&255}},getRandomColor(){for(var g=(Math.random()*16777215<<0).toString(16);g.length<6;)g=d+g;return u+g},getRGB(g){var v;return g in m?(v=m[g],{r:v[0],g:v[1],b:v[2]}):g[0]===u?this._hexToRgb(g.substring(1)):g.substr(0,4)===p?(v=_.exec(g.replace(/ /g,"")),{r:parseInt(v[1],10),g:parseInt(v[2],10),b:parseInt(v[3],10)}):{r:0,g:0,b:0}},colorToRGBA(g){return g=g||"black",e.Util._namedColorToRBA(g)||e.Util._hex3ColorToRGBA(g)||e.Util._hex4ColorToRGBA(g)||e.Util._hex6ColorToRGBA(g)||e.Util._hex8ColorToRGBA(g)||e.Util._rgbColorToRGBA(g)||e.Util._rgbaColorToRGBA(g)||e.Util._hslColorToRGBA(g)},_namedColorToRBA(g){var v=m[g.toLowerCase()];return v?{r:v[0],g:v[1],b:v[2],a:1}:null},_rgbColorToRGBA(g){if(g.indexOf("rgb(")===0){g=g.match(/rgb\(([^)]+)\)/)[1];var v=g.split(/ *, */).map(Number);return{r:v[0],g:v[1],b:v[2],a:1}}},_rgbaColorToRGBA(g){if(g.indexOf("rgba(")===0){g=g.match(/rgba\(([^)]+)\)/)[1];var v=g.split(/ *, */).map((S,w)=>S.slice(-1)==="%"?w===3?parseInt(S)/100:parseInt(S)/100*255:Number(S));return{r:v[0],g:v[1],b:v[2],a:v[3]}}},_hex8ColorToRGBA(g){if(g[0]==="#"&&g.length===9)return{r:parseInt(g.slice(1,3),16),g:parseInt(g.slice(3,5),16),b:parseInt(g.slice(5,7),16),a:parseInt(g.slice(7,9),16)/255}},_hex6ColorToRGBA(g){if(g[0]==="#"&&g.length===7)return{r:parseInt(g.slice(1,3),16),g:parseInt(g.slice(3,5),16),b:parseInt(g.slice(5,7),16),a:1}},_hex4ColorToRGBA(g){if(g[0]==="#"&&g.length===5)return{r:parseInt(g[1]+g[1],16),g:parseInt(g[2]+g[2],16),b:parseInt(g[3]+g[3],16),a:parseInt(g[4]+g[4],16)/255}},_hex3ColorToRGBA(g){if(g[0]==="#"&&g.length===4)return{r:parseInt(g[1]+g[1],16),g:parseInt(g[2]+g[2],16),b:parseInt(g[3]+g[3],16),a:1}},_hslColorToRGBA(g){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(g)){const[v,...S]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(g),w=Number(S[0])/360,x=Number(S[1])/100,C=Number(S[2])/100;let k,T,P;if(x===0)return P=C*255,{r:Math.round(P),g:Math.round(P),b:Math.round(P),a:1};C<.5?k=C*(1+x):k=C+x-C*x;const $=2*C-k,O=[0,0,0];for(let E=0;E<3;E++)T=w+1/3*-(E-1),T<0&&T++,T>1&&T--,6*T<1?P=$+(k-$)*6*T:2*T<1?P=k:3*T<2?P=$+(k-$)*(2/3-T)*6:P=$,O[E]=P*255;return{r:Math.round(O[0]),g:Math.round(O[1]),b:Math.round(O[2]),a:1}}},haveIntersection(g,v){return!(v.x>g.x+g.width||v.x+v.width<g.x||v.y>g.y+g.height||v.y+v.height<g.y)},cloneObject(g){var v={};for(var S in g)this._isPlainObject(g[S])?v[S]=this.cloneObject(g[S]):this._isArray(g[S])?v[S]=this.cloneArray(g[S]):v[S]=g[S];return v},cloneArray(g){return g.slice(0)},degToRad(g){return g*s},radToDeg(g){return g*l},_degToRad(g){return e.Util.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),e.Util.degToRad(g)},_radToDeg(g){return e.Util.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),e.Util.radToDeg(g)},_getRotation(g){return t.Konva.angleDeg?e.Util.radToDeg(g):g},_capitalize(g){return g.charAt(0).toUpperCase()+g.slice(1)},throw(g){throw new Error(h+g)},error(g){console.error(h+g)},warn(g){t.Konva.showWarnings&&console.warn(f+g)},each(g,v){for(var S in g)v(S,g[S])},_inRange(g,v,S){return v<=g&&g<S},_getProjectionToSegment(g,v,S,w,x,C){var k,T,P,$=(g-S)*(g-S)+(v-w)*(v-w);if($==0)k=g,T=v,P=(x-S)*(x-S)+(C-w)*(C-w);else{var O=((x-g)*(S-g)+(C-v)*(w-v))/$;O<0?(k=g,T=v,P=(g-x)*(g-x)+(v-C)*(v-C)):O>1?(k=S,T=w,P=(S-x)*(S-x)+(w-C)*(w-C)):(k=g+O*(S-g),T=v+O*(w-v),P=(k-x)*(k-x)+(T-C)*(T-C))}return[k,T,P]},_getProjectionToLine(g,v,S){var w=e.Util.cloneObject(g),x=Number.MAX_VALUE;return v.forEach(function(C,k){if(!(!S&&k===v.length-1)){var T=v[(k+1)%v.length],P=e.Util._getProjectionToSegment(C.x,C.y,T.x,T.y,g.x,g.y),$=P[0],O=P[1],E=P[2];E<x&&(w.x=$,w.y=O,x=E)}}),w},_prepareArrayForTween(g,v,S){var w,x=[],C=[];if(g.length>v.length){var k=v;v=g,g=k}for(w=0;w<g.length;w+=2)x.push({x:g[w],y:g[w+1]});for(w=0;w<v.length;w+=2)C.push({x:v[w],y:v[w+1]});var T=[];return C.forEach(function(P){var $=e.Util._getProjectionToLine(P,x,S);T.push($.x),T.push($.y)}),T},_prepareToStringify(g){var v;g.visitedByCircularReferenceRemoval=!0;for(var S in g)if(g.hasOwnProperty(S)&&g[S]&&typeof g[S]=="object"){if(v=Object.getOwnPropertyDescriptor(g,S),g[S].visitedByCircularReferenceRemoval||e.Util._isElement(g[S]))if(v.configurable)delete g[S];else return null;else if(e.Util._prepareToStringify(g[S])===null)if(v.configurable)delete g[S];else return null}return delete g.visitedByCircularReferenceRemoval,g},_assign(g,v){for(var S in v)g[S]=v[S];return g},_getFirstPointerId(g){return g.touches?g.changedTouches[0].identifier:g.pointerId||999},releaseCanvas(...g){t.Konva.releaseCanvasOnDestroy&&g.forEach(v=>{v.width=0,v.height=0})},drawRoundedRectPath(g,v,S,w){let x=0,C=0,k=0,T=0;typeof w=="number"?x=C=k=T=Math.min(w,v/2,S/2):(x=Math.min(w[0]||0,v/2,S/2),C=Math.min(w[1]||0,v/2,S/2),T=Math.min(w[2]||0,v/2,S/2),k=Math.min(w[3]||0,v/2,S/2)),g.moveTo(x,0),g.lineTo(v-C,0),g.arc(v-C,C,C,Math.PI*3/2,0,!1),g.lineTo(v,S-T),g.arc(v-T,S-T,T,0,Math.PI/2,!1),g.lineTo(k,S),g.arc(k,S-k,k,Math.PI/2,Math.PI,!1),g.lineTo(0,x),g.arc(x,x,x,Math.PI,Math.PI*3/2,!1)}}})(fr);var ir={},At={},Xe={};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.getComponentValidator=Xe.getBooleanValidator=Xe.getNumberArrayValidator=Xe.getFunctionValidator=Xe.getStringOrGradientValidator=Xe.getStringValidator=Xe.getNumberOrAutoValidator=Xe.getNumberOrArrayOfNumbersValidator=Xe.getNumberValidator=Xe.alphaComponent=Xe.RGBComponent=void 0;const tu=Rt,br=fr;function nu(e){return br.Util._isString(e)?'"'+e+'"':Object.prototype.toString.call(e)==="[object Number]"||br.Util._isBoolean(e)?e:Object.prototype.toString.call(e)}function Yxe(e){return e>255?255:e<0?0:Math.round(e)}Xe.RGBComponent=Yxe;function Zxe(e){return e>1?1:e<1e-4?1e-4:e}Xe.alphaComponent=Zxe;function Jxe(){if(tu.Konva.isUnminified)return function(e,t){return br.Util._isNumber(e)||br.Util.warn(nu(e)+' is a not valid value for "'+t+'" attribute. The value should be a number.'),e}}Xe.getNumberValidator=Jxe;function ewe(e){if(tu.Konva.isUnminified)return function(t,n){let r=br.Util._isNumber(t),i=br.Util._isArray(t)&&t.length==e;return!r&&!i&&br.Util.warn(nu(t)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+e+")"),t}}Xe.getNumberOrArrayOfNumbersValidator=ewe;function twe(){if(tu.Konva.isUnminified)return function(e,t){var n=br.Util._isNumber(e),r=e==="auto";return n||r||br.Util.warn(nu(e)+' is a not valid value for "'+t+'" attribute. The value should be a number or "auto".'),e}}Xe.getNumberOrAutoValidator=twe;function nwe(){if(tu.Konva.isUnminified)return function(e,t){return br.Util._isString(e)||br.Util.warn(nu(e)+' is a not valid value for "'+t+'" attribute. The value should be a string.'),e}}Xe.getStringValidator=nwe;function rwe(){if(tu.Konva.isUnminified)return function(e,t){const n=br.Util._isString(e),r=Object.prototype.toString.call(e)==="[object CanvasGradient]"||e&&e.addColorStop;return n||r||br.Util.warn(nu(e)+' is a not valid value for "'+t+'" attribute. The value should be a string or a native gradient.'),e}}Xe.getStringOrGradientValidator=rwe;function iwe(){if(tu.Konva.isUnminified)return function(e,t){return br.Util._isFunction(e)||br.Util.warn(nu(e)+' is a not valid value for "'+t+'" attribute. The value should be a function.'),e}}Xe.getFunctionValidator=iwe;function owe(){if(tu.Konva.isUnminified)return function(e,t){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&e instanceof n||(br.Util._isArray(e)?e.forEach(function(r){br.Util._isNumber(r)||br.Util.warn('"'+t+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):br.Util.warn(nu(e)+' is a not valid value for "'+t+'" attribute. The value should be a array of numbers.')),e}}Xe.getNumberArrayValidator=owe;function awe(){if(tu.Konva.isUnminified)return function(e,t){var n=e===!0||e===!1;return n||br.Util.warn(nu(e)+' is a not valid value for "'+t+'" attribute. The value should be a boolean.'),e}}Xe.getBooleanValidator=awe;function swe(e){if(tu.Konva.isUnminified)return function(t,n){return t==null||br.Util.isObject(t)||br.Util.warn(nu(t)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+e),t}}Xe.getComponentValidator=swe;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Factory=void 0;const t=fr,n=Xe;var r="get",i="set";e.Factory={addGetterSetter(o,a,s,l,u){e.Factory.addGetter(o,a,s),e.Factory.addSetter(o,a,l,u),e.Factory.addOverloadedGetterSetter(o,a)},addGetter(o,a,s){var l=r+t.Util._capitalize(a);o.prototype[l]=o.prototype[l]||function(){var u=this.attrs[a];return u===void 0?s:u}},addSetter(o,a,s,l){var u=i+t.Util._capitalize(a);o.prototype[u]||e.Factory.overWriteSetter(o,a,s,l)},overWriteSetter(o,a,s,l){var u=i+t.Util._capitalize(a);o.prototype[u]=function(c){return s&&c!==void 0&&c!==null&&(c=s.call(this,c,a)),this._setAttr(a,c),l&&l.call(this),this}},addComponentsGetterSetter(o,a,s,l,u){var c=s.length,d=t.Util._capitalize,f=r+d(a),h=i+d(a),p,m;o.prototype[f]=function(){var b={};for(p=0;p<c;p++)m=s[p],b[m]=this.getAttr(a+d(m));return b};var _=(0,n.getComponentValidator)(s);o.prototype[h]=function(b){var y=this.attrs[a],g;l&&(b=l.call(this,b)),_&&_.call(this,b,a);for(g in b)b.hasOwnProperty(g)&&this._setAttr(a+d(g),b[g]);return b||s.forEach(v=>{this._setAttr(a+d(v),void 0)}),this._fireChangeEvent(a,y,b),u&&u.call(this),this},e.Factory.addOverloadedGetterSetter(o,a)},addOverloadedGetterSetter(o,a){var s=t.Util._capitalize(a),l=i+s,u=r+s;o.prototype[a]=function(){return arguments.length?(this[l](arguments[0]),this):this[u]()}},addDeprecatedGetterSetter(o,a,s,l){t.Util.error("Adding deprecated "+a);var u=r+t.Util._capitalize(a),c=a+" property is deprecated and will be removed soon. Look at Konva change log for more information.";o.prototype[u]=function(){t.Util.error(c);var d=this.attrs[a];return d===void 0?s:d},e.Factory.addSetter(o,a,l,function(){t.Util.error(c)}),e.Factory.addOverloadedGetterSetter(o,a)},backCompat(o,a){t.Util.each(a,function(s,l){var u=o.prototype[l],c=r+t.Util._capitalize(s),d=i+t.Util._capitalize(s);function f(){u.apply(this,arguments),t.Util.error('"'+s+'" method is deprecated and will be removed soon. Use ""'+l+'" instead.')}o.prototype[s]=f,o.prototype[c]=f,o.prototype[d]=f})},afterSetFilter(){this._filterUpToDate=!1}}})(At);var os={},Dl={};Object.defineProperty(Dl,"__esModule",{value:!0});Dl.HitContext=Dl.SceneContext=Dl.Context=void 0;const bG=fr,lwe=Rt;function uwe(e){var t=[],n=e.length,r=bG.Util,i,o;for(i=0;i<n;i++)o=e[i],r._isNumber(o)?o=Math.round(o*1e3)/1e3:r._isString(o)||(o=o+""),t.push(o);return t}var rO=",",cwe="(",dwe=")",fwe="([",hwe="])",pwe=";",gwe="()",mwe="=",iO=["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"],ywe=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled"];const vwe=100;class ix{constructor(t){this.canvas=t,lwe.Konva.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(t){t.fillEnabled()&&this._fill(t)}_fill(t){}strokeShape(t){t.hasStroke()&&this._stroke(t)}_stroke(t){}fillStrokeShape(t){t.attrs.fillAfterStrokeEnabled?(this.strokeShape(t),this.fillShape(t)):(this.fillShape(t),this.strokeShape(t))}getTrace(t,n){var r=this.traceArr,i=r.length,o="",a,s,l,u;for(a=0;a<i;a++)s=r[a],l=s.method,l?(u=s.args,o+=l,t?o+=gwe:bG.Util._isArray(u[0])?o+=fwe+u.join(rO)+hwe:(n&&(u=u.map(c=>typeof c=="number"?Math.floor(c):c)),o+=cwe+u.join(rO)+dwe)):(o+=s.property,t||(o+=mwe+s.val)),o+=pwe;return o}clearTrace(){this.traceArr=[]}_trace(t){var n=this.traceArr,r;n.push(t),r=n.length,r>=vwe&&n.shift()}reset(){var t=this.getCanvas().getPixelRatio();this.setTransform(1*t,0,0,1*t,0,0)}getCanvas(){return this.canvas}clear(t){var n=this.getCanvas();t?this.clearRect(t.x||0,t.y||0,t.width||0,t.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(t){const n=t.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(t){var n=t.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(t){const n=t.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(t,n){this._context[t]=n}arc(t,n,r,i,o,a){this._context.arc(t,n,r,i,o,a)}arcTo(t,n,r,i,o){this._context.arcTo(t,n,r,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(t,n,r,i,o,a){this._context.bezierCurveTo(t,n,r,i,o,a)}clearRect(t,n,r,i){this._context.clearRect(t,n,r,i)}clip(...t){this._context.clip.apply(this._context,t)}closePath(){this._context.closePath()}createImageData(t,n){var r=arguments;if(r.length===2)return this._context.createImageData(t,n);if(r.length===1)return this._context.createImageData(t)}createLinearGradient(t,n,r,i){return this._context.createLinearGradient(t,n,r,i)}createPattern(t,n){return this._context.createPattern(t,n)}createRadialGradient(t,n,r,i,o,a){return this._context.createRadialGradient(t,n,r,i,o,a)}drawImage(t,n,r,i,o,a,s,l,u){var c=arguments,d=this._context;c.length===3?d.drawImage(t,n,r):c.length===5?d.drawImage(t,n,r,i,o):c.length===9&&d.drawImage(t,n,r,i,o,a,s,l,u)}ellipse(t,n,r,i,o,a,s,l){this._context.ellipse(t,n,r,i,o,a,s,l)}isPointInPath(t,n,r,i){return r?this._context.isPointInPath(r,t,n,i):this._context.isPointInPath(t,n,i)}fill(...t){this._context.fill.apply(this._context,t)}fillRect(t,n,r,i){this._context.fillRect(t,n,r,i)}strokeRect(t,n,r,i){this._context.strokeRect(t,n,r,i)}fillText(t,n,r,i){i?this._context.fillText(t,n,r,i):this._context.fillText(t,n,r)}measureText(t){return this._context.measureText(t)}getImageData(t,n,r,i){return this._context.getImageData(t,n,r,i)}lineTo(t,n){this._context.lineTo(t,n)}moveTo(t,n){this._context.moveTo(t,n)}rect(t,n,r,i){this._context.rect(t,n,r,i)}putImageData(t,n,r){this._context.putImageData(t,n,r)}quadraticCurveTo(t,n,r,i){this._context.quadraticCurveTo(t,n,r,i)}restore(){this._context.restore()}rotate(t){this._context.rotate(t)}save(){this._context.save()}scale(t,n){this._context.scale(t,n)}setLineDash(t){this._context.setLineDash?this._context.setLineDash(t):"mozDash"in this._context?this._context.mozDash=t:"webkitLineDash"in this._context&&(this._context.webkitLineDash=t)}getLineDash(){return this._context.getLineDash()}setTransform(t,n,r,i,o,a){this._context.setTransform(t,n,r,i,o,a)}stroke(t){t?this._context.stroke(t):this._context.stroke()}strokeText(t,n,r,i){this._context.strokeText(t,n,r,i)}transform(t,n,r,i,o,a){this._context.transform(t,n,r,i,o,a)}translate(t,n){this._context.translate(t,n)}_enableTrace(){var t=this,n=iO.length,r=this.setAttr,i,o,a=function(s){var l=t[s],u;t[s]=function(){return o=uwe(Array.prototype.slice.call(arguments,0)),u=l.apply(t,arguments),t._trace({method:s,args:o}),u}};for(i=0;i<n;i++)a(iO[i]);t.setAttr=function(){r.apply(t,arguments);var s=arguments[0],l=arguments[1];(s==="shadowOffsetX"||s==="shadowOffsetY"||s==="shadowBlur")&&(l=l/this.canvas.getPixelRatio()),t._trace({property:s,val:l})}}_applyGlobalCompositeOperation(t){const n=t.attrs.globalCompositeOperation;var r=!n||n==="source-over";r||this.setAttr("globalCompositeOperation",n)}}Dl.Context=ix;ywe.forEach(function(e){Object.defineProperty(ix.prototype,e,{get(){return this._context[e]},set(t){this._context[e]=t}})});class bwe extends ix{constructor(t,{willReadFrequently:n=!1}={}){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(t){var n=t.fill();this.setAttr("fillStyle",n),t._fillFunc(this)}_fillPattern(t){this.setAttr("fillStyle",t._getFillPattern()),t._fillFunc(this)}_fillLinearGradient(t){var n=t._getLinearGradient();n&&(this.setAttr("fillStyle",n),t._fillFunc(this))}_fillRadialGradient(t){const n=t._getRadialGradient();n&&(this.setAttr("fillStyle",n),t._fillFunc(this))}_fill(t){const n=t.fill(),r=t.getFillPriority();if(n&&r==="color"){this._fillColor(t);return}const i=t.getFillPatternImage();if(i&&r==="pattern"){this._fillPattern(t);return}const o=t.getFillLinearGradientColorStops();if(o&&r==="linear-gradient"){this._fillLinearGradient(t);return}const a=t.getFillRadialGradientColorStops();if(a&&r==="radial-gradient"){this._fillRadialGradient(t);return}n?this._fillColor(t):i?this._fillPattern(t):o?this._fillLinearGradient(t):a&&this._fillRadialGradient(t)}_strokeLinearGradient(t){const n=t.getStrokeLinearGradientStartPoint(),r=t.getStrokeLinearGradientEndPoint(),i=t.getStrokeLinearGradientColorStops(),o=this.createLinearGradient(n.x,n.y,r.x,r.y);if(i){for(var a=0;a<i.length;a+=2)o.addColorStop(i[a],i[a+1]);this.setAttr("strokeStyle",o)}}_stroke(t){var n=t.dash(),r=t.getStrokeScaleEnabled();if(t.hasStroke()){if(!r){this.save();var i=this.getCanvas().getPixelRatio();this.setTransform(i,0,0,i,0,0)}this._applyLineCap(t),n&&t.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",t.dashOffset())),this.setAttr("lineWidth",t.strokeWidth()),t.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)");var o=t.getStrokeLinearGradientColorStops();o?this._strokeLinearGradient(t):this.setAttr("strokeStyle",t.stroke()),t._strokeFunc(this),r||this.restore()}}_applyShadow(t){var n,r,i,o=(n=t.getShadowRGBA())!==null&&n!==void 0?n:"black",a=(r=t.getShadowBlur())!==null&&r!==void 0?r:5,s=(i=t.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},l=t.getAbsoluteScale(),u=this.canvas.getPixelRatio(),c=l.x*u,d=l.y*u;this.setAttr("shadowColor",o),this.setAttr("shadowBlur",a*Math.min(Math.abs(c),Math.abs(d))),this.setAttr("shadowOffsetX",s.x*c),this.setAttr("shadowOffsetY",s.y*d)}}Dl.SceneContext=bwe;class _we extends ix{constructor(t){super(t),this._context=t._canvas.getContext("2d",{willReadFrequently:!0})}_fill(t){this.save(),this.setAttr("fillStyle",t.colorKey),t._fillFuncHit(this),this.restore()}strokeShape(t){t.hasHitStroke()&&this._stroke(t)}_stroke(t){if(t.hasHitStroke()){const o=t.getStrokeScaleEnabled();if(!o){this.save();var n=this.getCanvas().getPixelRatio();this.setTransform(n,0,0,n,0,0)}this._applyLineCap(t);var r=t.hitStrokeWidth(),i=r==="auto"?t.strokeWidth():r;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",t.colorKey),t._strokeFuncHit(this),o||this.restore()}}}Dl.HitContext=_we;Object.defineProperty(os,"__esModule",{value:!0});os.HitCanvas=os.SceneCanvas=os.Canvas=void 0;const F_=fr,_G=Dl,SG=Rt,Swe=At,xwe=Xe;var Bv;function wwe(){if(Bv)return Bv;var e=F_.Util.createCanvasElement(),t=e.getContext("2d");return Bv=function(){var n=SG.Konva._global.devicePixelRatio||1,r=t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1;return n/r}(),F_.Util.releaseCanvas(e),Bv}class ox{constructor(t){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;var n=t||{},r=n.pixelRatio||SG.Konva.pixelRatio||wwe();this.pixelRatio=r,this._canvas=F_.Util.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(t){var n=this.pixelRatio;this.pixelRatio=t,this.setSize(this.getWidth()/n,this.getHeight()/n)}setWidth(t){this.width=this._canvas.width=t*this.pixelRatio,this._canvas.style.width=t+"px";var n=this.pixelRatio,r=this.getContext()._context;r.scale(n,n)}setHeight(t){this.height=this._canvas.height=t*this.pixelRatio,this._canvas.style.height=t+"px";var n=this.pixelRatio,r=this.getContext()._context;r.scale(n,n)}getWidth(){return this.width}getHeight(){return this.height}setSize(t,n){this.setWidth(t||0),this.setHeight(n||0)}toDataURL(t,n){try{return this._canvas.toDataURL(t,n)}catch{try{return this._canvas.toDataURL()}catch(i){return F_.Util.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}os.Canvas=ox;Swe.Factory.addGetterSetter(ox,"pixelRatio",void 0,(0,xwe.getNumberValidator)());class Cwe extends ox{constructor(t={width:0,height:0,willReadFrequently:!1}){super(t),this.context=new _G.SceneContext(this,{willReadFrequently:t.willReadFrequently}),this.setSize(t.width,t.height)}}os.SceneCanvas=Cwe;class Ewe extends ox{constructor(t={width:0,height:0}){super(t),this.hitCanvas=!0,this.context=new _G.HitContext(this),this.setSize(t.width,t.height)}}os.HitCanvas=Ewe;var ax={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DD=void 0;const t=Rt,n=fr;e.DD={get isDragging(){var r=!1;return e.DD._dragElements.forEach(i=>{i.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){var r;return e.DD._dragElements.forEach(i=>{r=i.node}),r},_dragElements:new Map,_drag(r){const i=[];e.DD._dragElements.forEach((o,a)=>{const{node:s}=o,l=s.getStage();l.setPointersPositions(r),o.pointerId===void 0&&(o.pointerId=n.Util._getFirstPointerId(r));const u=l._changedPointerPositions.find(f=>f.id===o.pointerId);if(u){if(o.dragStatus!=="dragging"){var c=s.dragDistance(),d=Math.max(Math.abs(u.x-o.startPointerPos.x),Math.abs(u.y-o.startPointerPos.y));if(d<c||(s.startDrag({evt:r}),!s.isDragging()))return}s._setDragPosition(r,o),i.push(s)}}),i.forEach(o=>{o.fire("dragmove",{type:"dragmove",target:o,evt:r},!0)})},_endDragBefore(r){const i=[];e.DD._dragElements.forEach(o=>{const{node:a}=o,s=a.getStage();if(r&&s.setPointersPositions(r),!s._changedPointerPositions.find(c=>c.id===o.pointerId))return;(o.dragStatus==="dragging"||o.dragStatus==="stopped")&&(e.DD.justDragged=!0,t.Konva._mouseListenClick=!1,t.Konva._touchListenClick=!1,t.Konva._pointerListenClick=!1,o.dragStatus="stopped");const u=o.node.getLayer()||o.node instanceof t.Konva.Stage&&o.node;u&&i.indexOf(u)===-1&&i.push(u)}),i.forEach(o=>{o.draw()})},_endDragAfter(r){e.DD._dragElements.forEach((i,o)=>{i.dragStatus==="stopped"&&i.node.fire("dragend",{type:"dragend",target:i.node,evt:r},!0),i.dragStatus!=="dragging"&&e.DD._dragElements.delete(o)})}},t.Konva.isBrowser&&(window.addEventListener("mouseup",e.DD._endDragBefore,!0),window.addEventListener("touchend",e.DD._endDragBefore,!0),window.addEventListener("mousemove",e.DD._drag),window.addEventListener("touchmove",e.DD._drag),window.addEventListener("mouseup",e.DD._endDragAfter,!1),window.addEventListener("touchend",e.DD._endDragAfter,!1))})(ax);Object.defineProperty(ir,"__esModule",{value:!0});ir.Node=void 0;const $t=fr,Cy=At,zv=os,Dc=Rt,la=ax,kr=Xe;var G1="absoluteOpacity",jv="allEventListeners",ml="absoluteTransform",oO="absoluteScale",Lc="canvas",Twe="Change",kwe="children",Awe="konva",KE="listening",aO="mouseenter",sO="mouseleave",lO="set",uO="Shape",q1=" ",cO="stage",mu="transform",Pwe="Stage",QE="visible",Iwe=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(q1);let Rwe=1;class ht{constructor(t){this._id=Rwe++,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(t),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(t){(t===mu||t===ml)&&this._cache.get(t)?this._cache.get(t).dirty=!0:t?this._cache.delete(t):this._cache.clear()}_getCache(t,n){var r=this._cache.get(t),i=t===mu||t===ml,o=r===void 0||i&&r.dirty===!0;return o&&(r=n.call(this),this._cache.set(t,r)),r}_calculate(t,n,r){if(!this._attachedDepsListeners.get(t)){const i=n.map(o=>o+"Change.konva").join(q1);this.on(i,()=>{this._clearCache(t)}),this._attachedDepsListeners.set(t,!0)}return this._getCache(t,r)}_getCanvasCache(){return this._cache.get(Lc)}_clearSelfAndDescendantCache(t){this._clearCache(t),t===ml&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Lc)){const{scene:t,filter:n,hit:r}=this._cache.get(Lc);$t.Util.releaseCanvas(t,n,r),this._cache.delete(Lc)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(t){var n=t||{},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),o=Math.ceil(n.height||r.height),a=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,c=n.drawBorder||!1,d=n.hitCanvasPixelRatio||1;if(!i||!o){$t.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}i+=u*2+1,o+=u*2+1,s-=u,l-=u;var f=new zv.SceneCanvas({pixelRatio:a,width:i,height:o}),h=new zv.SceneCanvas({pixelRatio:a,width:0,height:0,willReadFrequently:!0}),p=new zv.HitCanvas({pixelRatio:d,width:i,height:o}),m=f.getContext(),_=p.getContext();return p.isCache=!0,f.isCache=!0,this._cache.delete(Lc),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(f.getContext()._context.imageSmoothingEnabled=!1,h.getContext()._context.imageSmoothingEnabled=!1),m.save(),_.save(),m.translate(-s,-l),_.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(G1),this._clearSelfAndDescendantCache(oO),this.drawScene(f,this),this.drawHit(p,this),this._isUnderCache=!1,m.restore(),_.restore(),c&&(m.save(),m.beginPath(),m.rect(0,0,i,o),m.closePath(),m.setAttr("strokeStyle","red"),m.setAttr("lineWidth",5),m.stroke(),m.restore()),this._cache.set(Lc,{scene:f,filter:h,hit:p,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(Lc)}getClientRect(t){throw new Error('abstract "getClientRect" method call')}_transformedRect(t,n){var r=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],i,o,a,s,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var c=l.point(u);i===void 0&&(i=a=c.x,o=s=c.y),i=Math.min(i,c.x),o=Math.min(o,c.y),a=Math.max(a,c.x),s=Math.max(s,c.y)}),{x:i,y:o,width:a-i,height:s-o}}_drawCachedSceneCanvas(t){t.save(),t._applyOpacity(this),t._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();t.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),i=r.pixelRatio;t.drawImage(r._canvas,0,0,r.width/i,r.height/i),t.restore()}_drawCachedHitCanvas(t){var n=this._getCanvasCache(),r=n.hit;t.save(),t.translate(n.x,n.y),t.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),t.restore()}_getCachedSceneCanvas(){var t=this.filters(),n=this._getCanvasCache(),r=n.scene,i=n.filter,o=i.getContext(),a,s,l,u;if(t){if(!this._filterUpToDate){var c=r.pixelRatio;i.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(a=t.length,o.clear(),o.drawImage(r._canvas,0,0,r.getWidth()/c,r.getHeight()/c),s=o.getImageData(0,0,i.getWidth(),i.getHeight()),l=0;l<a;l++){if(u=t[l],typeof u!="function"){$t.Util.error("Filter should be type of function, but got "+typeof u+" instead. Please check correct filters");continue}u.call(this,s),o.putImageData(s,0,0)}}catch(d){$t.Util.error("Unable to apply filter. "+d.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}this._filterUpToDate=!0}return i}return r}on(t,n){if(this._cache&&this._cache.delete(jv),arguments.length===3)return this._delegate.apply(this,arguments);var r=t.split(q1),i=r.length,o,a,s,l,u;for(o=0;o<i;o++)a=r[o],s=a.split("."),l=s[0],u=s[1]||"",this.eventListeners[l]||(this.eventListeners[l]=[]),this.eventListeners[l].push({name:u,handler:n});return this}off(t,n){var r=(t||"").split(q1),i=r.length,o,a,s,l,u,c;if(this._cache&&this._cache.delete(jv),!t)for(a in this.eventListeners)this._off(a);for(o=0;o<i;o++)if(s=r[o],l=s.split("."),u=l[0],c=l[1],u)this.eventListeners[u]&&this._off(u,c,n);else for(a in this.eventListeners)this._off(a,c,n);return this}dispatchEvent(t){var n={target:this,type:t.type,evt:t};return this.fire(t.type,n),this}addEventListener(t,n){return this.on(t,function(r){n.call(this,r.evt)}),this}removeEventListener(t){return this.off(t),this}_delegate(t,n,r){var i=this;this.on(t,function(o){for(var a=o.target.findAncestors(n,!0,i),s=0;s<a.length;s++)o=$t.Util.cloneObject(o),o.currentTarget=a[s],r.call(a[s],o)})}remove(){return this.isDragging()&&this.stopDrag(),la.DD._dragElements.delete(this._id),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(ml),this._clearSelfAndDescendantCache(G1),this._clearSelfAndDescendantCache(oO),this._clearSelfAndDescendantCache(cO),this._clearSelfAndDescendantCache(QE),this._clearSelfAndDescendantCache(KE)}_remove(){this._clearCaches();var t=this.getParent();t&&t.children&&(t.children.splice(this.index,1),t._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(t){var n="get"+$t.Util._capitalize(t);return $t.Util._isFunction(this[n])?this[n]():this.attrs[t]}getAncestors(){for(var t=this.getParent(),n=[];t;)n.push(t),t=t.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(t){return this._batchTransformChanges(()=>{var n,r;if(!t)return this;for(n in t)n!==kwe&&(r=lO+$t.Util._capitalize(n),$t.Util._isFunction(this[r])?this[r](t[n]):this._setAttr(n,t[n]))}),this}isListening(){return this._getCache(KE,this._isListening)}_isListening(t){if(!this.listening())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isListening(t):!0}isVisible(){return this._getCache(QE,this._isVisible)}_isVisible(t){if(!this.visible())return!1;const r=this.getParent();return r&&r!==t&&this!==t?r._isVisible(t):!0}shouldDrawHit(t,n=!1){if(t)return this._isVisible(t)&&this._isListening(t);var r=this.getLayer(),i=!1;la.DD._dragElements.forEach(a=>{a.dragStatus==="dragging"&&(a.node.nodeType==="Stage"||a.node.getLayer()===r)&&(i=!0)});var o=!n&&!Dc.Konva.hitOnDragEnabled&&i;return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var t=this.getDepth(),n=this,r=0,i,o,a,s;function l(u){for(i=[],o=u.length,a=0;a<o;a++)s=u[a],r++,s.nodeType!==uO&&(i=i.concat(s.getChildren().slice())),s._id===n._id&&(a=o);i.length>0&&i[0].getDepth()<=t&&l(i)}return n.nodeType!==Pwe&&l(n.getStage().getChildren()),r}getDepth(){for(var t=0,n=this.parent;n;)t++,n=n.parent;return t}_batchTransformChanges(t){this._batchingTransformChange=!0,t(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(mu),this._clearSelfAndDescendantCache(ml)),this._needClearTransformCache=!1}setPosition(t){return this._batchTransformChanges(()=>{this.x(t.x),this.y(t.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){if(!this.getStage())return null;var t=this.getStage().getPointerPosition();if(!t)return null;var n=this.getAbsoluteTransform().copy();return n.invert(),n.point(t)}getAbsolutePosition(t){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!t&&(t=!0);var i=this.getAbsoluteTransform(t).getMatrix(),o=new $t.Transform,a=this.offset();return o.m=i.slice(),o.translate(a.x,a.y),o.getTranslation()}setAbsolutePosition(t){var n=this._clearTransform();this.attrs.x=n.x,this.attrs.y=n.y,delete n.x,delete n.y,this._clearCache(mu);var r=this._getAbsoluteTransform().copy();return r.invert(),r.translate(t.x,t.y),t={x:this.attrs.x+r.getTranslation().x,y:this.attrs.y+r.getTranslation().y},this._setTransform(n),this.setPosition({x:t.x,y:t.y}),this._clearCache(mu),this._clearSelfAndDescendantCache(ml),this}_setTransform(t){var n;for(n in t)this.attrs[n]=t[n]}_clearTransform(){var t={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,t}move(t){var n=t.x,r=t.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),r!==void 0&&(o+=r),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(t,n){var r=[],i=this.getParent(),o,a;if(!(n&&n._id===this._id)){for(r.unshift(this);i&&(!n||i._id!==n._id);)r.unshift(i),i=i.parent;for(o=r.length,a=0;a<o;a++)t(r[a])}}rotate(t){return this.rotation(this.rotation()+t),this}moveToTop(){if(!this.parent)return $t.Util.warn("Node has no parent. moveToTop function is ignored."),!1;var t=this.index,n=this.parent.getChildren().length;return t<n-1?(this.parent.children.splice(t,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return $t.Util.warn("Node has no parent. moveUp function is ignored."),!1;var t=this.index,n=this.parent.getChildren().length;return t<n-1?(this.parent.children.splice(t,1),this.parent.children.splice(t+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return $t.Util.warn("Node has no parent. moveDown function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.splice(t-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return $t.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var t=this.index;return t>0?(this.parent.children.splice(t,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(t){if(!this.parent)return $t.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(t<0||t>=this.parent.children.length)&&$t.Util.warn("Unexpected value "+t+" 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(t,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(G1,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var t=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(t*=n.getAbsoluteOpacity()),t}moveTo(t){return this.getParent()!==t&&(this._remove(),t.add(this)),this}toObject(){var t={},n=this.getAttrs(),r,i,o,a,s;t.attrs={};for(r in n)i=n[r],s=$t.Util.isObject(i)&&!$t.Util._isPlainObject(i)&&!$t.Util._isArray(i),!s&&(o=typeof this[r]=="function"&&this[r],delete n[r],a=o?o.call(this):null,n[r]=i,a!==i&&(t.attrs[r]=i));return t.className=this.getClassName(),$t.Util._prepareToStringify(t)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(t,n,r){var i=[];n&&this._isMatch(t)&&i.push(this);for(var o=this.parent;o;){if(o===r)return i;o._isMatch(t)&&i.push(o),o=o.parent}return i}isAncestorOf(t){return!1}findAncestor(t,n,r){return this.findAncestors(t,n,r)[0]}_isMatch(t){if(!t)return!1;if(typeof t=="function")return t(this);var n=t.replace(/ /g,"").split(","),r=n.length,i,o;for(i=0;i<r;i++)if(o=n[i],$t.Util.isValidSelector(o)||($t.Util.warn('Selector "'+o+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),$t.Util.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),$t.Util.warn("Konva is awesome, right?")),o.charAt(0)==="#"){if(this.id()===o.slice(1))return!0}else if(o.charAt(0)==="."){if(this.hasName(o.slice(1)))return!0}else if(this.className===o||this.nodeType===o)return!0;return!1}getLayer(){var t=this.getParent();return t?t.getLayer():null}getStage(){return this._getCache(cO,this._getStage)}_getStage(){var t=this.getParent();if(t)return t.getStage()}fire(t,n={},r){return n.target=n.target||this,r?this._fireAndBubble(t,n):this._fire(t,n),this}getAbsoluteTransform(t){return t?this._getAbsoluteTransform(t):this._getCache(ml,this._getAbsoluteTransform)}_getAbsoluteTransform(t){var n;if(t)return n=new $t.Transform,this._eachAncestorReverse(function(i){var o=i.transformsEnabled();o==="all"?n.multiply(i.getTransform()):o==="position"&&n.translate(i.x()-i.offsetX(),i.y()-i.offsetY())},t),n;n=this._cache.get(ml)||new $t.Transform,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,o=this.attrs.y||0,a=this.attrs.offsetX||0,s=this.attrs.offsetY||0;n.translate(i-a,o-s)}return n.dirty=!1,n}getAbsoluteScale(t){for(var n=this;n;)n._isUnderCache&&(t=n),n=n.getParent();const i=this.getAbsoluteTransform(t).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(mu,this._getTransform)}_getTransform(){var t,n,r=this._cache.get(mu)||new $t.Transform;r.reset();var i=this.x(),o=this.y(),a=Dc.Konva.getAngle(this.rotation()),s=(t=this.attrs.scaleX)!==null&&t!==void 0?t:1,l=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,u=this.attrs.skewX||0,c=this.attrs.skewY||0,d=this.attrs.offsetX||0,f=this.attrs.offsetY||0;return(i!==0||o!==0)&&r.translate(i,o),a!==0&&r.rotate(a),(u!==0||c!==0)&&r.skew(u,c),(s!==1||l!==1)&&r.scale(s,l),(d!==0||f!==0)&&r.translate(-1*d,-1*f),r.dirty=!1,r}clone(t){var n=$t.Util.cloneObject(this.attrs),r,i,o,a,s;for(r in t)n[r]=t[r];var l=new this.constructor(n);for(r in this.eventListeners)for(i=this.eventListeners[r],o=i.length,a=0;a<o;a++)s=i[a],s.name.indexOf(Awe)<0&&(l.eventListeners[r]||(l.eventListeners[r]=[]),l.eventListeners[r].push(s));return l}_toKonvaCanvas(t){t=t||{};var n=this.getClientRect(),r=this.getStage(),i=t.x!==void 0?t.x:Math.floor(n.x),o=t.y!==void 0?t.y:Math.floor(n.y),a=t.pixelRatio||1,s=new zv.SceneCanvas({width:t.width||Math.ceil(n.width)||(r?r.width():0),height:t.height||Math.ceil(n.height)||(r?r.height():0),pixelRatio:a}),l=s.getContext();return t.imageSmoothingEnabled===!1&&(l._context.imageSmoothingEnabled=!1),l.save(),(i||o)&&l.translate(-1*i,-1*o),this.drawScene(s),l.restore(),s}toCanvas(t){return this._toKonvaCanvas(t)._canvas}toDataURL(t){t=t||{};var n=t.mimeType||null,r=t.quality||null,i=this._toKonvaCanvas(t).toDataURL(n,r);return t.callback&&t.callback(i),i}toImage(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,$t.Util._urlToImage(this.toDataURL(t),function(o){n(o),i==null||i(o)})}catch(i){r(i)}})}toBlob(t){return new Promise((n,r)=>{try{const i=t==null?void 0:t.callback;i&&delete t.callback,this.toCanvas(t).toBlob(o=>{n(o),i==null||i(o)})}catch(i){r(i)}})}setSize(t){return this.width(t.width),this.height(t.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():Dc.Konva.dragDistance}_off(t,n,r){var i=this.eventListeners[t],o,a,s;for(o=0;o<i.length;o++)if(a=i[o].name,s=i[o].handler,(a!=="konva"||n==="konva")&&(!n||a===n)&&(!r||r===s)){if(i.splice(o,1),i.length===0){delete this.eventListeners[t];break}o--}}_fireChangeEvent(t,n,r){this._fire(t+Twe,{oldVal:n,newVal:r})}addName(t){if(!this.hasName(t)){var n=this.name(),r=n?n+" "+t:t;this.name(r)}return this}hasName(t){if(!t)return!1;const n=this.name();if(!n)return!1;var r=(n||"").split(/\s/g);return r.indexOf(t)!==-1}removeName(t){var n=(this.name()||"").split(/\s/g),r=n.indexOf(t);return r!==-1&&(n.splice(r,1),this.name(n.join(" "))),this}setAttr(t,n){var r=this[lO+$t.Util._capitalize(t)];return $t.Util._isFunction(r)?r.call(this,n):this._setAttr(t,n),this}_requestDraw(){if(Dc.Konva.autoDrawEnabled){const t=this.getLayer()||this.getStage();t==null||t.batchDraw()}}_setAttr(t,n){var r=this.attrs[t];r===n&&!$t.Util.isObject(n)||(n==null?delete this.attrs[t]:this.attrs[t]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(t,r,n),this._requestDraw())}_setComponentAttr(t,n,r){var i;r!==void 0&&(i=this.attrs[t],i||(this.attrs[t]=this.getAttr(t)),this.attrs[t][n]=r,this._fireChangeEvent(t,i,r))}_fireAndBubble(t,n,r){n&&this.nodeType===uO&&(n.target=this);var i=(t===aO||t===sO)&&(r&&(this===r||this.isAncestorOf&&this.isAncestorOf(r))||this.nodeType==="Stage"&&!r);if(!i){this._fire(t,n);var o=(t===aO||t===sO)&&r&&r.isAncestorOf&&r.isAncestorOf(this)&&!r.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!o&&(r&&r.parent?this._fireAndBubble.call(this.parent,t,n,r):this._fireAndBubble.call(this.parent,t,n))}}_getProtoListeners(t){var n,r,i;const o=(n=this._cache.get(jv))!==null&&n!==void 0?n:{};let a=o==null?void 0:o[t];if(a===void 0){a=[];let s=Object.getPrototypeOf(this);for(;s;){const l=(i=(r=s.eventListeners)===null||r===void 0?void 0:r[t])!==null&&i!==void 0?i:[];a.push(...l),s=Object.getPrototypeOf(s)}o[t]=a,this._cache.set(jv,o)}return a}_fire(t,n){n=n||{},n.currentTarget=this,n.type=t;const r=this._getProtoListeners(t);if(r)for(var i=0;i<r.length;i++)r[i].handler.call(this,n);const o=this.eventListeners[t];if(o)for(var i=0;i<o.length;i++)o[i].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(t){var n=t?t.pointerId:void 0,r=this.getStage(),i=this.getAbsolutePosition(),o=r._getPointerById(n)||r._changedPointerPositions[0]||i;la.DD._dragElements.set(this._id,{node:this,startPointerPos:o,offset:{x:o.x-i.x,y:o.y-i.y},dragStatus:"ready",pointerId:n})}startDrag(t,n=!0){la.DD._dragElements.has(this._id)||this._createDragElement(t);const r=la.DD._dragElements.get(this._id);r.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:t&&t.evt},n)}_setDragPosition(t,n){const r=this.getStage()._getPointerById(n.pointerId);if(r){var i={x:r.x-n.offset.x,y:r.y-n.offset.y},o=this.dragBoundFunc();if(o!==void 0){const a=o.call(this,i,t);a?i=a:$t.Util.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}}stopDrag(t){const n=la.DD._dragElements.get(this._id);n&&(n.dragStatus="stopped"),la.DD._endDragBefore(t),la.DD._endDragAfter(t)}setDraggable(t){this._setAttr("draggable",t),this._dragChange()}isDragging(){const t=la.DD._dragElements.get(this._id);return t?t.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(t){var n=t.evt.button!==void 0,r=!n||Dc.Konva.dragButtons.indexOf(t.evt.button)>=0;if(r&&!this.isDragging()){var i=!1;la.DD._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(t)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var t=this.getStage();if(!t)return;const n=la.DD._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";r?this.stopDrag():i&&la.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(t={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-t.x,y:-t.y,width:n.width()+2*t.x,height:n.height()+2*t.y};return $t.Util.haveIntersection(r,this.getClientRect())}static create(t,n){return $t.Util._isString(t)&&(t=JSON.parse(t)),this._createNode(t,n)}static _createNode(t,n){var r=ht.prototype.getClassName.call(t),i=t.children,o,a,s;n&&(t.attrs.container=n),Dc.Konva[r]||($t.Util.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=Dc.Konva[r];if(o=new l(t.attrs),i)for(a=i.length,s=0;s<a;s++)o.add(ht._createNode(i[s]));return o}}ir.Node=ht;ht.prototype.nodeType="Node";ht.prototype._attrsAffectingSize=[];ht.prototype.eventListeners={};ht.prototype.on.call(ht.prototype,Iwe,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(mu),this._clearSelfAndDescendantCache(ml)});ht.prototype.on.call(ht.prototype,"visibleChange.konva",function(){this._clearSelfAndDescendantCache(QE)});ht.prototype.on.call(ht.prototype,"listeningChange.konva",function(){this._clearSelfAndDescendantCache(KE)});ht.prototype.on.call(ht.prototype,"opacityChange.konva",function(){this._clearSelfAndDescendantCache(G1)});const Rn=Cy.Factory.addGetterSetter;Rn(ht,"zIndex");Rn(ht,"absolutePosition");Rn(ht,"position");Rn(ht,"x",0,(0,kr.getNumberValidator)());Rn(ht,"y",0,(0,kr.getNumberValidator)());Rn(ht,"globalCompositeOperation","source-over",(0,kr.getStringValidator)());Rn(ht,"opacity",1,(0,kr.getNumberValidator)());Rn(ht,"name","",(0,kr.getStringValidator)());Rn(ht,"id","",(0,kr.getStringValidator)());Rn(ht,"rotation",0,(0,kr.getNumberValidator)());Cy.Factory.addComponentsGetterSetter(ht,"scale",["x","y"]);Rn(ht,"scaleX",1,(0,kr.getNumberValidator)());Rn(ht,"scaleY",1,(0,kr.getNumberValidator)());Cy.Factory.addComponentsGetterSetter(ht,"skew",["x","y"]);Rn(ht,"skewX",0,(0,kr.getNumberValidator)());Rn(ht,"skewY",0,(0,kr.getNumberValidator)());Cy.Factory.addComponentsGetterSetter(ht,"offset",["x","y"]);Rn(ht,"offsetX",0,(0,kr.getNumberValidator)());Rn(ht,"offsetY",0,(0,kr.getNumberValidator)());Rn(ht,"dragDistance",null,(0,kr.getNumberValidator)());Rn(ht,"width",0,(0,kr.getNumberValidator)());Rn(ht,"height",0,(0,kr.getNumberValidator)());Rn(ht,"listening",!0,(0,kr.getBooleanValidator)());Rn(ht,"preventDefault",!0,(0,kr.getBooleanValidator)());Rn(ht,"filters",null,function(e){return this._filterUpToDate=!1,e});Rn(ht,"visible",!0,(0,kr.getBooleanValidator)());Rn(ht,"transformsEnabled","all",(0,kr.getStringValidator)());Rn(ht,"size");Rn(ht,"dragBoundFunc");Rn(ht,"draggable",!1,(0,kr.getBooleanValidator)());Cy.Factory.backCompat(ht,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});var Gd={};Object.defineProperty(Gd,"__esModule",{value:!0});Gd.Container=void 0;const Sp=At,KC=ir,sx=Xe;let qd=class extends KC.Node{constructor(){super(...arguments),this.children=[]}getChildren(t){if(!t)return this.children||[];const n=this.children||[];var r=[];return n.forEach(function(i){t(i)&&r.push(i)}),r}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(t=>{t.parent=null,t.index=0,t.destroy()}),this.children=[],this._requestDraw(),this}add(...t){if(t.length===0)return this;if(t.length>1){for(var n=0;n<t.length;n++)this.add(t[n]);return this}const r=t[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(t){return this._generalFind(t,!1)}findOne(t){var n=this._generalFind(t,!0);return n.length>0?n[0]:void 0}_generalFind(t,n){var r=[];return this._descendants(i=>{const o=i._isMatch(t);return o&&r.push(i),!!(o&&n)}),r}_descendants(t){let n=!1;const r=this.getChildren();for(const i of r){if(n=t(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(t),n))return!0}return!1}toObject(){var t=KC.Node.prototype.toObject.call(this);return t.children=[],this.getChildren().forEach(n=>{t.children.push(n.toObject())}),t}isAncestorOf(t){for(var n=t.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(t){var n=KC.Node.prototype.clone.call(this,t);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(t){var n=[];return this.find("Shape").forEach(function(r){r.isVisible()&&r.intersects(t)&&n.push(r)}),n}_clearSelfAndDescendantCache(t){var n;super._clearSelfAndDescendantCache(t),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(t)}))}_setChildrenIndices(){var t;(t=this.children)===null||t===void 0||t.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas(),o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.scene,l=i&&i.isCache;if(!this.isVisible()&&!l)return this;if(s){o.save();var u=this.getAbsoluteTransform(n).getMatrix();o.transform(u[0],u[1],u[2],u[3],u[4],u[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n);return this}drawHit(t,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),i=t||r&&r.hitCanvas,o=i&&i.getContext(),a=this._getCanvasCache(),s=a&&a.hit;if(s){o.save();var l=this.getAbsoluteTransform(n).getMatrix();o.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(t,n,r){var i,o=n&&n.getContext(),a=this.clipWidth(),s=this.clipHeight(),l=this.clipFunc(),u=a&&s||l;const c=r===this;if(u){o.save();var d=this.getAbsoluteTransform(r),f=d.getMatrix();o.transform(f[0],f[1],f[2],f[3],f[4],f[5]),o.beginPath();let _;if(l)_=l.call(this,o,this);else{var h=this.clipX(),p=this.clipY();o.rect(h,p,a,s)}o.clip.apply(o,_),f=d.copy().invert().getMatrix(),o.transform(f[0],f[1],f[2],f[3],f[4],f[5])}var m=!c&&this.globalCompositeOperation()!=="source-over"&&t==="drawScene";m&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(_){_[t](n,r)}),m&&o.restore(),u&&o.restore()}getClientRect(t){var n;t=t||{};var r=t.skipTransform,i=t.relativeTo,o,a,s,l,u={x:1/0,y:1/0,width:0,height:0},c=this;(n=this.children)===null||n===void 0||n.forEach(function(m){if(m.visible()){var _=m.getClientRect({relativeTo:c,skipShadow:t.skipShadow,skipStroke:t.skipStroke});_.width===0&&_.height===0||(o===void 0?(o=_.x,a=_.y,s=_.x+_.width,l=_.y+_.height):(o=Math.min(o,_.x),a=Math.min(a,_.y),s=Math.max(s,_.x+_.width),l=Math.max(l,_.y+_.height)))}});for(var d=this.find("Shape"),f=!1,h=0;h<d.length;h++){var p=d[h];if(p._isVisible(this)){f=!0;break}}return f&&o!==void 0?u={x:o,y:a,width:s-o,height:l-a}:u={x:0,y:0,width:0,height:0},r?u:this._transformedRect(u,i)}};Gd.Container=qd;Sp.Factory.addComponentsGetterSetter(qd,"clip",["x","y","width","height"]);Sp.Factory.addGetterSetter(qd,"clipX",void 0,(0,sx.getNumberValidator)());Sp.Factory.addGetterSetter(qd,"clipY",void 0,(0,sx.getNumberValidator)());Sp.Factory.addGetterSetter(qd,"clipWidth",void 0,(0,sx.getNumberValidator)());Sp.Factory.addGetterSetter(qd,"clipHeight",void 0,(0,sx.getNumberValidator)());Sp.Factory.addGetterSetter(qd,"clipFunc");var xG={},qo={};Object.defineProperty(qo,"__esModule",{value:!0});qo.releaseCapture=qo.setPointerCapture=qo.hasPointerCapture=qo.createEvent=qo.getCapturedShape=void 0;const Owe=Rt,b0=new Map,wG=Owe.Konva._global.PointerEvent!==void 0;function Mwe(e){return b0.get(e)}qo.getCapturedShape=Mwe;function SA(e){return{evt:e,pointerId:e.pointerId}}qo.createEvent=SA;function Nwe(e,t){return b0.get(e)===t}qo.hasPointerCapture=Nwe;function $we(e,t){CG(e),t.getStage()&&(b0.set(e,t),wG&&t._fire("gotpointercapture",SA(new PointerEvent("gotpointercapture"))))}qo.setPointerCapture=$we;function CG(e,t){const n=b0.get(e);if(!n)return;const r=n.getStage();r&&r.content,b0.delete(e),wG&&n._fire("lostpointercapture",SA(new PointerEvent("lostpointercapture")))}qo.releaseCapture=CG;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Stage=e.stages=void 0;const t=fr,n=At,r=Gd,i=Rt,o=os,a=ax,s=Rt,l=qo;var u="Stage",c="string",d="px",f="mouseout",h="mouseleave",p="mouseover",m="mouseenter",_="mousemove",b="mousedown",y="mouseup",g="pointermove",v="pointerdown",S="pointerup",w="pointercancel",x="lostpointercapture",C="pointerout",k="pointerleave",T="pointerover",P="pointerenter",$="contextmenu",O="touchstart",E="touchend",A="touchmove",D="touchcancel",L="wheel",M=5,R=[[m,"_pointerenter"],[b,"_pointerdown"],[_,"_pointermove"],[y,"_pointerup"],[h,"_pointerleave"],[O,"_pointerdown"],[A,"_pointermove"],[E,"_pointerup"],[D,"_pointercancel"],[p,"_pointerover"],[L,"_wheel"],[$,"_contextmenu"],[v,"_pointerdown"],[g,"_pointermove"],[S,"_pointerup"],[w,"_pointercancel"],[x,"_lostpointercapture"]];const N={mouse:{[C]:f,[k]:h,[T]:p,[P]:m,[g]:_,[v]:b,[S]:y,[w]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[C]:"touchout",[k]:"touchleave",[T]:"touchover",[P]:"touchenter",[g]:A,[v]:O,[S]:E,[w]:D,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[C]:C,[k]:k,[T]:T,[P]:P,[g]:g,[v]:v,[S]:S,[w]:w,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},B=J=>J.indexOf("pointer")>=0?"pointer":J.indexOf("touch")>=0?"touch":"mouse",U=J=>{const j=B(J);if(j==="pointer")return i.Konva.pointerEventsEnabled&&N.pointer;if(j==="touch")return N.touch;if(j==="mouse")return N.mouse};function G(J={}){return(J.clipFunc||J.clipWidth||J.clipHeight)&&t.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),J}const Z="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);";e.stages=[];class ee extends r.Container{constructor(j){super(G(j)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),e.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{G(this.attrs)}),this._checkVisibility()}_validateAdd(j){const Q=j.getType()==="Layer",ne=j.getType()==="FastLayer";Q||ne||t.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const j=this.visible()?"":"none";this.content.style.display=j}setContainer(j){if(typeof j===c){if(j.charAt(0)==="."){var Q=j.slice(1);j=document.getElementsByClassName(Q)[0]}else{var ne;j.charAt(0)!=="#"?ne=j:ne=j.slice(1),j=document.getElementById(ne)}if(!j)throw"Can not find container in document with id "+ne}return this._setAttr("container",j),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),j.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var j=this.children,Q=j.length,ne;for(ne=0;ne<Q;ne++)j[ne].clear();return this}clone(j){return j||(j={}),j.container=typeof document<"u"&&document.createElement("div"),r.Container.prototype.clone.call(this,j)}destroy(){super.destroy();var j=this.content;j&&t.Util._isInDocument(j)&&this.container().removeChild(j);var Q=e.stages.indexOf(this);return Q>-1&&e.stages.splice(Q,1),t.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const j=this._pointerPositions[0]||this._changedPointerPositions[0];return j?{x:j.x,y:j.y}:(t.Util.warn(Z),null)}_getPointerById(j){return this._pointerPositions.find(Q=>Q.id===j)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(j){j=j||{},j.x=j.x||0,j.y=j.y||0,j.width=j.width||this.width(),j.height=j.height||this.height();var Q=new o.SceneCanvas({width:j.width,height:j.height,pixelRatio:j.pixelRatio||1}),ne=Q.getContext()._context,se=this.children;return(j.x||j.y)&&ne.translate(-1*j.x,-1*j.y),se.forEach(function(ye){if(ye.isVisible()){var ce=ye._toKonvaCanvas(j);ne.drawImage(ce._canvas,j.x,j.y,ce.getWidth()/ce.getPixelRatio(),ce.getHeight()/ce.getPixelRatio())}}),Q}getIntersection(j){if(!j)return null;var Q=this.children,ne=Q.length,se=ne-1,ye;for(ye=se;ye>=0;ye--){const ce=Q[ye].getIntersection(j);if(ce)return ce}return null}_resizeDOM(){var j=this.width(),Q=this.height();this.content&&(this.content.style.width=j+d,this.content.style.height=Q+d),this.bufferCanvas.setSize(j,Q),this.bufferHitCanvas.setSize(j,Q),this.children.forEach(ne=>{ne.setSize({width:j,height:Q}),ne.draw()})}add(j,...Q){if(arguments.length>1){for(var ne=0;ne<arguments.length;ne++)this.add(arguments[ne]);return this}super.add(j);var se=this.children.length;return se>M&&t.Util.warn("The stage has "+se+" 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."),j.setSize({width:this.width(),height:this.height()}),j.draw(),i.Konva.isBrowser&&this.content.appendChild(j.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(j){return l.hasPointerCapture(j,this)}setPointerCapture(j){l.setPointerCapture(j,this)}releaseCapture(j){l.releaseCapture(j,this)}getLayers(){return this.children}_bindContentEvents(){i.Konva.isBrowser&&R.forEach(([j,Q])=>{this.content.addEventListener(j,ne=>{this[Q](ne)},{passive:!1})})}_pointerenter(j){this.setPointersPositions(j);const Q=U(j.type);this._fire(Q.pointerenter,{evt:j,target:this,currentTarget:this})}_pointerover(j){this.setPointersPositions(j);const Q=U(j.type);this._fire(Q.pointerover,{evt:j,target:this,currentTarget:this})}_getTargetShape(j){let Q=this[j+"targetShape"];return Q&&!Q.getStage()&&(Q=null),Q}_pointerleave(j){const Q=U(j.type),ne=B(j.type);if(Q){this.setPointersPositions(j);var se=this._getTargetShape(ne),ye=!a.DD.isDragging||i.Konva.hitOnDragEnabled;se&&ye?(se._fireAndBubble(Q.pointerout,{evt:j}),se._fireAndBubble(Q.pointerleave,{evt:j}),this._fire(Q.pointerleave,{evt:j,target:this,currentTarget:this}),this[ne+"targetShape"]=null):ye&&(this._fire(Q.pointerleave,{evt:j,target:this,currentTarget:this}),this._fire(Q.pointerout,{evt:j,target:this,currentTarget:this})),this.pointerPos=void 0,this._pointerPositions=[]}}_pointerdown(j){const Q=U(j.type),ne=B(j.type);if(Q){this.setPointersPositions(j);var se=!1;this._changedPointerPositions.forEach(ye=>{var ce=this.getIntersection(ye);if(a.DD.justDragged=!1,i.Konva["_"+ne+"ListenClick"]=!0,!(ce&&ce.isListening()))return;i.Konva.capturePointerEventsEnabled&&ce.setPointerCapture(ye.id),this[ne+"ClickStartShape"]=ce,ce._fireAndBubble(Q.pointerdown,{evt:j,pointerId:ye.id}),se=!0;const ot=j.type.indexOf("touch")>=0;ce.preventDefault()&&j.cancelable&&ot&&j.preventDefault()}),se||this._fire(Q.pointerdown,{evt:j,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(j){const Q=U(j.type),ne=B(j.type);if(!Q)return;a.DD.isDragging&&a.DD.node.preventDefault()&&j.cancelable&&j.preventDefault(),this.setPointersPositions(j);var se=!a.DD.isDragging||i.Konva.hitOnDragEnabled;if(!se)return;var ye={};let ce=!1;var bt=this._getTargetShape(ne);this._changedPointerPositions.forEach(ot=>{const ze=l.getCapturedShape(ot.id)||this.getIntersection(ot),mt=ot.id,Pe={evt:j,pointerId:mt};var en=bt!==ze;if(en&&bt&&(bt._fireAndBubble(Q.pointerout,Object.assign({},Pe),ze),bt._fireAndBubble(Q.pointerleave,Object.assign({},Pe),ze)),ze){if(ye[ze._id])return;ye[ze._id]=!0}ze&&ze.isListening()?(ce=!0,en&&(ze._fireAndBubble(Q.pointerover,Object.assign({},Pe),bt),ze._fireAndBubble(Q.pointerenter,Object.assign({},Pe),bt),this[ne+"targetShape"]=ze),ze._fireAndBubble(Q.pointermove,Object.assign({},Pe))):bt&&(this._fire(Q.pointerover,{evt:j,target:this,currentTarget:this,pointerId:mt}),this[ne+"targetShape"]=null)}),ce||this._fire(Q.pointermove,{evt:j,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(j){const Q=U(j.type),ne=B(j.type);if(!Q)return;this.setPointersPositions(j);const se=this[ne+"ClickStartShape"],ye=this[ne+"ClickEndShape"];var ce={};let bt=!1;this._changedPointerPositions.forEach(ot=>{const ze=l.getCapturedShape(ot.id)||this.getIntersection(ot);if(ze){if(ze.releaseCapture(ot.id),ce[ze._id])return;ce[ze._id]=!0}const mt=ot.id,Pe={evt:j,pointerId:mt};let en=!1;i.Konva["_"+ne+"InDblClickWindow"]?(en=!0,clearTimeout(this[ne+"DblTimeout"])):a.DD.justDragged||(i.Konva["_"+ne+"InDblClickWindow"]=!0,clearTimeout(this[ne+"DblTimeout"])),this[ne+"DblTimeout"]=setTimeout(function(){i.Konva["_"+ne+"InDblClickWindow"]=!1},i.Konva.dblClickWindow),ze&&ze.isListening()?(bt=!0,this[ne+"ClickEndShape"]=ze,ze._fireAndBubble(Q.pointerup,Object.assign({},Pe)),i.Konva["_"+ne+"ListenClick"]&&se&&se===ze&&(ze._fireAndBubble(Q.pointerclick,Object.assign({},Pe)),en&&ye&&ye===ze&&ze._fireAndBubble(Q.pointerdblclick,Object.assign({},Pe)))):(this[ne+"ClickEndShape"]=null,i.Konva["_"+ne+"ListenClick"]&&this._fire(Q.pointerclick,{evt:j,target:this,currentTarget:this,pointerId:mt}),en&&this._fire(Q.pointerdblclick,{evt:j,target:this,currentTarget:this,pointerId:mt}))}),bt||this._fire(Q.pointerup,{evt:j,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),i.Konva["_"+ne+"ListenClick"]=!1,j.cancelable&&ne!=="touch"&&j.preventDefault()}_contextmenu(j){this.setPointersPositions(j);var Q=this.getIntersection(this.getPointerPosition());Q&&Q.isListening()?Q._fireAndBubble($,{evt:j}):this._fire($,{evt:j,target:this,currentTarget:this})}_wheel(j){this.setPointersPositions(j);var Q=this.getIntersection(this.getPointerPosition());Q&&Q.isListening()?Q._fireAndBubble(L,{evt:j}):this._fire(L,{evt:j,target:this,currentTarget:this})}_pointercancel(j){this.setPointersPositions(j);const Q=l.getCapturedShape(j.pointerId)||this.getIntersection(this.getPointerPosition());Q&&Q._fireAndBubble(S,l.createEvent(j)),l.releaseCapture(j.pointerId)}_lostpointercapture(j){l.releaseCapture(j.pointerId)}setPointersPositions(j){var Q=this._getContentPosition(),ne=null,se=null;j=j||window.event,j.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(j.touches,ye=>{this._pointerPositions.push({id:ye.identifier,x:(ye.clientX-Q.left)/Q.scaleX,y:(ye.clientY-Q.top)/Q.scaleY})}),Array.prototype.forEach.call(j.changedTouches||j.touches,ye=>{this._changedPointerPositions.push({id:ye.identifier,x:(ye.clientX-Q.left)/Q.scaleX,y:(ye.clientY-Q.top)/Q.scaleY})})):(ne=(j.clientX-Q.left)/Q.scaleX,se=(j.clientY-Q.top)/Q.scaleY,this.pointerPos={x:ne,y:se},this._pointerPositions=[{x:ne,y:se,id:t.Util._getFirstPointerId(j)}],this._changedPointerPositions=[{x:ne,y:se,id:t.Util._getFirstPointerId(j)}])}_setPointerPosition(j){t.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(j)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var j=this.content.getBoundingClientRect();return{top:j.top,left:j.left,scaleX:j.width/this.content.clientWidth||1,scaleY:j.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new o.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new o.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!!i.Konva.isBrowser){var j=this.container();if(!j)throw"Stage has no container. A container is required.";j.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"),j.appendChild(this.content),this._resizeDOM()}}cache(){return t.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(j){j.batchDraw()}),this}}e.Stage=ee,ee.prototype.nodeType=u,(0,s._registerNode)(ee),n.Factory.addGetterSetter(ee,"container")})(xG);var Ey={},Zr={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Shape=e.shapes=void 0;const t=Rt,n=fr,r=At,i=ir,o=Xe,a=Rt,s=qo;var l="hasShadow",u="shadowRGBA",c="patternImage",d="linearGradient",f="radialGradient";let h;function p(){return h||(h=n.Util.createCanvasElement().getContext("2d"),h)}e.shapes={};function m(k){const T=this.attrs.fillRule;T?k.fill(T):k.fill()}function _(k){k.stroke()}function b(k){k.fill()}function y(k){k.stroke()}function g(){this._clearCache(l)}function v(){this._clearCache(u)}function S(){this._clearCache(c)}function w(){this._clearCache(d)}function x(){this._clearCache(f)}class C extends i.Node{constructor(T){super(T);let P;for(;P=n.Util.getRandomColor(),!(P&&!(P in e.shapes)););this.colorKey=P,e.shapes[P]=this}getContext(){return n.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return n.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(l,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(c,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var T=p();const P=T.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(P&&P.setTransform){const $=new n.Transform;$.translate(this.fillPatternX(),this.fillPatternY()),$.rotate(t.Konva.getAngle(this.fillPatternRotation())),$.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),$.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const O=$.getMatrix(),E=typeof DOMMatrix>"u"?{a:O[0],b:O[1],c:O[2],d:O[3],e:O[4],f:O[5]}:new DOMMatrix(O);P.setTransform(E)}return P}}_getLinearGradient(){return this._getCache(d,this.__getLinearGradient)}__getLinearGradient(){var T=this.fillLinearGradientColorStops();if(T){for(var P=p(),$=this.fillLinearGradientStartPoint(),O=this.fillLinearGradientEndPoint(),E=P.createLinearGradient($.x,$.y,O.x,O.y),A=0;A<T.length;A+=2)E.addColorStop(T[A],T[A+1]);return E}}_getRadialGradient(){return this._getCache(f,this.__getRadialGradient)}__getRadialGradient(){var T=this.fillRadialGradientColorStops();if(T){for(var P=p(),$=this.fillRadialGradientStartPoint(),O=this.fillRadialGradientEndPoint(),E=P.createRadialGradient($.x,$.y,this.fillRadialGradientStartRadius(),O.x,O.y,this.fillRadialGradientEndRadius()),A=0;A<T.length;A+=2)E.addColorStop(T[A],T[A+1]);return E}}getShadowRGBA(){return this._getCache(u,this._getShadowRGBA)}_getShadowRGBA(){if(this.hasShadow()){var T=n.Util.colorToRGBA(this.shadowColor());if(T)return"rgba("+T.r+","+T.g+","+T.b+","+T.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 T=this.hitStrokeWidth();return T==="auto"?this.hasStroke():this.strokeEnabled()&&!!T}intersects(T){var P=this.getStage(),$=P.bufferHitCanvas,O;return $.getContext().clear(),this.drawHit($,null,!0),O=$.context.getImageData(Math.round(T.x),Math.round(T.y),1,1).data,O[3]>0}destroy(){return i.Node.prototype.destroy.call(this),delete e.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(T){var P;if(!this.getStage()||!((P=this.attrs.perfectDrawEnabled)!==null&&P!==void 0?P:!0))return!1;const O=T||this.hasFill(),E=this.hasStroke(),A=this.getAbsoluteOpacity()!==1;if(O&&E&&A)return!0;const D=this.hasShadow(),L=this.shadowForStrokeEnabled();return!!(O&&E&&D&&L)}setStrokeHitEnabled(T){n.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),T?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var T=this.size();return{x:this._centroid?-T.width/2:0,y:this._centroid?-T.height/2:0,width:T.width,height:T.height}}getClientRect(T={}){const P=T.skipTransform,$=T.relativeTo,O=this.getSelfRect(),A=!T.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,D=O.width+A,L=O.height+A,M=!T.skipShadow&&this.hasShadow(),R=M?this.shadowOffsetX():0,N=M?this.shadowOffsetY():0,B=D+Math.abs(R),U=L+Math.abs(N),G=M&&this.shadowBlur()||0,Z=B+G*2,ee=U+G*2,J={width:Z,height:ee,x:-(A/2+G)+Math.min(R,0)+O.x,y:-(A/2+G)+Math.min(N,0)+O.y};return P?J:this._transformedRect(J,$)}drawScene(T,P){var $=this.getLayer(),O=T||$.getCanvas(),E=O.getContext(),A=this._getCanvasCache(),D=this.getSceneFunc(),L=this.hasShadow(),M,R,N,B=O.isCache,U=P===this;if(!this.isVisible()&&!U)return this;if(A){E.save();var G=this.getAbsoluteTransform(P).getMatrix();return E.transform(G[0],G[1],G[2],G[3],G[4],G[5]),this._drawCachedSceneCanvas(E),E.restore(),this}if(!D)return this;if(E.save(),this._useBufferCanvas()&&!B){M=this.getStage(),R=M.bufferCanvas,N=R.getContext(),N.clear(),N.save(),N._applyLineJoin(this);var Z=this.getAbsoluteTransform(P).getMatrix();N.transform(Z[0],Z[1],Z[2],Z[3],Z[4],Z[5]),D.call(this,N,this),N.restore();var ee=R.pixelRatio;L&&E._applyShadow(this),E._applyOpacity(this),E._applyGlobalCompositeOperation(this),E.drawImage(R._canvas,0,0,R.width/ee,R.height/ee)}else{if(E._applyLineJoin(this),!U){var Z=this.getAbsoluteTransform(P).getMatrix();E.transform(Z[0],Z[1],Z[2],Z[3],Z[4],Z[5]),E._applyOpacity(this),E._applyGlobalCompositeOperation(this)}L&&E._applyShadow(this),D.call(this,E,this)}return E.restore(),this}drawHit(T,P,$=!1){if(!this.shouldDrawHit(P,$))return this;var O=this.getLayer(),E=T||O.hitCanvas,A=E&&E.getContext(),D=this.hitFunc()||this.sceneFunc(),L=this._getCanvasCache(),M=L&&L.hit;if(this.colorKey||n.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),M){A.save();var R=this.getAbsoluteTransform(P).getMatrix();return A.transform(R[0],R[1],R[2],R[3],R[4],R[5]),this._drawCachedHitCanvas(A),A.restore(),this}if(!D)return this;if(A.save(),A._applyLineJoin(this),!(this===P)){var B=this.getAbsoluteTransform(P).getMatrix();A.transform(B[0],B[1],B[2],B[3],B[4],B[5])}return D.call(this,A,this),A.restore(),this}drawHitFromCache(T=0){var P=this._getCanvasCache(),$=this._getCachedSceneCanvas(),O=P.hit,E=O.getContext(),A=O.getWidth(),D=O.getHeight(),L,M,R,N,B,U;E.clear(),E.drawImage($._canvas,0,0,A,D);try{for(L=E.getImageData(0,0,A,D),M=L.data,R=M.length,N=n.Util._hexToRgb(this.colorKey),B=0;B<R;B+=4)U=M[B+3],U>T?(M[B]=N.r,M[B+1]=N.g,M[B+2]=N.b,M[B+3]=255):M[B+3]=0;E.putImageData(L,0,0)}catch(G){n.Util.error("Unable to draw hit graph from cached scene canvas. "+G.message)}return this}hasPointerCapture(T){return s.hasPointerCapture(T,this)}setPointerCapture(T){s.setPointerCapture(T,this)}releaseCapture(T){s.releaseCapture(T,this)}}e.Shape=C,C.prototype._fillFunc=m,C.prototype._strokeFunc=_,C.prototype._fillFuncHit=b,C.prototype._strokeFuncHit=y,C.prototype._centroid=!1,C.prototype.nodeType="Shape",(0,a._registerNode)(C),C.prototype.eventListeners={},C.prototype.on.call(C.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",g),C.prototype.on.call(C.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",v),C.prototype.on.call(C.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",S),C.prototype.on.call(C.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",w),C.prototype.on.call(C.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",x),r.Factory.addGetterSetter(C,"stroke",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(C,"strokeWidth",2,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(C,"hitStrokeWidth","auto",(0,o.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(C,"strokeHitEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(C,"perfectDrawEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(C,"shadowForStrokeEnabled",!0,(0,o.getBooleanValidator)()),r.Factory.addGetterSetter(C,"lineJoin"),r.Factory.addGetterSetter(C,"lineCap"),r.Factory.addGetterSetter(C,"sceneFunc"),r.Factory.addGetterSetter(C,"hitFunc"),r.Factory.addGetterSetter(C,"dash"),r.Factory.addGetterSetter(C,"dashOffset",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"shadowColor",void 0,(0,o.getStringValidator)()),r.Factory.addGetterSetter(C,"shadowBlur",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"shadowOpacity",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(C,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(C,"shadowOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"shadowOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillPatternImage"),r.Factory.addGetterSetter(C,"fill",void 0,(0,o.getStringOrGradientValidator)()),r.Factory.addGetterSetter(C,"fillPatternX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillPatternY",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(C,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(C,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(C,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(C,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(C,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(C,"fillEnabled",!0),r.Factory.addGetterSetter(C,"strokeEnabled",!0),r.Factory.addGetterSetter(C,"shadowEnabled",!0),r.Factory.addGetterSetter(C,"dashEnabled",!0),r.Factory.addGetterSetter(C,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(C,"fillPriority","color"),r.Factory.addComponentsGetterSetter(C,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(C,"fillPatternOffsetX",0,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillPatternOffsetY",0,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(C,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(C,"fillPatternScaleX",1,(0,o.getNumberValidator)()),r.Factory.addGetterSetter(C,"fillPatternScaleY",1,(0,o.getNumberValidator)()),r.Factory.addComponentsGetterSetter(C,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(C,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(C,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(C,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(C,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(C,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(C,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(C,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(C,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(C,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(C,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(C,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(C,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(C,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(C,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(C,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(C,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(C,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(C,"fillPatternRotation",0),r.Factory.addGetterSetter(C,"fillRule",void 0,(0,o.getStringValidator)()),r.Factory.backCompat(C,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(Zr);Object.defineProperty(Ey,"__esModule",{value:!0});Ey.Layer=void 0;const fl=fr,QC=Gd,mf=ir,xA=At,dO=os,Dwe=Xe,Lwe=Zr,Fwe=Rt;var Bwe="#",zwe="beforeDraw",jwe="draw",EG=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],Uwe=EG.length;class xp extends QC.Container{constructor(t){super(t),this.canvas=new dO.SceneCanvas,this.hitCanvas=new dO.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),t<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[t+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){mf.Node.prototype.moveToTop.call(this);var t=this.getStage();return t&&t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){var t=mf.Node.prototype.moveUp.call(this);if(!t)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(mf.Node.prototype.moveDown.call(this)){var t=this.getStage();if(t){var n=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),n[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(mf.Node.prototype.moveToBottom.call(this)){var t=this.getStage();if(t){var n=t.children;t.content&&(t.content.removeChild(this.getNativeCanvasElement()),t.content.insertBefore(this.getNativeCanvasElement(),n[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){var t=this.getNativeCanvasElement();return mf.Node.prototype.remove.call(this),t&&t.parentNode&&fl.Util._isInDocument(t)&&t.parentNode.removeChild(t),this}getStage(){return this.parent}setSize({width:t,height:n}){return this.canvas.setSize(t,n),this.hitCanvas.setSize(t,n),this._setSmoothEnabled(),this}_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&fl.Util.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(t){return t=t||{},t.width=t.width||this.getWidth(),t.height=t.height||this.getHeight(),t.x=t.x!==void 0?t.x:this.x(),t.y=t.y!==void 0?t.y:this.y(),mf.Node.prototype._toKonvaCanvas.call(this,t)}_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(){fl.Util.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){fl.Util.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,fl.Util.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var n=1,r=!1;;){for(let i=0;i<Uwe;i++){const o=EG[i],a=this._getIntersection({x:t.x+o.x*n,y:t.y+o.y*n}),s=a.shape;if(s)return s;if(r=!!a.antialiased,!a.antialiased)break}if(r)n+=1;else return null}}_getIntersection(t){const n=this.hitCanvas.pixelRatio,r=this.hitCanvas.context.getImageData(Math.round(t.x*n),Math.round(t.y*n),1,1).data,i=r[3];if(i===255){const o=fl.Util._rgbToHex(r[0],r[1],r[2]),a=Lwe.shapes[Bwe+o];return a?{shape:a}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(t,n){var r=this.getLayer(),i=t||r&&r.getCanvas();return this._fire(zwe,{node:this}),this.clearBeforeDraw()&&i.getContext().clear(),QC.Container.prototype.drawScene.call(this,i,n),this._fire(jwe,{node:this}),this}drawHit(t,n){var r=this.getLayer(),i=t||r&&r.hitCanvas;return r&&r.clearBeforeDraw()&&r.getHitCanvas().getContext().clear(),QC.Container.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){fl.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return fl.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,n=!!this.hitCanvas._canvas.parentNode;n?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return fl.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}}Ey.Layer=xp;xp.prototype.nodeType="Layer";(0,Fwe._registerNode)(xp);xA.Factory.addGetterSetter(xp,"imageSmoothingEnabled",!0);xA.Factory.addGetterSetter(xp,"clearBeforeDraw",!0);xA.Factory.addGetterSetter(xp,"hitGraphEnabled",!0,(0,Dwe.getBooleanValidator)());var lx={};Object.defineProperty(lx,"__esModule",{value:!0});lx.FastLayer=void 0;const Vwe=fr,Gwe=Ey,qwe=Rt;class wA extends Gwe.Layer{constructor(t){super(t),this.listening(!1),Vwe.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}lx.FastLayer=wA;wA.prototype.nodeType="FastLayer";(0,qwe._registerNode)(wA);var wp={};Object.defineProperty(wp,"__esModule",{value:!0});wp.Group=void 0;const Hwe=fr,Wwe=Gd,Kwe=Rt;class CA extends Wwe.Container{_validateAdd(t){var n=t.getType();n!=="Group"&&n!=="Shape"&&Hwe.Util.throw("You may only add groups and shapes to groups.")}}wp.Group=CA;CA.prototype.nodeType="Group";(0,Kwe._registerNode)(CA);var Cp={};Object.defineProperty(Cp,"__esModule",{value:!0});Cp.Animation=void 0;const XC=Rt,fO=fr;var YC=function(){return XC.glob.performance&&XC.glob.performance.now?function(){return XC.glob.performance.now()}:function(){return new Date().getTime()}}();class Os{constructor(t,n){this.id=Os.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:YC(),frameRate:0},this.func=t,this.setLayers(n)}setLayers(t){var n=[];return t?t.length>0?n=t:n=[t]:n=[],this.layers=n,this}getLayers(){return this.layers}addLayer(t){var n=this.layers,r=n.length,i;for(i=0;i<r;i++)if(n[i]._id===t._id)return!1;return this.layers.push(t),!0}isRunning(){var t=Os,n=t.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=YC(),Os._addAnimation(this),this}stop(){return Os._removeAnimation(this),this}_updateFrameObject(t){this.frame.timeDiff=t-this.frame.lastTime,this.frame.lastTime=t,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(t){this.animations.push(t),this._handleAnimation()}static _removeAnimation(t){var n=t.id,r=this.animations,i=r.length,o;for(o=0;o<i;o++)if(r[o].id===n){this.animations.splice(o,1);break}}static _runFrames(){var t={},n=this.animations,r,i,o,a,s,l,u,c,d;for(a=0;a<n.length;a++)if(r=n[a],i=r.layers,o=r.func,r._updateFrameObject(YC()),l=i.length,o?d=o.call(r,r.frame)!==!1:d=!0,!!d)for(s=0;s<l;s++)u=i[s],u._id!==void 0&&(t[u._id]=u);for(c in t)t.hasOwnProperty(c)&&t[c].batchDraw()}static _animationLoop(){var t=Os;t.animations.length?(t._runFrames(),fO.Util.requestAnimFrame(t._animationLoop)):t.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,fO.Util.requestAnimFrame(this._animationLoop))}}Cp.Animation=Os;Os.animations=[];Os.animIdCounter=0;Os.animRunning=!1;var TG={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Easings=e.Tween=void 0;const t=fr,n=Cp,r=ir,i=Rt;var o={node:1,duration:1,easing:1,onFinish:1,yoyo:1},a=1,s=2,l=3,u=0,c=["fill","stroke","shadowColor"];class d{constructor(p,m,_,b,y,g,v){this.prop=p,this.propFunc=m,this.begin=b,this._pos=b,this.duration=g,this._change=0,this.prevPos=0,this.yoyo=v,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=_,this._change=y-this.begin,this.pause()}fire(p){var m=this[p];m&&m()}setTime(p){p>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():p<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=p,this.update())}getTime(){return this._time}setPosition(p){this.prevPos=this._pos,this.propFunc(p),this._pos=p}getPosition(p){return p===void 0&&(p=this._time),this.func(p,this.begin,this._change,this.duration)}play(){this.state=s,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=l,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(p){this.pause(),this._time=p,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 p=this.getTimer()-this._startTime;this.state===s?this.setTime(p):this.state===l&&this.setTime(this.duration-p)}pause(){this.state=a,this.fire("onPause")}getTimer(){return new Date().getTime()}}class f{constructor(p){var m=this,_=p.node,b=_._id,y,g=p.easing||e.Easings.Linear,v=!!p.yoyo,S;typeof p.duration>"u"?y=.3:p.duration===0?y=.001:y=p.duration,this.node=_,this._id=u++;var w=_.getLayer()||(_ instanceof i.Konva.Stage?_.getLayers():null);w||t.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new n.Animation(function(){m.tween.onEnterFrame()},w),this.tween=new d(S,function(x){m._tweenFunc(x)},g,0,1,y*1e3,v),this._addListeners(),f.attrs[b]||(f.attrs[b]={}),f.attrs[b][this._id]||(f.attrs[b][this._id]={}),f.tweens[b]||(f.tweens[b]={});for(S in p)o[S]===void 0&&this._addAttr(S,p[S]);this.reset(),this.onFinish=p.onFinish,this.onReset=p.onReset,this.onUpdate=p.onUpdate}_addAttr(p,m){var _=this.node,b=_._id,y,g,v,S,w,x,C,k;if(v=f.tweens[b][p],v&&delete f.attrs[b][v][p],y=_.getAttr(p),t.Util._isArray(m))if(g=[],w=Math.max(m.length,y.length),p==="points"&&m.length!==y.length&&(m.length>y.length?(C=y,y=t.Util._prepareArrayForTween(y,m,_.closed())):(x=m,m=t.Util._prepareArrayForTween(m,y,_.closed()))),p.indexOf("fill")===0)for(S=0;S<w;S++)if(S%2===0)g.push(m[S]-y[S]);else{var T=t.Util.colorToRGBA(y[S]);k=t.Util.colorToRGBA(m[S]),y[S]=T,g.push({r:k.r-T.r,g:k.g-T.g,b:k.b-T.b,a:k.a-T.a})}else for(S=0;S<w;S++)g.push(m[S]-y[S]);else c.indexOf(p)!==-1?(y=t.Util.colorToRGBA(y),k=t.Util.colorToRGBA(m),g={r:k.r-y.r,g:k.g-y.g,b:k.b-y.b,a:k.a-y.a}):g=m-y;f.attrs[b][this._id][p]={start:y,diff:g,end:m,trueEnd:x,trueStart:C},f.tweens[b][p]=this._id}_tweenFunc(p){var m=this.node,_=f.attrs[m._id][this._id],b,y,g,v,S,w,x,C;for(b in _){if(y=_[b],g=y.start,v=y.diff,C=y.end,t.Util._isArray(g))if(S=[],x=Math.max(g.length,C.length),b.indexOf("fill")===0)for(w=0;w<x;w++)w%2===0?S.push((g[w]||0)+v[w]*p):S.push("rgba("+Math.round(g[w].r+v[w].r*p)+","+Math.round(g[w].g+v[w].g*p)+","+Math.round(g[w].b+v[w].b*p)+","+(g[w].a+v[w].a*p)+")");else for(w=0;w<x;w++)S.push((g[w]||0)+v[w]*p);else c.indexOf(b)!==-1?S="rgba("+Math.round(g.r+v.r*p)+","+Math.round(g.g+v.g*p)+","+Math.round(g.b+v.b*p)+","+(g.a+v.a*p)+")":S=g+v*p;m.setAttr(b,S)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var p=this.node,m=f.attrs[p._id][this._id];m.points&&m.points.trueEnd&&p.setAttr("points",m.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var p=this.node,m=f.attrs[p._id][this._id];m.points&&m.points.trueStart&&p.points(m.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(p){return this.tween.seek(p*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var p=this.node._id,m=this._id,_=f.tweens[p],b;this.pause();for(b in _)delete f.tweens[p][b];delete f.attrs[p][m]}}e.Tween=f,f.attrs={},f.tweens={},r.Node.prototype.to=function(h){var p=h.onFinish;h.node=this,h.onFinish=function(){this.destroy(),p&&p()};var m=new f(h);m.play()},e.Easings={BackEaseIn(h,p,m,_){var b=1.70158;return m*(h/=_)*h*((b+1)*h-b)+p},BackEaseOut(h,p,m,_){var b=1.70158;return m*((h=h/_-1)*h*((b+1)*h+b)+1)+p},BackEaseInOut(h,p,m,_){var b=1.70158;return(h/=_/2)<1?m/2*(h*h*(((b*=1.525)+1)*h-b))+p:m/2*((h-=2)*h*(((b*=1.525)+1)*h+b)+2)+p},ElasticEaseIn(h,p,m,_,b,y){var g=0;return h===0?p:(h/=_)===1?p+m:(y||(y=_*.3),!b||b<Math.abs(m)?(b=m,g=y/4):g=y/(2*Math.PI)*Math.asin(m/b),-(b*Math.pow(2,10*(h-=1))*Math.sin((h*_-g)*(2*Math.PI)/y))+p)},ElasticEaseOut(h,p,m,_,b,y){var g=0;return h===0?p:(h/=_)===1?p+m:(y||(y=_*.3),!b||b<Math.abs(m)?(b=m,g=y/4):g=y/(2*Math.PI)*Math.asin(m/b),b*Math.pow(2,-10*h)*Math.sin((h*_-g)*(2*Math.PI)/y)+m+p)},ElasticEaseInOut(h,p,m,_,b,y){var g=0;return h===0?p:(h/=_/2)===2?p+m:(y||(y=_*(.3*1.5)),!b||b<Math.abs(m)?(b=m,g=y/4):g=y/(2*Math.PI)*Math.asin(m/b),h<1?-.5*(b*Math.pow(2,10*(h-=1))*Math.sin((h*_-g)*(2*Math.PI)/y))+p:b*Math.pow(2,-10*(h-=1))*Math.sin((h*_-g)*(2*Math.PI)/y)*.5+m+p)},BounceEaseOut(h,p,m,_){return(h/=_)<1/2.75?m*(7.5625*h*h)+p:h<2/2.75?m*(7.5625*(h-=1.5/2.75)*h+.75)+p:h<2.5/2.75?m*(7.5625*(h-=2.25/2.75)*h+.9375)+p:m*(7.5625*(h-=2.625/2.75)*h+.984375)+p},BounceEaseIn(h,p,m,_){return m-e.Easings.BounceEaseOut(_-h,0,m,_)+p},BounceEaseInOut(h,p,m,_){return h<_/2?e.Easings.BounceEaseIn(h*2,0,m,_)*.5+p:e.Easings.BounceEaseOut(h*2-_,0,m,_)*.5+m*.5+p},EaseIn(h,p,m,_){return m*(h/=_)*h+p},EaseOut(h,p,m,_){return-m*(h/=_)*(h-2)+p},EaseInOut(h,p,m,_){return(h/=_/2)<1?m/2*h*h+p:-m/2*(--h*(h-2)-1)+p},StrongEaseIn(h,p,m,_){return m*(h/=_)*h*h*h*h+p},StrongEaseOut(h,p,m,_){return m*((h=h/_-1)*h*h*h*h+1)+p},StrongEaseInOut(h,p,m,_){return(h/=_/2)<1?m/2*h*h*h*h*h+p:m/2*((h-=2)*h*h*h*h+2)+p},Linear(h,p,m,_){return m*h/_+p}}})(TG);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Konva=void 0;const t=Rt,n=fr,r=ir,i=Gd,o=xG,a=Ey,s=lx,l=wp,u=ax,c=Zr,d=Cp,f=TG,h=Dl,p=os;e.Konva=n.Util._assign(t.Konva,{Util:n.Util,Transform:n.Transform,Node:r.Node,Container:i.Container,Stage:o.Stage,stages:o.stages,Layer:a.Layer,FastLayer:s.FastLayer,Group:l.Group,DD:u.DD,Shape:c.Shape,shapes:c.shapes,Animation:d.Animation,Tween:f.Tween,Easings:f.Easings,Context:h.Context,Canvas:p.Canvas}),e.default=e.Konva})(vG);var ux={};Object.defineProperty(ux,"__esModule",{value:!0});ux.Arc=void 0;const cx=At,Qwe=Zr,hO=Rt,dx=Xe,Xwe=Rt;class ru extends Qwe.Shape{_sceneFunc(t){var n=hO.Konva.getAngle(this.angle()),r=this.clockwise();t.beginPath(),t.arc(0,0,this.outerRadius(),0,n,r),t.arc(0,0,this.innerRadius(),n,0,!r),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}getSelfRect(){const t=this.innerRadius(),n=this.outerRadius(),r=this.clockwise(),i=hO.Konva.getAngle(r?360-this.angle():this.angle()),o=Math.cos(Math.min(i,Math.PI)),a=1,s=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),l=Math.sin(Math.min(i,Math.PI/2)),u=o*(o>0?t:n),c=a*n,d=s*(s>0?t:n),f=l*(l>0?n:t);return{x:u,y:r?-1*f:d,width:c-u,height:f-d}}}ux.Arc=ru;ru.prototype._centroid=!0;ru.prototype.className="Arc";ru.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,Xwe._registerNode)(ru);cx.Factory.addGetterSetter(ru,"innerRadius",0,(0,dx.getNumberValidator)());cx.Factory.addGetterSetter(ru,"outerRadius",0,(0,dx.getNumberValidator)());cx.Factory.addGetterSetter(ru,"angle",0,(0,dx.getNumberValidator)());cx.Factory.addGetterSetter(ru,"clockwise",!1,(0,dx.getBooleanValidator)());var fx={},Ty={};Object.defineProperty(Ty,"__esModule",{value:!0});Ty.Line=void 0;const hx=At,Ywe=Zr,kG=Xe,Zwe=Rt;function XE(e,t,n,r,i,o,a){var s=Math.sqrt(Math.pow(n-e,2)+Math.pow(r-t,2)),l=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-r,2)),u=a*s/(s+l),c=a*l/(s+l),d=n-u*(i-e),f=r-u*(o-t),h=n+c*(i-e),p=r+c*(o-t);return[d,f,h,p]}function pO(e,t){var n=e.length,r=[],i,o;for(i=2;i<n-2;i+=2)o=XE(e[i-2],e[i-1],e[i],e[i+1],e[i+2],e[i+3],t),!isNaN(o[0])&&(r.push(o[0]),r.push(o[1]),r.push(e[i]),r.push(e[i+1]),r.push(o[2]),r.push(o[3]));return r}class Ec extends Ywe.Shape{constructor(t){super(t),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(t){var n=this.points(),r=n.length,i=this.tension(),o=this.closed(),a=this.bezier(),s,l,u;if(r){if(t.beginPath(),t.moveTo(n[0],n[1]),i!==0&&r>4){for(s=this.getTensionPoints(),l=s.length,u=o?0:4,o||t.quadraticCurveTo(s[0],s[1],s[2],s[3]);u<l-2;)t.bezierCurveTo(s[u++],s[u++],s[u++],s[u++],s[u++],s[u++]);o||t.quadraticCurveTo(s[l-2],s[l-1],n[r-2],n[r-1])}else if(a)for(u=2;u<r;)t.bezierCurveTo(n[u++],n[u++],n[u++],n[u++],n[u++],n[u++]);else for(u=2;u<r;u+=2)t.lineTo(n[u],n[u+1]);o?(t.closePath(),t.fillStrokeShape(this)):t.strokeShape(this)}}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():pO(this.points(),this.tension())}_getTensionPointsClosed(){var t=this.points(),n=t.length,r=this.tension(),i=XE(t[n-2],t[n-1],t[0],t[1],t[2],t[3],r),o=XE(t[n-4],t[n-3],t[n-2],t[n-1],t[0],t[1],r),a=pO(t,r),s=[i[2],i[3]].concat(a).concat([o[0],o[1],t[n-2],t[n-1],o[2],o[3],i[0],i[1],t[0],t[1]]);return s}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){var t=this.points();if(t.length<4)return{x:t[0]||0,y:t[1]||0,width:0,height:0};this.tension()!==0?t=[t[0],t[1],...this._getTensionPoints(),t[t.length-2],t[t.length-1]]:t=this.points();for(var n=t[0],r=t[0],i=t[1],o=t[1],a,s,l=0;l<t.length/2;l++)a=t[l*2],s=t[l*2+1],n=Math.min(n,a),r=Math.max(r,a),i=Math.min(i,s),o=Math.max(o,s);return{x:n,y:i,width:r-n,height:o-i}}}Ty.Line=Ec;Ec.prototype.className="Line";Ec.prototype._attrsAffectingSize=["points","bezier","tension"];(0,Zwe._registerNode)(Ec);hx.Factory.addGetterSetter(Ec,"closed",!1);hx.Factory.addGetterSetter(Ec,"bezier",!1);hx.Factory.addGetterSetter(Ec,"tension",0,(0,kG.getNumberValidator)());hx.Factory.addGetterSetter(Ec,"points",[],(0,kG.getNumberArrayValidator)());var Ep={},AG={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.t2length=e.getQuadraticArcLength=e.getCubicArcLength=e.binomialCoefficients=e.cValues=e.tValues=void 0,e.tValues=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],e.cValues=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],e.binomialCoefficients=[[1],[1,1],[1,2,1],[1,3,3,1]];const t=(a,s,l)=>{let u,c,d;u=l/2,c=0;for(let h=0;h<20;h++)d=u*e.tValues[20][h]+u,c+=e.cValues[20][h]*r(a,s,d);return u*c};e.getCubicArcLength=t;const n=(a,s,l)=>{l===void 0&&(l=1);const u=a[0]-2*a[1]+a[2],c=s[0]-2*s[1]+s[2],d=2*a[1]-2*a[0],f=2*s[1]-2*s[0],h=4*(u*u+c*c),p=4*(u*d+c*f),m=d*d+f*f;if(h===0)return l*Math.sqrt(Math.pow(a[2]-a[0],2)+Math.pow(s[2]-s[0],2));const _=p/(2*h),b=m/h,y=l+_,g=b-_*_,v=y*y+g>0?Math.sqrt(y*y+g):0,S=_*_+g>0?Math.sqrt(_*_+g):0,w=_+Math.sqrt(_*_+g)!==0?g*Math.log(Math.abs((y+v)/(_+S))):0;return Math.sqrt(h)/2*(y*v-_*S+w)};e.getQuadraticArcLength=n;function r(a,s,l){const u=i(1,l,a),c=i(1,l,s),d=u*u+c*c;return Math.sqrt(d)}const i=(a,s,l)=>{const u=l.length-1;let c,d;if(u===0)return 0;if(a===0){d=0;for(let f=0;f<=u;f++)d+=e.binomialCoefficients[u][f]*Math.pow(1-s,u-f)*Math.pow(s,f)*l[f];return d}else{c=new Array(u);for(let f=0;f<u;f++)c[f]=u*(l[f+1]-l[f]);return i(a-1,s,c)}},o=(a,s,l)=>{let u=1,c=a/s,d=(a-l(c))/s,f=0;for(;u>.001;){const h=l(c+d),p=Math.abs(a-h)/s;if(p<u)u=p,c+=d;else{const m=l(c-d),_=Math.abs(a-m)/s;_<u?(u=_,c-=d):d/=2}if(f++,f>500)break}return c};e.t2length=o})(AG);Object.defineProperty(Ep,"__esModule",{value:!0});Ep.Path=void 0;const Jwe=At,eCe=Zr,tCe=Rt,yf=AG;class Gr extends eCe.Shape{constructor(t){super(t),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Gr.parsePathData(this.data()),this.pathLength=Gr.getPathLength(this.dataArray)}_sceneFunc(t){var n=this.dataArray;t.beginPath();for(var r=!1,i=0;i<n.length;i++){var o=n[i].command,a=n[i].points;switch(o){case"L":t.lineTo(a[0],a[1]);break;case"M":t.moveTo(a[0],a[1]);break;case"C":t.bezierCurveTo(a[0],a[1],a[2],a[3],a[4],a[5]);break;case"Q":t.quadraticCurveTo(a[0],a[1],a[2],a[3]);break;case"A":var s=a[0],l=a[1],u=a[2],c=a[3],d=a[4],f=a[5],h=a[6],p=a[7],m=u>c?u:c,_=u>c?1:u/c,b=u>c?c/u:1;t.translate(s,l),t.rotate(h),t.scale(_,b),t.arc(0,0,m,d,d+f,1-p),t.scale(1/_,1/b),t.rotate(-h),t.translate(-s,-l);break;case"z":r=!0,t.closePath();break}}!r&&!this.hasFill()?t.strokeShape(this):t.fillStrokeShape(this)}getSelfRect(){var t=[];this.dataArray.forEach(function(u){if(u.command==="A"){var c=u.points[4],d=u.points[5],f=u.points[4]+d,h=Math.PI/180;if(Math.abs(c-f)<h&&(h=Math.abs(c-f)),d<0)for(let p=c-h;p>f;p-=h){const m=Gr.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],p,0);t.push(m.x,m.y)}else for(let p=c+h;p<f;p+=h){const m=Gr.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],p,0);t.push(m.x,m.y)}}else if(u.command==="C")for(let p=0;p<=1;p+=.01){const m=Gr.getPointOnCubicBezier(p,u.start.x,u.start.y,u.points[0],u.points[1],u.points[2],u.points[3],u.points[4],u.points[5]);t.push(m.x,m.y)}else t=t.concat(u.points)});for(var n=t[0],r=t[0],i=t[1],o=t[1],a,s,l=0;l<t.length/2;l++)a=t[l*2],s=t[l*2+1],isNaN(a)||(n=Math.min(n,a),r=Math.max(r,a)),isNaN(s)||(i=Math.min(i,s),o=Math.max(o,s));return{x:n,y:i,width:r-n,height:o-i}}getLength(){return this.pathLength}getPointAtLength(t){return Gr.getPointAtLengthOfDataArray(t,this.dataArray)}static getLineLength(t,n,r,i){return Math.sqrt((r-t)*(r-t)+(i-n)*(i-n))}static getPathLength(t){let n=0;for(var r=0;r<t.length;++r)n+=t[r].pathLength;return n}static getPointAtLengthOfDataArray(t,n){var r,i=0,o=n.length;if(!o)return null;for(;i<o&&t>n[i].pathLength;)t-=n[i].pathLength,++i;if(i===o)return r=n[i-1].points.slice(-2),{x:r[0],y:r[1]};if(t<.01)return r=n[i].points.slice(0,2),{x:r[0],y:r[1]};var a=n[i],s=a.points;switch(a.command){case"L":return Gr.getPointOnLine(t,a.start.x,a.start.y,s[0],s[1]);case"C":return Gr.getPointOnCubicBezier((0,yf.t2length)(t,Gr.getPathLength(n),m=>(0,yf.getCubicArcLength)([a.start.x,s[0],s[2],s[4]],[a.start.y,s[1],s[3],s[5]],m)),a.start.x,a.start.y,s[0],s[1],s[2],s[3],s[4],s[5]);case"Q":return Gr.getPointOnQuadraticBezier((0,yf.t2length)(t,Gr.getPathLength(n),m=>(0,yf.getQuadraticArcLength)([a.start.x,s[0],s[2]],[a.start.y,s[1],s[3]],m)),a.start.x,a.start.y,s[0],s[1],s[2],s[3]);case"A":var l=s[0],u=s[1],c=s[2],d=s[3],f=s[4],h=s[5],p=s[6];return f+=h*t/a.pathLength,Gr.getPointOnEllipticalArc(l,u,c,d,f,p)}return null}static getPointOnLine(t,n,r,i,o,a,s){a===void 0&&(a=n),s===void 0&&(s=r);var l=(o-r)/(i-n+1e-8),u=Math.sqrt(t*t/(1+l*l));i<n&&(u*=-1);var c=l*u,d;if(i===n)d={x:a,y:s+c};else if((s-r)/(a-n+1e-8)===l)d={x:a+u,y:s+c};else{var f,h,p=this.getLineLength(n,r,i,o),m=(a-n)*(i-n)+(s-r)*(o-r);m=m/(p*p),f=n+m*(i-n),h=r+m*(o-r);var _=this.getLineLength(a,s,f,h),b=Math.sqrt(t*t-_*_);u=Math.sqrt(b*b/(1+l*l)),i<n&&(u*=-1),c=l*u,d={x:f+u,y:h+c}}return d}static getPointOnCubicBezier(t,n,r,i,o,a,s,l,u){function c(_){return _*_*_}function d(_){return 3*_*_*(1-_)}function f(_){return 3*_*(1-_)*(1-_)}function h(_){return(1-_)*(1-_)*(1-_)}var p=l*c(t)+a*d(t)+i*f(t)+n*h(t),m=u*c(t)+s*d(t)+o*f(t)+r*h(t);return{x:p,y:m}}static getPointOnQuadraticBezier(t,n,r,i,o,a,s){function l(h){return h*h}function u(h){return 2*h*(1-h)}function c(h){return(1-h)*(1-h)}var d=a*l(t)+i*u(t)+n*c(t),f=s*l(t)+o*u(t)+r*c(t);return{x:d,y:f}}static getPointOnEllipticalArc(t,n,r,i,o,a){var s=Math.cos(a),l=Math.sin(a),u={x:r*Math.cos(o),y:i*Math.sin(o)};return{x:t+(u.x*s-u.y*l),y:n+(u.x*l+u.y*s)}}static parsePathData(t){if(!t)return[];var n=t,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 o=n.split("|"),a=[],s=[],l=0,u=0,c=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,d;for(i=1;i<o.length;i++){var f=o[i],h=f.charAt(0);for(f=f.slice(1),s.length=0;d=c.exec(f);)s.push(d[0]);for(var p=[],m=0,_=s.length;m<_;m++){if(s[m]==="00"){p.push(0,0);continue}var b=parseFloat(s[m]);isNaN(b)?p.push(0):p.push(b)}for(;p.length>0&&!isNaN(p[0]);){var y=null,g=[],v=l,S=u,w,x,C,k,T,P,$,O,E,A;switch(h){case"l":l+=p.shift(),u+=p.shift(),y="L",g.push(l,u);break;case"L":l=p.shift(),u=p.shift(),g.push(l,u);break;case"m":var D=p.shift(),L=p.shift();if(l+=D,u+=L,y="M",a.length>2&&a[a.length-1].command==="z"){for(var M=a.length-2;M>=0;M--)if(a[M].command==="M"){l=a[M].points[0]+D,u=a[M].points[1]+L;break}}g.push(l,u),h="l";break;case"M":l=p.shift(),u=p.shift(),y="M",g.push(l,u),h="L";break;case"h":l+=p.shift(),y="L",g.push(l,u);break;case"H":l=p.shift(),y="L",g.push(l,u);break;case"v":u+=p.shift(),y="L",g.push(l,u);break;case"V":u=p.shift(),y="L",g.push(l,u);break;case"C":g.push(p.shift(),p.shift(),p.shift(),p.shift()),l=p.shift(),u=p.shift(),g.push(l,u);break;case"c":g.push(l+p.shift(),u+p.shift(),l+p.shift(),u+p.shift()),l+=p.shift(),u+=p.shift(),y="C",g.push(l,u);break;case"S":x=l,C=u,w=a[a.length-1],w.command==="C"&&(x=l+(l-w.points[2]),C=u+(u-w.points[3])),g.push(x,C,p.shift(),p.shift()),l=p.shift(),u=p.shift(),y="C",g.push(l,u);break;case"s":x=l,C=u,w=a[a.length-1],w.command==="C"&&(x=l+(l-w.points[2]),C=u+(u-w.points[3])),g.push(x,C,l+p.shift(),u+p.shift()),l+=p.shift(),u+=p.shift(),y="C",g.push(l,u);break;case"Q":g.push(p.shift(),p.shift()),l=p.shift(),u=p.shift(),g.push(l,u);break;case"q":g.push(l+p.shift(),u+p.shift()),l+=p.shift(),u+=p.shift(),y="Q",g.push(l,u);break;case"T":x=l,C=u,w=a[a.length-1],w.command==="Q"&&(x=l+(l-w.points[0]),C=u+(u-w.points[1])),l=p.shift(),u=p.shift(),y="Q",g.push(x,C,l,u);break;case"t":x=l,C=u,w=a[a.length-1],w.command==="Q"&&(x=l+(l-w.points[0]),C=u+(u-w.points[1])),l+=p.shift(),u+=p.shift(),y="Q",g.push(x,C,l,u);break;case"A":k=p.shift(),T=p.shift(),P=p.shift(),$=p.shift(),O=p.shift(),E=l,A=u,l=p.shift(),u=p.shift(),y="A",g=this.convertEndpointToCenterParameterization(E,A,l,u,$,O,k,T,P);break;case"a":k=p.shift(),T=p.shift(),P=p.shift(),$=p.shift(),O=p.shift(),E=l,A=u,l+=p.shift(),u+=p.shift(),y="A",g=this.convertEndpointToCenterParameterization(E,A,l,u,$,O,k,T,P);break}a.push({command:y||h,points:g,start:{x:v,y:S},pathLength:this.calcLength(v,S,y||h,g)})}(h==="z"||h==="Z")&&a.push({command:"z",points:[],start:void 0,pathLength:0})}return a}static calcLength(t,n,r,i){var o,a,s,l,u=Gr;switch(r){case"L":return u.getLineLength(t,n,i[0],i[1]);case"C":return(0,yf.getCubicArcLength)([t,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return(0,yf.getQuadraticArcLength)([t,i[0],i[2]],[n,i[1],i[3]],1);case"A":o=0;var c=i[4],d=i[5],f=i[4]+d,h=Math.PI/180;if(Math.abs(c-f)<h&&(h=Math.abs(c-f)),a=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],c,0),d<0)for(l=c-h;l>f;l-=h)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(l=c+h;l<f;l+=h)s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),a=s;return s=u.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],f,0),o+=u.getLineLength(a.x,a.y,s.x,s.y),o}return 0}static convertEndpointToCenterParameterization(t,n,r,i,o,a,s,l,u){var c=u*(Math.PI/180),d=Math.cos(c)*(t-r)/2+Math.sin(c)*(n-i)/2,f=-1*Math.sin(c)*(t-r)/2+Math.cos(c)*(n-i)/2,h=d*d/(s*s)+f*f/(l*l);h>1&&(s*=Math.sqrt(h),l*=Math.sqrt(h));var p=Math.sqrt((s*s*(l*l)-s*s*(f*f)-l*l*(d*d))/(s*s*(f*f)+l*l*(d*d)));o===a&&(p*=-1),isNaN(p)&&(p=0);var m=p*s*f/l,_=p*-l*d/s,b=(t+r)/2+Math.cos(c)*m-Math.sin(c)*_,y=(n+i)/2+Math.sin(c)*m+Math.cos(c)*_,g=function(T){return Math.sqrt(T[0]*T[0]+T[1]*T[1])},v=function(T,P){return(T[0]*P[0]+T[1]*P[1])/(g(T)*g(P))},S=function(T,P){return(T[0]*P[1]<T[1]*P[0]?-1:1)*Math.acos(v(T,P))},w=S([1,0],[(d-m)/s,(f-_)/l]),x=[(d-m)/s,(f-_)/l],C=[(-1*d-m)/s,(-1*f-_)/l],k=S(x,C);return v(x,C)<=-1&&(k=Math.PI),v(x,C)>=1&&(k=0),a===0&&k>0&&(k=k-2*Math.PI),a===1&&k<0&&(k=k+2*Math.PI),[b,y,s,l,w,k,c,a]}}Ep.Path=Gr;Gr.prototype.className="Path";Gr.prototype._attrsAffectingSize=["data"];(0,tCe._registerNode)(Gr);Jwe.Factory.addGetterSetter(Gr,"data");Object.defineProperty(fx,"__esModule",{value:!0});fx.Arrow=void 0;const px=At,nCe=Ty,PG=Xe,rCe=Rt,gO=Ep;class Hd extends nCe.Line{_sceneFunc(t){super._sceneFunc(t);var n=Math.PI*2,r=this.points(),i=r,o=this.tension()!==0&&r.length>4;o&&(i=this.getTensionPoints());var a=this.pointerLength(),s=r.length,l,u;if(o){const f=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],r[s-2],r[s-1]],h=gO.Path.calcLength(i[i.length-4],i[i.length-3],"C",f),p=gO.Path.getPointOnQuadraticBezier(Math.min(1,1-a/h),f[0],f[1],f[2],f[3],f[4],f[5]);l=r[s-2]-p.x,u=r[s-1]-p.y}else l=r[s-2]-r[s-4],u=r[s-1]-r[s-3];var c=(Math.atan2(u,l)+n)%n,d=this.pointerWidth();this.pointerAtEnding()&&(t.save(),t.beginPath(),t.translate(r[s-2],r[s-1]),t.rotate(c),t.moveTo(0,0),t.lineTo(-a,d/2),t.lineTo(-a,-d/2),t.closePath(),t.restore(),this.__fillStroke(t)),this.pointerAtBeginning()&&(t.save(),t.beginPath(),t.translate(r[0],r[1]),o?(l=(i[0]+i[2])/2-r[0],u=(i[1]+i[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),t.rotate((Math.atan2(-u,-l)+n)%n),t.moveTo(0,0),t.lineTo(-a,d/2),t.lineTo(-a,-d/2),t.closePath(),t.restore(),this.__fillStroke(t))}__fillStroke(t){var n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,t.setLineDash([])),t.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const t=super.getSelfRect(),n=this.pointerWidth()/2;return{x:t.x-n,y:t.y-n,width:t.width+n*2,height:t.height+n*2}}}fx.Arrow=Hd;Hd.prototype.className="Arrow";(0,rCe._registerNode)(Hd);px.Factory.addGetterSetter(Hd,"pointerLength",10,(0,PG.getNumberValidator)());px.Factory.addGetterSetter(Hd,"pointerWidth",10,(0,PG.getNumberValidator)());px.Factory.addGetterSetter(Hd,"pointerAtBeginning",!1);px.Factory.addGetterSetter(Hd,"pointerAtEnding",!0);var gx={};Object.defineProperty(gx,"__esModule",{value:!0});gx.Circle=void 0;const iCe=At,oCe=Zr,aCe=Xe,sCe=Rt;let Tp=class extends oCe.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius()!==t/2&&this.radius(t/2)}setHeight(t){this.radius()!==t/2&&this.radius(t/2)}};gx.Circle=Tp;Tp.prototype._centroid=!0;Tp.prototype.className="Circle";Tp.prototype._attrsAffectingSize=["radius"];(0,sCe._registerNode)(Tp);iCe.Factory.addGetterSetter(Tp,"radius",0,(0,aCe.getNumberValidator)());var mx={};Object.defineProperty(mx,"__esModule",{value:!0});mx.Ellipse=void 0;const EA=At,lCe=Zr,IG=Xe,uCe=Rt;class Tc extends lCe.Shape{_sceneFunc(t){var n=this.radiusX(),r=this.radiusY();t.beginPath(),t.save(),n!==r&&t.scale(1,r/n),t.arc(0,0,n,0,Math.PI*2,!1),t.restore(),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(t){this.radiusX(t/2)}setHeight(t){this.radiusY(t/2)}}mx.Ellipse=Tc;Tc.prototype.className="Ellipse";Tc.prototype._centroid=!0;Tc.prototype._attrsAffectingSize=["radiusX","radiusY"];(0,uCe._registerNode)(Tc);EA.Factory.addComponentsGetterSetter(Tc,"radius",["x","y"]);EA.Factory.addGetterSetter(Tc,"radiusX",0,(0,IG.getNumberValidator)());EA.Factory.addGetterSetter(Tc,"radiusY",0,(0,IG.getNumberValidator)());var yx={};Object.defineProperty(yx,"__esModule",{value:!0});yx.Image=void 0;const ZC=fr,Wd=At,cCe=Zr,dCe=Rt,ky=Xe;let il=class RG extends cCe.Shape{constructor(t){super(t),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const t=this.image();t&&t.complete||t&&t.readyState===4||t&&t.addEventListener&&t.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(t){const n=this.getWidth(),r=this.getHeight(),i=this.cornerRadius(),o=this.attrs.image;let a;if(o){const s=this.attrs.cropWidth,l=this.attrs.cropHeight;s&&l?a=[o,this.cropX(),this.cropY(),s,l,0,0,n,r]:a=[o,0,0,n,r]}(this.hasFill()||this.hasStroke()||i)&&(t.beginPath(),i?ZC.Util.drawRoundedRectPath(t,n,r,i):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)),o&&(i&&t.clip(),t.drawImage.apply(t,a))}_hitFunc(t){var n=this.width(),r=this.height(),i=this.cornerRadius();t.beginPath(),i?ZC.Util.drawRoundedRectPath(t,n,r,i):t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}getWidth(){var t,n;return(t=this.attrs.width)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var t,n;return(t=this.attrs.height)!==null&&t!==void 0?t:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(t,n,r=null){var i=ZC.Util.createImageElement();i.onload=function(){var o=new RG({image:i});n(o)},i.onerror=r,i.crossOrigin="Anonymous",i.src=t}};yx.Image=il;il.prototype.className="Image";(0,dCe._registerNode)(il);Wd.Factory.addGetterSetter(il,"cornerRadius",0,(0,ky.getNumberOrArrayOfNumbersValidator)(4));Wd.Factory.addGetterSetter(il,"image");Wd.Factory.addComponentsGetterSetter(il,"crop",["x","y","width","height"]);Wd.Factory.addGetterSetter(il,"cropX",0,(0,ky.getNumberValidator)());Wd.Factory.addGetterSetter(il,"cropY",0,(0,ky.getNumberValidator)());Wd.Factory.addGetterSetter(il,"cropWidth",0,(0,ky.getNumberValidator)());Wd.Factory.addGetterSetter(il,"cropHeight",0,(0,ky.getNumberValidator)());var rp={};Object.defineProperty(rp,"__esModule",{value:!0});rp.Tag=rp.Label=void 0;const vx=At,fCe=Zr,hCe=wp,TA=Xe,OG=Rt;var MG=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],pCe="Change.konva",gCe="none",YE="up",ZE="right",JE="down",eT="left",mCe=MG.length;class kA extends hCe.Group{constructor(t){super(t),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(t){var n=this,r,i=function(){n._sync()};for(r=0;r<mCe;r++)t.on(MG[r]+pCe,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){var t=this.getText(),n=this.getTag(),r,i,o,a,s,l,u;if(t&&n){switch(r=t.width(),i=t.height(),o=n.pointerDirection(),a=n.pointerWidth(),u=n.pointerHeight(),s=0,l=0,o){case YE:s=r/2,l=-1*u;break;case ZE:s=r+a,l=i/2;break;case JE:s=r/2,l=i+u;break;case eT:s=-1*a,l=i/2;break}n.setAttrs({x:-1*s,y:-1*l,width:r,height:i}),t.setAttrs({x:-1*s,y:-1*l})}}}rp.Label=kA;kA.prototype.className="Label";(0,OG._registerNode)(kA);class Kd extends fCe.Shape{_sceneFunc(t){var n=this.width(),r=this.height(),i=this.pointerDirection(),o=this.pointerWidth(),a=this.pointerHeight(),s=this.cornerRadius();let l=0,u=0,c=0,d=0;typeof s=="number"?l=u=c=d=Math.min(s,n/2,r/2):(l=Math.min(s[0]||0,n/2,r/2),u=Math.min(s[1]||0,n/2,r/2),d=Math.min(s[2]||0,n/2,r/2),c=Math.min(s[3]||0,n/2,r/2)),t.beginPath(),t.moveTo(l,0),i===YE&&(t.lineTo((n-o)/2,0),t.lineTo(n/2,-1*a),t.lineTo((n+o)/2,0)),t.lineTo(n-u,0),t.arc(n-u,u,u,Math.PI*3/2,0,!1),i===ZE&&(t.lineTo(n,(r-a)/2),t.lineTo(n+o,r/2),t.lineTo(n,(r+a)/2)),t.lineTo(n,r-d),t.arc(n-d,r-d,d,0,Math.PI/2,!1),i===JE&&(t.lineTo((n+o)/2,r),t.lineTo(n/2,r+a),t.lineTo((n-o)/2,r)),t.lineTo(c,r),t.arc(c,r-c,c,Math.PI/2,Math.PI,!1),i===eT&&(t.lineTo(0,(r+a)/2),t.lineTo(-1*o,r/2),t.lineTo(0,(r-a)/2)),t.lineTo(0,l),t.arc(l,l,l,Math.PI,Math.PI*3/2,!1),t.closePath(),t.fillStrokeShape(this)}getSelfRect(){var t=0,n=0,r=this.pointerWidth(),i=this.pointerHeight(),o=this.pointerDirection(),a=this.width(),s=this.height();return o===YE?(n-=i,s+=i):o===JE?s+=i:o===eT?(t-=r*1.5,a+=r):o===ZE&&(a+=r*1.5),{x:t,y:n,width:a,height:s}}}rp.Tag=Kd;Kd.prototype.className="Tag";(0,OG._registerNode)(Kd);vx.Factory.addGetterSetter(Kd,"pointerDirection",gCe);vx.Factory.addGetterSetter(Kd,"pointerWidth",0,(0,TA.getNumberValidator)());vx.Factory.addGetterSetter(Kd,"pointerHeight",0,(0,TA.getNumberValidator)());vx.Factory.addGetterSetter(Kd,"cornerRadius",0,(0,TA.getNumberOrArrayOfNumbersValidator)(4));var Ay={};Object.defineProperty(Ay,"__esModule",{value:!0});Ay.Rect=void 0;const yCe=At,vCe=Zr,bCe=Rt,_Ce=fr,SCe=Xe;let bx=class extends vCe.Shape{_sceneFunc(t){var n=this.cornerRadius(),r=this.width(),i=this.height();t.beginPath(),n?_Ce.Util.drawRoundedRectPath(t,r,i,n):t.rect(0,0,r,i),t.closePath(),t.fillStrokeShape(this)}};Ay.Rect=bx;bx.prototype.className="Rect";(0,bCe._registerNode)(bx);yCe.Factory.addGetterSetter(bx,"cornerRadius",0,(0,SCe.getNumberOrArrayOfNumbersValidator)(4));var _x={};Object.defineProperty(_x,"__esModule",{value:!0});_x.RegularPolygon=void 0;const NG=At,xCe=Zr,$G=Xe,wCe=Rt;class Qd extends xCe.Shape{_sceneFunc(t){const n=this._getPoints();t.beginPath(),t.moveTo(n[0].x,n[0].y);for(var r=1;r<n.length;r++)t.lineTo(n[r].x,n[r].y);t.closePath(),t.fillStrokeShape(this)}_getPoints(){const t=this.attrs.sides,n=this.attrs.radius||0,r=[];for(var i=0;i<t;i++)r.push({x:n*Math.sin(i*2*Math.PI/t),y:-1*n*Math.cos(i*2*Math.PI/t)});return r}getSelfRect(){const t=this._getPoints();var n=t[0].x,r=t[0].y,i=t[0].x,o=t[0].y;return t.forEach(a=>{n=Math.min(n,a.x),r=Math.max(r,a.x),i=Math.min(i,a.y),o=Math.max(o,a.y)}),{x:n,y:i,width:r-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}_x.RegularPolygon=Qd;Qd.prototype.className="RegularPolygon";Qd.prototype._centroid=!0;Qd.prototype._attrsAffectingSize=["radius"];(0,wCe._registerNode)(Qd);NG.Factory.addGetterSetter(Qd,"radius",0,(0,$G.getNumberValidator)());NG.Factory.addGetterSetter(Qd,"sides",0,(0,$G.getNumberValidator)());var Sx={};Object.defineProperty(Sx,"__esModule",{value:!0});Sx.Ring=void 0;const DG=At,CCe=Zr,LG=Xe,ECe=Rt;var mO=Math.PI*2;class Xd extends CCe.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.innerRadius(),0,mO,!1),t.moveTo(this.outerRadius(),0),t.arc(0,0,this.outerRadius(),mO,0,!0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}Sx.Ring=Xd;Xd.prototype.className="Ring";Xd.prototype._centroid=!0;Xd.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,ECe._registerNode)(Xd);DG.Factory.addGetterSetter(Xd,"innerRadius",0,(0,LG.getNumberValidator)());DG.Factory.addGetterSetter(Xd,"outerRadius",0,(0,LG.getNumberValidator)());var xx={};Object.defineProperty(xx,"__esModule",{value:!0});xx.Sprite=void 0;const Yd=At,TCe=Zr,kCe=Cp,FG=Xe,ACe=Rt;class ol extends TCe.Shape{constructor(t){super(t),this._updated=!0,this.anim=new kCe.Animation(()=>{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(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+0],l=o[i+1],u=o[i+2],c=o[i+3],d=this.image();if((this.hasFill()||this.hasStroke())&&(t.beginPath(),t.rect(0,0,u,c),t.closePath(),t.fillStrokeShape(this)),d)if(a){var f=a[n],h=r*2;t.drawImage(d,s,l,u,c,f[h+0],f[h+1],u,c)}else t.drawImage(d,s,l,u,c,0,0,u,c)}_hitFunc(t){var n=this.animation(),r=this.frameIndex(),i=r*4,o=this.animations()[n],a=this.frameOffsets(),s=o[i+2],l=o[i+3];if(t.beginPath(),a){var u=a[n],c=r*2;t.rect(u[c+0],u[c+1],s,l)}else t.rect(0,0,s,l);t.closePath(),t.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var t=this;this.interval=setInterval(function(){t._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var t=this.getLayer();this.anim.setLayers(t),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var t=this.frameIndex(),n=this.animation(),r=this.animations(),i=r[n],o=i.length/4;t<o-1?this.frameIndex(t+1):this.frameIndex(0)}}xx.Sprite=ol;ol.prototype.className="Sprite";(0,ACe._registerNode)(ol);Yd.Factory.addGetterSetter(ol,"animation");Yd.Factory.addGetterSetter(ol,"animations");Yd.Factory.addGetterSetter(ol,"frameOffsets");Yd.Factory.addGetterSetter(ol,"image");Yd.Factory.addGetterSetter(ol,"frameIndex",0,(0,FG.getNumberValidator)());Yd.Factory.addGetterSetter(ol,"frameRate",17,(0,FG.getNumberValidator)());Yd.Factory.backCompat(ol,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});var wx={};Object.defineProperty(wx,"__esModule",{value:!0});wx.Star=void 0;const AA=At,PCe=Zr,PA=Xe,ICe=Rt;class kc extends PCe.Shape{_sceneFunc(t){var n=this.innerRadius(),r=this.outerRadius(),i=this.numPoints();t.beginPath(),t.moveTo(0,0-r);for(var o=1;o<i*2;o++){var a=o%2===0?r:n,s=a*Math.sin(o*Math.PI/i),l=-1*a*Math.cos(o*Math.PI/i);t.lineTo(s,l)}t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(t){this.outerRadius(t/2)}setHeight(t){this.outerRadius(t/2)}}wx.Star=kc;kc.prototype.className="Star";kc.prototype._centroid=!0;kc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];(0,ICe._registerNode)(kc);AA.Factory.addGetterSetter(kc,"numPoints",5,(0,PA.getNumberValidator)());AA.Factory.addGetterSetter(kc,"innerRadius",0,(0,PA.getNumberValidator)());AA.Factory.addGetterSetter(kc,"outerRadius",0,(0,PA.getNumberValidator)());var Fd={};Object.defineProperty(Fd,"__esModule",{value:!0});Fd.Text=Fd.stringToArray=void 0;const tT=fr,co=At,RCe=Zr,Ac=Xe,OCe=Rt;function BG(e){return Array.from(e)}Fd.stringToArray=BG;var vf="auto",MCe="center",tg="justify",NCe="Change.konva",$Ce="2d",yO="-",zG="left",DCe="text",LCe="Text",FCe="top",BCe="bottom",vO="middle",jG="normal",zCe="px ",Uv=" ",jCe="right",UCe="word",VCe="char",bO="none",JC="…",UG=["fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],GCe=UG.length;function qCe(e){return e.split(",").map(t=>{t=t.trim();const n=t.indexOf(" ")>=0,r=t.indexOf('"')>=0||t.indexOf("'")>=0;return n&&!r&&(t=`"${t}"`),t}).join(", ")}var Vv;function e5(){return Vv||(Vv=tT.Util.createCanvasElement().getContext($Ce),Vv)}function HCe(e){e.fillText(this._partialText,this._partialTextX,this._partialTextY)}function WCe(e){e.setAttr("miterLimit",2),e.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function KCe(e){return e=e||{},!e.fillLinearGradientColorStops&&!e.fillRadialGradientColorStops&&!e.fillPatternImage&&(e.fill=e.fill||"black"),e}let Ar=class extends RCe.Shape{constructor(t){super(KCe(t)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n<GCe;n++)this.on(UG[n]+NCe,this._setTextData);this._setTextData()}_sceneFunc(t){var n=this.textArr,r=n.length;if(this.text()){var i=this.padding(),o=this.fontSize(),a=this.lineHeight()*o,s=this.verticalAlign(),l=0,u=this.align(),c=this.getWidth(),d=this.letterSpacing(),f=this.fill(),h=this.textDecoration(),p=h.indexOf("underline")!==-1,m=h.indexOf("line-through")!==-1,_,b=0,b=a/2,y=0,g=0;for(t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",vO),t.setAttr("textAlign",zG),s===vO?l=(this.getHeight()-r*a-i*2)/2:s===BCe&&(l=this.getHeight()-r*a-i*2),t.translate(i,l+i),_=0;_<r;_++){var y=0,g=0,v=n[_],S=v.text,w=v.width,x=v.lastInParagraph,C,k,T;if(t.save(),u===jCe?y+=c-w-i*2:u===MCe&&(y+=(c-w-i*2)/2),p){t.save(),t.beginPath(),t.moveTo(y,b+g+Math.round(o/2)),C=S.split(" ").length-1,k=C===0,T=u===tg&&!x?c-i*2:w,t.lineTo(y+Math.round(T),b+g+Math.round(o/2)),t.lineWidth=o/15;const D=this._getLinearGradient();t.strokeStyle=D||f,t.stroke(),t.restore()}if(m){t.save(),t.beginPath(),t.moveTo(y,b+g),C=S.split(" ").length-1,k=C===0,T=u===tg&&x&&!k?c-i*2:w,t.lineTo(y+Math.round(T),b+g),t.lineWidth=o/15;const D=this._getLinearGradient();t.strokeStyle=D||f,t.stroke(),t.restore()}if(d!==0||u===tg){C=S.split(" ").length-1;for(var P=BG(S),$=0;$<P.length;$++){var O=P[$];O===" "&&!x&&u===tg&&(y+=(c-i*2-w)/C),this._partialTextX=y,this._partialTextY=b+g,this._partialText=O,t.fillStrokeShape(this),y+=this.measureSize(O).width+d}}else this._partialTextX=y,this._partialTextY=b+g,this._partialText=S,t.fillStrokeShape(this);t.restore(),r>1&&(b+=a)}}}_hitFunc(t){var n=this.getWidth(),r=this.getHeight();t.beginPath(),t.rect(0,0,n,r),t.closePath(),t.fillStrokeShape(this)}setText(t){var n=tT.Util._isString(t)?t:t==null?"":t+"";return this._setAttr(DCe,n),this}getWidth(){var t=this.attrs.width===vf||this.attrs.width===void 0;return t?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var t=this.attrs.height===vf||this.attrs.height===void 0;return t?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return tT.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(t){var n=e5(),r=this.fontSize(),i;return n.save(),n.font=this._getContextFont(),i=n.measureText(t),n.restore(),{width:i.width,height:r}}_getContextFont(){return this.fontStyle()+Uv+this.fontVariant()+Uv+(this.fontSize()+zCe)+qCe(this.fontFamily())}_addTextLine(t){this.align()===tg&&(t=t.trim());var r=this._getTextWidth(t);return this.textArr.push({text:t,width:r,lastInParagraph:!1})}_getTextWidth(t){var n=this.letterSpacing(),r=t.length;return e5().measureText(t).width+(r?n*(r-1):0)}_setTextData(){var t=this.text().split(`
|
||
`),n=+this.fontSize(),r=0,i=this.lineHeight()*n,o=this.attrs.width,a=this.attrs.height,s=o!==vf&&o!==void 0,l=a!==vf&&a!==void 0,u=this.padding(),c=o-u*2,d=a-u*2,f=0,h=this.wrap(),p=h!==bO,m=h!==VCe&&p,_=this.ellipsis();this.textArr=[],e5().font=this._getContextFont();for(var b=_?this._getTextWidth(JC):0,y=0,g=t.length;y<g;++y){var v=t[y],S=this._getTextWidth(v);if(s&&S>c)for(;v.length>0;){for(var w=0,x=v.length,C="",k=0;w<x;){var T=w+x>>>1,P=v.slice(0,T+1),$=this._getTextWidth(P)+b;$<=c?(w=T+1,C=P,k=$):x=T}if(C){if(m){var O,E=v[C.length],A=E===Uv||E===yO;A&&k<=c?O=C.length:O=Math.max(C.lastIndexOf(Uv),C.lastIndexOf(yO))+1,O>0&&(w=O,C=C.slice(0,w),k=this._getTextWidth(C))}C=C.trimRight(),this._addTextLine(C),r=Math.max(r,k),f+=i;var D=this._shouldHandleEllipsis(f);if(D){this._tryToAddEllipsisToLastLine();break}if(v=v.slice(w),v=v.trimLeft(),v.length>0&&(S=this._getTextWidth(v),S<=c)){this._addTextLine(v),f+=i,r=Math.max(r,S);break}}else break}else this._addTextLine(v),f+=i,r=Math.max(r,S),this._shouldHandleEllipsis(f)&&y<g-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),l&&f+i>d)break}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(t){var n=+this.fontSize(),r=this.lineHeight()*n,i=this.attrs.height,o=i!==vf&&i!==void 0,a=this.padding(),s=i-a*2,l=this.wrap(),u=l!==bO;return!u||o&&t+r>s}_tryToAddEllipsisToLastLine(){var t=this.attrs.width,n=t!==vf&&t!==void 0,r=this.padding(),i=t-r*2,o=this.ellipsis(),a=this.textArr[this.textArr.length-1];if(!(!a||!o)){if(n){var s=this._getTextWidth(a.text+JC)<i;s||(a.text=a.text.slice(0,a.text.length-3))}this.textArr.splice(this.textArr.length-1,1),this._addTextLine(a.text+JC)}}getStrokeScaleEnabled(){return!0}};Fd.Text=Ar;Ar.prototype._fillFunc=HCe;Ar.prototype._strokeFunc=WCe;Ar.prototype.className=LCe;Ar.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];(0,OCe._registerNode)(Ar);co.Factory.overWriteSetter(Ar,"width",(0,Ac.getNumberOrAutoValidator)());co.Factory.overWriteSetter(Ar,"height",(0,Ac.getNumberOrAutoValidator)());co.Factory.addGetterSetter(Ar,"fontFamily","Arial");co.Factory.addGetterSetter(Ar,"fontSize",12,(0,Ac.getNumberValidator)());co.Factory.addGetterSetter(Ar,"fontStyle",jG);co.Factory.addGetterSetter(Ar,"fontVariant",jG);co.Factory.addGetterSetter(Ar,"padding",0,(0,Ac.getNumberValidator)());co.Factory.addGetterSetter(Ar,"align",zG);co.Factory.addGetterSetter(Ar,"verticalAlign",FCe);co.Factory.addGetterSetter(Ar,"lineHeight",1,(0,Ac.getNumberValidator)());co.Factory.addGetterSetter(Ar,"wrap",UCe);co.Factory.addGetterSetter(Ar,"ellipsis",!1,(0,Ac.getBooleanValidator)());co.Factory.addGetterSetter(Ar,"letterSpacing",0,(0,Ac.getNumberValidator)());co.Factory.addGetterSetter(Ar,"text","",(0,Ac.getStringValidator)());co.Factory.addGetterSetter(Ar,"textDecoration","");var Cx={};Object.defineProperty(Cx,"__esModule",{value:!0});Cx.TextPath=void 0;const t5=fr,ps=At,QCe=Zr,ng=Ep,n5=Fd,VG=Xe,XCe=Rt;var YCe="",GG="normal";function qG(e){e.fillText(this.partialText,0,0)}function HG(e){e.strokeText(this.partialText,0,0)}class Jr extends QCe.Shape{constructor(t){super(t),this.dummyCanvas=t5.Util.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return ng.Path.getPathLength(this.dataArray)}_getPointAtLength(t){if(!this.attrs.data)return null;const n=this.pathLength;return t-1>n?null:ng.Path.getPointAtLengthOfDataArray(t,this.dataArray)}_readDataAttribute(){this.dataArray=ng.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(t){t.setAttr("font",this._getContextFont()),t.setAttr("textBaseline",this.textBaseline()),t.setAttr("textAlign","left"),t.save();var n=this.textDecoration(),r=this.fill(),i=this.fontSize(),o=this.glyphInfo;n==="underline"&&t.beginPath();for(var a=0;a<o.length;a++){t.save();var s=o[a].p0;t.translate(s.x,s.y),t.rotate(o[a].rotation),this.partialText=o[a].text,t.fillStrokeShape(this),n==="underline"&&(a===0&&t.moveTo(0,i/2+1),t.lineTo(i,i/2+1)),t.restore()}n==="underline"&&(t.strokeStyle=r,t.lineWidth=i/20,t.stroke()),t.restore()}_hitFunc(t){t.beginPath();var n=this.glyphInfo;if(n.length>=1){var r=n[0].p0;t.moveTo(r.x,r.y)}for(var i=0;i<n.length;i++){var o=n[i].p1;t.lineTo(o.x,o.y)}t.setAttr("lineWidth",this.fontSize()),t.setAttr("strokeStyle",this.colorKey),t.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return t5.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(t){return n5.Text.prototype.setText.call(this,t)}_getContextFont(){return n5.Text.prototype._getContextFont.call(this)}_getTextSize(t){var n=this.dummyCanvas,r=n.getContext("2d");r.save(),r.font=this._getContextFont();var i=r.measureText(t);return r.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const{width:t,height:n}=this._getTextSize(this.attrs.text);if(this.textWidth=t,this.textHeight=n,this.glyphInfo=[],!this.attrs.data)return null;const r=this.letterSpacing(),i=this.align(),o=this.kerningFunc(),a=Math.max(this.textWidth+((this.attrs.text||"").length-1)*r,0);let s=0;i==="center"&&(s=Math.max(0,this.pathLength/2-a/2)),i==="right"&&(s=Math.max(0,this.pathLength-a));const l=(0,n5.stringToArray)(this.text());let u=s;for(var c=0;c<l.length;c++){const d=this._getPointAtLength(u);if(!d)return;let f=this._getTextSize(l[c]).width+r;if(l[c]===" "&&i==="justify"){const y=this.text().split(" ").length-1;f+=(this.pathLength-a)/y}const h=this._getPointAtLength(u+f);if(!h)return;const p=ng.Path.getLineLength(d.x,d.y,h.x,h.y);let m=0;if(o)try{m=o(l[c-1],l[c])*this.fontSize()}catch{m=0}d.x+=m,h.x+=m,this.textWidth+=m;const _=ng.Path.getPointOnLine(m+p/2,d.x,d.y,h.x,h.y),b=Math.atan2(h.y-d.y,h.x-d.x);this.glyphInfo.push({transposeX:_.x,transposeY:_.y,text:l[c],rotation:b,p0:d,p1:h}),u+=f}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};var t=[];this.glyphInfo.forEach(function(c){t.push(c.p0.x),t.push(c.p0.y),t.push(c.p1.x),t.push(c.p1.y)});for(var n=t[0]||0,r=t[0]||0,i=t[1]||0,o=t[1]||0,a,s,l=0;l<t.length/2;l++)a=t[l*2],s=t[l*2+1],n=Math.min(n,a),r=Math.max(r,a),i=Math.min(i,s),o=Math.max(o,s);var u=this.fontSize();return{x:n-u/2,y:i-u/2,width:r-n+u,height:o-i+u}}destroy(){return t5.Util.releaseCanvas(this.dummyCanvas),super.destroy()}}Cx.TextPath=Jr;Jr.prototype._fillFunc=qG;Jr.prototype._strokeFunc=HG;Jr.prototype._fillFuncHit=qG;Jr.prototype._strokeFuncHit=HG;Jr.prototype.className="TextPath";Jr.prototype._attrsAffectingSize=["text","fontSize","data"];(0,XCe._registerNode)(Jr);ps.Factory.addGetterSetter(Jr,"data");ps.Factory.addGetterSetter(Jr,"fontFamily","Arial");ps.Factory.addGetterSetter(Jr,"fontSize",12,(0,VG.getNumberValidator)());ps.Factory.addGetterSetter(Jr,"fontStyle",GG);ps.Factory.addGetterSetter(Jr,"align","left");ps.Factory.addGetterSetter(Jr,"letterSpacing",0,(0,VG.getNumberValidator)());ps.Factory.addGetterSetter(Jr,"textBaseline","middle");ps.Factory.addGetterSetter(Jr,"fontVariant",GG);ps.Factory.addGetterSetter(Jr,"text",YCe);ps.Factory.addGetterSetter(Jr,"textDecoration",null);ps.Factory.addGetterSetter(Jr,"kerningFunc",null);var Ex={};Object.defineProperty(Ex,"__esModule",{value:!0});Ex.Transformer=void 0;const En=fr,bn=At,_O=ir,ZCe=Zr,JCe=Ay,SO=wp,ja=Rt,Pc=Xe,e5e=Rt;var WG="tr-konva",t5e=["resizeEnabledChange","rotateAnchorOffsetChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(e=>e+`.${WG}`).join(" "),xO="nodesRect",n5e=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],r5e={"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 i5e="ontouchstart"in ja.Konva._global;function o5e(e,t){if(e==="rotater")return"crosshair";t+=En.Util.degToRad(r5e[e]||0);var n=(En.Util.radToDeg(t)%360+360)%360;return En.Util._inRange(n,315+22.5,360)||En.Util._inRange(n,0,22.5)?"ns-resize":En.Util._inRange(n,45-22.5,45+22.5)?"nesw-resize":En.Util._inRange(n,90-22.5,90+22.5)?"ew-resize":En.Util._inRange(n,135-22.5,135+22.5)?"nwse-resize":En.Util._inRange(n,180-22.5,180+22.5)?"ns-resize":En.Util._inRange(n,225-22.5,225+22.5)?"nesw-resize":En.Util._inRange(n,270-22.5,270+22.5)?"ew-resize":En.Util._inRange(n,315-22.5,315+22.5)?"nwse-resize":(En.Util.error("Transformer has unknown angle for cursor detection: "+n),"pointer")}var B_=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],wO=1e8;function a5e(e){return{x:e.x+e.width/2*Math.cos(e.rotation)+e.height/2*Math.sin(-e.rotation),y:e.y+e.height/2*Math.cos(e.rotation)+e.width/2*Math.sin(e.rotation)}}function KG(e,t,n){const r=n.x+(e.x-n.x)*Math.cos(t)-(e.y-n.y)*Math.sin(t),i=n.y+(e.x-n.x)*Math.sin(t)+(e.y-n.y)*Math.cos(t);return Object.assign(Object.assign({},e),{rotation:e.rotation+t,x:r,y:i})}function s5e(e,t){const n=a5e(e);return KG(e,t,n)}function l5e(e,t,n){let r=t;for(let i=0;i<e.length;i++){const o=ja.Konva.getAngle(e[i]),a=Math.abs(o-t)%(Math.PI*2);Math.min(a,Math.PI*2-a)<n&&(r=o)}return r}class Jt extends SO.Group{constructor(t){super(t),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(t5e,this.update),this.getNode()&&this.update()}attachTo(t){return this.setNode(t),this}setNode(t){return En.Util.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([t])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return WG+this._id}setNodes(t=[]){this._nodes&&this._nodes.length&&this.detach();const n=t.filter(i=>i.isAncestorOf(this)?(En.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);this._nodes=t=n,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const o=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},a=i._attrsAffectingSize.map(s=>s+"Change."+this._getEventNamespace()).join(" ");i.on(a,o),i.on(n5e.map(s=>s+`.${this._getEventNamespace()}`).join(" "),o),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,o),this._proxyDrag(i)}),this._resetTransformCache();var r=!!this.findOne(".top-left");return r&&this.update(),this}_proxyDrag(t){let n;t.on(`dragstart.${this._getEventNamespace()}`,r=>{n=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(r,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,r=>{if(!n)return;const i=t.getAbsolutePosition(),o=i.x-n.x,a=i.y-n.y;this.nodes().forEach(s=>{if(s===t||s.isDragging())return;const l=s.getAbsolutePosition();s.setAbsolutePosition({x:l.x+o,y:l.y+a}),s.startDrag(r)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(xO),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(xO,this.__getNodeRect)}__getNodeShape(t,n=this.rotation(),r){var i=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=t.getAbsoluteScale(r),a=t.getAbsolutePosition(r),s=i.x*o.x-t.offsetX()*o.x,l=i.y*o.y-t.offsetY()*o.y;const u=(ja.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),c={x:a.x+s*Math.cos(u)+l*Math.sin(-u),y:a.y+l*Math.cos(u)+s*Math.sin(u),width:i.width*o.x,height:i.height*o.y,rotation:u};return KG(c,-ja.Konva.getAngle(n),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-wO,y:-wO,width:0,height:0,rotation:0};const n=[];this.nodes().map(u=>{const c=u.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var d=[{x:c.x,y:c.y},{x:c.x+c.width,y:c.y},{x:c.x+c.width,y:c.y+c.height},{x:c.x,y:c.y+c.height}],f=u.getAbsoluteTransform();d.forEach(function(h){var p=f.point(h);n.push(p)})});const r=new En.Transform;r.rotate(-ja.Konva.getAngle(this.rotation()));var i,o,a,s;n.forEach(function(u){var c=r.point(u);i===void 0&&(i=a=c.x,o=s=c.y),i=Math.min(i,c.x),o=Math.min(o,c.y),a=Math.max(a,c.x),s=Math.max(s,c.y)}),r.invert();const l=r.point({x:i,y:o});return{x:l.x,y:l.y,width:a-i,height:s-o,rotation:ja.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),B_.forEach((function(t){this._createAnchor(t)}).bind(this)),this._createAnchor("rotater")}_createAnchor(t){var n=new JCe.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:i5e?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=ja.Konva.getAngle(this.rotation()),o=o5e(t,i);n.getStage().content&&(n.getStage().content.style.cursor=o),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){var t=new ZCe.Shape({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()*En.Util._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(t),this._proxyDrag(t),t.on("dragstart",n=>{n.cancelBubble=!0}),t.on("dragmove",n=>{n.cancelBubble=!0}),t.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var n=this._getNodeRect(),r=n.width,i=n.height,o=Math.sqrt(Math.pow(r,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(r/o),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var a=t.target.getAbsolutePosition(),s=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:s.x-a.x,y:s.y-a.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(l=>{l._fire("transformstart",{evt:t.evt,target:l})})}_handleMouseMove(t){var n,r,i,o=this.findOne("."+this._movingAnchorName),a=o.getStage();a.setPointersPositions(t);const s=a.getPointerPosition();let l={x:s.x-this._anchorDragOffset.x,y:s.y-this._anchorDragOffset.y};const u=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(l=this.anchorDragBoundFunc()(u,l,t)),o.setAbsolutePosition(l);const c=o.getAbsolutePosition();if(!(u.x===c.x&&u.y===c.y)){if(this._movingAnchorName==="rotater"){var d=this._getNodeRect();n=o.x()-d.width/2,r=-o.y()+d.height/2;let O=Math.atan2(-r,n)+Math.PI/2;d.height<0&&(O-=Math.PI);var f=ja.Konva.getAngle(this.rotation());const E=f+O,A=ja.Konva.getAngle(this.rotationSnapTolerance()),L=l5e(this.rotationSnaps(),E,A)-d.rotation,M=s5e(d,L);this._fitNodesInto(M,t);return}var h=this.shiftBehavior(),p;h==="inverted"?p=this.keepRatio()&&!t.shiftKey:h==="none"?p=this.keepRatio():p=this.keepRatio()||t.shiftKey;var g=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(p){var m=g?{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(m.x-o.x(),2)+Math.pow(m.y-o.y(),2));var _=this.findOne(".top-left").x()>m.x?-1:1,b=this.findOne(".top-left").y()>m.y?-1:1;n=i*this.cos*_,r=i*this.sin*b,this.findOne(".top-left").x(m.x-n),this.findOne(".top-left").y(m.y-r)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(p){var m=g?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-m.x,2)+Math.pow(m.y-o.y(),2));var _=this.findOne(".top-right").x()<m.x?-1:1,b=this.findOne(".top-right").y()>m.y?-1:1;n=i*this.cos*_,r=i*this.sin*b,this.findOne(".top-right").x(m.x+n),this.findOne(".top-right").y(m.y-r)}var y=o.position();this.findOne(".top-left").y(y.y),this.findOne(".bottom-right").x(y.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(p){var m=g?{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(m.x-o.x(),2)+Math.pow(o.y()-m.y,2));var _=m.x<o.x()?-1:1,b=o.y()<m.y?-1:1;n=i*this.cos*_,r=i*this.sin*b,o.x(m.x-n),o.y(m.y+r)}y=o.position(),this.findOne(".top-left").x(y.x),this.findOne(".bottom-right").y(y.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(o.y());else if(this._movingAnchorName==="bottom-right"){if(p){var m=g?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};i=Math.sqrt(Math.pow(o.x()-m.x,2)+Math.pow(o.y()-m.y,2));var _=this.findOne(".bottom-right").x()<m.x?-1:1,b=this.findOne(".bottom-right").y()<m.y?-1:1;n=i*this.cos*_,r=i*this.sin*b,this.findOne(".bottom-right").x(m.x+n),this.findOne(".bottom-right").y(m.y+r)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));var g=this.centeredScaling()||t.altKey;if(g){var v=this.findOne(".top-left"),S=this.findOne(".bottom-right"),w=v.x(),x=v.y(),C=this.getWidth()-S.x(),k=this.getHeight()-S.y();S.move({x:-w,y:-x}),v.move({x:C,y:k})}var T=this.findOne(".top-left").getAbsolutePosition();n=T.x,r=T.y;var P=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),$=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:r,width:P,height:$,rotation:ja.Konva.getAngle(this.rotation())},t)}}_handleMouseUp(t){this._removeEvents(t)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(t){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:t,target:n}),n&&this._nodes.forEach(r=>{r._fire("transformend",{evt:t,target:r})}),this._movingAnchorName=null}}_fitNodesInto(t,n){var r=this._getNodeRect();const i=1;if(En.Util._inRange(t.width,-this.padding()*2-i,i)){this.update();return}if(En.Util._inRange(t.height,-this.padding()*2-i,i)){this.update();return}const o=this.flipEnabled();var a=new En.Transform;if(a.rotate(ja.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const d=a.point({x:-this.padding()*2,y:0});if(t.x+=d.x,t.y+=d.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,!o){this.update();return}}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const d=a.point({x:this.padding()*2,y:0});if(this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.width+=this.padding()*2,!o){this.update();return}}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const d=a.point({x:0,y:-this.padding()*2});if(t.x+=d.x,t.y+=d.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.height+=this.padding()*2,!o){this.update();return}}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const d=a.point({x:0,y:this.padding()*2});if(this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.height+=this.padding()*2,!o){this.update();return}}if(this.boundBoxFunc()){const d=this.boundBoxFunc()(r,t);d?t=d:En.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const s=1e7,l=new En.Transform;l.translate(r.x,r.y),l.rotate(r.rotation),l.scale(r.width/s,r.height/s);const u=new En.Transform;u.translate(t.x,t.y),u.rotate(t.rotation),u.scale(t.width/s,t.height/s);const c=u.multiply(l.invert());this._nodes.forEach(d=>{var f;const h=d.getParent().getAbsoluteTransform(),p=d.getTransform().copy();p.translate(d.offsetX(),d.offsetY());const m=new En.Transform;m.multiply(h.copy().invert()).multiply(c).multiply(h).multiply(p);const _=m.decompose();d.setAttrs(_),this._fire("transform",{evt:n,target:d}),d._fire("transform",{evt:n,target:d}),(f=d.getLayer())===null||f===void 0||f.batchDraw()}),this.rotation(En.Util._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,n){this.findOne(t).setAttrs(n)}update(){var t,n=this._getNodeRect();this.rotation(En.Util._getRotation(n.rotation));var r=n.width,i=n.height,o=this.enabledAnchors(),a=this.resizeEnabled(),s=this.padding(),l=this.anchorSize();const u=this.find("._anchor");u.forEach(d=>{d.setAttrs({width:l,height:l,offsetX:l/2,offsetY:l/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:l/2+s,offsetY:l/2+s,visible:a&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:r/2,y:0,offsetY:l/2+s,visible:a&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:r,y:0,offsetX:l/2-s,offsetY:l/2+s,visible:a&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:l/2+s,visible:a&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:r,y:i/2,offsetX:l/2-s,visible:a&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:l/2+s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:r/2,y:i,offsetY:l/2-s,visible:a&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:r,y:i,offsetX:l/2-s,offsetY:l/2-s,visible:a&&o.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:r/2,y:-this.rotateAnchorOffset()*En.Util._sign(i)-s,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:r,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const c=this.anchorStyleFunc();c&&u.forEach(d=>{c(d)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),SO.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return _O.Node.prototype.toObject.call(this)}clone(t){var n=_O.Node.prototype.clone.call(this,t);return n}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}Ex.Transformer=Jt;function u5e(e){return e instanceof Array||En.Util.warn("enabledAnchors value should be an array"),e instanceof Array&&e.forEach(function(t){B_.indexOf(t)===-1&&En.Util.warn("Unknown anchor name: "+t+". Available names are: "+B_.join(", "))}),e||[]}Jt.prototype.className="Transformer";(0,e5e._registerNode)(Jt);bn.Factory.addGetterSetter(Jt,"enabledAnchors",B_,u5e);bn.Factory.addGetterSetter(Jt,"flipEnabled",!0,(0,Pc.getBooleanValidator)());bn.Factory.addGetterSetter(Jt,"resizeEnabled",!0);bn.Factory.addGetterSetter(Jt,"anchorSize",10,(0,Pc.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"rotateEnabled",!0);bn.Factory.addGetterSetter(Jt,"rotationSnaps",[]);bn.Factory.addGetterSetter(Jt,"rotateAnchorOffset",50,(0,Pc.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"rotationSnapTolerance",5,(0,Pc.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"borderEnabled",!0);bn.Factory.addGetterSetter(Jt,"anchorStroke","rgb(0, 161, 255)");bn.Factory.addGetterSetter(Jt,"anchorStrokeWidth",1,(0,Pc.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"anchorFill","white");bn.Factory.addGetterSetter(Jt,"anchorCornerRadius",0,(0,Pc.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"borderStroke","rgb(0, 161, 255)");bn.Factory.addGetterSetter(Jt,"borderStrokeWidth",1,(0,Pc.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"borderDash");bn.Factory.addGetterSetter(Jt,"keepRatio",!0);bn.Factory.addGetterSetter(Jt,"shiftBehavior","default");bn.Factory.addGetterSetter(Jt,"centeredScaling",!1);bn.Factory.addGetterSetter(Jt,"ignoreStroke",!1);bn.Factory.addGetterSetter(Jt,"padding",0,(0,Pc.getNumberValidator)());bn.Factory.addGetterSetter(Jt,"node");bn.Factory.addGetterSetter(Jt,"nodes");bn.Factory.addGetterSetter(Jt,"boundBoxFunc");bn.Factory.addGetterSetter(Jt,"anchorDragBoundFunc");bn.Factory.addGetterSetter(Jt,"anchorStyleFunc");bn.Factory.addGetterSetter(Jt,"shouldOverdrawWholeArea",!1);bn.Factory.addGetterSetter(Jt,"useSingleNodeRotation",!0);bn.Factory.backCompat(Jt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var Tx={};Object.defineProperty(Tx,"__esModule",{value:!0});Tx.Wedge=void 0;const kx=At,c5e=Zr,d5e=Rt,QG=Xe,f5e=Rt;class iu extends c5e.Shape{_sceneFunc(t){t.beginPath(),t.arc(0,0,this.radius(),0,d5e.Konva.getAngle(this.angle()),this.clockwise()),t.lineTo(0,0),t.closePath(),t.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(t){this.radius(t/2)}setHeight(t){this.radius(t/2)}}Tx.Wedge=iu;iu.prototype.className="Wedge";iu.prototype._centroid=!0;iu.prototype._attrsAffectingSize=["radius"];(0,f5e._registerNode)(iu);kx.Factory.addGetterSetter(iu,"radius",0,(0,QG.getNumberValidator)());kx.Factory.addGetterSetter(iu,"angle",0,(0,QG.getNumberValidator)());kx.Factory.addGetterSetter(iu,"clockwise",!1);kx.Factory.backCompat(iu,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var Ax={};Object.defineProperty(Ax,"__esModule",{value:!0});Ax.Blur=void 0;const CO=At,h5e=ir,p5e=Xe;function EO(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var g5e=[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],m5e=[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 y5e(e,t){var n=e.data,r=e.width,i=e.height,o,a,s,l,u,c,d,f,h,p,m,_,b,y,g,v,S,w,x,C,k,T,P,$,O=t+t+1,E=r-1,A=i-1,D=t+1,L=D*(D+1)/2,M=new EO,R=null,N=M,B=null,U=null,G=g5e[t],Z=m5e[t];for(s=1;s<O;s++)N=N.next=new EO,s===D&&(R=N);for(N.next=M,d=c=0,a=0;a<i;a++){for(v=S=w=x=f=h=p=m=0,_=D*(C=n[c]),b=D*(k=n[c+1]),y=D*(T=n[c+2]),g=D*(P=n[c+3]),f+=L*C,h+=L*k,p+=L*T,m+=L*P,N=M,s=0;s<D;s++)N.r=C,N.g=k,N.b=T,N.a=P,N=N.next;for(s=1;s<D;s++)l=c+((E<s?E:s)<<2),f+=(N.r=C=n[l])*($=D-s),h+=(N.g=k=n[l+1])*$,p+=(N.b=T=n[l+2])*$,m+=(N.a=P=n[l+3])*$,v+=C,S+=k,w+=T,x+=P,N=N.next;for(B=M,U=R,o=0;o<r;o++)n[c+3]=P=m*G>>Z,P!==0?(P=255/P,n[c]=(f*G>>Z)*P,n[c+1]=(h*G>>Z)*P,n[c+2]=(p*G>>Z)*P):n[c]=n[c+1]=n[c+2]=0,f-=_,h-=b,p-=y,m-=g,_-=B.r,b-=B.g,y-=B.b,g-=B.a,l=d+((l=o+t+1)<E?l:E)<<2,v+=B.r=n[l],S+=B.g=n[l+1],w+=B.b=n[l+2],x+=B.a=n[l+3],f+=v,h+=S,p+=w,m+=x,B=B.next,_+=C=U.r,b+=k=U.g,y+=T=U.b,g+=P=U.a,v-=C,S-=k,w-=T,x-=P,U=U.next,c+=4;d+=r}for(o=0;o<r;o++){for(S=w=x=v=h=p=m=f=0,c=o<<2,_=D*(C=n[c]),b=D*(k=n[c+1]),y=D*(T=n[c+2]),g=D*(P=n[c+3]),f+=L*C,h+=L*k,p+=L*T,m+=L*P,N=M,s=0;s<D;s++)N.r=C,N.g=k,N.b=T,N.a=P,N=N.next;for(u=r,s=1;s<=t;s++)c=u+o<<2,f+=(N.r=C=n[c])*($=D-s),h+=(N.g=k=n[c+1])*$,p+=(N.b=T=n[c+2])*$,m+=(N.a=P=n[c+3])*$,v+=C,S+=k,w+=T,x+=P,N=N.next,s<A&&(u+=r);for(c=o,B=M,U=R,a=0;a<i;a++)l=c<<2,n[l+3]=P=m*G>>Z,P>0?(P=255/P,n[l]=(f*G>>Z)*P,n[l+1]=(h*G>>Z)*P,n[l+2]=(p*G>>Z)*P):n[l]=n[l+1]=n[l+2]=0,f-=_,h-=b,p-=y,m-=g,_-=B.r,b-=B.g,y-=B.b,g-=B.a,l=o+((l=a+D)<A?l:A)*r<<2,f+=v+=B.r=n[l],h+=S+=B.g=n[l+1],p+=w+=B.b=n[l+2],m+=x+=B.a=n[l+3],B=B.next,_+=C=U.r,b+=k=U.g,y+=T=U.b,g+=P=U.a,v-=C,S-=k,w-=T,x-=P,U=U.next,c+=r}}const v5e=function(t){var n=Math.round(this.blurRadius());n>0&&y5e(t,n)};Ax.Blur=v5e;CO.Factory.addGetterSetter(h5e.Node,"blurRadius",0,(0,p5e.getNumberValidator)(),CO.Factory.afterSetFilter);var Px={};Object.defineProperty(Px,"__esModule",{value:!0});Px.Brighten=void 0;const TO=At,b5e=ir,_5e=Xe,S5e=function(e){var t=this.brightness()*255,n=e.data,r=n.length,i;for(i=0;i<r;i+=4)n[i]+=t,n[i+1]+=t,n[i+2]+=t};Px.Brighten=S5e;TO.Factory.addGetterSetter(b5e.Node,"brightness",0,(0,_5e.getNumberValidator)(),TO.Factory.afterSetFilter);var Ix={};Object.defineProperty(Ix,"__esModule",{value:!0});Ix.Contrast=void 0;const kO=At,x5e=ir,w5e=Xe,C5e=function(e){var t=Math.pow((this.contrast()+100)/100,2),n=e.data,r=n.length,i=150,o=150,a=150,s;for(s=0;s<r;s+=4)i=n[s],o=n[s+1],a=n[s+2],i/=255,i-=.5,i*=t,i+=.5,i*=255,o/=255,o-=.5,o*=t,o+=.5,o*=255,a/=255,a-=.5,a*=t,a+=.5,a*=255,i=i<0?0:i>255?255:i,o=o<0?0:o>255?255:o,a=a<0?0:a>255?255:a,n[s]=i,n[s+1]=o,n[s+2]=a};Ix.Contrast=C5e;kO.Factory.addGetterSetter(x5e.Node,"contrast",0,(0,w5e.getNumberValidator)(),kO.Factory.afterSetFilter);var Rx={};Object.defineProperty(Rx,"__esModule",{value:!0});Rx.Emboss=void 0;const cc=At,Ox=ir,E5e=fr,XG=Xe,T5e=function(e){var t=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),i=this.embossBlend(),o=0,a=0,s=e.data,l=e.width,u=e.height,c=l*4,d=u;switch(r){case"top-left":o=-1,a=-1;break;case"top":o=-1,a=0;break;case"top-right":o=-1,a=1;break;case"right":o=0,a=1;break;case"bottom-right":o=1,a=1;break;case"bottom":o=1,a=0;break;case"bottom-left":o=1,a=-1;break;case"left":o=0,a=-1;break;default:E5e.Util.error("Unknown emboss direction: "+r)}do{var f=(d-1)*c,h=o;d+h<1&&(h=0),d+h>u&&(h=0);var p=(d-1+h)*l*4,m=l;do{var _=f+(m-1)*4,b=a;m+b<1&&(b=0),m+b>l&&(b=0);var y=p+(m-1+b)*4,g=s[_]-s[y],v=s[_+1]-s[y+1],S=s[_+2]-s[y+2],w=g,x=w>0?w:-w,C=v>0?v:-v,k=S>0?S:-S;if(C>x&&(w=v),k>x&&(w=S),w*=t,i){var T=s[_]+w,P=s[_+1]+w,$=s[_+2]+w;s[_]=T>255?255:T<0?0:T,s[_+1]=P>255?255:P<0?0:P,s[_+2]=$>255?255:$<0?0:$}else{var O=n-w;O<0?O=0:O>255&&(O=255),s[_]=s[_+1]=s[_+2]=O}}while(--m)}while(--d)};Rx.Emboss=T5e;cc.Factory.addGetterSetter(Ox.Node,"embossStrength",.5,(0,XG.getNumberValidator)(),cc.Factory.afterSetFilter);cc.Factory.addGetterSetter(Ox.Node,"embossWhiteLevel",.5,(0,XG.getNumberValidator)(),cc.Factory.afterSetFilter);cc.Factory.addGetterSetter(Ox.Node,"embossDirection","top-left",null,cc.Factory.afterSetFilter);cc.Factory.addGetterSetter(Ox.Node,"embossBlend",!1,null,cc.Factory.afterSetFilter);var Mx={};Object.defineProperty(Mx,"__esModule",{value:!0});Mx.Enhance=void 0;const AO=At,k5e=ir,A5e=Xe;function r5(e,t,n,r,i){var o=n-t,a=i-r,s;return o===0?r+a/2:a===0?r:(s=(e-t)/o,s=a*s+r,s)}const P5e=function(e){var t=e.data,n=t.length,r=t[0],i=r,o,a=t[1],s=a,l,u=t[2],c=u,d,f,h=this.enhance();if(h!==0){for(f=0;f<n;f+=4)o=t[f+0],o<r?r=o:o>i&&(i=o),l=t[f+1],l<a?a=l:l>s&&(s=l),d=t[f+2],d<u?u=d:d>c&&(c=d);i===r&&(i=255,r=0),s===a&&(s=255,a=0),c===u&&(c=255,u=0);var p,m,_,b,y,g,v,S,w;for(h>0?(m=i+h*(255-i),_=r-h*(r-0),y=s+h*(255-s),g=a-h*(a-0),S=c+h*(255-c),w=u-h*(u-0)):(p=(i+r)*.5,m=i+h*(i-p),_=r+h*(r-p),b=(s+a)*.5,y=s+h*(s-b),g=a+h*(a-b),v=(c+u)*.5,S=c+h*(c-v),w=u+h*(u-v)),f=0;f<n;f+=4)t[f+0]=r5(t[f+0],r,i,_,m),t[f+1]=r5(t[f+1],a,s,g,y),t[f+2]=r5(t[f+2],u,c,w,S)}};Mx.Enhance=P5e;AO.Factory.addGetterSetter(k5e.Node,"enhance",0,(0,A5e.getNumberValidator)(),AO.Factory.afterSetFilter);var Nx={};Object.defineProperty(Nx,"__esModule",{value:!0});Nx.Grayscale=void 0;const I5e=function(e){var t=e.data,n=t.length,r,i;for(r=0;r<n;r+=4)i=.34*t[r]+.5*t[r+1]+.16*t[r+2],t[r]=i,t[r+1]=i,t[r+2]=i};Nx.Grayscale=I5e;var $x={};Object.defineProperty($x,"__esModule",{value:!0});$x.HSL=void 0;const ip=At,IA=ir,RA=Xe;ip.Factory.addGetterSetter(IA.Node,"hue",0,(0,RA.getNumberValidator)(),ip.Factory.afterSetFilter);ip.Factory.addGetterSetter(IA.Node,"saturation",0,(0,RA.getNumberValidator)(),ip.Factory.afterSetFilter);ip.Factory.addGetterSetter(IA.Node,"luminance",0,(0,RA.getNumberValidator)(),ip.Factory.afterSetFilter);const R5e=function(e){var t=e.data,n=t.length,r=1,i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,a=this.luminance()*127,s,l=r*i*Math.cos(o*Math.PI/180),u=r*i*Math.sin(o*Math.PI/180),c=.299*r+.701*l+.167*u,d=.587*r-.587*l+.33*u,f=.114*r-.114*l-.497*u,h=.299*r-.299*l-.328*u,p=.587*r+.413*l+.035*u,m=.114*r-.114*l+.293*u,_=.299*r-.3*l+1.25*u,b=.587*r-.586*l-1.05*u,y=.114*r+.886*l-.2*u,g,v,S,w;for(s=0;s<n;s+=4)g=t[s+0],v=t[s+1],S=t[s+2],w=t[s+3],t[s+0]=c*g+d*v+f*S+a,t[s+1]=h*g+p*v+m*S+a,t[s+2]=_*g+b*v+y*S+a,t[s+3]=w};$x.HSL=R5e;var Dx={};Object.defineProperty(Dx,"__esModule",{value:!0});Dx.HSV=void 0;const op=At,OA=ir,MA=Xe,O5e=function(e){var t=e.data,n=t.length,r=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,a,s=r*i*Math.cos(o*Math.PI/180),l=r*i*Math.sin(o*Math.PI/180),u=.299*r+.701*s+.167*l,c=.587*r-.587*s+.33*l,d=.114*r-.114*s-.497*l,f=.299*r-.299*s-.328*l,h=.587*r+.413*s+.035*l,p=.114*r-.114*s+.293*l,m=.299*r-.3*s+1.25*l,_=.587*r-.586*s-1.05*l,b=.114*r+.886*s-.2*l,y,g,v,S;for(a=0;a<n;a+=4)y=t[a+0],g=t[a+1],v=t[a+2],S=t[a+3],t[a+0]=u*y+c*g+d*v,t[a+1]=f*y+h*g+p*v,t[a+2]=m*y+_*g+b*v,t[a+3]=S};Dx.HSV=O5e;op.Factory.addGetterSetter(OA.Node,"hue",0,(0,MA.getNumberValidator)(),op.Factory.afterSetFilter);op.Factory.addGetterSetter(OA.Node,"saturation",0,(0,MA.getNumberValidator)(),op.Factory.afterSetFilter);op.Factory.addGetterSetter(OA.Node,"value",0,(0,MA.getNumberValidator)(),op.Factory.afterSetFilter);var Lx={};Object.defineProperty(Lx,"__esModule",{value:!0});Lx.Invert=void 0;const M5e=function(e){var t=e.data,n=t.length,r;for(r=0;r<n;r+=4)t[r]=255-t[r],t[r+1]=255-t[r+1],t[r+2]=255-t[r+2]};Lx.Invert=M5e;var Fx={};Object.defineProperty(Fx,"__esModule",{value:!0});Fx.Kaleidoscope=void 0;const z_=At,YG=ir,PO=fr,ZG=Xe;var N5e=function(e,t,n){var r=e.data,i=t.data,o=e.width,a=e.height,s=n.polarCenterX||o/2,l=n.polarCenterY||a/2,u,c,d,f=0,h=0,p=0,m=0,_,b=Math.sqrt(s*s+l*l);c=o-s,d=a-l,_=Math.sqrt(c*c+d*d),b=_>b?_:b;var y=a,g=o,v,S,w=360/g*Math.PI/180,x,C;for(S=0;S<g;S+=1)for(x=Math.sin(S*w),C=Math.cos(S*w),v=0;v<y;v+=1)c=Math.floor(s+b*v/y*C),d=Math.floor(l+b*v/y*x),u=(d*o+c)*4,f=r[u+0],h=r[u+1],p=r[u+2],m=r[u+3],u=(S+v*o)*4,i[u+0]=f,i[u+1]=h,i[u+2]=p,i[u+3]=m},$5e=function(e,t,n){var r=e.data,i=t.data,o=e.width,a=e.height,s=n.polarCenterX||o/2,l=n.polarCenterY||a/2,u,c,d,f,h,p=0,m=0,_=0,b=0,y,g=Math.sqrt(s*s+l*l);c=o-s,d=a-l,y=Math.sqrt(c*c+d*d),g=y>g?y:g;var v=a,S=o,w,x,C=n.polarRotation||0,k,T;for(c=0;c<o;c+=1)for(d=0;d<a;d+=1)f=c-s,h=d-l,w=Math.sqrt(f*f+h*h)*v/g,x=(Math.atan2(h,f)*180/Math.PI+360+C)%360,x=x*S/360,k=Math.floor(x),T=Math.floor(w),u=(T*o+k)*4,p=r[u+0],m=r[u+1],_=r[u+2],b=r[u+3],u=(d*o+c)*4,i[u+0]=p,i[u+1]=m,i[u+2]=_,i[u+3]=b};const D5e=function(e){var t=e.width,n=e.height,r,i,o,a,s,l,u,c,d,f,h=Math.round(this.kaleidoscopePower()),p=Math.round(this.kaleidoscopeAngle()),m=Math.floor(t*(p%360)/360);if(!(h<1)){var _=PO.Util.createCanvasElement();_.width=t,_.height=n;var b=_.getContext("2d").getImageData(0,0,t,n);PO.Util.releaseCanvas(_),N5e(e,b,{polarCenterX:t/2,polarCenterY:n/2});for(var y=t/Math.pow(2,h);y<=8;)y=y*2,h-=1;y=Math.ceil(y);var g=y,v=0,S=g,w=1;for(m+y>t&&(v=g,S=0,w=-1),i=0;i<n;i+=1)for(r=v;r!==S;r+=w)o=Math.round(r+m)%t,d=(t*i+o)*4,s=b.data[d+0],l=b.data[d+1],u=b.data[d+2],c=b.data[d+3],f=(t*i+r)*4,b.data[f+0]=s,b.data[f+1]=l,b.data[f+2]=u,b.data[f+3]=c;for(i=0;i<n;i+=1)for(g=Math.floor(y),a=0;a<h;a+=1){for(r=0;r<g+1;r+=1)d=(t*i+r)*4,s=b.data[d+0],l=b.data[d+1],u=b.data[d+2],c=b.data[d+3],f=(t*i+g*2-r-1)*4,b.data[f+0]=s,b.data[f+1]=l,b.data[f+2]=u,b.data[f+3]=c;g*=2}$5e(b,e,{polarRotation:0})}};Fx.Kaleidoscope=D5e;z_.Factory.addGetterSetter(YG.Node,"kaleidoscopePower",2,(0,ZG.getNumberValidator)(),z_.Factory.afterSetFilter);z_.Factory.addGetterSetter(YG.Node,"kaleidoscopeAngle",0,(0,ZG.getNumberValidator)(),z_.Factory.afterSetFilter);var Bx={};Object.defineProperty(Bx,"__esModule",{value:!0});Bx.Mask=void 0;const IO=At,L5e=ir,F5e=Xe;function Gv(e,t,n){var r=(n*e.width+t)*4,i=[];return i.push(e.data[r++],e.data[r++],e.data[r++],e.data[r++]),i}function rg(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2)+Math.pow(e[2]-t[2],2))}function B5e(e){for(var t=[0,0,0],n=0;n<e.length;n++)t[0]+=e[n][0],t[1]+=e[n][1],t[2]+=e[n][2];return t[0]/=e.length,t[1]/=e.length,t[2]/=e.length,t}function z5e(e,t){var n=Gv(e,0,0),r=Gv(e,e.width-1,0),i=Gv(e,0,e.height-1),o=Gv(e,e.width-1,e.height-1),a=t||10;if(rg(n,r)<a&&rg(r,o)<a&&rg(o,i)<a&&rg(i,n)<a){for(var s=B5e([r,n,o,i]),l=[],u=0;u<e.width*e.height;u++){var c=rg(s,[e.data[u*4],e.data[u*4+1],e.data[u*4+2]]);l[u]=c<a?0:255}return l}}function j5e(e,t){for(var n=0;n<e.width*e.height;n++)e.data[4*n+3]=t[n]}function U5e(e,t,n){for(var r=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s<n;s++)for(var l=0;l<t;l++){for(var u=s*t+l,c=0,d=0;d<i;d++)for(var f=0;f<i;f++){var h=s+d-o,p=l+f-o;if(h>=0&&h<n&&p>=0&&p<t){var m=h*t+p,_=r[d*i+f];c+=e[m]*_}}a[u]=c===255*8?255:0}return a}function V5e(e,t,n){for(var r=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s<n;s++)for(var l=0;l<t;l++){for(var u=s*t+l,c=0,d=0;d<i;d++)for(var f=0;f<i;f++){var h=s+d-o,p=l+f-o;if(h>=0&&h<n&&p>=0&&p<t){var m=h*t+p,_=r[d*i+f];c+=e[m]*_}}a[u]=c>=255*4?255:0}return a}function G5e(e,t,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(r.length)),o=Math.floor(i/2),a=[],s=0;s<n;s++)for(var l=0;l<t;l++){for(var u=s*t+l,c=0,d=0;d<i;d++)for(var f=0;f<i;f++){var h=s+d-o,p=l+f-o;if(h>=0&&h<n&&p>=0&&p<t){var m=h*t+p,_=r[d*i+f];c+=e[m]*_}}a[u]=c}return a}const q5e=function(e){var t=this.threshold(),n=z5e(e,t);return n&&(n=U5e(n,e.width,e.height),n=V5e(n,e.width,e.height),n=G5e(n,e.width,e.height),j5e(e,n)),e};Bx.Mask=q5e;IO.Factory.addGetterSetter(L5e.Node,"threshold",0,(0,F5e.getNumberValidator)(),IO.Factory.afterSetFilter);var zx={};Object.defineProperty(zx,"__esModule",{value:!0});zx.Noise=void 0;const RO=At,H5e=ir,W5e=Xe,K5e=function(e){var t=this.noise()*255,n=e.data,r=n.length,i=t/2,o;for(o=0;o<r;o+=4)n[o+0]+=i-2*i*Math.random(),n[o+1]+=i-2*i*Math.random(),n[o+2]+=i-2*i*Math.random()};zx.Noise=K5e;RO.Factory.addGetterSetter(H5e.Node,"noise",.2,(0,W5e.getNumberValidator)(),RO.Factory.afterSetFilter);var jx={};Object.defineProperty(jx,"__esModule",{value:!0});jx.Pixelate=void 0;const OO=At,Q5e=fr,X5e=ir,Y5e=Xe,Z5e=function(e){var t=Math.ceil(this.pixelSize()),n=e.width,r=e.height,i,o,a,s,l,u,c,d=Math.ceil(n/t),f=Math.ceil(r/t),h,p,m,_,b,y,g,v=e.data;if(t<=0){Q5e.Util.error("pixelSize value can not be <= 0");return}for(b=0;b<d;b+=1)for(y=0;y<f;y+=1){for(s=0,l=0,u=0,c=0,h=b*t,p=h+t,m=y*t,_=m+t,g=0,i=h;i<p;i+=1)if(!(i>=n))for(o=m;o<_;o+=1)o>=r||(a=(n*o+i)*4,s+=v[a+0],l+=v[a+1],u+=v[a+2],c+=v[a+3],g+=1);for(s=s/g,l=l/g,u=u/g,c=c/g,i=h;i<p;i+=1)if(!(i>=n))for(o=m;o<_;o+=1)o>=r||(a=(n*o+i)*4,v[a+0]=s,v[a+1]=l,v[a+2]=u,v[a+3]=c)}};jx.Pixelate=Z5e;OO.Factory.addGetterSetter(X5e.Node,"pixelSize",8,(0,Y5e.getNumberValidator)(),OO.Factory.afterSetFilter);var Ux={};Object.defineProperty(Ux,"__esModule",{value:!0});Ux.Posterize=void 0;const MO=At,J5e=ir,e3e=Xe,t3e=function(e){var t=Math.round(this.levels()*254)+1,n=e.data,r=n.length,i=255/t,o;for(o=0;o<r;o+=1)n[o]=Math.floor(n[o]/i)*i};Ux.Posterize=t3e;MO.Factory.addGetterSetter(J5e.Node,"levels",.5,(0,e3e.getNumberValidator)(),MO.Factory.afterSetFilter);var Vx={};Object.defineProperty(Vx,"__esModule",{value:!0});Vx.RGB=void 0;const j_=At,NA=ir,n3e=Xe,r3e=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),a,s;for(a=0;a<n;a+=4)s=(.34*t[a]+.5*t[a+1]+.16*t[a+2])/255,t[a]=s*r,t[a+1]=s*i,t[a+2]=s*o,t[a+3]=t[a+3]};Vx.RGB=r3e;j_.Factory.addGetterSetter(NA.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});j_.Factory.addGetterSetter(NA.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});j_.Factory.addGetterSetter(NA.Node,"blue",0,n3e.RGBComponent,j_.Factory.afterSetFilter);var Gx={};Object.defineProperty(Gx,"__esModule",{value:!0});Gx.RGBA=void 0;const _0=At,qx=ir,i3e=Xe,o3e=function(e){var t=e.data,n=t.length,r=this.red(),i=this.green(),o=this.blue(),a=this.alpha(),s,l;for(s=0;s<n;s+=4)l=1-a,t[s]=r*a+t[s]*l,t[s+1]=i*a+t[s+1]*l,t[s+2]=o*a+t[s+2]*l};Gx.RGBA=o3e;_0.Factory.addGetterSetter(qx.Node,"red",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});_0.Factory.addGetterSetter(qx.Node,"green",0,function(e){return this._filterUpToDate=!1,e>255?255:e<0?0:Math.round(e)});_0.Factory.addGetterSetter(qx.Node,"blue",0,i3e.RGBComponent,_0.Factory.afterSetFilter);_0.Factory.addGetterSetter(qx.Node,"alpha",1,function(e){return this._filterUpToDate=!1,e>1?1:e<0?0:e});var Hx={};Object.defineProperty(Hx,"__esModule",{value:!0});Hx.Sepia=void 0;const a3e=function(e){var t=e.data,n=t.length,r,i,o,a;for(r=0;r<n;r+=4)i=t[r+0],o=t[r+1],a=t[r+2],t[r+0]=Math.min(255,i*.393+o*.769+a*.189),t[r+1]=Math.min(255,i*.349+o*.686+a*.168),t[r+2]=Math.min(255,i*.272+o*.534+a*.131)};Hx.Sepia=a3e;var Wx={};Object.defineProperty(Wx,"__esModule",{value:!0});Wx.Solarize=void 0;const s3e=function(e){var t=e.data,n=e.width,r=e.height,i=n*4,o=r;do{var a=(o-1)*i,s=n;do{var l=a+(s-1)*4,u=t[l],c=t[l+1],d=t[l+2];u>127&&(u=255-u),c>127&&(c=255-c),d>127&&(d=255-d),t[l]=u,t[l+1]=c,t[l+2]=d}while(--s)}while(--o)};Wx.Solarize=s3e;var Kx={};Object.defineProperty(Kx,"__esModule",{value:!0});Kx.Threshold=void 0;const NO=At,l3e=ir,u3e=Xe,c3e=function(e){var t=this.threshold()*255,n=e.data,r=n.length,i;for(i=0;i<r;i+=1)n[i]=n[i]<t?0:255};Kx.Threshold=c3e;NO.Factory.addGetterSetter(l3e.Node,"threshold",.5,(0,u3e.getNumberValidator)(),NO.Factory.afterSetFilter);Object.defineProperty(rx,"__esModule",{value:!0});rx.Konva=void 0;const $O=vG,d3e=ux,f3e=fx,h3e=gx,p3e=mx,g3e=yx,DO=rp,m3e=Ty,y3e=Ep,v3e=Ay,b3e=_x,_3e=Sx,S3e=xx,x3e=wx,w3e=Fd,C3e=Cx,E3e=Ex,T3e=Tx,k3e=Ax,A3e=Px,P3e=Ix,I3e=Rx,R3e=Mx,O3e=Nx,M3e=$x,N3e=Dx,$3e=Lx,D3e=Fx,L3e=Bx,F3e=zx,B3e=jx,z3e=Ux,j3e=Vx,U3e=Gx,V3e=Hx,G3e=Wx,q3e=Kx;rx.Konva=$O.Konva.Util._assign($O.Konva,{Arc:d3e.Arc,Arrow:f3e.Arrow,Circle:h3e.Circle,Ellipse:p3e.Ellipse,Image:g3e.Image,Label:DO.Label,Tag:DO.Tag,Line:m3e.Line,Path:y3e.Path,Rect:v3e.Rect,RegularPolygon:b3e.RegularPolygon,Ring:_3e.Ring,Sprite:S3e.Sprite,Star:x3e.Star,Text:w3e.Text,TextPath:C3e.TextPath,Transformer:E3e.Transformer,Wedge:T3e.Wedge,Filters:{Blur:k3e.Blur,Brighten:A3e.Brighten,Contrast:P3e.Contrast,Emboss:I3e.Emboss,Enhance:R3e.Enhance,Grayscale:O3e.Grayscale,HSL:M3e.HSL,HSV:N3e.HSV,Invert:$3e.Invert,Kaleidoscope:D3e.Kaleidoscope,Mask:L3e.Mask,Noise:F3e.Noise,Pixelate:B3e.Pixelate,Posterize:z3e.Posterize,RGB:j3e.RGB,RGBA:U3e.RGBA,Sepia:V3e.Sepia,Solarize:G3e.Solarize,Threshold:q3e.Threshold}});var H3e=_A.exports;Object.defineProperty(H3e,"__esModule",{value:!0});const W3e=rx;_A.exports=W3e.Konva;var K3e=_A.exports;const ig=mc(K3e),Q3e=async(e,t,n)=>{const{width:r,height:i}=t,o=document.createElement("div"),a=new ig.Stage({container:o,width:r,height:i}),s=new ig.Layer,l=new ig.Layer;return s.add(new ig.Rect({...t,fill:n?"black":"white"})),e.forEach(u=>l.add(new ig.Line({points:u.points,stroke:n?"white":"black",strokeWidth:u.strokeWidth*2,tension:0,lineCap:"round",lineJoin:"round",shadowForStrokeEnabled:!1,globalCompositeOperation:u.tool==="brush"?"source-over":"destination-out"}))),a.add(s),a.add(l),o.remove(),a},X3e=async(e,t,n)=>new Promise((r,i)=>{const o=document.createElement("canvas");o.width=t,o.height=n;const a=o.getContext("2d"),s=new Image;if(!a){o.remove(),i("Unable to get context");return}s.onload=function(){a.drawImage(s,0,0),o.remove(),r(a.getImageData(0,0,t,n))},s.src=e}),LO=async(e,t)=>{const n=e.toDataURL(t);return await X3e(n,t.width,t.height)},$A=async(e,t,n,r,i)=>{const o=_e("canvas"),a=tx(),s=Gxe();if(!a||!s){o.error("Unable to find canvas / stage");return}const l={...t,...n},u=a.clone();u.scale({x:1,y:1});const c=u.getAbsolutePosition(),d={x:l.x+c.x,y:l.y+c.y,width:l.width,height:l.height},f=await L_(u,d),h=await LO(u,d),p=await Q3e(r?e.objects.filter(TB):[],l,i),m=await L_(p,l),_=await LO(p,l);return{baseBlob:f,baseImageData:h,maskBlob:m,maskImageData:_}},Y3e=()=>{Fe({actionCreator:Lxe,effect:async(e,{dispatch:t,getState:n})=>{const r=_e("canvas"),i=n(),o=await $A(i.canvas.layerState,i.canvas.boundingBoxCoordinates,i.canvas.boundingBoxDimensions,i.canvas.isMaskEnabled,i.canvas.shouldPreserveMaskedArea);if(!o)return;const{maskBlob:a}=o;if(!a){r.error("Problem getting mask layer blob"),t(qt({title:Y("toast.problemSavingMask"),description:Y("toast.problemSavingMaskDesc"),status:"error"}));return}const{autoAddBoardId:s}=i.gallery;t(ve.endpoints.uploadImage.initiate({file:new File([a],"canvasMaskImage.png",{type:"image/png"}),image_category:"mask",is_intermediate:!1,board_id:s==="none"?void 0:s,crop_visible:!0,postUploadAction:{type:"TOAST",toastOptions:{title:Y("toast.maskSavedAssets")}}}))}})},Z3e=()=>{Fe({actionCreator:Uxe,effect:async(e,{dispatch:t,getState:n})=>{const r=_e("canvas"),i=n(),o=await $A(i.canvas.layerState,i.canvas.boundingBoxCoordinates,i.canvas.boundingBoxDimensions,i.canvas.isMaskEnabled,i.canvas.shouldPreserveMaskedArea);if(!o)return;const{maskBlob:a}=o;if(!a){r.error("Problem getting mask layer blob"),t(qt({title:Y("toast.problemImportingMask"),description:Y("toast.problemImportingMaskDesc"),status:"error"}));return}const{autoAddBoardId:s}=i.gallery,l=await t(ve.endpoints.uploadImage.initiate({file:new File([a],"canvasMaskImage.png",{type:"image/png"}),image_category:"mask",is_intermediate:!1,board_id:s==="none"?void 0:s,crop_visible:!1,postUploadAction:{type:"TOAST",toastOptions:{title:Y("toast.maskSentControlnetAssets")}}})).unwrap(),{image_name:u}=l;t(Cc({controlNetId:e.payload.controlNet.controlNetId,controlImage:u}))}})},J3e=async()=>{const e=tx();if(!e)return;const t=e.clone();return t.scale({x:1,y:1}),L_(t,t.getClientRect())},eEe=()=>{Fe({actionCreator:zxe,effect:async(e,{dispatch:t})=>{const n=x2.get().child({namespace:"canvasCopiedToClipboardListener"}),r=await J3e();if(!r){n.error("Problem getting base layer blob"),t(qt({title:Y("toast.problemMergingCanvas"),description:Y("toast.problemMergingCanvasDesc"),status:"error"}));return}const i=tx();if(!i){n.error("Problem getting canvas base layer"),t(qt({title:Y("toast.problemMergingCanvas"),description:Y("toast.problemMergingCanvasDesc"),status:"error"}));return}const o=i.getClientRect({relativeTo:i.getParent()}),a=await t(ve.endpoints.uploadImage.initiate({file:new File([r],"mergedCanvas.png",{type:"image/png"}),image_category:"general",is_intermediate:!0,postUploadAction:{type:"TOAST",toastOptions:{title:Y("toast.canvasMerged")}}})).unwrap(),{image_name:s}=a;t(dle({kind:"image",layer:"base",imageName:s,...o}))}})},tEe=()=>{Fe({actionCreator:Dxe,effect:async(e,{dispatch:t,getState:n})=>{const r=_e("canvas"),i=n();let o;try{o=await nx(i)}catch(s){r.error(String(s)),t(qt({title:Y("toast.problemSavingCanvas"),description:Y("toast.problemSavingCanvasDesc"),status:"error"}));return}const{autoAddBoardId:a}=i.gallery;t(ve.endpoints.uploadImage.initiate({file:new File([o],"savedCanvas.png",{type:"image/png"}),image_category:"general",is_intermediate:!1,board_id:a==="none"?void 0:a,crop_visible:!0,postUploadAction:{type:"TOAST",toastOptions:{title:Y("toast.canvasSavedGallery")}}}))}})},nEe=(e,t,n)=>{var c;if(!(m0e.match(e)||VR.match(e)||Cc.match(e)||y0e.match(e)||GR.match(e))||GR.match(e)&&((c=n.controlNet.controlNets[e.payload.controlNetId])==null?void 0:c.shouldAutoConfig)===!0)return!1;const i=t.controlNet.controlNets[e.payload.controlNetId];if(!i)return!1;const{controlImage:o,processorType:a,shouldAutoConfig:s}=i;return VR.match(e)&&!s?!1:a!=="none"&&!!o},rEe=()=>{Fe({predicate:nEe,effect:async(e,{dispatch:t,cancelActiveListeners:n,delay:r})=>{const i=_e("session"),{controlNetId:o}=e.payload;n(),i.trace("ControlNet auto-process triggered"),await r(300),t(Qk({controlNetId:o}))}})},Be="positive_conditioning",We="negative_conditioning",Oe="denoise_latents",Ke="latents_to_image",Ja="save_image",vd="nsfw_checker",Qc="invisible_watermark",Le="noise",Ic="main_model_loader",Qx="onnx_model_loader",bs="vae_loader",JG="lora_loader",Zt="clip_skip",Hn="image_to_latents",Ms="resize_image",bh="img2img_resize",me="canvas_output",Kn="inpaint_image",Ai="inpaint_image_resize_up",qi="inpaint_image_resize_down",Kt="inpaint_infill",Lu="inpaint_infill_resize_down",Wn="inpaint_create_mask",gt="canvas_coherence_denoise_latents",Vt="canvas_coherence_noise",dc="canvas_coherence_noise_increment",yr="canvas_coherence_mask_edge",jt="canvas_coherence_inpaint_create_mask",_h="tomask",Ui="mask_blur",Ti="mask_combine",Nn="mask_resize_up",Hi="mask_resize_down",qv="control_net_collect",iEe="ip_adapter",pt="metadata_accumulator",i5="esrgan",Vi="sdxl_model_loader",Te="sdxl_denoise_latents",Fc="sdxl_refiner_model_loader",Hv="sdxl_refiner_positive_conditioning",Wv="sdxl_refiner_negative_conditioning",_s="sdxl_refiner_denoise_latents",da="refiner_inpaint_create_mask",Wr="seamless",Xa="refiner_seamless",eq="text_to_image_graph",nT="image_to_image_graph",tq="canvas_text_to_image_graph",rT="canvas_image_to_image_graph",Xx="canvas_inpaint_graph",Yx="canvas_outpaint_graph",DA="sdxl_text_to_image_graph",U_="sxdl_image_to_image_graph",Zx="sdxl_canvas_text_to_image_graph",S0="sdxl_canvas_image_to_image_graph",fc="sdxl_canvas_inpaint_graph",hc="sdxl_canvas_outpaint_graph",nq=e=>(e==null?void 0:e.type)==="image_output",oEe=()=>{Fe({actionCreator:Qk,effect:async(e,{dispatch:t,getState:n,take:r})=>{var l;const i=_e("session"),{controlNetId:o}=e.payload,a=n().controlNet.controlNets[o];if(!(a!=null&&a.controlImage)){i.error("Unable to process ControlNet image");return}const s={nodes:{[a.processorNode.id]:{...a.processorNode,is_intermediate:!0,image:{image_name:a.controlImage}},[Ja]:{id:Ja,type:"save_image",is_intermediate:!0,use_cache:!1}},edges:[{source:{node_id:a.processorNode.id,field:"image"},destination:{node_id:Ja,field:"image"}}]};try{const u=t(Xr.endpoints.enqueueGraph.initiate({graph:s,prepend:!0},{fixedCacheKey:"enqueueGraph"})),c=await u.unwrap();u.reset(),i.debug({enqueueResult:Xt(c)},Y("queue.graphQueued"));const[d]=await r(f=>qk.match(f)&&f.payload.data.graph_execution_state_id===c.queue_item.session_id&&f.payload.data.source_node_id===Ja);if(nq(d.payload.data.result)){const{image_name:f}=d.payload.data.result.image,[{payload:h}]=await r(m=>ve.endpoints.getImageDTO.matchFulfilled(m)&&m.payload.image_name===f),p=h;i.debug({controlNetId:e.payload,processedControlImage:p},"ControlNet image processed"),t(Xk({controlNetId:o,processedControlImage:p.image_name}))}}catch(u){if(i.error({graph:Xt(s)},Y("queue.graphFailedToQueue")),u instanceof Object&&"data"in u&&"status"in u&&u.status===403){const c=((l=u.data)==null?void 0:l.detail)||"Unknown Error";t(qt({title:Y("queue.graphFailedToQueue"),status:"error",description:c,duration:15e3})),t(b0e()),t(Cc({controlNetId:o,controlImage:null}));return}t(qt({title:Y("queue.graphFailedToQueue"),status:"error"}))}}})},LA=Ne("app/enqueueRequested");Ne("app/batchEnqueued");const aEe=e=>{const t=window.open("");t&&e.forEach(n=>{const r=new Image;r.src=n.base64,t.document.write(n.caption),t.document.write("</br>"),t.document.write(r.outerHTML),t.document.write("</br></br>")})},FO=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=i=>t(r.result),r.onerror=i=>n(r.error),r.onabort=i=>n(new Error("Read aborted")),r.readAsDataURL(e)}),sEe=e=>{let t=!0,n=!1;const r=e.length;let i=3;for(i;i<r;i+=4)if(e[i]===255?t=!1:n=!0,!t&&n)return{isFullyTransparent:t,isPartiallyTransparent:n};return{isFullyTransparent:t,isPartiallyTransparent:n}},lEe=e=>{const t=e.length;let n=0;for(n;n<t;)if(e[n++]===0&&e[n++]===0&&e[n++]===0&&e[n++]===255)return!0;return!1},uEe=(e,t)=>{const{isPartiallyTransparent:n,isFullyTransparent:r}=sEe(e.data),i=lEe(t.data);return n?r?"txt2img":"outpaint":i?"inpaint":"img2img"},cEe=e=>Coe(e,n=>n.isEnabled&&(!!n.processedControlImage||n.processorType==="none"&&!!n.controlImage)),Pa=(e,t,n)=>{const{isEnabled:r,controlNets:i}=e.controlNet,o=cEe(i),a=t.nodes[pt];if(r&&o.length&&o.length){const s={id:qv,type:"collect",is_intermediate:!0};t.nodes[qv]=s,t.edges.push({source:{node_id:qv,field:"collection"},destination:{node_id:n,field:"control"}}),o.forEach(l=>{const{controlNetId:u,controlImage:c,processedControlImage:d,beginStepPct:f,endStepPct:h,controlMode:p,resizeMode:m,model:_,processorType:b,weight:y}=l,g={id:`control_net_${u}`,type:"controlnet",is_intermediate:!0,begin_step_percent:f,end_step_percent:h,control_mode:p,resize_mode:m,control_model:_,control_weight:y};if(d&&b!=="none")g.image={image_name:d};else if(c)g.image={image_name:c};else return;if(t.nodes[g.id]=g,a!=null&&a.controlnets){const v=KS(g,["id","type"]);a.controlnets.push(v)}t.edges.push({source:{node_id:g.id,field:"control"},destination:{node_id:qv,field:"item"}}),gt in t.nodes&&t.edges.push({source:{node_id:g.id,field:"control"},destination:{node_id:gt,field:"control"}})})}},Ia=(e,t,n)=>{var a,s,l,u;const{isIPAdapterEnabled:r,ipAdapterInfo:i}=e.controlNet,o=t.nodes[pt];if(r&&i.model){const c={id:iEe,type:"ip_adapter",is_intermediate:!0,weight:i.weight,ip_adapter_model:{base_model:(a=i.model)==null?void 0:a.base_model,model_name:(s=i.model)==null?void 0:s.model_name},begin_step_percent:i.beginStepPct,end_step_percent:i.endStepPct};if(i.adapterImage)c.image={image_name:i.adapterImage};else return;if(t.nodes[c.id]=c,o!=null&&o.ipAdapters){const d={image:{image_name:i.adapterImage},ip_adapter_model:{base_model:(l=i.model)==null?void 0:l.base_model,model_name:(u=i.model)==null?void 0:u.model_name},weight:i.weight,begin_step_percent:i.beginStepPct,end_step_percent:i.endStepPct};o.ipAdapters.push(d)}t.edges.push({source:{node_id:c.id,field:"ip_adapter"},destination:{node_id:n,field:"ip_adapter"}}),gt in t.nodes&&t.edges.push({source:{node_id:c.id,field:"ip_adapter"},destination:{node_id:gt,field:"ip_adapter"}})}},kp=(e,t,n,r=Ic)=>{const{loras:i}=e.lora,o=QS(i),a=t.nodes[pt];o>0&&(t.edges=t.edges.filter(u=>!(u.source.node_id===r&&["unet"].includes(u.source.field))),t.edges=t.edges.filter(u=>!(u.source.node_id===Zt&&["clip"].includes(u.source.field))));let s="",l=0;Ea(i,u=>{const{model_name:c,base_model:d,weight:f}=u,h=`${JG}_${c.replace(".","_")}`,p={type:"lora_loader",id:h,is_intermediate:!0,lora:{model_name:c,base_model:d},weight:f};a!=null&&a.loras&&a.loras.push({lora:{model_name:c,base_model:d},weight:f}),t.nodes[h]=p,l===0?(t.edges.push({source:{node_id:r,field:"unet"},destination:{node_id:h,field:"unet"}}),t.edges.push({source:{node_id:Zt,field:"clip"},destination:{node_id:h,field:"clip"}})):(t.edges.push({source:{node_id:s,field:"unet"},destination:{node_id:h,field:"unet"}}),t.edges.push({source:{node_id:s,field:"clip"},destination:{node_id:h,field:"clip"}})),l===o-1&&(t.edges.push({source:{node_id:h,field:"unet"},destination:{node_id:n,field:"unet"}}),t.id&&[Xx,Yx].includes(t.id)&&t.edges.push({source:{node_id:h,field:"unet"},destination:{node_id:gt,field:"unet"}}),t.edges.push({source:{node_id:h,field:"clip"},destination:{node_id:Be,field:"clip"}}),t.edges.push({source:{node_id:h,field:"clip"},destination:{node_id:We,field:"clip"}})),s=h,l+=1})},Ra=(e,t,n=Ke)=>{const r=t.nodes[n];if(!r)return;r.is_intermediate=!0,r.use_cache=!0;const i={id:vd,type:"img_nsfw",is_intermediate:!0};t.nodes[vd]=i,t.edges.push({source:{node_id:n,field:"image"},destination:{node_id:vd,field:"image"}})},dEe=["txt2img","img2img","unifiedCanvas","nodes","modelManager","queue"],FA=Ii(e=>e,({ui:e})=>hk(e.activeTab)?e.activeTab:"txt2img"),fKe=Ii(e=>e,({ui:e,config:t})=>{const r=dEe.filter(i=>!t.disabledTabs.includes(i)).indexOf(e.activeTab);return r===-1?0:r}),hKe=Ii(e=>e.ui,e=>e,{memoizeOptions:{equalityCheck:pk}}),Oa=(e,t)=>{const r=FA(e)==="unifiedCanvas"?!e.canvas.shouldAutoSave:!1,{autoAddBoardId:i}=e.gallery,o={id:Ja,type:"save_image",is_intermediate:r,use_cache:!1,board:i==="none"?void 0:{board_id:i}};t.nodes[Ja]=o,t.nodes[pt]&&t.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:Ja,field:"metadata"}});const s={node_id:Ja,field:"image"};Qc in t.nodes?t.edges.push({source:{node_id:Qc,field:"image"},destination:s}):vd in t.nodes?t.edges.push({source:{node_id:vd,field:"image"},destination:s}):me in t.nodes?t.edges.push({source:{node_id:me,field:"image"},destination:s}):Ke in t.nodes&&t.edges.push({source:{node_id:Ke,field:"image"},destination:s})},Ma=(e,t,n)=>{const{seamlessXAxis:r,seamlessYAxis:i}=e.generation;t.nodes[Wr]={id:Wr,type:"seamless",seamless_x:r,seamless_y:i};let o=Oe;(t.id===DA||t.id===U_||t.id===Zx||t.id===S0||t.id===fc||t.id===hc)&&(o=Te),t.edges=t.edges.filter(a=>!(a.source.node_id===n&&["unet"].includes(a.source.field))&&!(a.source.node_id===n&&["vae"].includes(a.source.field))),t.edges.push({source:{node_id:n,field:"unet"},destination:{node_id:Wr,field:"unet"}},{source:{node_id:n,field:"vae"},destination:{node_id:Wr,field:"vae"}},{source:{node_id:Wr,field:"unet"},destination:{node_id:o,field:"unet"}}),(t.id==Xx||t.id===Yx||t.id===fc||t.id===hc)&&t.edges.push({source:{node_id:Wr,field:"unet"},destination:{node_id:gt,field:"unet"}})},Na=(e,t,n=Ic)=>{const{vae:r,canvasCoherenceMode:i}=e.generation,{boundingBoxScaleMethod:o}=e.canvas,{shouldUseSDXLRefiner:a}=e.sdxl,s=["auto","manual"].includes(o),l=!r,u=t.nodes[pt];l||(t.nodes[bs]={type:"vae_loader",id:bs,is_intermediate:!0,vae_model:r});const c=n==Qx;(t.id===eq||t.id===nT||t.id===DA||t.id===U_)&&t.edges.push({source:{node_id:l?n:bs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Ke,field:"vae"}}),(t.id===tq||t.id===rT||t.id===Zx||t.id==S0)&&t.edges.push({source:{node_id:l?n:bs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:s?Ke:me,field:"vae"}}),(t.id===nT||t.id===U_||t.id===rT||t.id===S0)&&t.edges.push({source:{node_id:l?n:bs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Hn,field:"vae"}}),(t.id===Xx||t.id===Yx||t.id===fc||t.id===hc)&&(t.edges.push({source:{node_id:l?n:bs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Kn,field:"vae"}},{source:{node_id:l?n:bs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Wn,field:"vae"}},{source:{node_id:l?n:bs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:Ke,field:"vae"}}),i!=="unmasked"&&t.edges.push({source:{node_id:l?n:bs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:jt,field:"vae"}})),a&&(t.id===fc||t.id===hc)&&t.edges.push({source:{node_id:l?n:bs,field:l&&c?"vae_decoder":"vae"},destination:{node_id:da,field:"vae"}}),r&&u&&(u.vae=r)},$a=(e,t,n=Ke)=>{const i=FA(e)==="unifiedCanvas"?!e.canvas.shouldAutoSave:!1,o=t.nodes[n],a=t.nodes[vd],s=t.nodes[pt];if(!o)return;const l={id:Qc,type:"img_watermark",is_intermediate:i};t.nodes[Qc]=l,o.is_intermediate=!0,o.use_cache=!0,a?(a.is_intermediate=!0,t.edges.push({source:{node_id:vd,field:"image"},destination:{node_id:Qc,field:"image"}})):t.edges.push({source:{node_id:n,field:"image"},destination:{node_id:Qc,field:"image"}}),s&&t.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:Qc,field:"metadata"}})},fEe=(e,t)=>{const n=_e("nodes"),{positivePrompt:r,negativePrompt:i,model:o,cfgScale:a,scheduler:s,seed:l,steps:u,img2imgStrength:c,vaePrecision:d,clipSkip:f,shouldUseCpuNoise:h,seamlessXAxis:p,seamlessYAxis:m}=e.generation,{width:_,height:b}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:y,boundingBoxScaleMethod:g}=e.canvas,v=d==="fp32",S=!0,w=["auto","manual"].includes(g);if(!o)throw n.error("No model found in state"),new Error("No model found in state");let x=Ic;const C=h,k={id:rT,nodes:{[x]:{type:"main_model_loader",id:x,is_intermediate:S,model:o},[Zt]:{type:"clip_skip",id:Zt,is_intermediate:S,skipped_layers:f},[Be]:{type:"compel",id:Be,is_intermediate:S,prompt:r},[We]:{type:"compel",id:We,is_intermediate:S,prompt:i},[Le]:{type:"noise",id:Le,is_intermediate:S,use_cpu:C,seed:l,width:w?y.width:_,height:w?y.height:b},[Hn]:{type:"i2l",id:Hn,is_intermediate:S},[Oe]:{type:"denoise_latents",id:Oe,is_intermediate:S,cfg_scale:a,scheduler:s,steps:u,denoising_start:1-c,denoising_end:1},[me]:{type:"l2i",id:me,is_intermediate:S}},edges:[{source:{node_id:x,field:"unet"},destination:{node_id:Oe,field:"unet"}},{source:{node_id:x,field:"clip"},destination:{node_id:Zt,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Oe,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Oe,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Oe,field:"noise"}},{source:{node_id:Hn,field:"latents"},destination:{node_id:Oe,field:"latents"}}]};return w?(k.nodes[bh]={id:bh,type:"img_resize",is_intermediate:S,image:t,width:y.width,height:y.height},k.nodes[Ke]={id:Ke,type:"l2i",is_intermediate:S,fp32:v},k.nodes[me]={id:me,type:"img_resize",is_intermediate:S,width:_,height:b},k.edges.push({source:{node_id:bh,field:"image"},destination:{node_id:Hn,field:"image"}},{source:{node_id:Oe,field:"latents"},destination:{node_id:Ke,field:"latents"}},{source:{node_id:Ke,field:"image"},destination:{node_id:me,field:"image"}})):(k.nodes[me]={type:"l2i",id:me,is_intermediate:S,fp32:v},k.nodes[Hn].image=t,k.edges.push({source:{node_id:Oe,field:"latents"},destination:{node_id:me,field:"latents"}})),k.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"img2img",cfg_scale:a,width:w?y.width:_,height:w?y.height:b,positive_prompt:r,negative_prompt:i,model:o,seed:l,steps:u,rand_device:C?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],ipAdapters:[],clip_skip:f,strength:c,init_image:t.image_name},(p||m)&&(Ma(e,k,x),x=Wr),kp(e,k,Oe),Na(e,k,x),Pa(e,k,Oe),Ia(e,k,Oe),e.system.shouldUseNSFWChecker&&Ra(e,k,me),e.system.shouldUseWatermarker&&$a(e,k,me),Oa(e,k),k},hEe=(e,t,n)=>{const r=_e("nodes"),{positivePrompt:i,negativePrompt:o,model:a,cfgScale:s,scheduler:l,steps:u,img2imgStrength:c,seed:d,vaePrecision:f,shouldUseCpuNoise:h,maskBlur:p,maskBlurMethod:m,canvasCoherenceMode:_,canvasCoherenceSteps:b,canvasCoherenceStrength:y,clipSkip:g,seamlessXAxis:v,seamlessYAxis:S}=e.generation;if(!a)throw r.error("No Image found in state"),new Error("No Image found in state");const{width:w,height:x}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:C,boundingBoxScaleMethod:k}=e.canvas,T=!0,P=f==="fp32",$=["auto","manual"].includes(k);let O=Ic;const E=h,A={id:Xx,nodes:{[O]:{type:"main_model_loader",id:O,is_intermediate:T,model:a},[Zt]:{type:"clip_skip",id:Zt,is_intermediate:T,skipped_layers:g},[Be]:{type:"compel",id:Be,is_intermediate:T,prompt:i},[We]:{type:"compel",id:We,is_intermediate:T,prompt:o},[Ui]:{type:"img_blur",id:Ui,is_intermediate:T,radius:p,blur_type:m},[Kn]:{type:"i2l",id:Kn,is_intermediate:T,fp32:P},[Le]:{type:"noise",id:Le,use_cpu:E,seed:d,is_intermediate:T},[Wn]:{type:"create_denoise_mask",id:Wn,is_intermediate:T,fp32:P},[Oe]:{type:"denoise_latents",id:Oe,is_intermediate:T,steps:u,cfg_scale:s,scheduler:l,denoising_start:1-c,denoising_end:1},[Vt]:{type:"noise",id:Vt,use_cpu:E,seed:d+1,is_intermediate:T},[dc]:{type:"add",id:dc,b:1,is_intermediate:T},[gt]:{type:"denoise_latents",id:gt,is_intermediate:T,steps:b,cfg_scale:s,scheduler:l,denoising_start:1-y,denoising_end:1},[Ke]:{type:"l2i",id:Ke,is_intermediate:T,fp32:P},[me]:{type:"color_correct",id:me,is_intermediate:T,reference:t}},edges:[{source:{node_id:O,field:"unet"},destination:{node_id:Oe,field:"unet"}},{source:{node_id:O,field:"clip"},destination:{node_id:Zt,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Oe,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Oe,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Oe,field:"noise"}},{source:{node_id:Kn,field:"latents"},destination:{node_id:Oe,field:"latents"}},{source:{node_id:Ui,field:"image"},destination:{node_id:Wn,field:"mask"}},{source:{node_id:Wn,field:"denoise_mask"},destination:{node_id:Oe,field:"denoise_mask"}},{source:{node_id:O,field:"unet"},destination:{node_id:gt,field:"unet"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:gt,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:gt,field:"negative_conditioning"}},{source:{node_id:Vt,field:"noise"},destination:{node_id:gt,field:"noise"}},{source:{node_id:Oe,field:"latents"},destination:{node_id:gt,field:"latents"}},{source:{node_id:gt,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};if($){const D=C.width,L=C.height;A.nodes[Ai]={type:"img_resize",id:Ai,is_intermediate:T,width:D,height:L,image:t},A.nodes[Nn]={type:"img_resize",id:Nn,is_intermediate:T,width:D,height:L,image:n},A.nodes[qi]={type:"img_resize",id:qi,is_intermediate:T,width:w,height:x},A.nodes[Hi]={type:"img_resize",id:Hi,is_intermediate:T,width:w,height:x},A.nodes[Le].width=D,A.nodes[Le].height=L,A.nodes[Vt].width=D,A.nodes[Vt].height=L,A.edges.push({source:{node_id:Ai,field:"image"},destination:{node_id:Kn,field:"image"}},{source:{node_id:Nn,field:"image"},destination:{node_id:Ui,field:"image"}},{source:{node_id:Ai,field:"image"},destination:{node_id:Wn,field:"image"}},{source:{node_id:Ke,field:"image"},destination:{node_id:qi,field:"image"}},{source:{node_id:qi,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Ui,field:"image"},destination:{node_id:Hi,field:"image"}},{source:{node_id:Hi,field:"image"},destination:{node_id:me,field:"mask"}})}else A.nodes[Le].width=w,A.nodes[Le].height=x,A.nodes[Vt].width=w,A.nodes[Vt].height=x,A.nodes[Kn]={...A.nodes[Kn],image:t},A.nodes[Ui]={...A.nodes[Ui],image:n},A.nodes[Wn]={...A.nodes[Wn],image:t},A.edges.push({source:{node_id:Ke,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Ui,field:"image"},destination:{node_id:me,field:"mask"}});return _!=="unmasked"&&(A.nodes[jt]={type:"create_denoise_mask",id:jt,is_intermediate:T,fp32:P},$?A.edges.push({source:{node_id:Ai,field:"image"},destination:{node_id:jt,field:"image"}}):A.nodes[jt]={...A.nodes[jt],image:t},_==="mask"&&($?A.edges.push({source:{node_id:Nn,field:"image"},destination:{node_id:jt,field:"mask"}}):A.nodes[jt]={...A.nodes[jt],mask:n}),_==="edge"&&(A.nodes[yr]={type:"mask_edge",id:yr,is_intermediate:T,edge_blur:p,edge_size:p*2,low_threshold:100,high_threshold:200},$?A.edges.push({source:{node_id:Nn,field:"image"},destination:{node_id:yr,field:"image"}}):A.nodes[yr]={...A.nodes[yr],image:n},A.edges.push({source:{node_id:yr,field:"image"},destination:{node_id:jt,field:"mask"}})),A.edges.push({source:{node_id:jt,field:"denoise_mask"},destination:{node_id:gt,field:"denoise_mask"}})),(v||S)&&(Ma(e,A,O),O=Wr),Na(e,A,O),kp(e,A,Oe,O),Pa(e,A,Oe),Ia(e,A,Oe),e.system.shouldUseNSFWChecker&&Ra(e,A,me),e.system.shouldUseWatermarker&&$a(e,A,me),Oa(e,A),A},pEe=(e,t,n)=>{const r=_e("nodes"),{positivePrompt:i,negativePrompt:o,model:a,cfgScale:s,scheduler:l,steps:u,img2imgStrength:c,seed:d,vaePrecision:f,shouldUseCpuNoise:h,maskBlur:p,canvasCoherenceMode:m,canvasCoherenceSteps:_,canvasCoherenceStrength:b,infillTileSize:y,infillPatchmatchDownscaleSize:g,infillMethod:v,clipSkip:S,seamlessXAxis:w,seamlessYAxis:x}=e.generation;if(!a)throw r.error("No model found in state"),new Error("No model found in state");const{width:C,height:k}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:T,boundingBoxScaleMethod:P}=e.canvas,$=f==="fp32",O=!0,E=["auto","manual"].includes(P);let A=Ic;const D=h,L={id:Yx,nodes:{[A]:{type:"main_model_loader",id:A,is_intermediate:O,model:a},[Zt]:{type:"clip_skip",id:Zt,is_intermediate:O,skipped_layers:S},[Be]:{type:"compel",id:Be,is_intermediate:O,prompt:i},[We]:{type:"compel",id:We,is_intermediate:O,prompt:o},[_h]:{type:"tomask",id:_h,is_intermediate:O,image:t},[Ti]:{type:"mask_combine",id:Ti,is_intermediate:O,mask2:n},[Kn]:{type:"i2l",id:Kn,is_intermediate:O,fp32:$},[Le]:{type:"noise",id:Le,use_cpu:D,seed:d,is_intermediate:O},[Wn]:{type:"create_denoise_mask",id:Wn,is_intermediate:O,fp32:$},[Oe]:{type:"denoise_latents",id:Oe,is_intermediate:O,steps:u,cfg_scale:s,scheduler:l,denoising_start:1-c,denoising_end:1},[Vt]:{type:"noise",id:Vt,use_cpu:D,seed:d+1,is_intermediate:O},[dc]:{type:"add",id:dc,b:1,is_intermediate:O},[gt]:{type:"denoise_latents",id:gt,is_intermediate:O,steps:_,cfg_scale:s,scheduler:l,denoising_start:1-b,denoising_end:1},[Ke]:{type:"l2i",id:Ke,is_intermediate:O,fp32:$},[me]:{type:"color_correct",id:me,is_intermediate:O}},edges:[{source:{node_id:A,field:"unet"},destination:{node_id:Oe,field:"unet"}},{source:{node_id:A,field:"clip"},destination:{node_id:Zt,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Kt,field:"image"},destination:{node_id:Kn,field:"image"}},{source:{node_id:_h,field:"image"},destination:{node_id:Ti,field:"mask1"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Oe,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Oe,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Oe,field:"noise"}},{source:{node_id:Kn,field:"latents"},destination:{node_id:Oe,field:"latents"}},{source:{node_id:E?Nn:Ti,field:"image"},destination:{node_id:Wn,field:"mask"}},{source:{node_id:Wn,field:"denoise_mask"},destination:{node_id:Oe,field:"denoise_mask"}},{source:{node_id:A,field:"unet"},destination:{node_id:gt,field:"unet"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:gt,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:gt,field:"negative_conditioning"}},{source:{node_id:Vt,field:"noise"},destination:{node_id:gt,field:"noise"}},{source:{node_id:Oe,field:"latents"},destination:{node_id:gt,field:"latents"}},{source:{node_id:Kt,field:"image"},destination:{node_id:Wn,field:"image"}},{source:{node_id:gt,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};if(v==="patchmatch"&&(L.nodes[Kt]={type:"infill_patchmatch",id:Kt,is_intermediate:O,downscale:g}),v==="lama"&&(L.nodes[Kt]={type:"infill_lama",id:Kt,is_intermediate:O}),v==="cv2"&&(L.nodes[Kt]={type:"infill_cv2",id:Kt,is_intermediate:O}),v==="tile"&&(L.nodes[Kt]={type:"infill_tile",id:Kt,is_intermediate:O,tile_size:y}),E){const M=T.width,R=T.height;L.nodes[Ai]={type:"img_resize",id:Ai,is_intermediate:O,width:M,height:R,image:t},L.nodes[Nn]={type:"img_resize",id:Nn,is_intermediate:O,width:M,height:R},L.nodes[qi]={type:"img_resize",id:qi,is_intermediate:O,width:C,height:k},L.nodes[Lu]={type:"img_resize",id:Lu,is_intermediate:O,width:C,height:k},L.nodes[Hi]={type:"img_resize",id:Hi,is_intermediate:O,width:C,height:k},L.nodes[Le].width=M,L.nodes[Le].height=R,L.nodes[Vt].width=M,L.nodes[Vt].height=R,L.edges.push({source:{node_id:Ai,field:"image"},destination:{node_id:Kt,field:"image"}},{source:{node_id:Ti,field:"image"},destination:{node_id:Nn,field:"image"}},{source:{node_id:Ke,field:"image"},destination:{node_id:qi,field:"image"}},{source:{node_id:Nn,field:"image"},destination:{node_id:Hi,field:"image"}},{source:{node_id:Kt,field:"image"},destination:{node_id:Lu,field:"image"}},{source:{node_id:Lu,field:"image"},destination:{node_id:me,field:"reference"}},{source:{node_id:qi,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Hi,field:"image"},destination:{node_id:me,field:"mask"}})}else L.nodes[Kt]={...L.nodes[Kt],image:t},L.nodes[Le].width=C,L.nodes[Le].height=k,L.nodes[Vt].width=C,L.nodes[Vt].height=k,L.nodes[Kn]={...L.nodes[Kn],image:t},L.edges.push({source:{node_id:Kt,field:"image"},destination:{node_id:me,field:"reference"}},{source:{node_id:Ke,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Ti,field:"image"},destination:{node_id:me,field:"mask"}});return m!=="unmasked"&&(L.nodes[jt]={type:"create_denoise_mask",id:jt,is_intermediate:O,fp32:$},L.edges.push({source:{node_id:Kt,field:"image"},destination:{node_id:jt,field:"image"}}),m==="mask"&&(E?L.edges.push({source:{node_id:Nn,field:"image"},destination:{node_id:jt,field:"mask"}}):L.edges.push({source:{node_id:Ti,field:"image"},destination:{node_id:jt,field:"mask"}})),m==="edge"&&(L.nodes[yr]={type:"mask_edge",id:yr,is_intermediate:O,edge_blur:p,edge_size:p*2,low_threshold:100,high_threshold:200},E?L.edges.push({source:{node_id:Nn,field:"image"},destination:{node_id:yr,field:"image"}}):L.edges.push({source:{node_id:Ti,field:"image"},destination:{node_id:yr,field:"image"}}),L.edges.push({source:{node_id:yr,field:"image"},destination:{node_id:jt,field:"mask"}})),L.edges.push({source:{node_id:jt,field:"denoise_mask"},destination:{node_id:gt,field:"denoise_mask"}})),(w||x)&&(Ma(e,L,A),A=Wr),Na(e,L,A),kp(e,L,Oe,A),Pa(e,L,Oe),Ia(e,L,Oe),e.system.shouldUseNSFWChecker&&Ra(e,L,me),e.system.shouldUseWatermarker&&$a(e,L,me),Oa(e,L),L},Ap=(e,t,n,r=Vi)=>{const{loras:i}=e.lora,o=QS(i),a=t.nodes[pt],s=r;let l=r;[Wr,da].includes(r)&&(l=Vi),o>0&&(t.edges=t.edges.filter(d=>!(d.source.node_id===s&&["unet"].includes(d.source.field))&&!(d.source.node_id===l&&["clip"].includes(d.source.field))&&!(d.source.node_id===l&&["clip2"].includes(d.source.field))));let u="",c=0;Ea(i,d=>{const{model_name:f,base_model:h,weight:p}=d,m=`${JG}_${f.replace(".","_")}`,_={type:"sdxl_lora_loader",id:m,is_intermediate:!0,lora:{model_name:f,base_model:h},weight:p};a&&(a.loras||(a.loras=[]),a.loras.push({lora:{model_name:f,base_model:h},weight:p})),t.nodes[m]=_,c===0?(t.edges.push({source:{node_id:s,field:"unet"},destination:{node_id:m,field:"unet"}}),t.edges.push({source:{node_id:l,field:"clip"},destination:{node_id:m,field:"clip"}}),t.edges.push({source:{node_id:l,field:"clip2"},destination:{node_id:m,field:"clip2"}})):(t.edges.push({source:{node_id:u,field:"unet"},destination:{node_id:m,field:"unet"}}),t.edges.push({source:{node_id:u,field:"clip"},destination:{node_id:m,field:"clip"}}),t.edges.push({source:{node_id:u,field:"clip2"},destination:{node_id:m,field:"clip2"}})),c===o-1&&(t.edges.push({source:{node_id:m,field:"unet"},destination:{node_id:n,field:"unet"}}),t.id&&[fc,hc].includes(t.id)&&t.edges.push({source:{node_id:m,field:"unet"},destination:{node_id:gt,field:"unet"}}),t.edges.push({source:{node_id:m,field:"clip"},destination:{node_id:Be,field:"clip"}}),t.edges.push({source:{node_id:m,field:"clip"},destination:{node_id:We,field:"clip"}}),t.edges.push({source:{node_id:m,field:"clip2"},destination:{node_id:Be,field:"clip2"}}),t.edges.push({source:{node_id:m,field:"clip2"},destination:{node_id:We,field:"clip2"}})),u=m,c+=1})},Zd=(e,t)=>{const{positivePrompt:n,negativePrompt:r}=e.generation,{positiveStylePrompt:i,negativeStylePrompt:o,shouldConcatSDXLStylePrompt:a}=e.sdxl,s=a||t?[n,i].join(" "):i,l=a||t?[r,o].join(" "):o;return{joinedPositiveStylePrompt:s,joinedNegativeStylePrompt:l}},Pp=(e,t,n,r,i,o)=>{const{refinerModel:a,refinerPositiveAestheticScore:s,refinerNegativeAestheticScore:l,refinerSteps:u,refinerScheduler:c,refinerCFGScale:d,refinerStart:f}=e.sdxl,{seamlessXAxis:h,seamlessYAxis:p,vaePrecision:m}=e.generation,{boundingBoxScaleMethod:_}=e.canvas,b=m==="fp32",y=["auto","manual"].includes(_);if(!a)return;const g=t.nodes[pt];g&&(g.refiner_model=a,g.refiner_positive_aesthetic_score=s,g.refiner_negative_aesthetic_score=l,g.refiner_cfg_scale=d,g.refiner_scheduler=c,g.refiner_start=f,g.refiner_steps=u);const v=r||Vi,{joinedPositiveStylePrompt:S,joinedNegativeStylePrompt:w}=Zd(e,!0);t.edges=t.edges.filter(x=>!(x.source.node_id===n&&["latents"].includes(x.source.field))),t.edges=t.edges.filter(x=>!(x.source.node_id===v&&["vae"].includes(x.source.field))),t.nodes[Fc]={type:"sdxl_refiner_model_loader",id:Fc,model:a},t.nodes[Hv]={type:"sdxl_refiner_compel_prompt",id:Hv,style:S,aesthetic_score:s},t.nodes[Wv]={type:"sdxl_refiner_compel_prompt",id:Wv,style:w,aesthetic_score:l},t.nodes[_s]={type:"denoise_latents",id:_s,cfg_scale:d,steps:u,scheduler:c,denoising_start:f,denoising_end:1},h||p?(t.nodes[Xa]={id:Xa,type:"seamless",seamless_x:h,seamless_y:p},t.edges.push({source:{node_id:Fc,field:"unet"},destination:{node_id:Xa,field:"unet"}},{source:{node_id:Fc,field:"vae"},destination:{node_id:Xa,field:"vae"}},{source:{node_id:Xa,field:"unet"},destination:{node_id:_s,field:"unet"}})):t.edges.push({source:{node_id:Fc,field:"unet"},destination:{node_id:_s,field:"unet"}}),t.edges.push({source:{node_id:Fc,field:"clip2"},destination:{node_id:Hv,field:"clip2"}},{source:{node_id:Fc,field:"clip2"},destination:{node_id:Wv,field:"clip2"}},{source:{node_id:Hv,field:"conditioning"},destination:{node_id:_s,field:"positive_conditioning"}},{source:{node_id:Wv,field:"conditioning"},destination:{node_id:_s,field:"negative_conditioning"}},{source:{node_id:n,field:"latents"},destination:{node_id:_s,field:"latents"}}),(t.id===fc||t.id===hc)&&(t.nodes[da]={type:"create_denoise_mask",id:da,is_intermediate:!0,fp32:b},y?t.edges.push({source:{node_id:Ai,field:"image"},destination:{node_id:da,field:"image"}}):t.nodes[da]={...t.nodes[da],image:i},t.id===fc&&(y?t.edges.push({source:{node_id:Nn,field:"image"},destination:{node_id:da,field:"mask"}}):t.nodes[da]={...t.nodes[da],mask:o}),t.id===hc&&t.edges.push({source:{node_id:y?Nn:Ti,field:"image"},destination:{node_id:da,field:"mask"}}),t.edges.push({source:{node_id:da,field:"denoise_mask"},destination:{node_id:_s,field:"denoise_mask"}})),t.id===Zx||t.id===S0?t.edges.push({source:{node_id:_s,field:"latents"},destination:{node_id:y?Ke:me,field:"latents"}}):t.edges.push({source:{node_id:_s,field:"latents"},destination:{node_id:Ke,field:"latents"}})},gEe=(e,t)=>{const n=_e("nodes"),{positivePrompt:r,negativePrompt:i,model:o,cfgScale:a,scheduler:s,seed:l,steps:u,vaePrecision:c,shouldUseCpuNoise:d,seamlessXAxis:f,seamlessYAxis:h}=e.generation,{shouldUseSDXLRefiner:p,refinerStart:m,sdxlImg2ImgDenoisingStrength:_}=e.sdxl,{width:b,height:y}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:g,boundingBoxScaleMethod:v}=e.canvas,S=c==="fp32",w=!0,x=["auto","manual"].includes(v);if(!o)throw n.error("No model found in state"),new Error("No model found in state");let C=Vi;const k=d,{joinedPositiveStylePrompt:T,joinedNegativeStylePrompt:P}=Zd(e),$={id:S0,nodes:{[C]:{type:"sdxl_model_loader",id:C,model:o},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:r,style:T},[We]:{type:"sdxl_compel_prompt",id:We,prompt:i,style:P},[Le]:{type:"noise",id:Le,is_intermediate:w,use_cpu:k,seed:l,width:x?g.width:b,height:x?g.height:y},[Hn]:{type:"i2l",id:Hn,is_intermediate:w,fp32:S},[Te]:{type:"denoise_latents",id:Te,is_intermediate:w,cfg_scale:a,scheduler:s,steps:u,denoising_start:p?Math.min(m,1-_):1-_,denoising_end:p?m:1}},edges:[{source:{node_id:C,field:"unet"},destination:{node_id:Te,field:"unet"}},{source:{node_id:C,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:C,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:We,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Te,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Te,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Te,field:"noise"}},{source:{node_id:Hn,field:"latents"},destination:{node_id:Te,field:"latents"}}]};return x?($.nodes[bh]={id:bh,type:"img_resize",is_intermediate:w,image:t,width:g.width,height:g.height},$.nodes[Ke]={id:Ke,type:"l2i",is_intermediate:w,fp32:S},$.nodes[me]={id:me,type:"img_resize",is_intermediate:w,width:b,height:y},$.edges.push({source:{node_id:bh,field:"image"},destination:{node_id:Hn,field:"image"}},{source:{node_id:Te,field:"latents"},destination:{node_id:Ke,field:"latents"}},{source:{node_id:Ke,field:"image"},destination:{node_id:me,field:"image"}})):($.nodes[me]={type:"l2i",id:me,is_intermediate:w,fp32:S},$.nodes[Hn].image=t,$.edges.push({source:{node_id:Te,field:"latents"},destination:{node_id:me,field:"latents"}})),$.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"img2img",cfg_scale:a,width:x?g.width:b,height:x?g.height:y,positive_prompt:r,negative_prompt:i,model:o,seed:l,steps:u,rand_device:k?"cpu":"cuda",scheduler:s,vae:void 0,controlnets:[],loras:[],ipAdapters:[],strength:_,init_image:t.image_name},$.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:me,field:"metadata"}}),(f||h)&&(Ma(e,$,C),C=Wr),p&&(Pp(e,$,Te,C),(f||h)&&(C=Xa)),Na(e,$,C),Ap(e,$,Te,C),Pa(e,$,Te),Ia(e,$,Te),e.system.shouldUseNSFWChecker&&Ra(e,$,me),e.system.shouldUseWatermarker&&$a(e,$,me),Oa(e,$),$},mEe=(e,t,n)=>{const r=_e("nodes"),{positivePrompt:i,negativePrompt:o,model:a,cfgScale:s,scheduler:l,steps:u,seed:c,vaePrecision:d,shouldUseCpuNoise:f,maskBlur:h,maskBlurMethod:p,canvasCoherenceMode:m,canvasCoherenceSteps:_,canvasCoherenceStrength:b,seamlessXAxis:y,seamlessYAxis:g}=e.generation,{sdxlImg2ImgDenoisingStrength:v,shouldUseSDXLRefiner:S,refinerStart:w}=e.sdxl;if(!a)throw r.error("No model found in state"),new Error("No model found in state");const{width:x,height:C}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:k,boundingBoxScaleMethod:T}=e.canvas,P=d==="fp32",$=!0,O=["auto","manual"].includes(T);let E=Vi;const A=f,{joinedPositiveStylePrompt:D,joinedNegativeStylePrompt:L}=Zd(e),M={id:fc,nodes:{[E]:{type:"sdxl_model_loader",id:E,model:a},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:i,style:D},[We]:{type:"sdxl_compel_prompt",id:We,prompt:o,style:L},[Ui]:{type:"img_blur",id:Ui,is_intermediate:$,radius:h,blur_type:p},[Kn]:{type:"i2l",id:Kn,is_intermediate:$,fp32:P},[Le]:{type:"noise",id:Le,use_cpu:A,seed:c,is_intermediate:$},[Wn]:{type:"create_denoise_mask",id:Wn,is_intermediate:$,fp32:P},[Te]:{type:"denoise_latents",id:Te,is_intermediate:$,steps:u,cfg_scale:s,scheduler:l,denoising_start:S?Math.min(w,1-v):1-v,denoising_end:S?w:1},[Vt]:{type:"noise",id:Vt,use_cpu:A,seed:c+1,is_intermediate:$},[dc]:{type:"add",id:dc,b:1,is_intermediate:$},[gt]:{type:"denoise_latents",id:gt,is_intermediate:$,steps:_,cfg_scale:s,scheduler:l,denoising_start:1-b,denoising_end:1},[Ke]:{type:"l2i",id:Ke,is_intermediate:$,fp32:P},[me]:{type:"color_correct",id:me,is_intermediate:$,reference:t}},edges:[{source:{node_id:E,field:"unet"},destination:{node_id:Te,field:"unet"}},{source:{node_id:E,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:E,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:E,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:E,field:"clip2"},destination:{node_id:We,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Te,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Te,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Te,field:"noise"}},{source:{node_id:Kn,field:"latents"},destination:{node_id:Te,field:"latents"}},{source:{node_id:Ui,field:"image"},destination:{node_id:Wn,field:"mask"}},{source:{node_id:Wn,field:"denoise_mask"},destination:{node_id:Te,field:"denoise_mask"}},{source:{node_id:E,field:"unet"},destination:{node_id:gt,field:"unet"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:gt,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:gt,field:"negative_conditioning"}},{source:{node_id:Vt,field:"noise"},destination:{node_id:gt,field:"noise"}},{source:{node_id:Te,field:"latents"},destination:{node_id:gt,field:"latents"}},{source:{node_id:gt,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};if(O){const R=k.width,N=k.height;M.nodes[Ai]={type:"img_resize",id:Ai,is_intermediate:$,width:R,height:N,image:t},M.nodes[Nn]={type:"img_resize",id:Nn,is_intermediate:$,width:R,height:N,image:n},M.nodes[qi]={type:"img_resize",id:qi,is_intermediate:$,width:x,height:C},M.nodes[Hi]={type:"img_resize",id:Hi,is_intermediate:$,width:x,height:C},M.nodes[Le].width=R,M.nodes[Le].height=N,M.nodes[Vt].width=R,M.nodes[Vt].height=N,M.edges.push({source:{node_id:Ai,field:"image"},destination:{node_id:Kn,field:"image"}},{source:{node_id:Nn,field:"image"},destination:{node_id:Ui,field:"image"}},{source:{node_id:Ai,field:"image"},destination:{node_id:Wn,field:"image"}},{source:{node_id:Ke,field:"image"},destination:{node_id:qi,field:"image"}},{source:{node_id:qi,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Ui,field:"image"},destination:{node_id:Hi,field:"image"}},{source:{node_id:Hi,field:"image"},destination:{node_id:me,field:"mask"}})}else M.nodes[Le].width=x,M.nodes[Le].height=C,M.nodes[Vt].width=x,M.nodes[Vt].height=C,M.nodes[Kn]={...M.nodes[Kn],image:t},M.nodes[Ui]={...M.nodes[Ui],image:n},M.nodes[Wn]={...M.nodes[Wn],image:t},M.edges.push({source:{node_id:Ke,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Ui,field:"image"},destination:{node_id:me,field:"mask"}});return m!=="unmasked"&&(M.nodes[jt]={type:"create_denoise_mask",id:jt,is_intermediate:$,fp32:P},O?M.edges.push({source:{node_id:Ai,field:"image"},destination:{node_id:jt,field:"image"}}):M.nodes[jt]={...M.nodes[jt],image:t},m==="mask"&&(O?M.edges.push({source:{node_id:Nn,field:"image"},destination:{node_id:jt,field:"mask"}}):M.nodes[jt]={...M.nodes[jt],mask:n}),m==="edge"&&(M.nodes[yr]={type:"mask_edge",id:yr,is_intermediate:$,edge_blur:h,edge_size:h*2,low_threshold:100,high_threshold:200},O?M.edges.push({source:{node_id:Nn,field:"image"},destination:{node_id:yr,field:"image"}}):M.nodes[yr]={...M.nodes[yr],image:n},M.edges.push({source:{node_id:yr,field:"image"},destination:{node_id:jt,field:"mask"}})),M.edges.push({source:{node_id:jt,field:"denoise_mask"},destination:{node_id:gt,field:"denoise_mask"}})),(y||g)&&(Ma(e,M,E),E=Wr),S&&(Pp(e,M,gt,E,t,n),(y||g)&&(E=Xa)),Na(e,M,E),Ap(e,M,Te,E),Pa(e,M,Te),Ia(e,M,Te),e.system.shouldUseNSFWChecker&&Ra(e,M,me),e.system.shouldUseWatermarker&&$a(e,M,me),Oa(e,M),M},yEe=(e,t,n)=>{const r=_e("nodes"),{positivePrompt:i,negativePrompt:o,model:a,cfgScale:s,scheduler:l,steps:u,seed:c,vaePrecision:d,shouldUseCpuNoise:f,maskBlur:h,canvasCoherenceMode:p,canvasCoherenceSteps:m,canvasCoherenceStrength:_,infillTileSize:b,infillPatchmatchDownscaleSize:y,infillMethod:g,seamlessXAxis:v,seamlessYAxis:S}=e.generation,{sdxlImg2ImgDenoisingStrength:w,shouldUseSDXLRefiner:x,refinerStart:C}=e.sdxl;if(!a)throw r.error("No model found in state"),new Error("No model found in state");const{width:k,height:T}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:P,boundingBoxScaleMethod:$}=e.canvas,O=d==="fp32",E=!0,A=["auto","manual"].includes($);let D=Vi;const L=f,{joinedPositiveStylePrompt:M,joinedNegativeStylePrompt:R}=Zd(e),N={id:hc,nodes:{[Vi]:{type:"sdxl_model_loader",id:Vi,model:a},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:i,style:M},[We]:{type:"sdxl_compel_prompt",id:We,prompt:o,style:R},[_h]:{type:"tomask",id:_h,is_intermediate:E,image:t},[Ti]:{type:"mask_combine",id:Ti,is_intermediate:E,mask2:n},[Kn]:{type:"i2l",id:Kn,is_intermediate:E,fp32:O},[Le]:{type:"noise",id:Le,use_cpu:L,seed:c,is_intermediate:E},[Wn]:{type:"create_denoise_mask",id:Wn,is_intermediate:E,fp32:O},[Te]:{type:"denoise_latents",id:Te,is_intermediate:E,steps:u,cfg_scale:s,scheduler:l,denoising_start:x?Math.min(C,1-w):1-w,denoising_end:x?C:1},[Vt]:{type:"noise",id:Vt,use_cpu:L,seed:c+1,is_intermediate:E},[dc]:{type:"add",id:dc,b:1,is_intermediate:E},[gt]:{type:"denoise_latents",id:gt,is_intermediate:E,steps:m,cfg_scale:s,scheduler:l,denoising_start:1-_,denoising_end:1},[Ke]:{type:"l2i",id:Ke,is_intermediate:E,fp32:O},[me]:{type:"color_correct",id:me,is_intermediate:E}},edges:[{source:{node_id:Vi,field:"unet"},destination:{node_id:Te,field:"unet"}},{source:{node_id:Vi,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Vi,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:Vi,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Vi,field:"clip2"},destination:{node_id:We,field:"clip2"}},{source:{node_id:Kt,field:"image"},destination:{node_id:Kn,field:"image"}},{source:{node_id:_h,field:"image"},destination:{node_id:Ti,field:"mask1"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Te,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Te,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Te,field:"noise"}},{source:{node_id:Kn,field:"latents"},destination:{node_id:Te,field:"latents"}},{source:{node_id:A?Nn:Ti,field:"image"},destination:{node_id:Wn,field:"mask"}},{source:{node_id:Wn,field:"denoise_mask"},destination:{node_id:Te,field:"denoise_mask"}},{source:{node_id:D,field:"unet"},destination:{node_id:gt,field:"unet"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:gt,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:gt,field:"negative_conditioning"}},{source:{node_id:Vt,field:"noise"},destination:{node_id:gt,field:"noise"}},{source:{node_id:Te,field:"latents"},destination:{node_id:gt,field:"latents"}},{source:{node_id:Kt,field:"image"},destination:{node_id:Wn,field:"image"}},{source:{node_id:gt,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};if(g==="patchmatch"&&(N.nodes[Kt]={type:"infill_patchmatch",id:Kt,is_intermediate:E,downscale:y}),g==="lama"&&(N.nodes[Kt]={type:"infill_lama",id:Kt,is_intermediate:E}),g==="cv2"&&(N.nodes[Kt]={type:"infill_cv2",id:Kt,is_intermediate:E}),g==="tile"&&(N.nodes[Kt]={type:"infill_tile",id:Kt,is_intermediate:E,tile_size:b}),A){const B=P.width,U=P.height;N.nodes[Ai]={type:"img_resize",id:Ai,is_intermediate:E,width:B,height:U,image:t},N.nodes[Nn]={type:"img_resize",id:Nn,is_intermediate:E,width:B,height:U},N.nodes[qi]={type:"img_resize",id:qi,is_intermediate:E,width:k,height:T},N.nodes[Lu]={type:"img_resize",id:Lu,is_intermediate:E,width:k,height:T},N.nodes[Hi]={type:"img_resize",id:Hi,is_intermediate:E,width:k,height:T},N.nodes[Le].width=B,N.nodes[Le].height=U,N.nodes[Vt].width=B,N.nodes[Vt].height=U,N.edges.push({source:{node_id:Ai,field:"image"},destination:{node_id:Kt,field:"image"}},{source:{node_id:Ti,field:"image"},destination:{node_id:Nn,field:"image"}},{source:{node_id:Ke,field:"image"},destination:{node_id:qi,field:"image"}},{source:{node_id:Nn,field:"image"},destination:{node_id:Hi,field:"image"}},{source:{node_id:Kt,field:"image"},destination:{node_id:Lu,field:"image"}},{source:{node_id:Lu,field:"image"},destination:{node_id:me,field:"reference"}},{source:{node_id:qi,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Hi,field:"image"},destination:{node_id:me,field:"mask"}})}else N.nodes[Kt]={...N.nodes[Kt],image:t},N.nodes[Le].width=k,N.nodes[Le].height=T,N.nodes[Vt].width=k,N.nodes[Vt].height=T,N.nodes[Kn]={...N.nodes[Kn],image:t},N.edges.push({source:{node_id:Kt,field:"image"},destination:{node_id:me,field:"reference"}},{source:{node_id:Ke,field:"image"},destination:{node_id:me,field:"image"}},{source:{node_id:Ti,field:"image"},destination:{node_id:me,field:"mask"}});return p!=="unmasked"&&(N.nodes[jt]={type:"create_denoise_mask",id:jt,is_intermediate:E,fp32:O},N.edges.push({source:{node_id:Kt,field:"image"},destination:{node_id:jt,field:"image"}}),p==="mask"&&(A?N.edges.push({source:{node_id:Nn,field:"image"},destination:{node_id:jt,field:"mask"}}):N.edges.push({source:{node_id:Ti,field:"image"},destination:{node_id:jt,field:"mask"}})),p==="edge"&&(N.nodes[yr]={type:"mask_edge",id:yr,is_intermediate:E,edge_blur:h,edge_size:h*2,low_threshold:100,high_threshold:200},A?N.edges.push({source:{node_id:Nn,field:"image"},destination:{node_id:yr,field:"image"}}):N.edges.push({source:{node_id:Ti,field:"image"},destination:{node_id:yr,field:"image"}}),N.edges.push({source:{node_id:yr,field:"image"},destination:{node_id:jt,field:"mask"}})),N.edges.push({source:{node_id:jt,field:"denoise_mask"},destination:{node_id:gt,field:"denoise_mask"}})),(v||S)&&(Ma(e,N,D),D=Wr),x&&(Pp(e,N,gt,D,t),(v||S)&&(D=Xa)),Na(e,N,D),Ap(e,N,Te,D),Pa(e,N,Te),Ia(e,N,Te),e.system.shouldUseNSFWChecker&&Ra(e,N,me),e.system.shouldUseWatermarker&&$a(e,N,me),Oa(e,N),N},vEe=e=>{const t=_e("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,vaePrecision:u,shouldUseCpuNoise:c,seamlessXAxis:d,seamlessYAxis:f}=e.generation,{width:h,height:p}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:m,boundingBoxScaleMethod:_}=e.canvas,b=u==="fp32",y=!0,g=["auto","manual"].includes(_),{shouldUseSDXLRefiner:v,refinerStart:S}=e.sdxl;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const w=c,x=i.model_type==="onnx";let C=x?Qx:Vi;const k=x?"onnx_model_loader":"sdxl_model_loader",T=x?{type:"t2l_onnx",id:Te,is_intermediate:y,cfg_scale:o,scheduler:a,steps:l}:{type:"denoise_latents",id:Te,is_intermediate:y,cfg_scale:o,scheduler:a,steps:l,denoising_start:0,denoising_end:v?S:1},{joinedPositiveStylePrompt:P,joinedNegativeStylePrompt:$}=Zd(e),O={id:Zx,nodes:{[C]:{type:k,id:C,is_intermediate:y,model:i},[Be]:{type:x?"prompt_onnx":"sdxl_compel_prompt",id:Be,is_intermediate:y,prompt:n,style:P},[We]:{type:x?"prompt_onnx":"sdxl_compel_prompt",id:We,is_intermediate:y,prompt:r,style:$},[Le]:{type:"noise",id:Le,is_intermediate:y,seed:s,width:g?m.width:h,height:g?m.height:p,use_cpu:w},[T.id]:T},edges:[{source:{node_id:C,field:"unet"},destination:{node_id:Te,field:"unet"}},{source:{node_id:C,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:C,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:We,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Te,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Te,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Te,field:"noise"}}]};return g?(O.nodes[Ke]={id:Ke,type:x?"l2i_onnx":"l2i",is_intermediate:y,fp32:b},O.nodes[me]={id:me,type:"img_resize",is_intermediate:y,width:h,height:p},O.edges.push({source:{node_id:Te,field:"latents"},destination:{node_id:Ke,field:"latents"}},{source:{node_id:Ke,field:"image"},destination:{node_id:me,field:"image"}})):(O.nodes[me]={type:x?"l2i_onnx":"l2i",id:me,is_intermediate:y,fp32:b},O.edges.push({source:{node_id:Te,field:"latents"},destination:{node_id:me,field:"latents"}})),O.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"txt2img",cfg_scale:o,width:g?m.width:h,height:g?m.height:p,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:w?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],ipAdapters:[]},O.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:me,field:"metadata"}}),(d||f)&&(Ma(e,O,C),C=Wr),v&&(Pp(e,O,Te,C),(d||f)&&(C=Xa)),Ap(e,O,Te,C),Na(e,O,C),Pa(e,O,Te),Ia(e,O,Te),e.system.shouldUseNSFWChecker&&Ra(e,O,me),e.system.shouldUseWatermarker&&$a(e,O,me),Oa(e,O),O},bEe=e=>{const t=_e("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,vaePrecision:u,clipSkip:c,shouldUseCpuNoise:d,seamlessXAxis:f,seamlessYAxis:h}=e.generation,{width:p,height:m}=e.canvas.boundingBoxDimensions,{scaledBoundingBoxDimensions:_,boundingBoxScaleMethod:b}=e.canvas,y=u==="fp32",g=!0,v=["auto","manual"].includes(b);if(!i)throw t.error("No model found in state"),new Error("No model found in state");const S=d,w=i.model_type==="onnx";let x=w?Qx:Ic;const C=w?"onnx_model_loader":"main_model_loader",k=w?{type:"t2l_onnx",id:Oe,is_intermediate:g,cfg_scale:o,scheduler:a,steps:l}:{type:"denoise_latents",id:Oe,is_intermediate:g,cfg_scale:o,scheduler:a,steps:l,denoising_start:0,denoising_end:1},T={id:tq,nodes:{[x]:{type:C,id:x,is_intermediate:g,model:i},[Zt]:{type:"clip_skip",id:Zt,is_intermediate:g,skipped_layers:c},[Be]:{type:w?"prompt_onnx":"compel",id:Be,is_intermediate:g,prompt:n},[We]:{type:w?"prompt_onnx":"compel",id:We,is_intermediate:g,prompt:r},[Le]:{type:"noise",id:Le,is_intermediate:g,seed:s,width:v?_.width:p,height:v?_.height:m,use_cpu:S},[k.id]:k},edges:[{source:{node_id:x,field:"unet"},destination:{node_id:Oe,field:"unet"}},{source:{node_id:x,field:"clip"},destination:{node_id:Zt,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Oe,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Oe,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Oe,field:"noise"}}]};return v?(T.nodes[Ke]={id:Ke,type:w?"l2i_onnx":"l2i",is_intermediate:g,fp32:y},T.nodes[me]={id:me,type:"img_resize",is_intermediate:g,width:p,height:m},T.edges.push({source:{node_id:Oe,field:"latents"},destination:{node_id:Ke,field:"latents"}},{source:{node_id:Ke,field:"image"},destination:{node_id:me,field:"image"}})):(T.nodes[me]={type:w?"l2i_onnx":"l2i",id:me,is_intermediate:g,fp32:y},T.edges.push({source:{node_id:Oe,field:"latents"},destination:{node_id:me,field:"latents"}})),T.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"txt2img",cfg_scale:o,width:v?_.width:p,height:v?_.height:m,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:S?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],ipAdapters:[],clip_skip:c},T.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:me,field:"metadata"}}),(f||h)&&(Ma(e,T,x),x=Wr),Na(e,T,x),kp(e,T,Oe,x),Pa(e,T,Oe),Ia(e,T,Oe),e.system.shouldUseNSFWChecker&&Ra(e,T,me),e.system.shouldUseWatermarker&&$a(e,T,me),Oa(e,T),T},_Ee=(e,t,n,r)=>{let i;if(t==="txt2img")e.generation.model&&e.generation.model.base_model==="sdxl"?i=vEe(e):i=bEe(e);else if(t==="img2img"){if(!n)throw new Error("Missing canvas init image");e.generation.model&&e.generation.model.base_model==="sdxl"?i=gEe(e,n):i=fEe(e,n)}else if(t==="inpaint"){if(!n||!r)throw new Error("Missing canvas init and mask images");e.generation.model&&e.generation.model.base_model==="sdxl"?i=mEe(e,n,r):i=hEe(e,n,r)}else{if(!n)throw new Error("Missing canvas init image");e.generation.model&&e.generation.model.base_model==="sdxl"?i=yEe(e,n,r):i=pEe(e,n,r)}return i},o5=({count:e,start:t,min:n=Lae,max:r=qg})=>{const i=t??hae(n,r),o=[];for(let a=i;a<i+e;a++)o.push(a%r);return o},rq=(e,t,n)=>{const{iterations:r,model:i,shouldRandomizeSeed:o,seed:a}=e.generation,{shouldConcatSDXLStylePrompt:s,positiveStylePrompt:l}=e.sdxl,{prompts:u,seedBehaviour:c}=e.dynamicPrompts,d=[];if(u.length===1){Z8(t.nodes[pt],"seed");const h=o5({count:r,start:o?void 0:a}),p=[];t.nodes[Le]&&p.push({node_path:Le,field_name:"seed",items:h}),t.nodes[pt]&&p.push({node_path:pt,field_name:"seed",items:h}),t.nodes[Vt]&&p.push({node_path:Vt,field_name:"seed",items:h.map(m=>(m+1)%qg)}),d.push(p)}else{const h=[],p=[];if(c==="PER_PROMPT"){const _=o5({count:u.length*r,start:o?void 0:a});t.nodes[Le]&&h.push({node_path:Le,field_name:"seed",items:_}),t.nodes[pt]&&h.push({node_path:pt,field_name:"seed",items:_}),t.nodes[Vt]&&h.push({node_path:Vt,field_name:"seed",items:_.map(b=>(b+1)%qg)})}else{const _=o5({count:r,start:o?void 0:a});t.nodes[Le]&&p.push({node_path:Le,field_name:"seed",items:_}),t.nodes[pt]&&p.push({node_path:pt,field_name:"seed",items:_}),t.nodes[Vt]&&p.push({node_path:Vt,field_name:"seed",items:_.map(b=>(b+1)%qg)}),d.push(p)}const m=c==="PER_PROMPT"?bae(r).flatMap(()=>u):u;if(t.nodes[Be]&&h.push({node_path:Be,field_name:"prompt",items:m}),t.nodes[pt]&&h.push({node_path:pt,field_name:"positive_prompt",items:m}),s&&(i==null?void 0:i.base_model)==="sdxl"){Z8(t.nodes[pt],"positive_style_prompt");const _=m.map(b=>[b,l].join(" "));t.nodes[Be]&&h.push({node_path:Be,field_name:"style",items:_}),t.nodes[pt]&&h.push({node_path:pt,field_name:"positive_style_prompt",items:_})}d.push(h)}return{prepend:n,batch:{graph:t,runs:1,data:d}}},SEe=()=>{Fe({predicate:e=>LA.match(e)&&e.payload.tabName==="unifiedCanvas",effect:async(e,{getState:t,dispatch:n})=>{const r=_e("queue"),{prepend:i}=e.payload,o=t(),{layerState:a,boundingBoxCoordinates:s,boundingBoxDimensions:l,isMaskEnabled:u,shouldPreserveMaskedArea:c}=o.canvas,d=await $A(a,s,l,u,c);if(!d){r.error("Unable to create canvas data");return}const{baseBlob:f,baseImageData:h,maskBlob:p,maskImageData:m}=d,_=uEe(h,m);if(o.system.enableImageDebugging){const S=await FO(f),w=await FO(p);aEe([{base64:w,caption:"mask b64"},{base64:S,caption:"image b64"}])}r.debug(`Generation mode: ${_}`);let b,y;["img2img","inpaint","outpaint"].includes(_)&&(b=await n(ve.endpoints.uploadImage.initiate({file:new File([f],"canvasInitImage.png",{type:"image/png"}),image_category:"general",is_intermediate:!0})).unwrap()),["inpaint","outpaint"].includes(_)&&(y=await n(ve.endpoints.uploadImage.initiate({file:new File([p],"canvasMaskImage.png",{type:"image/png"}),image_category:"mask",is_intermediate:!0})).unwrap());const g=_Ee(o,_,b,y);r.debug({graph:Xt(g)},"Canvas graph built"),n(fG(g));const v=rq(o,g,i);try{const S=n(Xr.endpoints.enqueueBatch.initiate(v,{fixedCacheKey:"enqueueBatch"})),w=await S.unwrap();S.reset();const x=w.batch.batch_id;o.canvas.layerState.stagingArea.boundingBox||n(fle({boundingBox:{...o.canvas.boundingBoxCoordinates,...o.canvas.boundingBoxDimensions}})),n(hle(x))}catch{}}})},xEe=e=>{const t=_e("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,initialImage:u,img2imgStrength:c,shouldFitToWidthHeight:d,width:f,height:h,clipSkip:p,shouldUseCpuNoise:m,vaePrecision:_,seamlessXAxis:b,seamlessYAxis:y}=e.generation;if(!u)throw t.error("No initial image found in state"),new Error("No initial image found in state");if(!i)throw t.error("No model found in state"),new Error("No model found in state");const g=_==="fp32",v=!0;let S=Ic;const w=m,x={id:nT,nodes:{[S]:{type:"main_model_loader",id:S,model:i,is_intermediate:v},[Zt]:{type:"clip_skip",id:Zt,skipped_layers:p,is_intermediate:v},[Be]:{type:"compel",id:Be,prompt:n,is_intermediate:v},[We]:{type:"compel",id:We,prompt:r,is_intermediate:v},[Le]:{type:"noise",id:Le,use_cpu:w,seed:s,is_intermediate:v},[Ke]:{type:"l2i",id:Ke,fp32:g,is_intermediate:v},[Oe]:{type:"denoise_latents",id:Oe,cfg_scale:o,scheduler:a,steps:l,denoising_start:1-c,denoising_end:1,is_intermediate:v},[Hn]:{type:"i2l",id:Hn,fp32:g,is_intermediate:v}},edges:[{source:{node_id:S,field:"unet"},destination:{node_id:Oe,field:"unet"}},{source:{node_id:S,field:"clip"},destination:{node_id:Zt,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Oe,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Oe,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Oe,field:"noise"}},{source:{node_id:Hn,field:"latents"},destination:{node_id:Oe,field:"latents"}},{source:{node_id:Oe,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};if(d&&(u.width!==f||u.height!==h)){const C={id:Ms,type:"img_resize",image:{image_name:u.imageName},is_intermediate:!0,width:f,height:h};x.nodes[Ms]=C,x.edges.push({source:{node_id:Ms,field:"image"},destination:{node_id:Hn,field:"image"}}),x.edges.push({source:{node_id:Ms,field:"width"},destination:{node_id:Le,field:"width"}}),x.edges.push({source:{node_id:Ms,field:"height"},destination:{node_id:Le,field:"height"}})}else x.nodes[Hn].image={image_name:u.imageName},x.edges.push({source:{node_id:Hn,field:"width"},destination:{node_id:Le,field:"width"}}),x.edges.push({source:{node_id:Hn,field:"height"},destination:{node_id:Le,field:"height"}});return x.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"img2img",cfg_scale:o,height:h,width:f,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:w?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],ipAdapters:[],clip_skip:p,strength:c,init_image:u.imageName},x.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:Ke,field:"metadata"}}),(b||y)&&(Ma(e,x,S),S=Wr),Na(e,x,S),kp(e,x,Oe,S),Pa(e,x,Oe),Ia(e,x,Oe),e.system.shouldUseNSFWChecker&&Ra(e,x),e.system.shouldUseWatermarker&&$a(e,x),Oa(e,x),x},wEe=e=>{const t=_e("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,initialImage:u,shouldFitToWidthHeight:c,width:d,height:f,shouldUseCpuNoise:h,vaePrecision:p,seamlessXAxis:m,seamlessYAxis:_}=e.generation,{positiveStylePrompt:b,negativeStylePrompt:y,shouldUseSDXLRefiner:g,refinerStart:v,sdxlImg2ImgDenoisingStrength:S}=e.sdxl;if(!u)throw t.error("No initial image found in state"),new Error("No initial image found in state");if(!i)throw t.error("No model found in state"),new Error("No model found in state");const w=p==="fp32",x=!0;let C=Vi;const k=h,{joinedPositiveStylePrompt:T,joinedNegativeStylePrompt:P}=Zd(e),$={id:U_,nodes:{[C]:{type:"sdxl_model_loader",id:C,model:i,is_intermediate:x},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:n,style:T,is_intermediate:x},[We]:{type:"sdxl_compel_prompt",id:We,prompt:r,style:P,is_intermediate:x},[Le]:{type:"noise",id:Le,use_cpu:k,seed:s,is_intermediate:x},[Ke]:{type:"l2i",id:Ke,fp32:w,is_intermediate:x},[Te]:{type:"denoise_latents",id:Te,cfg_scale:o,scheduler:a,steps:l,denoising_start:g?Math.min(v,1-S):1-S,denoising_end:g?v:1,is_intermediate:x},[Hn]:{type:"i2l",id:Hn,fp32:w,is_intermediate:x}},edges:[{source:{node_id:C,field:"unet"},destination:{node_id:Te,field:"unet"}},{source:{node_id:C,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:C,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:We,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Te,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Te,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Te,field:"noise"}},{source:{node_id:Hn,field:"latents"},destination:{node_id:Te,field:"latents"}},{source:{node_id:Te,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};if(c&&(u.width!==d||u.height!==f)){const O={id:Ms,type:"img_resize",image:{image_name:u.imageName},is_intermediate:!0,width:d,height:f};$.nodes[Ms]=O,$.edges.push({source:{node_id:Ms,field:"image"},destination:{node_id:Hn,field:"image"}}),$.edges.push({source:{node_id:Ms,field:"width"},destination:{node_id:Le,field:"width"}}),$.edges.push({source:{node_id:Ms,field:"height"},destination:{node_id:Le,field:"height"}})}else $.nodes[Hn].image={image_name:u.imageName},$.edges.push({source:{node_id:Hn,field:"width"},destination:{node_id:Le,field:"width"}}),$.edges.push({source:{node_id:Hn,field:"height"},destination:{node_id:Le,field:"height"}});return $.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"sdxl_img2img",cfg_scale:o,height:f,width:d,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:k?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],ipAdapters:[],strength:S,init_image:u.imageName,positive_style_prompt:b,negative_style_prompt:y},$.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:Ke,field:"metadata"}}),(m||_)&&(Ma(e,$,C),C=Wr),g&&(Pp(e,$,Te),(m||_)&&(C=Xa)),Na(e,$,C),Ap(e,$,Te,C),Pa(e,$,Te),Ia(e,$,Te),e.system.shouldUseNSFWChecker&&Ra(e,$),e.system.shouldUseWatermarker&&$a(e,$),Oa(e,$),$},CEe=e=>{const t=_e("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,seed:s,steps:l,width:u,height:c,shouldUseCpuNoise:d,vaePrecision:f,seamlessXAxis:h,seamlessYAxis:p}=e.generation,{positiveStylePrompt:m,negativeStylePrompt:_,shouldUseSDXLRefiner:b,refinerStart:y}=e.sdxl,g=d;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const v=f==="fp32",S=!0,{joinedPositiveStylePrompt:w,joinedNegativeStylePrompt:x}=Zd(e);let C=Vi;const k={id:DA,nodes:{[C]:{type:"sdxl_model_loader",id:C,model:i,is_intermediate:S},[Be]:{type:"sdxl_compel_prompt",id:Be,prompt:n,style:w,is_intermediate:S},[We]:{type:"sdxl_compel_prompt",id:We,prompt:r,style:x,is_intermediate:S},[Le]:{type:"noise",id:Le,seed:s,width:u,height:c,use_cpu:g,is_intermediate:S},[Te]:{type:"denoise_latents",id:Te,cfg_scale:o,scheduler:a,steps:l,denoising_start:0,denoising_end:b?y:1,is_intermediate:S},[Ke]:{type:"l2i",id:Ke,fp32:v,is_intermediate:S}},edges:[{source:{node_id:C,field:"unet"},destination:{node_id:Te,field:"unet"}},{source:{node_id:C,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:Be,field:"clip2"}},{source:{node_id:C,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:C,field:"clip2"},destination:{node_id:We,field:"clip2"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Te,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Te,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Te,field:"noise"}},{source:{node_id:Te,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};return k.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"sdxl_txt2img",cfg_scale:o,height:c,width:u,positive_prompt:n,negative_prompt:r,model:i,seed:s,steps:l,rand_device:g?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],ipAdapters:[],positive_style_prompt:m,negative_style_prompt:_},k.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:Ke,field:"metadata"}}),(h||p)&&(Ma(e,k,C),C=Wr),b&&(Pp(e,k,Te),(h||p)&&(C=Xa)),Na(e,k,C),Ap(e,k,Te,C),Pa(e,k,Te),Ia(e,k,Te),e.system.shouldUseNSFWChecker&&Ra(e,k),e.system.shouldUseWatermarker&&$a(e,k),Oa(e,k),k},EEe=e=>{const t=_e("nodes"),{positivePrompt:n,negativePrompt:r,model:i,cfgScale:o,scheduler:a,steps:s,width:l,height:u,clipSkip:c,shouldUseCpuNoise:d,vaePrecision:f,seamlessXAxis:h,seamlessYAxis:p,seed:m}=e.generation,_=d;if(!i)throw t.error("No model found in state"),new Error("No model found in state");const b=f==="fp32",y=!0,g=i.model_type==="onnx";let v=g?Qx:Ic;const S=g?"onnx_model_loader":"main_model_loader",w=g?{type:"t2l_onnx",id:Oe,is_intermediate:y,cfg_scale:o,scheduler:a,steps:s}:{type:"denoise_latents",id:Oe,is_intermediate:y,cfg_scale:o,scheduler:a,steps:s,denoising_start:0,denoising_end:1},x={id:eq,nodes:{[v]:{type:S,id:v,is_intermediate:y,model:i},[Zt]:{type:"clip_skip",id:Zt,skipped_layers:c,is_intermediate:y},[Be]:{type:g?"prompt_onnx":"compel",id:Be,prompt:n,is_intermediate:y},[We]:{type:g?"prompt_onnx":"compel",id:We,prompt:r,is_intermediate:y},[Le]:{type:"noise",id:Le,seed:m,width:l,height:u,use_cpu:_,is_intermediate:y},[w.id]:w,[Ke]:{type:g?"l2i_onnx":"l2i",id:Ke,fp32:b,is_intermediate:y}},edges:[{source:{node_id:v,field:"unet"},destination:{node_id:Oe,field:"unet"}},{source:{node_id:v,field:"clip"},destination:{node_id:Zt,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:Be,field:"clip"}},{source:{node_id:Zt,field:"clip"},destination:{node_id:We,field:"clip"}},{source:{node_id:Be,field:"conditioning"},destination:{node_id:Oe,field:"positive_conditioning"}},{source:{node_id:We,field:"conditioning"},destination:{node_id:Oe,field:"negative_conditioning"}},{source:{node_id:Le,field:"noise"},destination:{node_id:Oe,field:"noise"}},{source:{node_id:Oe,field:"latents"},destination:{node_id:Ke,field:"latents"}}]};return x.nodes[pt]={id:pt,type:"metadata_accumulator",generation_mode:"txt2img",cfg_scale:o,height:u,width:l,positive_prompt:n,negative_prompt:r,model:i,seed:m,steps:s,rand_device:_?"cpu":"cuda",scheduler:a,vae:void 0,controlnets:[],loras:[],ipAdapters:[],clip_skip:c},x.edges.push({source:{node_id:pt,field:"metadata"},destination:{node_id:Ke,field:"metadata"}}),(h||p)&&(Ma(e,x,v),v=Wr),Na(e,x,v),kp(e,x,Oe,v),Pa(e,x,Oe),Ia(e,x,Oe),e.system.shouldUseNSFWChecker&&Ra(e,x),e.system.shouldUseWatermarker&&$a(e,x),Oa(e,x),x},TEe=()=>{Fe({predicate:e=>LA.match(e)&&(e.payload.tabName==="txt2img"||e.payload.tabName==="img2img"),effect:async(e,{getState:t,dispatch:n})=>{const r=t(),i=r.generation.model,{prepend:o}=e.payload;let a;i&&i.base_model==="sdxl"?e.payload.tabName==="txt2img"?a=CEe(r):a=wEe(r):e.payload.tabName==="txt2img"?a=EEe(r):a=xEe(r);const s=rq(r,a,o);n(Xr.endpoints.enqueueBatch.initiate(s,{fixedCacheKey:"enqueueBatch"})).reset()}})},kEe=/[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*/u;function AEe(e){return e.length===1?e[0].toString():e.reduce((t,n)=>{if(typeof n=="number")return t+"["+n.toString()+"]";if(n.includes('"'))return t+'["'+PEe(n)+'"]';if(!kEe.test(n))return t+'["'+n+'"]';const r=t.length===0?"":".";return t+r+n},"")}function PEe(e){return e.replace(/"/g,'\\"')}function IEe(e){return e.length!==0}const REe=99,iq="; ",oq=", or ",BA="Validation error",aq=": ";class sq extends Error{constructor(n,r=[]){super(n);xw(this,"details");xw(this,"name");this.details=r,this.name="ZodValidationError"}toString(){return this.message}}function zA(e,t,n){if(e.code==="invalid_union")return e.unionErrors.reduce((r,i)=>{const o=i.issues.map(a=>zA(a,t,n)).join(t);return r.includes(o)||r.push(o),r},[]).join(n);if(IEe(e.path)){if(e.path.length===1){const r=e.path[0];if(typeof r=="number")return`${e.message} at index ${r}`}return`${e.message} at "${AEe(e.path)}"`}return e.message}function lq(e,t,n){return t!==null?e.length>0?[t,e].join(n):t:e.length>0?e:BA}function pKe(e,t={}){const{issueSeparator:n=iq,unionSeparator:r=oq,prefixSeparator:i=aq,prefix:o=BA}=t,a=zA(e,n,r),s=lq(a,o,i);return new sq(s,[e])}function BO(e,t={}){const{maxIssuesInMessage:n=REe,issueSeparator:r=iq,unionSeparator:i=oq,prefixSeparator:o=aq,prefix:a=BA}=t,s=e.errors.slice(0,n).map(u=>zA(u,r,i)).join(r),l=lq(s,a,o);return new sq(l,e.errors)}const OEe=e=>{const{workflow:t,nodes:n,edges:r}=e,i={...t,nodes:[],edges:[]};return n.filter(o=>["invocation","notes"].includes(o.type??"__UNKNOWN_NODE_TYPE__")).forEach(o=>{const a=qB.safeParse(o);if(!a.success){const{message:s}=BO(a.error,{prefix:be.t("nodes.unableToParseNode")});_e("nodes").warn({node:Xt(o)},s);return}i.nodes.push(a.data)}),r.forEach(o=>{const a=HB.safeParse(o);if(!a.success){const{message:s}=BO(a.error,{prefix:be.t("nodes.unableToParseEdge")});_e("nodes").warn({edge:Xt(o)},s);return}i.edges.push(a.data)}),i},MEe=e=>{if(e.type==="ColorField"&&e.value){const t=Cn(e.value),{r:n,g:r,b:i,a:o}=e.value,a=Math.max(0,Math.min(o*255,255));return Object.assign(t,{r:n,g:r,b:i,a}),t}return e.value},NEe=e=>{const{nodes:t,edges:n}=e,r=t.filter(Ur),i=JSON.stringify(OEe(e)),o=r.reduce((u,c)=>{const{id:d,data:f}=c,{type:h,inputs:p,isIntermediate:m,embedWorkflow:_}=f,b=eE(p,(g,v,S)=>{const w=MEe(v);return g[S]=w,g},{});b.use_cache=c.data.useCache;const y={type:h,id:d,...b,is_intermediate:m};return _&&Object.assign(y,{workflow:i}),Object.assign(u,{[d]:y}),u},{}),s=n.filter(u=>u.type!=="collapsed").reduce((u,c)=>{const{source:d,target:f,sourceHandle:h,targetHandle:p}=c;return u.push({source:{node_id:d,field:h},destination:{node_id:f,field:p}}),u},[]);return s.forEach(u=>{const c=o[u.destination.node_id],d=u.destination.field;o[u.destination.node_id]=KS(c,d)}),{id:LV(),nodes:o,edges:s}},$Ee=()=>{Fe({predicate:e=>LA.match(e)&&e.payload.tabName==="nodes",effect:async(e,{getState:t,dispatch:n})=>{const r=t(),o={batch:{graph:NEe(r.nodes),runs:r.generation.iterations},prepend:e.payload.prepend};n(Xr.endpoints.enqueueBatch.initiate(o,{fixedCacheKey:"enqueueBatch"})).reset()}})},DEe=()=>{Fe({matcher:ve.endpoints.addImageToBoard.matchFulfilled,effect:e=>{const t=_e("images"),{board_id:n,imageDTO:r}=e.meta.arg.originalArgs;t.debug({board_id:n,imageDTO:r},"Image added to board")}})},LEe=()=>{Fe({matcher:ve.endpoints.addImageToBoard.matchRejected,effect:e=>{const t=_e("images"),{board_id:n,imageDTO:r}=e.meta.arg.originalArgs;t.debug({board_id:n,imageDTO:r},"Problem adding image to board")}})},jA=Ne("deleteImageModal/imageDeletionConfirmed"),gKe=Ii(e=>e,e=>e.gallery.selection[e.gallery.selection.length-1],ex),uq=Ii([e=>e],e=>{const{selectedBoardId:t,galleryView:n}=e.gallery;return{board_id:t,categories:n==="images"?oi:Ji,offset:0,limit:_le,is_intermediate:!1}},ex),FEe=()=>{Fe({actionCreator:jA,effect:async(e,{dispatch:t,getState:n,condition:r})=>{var f;const{imageDTOs:i,imagesUsage:o}=e.payload;if(i.length!==1||o.length!==1)return;const a=i[0],s=o[0];if(!a||!s)return;t(Yk(!1));const l=n(),u=(f=l.gallery.selection[l.gallery.selection.length-1])==null?void 0:f.image_name;if(a&&(a==null?void 0:a.image_name)===u){const{image_name:h}=a,p=uq(l),{data:m}=ve.endpoints.listImages.select(p)(l),_=m?Gn.getSelectors().selectAll(m):[],b=_.findIndex(S=>S.image_name===h),y=_.filter(S=>S.image_name!==h),g=Nu(b,0,y.length-1),v=y[g];t(Gs(v||null))}s.isCanvasImage&&t(bk()),i.forEach(h=>{var p;((p=n().generation.initialImage)==null?void 0:p.imageName)===h.image_name&&t(vk()),Ea(n().controlNet.controlNets,m=>{(m.controlImage===h.image_name||m.processedControlImage===h.image_name)&&(t(Cc({controlNetId:m.controlNetId,controlImage:null})),t(Xk({controlNetId:m.controlNetId,processedControlImage:null})))}),n().controlNet.ipAdapterInfo.adapterImage===h.image_name&&t(q2(null)),n().nodes.nodes.forEach(m=>{Ur(m)&&Ea(m.data.inputs,_=>{var b;_.type==="ImageField"&&((b=_.value)==null?void 0:b.image_name)===h.image_name&&t(Z2({nodeId:m.data.id,fieldName:_.name,value:void 0}))})})});const{requestId:c}=t(ve.endpoints.deleteImage.initiate(a));await r(h=>ve.endpoints.deleteImage.matchFulfilled(h)&&h.meta.requestId===c,3e4)&&t(us.util.invalidateTags([{type:"Board",id:a.board_id}]))}})},BEe=()=>{Fe({actionCreator:jA,effect:async(e,{dispatch:t,getState:n})=>{const{imageDTOs:r,imagesUsage:i}=e.payload;if(!(r.length<=1||i.length<=1))try{await t(ve.endpoints.deleteImages.initiate({imageDTOs:r})).unwrap();const o=n(),a=uq(o),{data:s}=ve.endpoints.listImages.select(a)(o),l=s?Gn.getSelectors().selectAll(s)[0]:void 0;t(Gs(l||null)),t(Yk(!1)),i.some(u=>u.isCanvasImage)&&t(bk()),r.forEach(u=>{var c;((c=n().generation.initialImage)==null?void 0:c.imageName)===u.image_name&&t(vk()),Ea(n().controlNet.controlNets,d=>{(d.controlImage===u.image_name||d.processedControlImage===u.image_name)&&(t(Cc({controlNetId:d.controlNetId,controlImage:null})),t(Xk({controlNetId:d.controlNetId,processedControlImage:null})))}),n().controlNet.ipAdapterInfo.adapterImage===u.image_name&&t(q2(null)),n().nodes.nodes.forEach(d=>{Ur(d)&&Ea(d.data.inputs,f=>{var h;f.type==="ImageField"&&((h=f.value)==null?void 0:h.image_name)===u.image_name&&t(Z2({nodeId:d.data.id,fieldName:f.name,value:void 0}))})})})}catch{}}})},zEe=()=>{Fe({matcher:ve.endpoints.deleteImage.matchPending,effect:()=>{}})},jEe=()=>{Fe({matcher:ve.endpoints.deleteImage.matchFulfilled,effect:e=>{_e("images").debug({imageDTO:e.meta.arg.originalArgs},"Image deleted")}})},UEe=()=>{Fe({matcher:ve.endpoints.deleteImage.matchRejected,effect:e=>{_e("images").debug({imageDTO:e.meta.arg.originalArgs},"Unable to delete image")}})},cq=Ne("dnd/dndDropped"),VEe=()=>{Fe({actionCreator:cq,effect:async(e,{dispatch:t})=>{const n=_e("dnd"),{activeData:r,overData:i}=e.payload;if(r.payloadType==="IMAGE_DTO"?n.debug({activeData:r,overData:i},"Image dropped"):r.payloadType==="IMAGE_DTOS"?n.debug({activeData:r,overData:i},`Images (${r.payload.imageDTOs.length}) dropped`):r.payloadType==="NODE_FIELD"?n.debug({activeData:Xt(r),overData:Xt(i)},"Node field dropped"):n.debug({activeData:r,overData:i},"Unknown payload dropped"),i.actionType==="ADD_FIELD_TO_LINEAR"&&r.payloadType==="NODE_FIELD"){const{nodeId:o,field:a}=r.payload;t(c2e({nodeId:o,fieldName:a.name}))}if(i.actionType==="SET_CURRENT_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(Gs(r.payload.imageDTO));return}if(i.actionType==="SET_INITIAL_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(ZS(r.payload.imageDTO));return}if(i.actionType==="SET_CONTROLNET_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{controlNetId:o}=i.context;t(Cc({controlImage:r.payload.imageDTO.image_name,controlNetId:o})),t(sU({controlNetId:o,isEnabled:!0}));return}if(i.actionType==="SET_IP_ADAPTER_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(q2(r.payload.imageDTO.image_name)),t(lU(!0));return}if(i.actionType==="SET_CANVAS_INITIAL_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){t(PB(r.payload.imageDTO));return}if(i.actionType==="SET_NODES_IMAGE"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{fieldName:o,nodeId:a}=i.context;t(Z2({nodeId:a,fieldName:o,value:r.payload.imageDTO}));return}if(i.actionType==="ADD_TO_BOARD"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{imageDTO:o}=r.payload,{boardId:a}=i.context;t(ve.endpoints.addImageToBoard.initiate({imageDTO:o,board_id:a}));return}if(i.actionType==="REMOVE_FROM_BOARD"&&r.payloadType==="IMAGE_DTO"&&r.payload.imageDTO){const{imageDTO:o}=r.payload;t(ve.endpoints.removeImageFromBoard.initiate({imageDTO:o}));return}if(i.actionType==="ADD_TO_BOARD"&&r.payloadType==="IMAGE_DTOS"&&r.payload.imageDTOs){const{imageDTOs:o}=r.payload,{boardId:a}=i.context;t(ve.endpoints.addImagesToBoard.initiate({imageDTOs:o,board_id:a}));return}if(i.actionType==="REMOVE_FROM_BOARD"&&r.payloadType==="IMAGE_DTOS"&&r.payload.imageDTOs){const{imageDTOs:o}=r.payload;t(ve.endpoints.removeImagesFromBoard.initiate({imageDTOs:o}));return}}})},GEe=()=>{Fe({matcher:ve.endpoints.removeImageFromBoard.matchFulfilled,effect:e=>{const t=_e("images"),n=e.meta.arg.originalArgs;t.debug({imageDTO:n},"Image removed from board")}})},qEe=()=>{Fe({matcher:ve.endpoints.removeImageFromBoard.matchRejected,effect:e=>{const t=_e("images"),n=e.meta.arg.originalArgs;t.debug({imageDTO:n},"Problem removing image from board")}})},HEe=()=>{Fe({actionCreator:x0e,effect:async(e,{dispatch:t,getState:n})=>{const r=e.payload,i=n(),{shouldConfirmOnDelete:o}=i.system,a=Mxe(n()),s=a.some(l=>l.isCanvasImage)||a.some(l=>l.isInitialImage)||a.some(l=>l.isControlNetImage)||a.some(l=>l.isIPAdapterImage)||a.some(l=>l.isNodesImage);if(o||s){t(Yk(!0));return}t(jA({imageDTOs:r,imagesUsage:a}))}})},WEe=()=>{Fe({matcher:ve.endpoints.uploadImage.matchFulfilled,effect:(e,{dispatch:t,getState:n})=>{const r=_e("images"),i=e.payload,o=n(),{autoAddBoardId:a}=o.gallery;r.debug({imageDTO:i},"Image uploaded");const{postUploadAction:s}=e.meta.arg.originalArgs;if(e.payload.is_intermediate&&!s)return;const l={title:Y("toast.imageUploaded"),status:"success"};if((s==null?void 0:s.type)==="TOAST"){const{toastOptions:u}=s;if(!a||a==="none")t(qt({...l,...u}));else{t(ve.endpoints.addImageToBoard.initiate({board_id:a,imageDTO:i}));const{data:c}=Ft.endpoints.listAllBoards.select()(o),d=c==null?void 0:c.find(h=>h.board_id===a),f=d?`${Y("toast.addedToBoard")} ${d.board_name}`:`${Y("toast.addedToBoard")} ${a}`;t(qt({...l,description:f}))}return}if((s==null?void 0:s.type)==="SET_CANVAS_INITIAL_IMAGE"){t(PB(i)),t(qt({...l,description:Y("toast.setCanvasInitialImage")}));return}if((s==null?void 0:s.type)==="SET_CONTROLNET_IMAGE"){const{controlNetId:u}=s;t(sU({controlNetId:u,isEnabled:!0})),t(Cc({controlNetId:u,controlImage:i.image_name})),t(qt({...l,description:Y("toast.setControlImage")}));return}if((s==null?void 0:s.type)==="SET_IP_ADAPTER_IMAGE"){t(q2(i.image_name)),t(lU(!0)),t(qt({...l,description:Y("toast.setIPAdapterImage")}));return}if((s==null?void 0:s.type)==="SET_INITIAL_IMAGE"){t(ZS(i)),t(qt({...l,description:Y("toast.setInitialImage")}));return}if((s==null?void 0:s.type)==="SET_NODES_IMAGE"){const{nodeId:u,fieldName:c}=s;t(Z2({nodeId:u,fieldName:c,value:i})),t(qt({...l,description:`${Y("toast.setNodeField")} ${c}`}));return}}})},KEe=()=>{Fe({matcher:ve.endpoints.uploadImage.matchRejected,effect:(e,{dispatch:t})=>{const n=_e("images"),r={arg:{...KS(e.meta.arg.originalArgs,["file","postUploadAction"]),file:"<Blob>"}};n.error({...r},"Image upload failed"),t(qt({title:Y("toast.imageUploadFailed"),description:e.error.message,status:"error"}))}})},QEe=()=>{Fe({matcher:ve.endpoints.starImages.matchFulfilled,effect:async(e,{dispatch:t,getState:n})=>{const{updated_image_names:r}=e.payload,i=n(),{selection:o}=i.gallery,a=[];o.forEach(s=>{r.includes(s.image_name)?a.push({...s,starred:!0}):a.push(s)}),t(pU(a))}})},XEe=()=>{Fe({matcher:ve.endpoints.unstarImages.matchFulfilled,effect:async(e,{dispatch:t,getState:n})=>{const{updated_image_names:r}=e.payload,i=n(),{selection:o}=i.gallery,a=[];o.forEach(s=>{r.includes(s.image_name)?a.push({...s,starred:!1}):a.push(s)}),t(pU(a))}})},YEe=Ne("generation/initialImageSelected"),ZEe=Ne("generation/modelSelected"),JEe=()=>{Fe({actionCreator:YEe,effect:(e,{dispatch:t})=>{if(!e.payload){t(qt(Ld({title:Y("toast.imageNotLoadedDesc"),status:"error"})));return}t(ZS(e.payload)),t(qt(Ld(Y("toast.sentToImageToImage"))))}})},eTe=()=>{Fe({actionCreator:ZEe,effect:(e,{getState:t,dispatch:n})=>{var l,u;const r=_e("models"),i=t(),o=cy.safeParse(e.payload);if(!o.success){r.error({error:o.error.format()},"Failed to parse main model");return}const a=o.data,{base_model:s}=a;if(((l=i.generation.model)==null?void 0:l.base_model)!==s){let c=0;Ea(i.lora.loras,(p,m)=>{p.base_model!==s&&(n(mU(m)),c+=1)});const{vae:d}=i.generation;d&&d.base_model!==s&&(n(EB(null)),c+=1);const{controlNets:f}=i.controlNet;Ea(f,(p,m)=>{var _;((_=p.model)==null?void 0:_.base_model)!==s&&(n(aU({controlNetId:m})),c+=1)});const{ipAdapterInfo:h}=i.controlNet;h.model&&h.model.base_model!==s&&(n(uU()),c+=1),c>0&&n(qt(Ld({title:`${Y("toast.baseModelChangedCleared")} ${c} ${Y("toast.incompatibleSubmodel")}${c===1?"":"s"}`,status:"warning"})))}((u=i.generation.model)==null?void 0:u.base_model)!==a.base_model&&i.ui.shouldAutoChangeDimensions&&(["sdxl","sdxl-refiner"].includes(a.base_model)?(n(tI(1024)),n(nI(1024)),n(rI({width:1024,height:1024}))):(n(tI(512)),n(nI(512)),n(rI({width:512,height:512})))),n($u(a))}})},x0=ds({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),zO=ds({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),jO=ds({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),UO=ds({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),iT=ds({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),VO=ds({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),GO=ds({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),oT=ds({sortComparer:(e,t)=>e.model_name.localeCompare(t.model_name)}),tTe=({base_model:e,model_type:t,model_name:n})=>`${e}/${t}/${n}`,fu=e=>{const t=[];return e.forEach(n=>{const r={...Cn(n),id:tTe(n)};t.push(r)}),t},vl=us.injectEndpoints({endpoints:e=>({getOnnxModels:e.query({query:t=>{const n={model_type:"onnx",base_models:t};return`models/?${Qg.stringify(n,{arrayFormat:"none"})}`},providesTags:t=>{const n=[{type:"OnnxModel",id:Mt}];return t&&n.push(...t.ids.map(r=>({type:"OnnxModel",id:r}))),n},transformResponse:t=>{const n=fu(t.models);return zO.setAll(zO.getInitialState(),n)}}),getMainModels:e.query({query:t=>{const n={model_type:"main",base_models:t};return`models/?${Qg.stringify(n,{arrayFormat:"none"})}`},providesTags:t=>{const n=[{type:"MainModel",id:Mt}];return t&&n.push(...t.ids.map(r=>({type:"MainModel",id:r}))),n},transformResponse:t=>{const n=fu(t.models);return x0.setAll(x0.getInitialState(),n)}}),updateMainModels:e.mutation({query:({base_model:t,model_name:n,body:r})=>({url:`models/${t}/main/${n}`,method:"PATCH",body:r}),invalidatesTags:[{type:"MainModel",id:Mt},{type:"SDXLRefinerModel",id:Mt},{type:"OnnxModel",id:Mt}]}),importMainModels:e.mutation({query:({body:t})=>({url:"models/import",method:"POST",body:t}),invalidatesTags:[{type:"MainModel",id:Mt},{type:"SDXLRefinerModel",id:Mt},{type:"OnnxModel",id:Mt}]}),addMainModels:e.mutation({query:({body:t})=>({url:"models/add",method:"POST",body:t}),invalidatesTags:[{type:"MainModel",id:Mt},{type:"SDXLRefinerModel",id:Mt},{type:"OnnxModel",id:Mt}]}),deleteMainModels:e.mutation({query:({base_model:t,model_name:n,model_type:r})=>({url:`models/${t}/${r}/${n}`,method:"DELETE"}),invalidatesTags:[{type:"MainModel",id:Mt},{type:"SDXLRefinerModel",id:Mt},{type:"OnnxModel",id:Mt}]}),convertMainModels:e.mutation({query:({base_model:t,model_name:n,convert_dest_directory:r})=>({url:`models/convert/${t}/main/${n}`,method:"PUT",params:{convert_dest_directory:r}}),invalidatesTags:[{type:"MainModel",id:Mt},{type:"SDXLRefinerModel",id:Mt},{type:"OnnxModel",id:Mt}]}),mergeMainModels:e.mutation({query:({base_model:t,body:n})=>({url:`models/merge/${t}`,method:"PUT",body:n}),invalidatesTags:[{type:"MainModel",id:Mt},{type:"SDXLRefinerModel",id:Mt},{type:"OnnxModel",id:Mt}]}),syncModels:e.mutation({query:()=>({url:"models/sync",method:"POST"}),invalidatesTags:[{type:"MainModel",id:Mt},{type:"SDXLRefinerModel",id:Mt},{type:"OnnxModel",id:Mt}]}),getLoRAModels:e.query({query:()=>({url:"models/",params:{model_type:"lora"}}),providesTags:t=>{const n=[{type:"LoRAModel",id:Mt}];return t&&n.push(...t.ids.map(r=>({type:"LoRAModel",id:r}))),n},transformResponse:t=>{const n=fu(t.models);return jO.setAll(jO.getInitialState(),n)}}),updateLoRAModels:e.mutation({query:({base_model:t,model_name:n,body:r})=>({url:`models/${t}/lora/${n}`,method:"PATCH",body:r}),invalidatesTags:[{type:"LoRAModel",id:Mt}]}),deleteLoRAModels:e.mutation({query:({base_model:t,model_name:n})=>({url:`models/${t}/lora/${n}`,method:"DELETE"}),invalidatesTags:[{type:"LoRAModel",id:Mt}]}),getControlNetModels:e.query({query:()=>({url:"models/",params:{model_type:"controlnet"}}),providesTags:t=>{const n=[{type:"ControlNetModel",id:Mt}];return t&&n.push(...t.ids.map(r=>({type:"ControlNetModel",id:r}))),n},transformResponse:t=>{const n=fu(t.models);return UO.setAll(UO.getInitialState(),n)}}),getIPAdapterModels:e.query({query:()=>({url:"models/",params:{model_type:"ip_adapter"}}),providesTags:t=>{const n=[{type:"IPAdapterModel",id:Mt}];return t&&n.push(...t.ids.map(r=>({type:"IPAdapterModel",id:r}))),n},transformResponse:t=>{const n=fu(t.models);return iT.setAll(iT.getInitialState(),n)}}),getT2IAdapterModels:e.query({query:()=>({url:"models/",params:{model_type:"t2i_adapter"}}),providesTags:t=>{const n=[{type:"T2IAdapterModel",id:Mt}];return t&&n.push(...t.ids.map(r=>({type:"T2IAdapterModel",id:r}))),n},transformResponse:t=>{const n=fu(t.models);return VO.setAll(VO.getInitialState(),n)}}),getVaeModels:e.query({query:()=>({url:"models/",params:{model_type:"vae"}}),providesTags:t=>{const n=[{type:"VaeModel",id:Mt}];return t&&n.push(...t.ids.map(r=>({type:"VaeModel",id:r}))),n},transformResponse:t=>{const n=fu(t.models);return oT.setAll(oT.getInitialState(),n)}}),getTextualInversionModels:e.query({query:()=>({url:"models/",params:{model_type:"embedding"}}),providesTags:t=>{const n=[{type:"TextualInversionModel",id:Mt}];return t&&n.push(...t.ids.map(r=>({type:"TextualInversionModel",id:r}))),n},transformResponse:t=>{const n=fu(t.models);return GO.setAll(GO.getInitialState(),n)}}),getModelsInFolder:e.query({query:t=>({url:`/models/search?${Qg.stringify(t,{})}`}),providesTags:t=>{const n=[{type:"ScannedModels",id:Mt}];return t&&n.push(...t.map(r=>({type:"ScannedModels",id:r}))),n}}),getCheckpointConfigs:e.query({query:()=>({url:"/models/ckpt_confs"})})})}),{useGetMainModelsQuery:mKe,useGetOnnxModelsQuery:yKe,useGetControlNetModelsQuery:vKe,useGetIPAdapterModelsQuery:bKe,useGetT2IAdapterModelsQuery:_Ke,useGetLoRAModelsQuery:SKe,useGetTextualInversionModelsQuery:xKe,useGetVaeModelsQuery:wKe,useUpdateMainModelsMutation:CKe,useDeleteMainModelsMutation:EKe,useImportMainModelsMutation:TKe,useAddMainModelsMutation:kKe,useConvertMainModelsMutation:AKe,useMergeMainModelsMutation:PKe,useDeleteLoRAModelsMutation:IKe,useUpdateLoRAModelsMutation:RKe,useSyncModelsMutation:OKe,useGetModelsInFolderQuery:MKe,useGetCheckpointConfigsQuery:NKe}=vl,nTe=()=>{Fe({predicate:e=>vl.endpoints.getMainModels.matchFulfilled(e)&&!e.meta.arg.originalArgs.includes("sdxl-refiner"),effect:async(e,{getState:t,dispatch:n})=>{const r=_e("models");r.info({models:e.payload.entities},`Main models loaded (${e.payload.ids.length})`);const i=t().generation.model,o=x0.getSelectors().selectAll(e.payload);if(o.length===0){n($u(null));return}if(i?o.some(l=>l.model_name===i.model_name&&l.base_model===i.base_model&&l.model_type===i.model_type):!1)return;const s=cy.safeParse(o[0]);if(!s.success){r.error({error:s.error.format()},"Failed to parse main model");return}n($u(s.data))}}),Fe({predicate:e=>vl.endpoints.getMainModels.matchFulfilled(e)&&e.meta.arg.originalArgs.includes("sdxl-refiner"),effect:async(e,{getState:t,dispatch:n})=>{const r=_e("models");r.info({models:e.payload.entities},`SDXL Refiner models loaded (${e.payload.ids.length})`);const i=t().sdxl.refinerModel,o=x0.getSelectors().selectAll(e.payload);if(o.length===0){n(K9(null)),n(p2e(!1));return}if(i?o.some(l=>l.model_name===i.model_name&&l.base_model===i.base_model&&l.model_type===i.model_type):!1)return;const s=mk.safeParse(o[0]);if(!s.success){r.error({error:s.error.format()},"Failed to parse SDXL Refiner Model");return}n(K9(s.data))}}),Fe({matcher:vl.endpoints.getVaeModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{const r=_e("models");r.info({models:e.payload.entities},`VAEs loaded (${e.payload.ids.length})`);const i=t().generation.vae;if(i===null||zf(e.payload.entities,l=>(l==null?void 0:l.model_name)===(i==null?void 0:i.model_name)&&(l==null?void 0:l.base_model)===(i==null?void 0:i.base_model)))return;const a=oT.getSelectors().selectAll(e.payload)[0];if(!a){n($u(null));return}const s=qse.safeParse(a);if(!s.success){r.error({error:s.error.format()},"Failed to parse VAE model");return}n(EB(s.data))}}),Fe({matcher:vl.endpoints.getLoRAModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{_e("models").info({models:e.payload.entities},`LoRAs loaded (${e.payload.ids.length})`);const i=t().lora.loras;Ea(i,(o,a)=>{zf(e.payload.entities,l=>(l==null?void 0:l.model_name)===(o==null?void 0:o.model_name)&&(l==null?void 0:l.base_model)===(o==null?void 0:o.base_model))||n(mU(a))})}}),Fe({matcher:vl.endpoints.getControlNetModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{_e("models").info({models:e.payload.entities},`ControlNet models loaded (${e.payload.ids.length})`);const i=t().controlNet.controlNets;Ea(i,(o,a)=>{zf(e.payload.entities,l=>{var u,c;return(l==null?void 0:l.model_name)===((u=o==null?void 0:o.model)==null?void 0:u.model_name)&&(l==null?void 0:l.base_model)===((c=o==null?void 0:o.model)==null?void 0:c.base_model)})||n(aU({controlNetId:a}))})}}),Fe({matcher:vl.endpoints.getIPAdapterModels.matchFulfilled,effect:async(e,{getState:t,dispatch:n})=>{const r=_e("models");r.info({models:e.payload.entities},`IP Adapter models loaded (${e.payload.ids.length})`);const{model:i}=t().controlNet.ipAdapterInfo;if(zf(e.payload.entities,l=>(l==null?void 0:l.model_name)===(i==null?void 0:i.model_name)&&(l==null?void 0:l.base_model)===(i==null?void 0:i.base_model)))return;const a=iT.getSelectors().selectAll(e.payload)[0];a||n(qR(null));const s=FB.safeParse(a);if(!s.success){r.error({error:s.error.format()},"Failed to parse IP Adapter model");return}n(qR(s.data))}}),Fe({matcher:vl.endpoints.getTextualInversionModels.matchFulfilled,effect:async e=>{_e("models").info({models:e.payload.entities},`Embeddings loaded (${e.payload.ids.length})`)}})},rTe=us.injectEndpoints({endpoints:e=>({dynamicPrompts:e.query({query:t=>({url:"utilities/dynamicprompts",body:t,method:"POST"}),keepUnusedDataFor:86400})})}),iTe=$o(tle,k0e,E0e,T0e,Vk),oTe=()=>{Fe({matcher:iTe,effect:async(e,{dispatch:t,getState:n,cancelActiveListeners:r,delay:i})=>{r(),await i(1e3);const o=n();if(o.config.disabledFeatures.includes("dynamicPrompting"))return;const{positivePrompt:a}=o.generation,{maxPrompts:s}=o.dynamicPrompts;t(MC(!0));try{const l=t(rTe.endpoints.dynamicPrompts.initiate({prompt:a,max_prompts:s})),u=await l.unwrap();l.unsubscribe(),t(A0e(u.prompts)),t(P0e(u.error)),t(HR(!1)),t(MC(!1))}catch{t(HR(!0)),t(MC(!1))}}})},bf=e=>e.$ref.split("/").slice(-1)[0],aTe=({schemaObject:e,baseField:t})=>{const n={...t,type:"integer",default:e.default??0};return e.multipleOf!==void 0&&(n.multipleOf=e.multipleOf),e.maximum!==void 0&&(n.maximum=e.maximum),e.exclusiveMaximum!==void 0&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&(n.exclusiveMinimum=e.exclusiveMinimum),n},sTe=({schemaObject:e,baseField:t})=>{const n={...t,type:"IntegerPolymorphic",default:e.default??0};return e.multipleOf!==void 0&&(n.multipleOf=e.multipleOf),e.maximum!==void 0&&(n.maximum=e.maximum),e.exclusiveMaximum!==void 0&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&(n.exclusiveMinimum=e.exclusiveMinimum),n},lTe=({schemaObject:e,baseField:t})=>{const n=rB(e.item_default)&&Moe(e.item_default)?e.item_default:0;return{...t,type:"IntegerCollection",default:e.default??[],item_default:n}},uTe=({schemaObject:e,baseField:t})=>{const n={...t,type:"float",default:e.default??0};return e.multipleOf!==void 0&&(n.multipleOf=e.multipleOf),e.maximum!==void 0&&(n.maximum=e.maximum),e.exclusiveMaximum!==void 0&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&(n.exclusiveMinimum=e.exclusiveMinimum),n},cTe=({schemaObject:e,baseField:t})=>{const n={...t,type:"FloatPolymorphic",default:e.default??0};return e.multipleOf!==void 0&&(n.multipleOf=e.multipleOf),e.maximum!==void 0&&(n.maximum=e.maximum),e.exclusiveMaximum!==void 0&&(n.exclusiveMaximum=e.exclusiveMaximum),e.minimum!==void 0&&(n.minimum=e.minimum),e.exclusiveMinimum!==void 0&&(n.exclusiveMinimum=e.exclusiveMinimum),n},dTe=({schemaObject:e,baseField:t})=>{const n=rB(e.item_default)?e.item_default:0;return{...t,type:"FloatCollection",default:e.default??[],item_default:n}},fTe=({schemaObject:e,baseField:t})=>{const n={...t,type:"string",default:e.default??""};return e.minLength!==void 0&&(n.minLength=e.minLength),e.maxLength!==void 0&&(n.maxLength=e.maxLength),e.pattern!==void 0&&(n.pattern=e.pattern),n},hTe=({schemaObject:e,baseField:t})=>{const n={...t,type:"StringPolymorphic",default:e.default??""};return e.minLength!==void 0&&(n.minLength=e.minLength),e.maxLength!==void 0&&(n.maxLength=e.maxLength),e.pattern!==void 0&&(n.pattern=e.pattern),n},pTe=({schemaObject:e,baseField:t})=>{const n=hk(e.item_default)?e.item_default:"";return{...t,type:"StringCollection",default:e.default??[],item_default:n}},gTe=({schemaObject:e,baseField:t})=>({...t,type:"boolean",default:e.default??!1}),mTe=({schemaObject:e,baseField:t})=>({...t,type:"BooleanPolymorphic",default:e.default??!1}),yTe=({schemaObject:e,baseField:t})=>{const n=e.item_default&&Ooe(e.item_default)?e.item_default:!1;return{...t,type:"BooleanCollection",default:e.default??[],item_default:n}},vTe=({schemaObject:e,baseField:t})=>({...t,type:"MainModelField",default:e.default??void 0}),bTe=({schemaObject:e,baseField:t})=>({...t,type:"SDXLMainModelField",default:e.default??void 0}),_Te=({schemaObject:e,baseField:t})=>({...t,type:"SDXLRefinerModelField",default:e.default??void 0}),STe=({schemaObject:e,baseField:t})=>({...t,type:"VaeModelField",default:e.default??void 0}),xTe=({schemaObject:e,baseField:t})=>({...t,type:"LoRAModelField",default:e.default??void 0}),wTe=({schemaObject:e,baseField:t})=>({...t,type:"ControlNetModelField",default:e.default??void 0}),CTe=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterModelField",default:e.default??void 0}),ETe=({schemaObject:e,baseField:t})=>({...t,type:"T2IAdapterModelField",default:e.default??void 0}),TTe=({schemaObject:e,baseField:t})=>({...t,type:"BoardField",default:e.default??void 0}),kTe=({schemaObject:e,baseField:t})=>({...t,type:"ImageField",default:e.default??void 0}),ATe=({schemaObject:e,baseField:t})=>({...t,type:"ImagePolymorphic",default:e.default??void 0}),PTe=({schemaObject:e,baseField:t})=>({...t,type:"ImageCollection",default:e.default??[],item_default:e.item_default??void 0}),ITe=({schemaObject:e,baseField:t})=>({...t,type:"DenoiseMaskField",default:e.default??void 0}),RTe=({schemaObject:e,baseField:t})=>({...t,type:"LatentsField",default:e.default??void 0}),OTe=({schemaObject:e,baseField:t})=>({...t,type:"LatentsPolymorphic",default:e.default??void 0}),MTe=({schemaObject:e,baseField:t})=>({...t,type:"LatentsCollection",default:e.default??[],item_default:e.item_default??void 0}),NTe=({schemaObject:e,baseField:t})=>({...t,type:"ConditioningField",default:e.default??void 0}),$Te=({schemaObject:e,baseField:t})=>({...t,type:"ConditioningPolymorphic",default:e.default??void 0}),DTe=({schemaObject:e,baseField:t})=>({...t,type:"ConditioningCollection",default:e.default??[],item_default:e.item_default??void 0}),LTe=({schemaObject:e,baseField:t})=>({...t,type:"UNetField",default:e.default??void 0}),FTe=({schemaObject:e,baseField:t})=>({...t,type:"ClipField",default:e.default??void 0}),BTe=({schemaObject:e,baseField:t})=>({...t,type:"VaeField",default:e.default??void 0}),zTe=({schemaObject:e,baseField:t})=>({...t,type:"ControlField",default:e.default??void 0}),jTe=({schemaObject:e,baseField:t})=>({...t,type:"ControlPolymorphic",default:e.default??void 0}),UTe=({schemaObject:e,baseField:t})=>({...t,type:"ControlCollection",default:e.default??[],item_default:e.item_default??void 0}),VTe=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterField",default:e.default??void 0}),GTe=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterPolymorphic",default:e.default??void 0}),qTe=({schemaObject:e,baseField:t})=>({...t,type:"IPAdapterCollection",default:e.default??[],item_default:e.item_default??void 0}),HTe=({schemaObject:e,baseField:t})=>({...t,type:"T2IAdapterField",default:e.default??void 0}),WTe=({schemaObject:e,baseField:t})=>({...t,type:"T2IAdapterPolymorphic",default:e.default??void 0}),KTe=({schemaObject:e,baseField:t})=>({...t,type:"T2IAdapterCollection",default:e.default??[],item_default:e.item_default??void 0}),QTe=({schemaObject:e,baseField:t})=>{const n=e.enum??[];return{...t,type:"enum",options:n,ui_choice_labels:e.ui_choice_labels,default:e.default??n[0]}},XTe=({baseField:e})=>({...e,type:"Collection",default:[]}),YTe=({baseField:e})=>({...e,type:"CollectionItem",default:void 0}),ZTe=({schemaObject:e,baseField:t})=>({...t,type:"ColorField",default:e.default??{r:127,g:127,b:127,a:255}}),JTe=({schemaObject:e,baseField:t})=>({...t,type:"ColorPolymorphic",default:e.default??{r:127,g:127,b:127,a:255}}),e4e=({schemaObject:e,baseField:t})=>({...t,type:"ColorCollection",default:e.default??[]}),t4e=({schemaObject:e,baseField:t})=>({...t,type:"Scheduler",default:e.default??"euler"}),qO=e=>{if(e!=null&&e.ui_type)return e.ui_type;if(e.type){if(e.enum)return"enum";if(e.type){if(e.type==="number")return"float";if(e.type==="array"){const t=rce(e.items)?e.items.type:bf(e.items);return fSe(t)?mA[t]:void 0}else return e.type}}else if(e.allOf){const t=e.allOf;if(t&&t[0]&&Hp(t[0]))return bf(t[0])}else if(e.anyOf){const t=e.anyOf;let n,r;if(pI(t[0])){const i=t[0].items,o=t[1];Hp(i)&&Hp(o)?(n=bf(i),r=bf(o)):yv(i)&&yv(o)&&(n=i.type,r=o.type)}else if(pI(t[1])){const i=t[0],o=t[1].items;Hp(i)&&Hp(o)?(n=bf(i),r=bf(o)):yv(i)&&yv(o)&&(n=i.type,r=o.type)}if(n===r&&pSe(n))return FV[n]}},dq={BoardField:TTe,boolean:gTe,BooleanCollection:yTe,BooleanPolymorphic:mTe,ClipField:FTe,Collection:XTe,CollectionItem:YTe,ColorCollection:e4e,ColorField:ZTe,ColorPolymorphic:JTe,ConditioningCollection:DTe,ConditioningField:NTe,ConditioningPolymorphic:$Te,ControlCollection:UTe,ControlField:zTe,ControlNetModelField:wTe,ControlPolymorphic:jTe,DenoiseMaskField:ITe,enum:QTe,float:uTe,FloatCollection:dTe,FloatPolymorphic:cTe,ImageCollection:PTe,ImageField:kTe,ImagePolymorphic:ATe,integer:aTe,IntegerCollection:lTe,IntegerPolymorphic:sTe,IPAdapterCollection:qTe,IPAdapterField:VTe,IPAdapterModelField:CTe,IPAdapterPolymorphic:GTe,LatentsCollection:MTe,LatentsField:RTe,LatentsPolymorphic:OTe,LoRAModelField:xTe,MainModelField:vTe,Scheduler:t4e,SDXLMainModelField:bTe,SDXLRefinerModelField:_Te,string:fTe,StringCollection:pTe,StringPolymorphic:hTe,T2IAdapterCollection:KTe,T2IAdapterField:HTe,T2IAdapterModelField:ETe,T2IAdapterPolymorphic:WTe,UNetField:LTe,VaeField:BTe,VaeModelField:STe},n4e=e=>!!(e&&e in dq),r4e=(e,t,n,r)=>{var f;const{input:i,ui_hidden:o,ui_component:a,ui_type:s,ui_order:l}=t,u={input:Cg.includes(r)?"connection":i,ui_hidden:o,ui_component:a,ui_type:s,required:((f=e.required)==null?void 0:f.includes(n))??!1,ui_order:l},c={name:n,title:t.title??"",description:t.description??"",fieldKind:"input",...u};if(!n4e(r))return;const d=dq[r];if(d)return d({schemaObject:t,baseField:c})},i4e=["id","type","metadata","use_cache"],o4e=["type"],a4e=["WorkflowField","MetadataField","IsIntermediate"],s4e=["graph","metadata_accumulator"],l4e=(e,t)=>!!(i4e.includes(t)||e==="collect"&&t==="collection"||e==="iterate"&&t==="index"),u4e=e=>!!a4e.includes(e),c4e=(e,t)=>!o4e.includes(t),d4e=e=>!s4e.includes(e.properties.type.default),f4e=(e,t=void 0,n=void 0)=>{var o;return Object.values(((o=e.components)==null?void 0:o.schemas)??{}).filter(ice).filter(d4e).filter(a=>t?t.includes(a.properties.type.default):!0).filter(a=>n?!n.includes(a.properties.type.default):!0).reduce((a,s)=>{var v,S;const l=s.properties.type.default,u=s.title.replace("Invocation",""),c=s.tags??[],d=s.description??"",f=s.version,h=eE(s.properties,(w,x,C)=>{if(l4e(l,C))return _e("nodes").trace({node:l,fieldName:C,field:Xt(x)},"Skipped reserved input field"),w;if(!gI(x))return _e("nodes").warn({node:l,propertyName:C,property:Xt(x)},"Unhandled input property"),w;const k=qO(x);if(!hI(k))return _e("nodes").warn({node:l,fieldName:C,fieldType:k,field:Xt(x)},"Skipping unknown input field type"),w;if(u4e(k))return _e("nodes").trace({node:l,fieldName:C,fieldType:k,field:Xt(x)},"Skipping reserved field type"),w;const T=r4e(s,x,C,k);return T?(w[C]=T,w):(_e("nodes").debug({node:l,fieldName:C,fieldType:k,field:Xt(x)},"Skipping input field with no template"),w)},{}),p=s.output.$ref.split("/").pop();if(!p)return _e("nodes").warn({outputRefObject:Xt(s.output)},"No output schema name found in ref object"),a;const m=(S=(v=e.components)==null?void 0:v.schemas)==null?void 0:S[p];if(!m)return _e("nodes").warn({outputSchemaName:p},"Output schema not found"),a;if(!oce(m))return _e("nodes").error({outputSchema:Xt(m)},"Invalid output schema"),a;const _=m.properties.type.default,b=eE(m.properties,(w,x,C)=>{if(!c4e(l,C))return _e("nodes").trace({type:l,propertyName:C,property:Xt(x)},"Skipped reserved output field"),w;if(!gI(x))return _e("nodes").warn({type:l,propertyName:C,property:Xt(x)},"Unhandled output property"),w;const k=qO(x);return hI(k)?(w[C]={fieldKind:"output",name:C,title:x.title??"",description:x.description??"",type:k,ui_hidden:x.ui_hidden??!1,ui_type:x.ui_type,ui_order:x.ui_order},w):(_e("nodes").warn({fieldName:C,fieldType:k,field:Xt(x)},"Skipping unknown output field type"),w)},{}),y=s.properties.use_cache.default,g={title:u,type:l,version:f,tags:c,description:d,outputType:_,inputs:h,outputs:b,useCache:y};return Object.assign(a,{[l]:g}),a},{})},h4e=()=>{Fe({actionCreator:y0.fulfilled,effect:(e,{dispatch:t,getState:n})=>{const r=_e("system"),i=e.payload;r.debug({schemaJSON:i},"Received OpenAPI schema");const{nodesAllowlist:o,nodesDenylist:a}=n().config,s=f4e(i,o,a);r.debug({nodeTemplates:Xt(s)},`Built ${QS(s)} node templates`),t(KV(s))}}),Fe({actionCreator:y0.rejected,effect:e=>{_e("system").error({error:Xt(e.error)},"Problem retrieving OpenAPI Schema")}})},p4e=()=>{Fe({actionCreator:jj,effect:(e,{dispatch:t,getState:n})=>{_e("socketio").debug("Connected");const{nodes:i,config:o,system:a}=n(),{disabledTabs:s}=o;!QS(i.nodeTemplates)&&!s.includes("nodes")&&t(y0()),a.isInitialized?t(us.util.resetApiState()):t(b2e(!0)),t(Vk(e.payload))}})},g4e=()=>{Fe({actionCreator:Uj,effect:(e,{dispatch:t})=>{_e("socketio").debug("Disconnected"),t(Vj(e.payload))}})},m4e=()=>{Fe({actionCreator:Kj,effect:(e,{dispatch:t})=>{_e("socketio").trace(e.payload,"Generator progress"),t(Wk(e.payload))}})},y4e=()=>{Fe({actionCreator:Hj,effect:(e,{dispatch:t})=>{_e("socketio").debug(e.payload,"Session complete"),t(Wj(e.payload))}})},v4e=["load_image","image"],b4e=()=>{Fe({actionCreator:qk,effect:async(e,{dispatch:t,getState:n})=>{const r=_e("socketio"),{data:i}=e.payload;r.debug({data:Xt(i)},`Invocation complete (${e.payload.data.node.type})`);const{result:o,node:a,queue_batch_id:s}=i;if(nq(o)&&!v4e.includes(a.type)){const{image_name:l}=o.image,{canvas:u,gallery:c}=n(),d=await t(ve.endpoints.getImageDTO.initiate(l)).unwrap();if(u.batchIds.includes(s)&&[me].includes(i.source_node_id)&&t(lle(d)),!d.is_intermediate){t(ve.util.updateQueryData("listImages",{board_id:d.board_id??"none",categories:oi},h=>{Gn.addOne(h,d)})),t(Ft.util.updateQueryData("getBoardImagesTotal",d.board_id??"none",h=>{h.total+=1})),t(ve.util.invalidateTags([{type:"Board",id:d.board_id??"none"}]));const{shouldAutoSwitch:f}=c;f&&(c.galleryView!=="images"&&t(CE("images")),d.board_id&&d.board_id!==c.selectedBoardId&&t(E_({boardId:d.board_id,selectedImageName:d.image_name})),!d.board_id&&c.selectedBoardId!=="none"&&t(E_({boardId:"none",selectedImageName:d.image_name})),t(Gs(d)))}}t(Hk(e.payload))}})},_4e=()=>{Fe({actionCreator:qj,effect:(e,{dispatch:t})=>{_e("socketio").error(e.payload,`Invocation error (${e.payload.data.node.type})`),t(G2(e.payload))}})},S4e=()=>{Fe({actionCreator:tU,effect:(e,{dispatch:t})=>{_e("socketio").error(e.payload,`Invocation retrieval error (${e.payload.data.graph_execution_state_id})`),t(nU(e.payload))}})},x4e=()=>{Fe({actionCreator:Gj,effect:(e,{dispatch:t})=>{_e("socketio").debug(e.payload,`Invocation started (${e.payload.data.node.type})`),t(Gk(e.payload))}})},w4e=()=>{Fe({actionCreator:Qj,effect:(e,{dispatch:t})=>{const n=_e("socketio"),{base_model:r,model_name:i,model_type:o,submodel:a}=e.payload.data;let s=`Model load started: ${r}/${o}/${i}`;a&&(s=s.concat(`/${a}`)),n.debug(e.payload,s),t(Xj(e.payload))}}),Fe({actionCreator:Yj,effect:(e,{dispatch:t})=>{const n=_e("socketio"),{base_model:r,model_name:i,model_type:o,submodel:a}=e.payload.data;let s=`Model load complete: ${r}/${o}/${i}`;a&&(s=s.concat(`/${a}`)),n.debug(e.payload,s),t(Zj(e.payload))}})},C4e=()=>{Fe({actionCreator:rU,effect:async(e,{dispatch:t})=>{const n=_e("socketio"),{queue_item_id:r,queue_batch_id:i,status:o}=e.payload.data;n.debug(e.payload,`Queue item ${r} status updated: ${o}`),t(Kk(e.payload)),t(Xr.util.updateQueryData("listQueueItems",void 0,s=>{Kc.updateOne(s,{id:r,changes:e.payload.data})})),t(Xr.util.invalidateTags(["CurrentSessionQueueItem","NextSessionQueueItem","InvocationCacheStatus",{type:"SessionQueueItem",id:r},{type:"SessionQueueItemDTO",id:r},{type:"BatchStatus",id:i}]));const a=t(Xr.endpoints.getQueueStatus.initiate(void 0,{forceRefetch:!0}));await a.unwrap(),a.unsubscribe()}})},E4e=()=>{Fe({actionCreator:Jj,effect:(e,{dispatch:t})=>{_e("socketio").error(e.payload,`Session retrieval error (${e.payload.data.graph_execution_state_id})`),t(eU(e.payload))}})},T4e=()=>{Fe({actionCreator:f0e,effect:(e,{dispatch:t})=>{_e("socketio").debug(e.payload,"Subscribed"),t(h0e(e.payload))}})},k4e=()=>{Fe({actionCreator:p0e,effect:(e,{dispatch:t})=>{_e("socketio").debug(e.payload,"Unsubscribed"),t(g0e(e.payload))}})},A4e=()=>{Fe({actionCreator:jxe,effect:async(e,{dispatch:t,getState:n})=>{const{imageDTO:r}=e.payload;try{const i=await t(ve.endpoints.changeImageIsIntermediate.initiate({imageDTO:r,is_intermediate:!1})).unwrap(),{autoAddBoardId:o}=n().gallery;o&&o!=="none"&&await t(ve.endpoints.addImageToBoard.initiate({imageDTO:i,board_id:o})),t(qt({title:Y("toast.imageSaved"),status:"success"}))}catch(i){t(qt({title:Y("toast.imageSavingFailed"),description:i==null?void 0:i.message,status:"error"}))}}})},$Ke=["sd-1","sd-2","sdxl","sdxl-refiner"],P4e=["sd-1","sd-2","sdxl"],DKe=["sdxl"],LKe=["sd-1","sd-2"],FKe=["sdxl-refiner"],I4e=()=>{Fe({actionCreator:sG,effect:async(e,{getState:t,dispatch:n})=>{var i;if(e.payload==="unifiedCanvas"){const o=(i=t().generation.model)==null?void 0:i.base_model;if(o&&["sd-1","sd-2","sdxl"].includes(o))return;try{const a=n(vl.endpoints.getMainModels.initiate(P4e)),s=await a.unwrap();if(a.unsubscribe(),!s.ids.length){n($u(null));return}const u=x0.getSelectors().selectAll(s).filter(h=>["sd-1","sd-2","sxdl"].includes(h.base_model))[0];if(!u){n($u(null));return}const{base_model:c,model_name:d,model_type:f}=u;n($u({base_model:c,model_name:d,model_type:f}))}catch{n($u(null))}}}})},R4e=({image_name:e,esrganModelName:t,autoAddBoardId:n})=>{const r={id:i5,type:"esrgan",image:{image_name:e},model_name:t,is_intermediate:!0},i={id:Ja,type:"save_image",use_cache:!1,is_intermediate:!1,board:n==="none"?void 0:{board_id:n}};return{id:"adhoc-esrgan-graph",nodes:{[i5]:r,[Ja]:i},edges:[{source:{node_id:i5,field:"image"},destination:{node_id:Ja,field:"image"}}]}},O4e=()=>Rj(),fq=wj;function M4e(){if(console&&console.warn){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t)}}const HO={};function aT(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&HO[t[0]]||(typeof t[0]=="string"&&(HO[t[0]]=new Date),M4e(...t))}const hq=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}};function WO(e,t,n){e.loadNamespaces(t,hq(e,n))}function KO(e,t,n,r){typeof n=="string"&&(n=[n]),n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,hq(e,r))}function N4e(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=t.languages[0],i=t.options?t.options.fallbackLng:!1,o=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const u=t.services.backendConnector.state[`${s}|${l}`];return u===-1||u===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!i||a(o,e)))}function $4e(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!t.languages||!t.languages.length?(aT("i18n.languages were undefined or empty",t.languages),!0):t.options.ignoreJSONStructure!==void 0?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(i,o)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!o(i.isLanguageChangingTo,e))return!1}}):N4e(e,t,n)}const D4e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,L4e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},F4e=e=>L4e[e],B4e=e=>e.replace(D4e,F4e);let sT={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:B4e};function z4e(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sT={...sT,...e}}function j4e(){return sT}let pq;function U4e(e){pq=e}function V4e(){return pq}const G4e={type:"3rdParty",init(e){z4e(e.options.react),U4e(e)}},q4e=I.createContext();class H4e{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const W4e=(e,t)=>{const n=I.useRef();return I.useEffect(()=>{n.current=t?n.current:e},[e,t]),n.current};function K4e(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=t,{i18n:r,defaultNS:i}=I.useContext(q4e)||{},o=n||r||V4e();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new H4e),!o){aT("You will need to pass in an i18next instance by using initReactI18next");const g=(S,w)=>typeof w=="string"?w:w&&typeof w=="object"&&typeof w.defaultValue=="string"?w.defaultValue:Array.isArray(S)?S[S.length-1]:S,v=[g,{},!1];return v.t=g,v.i18n={},v.ready=!1,v}o.options.react&&o.options.react.wait!==void 0&&aT("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...j4e(),...o.options.react,...t},{useSuspense:s,keyPrefix:l}=a;let u=e||i||o.options&&o.options.defaultNS;u=typeof u=="string"?[u]:u||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(u);const c=(o.isInitialized||o.initializedStoreOnce)&&u.every(g=>$4e(g,o,a));function d(){return o.getFixedT(t.lng||null,a.nsMode==="fallback"?u:u[0],l)}const[f,h]=I.useState(d);let p=u.join();t.lng&&(p=`${t.lng}${p}`);const m=W4e(p),_=I.useRef(!0);I.useEffect(()=>{const{bindI18n:g,bindI18nStore:v}=a;_.current=!0,!c&&!s&&(t.lng?KO(o,t.lng,u,()=>{_.current&&h(d)}):WO(o,u,()=>{_.current&&h(d)})),c&&m&&m!==p&&_.current&&h(d);function S(){_.current&&h(d)}return g&&o&&o.on(g,S),v&&o&&o.store.on(v,S),()=>{_.current=!1,g&&o&&g.split(" ").forEach(w=>o.off(w,S)),v&&o&&v.split(" ").forEach(w=>o.store.off(w,S))}},[o,p]);const b=I.useRef(!0);I.useEffect(()=>{_.current&&!b.current&&h(d),b.current=!1},[o,l]);const y=[f,o,c];if(y.t=f,y.i18n=o,y.ready=c,c||!c&&!s)return y;throw new Promise(g=>{t.lng?KO(o,t.lng,u,()=>g()):WO(o,u,()=>g())})}const Q4e=(e,t)=>{if(!e||!t)return;const{width:n,height:r}=e,i=r*4*n*4,o=r*2*n*2;return{x4:i,x2:o}},X4e=(e,t)=>{if(!e||!t)return{x4:!0,x2:!0};const n={x4:!1,x2:!1};return e.x4<=t&&(n.x4=!0),e.x2<=t&&(n.x2=!0),n},Y4e=(e,t)=>{if(!(!e||!t)&&!(e.x4&&e.x2)){if(!e.x2&&!e.x4)return"parameters.isAllowedToUpscale.tooLarge";if(!e.x4&&e.x2&&t===4)return"parameters.isAllowedToUpscale.useX2Model"}},gq=e=>Ii(iK,({postprocessing:t,config:n})=>{const{esrganModelName:r}=t,{maxUpscalePixels:i}=n,o=Q4e(e,i),a=X4e(o,i),s=r.includes("x2")?2:4,l=Y4e(a,s);return{isAllowedToUpscale:s===2?a.x2:a.x4,detailTKey:l}},ex),BKe=e=>{const{t}=K4e(),n=I.useMemo(()=>gq(e),[e]),{isAllowedToUpscale:r,detailTKey:i}=fq(n);return{isAllowedToUpscale:r,detail:i?t(i):void 0}},Z4e=Ne("upscale/upscaleRequested"),J4e=()=>{Fe({actionCreator:Z4e,effect:async(e,{dispatch:t,getState:n})=>{var f;const r=_e("session"),{imageDTO:i}=e.payload,{image_name:o}=i,a=n(),{isAllowedToUpscale:s,detailTKey:l}=gq(i)(a);if(!s){r.error({imageDTO:i},Y(l??"parameters.isAllowedToUpscale.tooLarge")),t(qt({title:Y(l??"parameters.isAllowedToUpscale.tooLarge"),status:"error"}));return}const{esrganModelName:u}=a.postprocessing,{autoAddBoardId:c}=a.gallery,d=R4e({image_name:o,esrganModelName:u,autoAddBoardId:c});try{const h=t(Xr.endpoints.enqueueGraph.initiate({graph:d,prepend:!0},{fixedCacheKey:"enqueueGraph"})),p=await h.unwrap();h.reset(),r.debug({enqueueResult:Xt(p)},Y("queue.graphQueued"))}catch(h){if(r.error({graph:Xt(d)},Y("queue.graphFailedToQueue")),h instanceof Object&&"data"in h&&"status"in h&&h.status===403){const p=((f=h.data)==null?void 0:f.detail)||"Unknown Error";t(qt({title:Y("queue.graphFailedToQueue"),status:"error",description:p,duration:15e3}));return}t(qt({title:Y("queue.graphFailedToQueue"),status:"error"}))}}})},eke=nl(null),tke=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,QO=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(tke);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},XO=e=>e==="*"||e==="x"||e==="X",YO=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},nke=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],rke=(e,t)=>{if(XO(e)||XO(t))return 0;const[n,r]=nke(YO(e),YO(t));return n>r?1:n<r?-1:0},ZO=(e,t)=>{for(let n=0;n<Math.max(e.length,t.length);n++){const r=rke(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0},ike=(e,t)=>{const n=QO(e),r=QO(t),i=n.pop(),o=r.pop(),a=ZO(n,r);return a!==0?a:i&&o?ZO(i.split("."),o.split(".")):i||o?i?-1:1:0},oke=(e,t)=>{const n=Cn(e),{nodes:r,edges:i}=n,o=[],a=r.filter(aE),s=gk(a,"id");return r.forEach(l=>{if(!aE(l))return;const u=t[l.data.type];if(!u){o.push({message:`${be.t("nodes.node")} "${l.data.type}" ${be.t("nodes.skipped")}`,issues:[`${be.t("nodes.nodeType")}"${l.data.type}" ${be.t("nodes.doesNotExist")}`],data:l});return}if(u.version&&l.data.version&&ike(u.version,l.data.version)!==0){o.push({message:`${be.t("nodes.node")} "${l.data.type}" ${be.t("nodes.mismatchedVersion")}`,issues:[`${be.t("nodes.node")} "${l.data.type}" v${l.data.version} ${be.t("nodes.maybeIncompatible")} v${u.version}`],data:{node:l,nodeTemplate:Xt(u)}});return}}),i.forEach((l,u)=>{const c=s[l.source],d=s[l.target],f=[];if(c?l.type==="default"&&!(l.sourceHandle in c.data.outputs)&&f.push(`${be.t("nodes.outputNode")} "${l.source}.${l.sourceHandle}" ${be.t("nodes.doesNotExist")}`):f.push(`${be.t("nodes.outputNode")} ${l.source} ${be.t("nodes.doesNotExist")}`),d?l.type==="default"&&!(l.targetHandle in d.data.inputs)&&f.push(`${be.t("nodes.inputField")} "${l.target}.${l.targetHandle}" ${be.t("nodes.doesNotExist")}`):f.push(`${be.t("nodes.inputNode")} ${l.target} ${be.t("nodes.doesNotExist")}`),t[(c==null?void 0:c.data.type)??"__UNKNOWN_NODE_TYPE__"]||f.push(`${be.t("nodes.sourceNode")} "${l.source}" ${be.t("nodes.missingTemplate")} "${c==null?void 0:c.data.type}"`),t[(d==null?void 0:d.data.type)??"__UNKNOWN_NODE_TYPE__"]||f.push(`${be.t("nodes.sourceNode")}"${l.target}" ${be.t("nodes.missingTemplate")} "${d==null?void 0:d.data.type}"`),f.length){delete i[u];const h=l.type==="default"?l.sourceHandle:l.source,p=l.type==="default"?l.targetHandle:l.target;o.push({message:`Edge "${h} -> ${p}" skipped`,issues:f,data:l})}}),{workflow:n,errors:o}},ake=()=>{Fe({actionCreator:_xe,effect:(e,{dispatch:t,getState:n})=>{const r=_e("nodes"),i=e.payload,o=n().nodes.nodeTemplates,{workflow:a,errors:s}=oke(i,o);t(d2e(a)),s.length?(t(qt(Ld({title:Y("toast.loadedWithWarnings"),status:"warning"}))),s.forEach(({message:l,...u})=>{r.warn(u,l)})):t(qt(Ld({title:Y("toast.workflowLoaded"),status:"success"}))),t(sG("nodes")),requestAnimationFrame(()=>{var l;(l=eke.get())==null||l.fitView()})}})};function ske(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function lke(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var uke=function(){function e(n){var r=this;this._insertTag=function(i){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,o),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 t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(lke(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=ske(i);try{o.insertRule(r,o.cssRules.length)}catch{}}else i.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){return r.parentNode&&r.parentNode.removeChild(r)}),this.tags=[],this.ctr=0},e}(),Bi="-ms-",V_="-moz-",ln="-webkit-",mq="comm",UA="rule",VA="decl",cke="@import",yq="@keyframes",dke="@layer",fke=Math.abs,Jx=String.fromCharCode,hke=Object.assign;function pke(e,t){return ki(e,0)^45?(((t<<2^ki(e,0))<<2^ki(e,1))<<2^ki(e,2))<<2^ki(e,3):0}function vq(e){return e.trim()}function gke(e,t){return(e=t.exec(e))?e[0]:e}function un(e,t,n){return e.replace(t,n)}function lT(e,t){return e.indexOf(t)}function ki(e,t){return e.charCodeAt(t)|0}function w0(e,t,n){return e.slice(t,n)}function As(e){return e.length}function GA(e){return e.length}function Kv(e,t){return t.push(e),e}function mke(e,t){return e.map(t).join("")}var ew=1,ap=1,bq=0,Mo=0,Dr=0,Ip="";function tw(e,t,n,r,i,o,a){return{value:e,root:t,parent:n,type:r,props:i,children:o,line:ew,column:ap,length:a,return:""}}function og(e,t){return hke(tw("",null,null,"",null,null,0),e,{length:-e.length},t)}function yke(){return Dr}function vke(){return Dr=Mo>0?ki(Ip,--Mo):0,ap--,Dr===10&&(ap=1,ew--),Dr}function Qo(){return Dr=Mo<bq?ki(Ip,Mo++):0,ap++,Dr===10&&(ap=1,ew++),Dr}function Hs(){return ki(Ip,Mo)}function H1(){return Mo}function Py(e,t){return w0(Ip,e,t)}function C0(e){switch(e){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 _q(e){return ew=ap=1,bq=As(Ip=e),Mo=0,[]}function Sq(e){return Ip="",e}function W1(e){return vq(Py(Mo-1,uT(e===91?e+2:e===40?e+1:e)))}function bke(e){for(;(Dr=Hs())&&Dr<33;)Qo();return C0(e)>2||C0(Dr)>3?"":" "}function _ke(e,t){for(;--t&&Qo()&&!(Dr<48||Dr>102||Dr>57&&Dr<65||Dr>70&&Dr<97););return Py(e,H1()+(t<6&&Hs()==32&&Qo()==32))}function uT(e){for(;Qo();)switch(Dr){case e:return Mo;case 34:case 39:e!==34&&e!==39&&uT(Dr);break;case 40:e===41&&uT(e);break;case 92:Qo();break}return Mo}function Ske(e,t){for(;Qo()&&e+Dr!==47+10;)if(e+Dr===42+42&&Hs()===47)break;return"/*"+Py(t,Mo-1)+"*"+Jx(e===47?e:Qo())}function xke(e){for(;!C0(Hs());)Qo();return Py(e,Mo)}function wke(e){return Sq(K1("",null,null,null,[""],e=_q(e),0,[0],e))}function K1(e,t,n,r,i,o,a,s,l){for(var u=0,c=0,d=a,f=0,h=0,p=0,m=1,_=1,b=1,y=0,g="",v=i,S=o,w=r,x=g;_;)switch(p=y,y=Qo()){case 40:if(p!=108&&ki(x,d-1)==58){lT(x+=un(W1(y),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:x+=W1(y);break;case 9:case 10:case 13:case 32:x+=bke(p);break;case 92:x+=_ke(H1()-1,7);continue;case 47:switch(Hs()){case 42:case 47:Kv(Cke(Ske(Qo(),H1()),t,n),l);break;default:x+="/"}break;case 123*m:s[u++]=As(x)*b;case 125*m:case 59:case 0:switch(y){case 0:case 125:_=0;case 59+c:b==-1&&(x=un(x,/\f/g,"")),h>0&&As(x)-d&&Kv(h>32?eM(x+";",r,n,d-1):eM(un(x," ","")+";",r,n,d-2),l);break;case 59:x+=";";default:if(Kv(w=JO(x,t,n,u,c,i,s,g,v=[],S=[],d),o),y===123)if(c===0)K1(x,t,w,w,v,o,d,s,S);else switch(f===99&&ki(x,3)===110?100:f){case 100:case 108:case 109:case 115:K1(e,w,w,r&&Kv(JO(e,w,w,0,0,i,s,g,i,v=[],d),S),i,S,d,s,r?v:S);break;default:K1(x,w,w,w,[""],S,0,s,S)}}u=c=h=0,m=b=1,g=x="",d=a;break;case 58:d=1+As(x),h=p;default:if(m<1){if(y==123)--m;else if(y==125&&m++==0&&vke()==125)continue}switch(x+=Jx(y),y*m){case 38:b=c>0?1:(x+="\f",-1);break;case 44:s[u++]=(As(x)-1)*b,b=1;break;case 64:Hs()===45&&(x+=W1(Qo())),f=Hs(),c=d=As(g=x+=xke(H1())),y++;break;case 45:p===45&&As(x)==2&&(m=0)}}return o}function JO(e,t,n,r,i,o,a,s,l,u,c){for(var d=i-1,f=i===0?o:[""],h=GA(f),p=0,m=0,_=0;p<r;++p)for(var b=0,y=w0(e,d+1,d=fke(m=a[p])),g=e;b<h;++b)(g=vq(m>0?f[b]+" "+y:un(y,/&\f/g,f[b])))&&(l[_++]=g);return tw(e,t,n,i===0?UA:s,l,u,c)}function Cke(e,t,n){return tw(e,t,n,mq,Jx(yke()),w0(e,2,-2),0)}function eM(e,t,n,r){return tw(e,t,n,VA,w0(e,0,r),w0(e,r+1,-1),r)}function Sh(e,t){for(var n="",r=GA(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||"";return n}function Eke(e,t,n,r){switch(e.type){case dke:if(e.children.length)break;case cke:case VA:return e.return=e.return||e.value;case mq:return"";case yq:return e.return=e.value+"{"+Sh(e.children,r)+"}";case UA:e.value=e.props.join(",")}return As(n=Sh(e.children,r))?e.return=e.value+"{"+n+"}":""}function Tke(e){var t=GA(e);return function(n,r,i,o){for(var a="",s=0;s<t;s++)a+=e[s](n,r,i,o)||"";return a}}function kke(e){return function(t){t.root||(t=t.return)&&e(t)}}var tM=function(t){var n=new WeakMap;return function(r){if(n.has(r))return n.get(r);var i=t(r);return n.set(r,i),i}};function xq(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Ake=function(t,n,r){for(var i=0,o=0;i=o,o=Hs(),i===38&&o===12&&(n[r]=1),!C0(o);)Qo();return Py(t,Mo)},Pke=function(t,n){var r=-1,i=44;do switch(C0(i)){case 0:i===38&&Hs()===12&&(n[r]=1),t[r]+=Ake(Mo-1,n,r);break;case 2:t[r]+=W1(i);break;case 4:if(i===44){t[++r]=Hs()===58?"&\f":"",n[r]=t[r].length;break}default:t[r]+=Jx(i)}while(i=Qo());return t},Ike=function(t,n){return Sq(Pke(_q(t),n))},nM=new WeakMap,Rke=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,r=t.parent,i=t.column===r.column&&t.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!nM.get(r))&&!i){nM.set(t,!0);for(var o=[],a=Ike(n,o),s=r.props,l=0,u=0;l<a.length;l++)for(var c=0;c<s.length;c++,u++)t.props[u]=o[l]?a[l].replace(/&\f/g,s[c]):s[c]+" "+a[l]}}},Oke=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function wq(e,t){switch(pke(e,t)){case 5103:return ln+"print-"+e+e;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 ln+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ln+e+V_+e+Bi+e+e;case 6828:case 4268:return ln+e+Bi+e+e;case 6165:return ln+e+Bi+"flex-"+e+e;case 5187:return ln+e+un(e,/(\w+).+(:[^]+)/,ln+"box-$1$2"+Bi+"flex-$1$2")+e;case 5443:return ln+e+Bi+"flex-item-"+un(e,/flex-|-self/,"")+e;case 4675:return ln+e+Bi+"flex-line-pack"+un(e,/align-content|flex-|-self/,"")+e;case 5548:return ln+e+Bi+un(e,"shrink","negative")+e;case 5292:return ln+e+Bi+un(e,"basis","preferred-size")+e;case 6060:return ln+"box-"+un(e,"-grow","")+ln+e+Bi+un(e,"grow","positive")+e;case 4554:return ln+un(e,/([^-])(transform)/g,"$1"+ln+"$2")+e;case 6187:return un(un(un(e,/(zoom-|grab)/,ln+"$1"),/(image-set)/,ln+"$1"),e,"")+e;case 5495:case 3959:return un(e,/(image-set\([^]*)/,ln+"$1$`$1");case 4968:return un(un(e,/(.+:)(flex-)?(.*)/,ln+"box-pack:$3"+Bi+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ln+e+e;case 4095:case 3583:case 4068:case 2532:return un(e,/(.+)-inline(.+)/,ln+"$1$2")+e;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(As(e)-1-t>6)switch(ki(e,t+1)){case 109:if(ki(e,t+4)!==45)break;case 102:return un(e,/(.+:)(.+)-([^]+)/,"$1"+ln+"$2-$3$1"+V_+(ki(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~lT(e,"stretch")?wq(un(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(ki(e,t+1)!==115)break;case 6444:switch(ki(e,As(e)-3-(~lT(e,"!important")&&10))){case 107:return un(e,":",":"+ln)+e;case 101:return un(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ln+(ki(e,14)===45?"inline-":"")+"box$3$1"+ln+"$2$3$1"+Bi+"$2box$3")+e}break;case 5936:switch(ki(e,t+11)){case 114:return ln+e+Bi+un(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ln+e+Bi+un(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ln+e+Bi+un(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ln+e+Bi+e+e}return e}var Mke=function(t,n,r,i){if(t.length>-1&&!t.return)switch(t.type){case VA:t.return=wq(t.value,t.length);break;case yq:return Sh([og(t,{value:un(t.value,"@","@"+ln)})],i);case UA:if(t.length)return mke(t.props,function(o){switch(gke(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Sh([og(t,{props:[un(o,/:(read-\w+)/,":"+V_+"$1")]})],i);case"::placeholder":return Sh([og(t,{props:[un(o,/:(plac\w+)/,":"+ln+"input-$1")]}),og(t,{props:[un(o,/:(plac\w+)/,":"+V_+"$1")]}),og(t,{props:[un(o,/:(plac\w+)/,Bi+"input-$1")]})],i)}return""})}},Nke=[Mke],$ke=function(t){var n=t.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(m){var _=m.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var i=t.stylisPlugins||Nke,o={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(m){for(var _=m.getAttribute("data-emotion").split(" "),b=1;b<_.length;b++)o[_[b]]=!0;s.push(m)});var l,u=[Rke,Oke];{var c,d=[Eke,kke(function(m){c.insert(m)})],f=Tke(u.concat(i,d)),h=function(_){return Sh(wke(_),f)};l=function(_,b,y,g){c=y,h(_?_+"{"+b.styles+"}":b.styles),g&&(p.inserted[b.name]=!0)}}var p={key:n,sheet:new uke({key:n,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:l};return p.sheet.hydrate(s),p},Dke=!0;function Lke(e,t,n){var r="";return n.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):r+=i+" "}),r}var Cq=function(t,n,r){var i=t.key+"-"+n.name;(r===!1||Dke===!1)&&t.registered[i]===void 0&&(t.registered[i]=n.styles)},Eq=function(t,n,r){Cq(t,n,r);var i=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var o=n;do t.insert(n===o?"."+i:"",o,t.sheet,!0),o=o.next;while(o!==void 0)}};function Fke(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var Bke={animationIterationCount:1,aspectRatio: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},zke=/[A-Z]|^ms/g,jke=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Tq=function(t){return t.charCodeAt(1)===45},rM=function(t){return t!=null&&typeof t!="boolean"},a5=xq(function(e){return Tq(e)?e:e.replace(zke,"-$&").toLowerCase()}),iM=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(jke,function(r,i,o){return Ps={name:i,styles:o,next:Ps},i})}return Bke[t]!==1&&!Tq(t)&&typeof n=="number"&&n!==0?n+"px":n};function E0(e,t,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 Ps={name:n.name,styles:n.styles,next:Ps},n.name;if(n.styles!==void 0){var r=n.next;if(r!==void 0)for(;r!==void 0;)Ps={name:r.name,styles:r.styles,next:Ps},r=r.next;var i=n.styles+";";return i}return Uke(e,t,n)}case"function":{if(e!==void 0){var o=Ps,a=n(e);return Ps=o,E0(e,t,a)}break}}if(t==null)return n;var s=t[n];return s!==void 0?s:n}function Uke(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=E0(e,t,n[i])+";";else for(var o in n){var a=n[o];if(typeof a!="object")t!=null&&t[a]!==void 0?r+=o+"{"+t[a]+"}":rM(a)&&(r+=a5(o)+":"+iM(o,a)+";");else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var s=0;s<a.length;s++)rM(a[s])&&(r+=a5(o)+":"+iM(o,a[s])+";");else{var l=E0(e,t,a);switch(o){case"animation":case"animationName":{r+=a5(o)+":"+l+";";break}default:r+=o+"{"+l+"}"}}}return r}var oM=/label:\s*([^\s;\n{]+)\s*(;|$)/g,Ps,qA=function(t,n,r){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var i=!0,o="";Ps=void 0;var a=t[0];a==null||a.raw===void 0?(i=!1,o+=E0(r,n,a)):o+=a[0];for(var s=1;s<t.length;s++)o+=E0(r,n,t[s]),i&&(o+=a[s]);oM.lastIndex=0;for(var l="",u;(u=oM.exec(o))!==null;)l+="-"+u[1];var c=Fke(o)+l;return{name:c,styles:o,next:Ps}},Vke=function(t){return t()},kq=GP["useInsertionEffect"]?GP["useInsertionEffect"]:!1,Gke=kq||Vke,aM=kq||I.useLayoutEffect,Aq=I.createContext(typeof HTMLElement<"u"?$ke({key:"css"}):null);Aq.Provider;var Pq=function(t){return I.forwardRef(function(n,r){var i=I.useContext(Aq);return t(n,i,r)})},T0=I.createContext({}),qke=function(t,n){if(typeof n=="function"){var r=n(t);return r}return x_({},t,n)},Hke=tM(function(e){return tM(function(t){return qke(e,t)})}),Wke=function(t){var n=I.useContext(T0);return t.theme!==n&&(n=Hke(n)(t.theme)),I.createElement(T0.Provider,{value:n},t.children)},Iq=Pq(function(e,t){var n=e.styles,r=qA([n],void 0,I.useContext(T0)),i=I.useRef();return aM(function(){var o=t.key+"-global",a=new t.sheet.constructor({key:o,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),s=!1,l=document.querySelector('style[data-emotion="'+o+" "+r.name+'"]');return t.sheet.tags.length&&(a.before=t.sheet.tags[0]),l!==null&&(s=!0,l.setAttribute("data-emotion",o),a.hydrate([l])),i.current=[a,s],function(){a.flush()}},[t]),aM(function(){var o=i.current,a=o[0],s=o[1];if(s){o[1]=!1;return}if(r.next!==void 0&&Eq(t,r.next,!0),a.tags.length){var l=a.tags[a.tags.length-1].nextElementSibling;a.before=l,a.flush()}t.insert("",r,a,!1)},[t,r.name]),null});function Kke(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return qA(t)}var Qke=function(){var t=Kke.apply(void 0,arguments),n="animation-"+t.name;return{name:n,styles:"@keyframes "+n+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}};function Xke(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Iy(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:o,defaultValue:a}=e,s=I.createContext(a);s.displayName=t;function l(){var u;const c=I.useContext(s);if(!c&&n){const d=new Error(o??Xke(r,i));throw d.name="ContextError",(u=Error.captureStackTrace)==null||u.call(Error,d,l),d}return c}return[s.Provider,l,s]}var[Yke,Zke]=Iy({strict:!1,name:"PortalManagerContext"});function Jke(e){const{children:t,zIndex:n}=e;return W.jsx(Yke,{value:{zIndex:n},children:t})}Jke.displayName="PortalManager";var G_=globalThis!=null&&globalThis.document?I.useLayoutEffect:I.useEffect,[Rq,eAe]=Iy({strict:!1,name:"PortalContext"}),HA="chakra-portal",tAe=".chakra-portal",nAe=e=>W.jsx("div",{className:"chakra-portal-zIndex",style:{position:"absolute",zIndex:e.zIndex,top:0,left:0,right:0},children:e.children}),rAe=e=>{const{appendToParentPortal:t,children:n}=e,[r,i]=I.useState(null),o=I.useRef(null),[,a]=I.useState({});I.useEffect(()=>a({}),[]);const s=eAe(),l=Zke();G_(()=>{if(!r)return;const c=r.ownerDocument,d=t?s??c.body:c.body;if(!d)return;o.current=c.createElement("div"),o.current.className=HA,d.appendChild(o.current),a({});const f=o.current;return()=>{d.contains(f)&&d.removeChild(f)}},[r]);const u=l!=null&&l.zIndex?W.jsx(nAe,{zIndex:l==null?void 0:l.zIndex,children:n}):n;return o.current?Vo.createPortal(W.jsx(Rq,{value:o.current,children:u}),o.current):W.jsx("span",{ref:c=>{c&&i(c)}})},iAe=e=>{const{children:t,containerRef:n,appendToParentPortal:r}=e,i=n.current,o=i??(typeof window<"u"?document.body:void 0),a=I.useMemo(()=>{const l=i==null?void 0:i.ownerDocument.createElement("div");return l&&(l.className=HA),l},[i]),[,s]=I.useState({});return G_(()=>s({}),[]),G_(()=>{if(!(!a||!o))return o.appendChild(a),()=>{o.removeChild(a)}},[a,o]),o&&a?Vo.createPortal(W.jsx(Rq,{value:r?a:null,children:t}),a):null};function nw(e){const t={appendToParentPortal:!0,...e},{containerRef:n,...r}=t;return n?W.jsx(iAe,{containerRef:n,...r}):W.jsx(rAe,{...r})}nw.className=HA;nw.selector=tAe;nw.displayName="Portal";function Oq(){const e=I.useContext(T0);if(!e)throw Error("useTheme: `theme` is undefined. Seems you forgot to wrap your app in `<ChakraProvider />` or `<ThemeProvider />`");return e}var WA=I.createContext({});WA.displayName="ColorModeContext";function rw(){const e=I.useContext(WA);if(e===void 0)throw new Error("useColorMode must be used within a ColorModeProvider");return e}function zKe(e,t){const{colorMode:n}=rw();return n==="dark"?t:e}function oAe(){const e=rw(),t=Oq();return{...e,theme:t}}function aAe(e,t,n){var r,i;if(t==null)return t;const o=a=>{var s,l;return(l=(s=e.__breakpoints)==null?void 0:s.asArray)==null?void 0:l[a]};return(i=(r=o(t))!=null?r:o(n))!=null?i:n}function sAe(e,t,n){var r,i;if(t==null)return t;const o=a=>{var s,l;return(l=(s=e.__cssMap)==null?void 0:s[a])==null?void 0:l.value};return(i=(r=o(t))!=null?r:o(n))!=null?i:n}function jKe(e,t,n){const r=Oq();return lAe(e,t,n)(r)}function lAe(e,t,n){const r=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n];return o=>{const a=i.filter(Boolean),s=r.map((l,u)=>{var c,d;if(e==="breakpoints")return aAe(o,l,(c=a[u])!=null?c:l);const f=`${e}.${l}`;return sAe(o,f,(d=a[u])!=null?d:l)});return Array.isArray(t)?s:s[0]}}var Rc=(...e)=>e.filter(Boolean).join(" ");function uAe(){return!1}function Ws(e){const t=typeof e;return e!=null&&(t==="object"||t==="function")&&!Array.isArray(e)}var UKe=e=>{const{condition:t,message:n}=e;t&&uAe()&&console.warn(n)};function Ls(e,...t){return cAe(e)?e(...t):e}var cAe=e=>typeof e=="function",VKe=e=>e?"":void 0,GKe=e=>e?!0:void 0;function qKe(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}function HKe(...e){return function(n){e.forEach(r=>{r==null||r(n)})}}var q_={exports:{}};q_.exports;(function(e,t){var n=200,r="__lodash_hash_undefined__",i=800,o=16,a=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",d="[object Date]",f="[object Error]",h="[object Function]",p="[object GeneratorFunction]",m="[object Map]",_="[object Number]",b="[object Null]",y="[object Object]",g="[object Proxy]",v="[object RegExp]",S="[object Set]",w="[object String]",x="[object Undefined]",C="[object WeakMap]",k="[object ArrayBuffer]",T="[object DataView]",P="[object Float32Array]",$="[object Float64Array]",O="[object Int8Array]",E="[object Int16Array]",A="[object Int32Array]",D="[object Uint8Array]",L="[object Uint8ClampedArray]",M="[object Uint16Array]",R="[object Uint32Array]",N=/[\\^$.*+?()[\]{}|]/g,B=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,G={};G[P]=G[$]=G[O]=G[E]=G[A]=G[D]=G[L]=G[M]=G[R]=!0,G[s]=G[l]=G[k]=G[c]=G[T]=G[d]=G[f]=G[h]=G[m]=G[_]=G[y]=G[v]=G[S]=G[w]=G[C]=!1;var Z=typeof yt=="object"&&yt&&yt.Object===Object&&yt,ee=typeof self=="object"&&self&&self.Object===Object&&self,J=Z||ee||Function("return this")(),j=t&&!t.nodeType&&t,Q=j&&!0&&e&&!e.nodeType&&e,ne=Q&&Q.exports===j,se=ne&&Z.process,ye=function(){try{var F=Q&&Q.require&&Q.require("util").types;return F||se&&se.binding&&se.binding("util")}catch{}}(),ce=ye&&ye.isTypedArray;function bt(F,V,X){switch(X.length){case 0:return F.call(V);case 1:return F.call(V,X[0]);case 2:return F.call(V,X[0],X[1]);case 3:return F.call(V,X[0],X[1],X[2])}return F.apply(V,X)}function ot(F,V){for(var X=-1,pe=Array(F);++X<F;)pe[X]=V(X);return pe}function ze(F){return function(V){return F(V)}}function mt(F,V){return F==null?void 0:F[V]}function Pe(F,V){return function(X){return F(V(X))}}var en=Array.prototype,Pr=Function.prototype,Ln=Object.prototype,An=J["__core-js_shared__"],tn=Pr.toString,Fn=Ln.hasOwnProperty,Ir=function(){var F=/[^.]+$/.exec(An&&An.keys&&An.keys.IE_PROTO||"");return F?"Symbol(src)_1."+F:""}(),ho=Ln.toString,ei=tn.call(Object),pr=RegExp("^"+tn.call(Fn).replace(N,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Br=ne?J.Buffer:void 0,ti=J.Symbol,Bn=J.Uint8Array,_n=Br?Br.allocUnsafe:void 0,Mi=Pe(Object.getPrototypeOf,Object),gi=Object.create,Qi=Ln.propertyIsEnumerable,Da=en.splice,Rr=ti?ti.toStringTag:void 0,po=function(){try{var F=or(Object,"defineProperty");return F({},"",{}),F}catch{}}(),al=Br?Br.isBuffer:void 0,Do=Math.max,sl=Date.now,zn=or(J,"Map"),nn=or(Object,"create"),zr=function(){function F(){}return function(V){if(!Qe(V))return{};if(gi)return gi(V);F.prototype=V;var X=new F;return F.prototype=void 0,X}}();function Or(F){var V=-1,X=F==null?0:F.length;for(this.clear();++V<X;){var pe=F[V];this.set(pe[0],pe[1])}}function Mr(){this.__data__=nn?nn(null):{},this.size=0}function ni(F){var V=this.has(F)&&delete this.__data__[F];return this.size-=V?1:0,V}function Ni(F){var V=this.__data__;if(nn){var X=V[F];return X===r?void 0:X}return Fn.call(V,F)?V[F]:void 0}function go(F){var V=this.__data__;return nn?V[F]!==void 0:Fn.call(V,F)}function mi(F,V){var X=this.__data__;return this.size+=this.has(F)?0:1,X[F]=nn&&V===void 0?r:V,this}Or.prototype.clear=Mr,Or.prototype.delete=ni,Or.prototype.get=Ni,Or.prototype.has=go,Or.prototype.set=mi;function jr(F){var V=-1,X=F==null?0:F.length;for(this.clear();++V<X;){var pe=F[V];this.set(pe[0],pe[1])}}function La(){this.__data__=[],this.size=0}function gs(F){var V=this.__data__,X=Ye(V,F);if(X<0)return!1;var pe=V.length-1;return X==pe?V.pop():Da.call(V,X,1),--this.size,!0}function yi(F){var V=this.__data__,X=Ye(V,F);return X<0?void 0:V[X][1]}function ou(F){return Ye(this.__data__,F)>-1}function oa(F,V){var X=this.__data__,pe=Ye(X,F);return pe<0?(++this.size,X.push([F,V])):X[pe][1]=V,this}jr.prototype.clear=La,jr.prototype.delete=gs,jr.prototype.get=yi,jr.prototype.has=ou,jr.prototype.set=oa;function ri(F){var V=-1,X=F==null?0:F.length;for(this.clear();++V<X;){var pe=F[V];this.set(pe[0],pe[1])}}function ll(){this.size=0,this.__data__={hash:new Or,map:new(zn||jr),string:new Or}}function H(F){var V=rn(this,F).delete(F);return this.size-=V?1:0,V}function te(F){return rn(this,F).get(F)}function re(F){return rn(this,F).has(F)}function de(F,V){var X=rn(this,F),pe=X.size;return X.set(F,V),this.size+=X.size==pe?0:1,this}ri.prototype.clear=ll,ri.prototype.delete=H,ri.prototype.get=te,ri.prototype.has=re,ri.prototype.set=de;function oe(F){var V=this.__data__=new jr(F);this.size=V.size}function je(){this.__data__=new jr,this.size=0}function Ge(F){var V=this.__data__,X=V.delete(F);return this.size=V.size,X}function ut(F){return this.__data__.get(F)}function $e(F){return this.__data__.has(F)}function qe(F,V){var X=this.__data__;if(X instanceof jr){var pe=X.__data__;if(!zn||pe.length<n-1)return pe.push([F,V]),this.size=++X.size,this;X=this.__data__=new ri(pe)}return X.set(F,V),this.size=X.size,this}oe.prototype.clear=je,oe.prototype.delete=Ge,oe.prototype.get=ut,oe.prototype.has=$e,oe.prototype.set=qe;function Ie(F,V){var X=ue(F),pe=!X&&we(F),Ct=!X&&!pe&&ge(F),pn=!X&&!pe&&!Ct&&Ut(F),In=X||pe||Ct||pn,It=In?ot(F.length,String):[],wn=It.length;for(var _i in F)(V||Fn.call(F,_i))&&!(In&&(_i=="length"||Ct&&(_i=="offset"||_i=="parent")||pn&&(_i=="buffer"||_i=="byteLength"||_i=="byteOffset")||Sn(_i,wn)))&&It.push(_i);return It}function ie(F,V,X){(X!==void 0&&!Ve(F[V],X)||X===void 0&&!(V in F))&&Ze(F,V,X)}function Se(F,V,X){var pe=F[V];(!(Fn.call(F,V)&&Ve(pe,X))||X===void 0&&!(V in F))&&Ze(F,V,X)}function Ye(F,V){for(var X=F.length;X--;)if(Ve(F[X][0],V))return X;return-1}function Ze(F,V,X){V=="__proto__"&&po?po(F,V,{configurable:!0,enumerable:!0,value:X,writable:!0}):F[V]=X}var ct=hn();function dt(F){return F==null?F===void 0?x:b:Rr&&Rr in Object(F)?xr(F):xe(F)}function _t(F){return Ae(F)&&dt(F)==s}function wt(F){if(!Qe(F)||xn(F))return!1;var V=Ce(F)?pr:B;return V.test(ft(F))}function Tt(F){return Ae(F)&&et(F.length)&&!!G[dt(F)]}function dn(F){if(!Qe(F))return mn(F);var V=on(F),X=[];for(var pe in F)pe=="constructor"&&(V||!Fn.call(F,pe))||X.push(pe);return X}function fn(F,V,X,pe,Ct){F!==V&&ct(V,function(pn,In){if(Ct||(Ct=new oe),Qe(pn))$i(F,V,In,X,fn,pe,Ct);else{var It=pe?pe(Ue(F,In),pn,In+"",F,V,Ct):void 0;It===void 0&&(It=pn),ie(F,In,It)}},ar)}function $i(F,V,X,pe,Ct,pn,In){var It=Ue(F,X),wn=Ue(V,X),_i=In.get(wn);if(_i){ie(F,X,_i);return}var Yn=pn?pn(It,wn,X+"",F,V,In):void 0,au=Yn===void 0;if(au){var tf=ue(wn),su=!tf&&ge(wn),nf=!tf&&!su&&Ut(wn);Yn=wn,tf||su||nf?ue(It)?Yn=It:fe(It)?Yn=mo(It):su?(au=!1,Yn=Sr(wn,!0)):nf?(au=!1,Yn=Xn(wn,!0)):Yn=[]:kt(wn)||we(wn)?(Yn=It,we(It)?Yn=Gt(It):(!Qe(It)||Ce(It))&&(Yn=bi(wn))):au=!1}au&&(In.set(wn,Yn),Ct(Yn,wn,pe,pn,In),In.delete(wn)),ie(F,X,Yn)}function Lo(F,V){return ke(Je(F,V,Pn),F+"")}var Di=po?function(F,V){return po(F,"toString",{configurable:!0,enumerable:!1,value:jn(V),writable:!0})}:Pn;function Sr(F,V){if(V)return F.slice();var X=F.length,pe=_n?_n(X):new F.constructor(X);return F.copy(pe),pe}function vi(F){var V=new F.constructor(F.byteLength);return new Bn(V).set(new Bn(F)),V}function Xn(F,V){var X=V?vi(F.buffer):F.buffer;return new F.constructor(X,F.byteOffset,F.length)}function mo(F,V){var X=-1,pe=F.length;for(V||(V=Array(pe));++X<pe;)V[X]=F[X];return V}function Fa(F,V,X,pe){var Ct=!X;X||(X={});for(var pn=-1,In=V.length;++pn<In;){var It=V[pn],wn=pe?pe(X[It],F[It],It,X,F):void 0;wn===void 0&&(wn=F[It]),Ct?Ze(X,It,wn):Se(X,It,wn)}return X}function it(F){return Lo(function(V,X){var pe=-1,Ct=X.length,pn=Ct>1?X[Ct-1]:void 0,In=Ct>2?X[2]:void 0;for(pn=F.length>3&&typeof pn=="function"?(Ct--,pn):void 0,In&&Nt(X[0],X[1],In)&&(pn=Ct<3?void 0:pn,Ct=1),V=Object(V);++pe<Ct;){var It=X[pe];It&&F(V,It,pe,pn)}return V})}function hn(F){return function(V,X,pe){for(var Ct=-1,pn=Object(V),In=pe(V),It=In.length;It--;){var wn=In[F?It:++Ct];if(X(pn[wn],wn,pn)===!1)break}return V}}function rn(F,V){var X=F.__data__;return Wt(V)?X[typeof V=="string"?"string":"hash"]:X.map}function or(F,V){var X=mt(F,V);return wt(X)?X:void 0}function xr(F){var V=Fn.call(F,Rr),X=F[Rr];try{F[Rr]=void 0;var pe=!0}catch{}var Ct=ho.call(F);return pe&&(V?F[Rr]=X:delete F[Rr]),Ct}function bi(F){return typeof F.constructor=="function"&&!on(F)?zr(Mi(F)):{}}function Sn(F,V){var X=typeof F;return V=V??a,!!V&&(X=="number"||X!="symbol"&&U.test(F))&&F>-1&&F%1==0&&F<V}function Nt(F,V,X){if(!Qe(X))return!1;var pe=typeof V;return(pe=="number"?Ee(X)&&Sn(V,X.length):pe=="string"&&V in X)?Ve(X[V],F):!1}function Wt(F){var V=typeof F;return V=="string"||V=="number"||V=="symbol"||V=="boolean"?F!=="__proto__":F===null}function xn(F){return!!Ir&&Ir in F}function on(F){var V=F&&F.constructor,X=typeof V=="function"&&V.prototype||Ln;return F===X}function mn(F){var V=[];if(F!=null)for(var X in Object(F))V.push(X);return V}function xe(F){return ho.call(F)}function Je(F,V,X){return V=Do(V===void 0?F.length-1:V,0),function(){for(var pe=arguments,Ct=-1,pn=Do(pe.length-V,0),In=Array(pn);++Ct<pn;)In[Ct]=pe[V+Ct];Ct=-1;for(var It=Array(V+1);++Ct<V;)It[Ct]=pe[Ct];return It[V]=X(In),bt(F,this,It)}}function Ue(F,V){if(!(V==="constructor"&&typeof F[V]=="function")&&V!="__proto__")return F[V]}var ke=He(Di);function He(F){var V=0,X=0;return function(){var pe=sl(),Ct=o-(pe-X);if(X=pe,Ct>0){if(++V>=i)return arguments[0]}else V=0;return F.apply(void 0,arguments)}}function ft(F){if(F!=null){try{return tn.call(F)}catch{}try{return F+""}catch{}}return""}function Ve(F,V){return F===V||F!==F&&V!==V}var we=_t(function(){return arguments}())?_t:function(F){return Ae(F)&&Fn.call(F,"callee")&&!Qi.call(F,"callee")},ue=Array.isArray;function Ee(F){return F!=null&&et(F.length)&&!Ce(F)}function fe(F){return Ae(F)&&Ee(F)}var ge=al||Xi;function Ce(F){if(!Qe(F))return!1;var V=dt(F);return V==h||V==p||V==u||V==g}function et(F){return typeof F=="number"&&F>-1&&F%1==0&&F<=a}function Qe(F){var V=typeof F;return F!=null&&(V=="object"||V=="function")}function Ae(F){return F!=null&&typeof F=="object"}function kt(F){if(!Ae(F)||dt(F)!=y)return!1;var V=Mi(F);if(V===null)return!0;var X=Fn.call(V,"constructor")&&V.constructor;return typeof X=="function"&&X instanceof X&&tn.call(X)==ei}var Ut=ce?ze(ce):Tt;function Gt(F){return Fa(F,ar(F))}function ar(F){return Ee(F)?Ie(F,!0):dn(F)}var gr=it(function(F,V,X,pe){fn(F,V,X,pe)});function jn(F){return function(){return F}}function Pn(F){return F}function Xi(){return!1}e.exports=gr})(q_,q_.exports);var dAe=q_.exports;const Fs=mc(dAe);var fAe=e=>/!(important)?$/.test(e),sM=e=>typeof e=="string"?e.replace(/!(important)?$/,"").trim():e,hAe=(e,t)=>n=>{const r=String(t),i=fAe(r),o=sM(r),a=e?`${e}.${o}`:o;let s=Ws(n.__cssMap)&&a in n.__cssMap?n.__cssMap[a].varRef:t;return s=sM(s),i?`${s} !important`:s};function KA(e){const{scale:t,transform:n,compose:r}=e;return(o,a)=>{var s;const l=hAe(t,o)(a);let u=(s=n==null?void 0:n(l,a))!=null?s:l;return r&&(u=r(u,a)),u}}var Qv=(...e)=>t=>e.reduce((n,r)=>r(n),t);function ua(e,t){return n=>{const r={property:n,scale:e};return r.transform=KA({scale:e,transform:t}),r}}var pAe=({rtl:e,ltr:t})=>n=>n.direction==="rtl"?e:t;function gAe(e){const{property:t,scale:n,transform:r}=e;return{scale:n,property:pAe(t),transform:n?KA({scale:n,compose:r}):r}}var Mq=["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 mAe(){return["translateX(var(--chakra-translate-x, 0))","translateY(var(--chakra-translate-y, 0))",...Mq].join(" ")}function yAe(){return["translate3d(var(--chakra-translate-x, 0), var(--chakra-translate-y, 0), 0)",...Mq].join(" ")}var vAe={"--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(" ")},bAe={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 _Ae(e){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":e,boxShadow:["var(--chakra-ring-offset-shadow)","var(--chakra-ring-shadow)","var(--chakra-shadow, 0 0 #0000)"].join(", ")}}var SAe={"row-reverse":{space:"--chakra-space-x-reverse",divide:"--chakra-divide-x-reverse"},"column-reverse":{space:"--chakra-space-y-reverse",divide:"--chakra-divide-y-reverse"}},cT={"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"},xAe=new Set(Object.values(cT)),dT=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),wAe=e=>e.trim();function CAe(e,t){if(e==null||dT.has(e))return e;if(!(fT(e)||dT.has(e)))return`url('${e}')`;const i=/(^[a-z-A-Z]+)\((.*)\)/g.exec(e),o=i==null?void 0:i[1],a=i==null?void 0:i[2];if(!o||!a)return e;const s=o.includes("-gradient")?o:`${o}-gradient`,[l,...u]=a.split(",").map(wAe).filter(Boolean);if((u==null?void 0:u.length)===0)return e;const c=l in cT?cT[l]:l;u.unshift(c);const d=u.map(f=>{if(xAe.has(f))return f;const h=f.indexOf(" "),[p,m]=h!==-1?[f.substr(0,h),f.substr(h+1)]:[f],_=fT(m)?m:m&&m.split(" "),b=`colors.${p}`,y=b in t.__cssMap?t.__cssMap[b].varRef:p;return _?[y,...Array.isArray(_)?_:[_]].join(" "):y});return`${s}(${d.join(", ")})`}var fT=e=>typeof e=="string"&&e.includes("(")&&e.includes(")"),EAe=(e,t)=>CAe(e,t??{});function TAe(e){return/^var\(--.+\)$/.test(e)}var kAe=e=>{const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}},Ss=e=>t=>`${e}(${t})`,Qt={filter(e){return e!=="auto"?e:vAe},backdropFilter(e){return e!=="auto"?e:bAe},ring(e){return _Ae(Qt.px(e))},bgClip(e){return e==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:e}},transform(e){return e==="auto"?mAe():e==="auto-gpu"?yAe():e},vh(e){return e==="$100vh"?"var(--chakra-vh)":e},px(e){if(e==null)return e;const{unitless:t}=kAe(e);return t||typeof e=="number"?`${e}px`:e},fraction(e){return typeof e!="number"||e>1?e:`${e*100}%`},float(e,t){const n={left:"right",right:"left"};return t.direction==="rtl"?n[e]:e},degree(e){if(TAe(e)||e==null)return e;const t=typeof e=="string"&&!e.endsWith("deg");return typeof e=="number"||t?`${e}deg`:e},gradient:EAe,blur:Ss("blur"),opacity:Ss("opacity"),brightness:Ss("brightness"),contrast:Ss("contrast"),dropShadow:Ss("drop-shadow"),grayscale:Ss("grayscale"),hueRotate:Ss("hue-rotate"),invert:Ss("invert"),saturate:Ss("saturate"),sepia:Ss("sepia"),bgImage(e){return e==null||fT(e)||dT.has(e)?e:`url(${e})`},outline(e){const t=String(e)==="0"||String(e)==="none";return e!==null&&t?{outline:"2px solid transparent",outlineOffset:"2px"}:{outline:e}},flexDirection(e){var t;const{space:n,divide:r}=(t=SAe[e])!=null?t:{},i={flexDirection:e};return n&&(i[n]=1),r&&(i[r]=1),i}},q={borderWidths:ua("borderWidths"),borderStyles:ua("borderStyles"),colors:ua("colors"),borders:ua("borders"),gradients:ua("gradients",Qt.gradient),radii:ua("radii",Qt.px),space:ua("space",Qv(Qt.vh,Qt.px)),spaceT:ua("space",Qv(Qt.vh,Qt.px)),degreeT(e){return{property:e,transform:Qt.degree}},prop(e,t,n){return{property:e,scale:t,...t&&{transform:KA({scale:t,transform:n})}}},propT(e,t){return{property:e,transform:t}},sizes:ua("sizes",Qv(Qt.vh,Qt.px)),sizesT:ua("sizes",Qv(Qt.vh,Qt.fraction)),shadows:ua("shadows"),logical:gAe,blur:ua("blur",Qt.blur)},Q1={background:q.colors("background"),backgroundColor:q.colors("backgroundColor"),backgroundImage:q.gradients("backgroundImage"),backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0,backgroundAttachment:!0,backgroundClip:{transform:Qt.bgClip},bgSize:q.prop("backgroundSize"),bgPosition:q.prop("backgroundPosition"),bg:q.colors("background"),bgColor:q.colors("backgroundColor"),bgPos:q.prop("backgroundPosition"),bgRepeat:q.prop("backgroundRepeat"),bgAttachment:q.prop("backgroundAttachment"),bgGradient:q.gradients("backgroundImage"),bgClip:{transform:Qt.bgClip}};Object.assign(Q1,{bgImage:Q1.backgroundImage,bgImg:Q1.backgroundImage});var sn={border:q.borders("border"),borderWidth:q.borderWidths("borderWidth"),borderStyle:q.borderStyles("borderStyle"),borderColor:q.colors("borderColor"),borderRadius:q.radii("borderRadius"),borderTop:q.borders("borderTop"),borderBlockStart:q.borders("borderBlockStart"),borderTopLeftRadius:q.radii("borderTopLeftRadius"),borderStartStartRadius:q.logical({scale:"radii",property:{ltr:"borderTopLeftRadius",rtl:"borderTopRightRadius"}}),borderEndStartRadius:q.logical({scale:"radii",property:{ltr:"borderBottomLeftRadius",rtl:"borderBottomRightRadius"}}),borderTopRightRadius:q.radii("borderTopRightRadius"),borderStartEndRadius:q.logical({scale:"radii",property:{ltr:"borderTopRightRadius",rtl:"borderTopLeftRadius"}}),borderEndEndRadius:q.logical({scale:"radii",property:{ltr:"borderBottomRightRadius",rtl:"borderBottomLeftRadius"}}),borderRight:q.borders("borderRight"),borderInlineEnd:q.borders("borderInlineEnd"),borderBottom:q.borders("borderBottom"),borderBlockEnd:q.borders("borderBlockEnd"),borderBottomLeftRadius:q.radii("borderBottomLeftRadius"),borderBottomRightRadius:q.radii("borderBottomRightRadius"),borderLeft:q.borders("borderLeft"),borderInlineStart:{property:"borderInlineStart",scale:"borders"},borderInlineStartRadius:q.logical({scale:"radii",property:{ltr:["borderTopLeftRadius","borderBottomLeftRadius"],rtl:["borderTopRightRadius","borderBottomRightRadius"]}}),borderInlineEndRadius:q.logical({scale:"radii",property:{ltr:["borderTopRightRadius","borderBottomRightRadius"],rtl:["borderTopLeftRadius","borderBottomLeftRadius"]}}),borderX:q.borders(["borderLeft","borderRight"]),borderInline:q.borders("borderInline"),borderY:q.borders(["borderTop","borderBottom"]),borderBlock:q.borders("borderBlock"),borderTopWidth:q.borderWidths("borderTopWidth"),borderBlockStartWidth:q.borderWidths("borderBlockStartWidth"),borderTopColor:q.colors("borderTopColor"),borderBlockStartColor:q.colors("borderBlockStartColor"),borderTopStyle:q.borderStyles("borderTopStyle"),borderBlockStartStyle:q.borderStyles("borderBlockStartStyle"),borderBottomWidth:q.borderWidths("borderBottomWidth"),borderBlockEndWidth:q.borderWidths("borderBlockEndWidth"),borderBottomColor:q.colors("borderBottomColor"),borderBlockEndColor:q.colors("borderBlockEndColor"),borderBottomStyle:q.borderStyles("borderBottomStyle"),borderBlockEndStyle:q.borderStyles("borderBlockEndStyle"),borderLeftWidth:q.borderWidths("borderLeftWidth"),borderInlineStartWidth:q.borderWidths("borderInlineStartWidth"),borderLeftColor:q.colors("borderLeftColor"),borderInlineStartColor:q.colors("borderInlineStartColor"),borderLeftStyle:q.borderStyles("borderLeftStyle"),borderInlineStartStyle:q.borderStyles("borderInlineStartStyle"),borderRightWidth:q.borderWidths("borderRightWidth"),borderInlineEndWidth:q.borderWidths("borderInlineEndWidth"),borderRightColor:q.colors("borderRightColor"),borderInlineEndColor:q.colors("borderInlineEndColor"),borderRightStyle:q.borderStyles("borderRightStyle"),borderInlineEndStyle:q.borderStyles("borderInlineEndStyle"),borderTopRadius:q.radii(["borderTopLeftRadius","borderTopRightRadius"]),borderBottomRadius:q.radii(["borderBottomLeftRadius","borderBottomRightRadius"]),borderLeftRadius:q.radii(["borderTopLeftRadius","borderBottomLeftRadius"]),borderRightRadius:q.radii(["borderTopRightRadius","borderBottomRightRadius"])};Object.assign(sn,{rounded:sn.borderRadius,roundedTop:sn.borderTopRadius,roundedTopLeft:sn.borderTopLeftRadius,roundedTopRight:sn.borderTopRightRadius,roundedTopStart:sn.borderStartStartRadius,roundedTopEnd:sn.borderStartEndRadius,roundedBottom:sn.borderBottomRadius,roundedBottomLeft:sn.borderBottomLeftRadius,roundedBottomRight:sn.borderBottomRightRadius,roundedBottomStart:sn.borderEndStartRadius,roundedBottomEnd:sn.borderEndEndRadius,roundedLeft:sn.borderLeftRadius,roundedRight:sn.borderRightRadius,roundedStart:sn.borderInlineStartRadius,roundedEnd:sn.borderInlineEndRadius,borderStart:sn.borderInlineStart,borderEnd:sn.borderInlineEnd,borderTopStartRadius:sn.borderStartStartRadius,borderTopEndRadius:sn.borderStartEndRadius,borderBottomStartRadius:sn.borderEndStartRadius,borderBottomEndRadius:sn.borderEndEndRadius,borderStartRadius:sn.borderInlineStartRadius,borderEndRadius:sn.borderInlineEndRadius,borderStartWidth:sn.borderInlineStartWidth,borderEndWidth:sn.borderInlineEndWidth,borderStartColor:sn.borderInlineStartColor,borderEndColor:sn.borderInlineEndColor,borderStartStyle:sn.borderInlineStartStyle,borderEndStyle:sn.borderInlineEndStyle});var AAe={color:q.colors("color"),textColor:q.colors("color"),fill:q.colors("fill"),stroke:q.colors("stroke")},hT={boxShadow:q.shadows("boxShadow"),mixBlendMode:!0,blendMode:q.prop("mixBlendMode"),backgroundBlendMode:!0,bgBlendMode:q.prop("backgroundBlendMode"),opacity:!0};Object.assign(hT,{shadow:hT.boxShadow});var PAe={filter:{transform:Qt.filter},blur:q.blur("--chakra-blur"),brightness:q.propT("--chakra-brightness",Qt.brightness),contrast:q.propT("--chakra-contrast",Qt.contrast),hueRotate:q.degreeT("--chakra-hue-rotate"),invert:q.propT("--chakra-invert",Qt.invert),saturate:q.propT("--chakra-saturate",Qt.saturate),dropShadow:q.propT("--chakra-drop-shadow",Qt.dropShadow),backdropFilter:{transform:Qt.backdropFilter},backdropBlur:q.blur("--chakra-backdrop-blur"),backdropBrightness:q.propT("--chakra-backdrop-brightness",Qt.brightness),backdropContrast:q.propT("--chakra-backdrop-contrast",Qt.contrast),backdropHueRotate:q.degreeT("--chakra-backdrop-hue-rotate"),backdropInvert:q.propT("--chakra-backdrop-invert",Qt.invert),backdropSaturate:q.propT("--chakra-backdrop-saturate",Qt.saturate)},H_={alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:{transform:Qt.flexDirection},flex:!0,flexFlow:!0,flexGrow:!0,flexShrink:!0,flexBasis:q.sizes("flexBasis"),justifySelf:!0,alignSelf:!0,order:!0,placeItems:!0,placeContent:!0,placeSelf:!0,gap:q.space("gap"),rowGap:q.space("rowGap"),columnGap:q.space("columnGap")};Object.assign(H_,{flexDir:H_.flexDirection});var Nq={gridGap:q.space("gridGap"),gridColumnGap:q.space("gridColumnGap"),gridRowGap:q.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},IAe={appearance:!0,cursor:!0,resize:!0,userSelect:!0,pointerEvents:!0,outline:{transform:Qt.outline},outlineOffset:!0,outlineColor:q.colors("outlineColor")},fa={width:q.sizesT("width"),inlineSize:q.sizesT("inlineSize"),height:q.sizes("height"),blockSize:q.sizes("blockSize"),boxSize:q.sizes(["width","height"]),minWidth:q.sizes("minWidth"),minInlineSize:q.sizes("minInlineSize"),minHeight:q.sizes("minHeight"),minBlockSize:q.sizes("minBlockSize"),maxWidth:q.sizes("maxWidth"),maxInlineSize:q.sizes("maxInlineSize"),maxHeight:q.sizes("maxHeight"),maxBlockSize:q.sizes("maxBlockSize"),overflow:!0,overflowX:!0,overflowY:!0,overscrollBehavior:!0,overscrollBehaviorX:!0,overscrollBehaviorY:!0,display:!0,aspectRatio:!0,hideFrom:{scale:"breakpoints",transform:(e,t)=>{var n,r,i;return{[`@media screen and (min-width: ${(i=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r.minW)!=null?i:e})`]:{display:"none"}}}},hideBelow:{scale:"breakpoints",transform:(e,t)=>{var n,r,i;return{[`@media screen and (max-width: ${(i=(r=(n=t.__breakpoints)==null?void 0:n.get(e))==null?void 0:r._minW)!=null?i:e})`]:{display:"none"}}}},verticalAlign:!0,boxSizing:!0,boxDecorationBreak:!0,float:q.propT("float",Qt.float),objectFit:!0,objectPosition:!0,visibility:!0,isolation:!0};Object.assign(fa,{w:fa.width,h:fa.height,minW:fa.minWidth,maxW:fa.maxWidth,minH:fa.minHeight,maxH:fa.maxHeight,overscroll:fa.overscrollBehavior,overscrollX:fa.overscrollBehaviorX,overscrollY:fa.overscrollBehaviorY});var RAe={listStyleType:!0,listStylePosition:!0,listStylePos:q.prop("listStylePosition"),listStyleImage:!0,listStyleImg:q.prop("listStyleImage")};function OAe(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r<i.length&&e;r+=1)e=e[i[r]];return e===void 0?n:e}var MAe=e=>{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},NAe=MAe(OAe),$Ae={border:"0px",clip:"rect(0, 0, 0, 0)",width:"1px",height:"1px",margin:"-1px",padding:"0px",overflow:"hidden",whiteSpace:"nowrap",position:"absolute"},DAe={position:"static",width:"auto",height:"auto",clip:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal"},s5=(e,t,n)=>{const r={},i=NAe(e,t,{});for(const o in i)o in n&&n[o]!=null||(r[o]=i[o]);return r},LAe={srOnly:{transform(e){return e===!0?$Ae:e==="focusable"?DAe:{}}},layerStyle:{processResult:!0,transform:(e,t,n)=>s5(t,`layerStyles.${e}`,n)},textStyle:{processResult:!0,transform:(e,t,n)=>s5(t,`textStyles.${e}`,n)},apply:{processResult:!0,transform:(e,t,n)=>s5(t,e,n)}},Xg={position:!0,pos:q.prop("position"),zIndex:q.prop("zIndex","zIndices"),inset:q.spaceT("inset"),insetX:q.spaceT(["left","right"]),insetInline:q.spaceT("insetInline"),insetY:q.spaceT(["top","bottom"]),insetBlock:q.spaceT("insetBlock"),top:q.spaceT("top"),insetBlockStart:q.spaceT("insetBlockStart"),bottom:q.spaceT("bottom"),insetBlockEnd:q.spaceT("insetBlockEnd"),left:q.spaceT("left"),insetInlineStart:q.logical({scale:"space",property:{ltr:"left",rtl:"right"}}),right:q.spaceT("right"),insetInlineEnd:q.logical({scale:"space",property:{ltr:"right",rtl:"left"}})};Object.assign(Xg,{insetStart:Xg.insetInlineStart,insetEnd:Xg.insetInlineEnd});var FAe={ring:{transform:Qt.ring},ringColor:q.colors("--chakra-ring-color"),ringOffset:q.prop("--chakra-ring-offset-width"),ringOffsetColor:q.colors("--chakra-ring-offset-color"),ringInset:q.prop("--chakra-ring-inset")},Vn={margin:q.spaceT("margin"),marginTop:q.spaceT("marginTop"),marginBlockStart:q.spaceT("marginBlockStart"),marginRight:q.spaceT("marginRight"),marginInlineEnd:q.spaceT("marginInlineEnd"),marginBottom:q.spaceT("marginBottom"),marginBlockEnd:q.spaceT("marginBlockEnd"),marginLeft:q.spaceT("marginLeft"),marginInlineStart:q.spaceT("marginInlineStart"),marginX:q.spaceT(["marginInlineStart","marginInlineEnd"]),marginInline:q.spaceT("marginInline"),marginY:q.spaceT(["marginTop","marginBottom"]),marginBlock:q.spaceT("marginBlock"),padding:q.space("padding"),paddingTop:q.space("paddingTop"),paddingBlockStart:q.space("paddingBlockStart"),paddingRight:q.space("paddingRight"),paddingBottom:q.space("paddingBottom"),paddingBlockEnd:q.space("paddingBlockEnd"),paddingLeft:q.space("paddingLeft"),paddingInlineStart:q.space("paddingInlineStart"),paddingInlineEnd:q.space("paddingInlineEnd"),paddingX:q.space(["paddingInlineStart","paddingInlineEnd"]),paddingInline:q.space("paddingInline"),paddingY:q.space(["paddingTop","paddingBottom"]),paddingBlock:q.space("paddingBlock")};Object.assign(Vn,{m:Vn.margin,mt:Vn.marginTop,mr:Vn.marginRight,me:Vn.marginInlineEnd,marginEnd:Vn.marginInlineEnd,mb:Vn.marginBottom,ml:Vn.marginLeft,ms:Vn.marginInlineStart,marginStart:Vn.marginInlineStart,mx:Vn.marginX,my:Vn.marginY,p:Vn.padding,pt:Vn.paddingTop,py:Vn.paddingY,px:Vn.paddingX,pb:Vn.paddingBottom,pl:Vn.paddingLeft,ps:Vn.paddingInlineStart,paddingStart:Vn.paddingInlineStart,pr:Vn.paddingRight,pe:Vn.paddingInlineEnd,paddingEnd:Vn.paddingInlineEnd});var BAe={textDecorationColor:q.colors("textDecorationColor"),textDecoration:!0,textDecor:{property:"textDecoration"},textDecorationLine:!0,textDecorationStyle:!0,textDecorationThickness:!0,textUnderlineOffset:!0,textShadow:q.shadows("textShadow")},zAe={clipPath:!0,transform:q.propT("transform",Qt.transform),transformOrigin:!0,translateX:q.spaceT("--chakra-translate-x"),translateY:q.spaceT("--chakra-translate-y"),skewX:q.degreeT("--chakra-skew-x"),skewY:q.degreeT("--chakra-skew-y"),scaleX:q.prop("--chakra-scale-x"),scaleY:q.prop("--chakra-scale-y"),scale:q.prop(["--chakra-scale-x","--chakra-scale-y"]),rotate:q.degreeT("--chakra-rotate")},jAe={transition:!0,transitionDelay:!0,animation:!0,willChange:!0,transitionDuration:q.prop("transitionDuration","transition.duration"),transitionProperty:q.prop("transitionProperty","transition.property"),transitionTimingFunction:q.prop("transitionTimingFunction","transition.easing")},UAe={fontFamily:q.prop("fontFamily","fonts"),fontSize:q.prop("fontSize","fontSizes",Qt.px),fontWeight:q.prop("fontWeight","fontWeights"),lineHeight:q.prop("lineHeight","lineHeights"),letterSpacing:q.prop("letterSpacing","letterSpacings"),textAlign:!0,fontStyle:!0,textIndent:!0,wordBreak:!0,overflowWrap:!0,textOverflow:!0,textTransform:!0,whiteSpace:!0,isTruncated:{transform(e){if(e===!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"}},VAe={scrollBehavior:!0,scrollSnapAlign:!0,scrollSnapStop:!0,scrollSnapType:!0,scrollMargin:q.spaceT("scrollMargin"),scrollMarginTop:q.spaceT("scrollMarginTop"),scrollMarginBottom:q.spaceT("scrollMarginBottom"),scrollMarginLeft:q.spaceT("scrollMarginLeft"),scrollMarginRight:q.spaceT("scrollMarginRight"),scrollMarginX:q.spaceT(["scrollMarginLeft","scrollMarginRight"]),scrollMarginY:q.spaceT(["scrollMarginTop","scrollMarginBottom"]),scrollPadding:q.spaceT("scrollPadding"),scrollPaddingTop:q.spaceT("scrollPaddingTop"),scrollPaddingBottom:q.spaceT("scrollPaddingBottom"),scrollPaddingLeft:q.spaceT("scrollPaddingLeft"),scrollPaddingRight:q.spaceT("scrollPaddingRight"),scrollPaddingX:q.spaceT(["scrollPaddingLeft","scrollPaddingRight"]),scrollPaddingY:q.spaceT(["scrollPaddingTop","scrollPaddingBottom"])};function $q(e){return Ws(e)&&e.reference?e.reference:String(e)}var iw=(e,...t)=>t.map($q).join(` ${e} `).replace(/calc/g,""),lM=(...e)=>`calc(${iw("+",...e)})`,uM=(...e)=>`calc(${iw("-",...e)})`,pT=(...e)=>`calc(${iw("*",...e)})`,cM=(...e)=>`calc(${iw("/",...e)})`,dM=e=>{const t=$q(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:pT(t,-1)},Xc=Object.assign(e=>({add:(...t)=>Xc(lM(e,...t)),subtract:(...t)=>Xc(uM(e,...t)),multiply:(...t)=>Xc(pT(e,...t)),divide:(...t)=>Xc(cM(e,...t)),negate:()=>Xc(dM(e)),toString:()=>e.toString()}),{add:lM,subtract:uM,multiply:pT,divide:cM,negate:dM});function GAe(e,t="-"){return e.replace(/\s+/g,t)}function qAe(e){const t=GAe(e.toString());return WAe(HAe(t))}function HAe(e){return e.includes("\\.")?e:!Number.isInteger(parseFloat(e.toString()))?e.replace(".","\\."):e}function WAe(e){return e.replace(/[!-,/:-@[-^`{-~]/g,"\\$&")}function KAe(e,t=""){return[t,e].filter(Boolean).join("-")}function QAe(e,t){return`var(${e}${t?`, ${t}`:""})`}function XAe(e,t=""){return qAe(`--${KAe(e,t)}`)}function nt(e,t,n){const r=XAe(e,n);return{variable:r,reference:QAe(r,t)}}function YAe(e,t){const n={};for(const r of t){if(Array.isArray(r)){const[i,o]=r;n[i]=nt(`${e}-${i}`,o);continue}n[r]=nt(`${e}-${r}`)}return n}function ZAe(e){const t=e==null?0:e.length;return t?e[t-1]:void 0}function JAe(e){const t=parseFloat(e.toString()),n=e.toString().replace(String(t),"");return{unitless:!n,value:t,unit:n}}function gT(e){if(e==null)return e;const{unitless:t}=JAe(e);return t||typeof e=="number"?`${e}px`:e}var Dq=(e,t)=>parseInt(e[1],10)>parseInt(t[1],10)?1:-1,QA=e=>Object.fromEntries(Object.entries(e).sort(Dq));function fM(e){const t=QA(e);return Object.assign(Object.values(t),t)}function ePe(e){const t=Object.keys(QA(e));return new Set(t)}function hM(e){var t;if(!e)return e;e=(t=gT(e))!=null?t:e;const n=-.02;return typeof e=="number"?`${e+n}`:e.replace(/(\d+\.?\d*)/u,r=>`${parseFloat(r)+n}`)}function Tg(e,t){const n=["@media screen"];return e&&n.push("and",`(min-width: ${gT(e)})`),t&&n.push("and",`(max-width: ${gT(t)})`),n.join(" ")}function tPe(e){var t;if(!e)return null;e.base=(t=e.base)!=null?t:"0px";const n=fM(e),r=Object.entries(e).sort(Dq).map(([a,s],l,u)=>{var c;let[,d]=(c=u[l+1])!=null?c:[];return d=parseFloat(d)>0?hM(d):void 0,{_minW:hM(s),breakpoint:a,minW:s,maxW:d,maxWQuery:Tg(null,d),minWQuery:Tg(s),minMaxQuery:Tg(s,d)}}),i=ePe(e),o=Array.from(i.values());return{keys:i,normalized:n,isResponsive(a){const s=Object.keys(a);return s.length>0&&s.every(l=>i.has(l))},asObject:QA(e),asArray:fM(e),details:r,get(a){return r.find(s=>s.breakpoint===a)},media:[null,...n.map(a=>Tg(a)).slice(1)],toArrayValue(a){if(!Ws(a))throw new Error("toArrayValue: value must be an object");const s=o.map(l=>{var u;return(u=a[l])!=null?u:null});for(;ZAe(s)===null;)s.pop();return s},toObjectValue(a){if(!Array.isArray(a))throw new Error("toObjectValue: value must be an array");return a.reduce((s,l,u)=>{const c=o[u];return c!=null&&l!=null&&(s[c]=l),s},{})}}}var Si={hover:(e,t)=>`${e}:hover ${t}, ${e}[data-hover] ${t}`,focus:(e,t)=>`${e}:focus ${t}, ${e}[data-focus] ${t}`,focusVisible:(e,t)=>`${e}:focus-visible ${t}`,focusWithin:(e,t)=>`${e}:focus-within ${t}`,active:(e,t)=>`${e}:active ${t}, ${e}[data-active] ${t}`,disabled:(e,t)=>`${e}:disabled ${t}, ${e}[data-disabled] ${t}`,invalid:(e,t)=>`${e}:invalid ${t}, ${e}[data-invalid] ${t}`,checked:(e,t)=>`${e}:checked ${t}, ${e}[data-checked] ${t}`,indeterminate:(e,t)=>`${e}:indeterminate ${t}, ${e}[aria-checked=mixed] ${t}, ${e}[data-indeterminate] ${t}`,readOnly:(e,t)=>`${e}:read-only ${t}, ${e}[readonly] ${t}, ${e}[data-read-only] ${t}`,expanded:(e,t)=>`${e}:read-only ${t}, ${e}[aria-expanded=true] ${t}, ${e}[data-expanded] ${t}`,placeholderShown:(e,t)=>`${e}:placeholder-shown ${t}`},hu=e=>Lq(t=>e(t,"&"),"[role=group]","[data-group]",".group"),hl=e=>Lq(t=>e(t,"~ &"),"[data-peer]",".peer"),Lq=(e,...t)=>t.map(e).join(", "),ow={_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",_firstLetter:"&::first-letter",_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:hu(Si.hover),_peerHover:hl(Si.hover),_groupFocus:hu(Si.focus),_peerFocus:hl(Si.focus),_groupFocusVisible:hu(Si.focusVisible),_peerFocusVisible:hl(Si.focusVisible),_groupActive:hu(Si.active),_peerActive:hl(Si.active),_groupDisabled:hu(Si.disabled),_peerDisabled:hl(Si.disabled),_groupInvalid:hu(Si.invalid),_peerInvalid:hl(Si.invalid),_groupChecked:hu(Si.checked),_peerChecked:hl(Si.checked),_groupFocusWithin:hu(Si.focusWithin),_peerFocusWithin:hl(Si.focusWithin),_peerPlaceholderShown:hl(Si.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]",_horizontal:"&[data-orientation=horizontal]",_vertical:"&[data-orientation=vertical]"},Fq=Object.keys(ow);function pM(e,t){return nt(String(e).replace(/\./g,"-"),void 0,t)}function nPe(e,t){let n={};const r={};for(const[i,o]of Object.entries(e)){const{isSemantic:a,value:s}=o,{variable:l,reference:u}=pM(i,t==null?void 0:t.cssVarPrefix);if(!a){if(i.startsWith("space")){const f=i.split("."),[h,...p]=f,m=`${h}.-${p.join(".")}`,_=Xc.negate(s),b=Xc.negate(u);r[m]={value:_,var:l,varRef:b}}n[l]=s,r[i]={value:s,var:l,varRef:u};continue}const c=f=>{const p=[String(i).split(".")[0],f].join(".");if(!e[p])return f;const{reference:_}=pM(p,t==null?void 0:t.cssVarPrefix);return _},d=Ws(s)?s:{default:s};n=Fs(n,Object.entries(d).reduce((f,[h,p])=>{var m,_;if(!p)return f;const b=c(`${p}`);if(h==="default")return f[l]=b,f;const y=(_=(m=ow)==null?void 0:m[h])!=null?_:h;return f[y]={[l]:b},f},{})),r[i]={value:u,var:l,varRef:u}}return{cssVars:n,cssMap:r}}function rPe(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}function iPe(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function oPe(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}function gM(e,t,n={}){const{stop:r,getKey:i}=n;function o(a,s=[]){var l;if(oPe(a)||Array.isArray(a)){const u={};for(const[c,d]of Object.entries(a)){const f=(l=i==null?void 0:i(c))!=null?l:c,h=[...s,f];if(r!=null&&r(a,h))return t(a,s);u[f]=o(d,h)}return u}return t(a,s)}return o(e)}var aPe=["colors","borders","borderWidths","borderStyles","fonts","fontSizes","fontWeights","gradients","letterSpacings","lineHeights","radii","space","shadows","sizes","zIndices","transition","blur","breakpoints"];function sPe(e){return iPe(e,aPe)}function lPe(e){return e.semanticTokens}function uPe(e){const{__cssMap:t,__cssVars:n,__breakpoints:r,...i}=e;return i}var cPe=e=>Fq.includes(e)||e==="default";function dPe({tokens:e,semanticTokens:t}){const n={};return gM(e,(r,i)=>{r!=null&&(n[i.join(".")]={isSemantic:!1,value:r})}),gM(t,(r,i)=>{r!=null&&(n[i.join(".")]={isSemantic:!0,value:r})},{stop:r=>Object.keys(r).every(cPe)}),n}function fPe(e){var t;const n=uPe(e),r=sPe(n),i=lPe(n),o=dPe({tokens:r,semanticTokens:i}),a=(t=n.config)==null?void 0:t.cssVarPrefix,{cssMap:s,cssVars:l}=nPe(o,{cssVarPrefix:a});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"},...l},__cssMap:s,__breakpoints:tPe(n.breakpoints)}),n}var XA=Fs({},Q1,sn,AAe,H_,fa,PAe,FAe,IAe,Nq,LAe,Xg,hT,Vn,VAe,UAe,BAe,zAe,RAe,jAe),hPe=Object.assign({},Vn,fa,H_,Nq,Xg),WKe=Object.keys(hPe),pPe=[...Object.keys(XA),...Fq],gPe={...XA,...ow},mPe=e=>e in gPe,yPe=e=>t=>{if(!t.__breakpoints)return e;const{isResponsive:n,toArrayValue:r,media:i}=t.__breakpoints,o={};for(const a in e){let s=Ls(e[a],t);if(s==null)continue;if(s=Ws(s)&&n(s)?r(s):s,!Array.isArray(s)){o[a]=s;continue}const l=s.slice(0,i.length).length;for(let u=0;u<l;u+=1){const c=i==null?void 0:i[u];if(!c){o[a]=s[u];continue}o[c]=o[c]||{},s[u]!=null&&(o[c][a]=s[u])}}return o};function vPe(e){const t=[];let n="",r=!1;for(let i=0;i<e.length;i++){const o=e[i];o==="("?(r=!0,n+=o):o===")"?(r=!1,n+=o):o===","&&!r?(t.push(n),n=""):n+=o}return n=n.trim(),n&&t.push(n),t}function bPe(e){return/^var\(--.+\)$/.test(e)}var _Pe=(e,t)=>e.startsWith("--")&&typeof t=="string"&&!bPe(t),SPe=(e,t)=>{var n,r;if(t==null)return t;const i=l=>{var u,c;return(c=(u=e.__cssMap)==null?void 0:u[l])==null?void 0:c.varRef},o=l=>{var u;return(u=i(l))!=null?u:l},[a,s]=vPe(t);return t=(r=(n=i(a))!=null?n:o(s))!=null?r:o(t),t};function xPe(e){const{configs:t={},pseudos:n={},theme:r}=e,i=(o,a=!1)=>{var s,l,u;const c=Ls(o,r),d=yPe(c)(r);let f={};for(let h in d){const p=d[h];let m=Ls(p,r);h in n&&(h=n[h]),_Pe(h,m)&&(m=SPe(r,m));let _=t[h];if(_===!0&&(_={property:h}),Ws(m)){f[h]=(s=f[h])!=null?s:{},f[h]=Fs({},f[h],i(m,!0));continue}let b=(u=(l=_==null?void 0:_.transform)==null?void 0:l.call(_,m,r,c))!=null?u:m;b=_!=null&&_.processResult?i(b,!0):b;const y=Ls(_==null?void 0:_.property,r);if(!a&&(_!=null&&_.static)){const g=Ls(_.static,r);f=Fs({},f,g)}if(y&&Array.isArray(y)){for(const g of y)f[g]=b;continue}if(y){y==="&"&&Ws(b)?f=Fs({},f,b):f[y]=b;continue}if(Ws(b)){f=Fs({},f,b);continue}f[h]=b}return f};return i}var Bq=e=>t=>xPe({theme:t,pseudos:ow,configs:XA})(e);function Pt(e){return{definePartsStyle(t){return t},defineMultiStyleConfig(t){return{parts:e,...t}}}}function wPe(e,t){if(Array.isArray(e))return e;if(Ws(e))return t(e);if(e!=null)return[e]}function CPe(e,t){for(let n=t+1;n<e.length;n++)if(e[n]!=null)return n;return-1}function EPe(e){const t=e.__breakpoints;return function(r,i,o,a){var s,l;if(!t)return;const u={},c=wPe(o,t.toArrayValue);if(!c)return u;const d=c.length,f=d===1,h=!!r.parts;for(let p=0;p<d;p++){const m=t.details[p],_=t.details[CPe(c,p)],b=Tg(m.minW,_==null?void 0:_._minW),y=Ls((s=r[i])==null?void 0:s[c[p]],a);if(y){if(h){(l=r.parts)==null||l.forEach(g=>{Fs(u,{[g]:f?y[g]:{[b]:y[g]}})});continue}if(!h){f?Fs(u,y):u[b]=y;continue}u[b]=y}}return u}}function TPe(e){return t=>{var n;const{variant:r,size:i,theme:o}=t,a=EPe(o);return Fs({},Ls((n=e.baseStyle)!=null?n:{},t),a(e,"sizes",i,t),a(e,"variants",r,t))}}function KKe(e,t,n){var r,i,o;return(o=(i=(r=e.__cssMap)==null?void 0:r[`${t}.${n}`])==null?void 0:i.varRef)!=null?o:n}function Ry(e){return rPe(e,["styleConfig","size","variant","colorScheme"])}var kPe={common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, transform",colors:"background-color, border-color, color, fill, stroke",dimensions:"width, height",position:"left, right, top, bottom",background:"background-color, background-image, background-position"},APe={"ease-in":"cubic-bezier(0.4, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.2, 1)","ease-in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},PPe={"ultra-fast":"50ms",faster:"100ms",fast:"150ms",normal:"200ms",slow:"300ms",slower:"400ms","ultra-slow":"500ms"},IPe={property:kPe,easing:APe,duration:PPe},RPe=IPe,OPe={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e3,sticky:1100,banner:1200,overlay:1300,modal:1400,popover:1500,skipLink:1600,toast:1700,tooltip:1800},MPe=OPe,NPe={none:0,"1px":"1px solid","2px":"2px solid","4px":"4px solid","8px":"8px solid"},$Pe=NPe,DPe={base:"0em",sm:"30em",md:"48em",lg:"62em",xl:"80em","2xl":"96em"},LPe=DPe,FPe={transparent:"transparent",current:"currentColor",black:"#000000",white:"#FFFFFF",whiteAlpha:{50:"rgba(255, 255, 255, 0.04)",100:"rgba(255, 255, 255, 0.06)",200:"rgba(255, 255, 255, 0.08)",300:"rgba(255, 255, 255, 0.16)",400:"rgba(255, 255, 255, 0.24)",500:"rgba(255, 255, 255, 0.36)",600:"rgba(255, 255, 255, 0.48)",700:"rgba(255, 255, 255, 0.64)",800:"rgba(255, 255, 255, 0.80)",900:"rgba(255, 255, 255, 0.92)"},blackAlpha:{50:"rgba(0, 0, 0, 0.04)",100:"rgba(0, 0, 0, 0.06)",200:"rgba(0, 0, 0, 0.08)",300:"rgba(0, 0, 0, 0.16)",400:"rgba(0, 0, 0, 0.24)",500:"rgba(0, 0, 0, 0.36)",600:"rgba(0, 0, 0, 0.48)",700:"rgba(0, 0, 0, 0.64)",800:"rgba(0, 0, 0, 0.80)",900:"rgba(0, 0, 0, 0.92)"},gray:{50:"#F7FAFC",100:"#EDF2F7",200:"#E2E8F0",300:"#CBD5E0",400:"#A0AEC0",500:"#718096",600:"#4A5568",700:"#2D3748",800:"#1A202C",900:"#171923"},red:{50:"#FFF5F5",100:"#FED7D7",200:"#FEB2B2",300:"#FC8181",400:"#F56565",500:"#E53E3E",600:"#C53030",700:"#9B2C2C",800:"#822727",900:"#63171B"},orange:{50:"#FFFAF0",100:"#FEEBC8",200:"#FBD38D",300:"#F6AD55",400:"#ED8936",500:"#DD6B20",600:"#C05621",700:"#9C4221",800:"#7B341E",900:"#652B19"},yellow:{50:"#FFFFF0",100:"#FEFCBF",200:"#FAF089",300:"#F6E05E",400:"#ECC94B",500:"#D69E2E",600:"#B7791F",700:"#975A16",800:"#744210",900:"#5F370E"},green:{50:"#F0FFF4",100:"#C6F6D5",200:"#9AE6B4",300:"#68D391",400:"#48BB78",500:"#38A169",600:"#2F855A",700:"#276749",800:"#22543D",900:"#1C4532"},teal:{50:"#E6FFFA",100:"#B2F5EA",200:"#81E6D9",300:"#4FD1C5",400:"#38B2AC",500:"#319795",600:"#2C7A7B",700:"#285E61",800:"#234E52",900:"#1D4044"},blue:{50:"#ebf8ff",100:"#bee3f8",200:"#90cdf4",300:"#63b3ed",400:"#4299e1",500:"#3182ce",600:"#2b6cb0",700:"#2c5282",800:"#2a4365",900:"#1A365D"},cyan:{50:"#EDFDFD",100:"#C4F1F9",200:"#9DECF9",300:"#76E4F7",400:"#0BC5EA",500:"#00B5D8",600:"#00A3C4",700:"#0987A0",800:"#086F83",900:"#065666"},purple:{50:"#FAF5FF",100:"#E9D8FD",200:"#D6BCFA",300:"#B794F4",400:"#9F7AEA",500:"#805AD5",600:"#6B46C1",700:"#553C9A",800:"#44337A",900:"#322659"},pink:{50:"#FFF5F7",100:"#FED7E2",200:"#FBB6CE",300:"#F687B3",400:"#ED64A6",500:"#D53F8C",600:"#B83280",700:"#97266D",800:"#702459",900:"#521B41"},linkedin:{50:"#E8F4F9",100:"#CFEDFB",200:"#9BDAF3",300:"#68C7EC",400:"#34B3E4",500:"#00A0DC",600:"#008CC9",700:"#0077B5",800:"#005E93",900:"#004471"},facebook:{50:"#E8F4F9",100:"#D9DEE9",200:"#B7C2DA",300:"#6482C0",400:"#4267B2",500:"#385898",600:"#314E89",700:"#29487D",800:"#223B67",900:"#1E355B"},messenger:{50:"#D0E6FF",100:"#B9DAFF",200:"#A2CDFF",300:"#7AB8FF",400:"#2E90FF",500:"#0078FF",600:"#0063D1",700:"#0052AC",800:"#003C7E",900:"#002C5C"},whatsapp:{50:"#dffeec",100:"#b9f5d0",200:"#90edb3",300:"#65e495",400:"#3cdd78",500:"#22c35e",600:"#179848",700:"#0c6c33",800:"#01421c",900:"#001803"},twitter:{50:"#E5F4FD",100:"#C8E9FB",200:"#A8DCFA",300:"#83CDF7",400:"#57BBF5",500:"#1DA1F2",600:"#1A94DA",700:"#1681BF",800:"#136B9E",900:"#0D4D71"},telegram:{50:"#E3F2F9",100:"#C5E4F3",200:"#A2D4EC",300:"#7AC1E4",400:"#47A9DA",500:"#0088CC",600:"#007AB8",700:"#006BA1",800:"#005885",900:"#003F5E"}},BPe=FPe,zPe={none:"0",sm:"0.125rem",base:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},jPe=zPe,UPe={xs:"0 0 0 1px rgba(0, 0, 0, 0.05)",sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",base:"0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",xl:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)","2xl":"0 25px 50px -12px rgba(0, 0, 0, 0.25)",outline:"0 0 0 3px rgba(66, 153, 225, 0.6)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.06)",none:"none","dark-lg":"rgba(0, 0, 0, 0.1) 0px 0px 0px 1px, rgba(0, 0, 0, 0.2) 0px 5px 10px, rgba(0, 0, 0, 0.4) 0px 15px 40px"},VPe=UPe,GPe={none:0,sm:"4px",base:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},qPe=GPe,HPe={letterSpacings:{tighter:"-0.05em",tight:"-0.025em",normal:"0",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeights:{normal:"normal",none:1,shorter:1.25,short:1.375,base:1.5,tall:1.625,taller:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},fontWeights:{hairline:100,thin:200,light:300,normal:400,medium:500,semibold:600,bold:700,extrabold:800,black:900},fonts:{heading:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'},fontSizes:{"3xs":"0.45rem","2xs":"0.625rem",xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem","5xl":"3rem","6xl":"3.75rem","7xl":"4.5rem","8xl":"6rem","9xl":"8rem"}},zq=HPe,jq={px:"1px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},WPe={max:"max-content",min:"min-content",full:"100%","3xs":"14rem","2xs":"16rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem","8xl":"90rem",prose:"60ch"},KPe={sm:"640px",md:"768px",lg:"1024px",xl:"1280px"},QPe={...jq,...WPe,container:KPe},Uq=QPe,XPe={breakpoints:LPe,zIndices:MPe,radii:jPe,blur:qPe,colors:BPe,...zq,sizes:Uq,shadows:VPe,space:jq,borders:$Pe,transition:RPe},{defineMultiStyleConfig:YPe,definePartsStyle:kg}=Pt(["stepper","step","title","description","indicator","separator","icon","number"]),kl=nt("stepper-indicator-size"),Uf=nt("stepper-icon-size"),Vf=nt("stepper-title-font-size"),Ag=nt("stepper-description-font-size"),ag=nt("stepper-accent-color"),ZPe=kg(({colorScheme:e})=>({stepper:{display:"flex",justifyContent:"space-between",gap:"4","&[data-orientation=vertical]":{flexDirection:"column",alignItems:"flex-start"},"&[data-orientation=horizontal]":{flexDirection:"row",alignItems:"center"},[ag.variable]:`colors.${e}.500`,_dark:{[ag.variable]:`colors.${e}.200`}},title:{fontSize:Vf.reference,fontWeight:"medium"},description:{fontSize:Ag.reference,color:"chakra-subtle-text"},number:{fontSize:Vf.reference},step:{flexShrink:0,position:"relative",display:"flex",gap:"2","&[data-orientation=horizontal]":{alignItems:"center"},flex:"1","&:last-of-type:not([data-stretch])":{flex:"initial"}},icon:{flexShrink:0,width:Uf.reference,height:Uf.reference},indicator:{flexShrink:0,borderRadius:"full",width:kl.reference,height:kl.reference,display:"flex",justifyContent:"center",alignItems:"center","&[data-status=active]":{borderWidth:"2px",borderColor:ag.reference},"&[data-status=complete]":{bg:ag.reference,color:"chakra-inverse-text"},"&[data-status=incomplete]":{borderWidth:"2px"}},separator:{bg:"chakra-border-color",flex:"1","&[data-status=complete]":{bg:ag.reference},"&[data-orientation=horizontal]":{width:"100%",height:"2px",marginStart:"2"},"&[data-orientation=vertical]":{width:"2px",position:"absolute",height:"100%",maxHeight:`calc(100% - ${kl.reference} - 8px)`,top:`calc(${kl.reference} + 4px)`,insetStart:`calc(${kl.reference} / 2 - 1px)`}}})),JPe=YPe({baseStyle:ZPe,sizes:{xs:kg({stepper:{[kl.variable]:"sizes.4",[Uf.variable]:"sizes.3",[Vf.variable]:"fontSizes.xs",[Ag.variable]:"fontSizes.xs"}}),sm:kg({stepper:{[kl.variable]:"sizes.6",[Uf.variable]:"sizes.4",[Vf.variable]:"fontSizes.sm",[Ag.variable]:"fontSizes.xs"}}),md:kg({stepper:{[kl.variable]:"sizes.8",[Uf.variable]:"sizes.5",[Vf.variable]:"fontSizes.md",[Ag.variable]:"fontSizes.sm"}}),lg:kg({stepper:{[kl.variable]:"sizes.10",[Uf.variable]:"sizes.6",[Vf.variable]:"fontSizes.lg",[Ag.variable]:"fontSizes.md"}})},defaultProps:{size:"md",colorScheme:"blue"}});function gn(e,t={}){let n=!1;function r(){if(!n){n=!0;return}throw new Error("[anatomy] .part(...) should only be called once. Did you mean to use .extend(...) ?")}function i(...c){r();for(const d of c)t[d]=l(d);return gn(e,t)}function o(...c){for(const d of c)d in t||(t[d]=l(d));return gn(e,t)}function a(){return Object.fromEntries(Object.entries(t).map(([d,f])=>[d,f.selector]))}function s(){return Object.fromEntries(Object.entries(t).map(([d,f])=>[d,f.className]))}function l(c){const h=`chakra-${(["container","root"].includes(c??"")?[e]:[e,c]).filter(Boolean).join("__")}`;return{className:h,selector:`.${h}`,toString:()=>c}}return{parts:i,toPart:l,extend:o,selectors:a,classnames:s,get keys(){return Object.keys(t)},__type:{}}}var Vq=gn("accordion").parts("root","container","button","panel").extend("icon"),e6e=gn("alert").parts("title","description","container").extend("icon","spinner"),t6e=gn("avatar").parts("label","badge","container").extend("excessLabel","group"),n6e=gn("breadcrumb").parts("link","item","container").extend("separator");gn("button").parts();var Gq=gn("checkbox").parts("control","icon","container").extend("label");gn("progress").parts("track","filledTrack").extend("label");var r6e=gn("drawer").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),qq=gn("editable").parts("preview","input","textarea"),i6e=gn("form").parts("container","requiredIndicator","helperText"),o6e=gn("formError").parts("text","icon"),Hq=gn("input").parts("addon","field","element","group"),a6e=gn("list").parts("container","item","icon"),Wq=gn("menu").parts("button","list","item").extend("groupTitle","icon","command","divider"),Kq=gn("modal").parts("overlay","dialogContainer","dialog").extend("header","closeButton","body","footer"),Qq=gn("numberinput").parts("root","field","stepperGroup","stepper");gn("pininput").parts("field");var Xq=gn("popover").parts("content","header","body","footer").extend("popper","arrow","closeButton"),Yq=gn("progress").parts("label","filledTrack","track"),s6e=gn("radio").parts("container","control","label"),Zq=gn("select").parts("field","icon"),Jq=gn("slider").parts("container","track","thumb","filledTrack","mark"),l6e=gn("stat").parts("container","label","helpText","number","icon"),eH=gn("switch").parts("container","track","thumb"),u6e=gn("table").parts("table","thead","tbody","tr","th","td","tfoot","caption"),tH=gn("tabs").parts("root","tab","tablist","tabpanel","tabpanels","indicator"),c6e=gn("tag").parts("container","label","closeButton"),d6e=gn("card").parts("container","header","body","footer");function ld(e,t,n){return Math.min(Math.max(e,n),t)}class f6e extends Error{constructor(t){super(`Failed to parse color: "${t}"`)}}var Pg=f6e;function YA(e){if(typeof e!="string")throw new Pg(e);if(e.trim().toLowerCase()==="transparent")return[0,0,0,0];let t=e.trim();t=_6e.test(e)?g6e(e):e;const n=m6e.exec(t);if(n){const a=Array.from(n).slice(1);return[...a.slice(0,3).map(s=>parseInt(k0(s,2),16)),parseInt(k0(a[3]||"f",2),16)/255]}const r=y6e.exec(t);if(r){const a=Array.from(r).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,16)),parseInt(a[3]||"ff",16)/255]}const i=v6e.exec(t);if(i){const a=Array.from(i).slice(1);return[...a.slice(0,3).map(s=>parseInt(s,10)),parseFloat(a[3]||"1")]}const o=b6e.exec(t);if(o){const[a,s,l,u]=Array.from(o).slice(1).map(parseFloat);if(ld(0,100,s)!==s)throw new Pg(e);if(ld(0,100,l)!==l)throw new Pg(e);return[...S6e(a,s,l),Number.isNaN(u)?1:u]}throw new Pg(e)}function h6e(e){let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return(t>>>0)%2341}const mM=e=>parseInt(e.replace(/_/g,""),36),p6e="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((e,t)=>{const n=mM(t.substring(0,3)),r=mM(t.substring(3)).toString(16);let i="";for(let o=0;o<6-r.length;o++)i+="0";return e[n]=`${i}${r}`,e},{});function g6e(e){const t=e.toLowerCase().trim(),n=p6e[h6e(t)];if(!n)throw new Pg(e);return`#${n}`}const k0=(e,t)=>Array.from(Array(t)).map(()=>e).join(""),m6e=new RegExp(`^#${k0("([a-f0-9])",3)}([a-f0-9])?$`,"i"),y6e=new RegExp(`^#${k0("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),v6e=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${k0(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),b6e=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,_6e=/^[a-z]+$/i,yM=e=>Math.round(e*255),S6e=(e,t,n)=>{let r=n/100;if(t===0)return[r,r,r].map(yM);const i=(e%360+360)%360/60,o=(1-Math.abs(2*r-1))*(t/100),a=o*(1-Math.abs(i%2-1));let s=0,l=0,u=0;i>=0&&i<1?(s=o,l=a):i>=1&&i<2?(s=a,l=o):i>=2&&i<3?(l=o,u=a):i>=3&&i<4?(l=a,u=o):i>=4&&i<5?(s=a,u=o):i>=5&&i<6&&(s=o,u=a);const c=r-o/2,d=s+c,f=l+c,h=u+c;return[d,f,h].map(yM)};function x6e(e,t,n,r){return`rgba(${ld(0,255,e).toFixed()}, ${ld(0,255,t).toFixed()}, ${ld(0,255,n).toFixed()}, ${parseFloat(ld(0,1,r).toFixed(3))})`}function w6e(e,t){const[n,r,i,o]=YA(e);return x6e(n,r,i,o-t)}function C6e(e){const[t,n,r,i]=YA(e);let o=a=>{const s=ld(0,255,a).toString(16);return s.length===1?`0${s}`:s};return`#${o(t)}${o(n)}${o(r)}${i<1?o(Math.round(i*255)):""}`}function E6e(e,t,n,r,i){for(t=t.split?t.split("."):t,r=0;r<t.length;r++)e=e?e[t[r]]:i;return e===i?n:e}var T6e=e=>Object.keys(e).length===0,ro=(e,t,n)=>{const r=E6e(e,`colors.${t}`,t);try{return C6e(r),r}catch{return n??"#000000"}},k6e=e=>{const[t,n,r]=YA(e);return(t*299+n*587+r*114)/1e3},A6e=e=>t=>{const n=ro(t,e);return k6e(n)<128?"dark":"light"},P6e=e=>t=>A6e(e)(t)==="dark",sp=(e,t)=>n=>{const r=ro(n,e);return w6e(r,1-t)};function vM(e="1rem",t="rgba(255, 255, 255, 0.15)"){return{backgroundImage:`linear-gradient(
|
||
45deg,
|
||
${t} 25%,
|
||
transparent 25%,
|
||
transparent 50%,
|
||
${t} 50%,
|
||
${t} 75%,
|
||
transparent 75%,
|
||
transparent
|
||
)`,backgroundSize:`${e} ${e}`}}var I6e=()=>`#${Math.floor(Math.random()*16777215).toString(16).padEnd(6,"0")}`;function R6e(e){const t=I6e();return!e||T6e(e)?t:e.string&&e.colors?M6e(e.string,e.colors):e.string&&!e.colors?O6e(e.string):e.colors&&!e.string?N6e(e.colors):t}function O6e(e){let t=0;if(e.length===0)return t.toString();for(let r=0;r<e.length;r+=1)t=e.charCodeAt(r)+((t<<5)-t),t=t&t;let n="#";for(let r=0;r<3;r+=1){const i=t>>r*8&255;n+=`00${i.toString(16)}`.substr(-2)}return n}function M6e(e,t){let n=0;if(e.length===0)return t[0];for(let r=0;r<e.length;r+=1)n=e.charCodeAt(r)+((n<<5)-n),n=n&n;return n=(n%t.length+t.length)%t.length,t[n]}function N6e(e){return e[Math.floor(Math.random()*e.length)]}function K(e,t){return n=>n.colorMode==="dark"?t:e}function ZA(e){const{orientation:t,vertical:n,horizontal:r}=e;return t?t==="vertical"?n:r:{}}function nH(e){return Ws(e)&&e.reference?e.reference:String(e)}var aw=(e,...t)=>t.map(nH).join(` ${e} `).replace(/calc/g,""),bM=(...e)=>`calc(${aw("+",...e)})`,_M=(...e)=>`calc(${aw("-",...e)})`,mT=(...e)=>`calc(${aw("*",...e)})`,SM=(...e)=>`calc(${aw("/",...e)})`,xM=e=>{const t=nH(e);return t!=null&&!Number.isNaN(parseFloat(t))?String(t).startsWith("-")?String(t).slice(1):`-${t}`:mT(t,-1)},Al=Object.assign(e=>({add:(...t)=>Al(bM(e,...t)),subtract:(...t)=>Al(_M(e,...t)),multiply:(...t)=>Al(mT(e,...t)),divide:(...t)=>Al(SM(e,...t)),negate:()=>Al(xM(e)),toString:()=>e.toString()}),{add:bM,subtract:_M,multiply:mT,divide:SM,negate:xM});function $6e(e){return!Number.isInteger(parseFloat(e.toString()))}function D6e(e,t="-"){return e.replace(/\s+/g,t)}function rH(e){const t=D6e(e.toString());return t.includes("\\.")?e:$6e(e)?t.replace(".","\\."):e}function L6e(e,t=""){return[t,rH(e)].filter(Boolean).join("-")}function F6e(e,t){return`var(${rH(e)}${t?`, ${t}`:""})`}function B6e(e,t=""){return`--${L6e(e,t)}`}function hr(e,t){const n=B6e(e,t==null?void 0:t.prefix);return{variable:n,reference:F6e(n,z6e(t==null?void 0:t.fallback))}}function z6e(e){return typeof e=="string"?e:e==null?void 0:e.reference}var{defineMultiStyleConfig:j6e,definePartsStyle:X1}=Pt(eH.keys),Yg=hr("switch-track-width"),bd=hr("switch-track-height"),l5=hr("switch-track-diff"),U6e=Al.subtract(Yg,bd),yT=hr("switch-thumb-x"),sg=hr("switch-bg"),V6e=e=>{const{colorScheme:t}=e;return{borderRadius:"full",p:"0.5",width:[Yg.reference],height:[bd.reference],transitionProperty:"common",transitionDuration:"fast",[sg.variable]:"colors.gray.300",_dark:{[sg.variable]:"colors.whiteAlpha.400"},_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed"},_checked:{[sg.variable]:`colors.${t}.500`,_dark:{[sg.variable]:`colors.${t}.200`}},bg:sg.reference}},G6e={bg:"white",transitionProperty:"transform",transitionDuration:"normal",borderRadius:"inherit",width:[bd.reference],height:[bd.reference],_checked:{transform:`translateX(${yT.reference})`}},q6e=X1(e=>({container:{[l5.variable]:U6e,[yT.variable]:l5.reference,_rtl:{[yT.variable]:Al(l5).negate().toString()}},track:V6e(e),thumb:G6e})),H6e={sm:X1({container:{[Yg.variable]:"1.375rem",[bd.variable]:"sizes.3"}}),md:X1({container:{[Yg.variable]:"1.875rem",[bd.variable]:"sizes.4"}}),lg:X1({container:{[Yg.variable]:"2.875rem",[bd.variable]:"sizes.6"}})},W6e=j6e({baseStyle:q6e,sizes:H6e,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:K6e,definePartsStyle:xh}=Pt(u6e.keys),Q6e=xh({table:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full"},th:{fontFamily:"heading",fontWeight:"bold",textTransform:"uppercase",letterSpacing:"wider",textAlign:"start"},td:{textAlign:"start"},caption:{mt:4,fontFamily:"heading",textAlign:"center",fontWeight:"medium"}}),W_={"&[data-is-numeric=true]":{textAlign:"end"}},X6e=xh(e=>{const{colorScheme:t}=e;return{th:{color:K("gray.600","gray.400")(e),borderBottom:"1px",borderColor:K(`${t}.100`,`${t}.700`)(e),...W_},td:{borderBottom:"1px",borderColor:K(`${t}.100`,`${t}.700`)(e),...W_},caption:{color:K("gray.600","gray.100")(e)},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Y6e=xh(e=>{const{colorScheme:t}=e;return{th:{color:K("gray.600","gray.400")(e),borderBottom:"1px",borderColor:K(`${t}.100`,`${t}.700`)(e),...W_},td:{borderBottom:"1px",borderColor:K(`${t}.100`,`${t}.700`)(e),...W_},caption:{color:K("gray.600","gray.100")(e)},tbody:{tr:{"&:nth-of-type(odd)":{"th, td":{borderBottomWidth:"1px",borderColor:K(`${t}.100`,`${t}.700`)(e)},td:{background:K(`${t}.100`,`${t}.700`)(e)}}}},tfoot:{tr:{"&:last-of-type":{th:{borderBottomWidth:0}}}}}}),Z6e={simple:X6e,striped:Y6e,unstyled:{}},J6e={sm:xh({th:{px:"4",py:"1",lineHeight:"4",fontSize:"xs"},td:{px:"4",py:"2",fontSize:"sm",lineHeight:"4"},caption:{px:"4",py:"2",fontSize:"xs"}}),md:xh({th:{px:"6",py:"3",lineHeight:"4",fontSize:"xs"},td:{px:"6",py:"4",lineHeight:"5"},caption:{px:"6",py:"2",fontSize:"sm"}}),lg:xh({th:{px:"8",py:"4",lineHeight:"5",fontSize:"sm"},td:{px:"8",py:"5",lineHeight:"6"},caption:{px:"6",py:"2",fontSize:"md"}})},e8e=K6e({baseStyle:Q6e,variants:Z6e,sizes:J6e,defaultProps:{variant:"simple",size:"md",colorScheme:"gray"}}),So=nt("tabs-color"),Ya=nt("tabs-bg"),Xv=nt("tabs-border-color"),{defineMultiStyleConfig:t8e,definePartsStyle:Ks}=Pt(tH.keys),n8e=e=>{const{orientation:t}=e;return{display:t==="vertical"?"flex":"block"}},r8e=e=>{const{isFitted:t}=e;return{flex:t?1:void 0,transitionProperty:"common",transitionDuration:"normal",_focusVisible:{zIndex:1,boxShadow:"outline"},_disabled:{cursor:"not-allowed",opacity:.4}}},i8e=e=>{const{align:t="start",orientation:n}=e;return{justifyContent:{end:"flex-end",center:"center",start:"flex-start"}[t],flexDirection:n==="vertical"?"column":"row"}},o8e={p:4},a8e=Ks(e=>({root:n8e(e),tab:r8e(e),tablist:i8e(e),tabpanel:o8e})),s8e={sm:Ks({tab:{py:1,px:4,fontSize:"sm"}}),md:Ks({tab:{fontSize:"md",py:2,px:4}}),lg:Ks({tab:{fontSize:"lg",py:3,px:4}})},l8e=Ks(e=>{const{colorScheme:t,orientation:n}=e,r=n==="vertical",i=r?"borderStart":"borderBottom",o=r?"marginStart":"marginBottom";return{tablist:{[i]:"2px solid",borderColor:"inherit"},tab:{[i]:"2px solid",borderColor:"transparent",[o]:"-2px",_selected:{[So.variable]:`colors.${t}.600`,_dark:{[So.variable]:`colors.${t}.300`},borderColor:"currentColor"},_active:{[Ya.variable]:"colors.gray.200",_dark:{[Ya.variable]:"colors.whiteAlpha.300"}},_disabled:{_active:{bg:"none"}},color:So.reference,bg:Ya.reference}}}),u8e=Ks(e=>{const{colorScheme:t}=e;return{tab:{borderTopRadius:"md",border:"1px solid",borderColor:"transparent",mb:"-1px",[Xv.variable]:"transparent",_selected:{[So.variable]:`colors.${t}.600`,[Xv.variable]:"colors.white",_dark:{[So.variable]:`colors.${t}.300`,[Xv.variable]:"colors.gray.800"},borderColor:"inherit",borderBottomColor:Xv.reference},color:So.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),c8e=Ks(e=>{const{colorScheme:t}=e;return{tab:{border:"1px solid",borderColor:"inherit",[Ya.variable]:"colors.gray.50",_dark:{[Ya.variable]:"colors.whiteAlpha.50"},mb:"-1px",_notLast:{marginEnd:"-1px"},_selected:{[Ya.variable]:"colors.white",[So.variable]:`colors.${t}.600`,_dark:{[Ya.variable]:"colors.gray.800",[So.variable]:`colors.${t}.300`},borderColor:"inherit",borderTopColor:"currentColor",borderBottomColor:"transparent"},color:So.reference,bg:Ya.reference},tablist:{mb:"-1px",borderBottom:"1px solid",borderColor:"inherit"}}}),d8e=Ks(e=>{const{colorScheme:t,theme:n}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",color:"gray.600",_selected:{color:ro(n,`${t}.700`),bg:ro(n,`${t}.100`)}}}}),f8e=Ks(e=>{const{colorScheme:t}=e;return{tab:{borderRadius:"full",fontWeight:"semibold",[So.variable]:"colors.gray.600",_dark:{[So.variable]:"inherit"},_selected:{[So.variable]:"colors.white",[Ya.variable]:`colors.${t}.600`,_dark:{[So.variable]:"colors.gray.800",[Ya.variable]:`colors.${t}.300`}},color:So.reference,bg:Ya.reference}}}),h8e=Ks({}),p8e={line:l8e,enclosed:u8e,"enclosed-colored":c8e,"soft-rounded":d8e,"solid-rounded":f8e,unstyled:h8e},g8e=t8e({baseStyle:a8e,sizes:s8e,variants:p8e,defaultProps:{size:"md",variant:"line",colorScheme:"blue"}}),Tr=YAe("badge",["bg","color","shadow"]),m8e={px:1,textTransform:"uppercase",fontSize:"xs",borderRadius:"sm",fontWeight:"bold",bg:Tr.bg.reference,color:Tr.color.reference,boxShadow:Tr.shadow.reference},y8e=e=>{const{colorScheme:t,theme:n}=e,r=sp(`${t}.500`,.6)(n);return{[Tr.bg.variable]:`colors.${t}.500`,[Tr.color.variable]:"colors.white",_dark:{[Tr.bg.variable]:r,[Tr.color.variable]:"colors.whiteAlpha.800"}}},v8e=e=>{const{colorScheme:t,theme:n}=e,r=sp(`${t}.200`,.16)(n);return{[Tr.bg.variable]:`colors.${t}.100`,[Tr.color.variable]:`colors.${t}.800`,_dark:{[Tr.bg.variable]:r,[Tr.color.variable]:`colors.${t}.200`}}},b8e=e=>{const{colorScheme:t,theme:n}=e,r=sp(`${t}.200`,.8)(n);return{[Tr.color.variable]:`colors.${t}.500`,_dark:{[Tr.color.variable]:r},[Tr.shadow.variable]:`inset 0 0 0px 1px ${Tr.color.reference}`}},_8e={solid:y8e,subtle:v8e,outline:b8e},Zg={baseStyle:m8e,variants:_8e,defaultProps:{variant:"subtle",colorScheme:"gray"}},{defineMultiStyleConfig:S8e,definePartsStyle:_d}=Pt(c6e.keys),wM=nt("tag-bg"),CM=nt("tag-color"),u5=nt("tag-shadow"),Y1=nt("tag-min-height"),Z1=nt("tag-min-width"),J1=nt("tag-font-size"),eb=nt("tag-padding-inline"),x8e={fontWeight:"medium",lineHeight:1.2,outline:0,[CM.variable]:Tr.color.reference,[wM.variable]:Tr.bg.reference,[u5.variable]:Tr.shadow.reference,color:CM.reference,bg:wM.reference,boxShadow:u5.reference,borderRadius:"md",minH:Y1.reference,minW:Z1.reference,fontSize:J1.reference,px:eb.reference,_focusVisible:{[u5.variable]:"shadows.outline"}},w8e={lineHeight:1.2,overflow:"visible"},C8e={fontSize:"lg",w:"5",h:"5",transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",marginStart:"1.5",marginEnd:"-1",opacity:.5,_disabled:{opacity:.4},_focusVisible:{boxShadow:"outline",bg:"rgba(0, 0, 0, 0.14)"},_hover:{opacity:.8},_active:{opacity:1}},E8e=_d({container:x8e,label:w8e,closeButton:C8e}),T8e={sm:_d({container:{[Y1.variable]:"sizes.5",[Z1.variable]:"sizes.5",[J1.variable]:"fontSizes.xs",[eb.variable]:"space.2"},closeButton:{marginEnd:"-2px",marginStart:"0.35rem"}}),md:_d({container:{[Y1.variable]:"sizes.6",[Z1.variable]:"sizes.6",[J1.variable]:"fontSizes.sm",[eb.variable]:"space.2"}}),lg:_d({container:{[Y1.variable]:"sizes.8",[Z1.variable]:"sizes.8",[J1.variable]:"fontSizes.md",[eb.variable]:"space.3"}})},k8e={subtle:_d(e=>{var t;return{container:(t=Zg.variants)==null?void 0:t.subtle(e)}}),solid:_d(e=>{var t;return{container:(t=Zg.variants)==null?void 0:t.solid(e)}}),outline:_d(e=>{var t;return{container:(t=Zg.variants)==null?void 0:t.outline(e)}})},A8e=S8e({variants:k8e,baseStyle:E8e,sizes:T8e,defaultProps:{size:"md",variant:"subtle",colorScheme:"gray"}}),{definePartsStyle:Ol,defineMultiStyleConfig:P8e}=Pt(Hq.keys),Gf=nt("input-height"),qf=nt("input-font-size"),Hf=nt("input-padding"),Wf=nt("input-border-radius"),I8e=Ol({addon:{height:Gf.reference,fontSize:qf.reference,px:Hf.reference,borderRadius:Wf.reference},field:{width:"100%",height:Gf.reference,fontSize:qf.reference,px:Hf.reference,borderRadius:Wf.reference,minWidth:0,outline:0,position:"relative",appearance:"none",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed"}}}),pu={lg:{[qf.variable]:"fontSizes.lg",[Hf.variable]:"space.4",[Wf.variable]:"radii.md",[Gf.variable]:"sizes.12"},md:{[qf.variable]:"fontSizes.md",[Hf.variable]:"space.4",[Wf.variable]:"radii.md",[Gf.variable]:"sizes.10"},sm:{[qf.variable]:"fontSizes.sm",[Hf.variable]:"space.3",[Wf.variable]:"radii.sm",[Gf.variable]:"sizes.8"},xs:{[qf.variable]:"fontSizes.xs",[Hf.variable]:"space.2",[Wf.variable]:"radii.sm",[Gf.variable]:"sizes.6"}},R8e={lg:Ol({field:pu.lg,group:pu.lg}),md:Ol({field:pu.md,group:pu.md}),sm:Ol({field:pu.sm,group:pu.sm}),xs:Ol({field:pu.xs,group:pu.xs})};function JA(e){const{focusBorderColor:t,errorBorderColor:n}=e;return{focusBorderColor:t||K("blue.500","blue.300")(e),errorBorderColor:n||K("red.500","red.300")(e)}}var O8e=Ol(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=JA(e);return{field:{border:"1px solid",borderColor:"inherit",bg:"inherit",_hover:{borderColor:K("gray.300","whiteAlpha.400")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ro(t,r),boxShadow:`0 0 0 1px ${ro(t,r)}`},_focusVisible:{zIndex:1,borderColor:ro(t,n),boxShadow:`0 0 0 1px ${ro(t,n)}`}},addon:{border:"1px solid",borderColor:K("inherit","whiteAlpha.50")(e),bg:K("gray.100","whiteAlpha.300")(e)}}}),M8e=Ol(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=JA(e);return{field:{border:"2px solid",borderColor:"transparent",bg:K("gray.100","whiteAlpha.50")(e),_hover:{bg:K("gray.200","whiteAlpha.100")(e)},_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ro(t,r)},_focusVisible:{bg:"transparent",borderColor:ro(t,n)}},addon:{border:"2px solid",borderColor:"transparent",bg:K("gray.100","whiteAlpha.50")(e)}}}),N8e=Ol(e=>{const{theme:t}=e,{focusBorderColor:n,errorBorderColor:r}=JA(e);return{field:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent",_readOnly:{boxShadow:"none !important",userSelect:"all"},_invalid:{borderColor:ro(t,r),boxShadow:`0px 1px 0px 0px ${ro(t,r)}`},_focusVisible:{borderColor:ro(t,n),boxShadow:`0px 1px 0px 0px ${ro(t,n)}`}},addon:{borderBottom:"2px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}}),$8e=Ol({field:{bg:"transparent",px:"0",height:"auto"},addon:{bg:"transparent",px:"0",height:"auto"}}),D8e={outline:O8e,filled:M8e,flushed:N8e,unstyled:$8e},cn=P8e({baseStyle:I8e,sizes:R8e,variants:D8e,defaultProps:{size:"md",variant:"outline"}}),EM,L8e={...(EM=cn.baseStyle)==null?void 0:EM.field,paddingY:"2",minHeight:"20",lineHeight:"short",verticalAlign:"top"},TM,kM,F8e={outline:e=>{var t,n;return(n=(t=cn.variants)==null?void 0:t.outline(e).field)!=null?n:{}},flushed:e=>{var t,n;return(n=(t=cn.variants)==null?void 0:t.flushed(e).field)!=null?n:{}},filled:e=>{var t,n;return(n=(t=cn.variants)==null?void 0:t.filled(e).field)!=null?n:{}},unstyled:(kM=(TM=cn.variants)==null?void 0:TM.unstyled.field)!=null?kM:{}},AM,PM,IM,RM,OM,MM,NM,$M,B8e={xs:(PM=(AM=cn.sizes)==null?void 0:AM.xs.field)!=null?PM:{},sm:(RM=(IM=cn.sizes)==null?void 0:IM.sm.field)!=null?RM:{},md:(MM=(OM=cn.sizes)==null?void 0:OM.md.field)!=null?MM:{},lg:($M=(NM=cn.sizes)==null?void 0:NM.lg.field)!=null?$M:{}},z8e={baseStyle:L8e,sizes:B8e,variants:F8e,defaultProps:{size:"md",variant:"outline"}},Yv=hr("tooltip-bg"),c5=hr("tooltip-fg"),j8e=hr("popper-arrow-bg"),U8e={bg:Yv.reference,color:c5.reference,[Yv.variable]:"colors.gray.700",[c5.variable]:"colors.whiteAlpha.900",_dark:{[Yv.variable]:"colors.gray.300",[c5.variable]:"colors.gray.900"},[j8e.variable]:Yv.reference,px:"2",py:"0.5",borderRadius:"sm",fontWeight:"medium",fontSize:"sm",boxShadow:"md",maxW:"xs",zIndex:"tooltip"},V8e={baseStyle:U8e},{defineMultiStyleConfig:G8e,definePartsStyle:Ig}=Pt(Yq.keys),q8e=e=>{const{colorScheme:t,theme:n,isIndeterminate:r,hasStripe:i}=e,o=K(vM(),vM("1rem","rgba(0,0,0,0.1)"))(e),a=K(`${t}.500`,`${t}.200`)(e),s=`linear-gradient(
|
||
to right,
|
||
transparent 0%,
|
||
${ro(n,a)} 50%,
|
||
transparent 100%
|
||
)`;return{...!r&&i&&o,...r?{bgImage:s}:{bgColor:a}}},H8e={lineHeight:"1",fontSize:"0.25em",fontWeight:"bold",color:"white"},W8e=e=>({bg:K("gray.100","whiteAlpha.300")(e)}),K8e=e=>({transitionProperty:"common",transitionDuration:"slow",...q8e(e)}),Q8e=Ig(e=>({label:H8e,filledTrack:K8e(e),track:W8e(e)})),X8e={xs:Ig({track:{h:"1"}}),sm:Ig({track:{h:"2"}}),md:Ig({track:{h:"3"}}),lg:Ig({track:{h:"4"}})},Y8e=G8e({sizes:X8e,baseStyle:Q8e,defaultProps:{size:"md",colorScheme:"blue"}}),Z8e=e=>typeof e=="function";function oo(e,...t){return Z8e(e)?e(...t):e}var{definePartsStyle:tb,defineMultiStyleConfig:J8e}=Pt(Gq.keys),Jg=nt("checkbox-size"),eIe=e=>{const{colorScheme:t}=e;return{w:Jg.reference,h:Jg.reference,transitionProperty:"box-shadow",transitionDuration:"normal",border:"2px solid",borderRadius:"sm",borderColor:"inherit",color:"white",_checked:{bg:K(`${t}.500`,`${t}.200`)(e),borderColor:K(`${t}.500`,`${t}.200`)(e),color:K("white","gray.900")(e),_hover:{bg:K(`${t}.600`,`${t}.300`)(e),borderColor:K(`${t}.600`,`${t}.300`)(e)},_disabled:{borderColor:K("gray.200","transparent")(e),bg:K("gray.200","whiteAlpha.300")(e),color:K("gray.500","whiteAlpha.500")(e)}},_indeterminate:{bg:K(`${t}.500`,`${t}.200`)(e),borderColor:K(`${t}.500`,`${t}.200`)(e),color:K("white","gray.900")(e)},_disabled:{bg:K("gray.100","whiteAlpha.100")(e),borderColor:K("gray.100","transparent")(e)},_focusVisible:{boxShadow:"outline"},_invalid:{borderColor:K("red.500","red.300")(e)}}},tIe={_disabled:{cursor:"not-allowed"}},nIe={userSelect:"none",_disabled:{opacity:.4}},rIe={transitionProperty:"transform",transitionDuration:"normal"},iIe=tb(e=>({icon:rIe,container:tIe,control:oo(eIe,e),label:nIe})),oIe={sm:tb({control:{[Jg.variable]:"sizes.3"},label:{fontSize:"sm"},icon:{fontSize:"3xs"}}),md:tb({control:{[Jg.variable]:"sizes.4"},label:{fontSize:"md"},icon:{fontSize:"2xs"}}),lg:tb({control:{[Jg.variable]:"sizes.5"},label:{fontSize:"lg"},icon:{fontSize:"2xs"}})},K_=J8e({baseStyle:iIe,sizes:oIe,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:aIe,definePartsStyle:nb}=Pt(s6e.keys),sIe=e=>{var t;const n=(t=oo(K_.baseStyle,e))==null?void 0:t.control;return{...n,borderRadius:"full",_checked:{...n==null?void 0:n._checked,_before:{content:'""',display:"inline-block",pos:"relative",w:"50%",h:"50%",borderRadius:"50%",bg:"currentColor"}}}},lIe=nb(e=>{var t,n,r,i;return{label:(n=(t=K_).baseStyle)==null?void 0:n.call(t,e).label,container:(i=(r=K_).baseStyle)==null?void 0:i.call(r,e).container,control:sIe(e)}}),uIe={md:nb({control:{w:"4",h:"4"},label:{fontSize:"md"}}),lg:nb({control:{w:"5",h:"5"},label:{fontSize:"lg"}}),sm:nb({control:{width:"3",height:"3"},label:{fontSize:"sm"}})},cIe=aIe({baseStyle:lIe,sizes:uIe,defaultProps:{size:"md",colorScheme:"blue"}}),{defineMultiStyleConfig:dIe,definePartsStyle:fIe}=Pt(Zq.keys),Zv=nt("select-bg"),DM,hIe={...(DM=cn.baseStyle)==null?void 0:DM.field,appearance:"none",paddingBottom:"1px",lineHeight:"normal",bg:Zv.reference,[Zv.variable]:"colors.white",_dark:{[Zv.variable]:"colors.gray.700"},"> option, > optgroup":{bg:Zv.reference}},pIe={width:"6",height:"100%",insetEnd:"2",position:"relative",color:"currentColor",fontSize:"xl",_disabled:{opacity:.5}},gIe=fIe({field:hIe,icon:pIe}),Jv={paddingInlineEnd:"8"},LM,FM,BM,zM,jM,UM,VM,GM,mIe={lg:{...(LM=cn.sizes)==null?void 0:LM.lg,field:{...(FM=cn.sizes)==null?void 0:FM.lg.field,...Jv}},md:{...(BM=cn.sizes)==null?void 0:BM.md,field:{...(zM=cn.sizes)==null?void 0:zM.md.field,...Jv}},sm:{...(jM=cn.sizes)==null?void 0:jM.sm,field:{...(UM=cn.sizes)==null?void 0:UM.sm.field,...Jv}},xs:{...(VM=cn.sizes)==null?void 0:VM.xs,field:{...(GM=cn.sizes)==null?void 0:GM.xs.field,...Jv},icon:{insetEnd:"1"}}},yIe=dIe({baseStyle:gIe,sizes:mIe,variants:cn.variants,defaultProps:cn.defaultProps}),d5=nt("skeleton-start-color"),f5=nt("skeleton-end-color"),vIe={[d5.variable]:"colors.gray.100",[f5.variable]:"colors.gray.400",_dark:{[d5.variable]:"colors.gray.800",[f5.variable]:"colors.gray.600"},background:d5.reference,borderColor:f5.reference,opacity:.7,borderRadius:"sm"},bIe={baseStyle:vIe},h5=nt("skip-link-bg"),_Ie={borderRadius:"md",fontWeight:"semibold",_focusVisible:{boxShadow:"outline",padding:"4",position:"fixed",top:"6",insetStart:"6",[h5.variable]:"colors.white",_dark:{[h5.variable]:"colors.gray.700"},bg:h5.reference}},SIe={baseStyle:_Ie},{defineMultiStyleConfig:xIe,definePartsStyle:sw}=Pt(Jq.keys),A0=nt("slider-thumb-size"),P0=nt("slider-track-size"),Pu=nt("slider-bg"),wIe=e=>{const{orientation:t}=e;return{display:"inline-block",position:"relative",cursor:"pointer",_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"},...ZA({orientation:t,vertical:{h:"100%"},horizontal:{w:"100%"}})}},CIe=e=>({...ZA({orientation:e.orientation,horizontal:{h:P0.reference},vertical:{w:P0.reference}}),overflow:"hidden",borderRadius:"sm",[Pu.variable]:"colors.gray.200",_dark:{[Pu.variable]:"colors.whiteAlpha.200"},_disabled:{[Pu.variable]:"colors.gray.300",_dark:{[Pu.variable]:"colors.whiteAlpha.300"}},bg:Pu.reference}),EIe=e=>{const{orientation:t}=e;return{...ZA({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",_active:{transform:"translateX(-50%) scale(1.15)"}},horizontal:{top:"50%",transform:"translateY(-50%)",_active:{transform:"translateY(-50%) scale(1.15)"}}}),w:A0.reference,h:A0.reference,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",outline:0,zIndex:1,borderRadius:"full",bg:"white",boxShadow:"base",border:"1px solid",borderColor:"transparent",transitionProperty:"transform",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{bg:"gray.300"}}},TIe=e=>{const{colorScheme:t}=e;return{width:"inherit",height:"inherit",[Pu.variable]:`colors.${t}.500`,_dark:{[Pu.variable]:`colors.${t}.200`},bg:Pu.reference}},kIe=sw(e=>({container:wIe(e),track:CIe(e),thumb:EIe(e),filledTrack:TIe(e)})),AIe=sw({container:{[A0.variable]:"sizes.4",[P0.variable]:"sizes.1"}}),PIe=sw({container:{[A0.variable]:"sizes.3.5",[P0.variable]:"sizes.1"}}),IIe=sw({container:{[A0.variable]:"sizes.2.5",[P0.variable]:"sizes.0.5"}}),RIe={lg:AIe,md:PIe,sm:IIe},OIe=xIe({baseStyle:kIe,sizes:RIe,defaultProps:{size:"md",colorScheme:"blue"}}),Yc=hr("spinner-size"),MIe={width:[Yc.reference],height:[Yc.reference]},NIe={xs:{[Yc.variable]:"sizes.3"},sm:{[Yc.variable]:"sizes.4"},md:{[Yc.variable]:"sizes.6"},lg:{[Yc.variable]:"sizes.8"},xl:{[Yc.variable]:"sizes.12"}},$Ie={baseStyle:MIe,sizes:NIe,defaultProps:{size:"md"}},{defineMultiStyleConfig:DIe,definePartsStyle:iH}=Pt(l6e.keys),LIe={fontWeight:"medium"},FIe={opacity:.8,marginBottom:"2"},BIe={verticalAlign:"baseline",fontWeight:"semibold"},zIe={marginEnd:1,w:"3.5",h:"3.5",verticalAlign:"middle"},jIe=iH({container:{},label:LIe,helpText:FIe,number:BIe,icon:zIe}),UIe={md:iH({label:{fontSize:"sm"},helpText:{fontSize:"sm"},number:{fontSize:"2xl"}})},VIe=DIe({baseStyle:jIe,sizes:UIe,defaultProps:{size:"md"}}),p5=nt("kbd-bg"),GIe={[p5.variable]:"colors.gray.100",_dark:{[p5.variable]:"colors.whiteAlpha.100"},bg:p5.reference,borderRadius:"md",borderWidth:"1px",borderBottomWidth:"3px",fontSize:"0.8em",fontWeight:"bold",lineHeight:"normal",px:"0.4em",whiteSpace:"nowrap"},qIe={baseStyle:GIe},HIe={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",cursor:"pointer",textDecoration:"none",outline:"none",color:"inherit",_hover:{textDecoration:"underline"},_focusVisible:{boxShadow:"outline"}},WIe={baseStyle:HIe},{defineMultiStyleConfig:KIe,definePartsStyle:QIe}=Pt(a6e.keys),XIe={marginEnd:"2",display:"inline",verticalAlign:"text-bottom"},YIe=QIe({icon:XIe}),ZIe=KIe({baseStyle:YIe}),{defineMultiStyleConfig:JIe,definePartsStyle:eRe}=Pt(Wq.keys),Es=nt("menu-bg"),g5=nt("menu-shadow"),tRe={[Es.variable]:"#fff",[g5.variable]:"shadows.sm",_dark:{[Es.variable]:"colors.gray.700",[g5.variable]:"shadows.dark-lg"},color:"inherit",minW:"3xs",py:"2",zIndex:1,borderRadius:"md",borderWidth:"1px",bg:Es.reference,boxShadow:g5.reference},nRe={py:"1.5",px:"3",transitionProperty:"background",transitionDuration:"ultra-fast",transitionTimingFunction:"ease-in",_focus:{[Es.variable]:"colors.gray.100",_dark:{[Es.variable]:"colors.whiteAlpha.100"}},_active:{[Es.variable]:"colors.gray.200",_dark:{[Es.variable]:"colors.whiteAlpha.200"}},_expanded:{[Es.variable]:"colors.gray.100",_dark:{[Es.variable]:"colors.whiteAlpha.100"}},_disabled:{opacity:.4,cursor:"not-allowed"},bg:Es.reference},rRe={mx:4,my:2,fontWeight:"semibold",fontSize:"sm"},iRe={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0},oRe={opacity:.6},aRe={border:0,borderBottom:"1px solid",borderColor:"inherit",my:"2",opacity:.6},sRe={transitionProperty:"common",transitionDuration:"normal"},lRe=eRe({button:sRe,list:tRe,item:nRe,groupTitle:rRe,icon:iRe,command:oRe,divider:aRe}),uRe=JIe({baseStyle:lRe}),{defineMultiStyleConfig:cRe,definePartsStyle:vT}=Pt(Kq.keys),m5=nt("modal-bg"),y5=nt("modal-shadow"),dRe={bg:"blackAlpha.600",zIndex:"modal"},fRe=e=>{const{isCentered:t,scrollBehavior:n}=e;return{display:"flex",zIndex:"modal",justifyContent:"center",alignItems:t?"center":"flex-start",overflow:n==="inside"?"hidden":"auto",overscrollBehaviorY:"none"}},hRe=e=>{const{isCentered:t,scrollBehavior:n}=e;return{borderRadius:"md",color:"inherit",my:t?"auto":"16",mx:t?"auto":void 0,zIndex:"modal",maxH:n==="inside"?"calc(100% - 7.5rem)":void 0,[m5.variable]:"colors.white",[y5.variable]:"shadows.lg",_dark:{[m5.variable]:"colors.gray.700",[y5.variable]:"shadows.dark-lg"},bg:m5.reference,boxShadow:y5.reference}},pRe={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},gRe={position:"absolute",top:"2",insetEnd:"3"},mRe=e=>{const{scrollBehavior:t}=e;return{px:"6",py:"2",flex:"1",overflow:t==="inside"?"auto":void 0}},yRe={px:"6",py:"4"},vRe=vT(e=>({overlay:dRe,dialogContainer:oo(fRe,e),dialog:oo(hRe,e),header:pRe,closeButton:gRe,body:oo(mRe,e),footer:yRe}));function za(e){return vT(e==="full"?{dialog:{maxW:"100vw",minH:"$100vh",my:"0",borderRadius:"0"}}:{dialog:{maxW:e}})}var bRe={xs:za("xs"),sm:za("sm"),md:za("md"),lg:za("lg"),xl:za("xl"),"2xl":za("2xl"),"3xl":za("3xl"),"4xl":za("4xl"),"5xl":za("5xl"),"6xl":za("6xl"),full:za("full")},_Re=cRe({baseStyle:vRe,sizes:bRe,defaultProps:{size:"md"}}),{defineMultiStyleConfig:SRe,definePartsStyle:oH}=Pt(Qq.keys),eP=hr("number-input-stepper-width"),aH=hr("number-input-input-padding"),xRe=Al(eP).add("0.5rem").toString(),v5=hr("number-input-bg"),b5=hr("number-input-color"),_5=hr("number-input-border-color"),wRe={[eP.variable]:"sizes.6",[aH.variable]:xRe},CRe=e=>{var t,n;return(n=(t=oo(cn.baseStyle,e))==null?void 0:t.field)!=null?n:{}},ERe={width:eP.reference},TRe={borderStart:"1px solid",borderStartColor:_5.reference,color:b5.reference,bg:v5.reference,[b5.variable]:"colors.chakra-body-text",[_5.variable]:"colors.chakra-border-color",_dark:{[b5.variable]:"colors.whiteAlpha.800",[_5.variable]:"colors.whiteAlpha.300"},_active:{[v5.variable]:"colors.gray.200",_dark:{[v5.variable]:"colors.whiteAlpha.300"}},_disabled:{opacity:.4,cursor:"not-allowed"}},kRe=oH(e=>{var t;return{root:wRe,field:(t=oo(CRe,e))!=null?t:{},stepperGroup:ERe,stepper:TRe}});function e1(e){var t,n,r;const i=(t=cn.sizes)==null?void 0:t[e],o={lg:"md",md:"md",sm:"sm",xs:"sm"},a=(r=(n=i.field)==null?void 0:n.fontSize)!=null?r:"md",s=zq.fontSizes[a];return oH({field:{...i.field,paddingInlineEnd:aH.reference,verticalAlign:"top"},stepper:{fontSize:Al(s).multiply(.75).toString(),_first:{borderTopEndRadius:o[e]},_last:{borderBottomEndRadius:o[e],mt:"-1px",borderTopWidth:1}}})}var ARe={xs:e1("xs"),sm:e1("sm"),md:e1("md"),lg:e1("lg")},PRe=SRe({baseStyle:kRe,sizes:ARe,variants:cn.variants,defaultProps:cn.defaultProps}),qM,IRe={...(qM=cn.baseStyle)==null?void 0:qM.field,textAlign:"center"},RRe={lg:{fontSize:"lg",w:12,h:12,borderRadius:"md"},md:{fontSize:"md",w:10,h:10,borderRadius:"md"},sm:{fontSize:"sm",w:8,h:8,borderRadius:"sm"},xs:{fontSize:"xs",w:6,h:6,borderRadius:"sm"}},HM,WM,ORe={outline:e=>{var t,n,r;return(r=(n=oo((t=cn.variants)==null?void 0:t.outline,e))==null?void 0:n.field)!=null?r:{}},flushed:e=>{var t,n,r;return(r=(n=oo((t=cn.variants)==null?void 0:t.flushed,e))==null?void 0:n.field)!=null?r:{}},filled:e=>{var t,n,r;return(r=(n=oo((t=cn.variants)==null?void 0:t.filled,e))==null?void 0:n.field)!=null?r:{}},unstyled:(WM=(HM=cn.variants)==null?void 0:HM.unstyled.field)!=null?WM:{}},MRe={baseStyle:IRe,sizes:RRe,variants:ORe,defaultProps:cn.defaultProps},{defineMultiStyleConfig:NRe,definePartsStyle:$Re}=Pt(Xq.keys),t1=hr("popper-bg"),DRe=hr("popper-arrow-bg"),KM=hr("popper-arrow-shadow-color"),LRe={zIndex:10},FRe={[t1.variable]:"colors.white",bg:t1.reference,[DRe.variable]:t1.reference,[KM.variable]:"colors.gray.200",_dark:{[t1.variable]:"colors.gray.700",[KM.variable]:"colors.whiteAlpha.300"},width:"xs",border:"1px solid",borderColor:"inherit",borderRadius:"md",boxShadow:"sm",zIndex:"inherit",_focusVisible:{outline:0,boxShadow:"outline"}},BRe={px:3,py:2,borderBottomWidth:"1px"},zRe={px:3,py:2},jRe={px:3,py:2,borderTopWidth:"1px"},URe={position:"absolute",borderRadius:"md",top:1,insetEnd:2,padding:2},VRe=$Re({popper:LRe,content:FRe,header:BRe,body:zRe,footer:jRe,closeButton:URe}),GRe=NRe({baseStyle:VRe}),{definePartsStyle:bT,defineMultiStyleConfig:qRe}=Pt(r6e.keys),S5=nt("drawer-bg"),x5=nt("drawer-box-shadow");function _f(e){return bT(e==="full"?{dialog:{maxW:"100vw",h:"100vh"}}:{dialog:{maxW:e}})}var HRe={bg:"blackAlpha.600",zIndex:"overlay"},WRe={display:"flex",zIndex:"modal",justifyContent:"center"},KRe=e=>{const{isFullHeight:t}=e;return{...t&&{height:"100vh"},zIndex:"modal",maxH:"100vh",color:"inherit",[S5.variable]:"colors.white",[x5.variable]:"shadows.lg",_dark:{[S5.variable]:"colors.gray.700",[x5.variable]:"shadows.dark-lg"},bg:S5.reference,boxShadow:x5.reference}},QRe={px:"6",py:"4",fontSize:"xl",fontWeight:"semibold"},XRe={position:"absolute",top:"2",insetEnd:"3"},YRe={px:"6",py:"2",flex:"1",overflow:"auto"},ZRe={px:"6",py:"4"},JRe=bT(e=>({overlay:HRe,dialogContainer:WRe,dialog:oo(KRe,e),header:QRe,closeButton:XRe,body:YRe,footer:ZRe})),e9e={xs:_f("xs"),sm:_f("md"),md:_f("lg"),lg:_f("2xl"),xl:_f("4xl"),full:_f("full")},t9e=qRe({baseStyle:JRe,sizes:e9e,defaultProps:{size:"xs"}}),{definePartsStyle:n9e,defineMultiStyleConfig:r9e}=Pt(qq.keys),i9e={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},o9e={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},a9e={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},s9e=n9e({preview:i9e,input:o9e,textarea:a9e}),l9e=r9e({baseStyle:s9e}),{definePartsStyle:u9e,defineMultiStyleConfig:c9e}=Pt(i6e.keys),wh=nt("form-control-color"),d9e={marginStart:"1",[wh.variable]:"colors.red.500",_dark:{[wh.variable]:"colors.red.300"},color:wh.reference},f9e={mt:"2",[wh.variable]:"colors.gray.600",_dark:{[wh.variable]:"colors.whiteAlpha.600"},color:wh.reference,lineHeight:"normal",fontSize:"sm"},h9e=u9e({container:{width:"100%",position:"relative"},requiredIndicator:d9e,helperText:f9e}),p9e=c9e({baseStyle:h9e}),{definePartsStyle:g9e,defineMultiStyleConfig:m9e}=Pt(o6e.keys),Ch=nt("form-error-color"),y9e={[Ch.variable]:"colors.red.500",_dark:{[Ch.variable]:"colors.red.300"},color:Ch.reference,mt:"2",fontSize:"sm",lineHeight:"normal"},v9e={marginEnd:"0.5em",[Ch.variable]:"colors.red.500",_dark:{[Ch.variable]:"colors.red.300"},color:Ch.reference},b9e=g9e({text:y9e,icon:v9e}),_9e=m9e({baseStyle:b9e}),S9e={fontSize:"md",marginEnd:"3",mb:"2",fontWeight:"medium",transitionProperty:"common",transitionDuration:"normal",opacity:1,_disabled:{opacity:.4}},x9e={baseStyle:S9e},w9e={fontFamily:"heading",fontWeight:"bold"},C9e={"4xl":{fontSize:["6xl",null,"7xl"],lineHeight:1},"3xl":{fontSize:["5xl",null,"6xl"],lineHeight:1},"2xl":{fontSize:["4xl",null,"5xl"],lineHeight:[1.2,null,1]},xl:{fontSize:["3xl",null,"4xl"],lineHeight:[1.33,null,1.2]},lg:{fontSize:["2xl",null,"3xl"],lineHeight:[1.33,null,1.2]},md:{fontSize:"xl",lineHeight:1.2},sm:{fontSize:"md",lineHeight:1.2},xs:{fontSize:"sm",lineHeight:1.2}},E9e={baseStyle:w9e,sizes:C9e,defaultProps:{size:"xl"}},{defineMultiStyleConfig:T9e,definePartsStyle:k9e}=Pt(n6e.keys),w5=nt("breadcrumb-link-decor"),A9e={transitionProperty:"common",transitionDuration:"fast",transitionTimingFunction:"ease-out",outline:"none",color:"inherit",textDecoration:w5.reference,[w5.variable]:"none","&:not([aria-current=page])":{cursor:"pointer",_hover:{[w5.variable]:"underline"},_focusVisible:{boxShadow:"outline"}}},P9e=k9e({link:A9e}),I9e=T9e({baseStyle:P9e}),R9e={lineHeight:"1.2",borderRadius:"md",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",_focusVisible:{boxShadow:"outline"},_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{_disabled:{bg:"initial"}}},sH=e=>{const{colorScheme:t,theme:n}=e;if(t==="gray")return{color:K("gray.800","whiteAlpha.900")(e),_hover:{bg:K("gray.100","whiteAlpha.200")(e)},_active:{bg:K("gray.200","whiteAlpha.300")(e)}};const r=sp(`${t}.200`,.12)(n),i=sp(`${t}.200`,.24)(n);return{color:K(`${t}.600`,`${t}.200`)(e),bg:"transparent",_hover:{bg:K(`${t}.50`,r)(e)},_active:{bg:K(`${t}.100`,i)(e)}}},O9e=e=>{const{colorScheme:t}=e,n=K("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"},...oo(sH,e)}},M9e={yellow:{bg:"yellow.400",color:"black",hoverBg:"yellow.500",activeBg:"yellow.600"},cyan:{bg:"cyan.400",color:"black",hoverBg:"cyan.500",activeBg:"cyan.600"}},N9e=e=>{var t;const{colorScheme:n}=e;if(n==="gray"){const l=K("gray.100","whiteAlpha.200")(e);return{bg:l,color:K("gray.800","whiteAlpha.900")(e),_hover:{bg:K("gray.200","whiteAlpha.300")(e),_disabled:{bg:l}},_active:{bg:K("gray.300","whiteAlpha.400")(e)}}}const{bg:r=`${n}.500`,color:i="white",hoverBg:o=`${n}.600`,activeBg:a=`${n}.700`}=(t=M9e[n])!=null?t:{},s=K(r,`${n}.200`)(e);return{bg:s,color:K(i,"gray.800")(e),_hover:{bg:K(o,`${n}.300`)(e),_disabled:{bg:s}},_active:{bg:K(a,`${n}.400`)(e)}}},$9e=e=>{const{colorScheme:t}=e;return{padding:0,height:"auto",lineHeight:"normal",verticalAlign:"baseline",color:K(`${t}.500`,`${t}.200`)(e),_hover:{textDecoration:"underline",_disabled:{textDecoration:"none"}},_active:{color:K(`${t}.700`,`${t}.500`)(e)}}},D9e={bg:"none",color:"inherit",display:"inline",lineHeight:"inherit",m:"0",p:"0"},L9e={ghost:sH,outline:O9e,solid:N9e,link:$9e,unstyled:D9e},F9e={lg:{h:"12",minW:"12",fontSize:"lg",px:"6"},md:{h:"10",minW:"10",fontSize:"md",px:"4"},sm:{h:"8",minW:"8",fontSize:"sm",px:"3"},xs:{h:"6",minW:"6",fontSize:"xs",px:"2"}},B9e={baseStyle:R9e,variants:L9e,sizes:F9e,defaultProps:{variant:"solid",size:"md",colorScheme:"gray"}},{definePartsStyle:Sd,defineMultiStyleConfig:z9e}=Pt(d6e.keys),Q_=nt("card-bg"),Ll=nt("card-padding"),lH=nt("card-shadow"),rb=nt("card-radius"),uH=nt("card-border-width","0"),cH=nt("card-border-color"),j9e=Sd({container:{[Q_.variable]:"colors.chakra-body-bg",backgroundColor:Q_.reference,boxShadow:lH.reference,borderRadius:rb.reference,color:"chakra-body-text",borderWidth:uH.reference,borderColor:cH.reference},body:{padding:Ll.reference,flex:"1 1 0%"},header:{padding:Ll.reference},footer:{padding:Ll.reference}}),U9e={sm:Sd({container:{[rb.variable]:"radii.base",[Ll.variable]:"space.3"}}),md:Sd({container:{[rb.variable]:"radii.md",[Ll.variable]:"space.5"}}),lg:Sd({container:{[rb.variable]:"radii.xl",[Ll.variable]:"space.7"}})},V9e={elevated:Sd({container:{[lH.variable]:"shadows.base",_dark:{[Q_.variable]:"colors.gray.700"}}}),outline:Sd({container:{[uH.variable]:"1px",[cH.variable]:"colors.chakra-border-color"}}),filled:Sd({container:{[Q_.variable]:"colors.chakra-subtle-bg"}}),unstyled:{body:{[Ll.variable]:0},header:{[Ll.variable]:0},footer:{[Ll.variable]:0}}},G9e=z9e({baseStyle:j9e,variants:V9e,sizes:U9e,defaultProps:{variant:"elevated",size:"md"}}),em=hr("close-button-size"),lg=hr("close-button-bg"),q9e={w:[em.reference],h:[em.reference],borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_disabled:{opacity:.4,cursor:"not-allowed",boxShadow:"none"},_hover:{[lg.variable]:"colors.blackAlpha.100",_dark:{[lg.variable]:"colors.whiteAlpha.100"}},_active:{[lg.variable]:"colors.blackAlpha.200",_dark:{[lg.variable]:"colors.whiteAlpha.200"}},_focusVisible:{boxShadow:"outline"},bg:lg.reference},H9e={lg:{[em.variable]:"sizes.10",fontSize:"md"},md:{[em.variable]:"sizes.8",fontSize:"xs"},sm:{[em.variable]:"sizes.6",fontSize:"2xs"}},W9e={baseStyle:q9e,sizes:H9e,defaultProps:{size:"md"}},{variants:K9e,defaultProps:Q9e}=Zg,X9e={fontFamily:"mono",fontSize:"sm",px:"0.2em",borderRadius:"sm",bg:Tr.bg.reference,color:Tr.color.reference,boxShadow:Tr.shadow.reference},Y9e={baseStyle:X9e,variants:K9e,defaultProps:Q9e},Z9e={w:"100%",mx:"auto",maxW:"prose",px:"4"},J9e={baseStyle:Z9e},eOe={opacity:.6,borderColor:"inherit"},tOe={borderStyle:"solid"},nOe={borderStyle:"dashed"},rOe={solid:tOe,dashed:nOe},iOe={baseStyle:eOe,variants:rOe,defaultProps:{variant:"solid"}},{definePartsStyle:oOe,defineMultiStyleConfig:aOe}=Pt(Vq.keys),sOe={borderTopWidth:"1px",borderColor:"inherit",_last:{borderBottomWidth:"1px"}},lOe={transitionProperty:"common",transitionDuration:"normal",fontSize:"md",_focusVisible:{boxShadow:"outline"},_hover:{bg:"blackAlpha.50"},_disabled:{opacity:.4,cursor:"not-allowed"},px:"4",py:"2"},uOe={pt:"2",px:"4",pb:"5"},cOe={fontSize:"1.25em"},dOe=oOe({container:sOe,button:lOe,panel:uOe,icon:cOe}),fOe=aOe({baseStyle:dOe}),{definePartsStyle:Oy,defineMultiStyleConfig:hOe}=Pt(e6e.keys),Xo=nt("alert-fg"),Ql=nt("alert-bg"),pOe=Oy({container:{bg:Ql.reference,px:"4",py:"3"},title:{fontWeight:"bold",lineHeight:"6",marginEnd:"2"},description:{lineHeight:"6"},icon:{color:Xo.reference,flexShrink:0,marginEnd:"3",w:"5",h:"6"},spinner:{color:Xo.reference,flexShrink:0,marginEnd:"3",w:"5",h:"5"}});function tP(e){const{theme:t,colorScheme:n}=e,r=sp(`${n}.200`,.16)(t);return{light:`colors.${n}.100`,dark:r}}var gOe=Oy(e=>{const{colorScheme:t}=e,n=tP(e);return{container:{[Xo.variable]:`colors.${t}.500`,[Ql.variable]:n.light,_dark:{[Xo.variable]:`colors.${t}.200`,[Ql.variable]:n.dark}}}}),mOe=Oy(e=>{const{colorScheme:t}=e,n=tP(e);return{container:{[Xo.variable]:`colors.${t}.500`,[Ql.variable]:n.light,_dark:{[Xo.variable]:`colors.${t}.200`,[Ql.variable]:n.dark},paddingStart:"3",borderStartWidth:"4px",borderStartColor:Xo.reference}}}),yOe=Oy(e=>{const{colorScheme:t}=e,n=tP(e);return{container:{[Xo.variable]:`colors.${t}.500`,[Ql.variable]:n.light,_dark:{[Xo.variable]:`colors.${t}.200`,[Ql.variable]:n.dark},pt:"2",borderTopWidth:"4px",borderTopColor:Xo.reference}}}),vOe=Oy(e=>{const{colorScheme:t}=e;return{container:{[Xo.variable]:"colors.white",[Ql.variable]:`colors.${t}.500`,_dark:{[Xo.variable]:"colors.gray.900",[Ql.variable]:`colors.${t}.200`},color:Xo.reference}}}),bOe={subtle:gOe,"left-accent":mOe,"top-accent":yOe,solid:vOe},_Oe=hOe({baseStyle:pOe,variants:bOe,defaultProps:{variant:"subtle",colorScheme:"blue"}}),{definePartsStyle:dH,defineMultiStyleConfig:SOe}=Pt(t6e.keys),Eh=nt("avatar-border-color"),tm=nt("avatar-bg"),I0=nt("avatar-font-size"),lp=nt("avatar-size"),xOe={borderRadius:"full",border:"0.2em solid",borderColor:Eh.reference,[Eh.variable]:"white",_dark:{[Eh.variable]:"colors.gray.800"}},wOe={bg:tm.reference,fontSize:I0.reference,width:lp.reference,height:lp.reference,lineHeight:"1",[tm.variable]:"colors.gray.200",_dark:{[tm.variable]:"colors.whiteAlpha.400"}},COe=e=>{const{name:t,theme:n}=e,r=t?R6e({string:t}):"colors.gray.400",i=P6e(r)(n);let o="white";return i||(o="gray.800"),{bg:tm.reference,fontSize:I0.reference,color:o,borderColor:Eh.reference,verticalAlign:"top",width:lp.reference,height:lp.reference,"&:not([data-loaded])":{[tm.variable]:r},[Eh.variable]:"colors.white",_dark:{[Eh.variable]:"colors.gray.800"}}},EOe={fontSize:I0.reference,lineHeight:"1"},TOe=dH(e=>({badge:oo(xOe,e),excessLabel:oo(wOe,e),container:oo(COe,e),label:EOe}));function gu(e){const t=e!=="100%"?Uq[e]:void 0;return dH({container:{[lp.variable]:t??e,[I0.variable]:`calc(${t??e} / 2.5)`},excessLabel:{[lp.variable]:t??e,[I0.variable]:`calc(${t??e} / 2.5)`}})}var kOe={"2xs":gu(4),xs:gu(6),sm:gu(8),md:gu(12),lg:gu(16),xl:gu(24),"2xl":gu(32),full:gu("100%")},AOe=SOe({baseStyle:TOe,sizes:kOe,defaultProps:{size:"md"}}),POe={Accordion:fOe,Alert:_Oe,Avatar:AOe,Badge:Zg,Breadcrumb:I9e,Button:B9e,Checkbox:K_,CloseButton:W9e,Code:Y9e,Container:J9e,Divider:iOe,Drawer:t9e,Editable:l9e,Form:p9e,FormError:_9e,FormLabel:x9e,Heading:E9e,Input:cn,Kbd:qIe,Link:WIe,List:ZIe,Menu:uRe,Modal:_Re,NumberInput:PRe,PinInput:MRe,Popover:GRe,Progress:Y8e,Radio:cIe,Select:yIe,Skeleton:bIe,SkipLink:SIe,Slider:OIe,Spinner:$Ie,Stat:VIe,Switch:W6e,Table:e8e,Tabs:g8e,Tag:A8e,Textarea:z8e,Tooltip:V8e,Card:G9e,Stepper:JPe},IOe={colors:{"chakra-body-text":{_light:"gray.800",_dark:"whiteAlpha.900"},"chakra-body-bg":{_light:"white",_dark:"gray.800"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.300"},"chakra-inverse-text":{_light:"white",_dark:"gray.800"},"chakra-subtle-bg":{_light:"gray.100",_dark:"gray.700"},"chakra-subtle-text":{_light:"gray.600",_dark:"gray.400"},"chakra-placeholder-color":{_light:"gray.500",_dark:"whiteAlpha.400"}}},ROe={global:{body:{fontFamily:"body",color:"chakra-body-text",bg:"chakra-body-bg",transitionProperty:"background-color",transitionDuration:"normal",lineHeight:"base"},"*::placeholder":{color:"chakra-placeholder-color"},"*, *::before, &::after":{borderColor:"chakra-border-color"}}},OOe="ltr",MOe={useSystemColorMode:!1,initialColorMode:"light",cssVarPrefix:"chakra"},NOe={semanticTokens:IOe,direction:OOe,...XPe,components:POe,styles:ROe,config:MOe},$Oe=NOe;function DOe(e,t){const n={};return Object.keys(e).forEach(r=>{t.includes(r)||(n[r]=e[r])}),n}function LOe(e,t,n,r){const i=typeof t=="string"?t.split("."):[t];for(r=0;r<i.length&&e;r+=1)e=e[i[r]];return e===void 0?n:e}var FOe=e=>{const t=new WeakMap;return(r,i,o,a)=>{if(typeof r>"u")return e(r,i,o);t.has(r)||t.set(r,new Map);const s=t.get(r);if(s.has(i))return s.get(i);const l=e(r,i,o,a);return s.set(i,l),l}},fH=FOe(LOe);function hH(e,t){const n={};return Object.keys(e).forEach(r=>{const i=e[r];t(i,r,e)&&(n[r]=i)}),n}var pH=e=>hH(e,t=>t!=null);function BOe(e){return typeof e=="function"}function gH(e,...t){return BOe(e)?e(...t):e}function QKe(...e){return function(n){e.some(r=>(r==null||r(n),n==null?void 0:n.defaultPrevented))}}var zOe=typeof Element<"u",jOe=typeof Map=="function",UOe=typeof Set=="function",VOe=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function ib(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,i;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ib(e[r],t[r]))return!1;return!0}var o;if(jOe&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!ib(r.value[1],t.get(r.value[0])))return!1;return!0}if(UOe&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(VOe&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[r]))return!1;if(zOe&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((i[r]==="_owner"||i[r]==="__v"||i[r]==="__o")&&e.$$typeof)&&!ib(e[i[r]],t[i[r]]))return!1;return!0}return e!==e&&t!==t}var GOe=function(t,n){try{return ib(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const qOe=mc(GOe);function mH(e,t={}){var n;const{styleConfig:r,...i}=t,{theme:o,colorMode:a}=oAe(),s=e?fH(o,`components.${e}`):void 0,l=r||s,u=Fs({theme:o,colorMode:a},(n=l==null?void 0:l.defaultProps)!=null?n:{},pH(DOe(i,["children"]))),c=I.useRef({});if(l){const f=TPe(l)(u);qOe(c.current,f)||(c.current=f)}return c.current}function My(e,t={}){return mH(e,t)}function HOe(e,t={}){return mH(e,t)}var WOe=new Set([...pPe,"textStyle","layerStyle","apply","noOfLines","focusBorderColor","errorBorderColor","as","__css","css","sx"]),KOe=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function QOe(e){return KOe.has(e)||!WOe.has(e)}function XOe(e,...t){if(e==null)throw new TypeError("Cannot convert undefined or null to object");const n={...e};for(const r of t)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}function YOe(e){const t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}var ZOe=/^((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)-.*))$/,JOe=xq(function(e){return ZOe.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),eMe=JOe,tMe=function(t){return t!=="theme"},QM=function(t){return typeof t=="string"&&t.charCodeAt(0)>96?eMe:tMe},XM=function(t,n,r){var i;if(n){var o=n.shouldForwardProp;i=t.__emotion_forwardProp&&o?function(a){return t.__emotion_forwardProp(a)&&o(a)}:o}return typeof i!="function"&&r&&(i=t.__emotion_forwardProp),i},nMe=function(t){var n=t.cache,r=t.serialized,i=t.isStringTag;return Cq(n,r,i),Gke(function(){return Eq(n,r,i)}),null},rMe=function e(t,n){var r=t.__emotion_real===t,i=r&&t.__emotion_base||t,o,a;n!==void 0&&(o=n.label,a=n.target);var s=XM(t,n,r),l=s||QM(i),u=!l("as");return function(){var c=arguments,d=r&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(o!==void 0&&d.push("label:"+o+";"),c[0]==null||c[0].raw===void 0)d.push.apply(d,c);else{d.push(c[0][0]);for(var f=c.length,h=1;h<f;h++)d.push(c[h],c[0][h])}var p=Pq(function(m,_,b){var y=u&&m.as||i,g="",v=[],S=m;if(m.theme==null){S={};for(var w in m)S[w]=m[w];S.theme=I.useContext(T0)}typeof m.className=="string"?g=Lke(_.registered,v,m.className):m.className!=null&&(g=m.className+" ");var x=qA(d.concat(v),_.registered,S);g+=_.key+"-"+x.name,a!==void 0&&(g+=" "+a);var C=u&&s===void 0?QM(y):l,k={};for(var T in m)u&&T==="as"||C(T)&&(k[T]=m[T]);return k.className=g,k.ref=b,I.createElement(I.Fragment,null,I.createElement(nMe,{cache:_,serialized:x,isStringTag:typeof y=="string"}),I.createElement(y,k))});return p.displayName=o!==void 0?o:"Styled("+(typeof i=="string"?i:i.displayName||i.name||"Component")+")",p.defaultProps=t.defaultProps,p.__emotion_real=p,p.__emotion_base=i,p.__emotion_styles=d,p.__emotion_forwardProp=s,Object.defineProperty(p,"toString",{value:function(){return"."+a}}),p.withComponent=function(m,_){return e(m,x_({},n,_,{shouldForwardProp:XM(p,_,!0)})).apply(void 0,d)},p}},iMe=["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"],X_=rMe.bind();iMe.forEach(function(e){X_[e]=X_(e)});var YM,oMe=(YM=X_.default)!=null?YM:X_,aMe=({baseStyle:e})=>t=>{const{theme:n,css:r,__css:i,sx:o,...a}=t,s=hH(a,(d,f)=>mPe(f)),l=gH(e,t),u=XOe({},i,l,pH(s),o),c=Bq(u)(t.theme);return r?[c,r]:c};function C5(e,t){const{baseStyle:n,...r}=t??{};r.shouldForwardProp||(r.shouldForwardProp=QOe);const i=aMe({baseStyle:n}),o=oMe(e,r)(i);return Tn.forwardRef(function(l,u){const{colorMode:c,forced:d}=rw();return Tn.createElement(o,{ref:u,"data-theme":d?c:void 0,...l})})}function sMe(){const e=new Map;return new Proxy(C5,{apply(t,n,r){return C5(...r)},get(t,n){return e.has(n)||e.set(n,C5(n)),e.get(n)}})}var Oi=sMe();function ia(e){return I.forwardRef(e)}function lMe(e={}){const{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,i=I.createContext(void 0);i.displayName=r;function o(){var a;const s=I.useContext(i);if(!s&&t){const l=new Error(n);throw l.name="ContextError",(a=Error.captureStackTrace)==null||a.call(Error,l,o),l}return s}return[i.Provider,o,i]}function uMe(e){const{cssVarsRoot:t,theme:n,children:r}=e,i=I.useMemo(()=>fPe(n),[n]);return W.jsxs(Wke,{theme:i,children:[W.jsx(cMe,{root:t}),r]})}function cMe({root:e=":host, :root"}){const t=[e,"[data-theme]"].join(",");return W.jsx(Iq,{styles:n=>({[t]:n.__cssVars})})}lMe({name:"StylesContext",errorMessage:"useStyles: `styles` is undefined. Seems you forgot to wrap the components in `<StylesProvider />` "});function XKe(){const{colorMode:e}=rw();return W.jsx(Iq,{styles:t=>{const n=fH(t,"styles.global"),r=gH(n,{theme:t,colorMode:e});return r?Bq(r)(t):void 0}})}var dMe=(e,t)=>e.find(n=>n.id===t);function ZM(e,t){const n=yH(e,t),r=n?e[n].findIndex(i=>i.id===t):-1;return{position:n,index:r}}function yH(e,t){for(const[n,r]of Object.entries(e))if(dMe(r,t))return n}function fMe(e){const t=e.includes("right"),n=e.includes("left");let r="center";return t&&(r="flex-end"),n&&(r="flex-start"),{display:"flex",flexDirection:"column",alignItems:r}}function hMe(e){const n=e==="top"||e==="bottom"?"0 auto":void 0,r=e.includes("top")?"env(safe-area-inset-top, 0px)":void 0,i=e.includes("bottom")?"env(safe-area-inset-bottom, 0px)":void 0,o=e.includes("left")?void 0:"env(safe-area-inset-right, 0px)",a=e.includes("right")?void 0:"env(safe-area-inset-left, 0px)";return{position:"fixed",zIndex:"var(--toast-z-index, 5500)",pointerEvents:"none",display:"flex",flexDirection:"column",margin:n,top:r,bottom:i,right:o,left:a}}function pMe(e,t=[]){const n=I.useRef(e);return I.useEffect(()=>{n.current=e}),I.useCallback((...r)=>{var i;return(i=n.current)==null?void 0:i.call(n,...r)},t)}function gMe(e,t){const n=pMe(e);I.useEffect(()=>{if(t==null)return;let r=null;return r=window.setTimeout(()=>{n()},t),()=>{r&&window.clearTimeout(r)}},[t,n])}function JM(e,t){const n=I.useRef(!1),r=I.useRef(!1);I.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),I.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}const vH=I.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),lw=I.createContext({}),Ny=I.createContext(null),uw=typeof document<"u",nP=uw?I.useLayoutEffect:I.useEffect,bH=I.createContext({strict:!1});function mMe(e,t,n,r){const{visualElement:i}=I.useContext(lw),o=I.useContext(bH),a=I.useContext(Ny),s=I.useContext(vH).reducedMotion,l=I.useRef();r=r||o.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:s}));const u=l.current;I.useInsertionEffect(()=>{u&&u.update(n,a)});const c=I.useRef(!!window.HandoffAppearAnimations);return nP(()=>{u&&(u.render(),c.current&&u.animationState&&u.animationState.animateChanges())}),I.useEffect(()=>{u&&(u.updateFeatures(),!c.current&&u.animationState&&u.animationState.animateChanges(),window.HandoffAppearAnimations=void 0,c.current=!1)}),u}function Kf(e){return typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function yMe(e,t,n){return I.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Kf(n)&&(n.current=r))},[t])}function R0(e){return typeof e=="string"||Array.isArray(e)}function cw(e){return typeof e=="object"&&typeof e.start=="function"}const rP=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],iP=["initial",...rP];function dw(e){return cw(e.animate)||iP.some(t=>R0(e[t]))}function _H(e){return!!(dw(e)||e.variants)}function vMe(e,t){if(dw(e)){const{initial:n,animate:r}=e;return{initial:n===!1||R0(n)?n:void 0,animate:R0(r)?r:void 0}}return e.inherit!==!1?t:{}}function bMe(e){const{initial:t,animate:n}=vMe(e,I.useContext(lw));return I.useMemo(()=>({initial:t,animate:n}),[e7(t),e7(n)])}function e7(e){return Array.isArray(e)?e.join(" "):e}const t7={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},O0={};for(const e in t7)O0[e]={isEnabled:t=>t7[e].some(n=>!!t[n])};function _Me(e){for(const t in e)O0[t]={...O0[t],...e[t]}}const oP=I.createContext({}),SH=I.createContext({}),SMe=Symbol.for("motionComponentSymbol");function xMe({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&_Me(e);function o(s,l){let u;const c={...I.useContext(vH),...s,layoutId:wMe(s)},{isStatic:d}=c,f=bMe(s),h=r(s,d);if(!d&&uw){f.visualElement=mMe(i,h,c,t);const p=I.useContext(SH),m=I.useContext(bH).strict;f.visualElement&&(u=f.visualElement.loadFeatures(c,m,e,p))}return I.createElement(lw.Provider,{value:f},u&&f.visualElement?I.createElement(u,{visualElement:f.visualElement,...c}):null,n(i,s,yMe(h,f.visualElement,l),h,d,f.visualElement))}const a=I.forwardRef(o);return a[SMe]=i,a}function wMe({layoutId:e}){const t=I.useContext(oP).id;return t&&e!==void 0?t+"-"+e:e}function CMe(e){function t(r,i={}){return xMe(e(r,i))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const EMe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function aP(e){return typeof e!="string"||e.includes("-")?!1:!!(EMe.indexOf(e)>-1||/[A-Z]/.test(e))}const Y_={};function TMe(e){Object.assign(Y_,e)}const $y=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Jd=new Set($y);function xH(e,{layout:t,layoutId:n}){return Jd.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Y_[e]||e==="opacity")}const No=e=>!!(e&&e.getVelocity),kMe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},AMe=$y.length;function PMe(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,i){let o="";for(let a=0;a<AMe;a++){const s=$y[a];if(e[s]!==void 0){const l=kMe[s]||s;o+=`${l}(${e[s]}) `}}return t&&!e.z&&(o+="translateZ(0)"),o=o.trim(),i?o=i(e,r?"":o):n&&r&&(o="none"),o}const wH=e=>t=>typeof t=="string"&&t.startsWith(e),CH=wH("--"),_T=wH("var(--"),IMe=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,RMe=(e,t)=>t&&typeof e=="number"?t.transform(e):e,pc=(e,t,n)=>Math.min(Math.max(n,e),t),ef={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},nm={...ef,transform:e=>pc(0,1,e)},n1={...ef,default:1},rm=e=>Math.round(e*1e5)/1e5,fw=/(-)?([\d]*\.?[\d])+/g,EH=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,OMe=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Dy(e){return typeof e=="string"}const Ly=e=>({test:t=>Dy(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),yu=Ly("deg"),Qs=Ly("%"),st=Ly("px"),MMe=Ly("vh"),NMe=Ly("vw"),n7={...Qs,parse:e=>Qs.parse(e)/100,transform:e=>Qs.transform(e*100)},r7={...ef,transform:Math.round},TH={borderWidth:st,borderTopWidth:st,borderRightWidth:st,borderBottomWidth:st,borderLeftWidth:st,borderRadius:st,radius:st,borderTopLeftRadius:st,borderTopRightRadius:st,borderBottomRightRadius:st,borderBottomLeftRadius:st,width:st,maxWidth:st,height:st,maxHeight:st,size:st,top:st,right:st,bottom:st,left:st,padding:st,paddingTop:st,paddingRight:st,paddingBottom:st,paddingLeft:st,margin:st,marginTop:st,marginRight:st,marginBottom:st,marginLeft:st,rotate:yu,rotateX:yu,rotateY:yu,rotateZ:yu,scale:n1,scaleX:n1,scaleY:n1,scaleZ:n1,skew:yu,skewX:yu,skewY:yu,distance:st,translateX:st,translateY:st,translateZ:st,x:st,y:st,z:st,perspective:st,transformPerspective:st,opacity:nm,originX:n7,originY:n7,originZ:st,zIndex:r7,fillOpacity:nm,strokeOpacity:nm,numOctaves:r7};function sP(e,t,n,r){const{style:i,vars:o,transform:a,transformOrigin:s}=e;let l=!1,u=!1,c=!0;for(const d in t){const f=t[d];if(CH(d)){o[d]=f;continue}const h=TH[d],p=RMe(f,h);if(Jd.has(d)){if(l=!0,a[d]=p,!c)continue;f!==(h.default||0)&&(c=!1)}else d.startsWith("origin")?(u=!0,s[d]=p):i[d]=p}if(t.transform||(l||r?i.transform=PMe(e.transform,n,c,r):i.transform&&(i.transform="none")),u){const{originX:d="50%",originY:f="50%",originZ:h=0}=s;i.transformOrigin=`${d} ${f} ${h}`}}const lP=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function kH(e,t,n){for(const r in t)!No(t[r])&&!xH(r,n)&&(e[r]=t[r])}function $Me({transformTemplate:e},t,n){return I.useMemo(()=>{const r=lP();return sP(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function DMe(e,t,n){const r=e.style||{},i={};return kH(i,r,e),Object.assign(i,$Me(e,t,n)),e.transformValues?e.transformValues(i):i}function LMe(e,t,n){const r={},i=DMe(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=i,r}const FMe=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function Z_(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||FMe.has(e)}let AH=e=>!Z_(e);function BMe(e){e&&(AH=t=>t.startsWith("on")?!Z_(t):e(t))}try{BMe(require("@emotion/is-prop-valid").default)}catch{}function zMe(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(AH(i)||n===!0&&Z_(i)||!t&&!Z_(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function i7(e,t,n){return typeof e=="string"?e:st.transform(t+n*e)}function jMe(e,t,n){const r=i7(t,e.x,e.width),i=i7(n,e.y,e.height);return`${r} ${i}`}const UMe={offset:"stroke-dashoffset",array:"stroke-dasharray"},VMe={offset:"strokeDashoffset",array:"strokeDasharray"};function GMe(e,t,n=1,r=0,i=!0){e.pathLength=1;const o=i?UMe:VMe;e[o.offset]=st.transform(-r);const a=st.transform(t),s=st.transform(n);e[o.array]=`${a} ${s}`}function uP(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:o,pathLength:a,pathSpacing:s=1,pathOffset:l=0,...u},c,d,f){if(sP(e,u,c,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:m}=e;h.transform&&(m&&(p.transform=h.transform),delete h.transform),m&&(i!==void 0||o!==void 0||p.transform)&&(p.transformOrigin=jMe(m,i!==void 0?i:.5,o!==void 0?o:.5)),t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),a!==void 0&&GMe(h,a,s,l,!1)}const PH=()=>({...lP(),attrs:{}}),cP=e=>typeof e=="string"&&e.toLowerCase()==="svg";function qMe(e,t,n,r){const i=I.useMemo(()=>{const o=PH();return uP(o,t,{enableHardwareAcceleration:!1},cP(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};kH(o,e.style,e),i.style={...o,...i.style}}return i}function HMe(e=!1){return(n,r,i,{latestValues:o},a)=>{const l=(aP(n)?qMe:LMe)(r,o,a,n),c={...zMe(r,typeof n=="string",e),...l,ref:i},{children:d}=r,f=I.useMemo(()=>No(d)?d.get():d,[d]);return I.createElement(n,{...c,children:f})}}const dP=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function IH(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const RH=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function OH(e,t,n,r){IH(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(RH.has(i)?i:dP(i),t.attrs[i])}function fP(e,t){const{style:n}=e,r={};for(const i in n)(No(n[i])||t.style&&No(t.style[i])||xH(i,e))&&(r[i]=n[i]);return r}function MH(e,t){const n=fP(e,t);for(const r in e)if(No(e[r])||No(t[r])){const i=$y.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[i]=e[r]}return n}function hP(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}function NH(e){const t=I.useRef(null);return t.current===null&&(t.current=e()),t.current}const J_=e=>Array.isArray(e),WMe=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),KMe=e=>J_(e)?e[e.length-1]||0:e;function ob(e){const t=No(e)?e.get():e;return WMe(t)?t.toValue():t}function QMe({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,o){const a={latestValues:XMe(r,i,o,e),renderState:t()};return n&&(a.mount=s=>n(r,s,a)),a}const $H=e=>(t,n)=>{const r=I.useContext(lw),i=I.useContext(Ny),o=()=>QMe(e,t,r,i);return n?o():NH(o)};function XMe(e,t,n,r){const i={},o=r(e,{});for(const f in o)i[f]=ob(o[f]);let{initial:a,animate:s}=e;const l=dw(e),u=_H(e);t&&u&&!l&&e.inherit!==!1&&(a===void 0&&(a=t.initial),s===void 0&&(s=t.animate));let c=n?n.initial===!1:!1;c=c||a===!1;const d=c?s:a;return d&&typeof d!="boolean"&&!cw(d)&&(Array.isArray(d)?d:[d]).forEach(h=>{const p=hP(e,h);if(!p)return;const{transitionEnd:m,transition:_,...b}=p;for(const y in b){let g=b[y];if(Array.isArray(g)){const v=c?g.length-1:0;g=g[v]}g!==null&&(i[y]=g)}for(const y in m)i[y]=m[y]}),i}const vr=e=>e;function YMe(e){let t=[],n=[],r=0,i=!1,o=!1;const a=new WeakSet,s={schedule:(l,u=!1,c=!1)=>{const d=c&&i,f=d?t:n;return u&&a.add(l),f.indexOf(l)===-1&&(f.push(l),d&&i&&(r=t.length)),l},cancel:l=>{const u=n.indexOf(l);u!==-1&&n.splice(u,1),a.delete(l)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length,r)for(let u=0;u<r;u++){const c=t[u];c(l),a.has(c)&&(s.schedule(c),e())}i=!1,o&&(o=!1,s.process(l))}};return s}const r1=["prepare","read","update","preRender","render","postRender"],ZMe=40;function JMe(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=r1.reduce((d,f)=>(d[f]=YMe(()=>n=!0),d),{}),a=d=>o[d].process(i),s=()=>{const d=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(d-i.timestamp,ZMe),1),i.timestamp=d,i.isProcessing=!0,r1.forEach(a),i.isProcessing=!1,n&&t&&(r=!1,e(s))},l=()=>{n=!0,r=!0,i.isProcessing||e(s)};return{schedule:r1.reduce((d,f)=>{const h=o[f];return d[f]=(p,m=!1,_=!1)=>(n||l(),h.schedule(p,m,_)),d},{}),cancel:d=>r1.forEach(f=>o[f].cancel(d)),state:i,steps:o}}const{schedule:Dn,cancel:Xl,state:ji,steps:E5}=JMe(typeof requestAnimationFrame<"u"?requestAnimationFrame:vr,!0),e7e={useVisualState:$H({scrapeMotionValuesFromProps:MH,createRenderState:PH,onMount:(e,t,{renderState:n,latestValues:r})=>{Dn.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),Dn.render(()=>{uP(n,r,{enableHardwareAcceleration:!1},cP(t.tagName),e.transformTemplate),OH(t,n)})}})},t7e={useVisualState:$H({scrapeMotionValuesFromProps:fP,createRenderState:lP})};function n7e(e,{forwardMotionProps:t=!1},n,r){return{...aP(e)?e7e:t7e,preloadedFeatures:n,useRender:HMe(t),createVisualElement:r,Component:e}}function Ml(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const DH=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function hw(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const r7e=e=>t=>DH(t)&&e(t,hw(t));function Fl(e,t,n,r){return Ml(e,t,r7e(n),r)}const i7e=(e,t)=>n=>t(e(n)),Zu=(...e)=>e.reduce(i7e);function LH(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const o7=LH("dragHorizontal"),a7=LH("dragVertical");function FH(e){let t=!1;if(e==="y")t=a7();else if(e==="x")t=o7();else{const n=o7(),r=a7();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function BH(){const e=FH(!0);return e?(e(),!1):!0}class Oc{constructor(t){this.isMounted=!1,this.node=t}update(){}}function s7(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),i=(o,a)=>{if(o.type==="touch"||BH())return;const s=e.getProps();e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",t),s[r]&&Dn.update(()=>s[r](o,a))};return Fl(e.current,n,i,{passive:!e.getProps()[r]})}class o7e extends Oc{mount(){this.unmount=Zu(s7(this.node,!0),s7(this.node,!1))}unmount(){}}class a7e extends Oc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Zu(Ml(this.node.current,"focus",()=>this.onFocus()),Ml(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const zH=(e,t)=>t?e===t?!0:zH(e,t.parentElement):!1;function T5(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,hw(n))}class s7e extends Oc{constructor(){super(...arguments),this.removeStartListeners=vr,this.removeEndListeners=vr,this.removeAccessibleListeners=vr,this.startPointerPress=(t,n)=>{if(this.removeEndListeners(),this.isPressing)return;const r=this.node.getProps(),o=Fl(window,"pointerup",(s,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c}=this.node.getProps();Dn.update(()=>{zH(this.node.current,s.target)?u&&u(s,l):c&&c(s,l)})},{passive:!(r.onTap||r.onPointerUp)}),a=Fl(window,"pointercancel",(s,l)=>this.cancelPress(s,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=Zu(o,a),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=o=>{if(o.key!=="Enter"||this.isPressing)return;const a=s=>{s.key!=="Enter"||!this.checkPressEnd()||T5("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&Dn.update(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Ml(this.node.current,"keyup",a),T5("down",(s,l)=>{this.startPress(s,l)})},n=Ml(this.node.current,"keydown",t),r=()=>{this.isPressing&&T5("cancel",(o,a)=>this.cancelPress(o,a))},i=Ml(this.node.current,"blur",r);this.removeAccessibleListeners=Zu(n,i)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&Dn.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!BH()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&Dn.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=Fl(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=Ml(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Zu(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const ST=new WeakMap,k5=new WeakMap,l7e=e=>{const t=ST.get(e.target);t&&t(e)},u7e=e=>{e.forEach(l7e)};function c7e({root:e,...t}){const n=e||document;k5.has(n)||k5.set(n,{});const r=k5.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(u7e,{root:e,...t})),r[i]}function d7e(e,t,n){const r=c7e(t);return ST.set(e,n),r.observe(e),()=>{ST.delete(e),r.unobserve(e)}}const f7e={some:0,all:1};class h7e extends Oc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:f7e[i]},s=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,o&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),f=u?c:d;f&&f(l)};return d7e(this.node.current,a,s)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(p7e(t,n))&&this.startObserver()}unmount(){}}function p7e({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const g7e={inView:{Feature:h7e},tap:{Feature:s7e},focus:{Feature:a7e},hover:{Feature:o7e}};function jH(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function m7e(e){const t={};return e.values.forEach((n,r)=>t[r]=n.get()),t}function y7e(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function pw(e,t,n){const r=e.getProps();return hP(r,t,n!==void 0?n:r.custom,m7e(e),y7e(e))}const v7e="framerAppearId",b7e="data-"+dP(v7e);let _7e=vr,pP=vr;const Ju=e=>e*1e3,Bl=e=>e/1e3,S7e={current:!1},UH=e=>Array.isArray(e)&&typeof e[0]=="number";function VH(e){return!!(!e||typeof e=="string"&&GH[e]||UH(e)||Array.isArray(e)&&e.every(VH))}const Rg=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,GH={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Rg([0,.65,.55,1]),circOut:Rg([.55,0,1,.45]),backIn:Rg([.31,.01,.66,-.59]),backOut:Rg([.33,1.53,.69,.99])};function qH(e){if(e)return UH(e)?Rg(e):Array.isArray(e)?e.map(qH):GH[e]}function x7e(e,t,n,{delay:r=0,duration:i,repeat:o=0,repeatType:a="loop",ease:s,times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=qH(s);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:o+1,direction:a==="reverse"?"alternate":"normal"})}function w7e(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const HH=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,C7e=1e-7,E7e=12;function T7e(e,t,n,r,i){let o,a,s=0;do a=t+(n-t)/2,o=HH(a,r,i)-e,o>0?n=a:t=a;while(Math.abs(o)>C7e&&++s<E7e);return a}function Fy(e,t,n,r){if(e===t&&n===r)return vr;const i=o=>T7e(o,0,1,e,n);return o=>o===0||o===1?o:HH(i(o),t,r)}const k7e=Fy(.42,0,1,1),A7e=Fy(0,0,.58,1),WH=Fy(.42,0,.58,1),P7e=e=>Array.isArray(e)&&typeof e[0]!="number",KH=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,QH=e=>t=>1-e(1-t),XH=e=>1-Math.sin(Math.acos(e)),gP=QH(XH),I7e=KH(gP),YH=Fy(.33,1.53,.69,.99),mP=QH(YH),R7e=KH(mP),O7e=e=>(e*=2)<1?.5*mP(e):.5*(2-Math.pow(2,-10*(e-1))),M7e={linear:vr,easeIn:k7e,easeInOut:WH,easeOut:A7e,circIn:XH,circInOut:I7e,circOut:gP,backIn:mP,backInOut:R7e,backOut:YH,anticipate:O7e},l7=e=>{if(Array.isArray(e)){pP(e.length===4);const[t,n,r,i]=e;return Fy(t,n,r,i)}else if(typeof e=="string")return M7e[e];return e},yP=(e,t)=>n=>!!(Dy(n)&&OMe.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),ZH=(e,t,n)=>r=>{if(!Dy(r))return r;const[i,o,a,s]=r.match(fw);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(a),alpha:s!==void 0?parseFloat(s):1}},N7e=e=>pc(0,255,e),A5={...ef,transform:e=>Math.round(N7e(e))},ud={test:yP("rgb","red"),parse:ZH("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+A5.transform(e)+", "+A5.transform(t)+", "+A5.transform(n)+", "+rm(nm.transform(r))+")"};function $7e(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const xT={test:yP("#"),parse:$7e,transform:ud.transform},Qf={test:yP("hsl","hue"),parse:ZH("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Qs.transform(rm(t))+", "+Qs.transform(rm(n))+", "+rm(nm.transform(r))+")"},eo={test:e=>ud.test(e)||xT.test(e)||Qf.test(e),parse:e=>ud.test(e)?ud.parse(e):Qf.test(e)?Qf.parse(e):xT.parse(e),transform:e=>Dy(e)?e:e.hasOwnProperty("red")?ud.transform(e):Qf.transform(e)},ur=(e,t,n)=>-n*e+n*t+e;function P5(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function D7e({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,a=0;if(!t)i=o=a=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=P5(l,s,e+1/3),o=P5(l,s,e),a=P5(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}const I5=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},L7e=[xT,ud,Qf],F7e=e=>L7e.find(t=>t.test(e));function u7(e){const t=F7e(e);let n=t.parse(e);return t===Qf&&(n=D7e(n)),n}const JH=(e,t)=>{const n=u7(e),r=u7(t),i={...n};return o=>(i.red=I5(n.red,r.red,o),i.green=I5(n.green,r.green,o),i.blue=I5(n.blue,r.blue,o),i.alpha=ur(n.alpha,r.alpha,o),ud.transform(i))};function B7e(e){var t,n;return isNaN(e)&&Dy(e)&&(((t=e.match(fw))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(EH))===null||n===void 0?void 0:n.length)||0)>0}const eW={regex:IMe,countKey:"Vars",token:"${v}",parse:vr},tW={regex:EH,countKey:"Colors",token:"${c}",parse:eo.parse},nW={regex:fw,countKey:"Numbers",token:"${n}",parse:ef.parse};function R5(e,{regex:t,countKey:n,token:r,parse:i}){const o=e.tokenised.match(t);o&&(e["num"+n]=o.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...o.map(i)))}function eS(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&R5(n,eW),R5(n,tW),R5(n,nW),n}function rW(e){return eS(e).values}function iW(e){const{values:t,numColors:n,numVars:r,tokenised:i}=eS(e),o=t.length;return a=>{let s=i;for(let l=0;l<o;l++)l<r?s=s.replace(eW.token,a[l]):l<r+n?s=s.replace(tW.token,eo.transform(a[l])):s=s.replace(nW.token,rm(a[l]));return s}}const z7e=e=>typeof e=="number"?0:e;function j7e(e){const t=rW(e);return iW(e)(t.map(z7e))}const gc={test:B7e,parse:rW,createTransformer:iW,getAnimatableNone:j7e},oW=(e,t)=>n=>`${n>0?t:e}`;function aW(e,t){return typeof e=="number"?n=>ur(e,t,n):eo.test(e)?JH(e,t):e.startsWith("var(")?oW(e,t):lW(e,t)}const sW=(e,t)=>{const n=[...e],r=n.length,i=e.map((o,a)=>aW(o,t[a]));return o=>{for(let a=0;a<r;a++)n[a]=i[a](o);return n}},U7e=(e,t)=>{const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=aW(e[i],t[i]));return i=>{for(const o in r)n[o]=r[o](i);return n}},lW=(e,t)=>{const n=gc.createTransformer(t),r=eS(e),i=eS(t);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?Zu(sW(r.values,i.values),n):oW(e,t)},M0=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},c7=(e,t)=>n=>ur(e,t,n);function V7e(e){return typeof e=="number"?c7:typeof e=="string"?eo.test(e)?JH:lW:Array.isArray(e)?sW:typeof e=="object"?U7e:c7}function G7e(e,t,n){const r=[],i=n||V7e(e[0]),o=e.length-1;for(let a=0;a<o;a++){let s=i(e[a],e[a+1]);if(t){const l=Array.isArray(t)?t[a]||vr:t;s=Zu(l,s)}r.push(s)}return r}function uW(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const o=e.length;if(pP(o===t.length),o===1)return()=>t[0];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=G7e(t,r,i),s=a.length,l=u=>{let c=0;if(s>1)for(;c<e.length-2&&!(u<e[c+1]);c++);const d=M0(e[c],e[c+1],u);return a[c](d)};return n?u=>l(pc(e[0],e[o-1],u)):l}function q7e(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=M0(0,t,r);e.push(ur(n,1,i))}}function H7e(e){const t=[0];return q7e(t,e.length-1),t}function W7e(e,t){return e.map(n=>n*t)}function K7e(e,t){return e.map(()=>t||WH).splice(0,e.length-1)}function tS({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=P7e(r)?r.map(l7):l7(r),o={done:!1,value:t[0]},a=W7e(n&&n.length===t.length?n:H7e(t),e),s=uW(a,t,{ease:Array.isArray(i)?i:K7e(t,i)});return{calculatedDuration:e,next:l=>(o.value=s(l),o.done=l>=e,o)}}function cW(e,t){return t?e*(1e3/t):0}const Q7e=5;function dW(e,t,n){const r=Math.max(t-Q7e,0);return cW(n-e(r),t-r)}const O5=.001,X7e=.01,d7=10,Y7e=.05,Z7e=1;function J7e({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;_7e(e<=Ju(d7));let a=1-t;a=pc(Y7e,Z7e,a),e=pc(X7e,d7,Bl(e)),a<1?(i=u=>{const c=u*a,d=c*e,f=c-n,h=wT(u,a),p=Math.exp(-d);return O5-f/h*p},o=u=>{const d=u*a*e,f=d*n+n,h=Math.pow(a,2)*Math.pow(u,2)*e,p=Math.exp(-d),m=wT(Math.pow(u,2),a);return(-i(u)+O5>0?-1:1)*((f-h)*p)/m}):(i=u=>{const c=Math.exp(-u*e),d=(u-n)*e+1;return-O5+c*d},o=u=>{const c=Math.exp(-u*e),d=(n-u)*(e*e);return c*d});const s=5/e,l=tNe(i,o,s);if(e=Ju(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const eNe=12;function tNe(e,t,n){let r=n;for(let i=1;i<eNe;i++)r=r-e(r)/t(r);return r}function wT(e,t){return e*Math.sqrt(1-t*t)}const nNe=["duration","bounce"],rNe=["stiffness","damping","mass"];function f7(e,t){return t.some(n=>e[n]!==void 0)}function iNe(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!f7(e,rNe)&&f7(e,nNe)){const n=J7e(e);t={...t,...n,velocity:0,mass:1},t.isResolvedFromDuration=!0}return t}function fW({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],o=e[e.length-1],a={done:!1,value:i},{stiffness:s,damping:l,mass:u,velocity:c,duration:d,isResolvedFromDuration:f}=iNe(r),h=c?-Bl(c):0,p=l/(2*Math.sqrt(s*u)),m=o-i,_=Bl(Math.sqrt(s/u)),b=Math.abs(m)<5;n||(n=b?.01:2),t||(t=b?.005:.5);let y;if(p<1){const g=wT(_,p);y=v=>{const S=Math.exp(-p*_*v);return o-S*((h+p*_*m)/g*Math.sin(g*v)+m*Math.cos(g*v))}}else if(p===1)y=g=>o-Math.exp(-_*g)*(m+(h+_*m)*g);else{const g=_*Math.sqrt(p*p-1);y=v=>{const S=Math.exp(-p*_*v),w=Math.min(g*v,300);return o-S*((h+p*_*m)*Math.sinh(w)+g*m*Math.cosh(w))/g}}return{calculatedDuration:f&&d||null,next:g=>{const v=y(g);if(f)a.done=g>=d;else{let S=h;g!==0&&(p<1?S=dW(y,g,v):S=0);const w=Math.abs(S)<=n,x=Math.abs(o-v)<=t;a.done=w&&x}return a.value=a.done?o:v,a}}}function h7({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:a,min:s,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],f={done:!1,value:d},h=C=>s!==void 0&&C<s||l!==void 0&&C>l,p=C=>s===void 0?l:l===void 0||Math.abs(s-C)<Math.abs(l-C)?s:l;let m=n*t;const _=d+m,b=a===void 0?_:a(_);b!==_&&(m=b-d);const y=C=>-m*Math.exp(-C/r),g=C=>b+y(C),v=C=>{const k=y(C),T=g(C);f.done=Math.abs(k)<=u,f.value=f.done?b:T};let S,w;const x=C=>{h(f.value)&&(S=C,w=fW({keyframes:[f.value,p(f.value)],velocity:dW(g,C,f.value),damping:i,stiffness:o,restDelta:u,restSpeed:c}))};return x(0),{calculatedDuration:null,next:C=>{let k=!1;return!w&&S===void 0&&(k=!0,v(C),x(C)),S!==void 0&&C>S?w.next(C-S):(!k&&v(C),f)}}}const oNe=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Dn.update(t,!0),stop:()=>Xl(t),now:()=>ji.isProcessing?ji.timestamp:performance.now()}},p7=2e4;function g7(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<p7;)t+=n,r=e.next(t);return t>=p7?1/0:t}const aNe={decay:h7,inertia:h7,tween:tS,keyframes:tS,spring:fW};function nS({autoplay:e=!0,delay:t=0,driver:n=oNe,keyframes:r,type:i="keyframes",repeat:o=0,repeatDelay:a=0,repeatType:s="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:d,...f}){let h=1,p=!1,m,_;const b=()=>{_=new Promise(B=>{m=B})};b();let y;const g=aNe[i]||tS;let v;g!==tS&&typeof r[0]!="number"&&(v=uW([0,100],r,{clamp:!1}),r=[0,100]);const S=g({...f,keyframes:r});let w;s==="mirror"&&(w=g({...f,keyframes:[...r].reverse(),velocity:-(f.velocity||0)}));let x="idle",C=null,k=null,T=null;S.calculatedDuration===null&&o&&(S.calculatedDuration=g7(S));const{calculatedDuration:P}=S;let $=1/0,O=1/0;P!==null&&($=P+a,O=$*(o+1)-a);let E=0;const A=B=>{if(k===null)return;h>0&&(k=Math.min(k,B)),h<0&&(k=Math.min(B-O/h,k)),C!==null?E=C:E=Math.round(B-k)*h;const U=E-t*(h>=0?1:-1),G=h>=0?U<0:U>O;E=Math.max(U,0),x==="finished"&&C===null&&(E=O);let Z=E,ee=S;if(o){const ne=E/$;let se=Math.floor(ne),ye=ne%1;!ye&&ne>=1&&(ye=1),ye===1&&se--,se=Math.min(se,o+1);const ce=!!(se%2);ce&&(s==="reverse"?(ye=1-ye,a&&(ye-=a/$)):s==="mirror"&&(ee=w));let bt=pc(0,1,ye);E>O&&(bt=s==="reverse"&&ce?1:0),Z=bt*$}const J=G?{done:!1,value:r[0]}:ee.next(Z);v&&(J.value=v(J.value));let{done:j}=J;!G&&P!==null&&(j=h>=0?E>=O:E<=0);const Q=C===null&&(x==="finished"||x==="running"&&j);return d&&d(J.value),Q&&M(),J},D=()=>{y&&y.stop(),y=void 0},L=()=>{x="idle",D(),m(),b(),k=T=null},M=()=>{x="finished",c&&c(),D(),m()},R=()=>{if(p)return;y||(y=n(A));const B=y.now();l&&l(),C!==null?k=B-C:(!k||x==="finished")&&(k=B),x==="finished"&&b(),T=k,C=null,x="running",y.start()};e&&R();const N={then(B,U){return _.then(B,U)},get time(){return Bl(E)},set time(B){B=Ju(B),E=B,C!==null||!y||h===0?C=B:k=y.now()-B/h},get duration(){const B=S.calculatedDuration===null?g7(S):S.calculatedDuration;return Bl(B)},get speed(){return h},set speed(B){B===h||!y||(h=B,N.time=Bl(E))},get state(){return x},play:R,pause:()=>{x="paused",C=E},stop:()=>{p=!0,x!=="idle"&&(x="idle",u&&u(),L())},cancel:()=>{T!==null&&A(T),L()},complete:()=>{x="finished"},sample:B=>(k=0,A(B))};return N}function sNe(e){let t;return()=>(t===void 0&&(t=e()),t)}const lNe=sNe(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),uNe=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),i1=10,cNe=2e4,dNe=(e,t)=>t.type==="spring"||e==="backgroundColor"||!VH(t.ease);function fNe(e,t,{onUpdate:n,onComplete:r,...i}){if(!(lNe()&&uNe.has(t)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0&&i.type!=="inertia"))return!1;let a=!1,s,l;const u=()=>{l=new Promise(y=>{s=y})};u();let{keyframes:c,duration:d=300,ease:f,times:h}=i;if(dNe(t,i)){const y=nS({...i,repeat:0,delay:0});let g={done:!1,value:c[0]};const v=[];let S=0;for(;!g.done&&S<cNe;)g=y.sample(S),v.push(g.value),S+=i1;h=void 0,c=v,d=S-i1,f="linear"}const p=x7e(e.owner.current,t,c,{...i,duration:d,ease:f,times:h}),m=()=>p.cancel(),_=()=>{Dn.update(m),s(),u()};return p.onfinish=()=>{e.set(w7e(c,i)),r&&r(),_()},{then(y,g){return l.then(y,g)},attachTimeline(y){return p.timeline=y,p.onfinish=null,vr},get time(){return Bl(p.currentTime||0)},set time(y){p.currentTime=Ju(y)},get speed(){return p.playbackRate},set speed(y){p.playbackRate=y},get duration(){return Bl(d)},play:()=>{a||(p.play(),Xl(m))},pause:()=>p.pause(),stop:()=>{if(a=!0,p.playState==="idle")return;const{currentTime:y}=p;if(y){const g=nS({...i,autoplay:!1});e.setWithVelocity(g.sample(y-i1).value,g.sample(y).value,i1)}_()},complete:()=>p.finish(),cancel:_}}function hNe({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const i=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:vr,pause:vr,stop:vr,then:o=>(o(),Promise.resolve()),cancel:vr,complete:vr});return t?nS({keyframes:[0,1],duration:0,delay:t,onComplete:i}):i()}const pNe={type:"spring",stiffness:500,damping:25,restSpeed:10},gNe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),mNe={type:"keyframes",duration:.8},yNe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},vNe=(e,{keyframes:t})=>t.length>2?mNe:Jd.has(e)?e.startsWith("scale")?gNe(t[1]):pNe:yNe,CT=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(gc.test(t)||t==="0")&&!t.startsWith("url(")),bNe=new Set(["brightness","contrast","saturate","opacity"]);function _Ne(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(fw)||[];if(!r)return e;const i=n.replace(r,"");let o=bNe.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const SNe=/([a-z-]*)\(.*?\)/g,ET={...gc,getAnimatableNone:e=>{const t=e.match(SNe);return t?t.map(_Ne).join(" "):e}},xNe={...TH,color:eo,backgroundColor:eo,outlineColor:eo,fill:eo,stroke:eo,borderColor:eo,borderTopColor:eo,borderRightColor:eo,borderBottomColor:eo,borderLeftColor:eo,filter:ET,WebkitFilter:ET},vP=e=>xNe[e];function hW(e,t){let n=vP(e);return n!==ET&&(n=gc),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const pW=e=>/^0[^.\s]+$/.test(e);function wNe(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||pW(e)}function CNe(e,t,n,r){const i=CT(t,n);let o;Array.isArray(n)?o=[...n]:o=[null,n];const a=r.from!==void 0?r.from:e.get();let s;const l=[];for(let u=0;u<o.length;u++)o[u]===null&&(o[u]=u===0?a:o[u-1]),wNe(o[u])&&l.push(u),typeof o[u]=="string"&&o[u]!=="none"&&o[u]!=="0"&&(s=o[u]);if(i&&l.length&&s)for(let u=0;u<l.length;u++){const c=l[u];o[c]=hW(t,s)}return o}function ENe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:a,repeatDelay:s,from:l,elapsed:u,...c}){return!!Object.keys(c).length}function gW(e,t){return e[t]||e.default||e}const bP=(e,t,n,r={})=>i=>{const o=gW(r,e)||{},a=o.delay||r.delay||0;let{elapsed:s=0}=r;s=s-Ju(a);const l=CNe(t,e,n,o),u=l[0],c=l[l.length-1],d=CT(e,u),f=CT(e,c);let h={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...o,delay:-s,onUpdate:p=>{t.set(p),o.onUpdate&&o.onUpdate(p)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(ENe(o)||(h={...h,...vNe(e,h)}),h.duration&&(h.duration=Ju(h.duration)),h.repeatDelay&&(h.repeatDelay=Ju(h.repeatDelay)),!d||!f||S7e.current||o.type===!1)return hNe(h);if(t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const p=fNe(t,e,h);if(p)return p}return nS(h)};function rS(e){return!!(No(e)&&e.add)}const mW=e=>/^\-?\d*\.?\d+$/.test(e);function _P(e,t){e.indexOf(t)===-1&&e.push(t)}function SP(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class xP{constructor(){this.subscriptions=[]}add(t){return _P(this.subscriptions,t),()=>SP(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o<i;o++){const a=this.subscriptions[o];a&&a(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const TNe=e=>!isNaN(parseFloat(e));class kNe{constructor(t,n={}){this.version="10.16.1",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,i=!0)=>{this.prev=this.current,this.current=r;const{delta:o,timestamp:a}=ji;this.lastUpdated!==a&&(this.timeDelta=o,this.lastUpdated=a,Dn.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Dn.postRender(this.velocityCheck),this.velocityCheck=({timestamp:r})=>{r!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=TNe(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new xP);const r=this.events[t].add(n);return t==="change"?()=>{r(),Dn.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=t,this.timeDelta=r}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?cW(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function up(e,t){return new kNe(e,t)}const yW=e=>t=>t.test(e),ANe={test:e=>e==="auto",parse:e=>e},vW=[ef,st,Qs,yu,NMe,MMe,ANe],ug=e=>vW.find(yW(e)),PNe=[...vW,eo,gc],INe=e=>PNe.find(yW(e));function RNe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,up(n))}function ONe(e,t){const n=pw(e,t);let{transitionEnd:r={},transition:i={},...o}=n?e.makeTargetAnimatable(n,!1):{};o={...o,...r};for(const a in o){const s=KMe(o[a]);RNe(e,a,s)}}function MNe(e,t,n){var r,i;const o=Object.keys(t).filter(s=>!e.hasValue(s)),a=o.length;if(a)for(let s=0;s<a;s++){const l=o[s],u=t[l];let c=null;Array.isArray(u)&&(c=u[0]),c===null&&(c=(i=(r=n[l])!==null&&r!==void 0?r:e.readValue(l))!==null&&i!==void 0?i:t[l]),c!=null&&(typeof c=="string"&&(mW(c)||pW(c))?c=parseFloat(c):!INe(c)&&gc.test(u)&&(c=hW(l,u)),e.addValue(l,up(c,{owner:e})),n[l]===void 0&&(n[l]=c),c!==null&&e.setBaseTarget(l,c))}}function NNe(e,t){return t?(t[e]||t.default||t).from:void 0}function $Ne(e,t,n){const r={};for(const i in e){const o=NNe(i,t);if(o!==void 0)r[i]=o;else{const a=n.getValue(i);a&&(r[i]=a.get())}}return r}function DNe({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function bW(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:o=e.getDefaultTransition(),transitionEnd:a,...s}=e.makeTargetAnimatable(t);const l=e.getValue("willChange");r&&(o=r);const u=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const d in s){const f=e.getValue(d),h=s[d];if(!f||h===void 0||c&&DNe(c,d))continue;const p={delay:n,elapsed:0,...o};if(window.HandoffAppearAnimations&&!f.hasAnimated){const _=e.getProps()[b7e];_&&(p.elapsed=window.HandoffAppearAnimations(_,d,f,Dn))}f.start(bP(d,f,h,e.shouldReduceMotion&&Jd.has(d)?{type:!1}:p));const m=f.animation;rS(l)&&(l.add(d),m.then(()=>l.remove(d))),u.push(m)}return a&&Promise.all(u).then(()=>{a&&ONe(e,a)}),u}function TT(e,t,n={}){const r=pw(e,t,n.custom);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const o=r?()=>Promise.all(bW(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:d}=i;return LNe(e,t,u+l,c,d,n)}:()=>Promise.resolve(),{when:s}=i;if(s){const[l,u]=s==="beforeChildren"?[o,a]:[a,o];return l().then(()=>u())}else return Promise.all([o(),a(n.delay)])}function LNe(e,t,n=0,r=0,i=1,o){const a=[],s=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>s-u*r;return Array.from(e.variantChildren).sort(FNe).forEach((u,c)=>{u.notify("AnimationStart",t),a.push(TT(u,t,{...o,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function FNe(e,t){return e.sortNodePosition(t)}function BNe(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>TT(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=TT(e,t,n);else{const i=typeof t=="function"?pw(e,t,n.custom):t;r=Promise.all(bW(e,i,n))}return r.then(()=>e.notify("AnimationComplete",t))}const zNe=[...rP].reverse(),jNe=rP.length;function UNe(e){return t=>Promise.all(t.map(({animation:n,options:r})=>BNe(e,n,r)))}function VNe(e){let t=UNe(e);const n=qNe();let r=!0;const i=(l,u)=>{const c=pw(e,u);if(c){const{transition:d,transitionEnd:f,...h}=c;l={...l,...h,...f}}return l};function o(l){t=l(e)}function a(l,u){const c=e.getProps(),d=e.getVariantContext(!0)||{},f=[],h=new Set;let p={},m=1/0;for(let b=0;b<jNe;b++){const y=zNe[b],g=n[y],v=c[y]!==void 0?c[y]:d[y],S=R0(v),w=y===u?g.isActive:null;w===!1&&(m=b);let x=v===d[y]&&v!==c[y]&&S;if(x&&r&&e.manuallyAnimateOnMount&&(x=!1),g.protectedKeys={...p},!g.isActive&&w===null||!v&&!g.prevProp||cw(v)||typeof v=="boolean")continue;const C=GNe(g.prevProp,v);let k=C||y===u&&g.isActive&&!x&&S||b>m&&S;const T=Array.isArray(v)?v:[v];let P=T.reduce(i,{});w===!1&&(P={});const{prevResolvedValues:$={}}=g,O={...$,...P},E=A=>{k=!0,h.delete(A),g.needsAnimating[A]=!0};for(const A in O){const D=P[A],L=$[A];p.hasOwnProperty(A)||(D!==L?J_(D)&&J_(L)?!jH(D,L)||C?E(A):g.protectedKeys[A]=!0:D!==void 0?E(A):h.add(A):D!==void 0&&h.has(A)?E(A):g.protectedKeys[A]=!0)}g.prevProp=v,g.prevResolvedValues=P,g.isActive&&(p={...p,...P}),r&&e.blockInitialAnimation&&(k=!1),k&&!x&&f.push(...T.map(A=>({animation:A,options:{type:y,...l}})))}if(h.size){const b={};h.forEach(y=>{const g=e.getBaseTarget(y);g!==void 0&&(b[y]=g)}),f.push({animation:b})}let _=!!f.length;return r&&c.initial===!1&&!e.manuallyAnimateOnMount&&(_=!1),r=!1,_?t(f):Promise.resolve()}function s(l,u,c){var d;if(n[l].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(h=>{var p;return(p=h.animationState)===null||p===void 0?void 0:p.setActive(l,u)}),n[l].isActive=u;const f=a(c,l);for(const h in n)n[h].protectedKeys={};return f}return{animateChanges:a,setActive:s,setAnimateFunction:o,getState:()=>n}}function GNe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!jH(t,e):!1}function Bc(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function qNe(){return{animate:Bc(!0),whileInView:Bc(),whileHover:Bc(),whileTap:Bc(),whileDrag:Bc(),whileFocus:Bc(),exit:Bc()}}class HNe extends Oc{constructor(t){super(t),t.animationState||(t.animationState=VNe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),cw(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let WNe=0;class KNe extends Oc{constructor(){super(...arguments),this.id=WNe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:r}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const o=this.node.animationState.setActive("exit",!t,{custom:r??this.node.getProps().custom});n&&!t&&o.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const QNe={animation:{Feature:HNe},exit:{Feature:KNe}},m7=(e,t)=>Math.abs(e-t);function XNe(e,t){const n=m7(e.x,t.x),r=m7(e.y,t.y);return Math.sqrt(n**2+r**2)}class _W{constructor(t,n,{transformPagePoint:r}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const u=N5(this.lastMoveEventInfo,this.history),c=this.startEvent!==null,d=XNe(u.offset,{x:0,y:0})>=3;if(!c&&!d)return;const{point:f}=u,{timestamp:h}=ji;this.history.push({...f,timestamp:h});const{onStart:p,onMove:m}=this.handlers;c||(p&&p(this.lastMoveEvent,u),this.startEvent=this.lastMoveEvent),m&&m(this.lastMoveEvent,u)},this.handlePointerMove=(u,c)=>{this.lastMoveEvent=u,this.lastMoveEventInfo=M5(c,this.transformPagePoint),Dn.update(this.updatePoint,!0)},this.handlePointerUp=(u,c)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:d,onSessionEnd:f}=this.handlers,h=N5(u.type==="pointercancel"?this.lastMoveEventInfo:M5(c,this.transformPagePoint),this.history);this.startEvent&&d&&d(u,h),f&&f(u,h)},!DH(t))return;this.handlers=n,this.transformPagePoint=r;const i=hw(t),o=M5(i,this.transformPagePoint),{point:a}=o,{timestamp:s}=ji;this.history=[{...a,timestamp:s}];const{onSessionStart:l}=n;l&&l(t,N5(o,this.history)),this.removeListeners=Zu(Fl(window,"pointermove",this.handlePointerMove),Fl(window,"pointerup",this.handlePointerUp),Fl(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Xl(this.updatePoint)}}function M5(e,t){return t?{point:t(e.point)}:e}function y7(e,t){return{x:e.x-t.x,y:e.y-t.y}}function N5({point:e},t){return{point:e,delta:y7(e,SW(t)),offset:y7(e,YNe(t)),velocity:ZNe(t,.1)}}function YNe(e){return e[0]}function SW(e){return e[e.length-1]}function ZNe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=SW(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Ju(t)));)n--;if(!r)return{x:0,y:0};const o=Bl(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const a={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function ea(e){return e.max-e.min}function kT(e,t=0,n=.01){return Math.abs(e-t)<=n}function v7(e,t,n,r=.5){e.origin=r,e.originPoint=ur(t.min,t.max,e.origin),e.scale=ea(n)/ea(t),(kT(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=ur(n.min,n.max,e.origin)-e.originPoint,(kT(e.translate)||isNaN(e.translate))&&(e.translate=0)}function im(e,t,n,r){v7(e.x,t.x,n.x,r?r.originX:void 0),v7(e.y,t.y,n.y,r?r.originY:void 0)}function b7(e,t,n){e.min=n.min+t.min,e.max=e.min+ea(t)}function JNe(e,t,n){b7(e.x,t.x,n.x),b7(e.y,t.y,n.y)}function _7(e,t,n){e.min=t.min-n.min,e.max=e.min+ea(t)}function om(e,t,n){_7(e.x,t.x,n.x),_7(e.y,t.y,n.y)}function e$e(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?ur(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?ur(n,e,r.max):Math.min(e,n)),e}function S7(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function t$e(e,{top:t,left:n,bottom:r,right:i}){return{x:S7(e.x,n,i),y:S7(e.y,t,r)}}function x7(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function n$e(e,t){return{x:x7(e.x,t.x),y:x7(e.y,t.y)}}function r$e(e,t){let n=.5;const r=ea(e),i=ea(t);return i>r?n=M0(t.min,t.max-r,e.min):r>i&&(n=M0(e.min,e.max-i,t.min)),pc(0,1,n)}function i$e(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const AT=.35;function o$e(e=AT){return e===!1?e=0:e===!0&&(e=AT),{x:w7(e,"left","right"),y:w7(e,"top","bottom")}}function w7(e,t,n){return{min:C7(e,t),max:C7(e,n)}}function C7(e,t){return typeof e=="number"?e:e[t]||0}const E7=()=>({translate:0,scale:1,origin:0,originPoint:0}),Xf=()=>({x:E7(),y:E7()}),T7=()=>({min:0,max:0}),$r=()=>({x:T7(),y:T7()});function ws(e){return[e("x"),e("y")]}function xW({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function a$e({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function s$e(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function $5(e){return e===void 0||e===1}function PT({scale:e,scaleX:t,scaleY:n}){return!$5(e)||!$5(t)||!$5(n)}function qc(e){return PT(e)||wW(e)||e.z||e.rotate||e.rotateX||e.rotateY}function wW(e){return k7(e.x)||k7(e.y)}function k7(e){return e&&e!=="0%"}function iS(e,t,n){const r=e-n,i=t*r;return n+i}function A7(e,t,n,r,i){return i!==void 0&&(e=iS(e,i,r)),iS(e,n,r)+t}function IT(e,t=0,n=1,r,i){e.min=A7(e.min,t,n,r,i),e.max=A7(e.max,t,n,r,i)}function CW(e,{x:t,y:n}){IT(e.x,t.translate,t.scale,t.originPoint),IT(e.y,n.translate,n.scale,n.originPoint)}function l$e(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,a;for(let s=0;s<i;s++){o=n[s],a=o.projectionDelta;const l=o.instance;l&&l.style&&l.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Yf(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,CW(e,a)),r&&qc(o.latestValues)&&Yf(e,o.latestValues))}t.x=P7(t.x),t.y=P7(t.y)}function P7(e){return Number.isInteger(e)||e>1.0000000000001||e<.999999999999?e:1}function xu(e,t){e.min=e.min+t,e.max=e.max+t}function I7(e,t,[n,r,i]){const o=t[i]!==void 0?t[i]:.5,a=ur(e.min,e.max,o);IT(e,t[n],t[r],a,t.scale)}const u$e=["x","scaleX","originX"],c$e=["y","scaleY","originY"];function Yf(e,t){I7(e.x,t,u$e),I7(e.y,t,c$e)}function EW(e,t){return xW(s$e(e.getBoundingClientRect(),t))}function d$e(e,t,n){const r=EW(e,n),{scroll:i}=t;return i&&(xu(r.x,i.offset.x),xu(r.y,i.offset.y)),r}const f$e=new WeakMap;class h$e{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=$r(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=l=>{this.stopAnimation(),n&&this.snapToCursor(hw(l,"page").point)},o=(l,u)=>{const{drag:c,dragPropagation:d,onDragStart:f}=this.getProps();if(c&&!d&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=FH(c),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ws(p=>{let m=this.getAxisMotionValue(p).get()||0;if(Qs.test(m)){const{projection:_}=this.visualElement;if(_&&_.layout){const b=_.layout.layoutBox[p];b&&(m=ea(b)*(parseFloat(m)/100))}}this.originPoint[p]=m}),f&&Dn.update(()=>f(l,u),!1,!0);const{animationState:h}=this.visualElement;h&&h.setActive("whileDrag",!0)},a=(l,u)=>{const{dragPropagation:c,dragDirectionLock:d,onDirectionLock:f,onDrag:h}=this.getProps();if(!c&&!this.openGlobalLock)return;const{offset:p}=u;if(d&&this.currentDirection===null){this.currentDirection=p$e(p),this.currentDirection!==null&&f&&f(this.currentDirection);return}this.updateAxis("x",u.point,p),this.updateAxis("y",u.point,p),this.visualElement.render(),h&&h(l,u)},s=(l,u)=>this.stop(l,u);this.panSession=new _W(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:s},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&Dn.update(()=>o(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!o1(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=e$e(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),{layout:r}=this.visualElement.projection||{},i=this.constraints;t&&Kf(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=t$e(r.layoutBox,t):this.constraints=!1,this.elastic=o$e(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&ws(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=i$e(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Kf(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=d$e(r,i.root,this.visualElement.getTransformPagePoint());let a=n$e(i.layout.layoutBox,o);if(n){const s=n(a$e(a));this.hasMutatedConstraints=!!s,s&&(a=xW(s))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:s}=this.getProps(),l=this.constraints||{},u=ws(c=>{if(!o1(c,n,this.currentDirection))return;let d=l&&l[c]||{};a&&(d={min:0,max:0});const f=i?200:1e6,h=i?40:1e7,p={type:"inertia",velocity:r?t[c]:0,bounceStiffness:f,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...o,...d};return this.startAxisValueAnimation(c,p)});return Promise.all(u).then(s)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(bP(t,r,0,n))}stopAnimation(){ws(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){ws(n=>{const{drag:r}=this.getProps();if(!o1(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:a,max:s}=i.layout.layoutBox[n];o.set(t[n]-ur(a,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Kf(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};ws(a=>{const s=this.getAxisMotionValue(a);if(s){const l=s.get();i[a]=r$e({min:l,max:l},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),ws(a=>{if(!o1(a,t,null))return;const s=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];s.set(ur(l,u,i[a]))})}addListeners(){if(!this.visualElement.current)return;f$e.set(this.visualElement,this);const t=this.visualElement.current,n=Fl(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Kf(l)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),r();const a=Ml(window,"resize",()=>this.scalePositionWithinConstraints()),s=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(ws(c=>{const d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),s&&s()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:a=AT,dragMomentum:s=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:a,dragMomentum:s}}}function o1(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function p$e(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class g$e extends Oc{constructor(t){super(t),this.removeGroupControls=vr,this.removeListeners=vr,this.controls=new h$e(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||vr}unmount(){this.removeGroupControls(),this.removeListeners()}}const R7=e=>(t,n)=>{e&&Dn.update(()=>e(t,n))};class m$e extends Oc{constructor(){super(...arguments),this.removePointerDownListener=vr}onPointerDown(t){this.session=new _W(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:R7(t),onStart:R7(n),onMove:r,onEnd:(o,a)=>{delete this.session,i&&Dn.update(()=>i(o,a))}}}mount(){this.removePointerDownListener=Fl(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function y$e(){const e=I.useContext(Ny);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=I.useId();return I.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}function v$e(){return b$e(I.useContext(Ny))}function b$e(e){return e===null?!0:e.isPresent}const ab={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function O7(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const cg={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(st.test(e))e=parseFloat(e);else return e;const n=O7(e,t.target.x),r=O7(e,t.target.y);return`${n}% ${r}%`}},_$e={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=gc.parse(e);if(i.length>5)return r;const o=gc.createTransformer(e),a=typeof i[0]!="number"?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;i[0+a]/=s,i[1+a]/=l;const u=ur(s,l,.5);return typeof i[2+a]=="number"&&(i[2+a]/=u),typeof i[3+a]=="number"&&(i[3+a]/=u),o(i)}};class S$e extends Tn.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;TMe(x$e),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),ab.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,i||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||Dn.postRender(()=>{const s=a.getStack();(!s||!s.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function TW(e){const[t,n]=y$e(),r=I.useContext(oP);return Tn.createElement(S$e,{...e,layoutGroup:r,switchLayoutGroup:I.useContext(SH),isPresent:t,safeToRemove:n})}const x$e={borderRadius:{...cg,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:cg,borderTopRightRadius:cg,borderBottomLeftRadius:cg,borderBottomRightRadius:cg,boxShadow:_$e},kW=["TopLeft","TopRight","BottomLeft","BottomRight"],w$e=kW.length,M7=e=>typeof e=="string"?parseFloat(e):e,N7=e=>typeof e=="number"||st.test(e);function C$e(e,t,n,r,i,o){i?(e.opacity=ur(0,n.opacity!==void 0?n.opacity:1,E$e(r)),e.opacityExit=ur(t.opacity!==void 0?t.opacity:1,0,T$e(r))):o&&(e.opacity=ur(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;a<w$e;a++){const s=`border${kW[a]}Radius`;let l=$7(t,s),u=$7(n,s);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||N7(l)===N7(u)?(e[s]=Math.max(ur(M7(l),M7(u),r),0),(Qs.test(u)||Qs.test(l))&&(e[s]+="%")):e[s]=u}(t.rotate||n.rotate)&&(e.rotate=ur(t.rotate||0,n.rotate||0,r))}function $7(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const E$e=AW(0,.5,gP),T$e=AW(.5,.95,vr);function AW(e,t,n){return r=>r<e?0:r>t?1:n(M0(e,t,r))}function D7(e,t){e.min=t.min,e.max=t.max}function ca(e,t){D7(e.x,t.x),D7(e.y,t.y)}function L7(e,t,n,r,i){return e-=t,e=iS(e,1/n,r),i!==void 0&&(e=iS(e,1/i,r)),e}function k$e(e,t=0,n=1,r=.5,i,o=e,a=e){if(Qs.test(t)&&(t=parseFloat(t),t=ur(a.min,a.max,t/100)-a.min),typeof t!="number")return;let s=ur(o.min,o.max,r);e===o&&(s-=t),e.min=L7(e.min,t,n,s,i),e.max=L7(e.max,t,n,s,i)}function F7(e,t,[n,r,i],o,a){k$e(e,t[n],t[r],t[i],t.scale,o,a)}const A$e=["x","scaleX","originX"],P$e=["y","scaleY","originY"];function B7(e,t,n,r){F7(e.x,t,A$e,n?n.x:void 0,r?r.x:void 0),F7(e.y,t,P$e,n?n.y:void 0,r?r.y:void 0)}function z7(e){return e.translate===0&&e.scale===1}function PW(e){return z7(e.x)&&z7(e.y)}function I$e(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function IW(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function j7(e){return ea(e.x)/ea(e.y)}class R$e{constructor(){this.members=[]}add(t){_P(this.members,t),t.scheduleRender()}remove(t){if(SP(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function U7(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y;if((i||o)&&(r=`translate3d(${i}px, ${o}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:c}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),c&&(r+=`rotateY(${c}deg) `)}const a=e.x.scale*t.x,s=e.y.scale*t.y;return(a!==1||s!==1)&&(r+=`scale(${a}, ${s})`),r||"none"}const O$e=(e,t)=>e.depth-t.depth;class M$e{constructor(){this.children=[],this.isDirty=!1}add(t){_P(this.children,t),this.isDirty=!0}remove(t){SP(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(O$e),this.isDirty=!1,this.children.forEach(t)}}function N$e(e,t){const n=performance.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(Xl(r),e(o-t))};return Dn.read(r,!0),()=>Xl(r)}function $$e(e){window.MotionDebug&&window.MotionDebug.record(e)}function D$e(e){return e instanceof SVGElement&&e.tagName!=="svg"}function L$e(e,t,n){const r=No(e)?e:up(e);return r.start(bP("",r,t,n)),r.animation}const V7=["","X","Y","Z"],G7=1e3;let F$e=0;const Hc={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function RW({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(a={},s=t==null?void 0:t()){this.id=F$e++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{Hc.totalNodes=Hc.resolvedTargetDeltas=Hc.recalculatedProjection=0,this.nodes.forEach(j$e),this.nodes.forEach(H$e),this.nodes.forEach(W$e),this.nodes.forEach(U$e),$$e(Hc)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new M$e)}addEventListener(a,s){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new xP),this.eventHandlers.get(a).add(s)}notifyListeners(a,...s){const l=this.eventHandlers.get(a);l&&l.notify(...s)}hasListeners(a){return this.eventHandlers.has(a)}mount(a,s=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=D$e(a),this.instance=a;const{layoutId:l,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),s&&(u||l)&&(this.isLayoutDirty=!0),e){let d;const f=()=>this.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=N$e(f,250),ab.hasAnimatedSinceResize&&(ab.hasAnimatedSinceResize=!1,this.nodes.forEach(H7))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeTargetChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||c.getDefaultTransition()||Z$e,{onLayoutAnimationStart:_,onLayoutAnimationComplete:b}=c.getProps(),y=!this.targetLayout||!IW(this.targetLayout,p)||h,g=!f&&h;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||g||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,g);const v={...gW(m,"layout"),onPlay:_,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(v.delay=0,v.type=!1),this.startAnimation(v)}else f||H7(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Xl(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(K$e),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;c<this.path.length;c++){const d=this.path[c];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:s,layout:l}=this.options;if(s===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(q7);return}this.isUpdating||this.nodes.forEach(G$e),this.isUpdating=!1,this.nodes.forEach(q$e),this.nodes.forEach(B$e),this.nodes.forEach(z$e),this.clearAllSnapshots();const s=performance.now();ji.delta=pc(0,1e3/60,s-ji.timestamp),ji.timestamp=s,ji.isProcessing=!0,E5.update.process(ji),E5.preRender.process(ji),E5.render.process(ji),ji.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(V$e),this.sharedNodes.forEach(Q$e)}scheduleUpdateProjection(){Dn.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Dn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutCorrected=$r(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:s}=this.options;s&&s.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let s=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(s=!1),s&&(this.scroll={animationId:this.root.animationId,phase:a,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!i)return;const a=this.isLayoutDirty||this.shouldResetTransform,s=this.projectionDelta&&!PW(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,c=u!==this.prevTransformTemplateValue;a&&(s||qc(this.latestValues)||c)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const s=this.measurePageBox();let l=this.removeElementScroll(s);return a&&(l=this.removeTransform(l)),J$e(l),{animationId:this.root.animationId,measuredBox:s,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:a}=this.options;if(!a)return $r();const s=a.measureViewportBox(),{scroll:l}=this.root;return l&&(xu(s.x,l.offset.x),xu(s.y,l.offset.y)),s}removeElementScroll(a){const s=$r();ca(s,a);for(let l=0;l<this.path.length;l++){const u=this.path[l],{scroll:c,options:d}=u;if(u!==this.root&&c&&d.layoutScroll){if(c.isRoot){ca(s,a);const{scroll:f}=this.root;f&&(xu(s.x,-f.offset.x),xu(s.y,-f.offset.y))}xu(s.x,c.offset.x),xu(s.y,c.offset.y)}}return s}applyTransform(a,s=!1){const l=$r();ca(l,a);for(let u=0;u<this.path.length;u++){const c=this.path[u];!s&&c.options.layoutScroll&&c.scroll&&c!==c.root&&Yf(l,{x:-c.scroll.offset.x,y:-c.scroll.offset.y}),qc(c.latestValues)&&Yf(l,c.latestValues)}return qc(this.latestValues)&&Yf(l,this.latestValues),l}removeTransform(a){const s=$r();ca(s,a);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!qc(u.latestValues))continue;PT(u.latestValues)&&u.updateSnapshot();const c=$r(),d=u.measurePageBox();ca(c,d),B7(s,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,c)}return qc(this.latestValues)&&B7(s,this.latestValues),s}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ji.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var s;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(a||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((s=this.parent)===null||s===void 0)&&s.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=ji.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=$r(),this.relativeTargetOrigin=$r(),om(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),ca(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=$r(),this.targetWithTransforms=$r()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),JNe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ca(this.target,this.layout.layoutBox),CW(this.target,this.targetDelta)):ca(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=$r(),this.relativeTargetOrigin=$r(),om(this.relativeTargetOrigin,this.target,h.target),ca(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Hc.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||PT(this.parent.latestValues)||wW(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var a;const s=this.getLead(),l=!!this.resumingFrom||this!==s;let u=!0;if((this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===ji.timestamp&&(u=!1),u)return;const{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;ca(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;l$e(this.layoutCorrected,this.treeScale,this.path,l),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox);const{target:p}=s;if(!p){this.projectionTransform&&(this.projectionDelta=Xf(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=Xf(),this.projectionDeltaWithTransform=Xf());const m=this.projectionTransform;im(this.projectionDelta,this.layoutCorrected,p,this.latestValues),this.projectionTransform=U7(this.projectionDelta,this.treeScale),(this.projectionTransform!==m||this.treeScale.x!==f||this.treeScale.y!==h)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),Hc.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),a){const s=this.getStack();s&&s.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(a,s=!1){const l=this.snapshot,u=l?l.latestValues:{},c={...this.latestValues},d=Xf();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!s;const f=$r(),h=l?l.source:void 0,p=this.layout?this.layout.source:void 0,m=h!==p,_=this.getStack(),b=!_||_.members.length<=1,y=!!(m&&!b&&this.options.crossfade===!0&&!this.path.some(Y$e));this.animationProgress=0;let g;this.mixTargetDelta=v=>{const S=v/1e3;W7(d.x,a.x,S),W7(d.y,a.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(om(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),X$e(this.relativeTarget,this.relativeTargetOrigin,f,S),g&&I$e(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=$r()),ca(g,this.relativeTarget)),m&&(this.animationValues=c,C$e(c,u,this.latestValues,S,y,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Xl(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Dn.update(()=>{ab.hasAnimatedSinceResize=!0,this.currentAnimation=L$e(0,G7,{...a,onUpdate:s=>{this.mixTargetDelta(s),a.onUpdate&&a.onUpdate(s)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(G7),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:s,target:l,layout:u,latestValues:c}=a;if(!(!s||!l||!u)){if(this!==a&&this.layout&&u&&OW(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||$r();const d=ea(this.layout.layoutBox.x);l.x.min=a.target.x.min,l.x.max=l.x.min+d;const f=ea(this.layout.layoutBox.y);l.y.min=a.target.y.min,l.y.max=l.y.min+f}ca(s,l),Yf(s,c),im(this.projectionDeltaWithTransform,this.layoutCorrected,s,c)}}registerSharedNode(a,s){this.sharedNodes.has(a)||this.sharedNodes.set(a,new R$e),this.sharedNodes.get(a).add(s);const u=s.options.initialPromotionConfig;s.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(s):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:s}=this.options;return s?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:s}=this.options;return s?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:s,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),a&&(this.projectionDelta=void 0,this.needsReset=!0),s&&this.setOptions({transition:s})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetRotation(){const{visualElement:a}=this.options;if(!a)return;let s=!1;const{latestValues:l}=a;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(s=!0),!s)return;const u={};for(let c=0;c<V7.length;c++){const d="rotate"+V7[c];l[d]&&(u[d]=l[d],a.setStaticValue(d,0))}a.render();for(const c in u)a.setStaticValue(c,u[c]);a.scheduleRender()}getProjectionStyles(a={}){var s,l;const u={};if(!this.instance||this.isSVG)return u;if(this.isVisible)u.visibility="";else return{visibility:"hidden"};const c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=ob(a.pointerEvents)||"",u.transform=c?c(this.latestValues,""):"none",u;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const m={};return this.options.layoutId&&(m.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,m.pointerEvents=ob(a.pointerEvents)||""),this.hasProjected&&!qc(this.latestValues)&&(m.transform=c?c({},""):"none",this.hasProjected=!1),m}const f=d.animationValues||d.latestValues;this.applyTransformsToTarget(),u.transform=U7(this.projectionDeltaWithTransform,this.treeScale,f),c&&(u.transform=c(f,u.transform));const{x:h,y:p}=this.projectionDelta;u.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,d.animationValues?u.opacity=d===this?(l=(s=f.opacity)!==null&&s!==void 0?s:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:u.opacity=d===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const m in Y_){if(f[m]===void 0)continue;const{correct:_,applyTo:b}=Y_[m],y=u.transform==="none"?f[m]:_(f[m],d);if(b){const g=b.length;for(let v=0;v<g;v++)u[b[v]]=y}else u[m]=y}return this.options.layoutId&&(u.pointerEvents=d===this?ob(a.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var s;return(s=a.currentAnimation)===null||s===void 0?void 0:s.stop()}),this.root.nodes.forEach(q7),this.root.sharedNodes.clear()}}}function B$e(e){e.updateLayout()}function z$e(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,a=n.source!==e.layout.source;o==="size"?ws(d=>{const f=a?n.measuredBox[d]:n.layoutBox[d],h=ea(f);f.min=r[d].min,f.max=f.min+h}):OW(o,n.layoutBox,r)&&ws(d=>{const f=a?n.measuredBox[d]:n.layoutBox[d],h=ea(r[d]);f.max=f.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+h)});const s=Xf();im(s,r,n.layoutBox);const l=Xf();a?im(l,e.applyTransform(i,!0),n.measuredBox):im(l,r,n.layoutBox);const u=!PW(s);let c=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:f,layout:h}=d;if(f&&h){const p=$r();om(p,n.layoutBox,f.layoutBox);const m=$r();om(m,r,h.layoutBox),IW(p,m)||(c=!0),d.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=p,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:s,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function j$e(e){Hc.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function U$e(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function V$e(e){e.clearSnapshot()}function q7(e){e.clearMeasurements()}function G$e(e){e.isLayoutDirty=!1}function q$e(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function H7(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function H$e(e){e.resolveTargetDelta()}function W$e(e){e.calcProjection()}function K$e(e){e.resetRotation()}function Q$e(e){e.removeLeadSnapshot()}function W7(e,t,n){e.translate=ur(t.translate,0,n),e.scale=ur(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function K7(e,t,n,r){e.min=ur(t.min,n.min,r),e.max=ur(t.max,n.max,r)}function X$e(e,t,n,r){K7(e.x,t.x,n.x,r),K7(e.y,t.y,n.y,r)}function Y$e(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const Z$e={duration:.45,ease:[.4,0,.1,1]},Q7=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),X7=Q7("applewebkit/")&&!Q7("chrome/")?Math.round:vr;function Y7(e){e.min=X7(e.min),e.max=X7(e.max)}function J$e(e){Y7(e.x),Y7(e.y)}function OW(e,t,n){return e==="position"||e==="preserve-aspect"&&!kT(j7(t),j7(n),.2)}const eDe=RW({attachResizeListener:(e,t)=>Ml(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),D5={current:void 0},MW=RW({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!D5.current){const e=new eDe({});e.mount(window),e.setOptions({layoutScroll:!0}),D5.current=e}return D5.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),tDe={pan:{Feature:m$e},drag:{Feature:g$e,ProjectionNode:MW,MeasureLayout:TW}},nDe=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function rDe(e){const t=nDe.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function RT(e,t,n=1){const[r,i]=rDe(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const a=o.trim();return mW(a)?parseFloat(a):a}else return _T(i)?RT(i,t,n+1):i}function iDe(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(i=>{const o=i.get();if(!_T(o))return;const a=RT(o,r);a&&i.set(a)});for(const i in t){const o=t[i];if(!_T(o))continue;const a=RT(o,r);a&&(t[i]=a,n||(n={}),n[i]===void 0&&(n[i]=o))}return{target:t,transitionEnd:n}}const oDe=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),NW=e=>oDe.has(e),aDe=e=>Object.keys(e).some(NW),Z7=e=>e===ef||e===st,J7=(e,t)=>parseFloat(e.split(", ")[t]),eN=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return J7(i[1],t);{const o=r.match(/^matrix\((.+)\)$/);return o?J7(o[1],e):0}},sDe=new Set(["x","y","z"]),lDe=$y.filter(e=>!sDe.has(e));function uDe(e){const t=[];return lDe.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const cp={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:eN(4,13),y:eN(5,14)};cp.translateX=cp.x;cp.translateY=cp.y;const cDe=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,o=getComputedStyle(i),{display:a}=o,s={};a==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{s[u]=cp[u](r,o)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const c=t.getValue(u);c&&c.jump(s[u]),e[u]=cp[u](l,o)}),e},dDe=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(NW);let o=[],a=!1;const s=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let c=n[l],d=ug(c);const f=t[l];let h;if(J_(f)){const p=f.length,m=f[0]===null?1:0;c=f[m],d=ug(c);for(let _=m;_<p&&f[_]!==null;_++)h?pP(ug(f[_])===h):h=ug(f[_])}else h=ug(f);if(d!==h)if(Z7(d)&&Z7(h)){const p=u.get();typeof p=="string"&&u.set(parseFloat(p)),typeof f=="string"?t[l]=parseFloat(f):Array.isArray(f)&&h===st&&(t[l]=f.map(parseFloat))}else d!=null&&d.transform&&(h!=null&&h.transform)&&(c===0||f===0)?c===0?u.set(h.transform(c)):t[l]=d.transform(f):(a||(o=uDe(e),a=!0),s.push(l),r[l]=r[l]!==void 0?r[l]:t[l],u.jump(f))}),s.length){const l=s.indexOf("height")>=0?window.pageYOffset:null,u=cDe(t,e,s);return o.length&&o.forEach(([c,d])=>{e.getValue(c).set(d)}),e.render(),uw&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function fDe(e,t,n,r){return aDe(t)?dDe(e,t,n,r):{target:t,transitionEnd:r}}const hDe=(e,t,n,r)=>{const i=iDe(e,t,r);return t=i.target,r=i.transitionEnd,fDe(e,t,n,r)},OT={current:null},$W={current:!1};function pDe(){if($W.current=!0,!!uw)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>OT.current=e.matches;e.addListener(t),t()}else OT.current=!1}function gDe(e,t,n){const{willChange:r}=t;for(const i in t){const o=t[i],a=n[i];if(No(o))e.addValue(i,o),rS(r)&&r.add(i);else if(No(a))e.addValue(i,up(o,{owner:e})),rS(r)&&r.remove(i);else if(a!==o)if(e.hasValue(i)){const s=e.getValue(i);!s.hasAnimated&&s.set(o)}else{const s=e.getStaticValue(i);e.addValue(i,up(s!==void 0?s:o,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const tN=new WeakMap,DW=Object.keys(O0),mDe=DW.length,nN=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],yDe=iP.length;class vDe{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Dn.render(this.render,!1,!0);const{latestValues:s,renderState:l}=o;this.latestValues=s,this.baseTarget={...s},this.initialValues=n.initial?{...s}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.isControllingVariants=dw(n),this.isVariantNode=_H(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(n,{});for(const d in c){const f=c[d];s[d]!==void 0&&No(f)&&(f.set(s[d],!1),rS(u)&&u.add(d))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,tN.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),$W.current||pDe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:OT.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){tN.delete(this.current),this.projection&&this.projection.unmount(),Xl(this.notifyUpdate),Xl(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const r=Jd.has(t),i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Dn.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),o()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},r,i,o){let a,s;for(let l=0;l<mDe;l++){const u=DW[l],{isEnabled:c,Feature:d,ProjectionNode:f,MeasureLayout:h}=O0[u];f&&(a=f),c(n)&&(!this.features[u]&&d&&(this.features[u]=new d(this)),h&&(s=h))}if(!this.projection&&a){this.projection=new a(this.latestValues,this.parent&&this.parent.projection);const{layoutId:l,layout:u,drag:c,dragConstraints:d,layoutScroll:f,layoutRoot:h}=n;this.projection.setOptions({layoutId:l,layout:u,alwaysMeasureLayout:!!c||d&&Kf(d),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:o,layoutScroll:f,layoutRoot:h})}return s}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):$r()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<nN.length;r++){const i=nN[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o=t["on"+i];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=gDe(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const r=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(r.initial=this.props.initial),r}const n={};for(let r=0;r<yDe;r++){const i=iP[r],o=this.props[i];(R0(o)||o===!1)&&(n[i]=o)}return n}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=up(n,{owner:this}),this.addValue(t,r)),r}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,i=typeof r=="string"||typeof r=="object"?(n=hP(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!No(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new xP),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class LW extends vDe{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:i},o){let a=$Ne(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),a&&(a=i(a))),o){MNe(this,r,a);const s=hDe(this,r,a,n);n=s.transitionEnd,r=s.target}return{transition:t,transitionEnd:n,...r}}}function bDe(e){return window.getComputedStyle(e)}class _De extends LW{readValueFromInstance(t,n){if(Jd.has(n)){const r=vP(n);return r&&r.default||0}else{const r=bDe(t),i=(CH(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return EW(t,n)}build(t,n,r,i){sP(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t,n){return fP(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;No(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,i){IH(t,n,r,i)}}class SDe extends LW{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Jd.has(n)){const r=vP(n);return r&&r.default||0}return n=RH.has(n)?n:dP(n),t.getAttribute(n)}measureInstanceViewportBox(){return $r()}scrapeMotionValuesFromProps(t,n){return MH(t,n)}build(t,n,r,i){uP(t,n,r,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,r,i){OH(t,n,r,i)}mount(t){this.isSVGTag=cP(t.tagName),super.mount(t)}}const xDe=(e,t)=>aP(e)?new SDe(t,{enableHardwareAcceleration:!1}):new _De(t,{enableHardwareAcceleration:!0}),wDe={layout:{ProjectionNode:MW,MeasureLayout:TW}},CDe={...QNe,...g7e,...tDe,...wDe},FW=CMe((e,t)=>n7e(e,t,CDe,xDe));function BW(){const e=I.useRef(!1);return nP(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function EDe(){const e=BW(),[t,n]=I.useState(0),r=I.useCallback(()=>{e.current&&n(t+1)},[t]);return[I.useCallback(()=>Dn.postRender(r),[r]),t]}class TDe extends I.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function kDe({children:e,isPresent:t}){const n=I.useId(),r=I.useRef(null),i=I.useRef({width:0,height:0,top:0,left:0});return I.useInsertionEffect(()=>{const{width:o,height:a,top:s,left:l}=i.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const u=document.createElement("style");return document.head.appendChild(u),u.sheet&&u.sheet.insertRule(`
|
||
[data-motion-pop-id="${n}"] {
|
||
position: absolute !important;
|
||
width: ${o}px !important;
|
||
height: ${a}px !important;
|
||
top: ${s}px !important;
|
||
left: ${l}px !important;
|
||
}
|
||
`),()=>{document.head.removeChild(u)}},[t]),I.createElement(TDe,{isPresent:t,childRef:r,sizeRef:i},I.cloneElement(e,{ref:r}))}const L5=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:a})=>{const s=NH(ADe),l=I.useId(),u=I.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:c=>{s.set(c,!0);for(const d of s.values())if(!d)return;r&&r()},register:c=>(s.set(c,!1),()=>s.delete(c))}),o?void 0:[n]);return I.useMemo(()=>{s.forEach((c,d)=>s.set(d,!1))},[n]),I.useEffect(()=>{!n&&!s.size&&r&&r()},[n]),a==="popLayout"&&(e=I.createElement(kDe,{isPresent:n},e)),I.createElement(Ny.Provider,{value:u},e)};function ADe(){return new Map}function PDe(e){return I.useEffect(()=>()=>e(),[])}const Tf=e=>e.key||"";function IDe(e,t){e.forEach(n=>{const r=Tf(n);t.set(r,n)})}function RDe(e){const t=[];return I.Children.forEach(e,n=>{I.isValidElement(n)&&t.push(n)}),t}const zW=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:i,presenceAffectsLayout:o=!0,mode:a="sync"})=>{const s=I.useContext(oP).forceRender||EDe()[0],l=BW(),u=RDe(e);let c=u;const d=I.useRef(new Map).current,f=I.useRef(c),h=I.useRef(new Map).current,p=I.useRef(!0);if(nP(()=>{p.current=!1,IDe(u,h),f.current=c}),PDe(()=>{p.current=!0,h.clear(),d.clear()}),p.current)return I.createElement(I.Fragment,null,c.map(y=>I.createElement(L5,{key:Tf(y),isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:o,mode:a},y)));c=[...c];const m=f.current.map(Tf),_=u.map(Tf),b=m.length;for(let y=0;y<b;y++){const g=m[y];_.indexOf(g)===-1&&!d.has(g)&&d.set(g,void 0)}return a==="wait"&&d.size&&(c=[]),d.forEach((y,g)=>{if(_.indexOf(g)!==-1)return;const v=h.get(g);if(!v)return;const S=m.indexOf(g);let w=y;if(!w){const x=()=>{h.delete(g),d.delete(g);const C=f.current.findIndex(k=>k.key===g);if(f.current.splice(C,1),!d.size){if(f.current=u,l.current===!1)return;s(),r&&r()}};w=I.createElement(L5,{key:Tf(v),isPresent:!1,onExitComplete:x,custom:t,presenceAffectsLayout:o,mode:a},v),d.set(g,w)}c.splice(S,0,w)}),c=c.map(y=>{const g=y.key;return d.has(g)?y:I.createElement(L5,{key:Tf(y),isPresent:!0,presenceAffectsLayout:o,mode:a},y)}),I.createElement(I.Fragment,null,d.size?c:c.map(y=>I.cloneElement(y)))};var ODe={initial:e=>{const{position:t}=e,n=["top","bottom"].includes(t)?"y":"x";let r=["top-right","bottom-right"].includes(t)?1:-1;return t==="bottom"&&(r=1),{opacity:0,[n]:r*24}},animate:{opacity:1,y:0,x:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}},exit:{opacity:0,scale:.85,transition:{duration:.2,ease:[.4,0,1,1]}}},jW=I.memo(e=>{const{id:t,message:n,onCloseComplete:r,onRequestRemove:i,requestClose:o=!1,position:a="bottom",duration:s=5e3,containerStyle:l,motionVariants:u=ODe,toastSpacing:c="0.5rem"}=e,[d,f]=I.useState(s),h=v$e();JM(()=>{h||r==null||r()},[h]),JM(()=>{f(s)},[s]);const p=()=>f(null),m=()=>f(s),_=()=>{h&&i()};I.useEffect(()=>{h&&o&&i()},[h,o,i]),gMe(_,d);const b=I.useMemo(()=>({pointerEvents:"auto",maxWidth:560,minWidth:300,margin:c,...l}),[l,c]),y=I.useMemo(()=>fMe(a),[a]);return W.jsx(FW.div,{layout:!0,className:"chakra-toast",variants:u,initial:"initial",animate:"animate",exit:"exit",onHoverStart:p,onHoverEnd:m,custom:{position:a},style:y,children:W.jsx(Oi.div,{role:"status","aria-atomic":"true",className:"chakra-toast__inner",__css:b,children:Ls(n,{id:t,onClose:_})})})});jW.displayName="ToastComponent";function MDe(e,t){var n;const r=e??"bottom",o={"top-start":{ltr:"top-left",rtl:"top-right"},"top-end":{ltr:"top-right",rtl:"top-left"},"bottom-start":{ltr:"bottom-left",rtl:"bottom-right"},"bottom-end":{ltr:"bottom-right",rtl:"bottom-left"}}[r];return(n=o==null?void 0:o[t])!=null?n:r}var rN={path:W.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",children:[W.jsx("path",{strokeLinecap:"round",fill:"none",d:"M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"}),W.jsx("path",{fill:"currentColor",strokeLinecap:"round",d:"M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"}),W.jsx("circle",{fill:"none",strokeMiterlimit:"10",cx:"12",cy:"12",r:"11.25"})]}),viewBox:"0 0 24 24"},By=ia((e,t)=>{const{as:n,viewBox:r,color:i="currentColor",focusable:o=!1,children:a,className:s,__css:l,...u}=e,c=Rc("chakra-icon",s),d=My("Icon",e),f={w:"1em",h:"1em",display:"inline-block",lineHeight:"1em",flexShrink:0,color:i,...l,...d},h={ref:t,focusable:o,className:c,__css:f},p=r??rN.viewBox;if(n&&typeof n!="string")return W.jsx(Oi.svg,{as:n,...h,...u});const m=a??rN.path;return W.jsx(Oi.svg,{verticalAlign:"middle",viewBox:p,...h,...u,children:m})});By.displayName="Icon";function NDe(e){return W.jsx(By,{viewBox:"0 0 24 24",...e,children:W.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.014,12.014,0,0,0,12,0Zm6.927,8.2-6.845,9.289a1.011,1.011,0,0,1-1.43.188L5.764,13.769a1,1,0,1,1,1.25-1.562l4.076,3.261,6.227-8.451A1,1,0,1,1,18.927,8.2Z"})})}function $De(e){return W.jsx(By,{viewBox:"0 0 24 24",...e,children:W.jsx("path",{fill:"currentColor",d:"M12,0A12,12,0,1,0,24,12,12.013,12.013,0,0,0,12,0Zm.25,5a1.5,1.5,0,1,1-1.5,1.5A1.5,1.5,0,0,1,12.25,5ZM14.5,18.5h-4a1,1,0,0,1,0-2h.75a.25.25,0,0,0,.25-.25v-4.5a.25.25,0,0,0-.25-.25H10.5a1,1,0,0,1,0-2h1a2,2,0,0,1,2,2v4.75a.25.25,0,0,0,.25.25h.75a1,1,0,1,1,0,2Z"})})}function iN(e){return W.jsx(By,{viewBox:"0 0 24 24",...e,children:W.jsx("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}var DDe=Qke({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),wP=ia((e,t)=>{const n=My("Spinner",e),{label:r="Loading...",thickness:i="2px",speed:o="0.45s",emptyColor:a="transparent",className:s,...l}=Ry(e),u=Rc("chakra-spinner",s),c={display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:i,borderBottomColor:a,borderLeftColor:a,animation:`${DDe} ${o} linear infinite`,...n};return W.jsx(Oi.div,{ref:t,__css:c,className:u,...l,children:r&&W.jsx(Oi.span,{srOnly:!0,children:r})})});wP.displayName="Spinner";var[LDe,CP]=Iy({name:"AlertContext",hookName:"useAlertContext",providerName:"<Alert />"}),[FDe,EP]=Iy({name:"AlertStylesContext",hookName:"useAlertStyles",providerName:"<Alert />"}),UW={info:{icon:$De,colorScheme:"blue"},warning:{icon:iN,colorScheme:"orange"},success:{icon:NDe,colorScheme:"green"},error:{icon:iN,colorScheme:"red"},loading:{icon:wP,colorScheme:"blue"}};function BDe(e){return UW[e].colorScheme}function zDe(e){return UW[e].icon}var VW=ia(function(t,n){const r=EP(),{status:i}=CP(),o={display:"inline",...r.description};return W.jsx(Oi.div,{ref:n,"data-status":i,...t,className:Rc("chakra-alert__desc",t.className),__css:o})});VW.displayName="AlertDescription";function GW(e){const{status:t}=CP(),n=zDe(t),r=EP(),i=t==="loading"?r.spinner:r.icon;return W.jsx(Oi.span,{display:"inherit","data-status":t,...e,className:Rc("chakra-alert__icon",e.className),__css:i,children:e.children||W.jsx(n,{h:"100%",w:"100%"})})}GW.displayName="AlertIcon";var qW=ia(function(t,n){const r=EP(),{status:i}=CP();return W.jsx(Oi.div,{ref:n,"data-status":i,...t,className:Rc("chakra-alert__title",t.className),__css:r.title})});qW.displayName="AlertTitle";var HW=ia(function(t,n){var r;const{status:i="info",addRole:o=!0,...a}=Ry(t),s=(r=t.colorScheme)!=null?r:BDe(i),l=HOe("Alert",{...t,colorScheme:s}),u={width:"100%",display:"flex",alignItems:"center",position:"relative",overflow:"hidden",...l.container};return W.jsx(LDe,{value:{status:i},children:W.jsx(FDe,{value:l,children:W.jsx(Oi.div,{"data-status":i,role:o?"alert":void 0,ref:n,...a,className:Rc("chakra-alert",t.className),__css:u})})})});HW.displayName="Alert";function jDe(e){return W.jsx(By,{focusable:"false","aria-hidden":!0,...e,children:W.jsx("path",{fill:"currentColor",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"})})}var WW=ia(function(t,n){const r=My("CloseButton",t),{children:i,isDisabled:o,__css:a,...s}=Ry(t),l={outline:0,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0};return W.jsx(Oi.button,{type:"button","aria-label":"Close",ref:n,disabled:o,__css:{...l,...r,...a},...s,children:i||W.jsx(jDe,{width:"1em",height:"1em"})})});WW.displayName="CloseButton";var UDe={top:[],"top-left":[],"top-right":[],"bottom-left":[],bottom:[],"bottom-right":[]},Ns=VDe(UDe);function VDe(e){let t=e;const n=new Set,r=i=>{t=i(t),n.forEach(o=>o())};return{getState:()=>t,subscribe:i=>(n.add(i),()=>{r(()=>e),n.delete(i)}),removeToast:(i,o)=>{r(a=>({...a,[o]:a[o].filter(s=>s.id!=i)}))},notify:(i,o)=>{const a=GDe(i,o),{position:s,id:l}=a;return r(u=>{var c,d;const h=s.includes("top")?[a,...(c=u[s])!=null?c:[]]:[...(d=u[s])!=null?d:[],a];return{...u,[s]:h}}),l},update:(i,o)=>{i&&r(a=>{const s={...a},{position:l,index:u}=ZM(s,i);return l&&u!==-1&&(s[l][u]={...s[l][u],...o,message:KW(o)}),s})},closeAll:({positions:i}={})=>{r(o=>(i??["bottom","bottom-right","bottom-left","top","top-left","top-right"]).reduce((l,u)=>(l[u]=o[u].map(c=>({...c,requestClose:!0})),l),{...o}))},close:i=>{r(o=>{const a=yH(o,i);return a?{...o,[a]:o[a].map(s=>s.id==i?{...s,requestClose:!0}:s)}:o})},isActive:i=>!!ZM(Ns.getState(),i).position}}var oN=0;function GDe(e,t={}){var n,r;oN+=1;const i=(n=t.id)!=null?n:oN,o=(r=t.position)!=null?r:"bottom";return{id:i,message:e,position:o,duration:t.duration,onCloseComplete:t.onCloseComplete,onRequestRemove:()=>Ns.removeToast(String(i),o),status:t.status,requestClose:!1,containerStyle:t.containerStyle}}var qDe=e=>{const{status:t,variant:n="solid",id:r,title:i,isClosable:o,onClose:a,description:s,colorScheme:l,icon:u}=e,c=r?{root:`toast-${r}`,title:`toast-${r}-title`,description:`toast-${r}-description`}:void 0;return W.jsxs(HW,{addRole:!1,status:t,variant:n,id:c==null?void 0:c.root,alignItems:"start",borderRadius:"md",boxShadow:"lg",paddingEnd:8,textAlign:"start",width:"auto",colorScheme:l,children:[W.jsx(GW,{children:u}),W.jsxs(Oi.div,{flex:"1",maxWidth:"100%",children:[i&&W.jsx(qW,{id:c==null?void 0:c.title,children:i}),s&&W.jsx(VW,{id:c==null?void 0:c.description,display:"block",children:s})]}),o&&W.jsx(WW,{size:"sm",onClick:a,position:"absolute",insetEnd:1,top:1})]})};function KW(e={}){const{render:t,toastComponent:n=qDe}=e;return i=>typeof t=="function"?t({...i,...e}):W.jsx(n,{...i,...e})}function HDe(e,t){const n=i=>{var o;return{...t,...i,position:MDe((o=i==null?void 0:i.position)!=null?o:t==null?void 0:t.position,e)}},r=i=>{const o=n(i),a=KW(o);return Ns.notify(a,o)};return r.update=(i,o)=>{Ns.update(i,n(o))},r.promise=(i,o)=>{const a=r({...o.loading,status:"loading",duration:null});i.then(s=>r.update(a,{status:"success",duration:5e3,...Ls(o.success,s)})).catch(s=>r.update(a,{status:"error",duration:5e3,...Ls(o.error,s)}))},r.closeAll=Ns.closeAll,r.close=Ns.close,r.isActive=Ns.isActive,r}var[ZKe,JKe]=Iy({name:"ToastOptionsContext",strict:!1}),WDe=e=>{const t=I.useSyncExternalStore(Ns.subscribe,Ns.getState,Ns.getState),{motionVariants:n,component:r=jW,portalProps:i}=e,a=Object.keys(t).map(s=>{const l=t[s];return W.jsx("div",{role:"region","aria-live":"polite","aria-label":"Notifications",id:`chakra-toast-manager-${s}`,style:hMe(s),children:W.jsx(zW,{initial:!1,children:l.map(u=>W.jsx(r,{motionVariants:n,...u},u.id))})},s)});return W.jsx(nw,{...i,children:a})},KDe={duration:5e3,variant:"solid"},Sf={theme:$Oe,colorMode:"light",toggleColorMode:()=>{},setColorMode:()=>{},defaultOptions:KDe,forced:!1};function QDe({theme:e=Sf.theme,colorMode:t=Sf.colorMode,toggleColorMode:n=Sf.toggleColorMode,setColorMode:r=Sf.setColorMode,defaultOptions:i=Sf.defaultOptions,motionVariants:o,toastSpacing:a,component:s,forced:l}=Sf){const u={colorMode:t,setColorMode:r,toggleColorMode:n,forced:l};return{ToastContainer:()=>W.jsx(uMe,{theme:e,children:W.jsx(WA.Provider,{value:u,children:W.jsx(WDe,{defaultOptions:i,motionVariants:o,toastSpacing:a,component:s})})}),toast:HDe(e.direction,i)}}var MT=ia(function(t,n){const{htmlWidth:r,htmlHeight:i,alt:o,...a}=t;return W.jsx("img",{width:r,height:i,ref:n,alt:o,...a})});MT.displayName="NativeImage";function XDe(e){const{loading:t,src:n,srcSet:r,onLoad:i,onError:o,crossOrigin:a,sizes:s,ignoreFallback:l}=e,[u,c]=I.useState("pending");I.useEffect(()=>{c(n?"loading":"pending")},[n]);const d=I.useRef(),f=I.useCallback(()=>{if(!n)return;h();const p=new Image;p.src=n,a&&(p.crossOrigin=a),r&&(p.srcset=r),s&&(p.sizes=s),t&&(p.loading=t),p.onload=m=>{h(),c("loaded"),i==null||i(m)},p.onerror=m=>{h(),c("failed"),o==null||o(m)},d.current=p},[n,a,r,s,i,o,t]),h=()=>{d.current&&(d.current.onload=null,d.current.onerror=null,d.current=null)};return G_(()=>{if(!l)return u==="loading"&&f(),()=>{h()}},[u,f,l]),l?"loaded":u}var YDe=(e,t)=>e!=="loaded"&&t==="beforeLoadOrError"||e==="failed"&&t==="onError";function ZDe(e,t=[]){const n=Object.assign({},e);for(const r of t)r in n&&delete n[r];return n}var TP=ia(function(t,n){const{fallbackSrc:r,fallback:i,src:o,srcSet:a,align:s,fit:l,loading:u,ignoreFallback:c,crossOrigin:d,fallbackStrategy:f="beforeLoadOrError",referrerPolicy:h,...p}=t,m=r!==void 0||i!==void 0,_=u!=null||c||!m,b=XDe({...t,crossOrigin:d,ignoreFallback:_}),y=YDe(b,f),g={ref:n,objectFit:l,objectPosition:s,..._?p:ZDe(p,["onError","onLoad"])};return y?i||W.jsx(Oi.img,{as:MT,className:"chakra-image__placeholder",src:r,...g}):W.jsx(Oi.img,{as:MT,src:o,srcSet:a,crossOrigin:d,loading:u,referrerPolicy:h,className:"chakra-image",...g})});TP.displayName="Image";var QW=ia(function(t,n){const r=My("Text",t),{className:i,align:o,decoration:a,casing:s,...l}=Ry(t),u=YOe({textAlign:t.align,textDecoration:t.decoration,textTransform:t.casing});return W.jsx(Oi.p,{ref:n,className:Rc("chakra-text",t.className),...u,...l,__css:r})});QW.displayName="Text";var NT=ia(function(t,n){const r=My("Heading",t),{className:i,...o}=Ry(t);return W.jsx(Oi.h2,{ref:n,className:Rc("chakra-heading",t.className),...o,__css:r})});NT.displayName="Heading";var oS=Oi("div");oS.displayName="Box";var XW=ia(function(t,n){const{size:r,centerContent:i=!0,...o}=t,a=i?{display:"flex",alignItems:"center",justifyContent:"center"}:{};return W.jsx(oS,{ref:n,boxSize:r,__css:{...a,flexShrink:0,flexGrow:0},...o})});XW.displayName="Square";var JDe=ia(function(t,n){const{size:r,...i}=t;return W.jsx(XW,{size:r,ref:n,borderRadius:"9999px",...i})});JDe.displayName="Circle";var kP=ia(function(t,n){const{direction:r,align:i,justify:o,wrap:a,basis:s,grow:l,shrink:u,...c}=t,d={display:"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:a,flexBasis:s,flexGrow:l,flexShrink:u};return W.jsx(Oi.div,{ref:n,__css:d,...c})});kP.displayName="Flex";const eLe=z.object({status:z.literal(422),data:z.object({detail:z.array(z.object({loc:z.array(z.string()),msg:z.string(),type:z.string()}))})});function yo(e,t,n=!1){e=String(e),t=String(t);const r=Array.from({length:21},(a,s)=>s*50),i=[0,5,10,15,20,25,30,35,40,45,50,55,59,64,68,73,77,82,86,95,100];return r.reduce((a,s,l)=>{const u=n?i[l]/100:1,c=n?50:i[r.length-1-l];return a[s]=`hsl(${e} ${t}% ${c}% / ${u})`,a},{})}const a1={H:220,S:16},s1={H:250,S:42},l1={H:47,S:42},u1={H:40,S:70},c1={H:28,S:42},d1={H:113,S:42},f1={H:0,S:42},tLe={base:yo(a1.H,a1.S),baseAlpha:yo(a1.H,a1.S,!0),accent:yo(s1.H,s1.S),accentAlpha:yo(s1.H,s1.S,!0),working:yo(l1.H,l1.S),workingAlpha:yo(l1.H,l1.S,!0),gold:yo(u1.H,u1.S),goldAlpha:yo(u1.H,u1.S,!0),warning:yo(c1.H,c1.S),warningAlpha:yo(c1.H,c1.S,!0),ok:yo(d1.H,d1.S),okAlpha:yo(d1.H,d1.S,!0),error:yo(f1.H,f1.S),errorAlpha:yo(f1.H,f1.S,!0)},{definePartsStyle:nLe,defineMultiStyleConfig:rLe}=Pt(Vq.keys),iLe={border:"none"},oLe=e=>{const{colorScheme:t}=e;return{fontWeight:"600",fontSize:"sm",border:"none",borderRadius:"base",bg:K(`${t}.200`,`${t}.700`)(e),color:K(`${t}.900`,`${t}.100`)(e),_hover:{bg:K(`${t}.250`,`${t}.650`)(e)},_expanded:{bg:K(`${t}.250`,`${t}.650`)(e),borderBottomRadius:"none",_hover:{bg:K(`${t}.300`,`${t}.600`)(e)}}}},aLe=e=>{const{colorScheme:t}=e;return{bg:K(`${t}.100`,`${t}.800`)(e),borderRadius:"base",borderTopRadius:"none"}},sLe={},lLe=nLe(e=>({container:iLe,button:oLe(e),panel:aLe(e),icon:sLe})),uLe=rLe({variants:{invokeAI:lLe},defaultProps:{variant:"invokeAI",colorScheme:"base"}}),cLe=e=>{const{colorScheme:t}=e;if(t==="base"){const r={bg:K("base.150","base.700")(e),color:K("base.300","base.500")(e),svg:{fill:K("base.300","base.500")(e)},opacity:1},i={bg:"none",color:K("base.300","base.500")(e),svg:{fill:K("base.500","base.500")(e)},opacity:1};return{bg:K("base.250","base.600")(e),color:K("base.850","base.100")(e),borderRadius:"base",svg:{fill:K("base.850","base.100")(e)},_hover:{bg:K("base.300","base.500")(e),color:K("base.900","base.50")(e),svg:{fill:K("base.900","base.50")(e)},_disabled:r},_disabled:r,'&[data-progress="true"]':{...i,_hover:i}}}const n={bg:K(`${t}.400`,`${t}.700`)(e),color:K(`${t}.600`,`${t}.500`)(e),svg:{fill:K(`${t}.600`,`${t}.500`)(e),filter:"unset"},opacity:.7,filter:"saturate(65%)"};return{bg:K(`${t}.400`,`${t}.600`)(e),color:K("base.50","base.100")(e),borderRadius:"base",svg:{fill:K("base.50","base.100")(e)},_disabled:n,_hover:{bg:K(`${t}.500`,`${t}.500`)(e),color:K("white","base.50")(e),svg:{fill:K("white","base.50")(e)},_disabled:n}}},dLe=e=>{const{colorScheme:t}=e,n=K("gray.200","whiteAlpha.300")(e);return{border:"1px solid",borderColor:t==="gray"?n:"currentColor",_hover:{bg:K(`${t}.500`,`${t}.500`)(e),color:K("white","base.50")(e),svg:{fill:K("white","base.50")(e)}},".chakra-button__group[data-attached][data-orientation=horizontal] > &:not(:last-of-type)":{marginEnd:"-1px"},".chakra-button__group[data-attached][data-orientation=vertical] > &:not(:last-of-type)":{marginBottom:"-1px"}}},fLe={variants:{invokeAI:cLe,invokeAIOutline:dLe},defaultProps:{variant:"invokeAI",colorScheme:"base"}},{definePartsStyle:hLe,defineMultiStyleConfig:pLe}=Pt(Gq.keys),gLe=e=>{const{colorScheme:t}=e;return{bg:K("base.200","base.700")(e),borderColor:K("base.300","base.600")(e),color:K("base.900","base.100")(e),_checked:{bg:K(`${t}.300`,`${t}.500`)(e),borderColor:K(`${t}.300`,`${t}.500`)(e),color:K(`${t}.900`,`${t}.100`)(e),_hover:{bg:K(`${t}.400`,`${t}.500`)(e),borderColor:K(`${t}.400`,`${t}.500`)(e)},_disabled:{borderColor:"transparent",bg:"whiteAlpha.300",color:"whiteAlpha.500"}},_indeterminate:{bg:K(`${t}.300`,`${t}.600`)(e),borderColor:K(`${t}.300`,`${t}.600`)(e),color:K(`${t}.900`,`${t}.100`)(e)},_disabled:{bg:"whiteAlpha.100",borderColor:"transparent"},_focusVisible:{boxShadow:"none",outline:"none"},_invalid:{borderColor:K("error.600","error.300")(e)}}},mLe=hLe(e=>({control:gLe(e)})),yLe=pLe({variants:{invokeAI:mLe},defaultProps:{variant:"invokeAI",colorScheme:"accent"}}),{definePartsStyle:vLe,defineMultiStyleConfig:bLe}=Pt(qq.keys),_Le={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal"},SLe=e=>({borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6},"::selection":{color:K("accent.900","accent.50")(e),bg:K("accent.200","accent.400")(e)}}),xLe={borderRadius:"md",py:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",_focusVisible:{boxShadow:"outline"},_placeholder:{opacity:.6}},wLe=vLe(e=>({preview:_Le,input:SLe(e),textarea:xLe})),CLe=bLe({variants:{invokeAI:wLe},defaultProps:{size:"sm",variant:"invokeAI"}}),ELe=e=>({fontSize:"sm",marginEnd:0,mb:1,fontWeight:"400",transitionProperty:"common",transitionDuration:"normal",whiteSpace:"nowrap",_disabled:{opacity:.4},color:K("base.700","base.300")(e),_invalid:{color:K("error.500","error.300")(e)}}),TLe={variants:{invokeAI:ELe},defaultProps:{variant:"invokeAI"}},gw=e=>({outline:"none",borderWidth:2,borderStyle:"solid",borderColor:K("base.200","base.800")(e),bg:K("base.50","base.900")(e),borderRadius:"base",color:K("base.900","base.100")(e),boxShadow:"none",_hover:{borderColor:K("base.300","base.600")(e)},_focus:{borderColor:K("accent.200","accent.600")(e),boxShadow:"none",_hover:{borderColor:K("accent.300","accent.500")(e)}},_invalid:{borderColor:K("error.300","error.600")(e),boxShadow:"none",_hover:{borderColor:K("error.400","error.500")(e)}},_disabled:{borderColor:K("base.300","base.700")(e),bg:K("base.300","base.700")(e),color:K("base.600","base.400")(e),_hover:{borderColor:K("base.300","base.700")(e)}},_placeholder:{color:K("base.700","base.400")(e)},"::selection":{bg:K("accent.200","accent.400")(e)}}),{definePartsStyle:kLe,defineMultiStyleConfig:ALe}=Pt(Hq.keys),PLe=kLe(e=>({field:gw(e)})),ILe=ALe({variants:{invokeAI:PLe},defaultProps:{size:"sm",variant:"invokeAI"}}),{definePartsStyle:RLe,defineMultiStyleConfig:OLe}=Pt(Wq.keys),MLe=RLe(e=>({button:{fontWeight:500,bg:K("base.300","base.500")(e),color:K("base.900","base.100")(e),_hover:{bg:K("base.400","base.600")(e),color:K("base.900","base.50")(e),fontWeight:600}},list:{zIndex:9999,color:K("base.900","base.150")(e),bg:K("base.200","base.800")(e),shadow:"dark-lg",border:"none"},item:{fontSize:"sm",bg:K("base.200","base.800")(e),_hover:{bg:K("base.300","base.700")(e),svg:{opacity:1}},_focus:{bg:K("base.400","base.600")(e)},svg:{opacity:.7,fontSize:14}}})),NLe=OLe({variants:{invokeAI:MLe},defaultProps:{variant:"invokeAI"}}),eQe={variants:{enter:{visibility:"visible",opacity:1,scale:1,transition:{duration:.07,ease:[.4,0,.2,1]}},exit:{transitionEnd:{visibility:"hidden"},opacity:0,scale:.8,transition:{duration:.07,easings:"easeOut"}}}},{defineMultiStyleConfig:$Le,definePartsStyle:DLe}=Pt(Kq.keys),LLe=e=>({bg:K("blackAlpha.700","blackAlpha.700")(e)}),FLe={},BLe=()=>({layerStyle:"first",maxH:"80vh"}),zLe=()=>({fontWeight:"600",fontSize:"lg",layerStyle:"first",borderTopRadius:"base",borderInlineEndRadius:"base"}),jLe={},ULe={overflowY:"scroll"},VLe={},GLe=DLe(e=>({overlay:LLe(e),dialogContainer:FLe,dialog:BLe(),header:zLe(),closeButton:jLe,body:ULe,footer:VLe})),qLe=$Le({variants:{invokeAI:GLe},defaultProps:{variant:"invokeAI",size:"lg"}}),{defineMultiStyleConfig:HLe,definePartsStyle:WLe}=Pt(Qq.keys),KLe=e=>({height:8}),QLe=e=>({border:"none",fontWeight:"600",height:"auto",py:1,ps:2,pe:6,...gw(e)}),XLe=e=>({display:"flex"}),YLe=e=>({border:"none",px:2,py:0,mx:-2,my:0,svg:{color:K("base.700","base.300")(e),width:2.5,height:2.5,_hover:{color:K("base.900","base.100")(e)}}}),ZLe=WLe(e=>({root:KLe(e),field:QLe(e),stepperGroup:XLe(e),stepper:YLe(e)})),JLe=HLe({variants:{invokeAI:ZLe},defaultProps:{size:"sm",variant:"invokeAI"}}),{defineMultiStyleConfig:eFe,definePartsStyle:YW}=Pt(Xq.keys),ZW=hr("popper-bg"),JW=hr("popper-arrow-bg"),eK=hr("popper-arrow-shadow-color"),tFe=e=>({[JW.variable]:K("colors.base.100","colors.base.800")(e),[ZW.variable]:K("colors.base.100","colors.base.800")(e),[eK.variable]:K("colors.base.400","colors.base.600")(e),minW:"unset",width:"unset",p:4,bg:K("base.100","base.800")(e),border:"none",shadow:"dark-lg"}),nFe=e=>({[JW.variable]:K("colors.base.100","colors.base.700")(e),[ZW.variable]:K("colors.base.100","colors.base.700")(e),[eK.variable]:K("colors.base.400","colors.base.400")(e),p:4,bg:K("base.100","base.700")(e),border:"none",shadow:"dark-lg"}),rFe=YW(e=>({content:tFe(e),body:{padding:0}})),iFe=YW(e=>({content:nFe(e),body:{padding:0}})),oFe=eFe({variants:{invokeAI:rFe,informational:iFe},defaultProps:{variant:"invokeAI"}}),{defineMultiStyleConfig:aFe,definePartsStyle:sFe}=Pt(Yq.keys),lFe=e=>({bg:"accentAlpha.700"}),uFe=e=>{const{colorScheme:t}=e;return{bg:K(`${t}.200`,`${t}.700`)(e)}},cFe=sFe(e=>({filledTrack:lFe(e),track:uFe(e)})),dFe=aFe({variants:{invokeAI:cFe},defaultProps:{variant:"invokeAI"}}),fFe={"::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"},{definePartsStyle:hFe,defineMultiStyleConfig:pFe}=Pt(Zq.keys),gFe=e=>({color:K("base.200","base.300")(e)}),mFe=e=>({fontWeight:"600",...gw(e)}),yFe=hFe(e=>({field:mFe(e),icon:gFe(e)})),vFe=pFe({variants:{invokeAI:yFe},defaultProps:{size:"sm",variant:"invokeAI"}}),aN=nt("skeleton-start-color"),sN=nt("skeleton-end-color"),bFe={borderRadius:"base",maxW:"full",maxH:"full",_light:{[aN.variable]:"colors.base.250",[sN.variable]:"colors.base.450"},_dark:{[aN.variable]:"colors.base.700",[sN.variable]:"colors.base.500"}},_Fe={variants:{invokeAI:bFe},defaultProps:{variant:"invokeAI"}},{definePartsStyle:SFe,defineMultiStyleConfig:xFe}=Pt(Jq.keys),wFe=e=>({bg:K("base.400","base.600")(e),h:1.5}),CFe=e=>{const{colorScheme:t}=e;return{bg:K(`${t}.400`,`${t}.600`)(e),h:1.5}},EFe=e=>({w:e.orientation==="horizontal"?2:4,h:e.orientation==="horizontal"?4:2,bg:K("base.50","base.100")(e)}),TFe=e=>({fontSize:"2xs",fontWeight:"500",color:K("base.700","base.400")(e),mt:2,insetInlineStart:"unset"}),kFe=SFe(e=>({container:{_disabled:{opacity:.6,cursor:"default",pointerEvents:"none"}},track:wFe(e),filledTrack:CFe(e),thumb:EFe(e),mark:TFe(e)})),AFe=xFe({variants:{invokeAI:kFe},defaultProps:{variant:"invokeAI",colorScheme:"accent"}}),{defineMultiStyleConfig:PFe,definePartsStyle:IFe}=Pt(eH.keys),RFe=e=>{const{colorScheme:t}=e;return{bg:K("base.300","base.600")(e),_focusVisible:{boxShadow:"none"},_checked:{bg:K(`${t}.400`,`${t}.500`)(e)}}},OFe=e=>{const{colorScheme:t}=e;return{bg:K(`${t}.50`,`${t}.50`)(e)}},MFe=IFe(e=>({container:{},track:RFe(e),thumb:OFe(e)})),NFe=PFe({variants:{invokeAI:MFe},defaultProps:{size:"md",variant:"invokeAI",colorScheme:"accent"}}),{defineMultiStyleConfig:$Fe,definePartsStyle:tK}=Pt(tH.keys),DFe=e=>({display:"flex",columnGap:4}),LFe=e=>({}),FFe=e=>{const{colorScheme:t}=e;return{display:"flex",flexDirection:"column",gap:1,color:K("base.700","base.400")(e),button:{fontSize:"sm",padding:2,borderRadius:"base",textShadow:K("0 0 0.3rem var(--invokeai-colors-accent-100)","0 0 0.3rem var(--invokeai-colors-accent-900)")(e),svg:{fill:K("base.700","base.300")(e)},_selected:{bg:K("accent.400","accent.600")(e),color:K("base.50","base.100")(e),svg:{fill:K("base.50","base.100")(e),filter:K(`drop-shadow(0px 0px 0.3rem var(--invokeai-colors-${t}-600))`,`drop-shadow(0px 0px 0.3rem var(--invokeai-colors-${t}-800))`)(e)},_hover:{bg:K("accent.500","accent.500")(e),color:K("white","base.50")(e),svg:{fill:K("white","base.50")(e)}}},_hover:{bg:K("base.100","base.800")(e),color:K("base.900","base.50")(e),svg:{fill:K("base.800","base.100")(e)}}}}},BFe=e=>({padding:0,height:"100%"}),zFe=tK(e=>({root:DFe(e),tab:LFe(e),tablist:FFe(e),tabpanel:BFe(e)})),jFe=tK(e=>({tab:{borderTopRadius:"base",px:4,py:1,fontSize:"sm",color:K("base.600","base.400")(e),fontWeight:500,_selected:{color:K("accent.600","accent.400")(e)}},tabpanel:{p:0,pt:4,w:"full",h:"full"},tabpanels:{w:"full",h:"full"}})),UFe=$Fe({variants:{line:jFe,appTabs:zFe},defaultProps:{variant:"appTabs",colorScheme:"accent"}}),VFe=e=>({color:K("base.500","base.400")(e)}),GFe={variants:{subtext:VFe}},qFe=e=>({...gw(e),"::-webkit-scrollbar":{display:"initial"},"::-webkit-resizer":{backgroundImage:`linear-gradient(135deg,
|
||
var(--invokeai-colors-base-50) 0%,
|
||
var(--invokeai-colors-base-50) 70%,
|
||
var(--invokeai-colors-base-200) 70%,
|
||
var(--invokeai-colors-base-200) 100%)`},_disabled:{"::-webkit-resizer":{backgroundImage:`linear-gradient(135deg,
|
||
var(--invokeai-colors-base-50) 0%,
|
||
var(--invokeai-colors-base-50) 70%,
|
||
var(--invokeai-colors-base-200) 70%,
|
||
var(--invokeai-colors-base-200) 100%)`}},_dark:{"::-webkit-resizer":{backgroundImage:`linear-gradient(135deg,
|
||
var(--invokeai-colors-base-900) 0%,
|
||
var(--invokeai-colors-base-900) 70%,
|
||
var(--invokeai-colors-base-800) 70%,
|
||
var(--invokeai-colors-base-800) 100%)`},_disabled:{"::-webkit-resizer":{backgroundImage:`linear-gradient(135deg,
|
||
var(--invokeai-colors-base-900) 0%,
|
||
var(--invokeai-colors-base-900) 70%,
|
||
var(--invokeai-colors-base-800) 70%,
|
||
var(--invokeai-colors-base-800) 100%)`}}},p:2}),HFe={variants:{invokeAI:qFe},defaultProps:{size:"md",variant:"invokeAI"}},WFe=hr("popper-arrow-bg"),KFe=e=>({borderRadius:"base",shadow:"dark-lg",bg:K("base.700","base.200")(e),[WFe.variable]:K("colors.base.700","colors.base.200")(e),pb:1.5}),QFe={baseStyle:KFe},lN={backgroundColor:"accentAlpha.150 !important",borderColor:"accentAlpha.700 !important",borderRadius:"base !important",borderStyle:"dashed !important",_dark:{borderColor:"accent.400 !important"}},XFe={".react-flow__nodesselection-rect":{...lN,padding:"1rem !important",boxSizing:"content-box !important",transform:"translate(-1rem, -1rem) !important"},".react-flow__selection":lN},YFe={config:{cssVarPrefix:"invokeai",initialColorMode:"dark",useSystemColorMode:!1},layerStyles:{body:{bg:"base.50",color:"base.900",".chakra-ui-dark &":{bg:"base.900",color:"base.50"}},first:{bg:"base.100",color:"base.900",".chakra-ui-dark &":{bg:"base.850",color:"base.100"}},second:{bg:"base.200",color:"base.900",".chakra-ui-dark &":{bg:"base.800",color:"base.100"}},third:{bg:"base.300",color:"base.900",".chakra-ui-dark &":{bg:"base.750",color:"base.100"}},nodeBody:{bg:"base.100",color:"base.900",".chakra-ui-dark &":{bg:"base.800",color:"base.100"}},nodeHeader:{bg:"base.200",color:"base.900",".chakra-ui-dark &":{bg:"base.900",color:"base.100"}},nodeFooter:{bg:"base.200",color:"base.900",".chakra-ui-dark &":{bg:"base.900",color:"base.100"}}},styles:{global:()=>({layerStyle:"body","*":{...fFe},...XFe})},direction:"ltr",fonts:{body:"'Inter Variable', sans-serif",heading:"'Inter Variable', sans-serif"},shadows:{light:{accent:"0 0 10px 0 var(--invokeai-colors-accent-300)",accentHover:"0 0 10px 0 var(--invokeai-colors-accent-400)",ok:"0 0 7px var(--invokeai-colors-ok-600)",working:"0 0 7px var(--invokeai-colors-working-600)",error:"0 0 7px var(--invokeai-colors-error-600)"},dark:{accent:"0 0 10px 0 var(--invokeai-colors-accent-600)",accentHover:"0 0 10px 0 var(--invokeai-colors-accent-500)",ok:"0 0 7px var(--invokeai-colors-ok-400)",working:"0 0 7px var(--invokeai-colors-working-400)",error:"0 0 7px var(--invokeai-colors-error-400)"},selected:{light:"0px 0px 0px 1px var(--invokeai-colors-base-150), 0px 0px 0px 4px var(--invokeai-colors-accent-400)",dark:"0px 0px 0px 1px var(--invokeai-colors-base-900), 0px 0px 0px 4px var(--invokeai-colors-accent-500)"},hoverSelected:{light:"0px 0px 0px 1px var(--invokeai-colors-base-150), 0px 0px 0px 4px var(--invokeai-colors-accent-500)",dark:"0px 0px 0px 1px var(--invokeai-colors-base-900), 0px 0px 0px 4px var(--invokeai-colors-accent-400)"},hoverUnselected:{light:"0px 0px 0px 1px var(--invokeai-colors-base-150), 0px 0px 0px 3px var(--invokeai-colors-accent-500)",dark:"0px 0px 0px 1px var(--invokeai-colors-base-900), 0px 0px 0px 3px var(--invokeai-colors-accent-400)"},nodeSelected:{light:"0 0 0 3px var(--invokeai-colors-accent-400)",dark:"0 0 0 3px var(--invokeai-colors-accent-500)"},nodeHovered:{light:"0 0 0 2px var(--invokeai-colors-accent-500)",dark:"0 0 0 2px var(--invokeai-colors-accent-400)"},nodeHoveredSelected:{light:"0 0 0 3px var(--invokeai-colors-accent-500)",dark:"0 0 0 3px var(--invokeai-colors-accent-400)"},nodeInProgress:{light:"0 0 0 2px var(--invokeai-colors-accent-500), 0 0 10px 2px var(--invokeai-colors-accent-600)",dark:"0 0 0 2px var(--invokeai-colors-yellow-400), 0 0 20px 2px var(--invokeai-colors-orange-700)"}},colors:tLe,components:{Button:fLe,Input:ILe,Editable:CLe,Textarea:HFe,Tabs:UFe,Progress:dFe,Accordion:uLe,FormLabel:TLe,Switch:NFe,NumberInput:JLe,Select:vFe,Skeleton:_Fe,Slider:AFe,Popover:oFe,Modal:qLe,Checkbox:yLe,Menu:NLe,Text:GFe,Tooltip:QFe}},ZFe={defaultOptions:{isClosable:!0}},{toast:dg}=QDe({theme:YFe,defaultOptions:ZFe.defaultOptions}),JFe=()=>{Fe({matcher:Xr.endpoints.enqueueBatch.matchFulfilled,effect:async e=>{const t=e.payload,n=e.meta.arg.originalArgs;_e("queue").debug({enqueueResult:Xt(t)},"Batch enqueued"),dg.isActive("batch-queued")||dg({id:"batch-queued",title:Y("queue.batchQueued"),description:Y("queue.batchQueuedDesc",{item_count:t.enqueued,direction:n.prepend?Y("queue.front"):Y("queue.back")}),duration:1e3,status:"success"})}}),Fe({matcher:Xr.endpoints.enqueueBatch.matchRejected,effect:async e=>{const t=e.payload,n=e.meta.arg.originalArgs;if(!t){dg({title:Y("queue.batchFailedToQueue"),status:"error",description:"Unknown Error"}),_e("queue").error({batchConfig:Xt(n),error:Xt(t)},Y("queue.batchFailedToQueue"));return}const r=eLe.safeParse(t);if(r.success)r.data.data.detail.map(i=>{dg({id:"batch-failed-to-queue",title:Y8(SF(i.msg),{length:128}),status:"error",description:Y8(`Path:
|
||
${i.loc.join(".")}`,{length:128})})});else{let i="Unknown Error",o;t.status===403&&"body"in t?i=ch(t,"body.detail","Unknown Error"):t.status===403&&"error"in t?i=ch(t,"error.detail","Unknown Error"):t.status===403&&"data"in t&&(i=ch(t,"data.detail","Unknown Error"),o=15e3),dg({title:Y("queue.batchFailedToQueue"),status:"error",description:i,...o?{duration:o}:{}})}_e("queue").error({batchConfig:Xt(n),error:Xt(t)},Y("queue.batchFailedToQueue"))}})},nK=UL(),Fe=nK.startListening;WEe();KEe();JEe();FEe();BEe();zEe();jEe();UEe();Nxe();HEe();QEe();XEe();SEe();$Ee();TEe();Pxe();JFe();tEe();Y3e();Xxe();Z3e();Qxe();Wxe();eEe();A4e();Txe();m4e();y4e();b4e();_4e();x4e();p4e();g4e();T4e();k4e();w4e();E4e();S4e();C4e();oEe();rEe();DEe();LEe();GEe();qEe();$xe();h4e();ake();VEe();eTe();Oxe();nTe();Ixe();kxe();J4e();I4e();oTe();const eBe={canvas:gle,gallery:R0e,generation:rle,nodes:f2e,postprocessing:h2e,system:_2e,config:$ae,ui:P2e,hotkeys:A2e,controlNet:_0e,dynamicPrompts:I0e,deleteImageModal:w0e,changeBoardModal:yle,lora:N0e,modelmanager:k2e,sdxl:g2e,queue:E2e,[us.reducerPath]:us.reducer},tBe=pp(eBe),nBe=exe(tBe),rBe=["canvas","gallery","generation","sdxl","nodes","postprocessing","system","ui","controlNet","dynamicPrompts","lora","modelmanager"],rK=xL({reducer:nBe,enhancers:e=>e.concat(txe(window.localStorage,rBe,{persistDebounce:300,serialize:hxe,unserialize:gxe,prefix:nxe})).concat(GL()),middleware:e=>e({serializableCheck:!1,immutableCheck:!1}).concat(us.middleware).concat(M2e).prepend(nK.middleware),devTools:{actionSanitizer:Sxe,stateSanitizer:wxe,trace:!0,predicate:(e,t)=>!xxe.includes(t.type)}}),iK=e=>e;MB.set(rK);const iBe=e=>{const{socket:t,storeApi:n}=e,{dispatch:r}=n;t.on("connect",()=>{_e("socketio").debug("Connected"),r(jj());const o=Vr.get();t.emit("subscribe_queue",{queue_id:o})}),t.on("connect_error",i=>{i&&i.message&&i.data==="ERR_UNAUTHENTICATED"&&r(qt(Ld({title:i.message,status:"error",duration:1e4})))}),t.on("disconnect",()=>{r(Uj())}),t.on("invocation_started",i=>{r(Gj({data:i}))}),t.on("generator_progress",i=>{r(Kj({data:i}))}),t.on("invocation_error",i=>{r(qj({data:i}))}),t.on("invocation_complete",i=>{r(qk({data:i}))}),t.on("graph_execution_state_complete",i=>{r(Hj({data:i}))}),t.on("model_load_started",i=>{r(Qj({data:i}))}),t.on("model_load_completed",i=>{r(Yj({data:i}))}),t.on("session_retrieval_error",i=>{r(Jj({data:i}))}),t.on("invocation_retrieval_error",i=>{r(tU({data:i}))}),t.on("queue_item_status_changed",i=>{r(rU({data:i}))})},Js=Object.create(null);Js.open="0";Js.close="1";Js.ping="2";Js.pong="3";Js.message="4";Js.upgrade="5";Js.noop="6";const sb=Object.create(null);Object.keys(Js).forEach(e=>{sb[Js[e]]=e});const $T={type:"error",data:"parser error"},oK=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",aK=typeof ArrayBuffer=="function",sK=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,AP=({type:e,data:t},n,r)=>oK&&t instanceof Blob?n?r(t):uN(t,r):aK&&(t instanceof ArrayBuffer||sK(t))?n?r(t):uN(new Blob([t]),r):r(Js[e]+(t||"")),uN=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function cN(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let F5;function oBe(e,t){if(oK&&e.data instanceof Blob)return e.data.arrayBuffer().then(cN).then(t);if(aK&&(e.data instanceof ArrayBuffer||sK(e.data)))return t(cN(e.data));AP(e,!1,n=>{F5||(F5=new TextEncoder),t(F5.encode(n))})}const dN="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Og=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<dN.length;e++)Og[dN.charCodeAt(e)]=e;const aBe=e=>{let t=e.length*.75,n=e.length,r,i=0,o,a,s,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),c=new Uint8Array(u);for(r=0;r<n;r+=4)o=Og[e.charCodeAt(r)],a=Og[e.charCodeAt(r+1)],s=Og[e.charCodeAt(r+2)],l=Og[e.charCodeAt(r+3)],c[i++]=o<<2|a>>4,c[i++]=(a&15)<<4|s>>2,c[i++]=(s&3)<<6|l&63;return u},sBe=typeof ArrayBuffer=="function",PP=(e,t)=>{if(typeof e!="string")return{type:"message",data:lK(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:lBe(e.substring(1),t)}:sb[n]?e.length>1?{type:sb[n],data:e.substring(1)}:{type:sb[n]}:$T},lBe=(e,t)=>{if(sBe){const n=aBe(e);return lK(n,t)}else return{base64:!0,data:e}},lK=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},uK=String.fromCharCode(30),uBe=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,a)=>{AP(o,!1,s=>{r[a]=s,++i===n&&t(r.join(uK))})})},cBe=(e,t)=>{const n=e.split(uK),r=[];for(let i=0;i<n.length;i++){const o=PP(n[i],t);if(r.push(o),o.type==="error")break}return r};function dBe(){return new TransformStream({transform(e,t){oBe(e,n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,r)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(i[0]|=128),t.enqueue(i),t.enqueue(n)})}})}let B5;function h1(e){return e.reduce((t,n)=>t+n.length,0)}function p1(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function fBe(e,t){B5||(B5=new TextDecoder);const n=[];let r=0,i=-1,o=!1;return new TransformStream({transform(a,s){for(n.push(a);;){if(r===0){if(h1(n)<1)break;const l=p1(n,1);o=(l[0]&128)===128,i=l[0]&127,i<126?r=3:i===126?r=1:r=2}else if(r===1){if(h1(n)<2)break;const l=p1(n,2);i=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(h1(n)<8)break;const l=p1(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),c=u.getUint32(0);if(c>Math.pow(2,53-32)-1){s.enqueue($T);break}i=c*Math.pow(2,32)+u.getUint32(4),r=3}else{if(h1(n)<i)break;const l=p1(n,i);s.enqueue(PP(o?l:B5.decode(l),t)),r=0}if(i===0||i>e){s.enqueue($T);break}}}})}const cK=4;function Fr(e){if(e)return hBe(e)}function hBe(e){for(var t in Fr.prototype)e[t]=Fr.prototype[t];return e}Fr.prototype.on=Fr.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};Fr.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};Fr.prototype.off=Fr.prototype.removeListener=Fr.prototype.removeAllListeners=Fr.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};Fr.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};Fr.prototype.emitReserved=Fr.prototype.emit;Fr.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Fr.prototype.hasListeners=function(e){return!!this.listeners(e).length};const ya=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())();function dK(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const pBe=ya.setTimeout,gBe=ya.clearTimeout;function mw(e,t){t.useNativeTimers?(e.setTimeoutFn=pBe.bind(ya),e.clearTimeoutFn=gBe.bind(ya)):(e.setTimeoutFn=ya.setTimeout.bind(ya),e.clearTimeoutFn=ya.clearTimeout.bind(ya))}const mBe=1.33;function yBe(e){return typeof e=="string"?vBe(e):Math.ceil((e.byteLength||e.size)*mBe)}function vBe(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function bBe(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function _Be(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}class SBe extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class IP extends Fr{constructor(t){super(),this.writable=!1,mw(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new SBe(t,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(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=PP(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=bBe(t);return n.length?"?"+n:""}}const fK="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),DT=64,xBe={};let fN=0,g1=0,hN;function pN(e){let t="";do t=fK[e%DT]+t,e=Math.floor(e/DT);while(e>0);return t}function hK(){const e=pN(+new Date);return e!==hN?(fN=0,hN=e):e+"."+pN(fN++)}for(;g1<DT;g1++)xBe[fK[g1]]=g1;let pK=!1;try{pK=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const wBe=pK;function gK(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||wBe))return new XMLHttpRequest}catch{}if(!t)try{return new ya[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function CBe(){}const EBe=function(){return new gK({xdomain:!1}).responseType!=null}();class TBe extends IP{constructor(t){if(super(t),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"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=EBe&&!n,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};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(t){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)};cBe(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,uBe(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=hK()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Th(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}let Th=class lb extends Fr{constructor(t,n){super(),mw(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=dK(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new gK(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=lb.requestsCount++,lb.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=CBe,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete lb.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};Th.requestsCount=0;Th.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",gN);else if(typeof addEventListener=="function"){const e="onpagehide"in ya?"pagehide":"unload";addEventListener(e,gN,!1)}}function gN(){for(let e in Th.requests)Th.requests.hasOwnProperty(e)&&Th.requests[e].abort()}const RP=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),m1=ya.WebSocket||ya.MozWebSocket,mN=!0,kBe="arraybuffer",yN=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ABe extends IP{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=yN?{}:dK(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=mN&&!yN?n?new m1(t,n):new m1(t):new m1(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;AP(r,this.supportsBinary,o=>{const a={};try{mN&&this.ws.send(o)}catch{}i&&RP(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=hK()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!m1}}class PBe extends IP{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=fBe(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=dBe();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const o=()=>{r.read().then(({done:s,value:l})=>{s||(this.onPacket(l),o())}).catch(s=>{})};o();const a={type:"open"};this.query.sid&&(a.data=`{"sid":"${this.query.sid}"}`),this.writer.write(a).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this.writer.write(r).then(()=>{i&&RP(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}const IBe={websocket:ABe,webtransport:PBe,polling:TBe},RBe=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,OBe=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function LT(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=RBe.exec(e||""),o={},a=14;for(;a--;)o[OBe[a]]=i[a]||"";return n!=-1&&r!=-1&&(o.source=t,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=MBe(o,o.path),o.queryKey=NBe(o,o.query),o}function MBe(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function NBe(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}let mK=class kf extends Fr{constructor(t,n={}){super(),this.binaryType=kBe,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=LT(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=LT(n.host).host),mw(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","webtransport"],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:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=_Be(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(t){const n=Object.assign({},this.opts.query);n.EIO=cK,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new IBe[t](r)}open(){let t;if(this.opts.rememberUpgrade&&kf.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch{this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.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(t){let n=this.createTransport(t),r=!1;kf.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;kf.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function o(){r||(r=!0,c(),n.close(),n=null)}const a=d=>{const f=new Error("probe error: "+d);f.transport=n.name,o(),this.emitReserved("upgradeError",f)};function s(){a("transport closed")}function l(){a("socket closed")}function u(d){n&&d.name!==n.name&&o()}const c=()=>{n.removeListener("open",i),n.removeListener("error",a),n.removeListener("close",s),this.off("close",l),this.off("upgrading",u)};n.once("open",i),n.once("error",a),n.once("close",s),this.once("close",l),this.once("upgrading",u),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(this.readyState="open",kf.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.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 t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.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+=yBe(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,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 o={type:t,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},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():t()}):this.upgrading?r():t()),this}onError(t){kf.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,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",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};mK.protocol=cK;function $Be(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=LT(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+t,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const DBe=typeof ArrayBuffer=="function",LBe=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,yK=Object.prototype.toString,FBe=typeof Blob=="function"||typeof Blob<"u"&&yK.call(Blob)==="[object BlobConstructor]",BBe=typeof File=="function"||typeof File<"u"&&yK.call(File)==="[object FileConstructor]";function OP(e){return DBe&&(e instanceof ArrayBuffer||LBe(e))||FBe&&e instanceof Blob||BBe&&e instanceof File}function ub(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(ub(e[n]))return!0;return!1}if(OP(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return ub(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&ub(e[n]))return!0;return!1}function zBe(e){const t=[],n=e.data,r=e;return r.data=FT(n,t),r.attachments=t.length,{packet:r,buffers:t}}function FT(e,t){if(!e)return e;if(OP(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=FT(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=FT(e[r],t));return n}return e}function jBe(e,t){return e.data=BT(e.data,t),delete e.attachments,e}function BT(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=BT(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=BT(e[n],t));return e}const UBe=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],VBe=5;var Bt;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Bt||(Bt={}));class GBe{constructor(t){this.replacer=t}encode(t){return(t.type===Bt.EVENT||t.type===Bt.ACK)&&ub(t)?this.encodeAsBinary({type:t.type===Bt.EVENT?Bt.BINARY_EVENT:Bt.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Bt.BINARY_EVENT||t.type===Bt.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=zBe(t),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}function vN(e){return Object.prototype.toString.call(e)==="[object Object]"}class MP extends Fr{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===Bt.BINARY_EVENT;r||n.type===Bt.BINARY_ACK?(n.type=r?Bt.EVENT:Bt.ACK,this.reconstructor=new qBe(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(OP(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),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: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(Bt[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===Bt.BINARY_EVENT||r.type===Bt.BINARY_ACK){const o=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const a=t.substring(o,n);if(a!=Number(a)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(a)}if(t.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(o,n)}else r.nsp="/";const i=t.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const a=t.charAt(n);if(a==null||Number(a)!=a){--n;break}if(n===t.length)break}r.id=Number(t.substring(o,n+1))}if(t.charAt(++n)){const o=this.tryParse(t.substr(n));if(MP.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Bt.CONNECT:return vN(n);case Bt.DISCONNECT:return n===void 0;case Bt.CONNECT_ERROR:return typeof n=="string"||vN(n);case Bt.EVENT:case Bt.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&UBe.indexOf(n[0])===-1);case Bt.ACK:case Bt.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class qBe{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=jBe(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const HBe=Object.freeze(Object.defineProperty({__proto__:null,Decoder:MP,Encoder:GBe,get PacketType(){return Bt},protocol:VBe},Symbol.toStringTag,{value:"Module"}));function qa(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const WBe=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class vK extends Fr{constructor(t,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=t,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 t=this.io;this.subs=[qa(t,"open",this.onopen.bind(this)),qa(t,"packet",this.onpacket.bind(this)),qa(t,"error",this.onerror.bind(this)),qa(t,"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(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(WBe.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:Bt.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const a=this.ids++,s=n.pop();this._registerAckCallback(a,s),r.id=a}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(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const o=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...a)=>{this.io.clearTimeoutFn(o),n.apply(this,[null,...a])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,o)=>{n.push((a,s)=>r?a?o(a):i(s):i(a)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...o)=>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,...o)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Bt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Bt.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.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 Bt.EVENT:case Bt.BINARY_EVENT:this.onevent(t);break;case Bt.ACK:case Bt.BINARY_ACK:this.onack(t);break;case Bt.DISCONNECT:this.ondisconnect();break;case Bt.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:Bt.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(n.apply(this,t.data),delete this.acks[t.id])}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Bt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Rp(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Rp.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Rp.prototype.reset=function(){this.attempts=0};Rp.prototype.setMin=function(e){this.ms=e};Rp.prototype.setMax=function(e){this.max=e};Rp.prototype.setJitter=function(e){this.jitter=e};class zT extends Fr{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,mw(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 Rp({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||HBe;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new mK(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=qa(n,"open",function(){r.onopen(),t&&t()}),o=s=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",s),t?t(s):this.maybeReconnectOnOpen()},a=qa(n,"error",o);if(this._timeout!==!1){const s=this._timeout,l=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),n.close()},s);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(a),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(qa(t,"ping",this.onping.bind(this)),qa(t,"data",this.ondata.bind(this)),qa(t,"error",this.onerror.bind(this)),qa(t,"close",this.onclose.bind(this)),qa(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){RP(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new vK(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),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(t,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=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(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const fg={};function cb(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=$Be(e,t.path||"/socket.io"),r=n.source,i=n.id,o=n.path,a=fg[i]&&o in fg[i].nsps,s=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return s?l=new zT(r,t):(fg[i]||(fg[i]=new zT(r,t)),l=fg[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(cb,{Manager:zT,Socket:vK,io:cb,connect:cb});const bN=()=>{let e=!1,n=`${window.location.protocol==="https:"?"wss":"ws"}://${window.location.host}`;const r={timeout:6e4,path:"/ws/socket.io",autoConnect:!1};if(["nodes","package"].includes("production")){const a=s0.get();a&&(n=a.replace(/^https?\:\/\//i,""));const s=Jh.get();s&&(r.auth={token:s}),r.transports=["websocket","polling"]}const i=cb(n,r);return a=>s=>l=>{e||(iBe({storeApi:a,socket:i}),e=!0,i.connect()),s(l)}},KBe=""+new URL("logo-13003d72.png",import.meta.url).href,QBe=()=>W.jsxs(kP,{position:"relative",width:"100vw",height:"100vh",alignItems:"center",justifyContent:"center",bg:"#151519",children:[W.jsx(TP,{src:KBe,w:"8rem",h:"8rem"}),W.jsx(wP,{label:"Loading",color:"grey",position:"absolute",size:"sm",width:"24px !important",height:"24px !important",right:"1.5rem",bottom:"1.5rem"})]}),XBe=I.memo(QBe);function jT(e){"@babel/helpers - typeof";return jT=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jT(e)}var bK=[],YBe=bK.forEach,ZBe=bK.slice;function UT(e){return YBe.call(ZBe.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function _K(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":jT(XMLHttpRequest))==="object"}function JBe(e){return!!e&&typeof e.then=="function"}function eze(e){return JBe(e)?e:Promise.resolve(e)}function tze(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var VT={exports:{}},y1={exports:{}},_N;function nze(){return _N||(_N=1,function(e,t){var n=typeof self<"u"?self:yt,r=function(){function o(){this.fetch=!1,this.DOMException=n.DOMException}return o.prototype=n,new o}();(function(o){(function(a){var s={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function l(E){return E&&DataView.prototype.isPrototypeOf(E)}if(s.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(E){return E&&u.indexOf(Object.prototype.toString.call(E))>-1};function d(E){if(typeof E!="string"&&(E=String(E)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(E))throw new TypeError("Invalid character in header field name");return E.toLowerCase()}function f(E){return typeof E!="string"&&(E=String(E)),E}function h(E){var A={next:function(){var D=E.shift();return{done:D===void 0,value:D}}};return s.iterable&&(A[Symbol.iterator]=function(){return A}),A}function p(E){this.map={},E instanceof p?E.forEach(function(A,D){this.append(D,A)},this):Array.isArray(E)?E.forEach(function(A){this.append(A[0],A[1])},this):E&&Object.getOwnPropertyNames(E).forEach(function(A){this.append(A,E[A])},this)}p.prototype.append=function(E,A){E=d(E),A=f(A);var D=this.map[E];this.map[E]=D?D+", "+A:A},p.prototype.delete=function(E){delete this.map[d(E)]},p.prototype.get=function(E){return E=d(E),this.has(E)?this.map[E]:null},p.prototype.has=function(E){return this.map.hasOwnProperty(d(E))},p.prototype.set=function(E,A){this.map[d(E)]=f(A)},p.prototype.forEach=function(E,A){for(var D in this.map)this.map.hasOwnProperty(D)&&E.call(A,this.map[D],D,this)},p.prototype.keys=function(){var E=[];return this.forEach(function(A,D){E.push(D)}),h(E)},p.prototype.values=function(){var E=[];return this.forEach(function(A){E.push(A)}),h(E)},p.prototype.entries=function(){var E=[];return this.forEach(function(A,D){E.push([D,A])}),h(E)},s.iterable&&(p.prototype[Symbol.iterator]=p.prototype.entries);function m(E){if(E.bodyUsed)return Promise.reject(new TypeError("Already read"));E.bodyUsed=!0}function _(E){return new Promise(function(A,D){E.onload=function(){A(E.result)},E.onerror=function(){D(E.error)}})}function b(E){var A=new FileReader,D=_(A);return A.readAsArrayBuffer(E),D}function y(E){var A=new FileReader,D=_(A);return A.readAsText(E),D}function g(E){for(var A=new Uint8Array(E),D=new Array(A.length),L=0;L<A.length;L++)D[L]=String.fromCharCode(A[L]);return D.join("")}function v(E){if(E.slice)return E.slice(0);var A=new Uint8Array(E.byteLength);return A.set(new Uint8Array(E)),A.buffer}function S(){return this.bodyUsed=!1,this._initBody=function(E){this._bodyInit=E,E?typeof E=="string"?this._bodyText=E:s.blob&&Blob.prototype.isPrototypeOf(E)?this._bodyBlob=E:s.formData&&FormData.prototype.isPrototypeOf(E)?this._bodyFormData=E:s.searchParams&&URLSearchParams.prototype.isPrototypeOf(E)?this._bodyText=E.toString():s.arrayBuffer&&s.blob&&l(E)?(this._bodyArrayBuffer=v(E.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(E)||c(E))?this._bodyArrayBuffer=v(E):this._bodyText=E=Object.prototype.toString.call(E):this._bodyText="",this.headers.get("content-type")||(typeof E=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):s.searchParams&&URLSearchParams.prototype.isPrototypeOf(E)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s.blob&&(this.blob=function(){var E=m(this);if(E)return E;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?m(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(b)}),this.text=function(){var E=m(this);if(E)return E;if(this._bodyBlob)return y(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(g(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s.formData&&(this.formData=function(){return this.text().then(k)}),this.json=function(){return this.text().then(JSON.parse)},this}var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function x(E){var A=E.toUpperCase();return w.indexOf(A)>-1?A:E}function C(E,A){A=A||{};var D=A.body;if(E instanceof C){if(E.bodyUsed)throw new TypeError("Already read");this.url=E.url,this.credentials=E.credentials,A.headers||(this.headers=new p(E.headers)),this.method=E.method,this.mode=E.mode,this.signal=E.signal,!D&&E._bodyInit!=null&&(D=E._bodyInit,E.bodyUsed=!0)}else this.url=String(E);if(this.credentials=A.credentials||this.credentials||"same-origin",(A.headers||!this.headers)&&(this.headers=new p(A.headers)),this.method=x(A.method||this.method||"GET"),this.mode=A.mode||this.mode||null,this.signal=A.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&D)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(D)}C.prototype.clone=function(){return new C(this,{body:this._bodyInit})};function k(E){var A=new FormData;return E.trim().split("&").forEach(function(D){if(D){var L=D.split("="),M=L.shift().replace(/\+/g," "),R=L.join("=").replace(/\+/g," ");A.append(decodeURIComponent(M),decodeURIComponent(R))}}),A}function T(E){var A=new p,D=E.replace(/\r?\n[\t ]+/g," ");return D.split(/\r?\n/).forEach(function(L){var M=L.split(":"),R=M.shift().trim();if(R){var N=M.join(":").trim();A.append(R,N)}}),A}S.call(C.prototype);function P(E,A){A||(A={}),this.type="default",this.status=A.status===void 0?200:A.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in A?A.statusText:"OK",this.headers=new p(A.headers),this.url=A.url||"",this._initBody(E)}S.call(P.prototype),P.prototype.clone=function(){return new P(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},P.error=function(){var E=new P(null,{status:0,statusText:""});return E.type="error",E};var $=[301,302,303,307,308];P.redirect=function(E,A){if($.indexOf(A)===-1)throw new RangeError("Invalid status code");return new P(null,{status:A,headers:{location:E}})},a.DOMException=o.DOMException;try{new a.DOMException}catch{a.DOMException=function(A,D){this.message=A,this.name=D;var L=Error(A);this.stack=L.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function O(E,A){return new Promise(function(D,L){var M=new C(E,A);if(M.signal&&M.signal.aborted)return L(new a.DOMException("Aborted","AbortError"));var R=new XMLHttpRequest;function N(){R.abort()}R.onload=function(){var B={status:R.status,statusText:R.statusText,headers:T(R.getAllResponseHeaders()||"")};B.url="responseURL"in R?R.responseURL:B.headers.get("X-Request-URL");var U="response"in R?R.response:R.responseText;D(new P(U,B))},R.onerror=function(){L(new TypeError("Network request failed"))},R.ontimeout=function(){L(new TypeError("Network request failed"))},R.onabort=function(){L(new a.DOMException("Aborted","AbortError"))},R.open(M.method,M.url,!0),M.credentials==="include"?R.withCredentials=!0:M.credentials==="omit"&&(R.withCredentials=!1),"responseType"in R&&s.blob&&(R.responseType="blob"),M.headers.forEach(function(B,U){R.setRequestHeader(U,B)}),M.signal&&(M.signal.addEventListener("abort",N),R.onreadystatechange=function(){R.readyState===4&&M.signal.removeEventListener("abort",N)}),R.send(typeof M._bodyInit>"u"?null:M._bodyInit)})}return O.polyfill=!0,o.fetch||(o.fetch=O,o.Headers=p,o.Request=C,o.Response=P),a.Headers=p,a.Request=C,a.Response=P,a.fetch=O,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(y1,y1.exports)),y1.exports}(function(e,t){var n;if(typeof fetch=="function"&&(typeof yt<"u"&&yt.fetch?n=yt.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof tze<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||nze();r.default&&(r=r.default),t.default=r,e.exports=t.default}})(VT,VT.exports);var SK=VT.exports;const xK=mc(SK),SN=UN({__proto__:null,default:xK},[SK]);function aS(e){"@babel/helpers - typeof";return aS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aS(e)}var zl;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?zl=global.fetch:typeof window<"u"&&window.fetch?zl=window.fetch:zl=fetch);var N0;_K()&&(typeof global<"u"&&global.XMLHttpRequest?N0=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(N0=window.XMLHttpRequest));var sS;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?sS=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(sS=window.ActiveXObject));!zl&&SN&&!N0&&!sS&&(zl=xK||SN);typeof zl!="function"&&(zl=void 0);var GT=function(t,n){if(n&&aS(n)==="object"){var r="";for(var i in n)r+="&"+encodeURIComponent(i)+"="+encodeURIComponent(n[i]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},xN=function(t,n,r){zl(t,n).then(function(i){if(!i.ok)return r(i.statusText||"Error",{status:i.status});i.text().then(function(o){r(null,{status:i.status,data:o})}).catch(r)}).catch(r)},wN=!1,rze=function(t,n,r,i){t.queryStringParams&&(n=GT(n,t.queryStringParams));var o=UT({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);r&&(o["Content-Type"]="application/json");var a=typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions,s=UT({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:o},wN?{}:a);try{xN(n,s,i)}catch(l){if(!a||Object.keys(a).length===0||!l.message||l.message.indexOf("not implemented")<0)return i(l);try{Object.keys(a).forEach(function(u){delete s[u]}),xN(n,s,i),wN=!0}catch(u){i(u)}}},ize=function(t,n,r,i){r&&aS(r)==="object"&&(r=GT("",r).slice(1)),t.queryStringParams&&(n=GT(n,t.queryStringParams));try{var o;N0?o=new N0:o=new sS("MSXML2.XMLHTTP.3.0"),o.open(r?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,r&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)o.setRequestHeader(s,a[s]);o.onreadystatechange=function(){o.readyState>3&&i(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(r)}catch(l){console&&console.log(l)}},oze=function(t,n,r,i){if(typeof r=="function"&&(i=r,r=void 0),i=i||function(){},zl&&n.indexOf("file:")!==0)return rze(t,n,r,i);if(_K()||typeof ActiveXObject=="function")return ize(t,n,r,i);i(new Error("No fetch and no xhr implementation found!"))};function $0(e){"@babel/helpers - typeof";return $0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$0(e)}function aze(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CN(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,wK(r.key),r)}}function sze(e,t,n){return t&&CN(e.prototype,t),n&&CN(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function lze(e,t,n){return t=wK(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wK(e){var t=uze(e,"string");return $0(t)==="symbol"?t:String(t)}function uze(e,t){if($0(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if($0(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cze=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 lze({},r,i||"")},parseLoadPayload:function(n,r){},request:oze,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},CK=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};aze(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return sze(e,[{key:"init",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=UT(i,this.options||{},cze()),this.allOptions=o,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,o,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,i)),l=eze(l),l.then(function(u){if(!u)return a(null,{});var c=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:i.join("+")});s.loadUrl(c,a,r,o)})}},{key:"loadUrl",value:function(n,r,i,o){var a=this,s=typeof i=="string"?[i]:i,l=typeof o=="string"?[o]:o,u=this.options.parseLoadPayload(s,l);this.options.request(this.options,n,u,function(c,d){if(d&&(d.status>=500&&d.status<600||!d.status))return r("failed loading "+n+"; status code: "+d.status,!0);if(d&&d.status>=400&&d.status<500)return r("failed loading "+n+"; status code: "+d.status,!1);if(!d&&c&&c.message&&c.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+c.message,!0);if(c)return r(c,!1);var f,h;try{typeof d.data=="string"?f=a.options.parse(d.data,i,o):f=d.data}catch{h="failed parsing "+n+" to json"}if(h)return r(h,!1);r(null,f)})}},{key:"create",value:function(n,r,i,o,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,i,o),u=0,c=[],d=[];n.forEach(function(f){var h=s.options.addPath;typeof s.options.addPath=="function"&&(h=s.options.addPath(f,r));var p=s.services.interpolator.interpolate(h,{lng:f,ns:r});s.options.request(s.options,p,l,function(m,_){u+=1,c.push(m),d.push(_),u===n.length&&typeof a=="function"&&a(c,d)})})}}},{key:"reload",value:function(){var n=this,r=this.services,i=r.backendConnector,o=r.languageUtils,a=r.logger,s=i.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],u=function(d){var f=o.toResolveHierarchy(d);f.forEach(function(h){l.indexOf(h)<0&&l.push(h)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(c){return u(c)}),l.forEach(function(c){n.allOptions.ns.forEach(function(d){i.read(c,d,"read",null,null,function(f,h){f&&a.warn("loading namespace ".concat(d," for language ").concat(c," failed"),f),!f&&h&&a.log("loaded namespace ".concat(d," for language ").concat(c),h),i.loaded("".concat(c,"|").concat(d),f,h)})})})}}}]),e}();CK.type="backend";be.use(CK).use(G4e).init({fallbackLng:"en",debug:!1,backend:{loadPath:"/locales/{{lng}}.json"},interpolation:{escapeValue:!1},returnNull:!1});const yw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Op(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function NP(e){return"nodeType"in e}function fo(e){var t,n;return e?Op(e)?e:NP(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function $P(e){const{Document:t}=fo(e);return e instanceof t}function zy(e){return Op(e)?!1:e instanceof fo(e).HTMLElement}function dze(e){return e instanceof fo(e).SVGElement}function Mp(e){return e?Op(e)?e.document:NP(e)?$P(e)?e:zy(e)?e.ownerDocument:document:document:document}const el=yw?I.useLayoutEffect:I.useEffect;function vw(e){const t=I.useRef(e);return el(()=>{t.current=e}),I.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function fze(){const e=I.useRef(null),t=I.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=I.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function D0(e,t){t===void 0&&(t=[e]);const n=I.useRef(e);return el(()=>{n.current!==e&&(n.current=e)},t),n}function jy(e,t){const n=I.useRef();return I.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function lS(e){const t=vw(e),n=I.useRef(null),r=I.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function uS(e){const t=I.useRef();return I.useEffect(()=>{t.current=e},[e]),t.current}let z5={};function bw(e,t){return I.useMemo(()=>{if(t)return t;const n=z5[e]==null?0:z5[e]+1;return z5[e]=n,e+"-"+n},[e,t])}function EK(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((o,a)=>{const s=Object.entries(a);for(const[l,u]of s){const c=o[l];c!=null&&(o[l]=c+e*u)}return o},{...t})}}const kh=EK(1),cS=EK(-1);function hze(e){return"clientX"in e&&"clientY"in e}function DP(e){if(!e)return!1;const{KeyboardEvent:t}=fo(e.target);return t&&e instanceof t}function pze(e){if(!e)return!1;const{TouchEvent:t}=fo(e.target);return t&&e instanceof t}function L0(e){if(pze(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return hze(e)?{x:e.clientX,y:e.clientY}:null}const F0=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[F0.Translate.toString(e),F0.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),EN="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function gze(e){return e.matches(EN)?e:e.querySelector(EN)}const mze={display:"none"};function yze(e){let{id:t,value:n}=e;return Tn.createElement("div",{id:t,style:mze},n)}const vze={position:"fixed",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};function bze(e){let{id:t,announcement:n}=e;return Tn.createElement("div",{id:t,style:vze,role:"status","aria-live":"assertive","aria-atomic":!0},n)}function _ze(){const[e,t]=I.useState("");return{announce:I.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const TK=I.createContext(null);function Sze(e){const t=I.useContext(TK);I.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function xze(){const[e]=I.useState(()=>new Set),t=I.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[I.useCallback(r=>{let{type:i,event:o}=r;e.forEach(a=>{var s;return(s=a[i])==null?void 0:s.call(a,o)})},[e]),t]}const wze={draggable:`
|
||
To pick up a draggable item, press the space bar.
|
||
While dragging, use the arrow keys to move the item.
|
||
Press space again to drop the item in its new position, or press escape to cancel.
|
||
`},Cze={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Eze(e){let{announcements:t=Cze,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=wze}=e;const{announce:o,announcement:a}=_ze(),s=bw("DndLiveRegion"),[l,u]=I.useState(!1);if(I.useEffect(()=>{u(!0)},[]),Sze(I.useMemo(()=>({onDragStart(d){let{active:f}=d;o(t.onDragStart({active:f}))},onDragMove(d){let{active:f,over:h}=d;t.onDragMove&&o(t.onDragMove({active:f,over:h}))},onDragOver(d){let{active:f,over:h}=d;o(t.onDragOver({active:f,over:h}))},onDragEnd(d){let{active:f,over:h}=d;o(t.onDragEnd({active:f,over:h}))},onDragCancel(d){let{active:f,over:h}=d;o(t.onDragCancel({active:f,over:h}))}}),[o,t])),!l)return null;const c=Tn.createElement(Tn.Fragment,null,Tn.createElement(yze,{id:r,value:i.draggable}),Tn.createElement(bze,{id:s,announcement:a}));return n?Vo.createPortal(c,n):c}var Hr;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Hr||(Hr={}));function dS(){}function TN(e,t){return I.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Tze(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return I.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const cs=Object.freeze({x:0,y:0});function kze(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Aze(e,t){const n=L0(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function Pze(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Ize(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Rze(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Oze(e,t){if(!e||e.length===0)return null;const[n]=e;return t?n[t]:n}function Mze(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),a=i-r,s=o-n;if(r<i&&n<o){const l=t.width*t.height,u=e.width*e.height,c=a*s,d=c/(l+u-c);return Number(d.toFixed(4))}return 0}const Nze=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:a}=o,s=n.get(a);if(s){const l=Mze(s,t);l>0&&i.push({id:a,data:{droppableContainer:o,value:l}})}}return i.sort(Ize)};function $ze(e,t){const{top:n,left:r,bottom:i,right:o}=t;return n<=e.y&&e.y<=i&&r<=e.x&&e.x<=o}const Dze=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];const i=[];for(const o of t){const{id:a}=o,s=n.get(a);if(s&&$ze(r,s)){const u=Rze(s).reduce((d,f)=>d+kze(r,f),0),c=Number((u/4).toFixed(4));i.push({id:a,data:{droppableContainer:o,value:c}})}}return i.sort(Pze)};function Lze(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function kK(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:cs}function Fze(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((a,s)=>({...a,top:a.top+e*s.y,bottom:a.bottom+e*s.y,left:a.left+e*s.x,right:a.right+e*s.x}),{...n})}}const Bze=Fze(1);function AK(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function zze(e,t,n){const r=AK(t);if(!r)return e;const{scaleX:i,scaleY:o,x:a,y:s}=r,l=e.left-a-(1-i)*parseFloat(n),u=e.top-s-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),c=i?e.width/i:e.width,d=o?e.height/o:e.height;return{width:c,height:d,top:u,right:l+c,bottom:u+d,left:l}}const jze={ignoreTransform:!1};function Uy(e,t){t===void 0&&(t=jze);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:c}=fo(e).getComputedStyle(e);u&&(n=zze(n,u,c))}const{top:r,left:i,width:o,height:a,bottom:s,right:l}=n;return{top:r,left:i,width:o,height:a,bottom:s,right:l}}function kN(e){return Uy(e,{ignoreTransform:!0})}function Uze(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Vze(e,t){return t===void 0&&(t=fo(e).getComputedStyle(e)),t.position==="fixed"}function Gze(e,t){t===void 0&&(t=fo(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function LP(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if($P(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!zy(i)||dze(i)||n.includes(i))return n;const o=fo(e).getComputedStyle(i);return i!==e&&Gze(i,o)&&n.push(i),Vze(i,o)?n:r(i.parentNode)}return e?r(e):n}function PK(e){const[t]=LP(e,1);return t??null}function j5(e){return!yw||!e?null:Op(e)?e:NP(e)?$P(e)||e===Mp(e).scrollingElement?window:zy(e)?e:null:null}function IK(e){return Op(e)?e.scrollX:e.scrollLeft}function RK(e){return Op(e)?e.scrollY:e.scrollTop}function qT(e){return{x:IK(e),y:RK(e)}}var ci;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ci||(ci={}));function OK(e){return!yw||!e?!1:e===document.scrollingElement}function MK(e){const t={x:0,y:0},n=OK(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,s=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:a,isRight:s,maxScroll:r,minScroll:t}}const qze={x:.2,y:.2};function Hze(e,t,n,r,i){let{top:o,left:a,right:s,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=qze);const{isTop:u,isBottom:c,isLeft:d,isRight:f}=MK(e),h={x:0,y:0},p={x:0,y:0},m={height:t.height*i.y,width:t.width*i.x};return!u&&o<=t.top+m.height?(h.y=ci.Backward,p.y=r*Math.abs((t.top+m.height-o)/m.height)):!c&&l>=t.bottom-m.height&&(h.y=ci.Forward,p.y=r*Math.abs((t.bottom-m.height-l)/m.height)),!f&&s>=t.right-m.width?(h.x=ci.Forward,p.x=r*Math.abs((t.right-m.width-s)/m.width)):!d&&a<=t.left+m.width&&(h.x=ci.Backward,p.x=r*Math.abs((t.left+m.width-a)/m.width)),{direction:h,speed:p}}function Wze(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:a}=window;return{top:0,left:0,right:o,bottom:a,width:o,height:a}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function NK(e){return e.reduce((t,n)=>kh(t,qT(n)),cs)}function Kze(e){return e.reduce((t,n)=>t+IK(n),0)}function Qze(e){return e.reduce((t,n)=>t+RK(n),0)}function $K(e,t){if(t===void 0&&(t=Uy),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);PK(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Xze=[["x",["left","right"],Kze],["y",["top","bottom"],Qze]];class FP{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=LP(n),i=NK(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,a,s]of Xze)for(const l of a)Object.defineProperty(this,l,{get:()=>{const u=s(r),c=i[o]-u;return this.rect[l]+c},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class am{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Yze(e){const{EventTarget:t}=fo(e);return e instanceof t?e:Mp(e)}function U5(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var pa;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(pa||(pa={}));function AN(e){e.preventDefault()}function Zze(e){e.stopPropagation()}var Mn;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter"})(Mn||(Mn={}));const DK={start:[Mn.Space,Mn.Enter],cancel:[Mn.Esc],end:[Mn.Space,Mn.Enter]},Jze=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Mn.Right:return{...n,x:n.x+25};case Mn.Left:return{...n,x:n.x-25};case Mn.Down:return{...n,y:n.y+25};case Mn.Up:return{...n,y:n.y-25}}};class LK{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new am(Mp(n)),this.windowListeners=new am(fo(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(pa.Resize,this.handleCancel),this.windowListeners.add(pa.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(pa.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&$K(r),n(cs)}handleKeyDown(t){if(DP(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=DK,coordinateGetter:a=Jze,scrollBehavior:s="smooth"}=i,{code:l}=t;if(o.end.includes(l)){this.handleEnd(t);return}if(o.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=r.current,c=u?{x:u.left,y:u.top}:cs;this.referenceCoordinates||(this.referenceCoordinates=c);const d=a(t,{active:n,context:r.current,currentCoordinates:c});if(d){const f=cS(d,c),h={x:0,y:0},{scrollableAncestors:p}=r.current;for(const m of p){const _=t.code,{isTop:b,isRight:y,isLeft:g,isBottom:v,maxScroll:S,minScroll:w}=MK(m),x=Wze(m),C={x:Math.min(_===Mn.Right?x.right-x.width/2:x.right,Math.max(_===Mn.Right?x.left:x.left+x.width/2,d.x)),y:Math.min(_===Mn.Down?x.bottom-x.height/2:x.bottom,Math.max(_===Mn.Down?x.top:x.top+x.height/2,d.y))},k=_===Mn.Right&&!y||_===Mn.Left&&!g,T=_===Mn.Down&&!v||_===Mn.Up&&!b;if(k&&C.x!==d.x){const P=m.scrollLeft+f.x,$=_===Mn.Right&&P<=S.x||_===Mn.Left&&P>=w.x;if($&&!f.y){m.scrollTo({left:P,behavior:s});return}$?h.x=m.scrollLeft-P:h.x=_===Mn.Right?m.scrollLeft-S.x:m.scrollLeft-w.x,h.x&&m.scrollBy({left:-h.x,behavior:s});break}else if(T&&C.y!==d.y){const P=m.scrollTop+f.y,$=_===Mn.Down&&P<=S.y||_===Mn.Up&&P>=w.y;if($&&!f.x){m.scrollTo({top:P,behavior:s});return}$?h.y=m.scrollTop-P:h.y=_===Mn.Down?m.scrollTop-S.y:m.scrollTop-w.y,h.y&&m.scrollBy({top:-h.y,behavior:s});break}}this.handleMove(t,kh(cS(d,this.referenceCoordinates),h))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}LK.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=DK,onActivation:i}=t,{active:o}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const s=o.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function PN(e){return!!(e&&"distance"in e)}function IN(e){return!!(e&&"delay"in e)}class BP{constructor(t,n,r){var i;r===void 0&&(r=Yze(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:a}=o;this.props=t,this.events=n,this.document=Mp(a),this.documentListeners=new am(this.document),this.listeners=new am(r),this.windowListeners=new am(fo(a)),this.initialCoordinates=(i=L0(o))!=null?i:cs,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),this.windowListeners.add(pa.Resize,this.handleCancel),this.windowListeners.add(pa.DragStart,AN),this.windowListeners.add(pa.VisibilityChange,this.handleCancel),this.windowListeners.add(pa.ContextMenu,AN),this.documentListeners.add(pa.Keydown,this.handleKeydown),n){if(PN(n))return;if(IN(n)){this.timeoutId=setTimeout(this.handleStart,n.delay);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(pa.Click,Zze,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(pa.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:a,options:{activationConstraint:s}}=o;if(!i)return;const l=(n=L0(t))!=null?n:cs,u=cS(i,l);if(!r&&s){if(IN(s))return U5(u,s.tolerance)?this.handleCancel():void 0;if(PN(s))return s.tolerance!=null&&U5(u,s.tolerance)?this.handleCancel():U5(u,s.distance)?this.handleStart():void 0}t.cancelable&&t.preventDefault(),a(l)}handleEnd(){const{onEnd:t}=this.props;this.detach(),t()}handleCancel(){const{onCancel:t}=this.props;this.detach(),t()}handleKeydown(t){t.code===Mn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const eje={move:{name:"pointermove"},end:{name:"pointerup"}};class FK extends BP{constructor(t){const{event:n}=t,r=Mp(n.target);super(t,eje,r)}}FK.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const tje={move:{name:"mousemove"},end:{name:"mouseup"}};var HT;(function(e){e[e.RightClick=2]="RightClick"})(HT||(HT={}));class BK extends BP{constructor(t){super(t,tje,Mp(t.event.target))}}BK.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===HT.RightClick?!1:(r==null||r({event:n}),!0)}}];const V5={move:{name:"touchmove"},end:{name:"touchend"}};class zK extends BP{constructor(t){super(t,V5)}static setup(){return window.addEventListener(V5.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(V5.move.name,t)};function t(){}}}zK.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var sm;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(sm||(sm={}));var fS;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(fS||(fS={}));function nje(e){let{acceleration:t,activator:n=sm.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:a=5,order:s=fS.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:c,delta:d,threshold:f}=e;const h=ije({delta:d,disabled:!o}),[p,m]=fze(),_=I.useRef({x:0,y:0}),b=I.useRef({x:0,y:0}),y=I.useMemo(()=>{switch(n){case sm.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case sm.DraggableRect:return i}},[n,i,l]),g=I.useRef(null),v=I.useCallback(()=>{const w=g.current;if(!w)return;const x=_.current.x*b.current.x,C=_.current.y*b.current.y;w.scrollBy(x,C)},[]),S=I.useMemo(()=>s===fS.TreeOrder?[...u].reverse():u,[s,u]);I.useEffect(()=>{if(!o||!u.length||!y){m();return}for(const w of S){if((r==null?void 0:r(w))===!1)continue;const x=u.indexOf(w),C=c[x];if(!C)continue;const{direction:k,speed:T}=Hze(w,C,y,t,f);for(const P of["x","y"])h[P][k[P]]||(T[P]=0,k[P]=0);if(T.x>0||T.y>0){m(),g.current=w,p(v,a),_.current=T,b.current=k;return}}_.current={x:0,y:0},b.current={x:0,y:0},m()},[t,v,r,m,o,a,JSON.stringify(y),JSON.stringify(h),p,u,S,c,JSON.stringify(f)])}const rje={x:{[ci.Backward]:!1,[ci.Forward]:!1},y:{[ci.Backward]:!1,[ci.Forward]:!1}};function ije(e){let{delta:t,disabled:n}=e;const r=uS(t);return jy(i=>{if(n||!r||!i)return rje;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[ci.Backward]:i.x[ci.Backward]||o.x===-1,[ci.Forward]:i.x[ci.Forward]||o.x===1},y:{[ci.Backward]:i.y[ci.Backward]||o.y===-1,[ci.Forward]:i.y[ci.Forward]||o.y===1}}},[n,t,r])}function oje(e,t){const n=t!==null?e.get(t):void 0,r=n?n.node.current:null;return jy(i=>{var o;return t===null?null:(o=r??i)!=null?o:null},[r,t])}function aje(e,t){return I.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...o]},[]),[e,t])}var B0;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(B0||(B0={}));var WT;(function(e){e.Optimized="optimized"})(WT||(WT={}));const RN=new Map;function sje(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,a]=I.useState(null),{frequency:s,measure:l,strategy:u}=i,c=I.useRef(e),d=_(),f=D0(d),h=I.useCallback(function(b){b===void 0&&(b=[]),!f.current&&a(y=>y===null?b:y.concat(b.filter(g=>!y.includes(g))))},[f]),p=I.useRef(null),m=jy(b=>{if(d&&!n)return RN;if(!b||b===RN||c.current!==e||o!=null){const y=new Map;for(let g of e){if(!g)continue;if(o&&o.length>0&&!o.includes(g.id)&&g.rect.current){y.set(g.id,g.rect.current);continue}const v=g.node.current,S=v?new FP(l(v),v):null;g.rect.current=S,S&&y.set(g.id,S)}return y}return b},[e,o,n,d,l]);return I.useEffect(()=>{c.current=e},[e]),I.useEffect(()=>{d||h()},[n,d]),I.useEffect(()=>{o&&o.length>0&&a(null)},[JSON.stringify(o)]),I.useEffect(()=>{d||typeof s!="number"||p.current!==null||(p.current=setTimeout(()=>{h(),p.current=null},s))},[s,d,h,...r]),{droppableRects:m,measureDroppableContainers:h,measuringScheduled:o!=null};function _(){switch(u){case B0.Always:return!1;case B0.BeforeDragging:return n;default:return!n}}}function zP(e,t){return jy(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function lje(e,t){return zP(e,t)}function uje(e){let{callback:t,disabled:n}=e;const r=vw(t),i=I.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return I.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function _w(e){let{callback:t,disabled:n}=e;const r=vw(t),i=I.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return I.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function cje(e){return new FP(Uy(e),e)}function ON(e,t,n){t===void 0&&(t=cje);const[r,i]=I.useReducer(s,null),o=uje({callback(l){if(e)for(const u of l){const{type:c,target:d}=u;if(c==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),a=_w({callback:i});return el(()=>{i(),e?(a==null||a.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),o==null||o.disconnect())},[e]),r;function s(l){if(!e)return null;if(e.isConnected===!1){var u;return(u=l??n)!=null?u:null}const c=t(e);return JSON.stringify(l)===JSON.stringify(c)?l:c}}function dje(e){const t=zP(e);return kK(e,t)}const MN=[];function fje(e){const t=I.useRef(e),n=jy(r=>e?r&&r!==MN&&e&&t.current&&e.parentNode===t.current.parentNode?r:LP(e):MN,[e]);return I.useEffect(()=>{t.current=e},[e]),n}function hje(e){const[t,n]=I.useState(null),r=I.useRef(e),i=I.useCallback(o=>{const a=j5(o.target);a&&n(s=>s?(s.set(a,qT(a)),new Map(s)):null)},[]);return I.useEffect(()=>{const o=r.current;if(e!==o){a(o);const s=e.map(l=>{const u=j5(l);return u?(u.addEventListener("scroll",i,{passive:!0}),[u,qT(u)]):null}).filter(l=>l!=null);n(s.length?new Map(s):null),r.current=e}return()=>{a(e),a(o)};function a(s){s.forEach(l=>{const u=j5(l);u==null||u.removeEventListener("scroll",i)})}},[i,e]),I.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,a)=>kh(o,a),cs):NK(e):cs,[e,t])}function NN(e,t){t===void 0&&(t=[]);const n=I.useRef(null);return I.useEffect(()=>{n.current=null},t),I.useEffect(()=>{const r=e!==cs;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?cS(e,n.current):cs}function pje(e){I.useEffect(()=>{if(!yw)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function gje(e,t){return I.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=a=>{o(a,t)},n},{}),[e,t])}function jK(e){return I.useMemo(()=>e?Uze(e):null,[e])}const G5=[];function mje(e,t){t===void 0&&(t=Uy);const[n]=e,r=jK(n?fo(n):null),[i,o]=I.useReducer(s,G5),a=_w({callback:o});return e.length>0&&i===G5&&o(),el(()=>{e.length?e.forEach(l=>a==null?void 0:a.observe(l)):(a==null||a.disconnect(),o())},[e]),i;function s(){return e.length?e.map(l=>OK(l)?r:new FP(t(l),l)):G5}}function UK(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return zy(t)?t:e}function yje(e){let{measure:t}=e;const[n,r]=I.useState(null),i=I.useCallback(u=>{for(const{target:c}of u)if(zy(c)){r(d=>{const f=t(c);return d?{...d,width:f.width,height:f.height}:f});break}},[t]),o=_w({callback:i}),a=I.useCallback(u=>{const c=UK(u);o==null||o.disconnect(),c&&(o==null||o.observe(c)),r(c?t(c):null)},[t,o]),[s,l]=lS(a);return I.useMemo(()=>({nodeRef:s,rect:n,setRef:l}),[n,s,l])}const vje=[{sensor:FK,options:{}},{sensor:LK,options:{}}],bje={current:{}},db={draggable:{measure:kN},droppable:{measure:kN,strategy:B0.WhileDragging,frequency:WT.Optimized},dragOverlay:{measure:Uy}};class lm extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const _je={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new lm,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:dS},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:db,measureDroppableContainers:dS,windowRect:null,measuringScheduled:!1},VK={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:dS,draggableNodes:new Map,over:null,measureDroppableContainers:dS},Vy=I.createContext(VK),GK=I.createContext(_je);function Sje(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new lm}}}function xje(e,t){switch(t.type){case Hr.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Hr.DragMove:return e.draggable.active?{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}}:e;case Hr.DragEnd:case Hr.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Hr.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new lm(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Hr.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new lm(e.droppable.containers);return a.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case Hr.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new lm(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function wje(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=I.useContext(Vy),o=uS(r),a=uS(n==null?void 0:n.id);return I.useEffect(()=>{if(!t&&!r&&o&&a!=null){if(!DP(o)||document.activeElement===o.target)return;const s=i.get(a);if(!s)return;const{activatorNode:l,node:u}=s;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const c of[l.current,u.current]){if(!c)continue;const d=gze(c);if(d){d.focus();break}}})}},[r,t,i,a,o]),null}function qK(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function Cje(e){return I.useMemo(()=>({draggable:{...db.draggable,...e==null?void 0:e.draggable},droppable:{...db.droppable,...e==null?void 0:e.droppable},dragOverlay:{...db.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Eje(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=I.useRef(!1),{x:a,y:s}=typeof i=="boolean"?{x:i,y:i}:i;el(()=>{if(!a&&!s||!t){o.current=!1;return}if(o.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const c=n(u),d=kK(c,r);if(a||(d.x=0),s||(d.y=0),o.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const f=PK(u);f&&f.scrollBy({top:d.y,left:d.x})}},[t,a,s,r,n])}const Sw=I.createContext({...cs,scaleX:1,scaleY:1});var wu;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(wu||(wu={}));const Tje=I.memo(function(t){var n,r,i,o;let{id:a,accessibility:s,autoScroll:l=!0,children:u,sensors:c=vje,collisionDetection:d=Nze,measuring:f,modifiers:h,...p}=t;const m=I.useReducer(xje,void 0,Sje),[_,b]=m,[y,g]=xze(),[v,S]=I.useState(wu.Uninitialized),w=v===wu.Initialized,{draggable:{active:x,nodes:C,translate:k},droppable:{containers:T}}=_,P=x?C.get(x):null,$=I.useRef({initial:null,translated:null}),O=I.useMemo(()=>{var zn;return x!=null?{id:x,data:(zn=P==null?void 0:P.data)!=null?zn:bje,rect:$}:null},[x,P]),E=I.useRef(null),[A,D]=I.useState(null),[L,M]=I.useState(null),R=D0(p,Object.values(p)),N=bw("DndDescribedBy",a),B=I.useMemo(()=>T.getEnabled(),[T]),U=Cje(f),{droppableRects:G,measureDroppableContainers:Z,measuringScheduled:ee}=sje(B,{dragging:w,dependencies:[k.x,k.y],config:U.droppable}),J=oje(C,x),j=I.useMemo(()=>L?L0(L):null,[L]),Q=sl(),ne=lje(J,U.draggable.measure);Eje({activeNode:x?C.get(x):null,config:Q.layoutShiftCompensation,initialRect:ne,measure:U.draggable.measure});const se=ON(J,U.draggable.measure,ne),ye=ON(J?J.parentElement:null),ce=I.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:G,draggableNodes:C,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),bt=T.getNodeFor((n=ce.current.over)==null?void 0:n.id),ot=yje({measure:U.dragOverlay.measure}),ze=(r=ot.nodeRef.current)!=null?r:J,mt=w?(i=ot.rect)!=null?i:se:null,Pe=!!(ot.nodeRef.current&&ot.rect),en=dje(Pe?null:se),Pr=jK(ze?fo(ze):null),Ln=fje(w?bt??J:null),An=mje(Ln),tn=qK(h,{transform:{x:k.x-en.x,y:k.y-en.y,scaleX:1,scaleY:1},activatorEvent:L,active:O,activeNodeRect:se,containerNodeRect:ye,draggingNodeRect:mt,over:ce.current.over,overlayNodeRect:ot.rect,scrollableAncestors:Ln,scrollableAncestorRects:An,windowRect:Pr}),Fn=j?kh(j,k):null,Ir=hje(Ln),ho=NN(Ir),ei=NN(Ir,[se]),pr=kh(tn,ho),Br=mt?Bze(mt,tn):null,ti=O&&Br?d({active:O,collisionRect:Br,droppableRects:G,droppableContainers:B,pointerCoordinates:Fn}):null,Bn=Oze(ti,"id"),[_n,Mi]=I.useState(null),gi=Pe?tn:kh(tn,ei),Qi=Lze(gi,(o=_n==null?void 0:_n.rect)!=null?o:null,se),Da=I.useCallback((zn,nn)=>{let{sensor:zr,options:Or}=nn;if(E.current==null)return;const Mr=C.get(E.current);if(!Mr)return;const ni=zn.nativeEvent,Ni=new zr({active:E.current,activeNode:Mr,event:ni,options:Or,context:ce,onStart(mi){const jr=E.current;if(jr==null)return;const La=C.get(jr);if(!La)return;const{onDragStart:gs}=R.current,yi={active:{id:jr,data:La.data,rect:$}};Vo.unstable_batchedUpdates(()=>{gs==null||gs(yi),S(wu.Initializing),b({type:Hr.DragStart,initialCoordinates:mi,active:jr}),y({type:"onDragStart",event:yi})})},onMove(mi){b({type:Hr.DragMove,coordinates:mi})},onEnd:go(Hr.DragEnd),onCancel:go(Hr.DragCancel)});Vo.unstable_batchedUpdates(()=>{D(Ni),M(zn.nativeEvent)});function go(mi){return async function(){const{active:La,collisions:gs,over:yi,scrollAdjustedTranslate:ou}=ce.current;let oa=null;if(La&&ou){const{cancelDrop:ri}=R.current;oa={activatorEvent:ni,active:La,collisions:gs,delta:ou,over:yi},mi===Hr.DragEnd&&typeof ri=="function"&&await Promise.resolve(ri(oa))&&(mi=Hr.DragCancel)}E.current=null,Vo.unstable_batchedUpdates(()=>{b({type:mi}),S(wu.Uninitialized),Mi(null),D(null),M(null);const ri=mi===Hr.DragEnd?"onDragEnd":"onDragCancel";if(oa){const ll=R.current[ri];ll==null||ll(oa),y({type:ri,event:oa})}})}}},[C]),Rr=I.useCallback((zn,nn)=>(zr,Or)=>{const Mr=zr.nativeEvent,ni=C.get(Or);if(E.current!==null||!ni||Mr.dndKit||Mr.defaultPrevented)return;const Ni={active:ni};zn(zr,nn.options,Ni)===!0&&(Mr.dndKit={capturedBy:nn.sensor},E.current=Or,Da(zr,nn))},[C,Da]),po=aje(c,Rr);pje(c),el(()=>{se&&v===wu.Initializing&&S(wu.Initialized)},[se,v]),I.useEffect(()=>{const{onDragMove:zn}=R.current,{active:nn,activatorEvent:zr,collisions:Or,over:Mr}=ce.current;if(!nn||!zr)return;const ni={active:nn,activatorEvent:zr,collisions:Or,delta:{x:pr.x,y:pr.y},over:Mr};Vo.unstable_batchedUpdates(()=>{zn==null||zn(ni),y({type:"onDragMove",event:ni})})},[pr.x,pr.y]),I.useEffect(()=>{const{active:zn,activatorEvent:nn,collisions:zr,droppableContainers:Or,scrollAdjustedTranslate:Mr}=ce.current;if(!zn||E.current==null||!nn||!Mr)return;const{onDragOver:ni}=R.current,Ni=Or.get(Bn),go=Ni&&Ni.rect.current?{id:Ni.id,rect:Ni.rect.current,data:Ni.data,disabled:Ni.disabled}:null,mi={active:zn,activatorEvent:nn,collisions:zr,delta:{x:Mr.x,y:Mr.y},over:go};Vo.unstable_batchedUpdates(()=>{Mi(go),ni==null||ni(mi),y({type:"onDragOver",event:mi})})},[Bn]),el(()=>{ce.current={activatorEvent:L,active:O,activeNode:J,collisionRect:Br,collisions:ti,droppableRects:G,draggableNodes:C,draggingNode:ze,draggingNodeRect:mt,droppableContainers:T,over:_n,scrollableAncestors:Ln,scrollAdjustedTranslate:pr},$.current={initial:mt,translated:Br}},[O,J,ti,Br,C,ze,mt,G,T,_n,Ln,pr]),nje({...Q,delta:k,draggingRect:Br,pointerCoordinates:Fn,scrollableAncestors:Ln,scrollableAncestorRects:An});const al=I.useMemo(()=>({active:O,activeNode:J,activeNodeRect:se,activatorEvent:L,collisions:ti,containerNodeRect:ye,dragOverlay:ot,draggableNodes:C,droppableContainers:T,droppableRects:G,over:_n,measureDroppableContainers:Z,scrollableAncestors:Ln,scrollableAncestorRects:An,measuringConfiguration:U,measuringScheduled:ee,windowRect:Pr}),[O,J,se,L,ti,ye,ot,C,T,G,_n,Z,Ln,An,U,ee,Pr]),Do=I.useMemo(()=>({activatorEvent:L,activators:po,active:O,activeNodeRect:se,ariaDescribedById:{draggable:N},dispatch:b,draggableNodes:C,over:_n,measureDroppableContainers:Z}),[L,po,O,se,b,N,C,_n,Z]);return Tn.createElement(TK.Provider,{value:g},Tn.createElement(Vy.Provider,{value:Do},Tn.createElement(GK.Provider,{value:al},Tn.createElement(Sw.Provider,{value:Qi},u)),Tn.createElement(wje,{disabled:(s==null?void 0:s.restoreFocus)===!1})),Tn.createElement(Eze,{...s,hiddenTextDescribedById:N}));function sl(){const zn=(A==null?void 0:A.autoScrollEnabled)===!1,nn=typeof l=="object"?l.enabled===!1:l===!1,zr=w&&!zn&&!nn;return typeof l=="object"?{...l,enabled:zr}:{enabled:zr}}}),kje=I.createContext(null),$N="button",Aje="Droppable";function tQe(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=bw(Aje),{activators:a,activatorEvent:s,active:l,activeNodeRect:u,ariaDescribedById:c,draggableNodes:d,over:f}=I.useContext(Vy),{role:h=$N,roleDescription:p="draggable",tabIndex:m=0}=i??{},_=(l==null?void 0:l.id)===t,b=I.useContext(_?Sw:kje),[y,g]=lS(),[v,S]=lS(),w=gje(a,t),x=D0(n);el(()=>(d.set(t,{id:t,key:o,node:y,activatorNode:v,data:x}),()=>{const k=d.get(t);k&&k.key===o&&d.delete(t)}),[d,t]);const C=I.useMemo(()=>({role:h,tabIndex:m,"aria-disabled":r,"aria-pressed":_&&h===$N?!0:void 0,"aria-roledescription":p,"aria-describedby":c.draggable}),[r,h,m,_,p,c.draggable]);return{active:l,activatorEvent:s,activeNodeRect:u,attributes:C,isDragging:_,listeners:r?void 0:w,node:y,over:f,setNodeRef:g,setActivatorNodeRef:S,transform:b}}function Pje(){return I.useContext(GK)}const Ije="Droppable",Rje={timeout:25};function nQe(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=bw(Ije),{active:a,dispatch:s,over:l,measureDroppableContainers:u}=I.useContext(Vy),c=I.useRef({disabled:n}),d=I.useRef(!1),f=I.useRef(null),h=I.useRef(null),{disabled:p,updateMeasurementsFor:m,timeout:_}={...Rje,...i},b=D0(m??r),y=I.useCallback(()=>{if(!d.current){d.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(b.current)?b.current:[b.current]),h.current=null},_)},[_]),g=_w({callback:y,disabled:p||!a}),v=I.useCallback((C,k)=>{g&&(k&&(g.unobserve(k),d.current=!1),C&&g.observe(C))},[g]),[S,w]=lS(v),x=D0(t);return I.useEffect(()=>{!g||!S.current||(g.disconnect(),d.current=!1,g.observe(S.current))},[S,g]),el(()=>(s({type:Hr.RegisterDroppable,element:{id:r,key:o,disabled:n,node:S,rect:f,data:x}}),()=>s({type:Hr.UnregisterDroppable,key:o,id:r})),[r]),I.useEffect(()=>{n!==c.current.disabled&&(s({type:Hr.SetDroppableDisabled,id:r,key:o,disabled:n}),c.current.disabled=n)},[r,o,n,s]),{active:a,rect:f,isOver:(l==null?void 0:l.id)===r,node:S,over:l,setNodeRef:w}}function Oje(e){let{animation:t,children:n}=e;const[r,i]=I.useState(null),[o,a]=I.useState(null),s=uS(n);return!n&&!r&&s&&i(s),el(()=>{if(!o)return;const l=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(l==null||u==null){i(null);return}Promise.resolve(t(u,o)).then(()=>{i(null)})},[t,r,o]),Tn.createElement(Tn.Fragment,null,n,r?I.cloneElement(r,{ref:a}):null)}const Mje={x:0,y:0,scaleX:1,scaleY:1};function Nje(e){let{children:t}=e;return Tn.createElement(Vy.Provider,{value:VK},Tn.createElement(Sw.Provider,{value:Mje},t))}const $je={position:"fixed",touchAction:"none"},Dje=e=>DP(e)?"transform 250ms ease":void 0,Lje=I.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:o,className:a,rect:s,style:l,transform:u,transition:c=Dje}=e;if(!s)return null;const d=i?u:{...u,scaleX:1,scaleY:1},f={...$je,width:s.width,height:s.height,top:s.top,left:s.left,transform:F0.Transform.toString(d),transformOrigin:i&&r?Aze(r,s):void 0,transition:typeof c=="function"?c(r):c,...l};return Tn.createElement(n,{className:a,style:f,ref:t},o)}),Fje=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:o,className:a}=e;if(o!=null&&o.active)for(const[s,l]of Object.entries(o.active))l!==void 0&&(i[s]=n.node.style.getPropertyValue(s),n.node.style.setProperty(s,l));if(o!=null&&o.dragOverlay)for(const[s,l]of Object.entries(o.dragOverlay))l!==void 0&&r.node.style.setProperty(s,l);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[l,u]of Object.entries(i))n.node.style.setProperty(l,u);a!=null&&a.active&&n.node.classList.remove(a.active)}},Bje=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:F0.Transform.toString(t)},{transform:F0.Transform.toString(n)}]},zje={duration:250,easing:"ease",keyframes:Bje,sideEffects:Fje({styles:{active:{opacity:"0"}}})};function jje(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return vw((o,a)=>{if(t===null)return;const s=n.get(o);if(!s)return;const l=s.node.current;if(!l)return;const u=UK(a);if(!u)return;const{transform:c}=fo(a).getComputedStyle(a),d=AK(c);if(!d)return;const f=typeof t=="function"?t:Uje(t);return $K(l,i.draggable.measure),f({active:{id:o,data:s.data,node:l,rect:i.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:i,transform:d})})}function Uje(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}={...zje,...e};return o=>{let{active:a,dragOverlay:s,transform:l,...u}=o;if(!t)return;const c={x:s.rect.left-a.rect.left,y:s.rect.top-a.rect.top},d={scaleX:l.scaleX!==1?a.rect.width*l.scaleX/s.rect.width:1,scaleY:l.scaleY!==1?a.rect.height*l.scaleY/s.rect.height:1},f={x:l.x-c.x,y:l.y-c.y,...d},h=i({...u,active:a,dragOverlay:s,transform:{initial:l,final:f}}),[p]=h,m=h[h.length-1];if(JSON.stringify(p)===JSON.stringify(m))return;const _=r==null?void 0:r({active:a,dragOverlay:s,...u}),b=s.node.animate(h,{duration:t,easing:n,fill:"forwards"});return new Promise(y=>{b.onfinish=()=>{_==null||_(),y()}})}}let DN=0;function Vje(e){return I.useMemo(()=>{if(e!=null)return DN++,DN},[e])}const Gje=Tn.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:o,modifiers:a,wrapperElement:s="div",className:l,zIndex:u=999}=e;const{activatorEvent:c,active:d,activeNodeRect:f,containerNodeRect:h,draggableNodes:p,droppableContainers:m,dragOverlay:_,over:b,measuringConfiguration:y,scrollableAncestors:g,scrollableAncestorRects:v,windowRect:S}=Pje(),w=I.useContext(Sw),x=Vje(d==null?void 0:d.id),C=qK(a,{activatorEvent:c,active:d,activeNodeRect:f,containerNodeRect:h,draggingNodeRect:_.rect,over:b,overlayNodeRect:_.rect,scrollableAncestors:g,scrollableAncestorRects:v,transform:w,windowRect:S}),k=zP(f),T=jje({config:r,draggableNodes:p,droppableContainers:m,measuringConfiguration:y}),P=k?_.setRef:void 0;return Tn.createElement(Nje,null,Tn.createElement(Oje,{animation:T},d&&x?Tn.createElement(Lje,{key:x,id:d.id,ref:P,as:s,activatorEvent:c,adjustScale:t,className:l,transition:o,rect:k,style:{zIndex:u,...i},transform:C},n):null))}),qje=Ii([iK,FA],({nodes:e},t)=>t==="nodes"?e.viewport.zoom:1),Hje=()=>{const e=fq(qje);return I.useCallback(({activatorEvent:n,draggingNodeRect:r,transform:i})=>{if(r&&n){const o=L0(n);if(!o)return i;const a=o.x-r.left,s=o.y-r.top,l=i.x+a-r.width/2,u=i.y+s-r.height/2,c=i.scaleX*e,d=i.scaleY*e;return{x:l,y:u,scaleX:c,scaleY:d}}return i},[e])},Wje=e=>{if(!e.pointerCoordinates)return[];const t=document.elementsFromPoint(e.pointerCoordinates.x,e.pointerCoordinates.y),n=e.droppableContainers.filter(r=>r.node.current?t.includes(r.node.current):!1);return Dze({...e,droppableContainers:n})};function Kje(e){return W.jsx(Tje,{...e})}const v1=28,LN={w:v1,h:v1,maxW:v1,maxH:v1,shadow:"dark-lg",borderRadius:"lg",opacity:.3,bg:"base.800",color:"base.50",_dark:{borderColor:"base.200",bg:"base.900",color:"base.100"}},Qje=e=>{if(!e.dragData)return null;if(e.dragData.payloadType==="NODE_FIELD"){const{field:t,fieldTemplate:n}=e.dragData.payload;return W.jsx(oS,{sx:{position:"relative",p:2,px:3,opacity:.7,bg:"base.300",borderRadius:"base",boxShadow:"dark-lg",whiteSpace:"nowrap",fontSize:"sm"},children:W.jsx(QW,{children:t.label||n.title})})}if(e.dragData.payloadType==="IMAGE_DTO"){const{thumbnail_url:t,width:n,height:r}=e.dragData.payload.imageDTO;return W.jsx(oS,{sx:{position:"relative",width:"full",height:"full",display:"flex",alignItems:"center",justifyContent:"center"},children:W.jsx(TP,{sx:{...LN},objectFit:"contain",src:t,width:n,height:r})})}return e.dragData.payloadType==="IMAGE_DTOS"?W.jsxs(kP,{sx:{position:"relative",alignItems:"center",justifyContent:"center",flexDir:"column",...LN},children:[W.jsx(NT,{children:e.dragData.payload.imageDTOs.length}),W.jsx(NT,{size:"sm",children:"Images"})]}):null},Xje=I.memo(Qje),Yje=e=>{const[t,n]=I.useState(null),r=_e("images"),i=O4e(),o=I.useCallback(d=>{r.trace({dragData:Xt(d.active.data.current)},"Drag started");const f=d.active.data.current;f&&n(f)},[r]),a=I.useCallback(d=>{var h;r.trace({dragData:Xt(d.active.data.current)},"Drag ended");const f=(h=d.over)==null?void 0:h.data.current;!t||!f||(i(cq({overData:f,activeData:t})),n(null))},[t,i,r]),s=TN(BK,{activationConstraint:{distance:10}}),l=TN(zK,{activationConstraint:{distance:10}}),u=Tze(s,l),c=Hje();return W.jsxs(Kje,{onDragStart:o,onDragEnd:a,sensors:u,collisionDetection:Wje,autoScroll:!1,children:[e.children,W.jsx(Gje,{dropAnimation:null,modifiers:[c],style:{width:"min-content",height:"min-content",cursor:"grabbing",userSelect:"none",padding:"10rem"},children:W.jsx(zW,{children:t&&W.jsx(FW.div,{layout:!0,initial:{opacity:0,scale:.7},animate:{opacity:1,scale:1,transition:{duration:.1}},children:W.jsx(Xje,{dragData:t})},"overlay-drag-image")})})]})},Zje=I.memo(Yje),FN=nl(void 0),BN=nl(void 0),Jje=I.lazy(()=>nL(()=>import("./App-6a1ad010.js"),["./App-6a1ad010.js","./MantineProvider-2b56c833.js","./App-6125620a.css"],import.meta.url)),eUe=I.lazy(()=>nL(()=>import("./ThemeLocaleProvider-6be4f995.js"),["./ThemeLocaleProvider-6be4f995.js","./MantineProvider-2b56c833.js","./ThemeLocaleProvider-90f0fcd3.css"],import.meta.url)),tUe=({apiUrl:e,token:t,config:n,headerComponent:r,middleware:i,projectId:o,queueId:a,selectedImage:s,customStarUi:l})=>(I.useEffect(()=>(t&&Jh.set(t),e&&s0.set(e),o&&l0.set(o),a&&Vr.set(a),lG(),i&&i.length>0?qE(bN(),...i):qE(bN()),()=>{s0.set(void 0),Jh.set(void 0),l0.set(void 0),Vr.set(hG)}),[e,t,i,o,a]),I.useEffect(()=>(l&&FN.set(l),()=>{FN.set(void 0)}),[l]),I.useEffect(()=>(r&&BN.set(r),()=>{BN.set(void 0)}),[r]),W.jsx(Tn.StrictMode,{children:W.jsx(Ame,{store:rK,children:W.jsx(Tn.Suspense,{fallback:W.jsx(XBe,{}),children:W.jsx(eUe,{children:W.jsx(Zje,{children:W.jsx(Jje,{config:n,selectedImage:s})})})})})})),nUe=I.memo(tUe);q5.createRoot(document.getElementById("root")).render(W.jsx(nUe,{}));export{VKe as $,Ka as A,gbe as B,Oo as C,Xu as D,Cs as E,Mqe as F,dA as G,ike as H,ia as I,By as J,oAe as K,JKe as L,HDe as M,Iy as N,Oi as O,vbe as P,Rc as Q,pMe as R,$m as S,qKe as T,UKe as U,zW as V,FW as W,HOe as X,Ry as Y,wP as Z,My as _,WL as a,jA as a$,GKe as a0,G_ as a1,JM as a2,Qke as a3,HKe as a4,Ls as a5,mc as a6,x_ as a7,$Y as a8,Tn as a9,oS as aA,kP as aB,NT as aC,FA as aD,ex as aE,K4e as aF,WGe as aG,$ke as aH,qA as aI,Eq as aJ,Lke as aK,Vo as aL,GP as aM,rw as aN,EWe as aO,NGe as aP,QGe as aQ,XGe as aR,CGe as aS,xGe as aT,QW as aU,zf as aV,Mxe as aW,gG as aX,dWe as aY,Sqe as aZ,Yk as a_,gH as aa,QKe as ab,YOe as ac,Ws as ad,Oq as ae,nw as af,y$e as ag,WW as ah,WKe as ai,nt as aj,jKe as ak,KKe as al,Ii as am,iK as an,pk as ao,fq as ap,OGe as aq,by as ar,Mz as as,oj as at,x2 as au,_e as av,O4e as aw,hWe as ax,qt as ay,Ld as az,jS as b,FUe as b$,eKe as b0,TP as b1,KBe as b2,be as b3,zGe as b4,KGe as b5,v0e as b6,bk as b7,gUe as b8,NWe as b9,Tqe as bA,$Ge as bB,DGe as bC,VGe as bD,E_ as bE,FGe as bF,Nu as bG,lv as bH,Eqe as bI,wqe as bJ,Cqe as bK,iUe as bL,lUe as bM,uUe as bN,cUe as bO,dUe as bP,tle as bQ,LUe as bR,tWe as bS,nWe as bT,mUe as bU,GUe as bV,hUe as bW,OUe as bX,bUe as bY,ZEe as bZ,pUe as b_,gWe as ba,tKe as bb,BWe as bc,nxe as bd,pWe as be,yWe as bf,y2e as bg,v2e as bh,RWe as bi,MWe as bj,mWe as bk,DWe as bl,vWe as bm,RGe as bn,fWe as bo,KWe as bp,eQe as bq,BGe as br,ble as bs,nqe as bt,tqe as bu,LGe as bv,kqe as bw,nQe as bx,tQe as by,LV as bz,NJ as c,Ur as c$,fUe as c0,QUe as c1,yUe as c2,tI as c3,vUe as c4,nI as c5,EUe as c6,NUe as c7,SKe as c8,jO as c9,cWe as cA,Rqe as cB,sqe as cC,Hxe as cD,Ne as cE,FN as cF,oqe as cG,rqe as cH,iqe as cI,x0e as cJ,_xe as cK,sG as cL,PB as cM,wGe as cN,uq as cO,jGe as cP,u0 as cQ,pU as cR,zKe as cS,UGe as cT,hv as cU,CE as cV,ZWe as cW,qWe as cX,bWe as cY,_We as cZ,VWe as c_,SUe as ca,Oqe as cb,vKe as cc,UO as cd,xUe as ce,kv as cf,Ef as cg,UR as ch,uqe as ci,bKe as cj,iT as ck,CUe as cl,iU as cm,yqe as cn,lU as co,YEe as cp,_Ue as cq,K9 as cr,oWe as cs,aWe as ct,sWe as cu,TUe as cv,lWe as cw,kUe as cx,uWe as cy,AUe as cz,_oe as d,Iqe as d$,fA as d0,Ea as d1,UWe as d2,PUe as d3,LA as d4,GWe as d5,FWe as d6,hk as d7,QHe as d8,qHe as d9,yKe as dA,LKe as dB,mKe as dC,dHe as dD,fHe as dE,FKe as dF,hHe as dG,DKe as dH,pHe as dI,gHe as dJ,qse as dK,wKe as dL,mHe as dM,Kse as dN,sHe as dO,wUe as dP,_Ke as dQ,lHe as dR,nHe as dS,KHe as dT,joe as dU,KS as dV,$Ue as dW,E0e as dX,T0e as dY,xqe as dZ,Pqe as d_,HHe as da,ZHe as db,WHe as dc,YHe as dd,XHe as de,OEe as df,bHe as dg,Bqe as dh,TGe as di,EGe as dj,Uqe as dk,Eae as dl,uHe as dm,Dqe as dn,rHe as dp,iHe as dq,Wse as dr,oHe as ds,oUe as dt,aHe as du,Z2 as dv,Hse as dw,cHe as dx,cy as dy,OKe as dz,QF as e,DVe as e$,mU as e0,Aqe as e1,QS as e2,aVe as e3,rVe as e4,iVe as e5,oVe as e6,Dae as e7,VR as e8,fqe as e9,rWe as eA,mk as eB,p2e as eC,P4e as eD,EB as eE,hKe as eF,lVe as eG,nle as eH,sVe as eI,Wa as eJ,MUe as eK,HUe as eL,Lae as eM,qg as eN,KUe as eO,iWe as eP,jUe as eQ,UUe as eR,VUe as eS,BUe as eT,zUe as eU,ele as eV,ZUe as eW,YUe as eX,gVe as eY,$Ve as eZ,vGe as e_,JGe as ea,YGe as eb,ZGe as ec,Cc as ed,rI as ee,m0e as ef,GR as eg,Vxe as eh,Uxe as ei,hqe as ej,pqe as ek,gqe as el,y0e as em,mqe as en,aU as eo,cqe as ep,sU as eq,bqe as er,_qe as es,q2 as et,qR as eu,vqe as ev,aqe as ew,cEe as ex,lqe as ey,xKe as ez,tF as f,RHe as f$,tVe as f0,nVe as f1,eVe as f2,vk as f3,jWe as f4,HWe as f5,eWe as f6,BKe as f7,Z4e as f8,AWe as f9,qqe as fA,Hqe as fB,gSe as fC,q9 as fD,tV as fE,wy as fF,Nqe as fG,Wc as fH,xHe as fI,LWe as fJ,wj as fK,Cg as fL,jqe as fM,Fqe as fN,SHe as fO,wHe as fP,IHe as fQ,$qe as fR,CHe as fS,EHe as fT,kGe as fU,$_ as fV,tt as fW,THe as fX,c2e as fY,Fv as fZ,zqe as f_,ve as fa,Ft as fb,Gn as fc,Gs as fd,gKe as fe,NKe as ff,kKe as fg,CWe as fh,TKe as fi,$Ke as fj,MKe as fk,wWe as fl,PKe as fm,AKe as fn,CKe as fo,RKe as fp,sUe as fq,EKe as fr,IKe as fs,aUe as ft,xV as fu,Lqe as fv,eE as fw,dSe as fx,Coe as fy,_He as fz,uF as g,dVe as g$,AHe as g0,Jqe as g1,Xqe as g2,Qqe as g3,Kqe as g4,eHe as g5,PHe as g6,NHe as g7,MHe as g8,GHe as g9,iKe as gA,JWe as gB,zWe as gC,QWe as gD,YWe as gE,Kc as gF,vG as gG,gQ as gH,Rt as gI,WVe as gJ,fGe as gK,dGe as gL,RVe as gM,nGe as gN,pGe as gO,Gxe as gP,CVe as gQ,UVe as gR,ig as gS,BVe as gT,EVe as gU,tx as gV,jVe as gW,SVe as gX,zVe as gY,xVe as gZ,kVe as g_,eke as ga,Yqe as gb,Zqe as gc,JHe as gd,$He as ge,OHe as gf,LHe as gg,iSe as gh,pKe as gi,WB as gj,BO as gk,Xt as gl,u2e as gm,y0 as gn,uc as go,VHe as gp,FHe as gq,UHe as gr,BHe as gs,DHe as gt,kHe as gu,jHe as gv,$V as gw,oKe as gx,nKe as gy,rKe as gz,mp as h,WA as h$,cVe as h0,uVe as h1,hGe as h2,bae as h3,rB as h4,TB as h5,Jh as h6,ale as h7,mVe as h8,yVe as h9,sGe as hA,JVe as hB,YVe as hC,ZVe as hD,bGe as hE,oGe as hF,_Ge as hG,FVe as hH,LVe as hI,_Ve as hJ,bVe as hK,yGe as hL,pVe as hM,OVe as hN,zxe as hO,Dxe as hP,Fxe as hQ,Bxe as hR,fKe as hS,TWe as hT,kWe as hU,GGe as hV,Y as hW,Nae as hX,Rxe as hY,BN as hZ,Iq as h_,vVe as ha,cGe as hb,PVe as hc,AVe as hd,ule as he,uGe as hf,jxe as hg,cle as hh,$A as hi,uEe as hj,MVe as hk,KVe as hl,HVe as hm,VVe as hn,fVe as ho,hVe as hp,SGe as hq,sKe as hr,aKe as hs,tGe as ht,XVe as hu,QVe as hv,Lxe as hw,IVe as hx,wVe as hy,lGe as hz,hoe as i,Fs as i0,NOe as i1,uMe as i2,XKe as i3,Jke as i4,ZKe as i5,WDe as i6,YFe as i7,ZFe as i8,Wke as i9,ly as j,Yr as k,sy as l,iy as m,Ro as n,GS as o,tk as p,JL as q,sk as r,UF as s,ay as t,I as u,W as v,Aa as w,_r as x,yh as y,pi as z};
|