const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Index-Csq_a7Uu.js","assets/Header-CQ-hRMFy.js","assets/Footer-B625QnUy.js","assets/ComparisonBar-VklzV7nq.js","assets/card-Xe3d9dhi.js","assets/OptimizedImage-BDiwQDT8.js","assets/ProductCard-5OM8mCzQ.js","assets/checkbox-CzTzIcmO.js","assets/index-DVk-hwER.js","assets/check-DCNsCDBV.js","assets/index-CeP29QIk.js","assets/index-CL0xAu-I.js","assets/chevron-right-Dnq_A__P.js","assets/seoHelpers-DphZaCAd.js","assets/external-link-RH3nu8XI.js","assets/arrow-left-PTJHM8zM.js","assets/useMetaDescription-Dr9AdqMY.js","assets/useDocumentTitle-B-SBpz7s.js","assets/useOpenGraph-BJUJ8GJb.js","assets/trending-up-DwS3N9Bd.js","assets/Login-CZbosYFl.js","assets/label-n4yO-TmJ.js","assets/Signup-BJF6P2Lx.js","assets/types-BQK_W90y.js","assets/progress-DtXyZUik.js","assets/Products-XIDlbOgM.js","assets/StructuredBreadcrumb-BCzmleui.js","assets/usePaginationMeta-BwbsE7lj.js","assets/select-Cw0Wzy5h.js","assets/chevron-down-B5BGiQa3.js","assets/ProductDetail-JXyzu4Uq.js","assets/useMutation-tTbw9fD5.js","assets/bell-CG2gu7ec.js","assets/badge-ChUUq-BC.js","assets/circle-check-BQ8-zlbN.js","assets/zod-DcfU_8_4.js","assets/index-ClwVMAx4.js","assets/textarea-DSeH8gpv.js","assets/alert-D83Fgsxk.js","assets/tabs-BeQtBmu6.js","assets/tag-DyoEMiBs.js","assets/Compare-CbRzpJlb.js","assets/plus-3qLVhq6w.js","assets/Terms-QOYp_ne3.js","assets/Privacy-BKxUAgpE.js","assets/Contact-CtGQnXqF.js","assets/Cookies-CFFfVhlJ.js","assets/NotFound-D44nFSrO.js","assets/Dashboard-aHVTxKHv.js","assets/shield-alert-likCOzT0.js","assets/alert-dialog-eWxBw4qI.js","assets/circle-stop-z46BIvNF.js","assets/table-DtxYby0-.js","assets/dialog-C2v1z946.js","assets/circle-check-big-0ANYTlh2.js","assets/SecurityDashboard-D8sSF21x.js","assets/triangle-alert-CsjZlvTr.js","assets/FeedDetail-C0PiUps-.js","assets/save-CVr34SZC.js","assets/Settings-B6mi3n82.js","assets/wrench-BtbhJp7c.js","assets/MaintenancePage-B7FSZ3i9.js","assets/Categories-DEyXd75K.js","assets/CategoryPage-N4FVmRt6.js","assets/Advertisers-Bjjuhdlx.js"])))=>i.map(i=>d[i]);
var k_=Object.defineProperty;var vf=t=>{throw TypeError(t)};var C_=(t,e,r)=>e in t?k_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var lr=(t,e,r)=>C_(t,typeof e!="symbol"?e+"":e,r),nu=(t,e,r)=>e.has(t)||vf("Cannot "+r);var E=(t,e,r)=>(nu(t,e,"read from private field"),r?r.call(t):e.get(t)),V=(t,e,r)=>e.has(t)?vf("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),M=(t,e,r,n)=>(nu(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),te=(t,e,r)=>(nu(t,e,"access private method"),r);var Ho=(t,e,r,n)=>({set _(s){M(t,e,s,r)},get _(){return E(t,e,n)}});function ig(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)}})();var GO=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function og(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function T_(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:function(){return t[n]}})}),r}var ag={exports:{}},El={},lg={exports:{}},X={};/**
 * @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"),P_=Symbol.for("react.portal"),R_=Symbol.for("react.fragment"),O_=Symbol.for("react.strict_mode"),A_=Symbol.for("react.profiler"),j_=Symbol.for("react.provider"),I_=Symbol.for("react.context"),N_=Symbol.for("react.forward_ref"),L_=Symbol.for("react.suspense"),$_=Symbol.for("react.memo"),D_=Symbol.for("react.lazy"),yf=Symbol.iterator;function M_(t){return t===null||typeof t!="object"?null:(t=yf&&t[yf]||t["@@iterator"],typeof t=="function"?t:null)}var ug={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},cg=Object.assign,dg={};function li(t,e,r){this.props=t,this.context=e,this.refs=dg,this.updater=r||ug}li.prototype.isReactComponent={};li.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")};li.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function hg(){}hg.prototype=li.prototype;function Ad(t,e,r){this.props=t,this.context=e,this.refs=dg,this.updater=r||ug}var jd=Ad.prototype=new hg;jd.constructor=Ad;cg(jd,li.prototype);jd.isPureReactComponent=!0;var wf=Array.isArray,fg=Object.prototype.hasOwnProperty,Id={current:null},pg={key:!0,ref:!0,__self:!0,__source:!0};function mg(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)fg.call(e,n)&&!pg.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:Id.current}}function U_(t,e){return{$$typeof:Oo,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Nd(t){return typeof t=="object"&&t!==null&&t.$$typeof===Oo}function F_(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var _f=/\/+/g;function su(t,e){return typeof t=="object"&&t!==null&&t.key!=null?F_(""+t.key):e.toString(36)}function Sa(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 P_:o=!0}}if(o)return o=t,s=s(o),t=n===""?"."+su(o,0):n,wf(s)?(r="",t!=null&&(r=t.replace(_f,"$&/")+"/"),Sa(s,e,r,"",function(u){return u})):s!=null&&(Nd(s)&&(s=U_(s,r+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(_f,"$&/")+"/")+t)),e.push(s)),1;if(o=0,n=n===""?".":n+":",wf(t))for(var a=0;a<t.length;a++){i=t[a];var l=n+su(i,a);o+=Sa(i,e,r,l,s)}else if(l=M_(t),typeof l=="function")for(t=l.call(t),a=0;!(i=t.next()).done;)i=i.value,l=n+su(i,a++),o+=Sa(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 qo(t,e,r){if(t==null)return t;var n=[],s=0;return Sa(t,n,"","",function(i){return e.call(r,i,s++)}),n}function z_(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 Ye={current:null},ka={transition:null},B_={ReactCurrentDispatcher:Ye,ReactCurrentBatchConfig:ka,ReactCurrentOwner:Id};function gg(){throw Error("act(...) is not supported in production builds of React.")}X.Children={map:qo,forEach:function(t,e,r){qo(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return qo(t,function(){e++}),e},toArray:function(t){return qo(t,function(e){return e})||[]},only:function(t){if(!Nd(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};X.Component=li;X.Fragment=R_;X.Profiler=A_;X.PureComponent=Ad;X.StrictMode=O_;X.Suspense=L_;X.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=B_;X.act=gg;X.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=cg({},t.props),s=t.key,i=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,o=Id.current),e.key!==void 0&&(s=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)fg.call(e,l)&&!pg.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}};X.createContext=function(t){return t={$$typeof:I_,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:j_,_context:t},t.Consumer=t};X.createElement=mg;X.createFactory=function(t){var e=mg.bind(null,t);return e.type=t,e};X.createRef=function(){return{current:null}};X.forwardRef=function(t){return{$$typeof:N_,render:t}};X.isValidElement=Nd;X.lazy=function(t){return{$$typeof:D_,_payload:{_status:-1,_result:t},_init:z_}};X.memo=function(t,e){return{$$typeof:$_,type:t,compare:e===void 0?null:e}};X.startTransition=function(t){var e=ka.transition;ka.transition={};try{t()}finally{ka.transition=e}};X.unstable_act=gg;X.useCallback=function(t,e){return Ye.current.useCallback(t,e)};X.useContext=function(t){return Ye.current.useContext(t)};X.useDebugValue=function(){};X.useDeferredValue=function(t){return Ye.current.useDeferredValue(t)};X.useEffect=function(t,e){return Ye.current.useEffect(t,e)};X.useId=function(){return Ye.current.useId()};X.useImperativeHandle=function(t,e,r){return Ye.current.useImperativeHandle(t,e,r)};X.useInsertionEffect=function(t,e){return Ye.current.useInsertionEffect(t,e)};X.useLayoutEffect=function(t,e){return Ye.current.useLayoutEffect(t,e)};X.useMemo=function(t,e){return Ye.current.useMemo(t,e)};X.useReducer=function(t,e,r){return Ye.current.useReducer(t,e,r)};X.useRef=function(t){return Ye.current.useRef(t)};X.useState=function(t){return Ye.current.useState(t)};X.useSyncExternalStore=function(t,e,r){return Ye.current.useSyncExternalStore(t,e,r)};X.useTransition=function(){return Ye.current.useTransition()};X.version="18.3.1";lg.exports=X;var w=lg.exports;const I=og(w),Ld=ig({__proto__:null,default:I},[w]);/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var V_=w,W_=Symbol.for("react.element"),H_=Symbol.for("react.fragment"),q_=Object.prototype.hasOwnProperty,K_=V_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Q_={key:!0,ref:!0,__self:!0,__source:!0};function vg(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)q_.call(e,n)&&!Q_.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:W_,type:t,key:i,ref:o,props:s,_owner:K_.current}}El.Fragment=H_;El.jsx=vg;El.jsxs=vg;ag.exports=El;var S=ag.exports,yg={exports:{}},vt={},wg={exports:{}},_g={};/**
 * @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(P,R){var $=P.length;P.push(R);e:for(;0<$;){var G=$-1>>>1,z=P[G];if(0<s(z,R))P[G]=R,P[$]=z,$=G;else break e}}function r(P){return P.length===0?null:P[0]}function n(P){if(P.length===0)return null;var R=P[0],$=P.pop();if($!==R){P[0]=$;e:for(var G=0,z=P.length,Y=z>>>1;G<Y;){var ee=2*(G+1)-1,Ee=P[ee],Ue=ee+1,se=P[Ue];if(0>s(Ee,$))Ue<z&&0>s(se,Ee)?(P[G]=se,P[Ue]=$,G=Ue):(P[G]=Ee,P[ee]=$,G=ee);else if(Ue<z&&0>s(se,$))P[G]=se,P[Ue]=$,G=Ue;else break e}}return R}function s(P,R){var $=P.sortIndex-R.sortIndex;return $!==0?$:P.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,_=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,g=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 m(P){for(var R=r(u);R!==null;){if(R.callback===null)n(u);else if(R.startTime<=P)n(u),R.sortIndex=R.expirationTime,e(l,R);else break;R=r(u)}}function b(P){if(y=!1,m(P),!_)if(r(l)!==null)_=!0,H(x);else{var R=r(u);R!==null&&Q(b,R.startTime-P)}}function x(P,R){_=!1,y&&(y=!1,g(T),T=-1),h=!0;var $=f;try{for(m(R),d=r(l);d!==null&&(!(d.expirationTime>R)||P&&!B());){var G=d.callback;if(typeof G=="function"){d.callback=null,f=d.priorityLevel;var z=G(d.expirationTime<=R);R=t.unstable_now(),typeof z=="function"?d.callback=z:d===r(l)&&n(l),m(R)}else n(l);d=r(l)}if(d!==null)var Y=!0;else{var ee=r(u);ee!==null&&Q(b,ee.startTime-R),Y=!1}return Y}finally{d=null,f=$,h=!1}}var k=!1,C=null,T=-1,j=5,A=-1;function B(){return!(t.unstable_now()-A<j)}function L(){if(C!==null){var P=t.unstable_now();A=P;var R=!0;try{R=C(!0,P)}finally{R?q():(k=!1,C=null)}}else k=!1}var q;if(typeof p=="function")q=function(){p(L)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,Z=N.port2;N.port1.onmessage=L,q=function(){Z.postMessage(null)}}else q=function(){v(L,0)};function H(P){C=P,k||(k=!0,q())}function Q(P,R){T=v(function(){P(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(P){P.callback=null},t.unstable_continueExecution=function(){_||h||(_=!0,H(x))},t.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<P?Math.floor(1e3/P):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return r(l)},t.unstable_next=function(P){switch(f){case 1:case 2:case 3:var R=3;break;default:R=f}var $=f;f=R;try{return P()}finally{f=$}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(P,R){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var $=f;f=P;try{return R()}finally{f=$}},t.unstable_scheduleCallback=function(P,R,$){var G=t.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?G+$:G):$=G,P){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=$+z,P={id:c++,callback:R,priorityLevel:P,startTime:$,expirationTime:z,sortIndex:-1},$>G?(P.sortIndex=$,e(u,P),r(l)===null&&P===r(u)&&(y?(g(T),T=-1):y=!0,Q(b,$-G))):(P.sortIndex=z,e(l,P),_||h||(_=!0,H(x))),P},t.unstable_shouldYield=B,t.unstable_wrapCallback=function(P){var R=f;return function(){var $=f;f=R;try{return P.apply(this,arguments)}finally{f=$}}}})(_g);wg.exports=_g;var G_=wg.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 J_=w,gt=G_;function O(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 bg=new Set,Xi={};function es(t,e){Xs(t,e),Xs(t+"Capture",e)}function Xs(t,e){for(Xi[t]=e,t=0;t<e.length;t++)bg.add(e[t])}var yr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gu=Object.prototype.hasOwnProperty,Y_=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,bf={},xf={};function X_(t){return Gu.call(xf,t)?!0:Gu.call(bf,t)?!1:Y_.test(t)?xf[t]=!0:(bf[t]=!0,!1)}function Z_(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 eb(t,e,r,n){if(e===null||typeof e>"u"||Z_(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 Xe(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 Me={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Me[t]=new Xe(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Me[e]=new Xe(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Me[t]=new Xe(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Me[t]=new Xe(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){Me[t]=new Xe(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Me[t]=new Xe(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Me[t]=new Xe(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Me[t]=new Xe(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Me[t]=new Xe(t,5,!1,t.toLowerCase(),null,!1,!1)});var $d=/[\-:]([a-z])/g;function Dd(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($d,Dd);Me[e]=new Xe(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($d,Dd);Me[e]=new Xe(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($d,Dd);Me[e]=new Xe(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Me[t]=new Xe(t,1,!1,t.toLowerCase(),null,!1,!1)});Me.xlinkHref=new Xe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Me[t]=new Xe(t,1,!1,t.toLowerCase(),null,!0,!0)});function Md(t,e,r,n){var s=Me.hasOwnProperty(e)?Me[e]:null;(s!==null?s.type!==0:n||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(eb(e,r,s,n)&&(r=null),n||s===null?X_(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 kr=J_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ko=Symbol.for("react.element"),ys=Symbol.for("react.portal"),ws=Symbol.for("react.fragment"),Ud=Symbol.for("react.strict_mode"),Ju=Symbol.for("react.profiler"),xg=Symbol.for("react.provider"),Eg=Symbol.for("react.context"),Fd=Symbol.for("react.forward_ref"),Yu=Symbol.for("react.suspense"),Xu=Symbol.for("react.suspense_list"),zd=Symbol.for("react.memo"),Mr=Symbol.for("react.lazy"),Sg=Symbol.for("react.offscreen"),Ef=Symbol.iterator;function xi(t){return t===null||typeof t!="object"?null:(t=Ef&&t[Ef]||t["@@iterator"],typeof t=="function"?t:null)}var ye=Object.assign,iu;function Ii(t){if(iu===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);iu=e&&e[1]||""}return`
`+iu+t}var ou=!1;function au(t,e){if(!t||ou)return"";ou=!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{ou=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Ii(t):""}function tb(t){switch(t.tag){case 5:return Ii(t.type);case 16:return Ii("Lazy");case 13:return Ii("Suspense");case 19:return Ii("SuspenseList");case 0:case 2:case 15:return t=au(t.type,!1),t;case 11:return t=au(t.type.render,!1),t;case 1:return t=au(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 ws:return"Fragment";case ys:return"Portal";case Ju:return"Profiler";case Ud:return"StrictMode";case Yu:return"Suspense";case Xu:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Eg:return(t.displayName||"Context")+".Consumer";case xg:return(t._context.displayName||"Context")+".Provider";case Fd:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case zd:return e=t.displayName||null,e!==null?e:Zu(t.type)||"Memo";case Mr:e=t._payload,t=t._init;try{return Zu(t(e))}catch{}}return null}function rb(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===Ud?"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 dn(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function kg(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function nb(t){var e=kg(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=nb(t))}function Cg(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=kg(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function Ua(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 ec(t,e){var r=e.checked;return ye({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function Sf(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=dn(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&&Md(t,"checked",e,!1)}function tc(t,e){Tg(t,e);var r=dn(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")?rc(t,e.type,r):e.hasOwnProperty("defaultValue")&&rc(t,e.type,dn(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function kf(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 rc(t,e,r){(e!=="number"||Ua(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Ni=Array.isArray;function As(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=""+dn(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 nc(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(O(91));return ye({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function Cf(t,e){var r=e.value;if(r==null){if(r=e.children,e=e.defaultValue,r!=null){if(e!=null)throw Error(O(92));if(Ni(r)){if(1<r.length)throw Error(O(93));r=r[0]}e=r}e==null&&(e=""),r=e}t._wrapperState={initialValue:dn(r)}}function Pg(t,e){var r=dn(e.value),n=dn(e.defaultValue);r!=null&&(r=""+r,r!==t.value&&(t.value=r),e.defaultValue==null&&t.defaultValue!==r&&(t.defaultValue=r)),n!=null&&(t.defaultValue=""+n)}function Tf(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function Rg(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 sc(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?Rg(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Go,Og=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(Go=Go||document.createElement("div"),Go.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Go.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Zi(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Ui={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},sb=["Webkit","ms","Moz","O"];Object.keys(Ui).forEach(function(t){sb.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Ui[e]=Ui[t]})});function Ag(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Ui.hasOwnProperty(t)&&Ui[t]?(""+e).trim():e+"px"}function jg(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=Ag(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,s):t[r]=s}}var ib=ye({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 ic(t,e){if(e){if(ib[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(O(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(O(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(O(61))}if(e.style!=null&&typeof e.style!="object")throw Error(O(62))}}function oc(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 ac=null;function Bd(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var lc=null,js=null,Is=null;function Pf(t){if(t=Io(t)){if(typeof lc!="function")throw Error(O(280));var e=t.stateNode;e&&(e=Pl(e),lc(t.stateNode,t.type,e))}}function Ig(t){js?Is?Is.push(t):Is=[t]:js=t}function Ng(){if(js){var t=js,e=Is;if(Is=js=null,Pf(t),e)for(t=0;t<e.length;t++)Pf(e[t])}}function Lg(t,e){return t(e)}function $g(){}var lu=!1;function Dg(t,e,r){if(lu)return t(e,r);lu=!0;try{return Lg(t,e,r)}finally{lu=!1,(js!==null||Is!==null)&&($g(),Ng())}}function eo(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(O(231,e,typeof r));return r}var uc=!1;if(yr)try{var Ei={};Object.defineProperty(Ei,"passive",{get:function(){uc=!0}}),window.addEventListener("test",Ei,Ei),window.removeEventListener("test",Ei,Ei)}catch{uc=!1}function ob(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 Fi=!1,Fa=null,za=!1,cc=null,ab={onError:function(t){Fi=!0,Fa=t}};function lb(t,e,r,n,s,i,o,a,l){Fi=!1,Fa=null,ob.apply(ab,arguments)}function ub(t,e,r,n,s,i,o,a,l){if(lb.apply(this,arguments),Fi){if(Fi){var u=Fa;Fi=!1,Fa=null}else throw Error(O(198));za||(za=!0,cc=u)}}function ts(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 Mg(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 Rf(t){if(ts(t)!==t)throw Error(O(188))}function cb(t){var e=t.alternate;if(!e){if(e=ts(t),e===null)throw Error(O(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 Rf(s),t;if(i===n)return Rf(s),e;i=i.sibling}throw Error(O(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(O(189))}}if(r.alternate!==n)throw Error(O(190))}if(r.tag!==3)throw Error(O(188));return r.stateNode.current===r?t:e}function Ug(t){return t=cb(t),t!==null?Fg(t):null}function Fg(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=Fg(t);if(e!==null)return e;t=t.sibling}return null}var zg=gt.unstable_scheduleCallback,Of=gt.unstable_cancelCallback,db=gt.unstable_shouldYield,hb=gt.unstable_requestPaint,be=gt.unstable_now,fb=gt.unstable_getCurrentPriorityLevel,Vd=gt.unstable_ImmediatePriority,Bg=gt.unstable_UserBlockingPriority,Ba=gt.unstable_NormalPriority,pb=gt.unstable_LowPriority,Vg=gt.unstable_IdlePriority,Sl=null,tr=null;function mb(t){if(tr&&typeof tr.onCommitFiberRoot=="function")try{tr.onCommitFiberRoot(Sl,t,void 0,(t.current.flags&128)===128)}catch{}}var Bt=Math.clz32?Math.clz32:yb,gb=Math.log,vb=Math.LN2;function yb(t){return t>>>=0,t===0?32:31-(gb(t)/vb|0)|0}var Jo=64,Yo=4194304;function Li(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 Va(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=Li(a):(i&=o,i!==0&&(n=Li(i)))}else o=r&~s,o!==0?n=Li(o):i!==0&&(n=Li(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-Bt(e),s=1<<r,n|=t[r],e&=~s;return n}function wb(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function _b(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,s=t.expirationTimes,i=t.pendingLanes;0<i;){var o=31-Bt(i),a=1<<o,l=s[o];l===-1?(!(a&r)||a&n)&&(s[o]=wb(a,e)):l<=e&&(t.expiredLanes|=a),i&=~a}}function dc(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Wg(){var t=Jo;return Jo<<=1,!(Jo&4194240)&&(Jo=64),t}function uu(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function Ao(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Bt(e),t[e]=r}function bb(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-Bt(r),i=1<<s;e[s]=0,n[s]=-1,t[s]=-1,r&=~i}}function Wd(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var n=31-Bt(r),s=1<<n;s&e|t[n]&e&&(t[n]|=e),r&=~s}}var oe=0;function Hg(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var qg,Hd,Kg,Qg,Gg,hc=!1,Xo=[],en=null,tn=null,rn=null,to=new Map,ro=new Map,Fr=[],xb="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 Af(t,e){switch(t){case"focusin":case"focusout":en=null;break;case"dragenter":case"dragleave":tn=null;break;case"mouseover":case"mouseout":rn=null;break;case"pointerover":case"pointerout":to.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":ro.delete(e.pointerId)}}function Si(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&&Hd(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,s!==null&&e.indexOf(s)===-1&&e.push(s),t)}function Eb(t,e,r,n,s){switch(e){case"focusin":return en=Si(en,t,e,r,n,s),!0;case"dragenter":return tn=Si(tn,t,e,r,n,s),!0;case"mouseover":return rn=Si(rn,t,e,r,n,s),!0;case"pointerover":var i=s.pointerId;return to.set(i,Si(to.get(i)||null,t,e,r,n,s)),!0;case"gotpointercapture":return i=s.pointerId,ro.set(i,Si(ro.get(i)||null,t,e,r,n,s)),!0}return!1}function Jg(t){var e=jn(t.target);if(e!==null){var r=ts(e);if(r!==null){if(e=r.tag,e===13){if(e=Mg(r),e!==null){t.blockedOn=e,Gg(t.priority,function(){Kg(r)});return}}else if(e===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Ca(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=fc(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(r===null){r=t.nativeEvent;var n=new r.constructor(r.type,r);ac=n,r.target.dispatchEvent(n),ac=null}else return e=Io(r),e!==null&&Hd(e),t.blockedOn=r,!1;e.shift()}return!0}function jf(t,e,r){Ca(t)&&r.delete(e)}function Sb(){hc=!1,en!==null&&Ca(en)&&(en=null),tn!==null&&Ca(tn)&&(tn=null),rn!==null&&Ca(rn)&&(rn=null),to.forEach(jf),ro.forEach(jf)}function ki(t,e){t.blockedOn===e&&(t.blockedOn=null,hc||(hc=!0,gt.unstable_scheduleCallback(gt.unstable_NormalPriority,Sb)))}function no(t){function e(s){return ki(s,t)}if(0<Xo.length){ki(Xo[0],t);for(var r=1;r<Xo.length;r++){var n=Xo[r];n.blockedOn===t&&(n.blockedOn=null)}}for(en!==null&&ki(en,t),tn!==null&&ki(tn,t),rn!==null&&ki(rn,t),to.forEach(e),ro.forEach(e),r=0;r<Fr.length;r++)n=Fr[r],n.blockedOn===t&&(n.blockedOn=null);for(;0<Fr.length&&(r=Fr[0],r.blockedOn===null);)Jg(r),r.blockedOn===null&&Fr.shift()}var Ns=kr.ReactCurrentBatchConfig,Wa=!0;function kb(t,e,r,n){var s=oe,i=Ns.transition;Ns.transition=null;try{oe=1,qd(t,e,r,n)}finally{oe=s,Ns.transition=i}}function Cb(t,e,r,n){var s=oe,i=Ns.transition;Ns.transition=null;try{oe=4,qd(t,e,r,n)}finally{oe=s,Ns.transition=i}}function qd(t,e,r,n){if(Wa){var s=fc(t,e,r,n);if(s===null)wu(t,e,n,Ha,r),Af(t,n);else if(Eb(s,t,e,r,n))n.stopPropagation();else if(Af(t,n),e&4&&-1<xb.indexOf(t)){for(;s!==null;){var i=Io(s);if(i!==null&&qg(i),i=fc(t,e,r,n),i===null&&wu(t,e,n,Ha,r),i===s)break;s=i}s!==null&&n.stopPropagation()}else wu(t,e,n,null,r)}}var Ha=null;function fc(t,e,r,n){if(Ha=null,t=Bd(n),t=jn(t),t!==null)if(e=ts(t),e===null)t=null;else if(r=e.tag,r===13){if(t=Mg(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 Yg(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(fb()){case Vd:return 1;case Bg:return 4;case Ba:case pb:return 16;case Vg:return 536870912;default:return 16}default:return 16}}var Yr=null,Kd=null,Ta=null;function Xg(){if(Ta)return Ta;var t,e=Kd,r=e.length,n,s="value"in Yr?Yr.value:Yr.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 Ta=s.slice(t,1<n?1-n:void 0)}function Pa(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 If(){return!1}function yt(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:If,this.isPropagationStopped=If,this}return ye(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 ui={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qd=yt(ui),jo=ye({},ui,{view:0,detail:0}),Tb=yt(jo),cu,du,Ci,kl=ye({},jo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gd,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!==Ci&&(Ci&&t.type==="mousemove"?(cu=t.screenX-Ci.screenX,du=t.screenY-Ci.screenY):du=cu=0,Ci=t),cu)},movementY:function(t){return"movementY"in t?t.movementY:du}}),Nf=yt(kl),Pb=ye({},kl,{dataTransfer:0}),Rb=yt(Pb),Ob=ye({},jo,{relatedTarget:0}),hu=yt(Ob),Ab=ye({},ui,{animationName:0,elapsedTime:0,pseudoElement:0}),jb=yt(Ab),Ib=ye({},ui,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Nb=yt(Ib),Lb=ye({},ui,{data:0}),Lf=yt(Lb),$b={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Db={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"},Mb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ub(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=Mb[t])?!!e[t]:!1}function Gd(){return Ub}var Fb=ye({},jo,{key:function(t){if(t.key){var e=$b[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Pa(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Db[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gd,charCode:function(t){return t.type==="keypress"?Pa(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Pa(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),zb=yt(Fb),Bb=ye({},kl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$f=yt(Bb),Vb=ye({},jo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gd}),Wb=yt(Vb),Hb=ye({},ui,{propertyName:0,elapsedTime:0,pseudoElement:0}),qb=yt(Hb),Kb=ye({},kl,{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}),Qb=yt(Kb),Gb=[9,13,27,32],Jd=yr&&"CompositionEvent"in window,zi=null;yr&&"documentMode"in document&&(zi=document.documentMode);var Jb=yr&&"TextEvent"in window&&!zi,Zg=yr&&(!Jd||zi&&8<zi&&11>=zi),Df=" ",Mf=!1;function ev(t,e){switch(t){case"keyup":return Gb.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tv(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var _s=!1;function Yb(t,e){switch(t){case"compositionend":return tv(e);case"keypress":return e.which!==32?null:(Mf=!0,Df);case"textInput":return t=e.data,t===Df&&Mf?null:t;default:return null}}function Xb(t,e){if(_s)return t==="compositionend"||!Jd&&ev(t,e)?(t=Xg(),Ta=Kd=Yr=null,_s=!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 Zg&&e.locale!=="ko"?null:e.data;default:return null}}var Zb={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 Uf(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!Zb[t.type]:e==="textarea"}function rv(t,e,r,n){Ig(n),e=qa(e,"onChange"),0<e.length&&(r=new Qd("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var Bi=null,so=null;function ex(t){fv(t,0)}function Cl(t){var e=Es(t);if(Cg(e))return t}function tx(t,e){if(t==="change")return e}var nv=!1;if(yr){var fu;if(yr){var pu="oninput"in document;if(!pu){var Ff=document.createElement("div");Ff.setAttribute("oninput","return;"),pu=typeof Ff.oninput=="function"}fu=pu}else fu=!1;nv=fu&&(!document.documentMode||9<document.documentMode)}function zf(){Bi&&(Bi.detachEvent("onpropertychange",sv),so=Bi=null)}function sv(t){if(t.propertyName==="value"&&Cl(so)){var e=[];rv(e,so,t,Bd(t)),Dg(ex,e)}}function rx(t,e,r){t==="focusin"?(zf(),Bi=e,so=r,Bi.attachEvent("onpropertychange",sv)):t==="focusout"&&zf()}function nx(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Cl(so)}function sx(t,e){if(t==="click")return Cl(e)}function ix(t,e){if(t==="input"||t==="change")return Cl(e)}function ox(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Wt=typeof Object.is=="function"?Object.is:ox;function io(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(!Gu.call(e,s)||!Wt(t[s],e[s]))return!1}return!0}function Bf(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Vf(t,e){var r=Bf(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=Bf(r)}}function iv(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?iv(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function ov(){for(var t=window,e=Ua();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=Ua(t.document)}return e}function Yd(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 ax(t){var e=ov(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&iv(r.ownerDocument.documentElement,r)){if(n!==null&&Yd(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=Vf(r,i);var o=Vf(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 lx=yr&&"documentMode"in document&&11>=document.documentMode,bs=null,pc=null,Vi=null,mc=!1;function Wf(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;mc||bs==null||bs!==Ua(n)||(n=bs,"selectionStart"in n&&Yd(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}),Vi&&io(Vi,n)||(Vi=n,n=qa(pc,"onSelect"),0<n.length&&(e=new Qd("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=bs)))}function ea(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var xs={animationend:ea("Animation","AnimationEnd"),animationiteration:ea("Animation","AnimationIteration"),animationstart:ea("Animation","AnimationStart"),transitionend:ea("Transition","TransitionEnd")},mu={},av={};yr&&(av=document.createElement("div").style,"AnimationEvent"in window||(delete xs.animationend.animation,delete xs.animationiteration.animation,delete xs.animationstart.animation),"TransitionEvent"in window||delete xs.transitionend.transition);function Tl(t){if(mu[t])return mu[t];if(!xs[t])return t;var e=xs[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in av)return mu[t]=e[r];return t}var lv=Tl("animationend"),uv=Tl("animationiteration"),cv=Tl("animationstart"),dv=Tl("transitionend"),hv=new Map,Hf="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 gn(t,e){hv.set(t,e),es(e,[t])}for(var gu=0;gu<Hf.length;gu++){var vu=Hf[gu],ux=vu.toLowerCase(),cx=vu[0].toUpperCase()+vu.slice(1);gn(ux,"on"+cx)}gn(lv,"onAnimationEnd");gn(uv,"onAnimationIteration");gn(cv,"onAnimationStart");gn("dblclick","onDoubleClick");gn("focusin","onFocus");gn("focusout","onBlur");gn(dv,"onTransitionEnd");Xs("onMouseEnter",["mouseout","mouseover"]);Xs("onMouseLeave",["mouseout","mouseover"]);Xs("onPointerEnter",["pointerout","pointerover"]);Xs("onPointerLeave",["pointerout","pointerover"]);es("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));es("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));es("onBeforeInput",["compositionend","keypress","textInput","paste"]);es("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));es("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));es("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $i="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(" "),dx=new Set("cancel close invalid load scroll toggle".split(" ").concat($i));function qf(t,e,r){var n=t.type||"unknown-event";t.currentTarget=r,ub(n,e,void 0,t),t.currentTarget=null}function fv(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;qf(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;qf(s,a,u),i=l}}}if(za)throw t=cc,za=!1,cc=null,t}function de(t,e){var r=e[_c];r===void 0&&(r=e[_c]=new Set);var n=t+"__bubble";r.has(n)||(pv(e,t,2,!1),r.add(n))}function yu(t,e,r){var n=0;e&&(n|=4),pv(r,t,n,e)}var ta="_reactListening"+Math.random().toString(36).slice(2);function oo(t){if(!t[ta]){t[ta]=!0,bg.forEach(function(r){r!=="selectionchange"&&(dx.has(r)||yu(r,!1,t),yu(r,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[ta]||(e[ta]=!0,yu("selectionchange",!1,e))}}function pv(t,e,r,n){switch(Yg(e)){case 1:var s=kb;break;case 4:s=Cb;break;default:s=qd}r=s.bind(null,e,r,t),s=void 0,!uc||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 wu(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=jn(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=Bd(r),d=[];e:{var f=hv.get(t);if(f!==void 0){var h=Qd,_=t;switch(t){case"keypress":if(Pa(r)===0)break e;case"keydown":case"keyup":h=zb;break;case"focusin":_="focus",h=hu;break;case"focusout":_="blur",h=hu;break;case"beforeblur":case"afterblur":h=hu;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=Nf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=Rb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=Wb;break;case lv:case uv:case cv:h=jb;break;case dv:h=qb;break;case"scroll":h=Tb;break;case"wheel":h=Qb;break;case"copy":case"cut":case"paste":h=Nb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=$f}var y=(e&4)!==0,v=!y&&t==="scroll",g=y?f!==null?f+"Capture":null:f;y=[];for(var p=u,m;p!==null;){m=p;var b=m.stateNode;if(m.tag===5&&b!==null&&(m=b,g!==null&&(b=eo(p,g),b!=null&&y.push(ao(p,b,m)))),v)break;p=p.return}0<y.length&&(f=new h(f,_,null,r,c),d.push({event:f,listeners:y}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",h=t==="mouseout"||t==="pointerout",f&&r!==ac&&(_=r.relatedTarget||r.fromElement)&&(jn(_)||_[wr]))break e;if((h||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,h?(_=r.relatedTarget||r.toElement,h=u,_=_?jn(_):null,_!==null&&(v=ts(_),_!==v||_.tag!==5&&_.tag!==6)&&(_=null)):(h=null,_=u),h!==_)){if(y=Nf,b="onMouseLeave",g="onMouseEnter",p="mouse",(t==="pointerout"||t==="pointerover")&&(y=$f,b="onPointerLeave",g="onPointerEnter",p="pointer"),v=h==null?f:Es(h),m=_==null?f:Es(_),f=new y(b,p+"leave",h,r,c),f.target=v,f.relatedTarget=m,b=null,jn(c)===u&&(y=new y(g,p+"enter",_,r,c),y.target=m,y.relatedTarget=v,b=y),v=b,h&&_)t:{for(y=h,g=_,p=0,m=y;m;m=us(m))p++;for(m=0,b=g;b;b=us(b))m++;for(;0<p-m;)y=us(y),p--;for(;0<m-p;)g=us(g),m--;for(;p--;){if(y===g||g!==null&&y===g.alternate)break t;y=us(y),g=us(g)}y=null}else y=null;h!==null&&Kf(d,f,h,y,!1),_!==null&&v!==null&&Kf(d,v,_,y,!0)}}e:{if(f=u?Es(u):window,h=f.nodeName&&f.nodeName.toLowerCase(),h==="select"||h==="input"&&f.type==="file")var x=tx;else if(Uf(f))if(nv)x=ix;else{x=nx;var k=rx}else(h=f.nodeName)&&h.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(x=sx);if(x&&(x=x(t,u))){rv(d,x,r,c);break e}k&&k(t,f,u),t==="focusout"&&(k=f._wrapperState)&&k.controlled&&f.type==="number"&&rc(f,"number",f.value)}switch(k=u?Es(u):window,t){case"focusin":(Uf(k)||k.contentEditable==="true")&&(bs=k,pc=u,Vi=null);break;case"focusout":Vi=pc=bs=null;break;case"mousedown":mc=!0;break;case"contextmenu":case"mouseup":case"dragend":mc=!1,Wf(d,r,c);break;case"selectionchange":if(lx)break;case"keydown":case"keyup":Wf(d,r,c)}var C;if(Jd)e:{switch(t){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else _s?ev(t,r)&&(T="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(T="onCompositionStart");T&&(Zg&&r.locale!=="ko"&&(_s||T!=="onCompositionStart"?T==="onCompositionEnd"&&_s&&(C=Xg()):(Yr=c,Kd="value"in Yr?Yr.value:Yr.textContent,_s=!0)),k=qa(u,T),0<k.length&&(T=new Lf(T,t,null,r,c),d.push({event:T,listeners:k}),C?T.data=C:(C=tv(r),C!==null&&(T.data=C)))),(C=Jb?Yb(t,r):Xb(t,r))&&(u=qa(u,"onBeforeInput"),0<u.length&&(c=new Lf("onBeforeInput","beforeinput",null,r,c),d.push({event:c,listeners:u}),c.data=C))}fv(d,e)})}function ao(t,e,r){return{instance:t,listener:e,currentTarget:r}}function qa(t,e){for(var r=e+"Capture",n=[];t!==null;){var s=t,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=eo(t,r),i!=null&&n.unshift(ao(t,i,s)),i=eo(t,e),i!=null&&n.push(ao(t,i,s))),t=t.return}return n}function us(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Kf(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=eo(r,i),l!=null&&o.unshift(ao(r,l,a))):s||(l=eo(r,i),l!=null&&o.push(ao(r,l,a)))),r=r.return}o.length!==0&&t.push({event:e,listeners:o})}var hx=/\r\n?/g,fx=/\u0000|\uFFFD/g;function Qf(t){return(typeof t=="string"?t:""+t).replace(hx,`
`).replace(fx,"")}function ra(t,e,r){if(e=Qf(e),Qf(t)!==e&&r)throw Error(O(425))}function Ka(){}var gc=null,vc=null;function yc(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 wc=typeof setTimeout=="function"?setTimeout:void 0,px=typeof clearTimeout=="function"?clearTimeout:void 0,Gf=typeof Promise=="function"?Promise:void 0,mx=typeof queueMicrotask=="function"?queueMicrotask:typeof Gf<"u"?function(t){return Gf.resolve(null).then(t).catch(gx)}:wc;function gx(t){setTimeout(function(){throw t})}function _u(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),no(e);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);no(e)}function nn(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function Jf(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 ci=Math.random().toString(36).slice(2),Zt="__reactFiber$"+ci,lo="__reactProps$"+ci,wr="__reactContainer$"+ci,_c="__reactEvents$"+ci,vx="__reactListeners$"+ci,yx="__reactHandles$"+ci;function jn(t){var e=t[Zt];if(e)return e;for(var r=t.parentNode;r;){if(e=r[wr]||r[Zt]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=Jf(t);t!==null;){if(r=t[Zt])return r;t=Jf(t)}return e}t=r,r=t.parentNode}return null}function Io(t){return t=t[Zt]||t[wr],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Es(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(O(33))}function Pl(t){return t[lo]||null}var bc=[],Ss=-1;function vn(t){return{current:t}}function he(t){0>Ss||(t.current=bc[Ss],bc[Ss]=null,Ss--)}function ue(t,e){Ss++,bc[Ss]=t.current,t.current=e}var hn={},He=vn(hn),st=vn(!1),Kn=hn;function Zs(t,e){var r=t.type.contextTypes;if(!r)return hn;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 it(t){return t=t.childContextTypes,t!=null}function Qa(){he(st),he(He)}function Yf(t,e,r){if(He.current!==hn)throw Error(O(168));ue(He,e),ue(st,r)}function mv(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(O(108,rb(t)||"Unknown",s));return ye({},r,n)}function Ga(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||hn,Kn=He.current,ue(He,t),ue(st,st.current),!0}function Xf(t,e,r){var n=t.stateNode;if(!n)throw Error(O(169));r?(t=mv(t,e,Kn),n.__reactInternalMemoizedMergedChildContext=t,he(st),he(He),ue(He,t)):he(st),ue(st,r)}var fr=null,Rl=!1,bu=!1;function gv(t){fr===null?fr=[t]:fr.push(t)}function wx(t){Rl=!0,gv(t)}function yn(){if(!bu&&fr!==null){bu=!0;var t=0,e=oe;try{var r=fr;for(oe=1;t<r.length;t++){var n=r[t];do n=n(!0);while(n!==null)}fr=null,Rl=!1}catch(s){throw fr!==null&&(fr=fr.slice(t+1)),zg(Vd,yn),s}finally{oe=e,bu=!1}}return null}var ks=[],Cs=0,Ja=null,Ya=0,xt=[],Et=0,Qn=null,mr=1,gr="";function Tn(t,e){ks[Cs++]=Ya,ks[Cs++]=Ja,Ja=t,Ya=e}function vv(t,e,r){xt[Et++]=mr,xt[Et++]=gr,xt[Et++]=Qn,Qn=t;var n=mr;t=gr;var s=32-Bt(n)-1;n&=~(1<<s),r+=1;var i=32-Bt(e)+s;if(30<i){var o=s-s%5;i=(n&(1<<o)-1).toString(32),n>>=o,s-=o,mr=1<<32-Bt(e)+s|r<<s|n,gr=i+t}else mr=1<<i|r<<s|n,gr=t}function Xd(t){t.return!==null&&(Tn(t,1),vv(t,1,0))}function Zd(t){for(;t===Ja;)Ja=ks[--Cs],ks[Cs]=null,Ya=ks[--Cs],ks[Cs]=null;for(;t===Qn;)Qn=xt[--Et],xt[Et]=null,gr=xt[--Et],xt[Et]=null,mr=xt[--Et],xt[Et]=null}var pt=null,ft=null,pe=!1,zt=null;function yv(t,e){var r=St(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 Zf(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,pt=t,ft=nn(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,pt=t,ft=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(r=Qn!==null?{id:mr,overflow:gr}:null,t.memoizedState={dehydrated:e,treeContext:r,retryLane:1073741824},r=St(18,null,null,0),r.stateNode=e,r.return=t,t.child=r,pt=t,ft=null,!0):!1;default:return!1}}function xc(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Ec(t){if(pe){var e=ft;if(e){var r=e;if(!Zf(t,e)){if(xc(t))throw Error(O(418));e=nn(r.nextSibling);var n=pt;e&&Zf(t,e)?yv(n,r):(t.flags=t.flags&-4097|2,pe=!1,pt=t)}}else{if(xc(t))throw Error(O(418));t.flags=t.flags&-4097|2,pe=!1,pt=t}}}function ep(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;pt=t}function na(t){if(t!==pt)return!1;if(!pe)return ep(t),pe=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!yc(t.type,t.memoizedProps)),e&&(e=ft)){if(xc(t))throw wv(),Error(O(418));for(;e;)yv(t,e),e=nn(e.nextSibling)}if(ep(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(O(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"){if(e===0){ft=nn(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++}t=t.nextSibling}ft=null}}else ft=pt?nn(t.stateNode.nextSibling):null;return!0}function wv(){for(var t=ft;t;)t=nn(t.nextSibling)}function ei(){ft=pt=null,pe=!1}function eh(t){zt===null?zt=[t]:zt.push(t)}var _x=kr.ReactCurrentBatchConfig;function Ti(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(O(309));var n=r.stateNode}if(!n)throw Error(O(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(O(284));if(!r._owner)throw Error(O(290,t))}return t}function sa(t,e){throw t=Object.prototype.toString.call(e),Error(O(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function tp(t){var e=t._init;return e(t._payload)}function _v(t){function e(g,p){if(t){var m=g.deletions;m===null?(g.deletions=[p],g.flags|=16):m.push(p)}}function r(g,p){if(!t)return null;for(;p!==null;)e(g,p),p=p.sibling;return null}function n(g,p){for(g=new Map;p!==null;)p.key!==null?g.set(p.key,p):g.set(p.index,p),p=p.sibling;return g}function s(g,p){return g=ln(g,p),g.index=0,g.sibling=null,g}function i(g,p,m){return g.index=m,t?(m=g.alternate,m!==null?(m=m.index,m<p?(g.flags|=2,p):m):(g.flags|=2,p)):(g.flags|=1048576,p)}function o(g){return t&&g.alternate===null&&(g.flags|=2),g}function a(g,p,m,b){return p===null||p.tag!==6?(p=Pu(m,g.mode,b),p.return=g,p):(p=s(p,m),p.return=g,p)}function l(g,p,m,b){var x=m.type;return x===ws?c(g,p,m.props.children,b,m.key):p!==null&&(p.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Mr&&tp(x)===p.type)?(b=s(p,m.props),b.ref=Ti(g,p,m),b.return=g,b):(b=La(m.type,m.key,m.props,null,g.mode,b),b.ref=Ti(g,p,m),b.return=g,b)}function u(g,p,m,b){return p===null||p.tag!==4||p.stateNode.containerInfo!==m.containerInfo||p.stateNode.implementation!==m.implementation?(p=Ru(m,g.mode,b),p.return=g,p):(p=s(p,m.children||[]),p.return=g,p)}function c(g,p,m,b,x){return p===null||p.tag!==7?(p=qn(m,g.mode,b,x),p.return=g,p):(p=s(p,m),p.return=g,p)}function d(g,p,m){if(typeof p=="string"&&p!==""||typeof p=="number")return p=Pu(""+p,g.mode,m),p.return=g,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Ko:return m=La(p.type,p.key,p.props,null,g.mode,m),m.ref=Ti(g,null,p),m.return=g,m;case ys:return p=Ru(p,g.mode,m),p.return=g,p;case Mr:var b=p._init;return d(g,b(p._payload),m)}if(Ni(p)||xi(p))return p=qn(p,g.mode,m,null),p.return=g,p;sa(g,p)}return null}function f(g,p,m,b){var x=p!==null?p.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return x!==null?null:a(g,p,""+m,b);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Ko:return m.key===x?l(g,p,m,b):null;case ys:return m.key===x?u(g,p,m,b):null;case Mr:return x=m._init,f(g,p,x(m._payload),b)}if(Ni(m)||xi(m))return x!==null?null:c(g,p,m,b,null);sa(g,m)}return null}function h(g,p,m,b,x){if(typeof b=="string"&&b!==""||typeof b=="number")return g=g.get(m)||null,a(p,g,""+b,x);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Ko:return g=g.get(b.key===null?m:b.key)||null,l(p,g,b,x);case ys:return g=g.get(b.key===null?m:b.key)||null,u(p,g,b,x);case Mr:var k=b._init;return h(g,p,m,k(b._payload),x)}if(Ni(b)||xi(b))return g=g.get(m)||null,c(p,g,b,x,null);sa(p,b)}return null}function _(g,p,m,b){for(var x=null,k=null,C=p,T=p=0,j=null;C!==null&&T<m.length;T++){C.index>T?(j=C,C=null):j=C.sibling;var A=f(g,C,m[T],b);if(A===null){C===null&&(C=j);break}t&&C&&A.alternate===null&&e(g,C),p=i(A,p,T),k===null?x=A:k.sibling=A,k=A,C=j}if(T===m.length)return r(g,C),pe&&Tn(g,T),x;if(C===null){for(;T<m.length;T++)C=d(g,m[T],b),C!==null&&(p=i(C,p,T),k===null?x=C:k.sibling=C,k=C);return pe&&Tn(g,T),x}for(C=n(g,C);T<m.length;T++)j=h(C,g,T,m[T],b),j!==null&&(t&&j.alternate!==null&&C.delete(j.key===null?T:j.key),p=i(j,p,T),k===null?x=j:k.sibling=j,k=j);return t&&C.forEach(function(B){return e(g,B)}),pe&&Tn(g,T),x}function y(g,p,m,b){var x=xi(m);if(typeof x!="function")throw Error(O(150));if(m=x.call(m),m==null)throw Error(O(151));for(var k=x=null,C=p,T=p=0,j=null,A=m.next();C!==null&&!A.done;T++,A=m.next()){C.index>T?(j=C,C=null):j=C.sibling;var B=f(g,C,A.value,b);if(B===null){C===null&&(C=j);break}t&&C&&B.alternate===null&&e(g,C),p=i(B,p,T),k===null?x=B:k.sibling=B,k=B,C=j}if(A.done)return r(g,C),pe&&Tn(g,T),x;if(C===null){for(;!A.done;T++,A=m.next())A=d(g,A.value,b),A!==null&&(p=i(A,p,T),k===null?x=A:k.sibling=A,k=A);return pe&&Tn(g,T),x}for(C=n(g,C);!A.done;T++,A=m.next())A=h(C,g,T,A.value,b),A!==null&&(t&&A.alternate!==null&&C.delete(A.key===null?T:A.key),p=i(A,p,T),k===null?x=A:k.sibling=A,k=A);return t&&C.forEach(function(L){return e(g,L)}),pe&&Tn(g,T),x}function v(g,p,m,b){if(typeof m=="object"&&m!==null&&m.type===ws&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Ko:e:{for(var x=m.key,k=p;k!==null;){if(k.key===x){if(x=m.type,x===ws){if(k.tag===7){r(g,k.sibling),p=s(k,m.props.children),p.return=g,g=p;break e}}else if(k.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===Mr&&tp(x)===k.type){r(g,k.sibling),p=s(k,m.props),p.ref=Ti(g,k,m),p.return=g,g=p;break e}r(g,k);break}else e(g,k);k=k.sibling}m.type===ws?(p=qn(m.props.children,g.mode,b,m.key),p.return=g,g=p):(b=La(m.type,m.key,m.props,null,g.mode,b),b.ref=Ti(g,p,m),b.return=g,g=b)}return o(g);case ys:e:{for(k=m.key;p!==null;){if(p.key===k)if(p.tag===4&&p.stateNode.containerInfo===m.containerInfo&&p.stateNode.implementation===m.implementation){r(g,p.sibling),p=s(p,m.children||[]),p.return=g,g=p;break e}else{r(g,p);break}else e(g,p);p=p.sibling}p=Ru(m,g.mode,b),p.return=g,g=p}return o(g);case Mr:return k=m._init,v(g,p,k(m._payload),b)}if(Ni(m))return _(g,p,m,b);if(xi(m))return y(g,p,m,b);sa(g,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,p!==null&&p.tag===6?(r(g,p.sibling),p=s(p,m),p.return=g,g=p):(r(g,p),p=Pu(m,g.mode,b),p.return=g,g=p),o(g)):r(g,p)}return v}var ti=_v(!0),bv=_v(!1),Xa=vn(null),Za=null,Ts=null,th=null;function rh(){th=Ts=Za=null}function nh(t){var e=Xa.current;he(Xa),t._currentValue=e}function Sc(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 Ls(t,e){Za=t,th=Ts=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(nt=!0),t.firstContext=null)}function Ct(t){var e=t._currentValue;if(th!==t)if(t={context:t,memoizedValue:e,next:null},Ts===null){if(Za===null)throw Error(O(308));Ts=t,Za.dependencies={lanes:0,firstContext:t}}else Ts=Ts.next=t;return e}var In=null;function sh(t){In===null?In=[t]:In.push(t)}function xv(t,e,r,n){var s=e.interleaved;return s===null?(r.next=r,sh(e)):(r.next=s.next,s.next=r),e.interleaved=r,_r(t,n)}function _r(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 Ur=!1;function ih(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ev(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 vr(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function sn(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,ne&2){var s=n.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),n.pending=e,_r(t,r)}return s=n.interleaved,s===null?(e.next=e,sh(n)):(e.next=s.next,s.next=e),n.interleaved=e,_r(t,r)}function Ra(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,Wd(t,r)}}function rp(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 el(t,e,r,n){var s=t.updateQueue;Ur=!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 _=t,y=a;switch(f=e,h=r,y.tag){case 1:if(_=y.payload,typeof _=="function"){d=_.call(h,d,f);break e}d=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=y.payload,f=typeof _=="function"?_.call(h,d,f):_,f==null)break e;d=ye({},d,f);break e;case 2:Ur=!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 np(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(O(191,s));s.call(n)}}}var No={},rr=vn(No),uo=vn(No),co=vn(No);function Nn(t){if(t===No)throw Error(O(174));return t}function oh(t,e){switch(ue(co,e),ue(uo,t),ue(rr,No),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:sc(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=sc(e,t)}he(rr),ue(rr,e)}function ri(){he(rr),he(uo),he(co)}function Sv(t){Nn(co.current);var e=Nn(rr.current),r=sc(e,t.type);e!==r&&(ue(uo,t),ue(rr,r))}function ah(t){uo.current===t&&(he(rr),he(uo))}var ge=vn(0);function tl(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 xu=[];function lh(){for(var t=0;t<xu.length;t++)xu[t]._workInProgressVersionPrimary=null;xu.length=0}var Oa=kr.ReactCurrentDispatcher,Eu=kr.ReactCurrentBatchConfig,Gn=0,ve=null,Re=null,Ie=null,rl=!1,Wi=!1,ho=0,bx=0;function Fe(){throw Error(O(321))}function uh(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 ch(t,e,r,n,s,i){if(Gn=i,ve=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Oa.current=t===null||t.memoizedState===null?kx:Cx,t=r(n,s),Wi){i=0;do{if(Wi=!1,ho=0,25<=i)throw Error(O(301));i+=1,Ie=Re=null,e.updateQueue=null,Oa.current=Tx,t=r(n,s)}while(Wi)}if(Oa.current=nl,e=Re!==null&&Re.next!==null,Gn=0,Ie=Re=ve=null,rl=!1,e)throw Error(O(300));return t}function dh(){var t=ho!==0;return ho=0,t}function Gt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ie===null?ve.memoizedState=Ie=t:Ie=Ie.next=t,Ie}function Tt(){if(Re===null){var t=ve.alternate;t=t!==null?t.memoizedState:null}else t=Re.next;var e=Ie===null?ve.memoizedState:Ie.next;if(e!==null)Ie=e,Re=t;else{if(t===null)throw Error(O(310));Re=t,t={memoizedState:Re.memoizedState,baseState:Re.baseState,baseQueue:Re.baseQueue,queue:Re.queue,next:null},Ie===null?ve.memoizedState=Ie=t:Ie=Ie.next=t}return Ie}function fo(t,e){return typeof e=="function"?e(t):e}function Su(t){var e=Tt(),r=e.queue;if(r===null)throw Error(O(311));r.lastRenderedReducer=t;var n=Re,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,ve.lanes|=c,Jn|=c}u=u.next}while(u!==null&&u!==i);l===null?o=n:l.next=a,Wt(n,e.memoizedState)||(nt=!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,ve.lanes|=i,Jn|=i,s=s.next;while(s!==t)}else s===null&&(r.lanes=0);return[e.memoizedState,r.dispatch]}function ku(t){var e=Tt(),r=e.queue;if(r===null)throw Error(O(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)||(nt=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),r.lastRenderedState=i}return[i,n]}function kv(){}function Cv(t,e){var r=ve,n=Tt(),s=e(),i=!Wt(n.memoizedState,s);if(i&&(n.memoizedState=s,nt=!0),n=n.queue,hh(Rv.bind(null,r,n,t),[t]),n.getSnapshot!==e||i||Ie!==null&&Ie.memoizedState.tag&1){if(r.flags|=2048,po(9,Pv.bind(null,r,n,s,e),void 0,null),Ne===null)throw Error(O(349));Gn&30||Tv(r,e,s)}return s}function Tv(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},e=ve.updateQueue,e===null?(e={lastEffect:null,stores:null},ve.updateQueue=e,e.stores=[t]):(r=e.stores,r===null?e.stores=[t]:r.push(t))}function Pv(t,e,r,n){e.value=r,e.getSnapshot=n,Ov(e)&&Av(t)}function Rv(t,e,r){return r(function(){Ov(e)&&Av(t)})}function Ov(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!Wt(t,r)}catch{return!0}}function Av(t){var e=_r(t,1);e!==null&&Vt(e,t,1,-1)}function sp(t){var e=Gt();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:fo,lastRenderedState:t},e.queue=t,t=t.dispatch=Sx.bind(null,ve,t),[e.memoizedState,t]}function po(t,e,r,n){return t={tag:t,create:e,destroy:r,deps:n,next:null},e=ve.updateQueue,e===null?(e={lastEffect:null,stores:null},ve.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 jv(){return Tt().memoizedState}function Aa(t,e,r,n){var s=Gt();ve.flags|=t,s.memoizedState=po(1|e,r,void 0,n===void 0?null:n)}function Ol(t,e,r,n){var s=Tt();n=n===void 0?null:n;var i=void 0;if(Re!==null){var o=Re.memoizedState;if(i=o.destroy,n!==null&&uh(n,o.deps)){s.memoizedState=po(e,r,i,n);return}}ve.flags|=t,s.memoizedState=po(1|e,r,i,n)}function ip(t,e){return Aa(8390656,8,t,e)}function hh(t,e){return Ol(2048,8,t,e)}function Iv(t,e){return Ol(4,2,t,e)}function Nv(t,e){return Ol(4,4,t,e)}function Lv(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 $v(t,e,r){return r=r!=null?r.concat([t]):null,Ol(4,4,Lv.bind(null,e,t),r)}function fh(){}function Dv(t,e){var r=Tt();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&uh(e,n[1])?n[0]:(r.memoizedState=[t,e],t)}function Mv(t,e){var r=Tt();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&uh(e,n[1])?n[0]:(t=t(),r.memoizedState=[t,e],t)}function Uv(t,e,r){return Gn&21?(Wt(r,e)||(r=Wg(),ve.lanes|=r,Jn|=r,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,nt=!0),t.memoizedState=r)}function xx(t,e){var r=oe;oe=r!==0&&4>r?r:4,t(!0);var n=Eu.transition;Eu.transition={};try{t(!1),e()}finally{oe=r,Eu.transition=n}}function Fv(){return Tt().memoizedState}function Ex(t,e,r){var n=an(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},zv(t))Bv(e,r);else if(r=xv(t,e,r,n),r!==null){var s=Je();Vt(r,t,n,s),Vv(r,e,n)}}function Sx(t,e,r){var n=an(t),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(zv(t))Bv(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,sh(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}r=xv(t,e,s,n),r!==null&&(s=Je(),Vt(r,t,n,s),Vv(r,e,n))}}function zv(t){var e=t.alternate;return t===ve||e!==null&&e===ve}function Bv(t,e){Wi=rl=!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,Wd(t,r)}}var nl={readContext:Ct,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useInsertionEffect:Fe,useLayoutEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useMutableSource:Fe,useSyncExternalStore:Fe,useId:Fe,unstable_isNewReconciler:!1},kx={readContext:Ct,useCallback:function(t,e){return Gt().memoizedState=[t,e===void 0?null:e],t},useContext:Ct,useEffect:ip,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,Aa(4194308,4,Lv.bind(null,e,t),r)},useLayoutEffect:function(t,e){return Aa(4194308,4,t,e)},useInsertionEffect:function(t,e){return Aa(4,2,t,e)},useMemo:function(t,e){var r=Gt();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Gt();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=Ex.bind(null,ve,t),[n.memoizedState,t]},useRef:function(t){var e=Gt();return t={current:t},e.memoizedState=t},useState:sp,useDebugValue:fh,useDeferredValue:function(t){return Gt().memoizedState=t},useTransition:function(){var t=sp(!1),e=t[0];return t=xx.bind(null,t[1]),Gt().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=ve,s=Gt();if(pe){if(r===void 0)throw Error(O(407));r=r()}else{if(r=e(),Ne===null)throw Error(O(349));Gn&30||Tv(n,e,r)}s.memoizedState=r;var i={value:r,getSnapshot:e};return s.queue=i,ip(Rv.bind(null,n,i,t),[t]),n.flags|=2048,po(9,Pv.bind(null,n,i,r,e),void 0,null),r},useId:function(){var t=Gt(),e=Ne.identifierPrefix;if(pe){var r=gr,n=mr;r=(n&~(1<<32-Bt(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=ho++,0<r&&(e+="H"+r.toString(32)),e+=":"}else r=bx++,e=":"+e+"r"+r.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},Cx={readContext:Ct,useCallback:Dv,useContext:Ct,useEffect:hh,useImperativeHandle:$v,useInsertionEffect:Iv,useLayoutEffect:Nv,useMemo:Mv,useReducer:Su,useRef:jv,useState:function(){return Su(fo)},useDebugValue:fh,useDeferredValue:function(t){var e=Tt();return Uv(e,Re.memoizedState,t)},useTransition:function(){var t=Su(fo)[0],e=Tt().memoizedState;return[t,e]},useMutableSource:kv,useSyncExternalStore:Cv,useId:Fv,unstable_isNewReconciler:!1},Tx={readContext:Ct,useCallback:Dv,useContext:Ct,useEffect:hh,useImperativeHandle:$v,useInsertionEffect:Iv,useLayoutEffect:Nv,useMemo:Mv,useReducer:ku,useRef:jv,useState:function(){return ku(fo)},useDebugValue:fh,useDeferredValue:function(t){var e=Tt();return Re===null?e.memoizedState=t:Uv(e,Re.memoizedState,t)},useTransition:function(){var t=ku(fo)[0],e=Tt().memoizedState;return[t,e]},useMutableSource:kv,useSyncExternalStore:Cv,useId:Fv,unstable_isNewReconciler:!1};function Lt(t,e){if(t&&t.defaultProps){e=ye({},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:ye({},e,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var Al={isMounted:function(t){return(t=t._reactInternals)?ts(t)===t:!1},enqueueSetState:function(t,e,r){t=t._reactInternals;var n=Je(),s=an(t),i=vr(n,s);i.payload=e,r!=null&&(i.callback=r),e=sn(t,i,s),e!==null&&(Vt(e,t,s,n),Ra(e,t,s))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=Je(),s=an(t),i=vr(n,s);i.tag=1,i.payload=e,r!=null&&(i.callback=r),e=sn(t,i,s),e!==null&&(Vt(e,t,s,n),Ra(e,t,s))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=Je(),n=an(t),s=vr(r,n);s.tag=2,e!=null&&(s.callback=e),e=sn(t,s,n),e!==null&&(Vt(e,t,n,r),Ra(e,t,n))}};function op(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?!io(r,n)||!io(s,i):!0}function Wv(t,e,r){var n=!1,s=hn,i=e.contextType;return typeof i=="object"&&i!==null?i=Ct(i):(s=it(e)?Kn:He.current,n=e.contextTypes,i=(n=n!=null)?Zs(t,s):hn),e=new e(r,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Al,t.stateNode=e,e._reactInternals=t,n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=i),e}function ap(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&&Al.enqueueReplaceState(e,e.state,null)}function Cc(t,e,r,n){var s=t.stateNode;s.props=r,s.state=t.memoizedState,s.refs={},ih(t);var i=e.contextType;typeof i=="object"&&i!==null?s.context=Ct(i):(i=it(e)?Kn:He.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&&Al.enqueueReplaceState(s,s.state,null),el(t,r,s,n),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308)}function ni(t,e){try{var r="",n=e;do r+=tb(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 Cu(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function Tc(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var Px=typeof WeakMap=="function"?WeakMap:Map;function Hv(t,e,r){r=vr(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){il||(il=!0,Dc=n),Tc(t,e)},r}function qv(t,e,r){r=vr(-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(){Tc(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){Tc(t,e),typeof n!="function"&&(on===null?on=new Set([this]):on.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function lp(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new Px;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=Bx.bind(null,t,e,r),e.then(t,t))}function up(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 cp(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=vr(-1,1),e.tag=2,sn(r,e,1))),r.lanes|=1),t)}var Rx=kr.ReactCurrentOwner,nt=!1;function Qe(t,e,r,n){e.child=t===null?bv(e,null,r,n):ti(e,t.child,r,n)}function dp(t,e,r,n,s){r=r.render;var i=e.ref;return Ls(e,s),n=ch(t,e,r,n,i,s),r=dh(),t!==null&&!nt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,br(t,e,s)):(pe&&r&&Xd(e),e.flags|=1,Qe(t,e,n,s),e.child)}function hp(t,e,r,n,s){if(t===null){var i=r.type;return typeof i=="function"&&!bh(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=i,Kv(t,e,i,n,s)):(t=La(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:io,r(o,n)&&t.ref===e.ref)return br(t,e,s)}return e.flags|=1,t=ln(i,n),t.ref=e.ref,t.return=e,e.child=t}function Kv(t,e,r,n,s){if(t!==null){var i=t.memoizedProps;if(io(i,n)&&t.ref===e.ref)if(nt=!1,e.pendingProps=n=i,(t.lanes&s)!==0)t.flags&131072&&(nt=!0);else return e.lanes=t.lanes,br(t,e,s)}return Pc(t,e,r,n,s)}function Qv(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},ue(Rs,ut),ut|=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,ue(Rs,ut),ut|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,ue(Rs,ut),ut|=n}else i!==null?(n=i.baseLanes|r,e.memoizedState=null):n=r,ue(Rs,ut),ut|=n;return Qe(t,e,s,r),e.child}function Gv(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function Pc(t,e,r,n,s){var i=it(r)?Kn:He.current;return i=Zs(e,i),Ls(e,s),r=ch(t,e,r,n,i,s),n=dh(),t!==null&&!nt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,br(t,e,s)):(pe&&n&&Xd(e),e.flags|=1,Qe(t,e,r,s),e.child)}function fp(t,e,r,n,s){if(it(r)){var i=!0;Ga(e)}else i=!1;if(Ls(e,s),e.stateNode===null)ja(t,e),Wv(e,r,n),Cc(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=it(r)?Kn:He.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)&&ap(e,o,n,u),Ur=!1;var f=e.memoizedState;o.state=f,el(e,n,o,s),l=e.memoizedState,a!==n||f!==l||st.current||Ur?(typeof c=="function"&&(kc(e,r,c,n),l=e.memoizedState),(a=Ur||op(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,Ev(t,e),a=e.memoizedProps,u=e.type===e.elementType?a:Lt(e.type,a),o.props=u,d=e.pendingProps,f=o.context,l=r.contextType,typeof l=="object"&&l!==null?l=Ct(l):(l=it(r)?Kn:He.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)&&ap(e,o,n,l),Ur=!1,f=e.memoizedState,o.state=f,el(e,n,o,s);var _=e.memoizedState;a!==d||f!==_||st.current||Ur?(typeof h=="function"&&(kc(e,r,h,n),_=e.memoizedState),(u=Ur||op(e,r,u,n,f,_,l)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,_,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,_,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=_),o.props=n,o.state=_,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 Rc(t,e,r,n,i,s)}function Rc(t,e,r,n,s,i){Gv(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return s&&Xf(e,r,!1),br(t,e,i);n=e.stateNode,Rx.current=e;var a=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=ti(e,t.child,null,i),e.child=ti(e,null,a,i)):Qe(t,e,a,i),e.memoizedState=n.state,s&&Xf(e,r,!0),e.child}function Jv(t){var e=t.stateNode;e.pendingContext?Yf(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Yf(t,e.context,!1),oh(t,e.containerInfo)}function pp(t,e,r,n,s){return ei(),eh(s),e.flags|=256,Qe(t,e,r,n),e.child}var Oc={dehydrated:null,treeContext:null,retryLane:0};function Ac(t){return{baseLanes:t,cachePool:null,transitions:null}}function Yv(t,e,r){var n=e.pendingProps,s=ge.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),ue(ge,s&1),t===null)return Ec(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=Nl(o,n,0,null),t=qn(t,n,r,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=Ac(r),e.memoizedState=Oc,t):ph(e,o));if(s=t.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return Ox(t,e,o,n,a,s,r);if(i){i=n.fallback,o=e.mode,s=t.child,a=s.sibling;var l={mode:"hidden",children:n.children};return!(o&1)&&e.child!==s?(n=e.child,n.childLanes=0,n.pendingProps=l,e.deletions=null):(n=ln(s,l),n.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=ln(a,i):(i=qn(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=Oc,n}return i=t.child,t=i.sibling,n=ln(i,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function ph(t,e){return e=Nl({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function ia(t,e,r,n){return n!==null&&eh(n),ti(e,t.child,null,r),t=ph(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Ox(t,e,r,n,s,i,o){if(r)return e.flags&256?(e.flags&=-257,n=Cu(Error(O(422))),ia(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=n.fallback,s=e.mode,n=Nl({mode:"visible",children:n.children},s,0,null),i=qn(i,s,o,null),i.flags|=2,n.return=e,i.return=e,n.sibling=i,e.child=n,e.mode&1&&ti(e,t.child,null,o),e.child.memoizedState=Ac(o),e.memoizedState=Oc,i);if(!(e.mode&1))return ia(t,e,o,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var a=n.dgst;return n=a,i=Error(O(419)),n=Cu(i,n,void 0),ia(t,e,o,n)}if(a=(o&t.childLanes)!==0,nt||a){if(n=Ne,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,_r(t,s),Vt(n,t,s,-1))}return _h(),n=Cu(Error(O(421))),ia(t,e,o,n)}return s.data==="$?"?(e.flags|=128,e.child=t.child,e=Vx.bind(null,t),s._reactRetry=e,null):(t=i.treeContext,ft=nn(s.nextSibling),pt=e,pe=!0,zt=null,t!==null&&(xt[Et++]=mr,xt[Et++]=gr,xt[Et++]=Qn,mr=t.id,gr=t.overflow,Qn=e),e=ph(e,n.children),e.flags|=4096,e)}function mp(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),Sc(t.return,e,r)}function Tu(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 Xv(t,e,r){var n=e.pendingProps,s=n.revealOrder,i=n.tail;if(Qe(t,e,n.children,r),n=ge.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&&mp(t,r,e);else if(t.tag===19)mp(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(ue(ge,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&&tl(t)===null&&(s=r),r=r.sibling;r=s,r===null?(s=e.child,e.child=null):(s=r.sibling,r.sibling=null),Tu(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&&tl(t)===null){e.child=s;break}t=s.sibling,s.sibling=r,r=s,s=t}Tu(e,!0,r,null,i);break;case"together":Tu(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function ja(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function br(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(O(153));if(e.child!==null){for(t=e.child,r=ln(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=ln(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function Ax(t,e,r){switch(e.tag){case 3:Jv(e),ei();break;case 5:Sv(e);break;case 1:it(e.type)&&Ga(e);break;case 4:oh(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,s=e.memoizedProps.value;ue(Xa,n._currentValue),n._currentValue=s;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(ue(ge,ge.current&1),e.flags|=128,null):r&e.child.childLanes?Yv(t,e,r):(ue(ge,ge.current&1),t=br(t,e,r),t!==null?t.sibling:null);ue(ge,ge.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return Xv(t,e,r);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),ue(ge,ge.current),n)break;return null;case 22:case 23:return e.lanes=0,Qv(t,e,r)}return br(t,e,r)}var Zv,jc,ey,ty;Zv=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}};jc=function(){};ey=function(t,e,r,n){var s=t.memoizedProps;if(s!==n){t=e.stateNode,Nn(rr.current);var i=null;switch(r){case"input":s=ec(t,s),n=ec(t,n),i=[];break;case"select":s=ye({},s,{value:void 0}),n=ye({},n,{value:void 0}),i=[];break;case"textarea":s=nc(t,s),n=nc(t,n),i=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=Ka)}ic(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"&&(Xi.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"&&(Xi.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&de("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)}};ty=function(t,e,r,n){r!==n&&(e.flags|=4)};function Pi(t,e){if(!pe)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 ze(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 jx(t,e,r){var n=e.pendingProps;switch(Zd(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ze(e),null;case 1:return it(e.type)&&Qa(),ze(e),null;case 3:return n=e.stateNode,ri(),he(st),he(He),lh(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(na(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,zt!==null&&(Fc(zt),zt=null))),jc(t,e),ze(e),null;case 5:ah(e);var s=Nn(co.current);if(r=e.type,t!==null&&e.stateNode!=null)ey(t,e,r,n,s),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(O(166));return ze(e),null}if(t=Nn(rr.current),na(e)){n=e.stateNode,r=e.type;var i=e.memoizedProps;switch(n[Zt]=e,n[lo]=i,t=(e.mode&1)!==0,r){case"dialog":de("cancel",n),de("close",n);break;case"iframe":case"object":case"embed":de("load",n);break;case"video":case"audio":for(s=0;s<$i.length;s++)de($i[s],n);break;case"source":de("error",n);break;case"img":case"image":case"link":de("error",n),de("load",n);break;case"details":de("toggle",n);break;case"input":Sf(n,i),de("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},de("invalid",n);break;case"textarea":Cf(n,i),de("invalid",n)}ic(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&&ra(n.textContent,a,t),s=["children",a]):typeof a=="number"&&n.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&ra(n.textContent,a,t),s=["children",""+a]):Xi.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&de("scroll",n)}switch(r){case"input":Qo(n),kf(n,i,!0);break;case"textarea":Qo(n),Tf(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=Ka)}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=Rg(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[Zt]=e,t[lo]=n,Zv(t,e,!1,!1),e.stateNode=t;e:{switch(o=oc(r,n),r){case"dialog":de("cancel",t),de("close",t),s=n;break;case"iframe":case"object":case"embed":de("load",t),s=n;break;case"video":case"audio":for(s=0;s<$i.length;s++)de($i[s],t);s=n;break;case"source":de("error",t),s=n;break;case"img":case"image":case"link":de("error",t),de("load",t),s=n;break;case"details":de("toggle",t),s=n;break;case"input":Sf(t,n),s=ec(t,n),de("invalid",t);break;case"option":s=n;break;case"select":t._wrapperState={wasMultiple:!!n.multiple},s=ye({},n,{value:void 0}),de("invalid",t);break;case"textarea":Cf(t,n),s=nc(t,n),de("invalid",t);break;default:s=n}ic(r,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?jg(t,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Og(t,l)):i==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&Zi(t,l):typeof l=="number"&&Zi(t,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Xi.hasOwnProperty(i)?l!=null&&i==="onScroll"&&de("scroll",t):l!=null&&Md(t,i,l,o))}switch(r){case"input":Qo(t),kf(t,n,!1);break;case"textarea":Qo(t),Tf(t);break;case"option":n.value!=null&&t.setAttribute("value",""+dn(n.value));break;case"select":t.multiple=!!n.multiple,i=n.value,i!=null?As(t,!!n.multiple,i,!1):n.defaultValue!=null&&As(t,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(t.onclick=Ka)}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 ze(e),null;case 6:if(t&&e.stateNode!=null)ty(t,e,t.memoizedProps,n);else{if(typeof n!="string"&&e.stateNode===null)throw Error(O(166));if(r=Nn(co.current),Nn(rr.current),na(e)){if(n=e.stateNode,r=e.memoizedProps,n[Zt]=e,(i=n.nodeValue!==r)&&(t=pt,t!==null))switch(t.tag){case 3:ra(n.nodeValue,r,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&ra(n.nodeValue,r,(t.mode&1)!==0)}i&&(e.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Zt]=e,e.stateNode=n}return ze(e),null;case 13:if(he(ge),n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(pe&&ft!==null&&e.mode&1&&!(e.flags&128))wv(),ei(),e.flags|=98560,i=!1;else if(i=na(e),n!==null&&n.dehydrated!==null){if(t===null){if(!i)throw Error(O(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(O(317));i[Zt]=e}else ei(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;ze(e),i=!1}else zt!==null&&(Fc(zt),zt=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||ge.current&1?Ae===0&&(Ae=3):_h())),e.updateQueue!==null&&(e.flags|=4),ze(e),null);case 4:return ri(),jc(t,e),t===null&&oo(e.stateNode.containerInfo),ze(e),null;case 10:return nh(e.type._context),ze(e),null;case 17:return it(e.type)&&Qa(),ze(e),null;case 19:if(he(ge),i=e.memoizedState,i===null)return ze(e),null;if(n=(e.flags&128)!==0,o=i.rendering,o===null)if(n)Pi(i,!1);else{if(Ae!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=tl(t),o!==null){for(e.flags|=128,Pi(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 ue(ge,ge.current&1|2),e.child}t=t.sibling}i.tail!==null&&be()>si&&(e.flags|=128,n=!0,Pi(i,!1),e.lanes=4194304)}else{if(!n)if(t=tl(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Pi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!pe)return ze(e),null}else 2*be()-i.renderingStartTime>si&&r!==1073741824&&(e.flags|=128,n=!0,Pi(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=be(),e.sibling=null,r=ge.current,ue(ge,n?r&1|2:r&1),e):(ze(e),null);case 22:case 23:return wh(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?ut&1073741824&&(ze(e),e.subtreeFlags&6&&(e.flags|=8192)):ze(e),null;case 24:return null;case 25:return null}throw Error(O(156,e.tag))}function Ix(t,e){switch(Zd(e),e.tag){case 1:return it(e.type)&&Qa(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return ri(),he(st),he(He),lh(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return ah(e),null;case 13:if(he(ge),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(O(340));ei()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return he(ge),null;case 4:return ri(),null;case 10:return nh(e.type._context),null;case 22:case 23:return wh(),null;case 24:return null;default:return null}}var oa=!1,We=!1,Nx=typeof WeakSet=="function"?WeakSet:Set,D=null;function Ps(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){_e(t,e,n)}else r.current=null}function Ic(t,e,r){try{r()}catch(n){_e(t,e,n)}}var gp=!1;function Lx(t,e){if(gc=Wa,t=ov(),Yd(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(vc={focusedElem:t,selectionRange:r},Wa=!1,D=e;D!==null;)if(e=D,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,D=t;else for(;D!==null;){e=D;try{var _=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var y=_.memoizedProps,v=_.memoizedState,g=e.stateNode,p=g.getSnapshotBeforeUpdate(e.elementType===e.type?y:Lt(e.type,y),v);g.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var m=e.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(O(163))}}catch(b){_e(e,e.return,b)}if(t=e.sibling,t!==null){t.return=e.return,D=t;break}D=e.return}return _=gp,gp=!1,_}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&&Ic(e,r,i)}s=s.next}while(s!==n)}}function jl(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 ry(t){var e=t.alternate;e!==null&&(t.alternate=null,ry(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Zt],delete e[lo],delete e[_c],delete e[vx],delete e[yx])),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 ny(t){return t.tag===5||t.tag===3||t.tag===4}function vp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||ny(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 Lc(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=Ka));else if(n!==4&&(t=t.child,t!==null))for(Lc(t,e,r),t=t.sibling;t!==null;)Lc(t,e,r),t=t.sibling}function $c(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($c(t,e,r),t=t.sibling;t!==null;)$c(t,e,r),t=t.sibling}var Le=null,Ut=!1;function Ir(t,e,r){for(r=r.child;r!==null;)sy(t,e,r),r=r.sibling}function sy(t,e,r){if(tr&&typeof tr.onCommitFiberUnmount=="function")try{tr.onCommitFiberUnmount(Sl,r)}catch{}switch(r.tag){case 5:We||Ps(r,e);case 6:var n=Le,s=Ut;Le=null,Ir(t,e,r),Le=n,Ut=s,Le!==null&&(Ut?(t=Le,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Le.removeChild(r.stateNode));break;case 18:Le!==null&&(Ut?(t=Le,r=r.stateNode,t.nodeType===8?_u(t.parentNode,r):t.nodeType===1&&_u(t,r),no(t)):_u(Le,r.stateNode));break;case 4:n=Le,s=Ut,Le=r.stateNode.containerInfo,Ut=!0,Ir(t,e,r),Le=n,Ut=s;break;case 0:case 11:case 14:case 15:if(!We&&(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)&&Ic(r,e,o),s=s.next}while(s!==n)}Ir(t,e,r);break;case 1:if(!We&&(Ps(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){_e(r,e,a)}Ir(t,e,r);break;case 21:Ir(t,e,r);break;case 22:r.mode&1?(We=(n=We)||r.memoizedState!==null,Ir(t,e,r),We=n):Ir(t,e,r);break;default:Ir(t,e,r)}}function yp(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new Nx),e.forEach(function(n){var s=Wx.bind(null,t,n);r.has(n)||(r.add(n),n.then(s,s))})}}function At(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:Le=a.stateNode,Ut=!1;break e;case 3:Le=a.stateNode.containerInfo,Ut=!0;break e;case 4:Le=a.stateNode.containerInfo,Ut=!0;break e}a=a.return}if(Le===null)throw Error(O(160));sy(i,o,s),Le=null,Ut=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(u){_e(s,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)iy(e,t),e=e.sibling}function iy(t,e){var r=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(At(e,t),Qt(t),n&4){try{Hi(3,t,t.return),jl(3,t)}catch(y){_e(t,t.return,y)}try{Hi(5,t,t.return)}catch(y){_e(t,t.return,y)}}break;case 1:At(e,t),Qt(t),n&512&&r!==null&&Ps(r,r.return);break;case 5:if(At(e,t),Qt(t),n&512&&r!==null&&Ps(r,r.return),t.flags&32){var s=t.stateNode;try{Zi(s,"")}catch(y){_e(t,t.return,y)}}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),oc(a,o);var u=oc(a,i);for(o=0;o<l.length;o+=2){var c=l[o],d=l[o+1];c==="style"?jg(s,d):c==="dangerouslySetInnerHTML"?Og(s,d):c==="children"?Zi(s,d):Md(s,c,d,u)}switch(a){case"input":tc(s,i);break;case"textarea":Pg(s,i);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?As(s,!!i.multiple,h,!1):f!==!!i.multiple&&(i.defaultValue!=null?As(s,!!i.multiple,i.defaultValue,!0):As(s,!!i.multiple,i.multiple?[]:"",!1))}s[lo]=i}catch(y){_e(t,t.return,y)}}break;case 6:if(At(e,t),Qt(t),n&4){if(t.stateNode===null)throw Error(O(162));s=t.stateNode,i=t.memoizedProps;try{s.nodeValue=i}catch(y){_e(t,t.return,y)}}break;case 3:if(At(e,t),Qt(t),n&4&&r!==null&&r.memoizedState.isDehydrated)try{no(e.containerInfo)}catch(y){_e(t,t.return,y)}break;case 4:At(e,t),Qt(t);break;case 13:At(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||(vh=be())),n&4&&yp(t);break;case 22:if(c=r!==null&&r.memoizedState!==null,t.mode&1?(We=(u=We)||c,At(e,t),We=u):At(e,t),Qt(t),n&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!c&&t.mode&1)for(D=t,c=t.child;c!==null;){for(d=D=c;D!==null;){switch(f=D,h=f.child,f.tag){case 0:case 11:case 14:case 15:Hi(4,f,f.return);break;case 1:Ps(f,f.return);var _=f.stateNode;if(typeof _.componentWillUnmount=="function"){n=f,r=f.return;try{e=n,_.props=e.memoizedProps,_.state=e.memoizedState,_.componentWillUnmount()}catch(y){_e(n,r,y)}}break;case 5:Ps(f,f.return);break;case 22:if(f.memoizedState!==null){_p(d);continue}}h!==null?(h.return=f,D=h):_p(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=Ag("display",o))}catch(y){_e(t,t.return,y)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(y){_e(t,t.return,y)}}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:At(e,t),Qt(t),n&4&&yp(t);break;case 21:break;default:At(e,t),Qt(t)}}function Qt(t){var e=t.flags;if(e&2){try{e:{for(var r=t.return;r!==null;){if(ny(r)){var n=r;break e}r=r.return}throw Error(O(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(Zi(s,""),n.flags&=-33);var i=vp(t);$c(t,i,s);break;case 3:case 4:var o=n.stateNode.containerInfo,a=vp(t);Lc(t,a,o);break;default:throw Error(O(161))}}catch(l){_e(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function $x(t,e,r){D=t,oy(t)}function oy(t,e,r){for(var n=(t.mode&1)!==0;D!==null;){var s=D,i=s.child;if(s.tag===22&&n){var o=s.memoizedState!==null||oa;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||We;a=oa;var u=We;if(oa=o,(We=l)&&!u)for(D=s;D!==null;)o=D,l=o.child,o.tag===22&&o.memoizedState!==null?bp(s):l!==null?(l.return=o,D=l):bp(s);for(;i!==null;)D=i,oy(i),i=i.sibling;D=s,oa=a,We=u}wp(t)}else s.subtreeFlags&8772&&i!==null?(i.return=s,D=i):wp(t)}}function wp(t){for(;D!==null;){var e=D;if(e.flags&8772){var r=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:We||jl(5,e);break;case 1:var n=e.stateNode;if(e.flags&4&&!We)if(r===null)n.componentDidMount();else{var s=e.elementType===e.type?r.memoizedProps:Lt(e.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&np(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}np(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&&no(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(O(163))}We||e.flags&512&&Nc(e)}catch(f){_e(e,e.return,f)}}if(e===t){D=null;break}if(r=e.sibling,r!==null){r.return=e.return,D=r;break}D=e.return}}function _p(t){for(;D!==null;){var e=D;if(e===t){D=null;break}var r=e.sibling;if(r!==null){r.return=e.return,D=r;break}D=e.return}}function bp(t){for(;D!==null;){var e=D;try{switch(e.tag){case 0:case 11:case 15:var r=e.return;try{jl(4,e)}catch(l){_e(e,r,l)}break;case 1:var n=e.stateNode;if(typeof n.componentDidMount=="function"){var s=e.return;try{n.componentDidMount()}catch(l){_e(e,s,l)}}var i=e.return;try{Nc(e)}catch(l){_e(e,i,l)}break;case 5:var o=e.return;try{Nc(e)}catch(l){_e(e,o,l)}}}catch(l){_e(e,e.return,l)}if(e===t){D=null;break}var a=e.sibling;if(a!==null){a.return=e.return,D=a;break}D=e.return}}var Dx=Math.ceil,sl=kr.ReactCurrentDispatcher,mh=kr.ReactCurrentOwner,kt=kr.ReactCurrentBatchConfig,ne=0,Ne=null,ke=null,De=0,ut=0,Rs=vn(0),Ae=0,mo=null,Jn=0,Il=0,gh=0,qi=null,rt=null,vh=0,si=1/0,dr=null,il=!1,Dc=null,on=null,aa=!1,Xr=null,ol=0,Ki=0,Mc=null,Ia=-1,Na=0;function Je(){return ne&6?be():Ia!==-1?Ia:Ia=be()}function an(t){return t.mode&1?ne&2&&De!==0?De&-De:_x.transition!==null?(Na===0&&(Na=Wg()),Na):(t=oe,t!==0||(t=window.event,t=t===void 0?16:Yg(t.type)),t):1}function Vt(t,e,r,n){if(50<Ki)throw Ki=0,Mc=null,Error(O(185));Ao(t,r,n),(!(ne&2)||t!==Ne)&&(t===Ne&&(!(ne&2)&&(Il|=r),Ae===4&&zr(t,De)),ot(t,n),r===1&&ne===0&&!(e.mode&1)&&(si=be()+500,Rl&&yn()))}function ot(t,e){var r=t.callbackNode;_b(t,e);var n=Va(t,t===Ne?De:0);if(n===0)r!==null&&Of(r),t.callbackNode=null,t.callbackPriority=0;else if(e=n&-n,t.callbackPriority!==e){if(r!=null&&Of(r),e===1)t.tag===0?wx(xp.bind(null,t)):gv(xp.bind(null,t)),mx(function(){!(ne&6)&&yn()}),r=null;else{switch(Hg(n)){case 1:r=Vd;break;case 4:r=Bg;break;case 16:r=Ba;break;case 536870912:r=Vg;break;default:r=Ba}r=py(r,ay.bind(null,t))}t.callbackPriority=e,t.callbackNode=r}}function ay(t,e){if(Ia=-1,Na=0,ne&6)throw Error(O(327));var r=t.callbackNode;if($s()&&t.callbackNode!==r)return null;var n=Va(t,t===Ne?De:0);if(n===0)return null;if(n&30||n&t.expiredLanes||e)e=al(t,n);else{e=n;var s=ne;ne|=2;var i=uy();(Ne!==t||De!==e)&&(dr=null,si=be()+500,Hn(t,e));do try{Fx();break}catch(a){ly(t,a)}while(!0);rh(),sl.current=i,ne=s,ke!==null?e=0:(Ne=null,De=0,e=Ae)}if(e!==0){if(e===2&&(s=dc(t),s!==0&&(n=s,e=Uc(t,s))),e===1)throw r=mo,Hn(t,0),zr(t,n),ot(t,be()),r;if(e===6)zr(t,n);else{if(s=t.current.alternate,!(n&30)&&!Mx(s)&&(e=al(t,n),e===2&&(i=dc(t),i!==0&&(n=i,e=Uc(t,i))),e===1))throw r=mo,Hn(t,0),zr(t,n),ot(t,be()),r;switch(t.finishedWork=s,t.finishedLanes=n,e){case 0:case 1:throw Error(O(345));case 2:Pn(t,rt,dr);break;case 3:if(zr(t,n),(n&130023424)===n&&(e=vh+500-be(),10<e)){if(Va(t,0)!==0)break;if(s=t.suspendedLanes,(s&n)!==n){Je(),t.pingedLanes|=t.suspendedLanes&s;break}t.timeoutHandle=wc(Pn.bind(null,t,rt,dr),e);break}Pn(t,rt,dr);break;case 4:if(zr(t,n),(n&4194240)===n)break;for(e=t.eventTimes,s=-1;0<n;){var o=31-Bt(n);i=1<<o,o=e[o],o>s&&(s=o),n&=~i}if(n=s,n=be()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Dx(n/1960))-n,10<n){t.timeoutHandle=wc(Pn.bind(null,t,rt,dr),n);break}Pn(t,rt,dr);break;case 5:Pn(t,rt,dr);break;default:throw Error(O(329))}}}return ot(t,be()),t.callbackNode===r?ay.bind(null,t):null}function Uc(t,e){var r=qi;return t.current.memoizedState.isDehydrated&&(Hn(t,e).flags|=256),t=al(t,e),t!==2&&(e=rt,rt=r,e!==null&&Fc(e)),t}function Fc(t){rt===null?rt=t:rt.push.apply(rt,t)}function Mx(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 zr(t,e){for(e&=~gh,e&=~Il,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-Bt(e),n=1<<r;t[r]=-1,e&=~n}}function xp(t){if(ne&6)throw Error(O(327));$s();var e=Va(t,0);if(!(e&1))return ot(t,be()),null;var r=al(t,e);if(t.tag!==0&&r===2){var n=dc(t);n!==0&&(e=n,r=Uc(t,n))}if(r===1)throw r=mo,Hn(t,0),zr(t,e),ot(t,be()),r;if(r===6)throw Error(O(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Pn(t,rt,dr),ot(t,be()),null}function yh(t,e){var r=ne;ne|=1;try{return t(e)}finally{ne=r,ne===0&&(si=be()+500,Rl&&yn())}}function Yn(t){Xr!==null&&Xr.tag===0&&!(ne&6)&&$s();var e=ne;ne|=1;var r=kt.transition,n=oe;try{if(kt.transition=null,oe=1,t)return t()}finally{oe=n,kt.transition=r,ne=e,!(ne&6)&&yn()}}function wh(){ut=Rs.current,he(Rs)}function Hn(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(r!==-1&&(t.timeoutHandle=-1,px(r)),ke!==null)for(r=ke.return;r!==null;){var n=r;switch(Zd(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Qa();break;case 3:ri(),he(st),he(He),lh();break;case 5:ah(n);break;case 4:ri();break;case 13:he(ge);break;case 19:he(ge);break;case 10:nh(n.type._context);break;case 22:case 23:wh()}r=r.return}if(Ne=t,ke=t=ln(t.current,null),De=ut=e,Ae=0,mo=null,gh=Il=Jn=0,rt=qi=null,In!==null){for(e=0;e<In.length;e++)if(r=In[e],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,i=r.pending;if(i!==null){var o=i.next;i.next=s,n.next=o}r.pending=n}In=null}return t}function ly(t,e){do{var r=ke;try{if(rh(),Oa.current=nl,rl){for(var n=ve.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}rl=!1}if(Gn=0,Ie=Re=ve=null,Wi=!1,ho=0,mh.current=null,r===null||r.return===null){Ae=1,mo=e,ke=null;break}e:{var i=t,o=r.return,a=r,l=e;if(e=De,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=up(o);if(h!==null){h.flags&=-257,cp(h,o,a,i,e),h.mode&1&&lp(i,u,e),e=h,l=u;var _=e.updateQueue;if(_===null){var y=new Set;y.add(l),e.updateQueue=y}else _.add(l);break e}else{if(!(e&1)){lp(i,u,e),_h();break e}l=Error(O(426))}}else if(pe&&a.mode&1){var v=up(o);if(v!==null){!(v.flags&65536)&&(v.flags|=256),cp(v,o,a,i,e),eh(ni(l,a));break e}}i=l=ni(l,a),Ae!==4&&(Ae=2),qi===null?qi=[i]:qi.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var g=Hv(i,l,e);rp(i,g);break e;case 1:a=l;var p=i.type,m=i.stateNode;if(!(i.flags&128)&&(typeof p.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(on===null||!on.has(m)))){i.flags|=65536,e&=-e,i.lanes|=e;var b=qv(i,a,e);rp(i,b);break e}}i=i.return}while(i!==null)}dy(r)}catch(x){e=x,ke===r&&r!==null&&(ke=r=r.return);continue}break}while(!0)}function uy(){var t=sl.current;return sl.current=nl,t===null?nl:t}function _h(){(Ae===0||Ae===3||Ae===2)&&(Ae=4),Ne===null||!(Jn&268435455)&&!(Il&268435455)||zr(Ne,De)}function al(t,e){var r=ne;ne|=2;var n=uy();(Ne!==t||De!==e)&&(dr=null,Hn(t,e));do try{Ux();break}catch(s){ly(t,s)}while(!0);if(rh(),ne=r,sl.current=n,ke!==null)throw Error(O(261));return Ne=null,De=0,Ae}function Ux(){for(;ke!==null;)cy(ke)}function Fx(){for(;ke!==null&&!db();)cy(ke)}function cy(t){var e=fy(t.alternate,t,ut);t.memoizedProps=t.pendingProps,e===null?dy(t):ke=e,mh.current=null}function dy(t){var e=t;do{var r=e.alternate;if(t=e.return,e.flags&32768){if(r=Ix(r,e),r!==null){r.flags&=32767,ke=r;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Ae=6,ke=null;return}}else if(r=jx(r,e,ut),r!==null){ke=r;return}if(e=e.sibling,e!==null){ke=e;return}ke=e=t}while(e!==null);Ae===0&&(Ae=5)}function Pn(t,e,r){var n=oe,s=kt.transition;try{kt.transition=null,oe=1,zx(t,e,r,n)}finally{kt.transition=s,oe=n}return null}function zx(t,e,r,n){do $s();while(Xr!==null);if(ne&6)throw Error(O(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(O(177));t.callbackNode=null,t.callbackPriority=0;var i=r.lanes|r.childLanes;if(bb(t,i),t===Ne&&(ke=Ne=null,De=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||aa||(aa=!0,py(Ba,function(){return $s(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=kt.transition,kt.transition=null;var o=oe;oe=1;var a=ne;ne|=4,mh.current=null,Lx(t,r),iy(r,t),ax(vc),Wa=!!gc,vc=gc=null,t.current=r,$x(r),hb(),ne=a,oe=o,kt.transition=i}else t.current=r;if(aa&&(aa=!1,Xr=t,ol=s),i=t.pendingLanes,i===0&&(on=null),mb(r.stateNode),ot(t,be()),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(il)throw il=!1,t=Dc,Dc=null,t;return ol&1&&t.tag!==0&&$s(),i=t.pendingLanes,i&1?t===Mc?Ki++:(Ki=0,Mc=t):Ki=0,yn(),null}function $s(){if(Xr!==null){var t=Hg(ol),e=kt.transition,r=oe;try{if(kt.transition=null,oe=16>t?16:t,Xr===null)var n=!1;else{if(t=Xr,Xr=null,ol=0,ne&6)throw Error(O(331));var s=ne;for(ne|=4,D=t.current;D!==null;){var i=D,o=i.child;if(D.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(D=u;D!==null;){var c=D;switch(c.tag){case 0:case 11:case 15:Hi(8,c,i)}var d=c.child;if(d!==null)d.return=c,D=d;else for(;D!==null;){c=D;var f=c.sibling,h=c.return;if(ry(c),c===u){D=null;break}if(f!==null){f.return=h,D=f;break}D=h}}}var _=i.alternate;if(_!==null){var y=_.child;if(y!==null){_.child=null;do{var v=y.sibling;y.sibling=null,y=v}while(y!==null)}}D=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,D=o;else e:for(;D!==null;){if(i=D,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Hi(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,D=g;break e}D=i.return}}var p=t.current;for(D=p;D!==null;){o=D;var m=o.child;if(o.subtreeFlags&2064&&m!==null)m.return=o,D=m;else e:for(o=p;D!==null;){if(a=D,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:jl(9,a)}}catch(x){_e(a,a.return,x)}if(a===o){D=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,D=b;break e}D=a.return}}if(ne=s,yn(),tr&&typeof tr.onPostCommitFiberRoot=="function")try{tr.onPostCommitFiberRoot(Sl,t)}catch{}n=!0}return n}finally{oe=r,kt.transition=e}}return!1}function Ep(t,e,r){e=ni(r,e),e=Hv(t,e,1),t=sn(t,e,1),e=Je(),t!==null&&(Ao(t,1,e),ot(t,e))}function _e(t,e,r){if(t.tag===3)Ep(t,t,r);else for(;e!==null;){if(e.tag===3){Ep(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(on===null||!on.has(n))){t=ni(r,t),t=qv(e,t,1),e=sn(e,t,1),t=Je(),e!==null&&(Ao(e,1,t),ot(e,t));break}}e=e.return}}function Bx(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),e=Je(),t.pingedLanes|=t.suspendedLanes&r,Ne===t&&(De&r)===r&&(Ae===4||Ae===3&&(De&130023424)===De&&500>be()-vh?Hn(t,0):gh|=r),ot(t,e)}function hy(t,e){e===0&&(t.mode&1?(e=Yo,Yo<<=1,!(Yo&130023424)&&(Yo=4194304)):e=1);var r=Je();t=_r(t,e),t!==null&&(Ao(t,e,r),ot(t,r))}function Vx(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),hy(t,r)}function Wx(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(O(314))}n!==null&&n.delete(e),hy(t,r)}var fy;fy=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||st.current)nt=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return nt=!1,Ax(t,e,r);nt=!!(t.flags&131072)}else nt=!1,pe&&e.flags&1048576&&vv(e,Ya,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;ja(t,e),t=e.pendingProps;var s=Zs(e,He.current);Ls(e,r),s=ch(null,e,n,t,s,r);var i=dh();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,it(n)?(i=!0,Ga(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,ih(e),s.updater=Al,e.stateNode=s,s._reactInternals=e,Cc(e,n,t,r),e=Rc(null,e,n,!0,i,r)):(e.tag=0,pe&&i&&Xd(e),Qe(null,e,s,r),e=e.child),e;case 16:n=e.elementType;e:{switch(ja(t,e),t=e.pendingProps,s=n._init,n=s(n._payload),e.type=n,s=e.tag=qx(n),t=Lt(n,t),s){case 0:e=Pc(null,e,n,t,r);break e;case 1:e=fp(null,e,n,t,r);break e;case 11:e=dp(null,e,n,t,r);break e;case 14:e=hp(null,e,n,Lt(n.type,t),r);break e}throw Error(O(306,n,""))}return e;case 0:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:Lt(n,s),Pc(t,e,n,s,r);case 1:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:Lt(n,s),fp(t,e,n,s,r);case 3:e:{if(Jv(e),t===null)throw Error(O(387));n=e.pendingProps,i=e.memoizedState,s=i.element,Ev(t,e),el(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=ni(Error(O(423)),e),e=pp(t,e,n,r,s);break e}else if(n!==s){s=ni(Error(O(424)),e),e=pp(t,e,n,r,s);break e}else for(ft=nn(e.stateNode.containerInfo.firstChild),pt=e,pe=!0,zt=null,r=bv(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ei(),n===s){e=br(t,e,r);break e}Qe(t,e,n,r)}e=e.child}return e;case 5:return Sv(e),t===null&&Ec(e),n=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,o=s.children,yc(n,s)?o=null:i!==null&&yc(n,i)&&(e.flags|=32),Gv(t,e),Qe(t,e,o,r),e.child;case 6:return t===null&&Ec(e),null;case 13:return Yv(t,e,r);case 4:return oh(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=ti(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:Lt(n,s),dp(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,ue(Xa,n._currentValue),n._currentValue=o,i!==null)if(Wt(i.value,o)){if(i.children===s.children&&!st.current){e=br(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=vr(-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),Sc(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(O(341));o.lanes|=r,a=o.alternate,a!==null&&(a.lanes|=r),Sc(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,Ls(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=Lt(n,e.pendingProps),s=Lt(n.type,s),hp(t,e,n,s,r);case 15:return Kv(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:Lt(n,s),ja(t,e),e.tag=1,it(n)?(t=!0,Ga(e)):t=!1,Ls(e,r),Wv(e,n,s),Cc(e,n,s,r),Rc(null,e,n,!0,t,r);case 19:return Xv(t,e,r);case 22:return Qv(t,e,r)}throw Error(O(156,e.tag))};function py(t,e){return zg(t,e)}function Hx(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function St(t,e,r,n){return new Hx(t,e,r,n)}function bh(t){return t=t.prototype,!(!t||!t.isReactComponent)}function qx(t){if(typeof t=="function")return bh(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Fd)return 11;if(t===zd)return 14}return 2}function ln(t,e){var r=t.alternate;return r===null?(r=St(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 La(t,e,r,n,s,i){var o=2;if(n=t,typeof t=="function")bh(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case ws:return qn(r.children,s,i,e);case Ud:o=8,s|=8;break;case Ju:return t=St(12,r,e,s|2),t.elementType=Ju,t.lanes=i,t;case Yu:return t=St(13,r,e,s),t.elementType=Yu,t.lanes=i,t;case Xu:return t=St(19,r,e,s),t.elementType=Xu,t.lanes=i,t;case Sg:return Nl(r,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case xg:o=10;break e;case Eg:o=9;break e;case Fd:o=11;break e;case zd:o=14;break e;case Mr:o=16,n=null;break e}throw Error(O(130,t==null?t:typeof t,""))}return e=St(o,r,e,s),e.elementType=t,e.type=n,e.lanes=i,e}function qn(t,e,r,n){return t=St(7,t,n,e),t.lanes=r,t}function Nl(t,e,r,n){return t=St(22,t,n,e),t.elementType=Sg,t.lanes=r,t.stateNode={isHidden:!1},t}function Pu(t,e,r){return t=St(6,t,null,e),t.lanes=r,t}function Ru(t,e,r){return e=St(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function Kx(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=uu(0),this.expirationTimes=uu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=uu(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function xh(t,e,r,n,s,i,o,a,l){return t=new Kx(t,e,r,a,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=St(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},ih(i),t}function Qx(t,e,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ys,key:n==null?null:""+n,children:t,containerInfo:e,implementation:r}}function my(t){if(!t)return hn;t=t._reactInternals;e:{if(ts(t)!==t||t.tag!==1)throw Error(O(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(it(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(O(171))}if(t.tag===1){var r=t.type;if(it(r))return mv(t,r,e)}return e}function gy(t,e,r,n,s,i,o,a,l){return t=xh(r,n,!0,t,s,i,o,a,l),t.context=my(null),r=t.current,n=Je(),s=an(r),i=vr(n,s),i.callback=e??null,sn(r,i,s),t.current.lanes=s,Ao(t,s,n),ot(t,n),t}function Ll(t,e,r,n){var s=e.current,i=Je(),o=an(s);return r=my(r),e.context===null?e.context=r:e.pendingContext=r,e=vr(i,o),e.payload={element:t},n=n===void 0?null:n,n!==null&&(e.callback=n),t=sn(s,e,o),t!==null&&(Vt(t,s,o,i),Ra(t,s,o)),o}function ll(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 Sp(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function Eh(t,e){Sp(t,e),(t=t.alternate)&&Sp(t,e)}function Gx(){return null}var vy=typeof reportError=="function"?reportError:function(t){console.error(t)};function Sh(t){this._internalRoot=t}$l.prototype.render=Sh.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(O(409));Ll(t,e,null,null)};$l.prototype.unmount=Sh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Yn(function(){Ll(null,t,null,null)}),e[wr]=null}};function $l(t){this._internalRoot=t}$l.prototype.unstable_scheduleHydration=function(t){if(t){var e=Qg();t={blockedOn:null,target:t,priority:e};for(var r=0;r<Fr.length&&e!==0&&e<Fr[r].priority;r++);Fr.splice(r,0,t),r===0&&Jg(t)}};function kh(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Dl(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function kp(){}function Jx(t,e,r,n,s){if(s){if(typeof n=="function"){var i=n;n=function(){var u=ll(o);i.call(u)}}var o=gy(e,n,t,0,null,!1,!1,"",kp);return t._reactRootContainer=o,t[wr]=o.current,oo(t.nodeType===8?t.parentNode:t),Yn(),o}for(;s=t.lastChild;)t.removeChild(s);if(typeof n=="function"){var a=n;n=function(){var u=ll(l);a.call(u)}}var l=xh(t,0,!1,null,null,!1,!1,"",kp);return t._reactRootContainer=l,t[wr]=l.current,oo(t.nodeType===8?t.parentNode:t),Yn(function(){Ll(e,l,r,n)}),l}function Ml(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=ll(o);a.call(l)}}Ll(e,o,t,s)}else o=Jx(r,e,t,s,n);return ll(o)}qg=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var r=Li(e.pendingLanes);r!==0&&(Wd(e,r|1),ot(e,be()),!(ne&6)&&(si=be()+500,yn()))}break;case 13:Yn(function(){var n=_r(t,1);if(n!==null){var s=Je();Vt(n,t,1,s)}}),Eh(t,1)}};Hd=function(t){if(t.tag===13){var e=_r(t,134217728);if(e!==null){var r=Je();Vt(e,t,134217728,r)}Eh(t,134217728)}};Kg=function(t){if(t.tag===13){var e=an(t),r=_r(t,e);if(r!==null){var n=Je();Vt(r,t,e,n)}Eh(t,e)}};Qg=function(){return oe};Gg=function(t,e){var r=oe;try{return oe=t,e()}finally{oe=r}};lc=function(t,e,r){switch(e){case"input":if(tc(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(O(90));Cg(n),tc(n,s)}}}break;case"textarea":Pg(t,r);break;case"select":e=r.value,e!=null&&As(t,!!r.multiple,e,!1)}};Lg=yh;$g=Yn;var Yx={usingClientEntryPoint:!1,Events:[Io,Es,Pl,Ig,Ng,yh]},Ri={findFiberByHostInstance:jn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Xx={bundleType:Ri.bundleType,version:Ri.version,rendererPackageName:Ri.rendererPackageName,rendererConfig:Ri.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:kr.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Ug(t),t===null?null:t.stateNode},findFiberByHostInstance:Ri.findFiberByHostInstance||Gx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var la=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!la.isDisabled&&la.supportsFiber)try{Sl=la.inject(Xx),tr=la}catch{}}vt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yx;vt.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!kh(e))throw Error(O(200));return Qx(t,e,null,r)};vt.createRoot=function(t,e){if(!kh(t))throw Error(O(299));var r=!1,n="",s=vy;return e!=null&&(e.unstable_strictMode===!0&&(r=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onRecoverableError!==void 0&&(s=e.onRecoverableError)),e=xh(t,1,!1,null,null,r,!1,n,s),t[wr]=e.current,oo(t.nodeType===8?t.parentNode:t),new Sh(e)};vt.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(O(188)):(t=Object.keys(t).join(","),Error(O(268,t)));return t=Ug(e),t=t===null?null:t.stateNode,t};vt.flushSync=function(t){return Yn(t)};vt.hydrate=function(t,e,r){if(!Dl(e))throw Error(O(200));return Ml(null,t,e,!0,r)};vt.hydrateRoot=function(t,e,r){if(!kh(t))throw Error(O(405));var n=r!=null&&r.hydratedSources||null,s=!1,i="",o=vy;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),e=gy(e,null,t,1,r??null,s,!1,i,o),t[wr]=e.current,oo(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 $l(e)};vt.render=function(t,e,r){if(!Dl(e))throw Error(O(200));return Ml(null,t,e,!1,r)};vt.unmountComponentAtNode=function(t){if(!Dl(t))throw Error(O(40));return t._reactRootContainer?(Yn(function(){Ml(null,null,t,!1,function(){t._reactRootContainer=null,t[wr]=null})}),!0):!1};vt.unstable_batchedUpdates=yh;vt.unstable_renderSubtreeIntoContainer=function(t,e,r,n){if(!Dl(r))throw Error(O(200));if(t==null||t._reactInternals===void 0)throw Error(O(38));return Ml(t,e,r,!1,n)};vt.version="18.3.1-next-f1338f8080-20240426";function yy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(yy)}catch(t){console.error(t)}}yy(),yg.exports=vt;var Lo=yg.exports;const wy=og(Lo);var _y,Cp=Lo;_y=Cp.createRoot,Cp.hydrateRoot;const Zx="modulepreload",eE=function(t){return"/"+t},Tp={},Ce=function(e,r,n){let s=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(r.map(l=>{if(l=eE(l),l in Tp)return;Tp[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":Zx,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((f,h)=>{d.addEventListener("load",f),d.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return e().catch(i)})},tE=1,rE=1e6;let Ou=0;function nE(){return Ou=(Ou+1)%Number.MAX_SAFE_INTEGER,Ou.toString()}const Au=new Map,Pp=t=>{if(Au.has(t))return;const e=setTimeout(()=>{Au.delete(t),Qi({type:"REMOVE_TOAST",toastId:t})},rE);Au.set(t,e)},sE=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,tE)};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?Pp(r):t.toasts.forEach(n=>{Pp(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)}}},$a=[];let Da={toasts:[]};function Qi(t){Da=sE(Da,t),$a.forEach(e=>{e(Da)})}function iE({...t}){const e=nE(),r=s=>Qi({type:"UPDATE_TOAST",toast:{...s,id:e}}),n=()=>Qi({type:"DISMISS_TOAST",toastId:e});return Qi({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||n()}}}),{id:e,dismiss:n,update:r}}function by(){const[t,e]=w.useState(Da);return w.useEffect(()=>($a.push(e),()=>{const r=$a.indexOf(e);r>-1&&$a.splice(r,1)}),[t]),{...t,toast:iE,dismiss:r=>Qi({type:"DISMISS_TOAST",toastId:r})}}function Oe(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 Rp(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function xy(...t){return e=>{let r=!1;const n=t.map(s=>{const i=Rp(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():Rp(t[s],null)}}}}function Ht(...t){return w.useCallback(xy(...t),t)}function JO(t,e){const r=w.createContext(e),n=i=>{const{children:o,...a}=i,l=w.useMemo(()=>a,Object.values(a));return S.jsx(r.Provider,{value:l,children:o})};n.displayName=t+"Provider";function s(i){const o=w.useContext(r);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[n,s]}function Ul(t,e=[]){let r=[];function n(i,o){const a=w.createContext(o),l=r.length;r=[...r,o];const u=d=>{var g;const{scope:f,children:h,..._}=d,y=((g=f==null?void 0:f[t])==null?void 0:g[l])||a,v=w.useMemo(()=>_,Object.values(_));return S.jsx(y.Provider,{value:v,children:h})};u.displayName=i+"Provider";function c(d,f){var y;const h=((y=f==null?void 0:f[t])==null?void 0:y[l])||a,_=w.useContext(h);if(_)return _;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=>w.createContext(o));return function(a){const l=(a==null?void 0:a[t])||i;return w.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[n,oE(s,...e)]}function oE(...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 w.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function ul(t){const e=aE(t),r=w.forwardRef((n,s)=>{const{children:i,...o}=n,a=w.Children.toArray(i),l=a.find(uE);if(l){const u=l.props.children,c=a.map(d=>d===l?w.Children.count(u)>1?w.Children.only(null):w.isValidElement(u)?u.props.children:null:d);return S.jsx(e,{...o,ref:s,children:w.isValidElement(u)?w.cloneElement(u,void 0,c):null})}return S.jsx(e,{...o,ref:s,children:i})});return r.displayName=`${t}.Slot`,r}var YO=ul("Slot");function aE(t){const e=w.forwardRef((r,n)=>{const{children:s,...i}=r;if(w.isValidElement(s)){const o=dE(s),a=cE(i,s.props);return s.type!==w.Fragment&&(a.ref=n?xy(n,o):o),w.cloneElement(s,a)}return w.Children.count(s)>1?w.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var Ey=Symbol("radix.slottable");function lE(t){const e=({children:r})=>S.jsx(S.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=Ey,e}function uE(t){return w.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===Ey}function cE(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 dE(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 hE(t){const e=t+"CollectionProvider",[r,n]=Ul(e),[s,i]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=y=>{const{scope:v,children:g}=y,p=I.useRef(null),m=I.useRef(new Map).current;return S.jsx(s,{scope:v,itemMap:m,collectionRef:p,children:g})};o.displayName=e;const a=t+"CollectionSlot",l=ul(a),u=I.forwardRef((y,v)=>{const{scope:g,children:p}=y,m=i(a,g),b=Ht(v,m.collectionRef);return S.jsx(l,{ref:b,children:p})});u.displayName=a;const c=t+"CollectionItemSlot",d="data-radix-collection-item",f=ul(c),h=I.forwardRef((y,v)=>{const{scope:g,children:p,...m}=y,b=I.useRef(null),x=Ht(v,b),k=i(c,g);return I.useEffect(()=>(k.itemMap.set(b,{ref:b,...m}),()=>void k.itemMap.delete(b))),S.jsx(f,{[d]:"",ref:x,children:p})});h.displayName=c;function _(y){const v=i(t+"CollectionConsumer",y);return I.useCallback(()=>{const p=v.collectionRef.current;if(!p)return[];const m=Array.from(p.querySelectorAll(`[${d}]`));return Array.from(v.itemMap.values()).sort((k,C)=>m.indexOf(k.ref.current)-m.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:o,Slot:u,ItemSlot:h},_,n]}var fE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],at=fE.reduce((t,e)=>{const r=ul(`Primitive.${e}`),n=w.forwardRef((s,i)=>{const{asChild:o,...a}=s,l=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(l,{...a,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Sy(t,e){t&&Lo.flushSync(()=>t.dispatchEvent(e))}function fn(t){const e=w.useRef(t);return w.useEffect(()=>{e.current=t}),w.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}function pE(t,e=globalThis==null?void 0:globalThis.document){const r=fn(t);w.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 mE="DismissableLayer",zc="dismissableLayer.update",gE="dismissableLayer.pointerDownOutside",vE="dismissableLayer.focusOutside",Op,ky=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ch=w.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...l}=t,u=w.useContext(ky),[c,d]=w.useState(null),f=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=w.useState({}),_=Ht(e,C=>d(C)),y=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=y.indexOf(v),p=c?y.indexOf(c):-1,m=u.layersWithOutsidePointerEventsDisabled.size>0,b=p>=g,x=wE(C=>{const T=C.target,j=[...u.branches].some(A=>A.contains(T));!b||j||(s==null||s(C),o==null||o(C),C.defaultPrevented||a==null||a())},f),k=_E(C=>{const T=C.target;[...u.branches].some(A=>A.contains(T))||(i==null||i(C),o==null||o(C),C.defaultPrevented||a==null||a())},f);return pE(C=>{p===u.layers.size-1&&(n==null||n(C),!C.defaultPrevented&&a&&(C.preventDefault(),a()))},f),w.useEffect(()=>{if(c)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Op=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),Ap(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Op)}},[c,f,r,u]),w.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),Ap())},[c,u]),w.useEffect(()=>{const C=()=>h({});return document.addEventListener(zc,C),()=>document.removeEventListener(zc,C)},[]),S.jsx(at.div,{...l,ref:_,style:{pointerEvents:m?b?"auto":"none":void 0,...t.style},onFocusCapture:Oe(t.onFocusCapture,k.onFocusCapture),onBlurCapture:Oe(t.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Oe(t.onPointerDownCapture,x.onPointerDownCapture)})});Ch.displayName=mE;var yE="DismissableLayerBranch",Cy=w.forwardRef((t,e)=>{const r=w.useContext(ky),n=w.useRef(null),s=Ht(e,n);return w.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),S.jsx(at.div,{...t,ref:s})});Cy.displayName=yE;function wE(t,e=globalThis==null?void 0:globalThis.document){const r=fn(t),n=w.useRef(!1),s=w.useRef(()=>{});return w.useEffect(()=>{const i=a=>{if(a.target&&!n.current){let l=function(){Ty(gE,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 _E(t,e=globalThis==null?void 0:globalThis.document){const r=fn(t),n=w.useRef(!1);return w.useEffect(()=>{const s=i=>{i.target&&!n.current&&Ty(vE,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 Ap(){const t=new CustomEvent(zc);document.dispatchEvent(t)}function Ty(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?Sy(s,i):s.dispatchEvent(i)}var bE=Ch,xE=Cy,xr=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},EE="Portal",Py=w.forwardRef((t,e)=>{var a;const{container:r,...n}=t,[s,i]=w.useState(!1);xr(()=>i(!0),[]);const o=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?wy.createPortal(S.jsx(at.div,{...n,ref:e}),o):null});Py.displayName=EE;function SE(t,e){return w.useReducer((r,n)=>e[r][n]??r,t)}var Th=t=>{const{present:e,children:r}=t,n=kE(e),s=typeof r=="function"?r({present:n.isPresent}):w.Children.only(r),i=Ht(n.ref,CE(s));return typeof r=="function"||n.isPresent?w.cloneElement(s,{ref:i}):null};Th.displayName="Presence";function kE(t){const[e,r]=w.useState(),n=w.useRef(null),s=w.useRef(t),i=w.useRef("none"),o=t?"mounted":"unmounted",[a,l]=SE(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const u=ua(n.current);i.current=a==="mounted"?u:"none"},[a]),xr(()=>{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]),xr(()=>{if(e){let u;const c=e.ownerDocument.defaultView??window,d=h=>{const y=ua(n.current).includes(h.animationName);if(h.target===e&&y&&(l("ANIMATION_END"),!s.current)){const v=e.style.animationFillMode;e.style.animationFillMode="forwards",u=c.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=v)})}},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:w.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function ua(t){return(t==null?void 0:t.animationName)||"none"}function CE(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 TE=Ld[" useInsertionEffect ".trim().toString()]||xr;function Ry({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[s,i,o]=PE({defaultProp:e,onChange:r}),a=t!==void 0,l=a?t:s;{const c=w.useRef(t!==void 0);w.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=w.useCallback(c=>{var d;if(a){const f=RE(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 PE({defaultProp:t,onChange:e}){const[r,n]=w.useState(t),s=w.useRef(r),i=w.useRef(e);return TE(()=>{i.current=e},[e]),w.useEffect(()=>{var o;s.current!==r&&((o=i.current)==null||o.call(i,r),s.current=r)},[r,s]),[r,n,i]}function RE(t){return typeof t=="function"}var OE=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"}),AE="VisuallyHidden",Fl=w.forwardRef((t,e)=>S.jsx(at.span,{...t,ref:e,style:{...OE,...t.style}}));Fl.displayName=AE;var jE=Fl,Ph="ToastProvider",[Rh,IE,NE]=hE("Toast"),[Oy,XO]=Ul("Toast",[NE]),[LE,zl]=Oy(Ph),Ay=t=>{const{__scopeToast:e,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=t,[a,l]=w.useState(null),[u,c]=w.useState(0),d=w.useRef(!1),f=w.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Ph}\`. Expected non-empty \`string\`.`),S.jsx(Rh.Provider,{scope:e,children:S.jsx(LE,{scope:e,label:r,duration:n,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:w.useCallback(()=>c(h=>h+1),[]),onToastRemove:w.useCallback(()=>c(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};Ay.displayName=Ph;var jy="ToastViewport",$E=["F8"],Bc="toast.viewportPause",Vc="toast.viewportResume",Iy=w.forwardRef((t,e)=>{const{__scopeToast:r,hotkey:n=$E,label:s="Notifications ({hotkey})",...i}=t,o=zl(jy,r),a=IE(r),l=w.useRef(null),u=w.useRef(null),c=w.useRef(null),d=w.useRef(null),f=Ht(e,d,o.onViewportChange),h=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=o.toastCount>0;w.useEffect(()=>{const v=g=>{var m;n.length!==0&&n.every(b=>g[b]||g.code===b)&&((m=d.current)==null||m.focus())};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[n]),w.useEffect(()=>{const v=l.current,g=d.current;if(_&&v&&g){const p=()=>{if(!o.isClosePausedRef.current){const k=new CustomEvent(Bc);g.dispatchEvent(k),o.isClosePausedRef.current=!0}},m=()=>{if(o.isClosePausedRef.current){const k=new CustomEvent(Vc);g.dispatchEvent(k),o.isClosePausedRef.current=!1}},b=k=>{!v.contains(k.relatedTarget)&&m()},x=()=>{v.contains(document.activeElement)||m()};return v.addEventListener("focusin",p),v.addEventListener("focusout",b),v.addEventListener("pointermove",p),v.addEventListener("pointerleave",x),window.addEventListener("blur",p),window.addEventListener("focus",m),()=>{v.removeEventListener("focusin",p),v.removeEventListener("focusout",b),v.removeEventListener("pointermove",p),v.removeEventListener("pointerleave",x),window.removeEventListener("blur",p),window.removeEventListener("focus",m)}}},[_,o.isClosePausedRef]);const y=w.useCallback(({tabbingDirection:v})=>{const p=a().map(m=>{const b=m.ref.current,x=[b,...GE(b)];return v==="forwards"?x:x.reverse()});return(v==="forwards"?p.reverse():p).flat()},[a]);return w.useEffect(()=>{const v=d.current;if(v){const g=p=>{var x,k,C;const m=p.altKey||p.ctrlKey||p.metaKey;if(p.key==="Tab"&&!m){const T=document.activeElement,j=p.shiftKey;if(p.target===v&&j){(x=u.current)==null||x.focus();return}const L=y({tabbingDirection:j?"backwards":"forwards"}),q=L.findIndex(N=>N===T);ju(L.slice(q+1))?p.preventDefault():j?(k=u.current)==null||k.focus():(C=c.current)==null||C.focus()}};return v.addEventListener("keydown",g),()=>v.removeEventListener("keydown",g)}},[a,y]),S.jsxs(xE,{ref:l,role:"region","aria-label":s.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:_?void 0:"none"},children:[_&&S.jsx(Wc,{ref:u,onFocusFromOutsideViewport:()=>{const v=y({tabbingDirection:"forwards"});ju(v)}}),S.jsx(Rh.Slot,{scope:r,children:S.jsx(at.ol,{tabIndex:-1,...i,ref:f})}),_&&S.jsx(Wc,{ref:c,onFocusFromOutsideViewport:()=>{const v=y({tabbingDirection:"backwards"});ju(v)}})]})});Iy.displayName=jy;var Ny="ToastFocusProxy",Wc=w.forwardRef((t,e)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=t,i=zl(Ny,r);return S.jsx(Fl,{"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()}})});Wc.displayName=Ny;var $o="Toast",DE="toast.swipeStart",ME="toast.swipeMove",UE="toast.swipeCancel",FE="toast.swipeEnd",Ly=w.forwardRef((t,e)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:i,...o}=t,[a,l]=Ry({prop:n,defaultProp:s??!0,onChange:i,caller:$o});return S.jsx(Th,{present:r||a,children:S.jsx(VE,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:fn(t.onPause),onResume:fn(t.onResume),onSwipeStart:Oe(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Oe(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:Oe(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:Oe(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)})})})});Ly.displayName=$o;var[zE,BE]=Oy($o,{onClose(){}}),VE=w.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,..._}=t,y=zl($o,r),[v,g]=w.useState(null),p=Ht(e,N=>g(N)),m=w.useRef(null),b=w.useRef(null),x=s||y.duration,k=w.useRef(0),C=w.useRef(x),T=w.useRef(0),{onToastAdd:j,onToastRemove:A}=y,B=fn(()=>{var Z;(v==null?void 0:v.contains(document.activeElement))&&((Z=y.viewport)==null||Z.focus()),o()}),L=w.useCallback(N=>{!N||N===1/0||(window.clearTimeout(T.current),k.current=new Date().getTime(),T.current=window.setTimeout(B,N))},[B]);w.useEffect(()=>{const N=y.viewport;if(N){const Z=()=>{L(C.current),u==null||u()},H=()=>{const Q=new Date().getTime()-k.current;C.current=C.current-Q,window.clearTimeout(T.current),l==null||l()};return N.addEventListener(Bc,H),N.addEventListener(Vc,Z),()=>{N.removeEventListener(Bc,H),N.removeEventListener(Vc,Z)}}},[y.viewport,x,l,u,L]),w.useEffect(()=>{i&&!y.isClosePausedRef.current&&L(x)},[i,x,y.isClosePausedRef,L]),w.useEffect(()=>(j(),()=>A()),[j,A]);const q=w.useMemo(()=>v?By(v):null,[v]);return y.viewport?S.jsxs(S.Fragment,{children:[q&&S.jsx(WE,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:q}),S.jsx(zE,{scope:r,onClose:B,children:Lo.createPortal(S.jsx(Rh.ItemSlot,{scope:r,children:S.jsx(bE,{asChild:!0,onEscapeKeyDown:Oe(a,()=>{y.isFocusedToastEscapeKeyDownRef.current||B(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:S.jsx(at.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":y.swipeDirection,..._,ref:p,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:Oe(t.onKeyDown,N=>{N.key==="Escape"&&(a==null||a(N.nativeEvent),N.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,B()))}),onPointerDown:Oe(t.onPointerDown,N=>{N.button===0&&(m.current={x:N.clientX,y:N.clientY})}),onPointerMove:Oe(t.onPointerMove,N=>{if(!m.current)return;const Z=N.clientX-m.current.x,H=N.clientY-m.current.y,Q=!!b.current,P=["left","right"].includes(y.swipeDirection),R=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,$=P?R(0,Z):0,G=P?0:R(0,H),z=N.pointerType==="touch"?10:2,Y={x:$,y:G},ee={originalEvent:N,delta:Y};Q?(b.current=Y,ca(ME,d,ee,{discrete:!1})):jp(Y,y.swipeDirection,z)?(b.current=Y,ca(DE,c,ee,{discrete:!1}),N.target.setPointerCapture(N.pointerId)):(Math.abs(Z)>z||Math.abs(H)>z)&&(m.current=null)}),onPointerUp:Oe(t.onPointerUp,N=>{const Z=b.current,H=N.target;if(H.hasPointerCapture(N.pointerId)&&H.releasePointerCapture(N.pointerId),b.current=null,m.current=null,Z){const Q=N.currentTarget,P={originalEvent:N,delta:Z};jp(Z,y.swipeDirection,y.swipeThreshold)?ca(FE,h,P,{discrete:!0}):ca(UE,f,P,{discrete:!0}),Q.addEventListener("click",R=>R.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),WE=t=>{const{__scopeToast:e,children:r,...n}=t,s=zl($o,e),[i,o]=w.useState(!1),[a,l]=w.useState(!1);return KE(()=>o(!0)),w.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:S.jsx(Py,{asChild:!0,children:S.jsx(Fl,{...n,children:i&&S.jsxs(S.Fragment,{children:[s.label," ",r]})})})},HE="ToastTitle",$y=w.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return S.jsx(at.div,{...n,ref:e})});$y.displayName=HE;var qE="ToastDescription",Dy=w.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return S.jsx(at.div,{...n,ref:e})});Dy.displayName=qE;var My="ToastAction",Uy=w.forwardRef((t,e)=>{const{altText:r,...n}=t;return r.trim()?S.jsx(zy,{altText:r,asChild:!0,children:S.jsx(Oh,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${My}\`. Expected non-empty \`string\`.`),null)});Uy.displayName=My;var Fy="ToastClose",Oh=w.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,s=BE(Fy,r);return S.jsx(zy,{asChild:!0,children:S.jsx(at.button,{type:"button",...n,ref:e,onClick:Oe(t.onClick,s.onClose)})})});Oh.displayName=Fy;var zy=w.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...s}=t;return S.jsx(at.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:e})});function By(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),QE(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(...By(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?Sy(s,i):s.dispatchEvent(i)}var jp=(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 KE(t=()=>{}){const e=fn(t);xr(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function QE(t){return t.nodeType===t.ELEMENT_NODE}function GE(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 ju(t){const e=document.activeElement;return t.some(r=>r===e?!0:(r.focus(),document.activeElement!==e))}var JE=Ay,Vy=Iy,Wy=Ly,Hy=$y,qy=Dy,Ky=Uy,Qy=Oh;function Gy(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=Gy(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Jy(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=Gy(t))&&(n&&(n+=" "),n+=e);return n}const Ip=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Np=Jy,YE=(t,e)=>r=>{var n;if((e==null?void 0:e.variants)==null)return Np(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=Ip(c)||Ip(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(_=>{let[y,v]=_;return Array.isArray(v)?v.includes({...i,...a}[y]):{...i,...a}[y]===v})?[...u,d,f]:u},[]);return Np(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 XE=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yy=(...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 ZE={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 eS=w.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:o,...a},l)=>w.createElement("svg",{ref:l,...ZE,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:Yy("lucide",s),...a},[...o.map(([u,c])=>w.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 Xy=(t,e)=>{const r=w.forwardRef(({className:n,...s},i)=>w.createElement(eS,{ref:i,iconNode:e,className:Yy(`lucide-${XE(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 tS=Xy("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
 * @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 rS=Xy("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Ah="-",nS=t=>{const e=iS(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{const a=o.split(Ah);return a[0]===""&&a.length!==1&&a.shift(),Zy(a,e)||sS(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(Ah);return(o=e.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},Lp=/^\[(.+)\]$/,sS=t=>{if(Lp.test(t)){const e=Lp.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},iS=t=>{const{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return aS(Object.entries(t.classGroups),r).forEach(([i,o])=>{Hc(o,n,i,e)}),n},Hc=(t,e,r,n)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:$p(e,s);i.classGroupId=r;return}if(typeof s=="function"){if(oS(s)){Hc(s(n),e,r,n);return}e.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([i,o])=>{Hc(o,$p(e,i),r,n)})})},$p=(t,e)=>{let r=t;return e.split(Ah).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},oS=t=>t.isThemeGetter,aS=(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,lS=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)}}},e0="!",uS=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 v=0;v<a.length;v++){let g=a[v];if(u===0){if(g===s&&(n||a.slice(v,v+i)===e)){l.push(a.slice(c,v)),c=v+i;continue}if(g==="/"){d=v;continue}}g==="["?u++:g==="]"&&u--}const f=l.length===0?a:a.substring(c),h=f.startsWith(e0),_=h?f.substring(1):f,y=d&&d>c?d-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:_,maybePostfixModifierPosition:y}};return r?a=>r({className:a,parseClassName:o}):o},cS=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},dS=t=>({cache:lS(t.cacheSize),parseClassName:uS(t),...nS(t)}),hS=/\s+/,fS=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=e,i=[],o=t.trim().split(hS);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 _=!!h,y=n(_?f.substring(0,h):f);if(!y){if(!_){a=u+(a.length>0?" "+a:a);continue}if(y=n(f),!y){a=u+(a.length>0?" "+a:a);continue}_=!1}const v=cS(c).join(":"),g=d?v+e0:v,p=g+y;if(i.includes(p))continue;i.push(p);const m=s(y,_);for(let b=0;b<m.length;++b){const x=m[b];i.push(g+x)}a=u+(a.length>0?" "+a:a)}return a};function pS(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=t0(e))&&(n&&(n+=" "),n+=r);return n}const t0=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=t0(t[n]))&&(r&&(r+=" "),r+=e);return r};function mS(t,...e){let r,n,s,i=o;function o(l){const u=e.reduce((c,d)=>d(c),t());return r=dS(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=fS(l,r);return s(l,c),c}return function(){return i(pS.apply(null,arguments))}}const ce=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},r0=/^\[(?:([a-z-]+):)?(.+)\]$/i,gS=/^\d+\/\d+$/,vS=new Set(["px","full","screen"]),yS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,wS=/\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$/,_S=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,bS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ur=t=>Ds(t)||vS.has(t)||gS.test(t),Nr=t=>di(t,"length",OS),Ds=t=>!!t&&!Number.isNaN(Number(t)),Iu=t=>di(t,"number",Ds),Oi=t=>!!t&&Number.isInteger(Number(t)),ES=t=>t.endsWith("%")&&Ds(t.slice(0,-1)),J=t=>r0.test(t),Lr=t=>yS.test(t),SS=new Set(["length","size","percentage"]),kS=t=>di(t,SS,n0),CS=t=>di(t,"position",n0),TS=new Set(["image","url"]),PS=t=>di(t,TS,jS),RS=t=>di(t,"",AS),Ai=()=>!0,di=(t,e,r)=>{const n=r0.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1},OS=t=>wS.test(t)&&!_S.test(t),n0=()=>!1,AS=t=>bS.test(t),jS=t=>xS.test(t),IS=()=>{const t=ce("colors"),e=ce("spacing"),r=ce("blur"),n=ce("brightness"),s=ce("borderColor"),i=ce("borderRadius"),o=ce("borderSpacing"),a=ce("borderWidth"),l=ce("contrast"),u=ce("grayscale"),c=ce("hueRotate"),d=ce("invert"),f=ce("gap"),h=ce("gradientColorStops"),_=ce("gradientColorStopPositions"),y=ce("inset"),v=ce("margin"),g=ce("opacity"),p=ce("padding"),m=ce("saturate"),b=ce("scale"),x=ce("sepia"),k=ce("skew"),C=ce("space"),T=ce("translate"),j=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",J,e],L=()=>[J,e],q=()=>["",ur,Nr],N=()=>["auto",Ds,J],Z=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],Q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>["start","end","center","between","around","evenly","stretch"],R=()=>["","0",J],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],G=()=>[Ds,J];return{cacheSize:500,separator:":",theme:{colors:[Ai],spacing:[ur,Nr],blur:["none","",Lr,J],brightness:G(),borderColor:[t],borderRadius:["none","","full",Lr,J],borderSpacing:L(),borderWidth:q(),contrast:G(),grayscale:R(),hueRotate:G(),invert:R(),gap:L(),gradientColorStops:[t],gradientColorStopPositions:[ES,Nr],inset:B(),margin:B(),opacity:G(),padding:L(),saturate:G(),scale:G(),sepia:R(),skew:G(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",J]}],container:["container"],columns:[{columns:[Lr]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"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:[...Z(),J]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Oi,J]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",J]}],grow:[{grow:R()}],shrink:[{shrink:R()}],order:[{order:["first","last","none",Oi,J]}],"grid-cols":[{"grid-cols":[Ai]}],"col-start-end":[{col:["auto",{span:["full",Oi,J]},J]}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":[Ai]}],"row-start-end":[{row:["auto",{span:[Oi,J]},J]}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",J]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",J]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...P()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...P(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...P(),"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:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",J,e]}],"min-w":[{"min-w":[J,e,"min","max","fit"]}],"max-w":[{"max-w":[J,e,"none","full","min","max","fit","prose",{screen:[Lr]},Lr]}],h:[{h:[J,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[J,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[J,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[J,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Lr,Nr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Iu]}],"font-family":[{font:[Ai]}],"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",J]}],"line-clamp":[{"line-clamp":["none",Ds,Iu]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ur,J]}],"list-image":[{"list-image":["none",J]}],"list-style-type":[{list:["none","disc","decimal",J]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ur,Nr]}],"underline-offset":[{"underline-offset":["auto",ur,J]}],"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:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",J]}],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",J]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Z(),CS]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kS]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},PS]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[_]}],"gradient-via-pos":[{via:[_]}],"gradient-to-pos":[{to:[_]}],"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":[g]}],"border-style":[{border:[...H(),"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":[g]}],"divide-style":[{divide:H()}],"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:["",...H()]}],"outline-offset":[{"outline-offset":[ur,J]}],"outline-w":[{outline:[ur,Nr]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[ur,Nr]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Lr,RS]}],"shadow-color":[{shadow:[Ai]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...Q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Q()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Lr,J]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[m]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[m]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",J]}],duration:[{duration:G()}],ease:[{ease:["linear","in","out","in-out",J]}],delay:[{delay:G()}],animate:[{animate:["none","spin","ping","pulse","bounce",J]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Oi,J]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",J]}],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",J]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",J]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[ur,Nr,Iu]}],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"]}}},NS=mS(IS);function wn(...t){return NS(Jy(t))}const LS=JE,s0=w.forwardRef(({className:t,...e},r)=>S.jsx(Vy,{ref:r,className:wn("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}));s0.displayName=Vy.displayName;const $S=YE("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"}}),i0=w.forwardRef(({className:t,variant:e,...r},n)=>S.jsx(Wy,{ref:n,className:wn($S({variant:e}),t),...r}));i0.displayName=Wy.displayName;const DS=w.forwardRef(({className:t,...e},r)=>S.jsx(Ky,{ref:r,className:wn("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}));DS.displayName=Ky.displayName;const o0=w.forwardRef(({className:t,...e},r)=>S.jsx(Qy,{ref:r,className:wn("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:S.jsx(rS,{className:"h-4 w-4"})}));o0.displayName=Qy.displayName;const a0=w.forwardRef(({className:t,...e},r)=>S.jsx(Hy,{ref:r,className:wn("text-sm font-semibold",t),...e}));a0.displayName=Hy.displayName;const l0=w.forwardRef(({className:t,...e},r)=>S.jsx(qy,{ref:r,className:wn("text-sm opacity-90",t),...e}));l0.displayName=qy.displayName;function MS(){const{toasts:t}=by();return S.jsxs(LS,{children:[t.map(function({id:e,title:r,description:n,action:s,...i}){return S.jsxs(i0,{...i,children:[S.jsxs("div",{className:"grid gap-1",children:[r&&S.jsx(a0,{children:r}),n&&S.jsx(l0,{children:n})]}),s,S.jsx(o0,{})]},e)}),S.jsx(s0,{})]})}var Dp=["light","dark"],US="(prefers-color-scheme: dark)",FS=w.createContext(void 0),zS={setTheme:t=>{},themes:[]},BS=()=>{var t;return(t=w.useContext(FS))!=null?t:zS};w.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(_=>`'${_}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,d=s?Dp.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(_,y=!1,v=!0)=>{let g=o?o[_]:_,p=y?_+"|| ''":`'${g}'`,m="";return s&&v&&!y&&Dp.includes(_)&&(m+=`d.style.colorScheme = '${_}';`),r==="class"?y||g?m+=`c.add(${p})`:m+="null":g&&(m+=`d[s](n,${p})`),m},h=t?`!function(){${c}${f(t)}}()`:n?`!function(){try{${c}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${US}',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 w.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:h}})});var VS=t=>{switch(t){case"success":return qS;case"info":return QS;case"warning":return KS;case"error":return GS;default:return null}},WS=Array(12).fill(0),HS=({visible:t,className:e})=>I.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},I.createElement("div",{className:"sonner-spinner"},WS.map((r,n)=>I.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),qS=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),KS=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},I.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"})),QS=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),GS=I.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},I.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"})),JS=I.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"},I.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),I.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),YS=()=>{let[t,e]=I.useState(document.hidden);return I.useEffect(()=>{let r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t},qc=1,XS=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:qc++,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],I.isValidElement(l))s=!1,this.create({id:r,type:"default",message:l});else if(e1(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)||qc++;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}},et=new XS,ZS=(t,e)=>{let r=(e==null?void 0:e.id)||qc++;return et.addToast({title:t,...e,id:r}),r},e1=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",t1=ZS,r1=()=>et.toasts,n1=()=>et.getActiveToasts(),ZO=Object.assign(t1,{success:et.success,info:et.info,warning:et.warning,error:et.error,custom:et.custom,message:et.message,promise:et.promise,dismiss:et.dismiss,loading:et.loading},{getHistory:r1,getToasts:n1});function s1(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))}s1(`: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 da(t){return t.label!==void 0}var i1=3,o1="32px",a1="16px",Mp=4e3,l1=356,u1=14,c1=20,d1=200;function jt(...t){return t.filter(Boolean).join(" ")}function h1(t){let[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}var f1=t=>{var e,r,n,s,i,o,a,l,u,c,d;let{invert:f,toast:h,unstyled:_,interacting:y,setHeights:v,visibleToasts:g,heights:p,index:m,toasts:b,expanded:x,removeToast:k,defaultRichColors:C,closeButton:T,style:j,cancelButtonStyle:A,actionButtonStyle:B,className:L="",descriptionClassName:q="",duration:N,position:Z,gap:H,loadingIcon:Q,expandByDefault:P,classNames:R,icons:$,closeButtonAriaLabel:G="Close toast",pauseWhenPageIsHidden:z}=t,[Y,ee]=I.useState(null),[Ee,Ue]=I.useState(null),[se,ns]=I.useState(!1),[Tr,xn]=I.useState(!1),[Pr,ss]=I.useState(!1),[Rr,Bo]=I.useState(!1),[Zl,Vo]=I.useState(!1),[eu,_i]=I.useState(0),[is,df]=I.useState(0),bi=I.useRef(h.duration||N||Mp),hf=I.useRef(null),En=I.useRef(null),g_=m===0,v_=m+1<=g,wt=h.type,os=h.dismissible!==!1,y_=h.className||"",w_=h.descriptionClassName||"",Wo=I.useMemo(()=>p.findIndex(K=>K.toastId===h.id)||0,[p,h.id]),__=I.useMemo(()=>{var K;return(K=h.closeButton)!=null?K:T},[h.closeButton,T]),ff=I.useMemo(()=>h.duration||N||Mp,[h.duration,N]),tu=I.useRef(0),as=I.useRef(0),pf=I.useRef(0),ls=I.useRef(null),[b_,x_]=Z.split("-"),mf=I.useMemo(()=>p.reduce((K,ae,fe)=>fe>=Wo?K:K+ae.height,0),[p,Wo]),gf=YS(),E_=h.invert||f,ru=wt==="loading";as.current=I.useMemo(()=>Wo*H+mf,[Wo,mf]),I.useEffect(()=>{bi.current=ff},[ff]),I.useEffect(()=>{ns(!0)},[]),I.useEffect(()=>{let K=En.current;if(K){let ae=K.getBoundingClientRect().height;return df(ae),v(fe=>[{toastId:h.id,height:ae,position:h.position},...fe]),()=>v(fe=>fe.filter(Pt=>Pt.toastId!==h.id))}},[v,h.id]),I.useLayoutEffect(()=>{if(!se)return;let K=En.current,ae=K.style.height;K.style.height="auto";let fe=K.getBoundingClientRect().height;K.style.height=ae,df(fe),v(Pt=>Pt.find(Rt=>Rt.toastId===h.id)?Pt.map(Rt=>Rt.toastId===h.id?{...Rt,height:fe}:Rt):[{toastId:h.id,height:fe,position:h.position},...Pt])},[se,h.title,h.description,v,h.id]);let Or=I.useCallback(()=>{xn(!0),_i(as.current),v(K=>K.filter(ae=>ae.toastId!==h.id)),setTimeout(()=>{k(h)},d1)},[h,k,v,as]);I.useEffect(()=>{if(h.promise&&wt==="loading"||h.duration===1/0||h.type==="loading")return;let K;return x||y||z&&gf?(()=>{if(pf.current<tu.current){let ae=new Date().getTime()-tu.current;bi.current=bi.current-ae}pf.current=new Date().getTime()})():bi.current!==1/0&&(tu.current=new Date().getTime(),K=setTimeout(()=>{var ae;(ae=h.onAutoClose)==null||ae.call(h,h),Or()},bi.current)),()=>clearTimeout(K)},[x,y,h,wt,z,gf,Or]),I.useEffect(()=>{h.delete&&Or()},[Or,h.delete]);function S_(){var K,ae,fe;return $!=null&&$.loading?I.createElement("div",{className:jt(R==null?void 0:R.loader,(K=h==null?void 0:h.classNames)==null?void 0:K.loader,"sonner-loader"),"data-visible":wt==="loading"},$.loading):Q?I.createElement("div",{className:jt(R==null?void 0:R.loader,(ae=h==null?void 0:h.classNames)==null?void 0:ae.loader,"sonner-loader"),"data-visible":wt==="loading"},Q):I.createElement(HS,{className:jt(R==null?void 0:R.loader,(fe=h==null?void 0:h.classNames)==null?void 0:fe.loader),visible:wt==="loading"})}return I.createElement("li",{tabIndex:0,ref:En,className:jt(L,y_,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[wt],(r=h==null?void 0:h.classNames)==null?void 0:r[wt]),"data-sonner-toast":"","data-rich-colors":(n=h.richColors)!=null?n:C,"data-styled":!(h.jsx||h.unstyled||_),"data-mounted":se,"data-promise":!!h.promise,"data-swiped":Zl,"data-removed":Tr,"data-visible":v_,"data-y-position":b_,"data-x-position":x_,"data-index":m,"data-front":g_,"data-swiping":Pr,"data-dismissible":os,"data-type":wt,"data-invert":E_,"data-swipe-out":Rr,"data-swipe-direction":Ee,"data-expanded":!!(x||P&&se),style:{"--index":m,"--toasts-before":m,"--z-index":b.length-m,"--offset":`${Tr?eu:as.current}px`,"--initial-height":P?"auto":`${is}px`,...j,...h.style},onDragEnd:()=>{ss(!1),ee(null),ls.current=null},onPointerDown:K=>{ru||!os||(hf.current=new Date,_i(as.current),K.target.setPointerCapture(K.pointerId),K.target.tagName!=="BUTTON"&&(ss(!0),ls.current={x:K.clientX,y:K.clientY}))},onPointerUp:()=>{var K,ae,fe,Pt;if(Rr||!os)return;ls.current=null;let Rt=Number(((K=En.current)==null?void 0:K.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ar=Number(((ae=En.current)==null?void 0:ae.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Sn=new Date().getTime()-((fe=hf.current)==null?void 0:fe.getTime()),Ot=Y==="x"?Rt:Ar,jr=Math.abs(Ot)/Sn;if(Math.abs(Ot)>=c1||jr>.11){_i(as.current),(Pt=h.onDismiss)==null||Pt.call(h,h),Ue(Y==="x"?Rt>0?"right":"left":Ar>0?"down":"up"),Or(),Bo(!0),Vo(!1);return}ss(!1),ee(null)},onPointerMove:K=>{var ae,fe,Pt,Rt;if(!ls.current||!os||((ae=window.getSelection())==null?void 0:ae.toString().length)>0)return;let Ar=K.clientY-ls.current.y,Sn=K.clientX-ls.current.x,Ot=(fe=t.swipeDirections)!=null?fe:h1(Z);!Y&&(Math.abs(Sn)>1||Math.abs(Ar)>1)&&ee(Math.abs(Sn)>Math.abs(Ar)?"x":"y");let jr={x:0,y:0};Y==="y"?(Ot.includes("top")||Ot.includes("bottom"))&&(Ot.includes("top")&&Ar<0||Ot.includes("bottom")&&Ar>0)&&(jr.y=Ar):Y==="x"&&(Ot.includes("left")||Ot.includes("right"))&&(Ot.includes("left")&&Sn<0||Ot.includes("right")&&Sn>0)&&(jr.x=Sn),(Math.abs(jr.x)>0||Math.abs(jr.y)>0)&&Vo(!0),(Pt=En.current)==null||Pt.style.setProperty("--swipe-amount-x",`${jr.x}px`),(Rt=En.current)==null||Rt.style.setProperty("--swipe-amount-y",`${jr.y}px`)}},__&&!h.jsx?I.createElement("button",{"aria-label":G,"data-disabled":ru,"data-close-button":!0,onClick:ru||!os?()=>{}:()=>{var K;Or(),(K=h.onDismiss)==null||K.call(h,h)},className:jt(R==null?void 0:R.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},(i=$==null?void 0:$.close)!=null?i:JS):null,h.jsx||w.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:I.createElement(I.Fragment,null,wt||h.icon||h.promise?I.createElement("div",{"data-icon":"",className:jt(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||S_():null,h.type!=="loading"?h.icon||($==null?void 0:$[wt])||VS(wt):null):null,I.createElement("div",{"data-content":"",className:jt(R==null?void 0:R.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},I.createElement("div",{"data-title":"",className:jt(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?I.createElement("div",{"data-description":"",className:jt(q,w_,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),w.isValidElement(h.cancel)?h.cancel:h.cancel&&da(h.cancel)?I.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||A,onClick:K=>{var ae,fe;da(h.cancel)&&os&&((fe=(ae=h.cancel).onClick)==null||fe.call(ae,K),Or())},className:jt(R==null?void 0:R.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,w.isValidElement(h.action)?h.action:h.action&&da(h.action)?I.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||B,onClick:K=>{var ae,fe;da(h.action)&&((fe=(ae=h.action).onClick)==null||fe.call(ae,K),!K.defaultPrevented&&Or())},className:jt(R==null?void 0:R.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function Up(){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 p1(t,e){let r={};return[t,e].forEach((n,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",a=i?a1:o1;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 m1=w.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:_=i1,toastOptions:y,dir:v=Up(),gap:g=u1,loadingIcon:p,icons:m,containerAriaLabel:b="Notifications",pauseWhenPageIsHidden:x}=t,[k,C]=I.useState([]),T=I.useMemo(()=>Array.from(new Set([n].concat(k.filter(z=>z.position).map(z=>z.position)))),[k,n]),[j,A]=I.useState([]),[B,L]=I.useState(!1),[q,N]=I.useState(!1),[Z,H]=I.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Q=I.useRef(null),P=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),R=I.useRef(null),$=I.useRef(!1),G=I.useCallback(z=>{C(Y=>{var ee;return(ee=Y.find(Ee=>Ee.id===z.id))!=null&&ee.delete||et.dismiss(z.id),Y.filter(({id:Ee})=>Ee!==z.id)})},[]);return I.useEffect(()=>et.subscribe(z=>{if(z.dismiss){C(Y=>Y.map(ee=>ee.id===z.id?{...ee,delete:!0}:ee));return}setTimeout(()=>{wy.flushSync(()=>{C(Y=>{let ee=Y.findIndex(Ee=>Ee.id===z.id);return ee!==-1?[...Y.slice(0,ee),{...Y[ee],...z},...Y.slice(ee+1)]:[z,...Y]})})})}),[]),I.useEffect(()=>{if(c!=="system"){H(c);return}if(c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;let z=window.matchMedia("(prefers-color-scheme: dark)");try{z.addEventListener("change",({matches:Y})=>{H(Y?"dark":"light")})}catch{z.addListener(({matches:ee})=>{try{H(ee?"dark":"light")}catch(Ee){console.error(Ee)}})}},[c]),I.useEffect(()=>{k.length<=1&&L(!1)},[k]),I.useEffect(()=>{let z=Y=>{var ee,Ee;s.every(Ue=>Y[Ue]||Y.code===Ue)&&(L(!0),(ee=Q.current)==null||ee.focus()),Y.code==="Escape"&&(document.activeElement===Q.current||(Ee=Q.current)!=null&&Ee.contains(document.activeElement))&&L(!1)};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[s]),I.useEffect(()=>{if(Q.current)return()=>{R.current&&(R.current.focus({preventScroll:!0}),R.current=null,$.current=!1)}},[Q.current]),I.createElement("section",{ref:e,"aria-label":`${b} ${P}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},T.map((z,Y)=>{var ee;let[Ee,Ue]=z.split("-");return k.length?I.createElement("ol",{key:z,dir:v==="auto"?Up():v,tabIndex:-1,ref:Q,className:a,"data-sonner-toaster":!0,"data-theme":Z,"data-y-position":Ee,"data-lifted":B&&k.length>1&&!i,"data-x-position":Ue,style:{"--front-toast-height":`${((ee=j[0])==null?void 0:ee.height)||0}px`,"--width":`${l1}px`,"--gap":`${g}px`,...h,...p1(l,u)},onBlur:se=>{$.current&&!se.currentTarget.contains(se.relatedTarget)&&($.current=!1,R.current&&(R.current.focus({preventScroll:!0}),R.current=null))},onFocus:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||$.current||($.current=!0,R.current=se.relatedTarget)},onMouseEnter:()=>L(!0),onMouseMove:()=>L(!0),onMouseLeave:()=>{q||L(!1)},onDragEnd:()=>L(!1),onPointerDown:se=>{se.target instanceof HTMLElement&&se.target.dataset.dismissible==="false"||N(!0)},onPointerUp:()=>N(!1)},k.filter(se=>!se.position&&Y===0||se.position===z).map((se,ns)=>{var Tr,xn;return I.createElement(f1,{key:se.id,icons:m,index:ns,toast:se,defaultRichColors:d,duration:(Tr=y==null?void 0:y.duration)!=null?Tr:f,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:r,visibleToasts:_,closeButton:(xn=y==null?void 0:y.closeButton)!=null?xn:o,interacting:q,position:z,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:G,toasts:k.filter(Pr=>Pr.position==se.position),heights:j.filter(Pr=>Pr.position==se.position),setHeights:A,expandByDefault:i,gap:g,loadingIcon:p,expanded:B,pauseWhenPageIsHidden:x,swipeDirections:t.swipeDirections})})):null}))});const g1=({...t})=>{const{theme:e="system"}=BS();return S.jsx(m1,{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})};var v1=Ld[" useId ".trim().toString()]||(()=>{}),y1=0;function w1(t){const[e,r]=w.useState(v1());return xr(()=>{r(n=>n??String(y1++))},[t]),e?`radix-${e}`:""}const _1=["top","right","bottom","left"],pn=Math.min,ct=Math.max,cl=Math.round,ha=Math.floor,nr=t=>({x:t,y:t}),b1={left:"right",right:"left",bottom:"top",top:"bottom"},x1={start:"end",end:"start"};function Kc(t,e,r){return ct(t,pn(e,r))}function Er(t,e){return typeof t=="function"?t(e):t}function Sr(t){return t.split("-")[0]}function hi(t){return t.split("-")[1]}function jh(t){return t==="x"?"y":"x"}function Ih(t){return t==="y"?"height":"width"}const E1=new Set(["top","bottom"]);function er(t){return E1.has(Sr(t))?"y":"x"}function Nh(t){return jh(er(t))}function S1(t,e,r){r===void 0&&(r=!1);const n=hi(t),s=Nh(t),i=Ih(s);let o=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=dl(o)),[o,dl(o)]}function k1(t){const e=dl(t);return[Qc(t),e,Qc(e)]}function Qc(t){return t.replace(/start|end/g,e=>x1[e])}const Fp=["left","right"],zp=["right","left"],C1=["top","bottom"],T1=["bottom","top"];function P1(t,e,r){switch(t){case"top":case"bottom":return r?e?zp:Fp:e?Fp:zp;case"left":case"right":return e?C1:T1;default:return[]}}function R1(t,e,r,n){const s=hi(t);let i=P1(Sr(t),r==="start",n);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(Qc)))),i}function dl(t){return t.replace(/left|right|bottom|top/g,e=>b1[e])}function O1(t){return{top:0,right:0,bottom:0,left:0,...t}}function u0(t){return typeof t!="number"?O1(t):{top:t,right:t,bottom:t,left:t}}function hl(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 Bp(t,e,r){let{reference:n,floating:s}=t;const i=er(e),o=Nh(e),a=Ih(o),l=Sr(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(hi(e)){case"start":h[o]-=f*(r&&u?-1:1);break;case"end":h[o]+=f*(r&&u?-1:1);break}return h}const A1=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}=Bp(u,n,l),f=n,h={},_=0;for(let y=0;y<a.length;y++){const{name:v,fn:g}=a[y],{x:p,y:m,data:b,reset:x}=await g({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=m??d,h={...h,[v]:{...h[v],...b}},x&&_<=50&&(_++,typeof x=="object"&&(x.placement&&(f=x.placement),x.rects&&(u=x.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:s}):x.rects),{x:c,y:d}=Bp(u,f,l)),y=-1)}return{x:c,y:d,placement:f,strategy:s,middlewareData:h}};async function go(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}=Er(e,t),_=u0(h),v=a[f?d==="floating"?"reference":"floating":d],g=hl(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(v)))==null||r?v:v.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,m=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),b=await(i.isElement==null?void 0:i.isElement(m))?await(i.getScale==null?void 0:i.getScale(m))||{x:1,y:1}:{x:1,y:1},x=hl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:p,offsetParent:m,strategy:l}):p);return{top:(g.top-x.top+_.top)/b.y,bottom:(x.bottom-g.bottom+_.bottom)/b.y,left:(g.left-x.left+_.left)/b.x,right:(x.right-g.right+_.right)/b.x}}const j1=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}=Er(t,e)||{};if(u==null)return{};const d=u0(c),f={x:r,y:n},h=Nh(s),_=Ih(h),y=await o.getDimensions(u),v=h==="y",g=v?"top":"left",p=v?"bottom":"right",m=v?"clientHeight":"clientWidth",b=i.reference[_]+i.reference[h]-f[h]-i.floating[_],x=f[h]-i.reference[h],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let C=k?k[m]:0;(!C||!await(o.isElement==null?void 0:o.isElement(k)))&&(C=a.floating[m]||i.floating[_]);const T=b/2-x/2,j=C/2-y[_]/2-1,A=pn(d[g],j),B=pn(d[p],j),L=A,q=C-y[_]-B,N=C/2-y[_]/2+T,Z=Kc(L,N,q),H=!l.arrow&&hi(s)!=null&&N!==Z&&i.reference[_]/2-(N<L?A:B)-y[_]/2<0,Q=H?N<L?N-L:N-q:0;return{[h]:f[h]+Q,data:{[h]:Z,centerOffset:N-Z-Q,...H&&{alignmentOffset:Q}},reset:H}}}),I1=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:_="none",flipAlignment:y=!0,...v}=Er(t,e);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const g=Sr(s),p=er(a),m=Sr(a)===a,b=await(l.isRTL==null?void 0:l.isRTL(u.floating)),x=f||(m||!y?[dl(a)]:k1(a)),k=_!=="none";!f&&k&&x.push(...R1(a,y,_,b));const C=[a,...x],T=await go(e,v),j=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(c&&j.push(T[g]),d){const N=S1(s,o,b);j.push(T[N[0]],T[N[1]])}if(A=[...A,{placement:s,overflows:j}],!j.every(N=>N<=0)){var B,L;const N=(((B=i.flip)==null?void 0:B.index)||0)+1,Z=C[N];if(Z&&(!(d==="alignment"?p!==er(Z):!1)||A.every(P=>P.overflows[0]>0&&er(P.placement)===p)))return{data:{index:N,overflows:A},reset:{placement:Z}};let H=(L=A.filter(Q=>Q.overflows[0]<=0).sort((Q,P)=>Q.overflows[1]-P.overflows[1])[0])==null?void 0:L.placement;if(!H)switch(h){case"bestFit":{var q;const Q=(q=A.filter(P=>{if(k){const R=er(P.placement);return R===p||R==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(R=>R>0).reduce((R,$)=>R+$,0)]).sort((P,R)=>P[1]-R[1])[0])==null?void 0:q[0];Q&&(H=Q);break}case"initialPlacement":H=a;break}if(s!==H)return{reset:{placement:H}}}return{}}}};function Vp(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function Wp(t){return _1.some(e=>t[e]>=0)}const N1=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...s}=Er(t,e);switch(n){case"referenceHidden":{const i=await go(e,{...s,elementContext:"reference"}),o=Vp(i,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:Wp(o)}}}case"escaped":{const i=await go(e,{...s,altBoundary:!0}),o=Vp(i,r.floating);return{data:{escapedOffsets:o,escaped:Wp(o)}}}default:return{}}}}},c0=new Set(["left","top"]);async function L1(t,e){const{placement:r,platform:n,elements:s}=t,i=await(n.isRTL==null?void 0:n.isRTL(s.floating)),o=Sr(r),a=hi(r),l=er(r)==="y",u=c0.has(o)?-1:1,c=i&&l?-1:1,d=Er(e,t);let{mainAxis:f,crossAxis:h,alignmentAxis:_}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof _=="number"&&(h=a==="end"?_*-1:_),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}const $1=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 L1(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}}}}},D1=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:v=>{let{x:g,y:p}=v;return{x:g,y:p}}},...l}=Er(t,e),u={x:r,y:n},c=await go(e,l),d=er(Sr(s)),f=jh(d);let h=u[f],_=u[d];if(i){const v=f==="y"?"top":"left",g=f==="y"?"bottom":"right",p=h+c[v],m=h-c[g];h=Kc(p,h,m)}if(o){const v=d==="y"?"top":"left",g=d==="y"?"bottom":"right",p=_+c[v],m=_-c[g];_=Kc(p,_,m)}const y=a.fn({...e,[f]:h,[d]:_});return{...y,data:{x:y.x-r,y:y.y-n,enabled:{[f]:i,[d]:o}}}}}},M1=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}=Er(t,e),c={x:r,y:n},d=er(s),f=jh(d);let h=c[f],_=c[d];const y=Er(a,e),v=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const m=f==="y"?"height":"width",b=i.reference[f]-i.floating[m]+v.mainAxis,x=i.reference[f]+i.reference[m]-v.mainAxis;h<b?h=b:h>x&&(h=x)}if(u){var g,p;const m=f==="y"?"width":"height",b=c0.has(Sr(s)),x=i.reference[d]-i.floating[m]+(b&&((g=o.offset)==null?void 0:g[d])||0)+(b?0:v.crossAxis),k=i.reference[d]+i.reference[m]+(b?0:((p=o.offset)==null?void 0:p[d])||0)-(b?v.crossAxis:0);_<x?_=x:_>k&&(_=k)}return{[f]:h,[d]:_}}}},U1=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}=Er(t,e),c=await go(e,u),d=Sr(s),f=hi(s),h=er(s)==="y",{width:_,height:y}=i.floating;let v,g;d==="top"||d==="bottom"?(v=d,g=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(g=d,v=f==="end"?"top":"bottom");const p=y-c.top-c.bottom,m=_-c.left-c.right,b=pn(y-c[v],p),x=pn(_-c[g],m),k=!e.middlewareData.shift;let C=b,T=x;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(T=m),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(C=p),k&&!f){const A=ct(c.left,0),B=ct(c.right,0),L=ct(c.top,0),q=ct(c.bottom,0);h?T=_-2*(A!==0||B!==0?A+B:ct(c.left,c.right)):C=y-2*(L!==0||q!==0?L+q:ct(c.top,c.bottom))}await l({...e,availableWidth:T,availableHeight:C});const j=await o.getDimensions(a.floating);return _!==j.width||y!==j.height?{reset:{rects:!0}}:{}}}};function Bl(){return typeof window<"u"}function fi(t){return d0(t)?(t.nodeName||"").toLowerCase():"#document"}function mt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ar(t){var e;return(e=(d0(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function d0(t){return Bl()?t instanceof Node||t instanceof mt(t).Node:!1}function qt(t){return Bl()?t instanceof Element||t instanceof mt(t).Element:!1}function sr(t){return Bl()?t instanceof HTMLElement||t instanceof mt(t).HTMLElement:!1}function Hp(t){return!Bl()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof mt(t).ShadowRoot}const F1=new Set(["inline","contents"]);function Do(t){const{overflow:e,overflowX:r,overflowY:n,display:s}=Kt(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!F1.has(s)}const z1=new Set(["table","td","th"]);function B1(t){return z1.has(fi(t))}const V1=[":popover-open",":modal"];function Vl(t){return V1.some(e=>{try{return t.matches(e)}catch{return!1}})}const W1=["transform","translate","scale","rotate","perspective"],H1=["transform","translate","scale","rotate","perspective","filter"],q1=["paint","layout","strict","content"];function Lh(t){const e=$h(),r=qt(t)?Kt(t):t;return W1.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)||H1.some(n=>(r.willChange||"").includes(n))||q1.some(n=>(r.contain||"").includes(n))}function K1(t){let e=mn(t);for(;sr(e)&&!ii(e);){if(Lh(e))return e;if(Vl(e))return null;e=mn(e)}return null}function $h(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Q1=new Set(["html","body","#document"]);function ii(t){return Q1.has(fi(t))}function Kt(t){return mt(t).getComputedStyle(t)}function Wl(t){return qt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function mn(t){if(fi(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Hp(t)&&t.host||ar(t);return Hp(e)?e.host:e}function h0(t){const e=mn(t);return ii(e)?t.ownerDocument?t.ownerDocument.body:t.body:sr(e)&&Do(e)?e:h0(e)}function vo(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const s=h0(t),i=s===((n=t.ownerDocument)==null?void 0:n.body),o=mt(s);if(i){const a=Gc(o);return e.concat(o,o.visualViewport||[],Do(s)?s:[],a&&r?vo(a):[])}return e.concat(s,vo(s,[],r))}function Gc(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function f0(t){const e=Kt(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const s=sr(t),i=s?t.offsetWidth:r,o=s?t.offsetHeight:n,a=cl(r)!==i||cl(n)!==o;return a&&(r=i,n=o),{width:r,height:n,$:a}}function Dh(t){return qt(t)?t:t.contextElement}function Ms(t){const e=Dh(t);if(!sr(e))return nr(1);const r=e.getBoundingClientRect(),{width:n,height:s,$:i}=f0(e);let o=(i?cl(r.width):r.width)/n,a=(i?cl(r.height):r.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const G1=nr(0);function p0(t){const e=mt(t);return!$h()||!e.visualViewport?G1:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function J1(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==mt(t)?!1:e}function Xn(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const s=t.getBoundingClientRect(),i=Dh(t);let o=nr(1);e&&(n?qt(n)&&(o=Ms(n)):o=Ms(t));const a=J1(i,r,n)?p0(i):nr(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=mt(i),h=n&&qt(n)?mt(n):n;let _=f,y=Gc(_);for(;y&&n&&h!==_;){const v=Ms(y),g=y.getBoundingClientRect(),p=Kt(y),m=g.left+(y.clientLeft+parseFloat(p.paddingLeft))*v.x,b=g.top+(y.clientTop+parseFloat(p.paddingTop))*v.y;l*=v.x,u*=v.y,c*=v.x,d*=v.y,l+=m,u+=b,_=mt(y),y=Gc(_)}}return hl({width:c,height:d,x:l,y:u})}function Mh(t,e){const r=Wl(t).scrollLeft;return e?e.left+r:Xn(ar(t)).left+r}function m0(t,e,r){r===void 0&&(r=!1);const n=t.getBoundingClientRect(),s=n.left+e.scrollLeft-(r?0:Mh(t,n)),i=n.top+e.scrollTop;return{x:s,y:i}}function Y1(t){let{elements:e,rect:r,offsetParent:n,strategy:s}=t;const i=s==="fixed",o=ar(n),a=e?Vl(e.floating):!1;if(n===o||a&&i)return r;let l={scrollLeft:0,scrollTop:0},u=nr(1);const c=nr(0),d=sr(n);if((d||!d&&!i)&&((fi(n)!=="body"||Do(o))&&(l=Wl(n)),sr(n))){const h=Xn(n);u=Ms(n),c.x=h.x+n.clientLeft,c.y=h.y+n.clientTop}const f=o&&!d&&!i?m0(o,l,!0):nr(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 X1(t){return Array.from(t.getClientRects())}function Z1(t){const e=ar(t),r=Wl(t),n=t.ownerDocument.body,s=ct(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ct(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+Mh(t);const a=-r.scrollTop;return Kt(n).direction==="rtl"&&(o+=ct(e.clientWidth,n.clientWidth)-s),{width:s,height:i,x:o,y:a}}function ek(t,e){const r=mt(t),n=ar(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=$h();(!u||u&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:i,height:o,x:a,y:l}}const tk=new Set(["absolute","fixed"]);function rk(t,e){const r=Xn(t,!0,e==="fixed"),n=r.top+t.clientTop,s=r.left+t.clientLeft,i=sr(t)?Ms(t):nr(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 qp(t,e,r){let n;if(e==="viewport")n=ek(t,r);else if(e==="document")n=Z1(ar(t));else if(qt(e))n=rk(e,r);else{const s=p0(t);n={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return hl(n)}function g0(t,e){const r=mn(t);return r===e||!qt(r)||ii(r)?!1:Kt(r).position==="fixed"||g0(r,e)}function nk(t,e){const r=e.get(t);if(r)return r;let n=vo(t,[],!1).filter(a=>qt(a)&&fi(a)!=="body"),s=null;const i=Kt(t).position==="fixed";let o=i?mn(t):t;for(;qt(o)&&!ii(o);){const a=Kt(o),l=Lh(o);!l&&a.position==="fixed"&&(s=null),(i?!l&&!s:!l&&a.position==="static"&&!!s&&tk.has(s.position)||Do(o)&&!l&&g0(t,o))?n=n.filter(c=>c!==o):s=a,o=mn(o)}return e.set(t,n),n}function sk(t){let{element:e,boundary:r,rootBoundary:n,strategy:s}=t;const o=[...r==="clippingAncestors"?Vl(e)?[]:nk(e,this._c):[].concat(r),n],a=o[0],l=o.reduce((u,c)=>{const d=qp(e,c,s);return u.top=ct(d.top,u.top),u.right=pn(d.right,u.right),u.bottom=pn(d.bottom,u.bottom),u.left=ct(d.left,u.left),u},qp(e,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function ik(t){const{width:e,height:r}=f0(t);return{width:e,height:r}}function ok(t,e,r){const n=sr(e),s=ar(e),i=r==="fixed",o=Xn(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=nr(0);function u(){l.x=Mh(s)}if(n||!n&&!i)if((fi(e)!=="body"||Do(s))&&(a=Wl(e)),n){const h=Xn(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?m0(s,a):nr(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 Nu(t){return Kt(t).position==="static"}function Kp(t,e){if(!sr(t)||Kt(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return ar(t)===r&&(r=r.ownerDocument.body),r}function v0(t,e){const r=mt(t);if(Vl(t))return r;if(!sr(t)){let s=mn(t);for(;s&&!ii(s);){if(qt(s)&&!Nu(s))return s;s=mn(s)}return r}let n=Kp(t,e);for(;n&&B1(n)&&Nu(n);)n=Kp(n,e);return n&&ii(n)&&Nu(n)&&!Lh(n)?r:n||K1(t)||r}const ak=async function(t){const e=this.getOffsetParent||v0,r=this.getDimensions,n=await r(t.floating);return{reference:ok(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function lk(t){return Kt(t).direction==="rtl"}const uk={convertOffsetParentRelativeRectToViewportRelativeRect:Y1,getDocumentElement:ar,getClippingRect:sk,getOffsetParent:v0,getElementRects:ak,getClientRects:X1,getDimensions:ik,getScale:Ms,isElement:qt,isRTL:lk};function y0(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function ck(t,e){let r=null,n;const s=ar(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 _=ha(d),y=ha(s.clientWidth-(c+f)),v=ha(s.clientHeight-(d+h)),g=ha(c),m={rootMargin:-_+"px "+-y+"px "+-v+"px "+-g+"px",threshold:ct(0,pn(1,l))||1};let b=!0;function x(k){const C=k[0].intersectionRatio;if(C!==l){if(!b)return o();C?o(!1,C):n=setTimeout(()=>{o(!1,1e-7)},1e3)}C===1&&!y0(u,t.getBoundingClientRect())&&o(),b=!1}try{r=new IntersectionObserver(x,{...m,root:s.ownerDocument})}catch{r=new IntersectionObserver(x,m)}r.observe(t)}return o(!0),i}function dk(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=Dh(t),c=s||i?[...u?vo(u):[],...vo(e)]:[];c.forEach(g=>{s&&g.addEventListener("scroll",r,{passive:!0}),i&&g.addEventListener("resize",r)});const d=u&&a?ck(u,r):null;let f=-1,h=null;o&&(h=new ResizeObserver(g=>{let[p]=g;p&&p.target===u&&h&&(h.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var m;(m=h)==null||m.observe(e)})),r()}),u&&!l&&h.observe(u),h.observe(e));let _,y=l?Xn(t):null;l&&v();function v(){const g=Xn(t);y&&!y0(y,g)&&r(),y=g,_=requestAnimationFrame(v)}return r(),()=>{var g;c.forEach(p=>{s&&p.removeEventListener("scroll",r),i&&p.removeEventListener("resize",r)}),d==null||d(),(g=h)==null||g.disconnect(),h=null,l&&cancelAnimationFrame(_)}}const hk=$1,fk=D1,pk=I1,mk=U1,gk=N1,Qp=j1,vk=M1,yk=(t,e,r)=>{const n=new Map,s={platform:uk,...r},i={...s.platform,_c:n};return A1(t,e,{...s,platform:i})};var wk=typeof document<"u",_k=function(){},Ma=wk?w.useLayoutEffect:_k;function fl(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(!fl(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)&&!fl(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function w0(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Gp(t,e){const r=w0(t);return Math.round(e*r)/r}function Lu(t){const e=w.useRef(t);return Ma(()=>{e.current=t}),e}function bk(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]=w.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[f,h]=w.useState(n);fl(f,n)||h(n);const[_,y]=w.useState(null),[v,g]=w.useState(null),p=w.useCallback(P=>{P!==k.current&&(k.current=P,y(P))},[]),m=w.useCallback(P=>{P!==C.current&&(C.current=P,g(P))},[]),b=i||_,x=o||v,k=w.useRef(null),C=w.useRef(null),T=w.useRef(c),j=l!=null,A=Lu(l),B=Lu(s),L=Lu(u),q=w.useCallback(()=>{if(!k.current||!C.current)return;const P={placement:e,strategy:r,middleware:f};B.current&&(P.platform=B.current),yk(k.current,C.current,P).then(R=>{const $={...R,isPositioned:L.current!==!1};N.current&&!fl(T.current,$)&&(T.current=$,Lo.flushSync(()=>{d($)}))})},[f,e,r,B,L]);Ma(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(P=>({...P,isPositioned:!1})))},[u]);const N=w.useRef(!1);Ma(()=>(N.current=!0,()=>{N.current=!1}),[]),Ma(()=>{if(b&&(k.current=b),x&&(C.current=x),b&&x){if(A.current)return A.current(b,x,q);q()}},[b,x,q,A,j]);const Z=w.useMemo(()=>({reference:k,floating:C,setReference:p,setFloating:m}),[p,m]),H=w.useMemo(()=>({reference:b,floating:x}),[b,x]),Q=w.useMemo(()=>{const P={position:r,left:0,top:0};if(!H.floating)return P;const R=Gp(H.floating,c.x),$=Gp(H.floating,c.y);return a?{...P,transform:"translate("+R+"px, "+$+"px)",...w0(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:R,top:$}},[r,a,H.floating,c.x,c.y]);return w.useMemo(()=>({...c,update:q,refs:Z,elements:H,floatingStyles:Q}),[c,q,Z,H,Q])}const xk=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?Qp({element:n.current,padding:s}).fn(r):{}:n?Qp({element:n,padding:s}).fn(r):{}}}},Ek=(t,e)=>({...hk(t),options:[t,e]}),Sk=(t,e)=>({...fk(t),options:[t,e]}),kk=(t,e)=>({...vk(t),options:[t,e]}),Ck=(t,e)=>({...pk(t),options:[t,e]}),Tk=(t,e)=>({...mk(t),options:[t,e]}),Pk=(t,e)=>({...gk(t),options:[t,e]}),Rk=(t,e)=>({...xk(t),options:[t,e]});var Ok="Arrow",_0=w.forwardRef((t,e)=>{const{children:r,width:n=10,height:s=5,...i}=t;return S.jsx(at.svg,{...i,ref:e,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:S.jsx("polygon",{points:"0,0 30,0 15,10"})})});_0.displayName=Ok;var Ak=_0;function jk(t){const[e,r]=w.useState(void 0);return xr(()=>{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 Uh="Popper",[b0,x0]=Ul(Uh),[Ik,E0]=b0(Uh),S0=t=>{const{__scopePopper:e,children:r}=t,[n,s]=w.useState(null);return S.jsx(Ik,{scope:e,anchor:n,onAnchorChange:s,children:r})};S0.displayName=Uh;var k0="PopperAnchor",C0=w.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...s}=t,i=E0(k0,r),o=w.useRef(null),a=Ht(e,o);return w.useEffect(()=>{i.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:S.jsx(at.div,{...s,ref:a})});C0.displayName=k0;var Fh="PopperContent",[Nk,Lk]=b0(Fh),T0=w.forwardRef((t,e)=>{var se,ns,Tr,xn,Pr,ss;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}=t,v=E0(Fh,r),[g,p]=w.useState(null),m=Ht(e,Rr=>p(Rr)),[b,x]=w.useState(null),k=jk(b),C=(k==null?void 0:k.width)??0,T=(k==null?void 0:k.height)??0,j=n+(i!=="center"?"-"+i:""),A=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},B=Array.isArray(u)?u:[u],L=B.length>0,q={padding:A,boundary:B.filter(Dk),altBoundary:L},{refs:N,floatingStyles:Z,placement:H,isPositioned:Q,middlewareData:P}=bk({strategy:"fixed",placement:j,whileElementsMounted:(...Rr)=>dk(...Rr,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[Ek({mainAxis:s+T,alignmentAxis:o}),l&&Sk({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?kk():void 0,...q}),l&&Ck({...q}),Tk({...q,apply:({elements:Rr,rects:Bo,availableWidth:Zl,availableHeight:Vo})=>{const{width:eu,height:_i}=Bo.reference,is=Rr.floating.style;is.setProperty("--radix-popper-available-width",`${Zl}px`),is.setProperty("--radix-popper-available-height",`${Vo}px`),is.setProperty("--radix-popper-anchor-width",`${eu}px`),is.setProperty("--radix-popper-anchor-height",`${_i}px`)}}),b&&Rk({element:b,padding:a}),Mk({arrowWidth:C,arrowHeight:T}),f&&Pk({strategy:"referenceHidden",...q})]}),[R,$]=O0(H),G=fn(_);xr(()=>{Q&&(G==null||G())},[Q,G]);const z=(se=P.arrow)==null?void 0:se.x,Y=(ns=P.arrow)==null?void 0:ns.y,ee=((Tr=P.arrow)==null?void 0:Tr.centerOffset)!==0,[Ee,Ue]=w.useState();return xr(()=>{g&&Ue(window.getComputedStyle(g).zIndex)},[g]),S.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:Q?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ee,"--radix-popper-transform-origin":[(xn=P.transformOrigin)==null?void 0:xn.x,(Pr=P.transformOrigin)==null?void 0:Pr.y].join(" "),...((ss=P.hide)==null?void 0:ss.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:S.jsx(Nk,{scope:r,placedSide:R,onArrowChange:x,arrowX:z,arrowY:Y,shouldHideArrow:ee,children:S.jsx(at.div,{"data-side":R,"data-align":$,...y,ref:m,style:{...y.style,animation:Q?void 0:"none"}})})})});T0.displayName=Fh;var P0="PopperArrow",$k={top:"bottom",right:"left",bottom:"top",left:"right"},R0=w.forwardRef(function(e,r){const{__scopePopper:n,...s}=e,i=Lk(P0,n),o=$k[i.placedSide];return S.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:S.jsx(Ak,{...s,ref:r,style:{...s.style,display:"block"}})})});R0.displayName=P0;function Dk(t){return t!==null}var Mk=t=>({name:"transformOrigin",options:t,fn(e){var v,g,p;const{placement:r,rects:n,middlewareData:s}=e,o=((v=s.arrow)==null?void 0:v.centerOffset)!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[u,c]=O0(r),d={start:"0%",center:"50%",end:"100%"}[c],f=(((g=s.arrow)==null?void 0:g.x)??0)+a/2,h=(((p=s.arrow)==null?void 0:p.y)??0)+l/2;let _="",y="";return u==="bottom"?(_=o?d:`${f}px`,y=`${-l}px`):u==="top"?(_=o?d:`${f}px`,y=`${n.floating.height+l}px`):u==="right"?(_=`${-l}px`,y=o?d:`${h}px`):u==="left"&&(_=`${n.floating.width+l}px`,y=o?d:`${h}px`),{data:{x:_,y}}}});function O0(t){const[e,r="center"]=t.split("-");return[e,r]}var Uk=S0,Fk=C0,zk=T0,Bk=R0,[Hl,eA]=Ul("Tooltip",[x0]),ql=x0(),A0="TooltipProvider",Vk=700,Jc="tooltip.open",[Wk,zh]=Hl(A0),j0=t=>{const{__scopeTooltip:e,delayDuration:r=Vk,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:i}=t,o=w.useRef(!0),a=w.useRef(!1),l=w.useRef(0);return w.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),S.jsx(Wk,{scope:e,isOpenDelayedRef:o,delayDuration:r,onOpen:w.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:w.useCallback(u=>{a.current=u},[]),disableHoverableContent:s,children:i})};j0.displayName=A0;var yo="Tooltip",[Hk,Kl]=Hl(yo),I0=t=>{const{__scopeTooltip:e,children:r,open:n,defaultOpen:s,onOpenChange:i,disableHoverableContent:o,delayDuration:a}=t,l=zh(yo,t.__scopeTooltip),u=ql(e),[c,d]=w.useState(null),f=w1(),h=w.useRef(0),_=o??l.disableHoverableContent,y=a??l.delayDuration,v=w.useRef(!1),[g,p]=Ry({prop:n,defaultProp:s??!1,onChange:C=>{C?(l.onOpen(),document.dispatchEvent(new CustomEvent(Jc))):l.onClose(),i==null||i(C)},caller:yo}),m=w.useMemo(()=>g?v.current?"delayed-open":"instant-open":"closed",[g]),b=w.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,p(!0)},[p]),x=w.useCallback(()=>{window.clearTimeout(h.current),h.current=0,p(!1)},[p]),k=w.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,p(!0),h.current=0},y)},[y,p]);return w.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),S.jsx(Uk,{...u,children:S.jsx(Hk,{scope:e,contentId:f,open:g,stateAttribute:m,trigger:c,onTriggerChange:d,onTriggerEnter:w.useCallback(()=>{l.isOpenDelayedRef.current?k():b()},[l.isOpenDelayedRef,k,b]),onTriggerLeave:w.useCallback(()=>{_?x():(window.clearTimeout(h.current),h.current=0)},[x,_]),onOpen:b,onClose:x,disableHoverableContent:_,children:r})})};I0.displayName=yo;var Yc="TooltipTrigger",N0=w.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,s=Kl(Yc,r),i=zh(Yc,r),o=ql(r),a=w.useRef(null),l=Ht(e,a,s.onTriggerChange),u=w.useRef(!1),c=w.useRef(!1),d=w.useCallback(()=>u.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),S.jsx(Fk,{asChild:!0,...o,children:S.jsx(at.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:l,onPointerMove:Oe(t.onPointerMove,f=>{f.pointerType!=="touch"&&!c.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),c.current=!0)}),onPointerLeave:Oe(t.onPointerLeave,()=>{s.onTriggerLeave(),c.current=!1}),onPointerDown:Oe(t.onPointerDown,()=>{s.open&&s.onClose(),u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Oe(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:Oe(t.onBlur,s.onClose),onClick:Oe(t.onClick,s.onClose)})})});N0.displayName=Yc;var qk="TooltipPortal",[tA,Kk]=Hl(qk,{forceMount:void 0}),oi="TooltipContent",L0=w.forwardRef((t,e)=>{const r=Kk(oi,t.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...i}=t,o=Kl(oi,t.__scopeTooltip);return S.jsx(Th,{present:n||o.open,children:o.disableHoverableContent?S.jsx($0,{side:s,...i,ref:e}):S.jsx(Qk,{side:s,...i,ref:e})})}),Qk=w.forwardRef((t,e)=>{const r=Kl(oi,t.__scopeTooltip),n=zh(oi,t.__scopeTooltip),s=w.useRef(null),i=Ht(e,s),[o,a]=w.useState(null),{trigger:l,onClose:u}=r,c=s.current,{onPointerInTransitChange:d}=n,f=w.useCallback(()=>{a(null),d(!1)},[d]),h=w.useCallback((_,y)=>{const v=_.currentTarget,g={x:_.clientX,y:_.clientY},p=Zk(g,v.getBoundingClientRect()),m=eC(g,p),b=tC(y.getBoundingClientRect()),x=nC([...m,...b]);a(x),d(!0)},[d]);return w.useEffect(()=>()=>f(),[f]),w.useEffect(()=>{if(l&&c){const _=v=>h(v,c),y=v=>h(v,l);return l.addEventListener("pointerleave",_),c.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",_),c.removeEventListener("pointerleave",y)}}},[l,c,h,f]),w.useEffect(()=>{if(o){const _=y=>{const v=y.target,g={x:y.clientX,y:y.clientY},p=(l==null?void 0:l.contains(v))||(c==null?void 0:c.contains(v)),m=!rC(g,o);p?f():m&&(f(),u())};return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[l,c,o,u,f]),S.jsx($0,{...t,ref:i})}),[Gk,Jk]=Hl(yo,{isInside:!1}),Yk=lE("TooltipContent"),$0=w.forwardRef((t,e)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,l=Kl(oi,r),u=ql(r),{onClose:c}=l;return w.useEffect(()=>(document.addEventListener(Jc,c),()=>document.removeEventListener(Jc,c)),[c]),w.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]),S.jsx(Ch,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:c,children:S.jsxs(zk,{"data-state":l.stateAttribute,...u,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[S.jsx(Yk,{children:n}),S.jsx(Gk,{scope:r,isInside:!0,children:S.jsx(jE,{id:l.contentId,role:"tooltip",children:s||n})})]})})});L0.displayName=oi;var D0="TooltipArrow",Xk=w.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,s=ql(r);return Jk(D0,r).isInside?null:S.jsx(Bk,{...s,...n,ref:e})});Xk.displayName=D0;function Zk(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 eC(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 tC(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 rC(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 nC(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),sC(e)}function sC(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 iC=j0,oC=I0,aC=N0,M0=L0;const lC=iC,rA=oC,nA=aC,uC=w.forwardRef(({className:t,sideOffset:e=4,...r},n)=>S.jsx(M0,{ref:n,sideOffset:e,className:wn("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}));uC.displayName=M0.displayName;var Mo=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(){}},Zn=typeof window>"u"||"Deno"in globalThis;function tt(){}function cC(t,e){return typeof t=="function"?t(e):t}function Xc(t){return typeof t=="number"&&t>=0&&t!==1/0}function U0(t,e){return Math.max(t+(e||0)-Date.now(),0)}function un(t,e){return typeof t=="function"?t(e):t}function bt(t,e){return typeof t=="function"?t(e):t}function Jp(t,e){const{type:r="all",exact:n,fetchStatus:s,predicate:i,queryKey:o,stale:a}=t;if(o){if(n){if(e.queryHash!==Bh(o,e.options))return!1}else if(!_o(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 Yp(t,e){const{exact:r,status:n,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(r){if(wo(e.options.mutationKey)!==wo(i))return!1}else if(!_o(e.options.mutationKey,i))return!1}return!(n&&e.state.status!==n||s&&!s(e))}function Bh(t,e){return((e==null?void 0:e.queryKeyHashFn)||wo)(t)}function wo(t){return JSON.stringify(t,(e,r)=>ed(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function _o(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(r=>_o(t[r],e[r])):!1}function F0(t,e){if(t===e)return t;const r=Xp(t)&&Xp(e);if(r||ed(t)&&ed(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]=F0(t[d],e[d]),a[d]===t[d]&&t[d]!==void 0&&u++)}return s===o&&u===s?t:a}return e}function Zc(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const r in t)if(t[r]!==e[r])return!1;return!0}function Xp(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function ed(t){if(!Zp(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!Zp(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Zp(t){return Object.prototype.toString.call(t)==="[object Object]"}function dC(t){return new Promise(e=>{setTimeout(e,t)})}function td(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?F0(t,e):e}function hC(t,e,r=0){const n=[...t,e];return r&&n.length>r?n.slice(1):n}function fC(t,e,r=0){const n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var Vh=Symbol();function z0(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===Vh?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function pC(t,e){return typeof t=="function"?t(...e):!!t}var $n,Vr,Fs,Jm,mC=(Jm=class extends Mo{constructor(){super();V(this,$n);V(this,Vr);V(this,Fs);M(this,Fs,e=>{if(!Zn&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){E(this,Vr)||this.setEventListener(E(this,Fs))}onUnsubscribe(){var e;this.hasListeners()||((e=E(this,Vr))==null||e.call(this),M(this,Vr,void 0))}setEventListener(e){var r;M(this,Fs,e),(r=E(this,Vr))==null||r.call(this),M(this,Vr,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){E(this,$n)!==e&&(M(this,$n,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof E(this,$n)=="boolean"?E(this,$n):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},$n=new WeakMap,Vr=new WeakMap,Fs=new WeakMap,Jm),Wh=new mC,zs,Wr,Bs,Ym,gC=(Ym=class extends Mo{constructor(){super();V(this,zs,!0);V(this,Wr);V(this,Bs);M(this,Bs,e=>{if(!Zn&&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(){E(this,Wr)||this.setEventListener(E(this,Bs))}onUnsubscribe(){var e;this.hasListeners()||((e=E(this,Wr))==null||e.call(this),M(this,Wr,void 0))}setEventListener(e){var r;M(this,Bs,e),(r=E(this,Wr))==null||r.call(this),M(this,Wr,e(this.setOnline.bind(this)))}setOnline(e){E(this,zs)!==e&&(M(this,zs,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return E(this,zs)}},zs=new WeakMap,Wr=new WeakMap,Bs=new WeakMap,Ym),pl=new gC;function rd(){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 vC(t){return Math.min(1e3*2**t,3e4)}function B0(t){return(t??"online")==="online"?pl.isOnline():!0}var V0=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function $u(t){return t instanceof V0}function W0(t){let e=!1,r=0,n=!1,s;const i=rd(),o=y=>{var v;n||(f(new V0(y)),(v=t.abort)==null||v.call(t))},a=()=>{e=!0},l=()=>{e=!1},u=()=>Wh.isFocused()&&(t.networkMode==="always"||pl.isOnline())&&t.canRun(),c=()=>B0(t.networkMode)&&t.canRun(),d=y=>{var v;n||(n=!0,(v=t.onSuccess)==null||v.call(t,y),s==null||s(),i.resolve(y))},f=y=>{var v;n||(n=!0,(v=t.onError)==null||v.call(t,y),s==null||s(),i.reject(y))},h=()=>new Promise(y=>{var v;s=g=>{(n||u())&&y(g)},(v=t.onPause)==null||v.call(t)}).then(()=>{var y;s=void 0,n||(y=t.onContinue)==null||y.call(t)}),_=()=>{if(n)return;let y;const v=r===0?t.initialPromise:void 0;try{y=v??t.fn()}catch(g){y=Promise.reject(g)}Promise.resolve(y).then(d).catch(g=>{var k;if(n)return;const p=t.retry??(Zn?0:3),m=t.retryDelay??vC,b=typeof m=="function"?m(r,g):m,x=p===!0||typeof p=="number"&&r<p||typeof p=="function"&&p(r,g);if(e||!x){f(g);return}r++,(k=t.onFail)==null||k.call(t,r,g),dC(b).then(()=>u()?void 0:h()).then(()=>{e?f(g):_()})})};return{promise:i,cancel:o,continue:()=>(s==null||s(),i),cancelRetry:a,continueRetry:l,canStart:c,start:()=>(c()?_():h().then(_),i)}}var yC=t=>setTimeout(t,0);function wC(){let t=[],e=0,r=a=>{a()},n=a=>{a()},s=yC;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 $e=wC(),Dn,Xm,H0=(Xm=class{constructor(){V(this,Dn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Xc(this.gcTime)&&M(this,Dn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Zn?1/0:5*60*1e3))}clearGcTimeout(){E(this,Dn)&&(clearTimeout(E(this,Dn)),M(this,Dn,void 0))}},Dn=new WeakMap,Xm),Vs,Mn,_t,Un,Ve,Co,Fn,Dt,cr,Zm,_C=(Zm=class extends H0{constructor(e){super();V(this,Dt);V(this,Vs);V(this,Mn);V(this,_t);V(this,Un);V(this,Ve);V(this,Co);V(this,Fn);M(this,Fn,!1),M(this,Co,e.defaultOptions),this.setOptions(e.options),this.observers=[],M(this,Un,e.client),M(this,_t,E(this,Un).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,M(this,Vs,bC(this.options)),this.state=e.state??E(this,Vs),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=E(this,Ve))==null?void 0:e.promise}setOptions(e){this.options={...E(this,Co),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&E(this,_t).remove(this)}setData(e,r){const n=td(this.state.data,e,this.options);return te(this,Dt,cr).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){te(this,Dt,cr).call(this,{type:"setState",state:e,setStateOptions:r})}cancel(e){var n,s;const r=(n=E(this,Ve))==null?void 0:n.promise;return(s=E(this,Ve))==null||s.cancel(e),r?r.then(tt).catch(tt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(E(this,Vs))}isActive(){return this.observers.some(e=>bt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Vh||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>un(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:!U0(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=E(this,Ve))==null||r.continue()}onOnline(){var r;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=E(this,Ve))==null||r.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),E(this,_t).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(E(this,Ve)&&(E(this,Fn)?E(this,Ve).cancel({revert:!0}):E(this,Ve).cancelRetry()),this.scheduleGc()),E(this,_t).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||te(this,Dt,cr).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(E(this,Ve))return E(this,Ve).continueRetry(),E(this,Ve).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:()=>(M(this,Fn,!0),n.signal)})},i=()=>{const f=z0(this.options,r),_=(()=>{const y={client:E(this,Un),queryKey:this.queryKey,meta:this.meta};return s(y),y})();return M(this,Fn,!1),this.options.persister?this.options.persister(f,_,this):f(_)},a=(()=>{const f={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:E(this,Un),state:this.state,fetchFn:i};return s(f),f})();(u=this.options.behavior)==null||u.onFetch(a,this),M(this,Mn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&te(this,Dt,cr).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const l=f=>{var h,_,y,v;$u(f)&&f.silent||te(this,Dt,cr).call(this,{type:"error",error:f}),$u(f)||((_=(h=E(this,_t).config).onError)==null||_.call(h,f,this),(v=(y=E(this,_t).config).onSettled)==null||v.call(y,this.state.data,f,this)),this.scheduleGc()};return M(this,Ve,W0({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{var h,_,y,v;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(g){l(g);return}(_=(h=E(this,_t).config).onSuccess)==null||_.call(h,f,this),(v=(y=E(this,_t).config).onSettled)==null||v.call(y,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,h)=>{te(this,Dt,cr).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{te(this,Dt,cr).call(this,{type:"pause"})},onContinue:()=>{te(this,Dt,cr).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),E(this,Ve).start()}},Vs=new WeakMap,Mn=new WeakMap,_t=new WeakMap,Un=new WeakMap,Ve=new WeakMap,Co=new WeakMap,Fn=new WeakMap,Dt=new WeakSet,cr=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,...q0(n.data,this.options),fetchMeta:e.meta??null};case"success":return M(this,Mn,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 $u(s)&&s.revert&&E(this,Mn)?{...E(this,Mn),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),$e.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),E(this,_t).notify({query:this,type:"updated",action:e})})},Zm);function q0(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:B0(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function bC(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 Jt,eg,xC=(eg=class extends Mo{constructor(e={}){super();V(this,Jt);this.config=e,M(this,Jt,new Map)}build(e,r,n){const s=r.queryKey,i=r.queryHash??Bh(s,r);let o=this.get(i);return o||(o=new _C({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){E(this,Jt).has(e.queryHash)||(E(this,Jt).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=E(this,Jt).get(e.queryHash);r&&(e.destroy(),r===e&&E(this,Jt).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){$e.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return E(this,Jt).get(e)}getAll(){return[...E(this,Jt).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(n=>Jp(r,n))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(n=>Jp(e,n)):r}notify(e){$e.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){$e.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){$e.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Jt=new WeakMap,eg),Yt,qe,zn,Xt,Dr,tg,EC=(tg=class extends H0{constructor(e){super();V(this,Xt);V(this,Yt);V(this,qe);V(this,zn);this.mutationId=e.mutationId,M(this,qe,e.mutationCache),M(this,Yt,[]),this.state=e.state||SC(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){E(this,Yt).includes(e)||(E(this,Yt).push(e),this.clearGcTimeout(),E(this,qe).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){M(this,Yt,E(this,Yt).filter(r=>r!==e)),this.scheduleGc(),E(this,qe).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){E(this,Yt).length||(this.state.status==="pending"?this.scheduleGc():E(this,qe).remove(this))}continue(){var e;return((e=E(this,zn))==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,g,p,m,b,x,k,C,T;const r=()=>{te(this,Xt,Dr).call(this,{type:"continue"})};M(this,zn,W0({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(j,A)=>{te(this,Xt,Dr).call(this,{type:"failed",failureCount:j,error:A})},onPause:()=>{te(this,Xt,Dr).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>E(this,qe).canRun(this)}));const n=this.state.status==="pending",s=!E(this,zn).canStart();try{if(n)r();else{te(this,Xt,Dr).call(this,{type:"pending",variables:e,isPaused:s}),await((o=(i=E(this,qe).config).onMutate)==null?void 0:o.call(i,e,this));const A=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,e));A!==this.state.context&&te(this,Xt,Dr).call(this,{type:"pending",context:A,variables:e,isPaused:s})}const j=await E(this,zn).start();return await((c=(u=E(this,qe).config).onSuccess)==null?void 0:c.call(u,j,e,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,j,e,this.state.context)),await((_=(h=E(this,qe).config).onSettled)==null?void 0:_.call(h,j,null,this.state.variables,this.state.context,this)),await((v=(y=this.options).onSettled)==null?void 0:v.call(y,j,null,e,this.state.context)),te(this,Xt,Dr).call(this,{type:"success",data:j}),j}catch(j){try{throw await((p=(g=E(this,qe).config).onError)==null?void 0:p.call(g,j,e,this.state.context,this)),await((b=(m=this.options).onError)==null?void 0:b.call(m,j,e,this.state.context)),await((k=(x=E(this,qe).config).onSettled)==null?void 0:k.call(x,void 0,j,this.state.variables,this.state.context,this)),await((T=(C=this.options).onSettled)==null?void 0:T.call(C,void 0,j,e,this.state.context)),j}finally{te(this,Xt,Dr).call(this,{type:"error",error:j})}}finally{E(this,qe).runNext(this)}}},Yt=new WeakMap,qe=new WeakMap,zn=new WeakMap,Xt=new WeakSet,Dr=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),$e.batch(()=>{E(this,Yt).forEach(n=>{n.onMutationUpdate(e)}),E(this,qe).notify({mutation:this,type:"updated",action:e})})},tg);function SC(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var pr,Mt,To,rg,kC=(rg=class extends Mo{constructor(e={}){super();V(this,pr);V(this,Mt);V(this,To);this.config=e,M(this,pr,new Set),M(this,Mt,new Map),M(this,To,0)}build(e,r,n){const s=new EC({mutationCache:this,mutationId:++Ho(this,To)._,options:e.defaultMutationOptions(r),state:n});return this.add(s),s}add(e){E(this,pr).add(e);const r=fa(e);if(typeof r=="string"){const n=E(this,Mt).get(r);n?n.push(e):E(this,Mt).set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(E(this,pr).delete(e)){const r=fa(e);if(typeof r=="string"){const n=E(this,Mt).get(r);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&E(this,Mt).delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){const r=fa(e);if(typeof r=="string"){const n=E(this,Mt).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=fa(e);if(typeof r=="string"){const s=(n=E(this,Mt).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(){$e.batch(()=>{E(this,pr).forEach(e=>{this.notify({type:"removed",mutation:e})}),E(this,pr).clear(),E(this,Mt).clear()})}getAll(){return Array.from(E(this,pr))}find(e){const r={exact:!0,...e};return this.getAll().find(n=>Yp(r,n))}findAll(e={}){return this.getAll().filter(r=>Yp(e,r))}notify(e){$e.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>r.state.isPaused);return $e.batch(()=>Promise.all(e.map(r=>r.continue().catch(tt))))}},pr=new WeakMap,Mt=new WeakMap,To=new WeakMap,rg);function fa(t){var e;return(e=t.options.scope)==null?void 0:e.id}function em(t){return{onFetch:(e,r)=>{var c,d,f,h,_;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=((_=e.state.data)==null?void 0:_.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let y=!1;const v=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(e.signal.aborted?y=!0:e.signal.addEventListener("abort",()=>{y=!0}),e.signal)})},g=z0(e.options,e.fetchOptions),p=async(m,b,x)=>{if(y)return Promise.reject();if(b==null&&m.pages.length)return Promise.resolve(m);const C=(()=>{const B={client:e.client,queryKey:e.queryKey,pageParam:b,direction:x?"backward":"forward",meta:e.options.meta};return v(B),B})(),T=await g(C),{maxPages:j}=e.options,A=x?fC:hC;return{pages:A(m.pages,T,j),pageParams:A(m.pageParams,b,j)}};if(s&&i.length){const m=s==="backward",b=m?CC:tm,x={pages:i,pageParams:o},k=b(n,x);a=await p(x,k,m)}else{const m=t??i.length;do{const b=l===0?o[0]??n.initialPageParam:tm(n,a);if(l>0&&b==null)break;a=await p(a,b),l++}while(l<m)}return a};e.options.persister?e.fetchFn=()=>{var y,v;return(v=(y=e.options).persister)==null?void 0:v.call(y,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=u}}}function tm(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 CC(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 we,Hr,qr,Ws,Hs,Kr,qs,Ks,ng,TC=(ng=class{constructor(t={}){V(this,we);V(this,Hr);V(this,qr);V(this,Ws);V(this,Hs);V(this,Kr);V(this,qs);V(this,Ks);M(this,we,t.queryCache||new xC),M(this,Hr,t.mutationCache||new kC),M(this,qr,t.defaultOptions||{}),M(this,Ws,new Map),M(this,Hs,new Map),M(this,Kr,0)}mount(){Ho(this,Kr)._++,E(this,Kr)===1&&(M(this,qs,Wh.subscribe(async t=>{t&&(await this.resumePausedMutations(),E(this,we).onFocus())})),M(this,Ks,pl.subscribe(async t=>{t&&(await this.resumePausedMutations(),E(this,we).onOnline())})))}unmount(){var t,e;Ho(this,Kr)._--,E(this,Kr)===0&&((t=E(this,qs))==null||t.call(this),M(this,qs,void 0),(e=E(this,Ks))==null||e.call(this),M(this,Ks,void 0))}isFetching(t){return E(this,we).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return E(this,Hr).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=E(this,we).get(e.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),r=E(this,we).build(this,e),n=r.state.data;return n===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(un(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return E(this,we).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=E(this,we).get(n.queryHash),i=s==null?void 0:s.state.data,o=cC(e,i);if(o!==void 0)return E(this,we).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(t,e,r){return $e.batch(()=>E(this,we).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,r)]))}getQueryState(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=E(this,we).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=E(this,we);$e.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=E(this,we);return $e.batch(()=>(r.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const r={revert:!0,...e},n=$e.batch(()=>E(this,we).findAll(t).map(s=>s.cancel(r)));return Promise.all(n).then(tt).catch(tt)}invalidateQueries(t,e={}){return $e.batch(()=>(E(this,we).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=$e.batch(()=>E(this,we).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,r);return r.throwOnError||(i=i.catch(tt)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(tt)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=E(this,we).build(this,e);return r.isStaleByTime(un(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(tt).catch(tt)}fetchInfiniteQuery(t){return t.behavior=em(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(tt).catch(tt)}ensureInfiniteQueryData(t){return t.behavior=em(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return pl.isOnline()?E(this,Hr).resumePausedMutations():Promise.resolve()}getQueryCache(){return E(this,we)}getMutationCache(){return E(this,Hr)}getDefaultOptions(){return E(this,qr)}setDefaultOptions(t){M(this,qr,t)}setQueryDefaults(t,e){E(this,Ws).set(wo(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...E(this,Ws).values()],r={};return e.forEach(n=>{_o(t,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(t,e){E(this,Hs).set(wo(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...E(this,Hs).values()],r={};return e.forEach(n=>{_o(t,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...E(this,qr).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Bh(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===Vh&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...E(this,qr).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){E(this,we).clear(),E(this,Hr).clear()}},we=new WeakMap,Hr=new WeakMap,qr=new WeakMap,Ws=new WeakMap,Hs=new WeakMap,Kr=new WeakMap,qs=new WeakMap,Ks=new WeakMap,ng),Ze,re,Po,Ke,Bn,Qs,Qr,Gr,Ro,Gs,Js,Vn,Wn,Jr,Ys,ie,Di,nd,sd,id,od,ad,ld,ud,K0,sg,PC=(sg=class extends Mo{constructor(e,r){super();V(this,ie);V(this,Ze);V(this,re);V(this,Po);V(this,Ke);V(this,Bn);V(this,Qs);V(this,Qr);V(this,Gr);V(this,Ro);V(this,Gs);V(this,Js);V(this,Vn);V(this,Wn);V(this,Jr);V(this,Ys,new Set);this.options=r,M(this,Ze,e),M(this,Gr,null),M(this,Qr,rd()),this.options.experimental_prefetchInRender||E(this,Qr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(E(this,re).addObserver(this),rm(E(this,re),this.options)?te(this,ie,Di).call(this):this.updateResult(),te(this,ie,od).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return cd(E(this,re),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return cd(E(this,re),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,te(this,ie,ad).call(this),te(this,ie,ld).call(this),E(this,re).removeObserver(this)}setOptions(e){const r=this.options,n=E(this,re);if(this.options=E(this,Ze).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof bt(this.options.enabled,E(this,re))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");te(this,ie,ud).call(this),E(this,re).setOptions(this.options),r._defaulted&&!Zc(this.options,r)&&E(this,Ze).getQueryCache().notify({type:"observerOptionsUpdated",query:E(this,re),observer:this});const s=this.hasListeners();s&&nm(E(this,re),n,this.options,r)&&te(this,ie,Di).call(this),this.updateResult(),s&&(E(this,re)!==n||bt(this.options.enabled,E(this,re))!==bt(r.enabled,E(this,re))||un(this.options.staleTime,E(this,re))!==un(r.staleTime,E(this,re)))&&te(this,ie,nd).call(this);const i=te(this,ie,sd).call(this);s&&(E(this,re)!==n||bt(this.options.enabled,E(this,re))!==bt(r.enabled,E(this,re))||i!==E(this,Jr))&&te(this,ie,id).call(this,i)}getOptimisticResult(e){const r=E(this,Ze).getQueryCache().build(E(this,Ze),e),n=this.createResult(r,e);return OC(this,n)&&(M(this,Ke,n),M(this,Qs,this.options),M(this,Bn,E(this,re).state)),n}getCurrentResult(){return E(this,Ke)}trackResult(e,r){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),r==null||r(s),Reflect.get(n,s))})}trackProp(e){E(this,Ys).add(e)}getCurrentQuery(){return E(this,re)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const r=E(this,Ze).defaultQueryOptions(e),n=E(this,Ze).getQueryCache().build(E(this,Ze),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(e){return te(this,ie,Di).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),E(this,Ke)))}createResult(e,r){var j;const n=E(this,re),s=this.options,i=E(this,Ke),o=E(this,Bn),a=E(this,Qs),u=e!==n?e.state:E(this,Po),{state:c}=e;let d={...c},f=!1,h;if(r._optimisticResults){const A=this.hasListeners(),B=!A&&rm(e,r),L=A&&nm(e,n,r,s);(B||L)&&(d={...d,...q0(c.data,e.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:_,errorUpdatedAt:y,status:v}=d;h=d.data;let g=!1;if(r.placeholderData!==void 0&&h===void 0&&v==="pending"){let A;i!=null&&i.isPlaceholderData&&r.placeholderData===(a==null?void 0:a.placeholderData)?(A=i.data,g=!0):A=typeof r.placeholderData=="function"?r.placeholderData((j=E(this,Js))==null?void 0:j.state.data,E(this,Js)):r.placeholderData,A!==void 0&&(v="success",h=td(i==null?void 0:i.data,A,r),f=!0)}if(r.select&&h!==void 0&&!g)if(i&&h===(o==null?void 0:o.data)&&r.select===E(this,Ro))h=E(this,Gs);else try{M(this,Ro,r.select),h=r.select(h),h=td(i==null?void 0:i.data,h,r),M(this,Gs,h),M(this,Gr,null)}catch(A){M(this,Gr,A)}E(this,Gr)&&(_=E(this,Gr),h=E(this,Gs),y=Date.now(),v="error");const p=d.fetchStatus==="fetching",m=v==="pending",b=v==="error",x=m&&p,k=h!==void 0,T={status:v,fetchStatus:d.fetchStatus,isPending:m,isSuccess:v==="success",isError:b,isInitialLoading:x,isLoading:x,data:h,dataUpdatedAt:d.dataUpdatedAt,error:_,errorUpdatedAt:y,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:p,isRefetching:p&&!m,isLoadingError:b&&!k,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:b&&k,isStale:Hh(e,r),refetch:this.refetch,promise:E(this,Qr),isEnabled:bt(r.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=q=>{T.status==="error"?q.reject(T.error):T.data!==void 0&&q.resolve(T.data)},B=()=>{const q=M(this,Qr,T.promise=rd());A(q)},L=E(this,Qr);switch(L.status){case"pending":e.queryHash===n.queryHash&&A(L);break;case"fulfilled":(T.status==="error"||T.data!==L.value)&&B();break;case"rejected":(T.status!=="error"||T.error!==L.reason)&&B();break}}return T}updateResult(){const e=E(this,Ke),r=this.createResult(E(this,re),this.options);if(M(this,Bn,E(this,re).state),M(this,Qs,this.options),E(this,Bn).data!==void 0&&M(this,Js,E(this,re)),Zc(r,e))return;M(this,Ke,r);const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!E(this,Ys).size)return!0;const o=new Set(i??E(this,Ys));return this.options.throwOnError&&o.add("error"),Object.keys(E(this,Ke)).some(a=>{const l=a;return E(this,Ke)[l]!==e[l]&&o.has(l)})};te(this,ie,K0).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&te(this,ie,od).call(this)}},Ze=new WeakMap,re=new WeakMap,Po=new WeakMap,Ke=new WeakMap,Bn=new WeakMap,Qs=new WeakMap,Qr=new WeakMap,Gr=new WeakMap,Ro=new WeakMap,Gs=new WeakMap,Js=new WeakMap,Vn=new WeakMap,Wn=new WeakMap,Jr=new WeakMap,Ys=new WeakMap,ie=new WeakSet,Di=function(e){te(this,ie,ud).call(this);let r=E(this,re).fetch(this.options,e);return e!=null&&e.throwOnError||(r=r.catch(tt)),r},nd=function(){te(this,ie,ad).call(this);const e=un(this.options.staleTime,E(this,re));if(Zn||E(this,Ke).isStale||!Xc(e))return;const n=U0(E(this,Ke).dataUpdatedAt,e)+1;M(this,Vn,setTimeout(()=>{E(this,Ke).isStale||this.updateResult()},n))},sd=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(E(this,re)):this.options.refetchInterval)??!1},id=function(e){te(this,ie,ld).call(this),M(this,Jr,e),!(Zn||bt(this.options.enabled,E(this,re))===!1||!Xc(E(this,Jr))||E(this,Jr)===0)&&M(this,Wn,setInterval(()=>{(this.options.refetchIntervalInBackground||Wh.isFocused())&&te(this,ie,Di).call(this)},E(this,Jr)))},od=function(){te(this,ie,nd).call(this),te(this,ie,id).call(this,te(this,ie,sd).call(this))},ad=function(){E(this,Vn)&&(clearTimeout(E(this,Vn)),M(this,Vn,void 0))},ld=function(){E(this,Wn)&&(clearInterval(E(this,Wn)),M(this,Wn,void 0))},ud=function(){const e=E(this,Ze).getQueryCache().build(E(this,Ze),this.options);if(e===E(this,re))return;const r=E(this,re);M(this,re,e),M(this,Po,e.state),this.hasListeners()&&(r==null||r.removeObserver(this),e.addObserver(this))},K0=function(e){$e.batch(()=>{e.listeners&&this.listeners.forEach(r=>{r(E(this,Ke))}),E(this,Ze).getQueryCache().notify({query:E(this,re),type:"observerResultsUpdated"})})},sg);function RC(t,e){return bt(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function rm(t,e){return RC(t,e)||t.state.data!==void 0&&cd(t,e,e.refetchOnMount)}function cd(t,e,r){if(bt(e.enabled,t)!==!1&&un(e.staleTime,t)!=="static"){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&Hh(t,e)}return!1}function nm(t,e,r,n){return(t!==e||bt(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&Hh(t,r)}function Hh(t,e){return bt(e.enabled,t)!==!1&&t.isStaleByTime(un(e.staleTime,t))}function OC(t,e){return!Zc(t.getCurrentResult(),e)}var Q0=w.createContext(void 0),AC=t=>{const e=w.useContext(Q0);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},jC=({client:t,children:e})=>(w.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),S.jsx(Q0.Provider,{value:t,children:e})),G0=w.createContext(!1),IC=()=>w.useContext(G0);G0.Provider;function NC(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var LC=w.createContext(NC()),$C=()=>w.useContext(LC),DC=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},MC=t=>{w.useEffect(()=>{t.clearReset()},[t])},UC=({result:t,errorResetBoundary:e,throwOnError:r,query:n,suspense:s})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(s&&t.data===void 0||pC(r,[t.error,n])),FC=t=>{if(t.suspense){const e=n=>n==="static"?n:Math.max(n??1e3,1e3),r=t.staleTime;t.staleTime=typeof r=="function"?(...n)=>e(r(...n)):e(r),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},zC=(t,e)=>t.isLoading&&t.isFetching&&!e,BC=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,sm=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function VC(t,e,r){var d,f,h,_,y;const n=IC(),s=$C(),i=AC(),o=i.defaultQueryOptions(t);(f=(d=i.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||f.call(d,o),o._optimisticResults=n?"isRestoring":"optimistic",FC(o),DC(o,s),MC(s);const a=!i.getQueryCache().get(o.queryHash),[l]=w.useState(()=>new e(i,o)),u=l.getOptimisticResult(o),c=!n&&t.subscribed!==!1;if(w.useSyncExternalStore(w.useCallback(v=>{const g=c?l.subscribe($e.batchCalls(v)):tt;return l.updateResult(),g},[l,c]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),w.useEffect(()=>{l.setOptions(o)},[o,l]),BC(o,u))throw sm(o,l,s);if(UC({result:u,errorResetBoundary:s,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((_=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||_.call(h,o,u),o.experimental_prefetchInRender&&!Zn&&zC(u,n)){const v=a?sm(o,l,s):(y=i.getQueryCache().get(o.queryHash))==null?void 0:y.promise;v==null||v.catch(tt).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?u:l.trackResult(u)}function WC(t,e){return VC(t,PC)}/**
 * @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 bo(){return bo=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},bo.apply(this,arguments)}var Zr;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(Zr||(Zr={}));const im="popstate";function HC(t){t===void 0&&(t={});function e(n,s){let{pathname:i,search:o,hash:a}=n.location;return dd("",{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:ml(s)}return KC(e,r,null,t)}function xe(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function J0(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function qC(){return Math.random().toString(36).substr(2,8)}function om(t,e){return{usr:t.state,key:t.key,idx:e}}function dd(t,e,r,n){return r===void 0&&(r=null),bo({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?pi(e):e,{state:r,key:e&&e.key||n||qC()})}function ml(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 pi(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 KC(t,e,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:i=!1}=n,o=s.history,a=Zr.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(bo({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function d(){a=Zr.Pop;let v=c(),g=v==null?null:v-u;u=v,l&&l({action:a,location:y.location,delta:g})}function f(v,g){a=Zr.Push;let p=dd(y.location,v,g);u=c()+1;let m=om(p,u),b=y.createHref(p);try{o.pushState(m,"",b)}catch(x){if(x instanceof DOMException&&x.name==="DataCloneError")throw x;s.location.assign(b)}i&&l&&l({action:a,location:y.location,delta:1})}function h(v,g){a=Zr.Replace;let p=dd(y.location,v,g);u=c();let m=om(p,u),b=y.createHref(p);o.replaceState(m,"",b),i&&l&&l({action:a,location:y.location,delta:0})}function _(v){let g=s.location.origin!=="null"?s.location.origin:s.location.href,p=typeof v=="string"?v:ml(v);return p=p.replace(/ $/,"%20"),xe(g,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,g)}let y={get action(){return a},get location(){return t(s,o)},listen(v){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(im,d),l=v,()=>{s.removeEventListener(im,d),l=null}},createHref(v){return e(s,v)},createURL:_,encodeLocation(v){let g=_(v);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:f,replace:h,go(v){return o.go(v)}};return y}var am;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(am||(am={}));function QC(t,e,r){return r===void 0&&(r="/"),GC(t,e,r,!1)}function GC(t,e,r,n){let s=typeof e=="string"?pi(e):e,i=qh(s.pathname||"/",r);if(i==null)return null;let o=Y0(t);JC(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let u=aT(i);a=iT(o[l],u,n)}return a}function Y0(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("/")&&(xe(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=cn([n,l.relativePath]),c=r.concat(l);i.children&&i.children.length>0&&(xe(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Y0(i.children,e,c,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:nT(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 X0(i.path))s(i,o,l)}),e}function X0(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=X0(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 JC(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:sT(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const YC=/^:[\w-]+$/,XC=3,ZC=2,eT=1,tT=10,rT=-2,lm=t=>t==="*";function nT(t,e){let r=t.split("/"),n=r.length;return r.some(lm)&&(n+=rT),e&&(n+=ZC),r.filter(s=>!lm(s)).reduce((s,i)=>s+(YC.test(i)?XC:i===""?eT:tT),n)}function sT(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 iT(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=um({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},c),f=l.route;if(!d&&u&&r&&!n[n.length-1].route.index&&(d=um({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},c)),!d)return null;Object.assign(s,d.params),o.push({params:s,pathname:cn([i,d.pathname]),pathnameBase:dT(cn([i,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(i=cn([i,d.pathnameBase]))}return o}function um(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=oT(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 y=a[d]||"";o=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const _=a[d];return h&&!_?u[f]=void 0:u[f]=(_||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:t}}function oT(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),J0(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 aT(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return J0(!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 qh(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)||"/"}function lT(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:s=""}=typeof t=="string"?pi(t):t;return{pathname:r?r.startsWith("/")?r:uT(r,e):e,search:hT(n),hash:fT(s)}}function uT(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function Du(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function cT(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function Kh(t,e){let r=cT(t);return e?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Qh(t,e,r,n){n===void 0&&(n=!1);let s;typeof t=="string"?s=pi(t):(s=bo({},t),xe(!s.pathname||!s.pathname.includes("?"),Du("?","pathname","search",s)),xe(!s.pathname||!s.pathname.includes("#"),Du("#","pathname","hash",s)),xe(!s.search||!s.search.includes("#"),Du("#","search","hash",s)));let i=t===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=r;else{let d=e.length-1;if(!n&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;s.pathname=f.join("/")}a=d>=0?e[d]:"/"}let l=lT(s,a),u=o&&o!=="/"&&o.endsWith("/"),c=(i||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const cn=t=>t.join("/").replace(/\/\/+/g,"/"),dT=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),hT=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,fT=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function pT(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const Z0=["post","put","patch","delete"];new Set(Z0);const mT=["get",...Z0];new Set(mT);/**
 * React Router v6.30.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function xo(){return xo=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},xo.apply(this,arguments)}const Gh=w.createContext(null),gT=w.createContext(null),_n=w.createContext(null),Ql=w.createContext(null),Cr=w.createContext({outlet:null,matches:[],isDataRoute:!1}),ew=w.createContext(null);function vT(t,e){let{relative:r}=e===void 0?{}:e;mi()||xe(!1);let{basename:n,navigator:s}=w.useContext(_n),{hash:i,pathname:o,search:a}=rw(t,{relative:r}),l=o;return n!=="/"&&(l=o==="/"?n:cn([n,o])),s.createHref({pathname:l,search:a,hash:i})}function mi(){return w.useContext(Ql)!=null}function rs(){return mi()||xe(!1),w.useContext(Ql).location}function tw(t){w.useContext(_n).static||w.useLayoutEffect(t)}function Jh(){let{isDataRoute:t}=w.useContext(Cr);return t?OT():yT()}function yT(){mi()||xe(!1);let t=w.useContext(Gh),{basename:e,future:r,navigator:n}=w.useContext(_n),{matches:s}=w.useContext(Cr),{pathname:i}=rs(),o=JSON.stringify(Kh(s,r.v7_relativeSplatPath)),a=w.useRef(!1);return tw(()=>{a.current=!0}),w.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){n.go(u);return}let d=Qh(u,JSON.parse(o),i,c.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:cn([e,d.pathname])),(c.replace?n.replace:n.push)(d,c.state,c)},[e,n,o,i,t])}function sA(){let{matches:t}=w.useContext(Cr),e=t[t.length-1];return e?e.params:{}}function rw(t,e){let{relative:r}=e===void 0?{}:e,{future:n}=w.useContext(_n),{matches:s}=w.useContext(Cr),{pathname:i}=rs(),o=JSON.stringify(Kh(s,n.v7_relativeSplatPath));return w.useMemo(()=>Qh(t,JSON.parse(o),i,r==="path"),[t,o,i,r])}function wT(t,e){return _T(t,e)}function _T(t,e,r,n){mi()||xe(!1);let{navigator:s}=w.useContext(_n),{matches:i}=w.useContext(Cr),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=rs(),c;if(e){var d;let v=typeof e=="string"?pi(e):e;l==="/"||(d=v.pathname)!=null&&d.startsWith(l)||xe(!1),c=v}else c=u;let f=c.pathname||"/",h=f;if(l!=="/"){let v=l.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(v.length).join("/")}let _=QC(t,{pathname:h}),y=kT(_&&_.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:cn([l,s.encodeLocation?s.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:cn([l,s.encodeLocation?s.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),i,r,n);return e&&y?w.createElement(Ql.Provider,{value:{location:xo({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Zr.Pop}},y):y}function bT(){let t=RT(),e=pT(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},e),r?w.createElement("pre",{style:s},r):null,null)}const xT=w.createElement(bT,null);class ET extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,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?w.createElement(Cr.Provider,{value:this.props.routeContext},w.createElement(ew.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function ST(t){let{routeContext:e,match:r,children:n}=t,s=w.useContext(Gh);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),w.createElement(Cr.Provider,{value:e},n)}function kT(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||xe(!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,_=d.route.loader&&f[d.route.id]===void 0&&(!h||h[d.route.id]===void 0);if(d.route.lazy||_){l=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((c,d,f)=>{let h,_=!1,y=null,v=null;r&&(h=a&&d.route.id?a[d.route.id]:void 0,y=d.route.errorElement||xT,l&&(u<0&&f===0?(_=!0,v=null):u===f&&(_=!0,v=d.route.hydrateFallbackElement||null)));let g=e.concat(o.slice(0,f+1)),p=()=>{let m;return h?m=y:_?m=v:d.route.Component?m=w.createElement(d.route.Component,null):d.route.element?m=d.route.element:m=c,w.createElement(ST,{match:d,routeContext:{outlet:c,matches:g,isDataRoute:r!=null},children:m})};return r&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?w.createElement(ET,{location:r.location,revalidation:r.revalidation,component:y,error:h,children:p(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):p()},null)}var nw=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(nw||{}),gl=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}(gl||{});function CT(t){let e=w.useContext(Gh);return e||xe(!1),e}function TT(t){let e=w.useContext(gT);return e||xe(!1),e}function PT(t){let e=w.useContext(Cr);return e||xe(!1),e}function sw(t){let e=PT(),r=e.matches[e.matches.length-1];return r.route.id||xe(!1),r.route.id}function RT(){var t;let e=w.useContext(ew),r=TT(gl.UseRouteError),n=sw(gl.UseRouteError);return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function OT(){let{router:t}=CT(nw.UseNavigateStable),e=sw(gl.UseNavigateStable),r=w.useRef(!1);return tw(()=>{r.current=!0}),w.useCallback(function(s,i){i===void 0&&(i={}),r.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,xo({fromRouteId:e},i)))},[t,e])}function AT(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function cm(t){let{to:e,replace:r,state:n,relative:s}=t;mi()||xe(!1);let{future:i,static:o}=w.useContext(_n),{matches:a}=w.useContext(Cr),{pathname:l}=rs(),u=Jh(),c=Qh(e,Kh(a,i.v7_relativeSplatPath),l,s==="path"),d=JSON.stringify(c);return w.useEffect(()=>u(JSON.parse(d),{replace:r,state:n,relative:s}),[u,d,s,r,n]),null}function je(t){xe(!1)}function jT(t){let{basename:e="/",children:r=null,location:n,navigationType:s=Zr.Pop,navigator:i,static:o=!1,future:a}=t;mi()&&xe(!1);let l=e.replace(/^\/*/,"/"),u=w.useMemo(()=>({basename:l,navigator:i,static:o,future:xo({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof n=="string"&&(n=pi(n));let{pathname:c="/",search:d="",hash:f="",state:h=null,key:_="default"}=n,y=w.useMemo(()=>{let v=qh(c,l);return v==null?null:{location:{pathname:v,search:d,hash:f,state:h,key:_},navigationType:s}},[l,c,d,f,h,_,s]);return y==null?null:w.createElement(_n.Provider,{value:u},w.createElement(Ql.Provider,{children:r,value:y}))}function IT(t){let{children:e,location:r}=t;return wT(hd(e),r)}new Promise(()=>{});function hd(t,e){e===void 0&&(e=[]);let r=[];return w.Children.forEach(t,(n,s)=>{if(!w.isValidElement(n))return;let i=[...e,s];if(n.type===w.Fragment){r.push.apply(r,hd(n.props.children,i));return}n.type!==je&&xe(!1),!n.props.index||!n.props.children||xe(!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=hd(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
 */function fd(){return fd=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},fd.apply(this,arguments)}function NT(t,e){if(t==null)return{};var r={},n=Object.keys(t),s,i;for(i=0;i<n.length;i++)s=n[i],!(e.indexOf(s)>=0)&&(r[s]=t[s]);return r}function LT(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function $T(t,e){return t.button===0&&(!e||e==="_self")&&!LT(t)}function pd(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,r)=>{let n=t[r];return e.concat(Array.isArray(n)?n.map(s=>[r,s]):[[r,n]])},[]))}function DT(t,e){let r=pd(t);return e&&e.forEach((n,s)=>{r.has(s)||e.getAll(s).forEach(i=>{r.append(s,i)})}),r}const MT=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],UT="6";try{window.__reactRouterVersion=UT}catch{}const FT="startTransition",dm=Ld[FT];function zT(t){let{basename:e,children:r,future:n,window:s}=t,i=w.useRef();i.current==null&&(i.current=HC({window:s,v5Compat:!0}));let o=i.current,[a,l]=w.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},c=w.useCallback(d=>{u&&dm?dm(()=>l(d)):l(d)},[l,u]);return w.useLayoutEffect(()=>o.listen(c),[o,c]),w.useEffect(()=>AT(n),[n]),w.createElement(jT,{basename:e,children:r,location:a.location,navigationType:a.action,navigator:o,future:n})}const BT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",VT=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,iA=w.forwardRef(function(e,r){let{onClick:n,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:u,preventScrollReset:c,viewTransition:d}=e,f=NT(e,MT),{basename:h}=w.useContext(_n),_,y=!1;if(typeof u=="string"&&VT.test(u)&&(_=u,BT))try{let m=new URL(window.location.href),b=u.startsWith("//")?new URL(m.protocol+u):new URL(u),x=qh(b.pathname,h);b.origin===m.origin&&x!=null?u=x+b.search+b.hash:y=!0}catch{}let v=vT(u,{relative:s}),g=WT(u,{replace:o,state:a,target:l,preventScrollReset:c,relative:s,viewTransition:d});function p(m){n&&n(m),m.defaultPrevented||g(m)}return w.createElement("a",fd({},f,{href:_||v,onClick:y||i?n:p,ref:r,target:l}))});var hm;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(hm||(hm={}));var fm;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(fm||(fm={}));function WT(t,e){let{target:r,replace:n,state:s,preventScrollReset:i,relative:o,viewTransition:a}=e===void 0?{}:e,l=Jh(),u=rs(),c=rw(t,{relative:o});return w.useCallback(d=>{if($T(d,r)){d.preventDefault();let f=n!==void 0?n:ml(u)===ml(c);l(t,{replace:f,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[u,l,c,n,s,r,t,i,o,a])}function oA(t){let e=w.useRef(pd(t)),r=w.useRef(!1),n=rs(),s=w.useMemo(()=>DT(n.search,r.current?null:e.current),[n.search]),i=Jh(),o=w.useCallback((a,l)=>{const u=pd(typeof a=="function"?a(s):a);r.current=!0,i("?"+u,l)},[i,s]);return[s,o]}var md=function(t,e){return md=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(r[s]=n[s])},md(t,e)};function iw(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");md(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var vl=function(){return vl=Object.assign||function(e){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},vl.apply(this,arguments)};function gi(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 ow(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(i=(s<3?o(i):s>3?o(e,r,i):o(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i}function aw(t,e){return function(r,n){e(r,n,t)}}function lw(t,e,r,n,s,i){function o(g){if(g!==void 0&&typeof g!="function")throw new TypeError("Function expected");return g}for(var a=n.kind,l=a==="getter"?"get":a==="setter"?"set":"value",u=!e&&t?n.static?t:t.prototype:null,c=e||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),d,f=!1,h=r.length-1;h>=0;h--){var _={};for(var y in n)_[y]=y==="access"?{}:n[y];for(var y in n.access)_.access[y]=n.access[y];_.addInitializer=function(g){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(o(g||null))};var v=(0,r[h])(a==="accessor"?{get:c.get,set:c.set}:c[l],_);if(a==="accessor"){if(v===void 0)continue;if(v===null||typeof v!="object")throw new TypeError("Object expected");(d=o(v.get))&&(c.get=d),(d=o(v.set))&&(c.set=d),(d=o(v.init))&&s.unshift(d)}else(d=o(v))&&(a==="field"?s.unshift(d):c[l]=d)}u&&Object.defineProperty(u,n.name,c),f=!0}function uw(t,e,r){for(var n=arguments.length>2,s=0;s<e.length;s++)r=n?e[s].call(t,r):e[s].call(t);return n?r:void 0}function cw(t){return typeof t=="symbol"?t:"".concat(t)}function dw(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function hw(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function U(t,e,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function a(c){try{u(n.next(c))}catch(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())})}function fw(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(c){return l([u,c])}}function l(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(r=0)),r;)try{if(n=1,s&&(i=u[0]&2?s.return:u[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,u[1])).done)return i;switch(s=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,s=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){r.label=u[1];break}if(u[0]===6&&r.label<i[1]){r.label=i[1],i=u;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(u);break}i[2]&&r.ops.pop(),r.trys.pop();continue}u=e.call(t,r)}catch(c){u=[6,c],s=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Gl=Object.create?function(t,e,r,n){n===void 0&&(n=r);var s=Object.getOwnPropertyDescriptor(e,r);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,s)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};function pw(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Gl(e,t,r)}function yl(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Yh(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),s,i=[],o;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return i}function mw(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Yh(arguments[e]));return t}function gw(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),s=0,e=0;e<r;e++)for(var i=arguments[e],o=0,a=i.length;o<a;o++,s++)n[s]=i[o];return n}function vw(t,e,r){if(r||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}function ai(t){return this instanceof ai?(this.v=t,this):new ai(t)}function yw(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(h){return function(_){return Promise.resolve(_).then(h,d)}}function a(h,_){n[h]&&(s[h]=function(y){return new Promise(function(v,g){i.push([h,y,v,g])>1||l(h,y)})},_&&(s[h]=_(s[h])))}function l(h,_){try{u(n[h](_))}catch(y){f(i[0][3],y)}}function u(h){h.value instanceof ai?Promise.resolve(h.value.v).then(c,d):f(i[0][2],h)}function c(h){l("next",h)}function d(h){l("throw",h)}function f(h,_){h(_),i.shift(),i.length&&l(i[0][0],i[0][1])}}function ww(t){var e,r;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,i){e[s]=t[s]?function(o){return(r=!r)?{value:ai(t[s](o)),done:!1}:i?i(o):o}:i}}function _w(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof yl=="function"?yl(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=t[i]&&function(o){return new Promise(function(a,l){o=t[i](o),s(a,l,o.done,o.value)})}}function s(i,o,a,l){Promise.resolve(l).then(function(u){i({value:u,done:a})},o)}}function bw(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var HT=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},gd=function(t){return gd=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},gd(t)};function xw(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=gd(t),n=0;n<r.length;n++)r[n]!=="default"&&Gl(e,t,r[n]);return HT(e,t),e}function Ew(t){return t&&t.__esModule?t:{default:t}}function Sw(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function kw(t,e,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(t,r):s?s.value=r:e.set(t,r),r}function Cw(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function Tw(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,s;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(s=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");s&&(n=function(){try{s.call(this)}catch(i){return Promise.reject(i)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var qT=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function Pw(t){function e(i){t.error=t.hasError?new qT(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var r,n=0;function s(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(s);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(s,function(o){return e(o),s()})}else n|=1}catch(o){e(o)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return s()}function Rw(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,s,i,o){return n?e?".jsx":".js":s&&(!i||!o)?r:s+i+"."+o.toLowerCase()+"js"}):t}const KT={__extends:iw,__assign:vl,__rest:gi,__decorate:ow,__param:aw,__esDecorate:lw,__runInitializers:uw,__propKey:cw,__setFunctionName:dw,__metadata:hw,__awaiter:U,__generator:fw,__createBinding:Gl,__exportStar:pw,__values:yl,__read:Yh,__spread:mw,__spreadArrays:gw,__spreadArray:vw,__await:ai,__asyncGenerator:yw,__asyncDelegator:ww,__asyncValues:_w,__makeTemplateObject:bw,__importStar:xw,__importDefault:Ew,__classPrivateFieldGet:Sw,__classPrivateFieldSet:kw,__classPrivateFieldIn:Cw,__addDisposableResource:Tw,__disposeResources:Pw,__rewriteRelativeImportExtension:Rw},QT=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Tw,get __assign(){return vl},__asyncDelegator:ww,__asyncGenerator:yw,__asyncValues:_w,__await:ai,__awaiter:U,__classPrivateFieldGet:Sw,__classPrivateFieldIn:Cw,__classPrivateFieldSet:kw,__createBinding:Gl,__decorate:ow,__disposeResources:Pw,__esDecorate:lw,__exportStar:pw,__extends:iw,__generator:fw,__importDefault:Ew,__importStar:xw,__makeTemplateObject:bw,__metadata:hw,__param:aw,__propKey:cw,__read:Yh,__rest:gi,__rewriteRelativeImportExtension:Rw,__runInitializers:uw,__setFunctionName:dw,__spread:mw,__spreadArray:vw,__spreadArrays:gw,__values:yl,default:KT},Symbol.toStringTag,{value:"Module"})),GT=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class Xh extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}}class pm extends Xh{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class mm extends Xh{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class gm extends Xh{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var vd;(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"})(vd||(vd={}));class JT{constructor(e,{headers:r={},customFetch:n,region:s=vd.Any}={}){this.url=e,this.headers=r,this.region=s,this.fetch=GT(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return U(this,arguments,void 0,function*(r,n={}){var s;try{const{headers:i,method:o,body:a,signal:l}=n;let u={},{region:c}=n;c||(c=this.region);const d=new URL(`${this.url}/${r}`);c&&c!=="any"&&(u["x-region"]=c,d.searchParams.set("forceFunctionRegion",c));let f;a&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)?typeof Blob<"u"&&a instanceof Blob||a instanceof ArrayBuffer?(u["Content-Type"]="application/octet-stream",f=a):typeof a=="string"?(u["Content-Type"]="text/plain",f=a):typeof FormData<"u"&&a instanceof FormData?f=a:(u["Content-Type"]="application/json",f=JSON.stringify(a)):f=a;const h=yield this.fetch(d.toString(),{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},u),this.headers),i),body:f,signal:l}).catch(g=>{throw g.name==="AbortError"?g:new pm(g)}),_=h.headers.get("x-relay-error");if(_&&_==="true")throw new mm(h);if(!h.ok)throw new gm(h);let y=((s=h.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),v;return y==="application/json"?v=yield h.json():y==="application/octet-stream"||y==="application/pdf"?v=yield h.blob():y==="text/event-stream"?v=h:y==="multipart/form-data"?v=yield h.formData():v=yield h.text(),{data:v,error:null,response:h}}catch(i){return i instanceof Error&&i.name==="AbortError"?{data:null,error:new pm(i)}:{data:null,error:i,response:i instanceof gm||i instanceof mm?i.context:void 0}}})}}var Ge={};const vi=T_(QT);var pa={},ma={},ga={},va={},ya={},wa={},vm;function Ow(){if(vm)return wa;vm=1,Object.defineProperty(wa,"__esModule",{value:!0});class t extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.code=r.code}}return wa.default=t,wa}var ym;function Aw(){if(ym)return ya;ym=1,Object.defineProperty(ya,"__esModule",{value:!0});const e=vi.__importDefault(Ow());class r{constructor(s){var i,o;this.shouldThrowOnError=!1,this.method=s.method,this.url=s.url,this.headers=new Headers(s.headers),this.schema=s.schema,this.body=s.body,this.shouldThrowOnError=(i=s.shouldThrowOnError)!==null&&i!==void 0?i:!1,this.signal=s.signal,this.isMaybeSingle=(o=s.isMaybeSingle)!==null&&o!==void 0?o:!1,s.fetch?this.fetch=s.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(s,i){return this.headers=new Headers(this.headers),this.headers.set(s,i),this}then(s,i){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const o=this.fetch;let a=o(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async l=>{var u,c,d,f;let h=null,_=null,y=null,v=l.status,g=l.statusText;if(l.ok){if(this.method!=="HEAD"){const x=await l.text();x===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((u=this.headers.get("Accept"))===null||u===void 0)&&u.includes("application/vnd.pgrst.plan+text"))?_=x:_=JSON.parse(x))}const m=(c=this.headers.get("Prefer"))===null||c===void 0?void 0:c.match(/count=(exact|planned|estimated)/),b=(d=l.headers.get("content-range"))===null||d===void 0?void 0:d.split("/");m&&b&&b.length>1&&(y=parseInt(b[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(_)&&(_.length>1?(h={code:"PGRST116",details:`Results contain ${_.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},_=null,y=null,v=406,g="Not Acceptable"):_.length===1?_=_[0]:_=null)}else{const m=await l.text();try{h=JSON.parse(m),Array.isArray(h)&&l.status===404&&(_=[],h=null,v=200,g="OK")}catch{l.status===404&&m===""?(v=204,g="No Content"):h={message:m}}if(h&&this.isMaybeSingle&&(!((f=h==null?void 0:h.details)===null||f===void 0)&&f.includes("0 rows"))&&(h=null,v=200,g="OK"),h&&this.shouldThrowOnError)throw new e.default(h)}return{error:h,data:_,count:y,status:v,statusText:g}});return this.shouldThrowOnError||(a=a.catch(l=>{var u,c,d;return{error:{message:`${(u=l==null?void 0:l.name)!==null&&u!==void 0?u:"FetchError"}: ${l==null?void 0:l.message}`,details:`${(c=l==null?void 0:l.stack)!==null&&c!==void 0?c:""}`,hint:"",code:`${(d=l==null?void 0:l.code)!==null&&d!==void 0?d:""}`},data:null,count:null,status:0,statusText:""}})),a.then(s,i)}returns(){return this}overrideTypes(){return this}}return ya.default=r,ya}var wm;function jw(){if(wm)return va;wm=1,Object.defineProperty(va,"__esModule",{value:!0});const e=vi.__importDefault(Aw());class r extends e.default{select(s){let i=!1;const o=(s??"*").split("").map(a=>/\s/.test(a)&&!i?"":(a==='"'&&(i=!i),a)).join("");return this.url.searchParams.set("select",o),this.headers.append("Prefer","return=representation"),this}order(s,{ascending:i=!0,nullsFirst:o,foreignTable:a,referencedTable:l=a}={}){const u=l?`${l}.order`:"order",c=this.url.searchParams.get(u);return this.url.searchParams.set(u,`${c?`${c},`:""}${s}.${i?"asc":"desc"}${o===void 0?"":o?".nullsfirst":".nullslast"}`),this}limit(s,{foreignTable:i,referencedTable:o=i}={}){const a=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(a,`${s}`),this}range(s,i,{foreignTable:o,referencedTable:a=o}={}){const l=typeof a>"u"?"offset":`${a}.offset`,u=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(l,`${s}`),this.url.searchParams.set(u,`${i-s+1}`),this}abortSignal(s){return this.signal=s,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:s=!1,verbose:i=!1,settings:o=!1,buffers:a=!1,wal:l=!1,format:u="text"}={}){var c;const d=[s?"analyze":null,i?"verbose":null,o?"settings":null,a?"buffers":null,l?"wal":null].filter(Boolean).join("|"),f=(c=this.headers.get("Accept"))!==null&&c!==void 0?c:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${u}; for="${f}"; options=${d};`),u==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(s){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${s}`),this}}return va.default=r,va}var _m;function Zh(){if(_m)return ga;_m=1,Object.defineProperty(ga,"__esModule",{value:!0});const e=vi.__importDefault(jw()),r=new RegExp("[,()]");class n extends e.default{eq(i,o){return this.url.searchParams.append(i,`eq.${o}`),this}neq(i,o){return this.url.searchParams.append(i,`neq.${o}`),this}gt(i,o){return this.url.searchParams.append(i,`gt.${o}`),this}gte(i,o){return this.url.searchParams.append(i,`gte.${o}`),this}lt(i,o){return this.url.searchParams.append(i,`lt.${o}`),this}lte(i,o){return this.url.searchParams.append(i,`lte.${o}`),this}like(i,o){return this.url.searchParams.append(i,`like.${o}`),this}likeAllOf(i,o){return this.url.searchParams.append(i,`like(all).{${o.join(",")}}`),this}likeAnyOf(i,o){return this.url.searchParams.append(i,`like(any).{${o.join(",")}}`),this}ilike(i,o){return this.url.searchParams.append(i,`ilike.${o}`),this}ilikeAllOf(i,o){return this.url.searchParams.append(i,`ilike(all).{${o.join(",")}}`),this}ilikeAnyOf(i,o){return this.url.searchParams.append(i,`ilike(any).{${o.join(",")}}`),this}is(i,o){return this.url.searchParams.append(i,`is.${o}`),this}in(i,o){const a=Array.from(new Set(o)).map(l=>typeof l=="string"&&r.test(l)?`"${l}"`:`${l}`).join(",");return this.url.searchParams.append(i,`in.(${a})`),this}contains(i,o){return typeof o=="string"?this.url.searchParams.append(i,`cs.${o}`):Array.isArray(o)?this.url.searchParams.append(i,`cs.{${o.join(",")}}`):this.url.searchParams.append(i,`cs.${JSON.stringify(o)}`),this}containedBy(i,o){return typeof o=="string"?this.url.searchParams.append(i,`cd.${o}`):Array.isArray(o)?this.url.searchParams.append(i,`cd.{${o.join(",")}}`):this.url.searchParams.append(i,`cd.${JSON.stringify(o)}`),this}rangeGt(i,o){return this.url.searchParams.append(i,`sr.${o}`),this}rangeGte(i,o){return this.url.searchParams.append(i,`nxl.${o}`),this}rangeLt(i,o){return this.url.searchParams.append(i,`sl.${o}`),this}rangeLte(i,o){return this.url.searchParams.append(i,`nxr.${o}`),this}rangeAdjacent(i,o){return this.url.searchParams.append(i,`adj.${o}`),this}overlaps(i,o){return typeof o=="string"?this.url.searchParams.append(i,`ov.${o}`):this.url.searchParams.append(i,`ov.{${o.join(",")}}`),this}textSearch(i,o,{config:a,type:l}={}){let u="";l==="plain"?u="pl":l==="phrase"?u="ph":l==="websearch"&&(u="w");const c=a===void 0?"":`(${a})`;return this.url.searchParams.append(i,`${u}fts${c}.${o}`),this}match(i){return Object.entries(i).forEach(([o,a])=>{this.url.searchParams.append(o,`eq.${a}`)}),this}not(i,o,a){return this.url.searchParams.append(i,`not.${o}.${a}`),this}or(i,{foreignTable:o,referencedTable:a=o}={}){const l=a?`${a}.or`:"or";return this.url.searchParams.append(l,`(${i})`),this}filter(i,o,a){return this.url.searchParams.append(i,`${o}.${a}`),this}}return ga.default=n,ga}var bm;function Iw(){if(bm)return ma;bm=1,Object.defineProperty(ma,"__esModule",{value:!0});const e=vi.__importDefault(Zh());class r{constructor(s,{headers:i={},schema:o,fetch:a}){this.url=s,this.headers=new Headers(i),this.schema=o,this.fetch=a}select(s,i){const{head:o=!1,count:a}=i??{},l=o?"HEAD":"GET";let u=!1;const c=(s??"*").split("").map(d=>/\s/.test(d)&&!u?"":(d==='"'&&(u=!u),d)).join("");return this.url.searchParams.set("select",c),a&&this.headers.append("Prefer",`count=${a}`),new e.default({method:l,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(s,{count:i,defaultToNull:o=!0}={}){var a;const l="POST";if(i&&this.headers.append("Prefer",`count=${i}`),o||this.headers.append("Prefer","missing=default"),Array.isArray(s)){const u=s.reduce((c,d)=>c.concat(Object.keys(d)),[]);if(u.length>0){const c=[...new Set(u)].map(d=>`"${d}"`);this.url.searchParams.set("columns",c.join(","))}}return new e.default({method:l,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}upsert(s,{onConflict:i,ignoreDuplicates:o=!1,count:a,defaultToNull:l=!0}={}){var u;const c="POST";if(this.headers.append("Prefer",`resolution=${o?"ignore":"merge"}-duplicates`),i!==void 0&&this.url.searchParams.set("on_conflict",i),a&&this.headers.append("Prefer",`count=${a}`),l||this.headers.append("Prefer","missing=default"),Array.isArray(s)){const d=s.reduce((f,h)=>f.concat(Object.keys(h)),[]);if(d.length>0){const f=[...new Set(d)].map(h=>`"${h}"`);this.url.searchParams.set("columns",f.join(","))}}return new e.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}update(s,{count:i}={}){var o;const a="PATCH";return i&&this.headers.append("Prefer",`count=${i}`),new e.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:s,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}delete({count:s}={}){var i;const o="DELETE";return s&&this.headers.append("Prefer",`count=${s}`),new e.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}}return ma.default=r,ma}var xm;function YT(){if(xm)return pa;xm=1,Object.defineProperty(pa,"__esModule",{value:!0});const t=vi,e=t.__importDefault(Iw()),r=t.__importDefault(Zh());class n{constructor(i,{headers:o={},schema:a,fetch:l}={}){this.url=i,this.headers=new Headers(o),this.schemaName=a,this.fetch=l}from(i){const o=new URL(`${this.url}/${i}`);return new e.default(o,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(i){return new n(this.url,{headers:this.headers,schema:i,fetch:this.fetch})}rpc(i,o={},{head:a=!1,get:l=!1,count:u}={}){var c;let d;const f=new URL(`${this.url}/rpc/${i}`);let h;a||l?(d=a?"HEAD":"GET",Object.entries(o).filter(([y,v])=>v!==void 0).map(([y,v])=>[y,Array.isArray(v)?`{${v.join(",")}}`:`${v}`]).forEach(([y,v])=>{f.searchParams.append(y,v)})):(d="POST",h=o);const _=new Headers(this.headers);return u&&_.set("Prefer",`count=${u}`),new r.default({method:d,url:f,headers:_,schema:this.schemaName,body:h,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch})}}return pa.default=n,pa}Object.defineProperty(Ge,"__esModule",{value:!0});var Nw=Ge.PostgrestError=Ww=Ge.PostgrestBuilder=Bw=Ge.PostgrestTransformBuilder=Fw=Ge.PostgrestFilterBuilder=Mw=Ge.PostgrestQueryBuilder=$w=Ge.PostgrestClient=void 0;const yi=vi,Lw=yi.__importDefault(YT());var $w=Ge.PostgrestClient=Lw.default;const Dw=yi.__importDefault(Iw());var Mw=Ge.PostgrestQueryBuilder=Dw.default;const Uw=yi.__importDefault(Zh());var Fw=Ge.PostgrestFilterBuilder=Uw.default;const zw=yi.__importDefault(jw());var Bw=Ge.PostgrestTransformBuilder=zw.default;const Vw=yi.__importDefault(Aw());var Ww=Ge.PostgrestBuilder=Vw.default;const Hw=yi.__importDefault(Ow());Nw=Ge.PostgrestError=Hw.default;var qw=Ge.default={PostgrestClient:Lw.default,PostgrestQueryBuilder:Dw.default,PostgrestFilterBuilder:Uw.default,PostgrestTransformBuilder:zw.default,PostgrestBuilder:Vw.default,PostgrestError:Hw.default};const XT=ig({__proto__:null,get PostgrestBuilder(){return Ww},get PostgrestClient(){return $w},get PostgrestError(){return Nw},get PostgrestFilterBuilder(){return Fw},get PostgrestQueryBuilder(){return Mw},get PostgrestTransformBuilder(){return Bw},default:qw},[Ge]),{PostgrestClient:ZT,PostgrestQueryBuilder:aA,PostgrestFilterBuilder:lA,PostgrestTransformBuilder:uA,PostgrestBuilder:cA,PostgrestError:dA}=qw||XT;class eP{static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(typeof process<"u"){const r=process.versions;if(r&&r.node){const n=r.node,s=parseInt(n.replace(/^v/,"").split(".")[0]);return s>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${s} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${s} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
import ws from "ws"
new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let r=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(r+=`

Suggested solution: ${e.workaround}`),new Error(r)}static createWebSocket(e,r){const n=this.getWebSocketConstructor();return new n(e,r)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const tP="2.79.0",rP=`realtime-js/${tP}`,nP="1.0.0",yd=1e4,sP=1e3,iP=100;var Gi;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(Gi||(Gi={}));var Pe;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(Pe||(Pe={}));var Ft;(function(t){t.close="phx_close",t.error="phx_error",t.join="phx_join",t.reply="phx_reply",t.leave="phx_leave",t.access_token="access_token"})(Ft||(Ft={}));var wd;(function(t){t.websocket="websocket"})(wd||(wd={}));var On;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(On||(On={}));class oP{constructor(){this.HEADER_LENGTH=1}decode(e,r){return e.constructor===ArrayBuffer?r(this._binaryDecode(e)):r(typeof e=="string"?JSON.parse(e):{})}_binaryDecode(e){const r=new DataView(e),n=new TextDecoder;return this._decodeBroadcast(e,r,n)}_decodeBroadcast(e,r,n){const s=r.getUint8(1),i=r.getUint8(2);let o=this.HEADER_LENGTH+2;const a=n.decode(e.slice(o,o+s));o=o+s;const l=n.decode(e.slice(o,o+i));o=o+i;const u=JSON.parse(n.decode(e.slice(o,e.byteLength)));return{ref:null,topic:a,event:l,payload:u}}}class Kw{constructor(e,r){this.callback=e,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var le;(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"})(le||(le={}));const Em=(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]=aP(o,t,e,s),i),{}):{}},aP=(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)?Qw(i,o):_d(o)},Qw=(t,e)=>{if(t.charAt(0)==="_"){const r=t.slice(1,t.length);return dP(e,r)}switch(t){case le.bool:return lP(e);case le.float4:case le.float8:case le.int2:case le.int4:case le.int8:case le.numeric:case le.oid:return uP(e);case le.json:case le.jsonb:return cP(e);case le.timestamp:return hP(e);case le.abstime:case le.date:case le.daterange:case le.int4range:case le.int8range:case le.money:case le.reltime:case le.text:case le.time:case le.timestamptz:case le.timetz:case le.tsrange:case le.tstzrange:return _d(e);default:return _d(e)}},_d=t=>t,lP=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},uP=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},cP=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch(e){return console.log(`JSON parse error: ${e}`),t}return t},dP=(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=>Qw(e,a))}return t},hP=t=>typeof t=="string"?t.replace(" ","T"):t,Gw=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};class Mu{constructor(e,r,n={},s=yd){this.channel=e,this.event=r,this.payload=n,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,r){var n;return this._hasReceived(e)&&r((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:e,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:r}){this.recHooks.filter(n=>n.status===e).forEach(n=>n.callback(r))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var Sm;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(Sm||(Sm={}));class Ji{constructor(e,r){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(r==null?void 0:r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},s=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Ji.syncState(this.state,s,i,o),this.pendingDiffs.forEach(l=>{this.state=Ji.syncDiff(this.state,l,i,o)}),this.pendingDiffs=[],a()}),this.channel._on(n.diff,{},s=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Ji.syncDiff(this.state,s,i,o),a())}),this.onJoin((s,i,o)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:i,newPresences:o})}),this.onLeave((s,i,o)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,r,n,s){const i=this.cloneDeep(e),o=this.transformState(r),a={},l={};return this.map(i,(u,c)=>{o[u]||(l[u]=c)}),this.map(o,(u,c)=>{const d=i[u];if(d){const f=c.map(v=>v.presence_ref),h=d.map(v=>v.presence_ref),_=c.filter(v=>h.indexOf(v.presence_ref)<0),y=d.filter(v=>f.indexOf(v.presence_ref)<0);_.length>0&&(a[u]=_),y.length>0&&(l[u]=y)}else a[u]=c}),this.syncDiff(i,{joins:a,leaves:l},n,s)}static syncDiff(e,r,n,s){const{joins:i,leaves:o}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return n||(n=()=>{}),s||(s=()=>{}),this.map(i,(a,l)=>{var u;const c=(u=e[a])!==null&&u!==void 0?u:[];if(e[a]=this.cloneDeep(l),c.length>0){const d=e[a].map(h=>h.presence_ref),f=c.filter(h=>d.indexOf(h.presence_ref)<0);e[a].unshift(...f)}n(a,c,l)}),this.map(o,(a,l)=>{let u=e[a];if(!u)return;const c=l.map(d=>d.presence_ref);u=u.filter(d=>c.indexOf(d.presence_ref)<0),e[a]=u,s(a,u,l),u.length===0&&delete e[a]}),e}static map(e,r){return Object.getOwnPropertyNames(e).map(n=>r(n,e[n]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((r,n)=>{const s=e[n];return"metas"in s?r[n]=s.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):r[n]=s,r},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var km;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(km||(km={}));var Yi;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Yi||(Yi={}));var hr;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(hr||(hr={}));class ef{constructor(e,r={config:{}},n){var s,i;if(this.topic=e,this.params=r,this.socket=n,this.bindings={},this.state=Pe.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new Mu(this,Ft.join,this.params,this.timeout),this.rejoinTimer=new Kw(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Pe.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Pe.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Pe.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Pe.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Pe.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Ft.reply,{},(o,a)=>{this._trigger(this._replyEventName(a),o)}),this.presence=new Ji(this),this.broadcastEndpointURL=Gw(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((i=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||i===void 0)&&i.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(e,r=this.timeout){var n,s,i;if(this.socket.isConnected()||this.socket.connect(),this.state==Pe.closed){const{config:{broadcast:o,presence:a,private:l}}=this.params,u=(s=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(h=>h.filter))!==null&&s!==void 0?s:[],c=!!this.bindings[Yi.PRESENCE]&&this.bindings[Yi.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?void 0:e(hr.CHANNEL_ERROR,h)),this._onClose(()=>e==null?void 0:e(hr.CLOSED)),this.updateJoinPayload(Object.assign({config:f},d)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:h})=>{var _;if(this.socket.setAuth(),h===void 0){e==null||e(hr.SUBSCRIBED);return}else{const y=this.bindings.postgres_changes,v=(_=y==null?void 0:y.length)!==null&&_!==void 0?_:0,g=[];for(let p=0;p<v;p++){const m=y[p],{filter:{event:b,schema:x,table:k,filter:C}}=m,T=h&&h[p];if(T&&T.event===b&&T.schema===x&&T.table===k&&T.filter===C)g.push(Object.assign(Object.assign({},m),{id:T.id}));else{this.unsubscribe(),this.state=Pe.errored,e==null||e(hr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=g,e&&e(hr.SUBSCRIBED);return}}).receive("error",h=>{this.state=Pe.errored,e==null||e(hr.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(h).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(hr.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,r={}){return await this.send({type:"presence",event:"track",payload:e},r.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,r,n){return this.state===Pe.joined&&e===Yi.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(e,r,n)}async httpSend(e,r,n={}){var s;const i=this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"";if(r==null)return Promise.reject("Payload is required for httpSend()");const o={method:"POST",headers:{Authorization:i,apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:r,private:this.private}]})},a=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);if(a.status===202)return{success:!0};let l=a.statusText;try{const u=await a.json();l=u.error||u.message||l}catch{}return Promise.reject(new Error(l))}async send(e,r={}){var n,s;if(!this._canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:o}=e,l={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((s=u.body)===null||s===void 0?void 0:s.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,a,l;const u=this._push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((l=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||l===void 0)&&l.ack)&&i("ok"),u.receive("ok",()=>i("ok")),u.receive("error",()=>i("error")),u.receive("timeout",()=>i("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=Pe.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Ft.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(s=>{n=new Mu(this,Ft.leave,{},e),n.receive("ok",()=>{r(),s("ok")}).receive("timeout",()=>{r(),s("timed out")}).receive("error",()=>{s("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{n==null||n.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Pe.closed,this.bindings={}}async _fetchWithTimeout(e,r,n){const s=new AbortController,i=setTimeout(()=>s.abort(),n),o=await this.socket.fetch(e,Object.assign(Object.assign({},r),{signal:s.signal}));return clearTimeout(i),o}_push(e,r,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new Mu(this,e,r,n);return this._canPush()?s.send():this._addToPushBuffer(s),s}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>iP){const r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(e,r,n){return r}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,r,n){var s,i;const o=e.toLocaleLowerCase(),{close:a,error:l,leave:u,join:c}=Ft;if(n&&[a,l,u,c].indexOf(o)>=0&&n!==this._joinRef())return;let f=this._onMessage(o,r,n);if(r&&!f)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(h=>{var _,y,v;return((_=h.filter)===null||_===void 0?void 0:_.event)==="*"||((v=(y=h.filter)===null||y===void 0?void 0:y.event)===null||v===void 0?void 0:v.toLocaleLowerCase())===o}).map(h=>h.callback(f,n)):(i=this.bindings[o])===null||i===void 0||i.filter(h=>{var _,y,v,g,p,m;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in h){const b=h.id,x=(_=h.filter)===null||_===void 0?void 0:_.event;return b&&((y=r.ids)===null||y===void 0?void 0:y.includes(b))&&(x==="*"||(x==null?void 0:x.toLocaleLowerCase())===((v=r.data)===null||v===void 0?void 0:v.type.toLocaleLowerCase()))}else{const b=(p=(g=h==null?void 0:h.filter)===null||g===void 0?void 0:g.event)===null||p===void 0?void 0:p.toLocaleLowerCase();return b==="*"||b===((m=r==null?void 0:r.event)===null||m===void 0?void 0:m.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===o}).map(h=>{if(typeof f=="object"&&"ids"in f){const _=f.data,{schema:y,table:v,commit_timestamp:g,type:p,errors:m}=_;f=Object.assign(Object.assign({},{schema:y,table:v,commit_timestamp:g,eventType:p,new:{},old:{},errors:m}),this._getPayloadRecords(_))}h.callback(f,n)})}_isClosed(){return this.state===Pe.closed}_isJoined(){return this.state===Pe.joined}_isJoining(){return this.state===Pe.joining}_isLeaving(){return this.state===Pe.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,r,n){const s=e.toLocaleLowerCase(),i={type:s,filter:r,callback:n};return this.bindings[s]?this.bindings[s].push(i):this.bindings[s]=[i],this}_off(e,r){const n=e.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(s=>{var i;return!(((i=s.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===n&&ef.isEqual(s.filter,r))})),this}static isEqual(e,r){if(Object.keys(e).length!==Object.keys(r).length)return!1;for(const n in e)if(e[n]!==r[n])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(Ft.close,{},e)}_onError(e){this._on(Ft.error,{},r=>e(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Pe.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=Em(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=Em(e.columns,e.old_record)),r}}const Uu=()=>{},_a={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},fP=[1e3,2e3,5e3,1e4],pP=1e4,mP=`
  addEventListener("message", (e) => {
    if (e.data.event === "start") {
      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
    }
  });`;class gP{constructor(e,r){var n;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=yd,this.transport=null,this.heartbeatIntervalMs=_a.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=Uu,this.ref=0,this.reconnectTimer=null,this.logger=Uu,this.conn=null,this.sendBuffer=[],this.serializer=new oP,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=s=>s?(...i)=>s(...i):(...i)=>fetch(...i),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${e}/${wd.websocket}`,this.httpEndpoint=Gw(e),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=eP.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const r=e.message;throw r.includes("Node.js")?new Error(`${r}

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

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

  npm install ws

  import ws from "ws"
  const client = new RealtimeClient(url, {
    ...options,
    transport: ws
  })`):new Error(`WebSocket not available: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:nP}))}disconnect(e,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},e?this.conn.close(e,r??""):this.conn.close(),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const r=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const e=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,r,n){this.logger(e,r,n)}connectionState(){switch(this.conn&&this.conn.readyState){case Gi.connecting:return On.Connecting;case Gi.open:return On.Open;case Gi.closing:return On.Closing;default:return On.Closed}}isConnected(){return this.connectionState()===On.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(e,r={config:{}}){const n=`realtime:${e}`,s=this.getChannels().find(i=>i.topic===n);if(s)return s;{const i=new ef(`realtime:${e}`,r,this);return this.channels.push(i),i}}push(e){const{topic:r,event:n,payload:s,ref:i}=e,o=()=>{this.encode(e,a=>{var l;(l=this.conn)===null||l===void 0||l.send(a)})};this.log("push",`${r} ${n} (${i})`,s),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var e;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this._wasManualDisconnect=!1,(e=this.conn)===null||e===void 0||e.close(sP,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout()},_a.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this._setAuthSafely("heartbeat")}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let r=this.channels.find(n=>n.topic===e&&(n._isJoined()||n._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${e}"`),r.unsubscribe())}_remove(e){this.channels=this.channels.filter(r=>r.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,r=>{if(r.topic==="phoenix"&&r.event==="phx_reply")try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error")}catch(u){this.log("error","error in heartbeat callback",u)}r.ref&&r.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:n,event:s,payload:i,ref:o}=r,a=o?`(${o})`:"",l=i.status||"";this.log("receive",`${l} ${n} ${s} ${a}`.trim(),i),this.channels.filter(u=>u._isMember(n)).forEach(u=>u._trigger(s,i,o)),this._triggerStateCallbacks("message",r)})}_clearTimer(e){var r;e==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):e==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_teardownConnection(){this.conn&&(this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null),this._clearAllTimers(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this.workerRef.terminate()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(e){var r;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.scheduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e)}_triggerChanError(){this.channels.forEach(e=>e._trigger(Ft.error))}_appendParams(e,r){if(Object.keys(r).length===0)return e;const n=e.match(/\?/)?"&":"?",s=new URLSearchParams(r);return`${e}${n}${s}`}_workerObjectUrl(e){let r;if(e)r=e;else{const n=new Blob([mP],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_setConnectionState(e,r=!1){this._connectionState=e,e==="connecting"?this._wasManualDisconnect=!1:e==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(e=null){let r;e?r=e:this.accessToken?r=await this.accessToken():r=this.accessTokenValue,this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(n=>{const s={access_token:r,version:rP};r&&n.updateJoinPayload(s),n.joinedOnce&&n._isJoined()&&n._push(Ft.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this.setAuth().catch(r=>{this.log("error",`error setting auth in ${e}`,r)})}_triggerStateCallbacks(e,r){try{this.stateChangeCallbacks[e].forEach(n=>{try{n(r)}catch(s){this.log("error",`error in ${e} callback`,s)}})}catch(n){this.log("error",`error triggering ${e} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new Kw(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},_a.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var r,n,s,i,o,a,l,u,c;if(this.transport=(r=e==null?void 0:e.transport)!==null&&r!==void 0?r:null,this.timeout=(n=e==null?void 0:e.timeout)!==null&&n!==void 0?n:yd,this.heartbeatIntervalMs=(s=e==null?void 0:e.heartbeatIntervalMs)!==null&&s!==void 0?s:_a.HEARTBEAT_INTERVAL,this.worker=(i=e==null?void 0:e.worker)!==null&&i!==void 0?i:!1,this.accessToken=(o=e==null?void 0:e.accessToken)!==null&&o!==void 0?o:null,this.heartbeatCallback=(a=e==null?void 0:e.heartbeatCallback)!==null&&a!==void 0?a:Uu,e!=null&&e.params&&(this.params=e.params),e!=null&&e.logger&&(this.logger=e.logger),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(l=e==null?void 0:e.reconnectAfterMs)!==null&&l!==void 0?l:d=>fP[d-1]||pP,this.encode=(u=e==null?void 0:e.encode)!==null&&u!==void 0?u:(d,f)=>f(JSON.stringify(d)),this.decode=(c=e==null?void 0:e.decode)!==null&&c!==void 0?c:this.serializer.decode.bind(this.serializer),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl}}}class tf extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function me(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}class vP extends tf{constructor(e,r,n){super(e),this.name="StorageApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class bd extends tf{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}}const rf=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),yP=()=>Response,xd=t=>{if(Array.isArray(t))return t.map(r=>xd(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]=xd(n)}),e},wP=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)},Fu=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)},_P=(t,e,r)=>U(void 0,void 0,void 0,function*(){const n=yield yP();t instanceof n&&!(r!=null&&r.noResolveJson)?t.json().then(s=>{const i=t.status||500,o=(s==null?void 0:s.statusCode)||i+"";e(new vP(Fu(s),i,o))}).catch(s=>{e(new bd(Fu(s),s))}):e(new bd(Fu(t),t))}),bP=(t,e,r,n)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"||!n?s:(wP(n)?(s.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),s.body=JSON.stringify(n)):s.body=n,e!=null&&e.duplex&&(s.duplex=e.duplex),Object.assign(Object.assign({},s),r))};function Uo(t,e,r,n,s,i){return U(this,void 0,void 0,function*(){return new Promise((o,a)=>{t(r,bP(e,n,s,i)).then(l=>{if(!l.ok)throw l;return n!=null&&n.noResolveJson?l:l.json()}).then(l=>o(l)).catch(l=>_P(l,a,n))})})}function Eo(t,e,r,n){return U(this,void 0,void 0,function*(){return Uo(t,"GET",e,r,n)})}function $t(t,e,r,n,s){return U(this,void 0,void 0,function*(){return Uo(t,"POST",e,n,s,r)})}function Ed(t,e,r,n,s){return U(this,void 0,void 0,function*(){return Uo(t,"PUT",e,n,s,r)})}function xP(t,e,r,n){return U(this,void 0,void 0,function*(){return Uo(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}function nf(t,e,r,n,s){return U(this,void 0,void 0,function*(){return Uo(t,"DELETE",e,n,s,r)})}class EP{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r}then(e,r){return this.execute().then(e,r)}execute(){return U(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(me(e))return{data:null,error:e};throw e}})}}var Jw;class SP{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r,this[Jw]="BlobDownloadBuilder",this.promise=null}asStream(){return new EP(this.downloadFn,this.shouldThrowOnError)}then(e,r){return this.getPromise().then(e,r)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}execute(){return U(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(me(e))return{data:null,error:e};throw e}})}}Jw=Symbol.toStringTag;const kP={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Cm={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class CP{constructor(e,r={},n,s){this.shouldThrowOnError=!1,this.url=e,this.headers=r,this.bucketId=n,this.fetch=rf(s)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(e,r,n,s){return U(this,void 0,void 0,function*(){try{let i;const o=Object.assign(Object.assign({},Cm),s);let a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const l=o.metadata;typeof Blob<"u"&&n instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),l&&i.append("metadata",this.encodeMetadata(l)),i.append("",n)):typeof FormData<"u"&&n instanceof FormData?(i=n,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),l&&!i.has("metadata")&&i.append("metadata",this.encodeMetadata(l))):(i=n,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,l&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(l))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!o.duplex&&(o.duplex="half")),s!=null&&s.headers&&(a=Object.assign(Object.assign({},a),s.headers));const u=this._removeEmptyFolders(r),c=this._getFinalPath(u),d=yield(e=="PUT"?Ed:$t)(this.fetch,`${this.url}/object/${c}`,i,Object.assign({headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{data:{path:u,id:d.Id,fullPath:d.Key},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(me(i))return{data:null,error:i};throw i}})}upload(e,r,n){return U(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,s){return U(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(e),o=this._getFinalPath(i),a=new URL(this.url+`/object/upload/sign/${o}`);a.searchParams.set("token",r);try{let l;const u=Object.assign({upsert:Cm.upsert},s),c=Object.assign(Object.assign({},this.headers),{"x-upsert":String(u.upsert)});typeof Blob<"u"&&n instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",n)):typeof FormData<"u"&&n instanceof FormData?(l=n,l.append("cacheControl",u.cacheControl)):(l=n,c["cache-control"]=`max-age=${u.cacheControl}`,c["content-type"]=u.contentType);const d=yield Ed(this.fetch,a.toString(),l,{headers:c});return{data:{path:i,fullPath:d.Key},error:null}}catch(l){if(this.shouldThrowOnError)throw l;if(me(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(e,r){return U(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e);const s=Object.assign({},this.headers);r!=null&&r.upsert&&(s["x-upsert"]="true");const i=yield $t(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:s}),o=new URL(this.url+i.url),a=o.searchParams.get("token");if(!a)throw new tf("No token returned by API");return{data:{signedUrl:o.toString(),path:e,token:a},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(me(n))return{data:null,error:n};throw n}})}update(e,r,n){return U(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return U(this,void 0,void 0,function*(){try{return{data:yield $t(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(me(s))return{data:null,error:s};throw s}})}copy(e,r,n){return U(this,void 0,void 0,function*(){try{return{data:{path:(yield $t(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers})).Key},error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(me(s))return{data:null,error:s};throw s}})}createSignedUrl(e,r,n){return U(this,void 0,void 0,function*(){try{let s=this._getFinalPath(e),i=yield $t(this.fetch,`${this.url}/object/sign/${s}`,Object.assign({expiresIn:r},n!=null&&n.transform?{transform:n.transform}:{}),{headers:this.headers});const o=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${o}`)},{data:i,error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(me(s))return{data:null,error:s};throw s}})}createSignedUrls(e,r,n){return U(this,void 0,void 0,function*(){try{const s=yield $t(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),i=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{data:s.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${i}`):null})),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(me(s))return{data:null,error:s};throw s}})}download(e,r){const s=typeof(r==null?void 0:r.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((r==null?void 0:r.transform)||{}),o=i?`?${i}`:"",a=this._getFinalPath(e),l=()=>Eo(this.fetch,`${this.url}/${s}/${a}${o}`,{headers:this.headers,noResolveJson:!0});return new SP(l,this.shouldThrowOnError)}info(e){return U(this,void 0,void 0,function*(){const r=this._getFinalPath(e);try{const n=yield Eo(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:xd(n),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(me(n))return{data:null,error:n};throw n}})}exists(e){return U(this,void 0,void 0,function*(){const r=this._getFinalPath(e);try{return yield xP(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(me(n)&&n instanceof bd){const s=n.originalError;if([400,404].includes(s==null?void 0:s.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,r){const n=this._getFinalPath(e),s=[],i=r!=null&&r.download?`download=${r.download===!0?"":r.download}`:"";i!==""&&s.push(i);const a=typeof(r==null?void 0:r.transform)<"u"?"render/image":"object",l=this.transformOptsToQueryString((r==null?void 0:r.transform)||{});l!==""&&s.push(l);let u=s.join("&");return u!==""&&(u=`?${u}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${n}${u}`)}}}remove(e){return U(this,void 0,void 0,function*(){try{return{data:yield nf(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(me(r))return{data:null,error:r};throw r}})}list(e,r,n){return U(this,void 0,void 0,function*(){try{const s=Object.assign(Object.assign(Object.assign({},kP),r),{prefix:e||""});return{data:yield $t(this.fetch,`${this.url}/object/list/${this.bucketId}`,s,{headers:this.headers},n),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(me(s))return{data:null,error:s};throw s}})}listV2(e,r){return U(this,void 0,void 0,function*(){try{const n=Object.assign({},e);return{data:yield $t(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,n,{headers:this.headers},r),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(me(n))return{data:null,error:n};throw n}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const r=[];return e.width&&r.push(`width=${e.width}`),e.height&&r.push(`height=${e.height}`),e.resize&&r.push(`resize=${e.resize}`),e.format&&r.push(`format=${e.format}`),e.quality&&r.push(`quality=${e.quality}`),r.join("&")}}const Yw="2.79.0",Xw={"X-Client-Info":`storage-js/${Yw}`};class TP{constructor(e,r={},n,s){this.shouldThrowOnError=!1;const i=new URL(e);s!=null&&s.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase.")),this.url=i.href.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Xw),r),this.fetch=rf(n)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(e){return U(this,void 0,void 0,function*(){try{const r=this.listBucketOptionsToQueryString(e);return{data:yield Eo(this.fetch,`${this.url}/bucket${r}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(me(r))return{data:null,error:r};throw r}})}getBucket(e){return U(this,void 0,void 0,function*(){try{return{data:yield Eo(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(me(r))return{data:null,error:r};throw r}})}createBucket(e){return U(this,arguments,void 0,function*(r,n={public:!1}){try{return{data:yield $t(this.fetch,`${this.url}/bucket`,{id:r,name:r,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(me(s))return{data:null,error:s};throw s}})}updateBucket(e,r){return U(this,void 0,void 0,function*(){try{return{data:yield Ed(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(me(n))return{data:null,error:n};throw n}})}emptyBucket(e){return U(this,void 0,void 0,function*(){try{return{data:yield $t(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(me(r))return{data:null,error:r};throw r}})}deleteBucket(e){return U(this,void 0,void 0,function*(){try{return{data:yield nf(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(me(r))return{data:null,error:r};throw r}})}listBucketOptionsToQueryString(e){const r={};return e&&("limit"in e&&(r.limit=String(e.limit)),"offset"in e&&(r.offset=String(e.offset)),e.search&&(r.search=e.search),e.sortColumn&&(r.sortColumn=e.sortColumn),e.sortOrder&&(r.sortOrder=e.sortOrder)),Object.keys(r).length>0?"?"+new URLSearchParams(r).toString():""}}class PP{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},Xw),r),this.fetch=rf(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return U(this,void 0,void 0,function*(){try{return{data:yield $t(this.fetch,`${this.url}/bucket`,{name:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(me(r))return{data:null,error:r};throw r}})}listBuckets(e){return U(this,void 0,void 0,function*(){try{const r=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&r.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&r.set("sortOrder",e.sortOrder),e!=null&&e.search&&r.set("search",e.search);const n=r.toString(),s=n?`${this.url}/bucket?${n}`:`${this.url}/bucket`;return{data:yield Eo(this.fetch,s,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(me(r))return{data:null,error:r};throw r}})}deleteBucket(e){return U(this,void 0,void 0,function*(){try{return{data:yield nf(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(me(r))return{data:null,error:r};throw r}})}}const sf={"X-Client-Info":`storage-js/${Yw}`,"Content-Type":"application/json"};class Zw extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}}function dt(t){return typeof t=="object"&&t!==null&&"__isStorageVectorsError"in t}class zu extends Zw{constructor(e,r,n){super(e),this.name="StorageVectorsApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class RP extends Zw{constructor(e,r){super(e),this.name="StorageVectorsUnknownError",this.originalError=r}}var Tm;(function(t){t.InternalError="InternalError",t.S3VectorConflictException="S3VectorConflictException",t.S3VectorNotFoundException="S3VectorNotFoundException",t.S3VectorBucketNotEmpty="S3VectorBucketNotEmpty",t.S3VectorMaxBucketsExceeded="S3VectorMaxBucketsExceeded",t.S3VectorMaxIndexesExceeded="S3VectorMaxIndexesExceeded"})(Tm||(Tm={}));const of=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),OP=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)},Pm=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),AP=(t,e,r)=>U(void 0,void 0,void 0,function*(){if(t&&typeof t=="object"&&"status"in t&&"ok"in t&&typeof t.status=="number"&&!(r!=null&&r.noResolveJson)){const s=t.status||500,i=t;if(typeof i.json=="function")i.json().then(o=>{const a=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||s+"";e(new zu(Pm(o),s,a))}).catch(()=>{const o=s+"",a=i.statusText||`HTTP ${s} error`;e(new zu(a,s,o))});else{const o=s+"",a=i.statusText||`HTTP ${s} error`;e(new zu(a,s,o))}}else e(new RP(Pm(t),t))}),jP=(t,e,r,n)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return n?(OP(n)?(s.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),s.body=JSON.stringify(n)):s.body=n,Object.assign(Object.assign({},s),r)):s};function IP(t,e,r,n,s,i){return U(this,void 0,void 0,function*(){return new Promise((o,a)=>{t(r,jP(e,n,s,i)).then(l=>{if(!l.ok)throw l;if(n!=null&&n.noResolveJson)return l;const u=l.headers.get("content-type");return!u||!u.includes("application/json")?{}:l.json()}).then(l=>o(l)).catch(l=>AP(l,a,n))})})}function ht(t,e,r,n,s){return U(this,void 0,void 0,function*(){return IP(t,"POST",e,n,s,r)})}class NP{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},sf),r),this.fetch=of(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createIndex(e){return U(this,void 0,void 0,function*(){try{return{data:(yield ht(this.fetch,`${this.url}/CreateIndex`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(dt(r))return{data:null,error:r};throw r}})}getIndex(e,r){return U(this,void 0,void 0,function*(){try{return{data:yield ht(this.fetch,`${this.url}/GetIndex`,{vectorBucketName:e,indexName:r},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(dt(n))return{data:null,error:n};throw n}})}listIndexes(e){return U(this,void 0,void 0,function*(){try{return{data:yield ht(this.fetch,`${this.url}/ListIndexes`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(dt(r))return{data:null,error:r};throw r}})}deleteIndex(e,r){return U(this,void 0,void 0,function*(){try{return{data:(yield ht(this.fetch,`${this.url}/DeleteIndex`,{vectorBucketName:e,indexName:r},{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(dt(n))return{data:null,error:n};throw n}})}}class LP{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},sf),r),this.fetch=of(n)}throwOnError(){return this.shouldThrowOnError=!0,this}putVectors(e){return U(this,void 0,void 0,function*(){try{if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:(yield ht(this.fetch,`${this.url}/PutVectors`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(dt(r))return{data:null,error:r};throw r}})}getVectors(e){return U(this,void 0,void 0,function*(){try{return{data:yield ht(this.fetch,`${this.url}/GetVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(dt(r))return{data:null,error:r};throw r}})}listVectors(e){return U(this,void 0,void 0,function*(){try{if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return{data:yield ht(this.fetch,`${this.url}/ListVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(dt(r))return{data:null,error:r};throw r}})}queryVectors(e){return U(this,void 0,void 0,function*(){try{return{data:yield ht(this.fetch,`${this.url}/QueryVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(dt(r))return{data:null,error:r};throw r}})}deleteVectors(e){return U(this,void 0,void 0,function*(){try{if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:(yield ht(this.fetch,`${this.url}/DeleteVectors`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(dt(r))return{data:null,error:r};throw r}})}}class $P{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},sf),r),this.fetch=of(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return U(this,void 0,void 0,function*(){try{return{data:(yield ht(this.fetch,`${this.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(dt(r))return{data:null,error:r};throw r}})}getBucket(e){return U(this,void 0,void 0,function*(){try{return{data:yield ht(this.fetch,`${this.url}/GetVectorBucket`,{vectorBucketName:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(dt(r))return{data:null,error:r};throw r}})}listBuckets(){return U(this,arguments,void 0,function*(e={}){try{return{data:yield ht(this.fetch,`${this.url}/ListVectorBuckets`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(dt(r))return{data:null,error:r};throw r}})}deleteBucket(e){return U(this,void 0,void 0,function*(){try{return{data:(yield ht(this.fetch,`${this.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(dt(r))return{data:null,error:r};throw r}})}}class DP extends $P{constructor(e,r={}){super(e,r.headers||{},r.fetch)}from(e){return new MP(this.url,this.headers,e,this.fetch)}}class MP extends NP{constructor(e,r,n,s){super(e,r,s),this.vectorBucketName=n}createIndex(e){const r=Object.create(null,{createIndex:{get:()=>super.createIndex}});return U(this,void 0,void 0,function*(){return r.createIndex.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName}))})}listIndexes(){const e=Object.create(null,{listIndexes:{get:()=>super.listIndexes}});return U(this,arguments,void 0,function*(r={}){return e.listIndexes.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName}))})}getIndex(e){const r=Object.create(null,{getIndex:{get:()=>super.getIndex}});return U(this,void 0,void 0,function*(){return r.getIndex.call(this,this.vectorBucketName,e)})}deleteIndex(e){const r=Object.create(null,{deleteIndex:{get:()=>super.deleteIndex}});return U(this,void 0,void 0,function*(){return r.deleteIndex.call(this,this.vectorBucketName,e)})}index(e){return new UP(this.url,this.headers,this.vectorBucketName,e,this.fetch)}}class UP extends LP{constructor(e,r,n,s,i){super(e,r,i),this.vectorBucketName=n,this.indexName=s}putVectors(e){const r=Object.create(null,{putVectors:{get:()=>super.putVectors}});return U(this,void 0,void 0,function*(){return r.putVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}getVectors(e){const r=Object.create(null,{getVectors:{get:()=>super.getVectors}});return U(this,void 0,void 0,function*(){return r.getVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}listVectors(){const e=Object.create(null,{listVectors:{get:()=>super.listVectors}});return U(this,arguments,void 0,function*(r={}){return e.listVectors.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}queryVectors(e){const r=Object.create(null,{queryVectors:{get:()=>super.queryVectors}});return U(this,void 0,void 0,function*(){return r.queryVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}deleteVectors(e){const r=Object.create(null,{deleteVectors:{get:()=>super.deleteVectors}});return U(this,void 0,void 0,function*(){return r.deleteVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}}class FP extends TP{constructor(e,r={},n,s){super(e,r,n,s)}from(e){return new CP(this.url,this.headers,e,this.fetch)}get vectors(){return new DP(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new PP(this.url+"/iceberg",this.headers,this.fetch)}}const zP="2.79.0";let Mi="";typeof Deno<"u"?Mi="deno":typeof document<"u"?Mi="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Mi="react-native":Mi="node";const BP={"X-Client-Info":`supabase-js-${Mi}/${zP}`},VP={headers:BP},WP={schema:"public"},HP={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},qP={},KP=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),QP=()=>Headers,GP=(t,e,r)=>{const n=KP(r),s=QP();return async(i,o)=>{var a;const l=(a=await e())!==null&&a!==void 0?a:t;let u=new s(o==null?void 0:o.headers);return u.has("apikey")||u.set("apikey",t),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),n(i,Object.assign(Object.assign({},o),{headers:u}))}};function JP(t){return t.endsWith("/")?t:t+"/"}function YP(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:Object.assign(Object.assign({},l),s),auth:Object.assign(Object.assign({},u),i),realtime:Object.assign(Object.assign({},c),o),storage:{},global:Object.assign(Object.assign(Object.assign({},d),a),{headers:Object.assign(Object.assign({},(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 XP(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(JP(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}const e_="2.79.0",gs=30*1e3,Sd=3,Bu=Sd*gs,ZP="http://localhost:9999",eR="supabase.auth.token",tR={"X-Client-Info":`gotrue-js/${e_}`},kd="X-Supabase-Api-Version",t_={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},rR=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,nR=10*60*1e3;class So extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}}function F(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class sR extends So{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function iR(t){return F(t)&&t.name==="AuthApiError"}class An extends So{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}}class bn extends So{constructor(e,r,n,s){super(e,n,s),this.name=r,this.status=n}}class It extends bn{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function oR(t){return F(t)&&t.name==="AuthSessionMissingError"}class cs extends bn{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class ba extends bn{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class xa extends bn{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function aR(t){return F(t)&&t.name==="AuthImplicitGrantRedirectError"}class Rm extends bn{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Cd extends bn{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}}function Vu(t){return F(t)&&t.name==="AuthRetryableFetchError"}class Om extends bn{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}}class Td extends bn{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const wl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Am=` 	
\r=`.split(""),lR=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<Am.length;e+=1)t[Am[e].charCodeAt(0)]=-2;for(let e=0;e<wl.length;e+=1)t[wl[e].charCodeAt(0)]=e;return t})();function jm(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(wl[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(wl[n]),e.queuedBits-=6}}function r_(t,e,r){const n=lR[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 Im(t){const e=[],r=o=>{e.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=o=>{dR(o,n,r)};for(let o=0;o<t.length;o+=1)r_(t.charCodeAt(o),s,i);return e.join("")}function uR(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 cR(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}uR(n,e)}}function dR(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 Us(t){const e=[],r={queue:0,queuedBits:0},n=s=>{e.push(s)};for(let s=0;s<t.length;s+=1)r_(t.charCodeAt(s),r,n);return new Uint8Array(e)}function hR(t){const e=[];return cR(t,r=>e.push(r)),new Uint8Array(e)}function Ln(t){const e=[],r={queue:0,queuedBits:0},n=s=>{e.push(s)};return t.forEach(s=>jm(s,r,n)),jm(null,r,n),e.join("")}function fR(t){return Math.round(Date.now()/1e3)+t}function pR(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}const Be=()=>typeof window<"u"&&typeof document<"u",kn={tested:!1,writable:!1},n_=()=>{if(!Be())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(kn.tested)return kn.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),kn.tested=!0,kn.writable=!0}catch{kn.tested=!0,kn.writable=!1}return kn.writable};function mR(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 s_=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),gR=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))},Cn=async(t,e)=>{const r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}},$r=async(t,e)=>{await t.removeItem(e)};class Jl{constructor(){this.promise=new Jl.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}}Jl.promiseConstructor=Promise;function Wu(t){const e=t.split(".");if(e.length!==3)throw new Td("Invalid JWT structure");for(let n=0;n<e.length;n++)if(!rR.test(e[n]))throw new Td("JWT not in base64url format");return{header:JSON.parse(Im(e[0])),payload:JSON.parse(Im(e[1])),signature:Us(e[2]),raw:{header:e[0],payload:e[1]}}}async function vR(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function yR(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 wR(t){return("0"+t.toString(16)).substr(-2)}function _R(){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,wR).join("")}async function bR(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 xR(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 bR(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function ds(t,e,r=!1){const n=_R();let s=n;r&&(s+="/PASSWORD_RECOVERY"),await vs(t,`${e}-code-verifier`,s);const i=await xR(n);return[i,n===i?"plain":"s256"]}const ER=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function SR(t){const e=t.headers.get(kd);if(!e||!e.match(ER))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function kR(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 CR(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 TR=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function hs(t){if(!TR.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 PR(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 Nm(t){return JSON.parse(JSON.stringify(t))}const Rn=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),RR=[502,503,504];async function Lm(t){var e;if(!gR(t))throw new Cd(Rn(t),0);if(RR.includes(t.status))throw new Cd(Rn(t),t.status);let r;try{r=await t.json()}catch(i){throw new An(Rn(i),i)}let n;const s=SR(t);if(s&&s.getTime()>=t_["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 Om(Rn(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new It}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 Om(Rn(r),t.status,r.weak_password.reasons);throw new sR(Rn(r),t.status||500,n)}const OR=(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 W(t,e,r,n){var s;const i=Object.assign({},n==null?void 0:n.headers);i[kd]||(i[kd]=t_["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 AR(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 AR(t,e,r,n,s,i){const o=OR(e,n,s,i);let a;try{a=await t(r,Object.assign({},o))}catch(l){throw console.error(l),new Cd(Rn(l),0)}if(a.ok||await Lm(a),n!=null&&n.noResolveJson)return a;try{return await a.json()}catch(l){await Lm(l)}}function Nt(t){var e;let r=null;NR(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=fR(t.expires_in)));const n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}function $m(t){const e=Nt(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 Br(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function jR(t){return{data:t,error:null}}function IR(t){const{action_link:e,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i}=t,o=gi(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 Dm(t){return t}function NR(t){return t.access_token&&t.refresh_token&&t.expires_in}const qu=["global","local","others"];class LR{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=s_(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(e,r=qu[0]){if(qu.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${qu.join(", ")}`);try{return await W(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 W(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Br})}catch(n){if(F(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:r}=e,n=gi(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 W(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:IR,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 W(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Br})}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 W(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:Dm});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(_=>{const y=parseInt(_.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(_.split(";")[1].split("=")[1]);u[`${v}Page`]=y}),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 W(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Br})}catch(r){if(F(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){hs(e);try{return await W(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:Br})}catch(n){if(F(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){hs(e);try{return await W(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:Br})}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 W(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 W(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 W(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:Dm});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(_=>{const y=parseInt(_.split(";")[0].split("=")[1].substring(0,1)),v=JSON.parse(_.split(";")[1].split("=")[1]);u[`${v}Page`]=y}),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 W(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 W(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 W(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 W(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 W(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}}}function Mm(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}const fs={debug:!!(globalThis&&n_()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class i_ extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class $R extends i_{}async function DR(t,e,r){fs.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),fs.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async s=>{if(s){fs.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,s.name);try{return await r()}finally{fs.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,s.name)}}else{if(e===0)throw fs.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new $R(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(fs.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null,"  "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}}))}function MR(){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 o_(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function UR(t){return parseInt(t,16)}function FR(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}function zR(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=o_(t.address),_=c?`${c}://${n}`:n,y=t.statement?`${t.statement}
`:"",v=`${_} wants you to sign in with your Ethereum account:
${h}

${y}`;let g=`URI: ${d}
Version: ${f}
Chain ID: ${r}${o?`
Nonce: ${o}`:""}
Issued At: ${i.toISOString()}`;if(s&&(g+=`
Expiration Time: ${s.toISOString()}`),a&&(g+=`
Not Before: ${a.toISOString()}`),l&&(g+=`
Request ID: ${l}`),u){let p=`
Resources:`;for(const m of u){if(!m||typeof m!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${m}`);p+=`
- ${m}`}g+=p}return`${v}
${g}`}class Se 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 _l extends Se{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}}function BR({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 Se({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 Se({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 Se({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 Se({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 Se({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new Se({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 Se({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new Se({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(a_(o)){if(i.rp.id!==o)return new Se({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Se({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 Se({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 Se({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 Se({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function VR({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 Se({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new Se({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const n=window.location.hostname;if(a_(n)){if(r.rpId!==n)return new Se({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Se({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new Se({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 Se({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class WR{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 HR=new WR;function qR(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=gi(t,["challenge","user","excludeCredentials"]),i=Us(e).buffer,o=Object.assign(Object.assign({},r),{id:Us(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:Us(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return a}function KR(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=gi(t,["challenge","allowCredentials"]),s=Us(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:Us(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return i}function QR(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t;return{id:t.id,rawId:t.id,response:{attestationObject:Ln(new Uint8Array(t.response.attestationObject)),clientDataJSON:Ln(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function GR(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t,n=t.getClientExtensionResults(),s=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:Ln(new Uint8Array(s.authenticatorData)),clientDataJSON:Ln(new Uint8Array(s.clientDataJSON)),signature:Ln(new Uint8Array(s.signature)),userHandle:s.userHandle?Ln(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function a_(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function Um(){var t,e;return!!(Be()&&"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 JR(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new _l("Browser returned unexpected credential type",e)}:{data:null,error:new _l("Empty credential response",e)}}catch(e){return{data:null,error:BR({error:e,options:t})}}}async function YR(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new _l("Browser returned unexpected credential type",e)}:{data:null,error:new _l("Empty credential response",e)}}catch(e){return{data:null,error:VR({error:e,options:t})}}}const XR={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"none"},ZR={userVerification:"preferred",hints:["security-key"]};function bl(...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]=bl(a,o):n[i]=bl(o)}else n[i]=o}return n}function eO(t,e){return bl(XR,t,e||{})}function tO(t,e){return bl(ZR,t,e||{})}class rO{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:r,friendlyName:n,signal:s},i){try{const{data:o,error:a}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!o)return{data:null,error:a};const l=s??HR.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:u}=o.webauthn.credential_options.publicKey;u.name||(u.name=`${u.id}:${n}`),u.displayName||(u.displayName=u.name)}switch(o.webauthn.type){case"create":{const u=eO(o.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:c,error:d}=await JR({publicKey:u,signal:l});return c?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:c}},error:null}:{data:null,error:d}}case"request":{const u=tO(o.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:c,error:d}=await YR(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:u,signal:l}));return c?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:c}},error:null}:{data:null,error:d}}}}catch(o){return F(o)?{data:null,error:o}:{data:null,error:new An("Unexpected error in challenge",o)}}}async _verify({challengeId:e,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}},i){if(!r)return{data:null,error:new So("rpId is required for WebAuthn authentication")};try{if(!Um())return{data:null,error:new An("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 An("Unexpected error in authenticate",o)}}}async _register({friendlyName:e,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 So("rpId is required for WebAuthn registration")};try{if(!Um())return{data:null,error:new An("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 An("Unexpected error in register",o)}}}}MR();const nO={url:ZP,storageKey:eR,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:tR,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1};async function Fm(t,e,r){return await r()}const ps={};class ko{get jwks(){var e,r;return(r=(e=ps[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){ps[this.storageKey]=Object.assign(Object.assign({},ps[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=ps[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){ps[this.storageKey]=Object.assign(Object.assign({},ps[this.storageKey]),{cachedAt:e})}constructor(e){var r,n;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=ko.nextInstanceID,ko.nextInstanceID+=1,this.instanceID>0&&Be()&&console.warn("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.");const s=Object.assign(Object.assign({},nO),e);if(this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.persistSession=s.persistSession,this.storageKey=s.storageKey,this.autoRefreshToken=s.autoRefreshToken,this.admin=new LR({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=s_(s.fetch),this.lock=s.lock||Fm,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,this.throwOnError=s.throwOnError,s.lock?this.lock=s.lock:Be()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=DR:this.lock=Fm,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 rO(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this)},this.persistSession?(s.storage?this.storage=s.storage:n_()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Mm(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=Mm(this.memoryStorage)),Be()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(n=this.broadcastChannel)===null||n===void 0||n.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),await this._notifyAllSubscribers(i.data.event,i.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${e_}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let r={},n="none";if(Be()&&(r=mR(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),Be()&&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),aR(i)){const l=(e=i.details)===null||e===void 0?void 0:e.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:i}}return await this._removeSession(),{error:i}}const{session:o,redirectType:a}=s;return this._debug("#_initialize()","detected session in URL",o,"redirect type",a),await this._saveSession(o),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return F(r)?this._returnResult({error:r}):this._returnResult({error:new An("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,s;try{const i=await W(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:Nt}),{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,_=null;this.flowType==="pkce"&&([h,_]=await ds(this.storage,this.storageKey)),i=await W(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:_},xform:Nt})}else if("phone"in e){const{phone:c,password:d,options:f}=e;i=await W(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:Nt})}else throw new ba("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return this._returnResult({data:{user:null,session:null},error:a});const l=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(i){if(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 W(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:$m})}else if("phone"in e){const{phone:i,password:o,options:a}=e;r=await W(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:$m})}else throw new ba("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(-1,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:r}=e;switch(r){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(e){var r,n,s,i,o,a,l,u,c,d,f;let h,_;if("message"in e)h=e.message,_=e.signature;else{const{chain:y,wallet:v,statement:g,options:p}=e;let m;if(Be())if(typeof v=="object")m=v;else{const j=window;if("ethereum"in j&&typeof j.ethereum=="object"&&"request"in j.ethereum&&typeof j.ethereum.request=="function")m=j.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof v!="object"||!(p!=null&&p.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");m=v}const b=new URL((r=p==null?void 0:p.url)!==null&&r!==void 0?r:window.location.href),x=await m.request({method:"eth_requestAccounts"}).then(j=>j).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!x||x.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const k=o_(x[0]);let C=(n=p==null?void 0:p.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!C){const j=await m.request({method:"eth_chainId"});C=UR(j)}const T={domain:b.host,address:k,statement:g,uri:b.href,version:"1",chainId:C,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=zR(T),_=await m.request({method:"personal_sign",params:[FR(h),k]})}try{const{data:y,error:v}=await W(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:h,signature:_},!((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:Nt});if(v)throw v;if(!y||!y.session||!y.user){const g=new cs;return this._returnResult({data:{user:null,session:null},error:g})}return y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("SIGNED_IN",y.session)),this._returnResult({data:Object.assign({},y),error:v})}catch(y){if(F(y))return this._returnResult({data:{user:null,session:null},error:y});throw y}}async signInWithSolana(e){var r,n,s,i,o,a,l,u,c,d,f,h;let _,y;if("message"in e)_=e.message,y=e.signature;else{const{chain:v,wallet:g,statement:p,options:m}=e;let b;if(Be())if(typeof g=="object")b=g;else{const k=window;if("solana"in k&&typeof k.solana=="object"&&("signIn"in k.solana&&typeof k.solana.signIn=="function"||"signMessage"in k.solana&&typeof k.solana.signMessage=="function"))b=k.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 g!="object"||!(m!=null&&m.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");b=g}const x=new URL((r=m==null?void 0:m.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in b&&b.signIn){const k=await b.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},m==null?void 0:m.signInWithSolana),{version:"1",domain:x.host,uri:x.href}),p?{statement:p}:null));let C;if(Array.isArray(k)&&k[0]&&typeof k[0]=="object")C=k[0];else if(k&&typeof k=="object"&&"signedMessage"in k&&"signature"in k)C=k;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in C&&"signature"in C&&(typeof C.signedMessage=="string"||C.signedMessage instanceof Uint8Array)&&C.signature instanceof Uint8Array)_=typeof C.signedMessage=="string"?C.signedMessage:new TextDecoder().decode(C.signedMessage),y=C.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");_=[`${x.host} wants you to sign in with your Solana account:`,b.publicKey.toBase58(),...p?["",p,""]:[""],"Version: 1",`URI: ${x.href}`,`Issued At: ${(s=(n=m==null?void 0:m.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((i=m==null?void 0:m.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${m.signInWithSolana.notBefore}`]:[],...!((o=m==null?void 0:m.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${m.signInWithSolana.expirationTime}`]:[],...!((a=m==null?void 0:m.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${m.signInWithSolana.chainId}`]:[],...!((l=m==null?void 0:m.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${m.signInWithSolana.nonce}`]:[],...!((u=m==null?void 0:m.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${m.signInWithSolana.requestId}`]:[],...!((d=(c=m==null?void 0:m.signInWithSolana)===null||c===void 0?void 0:c.resources)===null||d===void 0)&&d.length?["Resources",...m.signInWithSolana.resources.map(C=>`- ${C}`)]:[]].join(`
`);const k=await b.signMessage(new TextEncoder().encode(_),"utf8");if(!k||!(k instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");y=k}}try{const{data:v,error:g}=await W(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:_,signature:Ln(y)},!((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:Nt});if(g)throw g;if(!v||!v.session||!v.user){const p=new cs;return this._returnResult({data:{user:null,session:null},error:p})}return v.session&&(await this._saveSession(v.session),await this._notifyAllSubscribers("SIGNED_IN",v.session)),this._returnResult({data:Object.assign({},v),error:g})}catch(v){if(F(v))return this._returnResult({data:{user:null,session:null},error:v});throw v}}async _exchangeCodeForSession(e){const r=await Cn(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(r??"").split("/");try{const{data:i,error:o}=await W(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:Nt});if(await $r(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(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 W(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:Nt}),{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 W(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 W(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 ba("You must provide either an email or phone number.")}catch(a){if(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 W(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:Nt});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;try{let i=null,o=null;this.flowType==="pkce"&&([i,o]=await ds(this.storage,this.storageKey));const a=await W(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:i,code_challenge_method:o}),headers:this.headers,xform:jR});return this._returnResult(a)}catch(i){if(F(i))return this._returnResult({data:null,error:i});throw i}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new It;const{error:s}=await W(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 W(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 W(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 ba("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(-1,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const r=await Cn(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 Cn(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=PR(e.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{session:null},error:i}):this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await W(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Br}):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 It}:await W(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:Br})})}catch(r){if(F(r))return oR(r)&&(await this._removeSession(),await $r(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{const{data:s,error:i}=n;if(i)throw i;if(!s.session)throw new It;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 W(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:Br});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(F(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new It;const r=Date.now()/1e3;let n=r,s=!0,i=null;const{payload:o}=Wu(e.access_token);if(o.exp&&(n=o.exp,s=n<=r),s){const{data:a,error:l}=await this._callRefreshToken(e.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!a)return{data:{user:null,session:null},error:null};i=a}else{const{data:a,error:l}=await this._getUser(e.access_token);if(l)throw l;i={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(r){if(F(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){const{data:o,error:a}=r;if(a)throw a;e=(n=o.session)!==null&&n!==void 0?n:void 0}if(!(e!=null&&e.refresh_token))throw new It;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(!Be())throw new xa("No browser detected.");if(e.error||e.error_description||e.error_code)throw new xa(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 Rm("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new xa("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 Rm("No code detected.");const{data:p,error:m}=await this._exchangeCodeForSession(e.code);if(m)throw m;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 xa("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 _=f-d;c-_>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",_,f,c):c-_<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",_,f,c);const{data:y,error:v}=await this._getUser(i);if(v)throw v;const g={provider_token:n,provider_refresh_token:s,access_token:i,expires_in:d,expires_at:f,refresh_token:o,token_type:u,user:y.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:g,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!!(e.access_token||e.error_description)}async _isPKCECallback(e){const r=await Cn(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return this._returnResult({error:i});const o=(n=s.session)===null||n===void 0?void 0:n.access_token;if(o){const{error:a}=await this.admin.signOut(o,e);if(a&&!(iR(a)&&(a.status===404||a.status===401||a.status===403)))return this._returnResult({error:a})}return e!=="others"&&(await this._removeSession(),await $r(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const r=pR(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,s;try{const{data:{session:i},error:o}=r;if(o)throw o;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",e,"session",i)}catch(i){await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",i),console.error(i)}})}async resetPasswordForEmail(e,r={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await ds(this.storage,this.storageKey,!0));try{return await W(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(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 W(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 Be()&&!(!((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 W(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:Nt}),{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(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 W(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 yR(async s=>(s>0&&await vR(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await W(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Nt})),(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),Be()&&!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 Cn(this.storage,this.storageKey);if(s&&this.userStorage){let o=await Cn(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 Cn(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(s.user=o.user,await $r(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 It;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new Jl;const{data:i,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!i.session)throw new It;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;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=Nm(s);await vs(this.storage,this.storageKey,i)}else{const s=Nm(r);await vs(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),await $r(this.storage,this.storageKey),await $r(this.storage,this.storageKey+"-code-verifier"),await $r(this.storage,this.storageKey+"-user"),this.userStorage&&await $r(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Be()&&(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),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-e)/gs);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${gs}ms, refresh threshold is ${Sd} ticks`),s<=Sd&&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 i_)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Be()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){const s=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&s.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&s.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[i,o]=await 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 W(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 W(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(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?QR(e.webauthn.credential_response):GR(e.webauthn.credential_response)})}:{code:e.code}),{data:a,error:l}=await W(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(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i)return this._returnResult({data:null,error:i});const o=await W(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:qR(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:KR(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(){var e,r;const{data:{session:n},error:s}=await this.getSession();if(s)return this._returnResult({data:null,error:s});if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:i}=Wu(n.access_token);let o=null;i.aal&&(o=i.aal);let a=o;((r=(e=n.user.factors)===null||e===void 0?void 0:e.filter(c=>c.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(a="aal2");const u=i.amr||[];return{data:{currentLevel:o,nextLevel:a,currentAuthenticationMethods:u},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?await W(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 It})})}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 It});const o=await W(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&&Be()&&!(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 It});const o=await W(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&&Be()&&!(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 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+nR>s)return n;const{data:i,error:o}=await W(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:_}=await this.getSession();if(_||!h.session)return this._returnResult({data:null,error:_});n=h.session.access_token}const{header:s,payload:i,signature:o,raw:{header:a,payload:l}}=Wu(n);r!=null&&r.allowExpired||kR(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=CR(s.alg),d=await crypto.subtle.importKey("jwk",u,c,!0,["verify"]);if(!await crypto.subtle.verify(c,d,o,hR(`${a}.${l}`)))throw new Td("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}}}ko.nextInstanceID=0;const sO=ko;class iO extends sO{constructor(e){super(e)}}class oO{constructor(e,r,n){var s,i,o;this.supabaseUrl=e,this.supabaseKey=r;const a=XP(e);if(!r)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const l=`sb-${a.hostname.split(".")[0]}-auth-token`,u={db:WP,realtime:qP,auth:Object.assign(Object.assign({},HP),{storageKey:l}),global:VP},c=YP(n??{},u);this.storageKey=(s=c.auth.storageKey)!==null&&s!==void 0?s:"",this.headers=(i=c.global.headers)!==null&&i!==void 0?i:{},c.accessToken?(this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(d,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=c.auth)!==null&&o!==void 0?o:{},this.headers,c.global.fetch),this.fetch=GP(r,this._getAccessToken.bind(this),c.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},c.realtime)),this.rest=new ZT(new URL("rest/v1",a).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch}),this.storage=new FP(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new JT(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,r,n)}channel(e,r={config:{}}){return this.realtime.channel(e,r)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e,r;if(this.accessToken)return await this.accessToken();const{data:n}=await this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:s,userStorage:i,storageKey:o,flowType:a,lock:l,debug:u,throwOnError:c},d,f){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new iO({url:this.authUrl.href,headers:Object.assign(Object.assign({},h),d),storageKey:o,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:s,userStorage:i,flowType:a,lock:l,debug:u,throwOnError:c,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(_=>_.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new gP(this.realtimeUrl.href,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n==null?void 0:n.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const aO=(t,e,r)=>new oO(t,e,r);function lO(){if(typeof window<"u"||typeof process>"u")return!1;const t=process.version;if(t==null)return!1;const e=t.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}lO()&&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 uO="https://fstfyyvdtlxlhdqlwghn.supabase.co",cO="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZzdGZ5eXZkdGx4bGhkcWx3Z2huIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjI0MjQyOTUsImV4cCI6MjA3ODAwMDI5NX0.5t3MG_jeyOvfXmYDW6wLNCYRYifmAr_yNFogE9u1aYA",lt=aO(uO,cO,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),l_=w.createContext(void 0);function dO({children:t}){const[e,r]=w.useState(null),[n,s]=w.useState(null),[i,o]=w.useState(!1),[a,l]=w.useState(!0),[u,c]=w.useState(!1),{toast:d}=by(),f=async v=>{try{const{data:g,error:p}=await lt.rpc("has_role",{_user_id:v,_role:"admin"});return p?(console.error("Error checking admin role:",p),!1):g||!1}catch(g){return console.error("Error checking admin role:",g),!1}};w.useEffect(()=>{let v=!0;const g=x=>{s(x),r((x==null?void 0:x.user)??null)},p=async x=>{if(!v)return;if(!(x!=null&&x.user)){o(!1),v&&c(!0);return}const k=await f(x.user.id);v&&(o(k),c(!0))},{data:{subscription:m}}=lt.auth.onAuthStateChange((x,k)=>{if(v){if(g(k),x==="SIGNED_OUT"||!(k!=null&&k.user)){o(!1),c(!0),l(!1);return}x==="SIGNED_IN"&&(l(!0),setTimeout(()=>{v&&p(k).catch(()=>{v&&o(!1)}).finally(()=>{v&&l(!1)})},0))}});return(async()=>{l(!0),c(!1);const{data:{session:x}}=await lt.auth.getSession();if(v){g(x);try{await p(x)}finally{v&&l(!1)}}})(),()=>{v=!1,m.unsubscribe()}},[]);const h=async(v,g)=>{try{const{data:p,error:m}=await lt.rpc("check_auth_rate_limit",{user_email:v});if(m)console.error("Error checking rate limit:",m);else if(p){const k=p;if(k.blocked)return lt.functions.invoke("send-security-alert",{body:{email:v,alertType:"rate_limit_block",details:{blockDuration:300,timestamp:new Date().toISOString()}}}).catch(C=>console.error("Error sending security alert:",C)),d({title:"Prea multe încercări",description:k.message||"Vă rugăm să așteptați înainte de a încerca din nou.",variant:"destructive"}),{error:new Error(k.message||"Rate limit exceeded")};if(k.remaining_attempts!==void 0&&k.remaining_attempts<=2){const C=5-k.remaining_attempts;lt.functions.invoke("send-security-alert",{body:{email:v,alertType:"failed_attempts",details:{attemptCount:C,timestamp:new Date().toISOString()}}}).catch(T=>console.error("Error sending security alert:",T))}}const{error:b}=await lt.auth.signInWithPassword({email:v,password:g}),x=await lt.rpc("log_auth_attempt",{user_email:v,is_successful:!b});if(x.error&&console.error("Error logging auth attempt:",x.error),b){if(p){const k=p;if(!k.blocked&&k.remaining_attempts!==void 0){const C=k.remaining_attempts-1;d({title:"Eroare la autentificare",description:`${b.message}${C>0?` Mai aveți ${C} încercări rămase.`:""}`,variant:"destructive"})}else d({title:"Eroare la autentificare",description:b.message,variant:"destructive"})}else d({title:"Eroare la autentificare",description:b.message,variant:"destructive"});return{error:b}}if(p){const k=p;k.remaining_attempts!==void 0&&k.remaining_attempts<5&&lt.functions.invoke("send-security-alert",{body:{email:v,alertType:"successful_after_fails",details:{timestamp:new Date().toISOString()}}}).catch(C=>console.error("Error sending security alert:",C))}return d({title:"Autentificare reușită",description:"Bine ai revenit!"}),{error:null}}catch(p){const m=p;return d({title:"Eroare",description:m.message,variant:"destructive"}),{error:m}}},_=async(v,g)=>{try{const{data:p,error:m}=await lt.rpc("validate_password_strength",{password:g});if(m)console.error("Error validating password:",m);else if(p){const k=p;if(!k.valid)return d({title:"Parolă invalidă",description:k.errors[0],variant:"destructive"}),{error:new Error(k.errors[0])}}const b=`${window.location.origin}/`,{error:x}=await lt.auth.signUp({email:v,password:g,options:{emailRedirectTo:b}});return x?(d({title:"Eroare la înregistrare",description:x.message,variant:"destructive"}),{error:x}):(d({title:"Cont creat cu succes",description:"Te poți autentifica acum."}),{error:null})}catch(p){const m=p;return d({title:"Eroare",description:m.message,variant:"destructive"}),{error:m}}},y=async()=>{try{await lt.auth.signOut(),o(!1),d({title:"Deconectare reușită"})}catch(v){console.error("Error signing out:",v)}};return S.jsx(l_.Provider,{value:{user:e,session:n,isAdmin:i,loading:a,adminCheckComplete:u,signIn:h,signUp:_,signOut:y},children:t})}function u_(){const t=w.useContext(l_);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t}const hO="G-VTHVQFP7SZ",fO=t=>{typeof window<"u"&&window.gtag&&window.gtag("config",hO,{page_path:t})},xl=(t,e)=>{typeof window<"u"&&window.gtag&&window.gtag("event",t,e)},hA=t=>{xl("product_comparison",{product_count:t.length,product_ids:t.join(",")})},fA=t=>{xl("search",{search_term:t})},c_=w.createContext(void 0),zm="product-comparison",pO=4,mO=({children:t})=>{const[e,r]=w.useState(()=>{const a=localStorage.getItem(zm);return a?JSON.parse(a):[]});w.useEffect(()=>{localStorage.setItem(zm,JSON.stringify(e))},[e]);const n=a=>e.includes(a)?!0:e.length>=pO?!1:(r(l=>{const u=[...l,a];return xl("add_to_comparison",{product_id:a,comparison_count:u.length}),u}),!0),s=a=>{r(l=>{const u=l.filter(c=>c!==a);return xl("remove_from_comparison",{product_id:a,comparison_count:u.length}),u})},i=()=>{r([])},o=a=>e.includes(a);return S.jsx(c_.Provider,{value:{comparisonIds:e,addToComparison:n,removeFromComparison:s,clearComparison:i,isInComparison:o},children:t})},pA=()=>{const t=w.useContext(c_);if(!t)throw new Error("useComparison must be used within ComparisonProvider");return t};function ji({children:t}){const{user:e,isAdmin:r,loading:n,adminCheckComplete:s}=u_();return n||!s?S.jsx("div",{className:"min-h-screen flex items-center justify-center",children:S.jsx(tS,{className:"h-8 w-8 animate-spin text-primary"})}):e?r?S.jsx(S.Fragment,{children:t}):S.jsx(cm,{to:"/products",replace:!0}):S.jsx(cm,{to:"/login",replace:!0})}let d_=-1;const wi=t=>{addEventListener("pageshow",e=>{e.persisted&&(d_=e.timeStamp,t(e))},!0)},ir=(t,e,r,n)=>{let s,i;return o=>{e.value>=0&&(o||n)&&(i=e.value-(s??0),(i||s===void 0)&&(s=e.value,e.delta=i,e.rating=((a,l)=>a>l[1]?"poor":a>l[0]?"needs-improvement":"good")(e.value,r),t(e)))}},af=t=>{requestAnimationFrame(()=>requestAnimationFrame(()=>t()))},lf=()=>{const t=performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Fo=()=>{const t=lf();return(t==null?void 0:t.activationStart)??0},or=(t,e=-1)=>{const r=lf();let n="navigate";return d_>=0?n="back-forward-cache":r&&(document.prerendering||Fo()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:t,value:e,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},Ku=new WeakMap;function uf(t,e){return Ku.get(t)||Ku.set(t,new e),Ku.get(t)}class gO{constructor(){lr(this,"t");lr(this,"i",0);lr(this,"o",[])}h(e){var s;if(e.hadRecentInput)return;const r=this.o[0],n=this.o.at(-1);this.i&&r&&n&&e.startTime-n.startTime<1e3&&e.startTime-r.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),(s=this.t)==null||s.call(this,e)}}const zo=(t,e,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const n=new PerformanceObserver(s=>{Promise.resolve().then(()=>{e(s.getEntries())})});return n.observe({type:t,buffered:!0,...r}),n}}catch{}},cf=t=>{let e=!1;return()=>{e||(t(),e=!0)}};let Os=-1;const h_=new Set,Bm=()=>document.visibilityState!=="hidden"||document.prerendering?1/0:0,Pd=t=>{if(document.visibilityState==="hidden"){if(t.type==="visibilitychange")for(const e of h_)e();isFinite(Os)||(Os=t.type==="visibilitychange"?t.timeStamp:0,removeEventListener("prerenderingchange",Pd,!0))}},Yl=()=>{var t;if(Os<0){const e=Fo();Os=(document.prerendering||(t=globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0])==null?void 0:t.startTime)??Bm(),addEventListener("visibilitychange",Pd,!0),addEventListener("prerenderingchange",Pd,!0),wi(()=>{setTimeout(()=>{Os=Bm()})})}return{get firstHiddenTime(){return Os},onHidden(e){h_.add(e)}}},Xl=t=>{document.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()},Vm=[1800,3e3],f_=(t,e={})=>{Xl(()=>{const r=Yl();let n,s=or("FCP");const i=zo("paint",o=>{for(const a of o)a.name==="first-contentful-paint"&&(i.disconnect(),a.startTime<r.firstHiddenTime&&(s.value=Math.max(a.startTime-Fo(),0),s.entries.push(a),n(!0)))});i&&(n=ir(t,s,Vm,e.reportAllChanges),wi(o=>{s=or("FCP"),n=ir(t,s,Vm,e.reportAllChanges),af(()=>{s.value=performance.now()-o.timeStamp,n(!0)})}))})},Wm=[.1,.25],vO=(t,e={})=>{const r=Yl();f_(cf(()=>{let n,s=or("CLS",0);const i=uf(e,gO),o=l=>{for(const u of l)i.h(u);i.i>s.value&&(s.value=i.i,s.entries=i.o,n())},a=zo("layout-shift",o);a&&(n=ir(t,s,Wm,e.reportAllChanges),r.onHidden(()=>{o(a.takeRecords()),n(!0)}),wi(()=>{i.i=0,s=or("CLS",0),n=ir(t,s,Wm,e.reportAllChanges),af(()=>n())}),setTimeout(n))}))};let p_=0,Qu=1/0,Ea=0;const yO=t=>{for(const e of t)e.interactionId&&(Qu=Math.min(Qu,e.interactionId),Ea=Math.max(Ea,e.interactionId),p_=Ea?(Ea-Qu)/7+1:0)};let Rd;const Hm=()=>Rd?p_:performance.interactionCount??0,wO=()=>{"interactionCount"in performance||Rd||(Rd=zo("event",yO,{type:"event",buffered:!0,durationThreshold:0}))};let qm=0;class _O{constructor(){lr(this,"u",[]);lr(this,"l",new Map);lr(this,"m");lr(this,"p")}v(){qm=Hm(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((Hm()-qm)/50));return this.u[e]}h(e){var s,i;if((s=this.m)==null||s.call(this,e),!e.interactionId&&e.entryType!=="first-input")return;const r=this.u.at(-1);let n=this.l.get(e.interactionId);if(n||this.u.length<10||e.duration>r.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort((o,a)=>a.P-o.P),this.u.length>10){const o=this.u.splice(10);for(const a of o)this.l.delete(a.id)}(i=this.p)==null||i.call(this,n)}}}const m_=t=>{const e=globalThis.requestIdleCallback||setTimeout;document.visibilityState==="hidden"?t():(t=cf(t),addEventListener("visibilitychange",t,{once:!0,capture:!0}),e(()=>{t(),removeEventListener("visibilitychange",t,{capture:!0})}))},Km=[200,500],bO=(t,e={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const r=Yl();Xl(()=>{wO();let n,s=or("INP");const i=uf(e,_O),o=l=>{m_(()=>{for(const c of l)i.h(c);const u=i.L();u&&u.P!==s.value&&(s.value=u.P,s.entries=u.entries,n())})},a=zo("event",o,{durationThreshold:e.durationThreshold??40});n=ir(t,s,Km,e.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),r.onHidden(()=>{o(a.takeRecords()),n(!0)}),wi(()=>{i.v(),s=or("INP"),n=ir(t,s,Km,e.reportAllChanges)}))})};class xO{constructor(){lr(this,"m")}h(e){var r;(r=this.m)==null||r.call(this,e)}}const Qm=[2500,4e3],EO=(t,e={})=>{Xl(()=>{const r=Yl();let n,s=or("LCP");const i=uf(e,xO),o=l=>{e.reportAllChanges||(l=l.slice(-1));for(const u of l)i.h(u),u.startTime<r.firstHiddenTime&&(s.value=Math.max(u.startTime-Fo(),0),s.entries=[u],n())},a=zo("largest-contentful-paint",o);if(a){n=ir(t,s,Qm,e.reportAllChanges);const l=cf(()=>{o(a.takeRecords()),a.disconnect(),n(!0)}),u=c=>{c.isTrusted&&(m_(l),removeEventListener(c.type,u,{capture:!0}))};for(const c of["keydown","click","visibilitychange"])addEventListener(c,u,{capture:!0});wi(c=>{s=or("LCP"),n=ir(t,s,Qm,e.reportAllChanges),af(()=>{s.value=performance.now()-c.timeStamp,n(!0)})})}})},Gm=[800,1800],Od=t=>{document.prerendering?Xl(()=>Od(t)):document.readyState!=="complete"?addEventListener("load",()=>Od(t),!0):setTimeout(t)},SO=(t,e={})=>{let r=or("TTFB"),n=ir(t,r,Gm,e.reportAllChanges);Od(()=>{const s=lf();s&&(r.value=Math.max(s.responseStart-Fo(),0),r.entries=[s],n(!0),wi(()=>{r=or("TTFB",0),n=ir(t,r,Gm,e.reportAllChanges),n(!0)}))})},kO=(t=!0)=>{w.useEffect(()=>{const e=r=>{if(t&&"performance"in window&&"measure"in window.performance)try{window.performance.mark(`web-vitals-${r.name}`)}catch(n){console.error("Failed to mark web vital:",n)}};vO(e),bO(e),EO(e),f_(e),SO(e)},[t])},CO=()=>{const{isAdmin:t,loading:e,adminCheckComplete:r}=u_(),{data:n,isLoading:s}=WC({queryKey:["maintenance-settings"],queryFn:async()=>{const{data:o,error:a}=await lt.from("site_settings_public").select("maintenance_mode, maintenance_message").single();return a?(console.error("Error fetching maintenance settings:",a),{maintenance_mode:!1,maintenance_message:""}):o},refetchInterval:3e4,staleTime:0,refetchOnMount:!0,refetchOnWindowFocus:!0}),i=e||!r||s;return{isInMaintenance:!i&&(n==null?void 0:n.maintenance_mode)&&!t,maintenanceMessage:n==null?void 0:n.maintenance_message,isLoading:i}};function ms({className:t,...e}){return S.jsx("div",{className:wn("animate-pulse rounded-md bg-muted",t),...e})}const TO=w.lazy(()=>Ce(()=>import("./Index-Csq_a7Uu.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))),PO=w.lazy(()=>Ce(()=>import("./Login-CZbosYFl.js"),__vite__mapDeps([20,16,17,18,2,4,21]))),RO=w.lazy(()=>Ce(()=>import("./Signup-BJF6P2Lx.js"),__vite__mapDeps([22,16,17,18,2,4,21,23,24,9]))),OO=w.lazy(()=>Ce(()=>import("./Products-XIDlbOgM.js"),__vite__mapDeps([25,1,2,3,4,5,26,12,27,7,8,9,28,10,29,16,17,18,13,14]))),AO=w.lazy(()=>Ce(()=>import("./ProductDetail-JXyzu4Uq.js"),__vite__mapDeps([30,16,17,18,5,6,4,2,7,8,9,10,1,11,12,13,14,31,32,33,34,35,36,37,38,23,29,26,39,15,40]))),jO=w.lazy(()=>Ce(()=>import("./ProductRedirect-_BEmhayM.js"),[])),IO=w.lazy(()=>Ce(()=>import("./Compare-CbRzpJlb.js"),__vite__mapDeps([41,1,2,4,5,42,14,26,12,16,17,18,15]))),NO=w.lazy(()=>Ce(()=>import("./Terms-QOYp_ne3.js"),__vite__mapDeps([43,1,2,26,12,16,17,18]))),LO=w.lazy(()=>Ce(()=>import("./Privacy-BKxUAgpE.js"),__vite__mapDeps([44,1,2,26,12,16,17,18])));w.lazy(()=>Ce(()=>import("./Contact-CtGQnXqF.js"),__vite__mapDeps([45,1,2,26,12,16,17,18,37])));w.lazy(()=>Ce(()=>import("./Cookies-CFFfVhlJ.js"),__vite__mapDeps([46,1,2,26,12,16,17,18])));const $O=w.lazy(()=>Ce(()=>import("./NotFound-D44nFSrO.js"),__vite__mapDeps([47,16,17,1,2,6,4,5,7,8,9,10,11,12,13,14,26,19,40]))),DO=w.lazy(()=>Ce(()=>import("./Dashboard-aHVTxKHv.js"),__vite__mapDeps([48,31,1,2,33,4,24,49,50,51,35,23,21,37,52,8,5,14,53,28,10,29,9,38,34,42,54,19,16,39,11]))),MO=w.lazy(()=>Ce(()=>import("./SecurityDashboard-D8sSF21x.js"),__vite__mapDeps([55,1,2,4,33,39,11,10,52,16,32,56]))),UO=w.lazy(()=>Ce(()=>import("./FeedDetail-C0PiUps-.js"),__vite__mapDeps([57,31,1,2,21,4,39,11,10,28,8,29,9,33,16,38,54,56,53,50,58,15,51]))),FO=w.lazy(()=>Ce(()=>import("./Settings-B6mi3n82.js"),__vite__mapDeps([59,31,1,2,4,21,28,10,8,29,9,33,16,38,36,37,50,60,58,56,23,24,34,51,14,49]))),zO=w.lazy(()=>Ce(()=>import("./MaintenancePage-B7FSZ3i9.js"),__vite__mapDeps([61,16,17,60]))),BO=w.lazy(()=>Ce(()=>import("./Categories-DEyXd75K.js"),__vite__mapDeps([62,1,2,26,12,4,16,17,18,40]))),VO=w.lazy(()=>Ce(()=>import("./CategoryPage-N4FVmRt6.js"),__vite__mapDeps([63,1,2,3,4,5,26,12,27,7,8,9,28,10,29,16,17,18,13,14]))),WO=w.lazy(()=>Ce(()=>import("./Advertisers-Bjjuhdlx.js"),__vite__mapDeps([64,31,1,2,4,33,53,21,7,8,9,52,50,42,14,34,56]))),HO=new TC({defaultOptions:{queries:{staleTime:5*60*1e3,gcTime:10*60*1e3,refetchOnWindowFocus:!0,retry:1,refetchOnMount:!0}}}),Te=()=>S.jsxs("div",{className:"min-h-screen bg-background",children:[S.jsx("div",{className:"border-b",children:S.jsx("div",{className:"container mx-auto px-4 py-4",children:S.jsx(ms,{className:"h-8 w-32"})})}),S.jsxs("div",{className:"container mx-auto px-4 py-8",children:[S.jsx(ms,{className:"h-12 w-3/4 mb-4"}),S.jsx(ms,{className:"h-6 w-1/2 mb-8"}),S.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[1,2,3,4,5,6].map(t=>S.jsxs("div",{className:"space-y-3",children:[S.jsx(ms,{className:"h-48 w-full"}),S.jsx(ms,{className:"h-4 w-3/4"}),S.jsx(ms,{className:"h-4 w-1/2"})]},t))})]})]}),qO=()=>{kO(!0);const t=rs(),{isInMaintenance:e,maintenanceMessage:r,isLoading:n}=CO();if(w.useEffect(()=>{fO(t.pathname+t.search)},[t]),n)return S.jsx(Te,{});const s=t.pathname==="/login"||t.pathname==="/signup";return e&&!s?S.jsx(w.Suspense,{fallback:S.jsx(Te,{}),children:S.jsx(zO,{message:r})}):S.jsxs(IT,{children:[S.jsx(je,{path:"/",element:S.jsx(w.Suspense,{fallback:S.jsx(Te,{}),children:S.jsx(TO,{})})}),S.jsx(je,{path:"/login",element:S.jsx(w.Suspense,{fallback:S.jsx(Te,{}),children:S.jsx(PO,{})})}),S.jsx(je,{path:"/signup",element:S.jsx(w.Suspense,{fallback:S.jsx(Te,{}),children:S.jsx(RO,{})})}),S.jsx(je,{path:"/products",element:S.jsx(w.Suspense,{fallback:S.jsx(Te,{}),children:S.jsx(OO,{})})}),S.jsx(je,{path:"/product/:slug",element:S.jsx(w.Suspense,{fallback:S.jsx(Te,{}),children:S.jsx(AO,{})})}),S.jsx(je,{path:"/products/:id",element:S.jsx(w.Suspense,{fallback:S.jsx(Te,{}),children:S.jsx(jO,{})})}),S.jsx(je,{path:"/categorii",element:S.jsx(w.Suspense,{fallback:S.jsx(Te,{}),children:S.jsx(BO,{})})}),S.jsx(je,{path:"/categorie/:slug",element:S.jsx(w.Suspense,{fallback:S.jsx(Te,{}),children:S.jsx(VO,{})})}),S.jsx(je,{path:"/compare",element:S.jsx(w.Suspense,{fallback:S.jsx(Te,{}),children:S.jsx(IO,{})})}),S.jsx(je,{path:"/terms",element:S.jsx(w.Suspense,{fallback:S.jsx(Te,{}),children:S.jsx(NO,{})})}),S.jsx(je,{path:"/privacy",element:S.jsx(w.Suspense,{fallback:S.jsx(Te,{}),children:S.jsx(LO,{})})}),S.jsx(je,{path:"/dashboard",element:S.jsx(ji,{children:S.jsx(w.Suspense,{fallback:S.jsx(Te,{}),children:S.jsx(DO,{})})})}),S.jsx(je,{path:"/security",element:S.jsx(ji,{children:S.jsx(w.Suspense,{fallback:S.jsx(Te,{}),children:S.jsx(MO,{})})})}),S.jsx(je,{path:"/feeds/:feedId",element:S.jsx(ji,{children:S.jsx(w.Suspense,{fallback:S.jsx(Te,{}),children:S.jsx(UO,{})})})}),S.jsx(je,{path:"/settings",element:S.jsx(ji,{children:S.jsx(w.Suspense,{fallback:S.jsx(Te,{}),children:S.jsx(FO,{})})})}),S.jsx(je,{path:"/advertisers",element:S.jsx(ji,{children:S.jsx(w.Suspense,{fallback:S.jsx(Te,{}),children:S.jsx(WO,{})})})}),S.jsx(je,{path:"*",element:S.jsx(w.Suspense,{fallback:S.jsx(Te,{}),children:S.jsx($O,{})})})]})},KO=()=>S.jsx(jC,{client:HO,children:S.jsxs(lC,{children:[S.jsx(MS,{}),S.jsx(g1,{}),S.jsx(zT,{children:S.jsx(dO,{children:S.jsx(mO,{children:S.jsx(qO,{})})})})]})});_y(document.getElementById("root")).render(S.jsx(KO,{}));export{YE as $,x0 as A,Fk as B,Th as C,Ch as D,zk as E,fn as F,Bk as G,xy as H,Sy as I,Py as J,ul as K,iA as L,Uk as M,cm as N,jk as O,at as P,iE as Q,I as R,YO as S,lC as T,GO as U,og as V,ms as W,rS as X,Jy as Y,ZO as Z,xr as _,wn as a,Lo as a0,OE as a1,lE as a2,Mo as a3,Zc as a4,wo as a5,SC as a6,$e as a7,tt as a8,pC as a9,fA as aa,vl as ab,gi as ac,vw as ad,JO as ae,tS as b,Xy as c,u_ as d,Jh as e,by as f,oA as g,AC as h,rA as i,S as j,nA as k,uC as l,hE as m,Ul as n,Ry as o,Ht as p,Oe as q,w as r,lt as s,xl as t,WC as u,w1 as v,sA as w,pA as x,hA as y,rs as z};