var zh=t=>{throw TypeError(t)};var lu=(t,e,r)=>e.has(t)||zh("Cannot "+r);var T=(t,e,r)=>(lu(t,e,"read from private field"),r?r.call(t):e.get(t)),ue=(t,e,r)=>e.has(t)?zh("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),Z=(t,e,r,n)=>(lu(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),Ve=(t,e,r)=>(lu(t,e,"access private method"),r);var Vo=(t,e,r,n)=>({set _(s){Z(t,e,s,r)},get _(){return T(t,e,n)}});function aw(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 jm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Im={exports:{}},El={},Lm={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 Oo=Symbol.for("react.element"),lw=Symbol.for("react.portal"),uw=Symbol.for("react.fragment"),cw=Symbol.for("react.strict_mode"),dw=Symbol.for("react.profiler"),hw=Symbol.for("react.provider"),fw=Symbol.for("react.context"),pw=Symbol.for("react.forward_ref"),mw=Symbol.for("react.suspense"),gw=Symbol.for("react.memo"),vw=Symbol.for("react.lazy"),Bh=Symbol.iterator;function yw(t){return t===null||typeof t!="object"?null:(t=Bh&&t[Bh]||t["@@iterator"],typeof t=="function"?t:null)}var $m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Dm=Object.assign,Mm={};function ci(t,e,r){this.props=t,this.context=e,this.refs=Mm,this.updater=r||$m}ci.prototype.isReactComponent={};ci.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")};ci.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function Um(){}Um.prototype=ci.prototype;function yd(t,e,r){this.props=t,this.context=e,this.refs=Mm,this.updater=r||$m}var wd=yd.prototype=new Um;wd.constructor=yd;Dm(wd,ci.prototype);wd.isPureReactComponent=!0;var Vh=Array.isArray,Fm=Object.prototype.hasOwnProperty,_d={current:null},zm={key:!0,ref:!0,__self:!0,__source:!0};function Bm(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)Fm.call(e,n)&&!zm.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:Oo,type:t,key:i,ref:o,props:s,_owner:_d.current}}function ww(t,e){return{$$typeof:Oo,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===Oo}function _w(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var Hh=/\/+/g;function uu(t,e){return typeof t=="object"&&t!==null&&t.key!=null?_w(""+t.key):e.toString(36)}function ba(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 Oo:case lw:o=!0}}if(o)return o=t,s=s(o),t=n===""?"."+uu(o,0):n,Vh(s)?(r="",t!=null&&(r=t.replace(Hh,"$&/")+"/"),ba(s,e,r,"",function(u){return u})):s!=null&&(bd(s)&&(s=ww(s,r+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(Hh,"$&/")+"/")+t)),e.push(s)),1;if(o=0,n=n===""?".":n+":",Vh(t))for(var a=0;a<t.length;a++){i=t[a];var l=n+uu(i,a);o+=ba(i,e,r,l,s)}else if(l=yw(t),typeof l=="function")for(t=l.call(t),a=0;!(i=t.next()).done;)i=i.value,l=n+uu(i,a++),o+=ba(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 Ho(t,e,r){if(t==null)return t;var n=[],s=0;return ba(t,n,"","",function(i){return e.call(r,i,s++)}),n}function bw(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 Xe={current:null},xa={transition:null},xw={ReactCurrentDispatcher:Xe,ReactCurrentBatchConfig:xa,ReactCurrentOwner:_d};function Vm(){throw Error("act(...) is not supported in production builds of React.")}se.Children={map:Ho,forEach:function(t,e,r){Ho(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return Ho(t,function(){e++}),e},toArray:function(t){return Ho(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=ci;se.Fragment=uw;se.Profiler=dw;se.PureComponent=yd;se.StrictMode=cw;se.Suspense=mw;se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xw;se.act=Vm;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=Dm({},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)Fm.call(e,l)&&!zm.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:Oo,type:t.type,key:s,ref:i,props:n,_owner:o}};se.createContext=function(t){return t={$$typeof:fw,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:hw,_context:t},t.Consumer=t};se.createElement=Bm;se.createFactory=function(t){var e=Bm.bind(null,t);return e.type=t,e};se.createRef=function(){return{current:null}};se.forwardRef=function(t){return{$$typeof:pw,render:t}};se.isValidElement=bd;se.lazy=function(t){return{$$typeof:vw,_payload:{_status:-1,_result:t},_init:bw}};se.memo=function(t,e){return{$$typeof:gw,type:t,compare:e===void 0?null:e}};se.startTransition=function(t){var e=xa.transition;xa.transition={};try{t()}finally{xa.transition=e}};se.unstable_act=Vm;se.useCallback=function(t,e){return Xe.current.useCallback(t,e)};se.useContext=function(t){return Xe.current.useContext(t)};se.useDebugValue=function(){};se.useDeferredValue=function(t){return Xe.current.useDeferredValue(t)};se.useEffect=function(t,e){return Xe.current.useEffect(t,e)};se.useId=function(){return Xe.current.useId()};se.useImperativeHandle=function(t,e,r){return Xe.current.useImperativeHandle(t,e,r)};se.useInsertionEffect=function(t,e){return Xe.current.useInsertionEffect(t,e)};se.useLayoutEffect=function(t,e){return Xe.current.useLayoutEffect(t,e)};se.useMemo=function(t,e){return Xe.current.useMemo(t,e)};se.useReducer=function(t,e,r){return Xe.current.useReducer(t,e,r)};se.useRef=function(t){return Xe.current.useRef(t)};se.useState=function(t){return Xe.current.useState(t)};se.useSyncExternalStore=function(t,e,r){return Xe.current.useSyncExternalStore(t,e,r)};se.useTransition=function(){return Xe.current.useTransition()};se.version="18.3.1";Lm.exports=se;var _=Lm.exports;const j=jm(_),Hm=aw({__proto__:null,default:j},[_]);/**
 * @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 kw=_,Sw=Symbol.for("react.element"),Ew=Symbol.for("react.fragment"),Tw=Object.prototype.hasOwnProperty,Cw=kw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Rw={key:!0,ref:!0,__self:!0,__source:!0};function Wm(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)Tw.call(e,n)&&!Rw.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:Sw,type:t,key:i,ref:o,props:s,_owner:Cw.current}}El.Fragment=Ew;El.jsx=Wm;El.jsxs=Wm;Im.exports=El;var x=Im.exports,qm={exports:{}},wt={},Km={exports:{}},Gm={};/**
 * @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,R){var D=C.length;C.push(R);e:for(;0<D;){var X=D-1>>>1,W=C[X];if(0<s(W,R))C[X]=R,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 R=C[0],D=C.pop();if(D!==R){C[0]=D;e:for(var X=0,W=C.length,ne=W>>>1;X<ne;){var oe=2*(X+1)-1,Ae=C[oe],Be=oe+1,de=C[Be];if(0>s(Ae,D))Be<W&&0>s(de,Ae)?(C[X]=de,C[Be]=D,X=Be):(C[X]=Ae,C[oe]=D,X=oe);else if(Be<W&&0>s(de,D))C[X]=de,C[Be]=D,X=Be;else break e}}return R}function s(C,R){var D=C.sortIndex-R.sortIndex;return D!==0?D:C.id-R.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,d=null,f=3,h=!1,y=!1,v=!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 g(C){for(var R=r(u);R!==null;){if(R.callback===null)n(u);else if(R.startTime<=C)n(u),R.sortIndex=R.expirationTime,e(l,R);else break;R=r(u)}}function b(C){if(v=!1,g(C),!y)if(r(l)!==null)y=!0,K(k);else{var R=r(u);R!==null&&Y(b,R.startTime-C)}}function k(C,R){y=!1,v&&(v=!1,m(A),A=-1),h=!0;var D=f;try{for(g(R),d=r(l);d!==null&&(!(d.expirationTime>R)||C&&!q());){var X=d.callback;if(typeof X=="function"){d.callback=null,f=d.priorityLevel;var W=X(d.expirationTime<=R);R=t.unstable_now(),typeof W=="function"?d.callback=W:d===r(l)&&n(l),g(R)}else n(l);d=r(l)}if(d!==null)var ne=!0;else{var oe=r(u);oe!==null&&Y(b,oe.startTime-R),ne=!1}return ne}finally{d=null,f=D,h=!1}}var S=!1,E=null,A=-1,N=5,I=-1;function q(){return!(t.unstable_now()-I<N)}function U(){if(E!==null){var C=t.unstable_now();I=C;var R=!0;try{R=E(!0,C)}finally{R?te():(S=!1,E=null)}}else S=!1}var te;if(typeof p=="function")te=function(){p(U)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,ie=L.port2;L.port1.onmessage=U,te=function(){ie.postMessage(null)}}else te=function(){w(U,0)};function K(C){E=C,S||(S=!0,te())}function Y(C,R){A=w(function(){C(t.unstable_now())},R)}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||h||(y=!0,K(k))},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"):N=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 R=3;break;default:R=f}var D=f;f=R;try{return C()}finally{f=D}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(C,R){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var D=f;f=C;try{return R()}finally{f=D}},t.unstable_scheduleCallback=function(C,R,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:R,priorityLevel:C,startTime:D,expirationTime:W,sortIndex:-1},D>X?(C.sortIndex=D,e(u,C),r(l)===null&&C===r(u)&&(v?(m(A),A=-1):v=!0,Y(b,D-X))):(C.sortIndex=W,e(l,C),y||h||(y=!0,K(k))),C},t.unstable_shouldYield=q,t.unstable_wrapCallback=function(C){var R=f;return function(){var D=f;f=R;try{return C.apply(this,arguments)}finally{f=D}}}})(Gm);Km.exports=Gm;var Aw=Km.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 Pw=_,vt=Aw;function P(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 Jm=new Set,Zi={};function Xn(t,e){Qs(t,e),Qs(t+"Capture",e)}function Qs(t,e){for(Zi[t]=e,t=0;t<e.length;t++)Jm.add(e[t])}var kr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ku=Object.prototype.hasOwnProperty,Ow=/^[: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]*$/,Wh={},qh={};function Nw(t){return Ku.call(qh,t)?!0:Ku.call(Wh,t)?!1:Ow.test(t)?qh[t]=!0:(Wh[t]=!0,!1)}function jw(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 Iw(t,e,r,n){if(e===null||typeof e>"u"||jw(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 et(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 ze={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ze[t]=new et(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ze[e]=new et(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ze[t]=new et(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ze[t]=new et(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){ze[t]=new et(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ze[t]=new et(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ze[t]=new et(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ze[t]=new et(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ze[t]=new et(t,5,!1,t.toLowerCase(),null,!1,!1)});var xd=/[\-:]([a-z])/g;function kd(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,kd);ze[e]=new et(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,kd);ze[e]=new et(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,kd);ze[e]=new et(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ze[t]=new et(t,1,!1,t.toLowerCase(),null,!1,!1)});ze.xlinkHref=new et("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ze[t]=new et(t,1,!1,t.toLowerCase(),null,!0,!0)});function Sd(t,e,r,n){var s=ze.hasOwnProperty(e)?ze[e]:null;(s!==null?s.type!==0:n||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(Iw(e,r,s,n)&&(r=null),n||s===null?Nw(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 Pr=Pw.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Wo=Symbol.for("react.element"),ws=Symbol.for("react.portal"),_s=Symbol.for("react.fragment"),Ed=Symbol.for("react.strict_mode"),Gu=Symbol.for("react.profiler"),Qm=Symbol.for("react.provider"),Zm=Symbol.for("react.context"),Td=Symbol.for("react.forward_ref"),Ju=Symbol.for("react.suspense"),Qu=Symbol.for("react.suspense_list"),Cd=Symbol.for("react.memo"),Br=Symbol.for("react.lazy"),Ym=Symbol.for("react.offscreen"),Kh=Symbol.iterator;function wi(t){return t===null||typeof t!="object"?null:(t=Kh&&t[Kh]||t["@@iterator"],typeof t=="function"?t:null)}var ke=Object.assign,cu;function Pi(t){if(cu===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);cu=e&&e[1]||""}return`
`+cu+t}var du=!1;function hu(t,e){if(!t||du)return"";du=!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{du=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Pi(t):""}function Lw(t){switch(t.tag){case 5:return Pi(t.type);case 16:return Pi("Lazy");case 13:return Pi("Suspense");case 19:return Pi("SuspenseList");case 0:case 2:case 15:return t=hu(t.type,!1),t;case 11:return t=hu(t.type.render,!1),t;case 1:return t=hu(t.type,!0),t;default:return""}}function Zu(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 _s:return"Fragment";case ws:return"Portal";case Gu:return"Profiler";case Ed:return"StrictMode";case Ju:return"Suspense";case Qu:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Zm:return(t.displayName||"Context")+".Consumer";case Qm: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:Zu(t.type)||"Memo";case Br:e=t._payload,t=t._init;try{return Zu(t(e))}catch{}}return null}function $w(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 Zu(e);case 8:return e===Ed?"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 pn(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Xm(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Dw(t){var e=Xm(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 qo(t){t._valueTracker||(t._valueTracker=Dw(t))}function eg(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=Xm(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function Ma(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 Yu(t,e){var r=e.checked;return ke({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function Gh(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=pn(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 tg(t,e){e=e.checked,e!=null&&Sd(t,"checked",e,!1)}function Xu(t,e){tg(t,e);var r=pn(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")?ec(t,e.type,r):e.hasOwnProperty("defaultValue")&&ec(t,e.type,pn(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Jh(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 ec(t,e,r){(e!=="number"||Ma(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Oi=Array.isArray;function Ns(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=""+pn(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 tc(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(P(91));return ke({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Qh(t,e){var r=e.value;if(r==null){if(r=e.children,e=e.defaultValue,r!=null){if(e!=null)throw Error(P(92));if(Oi(r)){if(1<r.length)throw Error(P(93));r=r[0]}e=r}e==null&&(e=""),r=e}t._wrapperState={initialValue:pn(r)}}function rg(t,e){var r=pn(e.value),n=pn(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 Zh(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function ng(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 rc(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?ng(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Ko,sg=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(Ko=Ko||document.createElement("div"),Ko.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Ko.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Yi(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Mi={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},Mw=["Webkit","ms","Moz","O"];Object.keys(Mi).forEach(function(t){Mw.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Mi[e]=Mi[t]})});function ig(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Mi.hasOwnProperty(t)&&Mi[t]?(""+e).trim():e+"px"}function og(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=ig(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,s):t[r]=s}}var Uw=ke({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 nc(t,e){if(e){if(Uw[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(P(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(P(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(P(61))}if(e.style!=null&&typeof e.style!="object")throw Error(P(62))}}function sc(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 ic=null;function Rd(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var oc=null,js=null,Is=null;function Yh(t){if(t=Io(t)){if(typeof oc!="function")throw Error(P(280));var e=t.stateNode;e&&(e=Pl(e),oc(t.stateNode,t.type,e))}}function ag(t){js?Is?Is.push(t):Is=[t]:js=t}function lg(){if(js){var t=js,e=Is;if(Is=js=null,Yh(t),e)for(t=0;t<e.length;t++)Yh(e[t])}}function ug(t,e){return t(e)}function cg(){}var fu=!1;function dg(t,e,r){if(fu)return t(e,r);fu=!0;try{return ug(t,e,r)}finally{fu=!1,(js!==null||Is!==null)&&(cg(),lg())}}function Xi(t,e){var r=t.stateNode;if(r===null)return null;var n=Pl(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(P(231,e,typeof r));return r}var ac=!1;if(kr)try{var _i={};Object.defineProperty(_i,"passive",{get:function(){ac=!0}}),window.addEventListener("test",_i,_i),window.removeEventListener("test",_i,_i)}catch{ac=!1}function Fw(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 Ui=!1,Ua=null,Fa=!1,lc=null,zw={onError:function(t){Ui=!0,Ua=t}};function Bw(t,e,r,n,s,i,o,a,l){Ui=!1,Ua=null,Fw.apply(zw,arguments)}function Vw(t,e,r,n,s,i,o,a,l){if(Bw.apply(this,arguments),Ui){if(Ui){var u=Ua;Ui=!1,Ua=null}else throw Error(P(198));Fa||(Fa=!0,lc=u)}}function es(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 hg(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 Xh(t){if(es(t)!==t)throw Error(P(188))}function Hw(t){var e=t.alternate;if(!e){if(e=es(t),e===null)throw Error(P(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 Xh(s),t;if(i===n)return Xh(s),e;i=i.sibling}throw Error(P(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(P(189))}}if(r.alternate!==n)throw Error(P(190))}if(r.tag!==3)throw Error(P(188));return r.stateNode.current===r?t:e}function fg(t){return t=Hw(t),t!==null?pg(t):null}function pg(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=pg(t);if(e!==null)return e;t=t.sibling}return null}var mg=vt.unstable_scheduleCallback,ef=vt.unstable_cancelCallback,Ww=vt.unstable_shouldYield,qw=vt.unstable_requestPaint,Re=vt.unstable_now,Kw=vt.unstable_getCurrentPriorityLevel,Ad=vt.unstable_ImmediatePriority,gg=vt.unstable_UserBlockingPriority,za=vt.unstable_NormalPriority,Gw=vt.unstable_LowPriority,vg=vt.unstable_IdlePriority,Tl=null,or=null;function Jw(t){if(or&&typeof or.onCommitFiberRoot=="function")try{or.onCommitFiberRoot(Tl,t,void 0,(t.current.flags&128)===128)}catch{}}var Vt=Math.clz32?Math.clz32:Yw,Qw=Math.log,Zw=Math.LN2;function Yw(t){return t>>>=0,t===0?32:31-(Qw(t)/Zw|0)|0}var Go=64,Jo=4194304;function Ni(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 Ba(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=Ni(a):(i&=o,i!==0&&(n=Ni(i)))}else o=r&~s,o!==0?n=Ni(o):i!==0&&(n=Ni(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-Vt(e),s=1<<r,n|=t[r],e&=~s;return n}function Xw(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 e_(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,s=t.expirationTimes,i=t.pendingLanes;0<i;){var o=31-Vt(i),a=1<<o,l=s[o];l===-1?(!(a&r)||a&n)&&(s[o]=Xw(a,e)):l<=e&&(t.expiredLanes|=a),i&=~a}}function uc(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function yg(){var t=Go;return Go<<=1,!(Go&4194240)&&(Go=64),t}function pu(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function No(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Vt(e),t[e]=r}function t_(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-Vt(r),i=1<<s;e[s]=0,n[s]=-1,t[s]=-1,r&=~i}}function Pd(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var n=31-Vt(r),s=1<<n;s&e|t[n]&e&&(t[n]|=e),r&=~s}}var he=0;function wg(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var _g,Od,bg,xg,kg,cc=!1,Qo=[],sn=null,on=null,an=null,eo=new Map,to=new Map,Wr=[],r_="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 tf(t,e){switch(t){case"focusin":case"focusout":sn=null;break;case"dragenter":case"dragleave":on=null;break;case"mouseover":case"mouseout":an=null;break;case"pointerover":case"pointerout":eo.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":to.delete(e.pointerId)}}function bi(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=Io(e),e!==null&&Od(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,s!==null&&e.indexOf(s)===-1&&e.push(s),t)}function n_(t,e,r,n,s){switch(e){case"focusin":return sn=bi(sn,t,e,r,n,s),!0;case"dragenter":return on=bi(on,t,e,r,n,s),!0;case"mouseover":return an=bi(an,t,e,r,n,s),!0;case"pointerover":var i=s.pointerId;return eo.set(i,bi(eo.get(i)||null,t,e,r,n,s)),!0;case"gotpointercapture":return i=s.pointerId,to.set(i,bi(to.get(i)||null,t,e,r,n,s)),!0}return!1}function Sg(t){var e=In(t.target);if(e!==null){var r=es(e);if(r!==null){if(e=r.tag,e===13){if(e=hg(r),e!==null){t.blockedOn=e,kg(t.priority,function(){bg(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 ka(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=dc(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(r===null){r=t.nativeEvent;var n=new r.constructor(r.type,r);ic=n,r.target.dispatchEvent(n),ic=null}else return e=Io(r),e!==null&&Od(e),t.blockedOn=r,!1;e.shift()}return!0}function rf(t,e,r){ka(t)&&r.delete(e)}function s_(){cc=!1,sn!==null&&ka(sn)&&(sn=null),on!==null&&ka(on)&&(on=null),an!==null&&ka(an)&&(an=null),eo.forEach(rf),to.forEach(rf)}function xi(t,e){t.blockedOn===e&&(t.blockedOn=null,cc||(cc=!0,vt.unstable_scheduleCallback(vt.unstable_NormalPriority,s_)))}function ro(t){function e(s){return xi(s,t)}if(0<Qo.length){xi(Qo[0],t);for(var r=1;r<Qo.length;r++){var n=Qo[r];n.blockedOn===t&&(n.blockedOn=null)}}for(sn!==null&&xi(sn,t),on!==null&&xi(on,t),an!==null&&xi(an,t),eo.forEach(e),to.forEach(e),r=0;r<Wr.length;r++)n=Wr[r],n.blockedOn===t&&(n.blockedOn=null);for(;0<Wr.length&&(r=Wr[0],r.blockedOn===null);)Sg(r),r.blockedOn===null&&Wr.shift()}var Ls=Pr.ReactCurrentBatchConfig,Va=!0;function i_(t,e,r,n){var s=he,i=Ls.transition;Ls.transition=null;try{he=1,Nd(t,e,r,n)}finally{he=s,Ls.transition=i}}function o_(t,e,r,n){var s=he,i=Ls.transition;Ls.transition=null;try{he=4,Nd(t,e,r,n)}finally{he=s,Ls.transition=i}}function Nd(t,e,r,n){if(Va){var s=dc(t,e,r,n);if(s===null)Su(t,e,n,Ha,r),tf(t,n);else if(n_(s,t,e,r,n))n.stopPropagation();else if(tf(t,n),e&4&&-1<r_.indexOf(t)){for(;s!==null;){var i=Io(s);if(i!==null&&_g(i),i=dc(t,e,r,n),i===null&&Su(t,e,n,Ha,r),i===s)break;s=i}s!==null&&n.stopPropagation()}else Su(t,e,n,null,r)}}var Ha=null;function dc(t,e,r,n){if(Ha=null,t=Rd(n),t=In(t),t!==null)if(e=es(t),e===null)t=null;else if(r=e.tag,r===13){if(t=hg(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 Ha=t,null}function Eg(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(Kw()){case Ad:return 1;case gg:return 4;case za:case Gw:return 16;case vg:return 536870912;default:return 16}default:return 16}}var en=null,jd=null,Sa=null;function Tg(){if(Sa)return Sa;var t,e=jd,r=e.length,n,s="value"in en?en.value:en.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 Sa=s.slice(t,1<n?1-n:void 0)}function Ea(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 nf(){return!1}function _t(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:nf,this.isPropagationStopped=nf,this}return ke(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 di={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Id=_t(di),jo=ke({},di,{view:0,detail:0}),a_=_t(jo),mu,gu,ki,Cl=ke({},jo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ld,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!==ki&&(ki&&t.type==="mousemove"?(mu=t.screenX-ki.screenX,gu=t.screenY-ki.screenY):gu=mu=0,ki=t),mu)},movementY:function(t){return"movementY"in t?t.movementY:gu}}),sf=_t(Cl),l_=ke({},Cl,{dataTransfer:0}),u_=_t(l_),c_=ke({},jo,{relatedTarget:0}),vu=_t(c_),d_=ke({},di,{animationName:0,elapsedTime:0,pseudoElement:0}),h_=_t(d_),f_=ke({},di,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),p_=_t(f_),m_=ke({},di,{data:0}),of=_t(m_),g_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},v_={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"},y_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function w_(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=y_[t])?!!e[t]:!1}function Ld(){return w_}var __=ke({},jo,{key:function(t){if(t.key){var e=g_[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Ea(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?v_[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ld,charCode:function(t){return t.type==="keypress"?Ea(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Ea(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),b_=_t(__),x_=ke({},Cl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),af=_t(x_),k_=ke({},jo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ld}),S_=_t(k_),E_=ke({},di,{propertyName:0,elapsedTime:0,pseudoElement:0}),T_=_t(E_),C_=ke({},Cl,{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}),R_=_t(C_),A_=[9,13,27,32],$d=kr&&"CompositionEvent"in window,Fi=null;kr&&"documentMode"in document&&(Fi=document.documentMode);var P_=kr&&"TextEvent"in window&&!Fi,Cg=kr&&(!$d||Fi&&8<Fi&&11>=Fi),lf=" ",uf=!1;function Rg(t,e){switch(t){case"keyup":return A_.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ag(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var bs=!1;function O_(t,e){switch(t){case"compositionend":return Ag(e);case"keypress":return e.which!==32?null:(uf=!0,lf);case"textInput":return t=e.data,t===lf&&uf?null:t;default:return null}}function N_(t,e){if(bs)return t==="compositionend"||!$d&&Rg(t,e)?(t=Tg(),Sa=jd=en=null,bs=!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 Cg&&e.locale!=="ko"?null:e.data;default:return null}}var j_={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 cf(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!j_[t.type]:e==="textarea"}function Pg(t,e,r,n){ag(n),e=Wa(e,"onChange"),0<e.length&&(r=new Id("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var zi=null,no=null;function I_(t){zg(t,0)}function Rl(t){var e=Ss(t);if(eg(e))return t}function L_(t,e){if(t==="change")return e}var Og=!1;if(kr){var yu;if(kr){var wu="oninput"in document;if(!wu){var df=document.createElement("div");df.setAttribute("oninput","return;"),wu=typeof df.oninput=="function"}yu=wu}else yu=!1;Og=yu&&(!document.documentMode||9<document.documentMode)}function hf(){zi&&(zi.detachEvent("onpropertychange",Ng),no=zi=null)}function Ng(t){if(t.propertyName==="value"&&Rl(no)){var e=[];Pg(e,no,t,Rd(t)),dg(I_,e)}}function $_(t,e,r){t==="focusin"?(hf(),zi=e,no=r,zi.attachEvent("onpropertychange",Ng)):t==="focusout"&&hf()}function D_(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Rl(no)}function M_(t,e){if(t==="click")return Rl(e)}function U_(t,e){if(t==="input"||t==="change")return Rl(e)}function F_(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Wt=typeof Object.is=="function"?Object.is:F_;function so(t,e){if(Wt(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(!Ku.call(e,s)||!Wt(t[s],e[s]))return!1}return!0}function ff(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function pf(t,e){var r=ff(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=ff(r)}}function jg(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?jg(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Ig(){for(var t=window,e=Ma();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=Ma(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 z_(t){var e=Ig(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&jg(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=pf(r,i);var o=pf(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 B_=kr&&"documentMode"in document&&11>=document.documentMode,xs=null,hc=null,Bi=null,fc=!1;function mf(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;fc||xs==null||xs!==Ma(n)||(n=xs,"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}),Bi&&so(Bi,n)||(Bi=n,n=Wa(hc,"onSelect"),0<n.length&&(e=new Id("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=xs)))}function Yo(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var ks={animationend:Yo("Animation","AnimationEnd"),animationiteration:Yo("Animation","AnimationIteration"),animationstart:Yo("Animation","AnimationStart"),transitionend:Yo("Transition","TransitionEnd")},_u={},Lg={};kr&&(Lg=document.createElement("div").style,"AnimationEvent"in window||(delete ks.animationend.animation,delete ks.animationiteration.animation,delete ks.animationstart.animation),"TransitionEvent"in window||delete ks.transitionend.transition);function Al(t){if(_u[t])return _u[t];if(!ks[t])return t;var e=ks[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in Lg)return _u[t]=e[r];return t}var $g=Al("animationend"),Dg=Al("animationiteration"),Mg=Al("animationstart"),Ug=Al("transitionend"),Fg=new Map,gf="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 xn(t,e){Fg.set(t,e),Xn(e,[t])}for(var bu=0;bu<gf.length;bu++){var xu=gf[bu],V_=xu.toLowerCase(),H_=xu[0].toUpperCase()+xu.slice(1);xn(V_,"on"+H_)}xn($g,"onAnimationEnd");xn(Dg,"onAnimationIteration");xn(Mg,"onAnimationStart");xn("dblclick","onDoubleClick");xn("focusin","onFocus");xn("focusout","onBlur");xn(Ug,"onTransitionEnd");Qs("onMouseEnter",["mouseout","mouseover"]);Qs("onMouseLeave",["mouseout","mouseover"]);Qs("onPointerEnter",["pointerout","pointerover"]);Qs("onPointerLeave",["pointerout","pointerover"]);Xn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Xn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Xn("onBeforeInput",["compositionend","keypress","textInput","paste"]);Xn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Xn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Xn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ji="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(" "),W_=new Set("cancel close invalid load scroll toggle".split(" ").concat(ji));function vf(t,e,r){var n=t.type||"unknown-event";t.currentTarget=r,Vw(n,e,void 0,t),t.currentTarget=null}function zg(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;vf(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;vf(s,a,u),i=l}}}if(Fa)throw t=lc,Fa=!1,lc=null,t}function ve(t,e){var r=e[yc];r===void 0&&(r=e[yc]=new Set);var n=t+"__bubble";r.has(n)||(Bg(e,t,2,!1),r.add(n))}function ku(t,e,r){var n=0;e&&(n|=4),Bg(r,t,n,e)}var Xo="_reactListening"+Math.random().toString(36).slice(2);function io(t){if(!t[Xo]){t[Xo]=!0,Jm.forEach(function(r){r!=="selectionchange"&&(W_.has(r)||ku(r,!1,t),ku(r,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Xo]||(e[Xo]=!0,ku("selectionchange",!1,e))}}function Bg(t,e,r,n){switch(Eg(e)){case 1:var s=i_;break;case 4:s=o_;break;default:s=Nd}r=s.bind(null,e,r,t),s=void 0,!ac||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 Su(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=In(a),o===null)return;if(l=o.tag,l===5||l===6){n=i=o;continue e}a=a.parentNode}}n=n.return}dg(function(){var u=i,c=Rd(r),d=[];e:{var f=Fg.get(t);if(f!==void 0){var h=Id,y=t;switch(t){case"keypress":if(Ea(r)===0)break e;case"keydown":case"keyup":h=b_;break;case"focusin":y="focus",h=vu;break;case"focusout":y="blur",h=vu;break;case"beforeblur":case"afterblur":h=vu;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":h=sf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=u_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=S_;break;case $g:case Dg:case Mg:h=h_;break;case Ug:h=T_;break;case"scroll":h=a_;break;case"wheel":h=R_;break;case"copy":case"cut":case"paste":h=p_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=af}var v=(e&4)!==0,w=!v&&t==="scroll",m=v?f!==null?f+"Capture":null:f;v=[];for(var p=u,g;p!==null;){g=p;var b=g.stateNode;if(g.tag===5&&b!==null&&(g=b,m!==null&&(b=Xi(p,m),b!=null&&v.push(oo(p,b,g)))),w)break;p=p.return}0<v.length&&(f=new h(f,y,null,r,c),d.push({event:f,listeners:v}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",h=t==="mouseout"||t==="pointerout",f&&r!==ic&&(y=r.relatedTarget||r.fromElement)&&(In(y)||y[Sr]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(y=r.relatedTarget||r.toElement,h=u,y=y?In(y):null,y!==null&&(w=es(y),y!==w||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=u),h!==y)){if(v=sf,b="onMouseLeave",m="onMouseEnter",p="mouse",(t==="pointerout"||t==="pointerover")&&(v=af,b="onPointerLeave",m="onPointerEnter",p="pointer"),w=h==null?f:Ss(h),g=y==null?f:Ss(y),f=new v(b,p+"leave",h,r,c),f.target=w,f.relatedTarget=g,b=null,In(c)===u&&(v=new v(m,p+"enter",y,r,c),v.target=g,v.relatedTarget=w,b=v),w=b,h&&y)t:{for(v=h,m=y,p=0,g=v;g;g=as(g))p++;for(g=0,b=m;b;b=as(b))g++;for(;0<p-g;)v=as(v),p--;for(;0<g-p;)m=as(m),g--;for(;p--;){if(v===m||m!==null&&v===m.alternate)break t;v=as(v),m=as(m)}v=null}else v=null;h!==null&&yf(d,f,h,v,!1),y!==null&&w!==null&&yf(d,w,y,v,!0)}}e:{if(f=u?Ss(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var k=L_;else if(cf(f))if(Og)k=U_;else{k=D_;var S=$_}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=M_);if(k&&(k=k(t,u))){Pg(d,k,r,c);break e}S&&S(t,f,u),t==="focusout"&&(S=f._wrapperState)&&S.controlled&&f.type==="number"&&ec(f,"number",f.value)}switch(S=u?Ss(u):window,t){case"focusin":(cf(S)||S.contentEditable==="true")&&(xs=S,hc=u,Bi=null);break;case"focusout":Bi=hc=xs=null;break;case"mousedown":fc=!0;break;case"contextmenu":case"mouseup":case"dragend":fc=!1,mf(d,r,c);break;case"selectionchange":if(B_)break;case"keydown":case"keyup":mf(d,r,c)}var E;if($d)e:{switch(t){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else bs?Rg(t,r)&&(A="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(A="onCompositionStart");A&&(Cg&&r.locale!=="ko"&&(bs||A!=="onCompositionStart"?A==="onCompositionEnd"&&bs&&(E=Tg()):(en=c,jd="value"in en?en.value:en.textContent,bs=!0)),S=Wa(u,A),0<S.length&&(A=new of(A,t,null,r,c),d.push({event:A,listeners:S}),E?A.data=E:(E=Ag(r),E!==null&&(A.data=E)))),(E=P_?O_(t,r):N_(t,r))&&(u=Wa(u,"onBeforeInput"),0<u.length&&(c=new of("onBeforeInput","beforeinput",null,r,c),d.push({event:c,listeners:u}),c.data=E))}zg(d,e)})}function oo(t,e,r){return{instance:t,listener:e,currentTarget:r}}function Wa(t,e){for(var r=e+"Capture",n=[];t!==null;){var s=t,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Xi(t,r),i!=null&&n.unshift(oo(t,i,s)),i=Xi(t,e),i!=null&&n.push(oo(t,i,s))),t=t.return}return n}function as(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function yf(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=Xi(r,i),l!=null&&o.unshift(oo(r,l,a))):s||(l=Xi(r,i),l!=null&&o.push(oo(r,l,a)))),r=r.return}o.length!==0&&t.push({event:e,listeners:o})}var q_=/\r\n?/g,K_=/\u0000|\uFFFD/g;function wf(t){return(typeof t=="string"?t:""+t).replace(q_,`
`).replace(K_,"")}function ea(t,e,r){if(e=wf(e),wf(t)!==e&&r)throw Error(P(425))}function qa(){}var pc=null,mc=null;function gc(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 vc=typeof setTimeout=="function"?setTimeout:void 0,G_=typeof clearTimeout=="function"?clearTimeout:void 0,_f=typeof Promise=="function"?Promise:void 0,J_=typeof queueMicrotask=="function"?queueMicrotask:typeof _f<"u"?function(t){return _f.resolve(null).then(t).catch(Q_)}:vc;function Q_(t){setTimeout(function(){throw t})}function Eu(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),ro(e);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);ro(e)}function ln(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 bf(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 hi=Math.random().toString(36).slice(2),sr="__reactFiber$"+hi,ao="__reactProps$"+hi,Sr="__reactContainer$"+hi,yc="__reactEvents$"+hi,Z_="__reactListeners$"+hi,Y_="__reactHandles$"+hi;function In(t){var e=t[sr];if(e)return e;for(var r=t.parentNode;r;){if(e=r[Sr]||r[sr]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=bf(t);t!==null;){if(r=t[sr])return r;t=bf(t)}return e}t=r,r=t.parentNode}return null}function Io(t){return t=t[sr]||t[Sr],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Ss(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(P(33))}function Pl(t){return t[ao]||null}var wc=[],Es=-1;function kn(t){return{current:t}}function ye(t){0>Es||(t.current=wc[Es],wc[Es]=null,Es--)}function me(t,e){Es++,wc[Es]=t.current,t.current=e}var mn={},Ge=kn(mn),ot=kn(!1),qn=mn;function Zs(t,e){var r=t.type.contextTypes;if(!r)return mn;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 at(t){return t=t.childContextTypes,t!=null}function Ka(){ye(ot),ye(Ge)}function xf(t,e,r){if(Ge.current!==mn)throw Error(P(168));me(Ge,e),me(ot,r)}function Vg(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(P(108,$w(t)||"Unknown",s));return ke({},r,n)}function Ga(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||mn,qn=Ge.current,me(Ge,t),me(ot,ot.current),!0}function kf(t,e,r){var n=t.stateNode;if(!n)throw Error(P(169));r?(t=Vg(t,e,qn),n.__reactInternalMemoizedMergedChildContext=t,ye(ot),ye(Ge),me(Ge,t)):ye(ot),me(ot,r)}var yr=null,Ol=!1,Tu=!1;function Hg(t){yr===null?yr=[t]:yr.push(t)}function X_(t){Ol=!0,Hg(t)}function Sn(){if(!Tu&&yr!==null){Tu=!0;var t=0,e=he;try{var r=yr;for(he=1;t<r.length;t++){var n=r[t];do n=n(!0);while(n!==null)}yr=null,Ol=!1}catch(s){throw yr!==null&&(yr=yr.slice(t+1)),mg(Ad,Sn),s}finally{he=e,Tu=!1}}return null}var Ts=[],Cs=0,Ja=null,Qa=0,kt=[],St=0,Kn=null,_r=1,br="";function Pn(t,e){Ts[Cs++]=Qa,Ts[Cs++]=Ja,Ja=t,Qa=e}function Wg(t,e,r){kt[St++]=_r,kt[St++]=br,kt[St++]=Kn,Kn=t;var n=_r;t=br;var s=32-Vt(n)-1;n&=~(1<<s),r+=1;var i=32-Vt(e)+s;if(30<i){var o=s-s%5;i=(n&(1<<o)-1).toString(32),n>>=o,s-=o,_r=1<<32-Vt(e)+s|r<<s|n,br=i+t}else _r=1<<i|r<<s|n,br=t}function Md(t){t.return!==null&&(Pn(t,1),Wg(t,1,0))}function Ud(t){for(;t===Ja;)Ja=Ts[--Cs],Ts[Cs]=null,Qa=Ts[--Cs],Ts[Cs]=null;for(;t===Kn;)Kn=kt[--St],kt[St]=null,br=kt[--St],kt[St]=null,_r=kt[--St],kt[St]=null}var mt=null,pt=null,_e=!1,Bt=null;function qg(t,e){var r=Et(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 Sf(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,mt=t,pt=ln(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,mt=t,pt=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(r=Kn!==null?{id:_r,overflow:br}:null,t.memoizedState={dehydrated:e,treeContext:r,retryLane:1073741824},r=Et(18,null,null,0),r.stateNode=e,r.return=t,t.child=r,mt=t,pt=null,!0):!1;default:return!1}}function _c(t){return(t.mode&1)!==0&&(t.flags&128)===0}function bc(t){if(_e){var e=pt;if(e){var r=e;if(!Sf(t,e)){if(_c(t))throw Error(P(418));e=ln(r.nextSibling);var n=mt;e&&Sf(t,e)?qg(n,r):(t.flags=t.flags&-4097|2,_e=!1,mt=t)}}else{if(_c(t))throw Error(P(418));t.flags=t.flags&-4097|2,_e=!1,mt=t}}}function Ef(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;mt=t}function ta(t){if(t!==mt)return!1;if(!_e)return Ef(t),_e=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!gc(t.type,t.memoizedProps)),e&&(e=pt)){if(_c(t))throw Kg(),Error(P(418));for(;e;)qg(t,e),e=ln(e.nextSibling)}if(Ef(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(P(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"){if(e===0){pt=ln(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++}t=t.nextSibling}pt=null}}else pt=mt?ln(t.stateNode.nextSibling):null;return!0}function Kg(){for(var t=pt;t;)t=ln(t.nextSibling)}function Ys(){pt=mt=null,_e=!1}function Fd(t){Bt===null?Bt=[t]:Bt.push(t)}var eb=Pr.ReactCurrentBatchConfig;function Si(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(P(309));var n=r.stateNode}if(!n)throw Error(P(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(P(284));if(!r._owner)throw Error(P(290,t))}return t}function ra(t,e){throw t=Object.prototype.toString.call(e),Error(P(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Tf(t){var e=t._init;return e(t._payload)}function Gg(t){function e(m,p){if(t){var g=m.deletions;g===null?(m.deletions=[p],m.flags|=16):g.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=hn(m,p),m.index=0,m.sibling=null,m}function i(m,p,g){return m.index=g,t?(g=m.alternate,g!==null?(g=g.index,g<p?(m.flags|=2,p):g):(m.flags|=2,p)):(m.flags|=1048576,p)}function o(m){return t&&m.alternate===null&&(m.flags|=2),m}function a(m,p,g,b){return p===null||p.tag!==6?(p=ju(g,m.mode,b),p.return=m,p):(p=s(p,g),p.return=m,p)}function l(m,p,g,b){var k=g.type;return k===_s?c(m,p,g.props.children,b,g.key):p!==null&&(p.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Br&&Tf(k)===p.type)?(b=s(p,g.props),b.ref=Si(m,p,g),b.return=m,b):(b=Na(g.type,g.key,g.props,null,m.mode,b),b.ref=Si(m,p,g),b.return=m,b)}function u(m,p,g,b){return p===null||p.tag!==4||p.stateNode.containerInfo!==g.containerInfo||p.stateNode.implementation!==g.implementation?(p=Iu(g,m.mode,b),p.return=m,p):(p=s(p,g.children||[]),p.return=m,p)}function c(m,p,g,b,k){return p===null||p.tag!==7?(p=Wn(g,m.mode,b,k),p.return=m,p):(p=s(p,g),p.return=m,p)}function d(m,p,g){if(typeof p=="string"&&p!==""||typeof p=="number")return p=ju(""+p,m.mode,g),p.return=m,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Wo:return g=Na(p.type,p.key,p.props,null,m.mode,g),g.ref=Si(m,null,p),g.return=m,g;case ws:return p=Iu(p,m.mode,g),p.return=m,p;case Br:var b=p._init;return d(m,b(p._payload),g)}if(Oi(p)||wi(p))return p=Wn(p,m.mode,g,null),p.return=m,p;ra(m,p)}return null}function f(m,p,g,b){var k=p!==null?p.key:null;if(typeof g=="string"&&g!==""||typeof g=="number")return k!==null?null:a(m,p,""+g,b);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Wo:return g.key===k?l(m,p,g,b):null;case ws:return g.key===k?u(m,p,g,b):null;case Br:return k=g._init,f(m,p,k(g._payload),b)}if(Oi(g)||wi(g))return k!==null?null:c(m,p,g,b,null);ra(m,g)}return null}function h(m,p,g,b,k){if(typeof b=="string"&&b!==""||typeof b=="number")return m=m.get(g)||null,a(p,m,""+b,k);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Wo:return m=m.get(b.key===null?g:b.key)||null,l(p,m,b,k);case ws:return m=m.get(b.key===null?g:b.key)||null,u(p,m,b,k);case Br:var S=b._init;return h(m,p,g,S(b._payload),k)}if(Oi(b)||wi(b))return m=m.get(g)||null,c(p,m,b,k,null);ra(p,b)}return null}function y(m,p,g,b){for(var k=null,S=null,E=p,A=p=0,N=null;E!==null&&A<g.length;A++){E.index>A?(N=E,E=null):N=E.sibling;var I=f(m,E,g[A],b);if(I===null){E===null&&(E=N);break}t&&E&&I.alternate===null&&e(m,E),p=i(I,p,A),S===null?k=I:S.sibling=I,S=I,E=N}if(A===g.length)return r(m,E),_e&&Pn(m,A),k;if(E===null){for(;A<g.length;A++)E=d(m,g[A],b),E!==null&&(p=i(E,p,A),S===null?k=E:S.sibling=E,S=E);return _e&&Pn(m,A),k}for(E=n(m,E);A<g.length;A++)N=h(E,m,A,g[A],b),N!==null&&(t&&N.alternate!==null&&E.delete(N.key===null?A:N.key),p=i(N,p,A),S===null?k=N:S.sibling=N,S=N);return t&&E.forEach(function(q){return e(m,q)}),_e&&Pn(m,A),k}function v(m,p,g,b){var k=wi(g);if(typeof k!="function")throw Error(P(150));if(g=k.call(g),g==null)throw Error(P(151));for(var S=k=null,E=p,A=p=0,N=null,I=g.next();E!==null&&!I.done;A++,I=g.next()){E.index>A?(N=E,E=null):N=E.sibling;var q=f(m,E,I.value,b);if(q===null){E===null&&(E=N);break}t&&E&&q.alternate===null&&e(m,E),p=i(q,p,A),S===null?k=q:S.sibling=q,S=q,E=N}if(I.done)return r(m,E),_e&&Pn(m,A),k;if(E===null){for(;!I.done;A++,I=g.next())I=d(m,I.value,b),I!==null&&(p=i(I,p,A),S===null?k=I:S.sibling=I,S=I);return _e&&Pn(m,A),k}for(E=n(m,E);!I.done;A++,I=g.next())I=h(E,m,A,I.value,b),I!==null&&(t&&I.alternate!==null&&E.delete(I.key===null?A:I.key),p=i(I,p,A),S===null?k=I:S.sibling=I,S=I);return t&&E.forEach(function(U){return e(m,U)}),_e&&Pn(m,A),k}function w(m,p,g,b){if(typeof g=="object"&&g!==null&&g.type===_s&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Wo:e:{for(var k=g.key,S=p;S!==null;){if(S.key===k){if(k=g.type,k===_s){if(S.tag===7){r(m,S.sibling),p=s(S,g.props.children),p.return=m,m=p;break e}}else if(S.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Br&&Tf(k)===S.type){r(m,S.sibling),p=s(S,g.props),p.ref=Si(m,S,g),p.return=m,m=p;break e}r(m,S);break}else e(m,S);S=S.sibling}g.type===_s?(p=Wn(g.props.children,m.mode,b,g.key),p.return=m,m=p):(b=Na(g.type,g.key,g.props,null,m.mode,b),b.ref=Si(m,p,g),b.return=m,m=b)}return o(m);case ws:e:{for(S=g.key;p!==null;){if(p.key===S)if(p.tag===4&&p.stateNode.containerInfo===g.containerInfo&&p.stateNode.implementation===g.implementation){r(m,p.sibling),p=s(p,g.children||[]),p.return=m,m=p;break e}else{r(m,p);break}else e(m,p);p=p.sibling}p=Iu(g,m.mode,b),p.return=m,m=p}return o(m);case Br:return S=g._init,w(m,p,S(g._payload),b)}if(Oi(g))return y(m,p,g,b);if(wi(g))return v(m,p,g,b);ra(m,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,p!==null&&p.tag===6?(r(m,p.sibling),p=s(p,g),p.return=m,m=p):(r(m,p),p=ju(g,m.mode,b),p.return=m,m=p),o(m)):r(m,p)}return w}var Xs=Gg(!0),Jg=Gg(!1),Za=kn(null),Ya=null,Rs=null,zd=null;function Bd(){zd=Rs=Ya=null}function Vd(t){var e=Za.current;ye(Za),t._currentValue=e}function xc(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 $s(t,e){Ya=t,zd=Rs=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(it=!0),t.firstContext=null)}function Ct(t){var e=t._currentValue;if(zd!==t)if(t={context:t,memoizedValue:e,next:null},Rs===null){if(Ya===null)throw Error(P(308));Rs=t,Ya.dependencies={lanes:0,firstContext:t}}else Rs=Rs.next=t;return e}var Ln=null;function Hd(t){Ln===null?Ln=[t]:Ln.push(t)}function Qg(t,e,r,n){var s=e.interleaved;return s===null?(r.next=r,Hd(e)):(r.next=s.next,s.next=r),e.interleaved=r,Er(t,n)}function Er(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 Vr=!1;function Wd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Zg(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 xr(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function un(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,Er(t,r)}return s=n.interleaved,s===null?(e.next=e,Hd(n)):(e.next=s.next,s.next=e),n.interleaved=e,Er(t,r)}function Ta(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,Pd(t,r)}}function Cf(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 Xa(t,e,r,n){var s=t.updateQueue;Vr=!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 d=s.baseState;o=0,c=u=l=null,a=i;do{var f=a.lane,h=a.eventTime;if((n&f)===f){c!==null&&(c=c.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=t,v=a;switch(f=e,h=r,v.tag){case 1:if(y=v.payload,typeof y=="function"){d=y.call(h,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,f=typeof y=="function"?y.call(h,d,f):y,f==null)break e;d=ke({},d,f);break e;case 2:Vr=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,f=s.effects,f===null?s.effects=[a]:f.push(a))}else h={eventTime:h,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=h,l=d):c=c.next=h,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=d),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);Jn|=o,t.lanes=o,t.memoizedState=d}}function Rf(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(P(191,s));s.call(n)}}}var Lo={},ar=kn(Lo),lo=kn(Lo),uo=kn(Lo);function $n(t){if(t===Lo)throw Error(P(174));return t}function qd(t,e){switch(me(uo,e),me(lo,t),me(ar,Lo),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:rc(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=rc(e,t)}ye(ar),me(ar,e)}function ei(){ye(ar),ye(lo),ye(uo)}function Yg(t){$n(uo.current);var e=$n(ar.current),r=rc(e,t.type);e!==r&&(me(lo,t),me(ar,r))}function Kd(t){lo.current===t&&(ye(ar),ye(lo))}var be=kn(0);function el(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 Cu=[];function Gd(){for(var t=0;t<Cu.length;t++)Cu[t]._workInProgressVersionPrimary=null;Cu.length=0}var Ca=Pr.ReactCurrentDispatcher,Ru=Pr.ReactCurrentBatchConfig,Gn=0,xe=null,Ne=null,Le=null,tl=!1,Vi=!1,co=0,tb=0;function He(){throw Error(P(321))}function Jd(t,e){if(e===null)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!Wt(t[r],e[r]))return!1;return!0}function Qd(t,e,r,n,s,i){if(Gn=i,xe=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Ca.current=t===null||t.memoizedState===null?ib:ob,t=r(n,s),Vi){i=0;do{if(Vi=!1,co=0,25<=i)throw Error(P(301));i+=1,Le=Ne=null,e.updateQueue=null,Ca.current=ab,t=r(n,s)}while(Vi)}if(Ca.current=rl,e=Ne!==null&&Ne.next!==null,Gn=0,Le=Ne=xe=null,tl=!1,e)throw Error(P(300));return t}function Zd(){var t=co!==0;return co=0,t}function Yt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Le===null?xe.memoizedState=Le=t:Le=Le.next=t,Le}function Rt(){if(Ne===null){var t=xe.alternate;t=t!==null?t.memoizedState:null}else t=Ne.next;var e=Le===null?xe.memoizedState:Le.next;if(e!==null)Le=e,Ne=t;else{if(t===null)throw Error(P(310));Ne=t,t={memoizedState:Ne.memoizedState,baseState:Ne.baseState,baseQueue:Ne.baseQueue,queue:Ne.queue,next:null},Le===null?xe.memoizedState=Le=t:Le=Le.next=t}return Le}function ho(t,e){return typeof e=="function"?e(t):e}function Au(t){var e=Rt(),r=e.queue;if(r===null)throw Error(P(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((Gn&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 d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=d,o=n):l=l.next=d,xe.lanes|=c,Jn|=c}u=u.next}while(u!==null&&u!==i);l===null?o=n:l.next=a,Wt(n,e.memoizedState)||(it=!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,xe.lanes|=i,Jn|=i,s=s.next;while(s!==t)}else s===null&&(r.lanes=0);return[e.memoizedState,r.dispatch]}function Pu(t){var e=Rt(),r=e.queue;if(r===null)throw Error(P(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);Wt(i,e.memoizedState)||(it=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),r.lastRenderedState=i}return[i,n]}function Xg(){}function ev(t,e){var r=xe,n=Rt(),s=e(),i=!Wt(n.memoizedState,s);if(i&&(n.memoizedState=s,it=!0),n=n.queue,Yd(nv.bind(null,r,n,t),[t]),n.getSnapshot!==e||i||Le!==null&&Le.memoizedState.tag&1){if(r.flags|=2048,fo(9,rv.bind(null,r,n,s,e),void 0,null),$e===null)throw Error(P(349));Gn&30||tv(r,e,s)}return s}function tv(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},e=xe.updateQueue,e===null?(e={lastEffect:null,stores:null},xe.updateQueue=e,e.stores=[t]):(r=e.stores,r===null?e.stores=[t]:r.push(t))}function rv(t,e,r,n){e.value=r,e.getSnapshot=n,sv(e)&&iv(t)}function nv(t,e,r){return r(function(){sv(e)&&iv(t)})}function sv(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!Wt(t,r)}catch{return!0}}function iv(t){var e=Er(t,1);e!==null&&Ht(e,t,1,-1)}function Af(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:ho,lastRenderedState:t},e.queue=t,t=t.dispatch=sb.bind(null,xe,t),[e.memoizedState,t]}function fo(t,e,r,n){return t={tag:t,create:e,destroy:r,deps:n,next:null},e=xe.updateQueue,e===null?(e={lastEffect:null,stores:null},xe.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 ov(){return Rt().memoizedState}function Ra(t,e,r,n){var s=Yt();xe.flags|=t,s.memoizedState=fo(1|e,r,void 0,n===void 0?null:n)}function Nl(t,e,r,n){var s=Rt();n=n===void 0?null:n;var i=void 0;if(Ne!==null){var o=Ne.memoizedState;if(i=o.destroy,n!==null&&Jd(n,o.deps)){s.memoizedState=fo(e,r,i,n);return}}xe.flags|=t,s.memoizedState=fo(1|e,r,i,n)}function Pf(t,e){return Ra(8390656,8,t,e)}function Yd(t,e){return Nl(2048,8,t,e)}function av(t,e){return Nl(4,2,t,e)}function lv(t,e){return Nl(4,4,t,e)}function uv(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 cv(t,e,r){return r=r!=null?r.concat([t]):null,Nl(4,4,uv.bind(null,e,t),r)}function Xd(){}function dv(t,e){var r=Rt();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&Jd(e,n[1])?n[0]:(r.memoizedState=[t,e],t)}function hv(t,e){var r=Rt();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&Jd(e,n[1])?n[0]:(t=t(),r.memoizedState=[t,e],t)}function fv(t,e,r){return Gn&21?(Wt(r,e)||(r=yg(),xe.lanes|=r,Jn|=r,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,it=!0),t.memoizedState=r)}function rb(t,e){var r=he;he=r!==0&&4>r?r:4,t(!0);var n=Ru.transition;Ru.transition={};try{t(!1),e()}finally{he=r,Ru.transition=n}}function pv(){return Rt().memoizedState}function nb(t,e,r){var n=dn(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},mv(t))gv(e,r);else if(r=Qg(t,e,r,n),r!==null){var s=Ye();Ht(r,t,n,s),vv(r,e,n)}}function sb(t,e,r){var n=dn(t),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(mv(t))gv(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,Wt(a,o)){var l=e.interleaved;l===null?(s.next=s,Hd(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}r=Qg(t,e,s,n),r!==null&&(s=Ye(),Ht(r,t,n,s),vv(r,e,n))}}function mv(t){var e=t.alternate;return t===xe||e!==null&&e===xe}function gv(t,e){Vi=tl=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function vv(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,Pd(t,r)}}var rl={readContext:Ct,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useInsertionEffect:He,useLayoutEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useMutableSource:He,useSyncExternalStore:He,useId:He,unstable_isNewReconciler:!1},ib={readContext:Ct,useCallback:function(t,e){return Yt().memoizedState=[t,e===void 0?null:e],t},useContext:Ct,useEffect:Pf,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,Ra(4194308,4,uv.bind(null,e,t),r)},useLayoutEffect:function(t,e){return Ra(4194308,4,t,e)},useInsertionEffect:function(t,e){return Ra(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=nb.bind(null,xe,t),[n.memoizedState,t]},useRef:function(t){var e=Yt();return t={current:t},e.memoizedState=t},useState:Af,useDebugValue:Xd,useDeferredValue:function(t){return Yt().memoizedState=t},useTransition:function(){var t=Af(!1),e=t[0];return t=rb.bind(null,t[1]),Yt().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=xe,s=Yt();if(_e){if(r===void 0)throw Error(P(407));r=r()}else{if(r=e(),$e===null)throw Error(P(349));Gn&30||tv(n,e,r)}s.memoizedState=r;var i={value:r,getSnapshot:e};return s.queue=i,Pf(nv.bind(null,n,i,t),[t]),n.flags|=2048,fo(9,rv.bind(null,n,i,r,e),void 0,null),r},useId:function(){var t=Yt(),e=$e.identifierPrefix;if(_e){var r=br,n=_r;r=(n&~(1<<32-Vt(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=co++,0<r&&(e+="H"+r.toString(32)),e+=":"}else r=tb++,e=":"+e+"r"+r.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},ob={readContext:Ct,useCallback:dv,useContext:Ct,useEffect:Yd,useImperativeHandle:cv,useInsertionEffect:av,useLayoutEffect:lv,useMemo:hv,useReducer:Au,useRef:ov,useState:function(){return Au(ho)},useDebugValue:Xd,useDeferredValue:function(t){var e=Rt();return fv(e,Ne.memoizedState,t)},useTransition:function(){var t=Au(ho)[0],e=Rt().memoizedState;return[t,e]},useMutableSource:Xg,useSyncExternalStore:ev,useId:pv,unstable_isNewReconciler:!1},ab={readContext:Ct,useCallback:dv,useContext:Ct,useEffect:Yd,useImperativeHandle:cv,useInsertionEffect:av,useLayoutEffect:lv,useMemo:hv,useReducer:Pu,useRef:ov,useState:function(){return Pu(ho)},useDebugValue:Xd,useDeferredValue:function(t){var e=Rt();return Ne===null?e.memoizedState=t:fv(e,Ne.memoizedState,t)},useTransition:function(){var t=Pu(ho)[0],e=Rt().memoizedState;return[t,e]},useMutableSource:Xg,useSyncExternalStore:ev,useId:pv,unstable_isNewReconciler:!1};function $t(t,e){if(t&&t.defaultProps){e=ke({},e),t=t.defaultProps;for(var r in t)e[r]===void 0&&(e[r]=t[r]);return e}return e}function kc(t,e,r,n){e=t.memoizedState,r=r(n,e),r=r==null?e:ke({},e,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var jl={isMounted:function(t){return(t=t._reactInternals)?es(t)===t:!1},enqueueSetState:function(t,e,r){t=t._reactInternals;var n=Ye(),s=dn(t),i=xr(n,s);i.payload=e,r!=null&&(i.callback=r),e=un(t,i,s),e!==null&&(Ht(e,t,s,n),Ta(e,t,s))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=Ye(),s=dn(t),i=xr(n,s);i.tag=1,i.payload=e,r!=null&&(i.callback=r),e=un(t,i,s),e!==null&&(Ht(e,t,s,n),Ta(e,t,s))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=Ye(),n=dn(t),s=xr(r,n);s.tag=2,e!=null&&(s.callback=e),e=un(t,s,n),e!==null&&(Ht(e,t,n,r),Ta(e,t,n))}};function Of(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?!so(r,n)||!so(s,i):!0}function yv(t,e,r){var n=!1,s=mn,i=e.contextType;return typeof i=="object"&&i!==null?i=Ct(i):(s=at(e)?qn:Ge.current,n=e.contextTypes,i=(n=n!=null)?Zs(t,s):mn),e=new e(r,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=jl,t.stateNode=e,e._reactInternals=t,n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=i),e}function Nf(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&&jl.enqueueReplaceState(e,e.state,null)}function Sc(t,e,r,n){var s=t.stateNode;s.props=r,s.state=t.memoizedState,s.refs={},Wd(t);var i=e.contextType;typeof i=="object"&&i!==null?s.context=Ct(i):(i=at(e)?qn:Ge.current,s.context=Zs(t,i)),s.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(kc(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&&jl.enqueueReplaceState(s,s.state,null),Xa(t,r,s,n),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308)}function ti(t,e){try{var r="",n=e;do r+=Lw(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 Ou(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function Ec(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var lb=typeof WeakMap=="function"?WeakMap:Map;function wv(t,e,r){r=xr(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){sl||(sl=!0,Lc=n),Ec(t,e)},r}function _v(t,e,r){r=xr(-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(){Ec(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){Ec(t,e),typeof n!="function"&&(cn===null?cn=new Set([this]):cn.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function jf(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new lb;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=xb.bind(null,t,e,r),e.then(t,t))}function If(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 Lf(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=xr(-1,1),e.tag=2,un(r,e,1))),r.lanes|=1),t)}var ub=Pr.ReactCurrentOwner,it=!1;function Qe(t,e,r,n){e.child=t===null?Jg(e,null,r,n):Xs(e,t.child,r,n)}function $f(t,e,r,n,s){r=r.render;var i=e.ref;return $s(e,s),n=Qd(t,e,r,n,i,s),r=Zd(),t!==null&&!it?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Tr(t,e,s)):(_e&&r&&Md(e),e.flags|=1,Qe(t,e,n,s),e.child)}function Df(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,bv(t,e,i,n,s)):(t=Na(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:so,r(o,n)&&t.ref===e.ref)return Tr(t,e,s)}return e.flags|=1,t=hn(i,n),t.ref=e.ref,t.return=e,e.child=t}function bv(t,e,r,n,s){if(t!==null){var i=t.memoizedProps;if(so(i,n)&&t.ref===e.ref)if(it=!1,e.pendingProps=n=i,(t.lanes&s)!==0)t.flags&131072&&(it=!0);else return e.lanes=t.lanes,Tr(t,e,s)}return Tc(t,e,r,n,s)}function xv(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(Ps,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(Ps,dt),dt|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,me(Ps,dt),dt|=n}else i!==null?(n=i.baseLanes|r,e.memoizedState=null):n=r,me(Ps,dt),dt|=n;return Qe(t,e,s,r),e.child}function kv(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function Tc(t,e,r,n,s){var i=at(r)?qn:Ge.current;return i=Zs(e,i),$s(e,s),r=Qd(t,e,r,n,i,s),n=Zd(),t!==null&&!it?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Tr(t,e,s)):(_e&&n&&Md(e),e.flags|=1,Qe(t,e,r,s),e.child)}function Mf(t,e,r,n,s){if(at(r)){var i=!0;Ga(e)}else i=!1;if($s(e,s),e.stateNode===null)Aa(t,e),yv(e,r,n),Sc(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=Ct(u):(u=at(r)?qn:Ge.current,u=Zs(e,u));var c=r.getDerivedStateFromProps,d=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||l!==u)&&Nf(e,o,n,u),Vr=!1;var f=e.memoizedState;o.state=f,Xa(e,n,o,s),l=e.memoizedState,a!==n||f!==l||ot.current||Vr?(typeof c=="function"&&(kc(e,r,c,n),l=e.memoizedState),(a=Vr||Of(e,r,a,n,f,l,u))?(d||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,Zg(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:$t(e.type,a),o.props=u,d=e.pendingProps,f=o.context,l=r.contextType,typeof l=="object"&&l!==null?l=Ct(l):(l=at(r)?qn:Ge.current,l=Zs(e,l));var h=r.getDerivedStateFromProps;(c=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||f!==l)&&Nf(e,o,n,l),Vr=!1,f=e.memoizedState,o.state=f,Xa(e,n,o,s);var y=e.memoizedState;a!==d||f!==y||ot.current||Vr?(typeof h=="function"&&(kc(e,r,h,n),y=e.memoizedState),(u=Vr||Of(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 Cc(t,e,r,n,i,s)}function Cc(t,e,r,n,s,i){kv(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return s&&kf(e,r,!1),Tr(t,e,i);n=e.stateNode,ub.current=e;var a=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=Xs(e,t.child,null,i),e.child=Xs(e,null,a,i)):Qe(t,e,a,i),e.memoizedState=n.state,s&&kf(e,r,!0),e.child}function Sv(t){var e=t.stateNode;e.pendingContext?xf(t,e.pendingContext,e.pendingContext!==e.context):e.context&&xf(t,e.context,!1),qd(t,e.containerInfo)}function Uf(t,e,r,n,s){return Ys(),Fd(s),e.flags|=256,Qe(t,e,r,n),e.child}var Rc={dehydrated:null,treeContext:null,retryLane:0};function Ac(t){return{baseLanes:t,cachePool:null,transitions:null}}function Ev(t,e,r){var n=e.pendingProps,s=be.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(be,s&1),t===null)return bc(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=$l(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=Ac(r),e.memoizedState=Rc,t):eh(e,o));if(s=t.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return cb(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=hn(s,l),n.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=hn(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?Ac(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=t.childLanes&~r,e.memoizedState=Rc,n}return i=t.child,t=i.sibling,n=hn(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=$l({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function na(t,e,r,n){return n!==null&&Fd(n),Xs(e,t.child,null,r),t=eh(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function cb(t,e,r,n,s,i,o){if(r)return e.flags&256?(e.flags&=-257,n=Ou(Error(P(422))),na(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=n.fallback,s=e.mode,n=$l({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&&Xs(e,t.child,null,o),e.child.memoizedState=Ac(o),e.memoizedState=Rc,i);if(!(e.mode&1))return na(t,e,o,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var a=n.dgst;return n=a,i=Error(P(419)),n=Ou(i,n,void 0),na(t,e,o,n)}if(a=(o&t.childLanes)!==0,it||a){if(n=$e,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,Er(t,s),Ht(n,t,s,-1))}return oh(),n=Ou(Error(P(421))),na(t,e,o,n)}return s.data==="$?"?(e.flags|=128,e.child=t.child,e=kb.bind(null,t),s._reactRetry=e,null):(t=i.treeContext,pt=ln(s.nextSibling),mt=e,_e=!0,Bt=null,t!==null&&(kt[St++]=_r,kt[St++]=br,kt[St++]=Kn,_r=t.id,br=t.overflow,Kn=e),e=eh(e,n.children),e.flags|=4096,e)}function Ff(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),xc(t.return,e,r)}function Nu(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 Tv(t,e,r){var n=e.pendingProps,s=n.revealOrder,i=n.tail;if(Qe(t,e,n.children,r),n=be.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&&Ff(t,r,e);else if(t.tag===19)Ff(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(be,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&&el(t)===null&&(s=r),r=r.sibling;r=s,r===null?(s=e.child,e.child=null):(s=r.sibling,r.sibling=null),Nu(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&&el(t)===null){e.child=s;break}t=s.sibling,s.sibling=r,r=s,s=t}Nu(e,!0,r,null,i);break;case"together":Nu(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Aa(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Tr(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Jn|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(P(153));if(e.child!==null){for(t=e.child,r=hn(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=hn(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function db(t,e,r){switch(e.tag){case 3:Sv(e),Ys();break;case 5:Yg(e);break;case 1:at(e.type)&&Ga(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(be,be.current&1),e.flags|=128,null):r&e.child.childLanes?Ev(t,e,r):(me(be,be.current&1),t=Tr(t,e,r),t!==null?t.sibling:null);me(be,be.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return Tv(t,e,r);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),me(be,be.current),n)break;return null;case 22:case 23:return e.lanes=0,xv(t,e,r)}return Tr(t,e,r)}var Cv,Pc,Rv,Av;Cv=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}};Pc=function(){};Rv=function(t,e,r,n){var s=t.memoizedProps;if(s!==n){t=e.stateNode,$n(ar.current);var i=null;switch(r){case"input":s=Yu(t,s),n=Yu(t,n),i=[];break;case"select":s=ke({},s,{value:void 0}),n=ke({},n,{value:void 0}),i=[];break;case"textarea":s=tc(t,s),n=tc(t,n),i=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=qa)}nc(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"&&(Zi.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"&&(Zi.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)}};Av=function(t,e,r,n){r!==n&&(e.flags|=4)};function Ei(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 We(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 hb(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 We(e),null;case 1:return at(e.type)&&Ka(),We(e),null;case 3:return n=e.stateNode,ei(),ye(ot),ye(Ge),Gd(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(ta(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Bt!==null&&(Mc(Bt),Bt=null))),Pc(t,e),We(e),null;case 5:Kd(e);var s=$n(uo.current);if(r=e.type,t!==null&&e.stateNode!=null)Rv(t,e,r,n,s),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(P(166));return We(e),null}if(t=$n(ar.current),ta(e)){n=e.stateNode,r=e.type;var i=e.memoizedProps;switch(n[sr]=e,n[ao]=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<ji.length;s++)ve(ji[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":Gh(n,i),ve("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},ve("invalid",n);break;case"textarea":Qh(n,i),ve("invalid",n)}nc(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&&ea(n.textContent,a,t),s=["children",a]):typeof a=="number"&&n.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&ea(n.textContent,a,t),s=["children",""+a]):Zi.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&ve("scroll",n)}switch(r){case"input":qo(n),Jh(n,i,!0);break;case"textarea":qo(n),Zh(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=qa)}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=ng(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[sr]=e,t[ao]=n,Cv(t,e,!1,!1),e.stateNode=t;e:{switch(o=sc(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<ji.length;s++)ve(ji[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":Gh(t,n),s=Yu(t,n),ve("invalid",t);break;case"option":s=n;break;case"select":t._wrapperState={wasMultiple:!!n.multiple},s=ke({},n,{value:void 0}),ve("invalid",t);break;case"textarea":Qh(t,n),s=tc(t,n),ve("invalid",t);break;default:s=n}nc(r,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?og(t,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&sg(t,l)):i==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&Yi(t,l):typeof l=="number"&&Yi(t,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Zi.hasOwnProperty(i)?l!=null&&i==="onScroll"&&ve("scroll",t):l!=null&&Sd(t,i,l,o))}switch(r){case"input":qo(t),Jh(t,n,!1);break;case"textarea":qo(t),Zh(t);break;case"option":n.value!=null&&t.setAttribute("value",""+pn(n.value));break;case"select":t.multiple=!!n.multiple,i=n.value,i!=null?Ns(t,!!n.multiple,i,!1):n.defaultValue!=null&&Ns(t,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(t.onclick=qa)}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 We(e),null;case 6:if(t&&e.stateNode!=null)Av(t,e,t.memoizedProps,n);else{if(typeof n!="string"&&e.stateNode===null)throw Error(P(166));if(r=$n(uo.current),$n(ar.current),ta(e)){if(n=e.stateNode,r=e.memoizedProps,n[sr]=e,(i=n.nodeValue!==r)&&(t=mt,t!==null))switch(t.tag){case 3:ea(n.nodeValue,r,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&ea(n.nodeValue,r,(t.mode&1)!==0)}i&&(e.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[sr]=e,e.stateNode=n}return We(e),null;case 13:if(ye(be),n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(_e&&pt!==null&&e.mode&1&&!(e.flags&128))Kg(),Ys(),e.flags|=98560,i=!1;else if(i=ta(e),n!==null&&n.dehydrated!==null){if(t===null){if(!i)throw Error(P(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(P(317));i[sr]=e}else Ys(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;We(e),i=!1}else Bt!==null&&(Mc(Bt),Bt=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||be.current&1?Ie===0&&(Ie=3):oh())),e.updateQueue!==null&&(e.flags|=4),We(e),null);case 4:return ei(),Pc(t,e),t===null&&io(e.stateNode.containerInfo),We(e),null;case 10:return Vd(e.type._context),We(e),null;case 17:return at(e.type)&&Ka(),We(e),null;case 19:if(ye(be),i=e.memoizedState,i===null)return We(e),null;if(n=(e.flags&128)!==0,o=i.rendering,o===null)if(n)Ei(i,!1);else{if(Ie!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=el(t),o!==null){for(e.flags|=128,Ei(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(be,be.current&1|2),e.child}t=t.sibling}i.tail!==null&&Re()>ri&&(e.flags|=128,n=!0,Ei(i,!1),e.lanes=4194304)}else{if(!n)if(t=el(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Ei(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!_e)return We(e),null}else 2*Re()-i.renderingStartTime>ri&&r!==1073741824&&(e.flags|=128,n=!0,Ei(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=Re(),e.sibling=null,r=be.current,me(be,n?r&1|2:r&1),e):(We(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&&(We(e),e.subtreeFlags&6&&(e.flags|=8192)):We(e),null;case 24:return null;case 25:return null}throw Error(P(156,e.tag))}function fb(t,e){switch(Ud(e),e.tag){case 1:return at(e.type)&&Ka(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return ei(),ye(ot),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(be),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(P(340));Ys()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return ye(be),null;case 4:return ei(),null;case 10:return Vd(e.type._context),null;case 22:case 23:return ih(),null;case 24:return null;default:return null}}var sa=!1,Ke=!1,pb=typeof WeakSet=="function"?WeakSet:Set,M=null;function As(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 Oc(t,e,r){try{r()}catch(n){Ce(t,e,n)}}var zf=!1;function mb(t,e){if(pc=Va,t=Ig(),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,d=t,f=null;t:for(;;){for(var h;d!==r||s!==0&&d.nodeType!==3||(a=o+s),d!==i||n!==0&&d.nodeType!==3||(l=o+n),d.nodeType===3&&(o+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===t)break t;if(f===r&&++u===s&&(a=o),f===i&&++c===n&&(l=o),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(mc={focusedElem:t,selectionRange:r},Va=!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 v=y.memoizedProps,w=y.memoizedState,m=e.stateNode,p=m.getSnapshotBeforeUpdate(e.elementType===e.type?v:$t(e.type,v),w);m.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var g=e.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(P(163))}}catch(b){Ce(e,e.return,b)}if(t=e.sibling,t!==null){t.return=e.return,M=t;break}M=e.return}return y=zf,zf=!1,y}function Hi(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&&Oc(e,r,i)}s=s.next}while(s!==n)}}function Il(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 Nc(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 Pv(t){var e=t.alternate;e!==null&&(t.alternate=null,Pv(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[sr],delete e[ao],delete e[yc],delete e[Z_],delete e[Y_])),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 Ov(t){return t.tag===5||t.tag===3||t.tag===4}function Bf(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Ov(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 jc(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=qa));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}function Ic(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(Ic(t,e,r),t=t.sibling;t!==null;)Ic(t,e,r),t=t.sibling}var Ue=null,zt=!1;function Mr(t,e,r){for(r=r.child;r!==null;)Nv(t,e,r),r=r.sibling}function Nv(t,e,r){if(or&&typeof or.onCommitFiberUnmount=="function")try{or.onCommitFiberUnmount(Tl,r)}catch{}switch(r.tag){case 5:Ke||As(r,e);case 6:var n=Ue,s=zt;Ue=null,Mr(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?Eu(t.parentNode,r):t.nodeType===1&&Eu(t,r),ro(t)):Eu(Ue,r.stateNode));break;case 4:n=Ue,s=zt,Ue=r.stateNode.containerInfo,zt=!0,Mr(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)&&Oc(r,e,o),s=s.next}while(s!==n)}Mr(t,e,r);break;case 1:if(!Ke&&(As(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)}Mr(t,e,r);break;case 21:Mr(t,e,r);break;case 22:r.mode&1?(Ke=(n=Ke)||r.memoizedState!==null,Mr(t,e,r),Ke=n):Mr(t,e,r);break;default:Mr(t,e,r)}}function Vf(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new pb),e.forEach(function(n){var s=Sb.bind(null,t,n);r.has(n)||(r.add(n),n.then(s,s))})}}function jt(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(P(160));Nv(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;)jv(e,t),e=e.sibling}function jv(t,e){var r=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(jt(e,t),Qt(t),n&4){try{Hi(3,t,t.return),Il(3,t)}catch(v){Ce(t,t.return,v)}try{Hi(5,t,t.return)}catch(v){Ce(t,t.return,v)}}break;case 1:jt(e,t),Qt(t),n&512&&r!==null&&As(r,r.return);break;case 5:if(jt(e,t),Qt(t),n&512&&r!==null&&As(r,r.return),t.flags&32){var s=t.stateNode;try{Yi(s,"")}catch(v){Ce(t,t.return,v)}}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&&tg(s,i),sc(a,o);var u=sc(a,i);for(o=0;o<l.length;o+=2){var c=l[o],d=l[o+1];c==="style"?og(s,d):c==="dangerouslySetInnerHTML"?sg(s,d):c==="children"?Yi(s,d):Sd(s,c,d,u)}switch(a){case"input":Xu(s,i);break;case"textarea":rg(s,i);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?Ns(s,!!i.multiple,h,!1):f!==!!i.multiple&&(i.defaultValue!=null?Ns(s,!!i.multiple,i.defaultValue,!0):Ns(s,!!i.multiple,i.multiple?[]:"",!1))}s[ao]=i}catch(v){Ce(t,t.return,v)}}break;case 6:if(jt(e,t),Qt(t),n&4){if(t.stateNode===null)throw Error(P(162));s=t.stateNode,i=t.memoizedProps;try{s.nodeValue=i}catch(v){Ce(t,t.return,v)}}break;case 3:if(jt(e,t),Qt(t),n&4&&r!==null&&r.memoizedState.isDehydrated)try{ro(e.containerInfo)}catch(v){Ce(t,t.return,v)}break;case 4:jt(e,t),Qt(t);break;case 13:jt(e,t),Qt(t),s=t.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(nh=Re())),n&4&&Vf(t);break;case 22:if(c=r!==null&&r.memoizedState!==null,t.mode&1?(Ke=(u=Ke)||c,jt(e,t),Ke=u):jt(e,t),Qt(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(d=M=c;M!==null;){switch(f=M,h=f.child,f.tag){case 0:case 11:case 14:case 15:Hi(4,f,f.return);break;case 1:As(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(v){Ce(n,r,v)}}break;case 5:As(f,f.return);break;case 22:if(f.memoizedState!==null){Wf(d);continue}}h!==null?(h.return=f,M=h):Wf(d)}c=c.sibling}e:for(c=null,d=t;;){if(d.tag===5){if(c===null){c=d;try{s=d.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=ig("display",o))}catch(v){Ce(t,t.return,v)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(v){Ce(t,t.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===t)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:jt(e,t),Qt(t),n&4&&Vf(t);break;case 21:break;default:jt(e,t),Qt(t)}}function Qt(t){var e=t.flags;if(e&2){try{e:{for(var r=t.return;r!==null;){if(Ov(r)){var n=r;break e}r=r.return}throw Error(P(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(Yi(s,""),n.flags&=-33);var i=Bf(t);Ic(t,i,s);break;case 3:case 4:var o=n.stateNode.containerInfo,a=Bf(t);jc(t,a,o);break;default:throw Error(P(161))}}catch(l){Ce(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function gb(t,e,r){M=t,Iv(t)}function Iv(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||sa;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||Ke;a=sa;var u=Ke;if(sa=o,(Ke=l)&&!u)for(M=s;M!==null;)o=M,l=o.child,o.tag===22&&o.memoizedState!==null?qf(s):l!==null?(l.return=o,M=l):qf(s);for(;i!==null;)M=i,Iv(i),i=i.sibling;M=s,sa=a,Ke=u}Hf(t)}else s.subtreeFlags&8772&&i!==null?(i.return=s,M=i):Hf(t)}}function Hf(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||Il(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:$t(e.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&Rf(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}Rf(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 d=c.dehydrated;d!==null&&ro(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(P(163))}Ke||e.flags&512&&Nc(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 Wf(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 qf(t){for(;M!==null;){var e=M;try{switch(e.tag){case 0:case 11:case 15:var r=e.return;try{Il(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{Nc(e)}catch(l){Ce(e,i,l)}break;case 5:var o=e.return;try{Nc(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 vb=Math.ceil,nl=Pr.ReactCurrentDispatcher,th=Pr.ReactCurrentOwner,Tt=Pr.ReactCurrentBatchConfig,ae=0,$e=null,Oe=null,Fe=0,dt=0,Ps=kn(0),Ie=0,po=null,Jn=0,Ll=0,rh=0,Wi=null,st=null,nh=0,ri=1/0,mr=null,sl=!1,Lc=null,cn=null,ia=!1,tn=null,il=0,qi=0,$c=null,Pa=-1,Oa=0;function Ye(){return ae&6?Re():Pa!==-1?Pa:Pa=Re()}function dn(t){return t.mode&1?ae&2&&Fe!==0?Fe&-Fe:eb.transition!==null?(Oa===0&&(Oa=yg()),Oa):(t=he,t!==0||(t=window.event,t=t===void 0?16:Eg(t.type)),t):1}function Ht(t,e,r,n){if(50<qi)throw qi=0,$c=null,Error(P(185));No(t,r,n),(!(ae&2)||t!==$e)&&(t===$e&&(!(ae&2)&&(Ll|=r),Ie===4&&qr(t,Fe)),lt(t,n),r===1&&ae===0&&!(e.mode&1)&&(ri=Re()+500,Ol&&Sn()))}function lt(t,e){var r=t.callbackNode;e_(t,e);var n=Ba(t,t===$e?Fe:0);if(n===0)r!==null&&ef(r),t.callbackNode=null,t.callbackPriority=0;else if(e=n&-n,t.callbackPriority!==e){if(r!=null&&ef(r),e===1)t.tag===0?X_(Kf.bind(null,t)):Hg(Kf.bind(null,t)),J_(function(){!(ae&6)&&Sn()}),r=null;else{switch(wg(n)){case 1:r=Ad;break;case 4:r=gg;break;case 16:r=za;break;case 536870912:r=vg;break;default:r=za}r=Bv(r,Lv.bind(null,t))}t.callbackPriority=e,t.callbackNode=r}}function Lv(t,e){if(Pa=-1,Oa=0,ae&6)throw Error(P(327));var r=t.callbackNode;if(Ds()&&t.callbackNode!==r)return null;var n=Ba(t,t===$e?Fe:0);if(n===0)return null;if(n&30||n&t.expiredLanes||e)e=ol(t,n);else{e=n;var s=ae;ae|=2;var i=Dv();($e!==t||Fe!==e)&&(mr=null,ri=Re()+500,Hn(t,e));do try{_b();break}catch(a){$v(t,a)}while(!0);Bd(),nl.current=i,ae=s,Oe!==null?e=0:($e=null,Fe=0,e=Ie)}if(e!==0){if(e===2&&(s=uc(t),s!==0&&(n=s,e=Dc(t,s))),e===1)throw r=po,Hn(t,0),qr(t,n),lt(t,Re()),r;if(e===6)qr(t,n);else{if(s=t.current.alternate,!(n&30)&&!yb(s)&&(e=ol(t,n),e===2&&(i=uc(t),i!==0&&(n=i,e=Dc(t,i))),e===1))throw r=po,Hn(t,0),qr(t,n),lt(t,Re()),r;switch(t.finishedWork=s,t.finishedLanes=n,e){case 0:case 1:throw Error(P(345));case 2:On(t,st,mr);break;case 3:if(qr(t,n),(n&130023424)===n&&(e=nh+500-Re(),10<e)){if(Ba(t,0)!==0)break;if(s=t.suspendedLanes,(s&n)!==n){Ye(),t.pingedLanes|=t.suspendedLanes&s;break}t.timeoutHandle=vc(On.bind(null,t,st,mr),e);break}On(t,st,mr);break;case 4:if(qr(t,n),(n&4194240)===n)break;for(e=t.eventTimes,s=-1;0<n;){var o=31-Vt(n);i=1<<o,o=e[o],o>s&&(s=o),n&=~i}if(n=s,n=Re()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*vb(n/1960))-n,10<n){t.timeoutHandle=vc(On.bind(null,t,st,mr),n);break}On(t,st,mr);break;case 5:On(t,st,mr);break;default:throw Error(P(329))}}}return lt(t,Re()),t.callbackNode===r?Lv.bind(null,t):null}function Dc(t,e){var r=Wi;return t.current.memoizedState.isDehydrated&&(Hn(t,e).flags|=256),t=ol(t,e),t!==2&&(e=st,st=r,e!==null&&Mc(e)),t}function Mc(t){st===null?st=t:st.push.apply(st,t)}function yb(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(!Wt(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 qr(t,e){for(e&=~rh,e&=~Ll,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-Vt(e),n=1<<r;t[r]=-1,e&=~n}}function Kf(t){if(ae&6)throw Error(P(327));Ds();var e=Ba(t,0);if(!(e&1))return lt(t,Re()),null;var r=ol(t,e);if(t.tag!==0&&r===2){var n=uc(t);n!==0&&(e=n,r=Dc(t,n))}if(r===1)throw r=po,Hn(t,0),qr(t,e),lt(t,Re()),r;if(r===6)throw Error(P(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,On(t,st,mr),lt(t,Re()),null}function sh(t,e){var r=ae;ae|=1;try{return t(e)}finally{ae=r,ae===0&&(ri=Re()+500,Ol&&Sn())}}function Qn(t){tn!==null&&tn.tag===0&&!(ae&6)&&Ds();var e=ae;ae|=1;var r=Tt.transition,n=he;try{if(Tt.transition=null,he=1,t)return t()}finally{he=n,Tt.transition=r,ae=e,!(ae&6)&&Sn()}}function ih(){dt=Ps.current,ye(Ps)}function Hn(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(r!==-1&&(t.timeoutHandle=-1,G_(r)),Oe!==null)for(r=Oe.return;r!==null;){var n=r;switch(Ud(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Ka();break;case 3:ei(),ye(ot),ye(Ge),Gd();break;case 5:Kd(n);break;case 4:ei();break;case 13:ye(be);break;case 19:ye(be);break;case 10:Vd(n.type._context);break;case 22:case 23:ih()}r=r.return}if($e=t,Oe=t=hn(t.current,null),Fe=dt=e,Ie=0,po=null,rh=Ll=Jn=0,st=Wi=null,Ln!==null){for(e=0;e<Ln.length;e++)if(r=Ln[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}Ln=null}return t}function $v(t,e){do{var r=Oe;try{if(Bd(),Ca.current=rl,tl){for(var n=xe.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}tl=!1}if(Gn=0,Le=Ne=xe=null,Vi=!1,co=0,th.current=null,r===null||r.return===null){Ie=1,po=e,Oe=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,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var h=If(o);if(h!==null){h.flags&=-257,Lf(h,o,a,i,e),h.mode&1&&jf(i,u,e),e=h,l=u;var y=e.updateQueue;if(y===null){var v=new Set;v.add(l),e.updateQueue=v}else y.add(l);break e}else{if(!(e&1)){jf(i,u,e),oh();break e}l=Error(P(426))}}else if(_e&&a.mode&1){var w=If(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Lf(w,o,a,i,e),Fd(ti(l,a));break e}}i=l=ti(l,a),Ie!==4&&(Ie=2),Wi===null?Wi=[i]:Wi.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var m=wv(i,l,e);Cf(i,m);break e;case 1:a=l;var p=i.type,g=i.stateNode;if(!(i.flags&128)&&(typeof p.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(cn===null||!cn.has(g)))){i.flags|=65536,e&=-e,i.lanes|=e;var b=_v(i,a,e);Cf(i,b);break e}}i=i.return}while(i!==null)}Uv(r)}catch(k){e=k,Oe===r&&r!==null&&(Oe=r=r.return);continue}break}while(!0)}function Dv(){var t=nl.current;return nl.current=rl,t===null?rl:t}function oh(){(Ie===0||Ie===3||Ie===2)&&(Ie=4),$e===null||!(Jn&268435455)&&!(Ll&268435455)||qr($e,Fe)}function ol(t,e){var r=ae;ae|=2;var n=Dv();($e!==t||Fe!==e)&&(mr=null,Hn(t,e));do try{wb();break}catch(s){$v(t,s)}while(!0);if(Bd(),ae=r,nl.current=n,Oe!==null)throw Error(P(261));return $e=null,Fe=0,Ie}function wb(){for(;Oe!==null;)Mv(Oe)}function _b(){for(;Oe!==null&&!Ww();)Mv(Oe)}function Mv(t){var e=zv(t.alternate,t,dt);t.memoizedProps=t.pendingProps,e===null?Uv(t):Oe=e,th.current=null}function Uv(t){var e=t;do{var r=e.alternate;if(t=e.return,e.flags&32768){if(r=fb(r,e),r!==null){r.flags&=32767,Oe=r;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Ie=6,Oe=null;return}}else if(r=hb(r,e,dt),r!==null){Oe=r;return}if(e=e.sibling,e!==null){Oe=e;return}Oe=e=t}while(e!==null);Ie===0&&(Ie=5)}function On(t,e,r){var n=he,s=Tt.transition;try{Tt.transition=null,he=1,bb(t,e,r,n)}finally{Tt.transition=s,he=n}return null}function bb(t,e,r,n){do Ds();while(tn!==null);if(ae&6)throw Error(P(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(P(177));t.callbackNode=null,t.callbackPriority=0;var i=r.lanes|r.childLanes;if(t_(t,i),t===$e&&(Oe=$e=null,Fe=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||ia||(ia=!0,Bv(za,function(){return Ds(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=Tt.transition,Tt.transition=null;var o=he;he=1;var a=ae;ae|=4,th.current=null,mb(t,r),jv(r,t),z_(mc),Va=!!pc,mc=pc=null,t.current=r,gb(r),qw(),ae=a,he=o,Tt.transition=i}else t.current=r;if(ia&&(ia=!1,tn=t,il=s),i=t.pendingLanes,i===0&&(cn=null),Jw(r.stateNode),lt(t,Re()),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(sl)throw sl=!1,t=Lc,Lc=null,t;return il&1&&t.tag!==0&&Ds(),i=t.pendingLanes,i&1?t===$c?qi++:(qi=0,$c=t):qi=0,Sn(),null}function Ds(){if(tn!==null){var t=wg(il),e=Tt.transition,r=he;try{if(Tt.transition=null,he=16>t?16:t,tn===null)var n=!1;else{if(t=tn,tn=null,il=0,ae&6)throw Error(P(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:Hi(8,c,i)}var d=c.child;if(d!==null)d.return=c,M=d;else for(;M!==null;){c=M;var f=c.sibling,h=c.return;if(Pv(c),c===u){M=null;break}if(f!==null){f.return=h,M=f;break}M=h}}}var y=i.alternate;if(y!==null){var v=y.child;if(v!==null){y.child=null;do{var w=v.sibling;v.sibling=null,v=w}while(v!==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:Hi(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 g=o.child;if(o.subtreeFlags&2064&&g!==null)g.return=o,M=g;else e:for(o=p;M!==null;){if(a=M,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Il(9,a)}}catch(k){Ce(a,a.return,k)}if(a===o){M=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,M=b;break e}M=a.return}}if(ae=s,Sn(),or&&typeof or.onPostCommitFiberRoot=="function")try{or.onPostCommitFiberRoot(Tl,t)}catch{}n=!0}return n}finally{he=r,Tt.transition=e}}return!1}function Gf(t,e,r){e=ti(r,e),e=wv(t,e,1),t=un(t,e,1),e=Ye(),t!==null&&(No(t,1,e),lt(t,e))}function Ce(t,e,r){if(t.tag===3)Gf(t,t,r);else for(;e!==null;){if(e.tag===3){Gf(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(cn===null||!cn.has(n))){t=ti(r,t),t=_v(e,t,1),e=un(e,t,1),t=Ye(),e!==null&&(No(e,1,t),lt(e,t));break}}e=e.return}}function xb(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),e=Ye(),t.pingedLanes|=t.suspendedLanes&r,$e===t&&(Fe&r)===r&&(Ie===4||Ie===3&&(Fe&130023424)===Fe&&500>Re()-nh?Hn(t,0):rh|=r),lt(t,e)}function Fv(t,e){e===0&&(t.mode&1?(e=Jo,Jo<<=1,!(Jo&130023424)&&(Jo=4194304)):e=1);var r=Ye();t=Er(t,e),t!==null&&(No(t,e,r),lt(t,r))}function kb(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),Fv(t,r)}function Sb(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(P(314))}n!==null&&n.delete(e),Fv(t,r)}var zv;zv=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||ot.current)it=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return it=!1,db(t,e,r);it=!!(t.flags&131072)}else it=!1,_e&&e.flags&1048576&&Wg(e,Qa,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;Aa(t,e),t=e.pendingProps;var s=Zs(e,Ge.current);$s(e,r),s=Qd(null,e,n,t,s,r);var i=Zd();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,at(n)?(i=!0,Ga(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Wd(e),s.updater=jl,e.stateNode=s,s._reactInternals=e,Sc(e,n,t,r),e=Cc(null,e,n,!0,i,r)):(e.tag=0,_e&&i&&Md(e),Qe(null,e,s,r),e=e.child),e;case 16:n=e.elementType;e:{switch(Aa(t,e),t=e.pendingProps,s=n._init,n=s(n._payload),e.type=n,s=e.tag=Tb(n),t=$t(n,t),s){case 0:e=Tc(null,e,n,t,r);break e;case 1:e=Mf(null,e,n,t,r);break e;case 11:e=$f(null,e,n,t,r);break e;case 14:e=Df(null,e,n,$t(n.type,t),r);break e}throw Error(P(306,n,""))}return e;case 0:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:$t(n,s),Tc(t,e,n,s,r);case 1:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:$t(n,s),Mf(t,e,n,s,r);case 3:e:{if(Sv(e),t===null)throw Error(P(387));n=e.pendingProps,i=e.memoizedState,s=i.element,Zg(t,e),Xa(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=ti(Error(P(423)),e),e=Uf(t,e,n,r,s);break e}else if(n!==s){s=ti(Error(P(424)),e),e=Uf(t,e,n,r,s);break e}else for(pt=ln(e.stateNode.containerInfo.firstChild),mt=e,_e=!0,Bt=null,r=Jg(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Ys(),n===s){e=Tr(t,e,r);break e}Qe(t,e,n,r)}e=e.child}return e;case 5:return Yg(e),t===null&&bc(e),n=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,o=s.children,gc(n,s)?o=null:i!==null&&gc(n,i)&&(e.flags|=32),kv(t,e),Qe(t,e,o,r),e.child;case 6:return t===null&&bc(e),null;case 13:return Ev(t,e,r);case 4:return qd(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Xs(e,null,n,r):Qe(t,e,n,r),e.child;case 11:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:$t(n,s),$f(t,e,n,s,r);case 7:return Qe(t,e,e.pendingProps,r),e.child;case 8:return Qe(t,e,e.pendingProps.children,r),e.child;case 12:return Qe(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(Wt(i.value,o)){if(i.children===s.children&&!ot.current){e=Tr(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=xr(-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),xc(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(P(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),xc(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}Qe(t,e,s.children,r),e=e.child}return e;case 9:return s=e.type,n=e.pendingProps.children,$s(e,r),s=Ct(s),n=n(s),e.flags|=1,Qe(t,e,n,r),e.child;case 14:return n=e.type,s=$t(n,e.pendingProps),s=$t(n.type,s),Df(t,e,n,s,r);case 15:return bv(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:$t(n,s),Aa(t,e),e.tag=1,at(n)?(t=!0,Ga(e)):t=!1,$s(e,r),yv(e,n,s),Sc(e,n,s,r),Cc(null,e,n,!0,t,r);case 19:return Tv(t,e,r);case 22:return xv(t,e,r)}throw Error(P(156,e.tag))};function Bv(t,e){return mg(t,e)}function Eb(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 Et(t,e,r,n){return new Eb(t,e,r,n)}function ah(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Tb(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 hn(t,e){var r=t.alternate;return r===null?(r=Et(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 Na(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 _s:return Wn(r.children,s,i,e);case Ed:o=8,s|=8;break;case Gu:return t=Et(12,r,e,s|2),t.elementType=Gu,t.lanes=i,t;case Ju:return t=Et(13,r,e,s),t.elementType=Ju,t.lanes=i,t;case Qu:return t=Et(19,r,e,s),t.elementType=Qu,t.lanes=i,t;case Ym:return $l(r,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Qm:o=10;break e;case Zm:o=9;break e;case Td:o=11;break e;case Cd:o=14;break e;case Br:o=16,n=null;break e}throw Error(P(130,t==null?t:typeof t,""))}return e=Et(o,r,e,s),e.elementType=t,e.type=n,e.lanes=i,e}function Wn(t,e,r,n){return t=Et(7,t,n,e),t.lanes=r,t}function $l(t,e,r,n){return t=Et(22,t,n,e),t.elementType=Ym,t.lanes=r,t.stateNode={isHidden:!1},t}function ju(t,e,r){return t=Et(6,t,null,e),t.lanes=r,t}function Iu(t,e,r){return e=Et(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Cb(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=pu(0),this.expirationTimes=pu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pu(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function lh(t,e,r,n,s,i,o,a,l){return t=new Cb(t,e,r,a,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Et(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wd(i),t}function Rb(t,e,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ws,key:n==null?null:""+n,children:t,containerInfo:e,implementation:r}}function Vv(t){if(!t)return mn;t=t._reactInternals;e:{if(es(t)!==t||t.tag!==1)throw Error(P(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(at(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(P(171))}if(t.tag===1){var r=t.type;if(at(r))return Vg(t,r,e)}return e}function Hv(t,e,r,n,s,i,o,a,l){return t=lh(r,n,!0,t,s,i,o,a,l),t.context=Vv(null),r=t.current,n=Ye(),s=dn(r),i=xr(n,s),i.callback=e??null,un(r,i,s),t.current.lanes=s,No(t,s,n),lt(t,n),t}function Dl(t,e,r,n){var s=e.current,i=Ye(),o=dn(s);return r=Vv(r),e.context===null?e.context=r:e.pendingContext=r,e=xr(i,o),e.payload={element:t},n=n===void 0?null:n,n!==null&&(e.callback=n),t=un(s,e,o),t!==null&&(Ht(t,s,o,i),Ta(t,s,o)),o}function al(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 Jf(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){Jf(t,e),(t=t.alternate)&&Jf(t,e)}function Ab(){return null}var Wv=typeof reportError=="function"?reportError:function(t){console.error(t)};function ch(t){this._internalRoot=t}Ml.prototype.render=ch.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(P(409));Dl(t,e,null,null)};Ml.prototype.unmount=ch.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Qn(function(){Dl(null,t,null,null)}),e[Sr]=null}};function Ml(t){this._internalRoot=t}Ml.prototype.unstable_scheduleHydration=function(t){if(t){var e=xg();t={blockedOn:null,target:t,priority:e};for(var r=0;r<Wr.length&&e!==0&&e<Wr[r].priority;r++);Wr.splice(r,0,t),r===0&&Sg(t)}};function dh(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Ul(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Qf(){}function Pb(t,e,r,n,s){if(s){if(typeof n=="function"){var i=n;n=function(){var u=al(o);i.call(u)}}var o=Hv(e,n,t,0,null,!1,!1,"",Qf);return t._reactRootContainer=o,t[Sr]=o.current,io(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=al(l);a.call(u)}}var l=lh(t,0,!1,null,null,!1,!1,"",Qf);return t._reactRootContainer=l,t[Sr]=l.current,io(t.nodeType===8?t.parentNode:t),Qn(function(){Dl(e,l,r,n)}),l}function Fl(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=al(o);a.call(l)}}Dl(e,o,t,s)}else o=Pb(r,e,t,s,n);return al(o)}_g=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var r=Ni(e.pendingLanes);r!==0&&(Pd(e,r|1),lt(e,Re()),!(ae&6)&&(ri=Re()+500,Sn()))}break;case 13:Qn(function(){var n=Er(t,1);if(n!==null){var s=Ye();Ht(n,t,1,s)}}),uh(t,1)}};Od=function(t){if(t.tag===13){var e=Er(t,134217728);if(e!==null){var r=Ye();Ht(e,t,134217728,r)}uh(t,134217728)}};bg=function(t){if(t.tag===13){var e=dn(t),r=Er(t,e);if(r!==null){var n=Ye();Ht(r,t,e,n)}uh(t,e)}};xg=function(){return he};kg=function(t,e){var r=he;try{return he=t,e()}finally{he=r}};oc=function(t,e,r){switch(e){case"input":if(Xu(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=Pl(n);if(!s)throw Error(P(90));eg(n),Xu(n,s)}}}break;case"textarea":rg(t,r);break;case"select":e=r.value,e!=null&&Ns(t,!!r.multiple,e,!1)}};ug=sh;cg=Qn;var Ob={usingClientEntryPoint:!1,Events:[Io,Ss,Pl,ag,lg,sh]},Ti={findFiberByHostInstance:In,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Nb={bundleType:Ti.bundleType,version:Ti.version,rendererPackageName:Ti.rendererPackageName,rendererConfig:Ti.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Pr.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=fg(t),t===null?null:t.stateNode},findFiberByHostInstance:Ti.findFiberByHostInstance||Ab,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 oa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!oa.isDisabled&&oa.supportsFiber)try{Tl=oa.inject(Nb),or=oa}catch{}}wt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ob;wt.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!dh(e))throw Error(P(200));return Rb(t,e,null,r)};wt.createRoot=function(t,e){if(!dh(t))throw Error(P(299));var r=!1,n="",s=Wv;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[Sr]=e.current,io(t.nodeType===8?t.parentNode:t),new ch(e)};wt.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(P(188)):(t=Object.keys(t).join(","),Error(P(268,t)));return t=fg(e),t=t===null?null:t.stateNode,t};wt.flushSync=function(t){return Qn(t)};wt.hydrate=function(t,e,r){if(!Ul(e))throw Error(P(200));return Fl(null,t,e,!0,r)};wt.hydrateRoot=function(t,e,r){if(!dh(t))throw Error(P(405));var n=r!=null&&r.hydratedSources||null,s=!1,i="",o=Wv;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),e=Hv(e,null,t,1,r??null,s,!1,i,o),t[Sr]=e.current,io(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 Ml(e)};wt.render=function(t,e,r){if(!Ul(e))throw Error(P(200));return Fl(null,t,e,!1,r)};wt.unmountComponentAtNode=function(t){if(!Ul(t))throw Error(P(40));return t._reactRootContainer?(Qn(function(){Fl(null,null,t,!1,function(){t._reactRootContainer=null,t[Sr]=null})}),!0):!1};wt.unstable_batchedUpdates=sh;wt.unstable_renderSubtreeIntoContainer=function(t,e,r,n){if(!Ul(r))throw Error(P(200));if(t==null||t._reactInternals===void 0)throw Error(P(38));return Fl(t,e,r,!1,n)};wt.version="18.3.1-next-f1338f8080-20240426";function qv(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(qv)}catch(t){console.error(t)}}qv(),qm.exports=wt;var $o=qm.exports;const Kv=jm($o);var Gv,Zf=$o;Gv=Zf.createRoot,Zf.hydrateRoot;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(){}},Bl=typeof window>"u"||"Deno"in globalThis;function Dt(){}function jb(t,e){return typeof t=="function"?t(e):t}function Ib(t){return typeof t=="number"&&t>=0&&t!==1/0}function Lb(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Uc(t,e){return typeof t=="function"?t(e):t}function $b(t,e){return typeof t=="function"?t(e):t}function Yf(t,e){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:o,stale:a}=t;if(o){if(n){if(e.queryHash!==hh(o,e.options))return!1}else if(!go(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 Xf(t,e){const{exact:r,status:n,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(r){if(mo(e.options.mutationKey)!==mo(i))return!1}else if(!go(e.options.mutationKey,i))return!1}return!(n&&e.state.status!==n||s&&!s(e))}function hh(t,e){return((e==null?void 0:e.queryKeyHashFn)||mo)(t)}function mo(t){return JSON.stringify(t,(e,r)=>Fc(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function go(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(r=>go(t[r],e[r])):!1}function Jv(t,e){if(t===e)return t;const r=ep(t)&&ep(e);if(r||Fc(t)&&Fc(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 d=r?c:i[c];(!r&&l.has(d)||r)&&t[d]===void 0&&e[d]===void 0?(a[d]=void 0,u++):(a[d]=Jv(t[d],e[d]),a[d]===t[d]&&t[d]!==void 0&&u++)}return s===o&&u===s?t:a}return e}function ep(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Fc(t){if(!tp(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!tp(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function tp(t){return Object.prototype.toString.call(t)==="[object Object]"}function Db(t){return new Promise(e=>{setTimeout(e,t)})}function Mb(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?Jv(t,e):e}function Ub(t,e,r=0){const n=[...t,e];return r&&n.length>r?n.slice(1):n}function Fb(t,e,r=0){const n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var fh=Symbol();function Qv(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===fh?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Mn,Jr,Bs,Em,zb=(Em=class extends zl{constructor(){super();ue(this,Mn);ue(this,Jr);ue(this,Bs);Z(this,Bs,e=>{if(!Bl&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){T(this,Jr)||this.setEventListener(T(this,Bs))}onUnsubscribe(){var e;this.hasListeners()||((e=T(this,Jr))==null||e.call(this),Z(this,Jr,void 0))}setEventListener(e){var r;Z(this,Bs,e),(r=T(this,Jr))==null||r.call(this),Z(this,Jr,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){T(this,Mn)!==e&&(Z(this,Mn,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof T(this,Mn)=="boolean"?T(this,Mn):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Mn=new WeakMap,Jr=new WeakMap,Bs=new WeakMap,Em),Zv=new zb,Vs,Qr,Hs,Tm,Bb=(Tm=class extends zl{constructor(){super();ue(this,Vs,!0);ue(this,Qr);ue(this,Hs);Z(this,Hs,e=>{if(!Bl&&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,Hs))}onUnsubscribe(){var e;this.hasListeners()||((e=T(this,Qr))==null||e.call(this),Z(this,Qr,void 0))}setEventListener(e){var r;Z(this,Hs,e),(r=T(this,Qr))==null||r.call(this),Z(this,Qr,e(this.setOnline.bind(this)))}setOnline(e){T(this,Vs)!==e&&(Z(this,Vs,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return T(this,Vs)}},Vs=new WeakMap,Qr=new WeakMap,Hs=new WeakMap,Tm),ll=new Bb;function Vb(){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 Hb(t){return Math.min(1e3*2**t,3e4)}function Yv(t){return(t??"online")==="online"?ll.isOnline():!0}var Xv=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Lu(t){return t instanceof Xv}function ey(t){let e=!1,r=0,n=!1,s;const i=Vb(),o=v=>{var w;n||(f(new Xv(v)),(w=t.abort)==null||w.call(t))},a=()=>{e=!0},l=()=>{e=!1},u=()=>Zv.isFocused()&&(t.networkMode==="always"||ll.isOnline())&&t.canRun(),c=()=>Yv(t.networkMode)&&t.canRun(),d=v=>{var w;n||(n=!0,(w=t.onSuccess)==null||w.call(t,v),s==null||s(),i.resolve(v))},f=v=>{var w;n||(n=!0,(w=t.onError)==null||w.call(t,v),s==null||s(),i.reject(v))},h=()=>new Promise(v=>{var w;s=m=>{(n||u())&&v(m)},(w=t.onPause)==null||w.call(t)}).then(()=>{var v;s=void 0,n||(v=t.onContinue)==null||v.call(t)}),y=()=>{if(n)return;let v;const w=r===0?t.initialPromise:void 0;try{v=w??t.fn()}catch(m){v=Promise.reject(m)}Promise.resolve(v).then(d).catch(m=>{var S;if(n)return;const p=t.retry??(Bl?0:3),g=t.retryDelay??Hb,b=typeof g=="function"?g(r,m):g,k=p===!0||typeof p=="number"&&r<p||typeof p=="function"&&p(r,m);if(e||!k){f(m);return}r++,(S=t.onFail)==null||S.call(t,r,m),Db(b).then(()=>u()?void 0:h()).then(()=>{e?f(m):y()})})};return{promise:i,cancel:o,continue:()=>(s==null||s(),i),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?y():h().then(y),i)}}var Wb=t=>setTimeout(t,0);function qb(){let t=[],e=0,r=a=>{a()},n=a=>{a()},s=Wb;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 Ze=qb(),Un,Cm,ty=(Cm=class{constructor(){ue(this,Un)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ib(this.gcTime)&&Z(this,Un,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Bl?1/0:5*60*1e3))}clearGcTimeout(){T(this,Un)&&(clearTimeout(T(this,Un)),Z(this,Un,void 0))}},Un=new WeakMap,Cm),Ws,Fn,xt,zn,qe,Ao,Bn,Ut,pr,Rm,Kb=(Rm=class extends ty{constructor(e){super();ue(this,Ut);ue(this,Ws);ue(this,Fn);ue(this,xt);ue(this,zn);ue(this,qe);ue(this,Ao);ue(this,Bn);Z(this,Bn,!1),Z(this,Ao,e.defaultOptions),this.setOptions(e.options),this.observers=[],Z(this,zn,e.client),Z(this,xt,T(this,zn).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Z(this,Ws,Jb(this.options)),this.state=e.state??T(this,Ws),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,Ao),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,xt).remove(this)}setData(e,r){const n=Mb(this.state.data,e,this.options);return Ve(this,Ut,pr).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,Ut,pr).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(Dt).catch(Dt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(T(this,Ws))}isActive(){return this.observers.some(e=>$b(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===fh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Uc(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:!Lb(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,xt).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,xt).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ve(this,Ut,pr).call(this,{type:"invalidate"})}fetch(e,r){var u,c,d;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(h=>h.options.queryFn);f&&this.setOptions(f.options)}const n=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(Z(this,Bn,!0),n.signal)})},i=()=>{const f=Qv(this.options,r),y=(()=>{const v={client:T(this,zn),queryKey:this.queryKey,meta:this.meta};return s(v),v})();return Z(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,zn),state:this.state,fetchFn:i};return s(f),f})();(u=this.options.behavior)==null||u.onFetch(a,this),Z(this,Fn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&Ve(this,Ut,pr).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const l=f=>{var h,y,v,w;Lu(f)&&f.silent||Ve(this,Ut,pr).call(this,{type:"error",error:f}),Lu(f)||((y=(h=T(this,xt).config).onError)==null||y.call(h,f,this),(w=(v=T(this,xt).config).onSettled)==null||w.call(v,this.state.data,f,this)),this.scheduleGc()};return Z(this,qe,ey({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{var h,y,v,w;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(m){l(m);return}(y=(h=T(this,xt).config).onSuccess)==null||y.call(h,f,this),(w=(v=T(this,xt).config).onSettled)==null||w.call(v,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,h)=>{Ve(this,Ut,pr).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{Ve(this,Ut,pr).call(this,{type:"pause"})},onContinue:()=>{Ve(this,Ut,pr).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),T(this,qe).start()}},Ws=new WeakMap,Fn=new WeakMap,xt=new WeakMap,zn=new WeakMap,qe=new WeakMap,Ao=new WeakMap,Bn=new WeakMap,Ut=new WeakSet,pr=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,...Gb(n.data,this.options),fetchMeta:e.meta??null};case"success":return Z(this,Fn,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 Lu(s)&&s.revert&&T(this,Fn)?{...T(this,Fn),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),Ze.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),T(this,xt).notify({query:this,type:"updated",action:e})})},Rm);function Gb(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Yv(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Jb(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 er,Am,Qb=(Am=class extends zl{constructor(e={}){super();ue(this,er);this.config=e,Z(this,er,new Map)}build(e,r,n){const s=r.queryKey,i=r.queryHash??hh(s,r);let o=this.get(i);return o||(o=new Kb({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){T(this,er).has(e.queryHash)||(T(this,er).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=T(this,er).get(e.queryHash);r&&(e.destroy(),r===e&&T(this,er).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ze.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return T(this,er).get(e)}getAll(){return[...T(this,er).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(n=>Yf(r,n))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(n=>Yf(e,n)):r}notify(e){Ze.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){Ze.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ze.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},er=new WeakMap,Am),tr,Je,Vn,rr,zr,Pm,Zb=(Pm=class extends ty{constructor(e){super();ue(this,rr);ue(this,tr);ue(this,Je);ue(this,Vn);this.mutationId=e.mutationId,Z(this,Je,e.mutationCache),Z(this,tr,[]),this.state=e.state||Yb(),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,tr).includes(e)||(T(this,tr).push(e),this.clearGcTimeout(),T(this,Je).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Z(this,tr,T(this,tr).filter(r=>r!==e)),this.scheduleGc(),T(this,Je).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){T(this,tr).length||(this.state.status==="pending"?this.scheduleGc():T(this,Je).remove(this))}continue(){var e;return((e=T(this,Vn))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,o,a,l,u,c,d,f,h,y,v,w,m,p,g,b,k,S,E,A;const r=()=>{Ve(this,rr,zr).call(this,{type:"continue"})};Z(this,Vn,ey({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(N,I)=>{Ve(this,rr,zr).call(this,{type:"failed",failureCount:N,error:I})},onPause:()=>{Ve(this,rr,zr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,Je).canRun(this)}));const n=this.state.status==="pending",s=!T(this,Vn).canStart();try{if(n)r();else{Ve(this,rr,zr).call(this,{type:"pending",variables:e,isPaused:s}),await((o=(i=T(this,Je).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,rr,zr).call(this,{type:"pending",context:I,variables:e,isPaused:s})}const N=await T(this,Vn).start();return await((c=(u=T(this,Je).config).onSuccess)==null?void 0:c.call(u,N,e,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,N,e,this.state.context)),await((y=(h=T(this,Je).config).onSettled)==null?void 0:y.call(h,N,null,this.state.variables,this.state.context,this)),await((w=(v=this.options).onSettled)==null?void 0:w.call(v,N,null,e,this.state.context)),Ve(this,rr,zr).call(this,{type:"success",data:N}),N}catch(N){try{throw await((p=(m=T(this,Je).config).onError)==null?void 0:p.call(m,N,e,this.state.context,this)),await((b=(g=this.options).onError)==null?void 0:b.call(g,N,e,this.state.context)),await((S=(k=T(this,Je).config).onSettled)==null?void 0:S.call(k,void 0,N,this.state.variables,this.state.context,this)),await((A=(E=this.options).onSettled)==null?void 0:A.call(E,void 0,N,e,this.state.context)),N}finally{Ve(this,rr,zr).call(this,{type:"error",error:N})}}finally{T(this,Je).runNext(this)}}},tr=new WeakMap,Je=new WeakMap,Vn=new WeakMap,rr=new WeakSet,zr=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),Ze.batch(()=>{T(this,tr).forEach(n=>{n.onMutationUpdate(e)}),T(this,Je).notify({mutation:this,type:"updated",action:e})})},Pm);function Yb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var wr,Ft,Po,Om,Xb=(Om=class extends zl{constructor(e={}){super();ue(this,wr);ue(this,Ft);ue(this,Po);this.config=e,Z(this,wr,new Set),Z(this,Ft,new Map),Z(this,Po,0)}build(e,r,n){const s=new Zb({mutationCache:this,mutationId:++Vo(this,Po)._,options:e.defaultMutationOptions(r),state:n});return this.add(s),s}add(e){T(this,wr).add(e);const r=aa(e);if(typeof r=="string"){const n=T(this,Ft).get(r);n?n.push(e):T(this,Ft).set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(T(this,wr).delete(e)){const r=aa(e);if(typeof r=="string"){const n=T(this,Ft).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,Ft).delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){const r=aa(e);if(typeof r=="string"){const n=T(this,Ft).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=aa(e);if(typeof r=="string"){const s=(n=T(this,Ft).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(){Ze.batch(()=>{T(this,wr).forEach(e=>{this.notify({type:"removed",mutation:e})}),T(this,wr).clear(),T(this,Ft).clear()})}getAll(){return Array.from(T(this,wr))}find(e){const r={exact:!0,...e};return this.getAll().find(n=>Xf(r,n))}findAll(e={}){return this.getAll().filter(r=>Xf(e,r))}notify(e){Ze.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return Ze.batch(()=>Promise.all(e.map(r=>r.continue().catch(Dt))))}},wr=new WeakMap,Ft=new WeakMap,Po=new WeakMap,Om);function aa(t){var e;return(e=t.options.scope)==null?void 0:e.id}function rp(t){return{onFetch:(e,r)=>{var c,d,f,h,y;const n=e.options,s=(f=(d=(c=e.fetchOptions)==null?void 0:c.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,i=((h=e.state.data)==null?void 0:h.pages)||[],o=((y=e.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let v=!1;const w=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(e.signal.aborted?v=!0:e.signal.addEventListener("abort",()=>{v=!0}),e.signal)})},m=Qv(e.options,e.fetchOptions),p=async(g,b,k)=>{if(v)return Promise.reject();if(b==null&&g.pages.length)return Promise.resolve(g);const E=(()=>{const q={client:e.client,queryKey:e.queryKey,pageParam:b,direction:k?"backward":"forward",meta:e.options.meta};return w(q),q})(),A=await m(E),{maxPages:N}=e.options,I=k?Fb:Ub;return{pages:I(g.pages,A,N),pageParams:I(g.pageParams,b,N)}};if(s&&i.length){const g=s==="backward",b=g?ex:np,k={pages:i,pageParams:o},S=b(n,k);a=await p(k,S,g)}else{const g=t??i.length;do{const b=l===0?o[0]??n.initialPageParam:np(n,a);if(l>0&&b==null)break;a=await p(a,b),l++}while(l<g)}return a};e.options.persister?e.fetchFn=()=>{var v,w;return(w=(v=e.options).persister)==null?void 0:w.call(v,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=u}}}function np(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 ex(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 Se,Zr,Yr,qs,Ks,Xr,Gs,Js,Nm,tx=(Nm=class{constructor(t={}){ue(this,Se);ue(this,Zr);ue(this,Yr);ue(this,qs);ue(this,Ks);ue(this,Xr);ue(this,Gs);ue(this,Js);Z(this,Se,t.queryCache||new Qb),Z(this,Zr,t.mutationCache||new Xb),Z(this,Yr,t.defaultOptions||{}),Z(this,qs,new Map),Z(this,Ks,new Map),Z(this,Xr,0)}mount(){Vo(this,Xr)._++,T(this,Xr)===1&&(Z(this,Gs,Zv.subscribe(async t=>{t&&(await this.resumePausedMutations(),T(this,Se).onFocus())})),Z(this,Js,ll.subscribe(async t=>{t&&(await this.resumePausedMutations(),T(this,Se).onOnline())})))}unmount(){var t,e;Vo(this,Xr)._--,T(this,Xr)===0&&((t=T(this,Gs))==null||t.call(this),Z(this,Gs,void 0),(e=T(this,Js))==null||e.call(this),Z(this,Js,void 0))}isFetching(t){return T(this,Se).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return T(this,Zr).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=T(this,Se).get(e.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),r=T(this,Se).build(this,e),n=r.state.data;return n===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(Uc(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return T(this,Se).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,Se).get(n.queryHash),i=s==null?void 0:s.state.data,o=jb(e,i);if(o!==void 0)return T(this,Se).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return Ze.batch(()=>T(this,Se).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,Se).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=T(this,Se);Ze.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=T(this,Se);return Ze.batch(()=>(r.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const r={revert:!0,...e},n=Ze.batch(()=>T(this,Se).findAll(t).map(s=>s.cancel(r)));return Promise.all(n).then(Dt).catch(Dt)}invalidateQueries(t,e={}){return Ze.batch(()=>(T(this,Se).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=Ze.batch(()=>T(this,Se).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(Dt)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(Dt)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=T(this,Se).build(this,e);return r.isStaleByTime(Uc(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Dt).catch(Dt)}fetchInfiniteQuery(t){return t.behavior=rp(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Dt).catch(Dt)}ensureInfiniteQueryData(t){return t.behavior=rp(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return ll.isOnline()?T(this,Zr).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,Se)}getMutationCache(){return T(this,Zr)}getDefaultOptions(){return T(this,Yr)}setDefaultOptions(t){Z(this,Yr,t)}setQueryDefaults(t,e){T(this,qs).set(mo(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...T(this,qs).values()],r={};return e.forEach(n=>{go(t,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(t,e){T(this,Ks).set(mo(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...T(this,Ks).values()],r={};return e.forEach(n=>{go(t,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...T(this,Yr).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=hh(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===fh&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...T(this,Yr).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){T(this,Se).clear(),T(this,Zr).clear()}},Se=new WeakMap,Zr=new WeakMap,Yr=new WeakMap,qs=new WeakMap,Ks=new WeakMap,Xr=new WeakMap,Gs=new WeakMap,Js=new WeakMap,Nm),rx=_.createContext(void 0),nx=({client:t,children:e})=>(_.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),x.jsx(rx.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 ul(){return ul=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},ul.apply(this,arguments)}var rn;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(rn||(rn={}));const sp="popstate";function sx(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:ny(s)}return ox(e,r,null,t)}function ut(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function ry(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function ix(){return Math.random().toString(36).substr(2,8)}function ip(t,e){return{usr:t.state,key:t.key,idx:e}}function zc(t,e,r,n){return r===void 0&&(r=null),ul({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Vl(e):e,{state:r,key:e&&e.key||n||ix()})}function ny(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 Vl(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 ox(t,e,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:i=!1}=n,o=s.history,a=rn.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(ul({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function d(){a=rn.Pop;let w=c(),m=w==null?null:w-u;u=w,l&&l({action:a,location:v.location,delta:m})}function f(w,m){a=rn.Push;let p=zc(v.location,w,m);u=c()+1;let g=ip(p,u),b=v.createHref(p);try{o.pushState(g,"",b)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;s.location.assign(b)}i&&l&&l({action:a,location:v.location,delta:1})}function h(w,m){a=rn.Replace;let p=zc(v.location,w,m);u=c();let g=ip(p,u),b=v.createHref(p);o.replaceState(g,"",b),i&&l&&l({action:a,location:v.location,delta:0})}function y(w){let m=s.location.origin!=="null"?s.location.origin:s.location.href,p=typeof w=="string"?w:ny(w);return p=p.replace(/ $/,"%20"),ut(m,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,m)}let v={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(sp,d),l=w,()=>{s.removeEventListener(sp,d),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:h,go(w){return o.go(w)}};return v}var op;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(op||(op={}));function ax(t,e,r){return r===void 0&&(r="/"),lx(t,e,r,!1)}function lx(t,e,r,n){let s=typeof e=="string"?Vl(e):e,i=oy(s.pathname||"/",r);if(i==null)return null;let o=sy(t);ux(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let u=_x(i);a=yx(o[l],u,n)}return a}function sy(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("/")&&(ut(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=Ms([n,l.relativePath]),c=r.concat(l);i.children&&i.children.length>0&&(ut(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),sy(i.children,e,c,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:gx(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 iy(i.path))s(i,o,l)}),e}function iy(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=iy(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 ux(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:vx(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const cx=/^:[\w-]+$/,dx=3,hx=2,fx=1,px=10,mx=-2,ap=t=>t==="*";function gx(t,e){let r=t.split("/"),n=r.length;return r.some(ap)&&(n+=mx),e&&(n+=hx),r.filter(s=>!ap(s)).reduce((s,i)=>s+(cx.test(i)?dx:i===""?fx:px),n)}function vx(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 yx(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)||"/",d=lp({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},c),f=l.route;if(!d&&u&&r&&!n[n.length-1].route.index&&(d=lp({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},c)),!d)return null;Object.assign(s,d.params),o.push({params:s,pathname:Ms([i,d.pathname]),pathnameBase:bx(Ms([i,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(i=Ms([i,d.pathnameBase]))}return o}function lp(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=wx(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,d)=>{let{paramName:f,isOptional:h}=c;if(f==="*"){let v=a[d]||"";o=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const y=a[d];return h&&!y?u[f]=void 0:u[f]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:t}}function wx(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),ry(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 _x(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return ry(!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 oy(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 Ms=t=>t.join("/").replace(/\/\/+/g,"/"),bx=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/");function xx(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const ay=["post","put","patch","delete"];new Set(ay);const kx=["get",...ay];new Set(kx);/**
 * 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 cl(){return cl=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},cl.apply(this,arguments)}const Sx=_.createContext(null),Ex=_.createContext(null),ly=_.createContext(null),Hl=_.createContext(null),Wl=_.createContext({outlet:null,matches:[],isDataRoute:!1}),uy=_.createContext(null);function ph(){return _.useContext(Hl)!=null}function cy(){return ph()||ut(!1),_.useContext(Hl).location}function Tx(t,e){return Cx(t,e)}function Cx(t,e,r,n){ph()||ut(!1);let{navigator:s}=_.useContext(ly),{matches:i}=_.useContext(Wl),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=cy(),c;if(e){var d;let w=typeof e=="string"?Vl(e):e;l==="/"||(d=w.pathname)!=null&&d.startsWith(l)||ut(!1),c=w}else c=u;let f=c.pathname||"/",h=f;if(l!=="/"){let w=l.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(w.length).join("/")}let y=ax(t,{pathname:h}),v=Nx(y&&y.map(w=>Object.assign({},w,{params:Object.assign({},a,w.params),pathname:Ms([l,s.encodeLocation?s.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?l:Ms([l,s.encodeLocation?s.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),i,r,n);return e&&v?_.createElement(Hl.Provider,{value:{location:cl({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:rn.Pop}},v):v}function Rx(){let t=$x(),e=xx(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 _.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},e),r?_.createElement("pre",{style:s},r):null,null)}const Ax=_.createElement(Rx,null);class Px extends _.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?_.createElement(Wl.Provider,{value:this.props.routeContext},_.createElement(uy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Ox(t){let{routeContext:e,match:r,children:n}=t,s=_.useContext(Sx);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),_.createElement(Wl.Provider,{value:e},n)}function Nx(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(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);c>=0||ut(!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 d=o[c];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=c),d.route.id){let{loaderData:f,errors:h}=r,y=d.route.loader&&f[d.route.id]===void 0&&(!h||h[d.route.id]===void 0);if(d.route.lazy||y){l=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((c,d,f)=>{let h,y=!1,v=null,w=null;r&&(h=a&&d.route.id?a[d.route.id]:void 0,v=d.route.errorElement||Ax,l&&(u<0&&f===0?(y=!0,w=null):u===f&&(y=!0,w=d.route.hydrateFallbackElement||null)));let m=e.concat(o.slice(0,f+1)),p=()=>{let g;return h?g=v:y?g=w:d.route.Component?g=_.createElement(d.route.Component,null):d.route.element?g=d.route.element:g=c,_.createElement(Ox,{match:d,routeContext:{outlet:c,matches:m,isDataRoute:r!=null},children:g})};return r&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?_.createElement(Px,{location:r.location,revalidation:r.revalidation,component:v,error:h,children:p(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):p()},null)}var Bc=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}(Bc||{});function jx(t){let e=_.useContext(Ex);return e||ut(!1),e}function Ix(t){let e=_.useContext(Wl);return e||ut(!1),e}function Lx(t){let e=Ix(),r=e.matches[e.matches.length-1];return r.route.id||ut(!1),r.route.id}function $x(){var t;let e=_.useContext(uy),r=jx(Bc.UseRouteError),n=Lx(Bc.UseRouteError);return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function Dx(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function Vc(t){ut(!1)}function Mx(t){let{basename:e="/",children:r=null,location:n,navigationType:s=rn.Pop,navigator:i,static:o=!1,future:a}=t;ph()&&ut(!1);let l=e.replace(/^\/*/,"/"),u=_.useMemo(()=>({basename:l,navigator:i,static:o,future:cl({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof n=="string"&&(n=Vl(n));let{pathname:c="/",search:d="",hash:f="",state:h=null,key:y="default"}=n,v=_.useMemo(()=>{let w=oy(c,l);return w==null?null:{location:{pathname:w,search:d,hash:f,state:h,key:y},navigationType:s}},[l,c,d,f,h,y,s]);return v==null?null:_.createElement(ly.Provider,{value:u},_.createElement(Hl.Provider,{children:r,value:v}))}function Ux(t){let{children:e,location:r}=t;return Tx(Hc(e),r)}new Promise(()=>{});function Hc(t,e){e===void 0&&(e=[]);let r=[];return _.Children.forEach(t,(n,s)=>{if(!_.isValidElement(n))return;let i=[...e,s];if(n.type===_.Fragment){r.push.apply(r,Hc(n.props.children,i));return}n.type!==Vc&&ut(!1),!n.props.index||!n.props.children||ut(!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=Hc(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 Fx="6";try{window.__reactRouterVersion=Fx}catch{}const zx="startTransition",up=Hm[zx];function Bx(t){let{basename:e,children:r,future:n,window:s}=t,i=_.useRef();i.current==null&&(i.current=sx({window:s,v5Compat:!0}));let o=i.current,[a,l]=_.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},c=_.useCallback(d=>{u&&up?up(()=>l(d)):l(d)},[l,u]);return _.useLayoutEffect(()=>o.listen(c),[o,c]),_.useEffect(()=>Dx(n),[n]),_.createElement(Mx,{basename:e,children:r,location:a.location,navigationType:a.action,navigator:o,future:n})}var cp;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(cp||(cp={}));var dp;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(dp||(dp={}));var hp=["light","dark"],Vx="(prefers-color-scheme: dark)",Hx=_.createContext(void 0),Wx={setTheme:t=>{},themes:[]},qx=()=>{var t;return(t=_.useContext(Hx))!=null?t:Wx};_.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';`,d=s?hp.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,v=!1,w=!0)=>{let m=o?o[y]:y,p=v?y+"|| ''":`'${m}'`,g="";return s&&w&&!v&&hp.includes(y)&&(g+=`d.style.colorScheme = '${y}';`),r==="class"?v||m?g+=`c.add(${p})`:g+="null":m&&(g+=`d[s](n,${p})`),g},h=t?`!function(){${c}${f(t)}}()`:n?`!function(){try{${c}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${Vx}',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)+"}"}${d}}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)};}${d}}catch(t){}}();`;return _.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:h}})});var Kx=t=>{switch(t){case"success":return Qx;case"info":return Yx;case"warning":return Zx;case"error":return Xx;default:return null}},Gx=Array(12).fill(0),Jx=({visible:t,className:e})=>j.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},j.createElement("div",{className:"sonner-spinner"},Gx.map((r,n)=>j.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Qx=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},j.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"})),Zx=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},j.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"})),Yx=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},j.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"})),Xx=j.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},j.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"})),ek=j.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"},j.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),j.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),tk=()=>{let[t,e]=j.useState(document.hidden);return j.useEffect(()=>{let r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t},Wc=1,rk=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:Wc++,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],j.isValidElement(l))s=!1,this.create({id:r,type:"default",message:l});else if(sk(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)||Wc++;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}},nt=new rk,nk=(t,e)=>{let r=(e==null?void 0:e.id)||Wc++;return nt.addToast({title:t,...e,id:r}),r},sk=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",ik=nk,ok=()=>nt.toasts,ak=()=>nt.getActiveToasts(),fp=Object.assign(ik,{success:nt.success,info:nt.info,warning:nt.warning,error:nt.error,custom:nt.custom,message:nt.message,promise:nt.promise,dismiss:nt.dismiss,loading:nt.loading},{getHistory:ok,getToasts:ak});function lk(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))}lk(`: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 la(t){return t.label!==void 0}var uk=3,ck="32px",dk="16px",pp=4e3,hk=356,fk=14,pk=20,mk=200;function It(...t){return t.filter(Boolean).join(" ")}function gk(t){let[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}var vk=t=>{var e,r,n,s,i,o,a,l,u,c,d;let{invert:f,toast:h,unstyled:y,interacting:v,setHeights:w,visibleToasts:m,heights:p,index:g,toasts:b,expanded:k,removeToast:S,defaultRichColors:E,closeButton:A,style:N,cancelButtonStyle:I,actionButtonStyle:q,className:U="",descriptionClassName:te="",duration:L,position:ie,gap:K,loadingIcon:Y,expandByDefault:C,classNames:R,icons:D,closeButtonAriaLabel:X="Close toast",pauseWhenPageIsHidden:W}=t,[ne,oe]=j.useState(null),[Ae,Be]=j.useState(null),[de,ts]=j.useState(!1),[Nr,En]=j.useState(!1),[jr,rs]=j.useState(!1),[Ir,Fo]=j.useState(!1),[su,zo]=j.useState(!1),[iu,vi]=j.useState(0),[ns,Lh]=j.useState(0),yi=j.useRef(h.duration||L||pp),$h=j.useRef(null),Tn=j.useRef(null),Y0=g===0,X0=g+1<=m,bt=h.type,ss=h.dismissible!==!1,ew=h.className||"",tw=h.descriptionClassName||"",Bo=j.useMemo(()=>p.findIndex(Q=>Q.toastId===h.id)||0,[p,h.id]),rw=j.useMemo(()=>{var Q;return(Q=h.closeButton)!=null?Q:A},[h.closeButton,A]),Dh=j.useMemo(()=>h.duration||L||pp,[h.duration,L]),ou=j.useRef(0),is=j.useRef(0),Mh=j.useRef(0),os=j.useRef(null),[nw,sw]=ie.split("-"),Uh=j.useMemo(()=>p.reduce((Q,fe,we)=>we>=Bo?Q:Q+fe.height,0),[p,Bo]),Fh=tk(),iw=h.invert||f,au=bt==="loading";is.current=j.useMemo(()=>Bo*K+Uh,[Bo,Uh]),j.useEffect(()=>{yi.current=Dh},[Dh]),j.useEffect(()=>{ts(!0)},[]),j.useEffect(()=>{let Q=Tn.current;if(Q){let fe=Q.getBoundingClientRect().height;return Lh(fe),w(we=>[{toastId:h.id,height:fe,position:h.position},...we]),()=>w(we=>we.filter(Pt=>Pt.toastId!==h.id))}},[w,h.id]),j.useLayoutEffect(()=>{if(!de)return;let Q=Tn.current,fe=Q.style.height;Q.style.height="auto";let we=Q.getBoundingClientRect().height;Q.style.height=fe,Lh(we),w(Pt=>Pt.find(Ot=>Ot.toastId===h.id)?Pt.map(Ot=>Ot.toastId===h.id?{...Ot,height:we}:Ot):[{toastId:h.id,height:we,position:h.position},...Pt])},[de,h.title,h.description,w,h.id]);let Lr=j.useCallback(()=>{En(!0),vi(is.current),w(Q=>Q.filter(fe=>fe.toastId!==h.id)),setTimeout(()=>{S(h)},mk)},[h,S,w,is]);j.useEffect(()=>{if(h.promise&&bt==="loading"||h.duration===1/0||h.type==="loading")return;let Q;return k||v||W&&Fh?(()=>{if(Mh.current<ou.current){let fe=new Date().getTime()-ou.current;yi.current=yi.current-fe}Mh.current=new Date().getTime()})():yi.current!==1/0&&(ou.current=new Date().getTime(),Q=setTimeout(()=>{var fe;(fe=h.onAutoClose)==null||fe.call(h,h),Lr()},yi.current)),()=>clearTimeout(Q)},[k,v,h,bt,W,Fh,Lr]),j.useEffect(()=>{h.delete&&Lr()},[Lr,h.delete]);function ow(){var Q,fe,we;return D!=null&&D.loading?j.createElement("div",{className:It(R==null?void 0:R.loader,(Q=h==null?void 0:h.classNames)==null?void 0:Q.loader,"sonner-loader"),"data-visible":bt==="loading"},D.loading):Y?j.createElement("div",{className:It(R==null?void 0:R.loader,(fe=h==null?void 0:h.classNames)==null?void 0:fe.loader,"sonner-loader"),"data-visible":bt==="loading"},Y):j.createElement(Jx,{className:It(R==null?void 0:R.loader,(we=h==null?void 0:h.classNames)==null?void 0:we.loader),visible:bt==="loading"})}return j.createElement("li",{tabIndex:0,ref:Tn,className:It(U,ew,R==null?void 0:R.toast,(e=h==null?void 0:h.classNames)==null?void 0:e.toast,R==null?void 0:R.default,R==null?void 0:R[bt],(r=h==null?void 0:h.classNames)==null?void 0:r[bt]),"data-sonner-toast":"","data-rich-colors":(n=h.richColors)!=null?n:E,"data-styled":!(h.jsx||h.unstyled||y),"data-mounted":de,"data-promise":!!h.promise,"data-swiped":su,"data-removed":Nr,"data-visible":X0,"data-y-position":nw,"data-x-position":sw,"data-index":g,"data-front":Y0,"data-swiping":jr,"data-dismissible":ss,"data-type":bt,"data-invert":iw,"data-swipe-out":Ir,"data-swipe-direction":Ae,"data-expanded":!!(k||C&&de),style:{"--index":g,"--toasts-before":g,"--z-index":b.length-g,"--offset":`${Nr?iu:is.current}px`,"--initial-height":C?"auto":`${ns}px`,...N,...h.style},onDragEnd:()=>{rs(!1),oe(null),os.current=null},onPointerDown:Q=>{au||!ss||($h.current=new Date,vi(is.current),Q.target.setPointerCapture(Q.pointerId),Q.target.tagName!=="BUTTON"&&(rs(!0),os.current={x:Q.clientX,y:Q.clientY}))},onPointerUp:()=>{var Q,fe,we,Pt;if(Ir||!ss)return;os.current=null;let Ot=Number(((Q=Tn.current)==null?void 0:Q.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),$r=Number(((fe=Tn.current)==null?void 0:fe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Cn=new Date().getTime()-((we=$h.current)==null?void 0:we.getTime()),Nt=ne==="x"?Ot:$r,Dr=Math.abs(Nt)/Cn;if(Math.abs(Nt)>=pk||Dr>.11){vi(is.current),(Pt=h.onDismiss)==null||Pt.call(h,h),Be(ne==="x"?Ot>0?"right":"left":$r>0?"down":"up"),Lr(),Fo(!0),zo(!1);return}rs(!1),oe(null)},onPointerMove:Q=>{var fe,we,Pt,Ot;if(!os.current||!ss||((fe=window.getSelection())==null?void 0:fe.toString().length)>0)return;let $r=Q.clientY-os.current.y,Cn=Q.clientX-os.current.x,Nt=(we=t.swipeDirections)!=null?we:gk(ie);!ne&&(Math.abs(Cn)>1||Math.abs($r)>1)&&oe(Math.abs(Cn)>Math.abs($r)?"x":"y");let Dr={x:0,y:0};ne==="y"?(Nt.includes("top")||Nt.includes("bottom"))&&(Nt.includes("top")&&$r<0||Nt.includes("bottom")&&$r>0)&&(Dr.y=$r):ne==="x"&&(Nt.includes("left")||Nt.includes("right"))&&(Nt.includes("left")&&Cn<0||Nt.includes("right")&&Cn>0)&&(Dr.x=Cn),(Math.abs(Dr.x)>0||Math.abs(Dr.y)>0)&&zo(!0),(Pt=Tn.current)==null||Pt.style.setProperty("--swipe-amount-x",`${Dr.x}px`),(Ot=Tn.current)==null||Ot.style.setProperty("--swipe-amount-y",`${Dr.y}px`)}},rw&&!h.jsx?j.createElement("button",{"aria-label":X,"data-disabled":au,"data-close-button":!0,onClick:au||!ss?()=>{}:()=>{var Q;Lr(),(Q=h.onDismiss)==null||Q.call(h,h)},className:It(R==null?void 0:R.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},(i=D==null?void 0:D.close)!=null?i:ek):null,h.jsx||_.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:j.createElement(j.Fragment,null,bt||h.icon||h.promise?j.createElement("div",{"data-icon":"",className:It(R==null?void 0:R.icon,(o=h==null?void 0:h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||ow():null,h.type!=="loading"?h.icon||(D==null?void 0:D[bt])||Kx(bt):null):null,j.createElement("div",{"data-content":"",className:It(R==null?void 0:R.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},j.createElement("div",{"data-title":"",className:It(R==null?void 0:R.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?j.createElement("div",{"data-description":"",className:It(te,tw,R==null?void 0:R.description,(u=h==null?void 0:h.classNames)==null?void 0:u.description)},typeof h.description=="function"?h.description():h.description):null),_.isValidElement(h.cancel)?h.cancel:h.cancel&&la(h.cancel)?j.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||I,onClick:Q=>{var fe,we;la(h.cancel)&&ss&&((we=(fe=h.cancel).onClick)==null||we.call(fe,Q),Lr())},className:It(R==null?void 0:R.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,_.isValidElement(h.action)?h.action:h.action&&la(h.action)?j.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||q,onClick:Q=>{var fe,we;la(h.action)&&((we=(fe=h.action).onClick)==null||we.call(fe,Q),!Q.defaultPrevented&&Lr())},className:It(R==null?void 0:R.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function mp(){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 yk(t,e){let r={};return[t,e].forEach((n,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",a=i?dk:ck;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 wk=_.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:d,duration:f,style:h,visibleToasts:y=uk,toastOptions:v,dir:w=mp(),gap:m=fk,loadingIcon:p,icons:g,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:k}=t,[S,E]=j.useState([]),A=j.useMemo(()=>Array.from(new Set([n].concat(S.filter(W=>W.position).map(W=>W.position)))),[S,n]),[N,I]=j.useState([]),[q,U]=j.useState(!1),[te,L]=j.useState(!1),[ie,K]=j.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Y=j.useRef(null),C=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=j.useRef(null),D=j.useRef(!1),X=j.useCallback(W=>{E(ne=>{var oe;return(oe=ne.find(Ae=>Ae.id===W.id))!=null&&oe.delete||nt.dismiss(W.id),ne.filter(({id:Ae})=>Ae!==W.id)})},[]);return j.useEffect(()=>nt.subscribe(W=>{if(W.dismiss){E(ne=>ne.map(oe=>oe.id===W.id?{...oe,delete:!0}:oe));return}setTimeout(()=>{Kv.flushSync(()=>{E(ne=>{let oe=ne.findIndex(Ae=>Ae.id===W.id);return oe!==-1?[...ne.slice(0,oe),{...ne[oe],...W},...ne.slice(oe+1)]:[W,...ne]})})})}),[]),j.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(Ae){console.error(Ae)}})}},[c]),j.useEffect(()=>{S.length<=1&&U(!1)},[S]),j.useEffect(()=>{let W=ne=>{var oe,Ae;s.every(Be=>ne[Be]||ne.code===Be)&&(U(!0),(oe=Y.current)==null||oe.focus()),ne.code==="Escape"&&(document.activeElement===Y.current||(Ae=Y.current)!=null&&Ae.contains(document.activeElement))&&U(!1)};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[s]),j.useEffect(()=>{if(Y.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,D.current=!1)}},[Y.current]),j.createElement("section",{ref:e,"aria-label":`${b} ${C}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((W,ne)=>{var oe;let[Ae,Be]=W.split("-");return S.length?j.createElement("ol",{key:W,dir:w==="auto"?mp():w,tabIndex:-1,ref:Y,className:a,"data-sonner-toaster":!0,"data-theme":ie,"data-y-position":Ae,"data-lifted":q&&S.length>1&&!i,"data-x-position":Be,style:{"--front-toast-height":`${((oe=N[0])==null?void 0:oe.height)||0}px`,"--width":`${hk}px`,"--gap":`${m}px`,...h,...yk(l,u)},onBlur:de=>{D.current&&!de.currentTarget.contains(de.relatedTarget)&&(D.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||D.current||(D.current=!0,R.current=de.relatedTarget)},onMouseEnter:()=>U(!0),onMouseMove:()=>U(!0),onMouseLeave:()=>{te||U(!1)},onDragEnd:()=>U(!1),onPointerDown:de=>{de.target instanceof HTMLElement&&de.target.dataset.dismissible==="false"||L(!0)},onPointerUp:()=>L(!1)},S.filter(de=>!de.position&&ne===0||de.position===W).map((de,ts)=>{var Nr,En;return j.createElement(vk,{key:de.id,icons:g,index:ts,toast:de,defaultRichColors:d,duration:(Nr=v==null?void 0:v.duration)!=null?Nr:f,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:r,visibleToasts:y,closeButton:(En=v==null?void 0:v.closeButton)!=null?En:o,interacting:te,position:W,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:X,toasts:S.filter(jr=>jr.position==de.position),heights:N.filter(jr=>jr.position==de.position),setHeights:I,expandByDefault:i,gap:m,loadingIcon:p,expanded:q,pauseWhenPageIsHidden:k,swipeDirections:t.swipeDirections})})):null}))});const _k=({...t})=>{const{theme:e="system"}=qx();return x.jsx(wk,{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})},bk=1,xk=1e6;let $u=0;function kk(){return $u=($u+1)%Number.MAX_SAFE_INTEGER,$u.toString()}const Du=new Map,gp=t=>{if(Du.has(t))return;const e=setTimeout(()=>{Du.delete(t),Ki({type:"REMOVE_TOAST",toastId:t})},xk);Du.set(t,e)},Sk=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,bk)};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?gp(r):t.toasts.forEach(n=>{gp(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)}}},ja=[];let Ia={toasts:[]};function Ki(t){Ia=Sk(Ia,t),ja.forEach(e=>{e(Ia)})}function Ek({...t}){const e=kk(),r=s=>Ki({type:"UPDATE_TOAST",toast:{...s,id:e}}),n=()=>Ki({type:"DISMISS_TOAST",toastId:e});return Ki({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||n()}}}),{id:e,dismiss:n,update:r}}function Tk(){const[t,e]=_.useState(Ia);return _.useEffect(()=>(ja.push(e),()=>{const r=ja.indexOf(e);r>-1&&ja.splice(r,1)}),[t]),{...t,toast:Ek,dismiss:r=>Ki({type:"DISMISS_TOAST",toastId:r})}}function je(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 vp(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function dy(...t){return e=>{let r=!1;const n=t.map(s=>{const i=vp(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():vp(t[s],null)}}}}function qt(...t){return _.useCallback(dy(...t),t)}function ql(t,e=[]){let r=[];function n(i,o){const a=_.createContext(o),l=r.length;r=[...r,o];const u=d=>{var m;const{scope:f,children:h,...y}=d,v=((m=f==null?void 0:f[t])==null?void 0:m[l])||a,w=_.useMemo(()=>y,Object.values(y));return x.jsx(v.Provider,{value:w,children:h})};u.displayName=i+"Provider";function c(d,f){var v;const h=((v=f==null?void 0:f[t])==null?void 0:v[l])||a,y=_.useContext(h);if(y)return y;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[u,c]}const s=()=>{const i=r.map(o=>_.createContext(o));return function(a){const l=(a==null?void 0:a[t])||i;return _.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[n,Ck(s,...e)]}function Ck(...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 d=l(i)[`__scope${u}`];return{...a,...d}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function dl(t){const e=Ak(t),r=_.forwardRef((n,s)=>{const{children:i,...o}=n,a=_.Children.toArray(i),l=a.find(Ok);if(l){const u=l.props.children,c=a.map(d=>d===l?_.Children.count(u)>1?_.Children.only(null):_.isValidElement(u)?u.props.children:null:d);return x.jsx(e,{...o,ref:s,children:_.isValidElement(u)?_.cloneElement(u,void 0,c):null})}return x.jsx(e,{...o,ref:s,children:i})});return r.displayName=`${t}.Slot`,r}var Rk=dl("Slot");function Ak(t){const e=_.forwardRef((r,n)=>{const{children:s,...i}=r;if(_.isValidElement(s)){const o=jk(s),a=Nk(i,s.props);return s.type!==_.Fragment&&(a.ref=n?dy(n,o):o),_.cloneElement(s,a)}return _.Children.count(s)>1?_.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var hy=Symbol("radix.slottable");function Pk(t){const e=({children:r})=>x.jsx(x.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=hy,e}function Ok(t){return _.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===hy}function Nk(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 jk(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 Ik(t){const e=t+"CollectionProvider",[r,n]=ql(e),[s,i]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=v=>{const{scope:w,children:m}=v,p=j.useRef(null),g=j.useRef(new Map).current;return x.jsx(s,{scope:w,itemMap:g,collectionRef:p,children:m})};o.displayName=e;const a=t+"CollectionSlot",l=dl(a),u=j.forwardRef((v,w)=>{const{scope:m,children:p}=v,g=i(a,m),b=qt(w,g.collectionRef);return x.jsx(l,{ref:b,children:p})});u.displayName=a;const c=t+"CollectionItemSlot",d="data-radix-collection-item",f=dl(c),h=j.forwardRef((v,w)=>{const{scope:m,children:p,...g}=v,b=j.useRef(null),k=qt(w,b),S=i(c,m);return j.useEffect(()=>(S.itemMap.set(b,{ref:b,...g}),()=>void S.itemMap.delete(b))),x.jsx(f,{[d]:"",ref:k,children:p})});h.displayName=c;function y(v){const w=i(t+"CollectionConsumer",v);return j.useCallback(()=>{const p=w.collectionRef.current;if(!p)return[];const g=Array.from(p.querySelectorAll(`[${d}]`));return Array.from(w.itemMap.values()).sort((S,E)=>g.indexOf(S.ref.current)-g.indexOf(E.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:o,Slot:u,ItemSlot:h},y,n]}var Lk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tt=Lk.reduce((t,e)=>{const r=dl(`Primitive.${e}`),n=_.forwardRef((s,i)=>{const{asChild:o,...a}=s,l=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(l,{...a,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function fy(t,e){t&&$o.flushSync(()=>t.dispatchEvent(e))}function gn(t){const e=_.useRef(t);return _.useEffect(()=>{e.current=t}),_.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}function $k(t,e=globalThis==null?void 0:globalThis.document){const r=gn(t);_.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 Dk="DismissableLayer",qc="dismissableLayer.update",Mk="dismissableLayer.pointerDownOutside",Uk="dismissableLayer.focusOutside",yp,py=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),mh=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...l}=t,u=_.useContext(py),[c,d]=_.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=_.useState({}),y=qt(e,E=>d(E)),v=Array.from(u.layers),[w]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),m=v.indexOf(w),p=c?v.indexOf(c):-1,g=u.layersWithOutsidePointerEventsDisabled.size>0,b=p>=m,k=zk(E=>{const A=E.target,N=[...u.branches].some(I=>I.contains(A));!b||N||(s==null||s(E),o==null||o(E),E.defaultPrevented||a==null||a())},f),S=Bk(E=>{const A=E.target;[...u.branches].some(I=>I.contains(A))||(i==null||i(E),o==null||o(E),E.defaultPrevented||a==null||a())},f);return $k(E=>{p===u.layers.size-1&&(n==null||n(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},f),_.useEffect(()=>{if(c)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(yp=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),wp(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=yp)}},[c,f,r,u]),_.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),wp())},[c,u]),_.useEffect(()=>{const E=()=>h({});return document.addEventListener(qc,E),()=>document.removeEventListener(qc,E)},[]),x.jsx(tt.div,{...l,ref:y,style:{pointerEvents:g?b?"auto":"none":void 0,...t.style},onFocusCapture:je(t.onFocusCapture,S.onFocusCapture),onBlurCapture:je(t.onBlurCapture,S.onBlurCapture),onPointerDownCapture:je(t.onPointerDownCapture,k.onPointerDownCapture)})});mh.displayName=Dk;var Fk="DismissableLayerBranch",my=_.forwardRef((t,e)=>{const r=_.useContext(py),n=_.useRef(null),s=qt(e,n);return _.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),x.jsx(tt.div,{...t,ref:s})});my.displayName=Fk;function zk(t,e=globalThis==null?void 0:globalThis.document){const r=gn(t),n=_.useRef(!1),s=_.useRef(()=>{});return _.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){gy(Mk,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 Bk(t,e=globalThis==null?void 0:globalThis.document){const r=gn(t),n=_.useRef(!1);return _.useEffect(()=>{const s=i=>{i.target&&!n.current&&gy(Uk,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 wp(){const t=new CustomEvent(qc);document.dispatchEvent(t)}function gy(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?fy(s,i):s.dispatchEvent(i)}var Vk=mh,Hk=my,vn=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},Wk="Portal",vy=_.forwardRef((t,e)=>{var a;const{container:r,...n}=t,[s,i]=_.useState(!1);vn(()=>i(!0),[]);const o=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?Kv.createPortal(x.jsx(tt.div,{...n,ref:e}),o):null});vy.displayName=Wk;function qk(t,e){return _.useReducer((r,n)=>e[r][n]??r,t)}var gh=t=>{const{present:e,children:r}=t,n=Kk(e),s=typeof r=="function"?r({present:n.isPresent}):_.Children.only(r),i=qt(n.ref,Gk(s));return typeof r=="function"||n.isPresent?_.cloneElement(s,{ref:i}):null};gh.displayName="Presence";function Kk(t){const[e,r]=_.useState(),n=_.useRef(null),s=_.useRef(t),i=_.useRef("none"),o=t?"mounted":"unmounted",[a,l]=qk(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const u=ua(n.current);i.current=a==="mounted"?u:"none"},[a]),vn(()=>{const u=n.current,c=s.current;if(c!==t){const f=i.current,h=ua(u);t?l("MOUNT"):h==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&f!==h?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,l]),vn(()=>{if(e){let u;const c=e.ownerDocument.defaultView??window,d=h=>{const v=ua(n.current).includes(h.animationName);if(h.target===e&&v&&(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=h=>{h.target===e&&(i.current=ua(n.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{c.clearTimeout(u),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:_.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function ua(t){return(t==null?void 0:t.animationName)||"none"}function Gk(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 Jk=Hm[" useInsertionEffect ".trim().toString()]||vn;function Qk({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[s,i,o]=Zk({defaultProp:e,onChange:r}),a=t!==void 0,l=a?t:s;{const c=_.useRef(t!==void 0);_.useEffect(()=>{const d=c.current;d!==a&&console.warn(`${n} is changing from ${d?"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=_.useCallback(c=>{var d;if(a){const f=Yk(c)?c(t):c;f!==t&&((d=o.current)==null||d.call(o,f))}else i(c)},[a,t,i,o]);return[l,u]}function Zk({defaultProp:t,onChange:e}){const[r,n]=_.useState(t),s=_.useRef(r),i=_.useRef(e);return Jk(()=>{i.current=e},[e]),_.useEffect(()=>{var o;s.current!==r&&((o=i.current)==null||o.call(i,r),s.current=r)},[r,s]),[r,n,i]}function Yk(t){return typeof t=="function"}var Xk=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"}),e1="VisuallyHidden",Kl=_.forwardRef((t,e)=>x.jsx(tt.span,{...t,ref:e,style:{...Xk,...t.style}}));Kl.displayName=e1;var t1=Kl,vh="ToastProvider",[yh,r1,n1]=Ik("Toast"),[yy,VA]=ql("Toast",[n1]),[s1,Gl]=yy(vh),wy=t=>{const{__scopeToast:e,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=t,[a,l]=_.useState(null),[u,c]=_.useState(0),d=_.useRef(!1),f=_.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${vh}\`. Expected non-empty \`string\`.`),x.jsx(yh.Provider,{scope:e,children:x.jsx(s1,{scope:e,label:r,duration:n,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:_.useCallback(()=>c(h=>h+1),[]),onToastRemove:_.useCallback(()=>c(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};wy.displayName=vh;var _y="ToastViewport",i1=["F8"],Kc="toast.viewportPause",Gc="toast.viewportResume",by=_.forwardRef((t,e)=>{const{__scopeToast:r,hotkey:n=i1,label:s="Notifications ({hotkey})",...i}=t,o=Gl(_y,r),a=r1(r),l=_.useRef(null),u=_.useRef(null),c=_.useRef(null),d=_.useRef(null),f=qt(e,d,o.onViewportChange),h=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=o.toastCount>0;_.useEffect(()=>{const w=m=>{var g;n.length!==0&&n.every(b=>m[b]||m.code===b)&&((g=d.current)==null||g.focus())};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[n]),_.useEffect(()=>{const w=l.current,m=d.current;if(y&&w&&m){const p=()=>{if(!o.isClosePausedRef.current){const S=new CustomEvent(Kc);m.dispatchEvent(S),o.isClosePausedRef.current=!0}},g=()=>{if(o.isClosePausedRef.current){const S=new CustomEvent(Gc);m.dispatchEvent(S),o.isClosePausedRef.current=!1}},b=S=>{!w.contains(S.relatedTarget)&&g()},k=()=>{w.contains(document.activeElement)||g()};return w.addEventListener("focusin",p),w.addEventListener("focusout",b),w.addEventListener("pointermove",p),w.addEventListener("pointerleave",k),window.addEventListener("blur",p),window.addEventListener("focus",g),()=>{w.removeEventListener("focusin",p),w.removeEventListener("focusout",b),w.removeEventListener("pointermove",p),w.removeEventListener("pointerleave",k),window.removeEventListener("blur",p),window.removeEventListener("focus",g)}}},[y,o.isClosePausedRef]);const v=_.useCallback(({tabbingDirection:w})=>{const p=a().map(g=>{const b=g.ref.current,k=[b,...y1(b)];return w==="forwards"?k:k.reverse()});return(w==="forwards"?p.reverse():p).flat()},[a]);return _.useEffect(()=>{const w=d.current;if(w){const m=p=>{var k,S,E;const g=p.altKey||p.ctrlKey||p.metaKey;if(p.key==="Tab"&&!g){const A=document.activeElement,N=p.shiftKey;if(p.target===w&&N){(k=u.current)==null||k.focus();return}const U=v({tabbingDirection:N?"backwards":"forwards"}),te=U.findIndex(L=>L===A);Mu(U.slice(te+1))?p.preventDefault():N?(S=u.current)==null||S.focus():(E=c.current)==null||E.focus()}};return w.addEventListener("keydown",m),()=>w.removeEventListener("keydown",m)}},[a,v]),x.jsxs(Hk,{ref:l,role:"region","aria-label":s.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&x.jsx(Jc,{ref:u,onFocusFromOutsideViewport:()=>{const w=v({tabbingDirection:"forwards"});Mu(w)}}),x.jsx(yh.Slot,{scope:r,children:x.jsx(tt.ol,{tabIndex:-1,...i,ref:f})}),y&&x.jsx(Jc,{ref:c,onFocusFromOutsideViewport:()=>{const w=v({tabbingDirection:"backwards"});Mu(w)}})]})});by.displayName=_y;var xy="ToastFocusProxy",Jc=_.forwardRef((t,e)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=t,i=Gl(xy,r);return x.jsx(Kl,{"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()}})});Jc.displayName=xy;var Do="Toast",o1="toast.swipeStart",a1="toast.swipeMove",l1="toast.swipeCancel",u1="toast.swipeEnd",ky=_.forwardRef((t,e)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:i,...o}=t,[a,l]=Qk({prop:n,defaultProp:s??!0,onChange:i,caller:Do});return x.jsx(gh,{present:r||a,children:x.jsx(h1,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:gn(t.onPause),onResume:gn(t.onResume),onSwipeStart:je(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:je(t.onSwipeMove,u=>{const{x:c,y:d}=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",`${d}px`)}),onSwipeCancel:je(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:je(t.onSwipeEnd,u=>{const{x:c,y:d}=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",`${d}px`),l(!1)})})})});ky.displayName=Do;var[c1,d1]=yy(Do,{onClose(){}}),h1=_.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:c,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:h,...y}=t,v=Gl(Do,r),[w,m]=_.useState(null),p=qt(e,L=>m(L)),g=_.useRef(null),b=_.useRef(null),k=s||v.duration,S=_.useRef(0),E=_.useRef(k),A=_.useRef(0),{onToastAdd:N,onToastRemove:I}=v,q=gn(()=>{var ie;(w==null?void 0:w.contains(document.activeElement))&&((ie=v.viewport)==null||ie.focus()),o()}),U=_.useCallback(L=>{!L||L===1/0||(window.clearTimeout(A.current),S.current=new Date().getTime(),A.current=window.setTimeout(q,L))},[q]);_.useEffect(()=>{const L=v.viewport;if(L){const ie=()=>{U(E.current),u==null||u()},K=()=>{const Y=new Date().getTime()-S.current;E.current=E.current-Y,window.clearTimeout(A.current),l==null||l()};return L.addEventListener(Kc,K),L.addEventListener(Gc,ie),()=>{L.removeEventListener(Kc,K),L.removeEventListener(Gc,ie)}}},[v.viewport,k,l,u,U]),_.useEffect(()=>{i&&!v.isClosePausedRef.current&&U(k)},[i,k,v.isClosePausedRef,U]),_.useEffect(()=>(N(),()=>I()),[N,I]);const te=_.useMemo(()=>w?Py(w):null,[w]);return v.viewport?x.jsxs(x.Fragment,{children:[te&&x.jsx(f1,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:te}),x.jsx(c1,{scope:r,onClose:q,children:$o.createPortal(x.jsx(yh.ItemSlot,{scope:r,children:x.jsx(Vk,{asChild:!0,onEscapeKeyDown:je(a,()=>{v.isFocusedToastEscapeKeyDownRef.current||q(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:x.jsx(tt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":v.swipeDirection,...y,ref:p,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:je(t.onKeyDown,L=>{L.key==="Escape"&&(a==null||a(L.nativeEvent),L.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,q()))}),onPointerDown:je(t.onPointerDown,L=>{L.button===0&&(g.current={x:L.clientX,y:L.clientY})}),onPointerMove:je(t.onPointerMove,L=>{if(!g.current)return;const ie=L.clientX-g.current.x,K=L.clientY-g.current.y,Y=!!b.current,C=["left","right"].includes(v.swipeDirection),R=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,D=C?R(0,ie):0,X=C?0:R(0,K),W=L.pointerType==="touch"?10:2,ne={x:D,y:X},oe={originalEvent:L,delta:ne};Y?(b.current=ne,ca(a1,d,oe,{discrete:!1})):_p(ne,v.swipeDirection,W)?(b.current=ne,ca(o1,c,oe,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(ie)>W||Math.abs(K)>W)&&(g.current=null)}),onPointerUp:je(t.onPointerUp,L=>{const ie=b.current,K=L.target;if(K.hasPointerCapture(L.pointerId)&&K.releasePointerCapture(L.pointerId),b.current=null,g.current=null,ie){const Y=L.currentTarget,C={originalEvent:L,delta:ie};_p(ie,v.swipeDirection,v.swipeThreshold)?ca(u1,h,C,{discrete:!0}):ca(l1,f,C,{discrete:!0}),Y.addEventListener("click",R=>R.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),f1=t=>{const{__scopeToast:e,children:r,...n}=t,s=Gl(Do,e),[i,o]=_.useState(!1),[a,l]=_.useState(!1);return g1(()=>o(!0)),_.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:x.jsx(vy,{asChild:!0,children:x.jsx(Kl,{...n,children:i&&x.jsxs(x.Fragment,{children:[s.label," ",r]})})})},p1="ToastTitle",Sy=_.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return x.jsx(tt.div,{...n,ref:e})});Sy.displayName=p1;var m1="ToastDescription",Ey=_.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return x.jsx(tt.div,{...n,ref:e})});Ey.displayName=m1;var Ty="ToastAction",Cy=_.forwardRef((t,e)=>{const{altText:r,...n}=t;return r.trim()?x.jsx(Ay,{altText:r,asChild:!0,children:x.jsx(wh,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${Ty}\`. Expected non-empty \`string\`.`),null)});Cy.displayName=Ty;var Ry="ToastClose",wh=_.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,s=d1(Ry,r);return x.jsx(Ay,{asChild:!0,children:x.jsx(tt.button,{type:"button",...n,ref:e,onClick:je(t.onClick,s.onClose)})})});wh.displayName=Ry;var Ay=_.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...s}=t;return x.jsx(tt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:e})});function Py(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),v1(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(...Py(n))}}),e}function ca(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?fy(s,i):s.dispatchEvent(i)}var _p=(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 g1(t=()=>{}){const e=gn(t);vn(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function v1(t){return t.nodeType===t.ELEMENT_NODE}function y1(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 Mu(t){const e=document.activeElement;return t.some(r=>r===e?!0:(r.focus(),document.activeElement!==e))}var w1=wy,Oy=by,Ny=ky,jy=Sy,Iy=Ey,Ly=Cy,$y=wh;function Dy(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=Dy(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function My(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=Dy(t))&&(n&&(n+=" "),n+=e);return n}const bp=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,xp=My,_h=(t,e)=>r=>{var n;if((e==null?void 0:e.variants)==null)return xp(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],d=i==null?void 0:i[u];if(c===null)return null;const f=bp(c)||bp(d);return s[u][f]}),a=r&&Object.entries(r).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((u,c)=>{let{class:d,className:f,...h}=c;return Object.entries(h).every(y=>{let[v,w]=y;return Array.isArray(w)?w.includes({...i,...a}[v]):{...i,...a}[v]===w})?[...u,d,f]:u},[]);return xp(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 _1=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Uy=(...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 b1={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 x1=_.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:o,...a},l)=>_.createElement("svg",{ref:l,...b1,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:Uy("lucide",s),...a},[...o.map(([u,c])=>_.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 dr=(t,e)=>{const r=_.forwardRef(({className:n,...s},i)=>_.createElement(x1,{ref:i,iconNode:e,className:Uy(`lucide-${_1(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 k1=dr("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
 * @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=dr("Battery",[["rect",{width:"16",height:"10",x:"2",y:"7",rx:"2",ry:"2",key:"1w10f2"}],["line",{x1:"22",x2:"22",y1:"11",y2:"13",key:"4dh1rd"}]]);/**
 * @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=dr("HeartHandshake",[["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"}],["path",{d:"M12 5 9.04 7.96a2.17 2.17 0 0 0 0 3.08c.82.82 2.13.85 3 .07l2.07-1.9a2.82 2.82 0 0 1 3.79 0l2.96 2.66",key:"4oyue0"}],["path",{d:"m18 15-2-2",key:"60u0ii"}],["path",{d:"m15 18-2-2",key:"6p76be"}]]);/**
 * @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 T1=dr("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
 * @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 C1=dr("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
 * @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 R1=dr("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
 * @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 A1=dr("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
 * @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 P1=dr("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
 * @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 O1=dr("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
 * @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 Fy=dr("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),bh="-",N1=t=>{const e=I1(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{const a=o.split(bh);return a[0]===""&&a.length!==1&&a.shift(),zy(a,e)||j1(o)},getConflictingClassGroupIds:(o,a)=>{const l=r[o]||[];return a&&n[o]?[...l,...n[o]]:l}}},zy=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const r=t[0],n=e.nextPart.get(r),s=n?zy(t.slice(1),n):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(bh);return(o=e.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},kp=/^\[(.+)\]$/,j1=t=>{if(kp.test(t)){const e=kp.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},I1=t=>{const{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return $1(Object.entries(t.classGroups),r).forEach(([i,o])=>{Qc(o,n,i,e)}),n},Qc=(t,e,r,n)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:Sp(e,s);i.classGroupId=r;return}if(typeof s=="function"){if(L1(s)){Qc(s(n),e,r,n);return}e.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,o])=>{Qc(o,Sp(e,i),r,n)})})},Sp=(t,e)=>{let r=t;return e.split(bh).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},L1=t=>t.isThemeGetter,$1=(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,D1=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)}}},By="!",M1=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,d;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==="/"){d=w;continue}}m==="["?u++:m==="]"&&u--}const f=l.length===0?a:a.substring(c),h=f.startsWith(By),y=h?f.substring(1):f,v=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:y,maybePostfixModifierPosition:v}};return r?a=>r({className:a,parseClassName:o}):o},U1=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},F1=t=>({cache:D1(t.cacheSize),parseClassName:M1(t),...N1(t)}),z1=/\s+/,B1=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=e,i=[],o=t.trim().split(z1);let a="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:h}=r(u);let y=!!h,v=n(y?f.substring(0,h):f);if(!v){if(!y){a=u+(a.length>0?" "+a:a);continue}if(v=n(f),!v){a=u+(a.length>0?" "+a:a);continue}y=!1}const w=U1(c).join(":"),m=d?w+By:w,p=m+v;if(i.includes(p))continue;i.push(p);const g=s(v,y);for(let b=0;b<g.length;++b){const k=g[b];i.push(m+k)}a=u+(a.length>0?" "+a:a)}return a};function V1(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=Vy(e))&&(n&&(n+=" "),n+=r);return n}const Vy=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=Vy(t[n]))&&(r&&(r+=" "),r+=e);return r};function H1(t,...e){let r,n,s,i=o;function o(l){const u=e.reduce((c,d)=>d(c),t());return r=F1(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=B1(l,r);return s(l,c),c}return function(){return i(V1.apply(null,arguments))}}const ge=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},Hy=/^\[(?:([a-z-]+):)?(.+)\]$/i,W1=/^\d+\/\d+$/,q1=new Set(["px","full","screen"]),K1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,G1=/\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$/,J1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Q1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Z1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fr=t=>Us(t)||q1.has(t)||W1.test(t),Ur=t=>fi(t,"length",iS),Us=t=>!!t&&!Number.isNaN(Number(t)),Uu=t=>fi(t,"number",Us),Ci=t=>!!t&&Number.isInteger(Number(t)),Y1=t=>t.endsWith("%")&&Us(t.slice(0,-1)),ee=t=>Hy.test(t),Fr=t=>K1.test(t),X1=new Set(["length","size","percentage"]),eS=t=>fi(t,X1,Wy),tS=t=>fi(t,"position",Wy),rS=new Set(["image","url"]),nS=t=>fi(t,rS,aS),sS=t=>fi(t,"",oS),Ri=()=>!0,fi=(t,e,r)=>{const n=Hy.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1},iS=t=>G1.test(t)&&!J1.test(t),Wy=()=>!1,oS=t=>Q1.test(t),aS=t=>Z1.test(t),lS=()=>{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"),d=ge("invert"),f=ge("gap"),h=ge("gradientColorStops"),y=ge("gradientColorStopPositions"),v=ge("inset"),w=ge("margin"),m=ge("opacity"),p=ge("padding"),g=ge("saturate"),b=ge("scale"),k=ge("sepia"),S=ge("skew"),E=ge("space"),A=ge("translate"),N=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",ee,e],U=()=>[ee,e],te=()=>["",fr,Ur],L=()=>["auto",Us,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"],R=()=>["","0",ee],D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],X=()=>[Us,ee];return{cacheSize:500,separator:":",theme:{colors:[Ri],spacing:[fr,Ur],blur:["none","",Fr,ee],brightness:X(),borderColor:[t],borderRadius:["none","","full",Fr,ee],borderSpacing:U(),borderWidth:te(),contrast:X(),grayscale:R(),hueRotate:X(),invert:R(),gap:U(),gradientColorStops:[t],gradientColorStopPositions:[Y1,Ur],inset:q(),margin:q(),opacity:X(),padding:U(),saturate:X(),scale:X(),sepia:R(),skew:X(),space:U(),translate:U()},classGroups:{aspect:[{aspect:["auto","square","video",ee]}],container:["container"],columns:[{columns:[Fr]}],"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:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ci,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:R()}],shrink:[{shrink:R()}],order:[{order:["first","last","none",Ci,ee]}],"grid-cols":[{"grid-cols":[Ri]}],"col-start-end":[{col:["auto",{span:["full",Ci,ee]},ee]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[Ri]}],"row-start-end":[{row:["auto",{span:[Ci,ee]},ee]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"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":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"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:[Fr]},Fr]}],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",Fr,Ur]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Uu]}],"font-family":[{font:[Ri]}],"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",Us,Uu]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",fr,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",fr,Ur]}],"underline-offset":[{"underline-offset":["auto",fr,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:U()}],"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(),tS]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",eS]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},nS]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],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":[fr,ee]}],"outline-w":[{outline:[fr,Ur]}],"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":[fr,Ur]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Fr,sS]}],"shadow-color":[{shadow:[Ri]}],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",Fr,ee]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[g]}],sepia:[{sepia:[k]}],"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":[d]}],"backdrop-opacity":[{"backdrop-opacity":[m]}],"backdrop-saturate":[{"backdrop-saturate":[g]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"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:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Ci,ee]}],"translate-x":[{"translate-x":[A]}],"translate-y":[{"translate-y":[A]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"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":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"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:[fr,Ur,Uu]}],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"]}}},uS=H1(lS);function Jt(...t){return uS(My(t))}const cS=w1,qy=_.forwardRef(({className:t,...e},r)=>x.jsx(Oy,{ref:r,className:Jt("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}));qy.displayName=Oy.displayName;const dS=_h("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"}}),Ky=_.forwardRef(({className:t,variant:e,...r},n)=>x.jsx(Ny,{ref:n,className:Jt(dS({variant:e}),t),...r}));Ky.displayName=Ny.displayName;const hS=_.forwardRef(({className:t,...e},r)=>x.jsx(Ly,{ref:r,className:Jt("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}));hS.displayName=Ly.displayName;const Gy=_.forwardRef(({className:t,...e},r)=>x.jsx($y,{ref:r,className:Jt("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:x.jsx(Fy,{className:"h-4 w-4"})}));Gy.displayName=$y.displayName;const Jy=_.forwardRef(({className:t,...e},r)=>x.jsx(jy,{ref:r,className:Jt("text-sm font-semibold",t),...e}));Jy.displayName=jy.displayName;const Qy=_.forwardRef(({className:t,...e},r)=>x.jsx(Iy,{ref:r,className:Jt("text-sm opacity-90",t),...e}));Qy.displayName=Iy.displayName;function fS(){const{toasts:t}=Tk();return x.jsxs(cS,{children:[t.map(function({id:e,title:r,description:n,action:s,...i}){return x.jsxs(Ky,{...i,children:[x.jsxs("div",{className:"grid gap-1",children:[r&&x.jsx(Jy,{children:r}),n&&x.jsx(Qy,{children:n})]}),s,x.jsx(Gy,{})]},e)}),x.jsx(qy,{})]})}const pS=["top","right","bottom","left"],yn=Math.min,ht=Math.max,hl=Math.round,da=Math.floor,lr=t=>({x:t,y:t}),mS={left:"right",right:"left",bottom:"top",top:"bottom"},gS={start:"end",end:"start"};function Zc(t,e,r){return ht(t,yn(e,r))}function Cr(t,e){return typeof t=="function"?t(e):t}function Rr(t){return t.split("-")[0]}function pi(t){return t.split("-")[1]}function xh(t){return t==="x"?"y":"x"}function kh(t){return t==="y"?"height":"width"}const vS=new Set(["top","bottom"]);function ir(t){return vS.has(Rr(t))?"y":"x"}function Sh(t){return xh(ir(t))}function yS(t,e,r){r===void 0&&(r=!1);const n=pi(t),s=Sh(t),i=kh(s);let o=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=fl(o)),[o,fl(o)]}function wS(t){const e=fl(t);return[Yc(t),e,Yc(e)]}function Yc(t){return t.replace(/start|end/g,e=>gS[e])}const Ep=["left","right"],Tp=["right","left"],_S=["top","bottom"],bS=["bottom","top"];function xS(t,e,r){switch(t){case"top":case"bottom":return r?e?Tp:Ep:e?Ep:Tp;case"left":case"right":return e?_S:bS;default:return[]}}function kS(t,e,r,n){const s=pi(t);let i=xS(Rr(t),r==="start",n);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(Yc)))),i}function fl(t){return t.replace(/left|right|bottom|top/g,e=>mS[e])}function SS(t){return{top:0,right:0,bottom:0,left:0,...t}}function Zy(t){return typeof t!="number"?SS(t):{top:t,right:t,bottom:t,left:t}}function pl(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 Cp(t,e,r){let{reference:n,floating:s}=t;const i=ir(e),o=Sh(e),a=kh(o),l=Rr(e),u=i==="y",c=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,f=n[a]/2-s[a]/2;let h;switch(l){case"top":h={x:c,y:n.y-s.height};break;case"bottom":h={x:c,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:d};break;case"left":h={x:n.x-s.width,y:d};break;default:h={x:n.x,y:n.y}}switch(pi(e)){case"start":h[o]-=f*(r&&u?-1:1);break;case"end":h[o]+=f*(r&&u?-1:1);break}return h}const ES=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:d}=Cp(u,n,l),f=n,h={},y=0;for(let v=0;v<a.length;v++){const{name:w,fn:m}=a[v],{x:p,y:g,data:b,reset:k}=await m({x:c,y:d,initialPlacement:n,placement:f,strategy:s,middlewareData:h,rects:u,platform:o,elements:{reference:t,floating:e}});c=p??c,d=g??d,h={...h,[w]:{...h[w],...b}},k&&y<=50&&(y++,typeof k=="object"&&(k.placement&&(f=k.placement),k.rects&&(u=k.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):k.rects),{x:c,y:d}=Cp(u,f,l)),v=-1)}return{x:c,y:d,placement:f,strategy:s,middlewareData:h}};async function vo(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:d="floating",altBoundary:f=!1,padding:h=0}=Cr(e,t),y=Zy(h),w=a[f?d==="floating"?"reference":"floating":d],m=pl(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=d==="floating"?{x:n,y:s,width:o.floating.width,height:o.floating.height}:o.reference,g=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(g))?await(i.getScale==null?void 0:i.getScale(g))||{x:1,y:1}:{x:1,y:1},k=pl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:p,offsetParent:g,strategy:l}):p);return{top:(m.top-k.top+y.top)/b.y,bottom:(k.bottom-m.bottom+y.bottom)/b.y,left:(m.left-k.left+y.left)/b.x,right:(k.right-m.right+y.right)/b.x}}const TS=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}=Cr(t,e)||{};if(u==null)return{};const d=Zy(c),f={x:r,y:n},h=Sh(s),y=kh(h),v=await o.getDimensions(u),w=h==="y",m=w?"top":"left",p=w?"bottom":"right",g=w?"clientHeight":"clientWidth",b=i.reference[y]+i.reference[h]-f[h]-i.floating[y],k=f[h]-i.reference[h],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let E=S?S[g]:0;(!E||!await(o.isElement==null?void 0:o.isElement(S)))&&(E=a.floating[g]||i.floating[y]);const A=b/2-k/2,N=E/2-v[y]/2-1,I=yn(d[m],N),q=yn(d[p],N),U=I,te=E-v[y]-q,L=E/2-v[y]/2+A,ie=Zc(U,L,te),K=!l.arrow&&pi(s)!=null&&L!==ie&&i.reference[y]/2-(L<U?I:q)-v[y]/2<0,Y=K?L<U?L-U:L-te:0;return{[h]:f[h]+Y,data:{[h]:ie,centerOffset:L-ie-Y,...K&&{alignmentOffset:Y}},reset:K}}}),CS=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:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...w}=Cr(t,e);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const m=Rr(s),p=ir(a),g=Rr(a)===a,b=await(l.isRTL==null?void 0:l.isRTL(u.floating)),k=f||(g||!v?[fl(a)]:wS(a)),S=y!=="none";!f&&S&&k.push(...kS(a,v,y,b));const E=[a,...k],A=await vo(e,w),N=[];let I=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&N.push(A[m]),d){const L=yS(s,o,b);N.push(A[L[0]],A[L[1]])}if(I=[...I,{placement:s,overflows:N}],!N.every(L=>L<=0)){var q,U;const L=(((q=i.flip)==null?void 0:q.index)||0)+1,ie=E[L];if(ie&&(!(d==="alignment"?p!==ir(ie):!1)||I.every(C=>C.overflows[0]>0&&ir(C.placement)===p)))return{data:{index:L,overflows:I},reset:{placement:ie}};let K=(U=I.filter(Y=>Y.overflows[0]<=0).sort((Y,C)=>Y.overflows[1]-C.overflows[1])[0])==null?void 0:U.placement;if(!K)switch(h){case"bestFit":{var te;const Y=(te=I.filter(C=>{if(S){const R=ir(C.placement);return R===p||R==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(R=>R>0).reduce((R,D)=>R+D,0)]).sort((C,R)=>C[1]-R[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 Rp(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Ap(t){return pS.some(e=>t[e]>=0)}const RS=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...s}=Cr(t,e);switch(n){case"referenceHidden":{const i=await vo(e,{...s,elementContext:"reference"}),o=Rp(i,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Ap(o)}}}case"escaped":{const i=await vo(e,{...s,altBoundary:!0}),o=Rp(i,r.floating);return{data:{escapedOffsets:o,escaped:Ap(o)}}}default:return{}}}}},Yy=new Set(["left","top"]);async function AS(t,e){const{placement:r,platform:n,elements:s}=t,i=await(n.isRTL==null?void 0:n.isRTL(s.floating)),o=Rr(r),a=pi(r),l=ir(r)==="y",u=Yy.has(o)?-1:1,c=i&&l?-1:1,d=Cr(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:y}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof y=="number"&&(h=a==="end"?y*-1:y),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}const PS=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 AS(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}}}}},OS=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}=Cr(t,e),u={x:r,y:n},c=await vo(e,l),d=ir(Rr(s)),f=xh(d);let h=u[f],y=u[d];if(i){const w=f==="y"?"top":"left",m=f==="y"?"bottom":"right",p=h+c[w],g=h-c[m];h=Zc(p,h,g)}if(o){const w=d==="y"?"top":"left",m=d==="y"?"bottom":"right",p=y+c[w],g=y-c[m];y=Zc(p,y,g)}const v=a.fn({...e,[f]:h,[d]:y});return{...v,data:{x:v.x-r,y:v.y-n,enabled:{[f]:i,[d]:o}}}}}},NS=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}=Cr(t,e),c={x:r,y:n},d=ir(s),f=xh(d);let h=c[f],y=c[d];const v=Cr(a,e),w=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const g=f==="y"?"height":"width",b=i.reference[f]-i.floating[g]+w.mainAxis,k=i.reference[f]+i.reference[g]-w.mainAxis;h<b?h=b:h>k&&(h=k)}if(u){var m,p;const g=f==="y"?"width":"height",b=Yy.has(Rr(s)),k=i.reference[d]-i.floating[g]+(b&&((m=o.offset)==null?void 0:m[d])||0)+(b?0:w.crossAxis),S=i.reference[d]+i.reference[g]+(b?0:((p=o.offset)==null?void 0:p[d])||0)-(b?w.crossAxis:0);y<k?y=k:y>S&&(y=S)}return{[f]:h,[d]:y}}}},jS=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}=Cr(t,e),c=await vo(e,u),d=Rr(s),f=pi(s),h=ir(s)==="y",{width:y,height:v}=i.floating;let w,m;d==="top"||d==="bottom"?(w=d,m=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(m=d,w=f==="end"?"top":"bottom");const p=v-c.top-c.bottom,g=y-c.left-c.right,b=yn(v-c[w],p),k=yn(y-c[m],g),S=!e.middlewareData.shift;let E=b,A=k;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(A=g),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(E=p),S&&!f){const I=ht(c.left,0),q=ht(c.right,0),U=ht(c.top,0),te=ht(c.bottom,0);h?A=y-2*(I!==0||q!==0?I+q:ht(c.left,c.right)):E=v-2*(U!==0||te!==0?U+te:ht(c.top,c.bottom))}await l({...e,availableWidth:A,availableHeight:E});const N=await o.getDimensions(a.floating);return y!==N.width||v!==N.height?{reset:{rects:!0}}:{}}}};function Jl(){return typeof window<"u"}function mi(t){return Xy(t)?(t.nodeName||"").toLowerCase():"#document"}function gt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function hr(t){var e;return(e=(Xy(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Xy(t){return Jl()?t instanceof Node||t instanceof gt(t).Node:!1}function Kt(t){return Jl()?t instanceof Element||t instanceof gt(t).Element:!1}function cr(t){return Jl()?t instanceof HTMLElement||t instanceof gt(t).HTMLElement:!1}function Pp(t){return!Jl()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof gt(t).ShadowRoot}const IS=new Set(["inline","contents"]);function Mo(t){const{overflow:e,overflowX:r,overflowY:n,display:s}=Gt(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!IS.has(s)}const LS=new Set(["table","td","th"]);function $S(t){return LS.has(mi(t))}const DS=[":popover-open",":modal"];function Ql(t){return DS.some(e=>{try{return t.matches(e)}catch{return!1}})}const MS=["transform","translate","scale","rotate","perspective"],US=["transform","translate","scale","rotate","perspective","filter"],FS=["paint","layout","strict","content"];function Eh(t){const e=Th(),r=Kt(t)?Gt(t):t;return MS.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)||US.some(n=>(r.willChange||"").includes(n))||FS.some(n=>(r.contain||"").includes(n))}function zS(t){let e=wn(t);for(;cr(e)&&!ni(e);){if(Eh(e))return e;if(Ql(e))return null;e=wn(e)}return null}function Th(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const BS=new Set(["html","body","#document"]);function ni(t){return BS.has(mi(t))}function Gt(t){return gt(t).getComputedStyle(t)}function Zl(t){return Kt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function wn(t){if(mi(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Pp(t)&&t.host||hr(t);return Pp(e)?e.host:e}function e0(t){const e=wn(t);return ni(e)?t.ownerDocument?t.ownerDocument.body:t.body:cr(e)&&Mo(e)?e:e0(e)}function yo(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const s=e0(t),i=s===((n=t.ownerDocument)==null?void 0:n.body),o=gt(s);if(i){const a=Xc(o);return e.concat(o,o.visualViewport||[],Mo(s)?s:[],a&&r?yo(a):[])}return e.concat(s,yo(s,[],r))}function Xc(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function t0(t){const e=Gt(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const s=cr(t),i=s?t.offsetWidth:r,o=s?t.offsetHeight:n,a=hl(r)!==i||hl(n)!==o;return a&&(r=i,n=o),{width:r,height:n,$:a}}function Ch(t){return Kt(t)?t:t.contextElement}function Fs(t){const e=Ch(t);if(!cr(e))return lr(1);const r=e.getBoundingClientRect(),{width:n,height:s,$:i}=t0(e);let o=(i?hl(r.width):r.width)/n,a=(i?hl(r.height):r.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const VS=lr(0);function r0(t){const e=gt(t);return!Th()||!e.visualViewport?VS:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function HS(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==gt(t)?!1:e}function Zn(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const s=t.getBoundingClientRect(),i=Ch(t);let o=lr(1);e&&(n?Kt(n)&&(o=Fs(n)):o=Fs(t));const a=HS(i,r,n)?r0(i):lr(0);let l=(s.left+a.x)/o.x,u=(s.top+a.y)/o.y,c=s.width/o.x,d=s.height/o.y;if(i){const f=gt(i),h=n&&Kt(n)?gt(n):n;let y=f,v=Xc(y);for(;v&&n&&h!==y;){const w=Fs(v),m=v.getBoundingClientRect(),p=Gt(v),g=m.left+(v.clientLeft+parseFloat(p.paddingLeft))*w.x,b=m.top+(v.clientTop+parseFloat(p.paddingTop))*w.y;l*=w.x,u*=w.y,c*=w.x,d*=w.y,l+=g,u+=b,y=gt(v),v=Xc(y)}}return pl({width:c,height:d,x:l,y:u})}function Rh(t,e){const r=Zl(t).scrollLeft;return e?e.left+r:Zn(hr(t)).left+r}function n0(t,e,r){r===void 0&&(r=!1);const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-(r?0:Rh(t,n)),i=n.top+e.scrollTop;return{x:s,y:i}}function WS(t){let{elements:e,rect:r,offsetParent:n,strategy:s}=t;const i=s==="fixed",o=hr(n),a=e?Ql(e.floating):!1;if(n===o||a&&i)return r;let l={scrollLeft:0,scrollTop:0},u=lr(1);const c=lr(0),d=cr(n);if((d||!d&&!i)&&((mi(n)!=="body"||Mo(o))&&(l=Zl(n)),cr(n))){const h=Zn(n);u=Fs(n),c.x=h.x+n.clientLeft,c.y=h.y+n.clientTop}const f=o&&!d&&!i?n0(o,l,!0):lr(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 qS(t){return Array.from(t.getClientRects())}function KS(t){const e=hr(t),r=Zl(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+Rh(t);const a=-r.scrollTop;return Gt(n).direction==="rtl"&&(o+=ht(e.clientWidth,n.clientWidth)-s),{width:s,height:i,x:o,y:a}}function GS(t,e){const r=gt(t),n=hr(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=Th();(!u||u&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:i,height:o,x:a,y:l}}const JS=new Set(["absolute","fixed"]);function QS(t,e){const r=Zn(t,!0,e==="fixed"),n=r.top+t.clientTop,s=r.left+t.clientLeft,i=cr(t)?Fs(t):lr(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 Op(t,e,r){let n;if(e==="viewport")n=GS(t,r);else if(e==="document")n=KS(hr(t));else if(Kt(e))n=QS(e,r);else{const s=r0(t);n={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return pl(n)}function s0(t,e){const r=wn(t);return r===e||!Kt(r)||ni(r)?!1:Gt(r).position==="fixed"||s0(r,e)}function ZS(t,e){const r=e.get(t);if(r)return r;let n=yo(t,[],!1).filter(a=>Kt(a)&&mi(a)!=="body"),s=null;const i=Gt(t).position==="fixed";let o=i?wn(t):t;for(;Kt(o)&&!ni(o);){const a=Gt(o),l=Eh(o);!l&&a.position==="fixed"&&(s=null),(i?!l&&!s:!l&&a.position==="static"&&!!s&&JS.has(s.position)||Mo(o)&&!l&&s0(t,o))?n=n.filter(c=>c!==o):s=a,o=wn(o)}return e.set(t,n),n}function YS(t){let{element:e,boundary:r,rootBoundary:n,strategy:s}=t;const o=[...r==="clippingAncestors"?Ql(e)?[]:ZS(e,this._c):[].concat(r),n],a=o[0],l=o.reduce((u,c)=>{const d=Op(e,c,s);return u.top=ht(d.top,u.top),u.right=yn(d.right,u.right),u.bottom=yn(d.bottom,u.bottom),u.left=ht(d.left,u.left),u},Op(e,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function XS(t){const{width:e,height:r}=t0(t);return{width:e,height:r}}function eE(t,e,r){const n=cr(e),s=hr(e),i=r==="fixed",o=Zn(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=lr(0);function u(){l.x=Rh(s)}if(n||!n&&!i)if((mi(e)!=="body"||Mo(s))&&(a=Zl(e)),n){const h=Zn(e,!0,i,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else s&&u();i&&!n&&s&&u();const c=s&&!n&&!i?n0(s,a):lr(0),d=o.left+a.scrollLeft-l.x-c.x,f=o.top+a.scrollTop-l.y-c.y;return{x:d,y:f,width:o.width,height:o.height}}function Fu(t){return Gt(t).position==="static"}function Np(t,e){if(!cr(t)||Gt(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return hr(t)===r&&(r=r.ownerDocument.body),r}function i0(t,e){const r=gt(t);if(Ql(t))return r;if(!cr(t)){let s=wn(t);for(;s&&!ni(s);){if(Kt(s)&&!Fu(s))return s;s=wn(s)}return r}let n=Np(t,e);for(;n&&$S(n)&&Fu(n);)n=Np(n,e);return n&&ni(n)&&Fu(n)&&!Eh(n)?r:n||zS(t)||r}const tE=async function(t){const e=this.getOffsetParent||i0,r=this.getDimensions,n=await r(t.floating);return{reference:eE(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function rE(t){return Gt(t).direction==="rtl"}const nE={convertOffsetParentRelativeRectToViewportRelativeRect:WS,getDocumentElement:hr,getClippingRect:YS,getOffsetParent:i0,getElementRects:tE,getClientRects:qS,getDimensions:XS,getScale:Fs,isElement:Kt,isRTL:rE};function o0(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function sE(t,e){let r=null,n;const s=hr(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:d,width:f,height:h}=u;if(a||e(),!f||!h)return;const y=da(d),v=da(s.clientWidth-(c+f)),w=da(s.clientHeight-(d+h)),m=da(c),g={rootMargin:-y+"px "+-v+"px "+-w+"px "+-m+"px",threshold:ht(0,yn(1,l))||1};let b=!0;function k(S){const E=S[0].intersectionRatio;if(E!==l){if(!b)return o();E?o(!1,E):n=setTimeout(()=>{o(!1,1e-7)},1e3)}E===1&&!o0(u,t.getBoundingClientRect())&&o(),b=!1}try{r=new IntersectionObserver(k,{...g,root:s.ownerDocument})}catch{r=new IntersectionObserver(k,g)}r.observe(t)}return o(!0),i}function iE(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=Ch(t),c=s||i?[...u?yo(u):[],...yo(e)]:[];c.forEach(m=>{s&&m.addEventListener("scroll",r,{passive:!0}),i&&m.addEventListener("resize",r)});const d=u&&a?sE(u,r):null;let f=-1,h=null;o&&(h=new ResizeObserver(m=>{let[p]=m;p&&p.target===u&&h&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var g;(g=h)==null||g.observe(e)})),r()}),u&&!l&&h.observe(u),h.observe(e));let y,v=l?Zn(t):null;l&&w();function w(){const m=Zn(t);v&&!o0(v,m)&&r(),v=m,y=requestAnimationFrame(w)}return r(),()=>{var m;c.forEach(p=>{s&&p.removeEventListener("scroll",r),i&&p.removeEventListener("resize",r)}),d==null||d(),(m=h)==null||m.disconnect(),h=null,l&&cancelAnimationFrame(y)}}const oE=PS,aE=OS,lE=CS,uE=jS,cE=RS,jp=TS,dE=NS,hE=(t,e,r)=>{const n=new Map,s={platform:nE,...r},i={...s.platform,_c:n};return ES(t,e,{...s,platform:i})};var fE=typeof document<"u",pE=function(){},La=fE?_.useLayoutEffect:pE;function ml(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(!ml(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)&&!ml(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function a0(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ip(t,e){const r=a0(t);return Math.round(e*r)/r}function zu(t){const e=_.useRef(t);return La(()=>{e.current=t}),e}function mE(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,d]=_.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[f,h]=_.useState(n);ml(f,n)||h(n);const[y,v]=_.useState(null),[w,m]=_.useState(null),p=_.useCallback(C=>{C!==S.current&&(S.current=C,v(C))},[]),g=_.useCallback(C=>{C!==E.current&&(E.current=C,m(C))},[]),b=i||y,k=o||w,S=_.useRef(null),E=_.useRef(null),A=_.useRef(c),N=l!=null,I=zu(l),q=zu(s),U=zu(u),te=_.useCallback(()=>{if(!S.current||!E.current)return;const C={placement:e,strategy:r,middleware:f};q.current&&(C.platform=q.current),hE(S.current,E.current,C).then(R=>{const D={...R,isPositioned:U.current!==!1};L.current&&!ml(A.current,D)&&(A.current=D,$o.flushSync(()=>{d(D)}))})},[f,e,r,q,U]);La(()=>{u===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,d(C=>({...C,isPositioned:!1})))},[u]);const L=_.useRef(!1);La(()=>(L.current=!0,()=>{L.current=!1}),[]),La(()=>{if(b&&(S.current=b),k&&(E.current=k),b&&k){if(I.current)return I.current(b,k,te);te()}},[b,k,te,I,N]);const ie=_.useMemo(()=>({reference:S,floating:E,setReference:p,setFloating:g}),[p,g]),K=_.useMemo(()=>({reference:b,floating:k}),[b,k]),Y=_.useMemo(()=>{const C={position:r,left:0,top:0};if(!K.floating)return C;const R=Ip(K.floating,c.x),D=Ip(K.floating,c.y);return a?{...C,transform:"translate("+R+"px, "+D+"px)",...a0(K.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:R,top:D}},[r,a,K.floating,c.x,c.y]);return _.useMemo(()=>({...c,update:te,refs:ie,elements:K,floatingStyles:Y}),[c,te,ie,K,Y])}const gE=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?jp({element:n.current,padding:s}).fn(r):{}:n?jp({element:n,padding:s}).fn(r):{}}}},vE=(t,e)=>({...oE(t),options:[t,e]}),yE=(t,e)=>({...aE(t),options:[t,e]}),wE=(t,e)=>({...dE(t),options:[t,e]}),_E=(t,e)=>({...lE(t),options:[t,e]}),bE=(t,e)=>({...uE(t),options:[t,e]}),xE=(t,e)=>({...cE(t),options:[t,e]}),kE=(t,e)=>({...gE(t),options:[t,e]});var SE="Arrow",l0=_.forwardRef((t,e)=>{const{children:r,width:n=10,height:s=5,...i}=t;return x.jsx(tt.svg,{...i,ref:e,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:x.jsx("polygon",{points:"0,0 30,0 15,10"})})});l0.displayName=SE;var EE=l0;function TE(t){const[e,r]=_.useState(void 0);return vn(()=>{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 u0="Popper",[c0,d0]=ql(u0),[HA,h0]=c0(u0),f0="PopperAnchor",p0=_.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...s}=t,i=h0(f0,r),o=_.useRef(null),a=qt(e,o);return _.useEffect(()=>{i.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:x.jsx(tt.div,{...s,ref:a})});p0.displayName=f0;var Ah="PopperContent",[CE,RE]=c0(Ah),m0=_.forwardRef((t,e)=>{var de,ts,Nr,En,jr,rs;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:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:h="optimized",onPlaced:y,...v}=t,w=h0(Ah,r),[m,p]=_.useState(null),g=qt(e,Ir=>p(Ir)),[b,k]=_.useState(null),S=TE(b),E=(S==null?void 0:S.width)??0,A=(S==null?void 0:S.height)??0,N=n+(i!=="center"?"-"+i:""),I=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},q=Array.isArray(u)?u:[u],U=q.length>0,te={padding:I,boundary:q.filter(PE),altBoundary:U},{refs:L,floatingStyles:ie,placement:K,isPositioned:Y,middlewareData:C}=mE({strategy:"fixed",placement:N,whileElementsMounted:(...Ir)=>iE(...Ir,{animationFrame:h==="always"}),elements:{reference:w.anchor},middleware:[vE({mainAxis:s+A,alignmentAxis:o}),l&&yE({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?wE():void 0,...te}),l&&_E({...te}),bE({...te,apply:({elements:Ir,rects:Fo,availableWidth:su,availableHeight:zo})=>{const{width:iu,height:vi}=Fo.reference,ns=Ir.floating.style;ns.setProperty("--radix-popper-available-width",`${su}px`),ns.setProperty("--radix-popper-available-height",`${zo}px`),ns.setProperty("--radix-popper-anchor-width",`${iu}px`),ns.setProperty("--radix-popper-anchor-height",`${vi}px`)}}),b&&kE({element:b,padding:a}),OE({arrowWidth:E,arrowHeight:A}),f&&xE({strategy:"referenceHidden",...te})]}),[R,D]=y0(K),X=gn(y);vn(()=>{Y&&(X==null||X())},[Y,X]);const W=(de=C.arrow)==null?void 0:de.x,ne=(ts=C.arrow)==null?void 0:ts.y,oe=((Nr=C.arrow)==null?void 0:Nr.centerOffset)!==0,[Ae,Be]=_.useState();return vn(()=>{m&&Be(window.getComputedStyle(m).zIndex)},[m]),x.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...ie,transform:Y?ie.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ae,"--radix-popper-transform-origin":[(En=C.transformOrigin)==null?void 0:En.x,(jr=C.transformOrigin)==null?void 0:jr.y].join(" "),...((rs=C.hide)==null?void 0:rs.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:x.jsx(CE,{scope:r,placedSide:R,onArrowChange:k,arrowX:W,arrowY:ne,shouldHideArrow:oe,children:x.jsx(tt.div,{"data-side":R,"data-align":D,...v,ref:g,style:{...v.style,animation:Y?void 0:"none"}})})})});m0.displayName=Ah;var g0="PopperArrow",AE={top:"bottom",right:"left",bottom:"top",left:"right"},v0=_.forwardRef(function(e,r){const{__scopePopper:n,...s}=e,i=RE(g0,n),o=AE[i.placedSide];return x.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:x.jsx(EE,{...s,ref:r,style:{...s.style,display:"block"}})})});v0.displayName=g0;function PE(t){return t!==null}var OE=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]=y0(r),d={start:"0%",center:"50%",end:"100%"}[c],f=(((m=s.arrow)==null?void 0:m.x)??0)+a/2,h=(((p=s.arrow)==null?void 0:p.y)??0)+l/2;let y="",v="";return u==="bottom"?(y=o?d:`${f}px`,v=`${-l}px`):u==="top"?(y=o?d:`${f}px`,v=`${n.floating.height+l}px`):u==="right"?(y=`${-l}px`,v=o?d:`${h}px`):u==="left"&&(y=`${n.floating.width+l}px`,v=o?d:`${h}px`),{data:{x:y,y:v}}}});function y0(t){const[e,r="center"]=t.split("-");return[e,r]}var NE=p0,jE=m0,IE=v0,[Yl,WA]=ql("Tooltip",[d0]),Ph=d0(),w0="TooltipProvider",LE=700,Lp="tooltip.open",[$E,_0]=Yl(w0),b0=t=>{const{__scopeTooltip:e,delayDuration:r=LE,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:i}=t,o=_.useRef(!0),a=_.useRef(!1),l=_.useRef(0);return _.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),x.jsx($E,{scope:e,isOpenDelayedRef:o,delayDuration:r,onOpen:_.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:_.useCallback(u=>{a.current=u},[]),disableHoverableContent:s,children:i})};b0.displayName=w0;var x0="Tooltip",[qA,Xl]=Yl(x0),ed="TooltipTrigger",DE=_.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,s=Xl(ed,r),i=_0(ed,r),o=Ph(r),a=_.useRef(null),l=qt(e,a,s.onTriggerChange),u=_.useRef(!1),c=_.useRef(!1),d=_.useCallback(()=>u.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),x.jsx(NE,{asChild:!0,...o,children:x.jsx(tt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:l,onPointerMove:je(t.onPointerMove,f=>{f.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),c.current=!0)}),onPointerLeave:je(t.onPointerLeave,()=>{s.onTriggerLeave(),c.current=!1}),onPointerDown:je(t.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:je(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:je(t.onBlur,s.onClose),onClick:je(t.onClick,s.onClose)})})});DE.displayName=ed;var ME="TooltipPortal",[KA,UE]=Yl(ME,{forceMount:void 0}),si="TooltipContent",k0=_.forwardRef((t,e)=>{const r=UE(si,t.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...i}=t,o=Xl(si,t.__scopeTooltip);return x.jsx(gh,{present:n||o.open,children:o.disableHoverableContent?x.jsx(S0,{side:s,...i,ref:e}):x.jsx(FE,{side:s,...i,ref:e})})}),FE=_.forwardRef((t,e)=>{const r=Xl(si,t.__scopeTooltip),n=_0(si,t.__scopeTooltip),s=_.useRef(null),i=qt(e,s),[o,a]=_.useState(null),{trigger:l,onClose:u}=r,c=s.current,{onPointerInTransitChange:d}=n,f=_.useCallback(()=>{a(null),d(!1)},[d]),h=_.useCallback((y,v)=>{const w=y.currentTarget,m={x:y.clientX,y:y.clientY},p=WE(m,w.getBoundingClientRect()),g=qE(m,p),b=KE(v.getBoundingClientRect()),k=JE([...g,...b]);a(k),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(l&&c){const y=w=>h(w,c),v=w=>h(w,l);return l.addEventListener("pointerleave",y),c.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",y),c.removeEventListener("pointerleave",v)}}},[l,c,h,f]),_.useEffect(()=>{if(o){const y=v=>{const w=v.target,m={x:v.clientX,y:v.clientY},p=(l==null?void 0:l.contains(w))||(c==null?void 0:c.contains(w)),g=!GE(m,o);p?f():g&&(f(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,c,o,u,f]),x.jsx(S0,{...t,ref:i})}),[zE,BE]=Yl(x0,{isInside:!1}),VE=Pk("TooltipContent"),S0=_.forwardRef((t,e)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,l=Xl(si,r),u=Ph(r),{onClose:c}=l;return _.useEffect(()=>(document.addEventListener(Lp,c),()=>document.removeEventListener(Lp,c)),[c]),_.useEffect(()=>{if(l.trigger){const d=f=>{const h=f.target;h!=null&&h.contains(l.trigger)&&c()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,c]),x.jsx(mh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:x.jsxs(jE,{"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:[x.jsx(VE,{children:n}),x.jsx(zE,{scope:r,isInside:!0,children:x.jsx(t1,{id:l.contentId,role:"tooltip",children:s||n})})]})})});k0.displayName=si;var E0="TooltipArrow",HE=_.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,s=Ph(r);return BE(E0,r).isInside?null:x.jsx(IE,{...s,...n,ref:e})});HE.displayName=E0;function WE(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 qE(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 KE(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 GE(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,d=l.x,f=l.y;c>n!=f>n&&r<(d-u)*(n-c)/(f-c)+u&&(s=!s)}return s}function JE(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),QE(e)}function QE(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 ZE=b0,T0=k0;const YE=ZE,XE=_.forwardRef(({className:t,sideOffset:e=4,...r},n)=>x.jsx(T0,{ref:n,sideOffset:e,className:Jt("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}));XE.displayName=T0.displayName;const eT=_h("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors 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",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",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"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),ii=_.forwardRef(({className:t,variant:e,size:r,asChild:n=!1,...s},i)=>{const o=n?Rk:"button";return x.jsx(o,{className:Jt(eT({variant:e,size:r,className:t})),ref:i,...s})});ii.displayName="Button";const tT=()=>{const[t,e]=_.useState(!1),r=[{label:"Tjänster",href:"#services"},{label:"Varför oss?",href:"#why-us"},{label:"Kontakt",href:"#contact"}];return x.jsxs("nav",{className:"sticky top-0 z-50 border-b bg-background/80 backdrop-blur-md",children:[x.jsxs("div",{className:"container flex h-24 items-center justify-between relative",children:[x.jsx("a",{href:"#",className:"md:static absolute left-1/2 -translate-x-1/2 md:translate-x-0 md:left-auto",children:x.jsx("img",{src:"/solros_logo.png",alt:"Solros Energi",className:"h-24 w-auto"})}),x.jsxs("div",{className:"hidden items-center gap-8 md:flex",children:[r.map(n=>x.jsx("a",{href:n.href,children:n.label},n.href)),x.jsx(ii,{asChild:!0,size:"sm",children:x.jsx("a",{href:"#contact",children:"Få en offert"})})]}),x.jsx("button",{className:"md:hidden ml-auto",onClick:()=>e(!t),"aria-label":"Toggle menu",children:t?x.jsx(Fy,{className:"h-5 w-5"}):x.jsx(C1,{className:"h-5 w-5"})})]}),t&&x.jsx("div",{className:"border-t bg-background px-6 pb-6 pt-4 md:hidden",children:x.jsxs("div",{className:"flex flex-col gap-4",children:[r.map(n=>x.jsx("a",{href:n.href,className:"text-sm font-medium text-muted-foreground transition-colors hover:text-foreground",onClick:()=>e(!1),children:n.label},n.href)),x.jsx(ii,{asChild:!0,size:"sm",className:"w-full",children:x.jsx("a",{href:"#contact",onClick:()=>e(!1),children:"Få en offert"})})]})})]})},rT=()=>x.jsxs("section",{className:"relative overflow-hidden",style:{background:"linear-gradient(135deg, hsl(90 50% 65%) 0%, hsl(120 40% 50%) 25%, hsl(170 50% 35%) 60%, hsl(180 45% 25%) 100%)"},children:[x.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:"radial-gradient(ellipse 60% 50% at 50% 40%, hsla(100, 60%, 65%, 0.35) 0%, transparent 70%)"}}),x.jsx("div",{className:"pointer-events-none absolute inset-0 bg-black/25"}),x.jsx("div",{className:"container relative z-10 py-20 md:py-32 lg:py-40",children:x.jsxs("div",{className:"mx-auto max-w-3xl text-center",children:[x.jsx("p",{className:"mb-4 text-sm font-semibold uppercase tracking-wider animate-fade-in-up",style:{color:"#ffffff"},children:"Södertörns hemenergiexperter"}),x.jsxs("h1",{className:"mb-6 text-4xl font-bold leading-tight tracking-tight text-white md:text-5xl lg:text-6xl animate-fade-in-up",style:{animationDelay:"0.1s"},children:["Lagra din solenergi."," ",x.jsx("span",{style:{color:"#F5C300"},children:"Spara varje dag."})]}),x.jsx("p",{className:"mx-auto mb-10 max-w-xl text-lg text-white/75 animate-fade-in-up",style:{animationDelay:"0.2s"},children:"Vi installerar hembatterier för solcellshushåll och kompletta solcellsanläggningar — allt från offert till färdig installation."}),x.jsxs("div",{className:"flex flex-col items-center gap-4 sm:flex-row sm:justify-center animate-fade-in-up",style:{animationDelay:"0.3s"},children:[x.jsx(ii,{asChild:!0,size:"lg",className:"gap-2 px-8 border-0",style:{backgroundColor:"#1a4a2e",color:"#F5C300"},children:x.jsxs("a",{href:"#contact",children:["Få en gratis offert ",x.jsx(k1,{className:"h-4 w-4"})]})}),x.jsx(ii,{asChild:!0,variant:"outline",size:"lg",className:"border-0",style:{backgroundColor:"#1a4a2e",color:"#f5f5f5"},children:x.jsx("a",{href:"#services",children:"Våra tjänster"})})]})]})}),x.jsx("div",{className:"absolute bottom-0 left-0 right-0 z-10",children:x.jsx("svg",{viewBox:"0 0 1440 60",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"w-full",children:x.jsx("path",{d:"M0 60L1440 60L1440 30C1200 0 240 0 0 30Z",fill:"hsl(var(--background))"})})})]});function Oh(t=.15){const e=_.useRef(null),[r,n]=_.useState(!1);return _.useEffect(()=>{const s=e.current;if(!s)return;const i=new IntersectionObserver(([o])=>{o.isIntersecting&&(n(!0),i.unobserve(s))},{threshold:t});return i.observe(s),()=>i.disconnect()},[t]),{ref:e,visible:r}}const nT=[{icon:S1,title:"Hembatteriinstallation",description:"Har du redan solceller? Maximera din egenförbrukning med ett smart hembatteri. Vi hanterar allt — dimensionering, installation och driftsättning.",features:["Anpassad batterikapacitet","Kompatibelt med befintliga solcellssystem","Smart energistyrning inkluderad","Nyckelfärdig installation"]},{icon:P1,title:"Solcellsinstallation",description:"Komplett solcellsanläggning för ditt hem — från takbesiktning till inkoppling. Svensk kvalitet, lokal expertis.",features:["Premiumsolpaneler","Professionell takmontering","Nätanslutning och certifiering","Upp till 25 års garanti"]}],sT=()=>{const{ref:t,visible:e}=Oh();return x.jsx("section",{id:"services",ref:t,className:`bg-background py-20 md:py-28 transition-none ${e?"animate-fade-in-up":"opacity-0"}`,children:x.jsxs("div",{className:"container",children:[x.jsxs("div",{className:"mx-auto mb-16 max-w-2xl text-center",children:[x.jsx("p",{className:"mb-2 text-sm font-semibold uppercase tracking-wider text-primary",children:"Våra tjänster"}),x.jsx("h2",{className:"text-3xl font-bold tracking-tight text-foreground md:text-4xl",children:"Energilösningar för ditt hem"})]}),x.jsx("div",{className:"grid gap-8 md:grid-cols-2",children:nT.map(r=>x.jsxs("div",{className:"group rounded-2xl border bg-card p-8 transition-shadow hover:shadow-lg md:p-10",children:[x.jsx("div",{className:"mb-6 flex h-14 w-14 items-center justify-center rounded-xl bg-secondary text-primary",children:x.jsx(r.icon,{className:"h-7 w-7"})}),x.jsx("h3",{className:"mb-3 text-xl font-bold text-card-foreground",children:r.title}),x.jsx("p",{className:"mb-6 text-muted-foreground leading-relaxed",children:r.description}),x.jsx("ul",{className:"space-y-2",children:r.features.map(n=>x.jsxs("li",{className:"flex items-start gap-2 text-sm text-card-foreground",children:[x.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary flex-shrink-0 mt-1.5"}),n]},n))})]},r.title))})]})})},iT=[{icon:T1,title:"Lokal expertis i Södertörn",description:"Vi känner Södertörns tak, elnät och regler — och finns alltid nära till hands."},{icon:O1,title:"Det solklara alternativet",description:"Från första hembesök till driftsättning — vi sköter allt."},{icon:A1,title:"Certifierade installatörer",description:"Alla våra tekniker är certifierade enligt branschstandard."},{icon:E1,title:"Personlig service",description:"Litet team, stort engagemang. Vi är med dig hela vägen."}],oT=()=>{const{ref:t,visible:e}=Oh();return x.jsx("section",{id:"why-us",ref:t,className:`bg-surface-green py-20 md:py-28 transition-none ${e?"animate-fade-in-up":"opacity-0"}`,children:x.jsxs("div",{className:"container",children:[x.jsxs("div",{className:"mx-auto mb-16 max-w-2xl text-center",children:[x.jsx("p",{className:"mb-2 text-sm font-semibold uppercase tracking-wider text-primary",children:"Varför välja oss?"}),x.jsx("h2",{className:"text-3xl font-bold tracking-tight text-foreground md:text-4xl",children:"Din trygghet är vår prioritet"})]}),x.jsx("div",{className:"grid gap-8 sm:grid-cols-2 lg:grid-cols-4",children:iT.map(r=>x.jsxs("div",{className:"text-center",children:[x.jsx("div",{className:"mx-auto mb-5 flex h-14 w-14 items-center justify-center rounded-full bg-primary text-primary-foreground",children:x.jsx(r.icon,{className:"h-6 w-6"})}),x.jsx("h3",{className:"mb-2 text-lg font-bold text-foreground",children:r.title}),x.jsx("p",{className:"text-sm leading-relaxed text-muted-foreground",children:r.description})]},r.title))})]})})},$a=_.forwardRef(({className:t,type:e,...r},n)=>x.jsx("input",{type:e,className:Jt("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 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 md:text-sm",t),ref:n,...r}));$a.displayName="Input";const C0=_.forwardRef(({className:t,...e},r)=>x.jsx("textarea",{className:Jt("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background 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",t),ref:r,...e}));C0.displayName="Textarea";var aT="Label",R0=_.forwardRef((t,e)=>x.jsx(tt.label,{...t,ref:e,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=t.onMouseDown)==null||s.call(t,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));R0.displayName=aT;var A0=R0;const lT=_h("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ii=_.forwardRef(({className:t,...e},r)=>x.jsx(A0,{ref:r,className:Jt(lT(),t),...e}));Ii.displayName=A0.displayName;function eu(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 uT(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(d){o(d)}}function l(c){try{u(n.throw(c))}catch(d){o(d)}}function u(c){c.done?i(c.value):s(c.value).then(a,l)}u((n=n.apply(t,e||[])).next())})}const cT=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class Nh extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class dT extends Nh{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class $p extends Nh{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Dp extends Nh{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var td;(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"})(td||(td={}));class hT{constructor(e,{headers:r={},customFetch:n,region:s=td.Any}={}){this.url=e,this.headers=r,this.region=s,this.fetch=cT(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return uT(this,arguments,void 0,function*(r,n={}){var s;let i,o;try{const{headers:a,method:l,body:u,signal:c,timeout:d}=n;let f={},{region:h}=n;h||(h=this.region);const y=new URL(`${this.url}/${r}`);h&&h!=="any"&&(f["x-region"]=h,y.searchParams.set("forceFunctionRegion",h));let v;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",v=u):typeof u=="string"?(f["Content-Type"]="text/plain",v=u):typeof FormData<"u"&&u instanceof FormData?v=u:(f["Content-Type"]="application/json",v=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?v=JSON.stringify(u):v=u;let w=c;d&&(o=new AbortController,i=setTimeout(()=>o.abort(),d),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:v,signal:w}).catch(k=>{throw new dT(k)}),p=m.headers.get("x-relay-error");if(p&&p==="true")throw new $p(m);if(!m.ok)throw new Dp(m);let g=((s=m.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),b;return g==="application/json"?b=yield m.json():g==="application/octet-stream"||g==="application/pdf"?b=yield m.blob():g==="text/event-stream"?b=m:g==="multipart/form-data"?b=yield m.formData():b=yield m.text(),{data:b,error:null,response:m}}catch(a){return{data:null,error:a,response:a instanceof Dp||a instanceof $p?a.context:void 0}}finally{i&&clearTimeout(i)}})}}const P0=3,Mp=t=>Math.min(1e3*2**t,3e4),fT=[520,503],O0=["GET","HEAD","OPTIONS"];var pT=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Up(t,e){return new Promise(r=>{if(e!=null&&e.aborted){r();return}const n=setTimeout(()=>{e==null||e.removeEventListener("abort",s),r()},t);function s(){clearTimeout(n),r()}e==null||e.addEventListener("abort",s)})}function mT(t,e,r,n){return!(!n||r>=P0||!O0.includes(t)||!fT.includes(e))}var gT=class{constructor(t){var e,r,n,s,i;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(r=t.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(n=t.shouldStripNulls)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(s=t.urlLengthLimit)!==null&&s!==void 0?s:8e3,this.retryEnabled=(i=t.retry)!==null&&i!==void 0?i:!0,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}retry(t){return this.retryEnabled=t,this}then(t,e){var r=this;if(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"),this.shouldStripNulls){const o=this.headers.get("Accept");o==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!o||o==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const n=this.fetch;let i=(async()=>{let o=0;for(;;){const u=new Headers(r.headers);o>0&&u.set("X-Retry-Count",String(o));let c;try{c=await n(r.url.toString(),{method:r.method,headers:u,body:JSON.stringify(r.body,(d,f)=>typeof f=="bigint"?f.toString():f),signal:r.signal})}catch(d){if((d==null?void 0:d.name)==="AbortError"||(d==null?void 0:d.code)==="ABORT_ERR"||!O0.includes(r.method))throw d;if(r.retryEnabled&&o<P0){const f=Mp(o);o++,await Up(f,r.signal);continue}throw d}if(mT(r.method,c.status,o,r.retryEnabled)){var a,l;const d=(a=(l=c.headers)===null||l===void 0?void 0:l.get("Retry-After"))!==null&&a!==void 0?a:null,f=d!==null?Math.max(0,parseInt(d,10)||0)*1e3:Mp(o);await c.text(),o++,await Up(f,r.signal);continue}return await r.processResponse(c)}})();return this.shouldThrowOnError||(i=i.catch(o=>{var a;let l="",u="",c="";const d=o==null?void 0:o.cause;if(d){var f,h,y,v;const p=(f=d==null?void 0:d.message)!==null&&f!==void 0?f:"",g=(h=d==null?void 0:d.code)!==null&&h!==void 0?h:"";l=`${(y=o==null?void 0:o.name)!==null&&y!==void 0?y:"FetchError"}: ${o==null?void 0:o.message}`,l+=`

Caused by: ${(v=d==null?void 0:d.name)!==null&&v!==void 0?v:"Error"}: ${p}`,g&&(l+=` (${g})`),d!=null&&d.stack&&(l+=`
${d.stack}`)}else{var w;l=(w=o==null?void 0:o.stack)!==null&&w!==void 0?w:""}const m=this.url.toString().length;return(o==null?void 0:o.name)==="AbortError"||(o==null?void 0:o.code)==="ABORT_ERR"?(c="",u="Request was aborted (timeout or manual cancellation)",m>this.urlLengthLimit&&(u+=`. Note: Your request URL is ${m} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((d==null?void 0:d.name)==="HeadersOverflowError"||(d==null?void 0:d.code)==="UND_ERR_HEADERS_OVERFLOW")&&(c="",u="HTTP headers exceeded server limits (typically 16KB)",m>this.urlLengthLimit&&(u+=`. Your request URL is ${m} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(a=o==null?void 0:o.name)!==null&&a!==void 0?a:"FetchError"}: ${o==null?void 0:o.message}`,details:l,hint:u,code:c},data:null,count:null,status:0,statusText:""}})),i.then(t,e)}async processResponse(t){var e=this;let r=null,n=null,s=null,i=t.status,o=t.statusText;if(t.ok){var a,l;if(e.method!=="HEAD"){var u;const f=await t.text();f===""||(e.headers.get("Accept")==="text/csv"||e.headers.get("Accept")&&(!((u=e.headers.get("Accept"))===null||u===void 0)&&u.includes("application/vnd.pgrst.plan+text"))?n=f:n=JSON.parse(f))}const c=(a=e.headers.get("Prefer"))===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),d=(l=t.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");c&&d&&d.length>1&&(s=parseInt(d[1])),e.isMaybeSingle&&Array.isArray(n)&&(n.length>1?(r={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,s=null,i=406,o="Not Acceptable"):n.length===1?n=n[0]:n=null)}else{const c=await t.text();try{r=JSON.parse(c),Array.isArray(r)&&t.status===404&&(n=[],r=null,i=200,o="OK")}catch{t.status===404&&c===""?(i=204,o="No Content"):r={message:c}}if(r&&e.shouldThrowOnError)throw new pT(r)}return{success:r===null,error:r,data:n,count:s,status:i,statusText:o}}returns(){return this}overrideTypes(){return this}},vT=class extends gT{select(t){let e=!1;const r=(t??"*").split("").map(n=>/\s/.test(n)&&!e?"":(n==='"'&&(e=!e),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:r,foreignTable:n,referencedTable:s=n}={}){const i=s?`${s}.order`:"order",o=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${o?`${o},`:""}${t}.${e?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:r=e}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${t}`),this}range(t,e,{foreignTable:r,referencedTable:n=r}={}){const s=typeof n>"u"?"offset":`${n}.offset`,i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${t}`),this.url.searchParams.set(i,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return 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:t=!1,verbose:e=!1,settings:r=!1,buffers:n=!1,wal:s=!1,format:i="text"}={}){var o;const a=[t?"analyze":null,e?"verbose":null,r?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),l=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${l}"; options=${a};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};const Fp=new RegExp("[,()]");var ps=class extends vT{eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&Fp.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}notIn(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&Fp.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`not.in.(${r})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:r,type:n}={}){let s="";n==="plain"?s="pl":n==="phrase"?s="ph":n==="websearch"&&(s="w");const i=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${s}fts${i}.${e}`),this}match(t){return Object.entries(t).filter(([e,r])=>r!==void 0).forEach(([e,r])=>{this.url.searchParams.append(e,`eq.${r}`)}),this}not(t,e,r){return this.url.searchParams.append(t,`not.${e}.${r}`),this}or(t,{foreignTable:e,referencedTable:r=e}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${t})`),this}filter(t,e,r){return this.url.searchParams.append(t,`${e}.${r}`),this}},yT=class{constructor(t,{headers:e={},schema:r,fetch:n,urlLengthLimit:s=8e3,retry:i}){this.url=t,this.headers=new Headers(e),this.schema=r,this.fetch=n,this.urlLengthLimit=s,this.retry=i}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:r=!1,count:n}=e??{},s=r?"HEAD":"GET";let i=!1;const o=(t??"*").split("").map(u=>/\s/.test(u)&&!i?"":(u==='"'&&(i=!i),u)).join(""),{url:a,headers:l}=this.cloneRequestState();return a.searchParams.set("select",o),n&&l.append("Prefer",`count=${n}`),new ps({method:s,url:a,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(t,{count:e,defaultToNull:r=!0}={}){var n;const s="POST",{url:i,headers:o}=this.cloneRequestState();if(e&&o.append("Prefer",`count=${e}`),r||o.append("Prefer","missing=default"),Array.isArray(t)){const a=t.reduce((l,u)=>l.concat(Object.keys(u)),[]);if(a.length>0){const l=[...new Set(a)].map(u=>`"${u}"`);i.searchParams.set("columns",l.join(","))}}return new ps({method:s,url:i,headers:o,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(t,{onConflict:e,ignoreDuplicates:r=!1,count:n,defaultToNull:s=!0}={}){var i;const o="POST",{url:a,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),e!==void 0&&a.searchParams.set("on_conflict",e),n&&l.append("Prefer",`count=${n}`),s||l.append("Prefer","missing=default"),Array.isArray(t)){const u=t.reduce((c,d)=>c.concat(Object.keys(d)),[]);if(u.length>0){const c=[...new Set(u)].map(d=>`"${d}"`);a.searchParams.set("columns",c.join(","))}}return new ps({method:o,url:a,headers:l,schema:this.schema,body:t,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(t,{count:e}={}){var r;const n="PATCH",{url:s,headers:i}=this.cloneRequestState();return e&&i.append("Prefer",`count=${e}`),new ps({method:n,url:s,headers:i,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:t}={}){var e;const r="DELETE",{url:n,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new ps({method:r,url:n,headers:s,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function wo(t){"@babel/helpers - typeof";return wo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wo(t)}function wT(t,e){if(wo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(wo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function _T(t){var e=wT(t,"string");return wo(e)=="symbol"?e:e+""}function bT(t,e,r){return(e=_T(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zp(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function ha(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?zp(Object(r),!0).forEach(function(n){bT(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zp(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var xT=class N0{constructor(e,{headers:r={},schema:n,fetch:s,timeout:i,urlLengthLimit:o=8e3,retry:a}={}){this.url=e,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=o;const l=s??globalThis.fetch;i!==void 0&&i>0?this.fetch=(u,c)=>{const d=new AbortController,f=setTimeout(()=>d.abort(),i),h=c==null?void 0:c.signal;if(h){if(h.aborted)return clearTimeout(f),l(u,c);const y=()=>{clearTimeout(f),d.abort()};return h.addEventListener("abort",y,{once:!0}),l(u,ha(ha({},c),{},{signal:d.signal})).finally(()=>{clearTimeout(f),h.removeEventListener("abort",y)})}return l(u,ha(ha({},c),{},{signal:d.signal})).finally(()=>clearTimeout(f))}:this.fetch=l,this.retry=a}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new yT(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(e){return new N0(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,r={},{head:n=!1,get:s=!1,count:i}={}){var o;let a;const l=new URL(`${this.url}/rpc/${e}`);let u;const c=h=>h!==null&&typeof h=="object"&&(!Array.isArray(h)||h.some(c)),d=n&&Object.values(r).some(c);d?(a="POST",u=r):n||s?(a=n?"HEAD":"GET",Object.entries(r).filter(([h,y])=>y!==void 0).map(([h,y])=>[h,Array.isArray(y)?`{${y.join(",")}}`:`${y}`]).forEach(([h,y])=>{l.searchParams.append(h,y)})):(a="POST",u=r);const f=new Headers(this.headers);return d?f.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&f.set("Prefer",`count=${i}`),new ps({method:a,url:l,headers:f,schema:this.schemaName,body:u,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class kT{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."};const r=globalThis.process;if(r){const n=r.versions;if(n&&n.node){const s=n.node,i=parseInt(s.replace(/^v/,"").split(".")[0]);return i>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${i} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${i} 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 isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const ST="2.103.2",ET=`realtime-js/${ST}`,TT="1.0.0",j0="2.0.0",CT=j0,RT=1e4,AT=100,Kr={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},I0={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},rd={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class PT{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):{},d=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(d.length>255)throw new Error(`metadata length ${d.length} exceeds maximum of 255`);const f=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+a.length+o.length+u.length+d.length,h=new ArrayBuffer(this.HEADER_LENGTH+f);let y=new DataView(h),v=0;y.setUint8(v++,this.KINDS.userBroadcastPush),y.setUint8(v++,l.length),y.setUint8(v++,a.length),y.setUint8(v++,o.length),y.setUint8(v++,u.length),y.setUint8(v++,d.length),y.setUint8(v++,r),Array.from(l,m=>y.setUint8(v++,m.charCodeAt(0))),Array.from(a,m=>y.setUint8(v++,m.charCodeAt(0))),Array.from(o,m=>y.setUint8(v++,m.charCodeAt(0))),Array.from(u,m=>y.setUint8(v++,m.charCodeAt(0))),Array.from(d,m=>y.setUint8(v++,m.charCodeAt(0)));var w=new Uint8Array(h.byteLength+n.byteLength);return w.set(new Uint8Array(h),0),w.set(new Uint8Array(n),h.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 d=n.decode(e.slice(l,l+o));l=l+o;const f=e.slice(l,e.byteLength),h=a===this.JSON_ENCODING?JSON.parse(n.decode(f)):f,y={type:this.BROADCAST_EVENT,event:c,payload:h};return o>0&&(y.meta=JSON.parse(d)),{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)))}}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 Bp=(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]=OT(o,t,e,s),i),{}):{}},OT=(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)?L0(i,o):nd(o)},L0=(t,e)=>{if(t.charAt(0)==="_"){const r=t.slice(1,t.length);return LT(e,r)}switch(t){case pe.bool:return NT(e);case pe.float4:case pe.float8:case pe.int2:case pe.int4:case pe.int8:case pe.numeric:case pe.oid:return jT(e);case pe.json:case pe.jsonb:return IT(e);case pe.timestamp:return $T(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 nd(e);default:return nd(e)}},nd=t=>t,NT=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},jT=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},IT=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},LT=(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=>L0(e,a))}return t},$T=t=>typeof t=="string"?t.replace(" ","T"):t,$0=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};var Gi=t=>typeof t=="function"?t:function(){return t},DT=typeof self<"u"?self:null,ms=typeof window<"u"?window:null,Xt=DT||ms||globalThis,MT="2.0.0",UT=1e4,FT=1e3,nr={connecting:0,open:1,closing:2,closed:3},rt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},gr={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},sd={longpoll:"longpoll",websocket:"websocket"},zT={complete:4},id="base64url.bearer.phx.",fa=class{constructor(t,e,r,n){this.channel=t,this.event=e,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(t){this.timeout=t,this.reset(),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()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:t,response:e,_ref:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},D0=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},BT=class{constructor(t,e,r){this.state=rt.closed,this.topic=t,this.params=Gi(e||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new fa(this,gr.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new D0(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=rt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",n=>{this.state=rt.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=rt.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=rt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new fa(this,gr.leave,Gi({}),this.timeout).send(),this.state=rt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(gr.reply,(n,s)=>{this.trigger(this.replyEventName(s),n)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=rt.closed,this.bindings=[]}onClose(t){this.on(gr.close,t)}onError(t){return this.on(gr.error,e=>t(e))}on(t,e){let r=this.bindingRef++;return this.bindings.push({event:t,ref:r,callback:e}),r}off(t,e){this.bindings=this.bindings.filter(r=>!(r.event===t&&(typeof e>"u"||e===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,r=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new fa(this,t,function(){return e},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=rt.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(gr.close,"leave")},r=new fa(this,gr.leave,Gi({}),t);return r.receive("ok",()=>e()).receive("timeout",()=>e()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(t,e,r){return e}filterBindings(t,e,r){return!0}isMember(t,e,r,n){return this.topic!==t?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:r,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=rt.joining,this.joinPush.resend(t))}trigger(t,e,r,n){let s=this.onMessage(t,e,r,n);if(e&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter(o=>o.event===t&&this.filterBindings(o,e,r));for(let o=0;o<i.length;o++)i[o].callback(s,r,n||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===rt.closed}isErrored(){return this.state===rt.errored}isJoined(){return this.state===rt.joined}isJoining(){return this.state===rt.joining}isLeaving(){return this.state===rt.leaving}},gl=class{static request(t,e,r,n,s,i,o){if(Xt.XDomainRequest){let a=new Xt.XDomainRequest;return this.xdomainRequest(a,t,e,n,s,i,o)}else if(Xt.XMLHttpRequest){let a=new Xt.XMLHttpRequest;return this.xhrRequest(a,t,e,r,n,s,i,o)}else{if(Xt.fetch&&Xt.AbortController)return this.fetchRequest(t,e,r,n,s,i,o);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,r,n,s,i,o){let a={method:t,headers:r,body:n},l=null;return s&&(l=new AbortController,setTimeout(()=>l.abort(),s),a.signal=l.signal),Xt.fetch(e,a).then(u=>u.text()).then(u=>this.parseJSON(u)).then(u=>o&&o(u)).catch(u=>{u.name==="AbortError"&&i?i():o&&o(null)}),l}static xdomainRequest(t,e,r,n,s,i,o){return t.timeout=s,t.open(e,r),t.onload=()=>{let a=this.parseJSON(t.responseText);o&&o(a)},i&&(t.ontimeout=i),t.onprogress=()=>{},t.send(n),t}static xhrRequest(t,e,r,n,s,i,o,a){t.open(e,r,!0),t.timeout=i;for(let[l,u]of Object.entries(n))t.setRequestHeader(l,u);return t.onerror=()=>a&&a(null),t.onreadystatechange=()=>{if(t.readyState===zT.complete&&a){let l=this.parseJSON(t.responseText);a(l)}},o&&(t.ontimeout=o),t.send(s),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch{return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let r=[];for(var n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let s=e?`${e}[${n}]`:n,i=t[n];typeof i=="object"?r.push(this.serialize(i,s)):r.push(encodeURIComponent(s)+"="+encodeURIComponent(i))}return r.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let r=t.match(/\?/)?"&":"?";return`${t}${r}${this.serialize(e)}`}},VT=t=>{let e="",r=new Uint8Array(t),n=r.byteLength;for(let s=0;s<n;s++)e+=String.fromCharCode(r[s]);return btoa(e)},ls=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(id)&&(this.authToken=atob(e[1].slice(id.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=nr.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+sd.websocket),"$1/"+sd.longpoll)}endpointURL(){return gl.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,r){this.close(t,e,r),this.readyState=nr.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===nr.open||this.readyState===nr.connecting}poll(){const t={Accept:"application/json"};this.authToken&&(t["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",t,null,()=>this.ontimeout(),e=>{if(e){var{status:r,token:n,messages:s}=e;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=n}else r=0;switch(r){case 200:s.forEach(i=>{setTimeout(()=>this.onmessage({data:i}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=nr.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(t){typeof t!="string"&&(t=VT(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},t.join(`
`),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(t,e,r){for(let s of this.reqs)s.abort();this.readyState=nr.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(t,e,r,n,s){let i,o=()=>{this.reqs.delete(i),n()};i=gl.request(t,this.endpointURL(),e,r,this.timeout,o,a=>{this.reqs.delete(i),this.isActive()&&s(a)}),this.reqs.add(i)}},HT=class Li{constructor(e,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=e,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,s=>{let{onJoin:i,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Li.syncState(this.state,s,i,o),this.pendingDiffs.forEach(l=>{this.state=Li.syncDiff(this.state,l,i,o)}),this.pendingDiffs=[],a()}),this.channel.on(n.diff,s=>{let{onJoin:i,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Li.syncDiff(this.state,s,i,o),a())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return Li.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,r,n,s){let i=this.clone(e),o={},a={};return this.map(i,(l,u)=>{r[l]||(a[l]=u)}),this.map(r,(l,u)=>{let c=i[l];if(c){let d=u.metas.map(v=>v.phx_ref),f=c.metas.map(v=>v.phx_ref),h=u.metas.filter(v=>f.indexOf(v.phx_ref)<0),y=c.metas.filter(v=>d.indexOf(v.phx_ref)<0);h.length>0&&(o[l]=u,o[l].metas=h),y.length>0&&(a[l]=this.clone(c),a[l].metas=y)}else o[l]=u}),this.syncDiff(i,{joins:o,leaves:a},n,s)}static syncDiff(e,r,n,s){let{joins:i,leaves:o}=this.clone(r);return n||(n=function(){}),s||(s=function(){}),this.map(i,(a,l)=>{let u=e[a];if(e[a]=this.clone(l),u){let c=e[a].metas.map(f=>f.phx_ref),d=u.metas.filter(f=>c.indexOf(f.phx_ref)<0);e[a].metas.unshift(...d)}n(a,u,l)}),this.map(o,(a,l)=>{let u=e[a];if(!u)return;let c=l.metas.map(d=>d.phx_ref);u.metas=u.metas.filter(d=>c.indexOf(d.phx_ref)<0),s(a,u,l),u.metas.length===0&&delete e[a]}),e}static list(e,r){return r||(r=function(n,s){return s}),this.map(e,(n,s)=>r(n,s))}static map(e,r){return Object.getOwnPropertyNames(e).map(n=>r(n,e[n]))}static clone(e){return JSON.parse(JSON.stringify(e))}},pa={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(r))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[r,n,s,i,o]=JSON.parse(t);return e({join_ref:r,ref:n,topic:s,event:i,payload:o})}},binaryEncode(t){let{join_ref:e,ref:r,event:n,topic:s,payload:i}=t,o=this.META_LENGTH+e.length+r.length+s.length+n.length,a=new ArrayBuffer(this.HEADER_LENGTH+o),l=new DataView(a),u=0;l.setUint8(u++,this.KINDS.push),l.setUint8(u++,e.length),l.setUint8(u++,r.length),l.setUint8(u++,s.length),l.setUint8(u++,n.length),Array.from(e,d=>l.setUint8(u++,d.charCodeAt(0))),Array.from(r,d=>l.setUint8(u++,d.charCodeAt(0))),Array.from(s,d=>l.setUint8(u++,d.charCodeAt(0))),Array.from(n,d=>l.setUint8(u++,d.charCodeAt(0)));var c=new Uint8Array(a.byteLength+i.byteLength);return c.set(new Uint8Array(a),0),c.set(new Uint8Array(i),a.byteLength),c.buffer},binaryDecode(t){let e=new DataView(t),r=e.getUint8(0),n=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(t,e,n);case this.KINDS.reply:return this.decodeReply(t,e,n);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,n)}},decodePush(t,e,r){let n=e.getUint8(1),s=e.getUint8(2),i=e.getUint8(3),o=this.HEADER_LENGTH+this.META_LENGTH-1,a=r.decode(t.slice(o,o+n));o=o+n;let l=r.decode(t.slice(o,o+s));o=o+s;let u=r.decode(t.slice(o,o+i));o=o+i;let c=t.slice(o,t.byteLength);return{join_ref:a,ref:null,topic:l,event:u,payload:c}},decodeReply(t,e,r){let n=e.getUint8(1),s=e.getUint8(2),i=e.getUint8(3),o=e.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,l=r.decode(t.slice(a,a+n));a=a+n;let u=r.decode(t.slice(a,a+s));a=a+s;let c=r.decode(t.slice(a,a+i));a=a+i;let d=r.decode(t.slice(a,a+o));a=a+o;let f=t.slice(a,t.byteLength),h={status:d,response:f};return{join_ref:l,ref:u,topic:c,event:gr.reply,payload:h}},decodeBroadcast(t,e,r){let n=e.getUint8(1),s=e.getUint8(2),i=this.HEADER_LENGTH+2,o=r.decode(t.slice(i,i+n));i=i+n;let a=r.decode(t.slice(i,i+s));i=i+s;let l=t.slice(i,t.byteLength);return{join_ref:null,ref:null,topic:o,event:a,payload:l}}},WT=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||UT,this.transport=e.transport||Xt.WebSocket||ls,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=e.sessionStorage||Xt&&Xt.sessionStorage,this.establishedConnections=0,this.defaultEncoder=pa.encode.bind(pa),this.defaultDecoder=pa.decode.bind(pa),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==ls?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;ms&&ms.addEventListener&&(ms.addEventListener("pagehide",n=>{this.conn&&(this.disconnect(),r=this.connectClock)}),ms.addEventListener("pageshow",n=>{r===this.connectClock&&(r=null,this.connect())}),ms.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=e.autoSendHeartbeat??!0,this.heartbeatCallback=e.heartbeatCallback??(()=>{}),this.rejoinAfterMs=n=>e.rejoinAfterMs?e.rejoinAfterMs(n):[1e3,2e3,5e3][n-1]||1e4,this.reconnectAfterMs=n=>e.reconnectAfterMs?e.reconnectAfterMs(n):[10,50,100,150,200,250,500,1e3,2e3][n-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(n,s,i)=>{console.log(`${n}: ${s}`,i)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=Gi(e.params||{}),this.endPoint=`${t}/${sd.websocket}`,this.vsn=e.vsn||MT,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new D0(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{e.beforeReconnect&&await e.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=e.authToken}getLongPollTransport(){return ls}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=gl.appendParams(gl.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,r)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Gi(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==ls?this.connectWithFallback(ls,this.longPollFallbackMs):this.transportConnect())}log(t,e,r){this.logger&&this.logger(t,e,r)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}onHeartbeat(t){this.heartbeatCallback=t}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let n=this.onMessage(s=>{s.ref===e&&(this.off([n]),t(Date.now()-r))});return!0}transportName(t){switch(t){case ls:return"LongPoll";default:return t.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${id}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),t),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,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)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let r=!1,n=!0,s,i,o=this.transportName(t),a=l=>{this.log("transport",`falling back to ${o}...`,l),this.off([s,i]),n=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${o}`))return a("memorized");this.fallbackTimer=setTimeout(a,e),i=this.onError(l=>{this.log("transport","error",l),n&&!r&&(clearTimeout(this.fallbackTimer),a(l))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!n){let l=this.transportName(t);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${l}`,"true"),this.log("transport",`established ${l} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(a,e),this.ping(l=>{this.log("transport","connected to primary after",l),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(t){this.log("error","error in heartbeat callback",t)}this.triggerChanError(),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),FT,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,r){if(!this.conn)return t&&t();const n=this.conn;this.waitForBufferDone(n,()=>{e?n.close(e,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e,r=1){if(r===5||!t.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(t,e,r+1)},150*r)}waitForSocketClosed(t,e,r=1){if(r===5||t.readyState===nr.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(t,e,r+1)},150*r)}onConnClose(t){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",t)}onConnError(t){this.hasLogger()&&this.log("transport",t);let e=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",t,e,r),(e===this.transport||r>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(gr.error)})}connectionState(){switch(this.conn&&this.conn.readyState){case nr.connecting:return"connecting";case nr.open:return"open";case nr.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([r])=>t.indexOf(r)===-1)}channel(t,e={}){let r=new BT(t,e,this);return this.channels.push(r),r}push(t){if(this.hasLogger()){let{topic:e,event:r,payload:n,ref:s,join_ref:i}=t;this.log("push",`${e} ${r} (${i}, ${s})`,n)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(t){this.log("error","error in heartbeat callback",t)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:r,event:n,payload:s,ref:i,join_ref:o}=e;if(i&&i===this.pendingHeartbeatRef){const a=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(s.status==="ok"?"ok":"error",a)}catch(l){this.log("error","error in heartbeat callback",l)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${s.status||""} ${r} ${n} ${i&&"("+i+")"||""}`.trim(),s);for(let a=0;a<this.channels.length;a++){const l=this.channels[a];l.isMember(r,n,s,o)&&l.trigger(n,s,i,o)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(t,...e){try{this.stateChangeCallbacks[t].forEach(([r,n])=>{try{n(...e)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}leaveOpenTopic(t){let e=this.channels.find(r=>r.topic===t&&(r.isJoined()||r.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}};class Ji{constructor(e,r){const n=KT(r);this.presence=new HT(e.getChannel(),n),this.presence.onJoin((s,i,o)=>{const a=Ji.onJoinPayload(s,i,o);e.getChannel().trigger("presence",a)}),this.presence.onLeave((s,i,o)=>{const a=Ji.onLeavePayload(s,i,o);e.getChannel().trigger("presence",a)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return Ji.transformState(this.presence.state)}static transformState(e){return e=qT(e),Object.getOwnPropertyNames(e).reduce((r,n)=>{const s=e[n];return r[n]=Da(s),r},{})}static onJoinPayload(e,r,n){const s=Vp(r),i=Da(n);return{event:"join",key:e,currentPresences:s,newPresences:i}}static onLeavePayload(e,r,n){const s=Vp(r),i=Da(n);return{event:"leave",key:e,currentPresences:s,leftPresences:i}}}function Da(t){return t.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function qT(t){return JSON.parse(JSON.stringify(t))}function KT(t){return(t==null?void 0:t.events)&&{events:t.events}}function Vp(t){return t!=null&&t.metas?Da(t):[]}var Hp;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(Hp||(Hp={}));class GT{get state(){return this.presenceAdapter.state}constructor(e,r){this.channel=e,this.presenceAdapter=new Ji(this.channel.channelAdapter,r)}}class JT{constructor(e,r,n){const s=QT(n);this.channel=e.getSocket().channel(r,s),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,r){return this.channel.on(e,r)}off(e,r){this.channel.off(e,r)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,r,n){let s;try{s=this.channel.push(e,r,n)}catch{throw`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`}if(this.channel.pushBuffer.length>AT){const i=this.channel.pushBuffer.shift();i.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${i.event}`,i.payload())}return s}updateJoinPayload(e){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),e)}canPush(){return this.socket.isConnected()&&this.state===Kr.joined}isJoined(){return this.state===Kr.joined}isJoining(){return this.state===Kr.joining}isClosed(){return this.state===Kr.closed}isLeaving(){return this.state===Kr.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function QT(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config)}}var Wp;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(Wp||(Wp={}));var Os;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Os||(Os={}));var vr;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(vr||(vr={}));class Qi{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,r={config:{}},n){var s,i;if(this.topic=e,this.params=r,this.socket=n,this.bindings={},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.channelAdapter=new JT(this.socket.socketAdapter,e,this.params),this.presence=new GT(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=$0(this.socket.socketAdapter.endPointURL()),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.channelAdapter.isClosed()){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(h=>h.filter))!==null&&s!==void 0?s:[],c=!!this.bindings[Os.PRESENCE]&&this.bindings[Os.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,d={},f={broadcast:o,presence:Object.assign(Object.assign({},a),{enabled:c}),postgres_changes:u,private:l};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(h=>{e==null||e(vr.CHANNEL_ERROR,h)}),this._onClose(()=>e==null?void 0:e(vr.CLOSED)),this.updateJoinPayload(Object.assign({config:f},d)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:h})=>{if(this.socket._isManualToken()||this.socket.setAuth(),h===void 0){e==null||e(vr.SUBSCRIBED);return}this._updatePostgresBindings(h,e)}).receive("error",h=>{this.state=Kr.errored,e==null||e(vr.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(h).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(vr.TIMED_OUT)})}return this}_updatePostgresBindings(e,r){var n;const s=this.bindings.postgres_changes,i=(n=s==null?void 0:s.length)!==null&&n!==void 0?n:0,o=[];for(let a=0;a<i;a++){const l=s[a],{filter:{event:u,schema:c,table:d,filter:f}}=l,h=e&&e[a];if(h&&h.event===u&&Qi.isFilterValueEqual(h.schema,c)&&Qi.isFilterValueEqual(h.table,d)&&Qi.isFilterValueEqual(h.filter,f))o.push(Object.assign(Object.assign({},l),{id:h.id}));else{this.unsubscribe(),this.state=Kr.errored,r==null||r(vr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,this.state!=Kr.errored&&r&&r(vr.SUBSCRIBED)}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){const s=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),i=e===Os.PRESENCE||e===Os.POSTGRES_CHANGES;if(s&&i)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,r,n)}async httpSend(e,r,n={}){var s;if(r==null)return Promise.reject("Payload is required for httpSend()");const i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o={method:"POST",headers:i,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.channelAdapter.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,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l={method:"POST",headers:a,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.channelAdapter.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.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}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}_on(e,r,n){const s=e.toLocaleLowerCase(),i=this.channelAdapter.on(e,n),o={type:s,filter:r,callback:n,ref:i};return this.bindings[s]?this.bindings[s].push(o):this.bindings[s]=[o],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,r,n)=>{var s,i,o,a,l,u,c;const d=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(d,n))return!1;const f=(s=this.bindings[d])===null||s===void 0?void 0:s.find(h=>h.ref===e.ref);if(!f)return!0;if(["broadcast","presence","postgres_changes"].includes(d))if("id"in f){const h=f.id,y=(i=f.filter)===null||i===void 0?void 0:i.event;return h&&((o=r.ids)===null||o===void 0?void 0:o.includes(h))&&(y==="*"||(y==null?void 0:y.toLocaleLowerCase())===((a=r.data)===null||a===void 0?void 0:a.type.toLocaleLowerCase()))}else{const h=(u=(l=f==null?void 0:f.filter)===null||l===void 0?void 0:l.event)===null||u===void 0?void 0:u.toLocaleLowerCase();return h==="*"||h===((c=r==null?void 0:r.event)===null||c===void 0?void 0:c.toLocaleLowerCase())}else return f.type.toLocaleLowerCase()===d})}_notThisChannelEvent(e,r){const{close:n,error:s,leave:i,join:o}=I0;return r&&[n,s,i,o].includes(e)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,r,n)=>{if(typeof r=="object"&&"ids"in r){const s=r.data,{schema:i,table:o,commit_timestamp:a,type:l,errors:u}=s;return Object.assign(Object.assign({},{schema:i,table:o,commit_timestamp:a,eventType:l,new:{},old:{},errors:u}),this._getPayloadRecords(s))}return r})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in e.bindings)for(const n of e.bindings[r])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,r){return(e??void 0)===(r??void 0)}_getPayloadRecords(e){const r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=Bp(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=Bp(e.columns,e.old_record)),r}}class ZT{constructor(e,r){this.socket=new WT(e,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,r,n,s=1e4){return new Promise(i=>{setTimeout(()=>i("timeout"),s),this.socket.disconnect(()=>{e(),i("ok")},r,n)})}push(e){this.socket.push(e)}log(e,r,n){this.socket.log(e,r,n)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==rd.connecting}isDisconnecting(){return this.socket.connectionState()==rd.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const YT={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},XT=[1e3,2e3,5e3,1e4],eC=1e4,tC=`
  addEventListener("message", (e) => {
    if (e.data.event === "start") {
      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
    }
  });`;class rC{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,r){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new PT,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._resolveFetch=i=>i?(...o)=>i(...o):(...o)=>fetch(...o),!(!((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;const s=this._initializeOptions(r);this.socketAdapter=new ZT(e,s),this.httpEndpoint=$0(e),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){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._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,r){return this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,r)}getChannels(){return this.channels}async removeChannel(e){const r=await e.unsubscribe();return r==="ok"&&e.teardown(),this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const e=this.channels.map(async n=>{const s=await n.unsubscribe();return n.teardown(),s}),r=await Promise.all(e);return this.disconnect(),r}log(e,r,n){this.socketAdapter.log(e,r,n)}connectionState(){return this.socketAdapter.connectionState()||rd.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,r={config:{}}){const n=`realtime:${e}`,s=this.getChannels().find(i=>i.topic===n);if(s)return s;{const i=new Qi(`realtime:${e}`,r,this);return this.channels.push(i),i}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(r=>r.topic!==e.topic)}async _performAuth(e=null){let r,n=!1;if(e)r=e,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(s=>{const i={access_token:r,version:ET};r&&s.updateJoinPayload(i),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(I0.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${e}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(r,n)=>{r=="sent"&&this._setAuthSafely(),e&&e(r,n)}}_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._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let r;if(e)r=e;else{const n=new Blob([tC],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_initializeOptions(e){var r,n,s,i,o,a,l,u,c;this.worker=(r=e==null?void 0:e.worker)!==null&&r!==void 0?r:!1,this.accessToken=(n=e==null?void 0:e.accessToken)!==null&&n!==void 0?n:null;const d={};d.timeout=(s=e==null?void 0:e.timeout)!==null&&s!==void 0?s:RT,d.heartbeatIntervalMs=(i=e==null?void 0:e.heartbeatIntervalMs)!==null&&i!==void 0?i:YT.HEARTBEAT_INTERVAL,d.transport=(o=e==null?void 0:e.transport)!==null&&o!==void 0?o:kT.getWebSocketConstructor(),d.params=e==null?void 0:e.params,d.logger=e==null?void 0:e.logger,d.heartbeatCallback=this._wrapHeartbeatCallback(e==null?void 0:e.heartbeatCallback),d.reconnectAfterMs=(a=e==null?void 0:e.reconnectAfterMs)!==null&&a!==void 0?a:v=>XT[v-1]||eC;let f,h;const y=(l=e==null?void 0:e.vsn)!==null&&l!==void 0?l:CT;switch(y){case TT:f=(v,w)=>w(JSON.stringify(v)),h=(v,w)=>w(JSON.parse(v));break;case j0:f=this.serializer.encode.bind(this.serializer),h=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${d.vsn}`)}if(d.vsn=y,d.encode=(u=e==null?void 0:e.encode)!==null&&u!==void 0?u:f,d.decode=(c=e==null?void 0:e.decode)!==null&&c!==void 0?c:h,d.beforeReconnect=this._reconnectAuth.bind(this),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,d.params=Object.assign(Object.assign({},d.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl,d.autoSendHeartbeat=!this.worker}return d}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var _o=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 nC(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 sC(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 iC(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:i,headers:o}){const a=nC(t.baseUrl,n,s),l=await sC(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(),d=(u.headers.get("content-type")||"").includes("application/json"),f=d&&c?JSON.parse(c):c;if(!u.ok){const h=d?f:void 0,y=h==null?void 0:h.error;throw new _o((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:h})}return{status:u.status,headers:u.headers,data:f}}}}function ma(t){return t.join("")}var oC=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:ma(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/${ma(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${ma(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${ma(t.namespace)}`}),!0}catch(e){if(e instanceof _o&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(r){if(r instanceof _o&&r.status===409)return;throw r}}};function us(t){return t.join("")}var aC=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/${us(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/${us(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/${us(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/${us(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/${us(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/${us(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(r){if(r instanceof _o&&r.status===404)return!1;throw r}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(r){if(r instanceof _o&&r.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw r}}},lC=class{constructor(t){var n;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const r=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=iC({baseUrl:r,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(n=t.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new oC(this.client,e),this.tableOps=new aC(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)}};function bo(t){"@babel/helpers - typeof";return bo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bo(t)}function uC(t,e){if(bo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(bo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cC(t){var e=uC(t,"string");return bo(e)=="symbol"?e:e+""}function dC(t,e,r){return(e=cC(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qp(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function H(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?qp(Object(r),!0).forEach(function(n){dC(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qp(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var tu=class extends Error{constructor(t,e="storage",r,n){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function ru(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var od=class extends tu{constructor(t,e,r,n="storage"){super(t,n,e,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=r}toJSON(){return H({},super.toJSON())}},M0=class extends tu{constructor(t,e,r="storage"){super(t,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};const hC=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),fC=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)},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},pC=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t),Kp=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)},mC=async(t,e,r,n)=>{if(t!==null&&typeof t=="object"&&typeof t.json=="function"){const s=t;let i=parseInt(s.status,10);Number.isFinite(i)||(i=500),s.json().then(o=>{const a=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||i+"";e(new od(Kp(o),i,a,n))}).catch(()=>{const o=i+"";e(new od(s.statusText||`HTTP ${i} error`,i,o,n))})}else e(new M0(Kp(t),t,n))},gC=(t,e,r,n)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};if(t==="GET"||t==="HEAD"||!n)return H(H({},s),r);if(fC(n)){var i;const o=(e==null?void 0:e.headers)||{};let a;for(const[l,u]of Object.entries(o))l.toLowerCase()==="content-type"&&(a=u);s.headers=vC(o,"Content-Type",(i=a)!==null&&i!==void 0?i:"application/json"),s.body=JSON.stringify(n)}else s.body=n;return e!=null&&e.duplex&&(s.duplex=e.duplex),H(H({},s),r)};function vC(t,e,r){const n=H({},t);for(const s of Object.keys(n))s.toLowerCase()===e.toLowerCase()&&delete n[s];return n[e]=r,n}async function Ai(t,e,r,n,s,i,o){return new Promise((a,l)=>{t(r,gC(e,n,s,i)).then(u=>{if(!u.ok)throw u;if(n!=null&&n.noResolveJson)return u;if(o==="vectors"){const c=u.headers.get("content-type");if(u.headers.get("content-length")==="0"||u.status===204)return{};if(!c||!c.includes("application/json"))return{}}return u.json()}).then(u=>a(u)).catch(u=>mC(u,l,n,o))})}function U0(t="storage"){return{get:async(e,r,n,s)=>Ai(e,"GET",r,n,s,void 0,t),post:async(e,r,n,s,i)=>Ai(e,"POST",r,s,i,n,t),put:async(e,r,n,s,i)=>Ai(e,"PUT",r,s,i,n,t),head:async(e,r,n,s)=>Ai(e,"HEAD",r,H(H({},n),{},{noResolveJson:!0}),s,void 0,t),remove:async(e,r,n,s,i)=>Ai(e,"DELETE",r,s,i,n,t)}}const yC=U0("storage"),{get:xo,post:Mt,put:ld,head:wC,remove:jh}=yC,ft=U0("vectors");var gi=class{constructor(t,e={},r,n="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=Object.fromEntries(Object.entries(e).map(([s,i])=>[s.toLowerCase(),i])),this.fetch=hC(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=H(H({},this.headers),{},{[t.toLowerCase()]:e}),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(ru(r))return{data:null,error:r};throw r}}},_C=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e}then(t,e){return this.execute().then(t,e)}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(ru(e))return{data:null,error:e};throw e}}};let F0;F0=Symbol.toStringTag;var bC=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[F0]="BlobDownloadBuilder",this.promise=null}asStream(){return new _C(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(ru(e))return{data:null,error:e};throw e}}};const xC={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Gp={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var kC=class extends gi{constructor(t,e={},r,n){super(t,e,n,"storage"),this.bucketId=r}async uploadOrUpdate(t,e,r,n){var s=this;return s.handleOperation(async()=>{let i;const o=H(H({},Gp),n);let a=H(H({},s.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const l=o.metadata;typeof Blob<"u"&&r instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),l&&i.append("metadata",s.encodeMetadata(l)),i.append("",r)):typeof FormData<"u"&&r instanceof FormData?(i=r,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),l&&!i.has("metadata")&&i.append("metadata",s.encodeMetadata(l))):(i=r,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,l&&(a["x-metadata"]=s.toBase64(s.encodeMetadata(l))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!o.duplex&&(o.duplex="half")),n!=null&&n.headers&&(a=H(H({},a),n.headers));const u=s._removeEmptyFolders(e),c=s._getFinalPath(u),d=await(t=="PUT"?ld:Mt)(s.fetch,`${s.url}/object/${c}`,i,H({headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:u,id:d.Id,fullPath:d.Key}})}async upload(t,e,r){return this.uploadOrUpdate("POST",t,e,r)}async uploadToSignedUrl(t,e,r,n){var s=this;const i=s._removeEmptyFolders(t),o=s._getFinalPath(i),a=new URL(s.url+`/object/upload/sign/${o}`);return a.searchParams.set("token",e),s.handleOperation(async()=>{let l;const u=H(H({},Gp),n),c=H(H({},s.headers),{"x-upsert":String(u.upsert)});return typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",u.cacheControl)):(l=r,c["cache-control"]=`max-age=${u.cacheControl}`,c["content-type"]=u.contentType),{path:i,fullPath:(await ld(s.fetch,a.toString(),l,{headers:c})).Key}})}async createSignedUploadUrl(t,e){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(t);const s=H({},r.headers);e!=null&&e.upsert&&(s["x-upsert"]="true");const i=await Mt(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:s}),o=new URL(r.url+i.url),a=o.searchParams.get("token");if(!a)throw new tu("No token returned by API");return{signedUrl:o.toString(),path:t,token:a}})}async update(t,e,r){return this.uploadOrUpdate("PUT",t,e,r)}async move(t,e,r){var n=this;return n.handleOperation(async()=>await Mt(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(t,e,r){var n=this;return n.handleOperation(async()=>({path:(await Mt(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(t,e,r){var n=this;return n.handleOperation(async()=>{let s=n._getFinalPath(t);const i=typeof(r==null?void 0:r.transform)=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let o=await Mt(n.fetch,`${n.url}/object/sign/${s}`,H({expiresIn:e},i?{transform:r.transform}:{}),{headers:n.headers});const a=new URLSearchParams;r!=null&&r.download&&a.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&a.set("cacheNonce",String(r.cacheNonce));const l=a.toString();return{signedUrl:encodeURI(`${n.url}${o.signedURL}${l?`&${l}`:""}`)}})}async createSignedUrls(t,e,r){var n=this;return n.handleOperation(async()=>{const s=await Mt(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:e,paths:t},{headers:n.headers}),i=new URLSearchParams;r!=null&&r.download&&i.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&i.set("cacheNonce",String(r.cacheNonce));const o=i.toString();return s.map(a=>H(H({},a),{},{signedUrl:a.signedURL?encodeURI(`${n.url}${a.signedURL}${o?`&${o}`:""}`):null}))})}download(t,e,r){const n=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image/authenticated":"object",s=new URLSearchParams;e!=null&&e.transform&&this.applyTransformOptsToQuery(s,e.transform),(e==null?void 0:e.cacheNonce)!=null&&s.set("cacheNonce",String(e.cacheNonce));const i=s.toString(),o=this._getFinalPath(t),a=()=>xo(this.fetch,`${this.url}/${n}/${o}${i?`?${i}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new bC(a,this.shouldThrowOnError)}async info(t){var e=this;const r=e._getFinalPath(t);return e.handleOperation(async()=>ad(await xo(e.fetch,`${e.url}/object/info/${r}`,{headers:e.headers})))}async exists(t){var e=this;const r=e._getFinalPath(t);try{return await wC(e.fetch,`${e.url}/object/${r}`,{headers:e.headers}),{data:!0,error:null}}catch(s){if(e.shouldThrowOnError)throw s;if(ru(s)){var n;const i=s instanceof od?s.status:s instanceof M0?(n=s.originalError)===null||n===void 0?void 0:n.status:void 0;if(i!==void 0&&[400,404].includes(i))return{data:!1,error:s}}throw s}}getPublicUrl(t,e){const r=this._getFinalPath(t),n=new URLSearchParams;e!=null&&e.download&&n.set("download",e.download===!0?"":e.download),e!=null&&e.transform&&this.applyTransformOptsToQuery(n,e.transform),(e==null?void 0:e.cacheNonce)!=null&&n.set("cacheNonce",String(e.cacheNonce));const s=n.toString(),i=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${r}`)+(s?`?${s}`:"")}}}async remove(t){var e=this;return e.handleOperation(async()=>await jh(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async list(t,e,r){var n=this;return n.handleOperation(async()=>{const s=H(H(H({},xC),e),{},{prefix:t||""});return await Mt(n.fetch,`${n.url}/object/list/${n.bucketId}`,s,{headers:n.headers},r)})}async listV2(t,e){var r=this;return r.handleOperation(async()=>{const n=H({},t);return await Mt(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(t,e){return e.width&&t.set("width",e.width.toString()),e.height&&t.set("height",e.height.toString()),e.resize&&t.set("resize",e.resize),e.format&&t.set("format",e.format),e.quality&&t.set("quality",e.quality.toString()),t}};const SC="2.103.2",Uo={"X-Client-Info":`storage-js/${SC}`};var EC=class extends gi{constructor(t,e={},r,n){const s=new URL(t);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const i=s.href.replace(/\/$/,""),o=H(H({},Uo),e);super(i,o,r,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=e.listBucketOptionsToQueryString(t);return await xo(e.fetch,`${e.url}/bucket${r}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await xo(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var r=this;return r.handleOperation(async()=>await Mt(r.fetch,`${r.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async updateBucket(t,e){var r=this;return r.handleOperation(async()=>await ld(r.fetch,`${r.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await Mt(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await jh(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(t){const e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},TC=class extends gi{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=H(H({},Uo),e);super(n,s,r,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Mt(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&r.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&r.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&r.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&r.set("sortOrder",t.sortOrder),t!=null&&t.search&&r.set("search",t.search);const n=r.toString(),s=n?`${e.url}/bucket?${n}`:`${e.url}/bucket`;return await xo(e.fetch,s,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await jh(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!pC(t))throw new tu("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new lC({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(s,i){const o=s[i];return typeof o!="function"?o:async(...a)=>{try{return{data:await o.apply(s,a),error:null}}catch(l){if(n)throw l;return{data:null,error:l}}}}})}},CC=class extends gi{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=H(H({},Uo),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await ft.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var r=this;return r.handleOperation(async()=>await ft.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await ft.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var r=this;return r.handleOperation(async()=>await ft.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers})||{})}},RC=class extends gi{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=H(H({},Uo),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await ft.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await ft.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await ft.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await ft.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await ft.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},AC=class extends gi{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=H(H({},Uo),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await ft.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await ft.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await ft.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await ft.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},PC=class extends AC{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new OC(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,r=this;return e().call(r,t)}async getBucket(t){var e=()=>super.getBucket,r=this;return e().call(r,t)}async listBuckets(t={}){var e=()=>super.listBuckets,r=this;return e().call(r,t)}async deleteBucket(t){var e=()=>super.deleteBucket,r=this;return e().call(r,t)}},OC=class extends CC{constructor(t,e,r,n){super(t,e,n),this.vectorBucketName=r}async createIndex(t){var e=()=>super.createIndex,r=this;return e().call(r,H(H({},t),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,r=this;return e().call(r,H(H({},t),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,r=this;return e().call(r,r.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,r=this;return e().call(r,r.vectorBucketName,t)}index(t){return new NC(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},NC=class extends RC{constructor(t,e,r,n,s){super(t,e,s),this.vectorBucketName=r,this.indexName=n}async putVectors(t){var e=()=>super.putVectors,r=this;return e().call(r,H(H({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(t){var e=()=>super.getVectors,r=this;return e().call(r,H(H({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,r=this;return e().call(r,H(H({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,r=this;return e().call(r,H(H({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,r=this;return e().call(r,H(H({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},jC=class extends EC{constructor(t,e={},r,n){super(t,e,r,n)}from(t){return new kC(this.url,this.headers,t,this.fetch)}get vectors(){return new PC(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new TC(this.url+"/iceberg",this.headers,this.fetch)}};const z0="2.103.2",gs=30*1e3,ud=3,Bu=ud*gs,IC="http://localhost:9999",LC="supabase.auth.token",$C={"X-Client-Info":`gotrue-js/${z0}`},cd="X-Supabase-Api-Version",B0={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},DC=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,MC=10*60*1e3;class ko extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function F(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class UC extends ko{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function FC(t){return F(t)&&t.name==="AuthApiError"}class jn extends ko{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}}class Or extends ko{constructor(e,r,n,s){super(e,n,s),this.name=r,this.status=n}}class ct extends Or{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function ga(t){return F(t)&&t.name==="AuthSessionMissingError"}class cs extends Or{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class va extends Or{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class ya extends Or{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function zC(t){return F(t)&&t.name==="AuthImplicitGrantRedirectError"}class Jp extends Or{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class BC extends Or{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class dd extends Or{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}}function Vu(t){return F(t)&&t.name==="AuthRetryableFetchError"}class Qp extends Or{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class hd extends Or{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const vl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Zp=` 	
\r=`.split(""),VC=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<Zp.length;e+=1)t[Zp[e].charCodeAt(0)]=-2;for(let e=0;e<vl.length;e+=1)t[vl[e].charCodeAt(0)]=e;return t})();function Yp(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(vl[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(vl[n]),e.queuedBits-=6}}function V0(t,e,r){const n=VC[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 Xp(t){const e=[],r=o=>{e.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=o=>{qC(o,n,r)};for(let o=0;o<t.length;o+=1)V0(t.charCodeAt(o),s,i);return e.join("")}function HC(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 WC(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}HC(n,e)}}function qC(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 zs(t){const e=[],r={queue:0,queuedBits:0},n=s=>{e.push(s)};for(let s=0;s<t.length;s+=1)V0(t.charCodeAt(s),r,n);return new Uint8Array(e)}function KC(t){const e=[];return WC(t,r=>e.push(r)),new Uint8Array(e)}function Dn(t){const e=[],r={queue:0,queuedBits:0},n=s=>{e.push(s)};return t.forEach(s=>Yp(s,r,n)),Yp(null,r,n),e.join("")}function GC(t){return Math.round(Date.now()/1e3)+t}function JC(){return Symbol("auth-callback")}const Me=()=>typeof window<"u"&&typeof document<"u",Rn={tested:!1,writable:!1},H0=()=>{if(!Me())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Rn.tested)return Rn.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Rn.tested=!0,Rn.writable=!0}catch{Rn.tested=!0,Rn.writable=!1}return Rn.writable};function QC(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 W0=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),ZC=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",vs=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},An=async(t,e)=>{const r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}},De=async(t,e)=>{await t.removeItem(e)};class nu{constructor(){this.promise=new nu.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}}nu.promiseConstructor=Promise;function wa(t){const e=t.split(".");if(e.length!==3)throw new hd("Invalid JWT structure");for(let n=0;n<e.length;n++)if(!DC.test(e[n]))throw new hd("JWT not in base64url format");return{header:JSON.parse(Xp(e[0])),payload:JSON.parse(Xp(e[1])),signature:zs(e[2]),raw:{header:e[0],payload:e[1]}}}async function YC(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function XC(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 eR(t){return("0"+t.toString(16)).substr(-2)}function tR(){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,eR).join("")}async function rR(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 nR(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 rR(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function ds(t,e,r=!1){const n=tR();let s=n;r&&(s+="/PASSWORD_RECOVERY"),await vs(t,`${e}-code-verifier`,s);const i=await nR(n);return[i,n===i?"plain":"s256"]}const sR=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function iR(t){const e=t.headers.get(cd);if(!e||!e.match(sR))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function oR(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 aR(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 lR=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function hs(t){if(!lR.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Hu(){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 uR(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 em(t){return JSON.parse(JSON.stringify(t))}const Nn=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),cR=[502,503,504,520,521,522,523,524,530];async function tm(t){var e;if(!ZC(t))throw new dd(Nn(t),0);if(cR.includes(t.status))throw new dd(Nn(t),t.status);let r;try{r=await t.json()}catch(i){throw new jn(Nn(i),i)}let n;const s=iR(t);if(s&&s.getTime()>=B0["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 Qp(Nn(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 Qp(Nn(r),t.status,r.weak_password.reasons);throw new UC(Nn(r),t.status||500,n)}const dR=(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 V(t,e,r,n){var s;const i=Object.assign({},n==null?void 0:n.headers);i[cd]||(i[cd]=B0["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 hR(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 hR(t,e,r,n,s,i){const o=dR(e,n,s,i);let a;try{a=await t(r,Object.assign({},o))}catch(l){throw console.error(l),new dd(Nn(l),0)}if(a.ok||await tm(a),n!=null&&n.noResolveJson)return a;try{return await a.json()}catch(l){await tm(l)}}function Lt(t){var e;let r=null;mR(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=GC(t.expires_in)));const n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}function rm(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 Gr(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function fR(t){return{data:t,error:null}}function pR(t){const{action_link:e,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i}=t,o=eu(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 nm(t){return t}function mR(t){return t.access_token&&t.refresh_token&&t.expires_in}const Wu=["global","local","others"];class gR{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=W0(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)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)}}async signOut(e,r=Wu[0]){if(Wu.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Wu.join(", ")}`);try{return await V(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(F(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await V(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Gr})}catch(n){if(F(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:r}=e,n=eu(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 V(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:pR,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(F(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await V(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Gr})}catch(r){if(F(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 V(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:nm});if(c.error)throw c.error;const d=await c.json(),f=(o=c.headers.get("x-total-count"))!==null&&o!==void 0?o:0,h=(l=(a=c.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return h.length>0&&(h.forEach(y=>{const v=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(y.split(";")[1].split("=")[1]);u[`${w}Page`]=v}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(F(u))return{data:{users:[]},error:u};throw u}}async getUserById(e){hs(e);try{return await V(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Gr})}catch(r){if(F(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){hs(e);try{return await V(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:Gr})}catch(n){if(F(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){hs(e);try{return await V(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:Gr})}catch(n){if(F(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){hs(e.userId);try{const{data:r,error:n}=await V(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(F(r))return{data:null,error:r};throw r}}async _deleteFactor(e){hs(e.userId),hs(e.id);try{return{data:await V(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if(F(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 V(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:nm});if(c.error)throw c.error;const d=await c.json(),f=(o=c.headers.get("x-total-count"))!==null&&o!==void 0?o:0,h=(l=(a=c.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return h.length>0&&(h.forEach(y=>{const v=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),w=JSON.parse(y.split(";")[1].split("=")[1]);u[`${w}Page`]=v}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(F(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(e){try{return await V(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(F(r))return{data:null,error:r};throw r}}async _getOAuthClient(e){try{return await V(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(F(r))return{data:null,error:r};throw r}}async _updateOAuthClient(e,r){try{return await V(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(F(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{return await V(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(F(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(e){try{return await V(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(F(r))return{data:null,error:r};throw r}}async _listCustomProviders(e){try{const r={};return e!=null&&e.type&&(r.type=e.type),await V(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:n=>{var s;return{data:{providers:(s=n==null?void 0:n.providers)!==null&&s!==void 0?s:[]},error:null}}})}catch(r){if(F(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(e){try{return await V(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(F(r))return{data:null,error:r};throw r}}async _getCustomProvider(e){try{return await V(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(F(r))return{data:null,error:r};throw r}}async _updateCustomProvider(e,r){try{return await V(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(F(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(e){try{return await V(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(F(r))return{data:null,error:r};throw r}}}function sm(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}const Zt={debug:!!(globalThis&&H0()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class q0 extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class im extends q0{}async function vR(t,e,r){Zt.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const n=new globalThis.AbortController;let s;e>0&&(s=setTimeout(()=>{n.abort(),Zt.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e)),await Promise.resolve();try{return await globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async i=>{if(i){clearTimeout(s),Zt.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,i.name);try{return await r()}finally{Zt.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,i.name)}}else{if(e===0)throw Zt.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new im(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Zt.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null,"  "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}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"),clearTimeout(s),await r()}})}catch(i){if(e>0&&clearTimeout(s),(i==null?void 0:i.name)==="AbortError"&&e>0){if(n.signal.aborted)return Zt.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",t),console.warn(`@supabase/gotrue-js: Lock "${t}" was not released within ${e}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,{mode:"exclusive",steal:!0},async o=>{if(o){Zt.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",t,o.name);try{return await r()}finally{Zt.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",t,o.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await r()}));throw Zt.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",t),new im(`Lock "${t}" was released because another request stole it`)}throw i}}function yR(){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 K0(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function wR(t){return parseInt(t,16)}function _R(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}function bR(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:d,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(!d)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 h=K0(t.address),y=c?`${c}://${n}`:n,v=t.statement?`${t.statement}
`:"",w=`${y} wants you to sign in with your Ethereum account:
${h}

${v}`;let m=`URI: ${d}
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 g of u){if(!g||typeof g!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${g}`);p+=`
- ${g}`}m+=p}return`${w}
${m}`}class Pe 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 yl extends Pe{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}}function xR({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 Pe({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 Pe({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 Pe({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 Pe({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 Pe({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new Pe({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 Pe({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new Pe({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(G0(o)){if(i.rp.id!==o)return new Pe({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Pe({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 Pe({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 Pe({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 Pe({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function kR({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 Pe({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new Pe({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const n=window.location.hostname;if(G0(n)){if(r.rpId!==n)return new Pe({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Pe({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new Pe({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 Pe({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class SR{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 ER=new SR;function TR(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=eu(t,["challenge","user","excludeCredentials"]),i=zs(e).buffer,o=Object.assign(Object.assign({},r),{id:zs(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:zs(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return a}function CR(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=eu(t,["challenge","allowCredentials"]),s=zs(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:zs(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return i}function RR(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:Dn(new Uint8Array(t.response.attestationObject)),clientDataJSON:Dn(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function AR(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:Dn(new Uint8Array(s.authenticatorData)),clientDataJSON:Dn(new Uint8Array(s.clientDataJSON)),signature:Dn(new Uint8Array(s.signature)),userHandle:s.userHandle?Dn(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function G0(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function om(){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 PR(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new yl("Browser returned unexpected credential type",e)}:{data:null,error:new yl("Empty credential response",e)}}catch(e){return{data:null,error:xR({error:e,options:t})}}}async function OR(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new yl("Browser returned unexpected credential type",e)}:{data:null,error:new yl("Empty credential response",e)}}catch(e){return{data:null,error:kR({error:e,options:t})}}}const NR={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},jR={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function wl(...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]=wl(a,o):n[i]=wl(o)}else n[i]=o}return n}function IR(t,e){return wl(NR,t,e||{})}function LR(t,e){return wl(jR,t,e||{})}class $R{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){var o;try{const{data:a,error:l}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!a)return{data:null,error:l};const u=s??ER.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:c}=a.webauthn.credential_options.publicKey;if(!c.name){const d=n;if(d)c.name=`${c.id}:${d}`;else{const h=(await this.client.getUser()).data.user,y=((o=h==null?void 0:h.user_metadata)===null||o===void 0?void 0:o.name)||(h==null?void 0:h.email)||(h==null?void 0:h.id)||"User";c.name=`${c.id}:${y}`}}c.displayName||(c.displayName=c.name)}switch(a.webauthn.type){case"create":{const c=IR(a.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:d,error:f}=await PR({publicKey:c,signal:u});return d?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:f}}case"request":{const c=LR(a.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:d,error:f}=await OR(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:c,signal:u}));return d?{data:{factorId:e,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:f}}}}catch(a){return F(a)?{data:null,error:a}:{data:null,error:new jn("Unexpected error in challenge",a)}}}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 ko("rpId is required for WebAuthn authentication")};try{if(!om())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 F(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 ko("rpId is required for WebAuthn registration")};try{if(!om())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 d;return(d=c.data)===null||d===void 0?void 0:d.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 F(o)?{data:null,error:o}:{data:null,error:new jn("Unexpected error in register",o)}}}}yR();const DR={url:IC,storageKey:LC,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:$C,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1};async function am(t,e,r){return await r()}const fs={};class So{get jwks(){var e,r;return(r=(e=fs[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){fs[this.storageKey]=Object.assign(Object.assign({},fs[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=fs[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){fs[this.storageKey]=Object.assign(Object.assign({},fs[this.storageKey]),{cachedAt:e})}constructor(e){var r,n,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=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({},DR),e);if(this.storageKey=i.storageKey,this.instanceID=(r=So.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,So.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 gR({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=W0(i.fetch),this.lock=i.lock||am,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,this.lockAcquireTimeout=i.lockAcquireTimeout,i.lock?this.lock=i.lock:this.persistSession&&Me()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=vR:this.lock=am,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 $R(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:H0()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=sm(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=sm(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);try{await this._notifyAllSubscribers(o.data.event,o.data.session,!1)}catch(a){this._debug("#broadcastChannel","error",a)}})}i.skipAutoInitialize||this.initialize().catch(o=>{this._debug("#initialize()","error",o)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${z0}) ${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(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let r={},n="none";if(Me()&&(r=QC(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),zC(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{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 F(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 V(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(F(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:d,options:f}=e;let h=null,y=null;this.flowType==="pkce"&&([h,y]=await ds(this.storage,this.storageKey)),i=await V(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:c,password:d,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:h,code_challenge_method:y},xform:Lt})}else if("phone"in e){const{phone:c,password:d,options:f}=e;i=await V(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:c,password:d,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 va("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return await De(this.storage,`${this.storageKey}-code-verifier`),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(await De(this.storage,`${this.storageKey}-code-verifier`),F(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 V(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:rm})}else if("phone"in e){const{phone:i,password:o,options:a}=e;r=await V(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:rm})}else throw new va("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 cs;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(F(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(this.lockAcquireTimeout,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,d,f;let h,y;if("message"in e)h=e.message,y=e.signature;else{const{chain:v,wallet:w,statement:m,options:p}=e;let g;if(Me())if(typeof w=="object")g=w;else{const N=window;if("ethereum"in N&&typeof N.ethereum=="object"&&"request"in N.ethereum&&typeof N.ethereum.request=="function")g=N.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.");g=w}const b=new URL((r=p==null?void 0:p.url)!==null&&r!==void 0?r:window.location.href),k=await g.request({method:"eth_requestAccounts"}).then(N=>N).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!k||k.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const S=K0(k[0]);let E=(n=p==null?void 0:p.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!E){const N=await g.request({method:"eth_chainId"});E=wR(N)}const A={domain:b.host,address:S,statement:m,uri:b.href,version:"1",chainId:E,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};h=bR(A),y=await g.request({method:"personal_sign",params:[_R(h),S]})}try{const{data:v,error:w}=await V(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:h,signature:y},!((d=e.options)===null||d===void 0)&&d.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(!v||!v.session||!v.user){const m=new cs;return this._returnResult({data:{user:null,session:null},error:m})}return v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),this._returnResult({data:Object.assign({},v),error:w})}catch(v){if(F(v))return this._returnResult({data:{user:null,session:null},error:v});throw v}}async signInWithSolana(e){var r,n,s,i,o,a,l,u,c,d,f,h;let y,v;if("message"in e)y=e.message,v=e.signature;else{const{chain:w,wallet:m,statement:p,options:g}=e;let b;if(Me())if(typeof m=="object")b=m;else{const S=window;if("solana"in S&&typeof S.solana=="object"&&("signIn"in S.solana&&typeof S.solana.signIn=="function"||"signMessage"in S.solana&&typeof S.solana.signMessage=="function"))b=S.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"||!(g!=null&&g.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");b=m}const k=new URL((r=g==null?void 0:g.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in b&&b.signIn){const S=await b.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},g==null?void 0:g.signInWithSolana),{version:"1",domain:k.host,uri:k.href}),p?{statement:p}:null));let E;if(Array.isArray(S)&&S[0]&&typeof S[0]=="object")E=S[0];else if(S&&typeof S=="object"&&"signedMessage"in S&&"signature"in S)E=S;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in E&&"signature"in E&&(typeof E.signedMessage=="string"||E.signedMessage instanceof Uint8Array)&&E.signature instanceof Uint8Array)y=typeof E.signedMessage=="string"?E.signedMessage:new TextDecoder().decode(E.signedMessage),v=E.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in b)||typeof b.signMessage!="function"||!("publicKey"in b)||typeof b!="object"||!b.publicKey||!("toBase58"in b.publicKey)||typeof b.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");y=[`${k.host} wants you to sign in with your Solana account:`,b.publicKey.toBase58(),...p?["",p,""]:[""],"Version: 1",`URI: ${k.href}`,`Issued At: ${(s=(n=g==null?void 0:g.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((i=g==null?void 0:g.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${g.signInWithSolana.notBefore}`]:[],...!((o=g==null?void 0:g.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${g.signInWithSolana.expirationTime}`]:[],...!((a=g==null?void 0:g.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${g.signInWithSolana.chainId}`]:[],...!((l=g==null?void 0:g.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${g.signInWithSolana.nonce}`]:[],...!((u=g==null?void 0:g.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${g.signInWithSolana.requestId}`]:[],...!((d=(c=g==null?void 0:g.signInWithSolana)===null||c===void 0?void 0:c.resources)===null||d===void 0)&&d.length?["Resources",...g.signInWithSolana.resources.map(E=>`- ${E}`)]:[]].join(`
`);const S=await b.signMessage(new TextEncoder().encode(y),"utf8");if(!S||!(S instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");v=S}}try{const{data:w,error:m}=await V(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:y,signature:Dn(v)},!((f=e.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(h=e.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:Lt});if(m)throw m;if(!w||!w.session||!w.user){const p=new cs;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(F(w))return this._returnResult({data:{user:null,session:null},error:w});throw w}}async _exchangeCodeForSession(e){const r=await An(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new BC;const{data:i,error:o}=await V(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:Lt});if(await De(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!i||!i.session||!i.user){const a=new cs;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(await De(this.storage,`${this.storageKey}-code-verifier`),F(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 V(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 cs;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(F(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 ds(this.storage,this.storageKey));const{error:d}=await V(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:d})}if("phone"in e){const{phone:a,options:l}=e,{data:u,error:c}=await V(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 va("You must provide either an email or phone number.")}catch(a){if(await De(this.storage,`${this.storageKey}-code-verifier`),F(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 V(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(F(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 ds(this.storage,this.storageKey));const u=await V(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:fR});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(await De(this.storage,`${this.storageKey}-code-verifier`),F(a))return this._returnResult({data:null,error:a});throw a}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,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 V(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(F(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 V(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 V(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 va("You must provide either an email or phone number and a type")}catch(r){if(F(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,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 An(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()<Bu:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){const o=await An(this.userStorage,this.storageKey+"-user");o!=null&&o.user?e.user=o.user:e.user=Hu()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};e.user=uR(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){if(e)return await this._getUser(e);await this.initializePromise;const r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(e){try{return e?await V(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Gr}):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 V(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:Gr})})}catch(r){if(F(r))return ga(r)&&(await this._removeSession(),await De(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(this.lockAcquireTimeout,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 ds(this.storage,this.storageKey));const{data:u,error:c}=await V(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:Gr});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(await De(this.storage,`${this.storageKey}-code-verifier`),F(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,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}=wa(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)return this._returnResult({data:{user:null,session:null},error: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(F(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,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(F(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(e,r){try{if(!Me())throw new ya("No browser detected.");if(e.error||e.error_description||e.error_code)throw new ya(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 Jp("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new ya("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 Jp("No code detected.");const{data:p,error:g}=await this._exchangeCodeForSession(e.code);if(g)throw g;const b=new URL(window.location.href);return b.searchParams.delete("code"),window.history.replaceState(window.history.state,"",b.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 ya("No session defined in URL");const c=Math.round(Date.now()/1e3),d=parseInt(a);let f=c+d;l&&(f=parseInt(l));const h=f-c;h*1e3<=gs&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${h}s, should have been closer to ${d}s`);const y=f-d;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:v,error:w}=await this._getUser(i);if(w)throw w;const m={provider_token:n,provider_refresh_token:s,access_token:i,expires_in:d,expires_at:f,refresh_token:o,token_type:u,user:v.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(F(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error_description)}async _isPKCECallback(e){const r=await An(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,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&&!ga(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&&!(FC(a)&&(a.status===404||a.status===401||a.status===403)||ga(a)))return this._returnResult({error:a})}return e!=="others"&&(await this._removeSession(),await De(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const r=JC(),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(this.lockAcquireTimeout,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),ga(i)?console.warn(i):console.error(i)}})}async resetPasswordForEmail(e,r={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await ds(this.storage,this.storageKey,!0));try{return await V(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(await De(this.storage,`${this.storageKey}-code-verifier`),F(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(F(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:d,error:f}=i;if(f)throw f;const h=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 V(this.fetch,"GET",h,{headers:this.headers,jwt:(c=(u=d.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(F(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,d=await V(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:h}=d;return h?this._returnResult({data:{user:null,session:null},error:h}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new cs}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:h}))}catch(s){if(await De(this.storage,`${this.storageKey}-code-verifier`),F(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 V(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(F(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 XC(async s=>(s>0&&await YC(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await V(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&&Vu(i)&&Date.now()+o-n<gs})}catch(n){if(this._debug(r,"error",n),F(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 An(this.storage,this.storageKey);if(s&&this.userStorage){let o=await An(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:s.user},await vs(this.userStorage,this.storageKey+"-user",o)),s.user=(e=o==null?void 0:o.user)!==null&&e!==void 0?e:Hu()}else if(s&&!s.user&&!s.user){const o=await An(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(s.user=o.user,await De(this.storage,this.storageKey+"-user"),await vs(this.storage,this.storageKey,s)):s.user=Hu()}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()<Bu;if(this._debug(n,`session has${i?"":" not"} expired with margin of ${Bu}s`),i){if(this.autoRefreshToken&&s.refresh_token){const{error:o}=await this._callRefreshToken(s.refresh_token);o&&(console.error(o),Vu(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 nu;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),F(i)){const o={data:null,error:i};return Vu(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,await De(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},e),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await vs(this.userStorage,this.storageKey+"-user",{user:r.user});const s=Object.assign({},r);delete s.user;const i=em(s);await vs(this.storage,this.storageKey,i)}else{const s=em(r);await vs(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await De(this.storage,this.storageKey),await De(this.storage,this.storageKey+"-code-verifier"),await De(this.storage,this.storageKey+"-user"),this.userStorage&&await De(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(),gs);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}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)/gs);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${gs}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 q0)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()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},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(this.lockAcquireTimeout,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 ds(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 V(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(F(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 V(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(F(r))return this._returnResult({data:null,error:r});throw r}}async _verify(e){return this._acquireLock(this.lockAcquireTimeout,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"?RR(e.webauthn.credential_response):AR(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:l}=await V(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(F(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(e){return this._acquireLock(this.lockAcquireTimeout,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 V(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:TR(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:CR(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(F(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(e){var r,n,s,i;if(e)try{const{payload:h}=wa(e);let y=null;h.aal&&(y=h.aal);let v=y;const{data:{user:w},error:m}=await this.getUser(e);if(m)return this._returnResult({data:null,error:m});((n=(r=w==null?void 0:w.factors)===null||r===void 0?void 0:r.filter(b=>b.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(v="aal2");const g=h.amr||[];return{data:{currentLevel:y,nextLevel:v,currentAuthenticationMethods:g},error:null}}catch(h){if(F(h))return this._returnResult({data:null,error:h});throw h}const{data:{session:o},error:a}=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:l}=wa(o.access_token);let u=null;l.aal&&(u=l.aal);let c=u;((i=(s=o.user.factors)===null||s===void 0?void 0:s.filter(h=>h.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(c="aal2");const f=l.amr||[];return{data:{currentLevel:u,nextLevel:c,currentAuthenticationMethods:f},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 V(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(F(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 V(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(F(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 V(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(F(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 V(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(F(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 V(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(F(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+MC>s)return n;const{data:i,error:o}=await V(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:h,error:y}=await this.getSession();if(y||!h.session)return this._returnResult({data:null,error:y});n=h.session.access_token}const{header:s,payload:i,signature:o,raw:{header:a,payload:l}}=wa(n);r!=null&&r.allowExpired||oR(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:h}=await this.getUser(n);if(h)throw h;return{data:{claims:i,header:s,signature:o},error:null}}const c=aR(s.alg),d=await crypto.subtle.importKey("jwk",u,c,!0,["verify"]);if(!await crypto.subtle.verify(c,d,o,KC(`${a}.${l}`)))throw new hd("Invalid JWT signature");return{data:{claims:i,header:s,signature:o},error:null}}catch(n){if(F(n))return this._returnResult({data:null,error:n});throw n}}}So.nextInstanceID={};const MR=So,UR="2.103.2";let $i="";typeof Deno<"u"?$i="deno":typeof document<"u"?$i="web":typeof navigator<"u"&&navigator.product==="ReactNative"?$i="react-native":$i="node";const FR={"X-Client-Info":`supabase-js-${$i}/${UR}`},zR={headers:FR},BR={schema:"public"},VR={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},HR={};function Eo(t){"@babel/helpers - typeof";return Eo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Eo(t)}function WR(t,e){if(Eo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Eo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qR(t){var e=WR(t,"string");return Eo(e)=="symbol"?e:e+""}function KR(t,e,r){return(e=qR(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lm(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Ee(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?lm(Object(r),!0).forEach(function(n){KR(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lm(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}const GR=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),JR=()=>Headers,QR=(t,e,r)=>{const n=GR(r),s=JR();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,Ee(Ee({},o),{},{headers:u}))}};function ZR(t){return t.endsWith("/")?t:t+"/"}function YR(t,e){var r,n;const{db:s,auth:i,realtime:o,global:a}=t,{db:l,auth:u,realtime:c,global:d}=e,f={db:Ee(Ee({},l),s),auth:Ee(Ee({},u),i),realtime:Ee(Ee({},c),o),storage:{},global:Ee(Ee(Ee({},d),a),{},{headers:Ee(Ee({},(r=d==null?void 0:d.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 XR(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(ZR(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var eA=class extends MR{constructor(t){super(t)}},tA=class{constructor(t,e,r){var n,s;this.supabaseUrl=t,this.supabaseKey=e;const i=XR(t);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",i),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",i),this.storageUrl=new URL("storage/v1",i),this.functionsUrl=new URL("functions/v1",i);const o=`sb-${i.hostname.split(".")[0]}-auth-token`,a={db:BR,realtime:HR,auth:Ee(Ee({},VR),{},{storageKey:o}),global:zR},l=YR(r??{},a);if(this.storageKey=(n=l.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(s=l.global.headers)!==null&&s!==void 0?s:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(c,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=l.auth)!==null&&u!==void 0?u:{},this.headers,l.global.fetch)}this.fetch=QR(e,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Ee({headers:this.headers,accessToken:this._getAccessToken.bind(this)},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(c=>this.realtime.setAuth(c)).catch(c=>console.warn("Failed to set initial Realtime auth token:",c)),this.rest=new xT(new URL("rest/v1",i).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new jC(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new hT(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,r)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t=this,e,r;if(t.accessToken)return await t.accessToken();const{data:n}=await t.auth.getSession();return(e=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:s,storageKey:i,flowType:o,lock:a,debug:l,throwOnError:u},c,d){const f={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new eA({url:this.authUrl.href,headers:Ee(Ee({},f),c),storageKey:i,autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:s,flowType:o,lock:a,debug:l,throwOnError:u,fetch:d,hasCustomAuthorizationHeader:Object.keys(this.headers).some(h=>h.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new rC(this.realtimeUrl.href,Ee(Ee({},t),{},{params:Ee(Ee({},{apikey:this.supabaseKey}),t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(t,e,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const rA=(t,e,r)=>new tA(t,e,r);function nA(){if(typeof window<"u")return!1;const t=globalThis.process;if(!t)return!1;const e=t.version;if(e==null)return!1;const r=e.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=18:!1}nA()&&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 sA="https://yrobtsphhjbjarywxvwr.supabase.co",iA="sb_publishable_XdqKS8XM386HtaJP6xARug_t8kwRE7U",oA=rA(sA,iA,{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 um;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(um||(um={}));const z=ce.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Hr=t=>{switch(typeof t){case"undefined":return z.undefined;case"string":return z.string;case"number":return Number.isNaN(t)?z.nan:z.number;case"boolean":return z.boolean;case"function":return z.function;case"bigint":return z.bigint;case"symbol":return z.symbol;case"object":return Array.isArray(t)?z.array:t===null?z.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?z.promise:typeof Map<"u"&&t instanceof Map?z.map:typeof Set<"u"&&t instanceof Set?z.set:typeof Date<"u"&&t instanceof Date?z.date:z.object;default:return z.unknown}},O=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 Ar 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 Ar))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()}}Ar.create=t=>new Ar(t);const fd=(t,e)=>{let r;switch(t.code){case O.invalid_type:t.received===z.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case O.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ce.jsonStringifyReplacer)}`;break;case O.unrecognized_keys:r=`Unrecognized key(s) in object: ${ce.joinValues(t.keys,", ")}`;break;case O.invalid_union:r="Invalid input";break;case O.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ce.joinValues(t.options)}`;break;case O.invalid_enum_value:r=`Invalid enum value. Expected ${ce.joinValues(t.options)}, received '${t.received}'`;break;case O.invalid_arguments:r="Invalid function arguments";break;case O.invalid_return_type:r="Invalid function return type";break;case O.invalid_date:r="Invalid date";break;case O.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 O.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 O.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 O.custom:r="Invalid input";break;case O.invalid_intersection_types:r="Intersection results could not be merged";break;case O.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case O.not_finite:r="Number must be finite";break;default:r=e.defaultError,ce.assertNever(t)}return{message:r}};let aA=fd;function lA(){return aA}const uA=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 $(t,e){const r=lA(),n=uA({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 yt{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 yt.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"}),Di=t=>({status:"dirty",value:t}),At=t=>({status:"valid",value:t}),cm=t=>t.status==="aborted",dm=t=>t.status==="dirty",oi=t=>t.status==="valid",_l=t=>typeof Promise<"u"&&t instanceof Promise;var B;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(B||(B={}));class _n{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 hm=(t,e)=>{if(oi(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 Ar(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 Hr(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Hr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new yt,ctx:{common:e.parent.common,data:e.data,parsedType:Hr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(_l(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:Hr(e)},s=this._parseSync({data:e,path:n.path,parent:n});return hm(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:Hr(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:r});return oi(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=>oi(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:Hr(e)},s=this._parse({data:e,path:n.path,parent:n}),i=await(_l(s)?s:Promise.resolve(s));return hm(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:O.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 li({schema:this,typeName:J.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 fn.create(this,this._def)}nullable(){return ui.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ur.create(this)}promise(){return Sl.create(this,this._def)}or(e){return xl.create([this,e],this._def)}and(e){return kl.create(this,e,this._def)}transform(e){return new li({...re(this._def),schema:this,typeName:J.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:J.ZodDefault})}brand(){return new NA({typeName:J.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:J.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ih.create(this,e)}readonly(){return vd.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cA=/^c[^\s-]{8,}$/i,dA=/^[0-9a-z]+$/,hA=/^[0-9A-HJKMNP-TV-Z]{26}$/i,fA=/^[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,pA=/^[a-z0-9_-]{21}$/i,mA=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,gA=/^[-+]?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)?)??$/,vA=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,yA="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let qu;const wA=/^(?:(?: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])$/,_A=/^(?:(?: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])$/,bA=/^(([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]))$/,xA=/^(([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])$/,kA=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,SA=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,J0="((\\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])))",EA=new RegExp(`^${J0}$`);function Q0(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 TA(t){return new RegExp(`^${Q0(t)}$`)}function CA(t){let e=`${J0}T${Q0(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 RA(t,e){return!!((e==="v4"||!e)&&wA.test(t)||(e==="v6"||!e)&&bA.test(t))}function AA(t,e){if(!mA.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 PA(t,e){return!!((e==="v4"||!e)&&_A.test(t)||(e==="v6"||!e)&&xA.test(t))}class nn extends le{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==z.string){const i=this._getOrReturnCtx(e);return $(i,{code:O.invalid_type,expected:z.string,received:i.parsedType}),G}const n=new yt;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),$(s,{code:O.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),$(s,{code:O.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?$(s,{code:O.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&$(s,{code:O.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")vA.test(e.data)||(s=this._getOrReturnCtx(e,s),$(s,{validation:"email",code:O.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")qu||(qu=new RegExp(yA,"u")),qu.test(e.data)||(s=this._getOrReturnCtx(e,s),$(s,{validation:"emoji",code:O.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")fA.test(e.data)||(s=this._getOrReturnCtx(e,s),$(s,{validation:"uuid",code:O.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")pA.test(e.data)||(s=this._getOrReturnCtx(e,s),$(s,{validation:"nanoid",code:O.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")cA.test(e.data)||(s=this._getOrReturnCtx(e,s),$(s,{validation:"cuid",code:O.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")dA.test(e.data)||(s=this._getOrReturnCtx(e,s),$(s,{validation:"cuid2",code:O.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")hA.test(e.data)||(s=this._getOrReturnCtx(e,s),$(s,{validation:"ulid",code:O.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),$(s,{validation:"url",code:O.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),$(s,{validation:"regex",code:O.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),$(s,{code:O.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),$(s,{code:O.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),$(s,{code:O.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?CA(i).test(e.data)||(s=this._getOrReturnCtx(e,s),$(s,{code:O.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?EA.test(e.data)||(s=this._getOrReturnCtx(e,s),$(s,{code:O.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?TA(i).test(e.data)||(s=this._getOrReturnCtx(e,s),$(s,{code:O.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?gA.test(e.data)||(s=this._getOrReturnCtx(e,s),$(s,{validation:"duration",code:O.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?RA(e.data,i.version)||(s=this._getOrReturnCtx(e,s),$(s,{validation:"ip",code:O.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?AA(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),$(s,{validation:"jwt",code:O.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?PA(e.data,i.version)||(s=this._getOrReturnCtx(e,s),$(s,{validation:"cidr",code:O.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?kA.test(e.data)||(s=this._getOrReturnCtx(e,s),$(s,{validation:"base64",code:O.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?SA.test(e.data)||(s=this._getOrReturnCtx(e,s),$(s,{validation:"base64url",code:O.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:O.invalid_string,...B.errToObj(n)})}_addCheck(e){return new nn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...B.errToObj(e)})}url(e){return this._addCheck({kind:"url",...B.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...B.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...B.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...B.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...B.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...B.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...B.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...B.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...B.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...B.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...B.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...B.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,...B.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,...B.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...B.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...B.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...B.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...B.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...B.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...B.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...B.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...B.errToObj(r)})}nonempty(e){return this.min(1,B.errToObj(e))}trim(){return new nn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new nn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new nn({...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}}nn.create=t=>new nn({checks:[],typeName:J.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...re(t)});function OA(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 To 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)!==z.number){const i=this._getOrReturnCtx(e);return $(i,{code:O.invalid_type,expected:z.number,received:i.parsedType}),G}let n;const s=new yt;for(const i of this._def.checks)i.kind==="int"?ce.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{code:O.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),$(n,{code:O.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),$(n,{code:O.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?OA(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),$(n,{code:O.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),$(n,{code:O.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,B.toString(r))}gt(e,r){return this.setLimit("min",e,!1,B.toString(r))}lte(e,r){return this.setLimit("max",e,!0,B.toString(r))}lt(e,r){return this.setLimit("max",e,!1,B.toString(r))}setLimit(e,r,n,s){return new To({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:B.toString(s)}]})}_addCheck(e){return new To({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:B.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:B.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:B.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:B.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:B.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:B.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:B.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:B.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:B.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)}}To.create=t=>new To({checks:[],typeName:J.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...re(t)});class Co 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)!==z.bigint)return this._getInvalidInput(e);let n;const s=new yt;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),$(n,{code:O.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),$(n,{code:O.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),$(n,{code:O.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 $(r,{code:O.invalid_type,expected:z.bigint,received:r.parsedType}),G}gte(e,r){return this.setLimit("min",e,!0,B.toString(r))}gt(e,r){return this.setLimit("min",e,!1,B.toString(r))}lte(e,r){return this.setLimit("max",e,!0,B.toString(r))}lt(e,r){return this.setLimit("max",e,!1,B.toString(r))}setLimit(e,r,n,s){return new Co({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:B.toString(s)}]})}_addCheck(e){return new Co({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:B.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:B.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:B.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:B.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:B.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}}Co.create=t=>new Co({checks:[],typeName:J.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...re(t)});class fm extends le{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==z.boolean){const n=this._getOrReturnCtx(e);return $(n,{code:O.invalid_type,expected:z.boolean,received:n.parsedType}),G}return At(e.data)}}fm.create=t=>new fm({typeName:J.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...re(t)});class bl extends le{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==z.date){const i=this._getOrReturnCtx(e);return $(i,{code:O.invalid_type,expected:z.date,received:i.parsedType}),G}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return $(i,{code:O.invalid_date}),G}const n=new yt;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),$(s,{code:O.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),$(s,{code:O.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 bl({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:B.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:B.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}}bl.create=t=>new bl({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:J.ZodDate,...re(t)});class pm extends le{_parse(e){if(this._getType(e)!==z.symbol){const n=this._getOrReturnCtx(e);return $(n,{code:O.invalid_type,expected:z.symbol,received:n.parsedType}),G}return At(e.data)}}pm.create=t=>new pm({typeName:J.ZodSymbol,...re(t)});class mm extends le{_parse(e){if(this._getType(e)!==z.undefined){const n=this._getOrReturnCtx(e);return $(n,{code:O.invalid_type,expected:z.undefined,received:n.parsedType}),G}return At(e.data)}}mm.create=t=>new mm({typeName:J.ZodUndefined,...re(t)});class gm extends le{_parse(e){if(this._getType(e)!==z.null){const n=this._getOrReturnCtx(e);return $(n,{code:O.invalid_type,expected:z.null,received:n.parsedType}),G}return At(e.data)}}gm.create=t=>new gm({typeName:J.ZodNull,...re(t)});class vm extends le{constructor(){super(...arguments),this._any=!0}_parse(e){return At(e.data)}}vm.create=t=>new vm({typeName:J.ZodAny,...re(t)});class ym extends le{constructor(){super(...arguments),this._unknown=!0}_parse(e){return At(e.data)}}ym.create=t=>new ym({typeName:J.ZodUnknown,...re(t)});class bn extends le{_parse(e){const r=this._getOrReturnCtx(e);return $(r,{code:O.invalid_type,expected:z.never,received:r.parsedType}),G}}bn.create=t=>new bn({typeName:J.ZodNever,...re(t)});class wm extends le{_parse(e){if(this._getType(e)!==z.undefined){const n=this._getOrReturnCtx(e);return $(n,{code:O.invalid_type,expected:z.void,received:n.parsedType}),G}return At(e.data)}}wm.create=t=>new wm({typeName:J.ZodVoid,...re(t)});class ur extends le{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==z.array)return $(r,{code:O.invalid_type,expected:z.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)&&($(r,{code:o?O.too_big:O.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&&($(r,{code:O.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&&($(r,{code:O.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 _n(r,o,r.path,a)))).then(o=>yt.mergeArray(n,o));const i=[...r.data].map((o,a)=>s.type._parseSync(new _n(r,o,r.path,a)));return yt.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new ur({...this._def,minLength:{value:e,message:B.toString(r)}})}max(e,r){return new ur({...this._def,maxLength:{value:e,message:B.toString(r)}})}length(e,r){return new ur({...this._def,exactLength:{value:e,message:B.toString(r)}})}nonempty(e){return this.min(1,e)}}ur.create=(t,e)=>new ur({type:t,minLength:null,maxLength:null,exactLength:null,typeName:J.ZodArray,...re(e)});function ys(t){if(t instanceof Te){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=fn.create(ys(n))}return new Te({...t._def,shape:()=>e})}else return t instanceof ur?new ur({...t._def,type:ys(t.element)}):t instanceof fn?fn.create(ys(t.unwrap())):t instanceof ui?ui.create(ys(t.unwrap())):t instanceof Yn?Yn.create(t.items.map(e=>ys(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)!==z.object){const u=this._getOrReturnCtx(e);return $(u,{code:O.invalid_type,expected:z.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 bn&&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],d=s.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new _n(s,d,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof bn){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&&($(s,{code:O.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 d=s.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new _n(s,d,s.path,c)),alwaysSet:c in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const d=await c.key,f=await c.value;u.push({key:d,value:f,alwaysSet:c.alwaysSet})}return u}).then(u=>yt.mergeObjectSync(n,u)):yt.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return B.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:B.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:J.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 ys(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 fn;)i=i._def.innerType;r[n]=i}return new Te({...this._def,shape:()=>r})}keyof(){return Z0(ce.objectKeys(this.shape))}}Te.create=(t,e)=>new Te({shape:()=>t,unknownKeys:"strip",catchall:bn.create(),typeName:J.ZodObject,...re(e)});Te.strictCreate=(t,e)=>new Te({shape:()=>t,unknownKeys:"strict",catchall:bn.create(),typeName:J.ZodObject,...re(e)});Te.lazycreate=(t,e)=>new Te({shape:t,unknownKeys:"strip",catchall:bn.create(),typeName:J.ZodObject,...re(e)});class xl 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 Ar(a.ctx.common.issues));return $(r,{code:O.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 Ar(l));return $(r,{code:O.invalid_union,unionErrors:a}),G}}get options(){return this._def.options}}xl.create=(t,e)=>new xl({options:t,typeName:J.ZodUnion,...re(e)});function pd(t,e){const r=Hr(t),n=Hr(e);if(t===e)return{valid:!0,data:t};if(r===z.object&&n===z.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===z.array&&n===z.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===z.date&&n===z.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class kl extends le{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),s=(i,o)=>{if(cm(i)||cm(o))return G;const a=pd(i.value,o.value);return a.valid?((dm(i)||dm(o))&&r.dirty(),{status:r.value,value:a.data}):($(n,{code:O.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}))}}kl.create=(t,e,r)=>new kl({left:t,right:e,typeName:J.ZodIntersection,...re(r)});class Yn extends le{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.array)return $(n,{code:O.invalid_type,expected:z.array,received:n.parsedType}),G;if(n.data.length<this._def.items.length)return $(n,{code:O.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),G;!this._def.rest&&n.data.length>this._def.items.length&&($(n,{code:O.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 _n(n,o,n.path,a)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>yt.mergeArray(r,o)):yt.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new Yn({...this._def,rest:e})}}Yn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Yn({items:t,typeName:J.ZodTuple,rest:null,...re(e)})};class _m 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!==z.map)return $(n,{code:O.invalid_type,expected:z.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 _n(n,a,n.path,[u,"key"])),value:i._parse(new _n(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}}}}_m.create=(t,e,r)=>new _m({valueType:e,keyType:t,typeName:J.ZodMap,...re(r)});class Ro extends le{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.set)return $(n,{code:O.invalid_type,expected:z.set,received:n.parsedType}),G;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&($(n,{code:O.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&&($(n,{code:O.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 _n(n,l,n.path,u)));return n.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(e,r){return new Ro({...this._def,minSize:{value:e,message:B.toString(r)}})}max(e,r){return new Ro({...this._def,maxSize:{value:e,message:B.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Ro.create=(t,e)=>new Ro({valueType:t,minSize:null,maxSize:null,typeName:J.ZodSet,...re(e)});class bm 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})}}bm.create=(t,e)=>new bm({getter:t,typeName:J.ZodLazy,...re(e)});class xm extends le{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return $(r,{received:r.data,code:O.invalid_literal,expected:this._def.value}),G}return{status:"valid",value:e.data}}get value(){return this._def.value}}xm.create=(t,e)=>new xm({value:t,typeName:J.ZodLiteral,...re(e)});function Z0(t,e){return new ai({values:t,typeName:J.ZodEnum,...re(e)})}class ai extends le{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return $(r,{expected:ce.joinValues(n),received:r.parsedType,code:O.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 $(r,{received:r.data,code:O.invalid_enum_value,options:n}),G}return At(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 ai.create(e,{...this._def,...r})}exclude(e,r=this._def){return ai.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}ai.create=Z0;class km extends le{_parse(e){const r=ce.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==z.string&&n.parsedType!==z.number){const s=ce.objectValues(r);return $(n,{expected:ce.joinValues(s),received:n.parsedType,code:O.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 $(n,{received:n.data,code:O.invalid_enum_value,options:s}),G}return At(e.data)}get enum(){return this._def.values}}km.create=(t,e)=>new km({values:t,typeName:J.ZodNativeEnum,...re(e)});class Sl extends le{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==z.promise&&r.common.async===!1)return $(r,{code:O.invalid_type,expected:z.promise,received:r.parsedType}),G;const n=r.parsedType===z.promise?r.data:Promise.resolve(r.data);return At(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Sl.create=(t,e)=>new Sl({type:t,typeName:J.ZodPromise,...re(e)});class li extends le{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===J.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=>{$(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"?Di(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"?Di(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(!oi(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=>oi(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:r.value,value:a})):G);ce.assertNever(s)}}li.create=(t,e,r)=>new li({schema:t,typeName:J.ZodEffects,effect:e,...re(r)});li.createWithPreprocess=(t,e,r)=>new li({schema:e,effect:{type:"preprocess",transform:t},typeName:J.ZodEffects,...re(r)});class fn extends le{_parse(e){return this._getType(e)===z.undefined?At(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}fn.create=(t,e)=>new fn({innerType:t,typeName:J.ZodOptional,...re(e)});class ui extends le{_parse(e){return this._getType(e)===z.null?At(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ui.create=(t,e)=>new ui({innerType:t,typeName:J.ZodNullable,...re(e)});class md extends le{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===z.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:J.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 _l(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ar(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ar(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}gd.create=(t,e)=>new gd({innerType:t,typeName:J.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...re(e)});class Sm extends le{_parse(e){if(this._getType(e)!==z.nan){const n=this._getOrReturnCtx(e);return $(n,{code:O.invalid_type,expected:z.nan,received:n.parsedType}),G}return{status:"valid",value:e.data}}}Sm.create=t=>new Sm({typeName:J.ZodNaN,...re(t)});class NA 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 Ih 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(),Di(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 Ih({in:e,out:r,typeName:J.ZodPipeline})}}class vd extends le{_parse(e){const r=this._def.innerType._parse(e),n=s=>(oi(s)&&(s.value=Object.freeze(s.value)),s);return _l(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}vd.create=(t,e)=>new vd({innerType:t,typeName:J.ZodReadonly,...re(e)});Te.lazycreate;var J;(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"})(J||(J={}));const _a=nn.create;bn.create;ur.create;const jA=Te.create;Te.strictCreate;xl.create;kl.create;Yn.create;ai.create;Sl.create;fn.create;ui.create;const IA=/^(?:\+46\s?\d{1,3}[\s-]?\d{3}[\s-]?\d{2}[\s-]?\d{2}|0\d{1,3}[\s-]?\d{3}[\s-]?\d{2}[\s-]?\d{2})$/,LA=jA({name:_a().trim().min(1,"Namn krävs").max(100),email:_a().trim().email("Ogiltig e-postadress").max(255),phone:_a().trim().max(30).refine(t=>!t||IA.test(t.replace(/\s+/g," ").trim()),{message:"Ogiltigt telefonnummer. Använd format som 070-123 45 67 eller +46701234567"}).optional(),message:_a().trim().min(1,"Meddelande krävs").max(2e3)}),$A=()=>{const[t,e]=_.useState({name:"",email:"",phone:"",message:"",website:""}),[r,n]=_.useState(!1),[s,i]=_.useState({}),o=c=>{e(d=>({...d,[c.target.name]:c.target.value})),i(d=>({...d,[c.target.name]:""}))},a=async c=>{if(c.preventDefault(),t.website)return;i({});const d=LA.safeParse(t);if(!d.success){const f={};d.error.issues.forEach(h=>{const y=h.path[0];f[y]=h.message}),i(f);return}n(!0);try{const{error:f}=await oA.from("contact_submissions").insert({name:d.data.name,email:d.data.email,phone:d.data.phone||null,message:d.data.message});if(f)throw f;fp.success("Tack! Vi återkommer så snart vi kan."),e({name:"",email:"",phone:"",message:"",website:""})}catch{fp.error("Något gick fel. Försök igen eller kontakta oss direkt.")}finally{n(!1)}},{ref:l,visible:u}=Oh();return x.jsx("section",{id:"contact",ref:l,className:`bg-background py-20 md:py-28 transition-none ${u?"animate-fade-in-up":"opacity-0"}`,children:x.jsx("div",{className:"container",children:x.jsxs("div",{className:"mx-auto max-w-xl",children:[x.jsxs("div",{className:"mb-10 text-center",children:[x.jsx("p",{className:"mb-2 text-sm font-semibold uppercase tracking-wider text-primary",children:"Kontakta oss"}),x.jsx("h2",{className:"text-3xl font-bold tracking-tight text-foreground md:text-4xl",children:"Redo att komma igång?"}),x.jsx("p",{className:"mt-3 text-muted-foreground",children:"Fyll i formuläret så hör vi av oss inom 24 timmar med en kostnadsfri offert."})]}),x.jsxs("form",{onSubmit:a,className:"space-y-5 rounded-2xl border bg-card p-8",children:[x.jsxs("div",{className:"absolute opacity-0 -z-10","aria-hidden":"true",children:[x.jsx("label",{htmlFor:"website",children:"Website"}),x.jsx("input",{id:"website",name:"website",type:"text",value:t.website,onChange:o,tabIndex:-1,autoComplete:"off"})]}),x.jsxs("div",{children:[x.jsx(Ii,{htmlFor:"name",children:"Namn *"}),x.jsx($a,{id:"name",name:"name",value:t.name,onChange:o,placeholder:"Ditt namn",className:"mt-1.5"}),s.name&&x.jsx("p",{className:"mt-1 text-sm text-destructive",children:s.name})]}),x.jsxs("div",{children:[x.jsx(Ii,{htmlFor:"email",children:"E-post *"}),x.jsx($a,{id:"email",name:"email",type:"email",value:t.email,onChange:o,placeholder:"din@email.se",className:"mt-1.5"}),s.email&&x.jsx("p",{className:"mt-1 text-sm text-destructive",children:s.email})]}),x.jsxs("div",{children:[x.jsx(Ii,{htmlFor:"phone",children:"Telefon"}),x.jsx($a,{id:"phone",name:"phone",type:"tel",value:t.phone,onChange:o,placeholder:"070-123 45 67",className:"mt-1.5"}),s.phone&&x.jsx("p",{className:"mt-1 text-sm text-destructive",children:s.phone})]}),x.jsxs("div",{children:[x.jsx(Ii,{htmlFor:"message",children:"Meddelande *"}),x.jsx(C0,{id:"message",name:"message",value:t.message,onChange:o,placeholder:"Berätta vad du behöver hjälp med...",rows:5,className:"mt-1.5"}),s.message&&x.jsx("p",{className:"mt-1 text-sm text-destructive",children:s.message})]}),x.jsx(ii,{type:"submit",className:"w-full gap-2",size:"lg",disabled:r,children:r?"Skickar...":x.jsxs(x.Fragment,{children:["Skicka förfrågan ",x.jsx(R1,{className:"h-4 w-4"})]})})]})]})})})},DA=()=>x.jsx("footer",{className:"border-t bg-card py-12",children:x.jsxs("div",{className:"container",children:[x.jsxs("div",{className:"grid gap-8 md:grid-cols-3",children:[x.jsxs("div",{children:[x.jsx("h3",{className:"mb-3 text-lg font-bold text-card-foreground",children:"Solros Energi AB"}),x.jsx("p",{className:"text-sm leading-relaxed text-muted-foreground",children:"Din kundnära och professionella installatör av hembatterier och solcellsanläggningar."})]}),x.jsxs("div",{children:[x.jsx("h4",{className:"mb-3 text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Snabblänkar"}),x.jsxs("ul",{className:"space-y-2 text-sm",children:[x.jsx("li",{children:x.jsx("a",{href:"#services",className:"text-card-foreground transition-colors hover:text-primary",children:"Tjänster"})}),x.jsx("li",{children:x.jsx("a",{href:"#why-us",className:"text-card-foreground transition-colors hover:text-primary",children:"Varför oss?"})}),x.jsx("li",{children:x.jsx("a",{href:"#contact",className:"text-card-foreground transition-colors hover:text-primary",children:"Kontakt"})})]})]}),x.jsxs("div",{children:[x.jsx("h4",{className:"mb-3 text-sm font-semibold uppercase tracking-wider text-muted-foreground",children:"Kontaktuppgifter"}),x.jsxs("ul",{className:"space-y-2 text-sm text-card-foreground",children:[x.jsx("li",{children:"Exempelgatan 12, 111 22 Stockholm"}),x.jsx("li",{children:"info@solbatteri.se"}),x.jsx("li",{children:"08-123 456 78"})]})]})]}),x.jsxs("div",{className:"mt-10 border-t pt-6 text-center text-xs text-muted-foreground",children:["© ",new Date().getFullYear()," Solros Energi AB. Alla rättigheter förbehållna."]})]})}),MA=()=>x.jsxs("div",{className:"min-h-screen",children:[x.jsx(tT,{}),x.jsx(rT,{}),x.jsx(sT,{}),x.jsx(oT,{}),x.jsx($A,{}),x.jsx(DA,{})]}),UA=()=>{const t=cy();return _.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),x.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:x.jsxs("div",{className:"text-center",children:[x.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),x.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),x.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},FA=new tx,zA=()=>x.jsx(nx,{client:FA,children:x.jsxs(YE,{children:[x.jsx(fS,{}),x.jsx(_k,{}),x.jsx(Bx,{children:x.jsxs(Ux,{children:[x.jsx(Vc,{path:"/",element:x.jsx(MA,{})}),x.jsx(Vc,{path:"*",element:x.jsx(UA,{})})]})})]})});Gv(document.getElementById("root")).render(x.jsx(zA,{}));