var Hh=t=>{throw TypeError(t)};var eu=(t,e,r)=>e.has(t)||Hh("Cannot "+r);var T=(t,e,r)=>(eu(t,e,"read from private field"),r?r.call(t):e.get(t)),ue=(t,e,r)=>e.has(t)?Hh("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),J=(t,e,r,n)=>(eu(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),Ve=(t,e,r)=>(eu(t,e,"access private method"),r);var Io=(t,e,r,n)=>({set _(s){J(t,e,s,r)},get _(){return T(t,e,n)}});function Lm(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();function Dm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Gw(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return t[n]}})}),r}var Mm={exports:{}},vl={},Um={exports:{}},se={};/**
 * @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 xo=Symbol.for("react.element"),Qw=Symbol.for("react.portal"),Zw=Symbol.for("react.fragment"),Jw=Symbol.for("react.strict_mode"),Yw=Symbol.for("react.profiler"),Xw=Symbol.for("react.provider"),e_=Symbol.for("react.context"),t_=Symbol.for("react.forward_ref"),r_=Symbol.for("react.suspense"),n_=Symbol.for("react.memo"),s_=Symbol.for("react.lazy"),qh=Symbol.iterator;function i_(t){return t===null||typeof t!="object"?null:(t=qh&&t[qh]||t["@@iterator"],typeof t=="function"?t:null)}var Fm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Bm=Object.assign,zm={};function oi(t,e,r){this.props=t,this.context=e,this.refs=zm,this.updater=r||Fm}oi.prototype.isReactComponent={};oi.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};oi.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Vm(){}Vm.prototype=oi.prototype;function yd(t,e,r){this.props=t,this.context=e,this.refs=zm,this.updater=r||Fm}var wd=yd.prototype=new Vm;wd.constructor=yd;Bm(wd,oi.prototype);wd.isPureReactComponent=!0;var Kh=Array.isArray,Wm=Object.prototype.hasOwnProperty,_d={current:null},Hm={key:!0,ref:!0,__self:!0,__source:!0};function qm(t,e,r){var n,s={},i=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(i=""+e.key),e)Wm.call(e,n)&&!Hm.hasOwnProperty(n)&&(s[n]=e[n]);var a=arguments.length-2;if(a===1)s.children=r;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];s.children=l}if(t&&t.defaultProps)for(n in a=t.defaultProps,a)s[n]===void 0&&(s[n]=a[n]);return{$$typeof:xo,type:t,key:i,ref:o,props:s,_owner:_d.current}}function o_(t,e){return{$$typeof:xo,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function bd(t){return typeof t=="object"&&t!==null&&t.$$typeof===xo}function a_(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var Gh=/\/+/g;function tu(t,e){return typeof t=="object"&&t!==null&&t.key!=null?a_(""+t.key):e.toString(36)}function fa(t,e,r,n,s){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case xo:case Qw:o=!0}}if(o)return o=t,s=s(o),t=n===""?"."+tu(o,0):n,Kh(s)?(r="",t!=null&&(r=t.replace(Gh,"$&/")+"/"),fa(s,e,r,"",function(u){return u})):s!=null&&(bd(s)&&(s=o_(s,r+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(Gh,"$&/")+"/")+t)),e.push(s)),1;if(o=0,n=n===""?".":n+":",Kh(t))for(var a=0;a<t.length;a++){i=t[a];var l=n+tu(i,a);o+=fa(i,e,r,l,s)}else if(l=i_(t),typeof l=="function")for(t=l.call(t),a=0;!(i=t.next()).done;)i=i.value,l=n+tu(i,a++),o+=fa(i,e,r,l,s);else if(i==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function $o(t,e,r){if(t==null)return t;var n=[],s=0;return fa(t,n,"","",function(i){return e.call(r,i,s++)}),n}function l_(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var et={current:null},pa={transition:null},u_={ReactCurrentDispatcher:et,ReactCurrentBatchConfig:pa,ReactCurrentOwner:_d};function Km(){throw Error("act(...) is not supported in production builds of React.")}se.Children={map:$o,forEach:function(t,e,r){$o(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return $o(t,function(){e++}),e},toArray:function(t){return $o(t,function(e){return e})||[]},only:function(t){if(!bd(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};se.Component=oi;se.Fragment=Zw;se.Profiler=Yw;se.PureComponent=yd;se.StrictMode=Jw;se.Suspense=r_;se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=u_;se.act=Km;se.cloneElement=function(t,e,r){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=Bm({},t.props),s=t.key,i=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,o=_d.current),e.key!==void 0&&(s=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)Wm.call(e,l)&&!Hm.hasOwnProperty(l)&&(n[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)n.children=r;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];n.children=a}return{$$typeof:xo,type:t.type,key:s,ref:i,props:n,_owner:o}};se.createContext=function(t){return t={$$typeof:e_,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:Xw,_context:t},t.Consumer=t};se.createElement=qm;se.createFactory=function(t){var e=qm.bind(null,t);return e.type=t,e};se.createRef=function(){return{current:null}};se.forwardRef=function(t){return{$$typeof:t_,render:t}};se.isValidElement=bd;se.lazy=function(t){return{$$typeof:s_,_payload:{_status:-1,_result:t},_init:l_}};se.memo=function(t,e){return{$$typeof:n_,type:t,compare:e===void 0?null:e}};se.startTransition=function(t){var e=pa.transition;pa.transition={};try{t()}finally{pa.transition=e}};se.unstable_act=Km;se.useCallback=function(t,e){return et.current.useCallback(t,e)};se.useContext=function(t){return et.current.useContext(t)};se.useDebugValue=function(){};se.useDeferredValue=function(t){return et.current.useDeferredValue(t)};se.useEffect=function(t,e){return et.current.useEffect(t,e)};se.useId=function(){return et.current.useId()};se.useImperativeHandle=function(t,e,r){return et.current.useImperativeHandle(t,e,r)};se.useInsertionEffect=function(t,e){return et.current.useInsertionEffect(t,e)};se.useLayoutEffect=function(t,e){return et.current.useLayoutEffect(t,e)};se.useMemo=function(t,e){return et.current.useMemo(t,e)};se.useReducer=function(t,e,r){return et.current.useReducer(t,e,r)};se.useRef=function(t){return et.current.useRef(t)};se.useState=function(t){return et.current.useState(t)};se.useSyncExternalStore=function(t,e,r){return et.current.useSyncExternalStore(t,e,r)};se.useTransition=function(){return et.current.useTransition()};se.version="18.3.1";Um.exports=se;var b=Um.exports;const N=Dm(b),Gm=Lm({__proto__:null,default:N},[b]);/**
 * @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 c_=b,d_=Symbol.for("react.element"),h_=Symbol.for("react.fragment"),f_=Object.prototype.hasOwnProperty,p_=c_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m_={key:!0,ref:!0,__self:!0,__source:!0};function Qm(t,e,r){var n,s={},i=null,o=null;r!==void 0&&(i=""+r),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(o=e.ref);for(n in e)f_.call(e,n)&&!m_.hasOwnProperty(n)&&(s[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)s[n]===void 0&&(s[n]=e[n]);return{$$typeof:d_,type:t,key:i,ref:o,props:s,_owner:p_.current}}vl.Fragment=h_;vl.jsx=Qm;vl.jsxs=Qm;Mm.exports=vl;var S=Mm.exports,Zm={exports:{}},_t={},Jm={exports:{}},Ym={};/**
 * @license React
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */(function(t){function e(C,P){var D=C.length;C.push(P);e:for(;0<D;){var X=D-1>>>1,W=C[X];if(0<s(W,P))C[X]=P,C[D]=W,D=X;else break e}}function r(C){return C.length===0?null:C[0]}function n(C){if(C.length===0)return null;var P=C[0],D=C.pop();if(D!==P){C[0]=D;e:for(var X=0,W=C.length,ne=W>>>1;X<ne;){var oe=2*(X+1)-1,Pe=C[oe],ze=oe+1,de=C[ze];if(0>s(Pe,D))ze<W&&0>s(de,Pe)?(C[X]=de,C[ze]=D,X=ze):(C[X]=Pe,C[oe]=D,X=oe);else if(ze<W&&0>s(de,D))C[X]=de,C[ze]=D,X=ze;else break e}}return P}function s(C,P){var D=C.sortIndex-P.sortIndex;return D!==0?D:C.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,h=null,f=3,d=!1,y=!1,g=!1,w=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(C){for(var P=r(u);P!==null;){if(P.callback===null)n(u);else if(P.startTime<=C)n(u),P.sortIndex=P.expirationTime,e(l,P);else break;P=r(u)}}function _(C){if(g=!1,v(C),!y)if(r(l)!==null)y=!0,K(x);else{var P=r(u);P!==null&&Y(_,P.startTime-C)}}function x(C,P){y=!1,g&&(g=!1,m(O),O=-1),d=!0;var D=f;try{for(v(P),h=r(l);h!==null&&(!(h.expirationTime>P)||C&&!q());){var X=h.callback;if(typeof X=="function"){h.callback=null,f=h.priorityLevel;var W=X(h.expirationTime<=P);P=t.unstable_now(),typeof W=="function"?h.callback=W:h===r(l)&&n(l),v(P)}else n(l);h=r(l)}if(h!==null)var ne=!0;else{var oe=r(u);oe!==null&&Y(_,oe.startTime-P),ne=!1}return ne}finally{h=null,f=D,d=!1}}var E=!1,k=null,O=-1,j=5,I=-1;function q(){return!(t.unstable_now()-I<j)}function F(){if(k!==null){var C=t.unstable_now();I=C;var P=!0;try{P=k(!0,C)}finally{P?te():(E=!1,k=null)}}else E=!1}var te;if(typeof p=="function")te=function(){p(F)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,ie=$.port2;$.port1.onmessage=F,te=function(){ie.postMessage(null)}}else te=function(){w(F,0)};function K(C){k=C,E||(E=!0,te())}function Y(C,P){O=w(function(){C(t.unstable_now())},P)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(C){C.callback=null},t.unstable_continueExecution=function(){y||d||(y=!0,K(x))},t.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<C?Math.floor(1e3/C):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return r(l)},t.unstable_next=function(C){switch(f){case 1:case 2:case 3:var P=3;break;default:P=f}var D=f;f=P;try{return C()}finally{f=D}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(C,P){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var D=f;f=C;try{return P()}finally{f=D}},t.unstable_scheduleCallback=function(C,P,D){var X=t.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?X+D:X):D=X,C){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=D+W,C={id:c++,callback:P,priorityLevel:C,startTime:D,expirationTime:W,sortIndex:-1},D>X?(C.sortIndex=D,e(u,C),r(l)===null&&C===r(u)&&(g?(m(O),O=-1):g=!0,Y(_,D-X))):(C.sortIndex=W,e(l,C),y||d||(y=!0,K(x))),C},t.unstable_shouldYield=q,t.unstable_wrapCallback=function(C){var P=f;return function(){var D=f;f=P;try{return C.apply(this,arguments)}finally{f=D}}}})(Ym);Jm.exports=Ym;var g_=Jm.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 v_=b,yt=g_;function R(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Xm=new Set,Hi={};function Yn(t,e){qs(t,e),qs(t+"Capture",e)}function qs(t,e){for(Hi[t]=e,t=0;t<e.length;t++)Xm.add(e[t])}var wr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hu=Object.prototype.hasOwnProperty,y_=/^[: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]*$/,Qh={},Zh={};function w_(t){return Hu.call(Zh,t)?!0:Hu.call(Qh,t)?!1:y_.test(t)?Zh[t]=!0:(Qh[t]=!0,!1)}function __(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function b_(t,e,r,n){if(e===null||typeof e>"u"||__(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function tt(t,e,r,n,s,i,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=o}var Be={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Be[t]=new tt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Be[e]=new tt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Be[t]=new tt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Be[t]=new tt(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Be[t]=new tt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Be[t]=new tt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Be[t]=new tt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Be[t]=new tt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Be[t]=new tt(t,5,!1,t.toLowerCase(),null,!1,!1)});var xd=/[\-:]([a-z])/g;function Sd(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(xd,Sd);Be[e]=new tt(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(xd,Sd);Be[e]=new tt(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(xd,Sd);Be[e]=new tt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Be[t]=new tt(t,1,!1,t.toLowerCase(),null,!1,!1)});Be.xlinkHref=new tt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Be[t]=new tt(t,1,!1,t.toLowerCase(),null,!0,!0)});function Ed(t,e,r,n){var s=Be.hasOwnProperty(e)?Be[e]:null;(s!==null?s.type!==0:n||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(b_(e,r,s,n)&&(r=null),n||s===null?w_(e)&&(r===null?t.removeAttribute(e):t.setAttribute(e,""+r)):s.mustUseProperty?t[s.propertyName]=r===null?s.type===3?!1:"":r:(e=s.attributeName,n=s.attributeNamespace,r===null?t.removeAttribute(e):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?t.setAttributeNS(n,e,r):t.setAttribute(e,r))))}var Tr=v_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Lo=Symbol.for("react.element"),gs=Symbol.for("react.portal"),vs=Symbol.for("react.fragment"),kd=Symbol.for("react.strict_mode"),qu=Symbol.for("react.profiler"),eg=Symbol.for("react.provider"),tg=Symbol.for("react.context"),Td=Symbol.for("react.forward_ref"),Ku=Symbol.for("react.suspense"),Gu=Symbol.for("react.suspense_list"),Cd=Symbol.for("react.memo"),Ur=Symbol.for("react.lazy"),rg=Symbol.for("react.offscreen"),Jh=Symbol.iterator;function vi(t){return t===null||typeof t!="object"?null:(t=Jh&&t[Jh]||t["@@iterator"],typeof t=="function"?t:null)}var Ee=Object.assign,ru;function Ci(t){if(ru===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);ru=e&&e[1]||""}return`
`+ru+t}var nu=!1;function su(t,e){if(!t||nu)return"";nu=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var n=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){n=u}t.call(e.prototype)}else{try{throw Error()}catch(u){n=u}t()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var s=u.stack.split(`
`),i=n.stack.split(`
`),o=s.length-1,a=i.length-1;1<=o&&0<=a&&s[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(s[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||s[o]!==i[a]){var l=`
`+s[o].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{nu=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Ci(t):""}function x_(t){switch(t.tag){case 5:return Ci(t.type);case 16:return Ci("Lazy");case 13:return Ci("Suspense");case 19:return Ci("SuspenseList");case 0:case 2:case 15:return t=su(t.type,!1),t;case 11:return t=su(t.type.render,!1),t;case 1:return t=su(t.type,!0),t;default:return""}}function Qu(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case vs:return"Fragment";case gs:return"Portal";case qu:return"Profiler";case kd:return"StrictMode";case Ku:return"Suspense";case Gu:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case tg:return(t.displayName||"Context")+".Consumer";case eg:return(t._context.displayName||"Context")+".Provider";case Td:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Cd:return e=t.displayName||null,e!==null?e:Qu(t.type)||"Memo";case Ur:e=t._payload,t=t._init;try{return Qu(t(e))}catch{}}return null}function S_(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qu(e);case 8:return e===kd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function cn(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ng(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function E_(t){var e=ng(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,i=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Do(t){t._valueTracker||(t._valueTracker=E_(t))}function sg(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=ng(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function Pa(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Zu(t,e){var r=e.checked;return Ee({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function Yh(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=cn(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function ig(t,e){e=e.checked,e!=null&&Ed(t,"checked",e,!1)}function Ju(t,e){ig(t,e);var r=cn(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Yu(t,e.type,r):e.hasOwnProperty("defaultValue")&&Yu(t,e.type,cn(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Xh(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function Yu(t,e,r){(e!=="number"||Pa(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Oi=Array.isArray;function Os(t,e,r,n){if(t=t.options,e){e={};for(var s=0;s<r.length;s++)e["$"+r[s]]=!0;for(r=0;r<t.length;r++)s=e.hasOwnProperty("$"+t[r].value),t[r].selected!==s&&(t[r].selected=s),s&&n&&(t[r].defaultSelected=!0)}else{for(r=""+cn(r),e=null,s=0;s<t.length;s++){if(t[s].value===r){t[s].selected=!0,n&&(t[s].defaultSelected=!0);return}e!==null||t[s].disabled||(e=t[s])}e!==null&&(e.selected=!0)}}function Xu(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(R(91));return Ee({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function ef(t,e){var r=e.value;if(r==null){if(r=e.children,e=e.defaultValue,r!=null){if(e!=null)throw Error(R(92));if(Oi(r)){if(1<r.length)throw Error(R(93));r=r[0]}e=r}e==null&&(e=""),r=e}t._wrapperState={initialValue:cn(r)}}function og(t,e){var r=cn(e.value),n=cn(e.defaultValue);r!=null&&(r=""+r,r!==t.value&&(t.value=r),e.defaultValue==null&&t.defaultValue!==r&&(t.defaultValue=r)),n!=null&&(t.defaultValue=""+n)}function tf(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function ag(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ec(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?ag(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Mo,lg=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,r,n,s){MSApp.execUnsafeLocalFunction(function(){return t(e,r,n,s)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Mo=Mo||document.createElement("div"),Mo.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Mo.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function qi(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Ni={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},k_=["Webkit","ms","Moz","O"];Object.keys(Ni).forEach(function(t){k_.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Ni[e]=Ni[t]})});function ug(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Ni.hasOwnProperty(t)&&Ni[t]?(""+e).trim():e+"px"}function cg(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=ug(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,s):t[r]=s}}var T_=Ee({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 tc(t,e){if(e){if(T_[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(R(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(R(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(R(61))}if(e.style!=null&&typeof e.style!="object")throw Error(R(62))}}function rc(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var nc=null;function Od(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var sc=null,Ps=null,Rs=null;function rf(t){if(t=ko(t)){if(typeof sc!="function")throw Error(R(280));var e=t.stateNode;e&&(e=xl(e),sc(t.stateNode,t.type,e))}}function dg(t){Ps?Rs?Rs.push(t):Rs=[t]:Ps=t}function hg(){if(Ps){var t=Ps,e=Rs;if(Rs=Ps=null,rf(t),e)for(t=0;t<e.length;t++)rf(e[t])}}function fg(t,e){return t(e)}function pg(){}var iu=!1;function mg(t,e,r){if(iu)return t(e,r);iu=!0;try{return fg(t,e,r)}finally{iu=!1,(Ps!==null||Rs!==null)&&(pg(),hg())}}function Ki(t,e){var r=t.stateNode;if(r===null)return null;var n=xl(r);if(n===null)return null;r=n[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(t=t.type,n=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!n;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(R(231,e,typeof r));return r}var ic=!1;if(wr)try{var yi={};Object.defineProperty(yi,"passive",{get:function(){ic=!0}}),window.addEventListener("test",yi,yi),window.removeEventListener("test",yi,yi)}catch{ic=!1}function C_(t,e,r,n,s,i,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{e.apply(r,u)}catch(c){this.onError(c)}}var Ii=!1,Ra=null,Aa=!1,oc=null,O_={onError:function(t){Ii=!0,Ra=t}};function P_(t,e,r,n,s,i,o,a,l){Ii=!1,Ra=null,C_.apply(O_,arguments)}function R_(t,e,r,n,s,i,o,a,l){if(P_.apply(this,arguments),Ii){if(Ii){var u=Ra;Ii=!1,Ra=null}else throw Error(R(198));Aa||(Aa=!0,oc=u)}}function Xn(t){var e=t,r=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(r=e.return),t=e.return;while(t)}return e.tag===3?r:null}function gg(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function nf(t){if(Xn(t)!==t)throw Error(R(188))}function A_(t){var e=t.alternate;if(!e){if(e=Xn(t),e===null)throw Error(R(188));return e!==t?null:t}for(var r=t,n=e;;){var s=r.return;if(s===null)break;var i=s.alternate;if(i===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===r)return nf(s),t;if(i===n)return nf(s),e;i=i.sibling}throw Error(R(188))}if(r.return!==n.return)r=s,n=i;else{for(var o=!1,a=s.child;a;){if(a===r){o=!0,r=s,n=i;break}if(a===n){o=!0,n=s,r=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===r){o=!0,r=i,n=s;break}if(a===n){o=!0,n=i,r=s;break}a=a.sibling}if(!o)throw Error(R(189))}}if(r.alternate!==n)throw Error(R(190))}if(r.tag!==3)throw Error(R(188));return r.stateNode.current===r?t:e}function vg(t){return t=A_(t),t!==null?yg(t):null}function yg(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=yg(t);if(e!==null)return e;t=t.sibling}return null}var wg=yt.unstable_scheduleCallback,sf=yt.unstable_cancelCallback,j_=yt.unstable_shouldYield,N_=yt.unstable_requestPaint,Oe=yt.unstable_now,I_=yt.unstable_getCurrentPriorityLevel,Pd=yt.unstable_ImmediatePriority,_g=yt.unstable_UserBlockingPriority,ja=yt.unstable_NormalPriority,$_=yt.unstable_LowPriority,bg=yt.unstable_IdlePriority,yl=null,sr=null;function L_(t){if(sr&&typeof sr.onCommitFiberRoot=="function")try{sr.onCommitFiberRoot(yl,t,void 0,(t.current.flags&128)===128)}catch{}}var Ht=Math.clz32?Math.clz32:U_,D_=Math.log,M_=Math.LN2;function U_(t){return t>>>=0,t===0?32:31-(D_(t)/M_|0)|0}var Uo=64,Fo=4194304;function Pi(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Na(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,s=t.suspendedLanes,i=t.pingedLanes,o=r&268435455;if(o!==0){var a=o&~s;a!==0?n=Pi(a):(i&=o,i!==0&&(n=Pi(i)))}else o=r&~s,o!==0?n=Pi(o):i!==0&&(n=Pi(i));if(n===0)return 0;if(e!==0&&e!==n&&!(e&s)&&(s=n&-n,i=e&-e,s>=i||s===16&&(i&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0<e;)r=31-Ht(e),s=1<<r,n|=t[r],e&=~s;return n}function F_(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function B_(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,s=t.expirationTimes,i=t.pendingLanes;0<i;){var o=31-Ht(i),a=1<<o,l=s[o];l===-1?(!(a&r)||a&n)&&(s[o]=F_(a,e)):l<=e&&(t.expiredLanes|=a),i&=~a}}function ac(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function xg(){var t=Uo;return Uo<<=1,!(Uo&4194240)&&(Uo=64),t}function ou(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function So(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Ht(e),t[e]=r}function z_(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0<r;){var s=31-Ht(r),i=1<<s;e[s]=0,n[s]=-1,t[s]=-1,r&=~i}}function Rd(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var n=31-Ht(r),s=1<<n;s&e|t[n]&e&&(t[n]|=e),r&=~s}}var he=0;function Sg(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var Eg,Ad,kg,Tg,Cg,lc=!1,Bo=[],en=null,tn=null,rn=null,Gi=new Map,Qi=new Map,zr=[],V_="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 of(t,e){switch(t){case"focusin":case"focusout":en=null;break;case"dragenter":case"dragleave":tn=null;break;case"mouseover":case"mouseout":rn=null;break;case"pointerover":case"pointerout":Gi.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qi.delete(e.pointerId)}}function wi(t,e,r,n,s,i){return t===null||t.nativeEvent!==i?(t={blockedOn:e,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[s]},e!==null&&(e=ko(e),e!==null&&Ad(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,s!==null&&e.indexOf(s)===-1&&e.push(s),t)}function W_(t,e,r,n,s){switch(e){case"focusin":return en=wi(en,t,e,r,n,s),!0;case"dragenter":return tn=wi(tn,t,e,r,n,s),!0;case"mouseover":return rn=wi(rn,t,e,r,n,s),!0;case"pointerover":var i=s.pointerId;return Gi.set(i,wi(Gi.get(i)||null,t,e,r,n,s)),!0;case"gotpointercapture":return i=s.pointerId,Qi.set(i,wi(Qi.get(i)||null,t,e,r,n,s)),!0}return!1}function Og(t){var e=Nn(t.target);if(e!==null){var r=Xn(e);if(r!==null){if(e=r.tag,e===13){if(e=gg(r),e!==null){t.blockedOn=e,Cg(t.priority,function(){kg(r)});return}}else if(e===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function ma(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=uc(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(r===null){r=t.nativeEvent;var n=new r.constructor(r.type,r);nc=n,r.target.dispatchEvent(n),nc=null}else return e=ko(r),e!==null&&Ad(e),t.blockedOn=r,!1;e.shift()}return!0}function af(t,e,r){ma(t)&&r.delete(e)}function H_(){lc=!1,en!==null&&ma(en)&&(en=null),tn!==null&&ma(tn)&&(tn=null),rn!==null&&ma(rn)&&(rn=null),Gi.forEach(af),Qi.forEach(af)}function _i(t,e){t.blockedOn===e&&(t.blockedOn=null,lc||(lc=!0,yt.unstable_scheduleCallback(yt.unstable_NormalPriority,H_)))}function Zi(t){function e(s){return _i(s,t)}if(0<Bo.length){_i(Bo[0],t);for(var r=1;r<Bo.length;r++){var n=Bo[r];n.blockedOn===t&&(n.blockedOn=null)}}for(en!==null&&_i(en,t),tn!==null&&_i(tn,t),rn!==null&&_i(rn,t),Gi.forEach(e),Qi.forEach(e),r=0;r<zr.length;r++)n=zr[r],n.blockedOn===t&&(n.blockedOn=null);for(;0<zr.length&&(r=zr[0],r.blockedOn===null);)Og(r),r.blockedOn===null&&zr.shift()}var As=Tr.ReactCurrentBatchConfig,Ia=!0;function q_(t,e,r,n){var s=he,i=As.transition;As.transition=null;try{he=1,jd(t,e,r,n)}finally{he=s,As.transition=i}}function K_(t,e,r,n){var s=he,i=As.transition;As.transition=null;try{he=4,jd(t,e,r,n)}finally{he=s,As.transition=i}}function jd(t,e,r,n){if(Ia){var s=uc(t,e,r,n);if(s===null)gu(t,e,n,$a,r),of(t,n);else if(W_(s,t,e,r,n))n.stopPropagation();else if(of(t,n),e&4&&-1<V_.indexOf(t)){for(;s!==null;){var i=ko(s);if(i!==null&&Eg(i),i=uc(t,e,r,n),i===null&&gu(t,e,n,$a,r),i===s)break;s=i}s!==null&&n.stopPropagation()}else gu(t,e,n,null,r)}}var $a=null;function uc(t,e,r,n){if($a=null,t=Od(n),t=Nn(t),t!==null)if(e=Xn(t),e===null)t=null;else if(r=e.tag,r===13){if(t=gg(e),t!==null)return t;t=null}else if(r===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return $a=t,null}function Pg(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(I_()){case Pd:return 1;case _g:return 4;case ja:case $_:return 16;case bg:return 536870912;default:return 16}default:return 16}}var Zr=null,Nd=null,ga=null;function Rg(){if(ga)return ga;var t,e=Nd,r=e.length,n,s="value"in Zr?Zr.value:Zr.textContent,i=s.length;for(t=0;t<r&&e[t]===s[t];t++);var o=r-t;for(n=1;n<=o&&e[r-n]===s[i-n];n++);return ga=s.slice(t,1<n?1-n:void 0)}function va(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function zo(){return!0}function lf(){return!1}function bt(t){function e(r,n,s,i,o){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(r=t[a],this[a]=r?r(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?zo:lf,this.isPropagationStopped=lf,this}return Ee(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=zo)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=zo)},persist:function(){},isPersistent:zo}),e}var ai={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Id=bt(ai),Eo=Ee({},ai,{view:0,detail:0}),G_=bt(Eo),au,lu,bi,wl=Ee({},Eo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$d,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==bi&&(bi&&t.type==="mousemove"?(au=t.screenX-bi.screenX,lu=t.screenY-bi.screenY):lu=au=0,bi=t),au)},movementY:function(t){return"movementY"in t?t.movementY:lu}}),uf=bt(wl),Q_=Ee({},wl,{dataTransfer:0}),Z_=bt(Q_),J_=Ee({},Eo,{relatedTarget:0}),uu=bt(J_),Y_=Ee({},ai,{animationName:0,elapsedTime:0,pseudoElement:0}),X_=bt(Y_),eb=Ee({},ai,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),tb=bt(eb),rb=Ee({},ai,{data:0}),cf=bt(rb),nb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},sb={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"},ib={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ob(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=ib[t])?!!e[t]:!1}function $d(){return ob}var ab=Ee({},Eo,{key:function(t){if(t.key){var e=nb[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=va(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?sb[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$d,charCode:function(t){return t.type==="keypress"?va(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?va(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),lb=bt(ab),ub=Ee({},wl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),df=bt(ub),cb=Ee({},Eo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$d}),db=bt(cb),hb=Ee({},ai,{propertyName:0,elapsedTime:0,pseudoElement:0}),fb=bt(hb),pb=Ee({},wl,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),mb=bt(pb),gb=[9,13,27,32],Ld=wr&&"CompositionEvent"in window,$i=null;wr&&"documentMode"in document&&($i=document.documentMode);var vb=wr&&"TextEvent"in window&&!$i,Ag=wr&&(!Ld||$i&&8<$i&&11>=$i),hf=" ",ff=!1;function jg(t,e){switch(t){case"keyup":return gb.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ng(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ys=!1;function yb(t,e){switch(t){case"compositionend":return Ng(e);case"keypress":return e.which!==32?null:(ff=!0,hf);case"textInput":return t=e.data,t===hf&&ff?null:t;default:return null}}function wb(t,e){if(ys)return t==="compositionend"||!Ld&&jg(t,e)?(t=Rg(),ga=Nd=Zr=null,ys=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Ag&&e.locale!=="ko"?null:e.data;default:return null}}var _b={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 pf(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!_b[t.type]:e==="textarea"}function Ig(t,e,r,n){dg(n),e=La(e,"onChange"),0<e.length&&(r=new Id("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var Li=null,Ji=null;function bb(t){Hg(t,0)}function _l(t){var e=bs(t);if(sg(e))return t}function xb(t,e){if(t==="change")return e}var $g=!1;if(wr){var cu;if(wr){var du="oninput"in document;if(!du){var mf=document.createElement("div");mf.setAttribute("oninput","return;"),du=typeof mf.oninput=="function"}cu=du}else cu=!1;$g=cu&&(!document.documentMode||9<document.documentMode)}function gf(){Li&&(Li.detachEvent("onpropertychange",Lg),Ji=Li=null)}function Lg(t){if(t.propertyName==="value"&&_l(Ji)){var e=[];Ig(e,Ji,t,Od(t)),mg(bb,e)}}function Sb(t,e,r){t==="focusin"?(gf(),Li=e,Ji=r,Li.attachEvent("onpropertychange",Lg)):t==="focusout"&&gf()}function Eb(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return _l(Ji)}function kb(t,e){if(t==="click")return _l(e)}function Tb(t,e){if(t==="input"||t==="change")return _l(e)}function Cb(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Kt=typeof Object.is=="function"?Object.is:Cb;function Yi(t,e){if(Kt(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!Hu.call(e,s)||!Kt(t[s],e[s]))return!1}return!0}function vf(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function yf(t,e){var r=vf(t);t=0;for(var n;r;){if(r.nodeType===3){if(n=t+r.textContent.length,t<=e&&n>=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=vf(r)}}function Dg(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Dg(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Mg(){for(var t=window,e=Pa();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=Pa(t.document)}return e}function Dd(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Ob(t){var e=Mg(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&Dg(r.ownerDocument.documentElement,r)){if(n!==null&&Dd(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var s=r.textContent.length,i=Math.min(n.start,s);n=n.end===void 0?i:Math.min(n.end,s),!t.extend&&i>n&&(s=n,n=i,i=s),s=yf(r,i);var o=yf(r,n);s&&o&&(t.rangeCount!==1||t.anchorNode!==s.node||t.anchorOffset!==s.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),t.removeAllRanges(),i>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<e.length;r++)t=e[r],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var Pb=wr&&"documentMode"in document&&11>=document.documentMode,ws=null,cc=null,Di=null,dc=!1;function wf(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;dc||ws==null||ws!==Pa(n)||(n=ws,"selectionStart"in n&&Dd(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Di&&Yi(Di,n)||(Di=n,n=La(cc,"onSelect"),0<n.length&&(e=new Id("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=ws)))}function Vo(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var _s={animationend:Vo("Animation","AnimationEnd"),animationiteration:Vo("Animation","AnimationIteration"),animationstart:Vo("Animation","AnimationStart"),transitionend:Vo("Transition","TransitionEnd")},hu={},Ug={};wr&&(Ug=document.createElement("div").style,"AnimationEvent"in window||(delete _s.animationend.animation,delete _s.animationiteration.animation,delete _s.animationstart.animation),"TransitionEvent"in window||delete _s.transitionend.transition);function bl(t){if(hu[t])return hu[t];if(!_s[t])return t;var e=_s[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in Ug)return hu[t]=e[r];return t}var Fg=bl("animationend"),Bg=bl("animationiteration"),zg=bl("animationstart"),Vg=bl("transitionend"),Wg=new Map,_f="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 yn(t,e){Wg.set(t,e),Yn(e,[t])}for(var fu=0;fu<_f.length;fu++){var pu=_f[fu],Rb=pu.toLowerCase(),Ab=pu[0].toUpperCase()+pu.slice(1);yn(Rb,"on"+Ab)}yn(Fg,"onAnimationEnd");yn(Bg,"onAnimationIteration");yn(zg,"onAnimationStart");yn("dblclick","onDoubleClick");yn("focusin","onFocus");yn("focusout","onBlur");yn(Vg,"onTransitionEnd");qs("onMouseEnter",["mouseout","mouseover"]);qs("onMouseLeave",["mouseout","mouseover"]);qs("onPointerEnter",["pointerout","pointerover"]);qs("onPointerLeave",["pointerout","pointerover"]);Yn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Yn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Yn("onBeforeInput",["compositionend","keypress","textInput","paste"]);Yn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Yn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Yn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ri="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(" "),jb=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ri));function bf(t,e,r){var n=t.type||"unknown-event";t.currentTarget=r,R_(n,e,void 0,t),t.currentTarget=null}function Hg(t,e){e=(e&4)!==0;for(var r=0;r<t.length;r++){var n=t[r],s=n.event;n=n.listeners;e:{var i=void 0;if(e)for(var o=n.length-1;0<=o;o--){var a=n[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==i&&s.isPropagationStopped())break e;bf(s,a,u),i=l}else for(o=0;o<n.length;o++){if(a=n[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==i&&s.isPropagationStopped())break e;bf(s,a,u),i=l}}}if(Aa)throw t=oc,Aa=!1,oc=null,t}function ve(t,e){var r=e[gc];r===void 0&&(r=e[gc]=new Set);var n=t+"__bubble";r.has(n)||(qg(e,t,2,!1),r.add(n))}function mu(t,e,r){var n=0;e&&(n|=4),qg(r,t,n,e)}var Wo="_reactListening"+Math.random().toString(36).slice(2);function Xi(t){if(!t[Wo]){t[Wo]=!0,Xm.forEach(function(r){r!=="selectionchange"&&(jb.has(r)||mu(r,!1,t),mu(r,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Wo]||(e[Wo]=!0,mu("selectionchange",!1,e))}}function qg(t,e,r,n){switch(Pg(e)){case 1:var s=q_;break;case 4:s=K_;break;default:s=jd}r=s.bind(null,e,r,t),s=void 0,!ic||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(s=!0),n?s!==void 0?t.addEventListener(e,r,{capture:!0,passive:s}):t.addEventListener(e,r,!0):s!==void 0?t.addEventListener(e,r,{passive:s}):t.addEventListener(e,r,!1)}function gu(t,e,r,n,s){var i=n;if(!(e&1)&&!(e&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var a=n.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=n.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;o=o.return}for(;a!==null;){if(o=Nn(a),o===null)return;if(l=o.tag,l===5||l===6){n=i=o;continue e}a=a.parentNode}}n=n.return}mg(function(){var u=i,c=Od(r),h=[];e:{var f=Wg.get(t);if(f!==void 0){var d=Id,y=t;switch(t){case"keypress":if(va(r)===0)break e;case"keydown":case"keyup":d=lb;break;case"focusin":y="focus",d=uu;break;case"focusout":y="blur",d=uu;break;case"beforeblur":case"afterblur":d=uu;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":d=uf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":d=Z_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":d=db;break;case Fg:case Bg:case zg:d=X_;break;case Vg:d=fb;break;case"scroll":d=G_;break;case"wheel":d=mb;break;case"copy":case"cut":case"paste":d=tb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":d=df}var g=(e&4)!==0,w=!g&&t==="scroll",m=g?f!==null?f+"Capture":null:f;g=[];for(var p=u,v;p!==null;){v=p;var _=v.stateNode;if(v.tag===5&&_!==null&&(v=_,m!==null&&(_=Ki(p,m),_!=null&&g.push(eo(p,_,v)))),w)break;p=p.return}0<g.length&&(f=new d(f,y,null,r,c),h.push({event:f,listeners:g}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",d=t==="mouseout"||t==="pointerout",f&&r!==nc&&(y=r.relatedTarget||r.fromElement)&&(Nn(y)||y[_r]))break e;if((d||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,d?(y=r.relatedTarget||r.toElement,d=u,y=y?Nn(y):null,y!==null&&(w=Xn(y),y!==w||y.tag!==5&&y.tag!==6)&&(y=null)):(d=null,y=u),d!==y)){if(g=uf,_="onMouseLeave",m="onMouseEnter",p="mouse",(t==="pointerout"||t==="pointerover")&&(g=df,_="onPointerLeave",m="onPointerEnter",p="pointer"),w=d==null?f:bs(d),v=y==null?f:bs(y),f=new g(_,p+"leave",d,r,c),f.target=w,f.relatedTarget=v,_=null,Nn(c)===u&&(g=new g(m,p+"enter",y,r,c),g.target=v,g.relatedTarget=w,_=g),w=_,d&&y)t:{for(g=d,m=y,p=0,v=g;v;v=os(v))p++;for(v=0,_=m;_;_=os(_))v++;for(;0<p-v;)g=os(g),p--;for(;0<v-p;)m=os(m),v--;for(;p--;){if(g===m||m!==null&&g===m.alternate)break t;g=os(g),m=os(m)}g=null}else g=null;d!==null&&xf(h,f,d,g,!1),y!==null&&w!==null&&xf(h,w,y,g,!0)}}e:{if(f=u?bs(u):window,d=f.nodeName&&f.nodeName.toLowerCase(),d==="select"||d==="input"&&f.type==="file")var x=xb;else if(pf(f))if($g)x=Tb;else{x=Eb;var E=Sb}else(d=f.nodeName)&&d.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(x=kb);if(x&&(x=x(t,u))){Ig(h,x,r,c);break e}E&&E(t,f,u),t==="focusout"&&(E=f._wrapperState)&&E.controlled&&f.type==="number"&&Yu(f,"number",f.value)}switch(E=u?bs(u):window,t){case"focusin":(pf(E)||E.contentEditable==="true")&&(ws=E,cc=u,Di=null);break;case"focusout":Di=cc=ws=null;break;case"mousedown":dc=!0;break;case"contextmenu":case"mouseup":case"dragend":dc=!1,wf(h,r,c);break;case"selectionchange":if(Pb)break;case"keydown":case"keyup":wf(h,r,c)}var k;if(Ld)e:{switch(t){case"compositionstart":var O="onCompositionStart";break e;case"compositionend":O="onCompositionEnd";break e;case"compositionupdate":O="onCompositionUpdate";break e}O=void 0}else ys?jg(t,r)&&(O="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(O="onCompositionStart");O&&(Ag&&r.locale!=="ko"&&(ys||O!=="onCompositionStart"?O==="onCompositionEnd"&&ys&&(k=Rg()):(Zr=c,Nd="value"in Zr?Zr.value:Zr.textContent,ys=!0)),E=La(u,O),0<E.length&&(O=new cf(O,t,null,r,c),h.push({event:O,listeners:E}),k?O.data=k:(k=Ng(r),k!==null&&(O.data=k)))),(k=vb?yb(t,r):wb(t,r))&&(u=La(u,"onBeforeInput"),0<u.length&&(c=new cf("onBeforeInput","beforeinput",null,r,c),h.push({event:c,listeners:u}),c.data=k))}Hg(h,e)})}function eo(t,e,r){return{instance:t,listener:e,currentTarget:r}}function La(t,e){for(var r=e+"Capture",n=[];t!==null;){var s=t,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Ki(t,r),i!=null&&n.unshift(eo(t,i,s)),i=Ki(t,e),i!=null&&n.push(eo(t,i,s))),t=t.return}return n}function os(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function xf(t,e,r,n,s){for(var i=e._reactName,o=[];r!==null&&r!==n;){var a=r,l=a.alternate,u=a.stateNode;if(l!==null&&l===n)break;a.tag===5&&u!==null&&(a=u,s?(l=Ki(r,i),l!=null&&o.unshift(eo(r,l,a))):s||(l=Ki(r,i),l!=null&&o.push(eo(r,l,a)))),r=r.return}o.length!==0&&t.push({event:e,listeners:o})}var Nb=/\r\n?/g,Ib=/\u0000|\uFFFD/g;function Sf(t){return(typeof t=="string"?t:""+t).replace(Nb,`
`).replace(Ib,"")}function Ho(t,e,r){if(e=Sf(e),Sf(t)!==e&&r)throw Error(R(425))}function Da(){}var hc=null,fc=null;function pc(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var mc=typeof setTimeout=="function"?setTimeout:void 0,$b=typeof clearTimeout=="function"?clearTimeout:void 0,Ef=typeof Promise=="function"?Promise:void 0,Lb=typeof queueMicrotask=="function"?queueMicrotask:typeof Ef<"u"?function(t){return Ef.resolve(null).then(t).catch(Db)}:mc;function Db(t){setTimeout(function(){throw t})}function vu(t,e){var r=e,n=0;do{var s=r.nextSibling;if(t.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){t.removeChild(s),Zi(e);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);Zi(e)}function nn(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function kf(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"){if(e===0)return t;e--}else r==="/$"&&e++}t=t.previousSibling}return null}var li=Math.random().toString(36).slice(2),rr="__reactFiber$"+li,to="__reactProps$"+li,_r="__reactContainer$"+li,gc="__reactEvents$"+li,Mb="__reactListeners$"+li,Ub="__reactHandles$"+li;function Nn(t){var e=t[rr];if(e)return e;for(var r=t.parentNode;r;){if(e=r[_r]||r[rr]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=kf(t);t!==null;){if(r=t[rr])return r;t=kf(t)}return e}t=r,r=t.parentNode}return null}function ko(t){return t=t[rr]||t[_r],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function bs(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(R(33))}function xl(t){return t[to]||null}var vc=[],xs=-1;function wn(t){return{current:t}}function ye(t){0>xs||(t.current=vc[xs],vc[xs]=null,xs--)}function me(t,e){xs++,vc[xs]=t.current,t.current=e}var dn={},Ge=wn(dn),it=wn(!1),Hn=dn;function Ks(t,e){var r=t.type.contextTypes;if(!r)return dn;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in r)s[i]=e[i];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function ot(t){return t=t.childContextTypes,t!=null}function Ma(){ye(it),ye(Ge)}function Tf(t,e,r){if(Ge.current!==dn)throw Error(R(168));me(Ge,e),me(it,r)}function Kg(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in e))throw Error(R(108,S_(t)||"Unknown",s));return Ee({},r,n)}function Ua(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||dn,Hn=Ge.current,me(Ge,t),me(it,it.current),!0}function Cf(t,e,r){var n=t.stateNode;if(!n)throw Error(R(169));r?(t=Kg(t,e,Hn),n.__reactInternalMemoizedMergedChildContext=t,ye(it),ye(Ge),me(Ge,t)):ye(it),me(it,r)}var pr=null,Sl=!1,yu=!1;function Gg(t){pr===null?pr=[t]:pr.push(t)}function Fb(t){Sl=!0,Gg(t)}function _n(){if(!yu&&pr!==null){yu=!0;var t=0,e=he;try{var r=pr;for(he=1;t<r.length;t++){var n=r[t];do n=n(!0);while(n!==null)}pr=null,Sl=!1}catch(s){throw pr!==null&&(pr=pr.slice(t+1)),wg(Pd,_n),s}finally{he=e,yu=!1}}return null}var Ss=[],Es=0,Fa=null,Ba=0,Et=[],kt=0,qn=null,gr=1,vr="";function Cn(t,e){Ss[Es++]=Ba,Ss[Es++]=Fa,Fa=t,Ba=e}function Qg(t,e,r){Et[kt++]=gr,Et[kt++]=vr,Et[kt++]=qn,qn=t;var n=gr;t=vr;var s=32-Ht(n)-1;n&=~(1<<s),r+=1;var i=32-Ht(e)+s;if(30<i){var o=s-s%5;i=(n&(1<<o)-1).toString(32),n>>=o,s-=o,gr=1<<32-Ht(e)+s|r<<s|n,vr=i+t}else gr=1<<i|r<<s|n,vr=t}function Md(t){t.return!==null&&(Cn(t,1),Qg(t,1,0))}function Ud(t){for(;t===Fa;)Fa=Ss[--Es],Ss[Es]=null,Ba=Ss[--Es],Ss[Es]=null;for(;t===qn;)qn=Et[--kt],Et[kt]=null,vr=Et[--kt],Et[kt]=null,gr=Et[--kt],Et[kt]=null}var gt=null,mt=null,_e=!1,Wt=null;function Zg(t,e){var r=Tt(5,null,null,0);r.elementType="DELETED",r.stateNode=e,r.return=t,e=t.deletions,e===null?(t.deletions=[r],t.flags|=16):e.push(r)}function Of(t,e){switch(t.tag){case 5:var r=t.type;return e=e.nodeType!==1||r.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,gt=t,mt=nn(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,gt=t,mt=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(r=qn!==null?{id:gr,overflow:vr}:null,t.memoizedState={dehydrated:e,treeContext:r,retryLane:1073741824},r=Tt(18,null,null,0),r.stateNode=e,r.return=t,t.child=r,gt=t,mt=null,!0):!1;default:return!1}}function yc(t){return(t.mode&1)!==0&&(t.flags&128)===0}function wc(t){if(_e){var e=mt;if(e){var r=e;if(!Of(t,e)){if(yc(t))throw Error(R(418));e=nn(r.nextSibling);var n=gt;e&&Of(t,e)?Zg(n,r):(t.flags=t.flags&-4097|2,_e=!1,gt=t)}}else{if(yc(t))throw Error(R(418));t.flags=t.flags&-4097|2,_e=!1,gt=t}}}function Pf(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;gt=t}function qo(t){if(t!==gt)return!1;if(!_e)return Pf(t),_e=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!pc(t.type,t.memoizedProps)),e&&(e=mt)){if(yc(t))throw Jg(),Error(R(418));for(;e;)Zg(t,e),e=nn(e.nextSibling)}if(Pf(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(R(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"){if(e===0){mt=nn(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++}t=t.nextSibling}mt=null}}else mt=gt?nn(t.stateNode.nextSibling):null;return!0}function Jg(){for(var t=mt;t;)t=nn(t.nextSibling)}function Gs(){mt=gt=null,_e=!1}function Fd(t){Wt===null?Wt=[t]:Wt.push(t)}var Bb=Tr.ReactCurrentBatchConfig;function xi(t,e,r){if(t=r.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(R(309));var n=r.stateNode}if(!n)throw Error(R(147,t));var s=n,i=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===i?e.ref:(e=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},e._stringRef=i,e)}if(typeof t!="string")throw Error(R(284));if(!r._owner)throw Error(R(290,t))}return t}function Ko(t,e){throw t=Object.prototype.toString.call(e),Error(R(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Rf(t){var e=t._init;return e(t._payload)}function Yg(t){function e(m,p){if(t){var v=m.deletions;v===null?(m.deletions=[p],m.flags|=16):v.push(p)}}function r(m,p){if(!t)return null;for(;p!==null;)e(m,p),p=p.sibling;return null}function n(m,p){for(m=new Map;p!==null;)p.key!==null?m.set(p.key,p):m.set(p.index,p),p=p.sibling;return m}function s(m,p){return m=ln(m,p),m.index=0,m.sibling=null,m}function i(m,p,v){return m.index=v,t?(v=m.alternate,v!==null?(v=v.index,v<p?(m.flags|=2,p):v):(m.flags|=2,p)):(m.flags|=1048576,p)}function o(m){return t&&m.alternate===null&&(m.flags|=2),m}function a(m,p,v,_){return p===null||p.tag!==6?(p=ku(v,m.mode,_),p.return=m,p):(p=s(p,v),p.return=m,p)}function l(m,p,v,_){var x=v.type;return x===vs?c(m,p,v.props.children,_,v.key):p!==null&&(p.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Ur&&Rf(x)===p.type)?(_=s(p,v.props),_.ref=xi(m,p,v),_.return=m,_):(_=Ea(v.type,v.key,v.props,null,m.mode,_),_.ref=xi(m,p,v),_.return=m,_)}function u(m,p,v,_){return p===null||p.tag!==4||p.stateNode.containerInfo!==v.containerInfo||p.stateNode.implementation!==v.implementation?(p=Tu(v,m.mode,_),p.return=m,p):(p=s(p,v.children||[]),p.return=m,p)}function c(m,p,v,_,x){return p===null||p.tag!==7?(p=Wn(v,m.mode,_,x),p.return=m,p):(p=s(p,v),p.return=m,p)}function h(m,p,v){if(typeof p=="string"&&p!==""||typeof p=="number")return p=ku(""+p,m.mode,v),p.return=m,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Lo:return v=Ea(p.type,p.key,p.props,null,m.mode,v),v.ref=xi(m,null,p),v.return=m,v;case gs:return p=Tu(p,m.mode,v),p.return=m,p;case Ur:var _=p._init;return h(m,_(p._payload),v)}if(Oi(p)||vi(p))return p=Wn(p,m.mode,v,null),p.return=m,p;Ko(m,p)}return null}function f(m,p,v,_){var x=p!==null?p.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return x!==null?null:a(m,p,""+v,_);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Lo:return v.key===x?l(m,p,v,_):null;case gs:return v.key===x?u(m,p,v,_):null;case Ur:return x=v._init,f(m,p,x(v._payload),_)}if(Oi(v)||vi(v))return x!==null?null:c(m,p,v,_,null);Ko(m,v)}return null}function d(m,p,v,_,x){if(typeof _=="string"&&_!==""||typeof _=="number")return m=m.get(v)||null,a(p,m,""+_,x);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Lo:return m=m.get(_.key===null?v:_.key)||null,l(p,m,_,x);case gs:return m=m.get(_.key===null?v:_.key)||null,u(p,m,_,x);case Ur:var E=_._init;return d(m,p,v,E(_._payload),x)}if(Oi(_)||vi(_))return m=m.get(v)||null,c(p,m,_,x,null);Ko(p,_)}return null}function y(m,p,v,_){for(var x=null,E=null,k=p,O=p=0,j=null;k!==null&&O<v.length;O++){k.index>O?(j=k,k=null):j=k.sibling;var I=f(m,k,v[O],_);if(I===null){k===null&&(k=j);break}t&&k&&I.alternate===null&&e(m,k),p=i(I,p,O),E===null?x=I:E.sibling=I,E=I,k=j}if(O===v.length)return r(m,k),_e&&Cn(m,O),x;if(k===null){for(;O<v.length;O++)k=h(m,v[O],_),k!==null&&(p=i(k,p,O),E===null?x=k:E.sibling=k,E=k);return _e&&Cn(m,O),x}for(k=n(m,k);O<v.length;O++)j=d(k,m,O,v[O],_),j!==null&&(t&&j.alternate!==null&&k.delete(j.key===null?O:j.key),p=i(j,p,O),E===null?x=j:E.sibling=j,E=j);return t&&k.forEach(function(q){return e(m,q)}),_e&&Cn(m,O),x}function g(m,p,v,_){var x=vi(v);if(typeof x!="function")throw Error(R(150));if(v=x.call(v),v==null)throw Error(R(151));for(var E=x=null,k=p,O=p=0,j=null,I=v.next();k!==null&&!I.done;O++,I=v.next()){k.index>O?(j=k,k=null):j=k.sibling;var q=f(m,k,I.value,_);if(q===null){k===null&&(k=j);break}t&&k&&q.alternate===null&&e(m,k),p=i(q,p,O),E===null?x=q:E.sibling=q,E=q,k=j}if(I.done)return r(m,k),_e&&Cn(m,O),x;if(k===null){for(;!I.done;O++,I=v.next())I=h(m,I.value,_),I!==null&&(p=i(I,p,O),E===null?x=I:E.sibling=I,E=I);return _e&&Cn(m,O),x}for(k=n(m,k);!I.done;O++,I=v.next())I=d(k,m,O,I.value,_),I!==null&&(t&&I.alternate!==null&&k.delete(I.key===null?O:I.key),p=i(I,p,O),E===null?x=I:E.sibling=I,E=I);return t&&k.forEach(function(F){return e(m,F)}),_e&&Cn(m,O),x}function w(m,p,v,_){if(typeof v=="object"&&v!==null&&v.type===vs&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Lo:e:{for(var x=v.key,E=p;E!==null;){if(E.key===x){if(x=v.type,x===vs){if(E.tag===7){r(m,E.sibling),p=s(E,v.props.children),p.return=m,m=p;break e}}else if(E.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Ur&&Rf(x)===E.type){r(m,E.sibling),p=s(E,v.props),p.ref=xi(m,E,v),p.return=m,m=p;break e}r(m,E);break}else e(m,E);E=E.sibling}v.type===vs?(p=Wn(v.props.children,m.mode,_,v.key),p.return=m,m=p):(_=Ea(v.type,v.key,v.props,null,m.mode,_),_.ref=xi(m,p,v),_.return=m,m=_)}return o(m);case gs:e:{for(E=v.key;p!==null;){if(p.key===E)if(p.tag===4&&p.stateNode.containerInfo===v.containerInfo&&p.stateNode.implementation===v.implementation){r(m,p.sibling),p=s(p,v.children||[]),p.return=m,m=p;break e}else{r(m,p);break}else e(m,p);p=p.sibling}p=Tu(v,m.mode,_),p.return=m,m=p}return o(m);case Ur:return E=v._init,w(m,p,E(v._payload),_)}if(Oi(v))return y(m,p,v,_);if(vi(v))return g(m,p,v,_);Ko(m,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,p!==null&&p.tag===6?(r(m,p.sibling),p=s(p,v),p.return=m,m=p):(r(m,p),p=ku(v,m.mode,_),p.return=m,m=p),o(m)):r(m,p)}return w}var Qs=Yg(!0),Xg=Yg(!1),za=wn(null),Va=null,ks=null,Bd=null;function zd(){Bd=ks=Va=null}function Vd(t){var e=za.current;ye(za),t._currentValue=e}function _c(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function js(t,e){Va=t,Bd=ks=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(st=!0),t.firstContext=null)}function Ot(t){var e=t._currentValue;if(Bd!==t)if(t={context:t,memoizedValue:e,next:null},ks===null){if(Va===null)throw Error(R(308));ks=t,Va.dependencies={lanes:0,firstContext:t}}else ks=ks.next=t;return e}var In=null;function Wd(t){In===null?In=[t]:In.push(t)}function ev(t,e,r,n){var s=e.interleaved;return s===null?(r.next=r,Wd(e)):(r.next=s.next,s.next=r),e.interleaved=r,br(t,n)}function br(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var Fr=!1;function Hd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function tv(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function yr(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function sn(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,ae&2){var s=n.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),n.pending=e,br(t,r)}return s=n.interleaved,s===null?(e.next=e,Wd(n)):(e.next=s.next,s.next=e),n.interleaved=e,br(t,r)}function ya(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,Rd(t,r)}}function Af(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?s=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?s=i=e:i=i.next=e}else s=i=e;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function Wa(t,e,r,n){var s=t.updateQueue;Fr=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?i=u:o.next=u,o=l;var c=t.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==o&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(i!==null){var h=s.baseState;o=0,c=u=l=null,a=i;do{var f=a.lane,d=a.eventTime;if((n&f)===f){c!==null&&(c=c.next={eventTime:d,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=t,g=a;switch(f=e,d=r,g.tag){case 1:if(y=g.payload,typeof y=="function"){h=y.call(d,h,f);break e}h=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=g.payload,f=typeof y=="function"?y.call(d,h,f):y,f==null)break e;h=Ee({},h,f);break e;case 2:Fr=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,f=s.effects,f===null?s.effects=[a]:f.push(a))}else d={eventTime:d,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=d,l=h):c=c.next=d,o|=f;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;f=a,a=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(c===null&&(l=h),s.baseState=l,s.firstBaseUpdate=u,s.lastBaseUpdate=c,e=s.shared.interleaved,e!==null){s=e;do o|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);Gn|=o,t.lanes=o,t.memoizedState=h}}function jf(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var n=t[e],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(R(191,s));s.call(n)}}}var To={},ir=wn(To),ro=wn(To),no=wn(To);function $n(t){if(t===To)throw Error(R(174));return t}function qd(t,e){switch(me(no,e),me(ro,t),me(ir,To),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:ec(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=ec(e,t)}ye(ir),me(ir,e)}function Zs(){ye(ir),ye(ro),ye(no)}function rv(t){$n(no.current);var e=$n(ir.current),r=ec(e,t.type);e!==r&&(me(ro,t),me(ir,r))}function Kd(t){ro.current===t&&(ye(ir),ye(ro))}var xe=wn(0);function Ha(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var wu=[];function Gd(){for(var t=0;t<wu.length;t++)wu[t]._workInProgressVersionPrimary=null;wu.length=0}var wa=Tr.ReactCurrentDispatcher,_u=Tr.ReactCurrentBatchConfig,Kn=0,Se=null,Ne=null,Le=null,qa=!1,Mi=!1,so=0,zb=0;function We(){throw Error(R(321))}function Qd(t,e){if(e===null)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!Kt(t[r],e[r]))return!1;return!0}function Zd(t,e,r,n,s,i){if(Kn=i,Se=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,wa.current=t===null||t.memoizedState===null?qb:Kb,t=r(n,s),Mi){i=0;do{if(Mi=!1,so=0,25<=i)throw Error(R(301));i+=1,Le=Ne=null,e.updateQueue=null,wa.current=Gb,t=r(n,s)}while(Mi)}if(wa.current=Ka,e=Ne!==null&&Ne.next!==null,Kn=0,Le=Ne=Se=null,qa=!1,e)throw Error(R(300));return t}function Jd(){var t=so!==0;return so=0,t}function Yt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Le===null?Se.memoizedState=Le=t:Le=Le.next=t,Le}function Pt(){if(Ne===null){var t=Se.alternate;t=t!==null?t.memoizedState:null}else t=Ne.next;var e=Le===null?Se.memoizedState:Le.next;if(e!==null)Le=e,Ne=t;else{if(t===null)throw Error(R(310));Ne=t,t={memoizedState:Ne.memoizedState,baseState:Ne.baseState,baseQueue:Ne.baseQueue,queue:Ne.queue,next:null},Le===null?Se.memoizedState=Le=t:Le=Le.next=t}return Le}function io(t,e){return typeof e=="function"?e(t):e}function bu(t){var e=Pt(),r=e.queue;if(r===null)throw Error(R(311));r.lastRenderedReducer=t;var n=Ne,s=n.baseQueue,i=r.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}n.baseQueue=s=i,r.pending=null}if(s!==null){i=s.next,n=n.baseState;var a=o=null,l=null,u=i;do{var c=u.lane;if((Kn&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:t(n,u.action);else{var h={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=h,o=n):l=l.next=h,Se.lanes|=c,Gn|=c}u=u.next}while(u!==null&&u!==i);l===null?o=n:l.next=a,Kt(n,e.memoizedState)||(st=!0),e.memoizedState=n,e.baseState=o,e.baseQueue=l,r.lastRenderedState=n}if(t=r.interleaved,t!==null){s=t;do i=s.lane,Se.lanes|=i,Gn|=i,s=s.next;while(s!==t)}else s===null&&(r.lanes=0);return[e.memoizedState,r.dispatch]}function xu(t){var e=Pt(),r=e.queue;if(r===null)throw Error(R(311));r.lastRenderedReducer=t;var n=r.dispatch,s=r.pending,i=e.memoizedState;if(s!==null){r.pending=null;var o=s=s.next;do i=t(i,o.action),o=o.next;while(o!==s);Kt(i,e.memoizedState)||(st=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),r.lastRenderedState=i}return[i,n]}function nv(){}function sv(t,e){var r=Se,n=Pt(),s=e(),i=!Kt(n.memoizedState,s);if(i&&(n.memoizedState=s,st=!0),n=n.queue,Yd(av.bind(null,r,n,t),[t]),n.getSnapshot!==e||i||Le!==null&&Le.memoizedState.tag&1){if(r.flags|=2048,oo(9,ov.bind(null,r,n,s,e),void 0,null),De===null)throw Error(R(349));Kn&30||iv(r,e,s)}return s}function iv(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},e=Se.updateQueue,e===null?(e={lastEffect:null,stores:null},Se.updateQueue=e,e.stores=[t]):(r=e.stores,r===null?e.stores=[t]:r.push(t))}function ov(t,e,r,n){e.value=r,e.getSnapshot=n,lv(e)&&uv(t)}function av(t,e,r){return r(function(){lv(e)&&uv(t)})}function lv(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!Kt(t,r)}catch{return!0}}function uv(t){var e=br(t,1);e!==null&&qt(e,t,1,-1)}function Nf(t){var e=Yt();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:io,lastRenderedState:t},e.queue=t,t=t.dispatch=Hb.bind(null,Se,t),[e.memoizedState,t]}function oo(t,e,r,n){return t={tag:t,create:e,destroy:r,deps:n,next:null},e=Se.updateQueue,e===null?(e={lastEffect:null,stores:null},Se.updateQueue=e,e.lastEffect=t.next=t):(r=e.lastEffect,r===null?e.lastEffect=t.next=t:(n=r.next,r.next=t,t.next=n,e.lastEffect=t)),t}function cv(){return Pt().memoizedState}function _a(t,e,r,n){var s=Yt();Se.flags|=t,s.memoizedState=oo(1|e,r,void 0,n===void 0?null:n)}function El(t,e,r,n){var s=Pt();n=n===void 0?null:n;var i=void 0;if(Ne!==null){var o=Ne.memoizedState;if(i=o.destroy,n!==null&&Qd(n,o.deps)){s.memoizedState=oo(e,r,i,n);return}}Se.flags|=t,s.memoizedState=oo(1|e,r,i,n)}function If(t,e){return _a(8390656,8,t,e)}function Yd(t,e){return El(2048,8,t,e)}function dv(t,e){return El(4,2,t,e)}function hv(t,e){return El(4,4,t,e)}function fv(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function pv(t,e,r){return r=r!=null?r.concat([t]):null,El(4,4,fv.bind(null,e,t),r)}function Xd(){}function mv(t,e){var r=Pt();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&Qd(e,n[1])?n[0]:(r.memoizedState=[t,e],t)}function gv(t,e){var r=Pt();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&Qd(e,n[1])?n[0]:(t=t(),r.memoizedState=[t,e],t)}function vv(t,e,r){return Kn&21?(Kt(r,e)||(r=xg(),Se.lanes|=r,Gn|=r,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,st=!0),t.memoizedState=r)}function Vb(t,e){var r=he;he=r!==0&&4>r?r:4,t(!0);var n=_u.transition;_u.transition={};try{t(!1),e()}finally{he=r,_u.transition=n}}function yv(){return Pt().memoizedState}function Wb(t,e,r){var n=an(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},wv(t))_v(e,r);else if(r=ev(t,e,r,n),r!==null){var s=Xe();qt(r,t,n,s),bv(r,e,n)}}function Hb(t,e,r){var n=an(t),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(wv(t))_v(e,s);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var o=e.lastRenderedState,a=i(o,r);if(s.hasEagerState=!0,s.eagerState=a,Kt(a,o)){var l=e.interleaved;l===null?(s.next=s,Wd(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}r=ev(t,e,s,n),r!==null&&(s=Xe(),qt(r,t,n,s),bv(r,e,n))}}function wv(t){var e=t.alternate;return t===Se||e!==null&&e===Se}function _v(t,e){Mi=qa=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function bv(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,Rd(t,r)}}var Ka={readContext:Ot,useCallback:We,useContext:We,useEffect:We,useImperativeHandle:We,useInsertionEffect:We,useLayoutEffect:We,useMemo:We,useReducer:We,useRef:We,useState:We,useDebugValue:We,useDeferredValue:We,useTransition:We,useMutableSource:We,useSyncExternalStore:We,useId:We,unstable_isNewReconciler:!1},qb={readContext:Ot,useCallback:function(t,e){return Yt().memoizedState=[t,e===void 0?null:e],t},useContext:Ot,useEffect:If,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,_a(4194308,4,fv.bind(null,e,t),r)},useLayoutEffect:function(t,e){return _a(4194308,4,t,e)},useInsertionEffect:function(t,e){return _a(4,2,t,e)},useMemo:function(t,e){var r=Yt();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Yt();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=Wb.bind(null,Se,t),[n.memoizedState,t]},useRef:function(t){var e=Yt();return t={current:t},e.memoizedState=t},useState:Nf,useDebugValue:Xd,useDeferredValue:function(t){return Yt().memoizedState=t},useTransition:function(){var t=Nf(!1),e=t[0];return t=Vb.bind(null,t[1]),Yt().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=Se,s=Yt();if(_e){if(r===void 0)throw Error(R(407));r=r()}else{if(r=e(),De===null)throw Error(R(349));Kn&30||iv(n,e,r)}s.memoizedState=r;var i={value:r,getSnapshot:e};return s.queue=i,If(av.bind(null,n,i,t),[t]),n.flags|=2048,oo(9,ov.bind(null,n,i,r,e),void 0,null),r},useId:function(){var t=Yt(),e=De.identifierPrefix;if(_e){var r=vr,n=gr;r=(n&~(1<<32-Ht(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=so++,0<r&&(e+="H"+r.toString(32)),e+=":"}else r=zb++,e=":"+e+"r"+r.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},Kb={readContext:Ot,useCallback:mv,useContext:Ot,useEffect:Yd,useImperativeHandle:pv,useInsertionEffect:dv,useLayoutEffect:hv,useMemo:gv,useReducer:bu,useRef:cv,useState:function(){return bu(io)},useDebugValue:Xd,useDeferredValue:function(t){var e=Pt();return vv(e,Ne.memoizedState,t)},useTransition:function(){var t=bu(io)[0],e=Pt().memoizedState;return[t,e]},useMutableSource:nv,useSyncExternalStore:sv,useId:yv,unstable_isNewReconciler:!1},Gb={readContext:Ot,useCallback:mv,useContext:Ot,useEffect:Yd,useImperativeHandle:pv,useInsertionEffect:dv,useLayoutEffect:hv,useMemo:gv,useReducer:xu,useRef:cv,useState:function(){return xu(io)},useDebugValue:Xd,useDeferredValue:function(t){var e=Pt();return Ne===null?e.memoizedState=t:vv(e,Ne.memoizedState,t)},useTransition:function(){var t=xu(io)[0],e=Pt().memoizedState;return[t,e]},useMutableSource:nv,useSyncExternalStore:sv,useId:yv,unstable_isNewReconciler:!1};function Dt(t,e){if(t&&t.defaultProps){e=Ee({},e),t=t.defaultProps;for(var r in t)e[r]===void 0&&(e[r]=t[r]);return e}return e}function bc(t,e,r,n){e=t.memoizedState,r=r(n,e),r=r==null?e:Ee({},e,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var kl={isMounted:function(t){return(t=t._reactInternals)?Xn(t)===t:!1},enqueueSetState:function(t,e,r){t=t._reactInternals;var n=Xe(),s=an(t),i=yr(n,s);i.payload=e,r!=null&&(i.callback=r),e=sn(t,i,s),e!==null&&(qt(e,t,s,n),ya(e,t,s))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=Xe(),s=an(t),i=yr(n,s);i.tag=1,i.payload=e,r!=null&&(i.callback=r),e=sn(t,i,s),e!==null&&(qt(e,t,s,n),ya(e,t,s))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=Xe(),n=an(t),s=yr(r,n);s.tag=2,e!=null&&(s.callback=e),e=sn(t,s,n),e!==null&&(qt(e,t,n,r),ya(e,t,n))}};function $f(t,e,r,n,s,i,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(n,i,o):e.prototype&&e.prototype.isPureReactComponent?!Yi(r,n)||!Yi(s,i):!0}function xv(t,e,r){var n=!1,s=dn,i=e.contextType;return typeof i=="object"&&i!==null?i=Ot(i):(s=ot(e)?Hn:Ge.current,n=e.contextTypes,i=(n=n!=null)?Ks(t,s):dn),e=new e(r,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=kl,t.stateNode=e,e._reactInternals=t,n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=i),e}function Lf(t,e,r,n){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(r,n),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(r,n),e.state!==t&&kl.enqueueReplaceState(e,e.state,null)}function xc(t,e,r,n){var s=t.stateNode;s.props=r,s.state=t.memoizedState,s.refs={},Hd(t);var i=e.contextType;typeof i=="object"&&i!==null?s.context=Ot(i):(i=ot(e)?Hn:Ge.current,s.context=Ks(t,i)),s.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(bc(t,e,i,r),s.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(e=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),e!==s.state&&kl.enqueueReplaceState(s,s.state,null),Wa(t,r,s,n),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308)}function Js(t,e){try{var r="",n=e;do r+=x_(n),n=n.return;while(n);var s=r}catch(i){s=`
Error generating stack: `+i.message+`
`+i.stack}return{value:t,source:e,stack:s,digest:null}}function Su(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function Sc(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var Qb=typeof WeakMap=="function"?WeakMap:Map;function Sv(t,e,r){r=yr(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){Qa||(Qa=!0,Nc=n),Sc(t,e)},r}function Ev(t,e,r){r=yr(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var s=e.value;r.payload=function(){return n(s)},r.callback=function(){Sc(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){Sc(t,e),typeof n!="function"&&(on===null?on=new Set([this]):on.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function Df(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new Qb;var s=new Set;n.set(e,s)}else s=n.get(e),s===void 0&&(s=new Set,n.set(e,s));s.has(r)||(s.add(r),t=ux.bind(null,t,e,r),e.then(t,t))}function Mf(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function Uf(t,e,r,n,s){return t.mode&1?(t.flags|=65536,t.lanes=s,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=yr(-1,1),e.tag=2,sn(r,e,1))),r.lanes|=1),t)}var Zb=Tr.ReactCurrentOwner,st=!1;function Ze(t,e,r,n){e.child=t===null?Xg(e,null,r,n):Qs(e,t.child,r,n)}function Ff(t,e,r,n,s){r=r.render;var i=e.ref;return js(e,s),n=Zd(t,e,r,n,i,s),r=Jd(),t!==null&&!st?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,xr(t,e,s)):(_e&&r&&Md(e),e.flags|=1,Ze(t,e,n,s),e.child)}function Bf(t,e,r,n,s){if(t===null){var i=r.type;return typeof i=="function"&&!ah(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=i,kv(t,e,i,n,s)):(t=Ea(r.type,null,n,e,e.mode,s),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&s)){var o=i.memoizedProps;if(r=r.compare,r=r!==null?r:Yi,r(o,n)&&t.ref===e.ref)return xr(t,e,s)}return e.flags|=1,t=ln(i,n),t.ref=e.ref,t.return=e,e.child=t}function kv(t,e,r,n,s){if(t!==null){var i=t.memoizedProps;if(Yi(i,n)&&t.ref===e.ref)if(st=!1,e.pendingProps=n=i,(t.lanes&s)!==0)t.flags&131072&&(st=!0);else return e.lanes=t.lanes,xr(t,e,s)}return Ec(t,e,r,n,s)}function Tv(t,e,r){var n=e.pendingProps,s=n.children,i=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},me(Cs,dt),dt|=r;else{if(!(r&1073741824))return t=i!==null?i.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,me(Cs,dt),dt|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,me(Cs,dt),dt|=n}else i!==null?(n=i.baseLanes|r,e.memoizedState=null):n=r,me(Cs,dt),dt|=n;return Ze(t,e,s,r),e.child}function Cv(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function Ec(t,e,r,n,s){var i=ot(r)?Hn:Ge.current;return i=Ks(e,i),js(e,s),r=Zd(t,e,r,n,i,s),n=Jd(),t!==null&&!st?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,xr(t,e,s)):(_e&&n&&Md(e),e.flags|=1,Ze(t,e,r,s),e.child)}function zf(t,e,r,n,s){if(ot(r)){var i=!0;Ua(e)}else i=!1;if(js(e,s),e.stateNode===null)ba(t,e),xv(e,r,n),xc(e,r,n,s),n=!0;else if(t===null){var o=e.stateNode,a=e.memoizedProps;o.props=a;var l=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=Ot(u):(u=ot(r)?Hn:Ge.current,u=Ks(e,u));var c=r.getDerivedStateFromProps,h=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||l!==u)&&Lf(e,o,n,u),Fr=!1;var f=e.memoizedState;o.state=f,Wa(e,n,o,s),l=e.memoizedState,a!==n||f!==l||it.current||Fr?(typeof c=="function"&&(bc(e,r,c,n),l=e.memoizedState),(a=Fr||$f(e,r,a,n,f,l,u))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=l),o.props=n,o.state=l,o.context=u,n=a):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{o=e.stateNode,tv(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:Dt(e.type,a),o.props=u,h=e.pendingProps,f=o.context,l=r.contextType,typeof l=="object"&&l!==null?l=Ot(l):(l=ot(r)?Hn:Ge.current,l=Ks(e,l));var d=r.getDerivedStateFromProps;(c=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==h||f!==l)&&Lf(e,o,n,l),Fr=!1,f=e.memoizedState,o.state=f,Wa(e,n,o,s);var y=e.memoizedState;a!==h||f!==y||it.current||Fr?(typeof d=="function"&&(bc(e,r,d,n),y=e.memoizedState),(u=Fr||$f(e,r,u,n,f,y,l)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,y,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,y,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=y),o.props=n,o.state=y,o.context=l,n=u):(typeof o.componentDidUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),n=!1)}return kc(t,e,r,n,i,s)}function kc(t,e,r,n,s,i){Cv(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return s&&Cf(e,r,!1),xr(t,e,i);n=e.stateNode,Zb.current=e;var a=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=Qs(e,t.child,null,i),e.child=Qs(e,null,a,i)):Ze(t,e,a,i),e.memoizedState=n.state,s&&Cf(e,r,!0),e.child}function Ov(t){var e=t.stateNode;e.pendingContext?Tf(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Tf(t,e.context,!1),qd(t,e.containerInfo)}function Vf(t,e,r,n,s){return Gs(),Fd(s),e.flags|=256,Ze(t,e,r,n),e.child}var Tc={dehydrated:null,treeContext:null,retryLane:0};function Cc(t){return{baseLanes:t,cachePool:null,transitions:null}}function Pv(t,e,r){var n=e.pendingProps,s=xe.current,i=!1,o=(e.flags&128)!==0,a;if((a=o)||(a=t!==null&&t.memoizedState===null?!1:(s&2)!==0),a?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(s|=1),me(xe,s&1),t===null)return wc(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=n.children,t=n.fallback,i?(n=e.mode,i=e.child,o={mode:"hidden",children:o},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Ol(o,n,0,null),t=Wn(t,n,r,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=Cc(r),e.memoizedState=Tc,t):eh(e,o));if(s=t.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return Jb(t,e,o,n,a,s,r);if(i){i=n.fallback,o=e.mode,s=t.child,a=s.sibling;var l={mode:"hidden",children:n.children};return!(o&1)&&e.child!==s?(n=e.child,n.childLanes=0,n.pendingProps=l,e.deletions=null):(n=ln(s,l),n.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=ln(a,i):(i=Wn(i,o,r,null),i.flags|=2),i.return=e,n.return=e,n.sibling=i,e.child=n,n=i,i=e.child,o=t.child.memoizedState,o=o===null?Cc(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=t.childLanes&~r,e.memoizedState=Tc,n}return i=t.child,t=i.sibling,n=ln(i,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function eh(t,e){return e=Ol({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Go(t,e,r,n){return n!==null&&Fd(n),Qs(e,t.child,null,r),t=eh(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Jb(t,e,r,n,s,i,o){if(r)return e.flags&256?(e.flags&=-257,n=Su(Error(R(422))),Go(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=n.fallback,s=e.mode,n=Ol({mode:"visible",children:n.children},s,0,null),i=Wn(i,s,o,null),i.flags|=2,n.return=e,i.return=e,n.sibling=i,e.child=n,e.mode&1&&Qs(e,t.child,null,o),e.child.memoizedState=Cc(o),e.memoizedState=Tc,i);if(!(e.mode&1))return Go(t,e,o,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var a=n.dgst;return n=a,i=Error(R(419)),n=Su(i,n,void 0),Go(t,e,o,n)}if(a=(o&t.childLanes)!==0,st||a){if(n=De,n!==null){switch(o&-o){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,br(t,s),qt(n,t,s,-1))}return oh(),n=Su(Error(R(421))),Go(t,e,o,n)}return s.data==="$?"?(e.flags|=128,e.child=t.child,e=cx.bind(null,t),s._reactRetry=e,null):(t=i.treeContext,mt=nn(s.nextSibling),gt=e,_e=!0,Wt=null,t!==null&&(Et[kt++]=gr,Et[kt++]=vr,Et[kt++]=qn,gr=t.id,vr=t.overflow,qn=e),e=eh(e,n.children),e.flags|=4096,e)}function Wf(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),_c(t.return,e,r)}function Eu(t,e,r,n,s){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=s)}function Rv(t,e,r){var n=e.pendingProps,s=n.revealOrder,i=n.tail;if(Ze(t,e,n.children,r),n=xe.current,n&2)n=n&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Wf(t,r,e);else if(t.tag===19)Wf(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(me(xe,n),!(e.mode&1))e.memoizedState=null;else switch(s){case"forwards":for(r=e.child,s=null;r!==null;)t=r.alternate,t!==null&&Ha(t)===null&&(s=r),r=r.sibling;r=s,r===null?(s=e.child,e.child=null):(s=r.sibling,r.sibling=null),Eu(e,!1,s,r,i);break;case"backwards":for(r=null,s=e.child,e.child=null;s!==null;){if(t=s.alternate,t!==null&&Ha(t)===null){e.child=s;break}t=s.sibling,s.sibling=r,r=s,s=t}Eu(e,!0,r,null,i);break;case"together":Eu(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ba(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function xr(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Gn|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(R(153));if(e.child!==null){for(t=e.child,r=ln(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=ln(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function Yb(t,e,r){switch(e.tag){case 3:Ov(e),Gs();break;case 5:rv(e);break;case 1:ot(e.type)&&Ua(e);break;case 4:qd(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,s=e.memoizedProps.value;me(za,n._currentValue),n._currentValue=s;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(me(xe,xe.current&1),e.flags|=128,null):r&e.child.childLanes?Pv(t,e,r):(me(xe,xe.current&1),t=xr(t,e,r),t!==null?t.sibling:null);me(xe,xe.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return Rv(t,e,r);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),me(xe,xe.current),n)break;return null;case 22:case 23:return e.lanes=0,Tv(t,e,r)}return xr(t,e,r)}var Av,Oc,jv,Nv;Av=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Oc=function(){};jv=function(t,e,r,n){var s=t.memoizedProps;if(s!==n){t=e.stateNode,$n(ir.current);var i=null;switch(r){case"input":s=Zu(t,s),n=Zu(t,n),i=[];break;case"select":s=Ee({},s,{value:void 0}),n=Ee({},n,{value:void 0}),i=[];break;case"textarea":s=Xu(t,s),n=Xu(t,n),i=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=Da)}tc(r,n);var o;r=null;for(u in s)if(!n.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var a=s[u];for(o in a)a.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Hi.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var l=n[u];if(a=s!=null?s[u]:void 0,n.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(r||(r={}),r[o]=l[o])}else r||(i||(i=[]),i.push(u,r)),r=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Hi.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&ve("scroll",t),i||a===l||(i=[])):(i=i||[]).push(u,l))}r&&(i=i||[]).push("style",r);var u=i;(e.updateQueue=u)&&(e.flags|=4)}};Nv=function(t,e,r,n){r!==n&&(e.flags|=4)};function Si(t,e){if(!_e)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function He(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var s=t.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=t,s=s.sibling;else for(s=t.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=t,s=s.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function Xb(t,e,r){var n=e.pendingProps;switch(Ud(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return He(e),null;case 1:return ot(e.type)&&Ma(),He(e),null;case 3:return n=e.stateNode,Zs(),ye(it),ye(Ge),Gd(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(qo(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Wt!==null&&(Lc(Wt),Wt=null))),Oc(t,e),He(e),null;case 5:Kd(e);var s=$n(no.current);if(r=e.type,t!==null&&e.stateNode!=null)jv(t,e,r,n,s),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(R(166));return He(e),null}if(t=$n(ir.current),qo(e)){n=e.stateNode,r=e.type;var i=e.memoizedProps;switch(n[rr]=e,n[to]=i,t=(e.mode&1)!==0,r){case"dialog":ve("cancel",n),ve("close",n);break;case"iframe":case"object":case"embed":ve("load",n);break;case"video":case"audio":for(s=0;s<Ri.length;s++)ve(Ri[s],n);break;case"source":ve("error",n);break;case"img":case"image":case"link":ve("error",n),ve("load",n);break;case"details":ve("toggle",n);break;case"input":Yh(n,i),ve("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},ve("invalid",n);break;case"textarea":ef(n,i),ve("invalid",n)}tc(r,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?n.textContent!==a&&(i.suppressHydrationWarning!==!0&&Ho(n.textContent,a,t),s=["children",a]):typeof a=="number"&&n.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Ho(n.textContent,a,t),s=["children",""+a]):Hi.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&ve("scroll",n)}switch(r){case"input":Do(n),Xh(n,i,!0);break;case"textarea":Do(n),tf(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=Da)}n=s,e.updateQueue=n,n!==null&&(e.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=ag(r)),t==="http://www.w3.org/1999/xhtml"?r==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[rr]=e,t[to]=n,Av(t,e,!1,!1),e.stateNode=t;e:{switch(o=rc(r,n),r){case"dialog":ve("cancel",t),ve("close",t),s=n;break;case"iframe":case"object":case"embed":ve("load",t),s=n;break;case"video":case"audio":for(s=0;s<Ri.length;s++)ve(Ri[s],t);s=n;break;case"source":ve("error",t),s=n;break;case"img":case"image":case"link":ve("error",t),ve("load",t),s=n;break;case"details":ve("toggle",t),s=n;break;case"input":Yh(t,n),s=Zu(t,n),ve("invalid",t);break;case"option":s=n;break;case"select":t._wrapperState={wasMultiple:!!n.multiple},s=Ee({},n,{value:void 0}),ve("invalid",t);break;case"textarea":ef(t,n),s=Xu(t,n),ve("invalid",t);break;default:s=n}tc(r,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?cg(t,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&lg(t,l)):i==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&qi(t,l):typeof l=="number"&&qi(t,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Hi.hasOwnProperty(i)?l!=null&&i==="onScroll"&&ve("scroll",t):l!=null&&Ed(t,i,l,o))}switch(r){case"input":Do(t),Xh(t,n,!1);break;case"textarea":Do(t),tf(t);break;case"option":n.value!=null&&t.setAttribute("value",""+cn(n.value));break;case"select":t.multiple=!!n.multiple,i=n.value,i!=null?Os(t,!!n.multiple,i,!1):n.defaultValue!=null&&Os(t,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(t.onclick=Da)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return He(e),null;case 6:if(t&&e.stateNode!=null)Nv(t,e,t.memoizedProps,n);else{if(typeof n!="string"&&e.stateNode===null)throw Error(R(166));if(r=$n(no.current),$n(ir.current),qo(e)){if(n=e.stateNode,r=e.memoizedProps,n[rr]=e,(i=n.nodeValue!==r)&&(t=gt,t!==null))switch(t.tag){case 3:Ho(n.nodeValue,r,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Ho(n.nodeValue,r,(t.mode&1)!==0)}i&&(e.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[rr]=e,e.stateNode=n}return He(e),null;case 13:if(ye(xe),n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(_e&&mt!==null&&e.mode&1&&!(e.flags&128))Jg(),Gs(),e.flags|=98560,i=!1;else if(i=qo(e),n!==null&&n.dehydrated!==null){if(t===null){if(!i)throw Error(R(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(R(317));i[rr]=e}else Gs(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;He(e),i=!1}else Wt!==null&&(Lc(Wt),Wt=null),i=!0;if(!i)return e.flags&65536?e:null}return e.flags&128?(e.lanes=r,e):(n=n!==null,n!==(t!==null&&t.memoizedState!==null)&&n&&(e.child.flags|=8192,e.mode&1&&(t===null||xe.current&1?$e===0&&($e=3):oh())),e.updateQueue!==null&&(e.flags|=4),He(e),null);case 4:return Zs(),Oc(t,e),t===null&&Xi(e.stateNode.containerInfo),He(e),null;case 10:return Vd(e.type._context),He(e),null;case 17:return ot(e.type)&&Ma(),He(e),null;case 19:if(ye(xe),i=e.memoizedState,i===null)return He(e),null;if(n=(e.flags&128)!==0,o=i.rendering,o===null)if(n)Si(i,!1);else{if($e!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=Ha(t),o!==null){for(e.flags|=128,Si(i,!1),n=o.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),e.subtreeFlags=0,n=r,r=e.child;r!==null;)i=r,t=n,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=t,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,t=o.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),r=r.sibling;return me(xe,xe.current&1|2),e.child}t=t.sibling}i.tail!==null&&Oe()>Ys&&(e.flags|=128,n=!0,Si(i,!1),e.lanes=4194304)}else{if(!n)if(t=Ha(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Si(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!_e)return He(e),null}else 2*Oe()-i.renderingStartTime>Ys&&r!==1073741824&&(e.flags|=128,n=!0,Si(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(r=i.last,r!==null?r.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Oe(),e.sibling=null,r=xe.current,me(xe,n?r&1|2:r&1),e):(He(e),null);case 22:case 23:return ih(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?dt&1073741824&&(He(e),e.subtreeFlags&6&&(e.flags|=8192)):He(e),null;case 24:return null;case 25:return null}throw Error(R(156,e.tag))}function ex(t,e){switch(Ud(e),e.tag){case 1:return ot(e.type)&&Ma(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Zs(),ye(it),ye(Ge),Gd(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Kd(e),null;case 13:if(ye(xe),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(R(340));Gs()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ye(xe),null;case 4:return Zs(),null;case 10:return Vd(e.type._context),null;case 22:case 23:return ih(),null;case 24:return null;default:return null}}var Qo=!1,Ke=!1,tx=typeof WeakSet=="function"?WeakSet:Set,M=null;function Ts(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Ce(t,e,n)}else r.current=null}function Pc(t,e,r){try{r()}catch(n){Ce(t,e,n)}}var Hf=!1;function rx(t,e){if(hc=Ia,t=Mg(),Dd(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,a=-1,l=-1,u=0,c=0,h=t,f=null;t:for(;;){for(var d;h!==r||s!==0&&h.nodeType!==3||(a=o+s),h!==i||n!==0&&h.nodeType!==3||(l=o+n),h.nodeType===3&&(o+=h.nodeValue.length),(d=h.firstChild)!==null;)f=h,h=d;for(;;){if(h===t)break t;if(f===r&&++u===s&&(a=o),f===i&&++c===n&&(l=o),(d=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=d}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(fc={focusedElem:t,selectionRange:r},Ia=!1,M=e;M!==null;)if(e=M,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,M=t;else for(;M!==null;){e=M;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var g=y.memoizedProps,w=y.memoizedState,m=e.stateNode,p=m.getSnapshotBeforeUpdate(e.elementType===e.type?g:Dt(e.type,g),w);m.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var v=e.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(R(163))}}catch(_){Ce(e,e.return,_)}if(t=e.sibling,t!==null){t.return=e.return,M=t;break}M=e.return}return y=Hf,Hf=!1,y}function Ui(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&t)===t){var i=s.destroy;s.destroy=void 0,i!==void 0&&Pc(e,r,i)}s=s.next}while(s!==n)}}function Tl(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function Rc(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function Iv(t){var e=t.alternate;e!==null&&(t.alternate=null,Iv(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[rr],delete e[to],delete e[gc],delete e[Mb],delete e[Ub])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function $v(t){return t.tag===5||t.tag===3||t.tag===4}function qf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||$v(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ac(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Da));else if(n!==4&&(t=t.child,t!==null))for(Ac(t,e,r),t=t.sibling;t!==null;)Ac(t,e,r),t=t.sibling}function jc(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(jc(t,e,r),t=t.sibling;t!==null;)jc(t,e,r),t=t.sibling}var Ue=null,zt=!1;function Ir(t,e,r){for(r=r.child;r!==null;)Lv(t,e,r),r=r.sibling}function Lv(t,e,r){if(sr&&typeof sr.onCommitFiberUnmount=="function")try{sr.onCommitFiberUnmount(yl,r)}catch{}switch(r.tag){case 5:Ke||Ts(r,e);case 6:var n=Ue,s=zt;Ue=null,Ir(t,e,r),Ue=n,zt=s,Ue!==null&&(zt?(t=Ue,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Ue.removeChild(r.stateNode));break;case 18:Ue!==null&&(zt?(t=Ue,r=r.stateNode,t.nodeType===8?vu(t.parentNode,r):t.nodeType===1&&vu(t,r),Zi(t)):vu(Ue,r.stateNode));break;case 4:n=Ue,s=zt,Ue=r.stateNode.containerInfo,zt=!0,Ir(t,e,r),Ue=n,zt=s;break;case 0:case 11:case 14:case 15:if(!Ke&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Pc(r,e,o),s=s.next}while(s!==n)}Ir(t,e,r);break;case 1:if(!Ke&&(Ts(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Ce(r,e,a)}Ir(t,e,r);break;case 21:Ir(t,e,r);break;case 22:r.mode&1?(Ke=(n=Ke)||r.memoizedState!==null,Ir(t,e,r),Ke=n):Ir(t,e,r);break;default:Ir(t,e,r)}}function Kf(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new tx),e.forEach(function(n){var s=dx.bind(null,t,n);r.has(n)||(r.add(n),n.then(s,s))})}}function It(t,e){var r=e.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var i=t,o=e,a=o;e:for(;a!==null;){switch(a.tag){case 5:Ue=a.stateNode,zt=!1;break e;case 3:Ue=a.stateNode.containerInfo,zt=!0;break e;case 4:Ue=a.stateNode.containerInfo,zt=!0;break e}a=a.return}if(Ue===null)throw Error(R(160));Lv(i,o,s),Ue=null,zt=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(u){Ce(s,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)Dv(e,t),e=e.sibling}function Dv(t,e){var r=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(It(e,t),Jt(t),n&4){try{Ui(3,t,t.return),Tl(3,t)}catch(g){Ce(t,t.return,g)}try{Ui(5,t,t.return)}catch(g){Ce(t,t.return,g)}}break;case 1:It(e,t),Jt(t),n&512&&r!==null&&Ts(r,r.return);break;case 5:if(It(e,t),Jt(t),n&512&&r!==null&&Ts(r,r.return),t.flags&32){var s=t.stateNode;try{qi(s,"")}catch(g){Ce(t,t.return,g)}}if(n&4&&(s=t.stateNode,s!=null)){var i=t.memoizedProps,o=r!==null?r.memoizedProps:i,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&ig(s,i),rc(a,o);var u=rc(a,i);for(o=0;o<l.length;o+=2){var c=l[o],h=l[o+1];c==="style"?cg(s,h):c==="dangerouslySetInnerHTML"?lg(s,h):c==="children"?qi(s,h):Ed(s,c,h,u)}switch(a){case"input":Ju(s,i);break;case"textarea":og(s,i);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var d=i.value;d!=null?Os(s,!!i.multiple,d,!1):f!==!!i.multiple&&(i.defaultValue!=null?Os(s,!!i.multiple,i.defaultValue,!0):Os(s,!!i.multiple,i.multiple?[]:"",!1))}s[to]=i}catch(g){Ce(t,t.return,g)}}break;case 6:if(It(e,t),Jt(t),n&4){if(t.stateNode===null)throw Error(R(162));s=t.stateNode,i=t.memoizedProps;try{s.nodeValue=i}catch(g){Ce(t,t.return,g)}}break;case 3:if(It(e,t),Jt(t),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Zi(e.containerInfo)}catch(g){Ce(t,t.return,g)}break;case 4:It(e,t),Jt(t);break;case 13:It(e,t),Jt(t),s=t.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(nh=Oe())),n&4&&Kf(t);break;case 22:if(c=r!==null&&r.memoizedState!==null,t.mode&1?(Ke=(u=Ke)||c,It(e,t),Ke=u):It(e,t),Jt(t),n&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!c&&t.mode&1)for(M=t,c=t.child;c!==null;){for(h=M=c;M!==null;){switch(f=M,d=f.child,f.tag){case 0:case 11:case 14:case 15:Ui(4,f,f.return);break;case 1:Ts(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){n=f,r=f.return;try{e=n,y.props=e.memoizedProps,y.state=e.memoizedState,y.componentWillUnmount()}catch(g){Ce(n,r,g)}}break;case 5:Ts(f,f.return);break;case 22:if(f.memoizedState!==null){Qf(h);continue}}d!==null?(d.return=f,M=d):Qf(h)}c=c.sibling}e:for(c=null,h=t;;){if(h.tag===5){if(c===null){c=h;try{s=h.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=h.stateNode,l=h.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=ug("display",o))}catch(g){Ce(t,t.return,g)}}}else if(h.tag===6){if(c===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(g){Ce(t,t.return,g)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===t)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;c===h&&(c=null),h=h.return}c===h&&(c=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:It(e,t),Jt(t),n&4&&Kf(t);break;case 21:break;default:It(e,t),Jt(t)}}function Jt(t){var e=t.flags;if(e&2){try{e:{for(var r=t.return;r!==null;){if($v(r)){var n=r;break e}r=r.return}throw Error(R(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(qi(s,""),n.flags&=-33);var i=qf(t);jc(t,i,s);break;case 3:case 4:var o=n.stateNode.containerInfo,a=qf(t);Ac(t,a,o);break;default:throw Error(R(161))}}catch(l){Ce(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function nx(t,e,r){M=t,Mv(t)}function Mv(t,e,r){for(var n=(t.mode&1)!==0;M!==null;){var s=M,i=s.child;if(s.tag===22&&n){var o=s.memoizedState!==null||Qo;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||Ke;a=Qo;var u=Ke;if(Qo=o,(Ke=l)&&!u)for(M=s;M!==null;)o=M,l=o.child,o.tag===22&&o.memoizedState!==null?Zf(s):l!==null?(l.return=o,M=l):Zf(s);for(;i!==null;)M=i,Mv(i),i=i.sibling;M=s,Qo=a,Ke=u}Gf(t)}else s.subtreeFlags&8772&&i!==null?(i.return=s,M=i):Gf(t)}}function Gf(t){for(;M!==null;){var e=M;if(e.flags&8772){var r=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Ke||Tl(5,e);break;case 1:var n=e.stateNode;if(e.flags&4&&!Ke)if(r===null)n.componentDidMount();else{var s=e.elementType===e.type?r.memoizedProps:Dt(e.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&jf(e,i,n);break;case 3:var o=e.updateQueue;if(o!==null){if(r=null,e.child!==null)switch(e.child.tag){case 5:r=e.child.stateNode;break;case 1:r=e.child.stateNode}jf(e,o,r)}break;case 5:var a=e.stateNode;if(r===null&&e.flags&4){r=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break;case"img":l.src&&(r.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var h=c.dehydrated;h!==null&&Zi(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(R(163))}Ke||e.flags&512&&Rc(e)}catch(f){Ce(e,e.return,f)}}if(e===t){M=null;break}if(r=e.sibling,r!==null){r.return=e.return,M=r;break}M=e.return}}function Qf(t){for(;M!==null;){var e=M;if(e===t){M=null;break}var r=e.sibling;if(r!==null){r.return=e.return,M=r;break}M=e.return}}function Zf(t){for(;M!==null;){var e=M;try{switch(e.tag){case 0:case 11:case 15:var r=e.return;try{Tl(4,e)}catch(l){Ce(e,r,l)}break;case 1:var n=e.stateNode;if(typeof n.componentDidMount=="function"){var s=e.return;try{n.componentDidMount()}catch(l){Ce(e,s,l)}}var i=e.return;try{Rc(e)}catch(l){Ce(e,i,l)}break;case 5:var o=e.return;try{Rc(e)}catch(l){Ce(e,o,l)}}}catch(l){Ce(e,e.return,l)}if(e===t){M=null;break}var a=e.sibling;if(a!==null){a.return=e.return,M=a;break}M=e.return}}var sx=Math.ceil,Ga=Tr.ReactCurrentDispatcher,th=Tr.ReactCurrentOwner,Ct=Tr.ReactCurrentBatchConfig,ae=0,De=null,Ae=null,Fe=0,dt=0,Cs=wn(0),$e=0,ao=null,Gn=0,Cl=0,rh=0,Fi=null,nt=null,nh=0,Ys=1/0,hr=null,Qa=!1,Nc=null,on=null,Zo=!1,Jr=null,Za=0,Bi=0,Ic=null,xa=-1,Sa=0;function Xe(){return ae&6?Oe():xa!==-1?xa:xa=Oe()}function an(t){return t.mode&1?ae&2&&Fe!==0?Fe&-Fe:Bb.transition!==null?(Sa===0&&(Sa=xg()),Sa):(t=he,t!==0||(t=window.event,t=t===void 0?16:Pg(t.type)),t):1}function qt(t,e,r,n){if(50<Bi)throw Bi=0,Ic=null,Error(R(185));So(t,r,n),(!(ae&2)||t!==De)&&(t===De&&(!(ae&2)&&(Cl|=r),$e===4&&Vr(t,Fe)),at(t,n),r===1&&ae===0&&!(e.mode&1)&&(Ys=Oe()+500,Sl&&_n()))}function at(t,e){var r=t.callbackNode;B_(t,e);var n=Na(t,t===De?Fe:0);if(n===0)r!==null&&sf(r),t.callbackNode=null,t.callbackPriority=0;else if(e=n&-n,t.callbackPriority!==e){if(r!=null&&sf(r),e===1)t.tag===0?Fb(Jf.bind(null,t)):Gg(Jf.bind(null,t)),Lb(function(){!(ae&6)&&_n()}),r=null;else{switch(Sg(n)){case 1:r=Pd;break;case 4:r=_g;break;case 16:r=ja;break;case 536870912:r=bg;break;default:r=ja}r=qv(r,Uv.bind(null,t))}t.callbackPriority=e,t.callbackNode=r}}function Uv(t,e){if(xa=-1,Sa=0,ae&6)throw Error(R(327));var r=t.callbackNode;if(Ns()&&t.callbackNode!==r)return null;var n=Na(t,t===De?Fe:0);if(n===0)return null;if(n&30||n&t.expiredLanes||e)e=Ja(t,n);else{e=n;var s=ae;ae|=2;var i=Bv();(De!==t||Fe!==e)&&(hr=null,Ys=Oe()+500,Vn(t,e));do try{ax();break}catch(a){Fv(t,a)}while(!0);zd(),Ga.current=i,ae=s,Ae!==null?e=0:(De=null,Fe=0,e=$e)}if(e!==0){if(e===2&&(s=ac(t),s!==0&&(n=s,e=$c(t,s))),e===1)throw r=ao,Vn(t,0),Vr(t,n),at(t,Oe()),r;if(e===6)Vr(t,n);else{if(s=t.current.alternate,!(n&30)&&!ix(s)&&(e=Ja(t,n),e===2&&(i=ac(t),i!==0&&(n=i,e=$c(t,i))),e===1))throw r=ao,Vn(t,0),Vr(t,n),at(t,Oe()),r;switch(t.finishedWork=s,t.finishedLanes=n,e){case 0:case 1:throw Error(R(345));case 2:On(t,nt,hr);break;case 3:if(Vr(t,n),(n&130023424)===n&&(e=nh+500-Oe(),10<e)){if(Na(t,0)!==0)break;if(s=t.suspendedLanes,(s&n)!==n){Xe(),t.pingedLanes|=t.suspendedLanes&s;break}t.timeoutHandle=mc(On.bind(null,t,nt,hr),e);break}On(t,nt,hr);break;case 4:if(Vr(t,n),(n&4194240)===n)break;for(e=t.eventTimes,s=-1;0<n;){var o=31-Ht(n);i=1<<o,o=e[o],o>s&&(s=o),n&=~i}if(n=s,n=Oe()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*sx(n/1960))-n,10<n){t.timeoutHandle=mc(On.bind(null,t,nt,hr),n);break}On(t,nt,hr);break;case 5:On(t,nt,hr);break;default:throw Error(R(329))}}}return at(t,Oe()),t.callbackNode===r?Uv.bind(null,t):null}function $c(t,e){var r=Fi;return t.current.memoizedState.isDehydrated&&(Vn(t,e).flags|=256),t=Ja(t,e),t!==2&&(e=nt,nt=r,e!==null&&Lc(e)),t}function Lc(t){nt===null?nt=t:nt.push.apply(nt,t)}function ix(t){for(var e=t;;){if(e.flags&16384){var r=e.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],i=s.getSnapshot;s=s.value;try{if(!Kt(i(),s))return!1}catch{return!1}}}if(r=e.child,e.subtreeFlags&16384&&r!==null)r.return=e,e=r;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Vr(t,e){for(e&=~rh,e&=~Cl,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-Ht(e),n=1<<r;t[r]=-1,e&=~n}}function Jf(t){if(ae&6)throw Error(R(327));Ns();var e=Na(t,0);if(!(e&1))return at(t,Oe()),null;var r=Ja(t,e);if(t.tag!==0&&r===2){var n=ac(t);n!==0&&(e=n,r=$c(t,n))}if(r===1)throw r=ao,Vn(t,0),Vr(t,e),at(t,Oe()),r;if(r===6)throw Error(R(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,On(t,nt,hr),at(t,Oe()),null}function sh(t,e){var r=ae;ae|=1;try{return t(e)}finally{ae=r,ae===0&&(Ys=Oe()+500,Sl&&_n())}}function Qn(t){Jr!==null&&Jr.tag===0&&!(ae&6)&&Ns();var e=ae;ae|=1;var r=Ct.transition,n=he;try{if(Ct.transition=null,he=1,t)return t()}finally{he=n,Ct.transition=r,ae=e,!(ae&6)&&_n()}}function ih(){dt=Cs.current,ye(Cs)}function Vn(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(r!==-1&&(t.timeoutHandle=-1,$b(r)),Ae!==null)for(r=Ae.return;r!==null;){var n=r;switch(Ud(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Ma();break;case 3:Zs(),ye(it),ye(Ge),Gd();break;case 5:Kd(n);break;case 4:Zs();break;case 13:ye(xe);break;case 19:ye(xe);break;case 10:Vd(n.type._context);break;case 22:case 23:ih()}r=r.return}if(De=t,Ae=t=ln(t.current,null),Fe=dt=e,$e=0,ao=null,rh=Cl=Gn=0,nt=Fi=null,In!==null){for(e=0;e<In.length;e++)if(r=In[e],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,i=r.pending;if(i!==null){var o=i.next;i.next=s,n.next=o}r.pending=n}In=null}return t}function Fv(t,e){do{var r=Ae;try{if(zd(),wa.current=Ka,qa){for(var n=Se.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}qa=!1}if(Kn=0,Le=Ne=Se=null,Mi=!1,so=0,th.current=null,r===null||r.return===null){$e=1,ao=e,Ae=null;break}e:{var i=t,o=r.return,a=r,l=e;if(e=Fe,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=a,h=c.tag;if(!(c.mode&1)&&(h===0||h===11||h===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 d=Mf(o);if(d!==null){d.flags&=-257,Uf(d,o,a,i,e),d.mode&1&&Df(i,u,e),e=d,l=u;var y=e.updateQueue;if(y===null){var g=new Set;g.add(l),e.updateQueue=g}else y.add(l);break e}else{if(!(e&1)){Df(i,u,e),oh();break e}l=Error(R(426))}}else if(_e&&a.mode&1){var w=Mf(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Uf(w,o,a,i,e),Fd(Js(l,a));break e}}i=l=Js(l,a),$e!==4&&($e=2),Fi===null?Fi=[i]:Fi.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var m=Sv(i,l,e);Af(i,m);break e;case 1:a=l;var p=i.type,v=i.stateNode;if(!(i.flags&128)&&(typeof p.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(on===null||!on.has(v)))){i.flags|=65536,e&=-e,i.lanes|=e;var _=Ev(i,a,e);Af(i,_);break e}}i=i.return}while(i!==null)}Vv(r)}catch(x){e=x,Ae===r&&r!==null&&(Ae=r=r.return);continue}break}while(!0)}function Bv(){var t=Ga.current;return Ga.current=Ka,t===null?Ka:t}function oh(){($e===0||$e===3||$e===2)&&($e=4),De===null||!(Gn&268435455)&&!(Cl&268435455)||Vr(De,Fe)}function Ja(t,e){var r=ae;ae|=2;var n=Bv();(De!==t||Fe!==e)&&(hr=null,Vn(t,e));do try{ox();break}catch(s){Fv(t,s)}while(!0);if(zd(),ae=r,Ga.current=n,Ae!==null)throw Error(R(261));return De=null,Fe=0,$e}function ox(){for(;Ae!==null;)zv(Ae)}function ax(){for(;Ae!==null&&!j_();)zv(Ae)}function zv(t){var e=Hv(t.alternate,t,dt);t.memoizedProps=t.pendingProps,e===null?Vv(t):Ae=e,th.current=null}function Vv(t){var e=t;do{var r=e.alternate;if(t=e.return,e.flags&32768){if(r=ex(r,e),r!==null){r.flags&=32767,Ae=r;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{$e=6,Ae=null;return}}else if(r=Xb(r,e,dt),r!==null){Ae=r;return}if(e=e.sibling,e!==null){Ae=e;return}Ae=e=t}while(e!==null);$e===0&&($e=5)}function On(t,e,r){var n=he,s=Ct.transition;try{Ct.transition=null,he=1,lx(t,e,r,n)}finally{Ct.transition=s,he=n}return null}function lx(t,e,r,n){do Ns();while(Jr!==null);if(ae&6)throw Error(R(327));r=t.finishedWork;var s=t.finishedLanes;if(r===null)return null;if(t.finishedWork=null,t.finishedLanes=0,r===t.current)throw Error(R(177));t.callbackNode=null,t.callbackPriority=0;var i=r.lanes|r.childLanes;if(z_(t,i),t===De&&(Ae=De=null,Fe=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Zo||(Zo=!0,qv(ja,function(){return Ns(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=Ct.transition,Ct.transition=null;var o=he;he=1;var a=ae;ae|=4,th.current=null,rx(t,r),Dv(r,t),Ob(fc),Ia=!!hc,fc=hc=null,t.current=r,nx(r),N_(),ae=a,he=o,Ct.transition=i}else t.current=r;if(Zo&&(Zo=!1,Jr=t,Za=s),i=t.pendingLanes,i===0&&(on=null),L_(r.stateNode),at(t,Oe()),e!==null)for(n=t.onRecoverableError,r=0;r<e.length;r++)s=e[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(Qa)throw Qa=!1,t=Nc,Nc=null,t;return Za&1&&t.tag!==0&&Ns(),i=t.pendingLanes,i&1?t===Ic?Bi++:(Bi=0,Ic=t):Bi=0,_n(),null}function Ns(){if(Jr!==null){var t=Sg(Za),e=Ct.transition,r=he;try{if(Ct.transition=null,he=16>t?16:t,Jr===null)var n=!1;else{if(t=Jr,Jr=null,Za=0,ae&6)throw Error(R(331));var s=ae;for(ae|=4,M=t.current;M!==null;){var i=M,o=i.child;if(M.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(M=u;M!==null;){var c=M;switch(c.tag){case 0:case 11:case 15:Ui(8,c,i)}var h=c.child;if(h!==null)h.return=c,M=h;else for(;M!==null;){c=M;var f=c.sibling,d=c.return;if(Iv(c),c===u){M=null;break}if(f!==null){f.return=d,M=f;break}M=d}}}var y=i.alternate;if(y!==null){var g=y.child;if(g!==null){y.child=null;do{var w=g.sibling;g.sibling=null,g=w}while(g!==null)}}M=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,M=o;else e:for(;M!==null;){if(i=M,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ui(9,i,i.return)}var m=i.sibling;if(m!==null){m.return=i.return,M=m;break e}M=i.return}}var p=t.current;for(M=p;M!==null;){o=M;var v=o.child;if(o.subtreeFlags&2064&&v!==null)v.return=o,M=v;else e:for(o=p;M!==null;){if(a=M,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Tl(9,a)}}catch(x){Ce(a,a.return,x)}if(a===o){M=null;break e}var _=a.sibling;if(_!==null){_.return=a.return,M=_;break e}M=a.return}}if(ae=s,_n(),sr&&typeof sr.onPostCommitFiberRoot=="function")try{sr.onPostCommitFiberRoot(yl,t)}catch{}n=!0}return n}finally{he=r,Ct.transition=e}}return!1}function Yf(t,e,r){e=Js(r,e),e=Sv(t,e,1),t=sn(t,e,1),e=Xe(),t!==null&&(So(t,1,e),at(t,e))}function Ce(t,e,r){if(t.tag===3)Yf(t,t,r);else for(;e!==null;){if(e.tag===3){Yf(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(on===null||!on.has(n))){t=Js(r,t),t=Ev(e,t,1),e=sn(e,t,1),t=Xe(),e!==null&&(So(e,1,t),at(e,t));break}}e=e.return}}function ux(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),e=Xe(),t.pingedLanes|=t.suspendedLanes&r,De===t&&(Fe&r)===r&&($e===4||$e===3&&(Fe&130023424)===Fe&&500>Oe()-nh?Vn(t,0):rh|=r),at(t,e)}function Wv(t,e){e===0&&(t.mode&1?(e=Fo,Fo<<=1,!(Fo&130023424)&&(Fo=4194304)):e=1);var r=Xe();t=br(t,e),t!==null&&(So(t,e,r),at(t,r))}function cx(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),Wv(t,r)}function dx(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,s=t.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(R(314))}n!==null&&n.delete(e),Wv(t,r)}var Hv;Hv=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||it.current)st=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return st=!1,Yb(t,e,r);st=!!(t.flags&131072)}else st=!1,_e&&e.flags&1048576&&Qg(e,Ba,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;ba(t,e),t=e.pendingProps;var s=Ks(e,Ge.current);js(e,r),s=Zd(null,e,n,t,s,r);var i=Jd();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,ot(n)?(i=!0,Ua(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Hd(e),s.updater=kl,e.stateNode=s,s._reactInternals=e,xc(e,n,t,r),e=kc(null,e,n,!0,i,r)):(e.tag=0,_e&&i&&Md(e),Ze(null,e,s,r),e=e.child),e;case 16:n=e.elementType;e:{switch(ba(t,e),t=e.pendingProps,s=n._init,n=s(n._payload),e.type=n,s=e.tag=fx(n),t=Dt(n,t),s){case 0:e=Ec(null,e,n,t,r);break e;case 1:e=zf(null,e,n,t,r);break e;case 11:e=Ff(null,e,n,t,r);break e;case 14:e=Bf(null,e,n,Dt(n.type,t),r);break e}throw Error(R(306,n,""))}return e;case 0:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:Dt(n,s),Ec(t,e,n,s,r);case 1:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:Dt(n,s),zf(t,e,n,s,r);case 3:e:{if(Ov(e),t===null)throw Error(R(387));n=e.pendingProps,i=e.memoizedState,s=i.element,tv(t,e),Wa(e,n,null,r);var o=e.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=Js(Error(R(423)),e),e=Vf(t,e,n,r,s);break e}else if(n!==s){s=Js(Error(R(424)),e),e=Vf(t,e,n,r,s);break e}else for(mt=nn(e.stateNode.containerInfo.firstChild),gt=e,_e=!0,Wt=null,r=Xg(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Gs(),n===s){e=xr(t,e,r);break e}Ze(t,e,n,r)}e=e.child}return e;case 5:return rv(e),t===null&&wc(e),n=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,o=s.children,pc(n,s)?o=null:i!==null&&pc(n,i)&&(e.flags|=32),Cv(t,e),Ze(t,e,o,r),e.child;case 6:return t===null&&wc(e),null;case 13:return Pv(t,e,r);case 4:return qd(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Qs(e,null,n,r):Ze(t,e,n,r),e.child;case 11:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:Dt(n,s),Ff(t,e,n,s,r);case 7:return Ze(t,e,e.pendingProps,r),e.child;case 8:return Ze(t,e,e.pendingProps.children,r),e.child;case 12:return Ze(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,s=e.pendingProps,i=e.memoizedProps,o=s.value,me(za,n._currentValue),n._currentValue=o,i!==null)if(Kt(i.value,o)){if(i.children===s.children&&!it.current){e=xr(t,e,r);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=yr(-1,r&-r),l.tag=2;var u=i.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}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),_c(i.return,r,e),a.lanes|=r;break}l=l.next}}else if(i.tag===10)o=i.type===e.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(R(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),_c(o,r,e),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Ze(t,e,s.children,r),e=e.child}return e;case 9:return s=e.type,n=e.pendingProps.children,js(e,r),s=Ot(s),n=n(s),e.flags|=1,Ze(t,e,n,r),e.child;case 14:return n=e.type,s=Dt(n,e.pendingProps),s=Dt(n.type,s),Bf(t,e,n,s,r);case 15:return kv(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:Dt(n,s),ba(t,e),e.tag=1,ot(n)?(t=!0,Ua(e)):t=!1,js(e,r),xv(e,n,s),xc(e,n,s,r),kc(null,e,n,!0,t,r);case 19:return Rv(t,e,r);case 22:return Tv(t,e,r)}throw Error(R(156,e.tag))};function qv(t,e){return wg(t,e)}function hx(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tt(t,e,r,n){return new hx(t,e,r,n)}function ah(t){return t=t.prototype,!(!t||!t.isReactComponent)}function fx(t){if(typeof t=="function")return ah(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Td)return 11;if(t===Cd)return 14}return 2}function ln(t,e){var r=t.alternate;return r===null?(r=Tt(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function Ea(t,e,r,n,s,i){var o=2;if(n=t,typeof t=="function")ah(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case vs:return Wn(r.children,s,i,e);case kd:o=8,s|=8;break;case qu:return t=Tt(12,r,e,s|2),t.elementType=qu,t.lanes=i,t;case Ku:return t=Tt(13,r,e,s),t.elementType=Ku,t.lanes=i,t;case Gu:return t=Tt(19,r,e,s),t.elementType=Gu,t.lanes=i,t;case rg:return Ol(r,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case eg:o=10;break e;case tg:o=9;break e;case Td:o=11;break e;case Cd:o=14;break e;case Ur:o=16,n=null;break e}throw Error(R(130,t==null?t:typeof t,""))}return e=Tt(o,r,e,s),e.elementType=t,e.type=n,e.lanes=i,e}function Wn(t,e,r,n){return t=Tt(7,t,n,e),t.lanes=r,t}function Ol(t,e,r,n){return t=Tt(22,t,n,e),t.elementType=rg,t.lanes=r,t.stateNode={isHidden:!1},t}function ku(t,e,r){return t=Tt(6,t,null,e),t.lanes=r,t}function Tu(t,e,r){return e=Tt(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function px(t,e,r,n,s){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ou(0),this.expirationTimes=ou(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ou(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function lh(t,e,r,n,s,i,o,a,l){return t=new px(t,e,r,a,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Tt(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hd(i),t}function mx(t,e,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:gs,key:n==null?null:""+n,children:t,containerInfo:e,implementation:r}}function Kv(t){if(!t)return dn;t=t._reactInternals;e:{if(Xn(t)!==t||t.tag!==1)throw Error(R(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(ot(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(R(171))}if(t.tag===1){var r=t.type;if(ot(r))return Kg(t,r,e)}return e}function Gv(t,e,r,n,s,i,o,a,l){return t=lh(r,n,!0,t,s,i,o,a,l),t.context=Kv(null),r=t.current,n=Xe(),s=an(r),i=yr(n,s),i.callback=e??null,sn(r,i,s),t.current.lanes=s,So(t,s,n),at(t,n),t}function Pl(t,e,r,n){var s=e.current,i=Xe(),o=an(s);return r=Kv(r),e.context===null?e.context=r:e.pendingContext=r,e=yr(i,o),e.payload={element:t},n=n===void 0?null:n,n!==null&&(e.callback=n),t=sn(s,e,o),t!==null&&(qt(t,s,o,i),ya(t,s,o)),o}function Ya(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function Xf(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function uh(t,e){Xf(t,e),(t=t.alternate)&&Xf(t,e)}function gx(){return null}var Qv=typeof reportError=="function"?reportError:function(t){console.error(t)};function ch(t){this._internalRoot=t}Rl.prototype.render=ch.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(R(409));Pl(t,e,null,null)};Rl.prototype.unmount=ch.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Qn(function(){Pl(null,t,null,null)}),e[_r]=null}};function Rl(t){this._internalRoot=t}Rl.prototype.unstable_scheduleHydration=function(t){if(t){var e=Tg();t={blockedOn:null,target:t,priority:e};for(var r=0;r<zr.length&&e!==0&&e<zr[r].priority;r++);zr.splice(r,0,t),r===0&&Og(t)}};function dh(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Al(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function ep(){}function vx(t,e,r,n,s){if(s){if(typeof n=="function"){var i=n;n=function(){var u=Ya(o);i.call(u)}}var o=Gv(e,n,t,0,null,!1,!1,"",ep);return t._reactRootContainer=o,t[_r]=o.current,Xi(t.nodeType===8?t.parentNode:t),Qn(),o}for(;s=t.lastChild;)t.removeChild(s);if(typeof n=="function"){var a=n;n=function(){var u=Ya(l);a.call(u)}}var l=lh(t,0,!1,null,null,!1,!1,"",ep);return t._reactRootContainer=l,t[_r]=l.current,Xi(t.nodeType===8?t.parentNode:t),Qn(function(){Pl(e,l,r,n)}),l}function jl(t,e,r,n,s){var i=r._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var l=Ya(o);a.call(l)}}Pl(e,o,t,s)}else o=vx(r,e,t,s,n);return Ya(o)}Eg=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var r=Pi(e.pendingLanes);r!==0&&(Rd(e,r|1),at(e,Oe()),!(ae&6)&&(Ys=Oe()+500,_n()))}break;case 13:Qn(function(){var n=br(t,1);if(n!==null){var s=Xe();qt(n,t,1,s)}}),uh(t,1)}};Ad=function(t){if(t.tag===13){var e=br(t,134217728);if(e!==null){var r=Xe();qt(e,t,134217728,r)}uh(t,134217728)}};kg=function(t){if(t.tag===13){var e=an(t),r=br(t,e);if(r!==null){var n=Xe();qt(r,t,e,n)}uh(t,e)}};Tg=function(){return he};Cg=function(t,e){var r=he;try{return he=t,e()}finally{he=r}};sc=function(t,e,r){switch(e){case"input":if(Ju(t,r),e=r.name,r.type==="radio"&&e!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<r.length;e++){var n=r[e];if(n!==t&&n.form===t.form){var s=xl(n);if(!s)throw Error(R(90));sg(n),Ju(n,s)}}}break;case"textarea":og(t,r);break;case"select":e=r.value,e!=null&&Os(t,!!r.multiple,e,!1)}};fg=sh;pg=Qn;var yx={usingClientEntryPoint:!1,Events:[ko,bs,xl,dg,hg,sh]},Ei={findFiberByHostInstance:Nn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},wx={bundleType:Ei.bundleType,version:Ei.version,rendererPackageName:Ei.rendererPackageName,rendererConfig:Ei.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Tr.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=vg(t),t===null?null:t.stateNode},findFiberByHostInstance:Ei.findFiberByHostInstance||gx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Jo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jo.isDisabled&&Jo.supportsFiber)try{yl=Jo.inject(wx),sr=Jo}catch{}}_t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yx;_t.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!dh(e))throw Error(R(200));return mx(t,e,null,r)};_t.createRoot=function(t,e){if(!dh(t))throw Error(R(299));var r=!1,n="",s=Qv;return e!=null&&(e.unstable_strictMode===!0&&(r=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onRecoverableError!==void 0&&(s=e.onRecoverableError)),e=lh(t,1,!1,null,null,r,!1,n,s),t[_r]=e.current,Xi(t.nodeType===8?t.parentNode:t),new ch(e)};_t.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(R(188)):(t=Object.keys(t).join(","),Error(R(268,t)));return t=vg(e),t=t===null?null:t.stateNode,t};_t.flushSync=function(t){return Qn(t)};_t.hydrate=function(t,e,r){if(!Al(e))throw Error(R(200));return jl(null,t,e,!0,r)};_t.hydrateRoot=function(t,e,r){if(!dh(t))throw Error(R(405));var n=r!=null&&r.hydratedSources||null,s=!1,i="",o=Qv;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),e=Gv(e,null,t,1,r??null,s,!1,i,o),t[_r]=e.current,Xi(t),n)for(t=0;t<n.length;t++)r=n[t],s=r._getVersion,s=s(r._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[r,s]:e.mutableSourceEagerHydrationData.push(r,s);return new Rl(e)};_t.render=function(t,e,r){if(!Al(e))throw Error(R(200));return jl(null,t,e,!1,r)};_t.unmountComponentAtNode=function(t){if(!Al(t))throw Error(R(40));return t._reactRootContainer?(Qn(function(){jl(null,null,t,!1,function(){t._reactRootContainer=null,t[_r]=null})}),!0):!1};_t.unstable_batchedUpdates=sh;_t.unstable_renderSubtreeIntoContainer=function(t,e,r,n){if(!Al(r))throw Error(R(200));if(t==null||t._reactInternals===void 0)throw Error(R(38));return jl(t,e,r,!1,n)};_t.version="18.3.1-next-f1338f8080-20240426";function Zv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Zv)}catch(t){console.error(t)}}Zv(),Zm.exports=_t;var Co=Zm.exports;const Jv=Dm(Co);var Yv,tp=Co;Yv=tp.createRoot,tp.hydrateRoot;const _x=1,bx=1e6;let Cu=0;function xx(){return Cu=(Cu+1)%Number.MAX_SAFE_INTEGER,Cu.toString()}const Ou=new Map,rp=t=>{if(Ou.has(t))return;const e=setTimeout(()=>{Ou.delete(t),zi({type:"REMOVE_TOAST",toastId:t})},bx);Ou.set(t,e)},Sx=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,_x)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(r=>r.id===e.toast.id?{...r,...e.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=e;return r?rp(r):t.toasts.forEach(n=>{rp(n.id)}),{...t,toasts:t.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==e.toastId)}}},ka=[];let Ta={toasts:[]};function zi(t){Ta=Sx(Ta,t),ka.forEach(e=>{e(Ta)})}function Dc({...t}){const e=xx(),r=s=>zi({type:"UPDATE_TOAST",toast:{...s,id:e}}),n=()=>zi({type:"DISMISS_TOAST",toastId:e});return zi({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||n()}}}),{id:e,dismiss:n,update:r}}function Ex(){const[t,e]=b.useState(Ta);return b.useEffect(()=>(ka.push(e),()=>{const r=ka.indexOf(e);r>-1&&ka.splice(r,1)}),[t]),{...t,toast:Dc,dismiss:r=>zi({type:"DISMISS_TOAST",toastId:r})}}function Ie(t,e,{checkForDefaultPrevented:r=!0}={}){return function(s){if(t==null||t(s),r===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function np(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Xv(...t){return e=>{let r=!1;const n=t.map(s=>{const i=np(s,e);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let s=0;s<n.length;s++){const i=n[s];typeof i=="function"?i():np(t[s],null)}}}}function Gt(...t){return b.useCallback(Xv(...t),t)}function Nl(t,e=[]){let r=[];function n(i,o){const a=b.createContext(o),l=r.length;r=[...r,o];const u=h=>{var m;const{scope:f,children:d,...y}=h,g=((m=f==null?void 0:f[t])==null?void 0:m[l])||a,w=b.useMemo(()=>y,Object.values(y));return S.jsx(g.Provider,{value:w,children:d})};u.displayName=i+"Provider";function c(h,f){var g;const d=((g=f==null?void 0:f[t])==null?void 0:g[l])||a,y=b.useContext(d);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[u,c]}const s=()=>{const i=r.map(o=>b.createContext(o));return function(a){const l=(a==null?void 0:a[t])||i;return b.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[n,kx(s,...e)]}function kx(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=n.reduce((a,{useScope:l,scopeName:u})=>{const h=l(i)[`__scope${u}`];return{...a,...h}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function Xa(t){const e=Cx(t),r=b.forwardRef((n,s)=>{const{children:i,...o}=n,a=b.Children.toArray(i),l=a.find(Px);if(l){const u=l.props.children,c=a.map(h=>h===l?b.Children.count(u)>1?b.Children.only(null):b.isValidElement(u)?u.props.children:null:h);return S.jsx(e,{...o,ref:s,children:b.isValidElement(u)?b.cloneElement(u,void 0,c):null})}return S.jsx(e,{...o,ref:s,children:i})});return r.displayName=`${t}.Slot`,r}var Tx=Xa("Slot");function Cx(t){const e=b.forwardRef((r,n)=>{const{children:s,...i}=r;if(b.isValidElement(s)){const o=Ax(s),a=Rx(i,s.props);return s.type!==b.Fragment&&(a.ref=n?Xv(n,o):o),b.cloneElement(s,a)}return b.Children.count(s)>1?b.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var ey=Symbol("radix.slottable");function Ox(t){const e=({children:r})=>S.jsx(S.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=ey,e}function Px(t){return b.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===ey}function Rx(t,e){const r={...e};for(const n in e){const s=t[n],i=e[n];/^on[A-Z]/.test(n)?s&&i?r[n]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(r[n]=s):n==="style"?r[n]={...s,...i}:n==="className"&&(r[n]=[s,i].filter(Boolean).join(" "))}return{...t,...r}}function Ax(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}function jx(t){const e=t+"CollectionProvider",[r,n]=Nl(e),[s,i]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:w,children:m}=g,p=N.useRef(null),v=N.useRef(new Map).current;return S.jsx(s,{scope:w,itemMap:v,collectionRef:p,children:m})};o.displayName=e;const a=t+"CollectionSlot",l=Xa(a),u=N.forwardRef((g,w)=>{const{scope:m,children:p}=g,v=i(a,m),_=Gt(w,v.collectionRef);return S.jsx(l,{ref:_,children:p})});u.displayName=a;const c=t+"CollectionItemSlot",h="data-radix-collection-item",f=Xa(c),d=N.forwardRef((g,w)=>{const{scope:m,children:p,...v}=g,_=N.useRef(null),x=Gt(w,_),E=i(c,m);return N.useEffect(()=>(E.itemMap.set(_,{ref:_,...v}),()=>void E.itemMap.delete(_))),S.jsx(f,{[h]:"",ref:x,children:p})});d.displayName=c;function y(g){const w=i(t+"CollectionConsumer",g);return N.useCallback(()=>{const p=w.collectionRef.current;if(!p)return[];const v=Array.from(p.querySelectorAll(`[${h}]`));return Array.from(w.itemMap.values()).sort((E,k)=>v.indexOf(E.ref.current)-v.indexOf(k.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:o,Slot:u,ItemSlot:d},y,n]}var Nx=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ut=Nx.reduce((t,e)=>{const r=Xa(`Primitive.${e}`),n=b.forwardRef((s,i)=>{const{asChild:o,...a}=s,l=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(l,{...a,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function ty(t,e){t&&Co.flushSync(()=>t.dispatchEvent(e))}function hn(t){const e=b.useRef(t);return b.useEffect(()=>{e.current=t}),b.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}function Ix(t,e=globalThis==null?void 0:globalThis.document){const r=hn(t);b.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var $x="DismissableLayer",Mc="dismissableLayer.update",Lx="dismissableLayer.pointerDownOutside",Dx="dismissableLayer.focusOutside",sp,ry=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),hh=b.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...l}=t,u=b.useContext(ry),[c,h]=b.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,d]=b.useState({}),y=Gt(e,k=>h(k)),g=Array.from(u.layers),[w]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=g.indexOf(w),p=c?g.indexOf(c):-1,v=u.layersWithOutsidePointerEventsDisabled.size>0,_=p>=m,x=Ux(k=>{const O=k.target,j=[...u.branches].some(I=>I.contains(O));!_||j||(s==null||s(k),o==null||o(k),k.defaultPrevented||a==null||a())},f),E=Fx(k=>{const O=k.target;[...u.branches].some(I=>I.contains(O))||(i==null||i(k),o==null||o(k),k.defaultPrevented||a==null||a())},f);return Ix(k=>{p===u.layers.size-1&&(n==null||n(k),!k.defaultPrevented&&a&&(k.preventDefault(),a()))},f),b.useEffect(()=>{if(c)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(sp=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),ip(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=sp)}},[c,f,r,u]),b.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),ip())},[c,u]),b.useEffect(()=>{const k=()=>d({});return document.addEventListener(Mc,k),()=>document.removeEventListener(Mc,k)},[]),S.jsx(ut.div,{...l,ref:y,style:{pointerEvents:v?_?"auto":"none":void 0,...t.style},onFocusCapture:Ie(t.onFocusCapture,E.onFocusCapture),onBlurCapture:Ie(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Ie(t.onPointerDownCapture,x.onPointerDownCapture)})});hh.displayName=$x;var Mx="DismissableLayerBranch",ny=b.forwardRef((t,e)=>{const r=b.useContext(ry),n=b.useRef(null),s=Gt(e,n);return b.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),S.jsx(ut.div,{...t,ref:s})});ny.displayName=Mx;function Ux(t,e=globalThis==null?void 0:globalThis.document){const r=hn(t),n=b.useRef(!1),s=b.useRef(()=>{});return b.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){sy(Lx,r,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=l,e.addEventListener("click",s.current,{once:!0})):l()}else e.removeEventListener("click",s.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function Fx(t,e=globalThis==null?void 0:globalThis.document){const r=hn(t),n=b.useRef(!1);return b.useEffect(()=>{const s=i=>{i.target&&!n.current&&sy(Dx,r,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function ip(){const t=new CustomEvent(Mc);document.dispatchEvent(t)}function sy(t,e,r,{discrete:n}){const s=r.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&s.addEventListener(t,e,{once:!0}),n?ty(s,i):s.dispatchEvent(i)}var Bx=hh,zx=ny,fn=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},Vx="Portal",iy=b.forwardRef((t,e)=>{var a;const{container:r,...n}=t,[s,i]=b.useState(!1);fn(()=>i(!0),[]);const o=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?Jv.createPortal(S.jsx(ut.div,{...n,ref:e}),o):null});iy.displayName=Vx;function Wx(t,e){return b.useReducer((r,n)=>e[r][n]??r,t)}var fh=t=>{const{present:e,children:r}=t,n=Hx(e),s=typeof r=="function"?r({present:n.isPresent}):b.Children.only(r),i=Gt(n.ref,qx(s));return typeof r=="function"||n.isPresent?b.cloneElement(s,{ref:i}):null};fh.displayName="Presence";function Hx(t){const[e,r]=b.useState(),n=b.useRef(null),s=b.useRef(t),i=b.useRef("none"),o=t?"mounted":"unmounted",[a,l]=Wx(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const u=Yo(n.current);i.current=a==="mounted"?u:"none"},[a]),fn(()=>{const u=n.current,c=s.current;if(c!==t){const f=i.current,d=Yo(u);t?l("MOUNT"):d==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&f!==d?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,l]),fn(()=>{if(e){let u;const c=e.ownerDocument.defaultView??window,h=d=>{const g=Yo(n.current).includes(d.animationName);if(d.target===e&&g&&(l("ANIMATION_END"),!s.current)){const w=e.style.animationFillMode;e.style.animationFillMode="forwards",u=c.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=w)})}},f=d=>{d.target===e&&(i.current=Yo(n.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{c.clearTimeout(u),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:b.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function Yo(t){return(t==null?void 0:t.animationName)||"none"}function qx(t){var n,s;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var Kx=Gm[" useInsertionEffect ".trim().toString()]||fn;function Gx({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[s,i,o]=Qx({defaultProp:e,onChange:r}),a=t!==void 0,l=a?t:s;{const c=b.useRef(t!==void 0);b.useEffect(()=>{const h=c.current;h!==a&&console.warn(`${n} is changing from ${h?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),c.current=a},[a,n])}const u=b.useCallback(c=>{var h;if(a){const f=Zx(c)?c(t):c;f!==t&&((h=o.current)==null||h.call(o,f))}else i(c)},[a,t,i,o]);return[l,u]}function Qx({defaultProp:t,onChange:e}){const[r,n]=b.useState(t),s=b.useRef(r),i=b.useRef(e);return Kx(()=>{i.current=e},[e]),b.useEffect(()=>{var o;s.current!==r&&((o=i.current)==null||o.call(i,r),s.current=r)},[r,s]),[r,n,i]}function Zx(t){return typeof t=="function"}var Jx=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Yx="VisuallyHidden",Il=b.forwardRef((t,e)=>S.jsx(ut.span,{...t,ref:e,style:{...Jx,...t.style}}));Il.displayName=Yx;var Xx=Il,ph="ToastProvider",[mh,e1,t1]=jx("Toast"),[oy,qP]=Nl("Toast",[t1]),[r1,$l]=oy(ph),ay=t=>{const{__scopeToast:e,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=t,[a,l]=b.useState(null),[u,c]=b.useState(0),h=b.useRef(!1),f=b.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${ph}\`. Expected non-empty \`string\`.`),S.jsx(mh.Provider,{scope:e,children:S.jsx(r1,{scope:e,label:r,duration:n,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:b.useCallback(()=>c(d=>d+1),[]),onToastRemove:b.useCallback(()=>c(d=>d-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:f,children:o})})};ay.displayName=ph;var ly="ToastViewport",n1=["F8"],Uc="toast.viewportPause",Fc="toast.viewportResume",uy=b.forwardRef((t,e)=>{const{__scopeToast:r,hotkey:n=n1,label:s="Notifications ({hotkey})",...i}=t,o=$l(ly,r),a=e1(r),l=b.useRef(null),u=b.useRef(null),c=b.useRef(null),h=b.useRef(null),f=Gt(e,h,o.onViewportChange),d=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=o.toastCount>0;b.useEffect(()=>{const w=m=>{var v;n.length!==0&&n.every(_=>m[_]||m.code===_)&&((v=h.current)==null||v.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[n]),b.useEffect(()=>{const w=l.current,m=h.current;if(y&&w&&m){const p=()=>{if(!o.isClosePausedRef.current){const E=new CustomEvent(Uc);m.dispatchEvent(E),o.isClosePausedRef.current=!0}},v=()=>{if(o.isClosePausedRef.current){const E=new CustomEvent(Fc);m.dispatchEvent(E),o.isClosePausedRef.current=!1}},_=E=>{!w.contains(E.relatedTarget)&&v()},x=()=>{w.contains(document.activeElement)||v()};return w.addEventListener("focusin",p),w.addEventListener("focusout",_),w.addEventListener("pointermove",p),w.addEventListener("pointerleave",x),window.addEventListener("blur",p),window.addEventListener("focus",v),()=>{w.removeEventListener("focusin",p),w.removeEventListener("focusout",_),w.removeEventListener("pointermove",p),w.removeEventListener("pointerleave",x),window.removeEventListener("blur",p),window.removeEventListener("focus",v)}}},[y,o.isClosePausedRef]);const g=b.useCallback(({tabbingDirection:w})=>{const p=a().map(v=>{const _=v.ref.current,x=[_,...g1(_)];return w==="forwards"?x:x.reverse()});return(w==="forwards"?p.reverse():p).flat()},[a]);return b.useEffect(()=>{const w=h.current;if(w){const m=p=>{var x,E,k;const v=p.altKey||p.ctrlKey||p.metaKey;if(p.key==="Tab"&&!v){const O=document.activeElement,j=p.shiftKey;if(p.target===w&&j){(x=u.current)==null||x.focus();return}const F=g({tabbingDirection:j?"backwards":"forwards"}),te=F.findIndex($=>$===O);Pu(F.slice(te+1))?p.preventDefault():j?(E=u.current)==null||E.focus():(k=c.current)==null||k.focus()}};return w.addEventListener("keydown",m),()=>w.removeEventListener("keydown",m)}},[a,g]),S.jsxs(zx,{ref:l,role:"region","aria-label":s.replace("{hotkey}",d),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&S.jsx(Bc,{ref:u,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"forwards"});Pu(w)}}),S.jsx(mh.Slot,{scope:r,children:S.jsx(ut.ol,{tabIndex:-1,...i,ref:f})}),y&&S.jsx(Bc,{ref:c,onFocusFromOutsideViewport:()=>{const w=g({tabbingDirection:"backwards"});Pu(w)}})]})});uy.displayName=ly;var cy="ToastFocusProxy",Bc=b.forwardRef((t,e)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=t,i=$l(cy,r);return S.jsx(Il,{"aria-hidden":!0,tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&n()}})});Bc.displayName=cy;var Oo="Toast",s1="toast.swipeStart",i1="toast.swipeMove",o1="toast.swipeCancel",a1="toast.swipeEnd",dy=b.forwardRef((t,e)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:i,...o}=t,[a,l]=Gx({prop:n,defaultProp:s??!0,onChange:i,caller:Oo});return S.jsx(fh,{present:r||a,children:S.jsx(c1,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:hn(t.onPause),onResume:hn(t.onResume),onSwipeStart:Ie(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Ie(t.onSwipeMove,u=>{const{x:c,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:Ie(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Ie(t.onSwipeEnd,u=>{const{x:c,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${c}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),l(!1)})})})});dy.displayName=Oo;var[l1,u1]=oy(Oo,{onClose(){}}),c1=b.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:h,onSwipeCancel:f,onSwipeEnd:d,...y}=t,g=$l(Oo,r),[w,m]=b.useState(null),p=Gt(e,$=>m($)),v=b.useRef(null),_=b.useRef(null),x=s||g.duration,E=b.useRef(0),k=b.useRef(x),O=b.useRef(0),{onToastAdd:j,onToastRemove:I}=g,q=hn(()=>{var ie;(w==null?void 0:w.contains(document.activeElement))&&((ie=g.viewport)==null||ie.focus()),o()}),F=b.useCallback($=>{!$||$===1/0||(window.clearTimeout(O.current),E.current=new Date().getTime(),O.current=window.setTimeout(q,$))},[q]);b.useEffect(()=>{const $=g.viewport;if($){const ie=()=>{F(k.current),u==null||u()},K=()=>{const Y=new Date().getTime()-E.current;k.current=k.current-Y,window.clearTimeout(O.current),l==null||l()};return $.addEventListener(Uc,K),$.addEventListener(Fc,ie),()=>{$.removeEventListener(Uc,K),$.removeEventListener(Fc,ie)}}},[g.viewport,x,l,u,F]),b.useEffect(()=>{i&&!g.isClosePausedRef.current&&F(x)},[i,x,g.isClosePausedRef,F]),b.useEffect(()=>(j(),()=>I()),[j,I]);const te=b.useMemo(()=>w?yy(w):null,[w]);return g.viewport?S.jsxs(S.Fragment,{children:[te&&S.jsx(d1,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:te}),S.jsx(l1,{scope:r,onClose:q,children:Co.createPortal(S.jsx(mh.ItemSlot,{scope:r,children:S.jsx(Bx,{asChild:!0,onEscapeKeyDown:Ie(a,()=>{g.isFocusedToastEscapeKeyDownRef.current||q(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:S.jsx(ut.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...y,ref:p,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Ie(t.onKeyDown,$=>{$.key==="Escape"&&(a==null||a($.nativeEvent),$.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:Ie(t.onPointerDown,$=>{$.button===0&&(v.current={x:$.clientX,y:$.clientY})}),onPointerMove:Ie(t.onPointerMove,$=>{if(!v.current)return;const ie=$.clientX-v.current.x,K=$.clientY-v.current.y,Y=!!_.current,C=["left","right"].includes(g.swipeDirection),P=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,D=C?P(0,ie):0,X=C?0:P(0,K),W=$.pointerType==="touch"?10:2,ne={x:D,y:X},oe={originalEvent:$,delta:ne};Y?(_.current=ne,Xo(i1,h,oe,{discrete:!1})):op(ne,g.swipeDirection,W)?(_.current=ne,Xo(s1,c,oe,{discrete:!1}),$.target.setPointerCapture($.pointerId)):(Math.abs(ie)>W||Math.abs(K)>W)&&(v.current=null)}),onPointerUp:Ie(t.onPointerUp,$=>{const ie=_.current,K=$.target;if(K.hasPointerCapture($.pointerId)&&K.releasePointerCapture($.pointerId),_.current=null,v.current=null,ie){const Y=$.currentTarget,C={originalEvent:$,delta:ie};op(ie,g.swipeDirection,g.swipeThreshold)?Xo(a1,d,C,{discrete:!0}):Xo(o1,f,C,{discrete:!0}),Y.addEventListener("click",P=>P.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),d1=t=>{const{__scopeToast:e,children:r,...n}=t,s=$l(Oo,e),[i,o]=b.useState(!1),[a,l]=b.useState(!1);return p1(()=>o(!0)),b.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:S.jsx(iy,{asChild:!0,children:S.jsx(Il,{...n,children:i&&S.jsxs(S.Fragment,{children:[s.label," ",r]})})})},h1="ToastTitle",hy=b.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return S.jsx(ut.div,{...n,ref:e})});hy.displayName=h1;var f1="ToastDescription",fy=b.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return S.jsx(ut.div,{...n,ref:e})});fy.displayName=f1;var py="ToastAction",my=b.forwardRef((t,e)=>{const{altText:r,...n}=t;return r.trim()?S.jsx(vy,{altText:r,asChild:!0,children:S.jsx(gh,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${py}\`. Expected non-empty \`string\`.`),null)});my.displayName=py;var gy="ToastClose",gh=b.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,s=u1(gy,r);return S.jsx(vy,{asChild:!0,children:S.jsx(ut.button,{type:"button",...n,ref:e,onClick:Ie(t.onClick,s.onClose)})})});gh.displayName=gy;var vy=b.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...s}=t;return S.jsx(ut.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:e})});function yy(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),m1(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",i=n.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=n.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...yy(n))}}),e}function Xo(t,e,r,{discrete:n}){const s=r.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&s.addEventListener(t,e,{once:!0}),n?ty(s,i):s.dispatchEvent(i)}var op=(t,e,r=0)=>{const n=Math.abs(t.x),s=Math.abs(t.y),i=n>s;return e==="left"||e==="right"?i&&n>r:!i&&s>r};function p1(t=()=>{}){const e=hn(t);fn(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function m1(t){return t.nodeType===t.ELEMENT_NODE}function g1(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function Pu(t){const e=document.activeElement;return t.some(r=>r===e?!0:(r.focus(),document.activeElement!==e))}var v1=ay,wy=uy,_y=dy,by=hy,xy=fy,Sy=my,Ey=gh;function ky(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(r=ky(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Ty(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=ky(t))&&(n&&(n+=" "),n+=e);return n}const ap=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,lp=Ty,Cy=(t,e)=>r=>{var n;if((e==null?void 0:e.variants)==null)return lp(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(u=>{const c=r==null?void 0:r[u],h=i==null?void 0:i[u];if(c===null)return null;const f=ap(c)||ap(h);return s[u][f]}),a=r&&Object.entries(r).reduce((u,c)=>{let[h,f]=c;return f===void 0||(u[h]=f),u},{}),l=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((u,c)=>{let{class:h,className:f,...d}=c;return Object.entries(d).every(y=>{let[g,w]=y;return Array.isArray(w)?w.includes({...i,...a}[g]):{...i,...a}[g]===w})?[...u,h,f]:u},[]);return lp(t,o,l,r==null?void 0:r.class,r==null?void 0:r.className)};/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const y1=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Oy=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim();/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var w1={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _1=b.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:o,...a},l)=>b.createElement("svg",{ref:l,...w1,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:Oy("lucide",s),...a},[...o.map(([u,c])=>b.createElement(u,c)),...Array.isArray(i)?i:[i]]));/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ll=(t,e)=>{const r=b.forwardRef(({className:n,...s},i)=>b.createElement(_1,{ref:i,iconNode:e,className:Oy(`lucide-${y1(t)}`,n),...s}));return r.displayName=`${t}`,r};/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const b1=Ll("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const x1=Ll("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const S1=Ll("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const E1=Ll("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),vh="-",k1=t=>{const e=C1(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{const a=o.split(vh);return a[0]===""&&a.length!==1&&a.shift(),Py(a,e)||T1(o)},getConflictingClassGroupIds:(o,a)=>{const l=r[o]||[];return a&&n[o]?[...l,...n[o]]:l}}},Py=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const r=t[0],n=e.nextPart.get(r),s=n?Py(t.slice(1),n):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(vh);return(o=e.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},up=/^\[(.+)\]$/,T1=t=>{if(up.test(t)){const e=up.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},C1=t=>{const{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return P1(Object.entries(t.classGroups),r).forEach(([i,o])=>{zc(o,n,i,e)}),n},zc=(t,e,r,n)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:cp(e,s);i.classGroupId=r;return}if(typeof s=="function"){if(O1(s)){zc(s(n),e,r,n);return}e.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,o])=>{zc(o,cp(e,i),r,n)})})},cp=(t,e)=>{let r=t;return e.split(vh).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},O1=t=>t.isThemeGetter,P1=(t,e)=>e?t.map(([r,n])=>{const s=n.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[e+o,a])):i);return[r,s]}):t,R1=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map;const s=(i,o)=>{r.set(i,o),e++,e>t&&(e=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return s(i,o),o},set(i,o){r.has(i)?r.set(i,o):s(i,o)}}},Ry="!",A1=t=>{const{separator:e,experimentalParseClassName:r}=t,n=e.length===1,s=e[0],i=e.length,o=a=>{const l=[];let u=0,c=0,h;for(let w=0;w<a.length;w++){let m=a[w];if(u===0){if(m===s&&(n||a.slice(w,w+i)===e)){l.push(a.slice(c,w)),c=w+i;continue}if(m==="/"){h=w;continue}}m==="["?u++:m==="]"&&u--}const f=l.length===0?a:a.substring(c),d=f.startsWith(Ry),y=d?f.substring(1):f,g=h&&h>c?h-c:void 0;return{modifiers:l,hasImportantModifier:d,baseClassName:y,maybePostfixModifierPosition:g}};return r?a=>r({className:a,parseClassName:o}):o},j1=t=>{if(t.length<=1)return t;const e=[];let r=[];return t.forEach(n=>{n[0]==="["?(e.push(...r.sort(),n),r=[]):r.push(n)}),e.push(...r.sort()),e},N1=t=>({cache:R1(t.cacheSize),parseClassName:A1(t),...k1(t)}),I1=/\s+/,$1=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=e,i=[],o=t.trim().split(I1);let a="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:d}=r(u);let y=!!d,g=n(y?f.substring(0,d):f);if(!g){if(!y){a=u+(a.length>0?" "+a:a);continue}if(g=n(f),!g){a=u+(a.length>0?" "+a:a);continue}y=!1}const w=j1(c).join(":"),m=h?w+Ry:w,p=m+g;if(i.includes(p))continue;i.push(p);const v=s(g,y);for(let _=0;_<v.length;++_){const x=v[_];i.push(m+x)}a=u+(a.length>0?" "+a:a)}return a};function L1(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=Ay(e))&&(n&&(n+=" "),n+=r);return n}const Ay=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=Ay(t[n]))&&(r&&(r+=" "),r+=e);return r};function D1(t,...e){let r,n,s,i=o;function o(l){const u=e.reduce((c,h)=>h(c),t());return r=N1(u),n=r.cache.get,s=r.cache.set,i=a,a(l)}function a(l){const u=n(l);if(u)return u;const c=$1(l,r);return s(l,c),c}return function(){return i(L1.apply(null,arguments))}}const ge=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},jy=/^\[(?:([a-z-]+):)?(.+)\]$/i,M1=/^\d+\/\d+$/,U1=new Set(["px","full","screen"]),F1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,B1=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,z1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,V1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,W1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cr=t=>Is(t)||U1.has(t)||M1.test(t),$r=t=>ui(t,"length",Y1),Is=t=>!!t&&!Number.isNaN(Number(t)),Ru=t=>ui(t,"number",Is),ki=t=>!!t&&Number.isInteger(Number(t)),H1=t=>t.endsWith("%")&&Is(t.slice(0,-1)),ee=t=>jy.test(t),Lr=t=>F1.test(t),q1=new Set(["length","size","percentage"]),K1=t=>ui(t,q1,Ny),G1=t=>ui(t,"position",Ny),Q1=new Set(["image","url"]),Z1=t=>ui(t,Q1,eS),J1=t=>ui(t,"",X1),Ti=()=>!0,ui=(t,e,r)=>{const n=jy.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1},Y1=t=>B1.test(t)&&!z1.test(t),Ny=()=>!1,X1=t=>V1.test(t),eS=t=>W1.test(t),tS=()=>{const t=ge("colors"),e=ge("spacing"),r=ge("blur"),n=ge("brightness"),s=ge("borderColor"),i=ge("borderRadius"),o=ge("borderSpacing"),a=ge("borderWidth"),l=ge("contrast"),u=ge("grayscale"),c=ge("hueRotate"),h=ge("invert"),f=ge("gap"),d=ge("gradientColorStops"),y=ge("gradientColorStopPositions"),g=ge("inset"),w=ge("margin"),m=ge("opacity"),p=ge("padding"),v=ge("saturate"),_=ge("scale"),x=ge("sepia"),E=ge("skew"),k=ge("space"),O=ge("translate"),j=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",ee,e],F=()=>[ee,e],te=()=>["",cr,$r],$=()=>["auto",Is,ee],ie=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],K=()=>["solid","dashed","dotted","double","none"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],C=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",ee],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],X=()=>[Is,ee];return{cacheSize:500,separator:":",theme:{colors:[Ti],spacing:[cr,$r],blur:["none","",Lr,ee],brightness:X(),borderColor:[t],borderRadius:["none","","full",Lr,ee],borderSpacing:F(),borderWidth:te(),contrast:X(),grayscale:P(),hueRotate:X(),invert:P(),gap:F(),gradientColorStops:[t],gradientColorStopPositions:[H1,$r],inset:q(),margin:q(),opacity:X(),padding:F(),saturate:X(),scale:X(),sepia:P(),skew:X(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",ee]}],container:["container"],columns:[{columns:[Lr]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ie(),ee]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ki,ee]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ee]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",ki,ee]}],"grid-cols":[{"grid-cols":[Ti]}],"col-start-end":[{col:["auto",{span:["full",ki,ee]},ee]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[Ti]}],"row-start-end":[{row:["auto",{span:[ki,ee]},ee]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ee]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ee]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...C()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...C(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...C(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[p]}],px:[{px:[p]}],py:[{py:[p]}],ps:[{ps:[p]}],pe:[{pe:[p]}],pt:[{pt:[p]}],pr:[{pr:[p]}],pb:[{pb:[p]}],pl:[{pl:[p]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ee,e]}],"min-w":[{"min-w":[ee,e,"min","max","fit"]}],"max-w":[{"max-w":[ee,e,"none","full","min","max","fit","prose",{screen:[Lr]},Lr]}],h:[{h:[ee,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ee,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ee,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ee,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Lr,$r]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ru]}],"font-family":[{font:[Ti]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ee]}],"line-clamp":[{"line-clamp":["none",Is,Ru]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",cr,ee]}],"list-image":[{"list-image":["none",ee]}],"list-style-type":[{list:["none","disc","decimal",ee]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[m]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",cr,$r]}],"underline-offset":[{"underline-offset":["auto",cr,ee]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[m]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ie(),G1]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",K1]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Z1]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[d]}],"gradient-via":[{via:[d]}],"gradient-to":[{to:[d]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[m]}],"border-style":[{border:[...K(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[m]}],"divide-style":[{divide:K()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...K()]}],"outline-offset":[{"outline-offset":[cr,ee]}],"outline-w":[{outline:[cr,$r]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[m]}],"ring-offset-w":[{"ring-offset":[cr,$r]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Lr,J1]}],"shadow-color":[{shadow:[Ti]}],opacity:[{opacity:[m]}],"mix-blend":[{"mix-blend":[...Y(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Y()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Lr,ee]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[h]}],saturate:[{saturate:[v]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ee]}],duration:[{duration:X()}],ease:[{ease:["linear","in","out","in-out",ee]}],delay:[{delay:X()}],animate:[{animate:["none","spin","ping","pulse","bounce",ee]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[ki,ee]}],"translate-x":[{"translate-x":[O]}],"translate-y":[{"translate-y":[O]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ee]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ee]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[cr,$r,Ru]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},rS=D1(tS);function Cr(...t){return rS(Ty(t))}const nS=v1,Iy=b.forwardRef(({className:t,...e},r)=>S.jsx(wy,{ref:r,className:Cr("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));Iy.displayName=wy.displayName;const sS=Cy("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),$y=b.forwardRef(({className:t,variant:e,...r},n)=>S.jsx(_y,{ref:n,className:Cr(sS({variant:e}),t),...r}));$y.displayName=_y.displayName;const iS=b.forwardRef(({className:t,...e},r)=>S.jsx(Sy,{ref:r,className:Cr("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",t),...e}));iS.displayName=Sy.displayName;const Ly=b.forwardRef(({className:t,...e},r)=>S.jsx(Ey,{ref:r,className:Cr("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:S.jsx(E1,{className:"h-4 w-4"})}));Ly.displayName=Ey.displayName;const Dy=b.forwardRef(({className:t,...e},r)=>S.jsx(by,{ref:r,className:Cr("text-sm font-semibold",t),...e}));Dy.displayName=by.displayName;const My=b.forwardRef(({className:t,...e},r)=>S.jsx(xy,{ref:r,className:Cr("text-sm opacity-90",t),...e}));My.displayName=xy.displayName;function oS(){const{toasts:t}=Ex();return S.jsxs(nS,{children:[t.map(function({id:e,title:r,description:n,action:s,...i}){return S.jsxs($y,{...i,children:[S.jsxs("div",{className:"grid gap-1",children:[r&&S.jsx(Dy,{children:r}),n&&S.jsx(My,{children:n})]}),s,S.jsx(Ly,{})]},e)}),S.jsx(Iy,{})]})}var dp=["light","dark"],aS="(prefers-color-scheme: dark)",lS=b.createContext(void 0),uS={setTheme:t=>{},themes:[]},cS=()=>{var t;return(t=b.useContext(lS))!=null?t:uS};b.memo(({forcedTheme:t,storageKey:e,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:i,value:o,attrs:a,nonce:l})=>{let u=i==="system",c=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(y=>`'${y}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,h=s?dp.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(y,g=!1,w=!0)=>{let m=o?o[y]:y,p=g?y+"|| ''":`'${m}'`,v="";return s&&w&&!g&&dp.includes(y)&&(v+=`d.style.colorScheme = '${y}';`),r==="class"?g||m?v+=`c.add(${p})`:v+="null":m&&(v+=`d[s](n,${p})`),v},d=t?`!function(){${c}${f(t)}}()`:n?`!function(){try{${c}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${aS}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}${u?"":"else{"+f(i,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${c}var e=localStorage.getItem('${e}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}else{${f(i,!1,!1)};}${h}}catch(t){}}();`;return b.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:d}})});var dS=t=>{switch(t){case"success":return pS;case"info":return gS;case"warning":return mS;case"error":return vS;default:return null}},hS=Array(12).fill(0),fS=({visible:t,className:e})=>N.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},N.createElement("div",{className:"sonner-spinner"},hS.map((r,n)=>N.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),pS=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},N.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),mS=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},N.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),gS=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},N.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),vS=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},N.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),yS=N.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},N.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),N.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),wS=()=>{let[t,e]=N.useState(document.hidden);return N.useEffect(()=>{let r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t},Vc=1,_S=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:r,...n}=t,s=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:Vc++,i=this.toasts.find(a=>a.id===s),o=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(a=>a.id===s?(this.publish({...a,...t,id:s,title:r}),{...a,...t,id:s,dismissible:o,title:r}):a):this.addToast({title:r,...n,dismissible:o,id:s}),s},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(r=>r({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let r;e.loading!==void 0&&(r=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let n=t instanceof Promise?t:t(),s=r!==void 0,i,o=n.then(async l=>{if(i=["resolve",l],N.isValidElement(l))s=!1,this.create({id:r,type:"default",message:l});else if(xS(l)&&!l.ok){s=!1;let u=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,c=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:r,type:"error",message:u,description:c})}else if(e.success!==void 0){s=!1;let u=typeof e.success=="function"?await e.success(l):e.success,c=typeof e.description=="function"?await e.description(l):e.description;this.create({id:r,type:"success",message:u,description:c})}}).catch(async l=>{if(i=["reject",l],e.error!==void 0){s=!1;let u=typeof e.error=="function"?await e.error(l):e.error,c=typeof e.description=="function"?await e.description(l):e.description;this.create({id:r,type:"error",message:u,description:c})}}).finally(()=>{var l;s&&(this.dismiss(r),r=void 0),(l=e.finally)==null||l.call(e)}),a=()=>new Promise((l,u)=>o.then(()=>i[0]==="reject"?u(i[1]):l(i[1])).catch(u));return typeof r!="string"&&typeof r!="number"?{unwrap:a}:Object.assign(r,{unwrap:a})},this.custom=(t,e)=>{let r=(e==null?void 0:e.id)||Vc++;return this.create({jsx:t(r),id:r,...e}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},rt=new _S,bS=(t,e)=>{let r=(e==null?void 0:e.id)||Vc++;return rt.addToast({title:t,...e,id:r}),r},xS=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",SS=bS,ES=()=>rt.toasts,kS=()=>rt.getActiveToasts();Object.assign(SS,{success:rt.success,info:rt.info,warning:rt.warning,error:rt.error,custom:rt.custom,message:rt.message,promise:rt.promise,dismiss:rt.dismiss,loading:rt.loading},{getHistory:ES,getToasts:kS});function TS(t,{insertAt:e}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}TS(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
`);function ea(t){return t.label!==void 0}var CS=3,OS="32px",PS="16px",hp=4e3,RS=356,AS=14,jS=20,NS=200;function $t(...t){return t.filter(Boolean).join(" ")}function IS(t){let[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}var $S=t=>{var e,r,n,s,i,o,a,l,u,c,h;let{invert:f,toast:d,unstyled:y,interacting:g,setHeights:w,visibleToasts:m,heights:p,index:v,toasts:_,expanded:x,removeToast:E,defaultRichColors:k,closeButton:O,style:j,cancelButtonStyle:I,actionButtonStyle:q,className:F="",descriptionClassName:te="",duration:$,position:ie,gap:K,loadingIcon:Y,expandByDefault:C,classNames:P,icons:D,closeButtonAriaLabel:X="Close toast",pauseWhenPageIsHidden:W}=t,[ne,oe]=N.useState(null),[Pe,ze]=N.useState(null),[de,es]=N.useState(!1),[Or,xn]=N.useState(!1),[Pr,ts]=N.useState(!1),[Rr,Ao]=N.useState(!1),[Zl,jo]=N.useState(!1),[Jl,mi]=N.useState(0),[rs,Uh]=N.useState(0),gi=N.useRef(d.duration||$||hp),Fh=N.useRef(null),Sn=N.useRef(null),Uw=v===0,Fw=v+1<=m,xt=d.type,ns=d.dismissible!==!1,Bw=d.className||"",zw=d.descriptionClassName||"",No=N.useMemo(()=>p.findIndex(Z=>Z.toastId===d.id)||0,[p,d.id]),Vw=N.useMemo(()=>{var Z;return(Z=d.closeButton)!=null?Z:O},[d.closeButton,O]),Bh=N.useMemo(()=>d.duration||$||hp,[d.duration,$]),Yl=N.useRef(0),ss=N.useRef(0),zh=N.useRef(0),is=N.useRef(null),[Ww,Hw]=ie.split("-"),Vh=N.useMemo(()=>p.reduce((Z,fe,we)=>we>=No?Z:Z+fe.height,0),[p,No]),Wh=wS(),qw=d.invert||f,Xl=xt==="loading";ss.current=N.useMemo(()=>No*K+Vh,[No,Vh]),N.useEffect(()=>{gi.current=Bh},[Bh]),N.useEffect(()=>{es(!0)},[]),N.useEffect(()=>{let Z=Sn.current;if(Z){let fe=Z.getBoundingClientRect().height;return Uh(fe),w(we=>[{toastId:d.id,height:fe,position:d.position},...we]),()=>w(we=>we.filter(At=>At.toastId!==d.id))}},[w,d.id]),N.useLayoutEffect(()=>{if(!de)return;let Z=Sn.current,fe=Z.style.height;Z.style.height="auto";let we=Z.getBoundingClientRect().height;Z.style.height=fe,Uh(we),w(At=>At.find(jt=>jt.toastId===d.id)?At.map(jt=>jt.toastId===d.id?{...jt,height:we}:jt):[{toastId:d.id,height:we,position:d.position},...At])},[de,d.title,d.description,w,d.id]);let Ar=N.useCallback(()=>{xn(!0),mi(ss.current),w(Z=>Z.filter(fe=>fe.toastId!==d.id)),setTimeout(()=>{E(d)},NS)},[d,E,w,ss]);N.useEffect(()=>{if(d.promise&&xt==="loading"||d.duration===1/0||d.type==="loading")return;let Z;return x||g||W&&Wh?(()=>{if(zh.current<Yl.current){let fe=new Date().getTime()-Yl.current;gi.current=gi.current-fe}zh.current=new Date().getTime()})():gi.current!==1/0&&(Yl.current=new Date().getTime(),Z=setTimeout(()=>{var fe;(fe=d.onAutoClose)==null||fe.call(d,d),Ar()},gi.current)),()=>clearTimeout(Z)},[x,g,d,xt,W,Wh,Ar]),N.useEffect(()=>{d.delete&&Ar()},[Ar,d.delete]);function Kw(){var Z,fe,we;return D!=null&&D.loading?N.createElement("div",{className:$t(P==null?void 0:P.loader,(Z=d==null?void 0:d.classNames)==null?void 0:Z.loader,"sonner-loader"),"data-visible":xt==="loading"},D.loading):Y?N.createElement("div",{className:$t(P==null?void 0:P.loader,(fe=d==null?void 0:d.classNames)==null?void 0:fe.loader,"sonner-loader"),"data-visible":xt==="loading"},Y):N.createElement(fS,{className:$t(P==null?void 0:P.loader,(we=d==null?void 0:d.classNames)==null?void 0:we.loader),visible:xt==="loading"})}return N.createElement("li",{tabIndex:0,ref:Sn,className:$t(F,Bw,P==null?void 0:P.toast,(e=d==null?void 0:d.classNames)==null?void 0:e.toast,P==null?void 0:P.default,P==null?void 0:P[xt],(r=d==null?void 0:d.classNames)==null?void 0:r[xt]),"data-sonner-toast":"","data-rich-colors":(n=d.richColors)!=null?n:k,"data-styled":!(d.jsx||d.unstyled||y),"data-mounted":de,"data-promise":!!d.promise,"data-swiped":Zl,"data-removed":Or,"data-visible":Fw,"data-y-position":Ww,"data-x-position":Hw,"data-index":v,"data-front":Uw,"data-swiping":Pr,"data-dismissible":ns,"data-type":xt,"data-invert":qw,"data-swipe-out":Rr,"data-swipe-direction":Pe,"data-expanded":!!(x||C&&de),style:{"--index":v,"--toasts-before":v,"--z-index":_.length-v,"--offset":`${Or?Jl:ss.current}px`,"--initial-height":C?"auto":`${rs}px`,...j,...d.style},onDragEnd:()=>{ts(!1),oe(null),is.current=null},onPointerDown:Z=>{Xl||!ns||(Fh.current=new Date,mi(ss.current),Z.target.setPointerCapture(Z.pointerId),Z.target.tagName!=="BUTTON"&&(ts(!0),is.current={x:Z.clientX,y:Z.clientY}))},onPointerUp:()=>{var Z,fe,we,At;if(Rr||!ns)return;is.current=null;let jt=Number(((Z=Sn.current)==null?void 0:Z.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),jr=Number(((fe=Sn.current)==null?void 0:fe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),En=new Date().getTime()-((we=Fh.current)==null?void 0:we.getTime()),Nt=ne==="x"?jt:jr,Nr=Math.abs(Nt)/En;if(Math.abs(Nt)>=jS||Nr>.11){mi(ss.current),(At=d.onDismiss)==null||At.call(d,d),ze(ne==="x"?jt>0?"right":"left":jr>0?"down":"up"),Ar(),Ao(!0),jo(!1);return}ts(!1),oe(null)},onPointerMove:Z=>{var fe,we,At,jt;if(!is.current||!ns||((fe=window.getSelection())==null?void 0:fe.toString().length)>0)return;let jr=Z.clientY-is.current.y,En=Z.clientX-is.current.x,Nt=(we=t.swipeDirections)!=null?we:IS(ie);!ne&&(Math.abs(En)>1||Math.abs(jr)>1)&&oe(Math.abs(En)>Math.abs(jr)?"x":"y");let Nr={x:0,y:0};ne==="y"?(Nt.includes("top")||Nt.includes("bottom"))&&(Nt.includes("top")&&jr<0||Nt.includes("bottom")&&jr>0)&&(Nr.y=jr):ne==="x"&&(Nt.includes("left")||Nt.includes("right"))&&(Nt.includes("left")&&En<0||Nt.includes("right")&&En>0)&&(Nr.x=En),(Math.abs(Nr.x)>0||Math.abs(Nr.y)>0)&&jo(!0),(At=Sn.current)==null||At.style.setProperty("--swipe-amount-x",`${Nr.x}px`),(jt=Sn.current)==null||jt.style.setProperty("--swipe-amount-y",`${Nr.y}px`)}},Vw&&!d.jsx?N.createElement("button",{"aria-label":X,"data-disabled":Xl,"data-close-button":!0,onClick:Xl||!ns?()=>{}:()=>{var Z;Ar(),(Z=d.onDismiss)==null||Z.call(d,d)},className:$t(P==null?void 0:P.closeButton,(s=d==null?void 0:d.classNames)==null?void 0:s.closeButton)},(i=D==null?void 0:D.close)!=null?i:yS):null,d.jsx||b.isValidElement(d.title)?d.jsx?d.jsx:typeof d.title=="function"?d.title():d.title:N.createElement(N.Fragment,null,xt||d.icon||d.promise?N.createElement("div",{"data-icon":"",className:$t(P==null?void 0:P.icon,(o=d==null?void 0:d.classNames)==null?void 0:o.icon)},d.promise||d.type==="loading"&&!d.icon?d.icon||Kw():null,d.type!=="loading"?d.icon||(D==null?void 0:D[xt])||dS(xt):null):null,N.createElement("div",{"data-content":"",className:$t(P==null?void 0:P.content,(a=d==null?void 0:d.classNames)==null?void 0:a.content)},N.createElement("div",{"data-title":"",className:$t(P==null?void 0:P.title,(l=d==null?void 0:d.classNames)==null?void 0:l.title)},typeof d.title=="function"?d.title():d.title),d.description?N.createElement("div",{"data-description":"",className:$t(te,zw,P==null?void 0:P.description,(u=d==null?void 0:d.classNames)==null?void 0:u.description)},typeof d.description=="function"?d.description():d.description):null),b.isValidElement(d.cancel)?d.cancel:d.cancel&&ea(d.cancel)?N.createElement("button",{"data-button":!0,"data-cancel":!0,style:d.cancelButtonStyle||I,onClick:Z=>{var fe,we;ea(d.cancel)&&ns&&((we=(fe=d.cancel).onClick)==null||we.call(fe,Z),Ar())},className:$t(P==null?void 0:P.cancelButton,(c=d==null?void 0:d.classNames)==null?void 0:c.cancelButton)},d.cancel.label):null,b.isValidElement(d.action)?d.action:d.action&&ea(d.action)?N.createElement("button",{"data-button":!0,"data-action":!0,style:d.actionButtonStyle||q,onClick:Z=>{var fe,we;ea(d.action)&&((we=(fe=d.action).onClick)==null||we.call(fe,Z),!Z.defaultPrevented&&Ar())},className:$t(P==null?void 0:P.actionButton,(h=d==null?void 0:d.classNames)==null?void 0:h.actionButton)},d.action.label):null))};function fp(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function LS(t,e){let r={};return[t,e].forEach((n,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",a=i?PS:OS;function l(u){["top","right","bottom","left"].forEach(c=>{r[`${o}-${c}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${o}-${u}`]=a:r[`${o}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):l(a)}),r}var DS=b.forwardRef(function(t,e){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:a,offset:l,mobileOffset:u,theme:c="light",richColors:h,duration:f,style:d,visibleToasts:y=CS,toastOptions:g,dir:w=fp(),gap:m=AS,loadingIcon:p,icons:v,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:x}=t,[E,k]=N.useState([]),O=N.useMemo(()=>Array.from(new Set([n].concat(E.filter(W=>W.position).map(W=>W.position)))),[E,n]),[j,I]=N.useState([]),[q,F]=N.useState(!1),[te,$]=N.useState(!1),[ie,K]=N.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=N.useRef(null),C=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=N.useRef(null),D=N.useRef(!1),X=N.useCallback(W=>{k(ne=>{var oe;return(oe=ne.find(Pe=>Pe.id===W.id))!=null&&oe.delete||rt.dismiss(W.id),ne.filter(({id:Pe})=>Pe!==W.id)})},[]);return N.useEffect(()=>rt.subscribe(W=>{if(W.dismiss){k(ne=>ne.map(oe=>oe.id===W.id?{...oe,delete:!0}:oe));return}setTimeout(()=>{Jv.flushSync(()=>{k(ne=>{let oe=ne.findIndex(Pe=>Pe.id===W.id);return oe!==-1?[...ne.slice(0,oe),{...ne[oe],...W},...ne.slice(oe+1)]:[W,...ne]})})})}),[]),N.useEffect(()=>{if(c!=="system"){K(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?K("dark"):K("light")),typeof window>"u")return;let W=window.matchMedia("(prefers-color-scheme: dark)");try{W.addEventListener("change",({matches:ne})=>{K(ne?"dark":"light")})}catch{W.addListener(({matches:oe})=>{try{K(oe?"dark":"light")}catch(Pe){console.error(Pe)}})}},[c]),N.useEffect(()=>{E.length<=1&&F(!1)},[E]),N.useEffect(()=>{let W=ne=>{var oe,Pe;s.every(ze=>ne[ze]||ne.code===ze)&&(F(!0),(oe=Y.current)==null||oe.focus()),ne.code==="Escape"&&(document.activeElement===Y.current||(Pe=Y.current)!=null&&Pe.contains(document.activeElement))&&F(!1)};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[s]),N.useEffect(()=>{if(Y.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,D.current=!1)}},[Y.current]),N.createElement("section",{ref:e,"aria-label":`${_} ${C}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},O.map((W,ne)=>{var oe;let[Pe,ze]=W.split("-");return E.length?N.createElement("ol",{key:W,dir:w==="auto"?fp():w,tabIndex:-1,ref:Y,className:a,"data-sonner-toaster":!0,"data-theme":ie,"data-y-position":Pe,"data-lifted":q&&E.length>1&&!i,"data-x-position":ze,style:{"--front-toast-height":`${((oe=j[0])==null?void 0:oe.height)||0}px`,"--width":`${RS}px`,"--gap":`${m}px`,...d,...LS(l,u)},onBlur:de=>{D.current&&!de.currentTarget.contains(de.relatedTarget)&&(D.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||D.current||(D.current=!0,P.current=de.relatedTarget)},onMouseEnter:()=>F(!0),onMouseMove:()=>F(!0),onMouseLeave:()=>{te||F(!1)},onDragEnd:()=>F(!1),onPointerDown:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},E.filter(de=>!de.position&&ne===0||de.position===W).map((de,es)=>{var Or,xn;return N.createElement($S,{key:de.id,icons:v,index:es,toast:de,defaultRichColors:h,duration:(Or=g==null?void 0:g.duration)!=null?Or:f,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:r,visibleToasts:y,closeButton:(xn=g==null?void 0:g.closeButton)!=null?xn:o,interacting:te,position:W,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:X,toasts:E.filter(Pr=>Pr.position==de.position),heights:j.filter(Pr=>Pr.position==de.position),setHeights:I,expandByDefault:i,gap:m,loadingIcon:p,expanded:q,pauseWhenPageIsHidden:x,swipeDirections:t.swipeDirections})})):null}))});const MS=({...t})=>{const{theme:e="system"}=cS();return S.jsx(DS,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})},US=["top","right","bottom","left"],pn=Math.min,ht=Math.max,el=Math.round,ta=Math.floor,or=t=>({x:t,y:t}),FS={left:"right",right:"left",bottom:"top",top:"bottom"},BS={start:"end",end:"start"};function Wc(t,e,r){return ht(t,pn(e,r))}function Sr(t,e){return typeof t=="function"?t(e):t}function Er(t){return t.split("-")[0]}function ci(t){return t.split("-")[1]}function yh(t){return t==="x"?"y":"x"}function wh(t){return t==="y"?"height":"width"}const zS=new Set(["top","bottom"]);function nr(t){return zS.has(Er(t))?"y":"x"}function _h(t){return yh(nr(t))}function VS(t,e,r){r===void 0&&(r=!1);const n=ci(t),s=_h(t),i=wh(s);let o=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=tl(o)),[o,tl(o)]}function WS(t){const e=tl(t);return[Hc(t),e,Hc(e)]}function Hc(t){return t.replace(/start|end/g,e=>BS[e])}const pp=["left","right"],mp=["right","left"],HS=["top","bottom"],qS=["bottom","top"];function KS(t,e,r){switch(t){case"top":case"bottom":return r?e?mp:pp:e?pp:mp;case"left":case"right":return e?HS:qS;default:return[]}}function GS(t,e,r,n){const s=ci(t);let i=KS(Er(t),r==="start",n);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(Hc)))),i}function tl(t){return t.replace(/left|right|bottom|top/g,e=>FS[e])}function QS(t){return{top:0,right:0,bottom:0,left:0,...t}}function Uy(t){return typeof t!="number"?QS(t):{top:t,right:t,bottom:t,left:t}}function rl(t){const{x:e,y:r,width:n,height:s}=t;return{width:n,height:s,top:r,left:e,right:e+n,bottom:r+s,x:e,y:r}}function gp(t,e,r){let{reference:n,floating:s}=t;const i=nr(e),o=_h(e),a=wh(o),l=Er(e),u=i==="y",c=n.x+n.width/2-s.width/2,h=n.y+n.height/2-s.height/2,f=n[a]/2-s[a]/2;let d;switch(l){case"top":d={x:c,y:n.y-s.height};break;case"bottom":d={x:c,y:n.y+n.height};break;case"right":d={x:n.x+n.width,y:h};break;case"left":d={x:n.x-s.width,y:h};break;default:d={x:n.x,y:n.y}}switch(ci(e)){case"start":d[o]-=f*(r&&u?-1:1);break;case"end":d[o]+=f*(r&&u?-1:1);break}return d}const ZS=async(t,e,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:i=[],platform:o}=r,a=i.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:c,y:h}=gp(u,n,l),f=n,d={},y=0;for(let g=0;g<a.length;g++){const{name:w,fn:m}=a[g],{x:p,y:v,data:_,reset:x}=await m({x:c,y:h,initialPlacement:n,placement:f,strategy:s,middlewareData:d,rects:u,platform:o,elements:{reference:t,floating:e}});c=p??c,h=v??h,d={...d,[w]:{...d[w],..._}},x&&y<=50&&(y++,typeof x=="object"&&(x.placement&&(f=x.placement),x.rects&&(u=x.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):x.rects),{x:c,y:h}=gp(u,f,l)),g=-1)}return{x:c,y:h,placement:f,strategy:s,middlewareData:d}};async function lo(t,e){var r;e===void 0&&(e={});const{x:n,y:s,platform:i,rects:o,elements:a,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:h="floating",altBoundary:f=!1,padding:d=0}=Sr(e,t),y=Uy(d),w=a[f?h==="floating"?"reference":"floating":h],m=rl(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(w)))==null||r?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),p=h==="floating"?{x:n,y:s,width:o.floating.width,height:o.floating.height}:o.reference,v=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),_=await(i.isElement==null?void 0:i.isElement(v))?await(i.getScale==null?void 0:i.getScale(v))||{x:1,y:1}:{x:1,y:1},x=rl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:p,offsetParent:v,strategy:l}):p);return{top:(m.top-x.top+y.top)/_.y,bottom:(x.bottom-m.bottom+y.bottom)/_.y,left:(m.left-x.left+y.left)/_.x,right:(x.right-m.right+y.right)/_.x}}const JS=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:s,rects:i,platform:o,elements:a,middlewareData:l}=e,{element:u,padding:c=0}=Sr(t,e)||{};if(u==null)return{};const h=Uy(c),f={x:r,y:n},d=_h(s),y=wh(d),g=await o.getDimensions(u),w=d==="y",m=w?"top":"left",p=w?"bottom":"right",v=w?"clientHeight":"clientWidth",_=i.reference[y]+i.reference[d]-f[d]-i.floating[y],x=f[d]-i.reference[d],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let k=E?E[v]:0;(!k||!await(o.isElement==null?void 0:o.isElement(E)))&&(k=a.floating[v]||i.floating[y]);const O=_/2-x/2,j=k/2-g[y]/2-1,I=pn(h[m],j),q=pn(h[p],j),F=I,te=k-g[y]-q,$=k/2-g[y]/2+O,ie=Wc(F,$,te),K=!l.arrow&&ci(s)!=null&&$!==ie&&i.reference[y]/2-($<F?I:q)-g[y]/2<0,Y=K?$<F?$-F:$-te:0;return{[d]:f[d]+Y,data:{[d]:ie,centerOffset:$-ie-Y,...K&&{alignmentOffset:Y}},reset:K}}}),YS=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:s,middlewareData:i,rects:o,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:g=!0,...w}=Sr(t,e);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const m=Er(s),p=nr(a),v=Er(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(u.floating)),x=f||(v||!g?[tl(a)]:WS(a)),E=y!=="none";!f&&E&&x.push(...GS(a,g,y,_));const k=[a,...x],O=await lo(e,w),j=[];let I=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&j.push(O[m]),h){const $=VS(s,o,_);j.push(O[$[0]],O[$[1]])}if(I=[...I,{placement:s,overflows:j}],!j.every($=>$<=0)){var q,F;const $=(((q=i.flip)==null?void 0:q.index)||0)+1,ie=k[$];if(ie&&(!(h==="alignment"?p!==nr(ie):!1)||I.every(C=>C.overflows[0]>0&&nr(C.placement)===p)))return{data:{index:$,overflows:I},reset:{placement:ie}};let K=(F=I.filter(Y=>Y.overflows[0]<=0).sort((Y,C)=>Y.overflows[1]-C.overflows[1])[0])==null?void 0:F.placement;if(!K)switch(d){case"bestFit":{var te;const Y=(te=I.filter(C=>{if(E){const P=nr(C.placement);return P===p||P==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(P=>P>0).reduce((P,D)=>P+D,0)]).sort((C,P)=>C[1]-P[1])[0])==null?void 0:te[0];Y&&(K=Y);break}case"initialPlacement":K=a;break}if(s!==K)return{reset:{placement:K}}}return{}}}};function vp(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function yp(t){return US.some(e=>t[e]>=0)}const XS=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...s}=Sr(t,e);switch(n){case"referenceHidden":{const i=await lo(e,{...s,elementContext:"reference"}),o=vp(i,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:yp(o)}}}case"escaped":{const i=await lo(e,{...s,altBoundary:!0}),o=vp(i,r.floating);return{data:{escapedOffsets:o,escaped:yp(o)}}}default:return{}}}}},Fy=new Set(["left","top"]);async function eE(t,e){const{placement:r,platform:n,elements:s}=t,i=await(n.isRTL==null?void 0:n.isRTL(s.floating)),o=Er(r),a=ci(r),l=nr(r)==="y",u=Fy.has(o)?-1:1,c=i&&l?-1:1,h=Sr(e,t);let{mainAxis:f,crossAxis:d,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof y=="number"&&(d=a==="end"?y*-1:y),l?{x:d*c,y:f*u}:{x:f*u,y:d*c}}const tE=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:s,y:i,placement:o,middlewareData:a}=e,l=await eE(e,t);return o===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:o}}}}},rE=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:s}=e,{mainAxis:i=!0,crossAxis:o=!1,limiter:a={fn:w=>{let{x:m,y:p}=w;return{x:m,y:p}}},...l}=Sr(t,e),u={x:r,y:n},c=await lo(e,l),h=nr(Er(s)),f=yh(h);let d=u[f],y=u[h];if(i){const w=f==="y"?"top":"left",m=f==="y"?"bottom":"right",p=d+c[w],v=d-c[m];d=Wc(p,d,v)}if(o){const w=h==="y"?"top":"left",m=h==="y"?"bottom":"right",p=y+c[w],v=y-c[m];y=Wc(p,y,v)}const g=a.fn({...e,[f]:d,[h]:y});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[f]:i,[h]:o}}}}}},nE=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:s,rects:i,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Sr(t,e),c={x:r,y:n},h=nr(s),f=yh(h);let d=c[f],y=c[h];const g=Sr(a,e),w=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const v=f==="y"?"height":"width",_=i.reference[f]-i.floating[v]+w.mainAxis,x=i.reference[f]+i.reference[v]-w.mainAxis;d<_?d=_:d>x&&(d=x)}if(u){var m,p;const v=f==="y"?"width":"height",_=Fy.has(Er(s)),x=i.reference[h]-i.floating[v]+(_&&((m=o.offset)==null?void 0:m[h])||0)+(_?0:w.crossAxis),E=i.reference[h]+i.reference[v]+(_?0:((p=o.offset)==null?void 0:p[h])||0)-(_?w.crossAxis:0);y<x?y=x:y>E&&(y=E)}return{[f]:d,[h]:y}}}},sE=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:s,rects:i,platform:o,elements:a}=e,{apply:l=()=>{},...u}=Sr(t,e),c=await lo(e,u),h=Er(s),f=ci(s),d=nr(s)==="y",{width:y,height:g}=i.floating;let w,m;h==="top"||h==="bottom"?(w=h,m=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(m=h,w=f==="end"?"top":"bottom");const p=g-c.top-c.bottom,v=y-c.left-c.right,_=pn(g-c[w],p),x=pn(y-c[m],v),E=!e.middlewareData.shift;let k=_,O=x;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(O=v),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(k=p),E&&!f){const I=ht(c.left,0),q=ht(c.right,0),F=ht(c.top,0),te=ht(c.bottom,0);d?O=y-2*(I!==0||q!==0?I+q:ht(c.left,c.right)):k=g-2*(F!==0||te!==0?F+te:ht(c.top,c.bottom))}await l({...e,availableWidth:O,availableHeight:k});const j=await o.getDimensions(a.floating);return y!==j.width||g!==j.height?{reset:{rects:!0}}:{}}}};function Dl(){return typeof window<"u"}function di(t){return By(t)?(t.nodeName||"").toLowerCase():"#document"}function vt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ur(t){var e;return(e=(By(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function By(t){return Dl()?t instanceof Node||t instanceof vt(t).Node:!1}function Qt(t){return Dl()?t instanceof Element||t instanceof vt(t).Element:!1}function lr(t){return Dl()?t instanceof HTMLElement||t instanceof vt(t).HTMLElement:!1}function wp(t){return!Dl()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof vt(t).ShadowRoot}const iE=new Set(["inline","contents"]);function Po(t){const{overflow:e,overflowX:r,overflowY:n,display:s}=Zt(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!iE.has(s)}const oE=new Set(["table","td","th"]);function aE(t){return oE.has(di(t))}const lE=[":popover-open",":modal"];function Ml(t){return lE.some(e=>{try{return t.matches(e)}catch{return!1}})}const uE=["transform","translate","scale","rotate","perspective"],cE=["transform","translate","scale","rotate","perspective","filter"],dE=["paint","layout","strict","content"];function bh(t){const e=xh(),r=Qt(t)?Zt(t):t;return uE.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||cE.some(n=>(r.willChange||"").includes(n))||dE.some(n=>(r.contain||"").includes(n))}function hE(t){let e=mn(t);for(;lr(e)&&!Xs(e);){if(bh(e))return e;if(Ml(e))return null;e=mn(e)}return null}function xh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const fE=new Set(["html","body","#document"]);function Xs(t){return fE.has(di(t))}function Zt(t){return vt(t).getComputedStyle(t)}function Ul(t){return Qt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function mn(t){if(di(t)==="html")return t;const e=t.assignedSlot||t.parentNode||wp(t)&&t.host||ur(t);return wp(e)?e.host:e}function zy(t){const e=mn(t);return Xs(e)?t.ownerDocument?t.ownerDocument.body:t.body:lr(e)&&Po(e)?e:zy(e)}function uo(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const s=zy(t),i=s===((n=t.ownerDocument)==null?void 0:n.body),o=vt(s);if(i){const a=qc(o);return e.concat(o,o.visualViewport||[],Po(s)?s:[],a&&r?uo(a):[])}return e.concat(s,uo(s,[],r))}function qc(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Vy(t){const e=Zt(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const s=lr(t),i=s?t.offsetWidth:r,o=s?t.offsetHeight:n,a=el(r)!==i||el(n)!==o;return a&&(r=i,n=o),{width:r,height:n,$:a}}function Sh(t){return Qt(t)?t:t.contextElement}function $s(t){const e=Sh(t);if(!lr(e))return or(1);const r=e.getBoundingClientRect(),{width:n,height:s,$:i}=Vy(e);let o=(i?el(r.width):r.width)/n,a=(i?el(r.height):r.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const pE=or(0);function Wy(t){const e=vt(t);return!xh()||!e.visualViewport?pE:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function mE(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==vt(t)?!1:e}function Zn(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const s=t.getBoundingClientRect(),i=Sh(t);let o=or(1);e&&(n?Qt(n)&&(o=$s(n)):o=$s(t));const a=mE(i,r,n)?Wy(i):or(0);let l=(s.left+a.x)/o.x,u=(s.top+a.y)/o.y,c=s.width/o.x,h=s.height/o.y;if(i){const f=vt(i),d=n&&Qt(n)?vt(n):n;let y=f,g=qc(y);for(;g&&n&&d!==y;){const w=$s(g),m=g.getBoundingClientRect(),p=Zt(g),v=m.left+(g.clientLeft+parseFloat(p.paddingLeft))*w.x,_=m.top+(g.clientTop+parseFloat(p.paddingTop))*w.y;l*=w.x,u*=w.y,c*=w.x,h*=w.y,l+=v,u+=_,y=vt(g),g=qc(y)}}return rl({width:c,height:h,x:l,y:u})}function Eh(t,e){const r=Ul(t).scrollLeft;return e?e.left+r:Zn(ur(t)).left+r}function Hy(t,e,r){r===void 0&&(r=!1);const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-(r?0:Eh(t,n)),i=n.top+e.scrollTop;return{x:s,y:i}}function gE(t){let{elements:e,rect:r,offsetParent:n,strategy:s}=t;const i=s==="fixed",o=ur(n),a=e?Ml(e.floating):!1;if(n===o||a&&i)return r;let l={scrollLeft:0,scrollTop:0},u=or(1);const c=or(0),h=lr(n);if((h||!h&&!i)&&((di(n)!=="body"||Po(o))&&(l=Ul(n)),lr(n))){const d=Zn(n);u=$s(n),c.x=d.x+n.clientLeft,c.y=d.y+n.clientTop}const f=o&&!h&&!i?Hy(o,l,!0):or(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x+f.x,y:r.y*u.y-l.scrollTop*u.y+c.y+f.y}}function vE(t){return Array.from(t.getClientRects())}function yE(t){const e=ur(t),r=Ul(t),n=t.ownerDocument.body,s=ht(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ht(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+Eh(t);const a=-r.scrollTop;return Zt(n).direction==="rtl"&&(o+=ht(e.clientWidth,n.clientWidth)-s),{width:s,height:i,x:o,y:a}}function wE(t,e){const r=vt(t),n=ur(t),s=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,a=0,l=0;if(s){i=s.width,o=s.height;const u=xh();(!u||u&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:i,height:o,x:a,y:l}}const _E=new Set(["absolute","fixed"]);function bE(t,e){const r=Zn(t,!0,e==="fixed"),n=r.top+t.clientTop,s=r.left+t.clientLeft,i=lr(t)?$s(t):or(1),o=t.clientWidth*i.x,a=t.clientHeight*i.y,l=s*i.x,u=n*i.y;return{width:o,height:a,x:l,y:u}}function _p(t,e,r){let n;if(e==="viewport")n=wE(t,r);else if(e==="document")n=yE(ur(t));else if(Qt(e))n=bE(e,r);else{const s=Wy(t);n={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return rl(n)}function qy(t,e){const r=mn(t);return r===e||!Qt(r)||Xs(r)?!1:Zt(r).position==="fixed"||qy(r,e)}function xE(t,e){const r=e.get(t);if(r)return r;let n=uo(t,[],!1).filter(a=>Qt(a)&&di(a)!=="body"),s=null;const i=Zt(t).position==="fixed";let o=i?mn(t):t;for(;Qt(o)&&!Xs(o);){const a=Zt(o),l=bh(o);!l&&a.position==="fixed"&&(s=null),(i?!l&&!s:!l&&a.position==="static"&&!!s&&_E.has(s.position)||Po(o)&&!l&&qy(t,o))?n=n.filter(c=>c!==o):s=a,o=mn(o)}return e.set(t,n),n}function SE(t){let{element:e,boundary:r,rootBoundary:n,strategy:s}=t;const o=[...r==="clippingAncestors"?Ml(e)?[]:xE(e,this._c):[].concat(r),n],a=o[0],l=o.reduce((u,c)=>{const h=_p(e,c,s);return u.top=ht(h.top,u.top),u.right=pn(h.right,u.right),u.bottom=pn(h.bottom,u.bottom),u.left=ht(h.left,u.left),u},_p(e,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function EE(t){const{width:e,height:r}=Vy(t);return{width:e,height:r}}function kE(t,e,r){const n=lr(e),s=ur(e),i=r==="fixed",o=Zn(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=or(0);function u(){l.x=Eh(s)}if(n||!n&&!i)if((di(e)!=="body"||Po(s))&&(a=Ul(e)),n){const d=Zn(e,!0,i,e);l.x=d.x+e.clientLeft,l.y=d.y+e.clientTop}else s&&u();i&&!n&&s&&u();const c=s&&!n&&!i?Hy(s,a):or(0),h=o.left+a.scrollLeft-l.x-c.x,f=o.top+a.scrollTop-l.y-c.y;return{x:h,y:f,width:o.width,height:o.height}}function Au(t){return Zt(t).position==="static"}function bp(t,e){if(!lr(t)||Zt(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return ur(t)===r&&(r=r.ownerDocument.body),r}function Ky(t,e){const r=vt(t);if(Ml(t))return r;if(!lr(t)){let s=mn(t);for(;s&&!Xs(s);){if(Qt(s)&&!Au(s))return s;s=mn(s)}return r}let n=bp(t,e);for(;n&&aE(n)&&Au(n);)n=bp(n,e);return n&&Xs(n)&&Au(n)&&!bh(n)?r:n||hE(t)||r}const TE=async function(t){const e=this.getOffsetParent||Ky,r=this.getDimensions,n=await r(t.floating);return{reference:kE(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function CE(t){return Zt(t).direction==="rtl"}const OE={convertOffsetParentRelativeRectToViewportRelativeRect:gE,getDocumentElement:ur,getClippingRect:SE,getOffsetParent:Ky,getElementRects:TE,getClientRects:vE,getDimensions:EE,getScale:$s,isElement:Qt,isRTL:CE};function Gy(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function PE(t,e){let r=null,n;const s=ur(t);function i(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const u=t.getBoundingClientRect(),{left:c,top:h,width:f,height:d}=u;if(a||e(),!f||!d)return;const y=ta(h),g=ta(s.clientWidth-(c+f)),w=ta(s.clientHeight-(h+d)),m=ta(c),v={rootMargin:-y+"px "+-g+"px "+-w+"px "+-m+"px",threshold:ht(0,pn(1,l))||1};let _=!0;function x(E){const k=E[0].intersectionRatio;if(k!==l){if(!_)return o();k?o(!1,k):n=setTimeout(()=>{o(!1,1e-7)},1e3)}k===1&&!Gy(u,t.getBoundingClientRect())&&o(),_=!1}try{r=new IntersectionObserver(x,{...v,root:s.ownerDocument})}catch{r=new IntersectionObserver(x,v)}r.observe(t)}return o(!0),i}function RE(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,u=Sh(t),c=s||i?[...u?uo(u):[],...uo(e)]:[];c.forEach(m=>{s&&m.addEventListener("scroll",r,{passive:!0}),i&&m.addEventListener("resize",r)});const h=u&&a?PE(u,r):null;let f=-1,d=null;o&&(d=new ResizeObserver(m=>{let[p]=m;p&&p.target===u&&d&&(d.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var v;(v=d)==null||v.observe(e)})),r()}),u&&!l&&d.observe(u),d.observe(e));let y,g=l?Zn(t):null;l&&w();function w(){const m=Zn(t);g&&!Gy(g,m)&&r(),g=m,y=requestAnimationFrame(w)}return r(),()=>{var m;c.forEach(p=>{s&&p.removeEventListener("scroll",r),i&&p.removeEventListener("resize",r)}),h==null||h(),(m=d)==null||m.disconnect(),d=null,l&&cancelAnimationFrame(y)}}const AE=tE,jE=rE,NE=YS,IE=sE,$E=XS,xp=JS,LE=nE,DE=(t,e,r)=>{const n=new Map,s={platform:OE,...r},i={...s.platform,_c:n};return ZS(t,e,{...s,platform:i})};var ME=typeof document<"u",UE=function(){},Ca=ME?b.useLayoutEffect:UE;function nl(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!nl(t[n],e[n]))return!1;return!0}if(s=Object.keys(t),r=s.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,s[n]))return!1;for(n=r;n--!==0;){const i=s[n];if(!(i==="_owner"&&t.$$typeof)&&!nl(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function Qy(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Sp(t,e){const r=Qy(t);return Math.round(e*r)/r}function ju(t){const e=b.useRef(t);return Ca(()=>{e.current=t}),e}function FE(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[c,h]=b.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[f,d]=b.useState(n);nl(f,n)||d(n);const[y,g]=b.useState(null),[w,m]=b.useState(null),p=b.useCallback(C=>{C!==E.current&&(E.current=C,g(C))},[]),v=b.useCallback(C=>{C!==k.current&&(k.current=C,m(C))},[]),_=i||y,x=o||w,E=b.useRef(null),k=b.useRef(null),O=b.useRef(c),j=l!=null,I=ju(l),q=ju(s),F=ju(u),te=b.useCallback(()=>{if(!E.current||!k.current)return;const C={placement:e,strategy:r,middleware:f};q.current&&(C.platform=q.current),DE(E.current,k.current,C).then(P=>{const D={...P,isPositioned:F.current!==!1};$.current&&!nl(O.current,D)&&(O.current=D,Co.flushSync(()=>{h(D)}))})},[f,e,r,q,F]);Ca(()=>{u===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,h(C=>({...C,isPositioned:!1})))},[u]);const $=b.useRef(!1);Ca(()=>($.current=!0,()=>{$.current=!1}),[]),Ca(()=>{if(_&&(E.current=_),x&&(k.current=x),_&&x){if(I.current)return I.current(_,x,te);te()}},[_,x,te,I,j]);const ie=b.useMemo(()=>({reference:E,floating:k,setReference:p,setFloating:v}),[p,v]),K=b.useMemo(()=>({reference:_,floating:x}),[_,x]),Y=b.useMemo(()=>{const C={position:r,left:0,top:0};if(!K.floating)return C;const P=Sp(K.floating,c.x),D=Sp(K.floating,c.y);return a?{...C,transform:"translate("+P+"px, "+D+"px)",...Qy(K.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:P,top:D}},[r,a,K.floating,c.x,c.y]);return b.useMemo(()=>({...c,update:te,refs:ie,elements:K,floatingStyles:Y}),[c,te,ie,K,Y])}const BE=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:s}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?xp({element:n.current,padding:s}).fn(r):{}:n?xp({element:n,padding:s}).fn(r):{}}}},zE=(t,e)=>({...AE(t),options:[t,e]}),VE=(t,e)=>({...jE(t),options:[t,e]}),WE=(t,e)=>({...LE(t),options:[t,e]}),HE=(t,e)=>({...NE(t),options:[t,e]}),qE=(t,e)=>({...IE(t),options:[t,e]}),KE=(t,e)=>({...$E(t),options:[t,e]}),GE=(t,e)=>({...BE(t),options:[t,e]});var QE="Arrow",Zy=b.forwardRef((t,e)=>{const{children:r,width:n=10,height:s=5,...i}=t;return S.jsx(ut.svg,{...i,ref:e,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});Zy.displayName=QE;var ZE=Zy;function JE(t){const[e,r]=b.useState(void 0);return fn(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}var Jy="Popper",[Yy,Xy]=Nl(Jy),[KP,e0]=Yy(Jy),t0="PopperAnchor",r0=b.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...s}=t,i=e0(t0,r),o=b.useRef(null),a=Gt(e,o);return b.useEffect(()=>{i.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:S.jsx(ut.div,{...s,ref:a})});r0.displayName=t0;var kh="PopperContent",[YE,XE]=Yy(kh),n0=b.forwardRef((t,e)=>{var de,es,Or,xn,Pr,ts;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:d="optimized",onPlaced:y,...g}=t,w=e0(kh,r),[m,p]=b.useState(null),v=Gt(e,Rr=>p(Rr)),[_,x]=b.useState(null),E=JE(_),k=(E==null?void 0:E.width)??0,O=(E==null?void 0:E.height)??0,j=n+(i!=="center"?"-"+i:""),I=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},q=Array.isArray(u)?u:[u],F=q.length>0,te={padding:I,boundary:q.filter(tk),altBoundary:F},{refs:$,floatingStyles:ie,placement:K,isPositioned:Y,middlewareData:C}=FE({strategy:"fixed",placement:j,whileElementsMounted:(...Rr)=>RE(...Rr,{animationFrame:d==="always"}),elements:{reference:w.anchor},middleware:[zE({mainAxis:s+O,alignmentAxis:o}),l&&VE({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?WE():void 0,...te}),l&&HE({...te}),qE({...te,apply:({elements:Rr,rects:Ao,availableWidth:Zl,availableHeight:jo})=>{const{width:Jl,height:mi}=Ao.reference,rs=Rr.floating.style;rs.setProperty("--radix-popper-available-width",`${Zl}px`),rs.setProperty("--radix-popper-available-height",`${jo}px`),rs.setProperty("--radix-popper-anchor-width",`${Jl}px`),rs.setProperty("--radix-popper-anchor-height",`${mi}px`)}}),_&&GE({element:_,padding:a}),rk({arrowWidth:k,arrowHeight:O}),f&&KE({strategy:"referenceHidden",...te})]}),[P,D]=o0(K),X=hn(y);fn(()=>{Y&&(X==null||X())},[Y,X]);const W=(de=C.arrow)==null?void 0:de.x,ne=(es=C.arrow)==null?void 0:es.y,oe=((Or=C.arrow)==null?void 0:Or.centerOffset)!==0,[Pe,ze]=b.useState();return fn(()=>{m&&ze(window.getComputedStyle(m).zIndex)},[m]),S.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...ie,transform:Y?ie.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Pe,"--radix-popper-transform-origin":[(xn=C.transformOrigin)==null?void 0:xn.x,(Pr=C.transformOrigin)==null?void 0:Pr.y].join(" "),...((ts=C.hide)==null?void 0:ts.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:S.jsx(YE,{scope:r,placedSide:P,onArrowChange:x,arrowX:W,arrowY:ne,shouldHideArrow:oe,children:S.jsx(ut.div,{"data-side":P,"data-align":D,...g,ref:v,style:{...g.style,animation:Y?void 0:"none"}})})})});n0.displayName=kh;var s0="PopperArrow",ek={top:"bottom",right:"left",bottom:"top",left:"right"},i0=b.forwardRef(function(e,r){const{__scopePopper:n,...s}=e,i=XE(s0,n),o=ek[i.placedSide];return S.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:S.jsx(ZE,{...s,ref:r,style:{...s.style,display:"block"}})})});i0.displayName=s0;function tk(t){return t!==null}var rk=t=>({name:"transformOrigin",options:t,fn(e){var w,m,p;const{placement:r,rects:n,middlewareData:s}=e,o=((w=s.arrow)==null?void 0:w.centerOffset)!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[u,c]=o0(r),h={start:"0%",center:"50%",end:"100%"}[c],f=(((m=s.arrow)==null?void 0:m.x)??0)+a/2,d=(((p=s.arrow)==null?void 0:p.y)??0)+l/2;let y="",g="";return u==="bottom"?(y=o?h:`${f}px`,g=`${-l}px`):u==="top"?(y=o?h:`${f}px`,g=`${n.floating.height+l}px`):u==="right"?(y=`${-l}px`,g=o?h:`${d}px`):u==="left"&&(y=`${n.floating.width+l}px`,g=o?h:`${d}px`),{data:{x:y,y:g}}}});function o0(t){const[e,r="center"]=t.split("-");return[e,r]}var nk=r0,sk=n0,ik=i0,[Fl,GP]=Nl("Tooltip",[Xy]),Th=Xy(),a0="TooltipProvider",ok=700,Ep="tooltip.open",[ak,l0]=Fl(a0),u0=t=>{const{__scopeTooltip:e,delayDuration:r=ok,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:i}=t,o=b.useRef(!0),a=b.useRef(!1),l=b.useRef(0);return b.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),S.jsx(ak,{scope:e,isOpenDelayedRef:o,delayDuration:r,onOpen:b.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:b.useCallback(u=>{a.current=u},[]),disableHoverableContent:s,children:i})};u0.displayName=a0;var c0="Tooltip",[QP,Bl]=Fl(c0),Kc="TooltipTrigger",lk=b.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,s=Bl(Kc,r),i=l0(Kc,r),o=Th(r),a=b.useRef(null),l=Gt(e,a,s.onTriggerChange),u=b.useRef(!1),c=b.useRef(!1),h=b.useCallback(()=>u.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),S.jsx(nk,{asChild:!0,...o,children:S.jsx(ut.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:l,onPointerMove:Ie(t.onPointerMove,f=>{f.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),c.current=!0)}),onPointerLeave:Ie(t.onPointerLeave,()=>{s.onTriggerLeave(),c.current=!1}),onPointerDown:Ie(t.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Ie(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:Ie(t.onBlur,s.onClose),onClick:Ie(t.onClick,s.onClose)})})});lk.displayName=Kc;var uk="TooltipPortal",[ZP,ck]=Fl(uk,{forceMount:void 0}),ei="TooltipContent",d0=b.forwardRef((t,e)=>{const r=ck(ei,t.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...i}=t,o=Bl(ei,t.__scopeTooltip);return S.jsx(fh,{present:n||o.open,children:o.disableHoverableContent?S.jsx(h0,{side:s,...i,ref:e}):S.jsx(dk,{side:s,...i,ref:e})})}),dk=b.forwardRef((t,e)=>{const r=Bl(ei,t.__scopeTooltip),n=l0(ei,t.__scopeTooltip),s=b.useRef(null),i=Gt(e,s),[o,a]=b.useState(null),{trigger:l,onClose:u}=r,c=s.current,{onPointerInTransitChange:h}=n,f=b.useCallback(()=>{a(null),h(!1)},[h]),d=b.useCallback((y,g)=>{const w=y.currentTarget,m={x:y.clientX,y:y.clientY},p=gk(m,w.getBoundingClientRect()),v=vk(m,p),_=yk(g.getBoundingClientRect()),x=_k([...v,..._]);a(x),h(!0)},[h]);return b.useEffect(()=>()=>f(),[f]),b.useEffect(()=>{if(l&&c){const y=w=>d(w,c),g=w=>d(w,l);return l.addEventListener("pointerleave",y),c.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",y),c.removeEventListener("pointerleave",g)}}},[l,c,d,f]),b.useEffect(()=>{if(o){const y=g=>{const w=g.target,m={x:g.clientX,y:g.clientY},p=(l==null?void 0:l.contains(w))||(c==null?void 0:c.contains(w)),v=!wk(m,o);p?f():v&&(f(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,c,o,u,f]),S.jsx(h0,{...t,ref:i})}),[hk,fk]=Fl(c0,{isInside:!1}),pk=Ox("TooltipContent"),h0=b.forwardRef((t,e)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,l=Bl(ei,r),u=Th(r),{onClose:c}=l;return b.useEffect(()=>(document.addEventListener(Ep,c),()=>document.removeEventListener(Ep,c)),[c]),b.useEffect(()=>{if(l.trigger){const h=f=>{const d=f.target;d!=null&&d.contains(l.trigger)&&c()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,c]),S.jsx(hh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:c,children:S.jsxs(sk,{"data-state":l.stateAttribute,...u,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[S.jsx(pk,{children:n}),S.jsx(hk,{scope:r,isInside:!0,children:S.jsx(Xx,{id:l.contentId,role:"tooltip",children:s||n})})]})})});d0.displayName=ei;var f0="TooltipArrow",mk=b.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,s=Th(r);return fk(f0,r).isInside?null:S.jsx(ik,{...s,...n,ref:e})});mk.displayName=f0;function gk(t,e){const r=Math.abs(e.top-t.y),n=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(r,n,s,i)){case i:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function vk(t,e,r=5){const n=[];switch(e){case"top":n.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":n.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":n.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":n.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return n}function yk(t){const{top:e,right:r,bottom:n,left:s}=t;return[{x:s,y:e},{x:r,y:e},{x:r,y:n},{x:s,y:n}]}function wk(t,e){const{x:r,y:n}=t;let s=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const a=e[i],l=e[o],u=a.x,c=a.y,h=l.x,f=l.y;c>n!=f>n&&r<(h-u)*(n-c)/(f-c)+u&&(s=!s)}return s}function _k(t){const e=t.slice();return e.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),bk(e)}function bk(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n<t.length;n++){const s=t[n];for(;e.length>=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const r=[];for(let n=t.length-1;n>=0;n--){const s=t[n];for(;r.length>=2;){const i=r[r.length-1],o=r[r.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))r.pop();else break}r.push(s)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}var xk=u0,p0=d0;const Sk=xk,Ek=b.forwardRef(({className:t,sideOffset:e=4,...r},n)=>S.jsx(p0,{ref:n,sideOffset:e,className:Cr("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r}));Ek.displayName=p0.displayName;var zl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Vl=typeof window>"u"||"Deno"in globalThis;function Mt(){}function kk(t,e){return typeof t=="function"?t(e):t}function Tk(t){return typeof t=="number"&&t>=0&&t!==1/0}function Ck(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Gc(t,e){return typeof t=="function"?t(e):t}function Ok(t,e){return typeof t=="function"?t(e):t}function kp(t,e){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:o,stale:a}=t;if(o){if(n){if(e.queryHash!==Ch(o,e.options))return!1}else if(!ho(e.queryKey,o))return!1}if(r!=="all"){const l=e.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||s&&s!==e.state.fetchStatus||i&&!i(e))}function Tp(t,e){const{exact:r,status:n,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(r){if(co(e.options.mutationKey)!==co(i))return!1}else if(!ho(e.options.mutationKey,i))return!1}return!(n&&e.state.status!==n||s&&!s(e))}function Ch(t,e){return((e==null?void 0:e.queryKeyHashFn)||co)(t)}function co(t){return JSON.stringify(t,(e,r)=>Qc(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function ho(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(r=>ho(t[r],e[r])):!1}function m0(t,e){if(t===e)return t;const r=Cp(t)&&Cp(e);if(r||Qc(t)&&Qc(e)){const n=r?t:Object.keys(t),s=n.length,i=r?e:Object.keys(e),o=i.length,a=r?[]:{},l=new Set(n);let u=0;for(let c=0;c<o;c++){const h=r?c:i[c];(!r&&l.has(h)||r)&&t[h]===void 0&&e[h]===void 0?(a[h]=void 0,u++):(a[h]=m0(t[h],e[h]),a[h]===t[h]&&t[h]!==void 0&&u++)}return s===o&&u===s?t:a}return e}function Cp(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Qc(t){if(!Op(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!Op(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Op(t){return Object.prototype.toString.call(t)==="[object Object]"}function Pk(t){return new Promise(e=>{setTimeout(e,t)})}function Rk(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?m0(t,e):e}function Ak(t,e,r=0){const n=[...t,e];return r&&n.length>r?n.slice(1):n}function jk(t,e,r=0){const n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var Oh=Symbol();function g0(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Oh?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Dn,Hr,Ms,Om,Nk=(Om=class extends zl{constructor(){super();ue(this,Dn);ue(this,Hr);ue(this,Ms);J(this,Ms,e=>{if(!Vl&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){T(this,Hr)||this.setEventListener(T(this,Ms))}onUnsubscribe(){var e;this.hasListeners()||((e=T(this,Hr))==null||e.call(this),J(this,Hr,void 0))}setEventListener(e){var r;J(this,Ms,e),(r=T(this,Hr))==null||r.call(this),J(this,Hr,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){T(this,Dn)!==e&&(J(this,Dn,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof T(this,Dn)=="boolean"?T(this,Dn):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Dn=new WeakMap,Hr=new WeakMap,Ms=new WeakMap,Om),v0=new Nk,Us,qr,Fs,Pm,Ik=(Pm=class extends zl{constructor(){super();ue(this,Us,!0);ue(this,qr);ue(this,Fs);J(this,Fs,e=>{if(!Vl&&window.addEventListener){const r=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){T(this,qr)||this.setEventListener(T(this,Fs))}onUnsubscribe(){var e;this.hasListeners()||((e=T(this,qr))==null||e.call(this),J(this,qr,void 0))}setEventListener(e){var r;J(this,Fs,e),(r=T(this,qr))==null||r.call(this),J(this,qr,e(this.setOnline.bind(this)))}setOnline(e){T(this,Us)!==e&&(J(this,Us,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return T(this,Us)}},Us=new WeakMap,qr=new WeakMap,Fs=new WeakMap,Pm),sl=new Ik;function $k(){let t,e;const r=new Promise((s,i)=>{t=s,e=i});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),t(s)},r.reject=s=>{n({status:"rejected",reason:s}),e(s)},r}function Lk(t){return Math.min(1e3*2**t,3e4)}function y0(t){return(t??"online")==="online"?sl.isOnline():!0}var w0=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Nu(t){return t instanceof w0}function _0(t){let e=!1,r=0,n=!1,s;const i=$k(),o=g=>{var w;n||(f(new w0(g)),(w=t.abort)==null||w.call(t))},a=()=>{e=!0},l=()=>{e=!1},u=()=>v0.isFocused()&&(t.networkMode==="always"||sl.isOnline())&&t.canRun(),c=()=>y0(t.networkMode)&&t.canRun(),h=g=>{var w;n||(n=!0,(w=t.onSuccess)==null||w.call(t,g),s==null||s(),i.resolve(g))},f=g=>{var w;n||(n=!0,(w=t.onError)==null||w.call(t,g),s==null||s(),i.reject(g))},d=()=>new Promise(g=>{var w;s=m=>{(n||u())&&g(m)},(w=t.onPause)==null||w.call(t)}).then(()=>{var g;s=void 0,n||(g=t.onContinue)==null||g.call(t)}),y=()=>{if(n)return;let g;const w=r===0?t.initialPromise:void 0;try{g=w??t.fn()}catch(m){g=Promise.reject(m)}Promise.resolve(g).then(h).catch(m=>{var E;if(n)return;const p=t.retry??(Vl?0:3),v=t.retryDelay??Lk,_=typeof v=="function"?v(r,m):v,x=p===!0||typeof p=="number"&&r<p||typeof p=="function"&&p(r,m);if(e||!x){f(m);return}r++,(E=t.onFail)==null||E.call(t,r,m),Pk(_).then(()=>u()?void 0:d()).then(()=>{e?f(m):y()})})};return{promise:i,cancel:o,continue:()=>(s==null||s(),i),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?y():d().then(y),i)}}var Dk=t=>setTimeout(t,0);function Mk(){let t=[],e=0,r=a=>{a()},n=a=>{a()},s=Dk;const i=a=>{e?t.push(a):s(()=>{r(a)})},o=()=>{const a=t;t=[],a.length&&s(()=>{n(()=>{a.forEach(l=>{r(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||o()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var Je=Mk(),Mn,Rm,b0=(Rm=class{constructor(){ue(this,Mn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Tk(this.gcTime)&&J(this,Mn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Vl?1/0:5*60*1e3))}clearGcTimeout(){T(this,Mn)&&(clearTimeout(T(this,Mn)),J(this,Mn,void 0))}},Mn=new WeakMap,Rm),Bs,Un,St,Fn,qe,_o,Bn,Ft,dr,Am,Uk=(Am=class extends b0{constructor(e){super();ue(this,Ft);ue(this,Bs);ue(this,Un);ue(this,St);ue(this,Fn);ue(this,qe);ue(this,_o);ue(this,Bn);J(this,Bn,!1),J(this,_o,e.defaultOptions),this.setOptions(e.options),this.observers=[],J(this,Fn,e.client),J(this,St,T(this,Fn).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,J(this,Bs,Bk(this.options)),this.state=e.state??T(this,Bs),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=T(this,qe))==null?void 0:e.promise}setOptions(e){this.options={...T(this,_o),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,St).remove(this)}setData(e,r){const n=Rk(this.state.data,e,this.options);return Ve(this,Ft,dr).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){Ve(this,Ft,dr).call(this,{type:"setState",state:e,setStateOptions:r})}cancel(e){var n,s;const r=(n=T(this,qe))==null?void 0:n.promise;return(s=T(this,qe))==null||s.cancel(e),r?r.then(Mt).catch(Mt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(T(this,Bs))}isActive(){return this.observers.some(e=>Ok(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Oh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Gc(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Ck(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=T(this,qe))==null||r.continue()}onOnline(){var r;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=T(this,qe))==null||r.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),T(this,St).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(T(this,qe)&&(T(this,Bn)?T(this,qe).cancel({revert:!0}):T(this,qe).cancelRetry()),this.scheduleGc()),T(this,St).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ve(this,Ft,dr).call(this,{type:"invalidate"})}fetch(e,r){var u,c,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(T(this,qe))return T(this,qe).continueRetry(),T(this,qe).promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(d=>d.options.queryFn);f&&this.setOptions(f.options)}const n=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(J(this,Bn,!0),n.signal)})},i=()=>{const f=g0(this.options,r),y=(()=>{const g={client:T(this,Fn),queryKey:this.queryKey,meta:this.meta};return s(g),g})();return J(this,Bn,!1),this.options.persister?this.options.persister(f,y,this):f(y)},a=(()=>{const f={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:T(this,Fn),state:this.state,fetchFn:i};return s(f),f})();(u=this.options.behavior)==null||u.onFetch(a,this),J(this,Un,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&Ve(this,Ft,dr).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const l=f=>{var d,y,g,w;Nu(f)&&f.silent||Ve(this,Ft,dr).call(this,{type:"error",error:f}),Nu(f)||((y=(d=T(this,St).config).onError)==null||y.call(d,f,this),(w=(g=T(this,St).config).onSettled)==null||w.call(g,this.state.data,f,this)),this.scheduleGc()};return J(this,qe,_0({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{var d,y,g,w;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(m){l(m);return}(y=(d=T(this,St).config).onSuccess)==null||y.call(d,f,this),(w=(g=T(this,St).config).onSettled)==null||w.call(g,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,d)=>{Ve(this,Ft,dr).call(this,{type:"failed",failureCount:f,error:d})},onPause:()=>{Ve(this,Ft,dr).call(this,{type:"pause"})},onContinue:()=>{Ve(this,Ft,dr).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),T(this,qe).start()}},Bs=new WeakMap,Un=new WeakMap,St=new WeakMap,Fn=new WeakMap,qe=new WeakMap,_o=new WeakMap,Bn=new WeakMap,Ft=new WeakSet,dr=function(e){const r=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Fk(n.data,this.options),fetchMeta:e.meta??null};case"success":return J(this,Un,void 0),{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=e.error;return Nu(s)&&s.revert&&T(this,Un)?{...T(this,Un),fetchStatus:"idle"}:{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),Je.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),T(this,St).notify({query:this,type:"updated",action:e})})},Am);function Fk(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:y0(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Bk(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Xt,jm,zk=(jm=class extends zl{constructor(e={}){super();ue(this,Xt);this.config=e,J(this,Xt,new Map)}build(e,r,n){const s=r.queryKey,i=r.queryHash??Ch(s,r);let o=this.get(i);return o||(o=new Uk({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){T(this,Xt).has(e.queryHash)||(T(this,Xt).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=T(this,Xt).get(e.queryHash);r&&(e.destroy(),r===e&&T(this,Xt).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Je.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return T(this,Xt).get(e)}getAll(){return[...T(this,Xt).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(n=>kp(r,n))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(n=>kp(e,n)):r}notify(e){Je.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){Je.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Je.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Xt=new WeakMap,jm),er,Qe,zn,tr,Mr,Nm,Vk=(Nm=class extends b0{constructor(e){super();ue(this,tr);ue(this,er);ue(this,Qe);ue(this,zn);this.mutationId=e.mutationId,J(this,Qe,e.mutationCache),J(this,er,[]),this.state=e.state||Wk(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){T(this,er).includes(e)||(T(this,er).push(e),this.clearGcTimeout(),T(this,Qe).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){J(this,er,T(this,er).filter(r=>r!==e)),this.scheduleGc(),T(this,Qe).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){T(this,er).length||(this.state.status==="pending"?this.scheduleGc():T(this,Qe).remove(this))}continue(){var e;return((e=T(this,zn))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,o,a,l,u,c,h,f,d,y,g,w,m,p,v,_,x,E,k,O;const r=()=>{Ve(this,tr,Mr).call(this,{type:"continue"})};J(this,zn,_0({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(j,I)=>{Ve(this,tr,Mr).call(this,{type:"failed",failureCount:j,error:I})},onPause:()=>{Ve(this,tr,Mr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,Qe).canRun(this)}));const n=this.state.status==="pending",s=!T(this,zn).canStart();try{if(n)r();else{Ve(this,tr,Mr).call(this,{type:"pending",variables:e,isPaused:s}),await((o=(i=T(this,Qe).config).onMutate)==null?void 0:o.call(i,e,this));const I=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,e));I!==this.state.context&&Ve(this,tr,Mr).call(this,{type:"pending",context:I,variables:e,isPaused:s})}const j=await T(this,zn).start();return await((c=(u=T(this,Qe).config).onSuccess)==null?void 0:c.call(u,j,e,this.state.context,this)),await((f=(h=this.options).onSuccess)==null?void 0:f.call(h,j,e,this.state.context)),await((y=(d=T(this,Qe).config).onSettled)==null?void 0:y.call(d,j,null,this.state.variables,this.state.context,this)),await((w=(g=this.options).onSettled)==null?void 0:w.call(g,j,null,e,this.state.context)),Ve(this,tr,Mr).call(this,{type:"success",data:j}),j}catch(j){try{throw await((p=(m=T(this,Qe).config).onError)==null?void 0:p.call(m,j,e,this.state.context,this)),await((_=(v=this.options).onError)==null?void 0:_.call(v,j,e,this.state.context)),await((E=(x=T(this,Qe).config).onSettled)==null?void 0:E.call(x,void 0,j,this.state.variables,this.state.context,this)),await((O=(k=this.options).onSettled)==null?void 0:O.call(k,void 0,j,e,this.state.context)),j}finally{Ve(this,tr,Mr).call(this,{type:"error",error:j})}}finally{T(this,Qe).runNext(this)}}},er=new WeakMap,Qe=new WeakMap,zn=new WeakMap,tr=new WeakSet,Mr=function(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Je.batch(()=>{T(this,er).forEach(n=>{n.onMutationUpdate(e)}),T(this,Qe).notify({mutation:this,type:"updated",action:e})})},Nm);function Wk(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var mr,Bt,bo,Im,Hk=(Im=class extends zl{constructor(e={}){super();ue(this,mr);ue(this,Bt);ue(this,bo);this.config=e,J(this,mr,new Set),J(this,Bt,new Map),J(this,bo,0)}build(e,r,n){const s=new Vk({mutationCache:this,mutationId:++Io(this,bo)._,options:e.defaultMutationOptions(r),state:n});return this.add(s),s}add(e){T(this,mr).add(e);const r=ra(e);if(typeof r=="string"){const n=T(this,Bt).get(r);n?n.push(e):T(this,Bt).set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(T(this,mr).delete(e)){const r=ra(e);if(typeof r=="string"){const n=T(this,Bt).get(r);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&T(this,Bt).delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){const r=ra(e);if(typeof r=="string"){const n=T(this,Bt).get(r),s=n==null?void 0:n.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var n;const r=ra(e);if(typeof r=="string"){const s=(n=T(this,Bt).get(r))==null?void 0:n.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Je.batch(()=>{T(this,mr).forEach(e=>{this.notify({type:"removed",mutation:e})}),T(this,mr).clear(),T(this,Bt).clear()})}getAll(){return Array.from(T(this,mr))}find(e){const r={exact:!0,...e};return this.getAll().find(n=>Tp(r,n))}findAll(e={}){return this.getAll().filter(r=>Tp(e,r))}notify(e){Je.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return Je.batch(()=>Promise.all(e.map(r=>r.continue().catch(Mt))))}},mr=new WeakMap,Bt=new WeakMap,bo=new WeakMap,Im);function ra(t){var e;return(e=t.options.scope)==null?void 0:e.id}function Pp(t){return{onFetch:(e,r)=>{var c,h,f,d,y;const n=e.options,s=(f=(h=(c=e.fetchOptions)==null?void 0:c.meta)==null?void 0:h.fetchMore)==null?void 0:f.direction,i=((d=e.state.data)==null?void 0:d.pages)||[],o=((y=e.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let g=!1;const w=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(e.signal.aborted?g=!0:e.signal.addEventListener("abort",()=>{g=!0}),e.signal)})},m=g0(e.options,e.fetchOptions),p=async(v,_,x)=>{if(g)return Promise.reject();if(_==null&&v.pages.length)return Promise.resolve(v);const k=(()=>{const q={client:e.client,queryKey:e.queryKey,pageParam:_,direction:x?"backward":"forward",meta:e.options.meta};return w(q),q})(),O=await m(k),{maxPages:j}=e.options,I=x?jk:Ak;return{pages:I(v.pages,O,j),pageParams:I(v.pageParams,_,j)}};if(s&&i.length){const v=s==="backward",_=v?qk:Rp,x={pages:i,pageParams:o},E=_(n,x);a=await p(x,E,v)}else{const v=t??i.length;do{const _=l===0?o[0]??n.initialPageParam:Rp(n,a);if(l>0&&_==null)break;a=await p(a,_),l++}while(l<v)}return a};e.options.persister?e.fetchFn=()=>{var g,w;return(w=(g=e.options).persister)==null?void 0:w.call(g,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=u}}}function Rp(t,{pages:e,pageParams:r}){const n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,r[n],r):void 0}function qk(t,{pages:e,pageParams:r}){var n;return e.length>0?(n=t.getPreviousPageParam)==null?void 0:n.call(t,e[0],e,r[0],r):void 0}var ke,Kr,Gr,zs,Vs,Qr,Ws,Hs,$m,Kk=($m=class{constructor(t={}){ue(this,ke);ue(this,Kr);ue(this,Gr);ue(this,zs);ue(this,Vs);ue(this,Qr);ue(this,Ws);ue(this,Hs);J(this,ke,t.queryCache||new zk),J(this,Kr,t.mutationCache||new Hk),J(this,Gr,t.defaultOptions||{}),J(this,zs,new Map),J(this,Vs,new Map),J(this,Qr,0)}mount(){Io(this,Qr)._++,T(this,Qr)===1&&(J(this,Ws,v0.subscribe(async t=>{t&&(await this.resumePausedMutations(),T(this,ke).onFocus())})),J(this,Hs,sl.subscribe(async t=>{t&&(await this.resumePausedMutations(),T(this,ke).onOnline())})))}unmount(){var t,e;Io(this,Qr)._--,T(this,Qr)===0&&((t=T(this,Ws))==null||t.call(this),J(this,Ws,void 0),(e=T(this,Hs))==null||e.call(this),J(this,Hs,void 0))}isFetching(t){return T(this,ke).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return T(this,Kr).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=T(this,ke).get(e.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),r=T(this,ke).build(this,e),n=r.state.data;return n===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(Gc(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return T(this,ke).findAll(t).map(({queryKey:e,state:r})=>{const n=r.data;return[e,n]})}setQueryData(t,e,r){const n=this.defaultQueryOptions({queryKey:t}),s=T(this,ke).get(n.queryHash),i=s==null?void 0:s.state.data,o=kk(e,i);if(o!==void 0)return T(this,ke).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return Je.batch(()=>T(this,ke).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,r)]))}getQueryState(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=T(this,ke).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=T(this,ke);Je.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=T(this,ke);return Je.batch(()=>(r.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const r={revert:!0,...e},n=Je.batch(()=>T(this,ke).findAll(t).map(s=>s.cancel(r)));return Promise.all(n).then(Mt).catch(Mt)}invalidateQueries(t,e={}){return Je.batch(()=>(T(this,ke).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const r={...e,cancelRefetch:e.cancelRefetch??!0},n=Je.batch(()=>T(this,ke).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(Mt)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(Mt)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=T(this,ke).build(this,e);return r.isStaleByTime(Gc(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Mt).catch(Mt)}fetchInfiniteQuery(t){return t.behavior=Pp(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Mt).catch(Mt)}ensureInfiniteQueryData(t){return t.behavior=Pp(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return sl.isOnline()?T(this,Kr).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,ke)}getMutationCache(){return T(this,Kr)}getDefaultOptions(){return T(this,Gr)}setDefaultOptions(t){J(this,Gr,t)}setQueryDefaults(t,e){T(this,zs).set(co(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...T(this,zs).values()],r={};return e.forEach(n=>{ho(t,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(t,e){T(this,Vs).set(co(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...T(this,Vs).values()],r={};return e.forEach(n=>{ho(t,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...T(this,Gr).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Ch(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Oh&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...T(this,Gr).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){T(this,ke).clear(),T(this,Kr).clear()}},ke=new WeakMap,Kr=new WeakMap,Gr=new WeakMap,zs=new WeakMap,Vs=new WeakMap,Qr=new WeakMap,Ws=new WeakMap,Hs=new WeakMap,$m),Gk=b.createContext(void 0),Qk=({client:t,children:e})=>(b.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),S.jsx(Gk.Provider,{value:t,children:e}));/**
 * @remix-run/router v1.23.0
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function il(){return il=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},il.apply(this,arguments)}var Yr;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(Yr||(Yr={}));const Ap="popstate";function Zk(t){t===void 0&&(t={});function e(n,s){let{pathname:i,search:o,hash:a}=n.location;return Zc("",{pathname:i,search:o,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(n,s){return typeof s=="string"?s:S0(s)}return Yk(e,r,null,t)}function lt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function x0(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Jk(){return Math.random().toString(36).substr(2,8)}function jp(t,e){return{usr:t.state,key:t.key,idx:e}}function Zc(t,e,r,n){return r===void 0&&(r=null),il({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Wl(e):e,{state:r,key:e&&e.key||n||Jk()})}function S0(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Wl(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function Yk(t,e,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:i=!1}=n,o=s.history,a=Yr.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(il({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function h(){a=Yr.Pop;let w=c(),m=w==null?null:w-u;u=w,l&&l({action:a,location:g.location,delta:m})}function f(w,m){a=Yr.Push;let p=Zc(g.location,w,m);u=c()+1;let v=jp(p,u),_=g.createHref(p);try{o.pushState(v,"",_)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;s.location.assign(_)}i&&l&&l({action:a,location:g.location,delta:1})}function d(w,m){a=Yr.Replace;let p=Zc(g.location,w,m);u=c();let v=jp(p,u),_=g.createHref(p);o.replaceState(v,"",_),i&&l&&l({action:a,location:g.location,delta:0})}function y(w){let m=s.location.origin!=="null"?s.location.origin:s.location.href,p=typeof w=="string"?w:S0(w);return p=p.replace(/ $/,"%20"),lt(m,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,m)}let g={get action(){return a},get location(){return t(s,o)},listen(w){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(Ap,h),l=w,()=>{s.removeEventListener(Ap,h),l=null}},createHref(w){return e(s,w)},createURL:y,encodeLocation(w){let m=y(w);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:f,replace:d,go(w){return o.go(w)}};return g}var Np;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(Np||(Np={}));function Xk(t,e,r){return r===void 0&&(r="/"),eT(t,e,r,!1)}function eT(t,e,r,n){let s=typeof e=="string"?Wl(e):e,i=T0(s.pathname||"/",r);if(i==null)return null;let o=E0(t);tT(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let u=hT(i);a=cT(o[l],u,n)}return a}function E0(t,e,r,n){e===void 0&&(e=[]),r===void 0&&(r=[]),n===void 0&&(n="");let s=(i,o,a)=>{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(lt(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Ls([n,l.relativePath]),c=r.concat(l);i.children&&i.children.length>0&&(lt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),E0(i.children,e,c,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:lT(u,i.index),routesMeta:c})};return t.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let l of k0(i.path))s(i,o,l)}),e}function k0(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,s=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return s?[i,""]:[i];let o=k0(n.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),s&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function tT(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:uT(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const rT=/^:[\w-]+$/,nT=3,sT=2,iT=1,oT=10,aT=-2,Ip=t=>t==="*";function lT(t,e){let r=t.split("/"),n=r.length;return r.some(Ip)&&(n+=aT),e&&(n+=sT),r.filter(s=>!Ip(s)).reduce((s,i)=>s+(rT.test(i)?nT:i===""?iT:oT),n)}function uT(t,e){return t.length===e.length&&t.slice(0,-1).every((n,s)=>n===e[s])?t[t.length-1]-e[e.length-1]:0}function cT(t,e,r){let{routesMeta:n}=t,s={},i="/",o=[];for(let a=0;a<n.length;++a){let l=n[a],u=a===n.length-1,c=i==="/"?e:e.slice(i.length)||"/",h=$p({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},c),f=l.route;if(!h&&u&&r&&!n[n.length-1].route.index&&(h=$p({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},c)),!h)return null;Object.assign(s,h.params),o.push({params:s,pathname:Ls([i,h.pathname]),pathnameBase:fT(Ls([i,h.pathnameBase])),route:f}),h.pathnameBase!=="/"&&(i=Ls([i,h.pathnameBase]))}return o}function $p(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=dT(t.path,t.caseSensitive,t.end),s=e.match(r);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:n.reduce((u,c,h)=>{let{paramName:f,isOptional:d}=c;if(f==="*"){let g=a[h]||"";o=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const y=a[h];return d&&!y?u[f]=void 0:u[f]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:t}}function dT(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),x0(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(n.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),n]}function hT(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return x0(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function T0(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}const Ls=t=>t.join("/").replace(/\/\/+/g,"/"),fT=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/");function pT(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const C0=["post","put","patch","delete"];new Set(C0);const mT=["get",...C0];new Set(mT);/**
 * React Router v6.30.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function ol(){return ol=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ol.apply(this,arguments)}const gT=b.createContext(null),vT=b.createContext(null),O0=b.createContext(null),Hl=b.createContext(null),ql=b.createContext({outlet:null,matches:[],isDataRoute:!1}),P0=b.createContext(null);function Ph(){return b.useContext(Hl)!=null}function R0(){return Ph()||lt(!1),b.useContext(Hl).location}function yT(t,e){return wT(t,e)}function wT(t,e,r,n){Ph()||lt(!1);let{navigator:s}=b.useContext(O0),{matches:i}=b.useContext(ql),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=R0(),c;if(e){var h;let w=typeof e=="string"?Wl(e):e;l==="/"||(h=w.pathname)!=null&&h.startsWith(l)||lt(!1),c=w}else c=u;let f=c.pathname||"/",d=f;if(l!=="/"){let w=l.replace(/^\//,"").split("/");d="/"+f.replace(/^\//,"").split("/").slice(w.length).join("/")}let y=Xk(t,{pathname:d}),g=ET(y&&y.map(w=>Object.assign({},w,{params:Object.assign({},a,w.params),pathname:Ls([l,s.encodeLocation?s.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?l:Ls([l,s.encodeLocation?s.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),i,r,n);return e&&g?b.createElement(Hl.Provider,{value:{location:ol({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Yr.Pop}},g):g}function _T(){let t=OT(),e=pT(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},e),r?b.createElement("pre",{style:s},r):null,null)}const bT=b.createElement(_T,null);class xT extends b.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?b.createElement(ql.Provider,{value:this.props.routeContext},b.createElement(P0.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ST(t){let{routeContext:e,match:r,children:n}=t,s=b.useContext(gT);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),b.createElement(ql.Provider,{value:e},n)}function ET(t,e,r,n){var s;if(e===void 0&&(e=[]),r===void 0&&(r=null),n===void 0&&(n=null),t==null){var i;if(!r)return null;if(r.errors)t=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let o=t,a=(s=r)==null?void 0:s.errors;if(a!=null){let c=o.findIndex(h=>h.route.id&&(a==null?void 0:a[h.route.id])!==void 0);c>=0||lt(!1),o=o.slice(0,Math.min(o.length,c+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let c=0;c<o.length;c++){let h=o[c];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=c),h.route.id){let{loaderData:f,errors:d}=r,y=h.route.loader&&f[h.route.id]===void 0&&(!d||d[h.route.id]===void 0);if(h.route.lazy||y){l=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((c,h,f)=>{let d,y=!1,g=null,w=null;r&&(d=a&&h.route.id?a[h.route.id]:void 0,g=h.route.errorElement||bT,l&&(u<0&&f===0?(y=!0,w=null):u===f&&(y=!0,w=h.route.hydrateFallbackElement||null)));let m=e.concat(o.slice(0,f+1)),p=()=>{let v;return d?v=g:y?v=w:h.route.Component?v=b.createElement(h.route.Component,null):h.route.element?v=h.route.element:v=c,b.createElement(ST,{match:h,routeContext:{outlet:c,matches:m,isDataRoute:r!=null},children:v})};return r&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?b.createElement(xT,{location:r.location,revalidation:r.revalidation,component:g,error:d,children:p(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):p()},null)}var Jc=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(Jc||{});function kT(t){let e=b.useContext(vT);return e||lt(!1),e}function TT(t){let e=b.useContext(ql);return e||lt(!1),e}function CT(t){let e=TT(),r=e.matches[e.matches.length-1];return r.route.id||lt(!1),r.route.id}function OT(){var t;let e=b.useContext(P0),r=kT(Jc.UseRouteError),n=CT(Jc.UseRouteError);return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function PT(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function Yc(t){lt(!1)}function RT(t){let{basename:e="/",children:r=null,location:n,navigationType:s=Yr.Pop,navigator:i,static:o=!1,future:a}=t;Ph()&&lt(!1);let l=e.replace(/^\/*/,"/"),u=b.useMemo(()=>({basename:l,navigator:i,static:o,future:ol({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof n=="string"&&(n=Wl(n));let{pathname:c="/",search:h="",hash:f="",state:d=null,key:y="default"}=n,g=b.useMemo(()=>{let w=T0(c,l);return w==null?null:{location:{pathname:w,search:h,hash:f,state:d,key:y},navigationType:s}},[l,c,h,f,d,y,s]);return g==null?null:b.createElement(O0.Provider,{value:u},b.createElement(Hl.Provider,{children:r,value:g}))}function AT(t){let{children:e,location:r}=t;return yT(Xc(e),r)}new Promise(()=>{});function Xc(t,e){e===void 0&&(e=[]);let r=[];return b.Children.forEach(t,(n,s)=>{if(!b.isValidElement(n))return;let i=[...e,s];if(n.type===b.Fragment){r.push.apply(r,Xc(n.props.children,i));return}n.type!==Yc&&lt(!1),!n.props.index||!n.props.children||lt(!1);let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Xc(n.props.children,i)),r.push(o)}),r}/**
 * React Router DOM v6.30.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */const jT="6";try{window.__reactRouterVersion=jT}catch{}const NT="startTransition",Lp=Gm[NT];function IT(t){let{basename:e,children:r,future:n,window:s}=t,i=b.useRef();i.current==null&&(i.current=Zk({window:s,v5Compat:!0}));let o=i.current,[a,l]=b.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},c=b.useCallback(h=>{u&&Lp?Lp(()=>l(h)):l(h)},[l,u]);return b.useLayoutEffect(()=>o.listen(c),[o,c]),b.useEffect(()=>PT(n),[n]),b.createElement(RT,{basename:e,children:r,location:a.location,navigationType:a.action,navigator:o,future:n})}var Dp;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Dp||(Dp={}));var Mp;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Mp||(Mp={}));const $T=Cy("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-medium ring-offset-background transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 font-body",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90 shadow-soft hover:shadow-elevated",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",hero:"bg-primary text-primary-foreground hover:bg-primary/90 shadow-elevated hover:-translate-y-0.5 text-base font-semibold tracking-wide"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-12 rounded-lg px-8",xl:"h-14 rounded-xl px-10 text-base",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),A0=b.forwardRef(({className:t,variant:e,size:r,asChild:n=!1,...s},i)=>{const o=n?Tx:"button";return S.jsx(o,{className:Cr($T({variant:e,size:r,className:t})),ref:i,...s})});A0.displayName="Button";const Oa=b.forwardRef(({className:t,type:e,...r},n)=>S.jsx("input",{type:e,className:Cr("flex h-12 w-full rounded-lg border border-input bg-background px-4 py-3 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition-all duration-200 font-body",t),ref:n,...r}));Oa.displayName="Input";var ed=function(t,e){return ed=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])},ed(t,e)};function j0(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");ed(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var al=function(){return al=Object.assign||function(e){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},al.apply(this,arguments)};function hi(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function N0(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(i=(s<3?o(i):s>3?o(e,r,i):o(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i}function I0(t,e){return function(r,n){e(r,n,t)}}function $0(t,e,r,n,s,i){function o(m){if(m!==void 0&&typeof m!="function")throw new TypeError("Function expected");return m}for(var a=n.kind,l=a==="getter"?"get":a==="setter"?"set":"value",u=!e&&t?n.static?t:t.prototype:null,c=e||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),h,f=!1,d=r.length-1;d>=0;d--){var y={};for(var g in n)y[g]=g==="access"?{}:n[g];for(var g in n.access)y.access[g]=n.access[g];y.addInitializer=function(m){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(o(m||null))};var w=(0,r[d])(a==="accessor"?{get:c.get,set:c.set}:c[l],y);if(a==="accessor"){if(w===void 0)continue;if(w===null||typeof w!="object")throw new TypeError("Object expected");(h=o(w.get))&&(c.get=h),(h=o(w.set))&&(c.set=h),(h=o(w.init))&&s.unshift(h)}else(h=o(w))&&(a==="field"?s.unshift(h):c[l]=h)}u&&Object.defineProperty(u,n.name,c),f=!0}function L0(t,e,r){for(var n=arguments.length>2,s=0;s<e.length;s++)r=n?e[s].call(t,r):e[s].call(t);return n?r:void 0}function D0(t){return typeof t=="symbol"?t:"".concat(t)}function M0(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function U0(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function U(t,e,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function a(c){try{u(n.next(c))}catch(h){o(h)}}function l(c){try{u(n.throw(c))}catch(h){o(h)}}function u(c){c.done?i(c.value):s(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})}function F0(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(c){return l([u,c])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,s&&(i=u[0]&2?s.return:u[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,u[1])).done)return i;switch(s=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,s=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(c){u=[6,c],s=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Kl=Object.create?function(t,e,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,s)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};function B0(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Kl(e,t,r)}function ll(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Rh(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),s,i=[],o;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return i}function z0(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Rh(arguments[e]));return t}function V0(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),s=0,e=0;e<r;e++)for(var i=arguments[e],o=0,a=i.length;o<a;o++,s++)n[s]=i[o];return n}function W0(t,e,r){if(r||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}function ti(t){return this instanceof ti?(this.v=t,this):new ti(t)}function H0(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(d){return function(y){return Promise.resolve(y).then(d,h)}}function a(d,y){n[d]&&(s[d]=function(g){return new Promise(function(w,m){i.push([d,g,w,m])>1||l(d,g)})},y&&(s[d]=y(s[d])))}function l(d,y){try{u(n[d](y))}catch(g){f(i[0][3],g)}}function u(d){d.value instanceof ti?Promise.resolve(d.value.v).then(c,h):f(i[0][2],d)}function c(d){l("next",d)}function h(d){l("throw",d)}function f(d,y){d(y),i.shift(),i.length&&l(i[0][0],i[0][1])}}function q0(t){var e,r;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,i){e[s]=t[s]?function(o){return(r=!r)?{value:ti(t[s](o)),done:!1}:i?i(o):o}:i}}function K0(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof ll=="function"?ll(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=t[i]&&function(o){return new Promise(function(a,l){o=t[i](o),s(a,l,o.done,o.value)})}}function s(i,o,a,l){Promise.resolve(l).then(function(u){i({value:u,done:a})},o)}}function G0(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var LT=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},td=function(t){return td=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},td(t)};function Q0(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=td(t),n=0;n<r.length;n++)r[n]!=="default"&&Kl(e,t,r[n]);return LT(e,t),e}function Z0(t){return t&&t.__esModule?t:{default:t}}function J0(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function Y0(t,e,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,r):s?s.value=r:e.set(t,r),r}function X0(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function ew(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,s;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(s=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");s&&(n=function(){try{s.call(this)}catch(i){return Promise.reject(i)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var DT=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function tw(t){function e(i){t.error=t.hasError?new DT(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var r,n=0;function s(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(s);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(s,function(o){return e(o),s()})}else n|=1}catch(o){e(o)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return s()}function rw(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,s,i,o){return n?e?".jsx":".js":s&&(!i||!o)?r:s+i+"."+o.toLowerCase()+"js"}):t}const MT={__extends:j0,__assign:al,__rest:hi,__decorate:N0,__param:I0,__esDecorate:$0,__runInitializers:L0,__propKey:D0,__setFunctionName:M0,__metadata:U0,__awaiter:U,__generator:F0,__createBinding:Kl,__exportStar:B0,__values:ll,__read:Rh,__spread:z0,__spreadArrays:V0,__spreadArray:W0,__await:ti,__asyncGenerator:H0,__asyncDelegator:q0,__asyncValues:K0,__makeTemplateObject:G0,__importStar:Q0,__importDefault:Z0,__classPrivateFieldGet:J0,__classPrivateFieldSet:Y0,__classPrivateFieldIn:X0,__addDisposableResource:ew,__disposeResources:tw,__rewriteRelativeImportExtension:rw},UT=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:ew,get __assign(){return al},__asyncDelegator:q0,__asyncGenerator:H0,__asyncValues:K0,__await:ti,__awaiter:U,__classPrivateFieldGet:J0,__classPrivateFieldIn:X0,__classPrivateFieldSet:Y0,__createBinding:Kl,__decorate:N0,__disposeResources:tw,__esDecorate:$0,__exportStar:B0,__extends:j0,__generator:F0,__importDefault:Z0,__importStar:Q0,__makeTemplateObject:G0,__metadata:U0,__param:I0,__propKey:D0,__read:Rh,__rest:hi,__rewriteRelativeImportExtension:rw,__runInitializers:L0,__setFunctionName:M0,__spread:z0,__spreadArray:W0,__spreadArrays:V0,__values:ll,default:MT},Symbol.toStringTag,{value:"Module"})),FT=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class Ah extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}}class BT extends Ah{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class Up extends Ah{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Fp extends Ah{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var rd;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(rd||(rd={}));class zT{constructor(e,{headers:r={},customFetch:n,region:s=rd.Any}={}){this.url=e,this.headers=r,this.region=s,this.fetch=FT(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return U(this,arguments,void 0,function*(r,n={}){var s;let i,o;try{const{headers:a,method:l,body:u,signal:c,timeout:h}=n;let f={},{region:d}=n;d||(d=this.region);const y=new URL(`${this.url}/${r}`);d&&d!=="any"&&(f["x-region"]=d,y.searchParams.set("forceFunctionRegion",d));let g;u&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(f["Content-Type"]="application/octet-stream",g=u):typeof u=="string"?(f["Content-Type"]="text/plain",g=u):typeof FormData<"u"&&u instanceof FormData?g=u:(f["Content-Type"]="application/json",g=JSON.stringify(u)):g=u;let w=c;h&&(o=new AbortController,i=setTimeout(()=>o.abort(),h),c?(w=o.signal,c.addEventListener("abort",()=>o.abort())):w=o.signal);const m=yield this.fetch(y.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),a),body:g,signal:w}).catch(x=>{throw new BT(x)}),p=m.headers.get("x-relay-error");if(p&&p==="true")throw new Up(m);if(!m.ok)throw new Fp(m);let v=((s=m.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),_;return v==="application/json"?_=yield m.json():v==="application/octet-stream"||v==="application/pdf"?_=yield m.blob():v==="text/event-stream"?_=m:v==="multipart/form-data"?_=yield m.formData():_=yield m.text(),{data:_,error:null,response:m}}catch(a){return{data:null,error:a,response:a instanceof Fp||a instanceof Up?a.context:void 0}}finally{i&&clearTimeout(i)}})}}var Ye={};const fi=Gw(UT);var na={},sa={},ia={},oa={},aa={},la={},Bp;function nw(){if(Bp)return la;Bp=1,Object.defineProperty(la,"__esModule",{value:!0});class t extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.code=r.code}}return la.default=t,la}var zp;function sw(){if(zp)return aa;zp=1,Object.defineProperty(aa,"__esModule",{value:!0});const e=fi.__importDefault(nw());class r{constructor(s){var i,o;this.shouldThrowOnError=!1,this.method=s.method,this.url=s.url,this.headers=new Headers(s.headers),this.schema=s.schema,this.body=s.body,this.shouldThrowOnError=(i=s.shouldThrowOnError)!==null&&i!==void 0?i:!1,this.signal=s.signal,this.isMaybeSingle=(o=s.isMaybeSingle)!==null&&o!==void 0?o:!1,s.fetch?this.fetch=s.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(s,i){return this.headers=new Headers(this.headers),this.headers.set(s,i),this}then(s,i){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const o=this.fetch;let a=o(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async l=>{var u,c,h,f;let d=null,y=null,g=null,w=l.status,m=l.statusText;if(l.ok){if(this.method!=="HEAD"){const x=await l.text();x===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((u=this.headers.get("Accept"))===null||u===void 0)&&u.includes("application/vnd.pgrst.plan+text"))?y=x:y=JSON.parse(x))}const v=(c=this.headers.get("Prefer"))===null||c===void 0?void 0:c.match(/count=(exact|planned|estimated)/),_=(h=l.headers.get("content-range"))===null||h===void 0?void 0:h.split("/");v&&_&&_.length>1&&(g=parseInt(_[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(y)&&(y.length>1?(d={code:"PGRST116",details:`Results contain ${y.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},y=null,g=null,w=406,m="Not Acceptable"):y.length===1?y=y[0]:y=null)}else{const v=await l.text();try{d=JSON.parse(v),Array.isArray(d)&&l.status===404&&(y=[],d=null,w=200,m="OK")}catch{l.status===404&&v===""?(w=204,m="No Content"):d={message:v}}if(d&&this.isMaybeSingle&&(!((f=d==null?void 0:d.details)===null||f===void 0)&&f.includes("0 rows"))&&(d=null,w=200,m="OK"),d&&this.shouldThrowOnError)throw new e.default(d)}return{error:d,data:y,count:g,status:w,statusText:m}});return this.shouldThrowOnError||(a=a.catch(l=>{var u,c,h,f,d,y;let g="";const w=l==null?void 0:l.cause;if(w){const m=(u=w==null?void 0:w.message)!==null&&u!==void 0?u:"",p=(c=w==null?void 0:w.code)!==null&&c!==void 0?c:"";g=`${(h=l==null?void 0:l.name)!==null&&h!==void 0?h:"FetchError"}: ${l==null?void 0:l.message}`,g+=`

Caused by: ${(f=w==null?void 0:w.name)!==null&&f!==void 0?f:"Error"}: ${m}`,p&&(g+=` (${p})`),w!=null&&w.stack&&(g+=`
${w.stack}`)}else g=(d=l==null?void 0:l.stack)!==null&&d!==void 0?d:"";return{error:{message:`${(y=l==null?void 0:l.name)!==null&&y!==void 0?y:"FetchError"}: ${l==null?void 0:l.message}`,details:g,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),a.then(s,i)}returns(){return this}overrideTypes(){return this}}return aa.default=r,aa}var Vp;function iw(){if(Vp)return oa;Vp=1,Object.defineProperty(oa,"__esModule",{value:!0});const e=fi.__importDefault(sw());class r extends e.default{select(s){let i=!1;const o=(s??"*").split("").map(a=>/\s/.test(a)&&!i?"":(a==='"'&&(i=!i),a)).join("");return this.url.searchParams.set("select",o),this.headers.append("Prefer","return=representation"),this}order(s,{ascending:i=!0,nullsFirst:o,foreignTable:a,referencedTable:l=a}={}){const u=l?`${l}.order`:"order",c=this.url.searchParams.get(u);return this.url.searchParams.set(u,`${c?`${c},`:""}${s}.${i?"asc":"desc"}${o===void 0?"":o?".nullsfirst":".nullslast"}`),this}limit(s,{foreignTable:i,referencedTable:o=i}={}){const a=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(a,`${s}`),this}range(s,i,{foreignTable:o,referencedTable:a=o}={}){const l=typeof a>"u"?"offset":`${a}.offset`,u=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(l,`${s}`),this.url.searchParams.set(u,`${i-s+1}`),this}abortSignal(s){return this.signal=s,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:s=!1,verbose:i=!1,settings:o=!1,buffers:a=!1,wal:l=!1,format:u="text"}={}){var c;const h=[s?"analyze":null,i?"verbose":null,o?"settings":null,a?"buffers":null,l?"wal":null].filter(Boolean).join("|"),f=(c=this.headers.get("Accept"))!==null&&c!==void 0?c:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${u}; for="${f}"; options=${h};`),u==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(s){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${s}`),this}}return oa.default=r,oa}var Wp;function jh(){if(Wp)return ia;Wp=1,Object.defineProperty(ia,"__esModule",{value:!0});const e=fi.__importDefault(iw()),r=new RegExp("[,()]");class n extends e.default{eq(i,o){return this.url.searchParams.append(i,`eq.${o}`),this}neq(i,o){return this.url.searchParams.append(i,`neq.${o}`),this}gt(i,o){return this.url.searchParams.append(i,`gt.${o}`),this}gte(i,o){return this.url.searchParams.append(i,`gte.${o}`),this}lt(i,o){return this.url.searchParams.append(i,`lt.${o}`),this}lte(i,o){return this.url.searchParams.append(i,`lte.${o}`),this}like(i,o){return this.url.searchParams.append(i,`like.${o}`),this}likeAllOf(i,o){return this.url.searchParams.append(i,`like(all).{${o.join(",")}}`),this}likeAnyOf(i,o){return this.url.searchParams.append(i,`like(any).{${o.join(",")}}`),this}ilike(i,o){return this.url.searchParams.append(i,`ilike.${o}`),this}ilikeAllOf(i,o){return this.url.searchParams.append(i,`ilike(all).{${o.join(",")}}`),this}ilikeAnyOf(i,o){return this.url.searchParams.append(i,`ilike(any).{${o.join(",")}}`),this}regexMatch(i,o){return this.url.searchParams.append(i,`match.${o}`),this}regexIMatch(i,o){return this.url.searchParams.append(i,`imatch.${o}`),this}is(i,o){return this.url.searchParams.append(i,`is.${o}`),this}isDistinct(i,o){return this.url.searchParams.append(i,`isdistinct.${o}`),this}in(i,o){const a=Array.from(new Set(o)).map(l=>typeof l=="string"&&r.test(l)?`"${l}"`:`${l}`).join(",");return this.url.searchParams.append(i,`in.(${a})`),this}contains(i,o){return typeof o=="string"?this.url.searchParams.append(i,`cs.${o}`):Array.isArray(o)?this.url.searchParams.append(i,`cs.{${o.join(",")}}`):this.url.searchParams.append(i,`cs.${JSON.stringify(o)}`),this}containedBy(i,o){return typeof o=="string"?this.url.searchParams.append(i,`cd.${o}`):Array.isArray(o)?this.url.searchParams.append(i,`cd.{${o.join(",")}}`):this.url.searchParams.append(i,`cd.${JSON.stringify(o)}`),this}rangeGt(i,o){return this.url.searchParams.append(i,`sr.${o}`),this}rangeGte(i,o){return this.url.searchParams.append(i,`nxl.${o}`),this}rangeLt(i,o){return this.url.searchParams.append(i,`sl.${o}`),this}rangeLte(i,o){return this.url.searchParams.append(i,`nxr.${o}`),this}rangeAdjacent(i,o){return this.url.searchParams.append(i,`adj.${o}`),this}overlaps(i,o){return typeof o=="string"?this.url.searchParams.append(i,`ov.${o}`):this.url.searchParams.append(i,`ov.{${o.join(",")}}`),this}textSearch(i,o,{config:a,type:l}={}){let u="";l==="plain"?u="pl":l==="phrase"?u="ph":l==="websearch"&&(u="w");const c=a===void 0?"":`(${a})`;return this.url.searchParams.append(i,`${u}fts${c}.${o}`),this}match(i){return Object.entries(i).forEach(([o,a])=>{this.url.searchParams.append(o,`eq.${a}`)}),this}not(i,o,a){return this.url.searchParams.append(i,`not.${o}.${a}`),this}or(i,{foreignTable:o,referencedTable:a=o}={}){const l=a?`${a}.or`:"or";return this.url.searchParams.append(l,`(${i})`),this}filter(i,o,a){return this.url.searchParams.append(i,`${o}.${a}`),this}}return ia.default=n,ia}var Hp;function ow(){if(Hp)return sa;Hp=1,Object.defineProperty(sa,"__esModule",{value:!0});const e=fi.__importDefault(jh());class r{constructor(s,{headers:i={},schema:o,fetch:a}){this.url=s,this.headers=new Headers(i),this.schema=o,this.fetch=a}select(s,i){const{head:o=!1,count:a}=i??{},l=o?"HEAD":"GET";let u=!1;const c=(s??"*").split("").map(h=>/\s/.test(h)&&!u?"":(h==='"'&&(u=!u),h)).join("");return this.url.searchParams.set("select",c),a&&this.headers.append("Prefer",`count=${a}`),new e.default({method:l,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(s,{count:i,defaultToNull:o=!0}={}){var a;const l="POST";if(i&&this.headers.append("Prefer",`count=${i}`),o||this.headers.append("Prefer","missing=default"),Array.isArray(s)){const u=s.reduce((c,h)=>c.concat(Object.keys(h)),[]);if(u.length>0){const c=[...new Set(u)].map(h=>`"${h}"`);this.url.searchParams.set("columns",c.join(","))}}return new e.default({method:l,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}upsert(s,{onConflict:i,ignoreDuplicates:o=!1,count:a,defaultToNull:l=!0}={}){var u;const c="POST";if(this.headers.append("Prefer",`resolution=${o?"ignore":"merge"}-duplicates`),i!==void 0&&this.url.searchParams.set("on_conflict",i),a&&this.headers.append("Prefer",`count=${a}`),l||this.headers.append("Prefer","missing=default"),Array.isArray(s)){const h=s.reduce((f,d)=>f.concat(Object.keys(d)),[]);if(h.length>0){const f=[...new Set(h)].map(d=>`"${d}"`);this.url.searchParams.set("columns",f.join(","))}}return new e.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}update(s,{count:i}={}){var o;const a="PATCH";return i&&this.headers.append("Prefer",`count=${i}`),new e.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}delete({count:s}={}){var i;const o="DELETE";return s&&this.headers.append("Prefer",`count=${s}`),new e.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}}return sa.default=r,sa}var qp;function VT(){if(qp)return na;qp=1,Object.defineProperty(na,"__esModule",{value:!0});const t=fi,e=t.__importDefault(ow()),r=t.__importDefault(jh());class n{constructor(i,{headers:o={},schema:a,fetch:l}={}){this.url=i,this.headers=new Headers(o),this.schemaName=a,this.fetch=l}from(i){if(!i||typeof i!="string"||i.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");const o=new URL(`${this.url}/${i}`);return new e.default(o,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(i){return new n(this.url,{headers:this.headers,schema:i,fetch:this.fetch})}rpc(i,o={},{head:a=!1,get:l=!1,count:u}={}){var c;let h;const f=new URL(`${this.url}/rpc/${i}`);let d;a||l?(h=a?"HEAD":"GET",Object.entries(o).filter(([g,w])=>w!==void 0).map(([g,w])=>[g,Array.isArray(w)?`{${w.join(",")}}`:`${w}`]).forEach(([g,w])=>{f.searchParams.append(g,w)})):(h="POST",d=o);const y=new Headers(this.headers);return u&&y.set("Prefer",`count=${u}`),new r.default({method:h,url:f,headers:y,schema:this.schemaName,body:d,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch})}}return na.default=n,na}Object.defineProperty(Ye,"__esModule",{value:!0});var aw=Ye.PostgrestError=vw=Ye.PostgrestBuilder=mw=Ye.PostgrestTransformBuilder=fw=Ye.PostgrestFilterBuilder=dw=Ye.PostgrestQueryBuilder=uw=Ye.PostgrestClient=void 0;const pi=fi,lw=pi.__importDefault(VT());var uw=Ye.PostgrestClient=lw.default;const cw=pi.__importDefault(ow());var dw=Ye.PostgrestQueryBuilder=cw.default;const hw=pi.__importDefault(jh());var fw=Ye.PostgrestFilterBuilder=hw.default;const pw=pi.__importDefault(iw());var mw=Ye.PostgrestTransformBuilder=pw.default;const gw=pi.__importDefault(sw());var vw=Ye.PostgrestBuilder=gw.default;const yw=pi.__importDefault(nw());aw=Ye.PostgrestError=yw.default;var ww=Ye.default={PostgrestClient:lw.default,PostgrestQueryBuilder:cw.default,PostgrestFilterBuilder:hw.default,PostgrestTransformBuilder:pw.default,PostgrestBuilder:gw.default,PostgrestError:yw.default};const WT=Lm({__proto__:null,get PostgrestBuilder(){return vw},get PostgrestClient(){return uw},get PostgrestError(){return aw},get PostgrestFilterBuilder(){return fw},get PostgrestQueryBuilder(){return dw},get PostgrestTransformBuilder(){return mw},default:ww},[Ye]),{PostgrestClient:HT,PostgrestQueryBuilder:JP,PostgrestFilterBuilder:YP,PostgrestTransformBuilder:XP,PostgrestBuilder:eR,PostgrestError:tR}=ww||WT;class qT{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(typeof process<"u"){const r=process.versions;if(r&&r.node){const n=r.node,s=parseInt(n.replace(/^v/,"").split(".")[0]);return s>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${s} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${s} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
import ws from "ws"
new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let r=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(r+=`

Suggested solution: ${e.workaround}`),new Error(r)}static createWebSocket(e,r){const n=this.getWebSocketConstructor();return new n(e,r)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const KT="2.86.0",GT=`realtime-js/${KT}`,_w="1.0.0",QT="2.0.0",Kp=_w,nd=1e4,ZT=1e3,JT=100;var Rn;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(Rn||(Rn={}));var je;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(je||(je={}));var Vt;(function(t){t.close="phx_close",t.error="phx_error",t.join="phx_join",t.reply="phx_reply",t.leave="phx_leave",t.access_token="access_token"})(Vt||(Vt={}));var sd;(function(t){t.websocket="websocket"})(sd||(sd={}));var An;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(An||(An={}));class YT{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,r){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){var r;return this._isArrayBuffer((r=e.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var r,n;const s=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(e){var r,n;const s=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},o=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(e,r,n){var s,i;const o=e.topic,a=(s=e.ref)!==null&&s!==void 0?s:"",l=(i=e.join_ref)!==null&&i!==void 0?i:"",u=e.payload.event,c=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},h=Object.keys(c).length===0?"":JSON.stringify(c);if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`ref length ${a.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`topic length ${o.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const f=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+a.length+o.length+u.length+h.length,d=new ArrayBuffer(this.HEADER_LENGTH+f);let y=new DataView(d),g=0;y.setUint8(g++,this.KINDS.userBroadcastPush),y.setUint8(g++,l.length),y.setUint8(g++,a.length),y.setUint8(g++,o.length),y.setUint8(g++,u.length),y.setUint8(g++,h.length),y.setUint8(g++,r),Array.from(l,m=>y.setUint8(g++,m.charCodeAt(0))),Array.from(a,m=>y.setUint8(g++,m.charCodeAt(0))),Array.from(o,m=>y.setUint8(g++,m.charCodeAt(0))),Array.from(u,m=>y.setUint8(g++,m.charCodeAt(0))),Array.from(h,m=>y.setUint8(g++,m.charCodeAt(0)));var w=new Uint8Array(d.byteLength+n.byteLength);return w.set(new Uint8Array(d),0),w.set(new Uint8Array(n),d.byteLength),w.buffer}decode(e,r){if(this._isArrayBuffer(e)){let n=this._binaryDecode(e);return r(n)}if(typeof e=="string"){const n=JSON.parse(e),[s,i,o,a,l]=n;return r({join_ref:s,ref:i,topic:o,event:a,payload:l})}return r({})}_binaryDecode(e){const r=new DataView(e),n=r.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,r,s)}}_decodeUserBroadcast(e,r,n){const s=r.getUint8(1),i=r.getUint8(2),o=r.getUint8(3),a=r.getUint8(4);let l=this.HEADER_LENGTH+4;const u=n.decode(e.slice(l,l+s));l=l+s;const c=n.decode(e.slice(l,l+i));l=l+i;const h=n.decode(e.slice(l,l+o));l=l+o;const f=e.slice(l,e.byteLength),d=a===this.JSON_ENCODING?JSON.parse(n.decode(f)):f,y={type:this.BROADCAST_EVENT,event:c,payload:d};return o>0&&(y.meta=JSON.parse(h)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:y}}_isArrayBuffer(e){var r;return e instanceof ArrayBuffer||((r=e==null?void 0:e.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(e,r){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([n])=>r.includes(n)))}}class bw{constructor(e,r){this.callback=e,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var pe;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(pe||(pe={}));const Gp=(t,e,r={})=>{var n;const s=(n=r.skipTypes)!==null&&n!==void 0?n:[];return e?Object.keys(e).reduce((i,o)=>(i[o]=XT(o,t,e,s),i),{}):{}},XT=(t,e,r,n)=>{const s=e.find(a=>a.name===t),i=s==null?void 0:s.type,o=r[t];return i&&!n.includes(i)?xw(i,o):id(o)},xw=(t,e)=>{if(t.charAt(0)==="_"){const r=t.slice(1,t.length);return nC(e,r)}switch(t){case pe.bool:return eC(e);case pe.float4:case pe.float8:case pe.int2:case pe.int4:case pe.int8:case pe.numeric:case pe.oid:return tC(e);case pe.json:case pe.jsonb:return rC(e);case pe.timestamp:return sC(e);case pe.abstime:case pe.date:case pe.daterange:case pe.int4range:case pe.int8range:case pe.money:case pe.reltime:case pe.text:case pe.time:case pe.timestamptz:case pe.timetz:case pe.tsrange:case pe.tstzrange:return id(e);default:return id(e)}},id=t=>t,eC=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},tC=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},rC=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch(e){return console.log(`JSON parse error: ${e}`),t}return t},nC=(t,e)=>{if(typeof t!="string")return t;const r=t.length-1,n=t[r];if(t[0]==="{"&&n==="}"){let i;const o=t.slice(1,r);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(a=>xw(e,a))}return t},sC=t=>typeof t=="string"?t.replace(" ","T"):t,Sw=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};class Iu{constructor(e,r,n={},s=nd){this.channel=e,this.event=r,this.payload=n,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,r){var n;return this._hasReceived(e)&&r((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:e,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:r}){this.recHooks.filter(n=>n.status===e).forEach(n=>n.callback(r))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var Qp;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(Qp||(Qp={}));class Vi{constructor(e,r){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(r==null?void 0:r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},s=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Vi.syncState(this.state,s,i,o),this.pendingDiffs.forEach(l=>{this.state=Vi.syncDiff(this.state,l,i,o)}),this.pendingDiffs=[],a()}),this.channel._on(n.diff,{},s=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Vi.syncDiff(this.state,s,i,o),a())}),this.onJoin((s,i,o)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:i,newPresences:o})}),this.onLeave((s,i,o)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,r,n,s){const i=this.cloneDeep(e),o=this.transformState(r),a={},l={};return this.map(i,(u,c)=>{o[u]||(l[u]=c)}),this.map(o,(u,c)=>{const h=i[u];if(h){const f=c.map(w=>w.presence_ref),d=h.map(w=>w.presence_ref),y=c.filter(w=>d.indexOf(w.presence_ref)<0),g=h.filter(w=>f.indexOf(w.presence_ref)<0);y.length>0&&(a[u]=y),g.length>0&&(l[u]=g)}else a[u]=c}),this.syncDiff(i,{joins:a,leaves:l},n,s)}static syncDiff(e,r,n,s){const{joins:i,leaves:o}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return n||(n=()=>{}),s||(s=()=>{}),this.map(i,(a,l)=>{var u;const c=(u=e[a])!==null&&u!==void 0?u:[];if(e[a]=this.cloneDeep(l),c.length>0){const h=e[a].map(d=>d.presence_ref),f=c.filter(d=>h.indexOf(d.presence_ref)<0);e[a].unshift(...f)}n(a,c,l)}),this.map(o,(a,l)=>{let u=e[a];if(!u)return;const c=l.map(h=>h.presence_ref);u=u.filter(h=>c.indexOf(h.presence_ref)<0),e[a]=u,s(a,u,l),u.length===0&&delete e[a]}),e}static map(e,r){return Object.getOwnPropertyNames(e).map(n=>r(n,e[n]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((r,n)=>{const s=e[n];return"metas"in s?r[n]=s.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):r[n]=s,r},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var Zp;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(Zp||(Zp={}));var Wi;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Wi||(Wi={}));var fr;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(fr||(fr={}));class Nh{constructor(e,r={config:{}},n){var s,i;if(this.topic=e,this.params=r,this.socket=n,this.bindings={},this.state=je.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new Iu(this,Vt.join,this.params,this.timeout),this.rejoinTimer=new bw(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=je.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=je.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=je.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=je.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=je.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Vt.reply,{},(o,a)=>{this._trigger(this._replyEventName(a),o)}),this.presence=new Vi(this),this.broadcastEndpointURL=Sw(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((i=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||i===void 0)&&i.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(e,r=this.timeout){var n,s,i;if(this.socket.isConnected()||this.socket.connect(),this.state==je.closed){const{config:{broadcast:o,presence:a,private:l}}=this.params,u=(s=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(d=>d.filter))!==null&&s!==void 0?s:[],c=!!this.bindings[Wi.PRESENCE]&&this.bindings[Wi.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,h={},f={broadcast:o,presence:Object.assign(Object.assign({},a),{enabled:c}),postgres_changes:u,private:l};this.socket.accessTokenValue&&(h.access_token=this.socket.accessTokenValue),this._onError(d=>e==null?void 0:e(fr.CHANNEL_ERROR,d)),this._onClose(()=>e==null?void 0:e(fr.CLOSED)),this.updateJoinPayload(Object.assign({config:f},h)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:d})=>{var y;if(this.socket.setAuth(),d===void 0){e==null||e(fr.SUBSCRIBED);return}else{const g=this.bindings.postgres_changes,w=(y=g==null?void 0:g.length)!==null&&y!==void 0?y:0,m=[];for(let p=0;p<w;p++){const v=g[p],{filter:{event:_,schema:x,table:E,filter:k}}=v,O=d&&d[p];if(O&&O.event===_&&O.schema===x&&O.table===E&&O.filter===k)m.push(Object.assign(Object.assign({},v),{id:O.id}));else{this.unsubscribe(),this.state=je.errored,e==null||e(fr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=m,e&&e(fr.SUBSCRIBED);return}}).receive("error",d=>{this.state=je.errored,e==null||e(fr.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(d).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(fr.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,r={}){return await this.send({type:"presence",event:"track",payload:e},r.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,r,n){return this.state===je.joined&&e===Wi.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(e,r,n)}async httpSend(e,r,n={}){var s;const i=this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"";if(r==null)return Promise.reject("Payload is required for httpSend()");const o={method:"POST",headers:{Authorization:i,apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:r,private:this.private}]})},a=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);if(a.status===202)return{success:!0};let l=a.statusText;try{const u=await a.json();l=u.error||u.message||l}catch{}return Promise.reject(new Error(l))}async send(e,r={}){var n,s;if(!this._canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:o}=e,l={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((s=u.body)===null||s===void 0?void 0:s.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,a,l;const u=this._push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((l=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||l===void 0)&&l.ack)&&i("ok"),u.receive("ok",()=>i("ok")),u.receive("error",()=>i("error")),u.receive("timeout",()=>i("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=je.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Vt.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(s=>{n=new Iu(this,Vt.leave,{},e),n.receive("ok",()=>{r(),s("ok")}).receive("timeout",()=>{r(),s("timed out")}).receive("error",()=>{s("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{n==null||n.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=je.closed,this.bindings={}}async _fetchWithTimeout(e,r,n){const s=new AbortController,i=setTimeout(()=>s.abort(),n),o=await this.socket.fetch(e,Object.assign(Object.assign({},r),{signal:s.signal}));return clearTimeout(i),o}_push(e,r,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new Iu(this,e,r,n);return this._canPush()?s.send():this._addToPushBuffer(s),s}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>JT){const r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(e,r,n){return r}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,r,n){var s,i;const o=e.toLocaleLowerCase(),{close:a,error:l,leave:u,join:c}=Vt;if(n&&[a,l,u,c].indexOf(o)>=0&&n!==this._joinRef())return;let f=this._onMessage(o,r,n);if(r&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(d=>{var y,g,w;return((y=d.filter)===null||y===void 0?void 0:y.event)==="*"||((w=(g=d.filter)===null||g===void 0?void 0:g.event)===null||w===void 0?void 0:w.toLocaleLowerCase())===o}).map(d=>d.callback(f,n)):(i=this.bindings[o])===null||i===void 0||i.filter(d=>{var y,g,w,m,p,v;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in d){const _=d.id,x=(y=d.filter)===null||y===void 0?void 0:y.event;return _&&((g=r.ids)===null||g===void 0?void 0:g.includes(_))&&(x==="*"||(x==null?void 0:x.toLocaleLowerCase())===((w=r.data)===null||w===void 0?void 0:w.type.toLocaleLowerCase()))}else{const _=(p=(m=d==null?void 0:d.filter)===null||m===void 0?void 0:m.event)===null||p===void 0?void 0:p.toLocaleLowerCase();return _==="*"||_===((v=r==null?void 0:r.event)===null||v===void 0?void 0:v.toLocaleLowerCase())}else return d.type.toLocaleLowerCase()===o}).map(d=>{if(typeof f=="object"&&"ids"in f){const y=f.data,{schema:g,table:w,commit_timestamp:m,type:p,errors:v}=y;f=Object.assign(Object.assign({},{schema:g,table:w,commit_timestamp:m,eventType:p,new:{},old:{},errors:v}),this._getPayloadRecords(y))}d.callback(f,n)})}_isClosed(){return this.state===je.closed}_isJoined(){return this.state===je.joined}_isJoining(){return this.state===je.joining}_isLeaving(){return this.state===je.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,r,n){const s=e.toLocaleLowerCase(),i={type:s,filter:r,callback:n};return this.bindings[s]?this.bindings[s].push(i):this.bindings[s]=[i],this}_off(e,r){const n=e.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(s=>{var i;return!(((i=s.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===n&&Nh.isEqual(s.filter,r))})),this}static isEqual(e,r){if(Object.keys(e).length!==Object.keys(r).length)return!1;for(const n in e)if(e[n]!==r[n])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(Vt.close,{},e)}_onError(e){this._on(Vt.error,{},r=>e(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=je.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=Gp(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=Gp(e.columns,e.old_record)),r}}const $u=()=>{},ua={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},iC=[1e3,2e3,5e3,1e4],oC=1e4,aC=`
  addEventListener("message", (e) => {
    if (e.data.event === "start") {
      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
    }
  });`;class lC{constructor(e,r){var n;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=nd,this.transport=null,this.heartbeatIntervalMs=ua.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=$u,this.ref=0,this.reconnectTimer=null,this.vsn=Kp,this.logger=$u,this.conn=null,this.sendBuffer=[],this.serializer=new YT,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=s=>s?(...i)=>s(...i):(...i)=>fetch(...i),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${e}/${sd.websocket}`,this.httpEndpoint=Sw(e),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=qT.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const r=e.message;throw r.includes("Node.js")?new Error(`${r}

To use Realtime in Node.js, you need to provide a WebSocket implementation:

Option 1: Use Node.js 22+ which has native WebSocket support
Option 2: Install and provide the "ws" package:

  npm install ws

  import ws from "ws"
  const client = new RealtimeClient(url, {
    ...options,
    transport: ws
  })`):new Error(`WebSocket not available: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(e,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(e?this.conn.close(e,r??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const r=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const e=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,r,n){this.logger(e,r,n)}connectionState(){switch(this.conn&&this.conn.readyState){case Rn.connecting:return An.Connecting;case Rn.open:return An.Open;case Rn.closing:return An.Closing;default:return An.Closed}}isConnected(){return this.connectionState()===An.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(e,r={config:{}}){const n=`realtime:${e}`,s=this.getChannels().find(i=>i.topic===n);if(s)return s;{const i=new Nh(`realtime:${e}`,r,this);return this.channels.push(i),i}}push(e){const{topic:r,event:n,payload:s,ref:i}=e,o=()=>{this.encode(e,a=>{var l;(l=this.conn)===null||l===void 0||l.send(a)})};this.log("push",`${r} ${n} (${i})`,s),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var e;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this._wasManualDisconnect=!1,(e=this.conn)===null||e===void 0||e.close(ZT,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout()},ua.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this._setAuthSafely("heartbeat")}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let r=this.channels.find(n=>n.topic===e&&(n._isJoined()||n._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${e}"`),r.unsubscribe())}_remove(e){this.channels=this.channels.filter(r=>r.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,r=>{if(r.topic==="phoenix"&&r.event==="phx_reply")try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error")}catch(u){this.log("error","error in heartbeat callback",u)}r.ref&&r.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:n,event:s,payload:i,ref:o}=r,a=o?`(${o})`:"",l=i.status||"";this.log("receive",`${l} ${n} ${s} ${a}`.trim(),i),this.channels.filter(u=>u._isMember(n)).forEach(u=>u._trigger(s,i,o)),this._triggerStateCallbacks("message",r)})}_clearTimer(e){var r;e==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):e==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_teardownConnection(){if(this.conn){if(this.conn.readyState===Rn.open||this.conn.readyState===Rn.connecting)try{this.conn.close()}catch(e){this.log("error","Error closing connection",e)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(r=>{this.log("error","error waiting for auth on connect",r),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this.workerRef.terminate()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(e){var r;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e)}_triggerChanError(){this.channels.forEach(e=>e._trigger(Vt.error))}_appendParams(e,r){if(Object.keys(r).length===0)return e;const n=e.match(/\?/)?"&":"?",s=new URLSearchParams(r);return`${e}${n}${s}`}_workerObjectUrl(e){let r;if(e)r=e;else{const n=new Blob([aC],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_setConnectionState(e,r=!1){this._connectionState=e,e==="connecting"?this._wasManualDisconnect=!1:e==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(e=null){let r;e?r=e:this.accessToken?r=await this.accessToken():r=this.accessTokenValue,this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(n=>{const s={access_token:r,version:GT};r&&n.updateJoinPayload(s),n.joinedOnce&&n._isJoined()&&n._push(Vt.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this.setAuth().catch(r=>{this.log("error",`error setting auth in ${e}`,r)})}_triggerStateCallbacks(e,r){try{this.stateChangeCallbacks[e].forEach(n=>{try{n(r)}catch(s){this.log("error",`error in ${e} callback`,s)}})}catch(n){this.log("error",`error triggering ${e} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new bw(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},ua.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var r,n,s,i,o,a,l,u,c,h,f,d;switch(this.transport=(r=e==null?void 0:e.transport)!==null&&r!==void 0?r:null,this.timeout=(n=e==null?void 0:e.timeout)!==null&&n!==void 0?n:nd,this.heartbeatIntervalMs=(s=e==null?void 0:e.heartbeatIntervalMs)!==null&&s!==void 0?s:ua.HEARTBEAT_INTERVAL,this.worker=(i=e==null?void 0:e.worker)!==null&&i!==void 0?i:!1,this.accessToken=(o=e==null?void 0:e.accessToken)!==null&&o!==void 0?o:null,this.heartbeatCallback=(a=e==null?void 0:e.heartbeatCallback)!==null&&a!==void 0?a:$u,this.vsn=(l=e==null?void 0:e.vsn)!==null&&l!==void 0?l:Kp,e!=null&&e.params&&(this.params=e.params),e!=null&&e.logger&&(this.logger=e.logger),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(u=e==null?void 0:e.reconnectAfterMs)!==null&&u!==void 0?u:y=>iC[y-1]||oC,this.vsn){case _w:this.encode=(c=e==null?void 0:e.encode)!==null&&c!==void 0?c:(y,g)=>g(JSON.stringify(y)),this.decode=(h=e==null?void 0:e.decode)!==null&&h!==void 0?h:(y,g)=>g(JSON.parse(y));break;case QT:this.encode=(f=e==null?void 0:e.encode)!==null&&f!==void 0?f:this.serializer.encode.bind(this.serializer),this.decode=(d=e==null?void 0:e.decode)!==null&&d!==void 0?d:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl}}}class Gl extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function be(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}class uC extends Gl{constructor(e,r,n){super(e),this.name="StorageApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class od extends Gl{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}}const Ih=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),cC=()=>Response,ad=t=>{if(Array.isArray(t))return t.map(r=>ad(r));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([r,n])=>{const s=r.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));e[s]=ad(n)}),e},dC=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},hC=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t),Lu=t=>{var e;return t.msg||t.message||t.error_description||(typeof t.error=="string"?t.error:(e=t.error)===null||e===void 0?void 0:e.message)||JSON.stringify(t)},fC=(t,e,r)=>U(void 0,void 0,void 0,function*(){const n=yield cC();t instanceof n&&!(r!=null&&r.noResolveJson)?t.json().then(s=>{const i=t.status||500,o=(s==null?void 0:s.statusCode)||i+"";e(new uC(Lu(s),i,o))}).catch(s=>{e(new od(Lu(s),s))}):e(new od(Lu(t),t))}),pC=(t,e,r,n)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"||!n?s:(dC(n)?(s.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),s.body=JSON.stringify(n)):s.body=n,e!=null&&e.duplex&&(s.duplex=e.duplex),Object.assign(Object.assign({},s),r))};function Ro(t,e,r,n,s,i){return U(this,void 0,void 0,function*(){return new Promise((o,a)=>{t(r,pC(e,n,s,i)).then(l=>{if(!l.ok)throw l;return n!=null&&n.noResolveJson?l:l.json()}).then(l=>o(l)).catch(l=>fC(l,a,n))})})}function fo(t,e,r,n){return U(this,void 0,void 0,function*(){return Ro(t,"GET",e,r,n)})}function Ut(t,e,r,n,s){return U(this,void 0,void 0,function*(){return Ro(t,"POST",e,n,s,r)})}function ld(t,e,r,n,s){return U(this,void 0,void 0,function*(){return Ro(t,"PUT",e,n,s,r)})}function mC(t,e,r,n){return U(this,void 0,void 0,function*(){return Ro(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}function $h(t,e,r,n,s){return U(this,void 0,void 0,function*(){return Ro(t,"DELETE",e,n,s,r)})}class gC{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r}then(e,r){return this.execute().then(e,r)}execute(){return U(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(be(e))return{data:null,error:e};throw e}})}}var Ew;class vC{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r,this[Ew]="BlobDownloadBuilder",this.promise=null}asStream(){return new gC(this.downloadFn,this.shouldThrowOnError)}then(e,r){return this.getPromise().then(e,r)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}execute(){return U(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(be(e))return{data:null,error:e};throw e}})}}Ew=Symbol.toStringTag;const yC={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Jp={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class wC{constructor(e,r={},n,s){this.shouldThrowOnError=!1,this.url=e,this.headers=r,this.bucketId=n,this.fetch=Ih(s)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(e,r,n,s){return U(this,void 0,void 0,function*(){try{let i;const o=Object.assign(Object.assign({},Jp),s);let a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const l=o.metadata;typeof Blob<"u"&&n instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),l&&i.append("metadata",this.encodeMetadata(l)),i.append("",n)):typeof FormData<"u"&&n instanceof FormData?(i=n,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),l&&!i.has("metadata")&&i.append("metadata",this.encodeMetadata(l))):(i=n,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,l&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(l))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!o.duplex&&(o.duplex="half")),s!=null&&s.headers&&(a=Object.assign(Object.assign({},a),s.headers));const u=this._removeEmptyFolders(r),c=this._getFinalPath(u),h=yield(e=="PUT"?ld:Ut)(this.fetch,`${this.url}/object/${c}`,i,Object.assign({headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{data:{path:u,id:h.Id,fullPath:h.Key},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(be(i))return{data:null,error:i};throw i}})}upload(e,r,n){return U(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,s){return U(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(e),o=this._getFinalPath(i),a=new URL(this.url+`/object/upload/sign/${o}`);a.searchParams.set("token",r);try{let l;const u=Object.assign({upsert:Jp.upsert},s),c=Object.assign(Object.assign({},this.headers),{"x-upsert":String(u.upsert)});typeof Blob<"u"&&n instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",n)):typeof FormData<"u"&&n instanceof FormData?(l=n,l.append("cacheControl",u.cacheControl)):(l=n,c["cache-control"]=`max-age=${u.cacheControl}`,c["content-type"]=u.contentType);const h=yield ld(this.fetch,a.toString(),l,{headers:c});return{data:{path:i,fullPath:h.Key},error:null}}catch(l){if(this.shouldThrowOnError)throw l;if(be(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(e,r){return U(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e);const s=Object.assign({},this.headers);r!=null&&r.upsert&&(s["x-upsert"]="true");const i=yield Ut(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:s}),o=new URL(this.url+i.url),a=o.searchParams.get("token");if(!a)throw new Gl("No token returned by API");return{data:{signedUrl:o.toString(),path:e,token:a},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(be(n))return{data:null,error:n};throw n}})}update(e,r,n){return U(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return U(this,void 0,void 0,function*(){try{return{data:yield Ut(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(be(s))return{data:null,error:s};throw s}})}copy(e,r,n){return U(this,void 0,void 0,function*(){try{return{data:{path:(yield Ut(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers})).Key},error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(be(s))return{data:null,error:s};throw s}})}createSignedUrl(e,r,n){return U(this,void 0,void 0,function*(){try{let s=this._getFinalPath(e),i=yield Ut(this.fetch,`${this.url}/object/sign/${s}`,Object.assign({expiresIn:r},n!=null&&n.transform?{transform:n.transform}:{}),{headers:this.headers});const o=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${o}`)},{data:i,error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(be(s))return{data:null,error:s};throw s}})}createSignedUrls(e,r,n){return U(this,void 0,void 0,function*(){try{const s=yield Ut(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),i=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{data:s.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${i}`):null})),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(be(s))return{data:null,error:s};throw s}})}download(e,r){const s=typeof(r==null?void 0:r.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((r==null?void 0:r.transform)||{}),o=i?`?${i}`:"",a=this._getFinalPath(e),l=()=>fo(this.fetch,`${this.url}/${s}/${a}${o}`,{headers:this.headers,noResolveJson:!0});return new vC(l,this.shouldThrowOnError)}info(e){return U(this,void 0,void 0,function*(){const r=this._getFinalPath(e);try{const n=yield fo(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:ad(n),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(be(n))return{data:null,error:n};throw n}})}exists(e){return U(this,void 0,void 0,function*(){const r=this._getFinalPath(e);try{return yield mC(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(be(n)&&n instanceof od){const s=n.originalError;if([400,404].includes(s==null?void 0:s.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,r){const n=this._getFinalPath(e),s=[],i=r!=null&&r.download?`download=${r.download===!0?"":r.download}`:"";i!==""&&s.push(i);const a=typeof(r==null?void 0:r.transform)<"u"?"render/image":"object",l=this.transformOptsToQueryString((r==null?void 0:r.transform)||{});l!==""&&s.push(l);let u=s.join("&");return u!==""&&(u=`?${u}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}${u}`)}}}remove(e){return U(this,void 0,void 0,function*(){try{return{data:yield $h(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(be(r))return{data:null,error:r};throw r}})}list(e,r,n){return U(this,void 0,void 0,function*(){try{const s=Object.assign(Object.assign(Object.assign({},yC),r),{prefix:e||""});return{data:yield Ut(this.fetch,`${this.url}/object/list/${this.bucketId}`,s,{headers:this.headers},n),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(be(s))return{data:null,error:s};throw s}})}listV2(e,r){return U(this,void 0,void 0,function*(){try{const n=Object.assign({},e);return{data:yield Ut(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,n,{headers:this.headers},r),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(be(n))return{data:null,error:n};throw n}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const r=[];return e.width&&r.push(`width=${e.width}`),e.height&&r.push(`height=${e.height}`),e.resize&&r.push(`resize=${e.resize}`),e.format&&r.push(`format=${e.format}`),e.quality&&r.push(`quality=${e.quality}`),r.join("&")}}const kw="2.86.0",Tw={"X-Client-Info":`storage-js/${kw}`};class _C{constructor(e,r={},n,s){this.shouldThrowOnError=!1;const i=new URL(e);s!=null&&s.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase.")),this.url=i.href.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Tw),r),this.fetch=Ih(n)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(e){return U(this,void 0,void 0,function*(){try{const r=this.listBucketOptionsToQueryString(e);return{data:yield fo(this.fetch,`${this.url}/bucket${r}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(be(r))return{data:null,error:r};throw r}})}getBucket(e){return U(this,void 0,void 0,function*(){try{return{data:yield fo(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(be(r))return{data:null,error:r};throw r}})}createBucket(e){return U(this,arguments,void 0,function*(r,n={public:!1}){try{return{data:yield Ut(this.fetch,`${this.url}/bucket`,{id:r,name:r,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(be(s))return{data:null,error:s};throw s}})}updateBucket(e,r){return U(this,void 0,void 0,function*(){try{return{data:yield ld(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(be(n))return{data:null,error:n};throw n}})}emptyBucket(e){return U(this,void 0,void 0,function*(){try{return{data:yield Ut(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(be(r))return{data:null,error:r};throw r}})}deleteBucket(e){return U(this,void 0,void 0,function*(){try{return{data:yield $h(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(be(r))return{data:null,error:r};throw r}})}listBucketOptionsToQueryString(e){const r={};return e&&("limit"in e&&(r.limit=String(e.limit)),"offset"in e&&(r.offset=String(e.offset)),e.search&&(r.search=e.search),e.sortColumn&&(r.sortColumn=e.sortColumn),e.sortOrder&&(r.sortOrder=e.sortOrder)),Object.keys(r).length>0?"?"+new URLSearchParams(r).toString():""}}var po=class extends Error{constructor(t,e){var r;super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((r=e.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function bC(t,e,r){const n=new URL(e,t);if(r)for(const[s,i]of Object.entries(r))i!==void 0&&n.searchParams.set(s,i);return n.toString()}async function xC(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function SC(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:i,headers:o}){const a=bC(t.baseUrl,n,s),l=await xC(t.auth),u=await e(a,{method:r,headers:{...i?{"Content-Type":"application/json"}:{},...l,...o},body:i?JSON.stringify(i):void 0}),c=await u.text(),h=(u.headers.get("content-type")||"").includes("application/json"),f=h&&c?JSON.parse(c):c;if(!u.ok){const d=h?f:void 0,y=d==null?void 0:d.error;throw new po((y==null?void 0:y.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:y==null?void 0:y.type,icebergCode:y==null?void 0:y.code,details:d})}return{status:u.status,headers:u.headers,data:f}}}}function ca(t){return t.join("")}var EC=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:ca(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(t,e){const r={namespace:t.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${ca(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${ca(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${ca(t.namespace)}`}),!0}catch(e){if(e instanceof po&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(r){if(r instanceof po&&r.status===409)return;throw r}}};function as(t){return t.join("")}var kC=class{constructor(t,e="",r){this.client=t,this.prefix=e,this.accessDelegation=r}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${as(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${as(t.namespace)}/tables`,body:e,headers:r})).data.metadata}async updateTable(t,e){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${as(t.namespace)}/tables/${t.name}`,body:e});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${as(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(t){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${as(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${as(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(r){if(r instanceof po&&r.status===404)return!1;throw r}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(r){if(r instanceof po&&r.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw r}}},TC=class{constructor(t){var n;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const r=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=SC({baseUrl:r,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(n=t.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new EC(this.client,e),this.tableOps=new kC(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}};class CC{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Tw),r),this.fetch=Ih(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return U(this,void 0,void 0,function*(){try{return{data:yield Ut(this.fetch,`${this.url}/bucket`,{name:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(be(r))return{data:null,error:r};throw r}})}listBuckets(e){return U(this,void 0,void 0,function*(){try{const r=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&r.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&r.set("sortOrder",e.sortOrder),e!=null&&e.search&&r.set("search",e.search);const n=r.toString(),s=n?`${this.url}/bucket?${n}`:`${this.url}/bucket`;return{data:yield fo(this.fetch,s,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(be(r))return{data:null,error:r};throw r}})}deleteBucket(e){return U(this,void 0,void 0,function*(){try{return{data:yield $h(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(be(r))return{data:null,error:r};throw r}})}from(e){if(!hC(e))throw new Gl("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");return new TC({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:()=>U(this,void 0,void 0,function*(){return this.headers})},fetch:this.fetch})}}const Lh={"X-Client-Info":`storage-js/${kw}`,"Content-Type":"application/json"};class Cw extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}}function ft(t){return typeof t=="object"&&t!==null&&"__isStorageVectorsError"in t}class Du extends Cw{constructor(e,r,n){super(e),this.name="StorageVectorsApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class OC extends Cw{constructor(e,r){super(e),this.name="StorageVectorsUnknownError",this.originalError=r}}var Yp;(function(t){t.InternalError="InternalError",t.S3VectorConflictException="S3VectorConflictException",t.S3VectorNotFoundException="S3VectorNotFoundException",t.S3VectorBucketNotEmpty="S3VectorBucketNotEmpty",t.S3VectorMaxBucketsExceeded="S3VectorMaxBucketsExceeded",t.S3VectorMaxIndexesExceeded="S3VectorMaxIndexesExceeded"})(Yp||(Yp={}));const Dh=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),PC=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Xp=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),RC=(t,e,r)=>U(void 0,void 0,void 0,function*(){if(t&&typeof t=="object"&&"status"in t&&"ok"in t&&typeof t.status=="number"&&!(r!=null&&r.noResolveJson)){const s=t.status||500,i=t;if(typeof i.json=="function")i.json().then(o=>{const a=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||s+"";e(new Du(Xp(o),s,a))}).catch(()=>{const o=s+"",a=i.statusText||`HTTP ${s} error`;e(new Du(a,s,o))});else{const o=s+"",a=i.statusText||`HTTP ${s} error`;e(new Du(a,s,o))}}else e(new OC(Xp(t),t))}),AC=(t,e,r,n)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return n?(PC(n)?(s.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),s.body=JSON.stringify(n)):s.body=n,Object.assign(Object.assign({},s),r)):s};function jC(t,e,r,n,s,i){return U(this,void 0,void 0,function*(){return new Promise((o,a)=>{t(r,AC(e,n,s,i)).then(l=>{if(!l.ok)throw l;if(n!=null&&n.noResolveJson)return l;const u=l.headers.get("content-type");return!u||!u.includes("application/json")?{}:l.json()}).then(l=>o(l)).catch(l=>RC(l,a,n))})})}function pt(t,e,r,n,s){return U(this,void 0,void 0,function*(){return jC(t,"POST",e,n,s,r)})}class NC{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Lh),r),this.fetch=Dh(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createIndex(e){return U(this,void 0,void 0,function*(){try{return{data:(yield pt(this.fetch,`${this.url}/CreateIndex`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ft(r))return{data:null,error:r};throw r}})}getIndex(e,r){return U(this,void 0,void 0,function*(){try{return{data:yield pt(this.fetch,`${this.url}/GetIndex`,{vectorBucketName:e,indexName:r},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ft(n))return{data:null,error:n};throw n}})}listIndexes(e){return U(this,void 0,void 0,function*(){try{return{data:yield pt(this.fetch,`${this.url}/ListIndexes`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ft(r))return{data:null,error:r};throw r}})}deleteIndex(e,r){return U(this,void 0,void 0,function*(){try{return{data:(yield pt(this.fetch,`${this.url}/DeleteIndex`,{vectorBucketName:e,indexName:r},{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ft(n))return{data:null,error:n};throw n}})}}class IC{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Lh),r),this.fetch=Dh(n)}throwOnError(){return this.shouldThrowOnError=!0,this}putVectors(e){return U(this,void 0,void 0,function*(){try{if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:(yield pt(this.fetch,`${this.url}/PutVectors`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ft(r))return{data:null,error:r};throw r}})}getVectors(e){return U(this,void 0,void 0,function*(){try{return{data:yield pt(this.fetch,`${this.url}/GetVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ft(r))return{data:null,error:r};throw r}})}listVectors(e){return U(this,void 0,void 0,function*(){try{if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return{data:yield pt(this.fetch,`${this.url}/ListVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ft(r))return{data:null,error:r};throw r}})}queryVectors(e){return U(this,void 0,void 0,function*(){try{return{data:yield pt(this.fetch,`${this.url}/QueryVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ft(r))return{data:null,error:r};throw r}})}deleteVectors(e){return U(this,void 0,void 0,function*(){try{if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:(yield pt(this.fetch,`${this.url}/DeleteVectors`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ft(r))return{data:null,error:r};throw r}})}}class $C{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Lh),r),this.fetch=Dh(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return U(this,void 0,void 0,function*(){try{return{data:(yield pt(this.fetch,`${this.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ft(r))return{data:null,error:r};throw r}})}getBucket(e){return U(this,void 0,void 0,function*(){try{return{data:yield pt(this.fetch,`${this.url}/GetVectorBucket`,{vectorBucketName:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ft(r))return{data:null,error:r};throw r}})}listBuckets(){return U(this,arguments,void 0,function*(e={}){try{return{data:yield pt(this.fetch,`${this.url}/ListVectorBuckets`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ft(r))return{data:null,error:r};throw r}})}deleteBucket(e){return U(this,void 0,void 0,function*(){try{return{data:(yield pt(this.fetch,`${this.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ft(r))return{data:null,error:r};throw r}})}}class LC extends $C{constructor(e,r={}){super(e,r.headers||{},r.fetch)}from(e){return new DC(this.url,this.headers,e,this.fetch)}createBucket(e){const r=Object.create(null,{createBucket:{get:()=>super.createBucket}});return U(this,void 0,void 0,function*(){return r.createBucket.call(this,e)})}getBucket(e){const r=Object.create(null,{getBucket:{get:()=>super.getBucket}});return U(this,void 0,void 0,function*(){return r.getBucket.call(this,e)})}listBuckets(){const e=Object.create(null,{listBuckets:{get:()=>super.listBuckets}});return U(this,arguments,void 0,function*(r={}){return e.listBuckets.call(this,r)})}deleteBucket(e){const r=Object.create(null,{deleteBucket:{get:()=>super.deleteBucket}});return U(this,void 0,void 0,function*(){return r.deleteBucket.call(this,e)})}}class DC extends NC{constructor(e,r,n,s){super(e,r,s),this.vectorBucketName=n}createIndex(e){const r=Object.create(null,{createIndex:{get:()=>super.createIndex}});return U(this,void 0,void 0,function*(){return r.createIndex.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName}))})}listIndexes(){const e=Object.create(null,{listIndexes:{get:()=>super.listIndexes}});return U(this,arguments,void 0,function*(r={}){return e.listIndexes.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName}))})}getIndex(e){const r=Object.create(null,{getIndex:{get:()=>super.getIndex}});return U(this,void 0,void 0,function*(){return r.getIndex.call(this,this.vectorBucketName,e)})}deleteIndex(e){const r=Object.create(null,{deleteIndex:{get:()=>super.deleteIndex}});return U(this,void 0,void 0,function*(){return r.deleteIndex.call(this,this.vectorBucketName,e)})}index(e){return new MC(this.url,this.headers,this.vectorBucketName,e,this.fetch)}}class MC extends IC{constructor(e,r,n,s,i){super(e,r,i),this.vectorBucketName=n,this.indexName=s}putVectors(e){const r=Object.create(null,{putVectors:{get:()=>super.putVectors}});return U(this,void 0,void 0,function*(){return r.putVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}getVectors(e){const r=Object.create(null,{getVectors:{get:()=>super.getVectors}});return U(this,void 0,void 0,function*(){return r.getVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}listVectors(){const e=Object.create(null,{listVectors:{get:()=>super.listVectors}});return U(this,arguments,void 0,function*(r={}){return e.listVectors.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}queryVectors(e){const r=Object.create(null,{queryVectors:{get:()=>super.queryVectors}});return U(this,void 0,void 0,function*(){return r.queryVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}deleteVectors(e){const r=Object.create(null,{deleteVectors:{get:()=>super.deleteVectors}});return U(this,void 0,void 0,function*(){return r.deleteVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}}class UC extends _C{constructor(e,r={},n,s){super(e,r,n,s)}from(e){return new wC(this.url,this.headers,e,this.fetch)}get vectors(){return new LC(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new CC(this.url+"/iceberg",this.headers,this.fetch)}}const FC="2.86.0";let Ai="";typeof Deno<"u"?Ai="deno":typeof document<"u"?Ai="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Ai="react-native":Ai="node";const BC={"X-Client-Info":`supabase-js-${Ai}/${FC}`},zC={headers:BC},VC={schema:"public"},WC={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},HC={},qC=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),KC=()=>Headers,GC=(t,e,r)=>{const n=qC(r),s=KC();return async(i,o)=>{var a;const l=(a=await e())!==null&&a!==void 0?a:t;let u=new s(o==null?void 0:o.headers);return u.has("apikey")||u.set("apikey",t),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),n(i,Object.assign(Object.assign({},o),{headers:u}))}};function QC(t){return t.endsWith("/")?t:t+"/"}function ZC(t,e){var r,n;const{db:s,auth:i,realtime:o,global:a}=t,{db:l,auth:u,realtime:c,global:h}=e,f={db:Object.assign(Object.assign({},l),s),auth:Object.assign(Object.assign({},u),i),realtime:Object.assign(Object.assign({},c),o),storage:{},global:Object.assign(Object.assign(Object.assign({},h),a),{headers:Object.assign(Object.assign({},(r=h==null?void 0:h.headers)!==null&&r!==void 0?r:{}),(n=a==null?void 0:a.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return t.accessToken?f.accessToken=t.accessToken:delete f.accessToken,f}function JC(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(QC(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}const Ow="2.86.0",fs=30*1e3,ud=3,Mu=ud*fs,YC="http://localhost:9999",XC="supabase.auth.token",eO={"X-Client-Info":`gotrue-js/${Ow}`},cd="X-Supabase-Api-Version",Pw={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},tO=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,rO=10*60*1e3;class mo extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}}function V(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class nO extends mo{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function sO(t){return V(t)&&t.name==="AuthApiError"}class jn extends mo{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}}class bn extends mo{constructor(e,r,n,s){super(e,n,s),this.name=r,this.status=n}}class ct extends bn{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function iO(t){return V(t)&&t.name==="AuthSessionMissingError"}class ls extends bn{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class da extends bn{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class ha extends bn{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function oO(t){return V(t)&&t.name==="AuthImplicitGrantRedirectError"}class em extends bn{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class dd extends bn{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}}function Uu(t){return V(t)&&t.name==="AuthRetryableFetchError"}class tm extends bn{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}}class hd extends bn{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const ul="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),rm=` 	
\r=`.split(""),aO=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<rm.length;e+=1)t[rm[e].charCodeAt(0)]=-2;for(let e=0;e<ul.length;e+=1)t[ul[e].charCodeAt(0)]=e;return t})();function nm(t,e,r){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(ul[n]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(ul[n]),e.queuedBits-=6}}function Rw(t,e,r){const n=aO[t];if(n>-1)for(e.queue=e.queue<<6|n,e.queuedBits+=6;e.queuedBits>=8;)r(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function sm(t){const e=[],r=o=>{e.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=o=>{cO(o,n,r)};for(let o=0;o<t.length;o+=1)Rw(t.charCodeAt(o),s,i);return e.join("")}function lO(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function uO(t,e){for(let r=0;r<t.length;r+=1){let n=t.charCodeAt(r);if(n>55295&&n<=56319){const s=(n-55296)*1024&65535;n=(t.charCodeAt(r+1)-56320&65535|s)+65536,r+=1}lO(n,e)}}function cO(t,e,r){if(e.utf8seq===0){if(t<=127){r(t);return}for(let n=1;n<6;n+=1)if(!(t>>7-n&1)){e.utf8seq=n;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&r(e.codepoint)}}function Ds(t){const e=[],r={queue:0,queuedBits:0},n=s=>{e.push(s)};for(let s=0;s<t.length;s+=1)Rw(t.charCodeAt(s),r,n);return new Uint8Array(e)}function dO(t){const e=[];return uO(t,r=>e.push(r)),new Uint8Array(e)}function Ln(t){const e=[],r={queue:0,queuedBits:0},n=s=>{e.push(s)};return t.forEach(s=>nm(s,r,n)),nm(null,r,n),e.join("")}function hO(t){return Math.round(Date.now()/1e3)+t}function fO(){return Symbol("auth-callback")}const Me=()=>typeof window<"u"&&typeof document<"u",kn={tested:!1,writable:!1},Aw=()=>{if(!Me())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(kn.tested)return kn.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),kn.tested=!0,kn.writable=!0}catch{kn.tested=!0,kn.writable=!1}return kn.writable};function pO(t){const e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((s,i)=>{e[i]=s})}catch{}return r.searchParams.forEach((n,s)=>{e[s]=n}),e}const jw=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),mO=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",ps=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},Tn=async(t,e)=>{const r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}},Dr=async(t,e)=>{await t.removeItem(e)};class Ql{constructor(){this.promise=new Ql.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}}Ql.promiseConstructor=Promise;function Fu(t){const e=t.split(".");if(e.length!==3)throw new hd("Invalid JWT structure");for(let n=0;n<e.length;n++)if(!tO.test(e[n]))throw new hd("JWT not in base64url format");return{header:JSON.parse(sm(e[0])),payload:JSON.parse(sm(e[1])),signature:Ds(e[2]),raw:{header:e[0],payload:e[1]}}}async function gO(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function vO(t,e){return new Promise((n,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await t(i);if(!e(i,null,o)){n(o);return}}catch(o){if(!e(i,o)){s(o);return}}})()})}function yO(t){return("0"+t.toString(16)).substr(-2)}function wO(){const e=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let s="";for(let i=0;i<56;i++)s+=r.charAt(Math.floor(Math.random()*n));return s}return crypto.getRandomValues(e),Array.from(e,yO).join("")}async function _O(t){const r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r),s=new Uint8Array(n);return Array.from(s).map(i=>String.fromCharCode(i)).join("")}async function bO(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;const r=await _O(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function us(t,e,r=!1){const n=wO();let s=n;r&&(s+="/PASSWORD_RECOVERY"),await ps(t,`${e}-code-verifier`,s);const i=await bO(n);return[i,n===i?"plain":"s256"]}const xO=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function SO(t){const e=t.headers.get(cd);if(!e||!e.match(xO))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function EO(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function kO(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const TO=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function cs(t){if(!TO.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Bu(){const t={};return new Proxy(t,{get:(e,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function CO(t,e){return new Proxy(t,{get:(r,n,s)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const i=n.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,s)}return!e.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(r,n,s)}})}function im(t){return JSON.parse(JSON.stringify(t))}const Pn=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),OO=[502,503,504];async function om(t){var e;if(!mO(t))throw new dd(Pn(t),0);if(OO.includes(t.status))throw new dd(Pn(t),t.status);let r;try{r=await t.json()}catch(i){throw new jn(Pn(i),i)}let n;const s=SO(t);if(s&&s.getTime()>=Pw["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new tm(Pn(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new ct}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((i,o)=>i&&typeof o=="string",!0))throw new tm(Pn(r),t.status,r.weak_password.reasons);throw new nO(Pn(r),t.status||500,n)}const PO=(t,e,r,n)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),s.body=JSON.stringify(n),Object.assign(Object.assign({},s),r))};async function H(t,e,r,n){var s;const i=Object.assign({},n==null?void 0:n.headers);i[cd]||(i[cd]=Pw["2024-01-01"].name),n!=null&&n.jwt&&(i.Authorization=`Bearer ${n.jwt}`);const o=(s=n==null?void 0:n.query)!==null&&s!==void 0?s:{};n!=null&&n.redirectTo&&(o.redirect_to=n.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=await RO(t,e,r+a,{headers:i,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(l):{data:Object.assign({},l),error:null}}async function RO(t,e,r,n,s,i){const o=PO(e,n,s,i);let a;try{a=await t(r,Object.assign({},o))}catch(l){throw console.error(l),new dd(Pn(l),0)}if(a.ok||await om(a),n!=null&&n.noResolveJson)return a;try{return await a.json()}catch(l){await om(l)}}function Lt(t){var e;let r=null;NO(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=hO(t.expires_in)));const n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}function am(t){const e=Lt(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}function Wr(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function AO(t){return{data:t,error:null}}function jO(t){const{action_link:e,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i}=t,o=hi(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i},l=Object.assign({},o);return{data:{properties:a,user:l},error:null}}function lm(t){return t}function NO(t){return t.access_token&&t.refresh_token&&t.expires_in}const zu=["global","local","others"];class IO{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=jw(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(e,r=zu[0]){if(zu.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${zu.join(", ")}`);try{return await H(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(V(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await H(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Wr})}catch(n){if(V(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:r}=e,n=hi(e,["options"]),s=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(s.new_email=n==null?void 0:n.newEmail,delete s.newEmail),await H(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:jO,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(V(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await H(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Wr})}catch(r){if(V(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,s,i,o,a,l;try{const u={nextPage:null,lastPage:0,total:0},c=await H(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(i=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:lm});if(c.error)throw c.error;const h=await c.json(),f=(o=c.headers.get("x-total-count"))!==null&&o!==void 0?o:0,d=(l=(a=c.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return d.length>0&&(d.forEach(y=>{const g=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(y.split(";")[1].split("=")[1]);u[`${w}Page`]=g}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(V(u))return{data:{users:[]},error:u};throw u}}async getUserById(e){cs(e);try{return await H(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Wr})}catch(r){if(V(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){cs(e);try{return await H(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:Wr})}catch(n){if(V(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){cs(e);try{return await H(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:Wr})}catch(n){if(V(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){cs(e.userId);try{const{data:r,error:n}=await H(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:r,error:n}}catch(r){if(V(r))return{data:null,error:r};throw r}}async _deleteFactor(e){cs(e.userId),cs(e.id);try{return{data:await H(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if(V(r))return{data:null,error:r};throw r}}async _listOAuthClients(e){var r,n,s,i,o,a,l;try{const u={nextPage:null,lastPage:0,total:0},c=await H(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(i=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:lm});if(c.error)throw c.error;const h=await c.json(),f=(o=c.headers.get("x-total-count"))!==null&&o!==void 0?o:0,d=(l=(a=c.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return d.length>0&&(d.forEach(y=>{const g=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(y.split(";")[1].split("=")[1]);u[`${w}Page`]=g}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},h),u),error:null}}catch(u){if(V(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(e){try{return await H(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(V(r))return{data:null,error:r};throw r}}async _getOAuthClient(e){try{return await H(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(V(r))return{data:null,error:r};throw r}}async _updateOAuthClient(e,r){try{return await H(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(V(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{return await H(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(V(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(e){try{return await H(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(V(r))return{data:null,error:r};throw r}}}function um(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}const ds={debug:!!(globalThis&&Aw()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Nw extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class $O extends Nw{}async function LO(t,e,r){ds.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),ds.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async s=>{if(s){ds.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,s.name);try{return await r()}finally{ds.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,s.name)}}else{if(e===0)throw ds.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new $O(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(ds.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null,"  "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}}))}function DO(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function Iw(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function MO(t){return parseInt(t,16)}function UO(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}function FO(t){var e;const{chainId:r,domain:n,expirationTime:s,issuedAt:i=new Date,nonce:o,notBefore:a,requestId:l,resources:u,scheme:c,uri:h,version:f}=t;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!h)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(f!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const d=Iw(t.address),y=c?`${c}://${n}`:n,g=t.statement?`${t.statement}
`:"",w=`${y} wants you to sign in with your Ethereum account:
${d}

${g}`;let m=`URI: ${h}
Version: ${f}
Chain ID: ${r}${o?`
Nonce: ${o}`:""}
Issued At: ${i.toISOString()}`;if(s&&(m+=`
Expiration Time: ${s.toISOString()}`),a&&(m+=`
Not Before: ${a.toISOString()}`),l&&(m+=`
Request ID: ${l}`),u){let p=`
Resources:`;for(const v of u){if(!v||typeof v!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${v}`);p+=`
- ${v}`}m+=p}return`${w}
${m}`}class Re extends Error{constructor({message:e,code:r,cause:n,name:s}){var i;super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=(i=s??(n instanceof Error?n.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=r}}class cl extends Re{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}}function BO({error:t,options:e}){var r,n,s;const{publicKey:i}=e;if(!i)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Re({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((r=i.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new Re({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((n=i.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new Re({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((s=i.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new Re({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new Re({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new Re({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return i.pubKeyCredParams.filter(a=>a.type==="public-key").length===0?new Re({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new Re({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const o=window.location.hostname;if($w(o)){if(i.rp.id!==o)return new Re({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Re({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new Re({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new Re({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new Re({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function zO({error:t,options:e}){const{publicKey:r}=e;if(!r)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Re({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new Re({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const n=window.location.hostname;if($w(n)){if(r.rpId!==n)return new Re({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Re({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new Re({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new Re({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class VO{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const WO=new VO;function HO(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:r,excludeCredentials:n}=t,s=hi(t,["challenge","user","excludeCredentials"]),i=Ds(e).buffer,o=Object.assign(Object.assign({},r),{id:Ds(r.id).buffer}),a=Object.assign(Object.assign({},s),{challenge:i,user:o});if(n&&n.length>0){a.excludeCredentials=new Array(n.length);for(let l=0;l<n.length;l++){const u=n[l];a.excludeCredentials[l]=Object.assign(Object.assign({},u),{id:Ds(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return a}function qO(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:r}=t,n=hi(t,["challenge","allowCredentials"]),s=Ds(e).buffer,i=Object.assign(Object.assign({},n),{challenge:s});if(r&&r.length>0){i.allowCredentials=new Array(r.length);for(let o=0;o<r.length;o++){const a=r[o];i.allowCredentials[o]=Object.assign(Object.assign({},a),{id:Ds(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return i}function KO(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t;return{id:t.id,rawId:t.id,response:{attestationObject:Ln(new Uint8Array(t.response.attestationObject)),clientDataJSON:Ln(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function GO(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t,n=t.getClientExtensionResults(),s=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:Ln(new Uint8Array(s.authenticatorData)),clientDataJSON:Ln(new Uint8Array(s.clientDataJSON)),signature:Ln(new Uint8Array(s.signature)),userHandle:s.userHandle?Ln(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function $w(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function cm(){var t,e;return!!(Me()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function QO(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new cl("Browser returned unexpected credential type",e)}:{data:null,error:new cl("Empty credential response",e)}}catch(e){return{data:null,error:BO({error:e,options:t})}}}async function ZO(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new cl("Browser returned unexpected credential type",e)}:{data:null,error:new cl("Empty credential response",e)}}catch(e){return{data:null,error:zO({error:e,options:t})}}}const JO={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},YO={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function dl(...t){const e=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),r=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),n={};for(const s of t)if(s)for(const i in s){const o=s[i];if(o!==void 0)if(Array.isArray(o))n[i]=o;else if(r(o))n[i]=o;else if(e(o)){const a=n[i];e(a)?n[i]=dl(a,o):n[i]=dl(o)}else n[i]=o}return n}function XO(t,e){return dl(JO,t,e||{})}function eP(t,e){return dl(YO,t,e||{})}class tP{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:r,friendlyName:n,signal:s},i){try{const{data:o,error:a}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!o)return{data:null,error:a};const l=s??WO.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:u}=o.webauthn.credential_options.publicKey;u.name||(u.name=`${u.id}:${n}`),u.displayName||(u.displayName=u.name)}switch(o.webauthn.type){case"create":{const u=XO(o.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:c,error:h}=await QO({publicKey:u,signal:l});return c?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:c}},error:null}:{data:null,error:h}}case"request":{const u=eP(o.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:c,error:h}=await ZO(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:u,signal:l}));return c?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:c}},error:null}:{data:null,error:h}}}}catch(o){return V(o)?{data:null,error:o}:{data:null,error:new jn("Unexpected error in challenge",o)}}}async _verify({challengeId:e,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!r)return{data:null,error:new mo("rpId is required for WebAuthn authentication")};try{if(!cm())return{data:null,error:new jn("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this.challenge({factorId:e,webauthn:{rpId:r,rpOrigins:n},signal:s},{request:i});if(!o)return{data:null,error:a};const{webauthn:l}=o;return this._verify({factorId:e,challengeId:o.challengeId,webauthn:{type:l.type,rpId:r,rpOrigins:n,credential_response:l.credential_response}})}catch(o){return V(o)?{data:null,error:o}:{data:null,error:new jn("Unexpected error in authenticate",o)}}}async _register({friendlyName:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!r)return{data:null,error:new mo("rpId is required for WebAuthn registration")};try{if(!cm())return{data:null,error:new jn("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this._enroll({friendlyName:e});if(!o)return await this.client.mfa.listFactors().then(c=>{var h;return(h=c.data)===null||h===void 0?void 0:h.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===e&&f.status!=="unverified")}).then(c=>c?this.client.mfa.unenroll({factorId:c==null?void 0:c.id}):void 0),{data:null,error:a};const{data:l,error:u}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:s},{create:i});return l?this._verify({factorId:o.id,challengeId:l.challengeId,webauthn:{rpId:r,rpOrigins:n,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:u}}catch(o){return V(o)?{data:null,error:o}:{data:null,error:new jn("Unexpected error in register",o)}}}}DO();const rP={url:YC,storageKey:XC,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:eO,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1};async function dm(t,e,r){return await r()}const hs={};class go{get jwks(){var e,r;return(r=(e=hs[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){hs[this.storageKey]=Object.assign(Object.assign({},hs[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=hs[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){hs[this.storageKey]=Object.assign(Object.assign({},hs[this.storageKey]),{cachedAt:e})}constructor(e){var r,n,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const i=Object.assign(Object.assign({},rP),e);if(this.storageKey=i.storageKey,this.instanceID=(r=go.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,go.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.instanceID>0&&Me()){const o=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(o),this.logDebugMessages&&console.trace(o)}if(this.persistSession=i.persistSession,this.autoRefreshToken=i.autoRefreshToken,this.admin=new IO({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=jw(i.fetch),this.lock=i.lock||dm,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,i.lock?this.lock=i.lock:Me()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=LO:this.lock=dm,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new tP(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(i.storage?this.storage=i.storage:Aw()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=um(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=um(this.memoryStorage)),Me()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Ow}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let r={},n="none";if(Me()&&(r=pO(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),Me()&&this.detectSessionInUrl&&n!=="none"){const{data:s,error:i}=await this._getSessionFromURL(r,n);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),oO(i)){const l=(e=i.details)===null||e===void 0?void 0:e.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:i}}return await this._removeSession(),{error:i}}const{session:o,redirectType:a}=s;return this._debug("#_initialize()","detected session in URL",o,"redirect type",a),await this._saveSession(o),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return V(r)?this._returnResult({error:r}):this._returnResult({error:new jn("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,s;try{const i=await H(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(s=e==null?void 0:e.options)===null||s===void 0?void 0:s.captchaToken}},xform:Lt}),{data:o,error:a}=i;if(a||!o)return this._returnResult({data:{user:null,session:null},error:a});const l=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(i){if(V(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(e){var r,n,s;try{let i;if("email"in e){const{email:c,password:h,options:f}=e;let d=null,y=null;this.flowType==="pkce"&&([d,y]=await us(this.storage,this.storageKey)),i=await H(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:c,password:h,data:(r=f==null?void 0:f.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:d,code_challenge_method:y},xform:Lt})}else if("phone"in e){const{phone:c,password:h,options:f}=e;i=await H(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:c,password:h,data:(n=f==null?void 0:f.data)!==null&&n!==void 0?n:{},channel:(s=f==null?void 0:f.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:Lt})}else throw new da("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return this._returnResult({data:{user:null,session:null},error:a});const l=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(i){if(V(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithPassword(e){try{let r;if("email"in e){const{email:i,password:o,options:a}=e;r=await H(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:am})}else if("phone"in e){const{phone:i,password:o,options:a}=e;r=await H(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:am})}else throw new da("You must provide either an email or phone number and a password");const{data:n,error:s}=r;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!n||!n.session||!n.user){const i=new ls;return this._returnResult({data:{user:null,session:null},error:i})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:s})}catch(r){if(V(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(e){var r,n,s,i;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(s=e.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(i=e.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:r}=e;switch(r){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(e){var r,n,s,i,o,a,l,u,c,h,f;let d,y;if("message"in e)d=e.message,y=e.signature;else{const{chain:g,wallet:w,statement:m,options:p}=e;let v;if(Me())if(typeof w=="object")v=w;else{const j=window;if("ethereum"in j&&typeof j.ethereum=="object"&&"request"in j.ethereum&&typeof j.ethereum.request=="function")v=j.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof w!="object"||!(p!=null&&p.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");v=w}const _=new URL((r=p==null?void 0:p.url)!==null&&r!==void 0?r:window.location.href),x=await v.request({method:"eth_requestAccounts"}).then(j=>j).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!x||x.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const E=Iw(x[0]);let k=(n=p==null?void 0:p.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!k){const j=await v.request({method:"eth_chainId"});k=MO(j)}const O={domain:_.host,address:E,statement:m,uri:_.href,version:"1",chainId:k,nonce:(s=p==null?void 0:p.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(o=(i=p==null?void 0:p.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(a=p==null?void 0:p.signInWithEthereum)===null||a===void 0?void 0:a.expirationTime,notBefore:(l=p==null?void 0:p.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(u=p==null?void 0:p.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(c=p==null?void 0:p.signInWithEthereum)===null||c===void 0?void 0:c.resources};d=FO(O),y=await v.request({method:"personal_sign",params:[UO(d),E]})}try{const{data:g,error:w}=await H(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:d,signature:y},!((h=e.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(f=e.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:Lt});if(w)throw w;if(!g||!g.session||!g.user){const m=new ls;return this._returnResult({data:{user:null,session:null},error:m})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:w})}catch(g){if(V(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(e){var r,n,s,i,o,a,l,u,c,h,f,d;let y,g;if("message"in e)y=e.message,g=e.signature;else{const{chain:w,wallet:m,statement:p,options:v}=e;let _;if(Me())if(typeof m=="object")_=m;else{const E=window;if("solana"in E&&typeof E.solana=="object"&&("signIn"in E.solana&&typeof E.solana.signIn=="function"||"signMessage"in E.solana&&typeof E.solana.signMessage=="function"))_=E.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof m!="object"||!(v!=null&&v.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");_=m}const x=new URL((r=v==null?void 0:v.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in _&&_.signIn){const E=await _.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},v==null?void 0:v.signInWithSolana),{version:"1",domain:x.host,uri:x.href}),p?{statement:p}:null));let k;if(Array.isArray(E)&&E[0]&&typeof E[0]=="object")k=E[0];else if(E&&typeof E=="object"&&"signedMessage"in E&&"signature"in E)k=E;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in k&&"signature"in k&&(typeof k.signedMessage=="string"||k.signedMessage instanceof Uint8Array)&&k.signature instanceof Uint8Array)y=typeof k.signedMessage=="string"?k.signedMessage:new TextDecoder().decode(k.signedMessage),g=k.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in _)||typeof _.signMessage!="function"||!("publicKey"in _)||typeof _!="object"||!_.publicKey||!("toBase58"in _.publicKey)||typeof _.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");y=[`${x.host} wants you to sign in with your Solana account:`,_.publicKey.toBase58(),...p?["",p,""]:[""],"Version: 1",`URI: ${x.href}`,`Issued At: ${(s=(n=v==null?void 0:v.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((i=v==null?void 0:v.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${v.signInWithSolana.notBefore}`]:[],...!((o=v==null?void 0:v.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${v.signInWithSolana.expirationTime}`]:[],...!((a=v==null?void 0:v.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${v.signInWithSolana.chainId}`]:[],...!((l=v==null?void 0:v.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${v.signInWithSolana.nonce}`]:[],...!((u=v==null?void 0:v.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${v.signInWithSolana.requestId}`]:[],...!((h=(c=v==null?void 0:v.signInWithSolana)===null||c===void 0?void 0:c.resources)===null||h===void 0)&&h.length?["Resources",...v.signInWithSolana.resources.map(k=>`- ${k}`)]:[]].join(`
`);const E=await _.signMessage(new TextEncoder().encode(y),"utf8");if(!E||!(E instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=E}}try{const{data:w,error:m}=await H(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:y,signature:Ln(g)},!((f=e.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(d=e.options)===null||d===void 0?void 0:d.captchaToken}}:null),xform:Lt});if(m)throw m;if(!w||!w.session||!w.user){const p=new ls;return this._returnResult({data:{user:null,session:null},error:p})}return w.session&&(await this._saveSession(w.session),await this._notifyAllSubscribers("SIGNED_IN",w.session)),this._returnResult({data:Object.assign({},w),error:m})}catch(w){if(V(w))return this._returnResult({data:{user:null,session:null},error:w});throw w}}async _exchangeCodeForSession(e){const r=await Tn(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(r??"").split("/");try{const{data:i,error:o}=await H(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:Lt});if(await Dr(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!i||!i.session||!i.user){const a=new ls;return this._returnResult({data:{user:null,session:null,redirectType:null},error:a})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),this._returnResult({data:Object.assign(Object.assign({},i),{redirectType:s??null}),error:o})}catch(i){if(V(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}}async signInWithIdToken(e){try{const{options:r,provider:n,token:s,access_token:i,nonce:o}=e,a=await H(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:s,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:Lt}),{data:l,error:u}=a;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l||!l.session||!l.user){const c=new ls;return this._returnResult({data:{user:null,session:null},error:c})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:u})}catch(r){if(V(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(e){var r,n,s,i,o;try{if("email"in e){const{email:a,options:l}=e;let u=null,c=null;this.flowType==="pkce"&&([u,c]=await us(this.storage,this.storageKey));const{error:h}=await H(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(r=l==null?void 0:l.data)!==null&&r!==void 0?r:{},create_user:(n=l==null?void 0:l.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:u,code_challenge_method:c},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:h})}if("phone"in e){const{phone:a,options:l}=e,{data:u,error:c}=await H(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(s=l==null?void 0:l.data)!==null&&s!==void 0?s:{},create_user:(i=l==null?void 0:l.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(o=l==null?void 0:l.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:c})}throw new da("You must provide either an email or phone number.")}catch(a){if(V(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async verifyOtp(e){var r,n;try{let s,i;"options"in e&&(s=(r=e.options)===null||r===void 0?void 0:r.redirectTo,i=(n=e.options)===null||n===void 0?void 0:n.captchaToken);const{data:o,error:a}=await H(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:Lt});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const l=o.session,u=o.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(s){if(V(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(e){var r,n,s,i,o;try{let a=null,l=null;this.flowType==="pkce"&&([a,l]=await us(this.storage,this.storageKey));const u=await H(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((s=e==null?void 0:e.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:a,code_challenge_method:l}),headers:this.headers,xform:AO});return!((i=u.data)===null||i===void 0)&&i.url&&Me()&&!(!((o=e.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(a){if(V(a))return this._returnResult({data:null,error:a});throw a}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new ct;const{error:s}=await H(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(e){if(V(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const r=`${this.url}/resend`;if("email"in e){const{email:n,type:s,options:i}=e,{error:o}=await H(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in e){const{phone:n,type:s,options:i}=e,{data:o,error:a}=await H(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:a})}throw new da("You must provide either an email or phone number and a type")}catch(r){if(V(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const r=await Tn(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const n=e.expires_at?e.expires_at*1e3-Date.now()<Mu:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){const o=await Tn(this.userStorage,this.storageKey+"-user");o!=null&&o.user?e.user=o.user:e.user=Bu()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};e.user=CO(e.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{session:null},error:i}):this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await H(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Wr}):await this._useSession(async r=>{var n,s,i;const{data:o,error:a}=r;if(a)throw a;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new ct}:await H(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(s=o.session)===null||s===void 0?void 0:s.access_token)!==null&&i!==void 0?i:void 0,xform:Wr})})}catch(r){if(V(r))return iO(r)&&(await this._removeSession(),await Dr(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{const{data:s,error:i}=n;if(i)throw i;if(!s.session)throw new ct;const o=s.session;let a=null,l=null;this.flowType==="pkce"&&e.email!=null&&([a,l]=await us(this.storage,this.storageKey));const{data:u,error:c}=await H(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:l}),jwt:o.access_token,xform:Wr});if(c)throw c;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(n){if(V(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new ct;const r=Date.now()/1e3;let n=r,s=!0,i=null;const{payload:o}=Fu(e.access_token);if(o.exp&&(n=o.exp,s=n<=r),s){const{data:a,error:l}=await this._callRefreshToken(e.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!a)return{data:{user:null,session:null},error:null};i=a}else{const{data:a,error:l}=await this._getUser(e.access_token);if(l)throw l;i={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(r){if(V(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){const{data:o,error:a}=r;if(a)throw a;e=(n=o.session)!==null&&n!==void 0?n:void 0}if(!(e!=null&&e.refresh_token))throw new ct;const{data:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(V(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(e,r){try{if(!Me())throw new ha("No browser detected.");if(e.error||e.error_description||e.error_code)throw new ha(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new em("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new ha("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new em("No code detected.");const{data:p,error:v}=await this._exchangeCodeForSession(e.code);if(v)throw v;const _=new URL(window.location.href);return _.searchParams.delete("code"),window.history.replaceState(window.history.state,"",_.toString()),{data:{session:p.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:s,access_token:i,refresh_token:o,expires_in:a,expires_at:l,token_type:u}=e;if(!i||!a||!o||!u)throw new ha("No session defined in URL");const c=Math.round(Date.now()/1e3),h=parseInt(a);let f=c+h;l&&(f=parseInt(l));const d=f-c;d*1e3<=fs&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${d}s, should have been closer to ${h}s`);const y=f-h;c-y>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",y,f,c):c-y<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",y,f,c);const{data:g,error:w}=await this._getUser(i);if(w)throw w;const m={provider_token:n,provider_refresh_token:s,access_token:i,expires_in:h,expires_at:f,refresh_token:o,token_type:u,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:m,redirectType:e.type},error:null})}catch(n){if(V(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){const r=await Tn(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return this._returnResult({error:i});const o=(n=s.session)===null||n===void 0?void 0:n.access_token;if(o){const{error:a}=await this.admin.signOut(o,e);if(a&&!(sO(a)&&(a.status===404||a.status===401||a.status===403)))return this._returnResult({error:a})}return e!=="others"&&(await this._removeSession(),await Dr(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const r=fO(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,s;try{const{data:{session:i},error:o}=r;if(o)throw o;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",e,"session",i)}catch(i){await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",i),console.error(i)}})}async resetPasswordForEmail(e,r={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await us(this.storage,this.storageKey,!0));try{return await H(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:s,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(i){if(V(i))return this._returnResult({data:null,error:i});throw i}}async getUserIdentities(){var e;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(r){if(V(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var r;try{const{data:n,error:s}=await this._useSession(async i=>{var o,a,l,u,c;const{data:h,error:f}=i;if(f)throw f;const d=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(a=e.options)===null||a===void 0?void 0:a.scopes,queryParams:(l=e.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await H(this.fetch,"GET",d,{headers:this.headers,jwt:(c=(u=h.session)===null||u===void 0?void 0:u.access_token)!==null&&c!==void 0?c:void 0})});if(s)throw s;return Me()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:e.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(V(n))return this._returnResult({data:{provider:e.provider,url:null},error:n});throw n}}async linkIdentityIdToken(e){return await this._useSession(async r=>{var n;try{const{error:s,data:{session:i}}=r;if(s)throw s;const{options:o,provider:a,token:l,access_token:u,nonce:c}=e,h=await H(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=i==null?void 0:i.access_token)!==null&&n!==void 0?n:void 0,body:{provider:a,id_token:l,access_token:u,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:Lt}),{data:f,error:d}=h;return d?this._returnResult({data:{user:null,session:null},error:d}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new ls}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:d}))}catch(s){if(V(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,s;const{data:i,error:o}=r;if(o)throw o;return await H(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(s=(n=i.session)===null||n===void 0?void 0:n.access_token)!==null&&s!==void 0?s:void 0})})}catch(r){if(V(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(e){const r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await vO(async s=>(s>0&&await gO(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await H(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Lt})),(s,i)=>{const o=200*Math.pow(2,s);return i&&Uu(i)&&Date.now()+o-n<fs})}catch(n){if(this._debug(r,"error",n),V(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),Me()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const s=await Tn(this.storage,this.storageKey);if(s&&this.userStorage){let o=await Tn(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:s.user},await ps(this.userStorage,this.storageKey+"-user",o)),s.user=(e=o==null?void 0:o.user)!==null&&e!==void 0?e:Bu()}else if(s&&!s.user&&!s.user){const o=await Tn(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(s.user=o.user,await Dr(this.storage,this.storageKey+"-user"),await ps(this.storage,this.storageKey,s)):s.user=Bu()}if(this._debug(n,"session from storage",s),!this._isValidSession(s)){this._debug(n,"session is not valid"),s!==null&&await this._removeSession();return}const i=((r=s.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<Mu;if(this._debug(n,`session has${i?"":" not"} expired with margin of ${Mu}s`),i){if(this.autoRefreshToken&&s.refresh_token){const{error:o}=await this._callRefreshToken(s.refresh_token);o&&(console.error(o),Uu(o)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:a}=await this._getUser(s.access_token);!a&&(o!=null&&o.user)?(s.user=o.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(n,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(n,"error",s),console.error(s);return}finally{this._debug(n,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new ct;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new Ql;const{data:i,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!i.session)throw new ct;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const a={data:i.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(i){if(this._debug(s,"error",i),V(i)){const o={data:null,error:i};return Uu(i)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(o),o}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(i),i}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(e,r,n=!0){const s=`#_notifyAllSubscribers(${e})`;this._debug(s,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(e,r)}catch(l){i.push(l)}});if(await Promise.all(o),i.length>0){for(let a=0;a<i.length;a+=1)console.error(i[a]);throw i[0]}}finally{this._debug(s,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0;const r=Object.assign({},e),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await ps(this.userStorage,this.storageKey+"-user",{user:r.user});const s=Object.assign({},r);delete s.user;const i=im(s);await ps(this.storage,this.storageKey,i)}else{const s=im(r);await ps(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),await Dr(this.storage,this.storageKey),await Dr(this.storage,this.storageKey+"-code-verifier"),await Dr(this.storage,this.storageKey+"-user"),this.userStorage&&await Dr(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Me()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),fs);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-e)/fs);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${fs}ms, refresh threshold is ${ud} ticks`),s<=ud&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof Nw)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Me()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){const s=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&s.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&s.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[i,o]=await us(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});s.push(a.toString())}if(n!=null&&n.queryParams){const i=new URLSearchParams(n.queryParams);s.push(i.toString())}return n!=null&&n.skipBrowserRedirect&&s.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${s.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;return i?this._returnResult({data:null,error:i}):await H(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(V(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,s;const{data:i,error:o}=r;if(o)return this._returnResult({data:null,error:o});const a=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:l,error:u}=await H(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(e.factorType==="totp"&&l.type==="totp"&&(!((s=l==null?void 0:l.totp)===null||s===void 0)&&s.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(r){if(V(r))return this._returnResult({data:null,error:r});throw r}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?KO(e.webauthn.credential_response):GO(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:l}=await H(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:o,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),this._returnResult({data:a,error:l}))})}catch(r){if(V(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return this._returnResult({data:null,error:i});const o=await H(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});if(o.error)return o;const{data:a}=o;if(a.type!=="webauthn")return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:HO(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:qO(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(V(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(e){const{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){var e;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const s={all:[],phone:[],totp:[],webauthn:[]};for(const i of(e=r==null?void 0:r.factors)!==null&&e!==void 0?e:[])s.all.push(i),i.status==="verified"&&s[i.factor_type].push(i);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(){var e,r;const{data:{session:n},error:s}=await this.getSession();if(s)return this._returnResult({data:null,error:s});if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:i}=Fu(n.access_token);let o=null;i.aal&&(o=i.aal);let a=o;((r=(e=n.user.factors)===null||e===void 0?void 0:e.filter(c=>c.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(a="aal2");const u=i.amr||[];return{data:{currentLevel:o,nextLevel:a,currentAuthenticationMethods:u},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?await H(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new ct})})}catch(r){if(V(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:s},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new ct});const o=await H(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&Me()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(V(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:s},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new ct});const o=await H(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:a=>({data:a,error:null})});return o.data&&o.data.redirect_url&&Me()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(V(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;return n?this._returnResult({data:null,error:n}):r?await H(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new ct})})}catch(e){if(V(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?(await H(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new ct})})}catch(r){if(V(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(e,r={keys:[]}){let n=r.keys.find(a=>a.kid===e);if(n)return n;const s=Date.now();if(n=this.jwks.keys.find(a=>a.kid===e),n&&this.jwks_cached_at+rO>s)return n;const{data:i,error:o}=await H(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=s,n=i.keys.find(a=>a.kid===e),!n)?null:n}async getClaims(e,r={}){try{let n=e;if(!n){const{data:d,error:y}=await this.getSession();if(y||!d.session)return this._returnResult({data:null,error:y});n=d.session.access_token}const{header:s,payload:i,signature:o,raw:{header:a,payload:l}}=Fu(n);r!=null&&r.allowExpired||EO(i.exp);const u=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!u){const{error:d}=await this.getUser(n);if(d)throw d;return{data:{claims:i,header:s,signature:o},error:null}}const c=kO(s.alg),h=await crypto.subtle.importKey("jwk",u,c,!0,["verify"]);if(!await crypto.subtle.verify(c,h,o,dO(`${a}.${l}`)))throw new hd("Invalid JWT signature");return{data:{claims:i,header:s,signature:o},error:null}}catch(n){if(V(n))return this._returnResult({data:null,error:n});throw n}}}go.nextInstanceID={};const nP=go;class sP extends nP{constructor(e){super(e)}}class iP{constructor(e,r,n){var s,i,o;this.supabaseUrl=e,this.supabaseKey=r;const a=JC(e);if(!r)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const l=`sb-${a.hostname.split(".")[0]}-auth-token`,u={db:VC,realtime:HC,auth:Object.assign(Object.assign({},WC),{storageKey:l}),global:zC},c=ZC(n??{},u);this.storageKey=(s=c.auth.storageKey)!==null&&s!==void 0?s:"",this.headers=(i=c.global.headers)!==null&&i!==void 0?i:{},c.accessToken?(this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(h,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=c.auth)!==null&&o!==void 0?o:{},this.headers,c.global.fetch),this.fetch=GC(r,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.accessToken&&this.accessToken().then(h=>this.realtime.setAuth(h)).catch(h=>console.warn("Failed to set initial Realtime auth token:",h)),this.rest=new HT(new URL("rest/v1",a).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),this.storage=new UC(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new zT(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,r,n)}channel(e,r={config:{}}){return this.realtime.channel(e,r)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e,r;if(this.accessToken)return await this.accessToken();const{data:n}=await this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:s,userStorage:i,storageKey:o,flowType:a,lock:l,debug:u,throwOnError:c},h,f){const d={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new sP({url:this.authUrl.href,headers:Object.assign(Object.assign({},d),h),storageKey:o,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:s,userStorage:i,flowType:a,lock:l,debug:u,throwOnError:c,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(y=>y.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new lC(this.realtimeUrl.href,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n==null?void 0:n.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const oP=(t,e,r)=>new iP(t,e,r);function aP(){if(typeof window<"u"||typeof process>"u")return!1;const t=process.version;if(t==null)return!1;const e=t.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}aP()&&console.warn("⚠️  Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const lP="https://qqrbyogacgtfzaauuzpa.supabase.co",uP="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InFxcmJ5b2dhY2d0ZnphYXV1enBhIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjQ3NTg0NjksImV4cCI6MjA4MDMzNDQ2OX0.iGk8HUI_OToehTyQduWuBATBBqWynicRxVuZy0BpIK0",cP=oP(lP,uP,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}});var ce;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),o={};for(const a of i)o[a]=s[a];return t.objectValues(o)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},t.find=(s,i)=>{for(const o of s)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(ce||(ce={}));var hm;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(hm||(hm={}));const B=ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Br=t=>{switch(typeof t){case"undefined":return B.undefined;case"string":return B.string;case"number":return Number.isNaN(t)?B.nan:B.number;case"boolean":return B.boolean;case"function":return B.function;case"bigint":return B.bigint;case"symbol":return B.symbol;case"object":return Array.isArray(t)?B.array:t===null?B.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?B.promise:typeof Map<"u"&&t instanceof Map?B.map:typeof Set<"u"&&t instanceof Set?B.set:typeof Date<"u"&&t instanceof Date?B.date:B.object;default:return B.unknown}},A=ce.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"]);class kr extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(i){return i.message},n={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let a=n,l=0;for(;l<o.path.length;){const u=o.path[l];l===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(o))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return s(this),n}static assert(e){if(!(e instanceof kr))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ce.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];r[i]=r[i]||[],r[i].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}kr.create=t=>new kr(t);const fd=(t,e)=>{let r;switch(t.code){case A.invalid_type:t.received===B.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case A.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ce.jsonStringifyReplacer)}`;break;case A.unrecognized_keys:r=`Unrecognized key(s) in object: ${ce.joinValues(t.keys,", ")}`;break;case A.invalid_union:r="Invalid input";break;case A.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ce.joinValues(t.options)}`;break;case A.invalid_enum_value:r=`Invalid enum value. Expected ${ce.joinValues(t.options)}, received '${t.received}'`;break;case A.invalid_arguments:r="Invalid function arguments";break;case A.invalid_return_type:r="Invalid function return type";break;case A.invalid_date:r="Invalid date";break;case A.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ce.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case A.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case A.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case A.custom:r="Invalid input";break;case A.invalid_intersection_types:r="Intersection results could not be merged";break;case A.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case A.not_finite:r="Number must be finite";break;default:r=e.defaultError,ce.assertNever(t)}return{message:r}};let dP=fd;function hP(){return dP}const fP=t=>{const{data:e,path:r,errorMaps:n,issueData:s}=t,i=[...r,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)a=u(o,{data:e,defaultError:a}).message;return{...s,path:i,message:a}};function L(t,e){const r=hP(),n=fP({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===fd?void 0:fd].filter(s=>!!s)});t.common.issues.push(n)}class wt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const s of r){if(s.status==="aborted")return G;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const s of r){const i=await s.key,o=await s.value;n.push({key:i,value:o})}return wt.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const s of r){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return G;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}}const G=Object.freeze({status:"aborted"}),ji=t=>({status:"dirty",value:t}),Rt=t=>({status:"valid",value:t}),fm=t=>t.status==="aborted",pm=t=>t.status==="dirty",ri=t=>t.status==="valid",hl=t=>typeof Promise<"u"&&t instanceof Promise;var z;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(z||(z={}));class gn{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const mm=(t,e)=>{if(ri(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new kr(t.common.issues);return this._error=r,this._error}}};function re(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(o,a)=>{const{message:l}=t;return o.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??n??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:l??r??a.defaultError}},description:s}}class le{get description(){return this._def.description}_getType(e){return Br(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Br(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new wt,ctx:{common:e.parent.common,data:e.data,parsedType:Br(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(hl(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Br(e)},s=this._parseSync({data:e,path:n.path,parent:n});return mm(n,s)}"~validate"(e){var n,s;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Br(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:r});return ri(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(s=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(i=>ri(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Br(e)},s=this._parse({data:e,path:n.path,parent:n}),i=await(hl(s)?s:Promise.resolve(s));return mm(n,i)}refine(e,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{const o=e(s),a=()=>i.addIssue({code:A.custom,...n(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new si({schema:this,typeName:Q.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,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),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return un.create(this,this._def)}nullable(){return ii.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ar.create(this)}promise(){return gl.create(this,this._def)}or(e){return pl.create([this,e],this._def)}and(e){return ml.create(this,e,this._def)}transform(e){return new si({...re(this._def),schema:this,typeName:Q.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new md({...re(this._def),innerType:this,defaultValue:r,typeName:Q.ZodDefault})}brand(){return new LP({typeName:Q.ZodBranded,type:this,...re(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new gd({...re(this._def),innerType:this,catchValue:r,typeName:Q.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Mh.create(this,e)}readonly(){return vd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const pP=/^c[^\s-]{8,}$/i,mP=/^[0-9a-z]+$/,gP=/^[0-9A-HJKMNP-TV-Z]{26}$/i,vP=/^[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,yP=/^[a-z0-9_-]{21}$/i,wP=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,_P=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,bP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,xP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Vu;const SP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,EP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,kP=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,TP=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,CP=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,OP=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Lw="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",PP=new RegExp(`^${Lw}$`);function Dw(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function RP(t){return new RegExp(`^${Dw(t)}$`)}function AP(t){let e=`${Lw}T${Dw(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function jP(t,e){return!!((e==="v4"||!e)&&SP.test(t)||(e==="v6"||!e)&&kP.test(t))}function NP(t,e){if(!wP.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function IP(t,e){return!!((e==="v4"||!e)&&EP.test(t)||(e==="v6"||!e)&&TP.test(t))}class Xr extends le{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==B.string){const i=this._getOrReturnCtx(e);return L(i,{code:A.invalid_type,expected:B.string,received:i.parsedType}),G}const n=new wt;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),L(s,{code:A.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),L(s,{code:A.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,a=e.data.length<i.value;(o||a)&&(s=this._getOrReturnCtx(e,s),o?L(s,{code:A.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&L(s,{code:A.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")bP.test(e.data)||(s=this._getOrReturnCtx(e,s),L(s,{validation:"email",code:A.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Vu||(Vu=new RegExp(xP,"u")),Vu.test(e.data)||(s=this._getOrReturnCtx(e,s),L(s,{validation:"emoji",code:A.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")vP.test(e.data)||(s=this._getOrReturnCtx(e,s),L(s,{validation:"uuid",code:A.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")yP.test(e.data)||(s=this._getOrReturnCtx(e,s),L(s,{validation:"nanoid",code:A.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")pP.test(e.data)||(s=this._getOrReturnCtx(e,s),L(s,{validation:"cuid",code:A.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")mP.test(e.data)||(s=this._getOrReturnCtx(e,s),L(s,{validation:"cuid2",code:A.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")gP.test(e.data)||(s=this._getOrReturnCtx(e,s),L(s,{validation:"ulid",code:A.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),L(s,{validation:"url",code:A.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),L(s,{validation:"regex",code:A.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),L(s,{code:A.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),L(s,{code:A.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),L(s,{code:A.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?AP(i).test(e.data)||(s=this._getOrReturnCtx(e,s),L(s,{code:A.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?PP.test(e.data)||(s=this._getOrReturnCtx(e,s),L(s,{code:A.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?RP(i).test(e.data)||(s=this._getOrReturnCtx(e,s),L(s,{code:A.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?_P.test(e.data)||(s=this._getOrReturnCtx(e,s),L(s,{validation:"duration",code:A.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?jP(e.data,i.version)||(s=this._getOrReturnCtx(e,s),L(s,{validation:"ip",code:A.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?NP(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),L(s,{validation:"jwt",code:A.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?IP(e.data,i.version)||(s=this._getOrReturnCtx(e,s),L(s,{validation:"cidr",code:A.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?CP.test(e.data)||(s=this._getOrReturnCtx(e,s),L(s,{validation:"base64",code:A.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?OP.test(e.data)||(s=this._getOrReturnCtx(e,s),L(s,{validation:"base64url",code:A.invalid_string,message:i.message}),n.dirty()):ce.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:A.invalid_string,...z.errToObj(n)})}_addCheck(e){return new Xr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...z.errToObj(e)})}url(e){return this._addCheck({kind:"url",...z.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...z.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...z.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...z.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...z.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...z.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...z.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...z.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...z.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...z.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...z.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...z.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...z.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...z.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...z.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...z.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...z.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...z.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...z.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...z.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...z.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...z.errToObj(r)})}nonempty(e){return this.min(1,z.errToObj(e))}trim(){return new Xr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Xr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Xr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Xr.create=t=>new Xr({checks:[],typeName:Q.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...re(t)});function $P(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,i=Number.parseInt(t.toFixed(s).replace(".","")),o=Number.parseInt(e.toFixed(s).replace(".",""));return i%o/10**s}class vo extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==B.number){const i=this._getOrReturnCtx(e);return L(i,{code:A.invalid_type,expected:B.number,received:i.parsedType}),G}let n;const s=new wt;for(const i of this._def.checks)i.kind==="int"?ce.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{code:A.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),L(n,{code:A.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),L(n,{code:A.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?$P(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),L(n,{code:A.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{code:A.not_finite,message:i.message}),s.dirty()):ce.assertNever(i);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,z.toString(r))}gt(e,r){return this.setLimit("min",e,!1,z.toString(r))}lte(e,r){return this.setLimit("max",e,!0,z.toString(r))}lt(e,r){return this.setLimit("max",e,!1,z.toString(r))}setLimit(e,r,n,s){return new vo({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:z.toString(s)}]})}_addCheck(e){return new vo({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:z.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:z.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:z.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:z.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:z.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:z.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ce.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}vo.create=t=>new vo({checks:[],typeName:Q.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...re(t)});class yo extends le{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==B.bigint)return this._getInvalidInput(e);let n;const s=new wt;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),L(n,{code:A.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),L(n,{code:A.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),L(n,{code:A.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):ce.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return L(r,{code:A.invalid_type,expected:B.bigint,received:r.parsedType}),G}gte(e,r){return this.setLimit("min",e,!0,z.toString(r))}gt(e,r){return this.setLimit("min",e,!1,z.toString(r))}lte(e,r){return this.setLimit("max",e,!0,z.toString(r))}lt(e,r){return this.setLimit("max",e,!1,z.toString(r))}setLimit(e,r,n,s){return new yo({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:z.toString(s)}]})}_addCheck(e){return new yo({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:z.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:z.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}yo.create=t=>new yo({checks:[],typeName:Q.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...re(t)});class gm extends le{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==B.boolean){const n=this._getOrReturnCtx(e);return L(n,{code:A.invalid_type,expected:B.boolean,received:n.parsedType}),G}return Rt(e.data)}}gm.create=t=>new gm({typeName:Q.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...re(t)});class fl extends le{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==B.date){const i=this._getOrReturnCtx(e);return L(i,{code:A.invalid_type,expected:B.date,received:i.parsedType}),G}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return L(i,{code:A.invalid_date}),G}const n=new wt;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),L(s,{code:A.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),L(s,{code:A.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):ce.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new fl({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:z.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:z.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}fl.create=t=>new fl({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Q.ZodDate,...re(t)});class vm extends le{_parse(e){if(this._getType(e)!==B.symbol){const n=this._getOrReturnCtx(e);return L(n,{code:A.invalid_type,expected:B.symbol,received:n.parsedType}),G}return Rt(e.data)}}vm.create=t=>new vm({typeName:Q.ZodSymbol,...re(t)});class ym extends le{_parse(e){if(this._getType(e)!==B.undefined){const n=this._getOrReturnCtx(e);return L(n,{code:A.invalid_type,expected:B.undefined,received:n.parsedType}),G}return Rt(e.data)}}ym.create=t=>new ym({typeName:Q.ZodUndefined,...re(t)});class wm extends le{_parse(e){if(this._getType(e)!==B.null){const n=this._getOrReturnCtx(e);return L(n,{code:A.invalid_type,expected:B.null,received:n.parsedType}),G}return Rt(e.data)}}wm.create=t=>new wm({typeName:Q.ZodNull,...re(t)});class _m extends le{constructor(){super(...arguments),this._any=!0}_parse(e){return Rt(e.data)}}_m.create=t=>new _m({typeName:Q.ZodAny,...re(t)});class bm extends le{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Rt(e.data)}}bm.create=t=>new bm({typeName:Q.ZodUnknown,...re(t)});class vn extends le{_parse(e){const r=this._getOrReturnCtx(e);return L(r,{code:A.invalid_type,expected:B.never,received:r.parsedType}),G}}vn.create=t=>new vn({typeName:Q.ZodNever,...re(t)});class xm extends le{_parse(e){if(this._getType(e)!==B.undefined){const n=this._getOrReturnCtx(e);return L(n,{code:A.invalid_type,expected:B.void,received:n.parsedType}),G}return Rt(e.data)}}xm.create=t=>new xm({typeName:Q.ZodVoid,...re(t)});class ar extends le{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==B.array)return L(r,{code:A.invalid_type,expected:B.array,received:r.parsedType}),G;if(s.exactLength!==null){const o=r.data.length>s.exactLength.value,a=r.data.length<s.exactLength.value;(o||a)&&(L(r,{code:o?A.too_big:A.too_small,minimum:a?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(L(r,{code:A.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(L(r,{code:A.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,a)=>s.type._parseAsync(new gn(r,o,r.path,a)))).then(o=>wt.mergeArray(n,o));const i=[...r.data].map((o,a)=>s.type._parseSync(new gn(r,o,r.path,a)));return wt.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new ar({...this._def,minLength:{value:e,message:z.toString(r)}})}max(e,r){return new ar({...this._def,maxLength:{value:e,message:z.toString(r)}})}length(e,r){return new ar({...this._def,exactLength:{value:e,message:z.toString(r)}})}nonempty(e){return this.min(1,e)}}ar.create=(t,e)=>new ar({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Q.ZodArray,...re(e)});function ms(t){if(t instanceof Te){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=un.create(ms(n))}return new Te({...t._def,shape:()=>e})}else return t instanceof ar?new ar({...t._def,type:ms(t.element)}):t instanceof un?un.create(ms(t.unwrap())):t instanceof ii?ii.create(ms(t.unwrap())):t instanceof Jn?Jn.create(t.items.map(e=>ms(e))):t}class Te extends le{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=ce.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==B.object){const u=this._getOrReturnCtx(e);return L(u,{code:A.invalid_type,expected:B.object,received:u.parsedType}),G}const{status:n,ctx:s}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof vn&&this._def.unknownKeys==="strip"))for(const u in s.data)o.includes(u)||a.push(u);const l=[];for(const u of o){const c=i[u],h=s.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new gn(s,h,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof vn){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of a)l.push({key:{status:"valid",value:c},value:{status:"valid",value:s.data[c]}});else if(u==="strict")a.length>0&&(L(s,{code:A.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of a){const h=s.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new gn(s,h,s.path,c)),alwaysSet:c in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const h=await c.key,f=await c.value;u.push({key:h,value:f,alwaysSet:c.alwaysSet})}return u}).then(u=>wt.mergeObjectSync(n,u)):wt.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return z.errToObj,new Te({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,o;const s=((o=(i=this._def).errorMap)==null?void 0:o.call(i,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:z.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new Te({...this._def,unknownKeys:"strip"})}passthrough(){return new Te({...this._def,unknownKeys:"passthrough"})}extend(e){return new Te({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Te({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Q.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Te({...this._def,catchall:e})}pick(e){const r={};for(const n of ce.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Te({...this._def,shape:()=>r})}omit(e){const r={};for(const n of ce.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new Te({...this._def,shape:()=>r})}deepPartial(){return ms(this)}partial(e){const r={};for(const n of ce.objectKeys(this.shape)){const s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}return new Te({...this._def,shape:()=>r})}required(e){const r={};for(const n of ce.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof un;)i=i._def.innerType;r[n]=i}return new Te({...this._def,shape:()=>r})}keyof(){return Mw(ce.objectKeys(this.shape))}}Te.create=(t,e)=>new Te({shape:()=>t,unknownKeys:"strip",catchall:vn.create(),typeName:Q.ZodObject,...re(e)});Te.strictCreate=(t,e)=>new Te({shape:()=>t,unknownKeys:"strict",catchall:vn.create(),typeName:Q.ZodObject,...re(e)});Te.lazycreate=(t,e)=>new Te({shape:t,unknownKeys:"strip",catchall:vn.create(),typeName:Q.ZodObject,...re(e)});class pl extends le{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function s(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(a=>new kr(a.ctx.common.issues));return L(r,{code:A.invalid_union,unionErrors:o}),G}if(r.common.async)return Promise.all(n.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const l of n){const u={...r,common:{...r.common,issues:[]},parent:null},c=l._parseSync({data:r.data,path:r.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!i&&(i={result:c,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const a=o.map(l=>new kr(l));return L(r,{code:A.invalid_union,unionErrors:a}),G}}get options(){return this._def.options}}pl.create=(t,e)=>new pl({options:t,typeName:Q.ZodUnion,...re(e)});function pd(t,e){const r=Br(t),n=Br(e);if(t===e)return{valid:!0,data:t};if(r===B.object&&n===B.object){const s=ce.objectKeys(e),i=ce.objectKeys(t).filter(a=>s.indexOf(a)!==-1),o={...t,...e};for(const a of i){const l=pd(t[a],e[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(r===B.array&&n===B.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const o=t[i],a=e[i],l=pd(o,a);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return r===B.date&&n===B.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class ml extends le{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),s=(i,o)=>{if(fm(i)||fm(o))return G;const a=pd(i.value,o.value);return a.valid?((pm(i)||pm(o))&&r.dirty(),{status:r.value,value:a.data}):(L(n,{code:A.invalid_intersection_types}),G)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}ml.create=(t,e,r)=>new ml({left:t,right:e,typeName:Q.ZodIntersection,...re(r)});class Jn extends le{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==B.array)return L(n,{code:A.invalid_type,expected:B.array,received:n.parsedType}),G;if(n.data.length<this._def.items.length)return L(n,{code:A.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),G;!this._def.rest&&n.data.length>this._def.items.length&&(L(n,{code:A.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new gn(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>wt.mergeArray(r,o)):wt.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new Jn({...this._def,rest:e})}}Jn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Jn({items:t,typeName:Q.ZodTuple,rest:null,...re(e)})};class Sm extends le{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==B.map)return L(n,{code:A.invalid_type,expected:B.map,received:n.parsedType}),G;const s=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([a,l],u)=>({key:s._parse(new gn(n,a,n.path,[u,"key"])),value:i._parse(new gn(n,l,n.path,[u,"value"]))}));if(n.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return G;(u.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(u.value,c.value)}return{status:r.value,value:a}})}else{const a=new Map;for(const l of o){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return G;(u.status==="dirty"||c.status==="dirty")&&r.dirty(),a.set(u.value,c.value)}return{status:r.value,value:a}}}}Sm.create=(t,e,r)=>new Sm({valueType:e,keyType:t,typeName:Q.ZodMap,...re(r)});class wo extends le{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==B.set)return L(n,{code:A.invalid_type,expected:B.set,received:n.parsedType}),G;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(L(n,{code:A.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(L(n,{code:A.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const i=this._def.valueType;function o(l){const u=new Set;for(const c of l){if(c.status==="aborted")return G;c.status==="dirty"&&r.dirty(),u.add(c.value)}return{status:r.value,value:u}}const a=[...n.data.values()].map((l,u)=>i._parse(new gn(n,l,n.path,u)));return n.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(e,r){return new wo({...this._def,minSize:{value:e,message:z.toString(r)}})}max(e,r){return new wo({...this._def,maxSize:{value:e,message:z.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}wo.create=(t,e)=>new wo({valueType:t,minSize:null,maxSize:null,typeName:Q.ZodSet,...re(e)});class Em extends le{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Em.create=(t,e)=>new Em({getter:t,typeName:Q.ZodLazy,...re(e)});class km extends le{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return L(r,{received:r.data,code:A.invalid_literal,expected:this._def.value}),G}return{status:"valid",value:e.data}}get value(){return this._def.value}}km.create=(t,e)=>new km({value:t,typeName:Q.ZodLiteral,...re(e)});function Mw(t,e){return new ni({values:t,typeName:Q.ZodEnum,...re(e)})}class ni extends le{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return L(r,{expected:ce.joinValues(n),received:r.parsedType,code:A.invalid_type}),G}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return L(r,{received:r.data,code:A.invalid_enum_value,options:n}),G}return Rt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return ni.create(e,{...this._def,...r})}exclude(e,r=this._def){return ni.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}ni.create=Mw;class Tm extends le{_parse(e){const r=ce.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==B.string&&n.parsedType!==B.number){const s=ce.objectValues(r);return L(n,{expected:ce.joinValues(s),received:n.parsedType,code:A.invalid_type}),G}if(this._cache||(this._cache=new Set(ce.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=ce.objectValues(r);return L(n,{received:n.data,code:A.invalid_enum_value,options:s}),G}return Rt(e.data)}get enum(){return this._def.values}}Tm.create=(t,e)=>new Tm({values:t,typeName:Q.ZodNativeEnum,...re(e)});class gl extends le{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==B.promise&&r.common.async===!1)return L(r,{code:A.invalid_type,expected:B.promise,received:r.parsedType}),G;const n=r.parsedType===B.promise?r.data:Promise.resolve(r.data);return Rt(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}gl.create=(t,e)=>new gl({type:t,typeName:Q.ZodPromise,...re(e)});class si extends le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Q.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:o=>{L(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async a=>{if(r.value==="aborted")return G;const l=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return l.status==="aborted"?G:l.status==="dirty"||r.value==="dirty"?ji(l.value):l});{if(r.value==="aborted")return G;const a=this._def.schema._parseSync({data:o,path:n.path,parent:n});return a.status==="aborted"?G:a.status==="dirty"||r.value==="dirty"?ji(a.value):a}}if(s.type==="refinement"){const o=a=>{const l=s.refinement(a,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?G:(a.status==="dirty"&&r.dirty(),o(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?G:(a.status==="dirty"&&r.dirty(),o(a.value).then(()=>({status:r.value,value:a.value}))))}if(s.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ri(o))return G;const a=s.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>ri(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:r.value,value:a})):G);ce.assertNever(s)}}si.create=(t,e,r)=>new si({schema:t,typeName:Q.ZodEffects,effect:e,...re(r)});si.createWithPreprocess=(t,e,r)=>new si({schema:e,effect:{type:"preprocess",transform:t},typeName:Q.ZodEffects,...re(r)});class un extends le{_parse(e){return this._getType(e)===B.undefined?Rt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}un.create=(t,e)=>new un({innerType:t,typeName:Q.ZodOptional,...re(e)});class ii extends le{_parse(e){return this._getType(e)===B.null?Rt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ii.create=(t,e)=>new ii({innerType:t,typeName:Q.ZodNullable,...re(e)});class md extends le{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===B.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}md.create=(t,e)=>new md({innerType:t,typeName:Q.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...re(e)});class gd extends le{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return hl(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new kr(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new kr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}gd.create=(t,e)=>new gd({innerType:t,typeName:Q.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...re(e)});class Cm extends le{_parse(e){if(this._getType(e)!==B.nan){const n=this._getOrReturnCtx(e);return L(n,{code:A.invalid_type,expected:B.nan,received:n.parsedType}),G}return{status:"valid",value:e.data}}}Cm.create=t=>new Cm({typeName:Q.ZodNaN,...re(t)});class LP extends le{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Mh extends le{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?G:i.status==="dirty"?(r.dirty(),ji(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?G:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new Mh({in:e,out:r,typeName:Q.ZodPipeline})}}class vd extends le{_parse(e){const r=this._def.innerType._parse(e),n=s=>(ri(s)&&(s.value=Object.freeze(s.value)),s);return hl(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}vd.create=(t,e)=>new vd({innerType:t,typeName:Q.ZodReadonly,...re(e)});Te.lazycreate;var Q;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Q||(Q={}));const Wu=Xr.create;vn.create;ar.create;const DP=Te.create;Te.strictCreate;pl.create;ml.create;Jn.create;ni.create;gl.create;un.create;ii.create;const MP=DP({name:Wu().trim().min(1,"Please enter your name").max(100,"Name must be less than 100 characters"),email:Wu().trim().email("Please enter a valid email").max(255,"Email must be less than 255 characters"),phone:Wu().trim().max(20,"Phone must be less than 20 characters").optional()}),UP=()=>{const[t,e]=b.useState({name:"",email:"",phone:""}),[r,n]=b.useState({}),[s,i]=b.useState(!1),o=l=>{const{name:u,value:c}=l.target;e(h=>({...h,[u]:c})),r[u]&&n(h=>({...h,[u]:""}))},a=async l=>{l.preventDefault(),i(!0);const u=MP.safeParse(t);if(!u.success){const h={};u.error.errors.forEach(f=>{f.path[0]&&(h[f.path[0]]=f.message)}),n(h),i(!1);return}const{error:c}=await cP.from("leads").insert({name:u.data.name,email:u.data.email,phone:u.data.phone||null});if(c){Dc({title:"Something went wrong",description:"Please try again later.",variant:"destructive"}),i(!1);return}Dc({title:"Welcome to KORA!",description:"Thank you for joining us. We'll be in touch soon."}),e({name:"",email:"",phone:""}),i(!1)};return S.jsxs("form",{onSubmit:a,className:"space-y-5",children:[S.jsxs("div",{className:"space-y-2",children:[S.jsxs("label",{htmlFor:"name",className:"block text-sm font-medium text-foreground",children:["Name ",S.jsx("span",{className:"text-primary",children:"*"})]}),S.jsx(Oa,{id:"name",name:"name",type:"text",placeholder:"Your full name",value:t.name,onChange:o,"aria-invalid":!!r.name,"aria-describedby":r.name?"name-error":void 0}),r.name&&S.jsx("p",{id:"name-error",className:"text-sm text-destructive",children:r.name})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsxs("label",{htmlFor:"email",className:"block text-sm font-medium text-foreground",children:["Email ",S.jsx("span",{className:"text-primary",children:"*"})]}),S.jsx(Oa,{id:"email",name:"email",type:"email",placeholder:"your@email.com",value:t.email,onChange:o,"aria-invalid":!!r.email,"aria-describedby":r.email?"email-error":void 0}),r.email&&S.jsx("p",{id:"email-error",className:"text-sm text-destructive",children:r.email})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsxs("label",{htmlFor:"phone",className:"block text-sm font-medium text-foreground",children:["Phone ",S.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),S.jsx(Oa,{id:"phone",name:"phone",type:"tel",placeholder:"Your phone number",value:t.phone,onChange:o,"aria-invalid":!!r.phone,"aria-describedby":r.phone?"phone-error":void 0}),r.phone&&S.jsx("p",{id:"phone-error",className:"text-sm text-destructive",children:r.phone})]}),S.jsx(A0,{type:"submit",variant:"hero",size:"lg",className:"w-full",disabled:s,children:s?"Joining...":"Start Your Journey"}),S.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"By signing up, you agree to receive emails from KORA. We respect your privacy."})]})},FP="/assets/hero-image-CUHzYe5q.jpg",BP=()=>S.jsxs("div",{className:"min-h-screen bg-background",children:[S.jsx("header",{className:"fixed top-0 left-0 right-0 z-50 bg-background/80 backdrop-blur-md border-b border-border/50",children:S.jsx("div",{className:"container mx-auto px-6 py-4",children:S.jsx("h1",{className:"font-display text-2xl font-bold text-foreground tracking-tight",children:"KORA"})})}),S.jsxs("main",{children:[S.jsx("section",{className:"pt-24 pb-16 lg:pt-32 lg:pb-24",children:S.jsx("div",{className:"container mx-auto px-6",children:S.jsxs("div",{className:"grid lg:grid-cols-2 gap-12 lg:gap-16 items-center",children:[S.jsxs("div",{className:"space-y-8 animate-fade-up",children:[S.jsxs("div",{className:"space-y-4",children:[S.jsx("span",{className:"inline-block px-4 py-2 bg-secondary/50 text-secondary-foreground rounded-full text-sm font-medium",children:"Training for Women 50+"}),S.jsx("h2",{className:"font-display text-4xl md:text-5xl lg:text-6xl font-bold text-foreground leading-tight text-balance",children:"Your Strongest Chapter Starts Here"}),S.jsx("p",{className:"text-lg text-muted-foreground max-w-lg",children:"KORA is a fitness community designed exclusively for women over 50. Build strength, confidence, and connection with training programs that celebrate this powerful stage of life."})]}),S.jsxs("div",{className:"grid sm:grid-cols-3 gap-4",children:[S.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl bg-card",children:[S.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:S.jsx(b1,{className:"w-5 h-5 text-primary"})}),S.jsxs("div",{children:[S.jsx("h3",{className:"font-medium text-foreground text-sm",children:"Tailored Programs"}),S.jsx("p",{className:"text-xs text-muted-foreground",children:"Designed for your body"})]})]}),S.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl bg-card",children:[S.jsx("div",{className:"p-2 rounded-lg bg-secondary/50",children:S.jsx(S1,{className:"w-5 h-5 text-secondary-foreground"})}),S.jsxs("div",{children:[S.jsx("h3",{className:"font-medium text-foreground text-sm",children:"Community"}),S.jsx("p",{className:"text-xs text-muted-foreground",children:"Supportive sisterhood"})]})]}),S.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl bg-card",children:[S.jsx("div",{className:"p-2 rounded-lg bg-accent/50",children:S.jsx(x1,{className:"w-5 h-5 text-accent-foreground"})}),S.jsxs("div",{children:[S.jsx("h3",{className:"font-medium text-foreground text-sm",children:"Results"}),S.jsx("p",{className:"text-xs text-muted-foreground",children:"Feel the difference"})]})]})]})]}),S.jsxs("div",{className:"space-y-8",children:[S.jsxs("div",{className:"relative animate-fade-up",style:{animationDelay:"0.2s"},children:[S.jsx("div",{className:"aspect-[4/3] rounded-2xl overflow-hidden shadow-elevated",children:S.jsx("img",{src:FP,alt:"Woman over 50 practicing yoga outdoors, embodying strength and serenity",className:"w-full h-full object-cover"})}),S.jsx("div",{className:"absolute -bottom-4 -left-4 w-24 h-24 bg-secondary rounded-full opacity-60 -z-10"}),S.jsx("div",{className:"absolute -top-4 -right-4 w-16 h-16 bg-primary/20 rounded-full -z-10"})]}),S.jsxs("div",{className:"bg-card rounded-2xl p-8 shadow-soft border border-border/50 animate-fade-up",style:{animationDelay:"0.4s"},children:[S.jsxs("div",{className:"text-center mb-6",children:[S.jsx("h3",{className:"font-display text-2xl font-semibold text-foreground",children:"Join the Movement"}),S.jsx("p",{className:"text-muted-foreground mt-1",children:"Get exclusive updates and early access"})]}),S.jsx(UP,{})]})]})]})})}),S.jsx("section",{className:"py-16 bg-card/50",children:S.jsxs("div",{className:"container mx-auto px-6 text-center",children:[S.jsx("p",{className:"text-muted-foreground text-sm uppercase tracking-widest mb-4",children:"Empowering Women"}),S.jsx("p",{className:"font-display text-2xl md:text-3xl text-foreground max-w-2xl mx-auto",children:`"Age is not a barrier—it's an invitation to discover your full potential."`})]})})]}),S.jsx("footer",{className:"py-8 border-t border-border",children:S.jsx("div",{className:"container mx-auto px-6 text-center",children:S.jsxs("p",{className:"text-sm text-muted-foreground",children:["© ",new Date().getFullYear()," KORA. All rights reserved."]})})})]}),zP=()=>{const t=R0();return b.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),S.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:S.jsxs("div",{className:"text-center",children:[S.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),S.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),S.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},VP=new Kk,WP=()=>S.jsx(Qk,{client:VP,children:S.jsxs(Sk,{children:[S.jsx(oS,{}),S.jsx(MS,{}),S.jsx(IT,{children:S.jsxs(AT,{children:[S.jsx(Yc,{path:"/",element:S.jsx(BP,{})}),S.jsx(Yc,{path:"*",element:S.jsx(zP,{})})]})})]})});Yv(document.getElementById("root")).render(S.jsx(WP,{}));