342 lines
669 KiB
JavaScript
342 lines
669 KiB
JavaScript
function OT(e,t){for(var a=0;a<t.length;a++){const s=t[a];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const c=Object.getOwnPropertyDescriptor(s,o);c&&Object.defineProperty(e,o,c.get?c:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function a(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(o){if(o.ep)return;o.ep=!0;const c=a(o);fetch(o.href,c)}})();function L0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Jf={exports:{}},mo={};/**
|
||
* @license React
|
||
* react-jsx-runtime.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Vy;function kT(){if(Vy)return mo;Vy=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(s,o,c){var u=null;if(c!==void 0&&(u=""+c),o.key!==void 0&&(u=""+o.key),"key"in o){c={};for(var d in o)d!=="key"&&(c[d]=o[d])}else c=o;return o=c.ref,{$$typeof:e,type:s,key:u,ref:o!==void 0?o:null,props:c}}return mo.Fragment=t,mo.jsx=a,mo.jsxs=a,mo}var Ky;function jT(){return Ky||(Ky=1,Jf.exports=kT()),Jf.exports}var b=jT(),Qf={exports:{}},Te={};/**
|
||
* @license React
|
||
* react.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Yy;function MT(){if(Yy)return Te;Yy=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),S=Symbol.iterator;function _(j){return j===null||typeof j!="object"?null:(j=S&&j[S]||j["@@iterator"],typeof j=="function"?j:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,R={};function C(j,G,F){this.props=j,this.context=G,this.refs=R,this.updater=F||E}C.prototype.isReactComponent={},C.prototype.setState=function(j,G){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,G,"setState")},C.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function N(){}N.prototype=C.prototype;function A(j,G,F){this.props=j,this.context=G,this.refs=R,this.updater=F||E}var D=A.prototype=new N;D.constructor=A,x(D,C.prototype),D.isPureReactComponent=!0;var V=Array.isArray;function q(){}var U={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function ae(j,G,F){var ee=F.ref;return{$$typeof:e,type:j,key:G,ref:ee!==void 0?ee:null,props:F}}function me(j,G){return ae(j.type,G,j.props)}function ve(j){return typeof j=="object"&&j!==null&&j.$$typeof===e}function de(j){var G={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(F){return G[F]})}var pe=/\/+/g;function J(j,G){return typeof j=="object"&&j!==null&&j.key!=null?de(""+j.key):G.toString(36)}function ie(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(q,q):(j.status="pending",j.then(function(G){j.status==="pending"&&(j.status="fulfilled",j.value=G)},function(G){j.status==="pending"&&(j.status="rejected",j.reason=G)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function O(j,G,F,ee,ne){var se=typeof j;(se==="undefined"||se==="boolean")&&(j=null);var te=!1;if(j===null)te=!0;else switch(se){case"bigint":case"string":case"number":te=!0;break;case"object":switch(j.$$typeof){case e:case t:te=!0;break;case v:return te=j._init,O(te(j._payload),G,F,ee,ne)}}if(te)return ne=ne(j),te=ee===""?"."+J(j,0):ee,V(ne)?(F="",te!=null&&(F=te.replace(pe,"$&/")+"/"),O(ne,G,F,"",function(Ce){return Ce})):ne!=null&&(ve(ne)&&(ne=me(ne,F+(ne.key==null||j&&j.key===ne.key?"":(""+ne.key).replace(pe,"$&/")+"/")+te)),G.push(ne)),1;te=0;var ce=ee===""?".":ee+":";if(V(j))for(var le=0;le<j.length;le++)ee=j[le],se=ce+J(ee,le),te+=O(ee,G,F,se,ne);else if(le=_(j),typeof le=="function")for(j=le.call(j),le=0;!(ee=j.next()).done;)ee=ee.value,se=ce+J(ee,le++),te+=O(ee,G,F,se,ne);else if(se==="object"){if(typeof j.then=="function")return O(ie(j),G,F,ee,ne);throw G=String(j),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return te}function $(j,G,F){if(j==null)return j;var ee=[],ne=0;return O(j,ee,"","",function(se){return G.call(F,se,ne++)}),ee}function K(j){if(j._status===-1){var G=j._result;G=G(),G.then(function(F){(j._status===0||j._status===-1)&&(j._status=1,j._result=F)},function(F){(j._status===0||j._status===-1)&&(j._status=2,j._result=F)}),j._status===-1&&(j._status=0,j._result=G)}if(j._status===1)return j._result.default;throw j._result}var Z=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},W={map:$,forEach:function(j,G,F){$(j,function(){G.apply(this,arguments)},F)},count:function(j){var G=0;return $(j,function(){G++}),G},toArray:function(j){return $(j,function(G){return G})||[]},only:function(j){if(!ve(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return Te.Activity=g,Te.Children=W,Te.Component=C,Te.Fragment=a,Te.Profiler=o,Te.PureComponent=A,Te.StrictMode=s,Te.Suspense=h,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,Te.__COMPILER_RUNTIME={__proto__:null,c:function(j){return U.H.useMemoCache(j)}},Te.cache=function(j){return function(){return j.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(j,G,F){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var ee=x({},j.props),ne=j.key;if(G!=null)for(se in G.key!==void 0&&(ne=""+G.key),G)!I.call(G,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&G.ref===void 0||(ee[se]=G[se]);var se=arguments.length-2;if(se===1)ee.children=F;else if(1<se){for(var te=Array(se),ce=0;ce<se;ce++)te[ce]=arguments[ce+2];ee.children=te}return ae(j.type,ne,ee)},Te.createContext=function(j){return j={$$typeof:u,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:c,_context:j},j},Te.createElement=function(j,G,F){var ee,ne={},se=null;if(G!=null)for(ee in G.key!==void 0&&(se=""+G.key),G)I.call(G,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(ne[ee]=G[ee]);var te=arguments.length-2;if(te===1)ne.children=F;else if(1<te){for(var ce=Array(te),le=0;le<te;le++)ce[le]=arguments[le+2];ne.children=ce}if(j&&j.defaultProps)for(ee in te=j.defaultProps,te)ne[ee]===void 0&&(ne[ee]=te[ee]);return ae(j,se,ne)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(j){return{$$typeof:d,render:j}},Te.isValidElement=ve,Te.lazy=function(j){return{$$typeof:v,_payload:{_status:-1,_result:j},_init:K}},Te.memo=function(j,G){return{$$typeof:p,type:j,compare:G===void 0?null:G}},Te.startTransition=function(j){var G=U.T,F={};U.T=F;try{var ee=j(),ne=U.S;ne!==null&&ne(F,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(q,Z)}catch(se){Z(se)}finally{G!==null&&F.types!==null&&(G.types=F.types),U.T=G}},Te.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},Te.use=function(j){return U.H.use(j)},Te.useActionState=function(j,G,F){return U.H.useActionState(j,G,F)},Te.useCallback=function(j,G){return U.H.useCallback(j,G)},Te.useContext=function(j){return U.H.useContext(j)},Te.useDebugValue=function(){},Te.useDeferredValue=function(j,G){return U.H.useDeferredValue(j,G)},Te.useEffect=function(j,G){return U.H.useEffect(j,G)},Te.useEffectEvent=function(j){return U.H.useEffectEvent(j)},Te.useId=function(){return U.H.useId()},Te.useImperativeHandle=function(j,G,F){return U.H.useImperativeHandle(j,G,F)},Te.useInsertionEffect=function(j,G){return U.H.useInsertionEffect(j,G)},Te.useLayoutEffect=function(j,G){return U.H.useLayoutEffect(j,G)},Te.useMemo=function(j,G){return U.H.useMemo(j,G)},Te.useOptimistic=function(j,G){return U.H.useOptimistic(j,G)},Te.useReducer=function(j,G,F){return U.H.useReducer(j,G,F)},Te.useRef=function(j){return U.H.useRef(j)},Te.useState=function(j){return U.H.useState(j)},Te.useSyncExternalStore=function(j,G,F){return U.H.useSyncExternalStore(j,G,F)},Te.useTransition=function(){return U.H.useTransition()},Te.version="19.2.6",Te}var Fy;function mu(){return Fy||(Fy=1,Qf.exports=MT()),Qf.exports}var y=mu();const re=L0(y),om=OT({__proto__:null,default:re},[y]);var Zf={exports:{}},po={},eh={exports:{}},th={};/**
|
||
* @license React
|
||
* scheduler.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Wy;function DT(){return Wy||(Wy=1,(function(e){function t(O,$){var K=O.length;O.push($);e:for(;0<K;){var Z=K-1>>>1,W=O[Z];if(0<o(W,$))O[Z]=$,O[K]=W,K=Z;else break e}}function a(O){return O.length===0?null:O[0]}function s(O){if(O.length===0)return null;var $=O[0],K=O.pop();if(K!==$){O[0]=K;e:for(var Z=0,W=O.length,j=W>>>1;Z<j;){var G=2*(Z+1)-1,F=O[G],ee=G+1,ne=O[ee];if(0>o(F,K))ee<W&&0>o(ne,F)?(O[Z]=ne,O[ee]=K,Z=ee):(O[Z]=F,O[G]=K,Z=G);else if(ee<W&&0>o(ne,K))O[Z]=ne,O[ee]=K,Z=ee;else break e}}return $}function o(O,$){var K=O.sortIndex-$.sortIndex;return K!==0?K:O.id-$.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var h=[],p=[],v=1,g=null,S=3,_=!1,E=!1,x=!1,R=!1,C=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function D(O){for(var $=a(p);$!==null;){if($.callback===null)s(p);else if($.startTime<=O)s(p),$.sortIndex=$.expirationTime,t(h,$);else break;$=a(p)}}function V(O){if(x=!1,D(O),!E)if(a(h)!==null)E=!0,q||(q=!0,de());else{var $=a(p);$!==null&&ie(V,$.startTime-O)}}var q=!1,U=-1,I=5,ae=-1;function me(){return R?!0:!(e.unstable_now()-ae<I)}function ve(){if(R=!1,q){var O=e.unstable_now();ae=O;var $=!0;try{e:{E=!1,x&&(x=!1,N(U),U=-1),_=!0;var K=S;try{t:{for(D(O),g=a(h);g!==null&&!(g.expirationTime>O&&me());){var Z=g.callback;if(typeof Z=="function"){g.callback=null,S=g.priorityLevel;var W=Z(g.expirationTime<=O);if(O=e.unstable_now(),typeof W=="function"){g.callback=W,D(O),$=!0;break t}g===a(h)&&s(h),D(O)}else s(h);g=a(h)}if(g!==null)$=!0;else{var j=a(p);j!==null&&ie(V,j.startTime-O),$=!1}}break e}finally{g=null,S=K,_=!1}$=void 0}}finally{$?de():q=!1}}}var de;if(typeof A=="function")de=function(){A(ve)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,J=pe.port2;pe.port1.onmessage=ve,de=function(){J.postMessage(null)}}else de=function(){C(ve,0)};function ie(O,$){U=C(function(){O(e.unstable_now())},$)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return S},e.unstable_next=function(O){switch(S){case 1:case 2:case 3:var $=3;break;default:$=S}var K=S;S=$;try{return O()}finally{S=K}},e.unstable_requestPaint=function(){R=!0},e.unstable_runWithPriority=function(O,$){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var K=S;S=O;try{return $()}finally{S=K}},e.unstable_scheduleCallback=function(O,$,K){var Z=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?Z+K:Z):K=Z,O){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=K+W,O={id:v++,callback:$,priorityLevel:O,startTime:K,expirationTime:W,sortIndex:-1},K>Z?(O.sortIndex=K,t(p,O),a(h)===null&&O===a(p)&&(x?(N(U),U=-1):x=!0,ie(V,K-Z))):(O.sortIndex=W,t(h,O),E||_||(E=!0,q||(q=!0,de()))),O},e.unstable_shouldYield=me,e.unstable_wrapCallback=function(O){var $=S;return function(){var K=S;S=$;try{return O.apply(this,arguments)}finally{S=K}}}})(th)),th}var Xy;function LT(){return Xy||(Xy=1,eh.exports=DT()),eh.exports}var nh={exports:{}},kt={};/**
|
||
* @license React
|
||
* react-dom.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Jy;function UT(){if(Jy)return kt;Jy=1;var e=mu();function t(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)p+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var s={d:{f:a,r:function(){throw Error(t(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(h,p,v){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:h,containerInfo:p,implementation:v}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,kt.createPortal=function(h,p){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return c(h,p,null,v)},kt.flushSync=function(h){var p=u.T,v=s.p;try{if(u.T=null,s.p=2,h)return h()}finally{u.T=p,s.p=v,s.d.f()}},kt.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,s.d.C(h,p))},kt.prefetchDNS=function(h){typeof h=="string"&&s.d.D(h)},kt.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var v=p.as,g=d(v,p.crossOrigin),S=typeof p.integrity=="string"?p.integrity:void 0,_=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;v==="style"?s.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:S,fetchPriority:_}):v==="script"&&s.d.X(h,{crossOrigin:g,integrity:S,fetchPriority:_,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},kt.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var v=d(p.as,p.crossOrigin);s.d.M(h,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&s.d.M(h)},kt.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var v=p.as,g=d(v,p.crossOrigin);s.d.L(h,v,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},kt.preloadModule=function(h,p){if(typeof h=="string")if(p){var v=d(p.as,p.crossOrigin);s.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else s.d.m(h)},kt.requestFormReset=function(h){s.d.r(h)},kt.unstable_batchedUpdates=function(h,p){return h(p)},kt.useFormState=function(h,p,v){return u.H.useFormState(h,p,v)},kt.useFormStatus=function(){return u.H.useHostTransitionStatus()},kt.version="19.2.6",kt}var Qy;function U0(){if(Qy)return nh.exports;Qy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),nh.exports=UT(),nh.exports}/**
|
||
* @license React
|
||
* react-dom-client.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Zy;function zT(){if(Zy)return po;Zy=1;var e=LT(),t=mu(),a=U0();function s(n){var r="https://react.dev/errors/"+n;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+n+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function c(n){var r=n,i=n;if(n.alternate)for(;r.return;)r=r.return;else{n=r;do r=n,(r.flags&4098)!==0&&(i=r.return),n=r.return;while(n)}return r.tag===3?i:null}function u(n){if(n.tag===13){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function d(n){if(n.tag===31){var r=n.memoizedState;if(r===null&&(n=n.alternate,n!==null&&(r=n.memoizedState)),r!==null)return r.dehydrated}return null}function h(n){if(c(n)!==n)throw Error(s(188))}function p(n){var r=n.alternate;if(!r){if(r=c(n),r===null)throw Error(s(188));return r!==n?null:n}for(var i=n,l=r;;){var f=i.return;if(f===null)break;var m=f.alternate;if(m===null){if(l=f.return,l!==null){i=l;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===i)return h(f),n;if(m===l)return h(f),r;m=m.sibling}throw Error(s(188))}if(i.return!==l.return)i=f,l=m;else{for(var w=!1,T=f.child;T;){if(T===i){w=!0,i=f,l=m;break}if(T===l){w=!0,l=f,i=m;break}T=T.sibling}if(!w){for(T=m.child;T;){if(T===i){w=!0,i=m,l=f;break}if(T===l){w=!0,l=m,i=f;break}T=T.sibling}if(!w)throw Error(s(189))}}if(i.alternate!==l)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?n:r}function v(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n;for(n=n.child;n!==null;){if(r=v(n),r!==null)return r;n=n.sibling}return null}var g=Object.assign,S=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),A=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),ae=Symbol.for("react.activity"),me=Symbol.for("react.memo_cache_sentinel"),ve=Symbol.iterator;function de(n){return n===null||typeof n!="object"?null:(n=ve&&n[ve]||n["@@iterator"],typeof n=="function"?n:null)}var pe=Symbol.for("react.client.reference");function J(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===pe?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case x:return"Fragment";case C:return"Profiler";case R:return"StrictMode";case V:return"Suspense";case q:return"SuspenseList";case ae:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case E:return"Portal";case A:return n.displayName||"Context";case N:return(n._context.displayName||"Context")+".Consumer";case D:var r=n.render;return n=n.displayName,n||(n=r.displayName||r.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case U:return r=n.displayName||null,r!==null?r:J(n.type)||"Memo";case I:r=n._payload,n=n._init;try{return J(n(r))}catch{}}return null}var ie=Array.isArray,O=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K={pending:!1,data:null,method:null,action:null},Z=[],W=-1;function j(n){return{current:n}}function G(n){0>W||(n.current=Z[W],Z[W]=null,W--)}function F(n,r){W++,Z[W]=n.current,n.current=r}var ee=j(null),ne=j(null),se=j(null),te=j(null);function ce(n,r){switch(F(se,r),F(ne,n),F(ee,null),r.nodeType){case 9:case 11:n=(n=r.documentElement)&&(n=n.namespaceURI)?my(n):0;break;default:if(n=r.tagName,r=r.namespaceURI)r=my(r),n=py(r,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}G(ee),F(ee,n)}function le(){G(ee),G(ne),G(se)}function Ce(n){n.memoizedState!==null&&F(te,n);var r=ee.current,i=py(r,n.type);r!==i&&(F(ne,n),F(ee,i))}function Re(n){ne.current===n&&(G(ee),G(ne)),te.current===n&&(G(te),co._currentValue=K)}var Ee,rt;function Ke(n){if(Ee===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);Ee=r&&r[1]||"",rt=-1<i.stack.indexOf(`
|
||
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||
`+Ee+n+rt}var En=!1;function cn(n,r){if(!n||En)return"";En=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(r){var Q=function(){throw Error()};if(Object.defineProperty(Q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Q,[])}catch(H){var B=H}Reflect.construct(n,[],Q)}else{try{Q.call()}catch(H){B=H}n.call(Q.prototype)}}else{try{throw Error()}catch(H){B=H}(Q=n())&&typeof Q.catch=="function"&&Q.catch(function(){})}}catch(H){if(H&&B&&typeof H.stack=="string")return[H.stack,B.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=l.DetermineComponentFrameRoot(),w=m[0],T=m[1];if(w&&T){var k=w.split(`
|
||
`),P=T.split(`
|
||
`);for(f=l=0;l<k.length&&!k[l].includes("DetermineComponentFrameRoot");)l++;for(;f<P.length&&!P[f].includes("DetermineComponentFrameRoot");)f++;if(l===k.length||f===P.length)for(l=k.length-1,f=P.length-1;1<=l&&0<=f&&k[l]!==P[f];)f--;for(;1<=l&&0<=f;l--,f--)if(k[l]!==P[f]){if(l!==1||f!==1)do if(l--,f--,0>f||k[l]!==P[f]){var Y=`
|
||
`+k[l].replace(" at new "," at ");return n.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",n.displayName)),Y}while(1<=l&&0<=f);break}}}finally{En=!1,Error.prepareStackTrace=i}return(i=n?n.displayName||n.name:"")?Ke(i):""}function Xt(n,r){switch(n.tag){case 26:case 27:case 5:return Ke(n.type);case 16:return Ke("Lazy");case 13:return n.child!==r&&r!==null?Ke("Suspense Fallback"):Ke("Suspense");case 19:return Ke("SuspenseList");case 0:case 15:return cn(n.type,!1);case 11:return cn(n.type.render,!1);case 1:return cn(n.type,!0);case 31:return Ke("Activity");default:return""}}function ya(n){try{var r="",i=null;do r+=Xt(n,i),i=n,n=n.return;while(n);return r}catch(l){return`
|
||
Error generating stack: `+l.message+`
|
||
`+l.stack}}var vt=Object.prototype.hasOwnProperty,wi=e.unstable_scheduleCallback,Si=e.unstable_cancelCallback,Mt=e.unstable_shouldYield,Dr=e.unstable_requestPaint,Dt=e.unstable_now,Pu=e.unstable_getCurrentPriorityLevel,ba=e.unstable_ImmediatePriority,nl=e.unstable_UserBlockingPriority,wa=e.unstable_NormalPriority,_i=e.unstable_LowPriority,nr=e.unstable_IdlePriority,rl=e.log,Lr=e.unstable_setDisableYieldValue,Sa=null,Lt=null;function Tn(n){if(typeof rl=="function"&&Lr(n),Lt&&typeof Lt.setStrictMode=="function")try{Lt.setStrictMode(Sa,n)}catch{}}var Nt=Math.clz32?Math.clz32:Bn,Bu=Math.log,xi=Math.LN2;function Bn(n){return n>>>=0,n===0?32:31-(Bu(n)/xi|0)|0}var rs=256,as=262144,_a=4194304;function In(n){var r=n&42;if(r!==0)return r;switch(n&-n){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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function xe(n,r,i){var l=n.pendingLanes;if(l===0)return 0;var f=0,m=n.suspendedLanes,w=n.pingedLanes;n=n.warmLanes;var T=l&134217727;return T!==0?(l=T&~m,l!==0?f=In(l):(w&=T,w!==0?f=In(w):i||(i=T&~n,i!==0&&(f=In(i))))):(T=l&~m,T!==0?f=In(T):w!==0?f=In(w):i||(i=l&~n,i!==0&&(f=In(i)))),f===0?0:r!==0&&r!==f&&(r&m)===0&&(m=f&-f,i=r&-r,m>=i||m===32&&(i&4194048)!==0)?r:f}function Ze(n,r){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&r)===0}function yt(n,r){switch(n){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32: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 r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ot(){var n=_a;return _a<<=1,(_a&62914560)===0&&(_a=4194304),n}function Ur(n){for(var r=[],i=0;31>i;i++)r.push(n);return r}function tt(n,r){n.pendingLanes|=r,r!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Pt(n,r,i,l,f,m){var w=n.pendingLanes;n.pendingLanes=i,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=i,n.entangledLanes&=i,n.errorRecoveryDisabledLanes&=i,n.shellSuspendCounter=0;var T=n.entanglements,k=n.expirationTimes,P=n.hiddenUpdates;for(i=w&~i;0<i;){var Y=31-Nt(i),Q=1<<Y;T[Y]=0,k[Y]=-1;var B=P[Y];if(B!==null)for(P[Y]=null,Y=0;Y<B.length;Y++){var H=B[Y];H!==null&&(H.lane&=-536870913)}i&=~Q}l!==0&&xa(n,l,0),m!==0&&f===0&&n.tag!==0&&(n.suspendedLanes|=m&~(w&~r))}function xa(n,r,i){n.pendingLanes|=r,n.suspendedLanes&=~r;var l=31-Nt(r);n.entangledLanes|=r,n.entanglements[l]=n.entanglements[l]|1073741824|i&261930}function Bt(n,r){var i=n.entangledLanes|=r;for(n=n.entanglements;i;){var l=31-Nt(i),f=1<<l;f&r|n[l]&r&&(n[l]|=r),i&=~f}}function It(n,r){var i=r&-r;return i=(i&42)!==0?1:ss(i),(i&(n.suspendedLanes|r))!==0?0:i}function ss(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function Cn(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Iu(){var n=$.p;return n!==0?n:(n=window.event,n===void 0?32:Py(n.type))}function ep(n,r){var i=$.p;try{return $.p=n,r()}finally{$.p=i}}var zr=Math.random().toString(36).slice(2),_t="__reactFiber$"+zr,$t="__reactProps$"+zr,is="__reactContainer$"+zr,$u="__reactEvents$"+zr,bE="__reactListeners$"+zr,wE="__reactHandles$"+zr,tp="__reactResources$"+zr,Ei="__reactMarker$"+zr;function Hu(n){delete n[_t],delete n[$t],delete n[$u],delete n[bE],delete n[wE]}function os(n){var r=n[_t];if(r)return r;for(var i=n.parentNode;i;){if(r=i[is]||i[_t]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(n=_y(n);n!==null;){if(i=n[_t])return i;n=_y(n)}return r}n=i,i=n.parentNode}return null}function ls(n){if(n=n[_t]||n[is]){var r=n.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return n}return null}function Ti(n){var r=n.tag;if(r===5||r===26||r===27||r===6)return n.stateNode;throw Error(s(33))}function cs(n){var r=n[tp];return r||(r=n[tp]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function bt(n){n[Ei]=!0}var np=new Set,rp={};function Ea(n,r){us(n,r),us(n+"Capture",r)}function us(n,r){for(rp[n]=r,n=0;n<r.length;n++)np.add(r[n])}var SE=RegExp("^[: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]*$"),ap={},sp={};function _E(n){return vt.call(sp,n)?!0:vt.call(ap,n)?!1:SE.test(n)?sp[n]=!0:(ap[n]=!0,!1)}function al(n,r,i){if(_E(r))if(i===null)n.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":n.removeAttribute(r);return;case"boolean":var l=r.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){n.removeAttribute(r);return}}n.setAttribute(r,""+i)}}function sl(n,r,i){if(i===null)n.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(r);return}n.setAttribute(r,""+i)}}function rr(n,r,i,l){if(l===null)n.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttributeNS(r,i,""+l)}}function un(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function ip(n){var r=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function xE(n,r,i){var l=Object.getOwnPropertyDescriptor(n.constructor.prototype,r);if(!n.hasOwnProperty(r)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var f=l.get,m=l.set;return Object.defineProperty(n,r,{configurable:!0,get:function(){return f.call(this)},set:function(w){i=""+w,m.call(this,w)}}),Object.defineProperty(n,r,{enumerable:l.enumerable}),{getValue:function(){return i},setValue:function(w){i=""+w},stopTracking:function(){n._valueTracker=null,delete n[r]}}}}function qu(n){if(!n._valueTracker){var r=ip(n)?"checked":"value";n._valueTracker=xE(n,r,""+n[r])}}function op(n){if(!n)return!1;var r=n._valueTracker;if(!r)return!0;var i=r.getValue(),l="";return n&&(l=ip(n)?n.checked?"true":"false":n.value),n=l,n!==i?(r.setValue(n),!0):!1}function il(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var EE=/[\n"\\]/g;function dn(n){return n.replace(EE,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Gu(n,r,i,l,f,m,w,T){n.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?n.type=w:n.removeAttribute("type"),r!=null?w==="number"?(r===0&&n.value===""||n.value!=r)&&(n.value=""+un(r)):n.value!==""+un(r)&&(n.value=""+un(r)):w!=="submit"&&w!=="reset"||n.removeAttribute("value"),r!=null?Vu(n,w,un(r)):i!=null?Vu(n,w,un(i)):l!=null&&n.removeAttribute("value"),f==null&&m!=null&&(n.defaultChecked=!!m),f!=null&&(n.checked=f&&typeof f!="function"&&typeof f!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?n.name=""+un(T):n.removeAttribute("name")}function lp(n,r,i,l,f,m,w,T){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(n.type=m),r!=null||i!=null){if(!(m!=="submit"&&m!=="reset"||r!=null)){qu(n);return}i=i!=null?""+un(i):"",r=r!=null?""+un(r):i,T||r===n.value||(n.value=r),n.defaultValue=r}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,n.checked=T?n.checked:!!l,n.defaultChecked=!!l,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(n.name=w),qu(n)}function Vu(n,r,i){r==="number"&&il(n.ownerDocument)===n||n.defaultValue===""+i||(n.defaultValue=""+i)}function ds(n,r,i,l){if(n=n.options,r){r={};for(var f=0;f<i.length;f++)r["$"+i[f]]=!0;for(i=0;i<n.length;i++)f=r.hasOwnProperty("$"+n[i].value),n[i].selected!==f&&(n[i].selected=f),f&&l&&(n[i].defaultSelected=!0)}else{for(i=""+un(i),r=null,f=0;f<n.length;f++){if(n[f].value===i){n[f].selected=!0,l&&(n[f].defaultSelected=!0);return}r!==null||n[f].disabled||(r=n[f])}r!==null&&(r.selected=!0)}}function cp(n,r,i){if(r!=null&&(r=""+un(r),r!==n.value&&(n.value=r),i==null)){n.defaultValue!==r&&(n.defaultValue=r);return}n.defaultValue=i!=null?""+un(i):""}function up(n,r,i,l){if(r==null){if(l!=null){if(i!=null)throw Error(s(92));if(ie(l)){if(1<l.length)throw Error(s(93));l=l[0]}i=l}i==null&&(i=""),r=i}i=un(r),n.defaultValue=i,l=n.textContent,l===i&&l!==""&&l!==null&&(n.value=l),qu(n)}function fs(n,r){if(r){var i=n.firstChild;if(i&&i===n.lastChild&&i.nodeType===3){i.nodeValue=r;return}}n.textContent=r}var TE=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function dp(n,r,i){var l=r.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?l?n.setProperty(r,""):r==="float"?n.cssFloat="":n[r]="":l?n.setProperty(r,i):typeof i!="number"||i===0||TE.has(r)?r==="float"?n.cssFloat=i:n[r]=(""+i).trim():n[r]=i+"px"}function fp(n,r,i){if(r!=null&&typeof r!="object")throw Error(s(62));if(n=n.style,i!=null){for(var l in i)!i.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?n.setProperty(l,""):l==="float"?n.cssFloat="":n[l]="");for(var f in r)l=r[f],r.hasOwnProperty(f)&&i[f]!==l&&dp(n,f,l)}else for(var m in r)r.hasOwnProperty(m)&&dp(n,m,r[m])}function Ku(n){if(n.indexOf("-")===-1)return!1;switch(n){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 CE=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),RE=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function ol(n){return RE.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}function ar(){}var Yu=null;function Fu(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var hs=null,ms=null;function hp(n){var r=ls(n);if(r&&(n=r.stateNode)){var i=n[$t]||null;e:switch(n=r.stateNode,r.type){case"input":if(Gu(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),r=i.name,i.type==="radio"&&r!=null){for(i=n;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+dn(""+r)+'"][type="radio"]'),r=0;r<i.length;r++){var l=i[r];if(l!==n&&l.form===n.form){var f=l[$t]||null;if(!f)throw Error(s(90));Gu(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(r=0;r<i.length;r++)l=i[r],l.form===n.form&&op(l)}break e;case"textarea":cp(n,i.value,i.defaultValue);break e;case"select":r=i.value,r!=null&&ds(n,!!i.multiple,r,!1)}}}var Wu=!1;function mp(n,r,i){if(Wu)return n(r,i);Wu=!0;try{var l=n(r);return l}finally{if(Wu=!1,(hs!==null||ms!==null)&&(Fl(),hs&&(r=hs,n=ms,ms=hs=null,hp(r),n)))for(r=0;r<n.length;r++)hp(n[r])}}function Ci(n,r){var i=n.stateNode;if(i===null)return null;var l=i[$t]||null;if(l===null)return null;i=l[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(n=n.type,l=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!l;break e;default:n=!1}if(n)return null;if(i&&typeof i!="function")throw Error(s(231,r,typeof i));return i}var sr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xu=!1;if(sr)try{var Ri={};Object.defineProperty(Ri,"passive",{get:function(){Xu=!0}}),window.addEventListener("test",Ri,Ri),window.removeEventListener("test",Ri,Ri)}catch{Xu=!1}var Pr=null,Ju=null,ll=null;function pp(){if(ll)return ll;var n,r=Ju,i=r.length,l,f="value"in Pr?Pr.value:Pr.textContent,m=f.length;for(n=0;n<i&&r[n]===f[n];n++);var w=i-n;for(l=1;l<=w&&r[i-l]===f[m-l];l++);return ll=f.slice(n,1<l?1-l:void 0)}function cl(n){var r=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&r===13&&(n=13)):n=r,n===10&&(n=13),32<=n||n===13?n:0}function ul(){return!0}function gp(){return!1}function Ht(n){function r(i,l,f,m,w){this._reactName=i,this._targetInst=f,this.type=l,this.nativeEvent=m,this.target=w,this.currentTarget=null;for(var T in n)n.hasOwnProperty(T)&&(i=n[T],this[T]=i?i(m):m[T]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?ul:gp,this.isPropagationStopped=gp,this}return g(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=ul)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=ul)},persist:function(){},isPersistent:ul}),r}var Ta={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dl=Ht(Ta),Ai=g({},Ta,{view:0,detail:0}),AE=Ht(Ai),Qu,Zu,Ni,fl=g({},Ai,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:td,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Ni&&(Ni&&n.type==="mousemove"?(Qu=n.screenX-Ni.screenX,Zu=n.screenY-Ni.screenY):Zu=Qu=0,Ni=n),Qu)},movementY:function(n){return"movementY"in n?n.movementY:Zu}}),vp=Ht(fl),NE=g({},fl,{dataTransfer:0}),OE=Ht(NE),kE=g({},Ai,{relatedTarget:0}),ed=Ht(kE),jE=g({},Ta,{animationName:0,elapsedTime:0,pseudoElement:0}),ME=Ht(jE),DE=g({},Ta,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),LE=Ht(DE),UE=g({},Ta,{data:0}),yp=Ht(UE),zE={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},PE={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"},BE={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function IE(n){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(n):(n=BE[n])?!!r[n]:!1}function td(){return IE}var $E=g({},Ai,{key:function(n){if(n.key){var r=zE[n.key]||n.key;if(r!=="Unidentified")return r}return n.type==="keypress"?(n=cl(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?PE[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:td,charCode:function(n){return n.type==="keypress"?cl(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?cl(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),HE=Ht($E),qE=g({},fl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bp=Ht(qE),GE=g({},Ai,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:td}),VE=Ht(GE),KE=g({},Ta,{propertyName:0,elapsedTime:0,pseudoElement:0}),YE=Ht(KE),FE=g({},fl,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),WE=Ht(FE),XE=g({},Ta,{newState:0,oldState:0}),JE=Ht(XE),QE=[9,13,27,32],nd=sr&&"CompositionEvent"in window,Oi=null;sr&&"documentMode"in document&&(Oi=document.documentMode);var ZE=sr&&"TextEvent"in window&&!Oi,wp=sr&&(!nd||Oi&&8<Oi&&11>=Oi),Sp=" ",_p=!1;function xp(n,r){switch(n){case"keyup":return QE.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ep(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var ps=!1;function e1(n,r){switch(n){case"compositionend":return Ep(r);case"keypress":return r.which!==32?null:(_p=!0,Sp);case"textInput":return n=r.data,n===Sp&&_p?null:n;default:return null}}function t1(n,r){if(ps)return n==="compositionend"||!nd&&xp(n,r)?(n=pp(),ll=Ju=Pr=null,ps=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return wp&&r.locale!=="ko"?null:r.data;default:return null}}var n1={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 Tp(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r==="input"?!!n1[n.type]:r==="textarea"}function Cp(n,r,i,l){hs?ms?ms.push(l):ms=[l]:hs=l,r=tc(r,"onChange"),0<r.length&&(i=new dl("onChange","change",null,i,l),n.push({event:i,listeners:r}))}var ki=null,ji=null;function r1(n){ly(n,0)}function hl(n){var r=Ti(n);if(op(r))return n}function Rp(n,r){if(n==="change")return r}var Ap=!1;if(sr){var rd;if(sr){var ad="oninput"in document;if(!ad){var Np=document.createElement("div");Np.setAttribute("oninput","return;"),ad=typeof Np.oninput=="function"}rd=ad}else rd=!1;Ap=rd&&(!document.documentMode||9<document.documentMode)}function Op(){ki&&(ki.detachEvent("onpropertychange",kp),ji=ki=null)}function kp(n){if(n.propertyName==="value"&&hl(ji)){var r=[];Cp(r,ji,n,Fu(n)),mp(r1,r)}}function a1(n,r,i){n==="focusin"?(Op(),ki=r,ji=i,ki.attachEvent("onpropertychange",kp)):n==="focusout"&&Op()}function s1(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return hl(ji)}function i1(n,r){if(n==="click")return hl(r)}function o1(n,r){if(n==="input"||n==="change")return hl(r)}function l1(n,r){return n===r&&(n!==0||1/n===1/r)||n!==n&&r!==r}var Jt=typeof Object.is=="function"?Object.is:l1;function Mi(n,r){if(Jt(n,r))return!0;if(typeof n!="object"||n===null||typeof r!="object"||r===null)return!1;var i=Object.keys(n),l=Object.keys(r);if(i.length!==l.length)return!1;for(l=0;l<i.length;l++){var f=i[l];if(!vt.call(r,f)||!Jt(n[f],r[f]))return!1}return!0}function jp(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Mp(n,r){var i=jp(n);n=0;for(var l;i;){if(i.nodeType===3){if(l=n+i.textContent.length,n<=r&&l>=r)return{node:i,offset:r-n};n=l}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=jp(i)}}function Dp(n,r){return n&&r?n===r?!0:n&&n.nodeType===3?!1:r&&r.nodeType===3?Dp(n,r.parentNode):"contains"in n?n.contains(r):n.compareDocumentPosition?!!(n.compareDocumentPosition(r)&16):!1:!1}function Lp(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var r=il(n.document);r instanceof n.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)n=r.contentWindow;else break;r=il(n.document)}return r}function sd(n){var r=n&&n.nodeName&&n.nodeName.toLowerCase();return r&&(r==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||r==="textarea"||n.contentEditable==="true")}var c1=sr&&"documentMode"in document&&11>=document.documentMode,gs=null,id=null,Di=null,od=!1;function Up(n,r,i){var l=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;od||gs==null||gs!==il(l)||(l=gs,"selectionStart"in l&&sd(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Di&&Mi(Di,l)||(Di=l,l=tc(id,"onSelect"),0<l.length&&(r=new dl("onSelect","select",null,r,i),n.push({event:r,listeners:l}),r.target=gs)))}function Ca(n,r){var i={};return i[n.toLowerCase()]=r.toLowerCase(),i["Webkit"+n]="webkit"+r,i["Moz"+n]="moz"+r,i}var vs={animationend:Ca("Animation","AnimationEnd"),animationiteration:Ca("Animation","AnimationIteration"),animationstart:Ca("Animation","AnimationStart"),transitionrun:Ca("Transition","TransitionRun"),transitionstart:Ca("Transition","TransitionStart"),transitioncancel:Ca("Transition","TransitionCancel"),transitionend:Ca("Transition","TransitionEnd")},ld={},zp={};sr&&(zp=document.createElement("div").style,"AnimationEvent"in window||(delete vs.animationend.animation,delete vs.animationiteration.animation,delete vs.animationstart.animation),"TransitionEvent"in window||delete vs.transitionend.transition);function Ra(n){if(ld[n])return ld[n];if(!vs[n])return n;var r=vs[n],i;for(i in r)if(r.hasOwnProperty(i)&&i in zp)return ld[n]=r[i];return n}var Pp=Ra("animationend"),Bp=Ra("animationiteration"),Ip=Ra("animationstart"),u1=Ra("transitionrun"),d1=Ra("transitionstart"),f1=Ra("transitioncancel"),$p=Ra("transitionend"),Hp=new Map,cd="abort auxClick beforeToggle 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(" ");cd.push("scrollEnd");function Rn(n,r){Hp.set(n,r),Ea(r,[n])}var ml=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)},fn=[],ys=0,ud=0;function pl(){for(var n=ys,r=ud=ys=0;r<n;){var i=fn[r];fn[r++]=null;var l=fn[r];fn[r++]=null;var f=fn[r];fn[r++]=null;var m=fn[r];if(fn[r++]=null,l!==null&&f!==null){var w=l.pending;w===null?f.next=f:(f.next=w.next,w.next=f),l.pending=f}m!==0&&qp(i,f,m)}}function gl(n,r,i,l){fn[ys++]=n,fn[ys++]=r,fn[ys++]=i,fn[ys++]=l,ud|=l,n.lanes|=l,n=n.alternate,n!==null&&(n.lanes|=l)}function dd(n,r,i,l){return gl(n,r,i,l),vl(n)}function Aa(n,r){return gl(n,null,null,r),vl(n)}function qp(n,r,i){n.lanes|=i;var l=n.alternate;l!==null&&(l.lanes|=i);for(var f=!1,m=n.return;m!==null;)m.childLanes|=i,l=m.alternate,l!==null&&(l.childLanes|=i),m.tag===22&&(n=m.stateNode,n===null||n._visibility&1||(f=!0)),n=m,m=m.return;return n.tag===3?(m=n.stateNode,f&&r!==null&&(f=31-Nt(i),n=m.hiddenUpdates,l=n[f],l===null?n[f]=[r]:l.push(r),r.lane=i|536870912),m):null}function vl(n){if(50<no)throw no=0,Sf=null,Error(s(185));for(var r=n.return;r!==null;)n=r,r=n.return;return n.tag===3?n.stateNode:null}var bs={};function h1(n,r,i,l){this.tag=n,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qt(n,r,i,l){return new h1(n,r,i,l)}function fd(n){return n=n.prototype,!(!n||!n.isReactComponent)}function ir(n,r){var i=n.alternate;return i===null?(i=Qt(n.tag,r,n.key,n.mode),i.elementType=n.elementType,i.type=n.type,i.stateNode=n.stateNode,i.alternate=n,n.alternate=i):(i.pendingProps=r,i.type=n.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=n.flags&65011712,i.childLanes=n.childLanes,i.lanes=n.lanes,i.child=n.child,i.memoizedProps=n.memoizedProps,i.memoizedState=n.memoizedState,i.updateQueue=n.updateQueue,r=n.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=n.sibling,i.index=n.index,i.ref=n.ref,i.refCleanup=n.refCleanup,i}function Gp(n,r){n.flags&=65011714;var i=n.alternate;return i===null?(n.childLanes=0,n.lanes=r,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=i.childLanes,n.lanes=i.lanes,n.child=i.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=i.memoizedProps,n.memoizedState=i.memoizedState,n.updateQueue=i.updateQueue,n.type=i.type,r=i.dependencies,n.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),n}function yl(n,r,i,l,f,m){var w=0;if(l=n,typeof n=="function")fd(n)&&(w=1);else if(typeof n=="string")w=yT(n,i,ee.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case ae:return n=Qt(31,i,r,f),n.elementType=ae,n.lanes=m,n;case x:return Na(i.children,f,m,r);case R:w=8,f|=24;break;case C:return n=Qt(12,i,r,f|2),n.elementType=C,n.lanes=m,n;case V:return n=Qt(13,i,r,f),n.elementType=V,n.lanes=m,n;case q:return n=Qt(19,i,r,f),n.elementType=q,n.lanes=m,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case A:w=10;break e;case N:w=9;break e;case D:w=11;break e;case U:w=14;break e;case I:w=16,l=null;break e}w=29,i=Error(s(130,n===null?"null":typeof n,"")),l=null}return r=Qt(w,i,r,f),r.elementType=n,r.type=l,r.lanes=m,r}function Na(n,r,i,l){return n=Qt(7,n,l,r),n.lanes=i,n}function hd(n,r,i){return n=Qt(6,n,null,r),n.lanes=i,n}function Vp(n){var r=Qt(18,null,null,0);return r.stateNode=n,r}function md(n,r,i){return r=Qt(4,n.children!==null?n.children:[],n.key,r),r.lanes=i,r.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},r}var Kp=new WeakMap;function hn(n,r){if(typeof n=="object"&&n!==null){var i=Kp.get(n);return i!==void 0?i:(r={value:n,source:r,stack:ya(r)},Kp.set(n,r),r)}return{value:n,source:r,stack:ya(r)}}var ws=[],Ss=0,bl=null,Li=0,mn=[],pn=0,Br=null,$n=1,Hn="";function or(n,r){ws[Ss++]=Li,ws[Ss++]=bl,bl=n,Li=r}function Yp(n,r,i){mn[pn++]=$n,mn[pn++]=Hn,mn[pn++]=Br,Br=n;var l=$n;n=Hn;var f=32-Nt(l)-1;l&=~(1<<f),i+=1;var m=32-Nt(r)+f;if(30<m){var w=f-f%5;m=(l&(1<<w)-1).toString(32),l>>=w,f-=w,$n=1<<32-Nt(r)+f|i<<f|l,Hn=m+n}else $n=1<<m|i<<f|l,Hn=n}function pd(n){n.return!==null&&(or(n,1),Yp(n,1,0))}function gd(n){for(;n===bl;)bl=ws[--Ss],ws[Ss]=null,Li=ws[--Ss],ws[Ss]=null;for(;n===Br;)Br=mn[--pn],mn[pn]=null,Hn=mn[--pn],mn[pn]=null,$n=mn[--pn],mn[pn]=null}function Fp(n,r){mn[pn++]=$n,mn[pn++]=Hn,mn[pn++]=Br,$n=r.id,Hn=r.overflow,Br=n}var xt=null,Xe=null,Ue=!1,Ir=null,gn=!1,vd=Error(s(519));function $r(n){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ui(hn(r,n)),vd}function Wp(n){var r=n.stateNode,i=n.type,l=n.memoizedProps;switch(r[_t]=n,r[$t]=l,i){case"dialog":je("cancel",r),je("close",r);break;case"iframe":case"object":case"embed":je("load",r);break;case"video":case"audio":for(i=0;i<ao.length;i++)je(ao[i],r);break;case"source":je("error",r);break;case"img":case"image":case"link":je("error",r),je("load",r);break;case"details":je("toggle",r);break;case"input":je("invalid",r),lp(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":je("invalid",r);break;case"textarea":je("invalid",r),up(r,l.value,l.defaultValue,l.children)}i=l.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||r.textContent===""+i||l.suppressHydrationWarning===!0||fy(r.textContent,i)?(l.popover!=null&&(je("beforetoggle",r),je("toggle",r)),l.onScroll!=null&&je("scroll",r),l.onScrollEnd!=null&&je("scrollend",r),l.onClick!=null&&(r.onclick=ar),r=!0):r=!1,r||$r(n,!0)}function Xp(n){for(xt=n.return;xt;)switch(xt.tag){case 5:case 31:case 13:gn=!1;return;case 27:case 3:gn=!0;return;default:xt=xt.return}}function _s(n){if(n!==xt)return!1;if(!Ue)return Xp(n),Ue=!0,!1;var r=n.tag,i;if((i=r!==3&&r!==27)&&((i=r===5)&&(i=n.type,i=!(i!=="form"&&i!=="button")||Uf(n.type,n.memoizedProps)),i=!i),i&&Xe&&$r(n),Xp(n),r===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));Xe=Sy(n)}else if(r===31){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));Xe=Sy(n)}else r===27?(r=Xe,ta(n.type)?(n=$f,$f=null,Xe=n):Xe=r):Xe=xt?yn(n.stateNode.nextSibling):null;return!0}function Oa(){Xe=xt=null,Ue=!1}function yd(){var n=Ir;return n!==null&&(Kt===null?Kt=n:Kt.push.apply(Kt,n),Ir=null),n}function Ui(n){Ir===null?Ir=[n]:Ir.push(n)}var bd=j(null),ka=null,lr=null;function Hr(n,r,i){F(bd,r._currentValue),r._currentValue=i}function cr(n){n._currentValue=bd.current,G(bd)}function wd(n,r,i){for(;n!==null;){var l=n.alternate;if((n.childLanes&r)!==r?(n.childLanes|=r,l!==null&&(l.childLanes|=r)):l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r),n===i)break;n=n.return}}function Sd(n,r,i,l){var f=n.child;for(f!==null&&(f.return=n);f!==null;){var m=f.dependencies;if(m!==null){var w=f.child;m=m.firstContext;e:for(;m!==null;){var T=m;m=f;for(var k=0;k<r.length;k++)if(T.context===r[k]){m.lanes|=i,T=m.alternate,T!==null&&(T.lanes|=i),wd(m.return,i,n),l||(w=null);break e}m=T.next}}else if(f.tag===18){if(w=f.return,w===null)throw Error(s(341));w.lanes|=i,m=w.alternate,m!==null&&(m.lanes|=i),wd(w,i,n),w=null}else w=f.child;if(w!==null)w.return=f;else for(w=f;w!==null;){if(w===n){w=null;break}if(f=w.sibling,f!==null){f.return=w.return,w=f;break}w=w.return}f=w}}function xs(n,r,i,l){n=null;for(var f=r,m=!1;f!==null;){if(!m){if((f.flags&524288)!==0)m=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var w=f.alternate;if(w===null)throw Error(s(387));if(w=w.memoizedProps,w!==null){var T=f.type;Jt(f.pendingProps.value,w.value)||(n!==null?n.push(T):n=[T])}}else if(f===te.current){if(w=f.alternate,w===null)throw Error(s(387));w.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(n!==null?n.push(co):n=[co])}f=f.return}n!==null&&Sd(r,n,i,l),r.flags|=262144}function wl(n){for(n=n.firstContext;n!==null;){if(!Jt(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function ja(n){ka=n,lr=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Et(n){return Jp(ka,n)}function Sl(n,r){return ka===null&&ja(n),Jp(n,r)}function Jp(n,r){var i=r._currentValue;if(r={context:r,memoizedValue:i,next:null},lr===null){if(n===null)throw Error(s(308));lr=r,n.dependencies={lanes:0,firstContext:r},n.flags|=524288}else lr=lr.next=r;return i}var m1=typeof AbortController<"u"?AbortController:function(){var n=[],r=this.signal={aborted:!1,addEventListener:function(i,l){n.push(l)}};this.abort=function(){r.aborted=!0,n.forEach(function(i){return i()})}},p1=e.unstable_scheduleCallback,g1=e.unstable_NormalPriority,ct={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _d(){return{controller:new m1,data:new Map,refCount:0}}function zi(n){n.refCount--,n.refCount===0&&p1(g1,function(){n.controller.abort()})}var Pi=null,xd=0,Es=0,Ts=null;function v1(n,r){if(Pi===null){var i=Pi=[];xd=0,Es=Rf(),Ts={status:"pending",value:void 0,then:function(l){i.push(l)}}}return xd++,r.then(Qp,Qp),r}function Qp(){if(--xd===0&&Pi!==null){Ts!==null&&(Ts.status="fulfilled");var n=Pi;Pi=null,Es=0,Ts=null;for(var r=0;r<n.length;r++)(0,n[r])()}}function y1(n,r){var i=[],l={status:"pending",value:null,reason:null,then:function(f){i.push(f)}};return n.then(function(){l.status="fulfilled",l.value=r;for(var f=0;f<i.length;f++)(0,i[f])(r)},function(f){for(l.status="rejected",l.reason=f,f=0;f<i.length;f++)(0,i[f])(void 0)}),l}var Zp=O.S;O.S=function(n,r){Uv=Dt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&v1(n,r),Zp!==null&&Zp(n,r)};var Ma=j(null);function Ed(){var n=Ma.current;return n!==null?n:Ye.pooledCache}function _l(n,r){r===null?F(Ma,Ma.current):F(Ma,r.pool)}function eg(){var n=Ed();return n===null?null:{parent:ct._currentValue,pool:n}}var Cs=Error(s(460)),Td=Error(s(474)),xl=Error(s(542)),El={then:function(){}};function tg(n){return n=n.status,n==="fulfilled"||n==="rejected"}function ng(n,r,i){switch(i=n[i],i===void 0?n.push(r):i!==r&&(r.then(ar,ar),r=i),r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,ag(n),n;default:if(typeof r.status=="string")r.then(ar,ar);else{if(n=Ye,n!==null&&100<n.shellSuspendCounter)throw Error(s(482));n=r,n.status="pending",n.then(function(l){if(r.status==="pending"){var f=r;f.status="fulfilled",f.value=l}},function(l){if(r.status==="pending"){var f=r;f.status="rejected",f.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw n=r.reason,ag(n),n}throw La=r,Cs}}function Da(n){try{var r=n._init;return r(n._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(La=i,Cs):i}}var La=null;function rg(){if(La===null)throw Error(s(459));var n=La;return La=null,n}function ag(n){if(n===Cs||n===xl)throw Error(s(483))}var Rs=null,Bi=0;function Tl(n){var r=Bi;return Bi+=1,Rs===null&&(Rs=[]),ng(Rs,n,r)}function Ii(n,r){r=r.props.ref,n.ref=r!==void 0?r:null}function Cl(n,r){throw r.$$typeof===S?Error(s(525)):(n=Object.prototype.toString.call(r),Error(s(31,n==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":n)))}function sg(n){function r(L,M){if(n){var z=L.deletions;z===null?(L.deletions=[M],L.flags|=16):z.push(M)}}function i(L,M){if(!n)return null;for(;M!==null;)r(L,M),M=M.sibling;return null}function l(L){for(var M=new Map;L!==null;)L.key!==null?M.set(L.key,L):M.set(L.index,L),L=L.sibling;return M}function f(L,M){return L=ir(L,M),L.index=0,L.sibling=null,L}function m(L,M,z){return L.index=z,n?(z=L.alternate,z!==null?(z=z.index,z<M?(L.flags|=67108866,M):z):(L.flags|=67108866,M)):(L.flags|=1048576,M)}function w(L){return n&&L.alternate===null&&(L.flags|=67108866),L}function T(L,M,z,X){return M===null||M.tag!==6?(M=hd(z,L.mode,X),M.return=L,M):(M=f(M,z),M.return=L,M)}function k(L,M,z,X){var we=z.type;return we===x?Y(L,M,z.props.children,X,z.key):M!==null&&(M.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===I&&Da(we)===M.type)?(M=f(M,z.props),Ii(M,z),M.return=L,M):(M=yl(z.type,z.key,z.props,null,L.mode,X),Ii(M,z),M.return=L,M)}function P(L,M,z,X){return M===null||M.tag!==4||M.stateNode.containerInfo!==z.containerInfo||M.stateNode.implementation!==z.implementation?(M=md(z,L.mode,X),M.return=L,M):(M=f(M,z.children||[]),M.return=L,M)}function Y(L,M,z,X,we){return M===null||M.tag!==7?(M=Na(z,L.mode,X,we),M.return=L,M):(M=f(M,z),M.return=L,M)}function Q(L,M,z){if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return M=hd(""+M,L.mode,z),M.return=L,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case _:return z=yl(M.type,M.key,M.props,null,L.mode,z),Ii(z,M),z.return=L,z;case E:return M=md(M,L.mode,z),M.return=L,M;case I:return M=Da(M),Q(L,M,z)}if(ie(M)||de(M))return M=Na(M,L.mode,z,null),M.return=L,M;if(typeof M.then=="function")return Q(L,Tl(M),z);if(M.$$typeof===A)return Q(L,Sl(L,M),z);Cl(L,M)}return null}function B(L,M,z,X){var we=M!==null?M.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return we!==null?null:T(L,M,""+z,X);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case _:return z.key===we?k(L,M,z,X):null;case E:return z.key===we?P(L,M,z,X):null;case I:return z=Da(z),B(L,M,z,X)}if(ie(z)||de(z))return we!==null?null:Y(L,M,z,X,null);if(typeof z.then=="function")return B(L,M,Tl(z),X);if(z.$$typeof===A)return B(L,M,Sl(L,z),X);Cl(L,z)}return null}function H(L,M,z,X,we){if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return L=L.get(z)||null,T(M,L,""+X,we);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case _:return L=L.get(X.key===null?z:X.key)||null,k(M,L,X,we);case E:return L=L.get(X.key===null?z:X.key)||null,P(M,L,X,we);case I:return X=Da(X),H(L,M,z,X,we)}if(ie(X)||de(X))return L=L.get(z)||null,Y(M,L,X,we,null);if(typeof X.then=="function")return H(L,M,z,Tl(X),we);if(X.$$typeof===A)return H(L,M,z,Sl(M,X),we);Cl(M,X)}return null}function he(L,M,z,X){for(var we=null,Pe=null,ye=M,Ne=M=0,De=null;ye!==null&&Ne<z.length;Ne++){ye.index>Ne?(De=ye,ye=null):De=ye.sibling;var Be=B(L,ye,z[Ne],X);if(Be===null){ye===null&&(ye=De);break}n&&ye&&Be.alternate===null&&r(L,ye),M=m(Be,M,Ne),Pe===null?we=Be:Pe.sibling=Be,Pe=Be,ye=De}if(Ne===z.length)return i(L,ye),Ue&&or(L,Ne),we;if(ye===null){for(;Ne<z.length;Ne++)ye=Q(L,z[Ne],X),ye!==null&&(M=m(ye,M,Ne),Pe===null?we=ye:Pe.sibling=ye,Pe=ye);return Ue&&or(L,Ne),we}for(ye=l(ye);Ne<z.length;Ne++)De=H(ye,L,Ne,z[Ne],X),De!==null&&(n&&De.alternate!==null&&ye.delete(De.key===null?Ne:De.key),M=m(De,M,Ne),Pe===null?we=De:Pe.sibling=De,Pe=De);return n&&ye.forEach(function(ia){return r(L,ia)}),Ue&&or(L,Ne),we}function Se(L,M,z,X){if(z==null)throw Error(s(151));for(var we=null,Pe=null,ye=M,Ne=M=0,De=null,Be=z.next();ye!==null&&!Be.done;Ne++,Be=z.next()){ye.index>Ne?(De=ye,ye=null):De=ye.sibling;var ia=B(L,ye,Be.value,X);if(ia===null){ye===null&&(ye=De);break}n&&ye&&ia.alternate===null&&r(L,ye),M=m(ia,M,Ne),Pe===null?we=ia:Pe.sibling=ia,Pe=ia,ye=De}if(Be.done)return i(L,ye),Ue&&or(L,Ne),we;if(ye===null){for(;!Be.done;Ne++,Be=z.next())Be=Q(L,Be.value,X),Be!==null&&(M=m(Be,M,Ne),Pe===null?we=Be:Pe.sibling=Be,Pe=Be);return Ue&&or(L,Ne),we}for(ye=l(ye);!Be.done;Ne++,Be=z.next())Be=H(ye,L,Ne,Be.value,X),Be!==null&&(n&&Be.alternate!==null&&ye.delete(Be.key===null?Ne:Be.key),M=m(Be,M,Ne),Pe===null?we=Be:Pe.sibling=Be,Pe=Be);return n&&ye.forEach(function(NT){return r(L,NT)}),Ue&&or(L,Ne),we}function Ve(L,M,z,X){if(typeof z=="object"&&z!==null&&z.type===x&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case _:e:{for(var we=z.key;M!==null;){if(M.key===we){if(we=z.type,we===x){if(M.tag===7){i(L,M.sibling),X=f(M,z.props.children),X.return=L,L=X;break e}}else if(M.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===I&&Da(we)===M.type){i(L,M.sibling),X=f(M,z.props),Ii(X,z),X.return=L,L=X;break e}i(L,M);break}else r(L,M);M=M.sibling}z.type===x?(X=Na(z.props.children,L.mode,X,z.key),X.return=L,L=X):(X=yl(z.type,z.key,z.props,null,L.mode,X),Ii(X,z),X.return=L,L=X)}return w(L);case E:e:{for(we=z.key;M!==null;){if(M.key===we)if(M.tag===4&&M.stateNode.containerInfo===z.containerInfo&&M.stateNode.implementation===z.implementation){i(L,M.sibling),X=f(M,z.children||[]),X.return=L,L=X;break e}else{i(L,M);break}else r(L,M);M=M.sibling}X=md(z,L.mode,X),X.return=L,L=X}return w(L);case I:return z=Da(z),Ve(L,M,z,X)}if(ie(z))return he(L,M,z,X);if(de(z)){if(we=de(z),typeof we!="function")throw Error(s(150));return z=we.call(z),Se(L,M,z,X)}if(typeof z.then=="function")return Ve(L,M,Tl(z),X);if(z.$$typeof===A)return Ve(L,M,Sl(L,z),X);Cl(L,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,M!==null&&M.tag===6?(i(L,M.sibling),X=f(M,z),X.return=L,L=X):(i(L,M),X=hd(z,L.mode,X),X.return=L,L=X),w(L)):i(L,M)}return function(L,M,z,X){try{Bi=0;var we=Ve(L,M,z,X);return Rs=null,we}catch(ye){if(ye===Cs||ye===xl)throw ye;var Pe=Qt(29,ye,null,L.mode);return Pe.lanes=X,Pe.return=L,Pe}finally{}}}var Ua=sg(!0),ig=sg(!1),qr=!1;function Cd(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rd(n,r){n=n.updateQueue,r.updateQueue===n&&(r.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Gr(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Vr(n,r,i){var l=n.updateQueue;if(l===null)return null;if(l=l.shared,(Ie&2)!==0){var f=l.pending;return f===null?r.next=r:(r.next=f.next,f.next=r),l.pending=r,r=vl(n),qp(n,null,i),r}return gl(n,l,r,i),vl(n)}function $i(n,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,(i&4194048)!==0)){var l=r.lanes;l&=n.pendingLanes,i|=l,r.lanes=i,Bt(n,i)}}function Ad(n,r){var i=n.updateQueue,l=n.alternate;if(l!==null&&(l=l.updateQueue,i===l)){var f=null,m=null;if(i=i.firstBaseUpdate,i!==null){do{var w={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};m===null?f=m=w:m=m.next=w,i=i.next}while(i!==null);m===null?f=m=r:m=m.next=r}else f=m=r;i={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:l.shared,callbacks:l.callbacks},n.updateQueue=i;return}n=i.lastBaseUpdate,n===null?i.firstBaseUpdate=r:n.next=r,i.lastBaseUpdate=r}var Nd=!1;function Hi(){if(Nd){var n=Ts;if(n!==null)throw n}}function qi(n,r,i,l){Nd=!1;var f=n.updateQueue;qr=!1;var m=f.firstBaseUpdate,w=f.lastBaseUpdate,T=f.shared.pending;if(T!==null){f.shared.pending=null;var k=T,P=k.next;k.next=null,w===null?m=P:w.next=P,w=k;var Y=n.alternate;Y!==null&&(Y=Y.updateQueue,T=Y.lastBaseUpdate,T!==w&&(T===null?Y.firstBaseUpdate=P:T.next=P,Y.lastBaseUpdate=k))}if(m!==null){var Q=f.baseState;w=0,Y=P=k=null,T=m;do{var B=T.lane&-536870913,H=B!==T.lane;if(H?(Me&B)===B:(l&B)===B){B!==0&&B===Es&&(Nd=!0),Y!==null&&(Y=Y.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var he=n,Se=T;B=r;var Ve=i;switch(Se.tag){case 1:if(he=Se.payload,typeof he=="function"){Q=he.call(Ve,Q,B);break e}Q=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=Se.payload,B=typeof he=="function"?he.call(Ve,Q,B):he,B==null)break e;Q=g({},Q,B);break e;case 2:qr=!0}}B=T.callback,B!==null&&(n.flags|=64,H&&(n.flags|=8192),H=f.callbacks,H===null?f.callbacks=[B]:H.push(B))}else H={lane:B,tag:T.tag,payload:T.payload,callback:T.callback,next:null},Y===null?(P=Y=H,k=Q):Y=Y.next=H,w|=B;if(T=T.next,T===null){if(T=f.shared.pending,T===null)break;H=T,T=H.next,H.next=null,f.lastBaseUpdate=H,f.shared.pending=null}}while(!0);Y===null&&(k=Q),f.baseState=k,f.firstBaseUpdate=P,f.lastBaseUpdate=Y,m===null&&(f.shared.lanes=0),Xr|=w,n.lanes=w,n.memoizedState=Q}}function og(n,r){if(typeof n!="function")throw Error(s(191,n));n.call(r)}function lg(n,r){var i=n.callbacks;if(i!==null)for(n.callbacks=null,n=0;n<i.length;n++)og(i[n],r)}var As=j(null),Rl=j(0);function cg(n,r){n=yr,F(Rl,n),F(As,r),yr=n|r.baseLanes}function Od(){F(Rl,yr),F(As,As.current)}function kd(){yr=Rl.current,G(As),G(Rl)}var Zt=j(null),vn=null;function Kr(n){var r=n.alternate;F(ot,ot.current&1),F(Zt,n),vn===null&&(r===null||As.current!==null||r.memoizedState!==null)&&(vn=n)}function jd(n){F(ot,ot.current),F(Zt,n),vn===null&&(vn=n)}function ug(n){n.tag===22?(F(ot,ot.current),F(Zt,n),vn===null&&(vn=n)):Yr()}function Yr(){F(ot,ot.current),F(Zt,Zt.current)}function en(n){G(Zt),vn===n&&(vn=null),G(ot)}var ot=j(0);function Al(n){for(var r=n;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Bf(i)||If(i)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var ur=0,Ae=null,qe=null,ut=null,Nl=!1,Ns=!1,za=!1,Ol=0,Gi=0,Os=null,b1=0;function at(){throw Error(s(321))}function Md(n,r){if(r===null)return!1;for(var i=0;i<r.length&&i<n.length;i++)if(!Jt(n[i],r[i]))return!1;return!0}function Dd(n,r,i,l,f,m){return ur=m,Ae=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,O.H=n===null||n.memoizedState===null?Yg:Wd,za=!1,m=i(l,f),za=!1,Ns&&(m=fg(r,i,l,f)),dg(n),m}function dg(n){O.H=Yi;var r=qe!==null&&qe.next!==null;if(ur=0,ut=qe=Ae=null,Nl=!1,Gi=0,Os=null,r)throw Error(s(300));n===null||dt||(n=n.dependencies,n!==null&&wl(n)&&(dt=!0))}function fg(n,r,i,l){Ae=n;var f=0;do{if(Ns&&(Os=null),Gi=0,Ns=!1,25<=f)throw Error(s(301));if(f+=1,ut=qe=null,n.updateQueue!=null){var m=n.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}O.H=Fg,m=r(i,l)}while(Ns);return m}function w1(){var n=O.H,r=n.useState()[0];return r=typeof r.then=="function"?Vi(r):r,n=n.useState()[0],(qe!==null?qe.memoizedState:null)!==n&&(Ae.flags|=1024),r}function Ld(){var n=Ol!==0;return Ol=0,n}function Ud(n,r,i){r.updateQueue=n.updateQueue,r.flags&=-2053,n.lanes&=~i}function zd(n){if(Nl){for(n=n.memoizedState;n!==null;){var r=n.queue;r!==null&&(r.pending=null),n=n.next}Nl=!1}ur=0,ut=qe=Ae=null,Ns=!1,Gi=Ol=0,Os=null}function Ut(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ut===null?Ae.memoizedState=ut=n:ut=ut.next=n,ut}function lt(){if(qe===null){var n=Ae.alternate;n=n!==null?n.memoizedState:null}else n=qe.next;var r=ut===null?Ae.memoizedState:ut.next;if(r!==null)ut=r,qe=n;else{if(n===null)throw Ae.alternate===null?Error(s(467)):Error(s(310));qe=n,n={memoizedState:qe.memoizedState,baseState:qe.baseState,baseQueue:qe.baseQueue,queue:qe.queue,next:null},ut===null?Ae.memoizedState=ut=n:ut=ut.next=n}return ut}function kl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Vi(n){var r=Gi;return Gi+=1,Os===null&&(Os=[]),n=ng(Os,n,r),r=Ae,(ut===null?r.memoizedState:ut.next)===null&&(r=r.alternate,O.H=r===null||r.memoizedState===null?Yg:Wd),n}function jl(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Vi(n);if(n.$$typeof===A)return Et(n)}throw Error(s(438,String(n)))}function Pd(n){var r=null,i=Ae.updateQueue;if(i!==null&&(r=i.memoCache),r==null){var l=Ae.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(f){return f.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),i===null&&(i=kl(),Ae.updateQueue=i),i.memoCache=r,i=r.data[r.index],i===void 0)for(i=r.data[r.index]=Array(n),l=0;l<n;l++)i[l]=me;return r.index++,i}function dr(n,r){return typeof r=="function"?r(n):r}function Ml(n){var r=lt();return Bd(r,qe,n)}function Bd(n,r,i){var l=n.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=i;var f=n.baseQueue,m=l.pending;if(m!==null){if(f!==null){var w=f.next;f.next=m.next,m.next=w}r.baseQueue=f=m,l.pending=null}if(m=n.baseState,f===null)n.memoizedState=m;else{r=f.next;var T=w=null,k=null,P=r,Y=!1;do{var Q=P.lane&-536870913;if(Q!==P.lane?(Me&Q)===Q:(ur&Q)===Q){var B=P.revertLane;if(B===0)k!==null&&(k=k.next={lane:0,revertLane:0,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}),Q===Es&&(Y=!0);else if((ur&B)===B){P=P.next,B===Es&&(Y=!0);continue}else Q={lane:0,revertLane:P.revertLane,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},k===null?(T=k=Q,w=m):k=k.next=Q,Ae.lanes|=B,Xr|=B;Q=P.action,za&&i(m,Q),m=P.hasEagerState?P.eagerState:i(m,Q)}else B={lane:Q,revertLane:P.revertLane,gesture:P.gesture,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},k===null?(T=k=B,w=m):k=k.next=B,Ae.lanes|=Q,Xr|=Q;P=P.next}while(P!==null&&P!==r);if(k===null?w=m:k.next=T,!Jt(m,n.memoizedState)&&(dt=!0,Y&&(i=Ts,i!==null)))throw i;n.memoizedState=m,n.baseState=w,n.baseQueue=k,l.lastRenderedState=m}return f===null&&(l.lanes=0),[n.memoizedState,l.dispatch]}function Id(n){var r=lt(),i=r.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=n;var l=i.dispatch,f=i.pending,m=r.memoizedState;if(f!==null){i.pending=null;var w=f=f.next;do m=n(m,w.action),w=w.next;while(w!==f);Jt(m,r.memoizedState)||(dt=!0),r.memoizedState=m,r.baseQueue===null&&(r.baseState=m),i.lastRenderedState=m}return[m,l]}function hg(n,r,i){var l=Ae,f=lt(),m=Ue;if(m){if(i===void 0)throw Error(s(407));i=i()}else i=r();var w=!Jt((qe||f).memoizedState,i);if(w&&(f.memoizedState=i,dt=!0),f=f.queue,qd(gg.bind(null,l,f,n),[n]),f.getSnapshot!==r||w||ut!==null&&ut.memoizedState.tag&1){if(l.flags|=2048,ks(9,{destroy:void 0},pg.bind(null,l,f,i,r),null),Ye===null)throw Error(s(349));m||(ur&127)!==0||mg(l,r,i)}return i}function mg(n,r,i){n.flags|=16384,n={getSnapshot:r,value:i},r=Ae.updateQueue,r===null?(r=kl(),Ae.updateQueue=r,r.stores=[n]):(i=r.stores,i===null?r.stores=[n]:i.push(n))}function pg(n,r,i,l){r.value=i,r.getSnapshot=l,vg(r)&&yg(n)}function gg(n,r,i){return i(function(){vg(r)&&yg(n)})}function vg(n){var r=n.getSnapshot;n=n.value;try{var i=r();return!Jt(n,i)}catch{return!0}}function yg(n){var r=Aa(n,2);r!==null&&Yt(r,n,2)}function $d(n){var r=Ut();if(typeof n=="function"){var i=n;if(n=i(),za){Tn(!0);try{i()}finally{Tn(!1)}}}return r.memoizedState=r.baseState=n,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dr,lastRenderedState:n},r}function bg(n,r,i,l){return n.baseState=i,Bd(n,qe,typeof l=="function"?l:dr)}function S1(n,r,i,l,f){if(Ul(n))throw Error(s(485));if(n=r.action,n!==null){var m={payload:f,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){m.listeners.push(w)}};O.T!==null?i(!0):m.isTransition=!1,l(m),i=r.pending,i===null?(m.next=r.pending=m,wg(r,m)):(m.next=i.next,r.pending=i.next=m)}}function wg(n,r){var i=r.action,l=r.payload,f=n.state;if(r.isTransition){var m=O.T,w={};O.T=w;try{var T=i(f,l),k=O.S;k!==null&&k(w,T),Sg(n,r,T)}catch(P){Hd(n,r,P)}finally{m!==null&&w.types!==null&&(m.types=w.types),O.T=m}}else try{m=i(f,l),Sg(n,r,m)}catch(P){Hd(n,r,P)}}function Sg(n,r,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(l){_g(n,r,l)},function(l){return Hd(n,r,l)}):_g(n,r,i)}function _g(n,r,i){r.status="fulfilled",r.value=i,xg(r),n.state=i,r=n.pending,r!==null&&(i=r.next,i===r?n.pending=null:(i=i.next,r.next=i,wg(n,i)))}function Hd(n,r,i){var l=n.pending;if(n.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=i,xg(r),r=r.next;while(r!==l)}n.action=null}function xg(n){n=n.listeners;for(var r=0;r<n.length;r++)(0,n[r])()}function Eg(n,r){return r}function Tg(n,r){if(Ue){var i=Ye.formState;if(i!==null){e:{var l=Ae;if(Ue){if(Xe){t:{for(var f=Xe,m=gn;f.nodeType!==8;){if(!m){f=null;break t}if(f=yn(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){Xe=yn(f.nextSibling),l=f.data==="F!";break e}}$r(l)}l=!1}l&&(r=i[0])}}return i=Ut(),i.memoizedState=i.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Eg,lastRenderedState:r},i.queue=l,i=Gg.bind(null,Ae,l),l.dispatch=i,l=$d(!1),m=Fd.bind(null,Ae,!1,l.queue),l=Ut(),f={state:r,dispatch:null,action:n,pending:null},l.queue=f,i=S1.bind(null,Ae,f,m,i),f.dispatch=i,l.memoizedState=n,[r,i,!1]}function Cg(n){var r=lt();return Rg(r,qe,n)}function Rg(n,r,i){if(r=Bd(n,r,Eg)[0],n=Ml(dr)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var l=Vi(r)}catch(w){throw w===Cs?xl:w}else l=r;r=lt();var f=r.queue,m=f.dispatch;return i!==r.memoizedState&&(Ae.flags|=2048,ks(9,{destroy:void 0},_1.bind(null,f,i),null)),[l,m,n]}function _1(n,r){n.action=r}function Ag(n){var r=lt(),i=qe;if(i!==null)return Rg(r,i,n);lt(),r=r.memoizedState,i=lt();var l=i.queue.dispatch;return i.memoizedState=n,[r,l,!1]}function ks(n,r,i,l){return n={tag:n,create:i,deps:l,inst:r,next:null},r=Ae.updateQueue,r===null&&(r=kl(),Ae.updateQueue=r),i=r.lastEffect,i===null?r.lastEffect=n.next=n:(l=i.next,i.next=n,n.next=l,r.lastEffect=n),n}function Ng(){return lt().memoizedState}function Dl(n,r,i,l){var f=Ut();Ae.flags|=n,f.memoizedState=ks(1|r,{destroy:void 0},i,l===void 0?null:l)}function Ll(n,r,i,l){var f=lt();l=l===void 0?null:l;var m=f.memoizedState.inst;qe!==null&&l!==null&&Md(l,qe.memoizedState.deps)?f.memoizedState=ks(r,m,i,l):(Ae.flags|=n,f.memoizedState=ks(1|r,m,i,l))}function Og(n,r){Dl(8390656,8,n,r)}function qd(n,r){Ll(2048,8,n,r)}function x1(n){Ae.flags|=4;var r=Ae.updateQueue;if(r===null)r=kl(),Ae.updateQueue=r,r.events=[n];else{var i=r.events;i===null?r.events=[n]:i.push(n)}}function kg(n){var r=lt().memoizedState;return x1({ref:r,nextImpl:n}),function(){if((Ie&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function jg(n,r){return Ll(4,2,n,r)}function Mg(n,r){return Ll(4,4,n,r)}function Dg(n,r){if(typeof r=="function"){n=n();var i=r(n);return function(){typeof i=="function"?i():r(null)}}if(r!=null)return n=n(),r.current=n,function(){r.current=null}}function Lg(n,r,i){i=i!=null?i.concat([n]):null,Ll(4,4,Dg.bind(null,r,n),i)}function Gd(){}function Ug(n,r){var i=lt();r=r===void 0?null:r;var l=i.memoizedState;return r!==null&&Md(r,l[1])?l[0]:(i.memoizedState=[n,r],n)}function zg(n,r){var i=lt();r=r===void 0?null:r;var l=i.memoizedState;if(r!==null&&Md(r,l[1]))return l[0];if(l=n(),za){Tn(!0);try{n()}finally{Tn(!1)}}return i.memoizedState=[l,r],l}function Vd(n,r,i){return i===void 0||(ur&1073741824)!==0&&(Me&261930)===0?n.memoizedState=r:(n.memoizedState=i,n=Pv(),Ae.lanes|=n,Xr|=n,i)}function Pg(n,r,i,l){return Jt(i,r)?i:As.current!==null?(n=Vd(n,i,l),Jt(n,r)||(dt=!0),n):(ur&42)===0||(ur&1073741824)!==0&&(Me&261930)===0?(dt=!0,n.memoizedState=i):(n=Pv(),Ae.lanes|=n,Xr|=n,r)}function Bg(n,r,i,l,f){var m=$.p;$.p=m!==0&&8>m?m:8;var w=O.T,T={};O.T=T,Fd(n,!1,r,i);try{var k=f(),P=O.S;if(P!==null&&P(T,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var Y=y1(k,l);Ki(n,r,Y,rn(n))}else Ki(n,r,l,rn(n))}catch(Q){Ki(n,r,{then:function(){},status:"rejected",reason:Q},rn())}finally{$.p=m,w!==null&&T.types!==null&&(w.types=T.types),O.T=w}}function E1(){}function Kd(n,r,i,l){if(n.tag!==5)throw Error(s(476));var f=Ig(n).queue;Bg(n,f,r,K,i===null?E1:function(){return $g(n),i(l)})}function Ig(n){var r=n.memoizedState;if(r!==null)return r;r={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dr,lastRenderedState:K},next:null};var i={};return r.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dr,lastRenderedState:i},next:null},n.memoizedState=r,n=n.alternate,n!==null&&(n.memoizedState=r),r}function $g(n){var r=Ig(n);r.next===null&&(r=n.alternate.memoizedState),Ki(n,r.next.queue,{},rn())}function Yd(){return Et(co)}function Hg(){return lt().memoizedState}function qg(){return lt().memoizedState}function T1(n){for(var r=n.return;r!==null;){switch(r.tag){case 24:case 3:var i=rn();n=Gr(i);var l=Vr(r,n,i);l!==null&&(Yt(l,r,i),$i(l,r,i)),r={cache:_d()},n.payload=r;return}r=r.return}}function C1(n,r,i){var l=rn();i={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Ul(n)?Vg(r,i):(i=dd(n,r,i,l),i!==null&&(Yt(i,n,l),Kg(i,r,l)))}function Gg(n,r,i){var l=rn();Ki(n,r,i,l)}function Ki(n,r,i,l){var f={lane:l,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Ul(n))Vg(r,f);else{var m=n.alternate;if(n.lanes===0&&(m===null||m.lanes===0)&&(m=r.lastRenderedReducer,m!==null))try{var w=r.lastRenderedState,T=m(w,i);if(f.hasEagerState=!0,f.eagerState=T,Jt(T,w))return gl(n,r,f,0),Ye===null&&pl(),!1}catch{}finally{}if(i=dd(n,r,f,l),i!==null)return Yt(i,n,l),Kg(i,r,l),!0}return!1}function Fd(n,r,i,l){if(l={lane:2,revertLane:Rf(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Ul(n)){if(r)throw Error(s(479))}else r=dd(n,i,l,2),r!==null&&Yt(r,n,2)}function Ul(n){var r=n.alternate;return n===Ae||r!==null&&r===Ae}function Vg(n,r){Ns=Nl=!0;var i=n.pending;i===null?r.next=r:(r.next=i.next,i.next=r),n.pending=r}function Kg(n,r,i){if((i&4194048)!==0){var l=r.lanes;l&=n.pendingLanes,i|=l,r.lanes=i,Bt(n,i)}}var Yi={readContext:Et,use:jl,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useLayoutEffect:at,useInsertionEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useSyncExternalStore:at,useId:at,useHostTransitionStatus:at,useFormState:at,useActionState:at,useOptimistic:at,useMemoCache:at,useCacheRefresh:at};Yi.useEffectEvent=at;var Yg={readContext:Et,use:jl,useCallback:function(n,r){return Ut().memoizedState=[n,r===void 0?null:r],n},useContext:Et,useEffect:Og,useImperativeHandle:function(n,r,i){i=i!=null?i.concat([n]):null,Dl(4194308,4,Dg.bind(null,r,n),i)},useLayoutEffect:function(n,r){return Dl(4194308,4,n,r)},useInsertionEffect:function(n,r){Dl(4,2,n,r)},useMemo:function(n,r){var i=Ut();r=r===void 0?null:r;var l=n();if(za){Tn(!0);try{n()}finally{Tn(!1)}}return i.memoizedState=[l,r],l},useReducer:function(n,r,i){var l=Ut();if(i!==void 0){var f=i(r);if(za){Tn(!0);try{i(r)}finally{Tn(!1)}}}else f=r;return l.memoizedState=l.baseState=f,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:f},l.queue=n,n=n.dispatch=C1.bind(null,Ae,n),[l.memoizedState,n]},useRef:function(n){var r=Ut();return n={current:n},r.memoizedState=n},useState:function(n){n=$d(n);var r=n.queue,i=Gg.bind(null,Ae,r);return r.dispatch=i,[n.memoizedState,i]},useDebugValue:Gd,useDeferredValue:function(n,r){var i=Ut();return Vd(i,n,r)},useTransition:function(){var n=$d(!1);return n=Bg.bind(null,Ae,n.queue,!0,!1),Ut().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,r,i){var l=Ae,f=Ut();if(Ue){if(i===void 0)throw Error(s(407));i=i()}else{if(i=r(),Ye===null)throw Error(s(349));(Me&127)!==0||mg(l,r,i)}f.memoizedState=i;var m={value:i,getSnapshot:r};return f.queue=m,Og(gg.bind(null,l,m,n),[n]),l.flags|=2048,ks(9,{destroy:void 0},pg.bind(null,l,m,i,r),null),i},useId:function(){var n=Ut(),r=Ye.identifierPrefix;if(Ue){var i=Hn,l=$n;i=(l&~(1<<32-Nt(l)-1)).toString(32)+i,r="_"+r+"R_"+i,i=Ol++,0<i&&(r+="H"+i.toString(32)),r+="_"}else i=b1++,r="_"+r+"r_"+i.toString(32)+"_";return n.memoizedState=r},useHostTransitionStatus:Yd,useFormState:Tg,useActionState:Tg,useOptimistic:function(n){var r=Ut();r.memoizedState=r.baseState=n;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=i,r=Fd.bind(null,Ae,!0,i),i.dispatch=r,[n,r]},useMemoCache:Pd,useCacheRefresh:function(){return Ut().memoizedState=T1.bind(null,Ae)},useEffectEvent:function(n){var r=Ut(),i={impl:n};return r.memoizedState=i,function(){if((Ie&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}},Wd={readContext:Et,use:jl,useCallback:Ug,useContext:Et,useEffect:qd,useImperativeHandle:Lg,useInsertionEffect:jg,useLayoutEffect:Mg,useMemo:zg,useReducer:Ml,useRef:Ng,useState:function(){return Ml(dr)},useDebugValue:Gd,useDeferredValue:function(n,r){var i=lt();return Pg(i,qe.memoizedState,n,r)},useTransition:function(){var n=Ml(dr)[0],r=lt().memoizedState;return[typeof n=="boolean"?n:Vi(n),r]},useSyncExternalStore:hg,useId:Hg,useHostTransitionStatus:Yd,useFormState:Cg,useActionState:Cg,useOptimistic:function(n,r){var i=lt();return bg(i,qe,n,r)},useMemoCache:Pd,useCacheRefresh:qg};Wd.useEffectEvent=kg;var Fg={readContext:Et,use:jl,useCallback:Ug,useContext:Et,useEffect:qd,useImperativeHandle:Lg,useInsertionEffect:jg,useLayoutEffect:Mg,useMemo:zg,useReducer:Id,useRef:Ng,useState:function(){return Id(dr)},useDebugValue:Gd,useDeferredValue:function(n,r){var i=lt();return qe===null?Vd(i,n,r):Pg(i,qe.memoizedState,n,r)},useTransition:function(){var n=Id(dr)[0],r=lt().memoizedState;return[typeof n=="boolean"?n:Vi(n),r]},useSyncExternalStore:hg,useId:Hg,useHostTransitionStatus:Yd,useFormState:Ag,useActionState:Ag,useOptimistic:function(n,r){var i=lt();return qe!==null?bg(i,qe,n,r):(i.baseState=n,[n,i.queue.dispatch])},useMemoCache:Pd,useCacheRefresh:qg};Fg.useEffectEvent=kg;function Xd(n,r,i,l){r=n.memoizedState,i=i(l,r),i=i==null?r:g({},r,i),n.memoizedState=i,n.lanes===0&&(n.updateQueue.baseState=i)}var Jd={enqueueSetState:function(n,r,i){n=n._reactInternals;var l=rn(),f=Gr(l);f.payload=r,i!=null&&(f.callback=i),r=Vr(n,f,l),r!==null&&(Yt(r,n,l),$i(r,n,l))},enqueueReplaceState:function(n,r,i){n=n._reactInternals;var l=rn(),f=Gr(l);f.tag=1,f.payload=r,i!=null&&(f.callback=i),r=Vr(n,f,l),r!==null&&(Yt(r,n,l),$i(r,n,l))},enqueueForceUpdate:function(n,r){n=n._reactInternals;var i=rn(),l=Gr(i);l.tag=2,r!=null&&(l.callback=r),r=Vr(n,l,i),r!==null&&(Yt(r,n,i),$i(r,n,i))}};function Wg(n,r,i,l,f,m,w){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(l,m,w):r.prototype&&r.prototype.isPureReactComponent?!Mi(i,l)||!Mi(f,m):!0}function Xg(n,r,i,l){n=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,l),r.state!==n&&Jd.enqueueReplaceState(r,r.state,null)}function Pa(n,r){var i=r;if("ref"in r){i={};for(var l in r)l!=="ref"&&(i[l]=r[l])}if(n=n.defaultProps){i===r&&(i=g({},i));for(var f in n)i[f]===void 0&&(i[f]=n[f])}return i}function Jg(n){ml(n)}function Qg(n){console.error(n)}function Zg(n){ml(n)}function zl(n,r){try{var i=n.onUncaughtError;i(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function ev(n,r,i){try{var l=n.onCaughtError;l(i.value,{componentStack:i.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Qd(n,r,i){return i=Gr(i),i.tag=3,i.payload={element:null},i.callback=function(){zl(n,r)},i}function tv(n){return n=Gr(n),n.tag=3,n}function nv(n,r,i,l){var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var m=l.value;n.payload=function(){return f(m)},n.callback=function(){ev(r,i,l)}}var w=i.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(n.callback=function(){ev(r,i,l),typeof f!="function"&&(Jr===null?Jr=new Set([this]):Jr.add(this));var T=l.stack;this.componentDidCatch(l.value,{componentStack:T!==null?T:""})})}function R1(n,r,i,l,f){if(i.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(r=i.alternate,r!==null&&xs(r,i,f,!0),i=Zt.current,i!==null){switch(i.tag){case 31:case 13:return vn===null?Wl():i.alternate===null&&st===0&&(st=3),i.flags&=-257,i.flags|=65536,i.lanes=f,l===El?i.flags|=16384:(r=i.updateQueue,r===null?i.updateQueue=new Set([l]):r.add(l),Ef(n,l,f)),!1;case 22:return i.flags|=65536,l===El?i.flags|=16384:(r=i.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},i.updateQueue=r):(i=r.retryQueue,i===null?r.retryQueue=new Set([l]):i.add(l)),Ef(n,l,f)),!1}throw Error(s(435,i.tag))}return Ef(n,l,f),Wl(),!1}if(Ue)return r=Zt.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=f,l!==vd&&(n=Error(s(422),{cause:l}),Ui(hn(n,i)))):(l!==vd&&(r=Error(s(423),{cause:l}),Ui(hn(r,i))),n=n.current.alternate,n.flags|=65536,f&=-f,n.lanes|=f,l=hn(l,i),f=Qd(n.stateNode,l,f),Ad(n,f),st!==4&&(st=2)),!1;var m=Error(s(520),{cause:l});if(m=hn(m,i),to===null?to=[m]:to.push(m),st!==4&&(st=2),r===null)return!0;l=hn(l,i),i=r;do{switch(i.tag){case 3:return i.flags|=65536,n=f&-f,i.lanes|=n,n=Qd(i.stateNode,l,n),Ad(i,n),!1;case 1:if(r=i.type,m=i.stateNode,(i.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Jr===null||!Jr.has(m))))return i.flags|=65536,f&=-f,i.lanes|=f,f=tv(f),nv(f,n,i,l),Ad(i,f),!1}i=i.return}while(i!==null);return!1}var Zd=Error(s(461)),dt=!1;function Tt(n,r,i,l){r.child=n===null?ig(r,null,i,l):Ua(r,n.child,i,l)}function rv(n,r,i,l,f){i=i.render;var m=r.ref;if("ref"in l){var w={};for(var T in l)T!=="ref"&&(w[T]=l[T])}else w=l;return ja(r),l=Dd(n,r,i,w,m,f),T=Ld(),n!==null&&!dt?(Ud(n,r,f),fr(n,r,f)):(Ue&&T&&pd(r),r.flags|=1,Tt(n,r,l,f),r.child)}function av(n,r,i,l,f){if(n===null){var m=i.type;return typeof m=="function"&&!fd(m)&&m.defaultProps===void 0&&i.compare===null?(r.tag=15,r.type=m,sv(n,r,m,l,f)):(n=yl(i.type,null,l,r,r.mode,f),n.ref=r.ref,n.return=r,r.child=n)}if(m=n.child,!lf(n,f)){var w=m.memoizedProps;if(i=i.compare,i=i!==null?i:Mi,i(w,l)&&n.ref===r.ref)return fr(n,r,f)}return r.flags|=1,n=ir(m,l),n.ref=r.ref,n.return=r,r.child=n}function sv(n,r,i,l,f){if(n!==null){var m=n.memoizedProps;if(Mi(m,l)&&n.ref===r.ref)if(dt=!1,r.pendingProps=l=m,lf(n,f))(n.flags&131072)!==0&&(dt=!0);else return r.lanes=n.lanes,fr(n,r,f)}return ef(n,r,i,l,f)}function iv(n,r,i,l){var f=l.children,m=n!==null?n.memoizedState:null;if(n===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((r.flags&128)!==0){if(m=m!==null?m.baseLanes|i:i,n!==null){for(l=r.child=n.child,f=0;l!==null;)f=f|l.lanes|l.childLanes,l=l.sibling;l=f&~m}else l=0,r.child=null;return ov(n,r,m,i,l)}if((i&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},n!==null&&_l(r,m!==null?m.cachePool:null),m!==null?cg(r,m):Od(),ug(r);else return l=r.lanes=536870912,ov(n,r,m!==null?m.baseLanes|i:i,i,l)}else m!==null?(_l(r,m.cachePool),cg(r,m),Yr(),r.memoizedState=null):(n!==null&&_l(r,null),Od(),Yr());return Tt(n,r,f,i),r.child}function Fi(n,r){return n!==null&&n.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function ov(n,r,i,l,f){var m=Ed();return m=m===null?null:{parent:ct._currentValue,pool:m},r.memoizedState={baseLanes:i,cachePool:m},n!==null&&_l(r,null),Od(),ug(r),n!==null&&xs(n,r,l,!0),r.childLanes=f,null}function Pl(n,r){return r=Il({mode:r.mode,children:r.children},n.mode),r.ref=n.ref,n.child=r,r.return=n,r}function lv(n,r,i){return Ua(r,n.child,null,i),n=Pl(r,r.pendingProps),n.flags|=2,en(r),r.memoizedState=null,n}function A1(n,r,i){var l=r.pendingProps,f=(r.flags&128)!==0;if(r.flags&=-129,n===null){if(Ue){if(l.mode==="hidden")return n=Pl(r,l),r.lanes=536870912,Fi(null,n);if(jd(r),(n=Xe)?(n=wy(n,gn),n=n!==null&&n.data==="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Br!==null?{id:$n,overflow:Hn}:null,retryLane:536870912,hydrationErrors:null},i=Vp(n),i.return=r,r.child=i,xt=r,Xe=null)):n=null,n===null)throw $r(r);return r.lanes=536870912,null}return Pl(r,l)}var m=n.memoizedState;if(m!==null){var w=m.dehydrated;if(jd(r),f)if(r.flags&256)r.flags&=-257,r=lv(n,r,i);else if(r.memoizedState!==null)r.child=n.child,r.flags|=128,r=null;else throw Error(s(558));else if(dt||xs(n,r,i,!1),f=(i&n.childLanes)!==0,dt||f){if(l=Ye,l!==null&&(w=It(l,i),w!==0&&w!==m.retryLane))throw m.retryLane=w,Aa(n,w),Yt(l,n,w),Zd;Wl(),r=lv(n,r,i)}else n=m.treeContext,Xe=yn(w.nextSibling),xt=r,Ue=!0,Ir=null,gn=!1,n!==null&&Fp(r,n),r=Pl(r,l),r.flags|=4096;return r}return n=ir(n.child,{mode:l.mode,children:l.children}),n.ref=r.ref,r.child=n,n.return=r,n}function Bl(n,r){var i=r.ref;if(i===null)n!==null&&n.ref!==null&&(r.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(s(284));(n===null||n.ref!==i)&&(r.flags|=4194816)}}function ef(n,r,i,l,f){return ja(r),i=Dd(n,r,i,l,void 0,f),l=Ld(),n!==null&&!dt?(Ud(n,r,f),fr(n,r,f)):(Ue&&l&&pd(r),r.flags|=1,Tt(n,r,i,f),r.child)}function cv(n,r,i,l,f,m){return ja(r),r.updateQueue=null,i=fg(r,l,i,f),dg(n),l=Ld(),n!==null&&!dt?(Ud(n,r,m),fr(n,r,m)):(Ue&&l&&pd(r),r.flags|=1,Tt(n,r,i,m),r.child)}function uv(n,r,i,l,f){if(ja(r),r.stateNode===null){var m=bs,w=i.contextType;typeof w=="object"&&w!==null&&(m=Et(w)),m=new i(l,m),r.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Jd,r.stateNode=m,m._reactInternals=r,m=r.stateNode,m.props=l,m.state=r.memoizedState,m.refs={},Cd(r),w=i.contextType,m.context=typeof w=="object"&&w!==null?Et(w):bs,m.state=r.memoizedState,w=i.getDerivedStateFromProps,typeof w=="function"&&(Xd(r,i,w,l),m.state=r.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(w=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),w!==m.state&&Jd.enqueueReplaceState(m,m.state,null),qi(r,l,m,f),Hi(),m.state=r.memoizedState),typeof m.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(n===null){m=r.stateNode;var T=r.memoizedProps,k=Pa(i,T);m.props=k;var P=m.context,Y=i.contextType;w=bs,typeof Y=="object"&&Y!==null&&(w=Et(Y));var Q=i.getDerivedStateFromProps;Y=typeof Q=="function"||typeof m.getSnapshotBeforeUpdate=="function",T=r.pendingProps!==T,Y||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(T||P!==w)&&Xg(r,m,l,w),qr=!1;var B=r.memoizedState;m.state=B,qi(r,l,m,f),Hi(),P=r.memoizedState,T||B!==P||qr?(typeof Q=="function"&&(Xd(r,i,Q,l),P=r.memoizedState),(k=qr||Wg(r,i,k,l,B,P,w))?(Y||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(r.flags|=4194308)):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=P),m.props=l,m.state=P,m.context=w,l=k):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{m=r.stateNode,Rd(n,r),w=r.memoizedProps,Y=Pa(i,w),m.props=Y,Q=r.pendingProps,B=m.context,P=i.contextType,k=bs,typeof P=="object"&&P!==null&&(k=Et(P)),T=i.getDerivedStateFromProps,(P=typeof T=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(w!==Q||B!==k)&&Xg(r,m,l,k),qr=!1,B=r.memoizedState,m.state=B,qi(r,l,m,f),Hi();var H=r.memoizedState;w!==Q||B!==H||qr||n!==null&&n.dependencies!==null&&wl(n.dependencies)?(typeof T=="function"&&(Xd(r,i,T,l),H=r.memoizedState),(Y=qr||Wg(r,i,Y,l,B,H,k)||n!==null&&n.dependencies!==null&&wl(n.dependencies))?(P||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(l,H,k),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(l,H,k)),typeof m.componentDidUpdate=="function"&&(r.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof m.componentDidUpdate!="function"||w===n.memoizedProps&&B===n.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&B===n.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=H),m.props=l,m.state=H,m.context=k,l=Y):(typeof m.componentDidUpdate!="function"||w===n.memoizedProps&&B===n.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&B===n.memoizedState||(r.flags|=1024),l=!1)}return m=l,Bl(n,r),l=(r.flags&128)!==0,m||l?(m=r.stateNode,i=l&&typeof i.getDerivedStateFromError!="function"?null:m.render(),r.flags|=1,n!==null&&l?(r.child=Ua(r,n.child,null,f),r.child=Ua(r,null,i,f)):Tt(n,r,i,f),r.memoizedState=m.state,n=r.child):n=fr(n,r,f),n}function dv(n,r,i,l){return Oa(),r.flags|=256,Tt(n,r,i,l),r.child}var tf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function nf(n){return{baseLanes:n,cachePool:eg()}}function rf(n,r,i){return n=n!==null?n.childLanes&~i:0,r&&(n|=nn),n}function fv(n,r,i){var l=r.pendingProps,f=!1,m=(r.flags&128)!==0,w;if((w=m)||(w=n!==null&&n.memoizedState===null?!1:(ot.current&2)!==0),w&&(f=!0,r.flags&=-129),w=(r.flags&32)!==0,r.flags&=-33,n===null){if(Ue){if(f?Kr(r):Yr(),(n=Xe)?(n=wy(n,gn),n=n!==null&&n.data!=="&"?n:null,n!==null&&(r.memoizedState={dehydrated:n,treeContext:Br!==null?{id:$n,overflow:Hn}:null,retryLane:536870912,hydrationErrors:null},i=Vp(n),i.return=r,r.child=i,xt=r,Xe=null)):n=null,n===null)throw $r(r);return If(n)?r.lanes=32:r.lanes=536870912,null}var T=l.children;return l=l.fallback,f?(Yr(),f=r.mode,T=Il({mode:"hidden",children:T},f),l=Na(l,f,i,null),T.return=r,l.return=r,T.sibling=l,r.child=T,l=r.child,l.memoizedState=nf(i),l.childLanes=rf(n,w,i),r.memoizedState=tf,Fi(null,l)):(Kr(r),af(r,T))}var k=n.memoizedState;if(k!==null&&(T=k.dehydrated,T!==null)){if(m)r.flags&256?(Kr(r),r.flags&=-257,r=sf(n,r,i)):r.memoizedState!==null?(Yr(),r.child=n.child,r.flags|=128,r=null):(Yr(),T=l.fallback,f=r.mode,l=Il({mode:"visible",children:l.children},f),T=Na(T,f,i,null),T.flags|=2,l.return=r,T.return=r,l.sibling=T,r.child=l,Ua(r,n.child,null,i),l=r.child,l.memoizedState=nf(i),l.childLanes=rf(n,w,i),r.memoizedState=tf,r=Fi(null,l));else if(Kr(r),If(T)){if(w=T.nextSibling&&T.nextSibling.dataset,w)var P=w.dgst;w=P,l=Error(s(419)),l.stack="",l.digest=w,Ui({value:l,source:null,stack:null}),r=sf(n,r,i)}else if(dt||xs(n,r,i,!1),w=(i&n.childLanes)!==0,dt||w){if(w=Ye,w!==null&&(l=It(w,i),l!==0&&l!==k.retryLane))throw k.retryLane=l,Aa(n,l),Yt(w,n,l),Zd;Bf(T)||Wl(),r=sf(n,r,i)}else Bf(T)?(r.flags|=192,r.child=n.child,r=null):(n=k.treeContext,Xe=yn(T.nextSibling),xt=r,Ue=!0,Ir=null,gn=!1,n!==null&&Fp(r,n),r=af(r,l.children),r.flags|=4096);return r}return f?(Yr(),T=l.fallback,f=r.mode,k=n.child,P=k.sibling,l=ir(k,{mode:"hidden",children:l.children}),l.subtreeFlags=k.subtreeFlags&65011712,P!==null?T=ir(P,T):(T=Na(T,f,i,null),T.flags|=2),T.return=r,l.return=r,l.sibling=T,r.child=l,Fi(null,l),l=r.child,T=n.child.memoizedState,T===null?T=nf(i):(f=T.cachePool,f!==null?(k=ct._currentValue,f=f.parent!==k?{parent:k,pool:k}:f):f=eg(),T={baseLanes:T.baseLanes|i,cachePool:f}),l.memoizedState=T,l.childLanes=rf(n,w,i),r.memoizedState=tf,Fi(n.child,l)):(Kr(r),i=n.child,n=i.sibling,i=ir(i,{mode:"visible",children:l.children}),i.return=r,i.sibling=null,n!==null&&(w=r.deletions,w===null?(r.deletions=[n],r.flags|=16):w.push(n)),r.child=i,r.memoizedState=null,i)}function af(n,r){return r=Il({mode:"visible",children:r},n.mode),r.return=n,n.child=r}function Il(n,r){return n=Qt(22,n,null,r),n.lanes=0,n}function sf(n,r,i){return Ua(r,n.child,null,i),n=af(r,r.pendingProps.children),n.flags|=2,r.memoizedState=null,n}function hv(n,r,i){n.lanes|=r;var l=n.alternate;l!==null&&(l.lanes|=r),wd(n.return,r,i)}function of(n,r,i,l,f,m){var w=n.memoizedState;w===null?n.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:i,tailMode:f,treeForkCount:m}:(w.isBackwards=r,w.rendering=null,w.renderingStartTime=0,w.last=l,w.tail=i,w.tailMode=f,w.treeForkCount=m)}function mv(n,r,i){var l=r.pendingProps,f=l.revealOrder,m=l.tail;l=l.children;var w=ot.current,T=(w&2)!==0;if(T?(w=w&1|2,r.flags|=128):w&=1,F(ot,w),Tt(n,r,l,i),l=Ue?Li:0,!T&&n!==null&&(n.flags&128)!==0)e:for(n=r.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&hv(n,i,r);else if(n.tag===19)hv(n,i,r);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===r)break e;for(;n.sibling===null;){if(n.return===null||n.return===r)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}switch(f){case"forwards":for(i=r.child,f=null;i!==null;)n=i.alternate,n!==null&&Al(n)===null&&(f=i),i=i.sibling;i=f,i===null?(f=r.child,r.child=null):(f=i.sibling,i.sibling=null),of(r,!1,f,i,m,l);break;case"backwards":case"unstable_legacy-backwards":for(i=null,f=r.child,r.child=null;f!==null;){if(n=f.alternate,n!==null&&Al(n)===null){r.child=f;break}n=f.sibling,f.sibling=i,i=f,f=n}of(r,!0,i,null,m,l);break;case"together":of(r,!1,null,null,void 0,l);break;default:r.memoizedState=null}return r.child}function fr(n,r,i){if(n!==null&&(r.dependencies=n.dependencies),Xr|=r.lanes,(i&r.childLanes)===0)if(n!==null){if(xs(n,r,i,!1),(i&r.childLanes)===0)return null}else return null;if(n!==null&&r.child!==n.child)throw Error(s(153));if(r.child!==null){for(n=r.child,i=ir(n,n.pendingProps),r.child=i,i.return=r;n.sibling!==null;)n=n.sibling,i=i.sibling=ir(n,n.pendingProps),i.return=r;i.sibling=null}return r.child}function lf(n,r){return(n.lanes&r)!==0?!0:(n=n.dependencies,!!(n!==null&&wl(n)))}function N1(n,r,i){switch(r.tag){case 3:ce(r,r.stateNode.containerInfo),Hr(r,ct,n.memoizedState.cache),Oa();break;case 27:case 5:Ce(r);break;case 4:ce(r,r.stateNode.containerInfo);break;case 10:Hr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,jd(r),null;break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated!==null?(Kr(r),r.flags|=128,null):(i&r.child.childLanes)!==0?fv(n,r,i):(Kr(r),n=fr(n,r,i),n!==null?n.sibling:null);Kr(r);break;case 19:var f=(n.flags&128)!==0;if(l=(i&r.childLanes)!==0,l||(xs(n,r,i,!1),l=(i&r.childLanes)!==0),f){if(l)return mv(n,r,i);r.flags|=128}if(f=r.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),F(ot,ot.current),l)break;return null;case 22:return r.lanes=0,iv(n,r,i,r.pendingProps);case 24:Hr(r,ct,n.memoizedState.cache)}return fr(n,r,i)}function pv(n,r,i){if(n!==null)if(n.memoizedProps!==r.pendingProps)dt=!0;else{if(!lf(n,i)&&(r.flags&128)===0)return dt=!1,N1(n,r,i);dt=(n.flags&131072)!==0}else dt=!1,Ue&&(r.flags&1048576)!==0&&Yp(r,Li,r.index);switch(r.lanes=0,r.tag){case 16:e:{var l=r.pendingProps;if(n=Da(r.elementType),r.type=n,typeof n=="function")fd(n)?(l=Pa(n,l),r.tag=1,r=uv(null,r,n,l,i)):(r.tag=0,r=ef(null,r,n,l,i));else{if(n!=null){var f=n.$$typeof;if(f===D){r.tag=11,r=rv(null,r,n,l,i);break e}else if(f===U){r.tag=14,r=av(null,r,n,l,i);break e}}throw r=J(n)||n,Error(s(306,r,""))}}return r;case 0:return ef(n,r,r.type,r.pendingProps,i);case 1:return l=r.type,f=Pa(l,r.pendingProps),uv(n,r,l,f,i);case 3:e:{if(ce(r,r.stateNode.containerInfo),n===null)throw Error(s(387));l=r.pendingProps;var m=r.memoizedState;f=m.element,Rd(n,r),qi(r,l,null,i);var w=r.memoizedState;if(l=w.cache,Hr(r,ct,l),l!==m.cache&&Sd(r,[ct],i,!0),Hi(),l=w.element,m.isDehydrated)if(m={element:l,isDehydrated:!1,cache:w.cache},r.updateQueue.baseState=m,r.memoizedState=m,r.flags&256){r=dv(n,r,l,i);break e}else if(l!==f){f=hn(Error(s(424)),r),Ui(f),r=dv(n,r,l,i);break e}else{switch(n=r.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(Xe=yn(n.firstChild),xt=r,Ue=!0,Ir=null,gn=!0,i=ig(r,null,l,i),r.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Oa(),l===f){r=fr(n,r,i);break e}Tt(n,r,l,i)}r=r.child}return r;case 26:return Bl(n,r),n===null?(i=Cy(r.type,null,r.pendingProps,null))?r.memoizedState=i:Ue||(i=r.type,n=r.pendingProps,l=nc(se.current).createElement(i),l[_t]=r,l[$t]=n,Ct(l,i,n),bt(l),r.stateNode=l):r.memoizedState=Cy(r.type,n.memoizedProps,r.pendingProps,n.memoizedState),null;case 27:return Ce(r),n===null&&Ue&&(l=r.stateNode=xy(r.type,r.pendingProps,se.current),xt=r,gn=!0,f=Xe,ta(r.type)?($f=f,Xe=yn(l.firstChild)):Xe=f),Tt(n,r,r.pendingProps.children,i),Bl(n,r),n===null&&(r.flags|=4194304),r.child;case 5:return n===null&&Ue&&((f=l=Xe)&&(l=sT(l,r.type,r.pendingProps,gn),l!==null?(r.stateNode=l,xt=r,Xe=yn(l.firstChild),gn=!1,f=!0):f=!1),f||$r(r)),Ce(r),f=r.type,m=r.pendingProps,w=n!==null?n.memoizedProps:null,l=m.children,Uf(f,m)?l=null:w!==null&&Uf(f,w)&&(r.flags|=32),r.memoizedState!==null&&(f=Dd(n,r,w1,null,null,i),co._currentValue=f),Bl(n,r),Tt(n,r,l,i),r.child;case 6:return n===null&&Ue&&((n=i=Xe)&&(i=iT(i,r.pendingProps,gn),i!==null?(r.stateNode=i,xt=r,Xe=null,n=!0):n=!1),n||$r(r)),null;case 13:return fv(n,r,i);case 4:return ce(r,r.stateNode.containerInfo),l=r.pendingProps,n===null?r.child=Ua(r,null,l,i):Tt(n,r,l,i),r.child;case 11:return rv(n,r,r.type,r.pendingProps,i);case 7:return Tt(n,r,r.pendingProps,i),r.child;case 8:return Tt(n,r,r.pendingProps.children,i),r.child;case 12:return Tt(n,r,r.pendingProps.children,i),r.child;case 10:return l=r.pendingProps,Hr(r,r.type,l.value),Tt(n,r,l.children,i),r.child;case 9:return f=r.type._context,l=r.pendingProps.children,ja(r),f=Et(f),l=l(f),r.flags|=1,Tt(n,r,l,i),r.child;case 14:return av(n,r,r.type,r.pendingProps,i);case 15:return sv(n,r,r.type,r.pendingProps,i);case 19:return mv(n,r,i);case 31:return A1(n,r,i);case 22:return iv(n,r,i,r.pendingProps);case 24:return ja(r),l=Et(ct),n===null?(f=Ed(),f===null&&(f=Ye,m=_d(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=i),f=m),r.memoizedState={parent:l,cache:f},Cd(r),Hr(r,ct,f)):((n.lanes&i)!==0&&(Rd(n,r),qi(r,null,null,i),Hi()),f=n.memoizedState,m=r.memoizedState,f.parent!==l?(f={parent:l,cache:l},r.memoizedState=f,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=f),Hr(r,ct,l)):(l=m.cache,Hr(r,ct,l),l!==f.cache&&Sd(r,[ct],i,!0))),Tt(n,r,r.pendingProps.children,i),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function hr(n){n.flags|=4}function cf(n,r,i,l,f){if((r=(n.mode&32)!==0)&&(r=!1),r){if(n.flags|=16777216,(f&335544128)===f)if(n.stateNode.complete)n.flags|=8192;else if(Hv())n.flags|=8192;else throw La=El,Td}else n.flags&=-16777217}function gv(n,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!ky(r))if(Hv())n.flags|=8192;else throw La=El,Td}function $l(n,r){r!==null&&(n.flags|=4),n.flags&16384&&(r=n.tag!==22?Ot():536870912,n.lanes|=r,Ls|=r)}function Wi(n,r){if(!Ue)switch(n.tailMode){case"hidden":r=n.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?n.tail=null:i.sibling=null;break;case"collapsed":i=n.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?r||n.tail===null?n.tail=null:n.tail.sibling=null:l.sibling=null}}function Je(n){var r=n.alternate!==null&&n.alternate.child===n.child,i=0,l=0;if(r)for(var f=n.child;f!==null;)i|=f.lanes|f.childLanes,l|=f.subtreeFlags&65011712,l|=f.flags&65011712,f.return=n,f=f.sibling;else for(f=n.child;f!==null;)i|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=n,f=f.sibling;return n.subtreeFlags|=l,n.childLanes=i,r}function O1(n,r,i){var l=r.pendingProps;switch(gd(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Je(r),null;case 1:return Je(r),null;case 3:return i=r.stateNode,l=null,n!==null&&(l=n.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),cr(ct),le(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(_s(r)?hr(r):n===null||n.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,yd())),Je(r),null;case 26:var f=r.type,m=r.memoizedState;return n===null?(hr(r),m!==null?(Je(r),gv(r,m)):(Je(r),cf(r,f,null,l,i))):m?m!==n.memoizedState?(hr(r),Je(r),gv(r,m)):(Je(r),r.flags&=-16777217):(n=n.memoizedProps,n!==l&&hr(r),Je(r),cf(r,f,n,l,i)),null;case 27:if(Re(r),i=se.current,f=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==l&&hr(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Je(r),null}n=ee.current,_s(r)?Wp(r):(n=xy(f,l,i),r.stateNode=n,hr(r))}return Je(r),null;case 5:if(Re(r),f=r.type,n!==null&&r.stateNode!=null)n.memoizedProps!==l&&hr(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return Je(r),null}if(m=ee.current,_s(r))Wp(r);else{var w=nc(se.current);switch(m){case 1:m=w.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:m=w.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":m=w.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":m=w.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":m=w.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof l.is=="string"?w.createElement("select",{is:l.is}):w.createElement("select"),l.multiple?m.multiple=!0:l.size&&(m.size=l.size);break;default:m=typeof l.is=="string"?w.createElement(f,{is:l.is}):w.createElement(f)}}m[_t]=r,m[$t]=l;e:for(w=r.child;w!==null;){if(w.tag===5||w.tag===6)m.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===r)break e;for(;w.sibling===null;){if(w.return===null||w.return===r)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}r.stateNode=m;e:switch(Ct(m,f,l),f){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&hr(r)}}return Je(r),cf(r,r.type,n===null?null:n.memoizedProps,r.pendingProps,i),null;case 6:if(n&&r.stateNode!=null)n.memoizedProps!==l&&hr(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(n=se.current,_s(r)){if(n=r.stateNode,i=r.memoizedProps,l=null,f=xt,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}n[_t]=r,n=!!(n.nodeValue===i||l!==null&&l.suppressHydrationWarning===!0||fy(n.nodeValue,i)),n||$r(r,!0)}else n=nc(n).createTextNode(l),n[_t]=r,r.stateNode=n}return Je(r),null;case 31:if(i=r.memoizedState,n===null||n.memoizedState!==null){if(l=_s(r),i!==null){if(n===null){if(!l)throw Error(s(318));if(n=r.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(557));n[_t]=r}else Oa(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Je(r),n=!1}else i=yd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=i),n=!0;if(!n)return r.flags&256?(en(r),r):(en(r),null);if((r.flags&128)!==0)throw Error(s(558))}return Je(r),null;case 13:if(l=r.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(f=_s(r),l!==null&&l.dehydrated!==null){if(n===null){if(!f)throw Error(s(318));if(f=r.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(s(317));f[_t]=r}else Oa(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Je(r),f=!1}else f=yd(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=f),f=!0;if(!f)return r.flags&256?(en(r),r):(en(r),null)}return en(r),(r.flags&128)!==0?(r.lanes=i,r):(i=l!==null,n=n!==null&&n.memoizedState!==null,i&&(l=r.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool),m=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(m=l.memoizedState.cachePool.pool),m!==f&&(l.flags|=2048)),i!==n&&i&&(r.child.flags|=8192),$l(r,r.updateQueue),Je(r),null);case 4:return le(),n===null&&kf(r.stateNode.containerInfo),Je(r),null;case 10:return cr(r.type),Je(r),null;case 19:if(G(ot),l=r.memoizedState,l===null)return Je(r),null;if(f=(r.flags&128)!==0,m=l.rendering,m===null)if(f)Wi(l,!1);else{if(st!==0||n!==null&&(n.flags&128)!==0)for(n=r.child;n!==null;){if(m=Al(n),m!==null){for(r.flags|=128,Wi(l,!1),n=m.updateQueue,r.updateQueue=n,$l(r,n),r.subtreeFlags=0,n=i,i=r.child;i!==null;)Gp(i,n),i=i.sibling;return F(ot,ot.current&1|2),Ue&&or(r,l.treeForkCount),r.child}n=n.sibling}l.tail!==null&&Dt()>Kl&&(r.flags|=128,f=!0,Wi(l,!1),r.lanes=4194304)}else{if(!f)if(n=Al(m),n!==null){if(r.flags|=128,f=!0,n=n.updateQueue,r.updateQueue=n,$l(r,n),Wi(l,!0),l.tail===null&&l.tailMode==="hidden"&&!m.alternate&&!Ue)return Je(r),null}else 2*Dt()-l.renderingStartTime>Kl&&i!==536870912&&(r.flags|=128,f=!0,Wi(l,!1),r.lanes=4194304);l.isBackwards?(m.sibling=r.child,r.child=m):(n=l.last,n!==null?n.sibling=m:r.child=m,l.last=m)}return l.tail!==null?(n=l.tail,l.rendering=n,l.tail=n.sibling,l.renderingStartTime=Dt(),n.sibling=null,i=ot.current,F(ot,f?i&1|2:i&1),Ue&&or(r,l.treeForkCount),n):(Je(r),null);case 22:case 23:return en(r),kd(),l=r.memoizedState!==null,n!==null?n.memoizedState!==null!==l&&(r.flags|=8192):l&&(r.flags|=8192),l?(i&536870912)!==0&&(r.flags&128)===0&&(Je(r),r.subtreeFlags&6&&(r.flags|=8192)):Je(r),i=r.updateQueue,i!==null&&$l(r,i.retryQueue),i=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==i&&(r.flags|=2048),n!==null&&G(Ma),null;case 24:return i=null,n!==null&&(i=n.memoizedState.cache),r.memoizedState.cache!==i&&(r.flags|=2048),cr(ct),Je(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function k1(n,r){switch(gd(r),r.tag){case 1:return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 3:return cr(ct),le(),n=r.flags,(n&65536)!==0&&(n&128)===0?(r.flags=n&-65537|128,r):null;case 26:case 27:case 5:return Re(r),null;case 31:if(r.memoizedState!==null){if(en(r),r.alternate===null)throw Error(s(340));Oa()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 13:if(en(r),n=r.memoizedState,n!==null&&n.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Oa()}return n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 19:return G(ot),null;case 4:return le(),null;case 10:return cr(r.type),null;case 22:case 23:return en(r),kd(),n!==null&&G(Ma),n=r.flags,n&65536?(r.flags=n&-65537|128,r):null;case 24:return cr(ct),null;case 25:return null;default:return null}}function vv(n,r){switch(gd(r),r.tag){case 3:cr(ct),le();break;case 26:case 27:case 5:Re(r);break;case 4:le();break;case 31:r.memoizedState!==null&&en(r);break;case 13:en(r);break;case 19:G(ot);break;case 10:cr(r.type);break;case 22:case 23:en(r),kd(),n!==null&&G(Ma);break;case 24:cr(ct)}}function Xi(n,r){try{var i=r.updateQueue,l=i!==null?i.lastEffect:null;if(l!==null){var f=l.next;i=f;do{if((i.tag&n)===n){l=void 0;var m=i.create,w=i.inst;l=m(),w.destroy=l}i=i.next}while(i!==f)}}catch(T){He(r,r.return,T)}}function Fr(n,r,i){try{var l=r.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var m=f.next;l=m;do{if((l.tag&n)===n){var w=l.inst,T=w.destroy;if(T!==void 0){w.destroy=void 0,f=r;var k=i,P=T;try{P()}catch(Y){He(f,k,Y)}}}l=l.next}while(l!==m)}}catch(Y){He(r,r.return,Y)}}function yv(n){var r=n.updateQueue;if(r!==null){var i=n.stateNode;try{lg(r,i)}catch(l){He(n,n.return,l)}}}function bv(n,r,i){i.props=Pa(n.type,n.memoizedProps),i.state=n.memoizedState;try{i.componentWillUnmount()}catch(l){He(n,r,l)}}function Ji(n,r){try{var i=n.ref;if(i!==null){switch(n.tag){case 26:case 27:case 5:var l=n.stateNode;break;case 30:l=n.stateNode;break;default:l=n.stateNode}typeof i=="function"?n.refCleanup=i(l):i.current=l}}catch(f){He(n,r,f)}}function qn(n,r){var i=n.ref,l=n.refCleanup;if(i!==null)if(typeof l=="function")try{l()}catch(f){He(n,r,f)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(f){He(n,r,f)}else i.current=null}function wv(n){var r=n.type,i=n.memoizedProps,l=n.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":i.autoFocus&&l.focus();break e;case"img":i.src?l.src=i.src:i.srcSet&&(l.srcset=i.srcSet)}}catch(f){He(n,n.return,f)}}function uf(n,r,i){try{var l=n.stateNode;Z1(l,n.type,i,r),l[$t]=r}catch(f){He(n,n.return,f)}}function Sv(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&ta(n.type)||n.tag===4}function df(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||Sv(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&ta(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function ff(n,r,i){var l=n.tag;if(l===5||l===6)n=n.stateNode,r?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(n,r):(r=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,r.appendChild(n),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=ar));else if(l!==4&&(l===27&&ta(n.type)&&(i=n.stateNode,r=null),n=n.child,n!==null))for(ff(n,r,i),n=n.sibling;n!==null;)ff(n,r,i),n=n.sibling}function Hl(n,r,i){var l=n.tag;if(l===5||l===6)n=n.stateNode,r?i.insertBefore(n,r):i.appendChild(n);else if(l!==4&&(l===27&&ta(n.type)&&(i=n.stateNode),n=n.child,n!==null))for(Hl(n,r,i),n=n.sibling;n!==null;)Hl(n,r,i),n=n.sibling}function _v(n){var r=n.stateNode,i=n.memoizedProps;try{for(var l=n.type,f=r.attributes;f.length;)r.removeAttributeNode(f[0]);Ct(r,l,i),r[_t]=n,r[$t]=i}catch(m){He(n,n.return,m)}}var mr=!1,ft=!1,hf=!1,xv=typeof WeakSet=="function"?WeakSet:Set,wt=null;function j1(n,r){if(n=n.containerInfo,Df=cc,n=Lp(n),sd(n)){if("selectionStart"in n)var i={start:n.selectionStart,end:n.selectionEnd};else e:{i=(i=n.ownerDocument)&&i.defaultView||window;var l=i.getSelection&&i.getSelection();if(l&&l.rangeCount!==0){i=l.anchorNode;var f=l.anchorOffset,m=l.focusNode;l=l.focusOffset;try{i.nodeType,m.nodeType}catch{i=null;break e}var w=0,T=-1,k=-1,P=0,Y=0,Q=n,B=null;t:for(;;){for(var H;Q!==i||f!==0&&Q.nodeType!==3||(T=w+f),Q!==m||l!==0&&Q.nodeType!==3||(k=w+l),Q.nodeType===3&&(w+=Q.nodeValue.length),(H=Q.firstChild)!==null;)B=Q,Q=H;for(;;){if(Q===n)break t;if(B===i&&++P===f&&(T=w),B===m&&++Y===l&&(k=w),(H=Q.nextSibling)!==null)break;Q=B,B=Q.parentNode}Q=H}i=T===-1||k===-1?null:{start:T,end:k}}else i=null}i=i||{start:0,end:0}}else i=null;for(Lf={focusedElem:n,selectionRange:i},cc=!1,wt=r;wt!==null;)if(r=wt,n=r.child,(r.subtreeFlags&1028)!==0&&n!==null)n.return=r,wt=n;else for(;wt!==null;){switch(r=wt,m=r.alternate,n=r.flags,r.tag){case 0:if((n&4)!==0&&(n=r.updateQueue,n=n!==null?n.events:null,n!==null))for(i=0;i<n.length;i++)f=n[i],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((n&1024)!==0&&m!==null){n=void 0,i=r,f=m.memoizedProps,m=m.memoizedState,l=i.stateNode;try{var he=Pa(i.type,f);n=l.getSnapshotBeforeUpdate(he,m),l.__reactInternalSnapshotBeforeUpdate=n}catch(Se){He(i,i.return,Se)}}break;case 3:if((n&1024)!==0){if(n=r.stateNode.containerInfo,i=n.nodeType,i===9)Pf(n);else if(i===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Pf(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(s(163))}if(n=r.sibling,n!==null){n.return=r.return,wt=n;break}wt=r.return}}function Ev(n,r,i){var l=i.flags;switch(i.tag){case 0:case 11:case 15:gr(n,i),l&4&&Xi(5,i);break;case 1:if(gr(n,i),l&4)if(n=i.stateNode,r===null)try{n.componentDidMount()}catch(w){He(i,i.return,w)}else{var f=Pa(i.type,r.memoizedProps);r=r.memoizedState;try{n.componentDidUpdate(f,r,n.__reactInternalSnapshotBeforeUpdate)}catch(w){He(i,i.return,w)}}l&64&&yv(i),l&512&&Ji(i,i.return);break;case 3:if(gr(n,i),l&64&&(n=i.updateQueue,n!==null)){if(r=null,i.child!==null)switch(i.child.tag){case 27:case 5:r=i.child.stateNode;break;case 1:r=i.child.stateNode}try{lg(n,r)}catch(w){He(i,i.return,w)}}break;case 27:r===null&&l&4&&_v(i);case 26:case 5:gr(n,i),r===null&&l&4&&wv(i),l&512&&Ji(i,i.return);break;case 12:gr(n,i);break;case 31:gr(n,i),l&4&&Rv(n,i);break;case 13:gr(n,i),l&4&&Av(n,i),l&64&&(n=i.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(i=$1.bind(null,i),oT(n,i))));break;case 22:if(l=i.memoizedState!==null||mr,!l){r=r!==null&&r.memoizedState!==null||ft,f=mr;var m=ft;mr=l,(ft=r)&&!m?vr(n,i,(i.subtreeFlags&8772)!==0):gr(n,i),mr=f,ft=m}break;case 30:break;default:gr(n,i)}}function Tv(n){var r=n.alternate;r!==null&&(n.alternate=null,Tv(r)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(r=n.stateNode,r!==null&&Hu(r)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var et=null,qt=!1;function pr(n,r,i){for(i=i.child;i!==null;)Cv(n,r,i),i=i.sibling}function Cv(n,r,i){if(Lt&&typeof Lt.onCommitFiberUnmount=="function")try{Lt.onCommitFiberUnmount(Sa,i)}catch{}switch(i.tag){case 26:ft||qn(i,r),pr(n,r,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:ft||qn(i,r);var l=et,f=qt;ta(i.type)&&(et=i.stateNode,qt=!1),pr(n,r,i),io(i.stateNode),et=l,qt=f;break;case 5:ft||qn(i,r);case 6:if(l=et,f=qt,et=null,pr(n,r,i),et=l,qt=f,et!==null)if(qt)try{(et.nodeType===9?et.body:et.nodeName==="HTML"?et.ownerDocument.body:et).removeChild(i.stateNode)}catch(m){He(i,r,m)}else try{et.removeChild(i.stateNode)}catch(m){He(i,r,m)}break;case 18:et!==null&&(qt?(n=et,yy(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,i.stateNode),qs(n)):yy(et,i.stateNode));break;case 4:l=et,f=qt,et=i.stateNode.containerInfo,qt=!0,pr(n,r,i),et=l,qt=f;break;case 0:case 11:case 14:case 15:Fr(2,i,r),ft||Fr(4,i,r),pr(n,r,i);break;case 1:ft||(qn(i,r),l=i.stateNode,typeof l.componentWillUnmount=="function"&&bv(i,r,l)),pr(n,r,i);break;case 21:pr(n,r,i);break;case 22:ft=(l=ft)||i.memoizedState!==null,pr(n,r,i),ft=l;break;default:pr(n,r,i)}}function Rv(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null))){n=n.dehydrated;try{qs(n)}catch(i){He(r,r.return,i)}}}function Av(n,r){if(r.memoizedState===null&&(n=r.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{qs(n)}catch(i){He(r,r.return,i)}}function M1(n){switch(n.tag){case 31:case 13:case 19:var r=n.stateNode;return r===null&&(r=n.stateNode=new xv),r;case 22:return n=n.stateNode,r=n._retryCache,r===null&&(r=n._retryCache=new xv),r;default:throw Error(s(435,n.tag))}}function ql(n,r){var i=M1(n);r.forEach(function(l){if(!i.has(l)){i.add(l);var f=H1.bind(null,n,l);l.then(f,f)}})}function Gt(n,r){var i=r.deletions;if(i!==null)for(var l=0;l<i.length;l++){var f=i[l],m=n,w=r,T=w;e:for(;T!==null;){switch(T.tag){case 27:if(ta(T.type)){et=T.stateNode,qt=!1;break e}break;case 5:et=T.stateNode,qt=!1;break e;case 3:case 4:et=T.stateNode.containerInfo,qt=!0;break e}T=T.return}if(et===null)throw Error(s(160));Cv(m,w,f),et=null,qt=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Nv(r,n),r=r.sibling}var An=null;function Nv(n,r){var i=n.alternate,l=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Gt(r,n),Vt(n),l&4&&(Fr(3,n,n.return),Xi(3,n),Fr(5,n,n.return));break;case 1:Gt(r,n),Vt(n),l&512&&(ft||i===null||qn(i,i.return)),l&64&&mr&&(n=n.updateQueue,n!==null&&(l=n.callbacks,l!==null&&(i=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=i===null?l:i.concat(l))));break;case 26:var f=An;if(Gt(r,n),Vt(n),l&512&&(ft||i===null||qn(i,i.return)),l&4){var m=i!==null?i.memoizedState:null;if(l=n.memoizedState,i===null)if(l===null)if(n.stateNode===null){e:{l=n.type,i=n.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":m=f.getElementsByTagName("title")[0],(!m||m[Ei]||m[_t]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(l),f.head.insertBefore(m,f.querySelector("head > title"))),Ct(m,l,i),m[_t]=n,bt(m),l=m;break e;case"link":var w=Ny("link","href",f).get(l+(i.href||""));if(w){for(var T=0;T<w.length;T++)if(m=w[T],m.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&m.getAttribute("rel")===(i.rel==null?null:i.rel)&&m.getAttribute("title")===(i.title==null?null:i.title)&&m.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){w.splice(T,1);break t}}m=f.createElement(l),Ct(m,l,i),f.head.appendChild(m);break;case"meta":if(w=Ny("meta","content",f).get(l+(i.content||""))){for(T=0;T<w.length;T++)if(m=w[T],m.getAttribute("content")===(i.content==null?null:""+i.content)&&m.getAttribute("name")===(i.name==null?null:i.name)&&m.getAttribute("property")===(i.property==null?null:i.property)&&m.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&m.getAttribute("charset")===(i.charSet==null?null:i.charSet)){w.splice(T,1);break t}}m=f.createElement(l),Ct(m,l,i),f.head.appendChild(m);break;default:throw Error(s(468,l))}m[_t]=n,bt(m),l=m}n.stateNode=l}else Oy(f,n.type,n.stateNode);else n.stateNode=Ay(f,l,n.memoizedProps);else m!==l?(m===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):m.count--,l===null?Oy(f,n.type,n.stateNode):Ay(f,l,n.memoizedProps)):l===null&&n.stateNode!==null&&uf(n,n.memoizedProps,i.memoizedProps)}break;case 27:Gt(r,n),Vt(n),l&512&&(ft||i===null||qn(i,i.return)),i!==null&&l&4&&uf(n,n.memoizedProps,i.memoizedProps);break;case 5:if(Gt(r,n),Vt(n),l&512&&(ft||i===null||qn(i,i.return)),n.flags&32){f=n.stateNode;try{fs(f,"")}catch(he){He(n,n.return,he)}}l&4&&n.stateNode!=null&&(f=n.memoizedProps,uf(n,f,i!==null?i.memoizedProps:f)),l&1024&&(hf=!0);break;case 6:if(Gt(r,n),Vt(n),l&4){if(n.stateNode===null)throw Error(s(162));l=n.memoizedProps,i=n.stateNode;try{i.nodeValue=l}catch(he){He(n,n.return,he)}}break;case 3:if(sc=null,f=An,An=rc(r.containerInfo),Gt(r,n),An=f,Vt(n),l&4&&i!==null&&i.memoizedState.isDehydrated)try{qs(r.containerInfo)}catch(he){He(n,n.return,he)}hf&&(hf=!1,Ov(n));break;case 4:l=An,An=rc(n.stateNode.containerInfo),Gt(r,n),Vt(n),An=l;break;case 12:Gt(r,n),Vt(n);break;case 31:Gt(r,n),Vt(n),l&4&&(l=n.updateQueue,l!==null&&(n.updateQueue=null,ql(n,l)));break;case 13:Gt(r,n),Vt(n),n.child.flags&8192&&n.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Vl=Dt()),l&4&&(l=n.updateQueue,l!==null&&(n.updateQueue=null,ql(n,l)));break;case 22:f=n.memoizedState!==null;var k=i!==null&&i.memoizedState!==null,P=mr,Y=ft;if(mr=P||f,ft=Y||k,Gt(r,n),ft=Y,mr=P,Vt(n),l&8192)e:for(r=n.stateNode,r._visibility=f?r._visibility&-2:r._visibility|1,f&&(i===null||k||mr||ft||Ba(n)),i=null,r=n;;){if(r.tag===5||r.tag===26){if(i===null){k=i=r;try{if(m=k.stateNode,f)w=m.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{T=k.stateNode;var Q=k.memoizedProps.style,B=Q!=null&&Q.hasOwnProperty("display")?Q.display:null;T.style.display=B==null||typeof B=="boolean"?"":(""+B).trim()}}catch(he){He(k,k.return,he)}}}else if(r.tag===6){if(i===null){k=r;try{k.stateNode.nodeValue=f?"":k.memoizedProps}catch(he){He(k,k.return,he)}}}else if(r.tag===18){if(i===null){k=r;try{var H=k.stateNode;f?by(H,!0):by(k.stateNode,!1)}catch(he){He(k,k.return,he)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===n)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===n)break e;for(;r.sibling===null;){if(r.return===null||r.return===n)break e;i===r&&(i=null),r=r.return}i===r&&(i=null),r.sibling.return=r.return,r=r.sibling}l&4&&(l=n.updateQueue,l!==null&&(i=l.retryQueue,i!==null&&(l.retryQueue=null,ql(n,i))));break;case 19:Gt(r,n),Vt(n),l&4&&(l=n.updateQueue,l!==null&&(n.updateQueue=null,ql(n,l)));break;case 30:break;case 21:break;default:Gt(r,n),Vt(n)}}function Vt(n){var r=n.flags;if(r&2){try{for(var i,l=n.return;l!==null;){if(Sv(l)){i=l;break}l=l.return}if(i==null)throw Error(s(160));switch(i.tag){case 27:var f=i.stateNode,m=df(n);Hl(n,m,f);break;case 5:var w=i.stateNode;i.flags&32&&(fs(w,""),i.flags&=-33);var T=df(n);Hl(n,T,w);break;case 3:case 4:var k=i.stateNode.containerInfo,P=df(n);ff(n,P,k);break;default:throw Error(s(161))}}catch(Y){He(n,n.return,Y)}n.flags&=-3}r&4096&&(n.flags&=-4097)}function Ov(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var r=n;Ov(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),n=n.sibling}}function gr(n,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Ev(n,r.alternate,r),r=r.sibling}function Ba(n){for(n=n.child;n!==null;){var r=n;switch(r.tag){case 0:case 11:case 14:case 15:Fr(4,r,r.return),Ba(r);break;case 1:qn(r,r.return);var i=r.stateNode;typeof i.componentWillUnmount=="function"&&bv(r,r.return,i),Ba(r);break;case 27:io(r.stateNode);case 26:case 5:qn(r,r.return),Ba(r);break;case 22:r.memoizedState===null&&Ba(r);break;case 30:Ba(r);break;default:Ba(r)}n=n.sibling}}function vr(n,r,i){for(i=i&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var l=r.alternate,f=n,m=r,w=m.flags;switch(m.tag){case 0:case 11:case 15:vr(f,m,i),Xi(4,m);break;case 1:if(vr(f,m,i),l=m,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(P){He(l,l.return,P)}if(l=m,f=l.updateQueue,f!==null){var T=l.stateNode;try{var k=f.shared.hiddenCallbacks;if(k!==null)for(f.shared.hiddenCallbacks=null,f=0;f<k.length;f++)og(k[f],T)}catch(P){He(l,l.return,P)}}i&&w&64&&yv(m),Ji(m,m.return);break;case 27:_v(m);case 26:case 5:vr(f,m,i),i&&l===null&&w&4&&wv(m),Ji(m,m.return);break;case 12:vr(f,m,i);break;case 31:vr(f,m,i),i&&w&4&&Rv(f,m);break;case 13:vr(f,m,i),i&&w&4&&Av(f,m);break;case 22:m.memoizedState===null&&vr(f,m,i),Ji(m,m.return);break;case 30:break;default:vr(f,m,i)}r=r.sibling}}function mf(n,r){var i=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),n=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(n=r.memoizedState.cachePool.pool),n!==i&&(n!=null&&n.refCount++,i!=null&&zi(i))}function pf(n,r){n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&zi(n))}function Nn(n,r,i,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)kv(n,r,i,l),r=r.sibling}function kv(n,r,i,l){var f=r.flags;switch(r.tag){case 0:case 11:case 15:Nn(n,r,i,l),f&2048&&Xi(9,r);break;case 1:Nn(n,r,i,l);break;case 3:Nn(n,r,i,l),f&2048&&(n=null,r.alternate!==null&&(n=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==n&&(r.refCount++,n!=null&&zi(n)));break;case 12:if(f&2048){Nn(n,r,i,l),n=r.stateNode;try{var m=r.memoizedProps,w=m.id,T=m.onPostCommit;typeof T=="function"&&T(w,r.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(k){He(r,r.return,k)}}else Nn(n,r,i,l);break;case 31:Nn(n,r,i,l);break;case 13:Nn(n,r,i,l);break;case 23:break;case 22:m=r.stateNode,w=r.alternate,r.memoizedState!==null?m._visibility&2?Nn(n,r,i,l):Qi(n,r):m._visibility&2?Nn(n,r,i,l):(m._visibility|=2,js(n,r,i,l,(r.subtreeFlags&10256)!==0||!1)),f&2048&&mf(w,r);break;case 24:Nn(n,r,i,l),f&2048&&pf(r.alternate,r);break;default:Nn(n,r,i,l)}}function js(n,r,i,l,f){for(f=f&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var m=n,w=r,T=i,k=l,P=w.flags;switch(w.tag){case 0:case 11:case 15:js(m,w,T,k,f),Xi(8,w);break;case 23:break;case 22:var Y=w.stateNode;w.memoizedState!==null?Y._visibility&2?js(m,w,T,k,f):Qi(m,w):(Y._visibility|=2,js(m,w,T,k,f)),f&&P&2048&&mf(w.alternate,w);break;case 24:js(m,w,T,k,f),f&&P&2048&&pf(w.alternate,w);break;default:js(m,w,T,k,f)}r=r.sibling}}function Qi(n,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var i=n,l=r,f=l.flags;switch(l.tag){case 22:Qi(i,l),f&2048&&mf(l.alternate,l);break;case 24:Qi(i,l),f&2048&&pf(l.alternate,l);break;default:Qi(i,l)}r=r.sibling}}var Zi=8192;function Ms(n,r,i){if(n.subtreeFlags&Zi)for(n=n.child;n!==null;)jv(n,r,i),n=n.sibling}function jv(n,r,i){switch(n.tag){case 26:Ms(n,r,i),n.flags&Zi&&n.memoizedState!==null&&bT(i,An,n.memoizedState,n.memoizedProps);break;case 5:Ms(n,r,i);break;case 3:case 4:var l=An;An=rc(n.stateNode.containerInfo),Ms(n,r,i),An=l;break;case 22:n.memoizedState===null&&(l=n.alternate,l!==null&&l.memoizedState!==null?(l=Zi,Zi=16777216,Ms(n,r,i),Zi=l):Ms(n,r,i));break;default:Ms(n,r,i)}}function Mv(n){var r=n.alternate;if(r!==null&&(n=r.child,n!==null)){r.child=null;do r=n.sibling,n.sibling=null,n=r;while(n!==null)}}function eo(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var l=r[i];wt=l,Lv(l,n)}Mv(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Dv(n),n=n.sibling}function Dv(n){switch(n.tag){case 0:case 11:case 15:eo(n),n.flags&2048&&Fr(9,n,n.return);break;case 3:eo(n);break;case 12:eo(n);break;case 22:var r=n.stateNode;n.memoizedState!==null&&r._visibility&2&&(n.return===null||n.return.tag!==13)?(r._visibility&=-3,Gl(n)):eo(n);break;default:eo(n)}}function Gl(n){var r=n.deletions;if((n.flags&16)!==0){if(r!==null)for(var i=0;i<r.length;i++){var l=r[i];wt=l,Lv(l,n)}Mv(n)}for(n=n.child;n!==null;){switch(r=n,r.tag){case 0:case 11:case 15:Fr(8,r,r.return),Gl(r);break;case 22:i=r.stateNode,i._visibility&2&&(i._visibility&=-3,Gl(r));break;default:Gl(r)}n=n.sibling}}function Lv(n,r){for(;wt!==null;){var i=wt;switch(i.tag){case 0:case 11:case 15:Fr(8,i,r);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var l=i.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:zi(i.memoizedState.cache)}if(l=i.child,l!==null)l.return=i,wt=l;else e:for(i=n;wt!==null;){l=wt;var f=l.sibling,m=l.return;if(Tv(l),l===i){wt=null;break e}if(f!==null){f.return=m,wt=f;break e}wt=m}}}var D1={getCacheForType:function(n){var r=Et(ct),i=r.data.get(n);return i===void 0&&(i=n(),r.data.set(n,i)),i},cacheSignal:function(){return Et(ct).controller.signal}},L1=typeof WeakMap=="function"?WeakMap:Map,Ie=0,Ye=null,ke=null,Me=0,$e=0,tn=null,Wr=!1,Ds=!1,gf=!1,yr=0,st=0,Xr=0,Ia=0,vf=0,nn=0,Ls=0,to=null,Kt=null,yf=!1,Vl=0,Uv=0,Kl=1/0,Yl=null,Jr=null,mt=0,Qr=null,Us=null,br=0,bf=0,wf=null,zv=null,no=0,Sf=null;function rn(){return(Ie&2)!==0&&Me!==0?Me&-Me:O.T!==null?Rf():Iu()}function Pv(){if(nn===0)if((Me&536870912)===0||Ue){var n=as;as<<=1,(as&3932160)===0&&(as=262144),nn=n}else nn=536870912;return n=Zt.current,n!==null&&(n.flags|=32),nn}function Yt(n,r,i){(n===Ye&&($e===2||$e===9)||n.cancelPendingCommit!==null)&&(zs(n,0),Zr(n,Me,nn,!1)),tt(n,i),((Ie&2)===0||n!==Ye)&&(n===Ye&&((Ie&2)===0&&(Ia|=i),st===4&&Zr(n,Me,nn,!1)),Gn(n))}function Bv(n,r,i){if((Ie&6)!==0)throw Error(s(327));var l=!i&&(r&127)===0&&(r&n.expiredLanes)===0||Ze(n,r),f=l?P1(n,r):xf(n,r,!0),m=l;do{if(f===0){Ds&&!l&&Zr(n,r,0,!1);break}else{if(i=n.current.alternate,m&&!U1(i)){f=xf(n,r,!1),m=!1;continue}if(f===2){if(m=r,n.errorRecoveryDisabledLanes&m)var w=0;else w=n.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){r=w;e:{var T=n;f=to;var k=T.current.memoizedState.isDehydrated;if(k&&(zs(T,w).flags|=256),w=xf(T,w,!1),w!==2){if(gf&&!k){T.errorRecoveryDisabledLanes|=m,Ia|=m,f=4;break e}m=Kt,Kt=f,m!==null&&(Kt===null?Kt=m:Kt.push.apply(Kt,m))}f=w}if(m=!1,f!==2)continue}}if(f===1){zs(n,0),Zr(n,r,0,!0);break}e:{switch(l=n,m=f,m){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:Zr(l,r,nn,!Wr);break e;case 2:Kt=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(f=Vl+300-Dt(),10<f)){if(Zr(l,r,nn,!Wr),xe(l,0,!0)!==0)break e;br=r,l.timeoutHandle=gy(Iv.bind(null,l,i,Kt,Yl,yf,r,nn,Ia,Ls,Wr,m,"Throttled",-0,0),f);break e}Iv(l,i,Kt,Yl,yf,r,nn,Ia,Ls,Wr,m,null,-0,0)}}break}while(!0);Gn(n)}function Iv(n,r,i,l,f,m,w,T,k,P,Y,Q,B,H){if(n.timeoutHandle=-1,Q=r.subtreeFlags,Q&8192||(Q&16785408)===16785408){Q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ar},jv(r,m,Q);var he=(m&62914560)===m?Vl-Dt():(m&4194048)===m?Uv-Dt():0;if(he=wT(Q,he),he!==null){br=m,n.cancelPendingCommit=he(Fv.bind(null,n,r,m,i,l,f,w,T,k,Y,Q,null,B,H)),Zr(n,m,w,!P);return}}Fv(n,r,m,i,l,f,w,T,k)}function U1(n){for(var r=n;;){var i=r.tag;if((i===0||i===11||i===15)&&r.flags&16384&&(i=r.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var l=0;l<i.length;l++){var f=i[l],m=f.getSnapshot;f=f.value;try{if(!Jt(m(),f))return!1}catch{return!1}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===n)break;for(;r.sibling===null;){if(r.return===null||r.return===n)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Zr(n,r,i,l){r&=~vf,r&=~Ia,n.suspendedLanes|=r,n.pingedLanes&=~r,l&&(n.warmLanes|=r),l=n.expirationTimes;for(var f=r;0<f;){var m=31-Nt(f),w=1<<m;l[m]=-1,f&=~w}i!==0&&xa(n,i,r)}function Fl(){return(Ie&6)===0?(ro(0),!1):!0}function _f(){if(ke!==null){if($e===0)var n=ke.return;else n=ke,lr=ka=null,zd(n),Rs=null,Bi=0,n=ke;for(;n!==null;)vv(n.alternate,n),n=n.return;ke=null}}function zs(n,r){var i=n.timeoutHandle;i!==-1&&(n.timeoutHandle=-1,nT(i)),i=n.cancelPendingCommit,i!==null&&(n.cancelPendingCommit=null,i()),br=0,_f(),Ye=n,ke=i=ir(n.current,null),Me=r,$e=0,tn=null,Wr=!1,Ds=Ze(n,r),gf=!1,Ls=nn=vf=Ia=Xr=st=0,Kt=to=null,yf=!1,(r&8)!==0&&(r|=r&32);var l=n.entangledLanes;if(l!==0)for(n=n.entanglements,l&=r;0<l;){var f=31-Nt(l),m=1<<f;r|=n[f],l&=~m}return yr=r,pl(),i}function $v(n,r){Ae=null,O.H=Yi,r===Cs||r===xl?(r=rg(),$e=3):r===Td?(r=rg(),$e=4):$e=r===Zd?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,tn=r,ke===null&&(st=1,zl(n,hn(r,n.current)))}function Hv(){var n=Zt.current;return n===null?!0:(Me&4194048)===Me?vn===null:(Me&62914560)===Me||(Me&536870912)!==0?n===vn:!1}function qv(){var n=O.H;return O.H=Yi,n===null?Yi:n}function Gv(){var n=O.A;return O.A=D1,n}function Wl(){st=4,Wr||(Me&4194048)!==Me&&Zt.current!==null||(Ds=!0),(Xr&134217727)===0&&(Ia&134217727)===0||Ye===null||Zr(Ye,Me,nn,!1)}function xf(n,r,i){var l=Ie;Ie|=2;var f=qv(),m=Gv();(Ye!==n||Me!==r)&&(Yl=null,zs(n,r)),r=!1;var w=st;e:do try{if($e!==0&&ke!==null){var T=ke,k=tn;switch($e){case 8:_f(),w=6;break e;case 3:case 2:case 9:case 6:Zt.current===null&&(r=!0);var P=$e;if($e=0,tn=null,Ps(n,T,k,P),i&&Ds){w=0;break e}break;default:P=$e,$e=0,tn=null,Ps(n,T,k,P)}}z1(),w=st;break}catch(Y){$v(n,Y)}while(!0);return r&&n.shellSuspendCounter++,lr=ka=null,Ie=l,O.H=f,O.A=m,ke===null&&(Ye=null,Me=0,pl()),w}function z1(){for(;ke!==null;)Vv(ke)}function P1(n,r){var i=Ie;Ie|=2;var l=qv(),f=Gv();Ye!==n||Me!==r?(Yl=null,Kl=Dt()+500,zs(n,r)):Ds=Ze(n,r);e:do try{if($e!==0&&ke!==null){r=ke;var m=tn;t:switch($e){case 1:$e=0,tn=null,Ps(n,r,m,1);break;case 2:case 9:if(tg(m)){$e=0,tn=null,Kv(r);break}r=function(){$e!==2&&$e!==9||Ye!==n||($e=7),Gn(n)},m.then(r,r);break e;case 3:$e=7;break e;case 4:$e=5;break e;case 7:tg(m)?($e=0,tn=null,Kv(r)):($e=0,tn=null,Ps(n,r,m,7));break;case 5:var w=null;switch(ke.tag){case 26:w=ke.memoizedState;case 5:case 27:var T=ke;if(w?ky(w):T.stateNode.complete){$e=0,tn=null;var k=T.sibling;if(k!==null)ke=k;else{var P=T.return;P!==null?(ke=P,Xl(P)):ke=null}break t}}$e=0,tn=null,Ps(n,r,m,5);break;case 6:$e=0,tn=null,Ps(n,r,m,6);break;case 8:_f(),st=6;break e;default:throw Error(s(462))}}B1();break}catch(Y){$v(n,Y)}while(!0);return lr=ka=null,O.H=l,O.A=f,Ie=i,ke!==null?0:(Ye=null,Me=0,pl(),st)}function B1(){for(;ke!==null&&!Mt();)Vv(ke)}function Vv(n){var r=pv(n.alternate,n,yr);n.memoizedProps=n.pendingProps,r===null?Xl(n):ke=r}function Kv(n){var r=n,i=r.alternate;switch(r.tag){case 15:case 0:r=cv(i,r,r.pendingProps,r.type,void 0,Me);break;case 11:r=cv(i,r,r.pendingProps,r.type.render,r.ref,Me);break;case 5:zd(r);default:vv(i,r),r=ke=Gp(r,yr),r=pv(i,r,yr)}n.memoizedProps=n.pendingProps,r===null?Xl(n):ke=r}function Ps(n,r,i,l){lr=ka=null,zd(r),Rs=null,Bi=0;var f=r.return;try{if(R1(n,f,r,i,Me)){st=1,zl(n,hn(i,n.current)),ke=null;return}}catch(m){if(f!==null)throw ke=f,m;st=1,zl(n,hn(i,n.current)),ke=null;return}r.flags&32768?(Ue||l===1?n=!0:Ds||(Me&536870912)!==0?n=!1:(Wr=n=!0,(l===2||l===9||l===3||l===6)&&(l=Zt.current,l!==null&&l.tag===13&&(l.flags|=16384))),Yv(r,n)):Xl(r)}function Xl(n){var r=n;do{if((r.flags&32768)!==0){Yv(r,Wr);return}n=r.return;var i=O1(r.alternate,r,yr);if(i!==null){ke=i;return}if(r=r.sibling,r!==null){ke=r;return}ke=r=n}while(r!==null);st===0&&(st=5)}function Yv(n,r){do{var i=k1(n.alternate,n);if(i!==null){i.flags&=32767,ke=i;return}if(i=n.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!r&&(n=n.sibling,n!==null)){ke=n;return}ke=n=i}while(n!==null);st=6,ke=null}function Fv(n,r,i,l,f,m,w,T,k){n.cancelPendingCommit=null;do Jl();while(mt!==0);if((Ie&6)!==0)throw Error(s(327));if(r!==null){if(r===n.current)throw Error(s(177));if(m=r.lanes|r.childLanes,m|=ud,Pt(n,i,m,w,T,k),n===Ye&&(ke=Ye=null,Me=0),Us=r,Qr=n,br=i,bf=m,wf=f,zv=l,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,q1(wa,function(){return Zv(),null})):(n.callbackNode=null,n.callbackPriority=0),l=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||l){l=O.T,O.T=null,f=$.p,$.p=2,w=Ie,Ie|=4;try{j1(n,r,i)}finally{Ie=w,$.p=f,O.T=l}}mt=1,Wv(),Xv(),Jv()}}function Wv(){if(mt===1){mt=0;var n=Qr,r=Us,i=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||i){i=O.T,O.T=null;var l=$.p;$.p=2;var f=Ie;Ie|=4;try{Nv(r,n);var m=Lf,w=Lp(n.containerInfo),T=m.focusedElem,k=m.selectionRange;if(w!==T&&T&&T.ownerDocument&&Dp(T.ownerDocument.documentElement,T)){if(k!==null&&sd(T)){var P=k.start,Y=k.end;if(Y===void 0&&(Y=P),"selectionStart"in T)T.selectionStart=P,T.selectionEnd=Math.min(Y,T.value.length);else{var Q=T.ownerDocument||document,B=Q&&Q.defaultView||window;if(B.getSelection){var H=B.getSelection(),he=T.textContent.length,Se=Math.min(k.start,he),Ve=k.end===void 0?Se:Math.min(k.end,he);!H.extend&&Se>Ve&&(w=Ve,Ve=Se,Se=w);var L=Mp(T,Se),M=Mp(T,Ve);if(L&&M&&(H.rangeCount!==1||H.anchorNode!==L.node||H.anchorOffset!==L.offset||H.focusNode!==M.node||H.focusOffset!==M.offset)){var z=Q.createRange();z.setStart(L.node,L.offset),H.removeAllRanges(),Se>Ve?(H.addRange(z),H.extend(M.node,M.offset)):(z.setEnd(M.node,M.offset),H.addRange(z))}}}}for(Q=[],H=T;H=H.parentNode;)H.nodeType===1&&Q.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<Q.length;T++){var X=Q[T];X.element.scrollLeft=X.left,X.element.scrollTop=X.top}}cc=!!Df,Lf=Df=null}finally{Ie=f,$.p=l,O.T=i}}n.current=r,mt=2}}function Xv(){if(mt===2){mt=0;var n=Qr,r=Us,i=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||i){i=O.T,O.T=null;var l=$.p;$.p=2;var f=Ie;Ie|=4;try{Ev(n,r.alternate,r)}finally{Ie=f,$.p=l,O.T=i}}mt=3}}function Jv(){if(mt===4||mt===3){mt=0,Dr();var n=Qr,r=Us,i=br,l=zv;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?mt=5:(mt=0,Us=Qr=null,Qv(n,n.pendingLanes));var f=n.pendingLanes;if(f===0&&(Jr=null),Cn(i),r=r.stateNode,Lt&&typeof Lt.onCommitFiberRoot=="function")try{Lt.onCommitFiberRoot(Sa,r,void 0,(r.current.flags&128)===128)}catch{}if(l!==null){r=O.T,f=$.p,$.p=2,O.T=null;try{for(var m=n.onRecoverableError,w=0;w<l.length;w++){var T=l[w];m(T.value,{componentStack:T.stack})}}finally{O.T=r,$.p=f}}(br&3)!==0&&Jl(),Gn(n),f=n.pendingLanes,(i&261930)!==0&&(f&42)!==0?n===Sf?no++:(no=0,Sf=n):no=0,ro(0)}}function Qv(n,r){(n.pooledCacheLanes&=r)===0&&(r=n.pooledCache,r!=null&&(n.pooledCache=null,zi(r)))}function Jl(){return Wv(),Xv(),Jv(),Zv()}function Zv(){if(mt!==5)return!1;var n=Qr,r=bf;bf=0;var i=Cn(br),l=O.T,f=$.p;try{$.p=32>i?32:i,O.T=null,i=wf,wf=null;var m=Qr,w=br;if(mt=0,Us=Qr=null,br=0,(Ie&6)!==0)throw Error(s(331));var T=Ie;if(Ie|=4,Dv(m.current),kv(m,m.current,w,i),Ie=T,ro(0,!1),Lt&&typeof Lt.onPostCommitFiberRoot=="function")try{Lt.onPostCommitFiberRoot(Sa,m)}catch{}return!0}finally{$.p=f,O.T=l,Qv(n,r)}}function ey(n,r,i){r=hn(i,r),r=Qd(n.stateNode,r,2),n=Vr(n,r,2),n!==null&&(tt(n,2),Gn(n))}function He(n,r,i){if(n.tag===3)ey(n,n,i);else for(;r!==null;){if(r.tag===3){ey(r,n,i);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Jr===null||!Jr.has(l))){n=hn(i,n),i=tv(2),l=Vr(r,i,2),l!==null&&(nv(i,l,r,n),tt(l,2),Gn(l));break}}r=r.return}}function Ef(n,r,i){var l=n.pingCache;if(l===null){l=n.pingCache=new L1;var f=new Set;l.set(r,f)}else f=l.get(r),f===void 0&&(f=new Set,l.set(r,f));f.has(i)||(gf=!0,f.add(i),n=I1.bind(null,n,r,i),r.then(n,n))}function I1(n,r,i){var l=n.pingCache;l!==null&&l.delete(r),n.pingedLanes|=n.suspendedLanes&i,n.warmLanes&=~i,Ye===n&&(Me&i)===i&&(st===4||st===3&&(Me&62914560)===Me&&300>Dt()-Vl?(Ie&2)===0&&zs(n,0):vf|=i,Ls===Me&&(Ls=0)),Gn(n)}function ty(n,r){r===0&&(r=Ot()),n=Aa(n,r),n!==null&&(tt(n,r),Gn(n))}function $1(n){var r=n.memoizedState,i=0;r!==null&&(i=r.retryLane),ty(n,i)}function H1(n,r){var i=0;switch(n.tag){case 31:case 13:var l=n.stateNode,f=n.memoizedState;f!==null&&(i=f.retryLane);break;case 19:l=n.stateNode;break;case 22:l=n.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(r),ty(n,i)}function q1(n,r){return wi(n,r)}var Ql=null,Bs=null,Tf=!1,Zl=!1,Cf=!1,ea=0;function Gn(n){n!==Bs&&n.next===null&&(Bs===null?Ql=Bs=n:Bs=Bs.next=n),Zl=!0,Tf||(Tf=!0,V1())}function ro(n,r){if(!Cf&&Zl){Cf=!0;do for(var i=!1,l=Ql;l!==null;){if(n!==0){var f=l.pendingLanes;if(f===0)var m=0;else{var w=l.suspendedLanes,T=l.pingedLanes;m=(1<<31-Nt(42|n)+1)-1,m&=f&~(w&~T),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(i=!0,sy(l,m))}else m=Me,m=xe(l,l===Ye?m:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(m&3)===0||Ze(l,m)||(i=!0,sy(l,m));l=l.next}while(i);Cf=!1}}function G1(){ny()}function ny(){Zl=Tf=!1;var n=0;ea!==0&&tT()&&(n=ea);for(var r=Dt(),i=null,l=Ql;l!==null;){var f=l.next,m=ry(l,r);m===0?(l.next=null,i===null?Ql=f:i.next=f,f===null&&(Bs=i)):(i=l,(n!==0||(m&3)!==0)&&(Zl=!0)),l=f}mt!==0&&mt!==5||ro(n),ea!==0&&(ea=0)}function ry(n,r){for(var i=n.suspendedLanes,l=n.pingedLanes,f=n.expirationTimes,m=n.pendingLanes&-62914561;0<m;){var w=31-Nt(m),T=1<<w,k=f[w];k===-1?((T&i)===0||(T&l)!==0)&&(f[w]=yt(T,r)):k<=r&&(n.expiredLanes|=T),m&=~T}if(r=Ye,i=Me,i=xe(n,n===r?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l=n.callbackNode,i===0||n===r&&($e===2||$e===9)||n.cancelPendingCommit!==null)return l!==null&&l!==null&&Si(l),n.callbackNode=null,n.callbackPriority=0;if((i&3)===0||Ze(n,i)){if(r=i&-i,r===n.callbackPriority)return r;switch(l!==null&&Si(l),Cn(i)){case 2:case 8:i=nl;break;case 32:i=wa;break;case 268435456:i=nr;break;default:i=wa}return l=ay.bind(null,n),i=wi(i,l),n.callbackPriority=r,n.callbackNode=i,r}return l!==null&&l!==null&&Si(l),n.callbackPriority=2,n.callbackNode=null,2}function ay(n,r){if(mt!==0&&mt!==5)return n.callbackNode=null,n.callbackPriority=0,null;var i=n.callbackNode;if(Jl()&&n.callbackNode!==i)return null;var l=Me;return l=xe(n,n===Ye?l:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),l===0?null:(Bv(n,l,r),ry(n,Dt()),n.callbackNode!=null&&n.callbackNode===i?ay.bind(null,n):null)}function sy(n,r){if(Jl())return null;Bv(n,r,!0)}function V1(){rT(function(){(Ie&6)!==0?wi(ba,G1):ny()})}function Rf(){if(ea===0){var n=Es;n===0&&(n=rs,rs<<=1,(rs&261888)===0&&(rs=256)),ea=n}return ea}function iy(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:ol(""+n)}function oy(n,r){var i=r.ownerDocument.createElement("input");return i.name=r.name,i.value=r.value,n.id&&i.setAttribute("form",n.id),r.parentNode.insertBefore(i,r),n=new FormData(n),i.parentNode.removeChild(i),n}function K1(n,r,i,l,f){if(r==="submit"&&i&&i.stateNode===f){var m=iy((f[$t]||null).action),w=l.submitter;w&&(r=(r=w[$t]||null)?iy(r.formAction):w.getAttribute("formAction"),r!==null&&(m=r,w=null));var T=new dl("action","action",null,l,f);n.push({event:T,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(ea!==0){var k=w?oy(f,w):new FormData(f);Kd(i,{pending:!0,data:k,method:f.method,action:m},null,k)}}else typeof m=="function"&&(T.preventDefault(),k=w?oy(f,w):new FormData(f),Kd(i,{pending:!0,data:k,method:f.method,action:m},m,k))},currentTarget:f}]})}}for(var Af=0;Af<cd.length;Af++){var Nf=cd[Af],Y1=Nf.toLowerCase(),F1=Nf[0].toUpperCase()+Nf.slice(1);Rn(Y1,"on"+F1)}Rn(Pp,"onAnimationEnd"),Rn(Bp,"onAnimationIteration"),Rn(Ip,"onAnimationStart"),Rn("dblclick","onDoubleClick"),Rn("focusin","onFocus"),Rn("focusout","onBlur"),Rn(u1,"onTransitionRun"),Rn(d1,"onTransitionStart"),Rn(f1,"onTransitionCancel"),Rn($p,"onTransitionEnd"),us("onMouseEnter",["mouseout","mouseover"]),us("onMouseLeave",["mouseout","mouseover"]),us("onPointerEnter",["pointerout","pointerover"]),us("onPointerLeave",["pointerout","pointerover"]),Ea("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ea("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ea("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ea("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ea("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ea("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ao="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(" "),W1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ao));function ly(n,r){r=(r&4)!==0;for(var i=0;i<n.length;i++){var l=n[i],f=l.event;l=l.listeners;e:{var m=void 0;if(r)for(var w=l.length-1;0<=w;w--){var T=l[w],k=T.instance,P=T.currentTarget;if(T=T.listener,k!==m&&f.isPropagationStopped())break e;m=T,f.currentTarget=P;try{m(f)}catch(Y){ml(Y)}f.currentTarget=null,m=k}else for(w=0;w<l.length;w++){if(T=l[w],k=T.instance,P=T.currentTarget,T=T.listener,k!==m&&f.isPropagationStopped())break e;m=T,f.currentTarget=P;try{m(f)}catch(Y){ml(Y)}f.currentTarget=null,m=k}}}}function je(n,r){var i=r[$u];i===void 0&&(i=r[$u]=new Set);var l=n+"__bubble";i.has(l)||(cy(r,n,2,!1),i.add(l))}function Of(n,r,i){var l=0;r&&(l|=4),cy(i,n,l,r)}var ec="_reactListening"+Math.random().toString(36).slice(2);function kf(n){if(!n[ec]){n[ec]=!0,np.forEach(function(i){i!=="selectionchange"&&(W1.has(i)||Of(i,!1,n),Of(i,!0,n))});var r=n.nodeType===9?n:n.ownerDocument;r===null||r[ec]||(r[ec]=!0,Of("selectionchange",!1,r))}}function cy(n,r,i,l){switch(Py(r)){case 2:var f=xT;break;case 8:f=ET;break;default:f=Kf}i=f.bind(null,r,i,n),f=void 0,!Xu||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(f=!0),l?f!==void 0?n.addEventListener(r,i,{capture:!0,passive:f}):n.addEventListener(r,i,!0):f!==void 0?n.addEventListener(r,i,{passive:f}):n.addEventListener(r,i,!1)}function jf(n,r,i,l,f){var m=l;if((r&1)===0&&(r&2)===0&&l!==null)e:for(;;){if(l===null)return;var w=l.tag;if(w===3||w===4){var T=l.stateNode.containerInfo;if(T===f)break;if(w===4)for(w=l.return;w!==null;){var k=w.tag;if((k===3||k===4)&&w.stateNode.containerInfo===f)return;w=w.return}for(;T!==null;){if(w=os(T),w===null)return;if(k=w.tag,k===5||k===6||k===26||k===27){l=m=w;continue e}T=T.parentNode}}l=l.return}mp(function(){var P=m,Y=Fu(i),Q=[];e:{var B=Hp.get(n);if(B!==void 0){var H=dl,he=n;switch(n){case"keypress":if(cl(i)===0)break e;case"keydown":case"keyup":H=HE;break;case"focusin":he="focus",H=ed;break;case"focusout":he="blur",H=ed;break;case"beforeblur":case"afterblur":H=ed;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":H=vp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":H=OE;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":H=VE;break;case Pp:case Bp:case Ip:H=ME;break;case $p:H=YE;break;case"scroll":case"scrollend":H=AE;break;case"wheel":H=WE;break;case"copy":case"cut":case"paste":H=LE;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":H=bp;break;case"toggle":case"beforetoggle":H=JE}var Se=(r&4)!==0,Ve=!Se&&(n==="scroll"||n==="scrollend"),L=Se?B!==null?B+"Capture":null:B;Se=[];for(var M=P,z;M!==null;){var X=M;if(z=X.stateNode,X=X.tag,X!==5&&X!==26&&X!==27||z===null||L===null||(X=Ci(M,L),X!=null&&Se.push(so(M,X,z))),Ve)break;M=M.return}0<Se.length&&(B=new H(B,he,null,i,Y),Q.push({event:B,listeners:Se}))}}if((r&7)===0){e:{if(B=n==="mouseover"||n==="pointerover",H=n==="mouseout"||n==="pointerout",B&&i!==Yu&&(he=i.relatedTarget||i.fromElement)&&(os(he)||he[is]))break e;if((H||B)&&(B=Y.window===Y?Y:(B=Y.ownerDocument)?B.defaultView||B.parentWindow:window,H?(he=i.relatedTarget||i.toElement,H=P,he=he?os(he):null,he!==null&&(Ve=c(he),Se=he.tag,he!==Ve||Se!==5&&Se!==27&&Se!==6)&&(he=null)):(H=null,he=P),H!==he)){if(Se=vp,X="onMouseLeave",L="onMouseEnter",M="mouse",(n==="pointerout"||n==="pointerover")&&(Se=bp,X="onPointerLeave",L="onPointerEnter",M="pointer"),Ve=H==null?B:Ti(H),z=he==null?B:Ti(he),B=new Se(X,M+"leave",H,i,Y),B.target=Ve,B.relatedTarget=z,X=null,os(Y)===P&&(Se=new Se(L,M+"enter",he,i,Y),Se.target=z,Se.relatedTarget=Ve,X=Se),Ve=X,H&&he)t:{for(Se=X1,L=H,M=he,z=0,X=L;X;X=Se(X))z++;X=0;for(var we=M;we;we=Se(we))X++;for(;0<z-X;)L=Se(L),z--;for(;0<X-z;)M=Se(M),X--;for(;z--;){if(L===M||M!==null&&L===M.alternate){Se=L;break t}L=Se(L),M=Se(M)}Se=null}else Se=null;H!==null&&uy(Q,B,H,Se,!1),he!==null&&Ve!==null&&uy(Q,Ve,he,Se,!0)}}e:{if(B=P?Ti(P):window,H=B.nodeName&&B.nodeName.toLowerCase(),H==="select"||H==="input"&&B.type==="file")var Pe=Rp;else if(Tp(B))if(Ap)Pe=o1;else{Pe=s1;var ye=a1}else H=B.nodeName,!H||H.toLowerCase()!=="input"||B.type!=="checkbox"&&B.type!=="radio"?P&&Ku(P.elementType)&&(Pe=Rp):Pe=i1;if(Pe&&(Pe=Pe(n,P))){Cp(Q,Pe,i,Y);break e}ye&&ye(n,B,P),n==="focusout"&&P&&B.type==="number"&&P.memoizedProps.value!=null&&Vu(B,"number",B.value)}switch(ye=P?Ti(P):window,n){case"focusin":(Tp(ye)||ye.contentEditable==="true")&&(gs=ye,id=P,Di=null);break;case"focusout":Di=id=gs=null;break;case"mousedown":od=!0;break;case"contextmenu":case"mouseup":case"dragend":od=!1,Up(Q,i,Y);break;case"selectionchange":if(c1)break;case"keydown":case"keyup":Up(Q,i,Y)}var Ne;if(nd)e:{switch(n){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else ps?xp(n,i)&&(De="onCompositionEnd"):n==="keydown"&&i.keyCode===229&&(De="onCompositionStart");De&&(wp&&i.locale!=="ko"&&(ps||De!=="onCompositionStart"?De==="onCompositionEnd"&&ps&&(Ne=pp()):(Pr=Y,Ju="value"in Pr?Pr.value:Pr.textContent,ps=!0)),ye=tc(P,De),0<ye.length&&(De=new yp(De,n,null,i,Y),Q.push({event:De,listeners:ye}),Ne?De.data=Ne:(Ne=Ep(i),Ne!==null&&(De.data=Ne)))),(Ne=ZE?e1(n,i):t1(n,i))&&(De=tc(P,"onBeforeInput"),0<De.length&&(ye=new yp("onBeforeInput","beforeinput",null,i,Y),Q.push({event:ye,listeners:De}),ye.data=Ne)),K1(Q,n,P,i,Y)}ly(Q,r)})}function so(n,r,i){return{instance:n,listener:r,currentTarget:i}}function tc(n,r){for(var i=r+"Capture",l=[];n!==null;){var f=n,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=Ci(n,i),f!=null&&l.unshift(so(n,f,m)),f=Ci(n,r),f!=null&&l.push(so(n,f,m))),n.tag===3)return l;n=n.return}return[]}function X1(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function uy(n,r,i,l,f){for(var m=r._reactName,w=[];i!==null&&i!==l;){var T=i,k=T.alternate,P=T.stateNode;if(T=T.tag,k!==null&&k===l)break;T!==5&&T!==26&&T!==27||P===null||(k=P,f?(P=Ci(i,m),P!=null&&w.unshift(so(i,P,k))):f||(P=Ci(i,m),P!=null&&w.push(so(i,P,k)))),i=i.return}w.length!==0&&n.push({event:r,listeners:w})}var J1=/\r\n?/g,Q1=/\u0000|\uFFFD/g;function dy(n){return(typeof n=="string"?n:""+n).replace(J1,`
|
||
`).replace(Q1,"")}function fy(n,r){return r=dy(r),dy(n)===r}function Ge(n,r,i,l,f,m){switch(i){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||fs(n,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&fs(n,""+l);break;case"className":sl(n,"class",l);break;case"tabIndex":sl(n,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":sl(n,i,l);break;case"style":fp(n,l,m);break;case"data":if(r!=="object"){sl(n,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||i!=="href")){n.removeAttribute(i);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(i);break}l=ol(""+l),n.setAttribute(i,l);break;case"action":case"formAction":if(typeof l=="function"){n.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(i==="formAction"?(r!=="input"&&Ge(n,r,"name",f.name,f,null),Ge(n,r,"formEncType",f.formEncType,f,null),Ge(n,r,"formMethod",f.formMethod,f,null),Ge(n,r,"formTarget",f.formTarget,f,null)):(Ge(n,r,"encType",f.encType,f,null),Ge(n,r,"method",f.method,f,null),Ge(n,r,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){n.removeAttribute(i);break}l=ol(""+l),n.setAttribute(i,l);break;case"onClick":l!=null&&(n.onclick=ar);break;case"onScroll":l!=null&&je("scroll",n);break;case"onScrollEnd":l!=null&&je("scrollend",n);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(i=l.__html,i!=null){if(f.children!=null)throw Error(s(60));n.innerHTML=i}}break;case"multiple":n.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":n.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){n.removeAttribute("xlink:href");break}i=ol(""+l),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(i,""+l):n.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(i,""):n.removeAttribute(i);break;case"capture":case"download":l===!0?n.setAttribute(i,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?n.setAttribute(i,l):n.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?n.setAttribute(i,l):n.removeAttribute(i);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?n.removeAttribute(i):n.setAttribute(i,l);break;case"popover":je("beforetoggle",n),je("toggle",n),al(n,"popover",l);break;case"xlinkActuate":rr(n,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":rr(n,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":rr(n,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":rr(n,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":rr(n,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":rr(n,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":rr(n,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":rr(n,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":rr(n,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":al(n,"is",l);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=CE.get(i)||i,al(n,i,l))}}function Mf(n,r,i,l,f,m){switch(i){case"style":fp(n,l,m);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(i=l.__html,i!=null){if(f.children!=null)throw Error(s(60));n.innerHTML=i}}break;case"children":typeof l=="string"?fs(n,l):(typeof l=="number"||typeof l=="bigint")&&fs(n,""+l);break;case"onScroll":l!=null&&je("scroll",n);break;case"onScrollEnd":l!=null&&je("scrollend",n);break;case"onClick":l!=null&&(n.onclick=ar);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!rp.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(f=i.endsWith("Capture"),r=i.slice(2,f?i.length-7:void 0),m=n[$t]||null,m=m!=null?m[i]:null,typeof m=="function"&&n.removeEventListener(r,m,f),typeof l=="function")){typeof m!="function"&&m!==null&&(i in n?n[i]=null:n.hasAttribute(i)&&n.removeAttribute(i)),n.addEventListener(r,l,f);break e}i in n?n[i]=l:l===!0?n.setAttribute(i,""):al(n,i,l)}}}function Ct(n,r,i){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":je("error",n),je("load",n);var l=!1,f=!1,m;for(m in i)if(i.hasOwnProperty(m)){var w=i[m];if(w!=null)switch(m){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Ge(n,r,m,w,i,null)}}f&&Ge(n,r,"srcSet",i.srcSet,i,null),l&&Ge(n,r,"src",i.src,i,null);return;case"input":je("invalid",n);var T=m=w=f=null,k=null,P=null;for(l in i)if(i.hasOwnProperty(l)){var Y=i[l];if(Y!=null)switch(l){case"name":f=Y;break;case"type":w=Y;break;case"checked":k=Y;break;case"defaultChecked":P=Y;break;case"value":m=Y;break;case"defaultValue":T=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(s(137,r));break;default:Ge(n,r,l,Y,i,null)}}lp(n,m,T,k,P,w,f,!1);return;case"select":je("invalid",n),l=w=m=null;for(f in i)if(i.hasOwnProperty(f)&&(T=i[f],T!=null))switch(f){case"value":m=T;break;case"defaultValue":w=T;break;case"multiple":l=T;default:Ge(n,r,f,T,i,null)}r=m,i=w,n.multiple=!!l,r!=null?ds(n,!!l,r,!1):i!=null&&ds(n,!!l,i,!0);return;case"textarea":je("invalid",n),m=f=l=null;for(w in i)if(i.hasOwnProperty(w)&&(T=i[w],T!=null))switch(w){case"value":l=T;break;case"defaultValue":f=T;break;case"children":m=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(s(91));break;default:Ge(n,r,w,T,i,null)}up(n,l,f,m);return;case"option":for(k in i)if(i.hasOwnProperty(k)&&(l=i[k],l!=null))switch(k){case"selected":n.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Ge(n,r,k,l,i,null)}return;case"dialog":je("beforetoggle",n),je("toggle",n),je("cancel",n),je("close",n);break;case"iframe":case"object":je("load",n);break;case"video":case"audio":for(l=0;l<ao.length;l++)je(ao[l],n);break;case"image":je("error",n),je("load",n);break;case"details":je("toggle",n);break;case"embed":case"source":case"link":je("error",n),je("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(P in i)if(i.hasOwnProperty(P)&&(l=i[P],l!=null))switch(P){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:Ge(n,r,P,l,i,null)}return;default:if(Ku(r)){for(Y in i)i.hasOwnProperty(Y)&&(l=i[Y],l!==void 0&&Mf(n,r,Y,l,i,void 0));return}}for(T in i)i.hasOwnProperty(T)&&(l=i[T],l!=null&&Ge(n,r,T,l,i,null))}function Z1(n,r,i,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,m=null,w=null,T=null,k=null,P=null,Y=null;for(H in i){var Q=i[H];if(i.hasOwnProperty(H)&&Q!=null)switch(H){case"checked":break;case"value":break;case"defaultValue":k=Q;default:l.hasOwnProperty(H)||Ge(n,r,H,null,l,Q)}}for(var B in l){var H=l[B];if(Q=i[B],l.hasOwnProperty(B)&&(H!=null||Q!=null))switch(B){case"type":m=H;break;case"name":f=H;break;case"checked":P=H;break;case"defaultChecked":Y=H;break;case"value":w=H;break;case"defaultValue":T=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(s(137,r));break;default:H!==Q&&Ge(n,r,B,H,l,Q)}}Gu(n,w,T,k,P,Y,m,f);return;case"select":H=w=T=B=null;for(m in i)if(k=i[m],i.hasOwnProperty(m)&&k!=null)switch(m){case"value":break;case"multiple":H=k;default:l.hasOwnProperty(m)||Ge(n,r,m,null,l,k)}for(f in l)if(m=l[f],k=i[f],l.hasOwnProperty(f)&&(m!=null||k!=null))switch(f){case"value":B=m;break;case"defaultValue":T=m;break;case"multiple":w=m;default:m!==k&&Ge(n,r,f,m,l,k)}r=T,i=w,l=H,B!=null?ds(n,!!i,B,!1):!!l!=!!i&&(r!=null?ds(n,!!i,r,!0):ds(n,!!i,i?[]:"",!1));return;case"textarea":H=B=null;for(T in i)if(f=i[T],i.hasOwnProperty(T)&&f!=null&&!l.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:Ge(n,r,T,null,l,f)}for(w in l)if(f=l[w],m=i[w],l.hasOwnProperty(w)&&(f!=null||m!=null))switch(w){case"value":B=f;break;case"defaultValue":H=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(s(91));break;default:f!==m&&Ge(n,r,w,f,l,m)}cp(n,B,H);return;case"option":for(var he in i)if(B=i[he],i.hasOwnProperty(he)&&B!=null&&!l.hasOwnProperty(he))switch(he){case"selected":n.selected=!1;break;default:Ge(n,r,he,null,l,B)}for(k in l)if(B=l[k],H=i[k],l.hasOwnProperty(k)&&B!==H&&(B!=null||H!=null))switch(k){case"selected":n.selected=B&&typeof B!="function"&&typeof B!="symbol";break;default:Ge(n,r,k,B,l,H)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Se in i)B=i[Se],i.hasOwnProperty(Se)&&B!=null&&!l.hasOwnProperty(Se)&&Ge(n,r,Se,null,l,B);for(P in l)if(B=l[P],H=i[P],l.hasOwnProperty(P)&&B!==H&&(B!=null||H!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(s(137,r));break;default:Ge(n,r,P,B,l,H)}return;default:if(Ku(r)){for(var Ve in i)B=i[Ve],i.hasOwnProperty(Ve)&&B!==void 0&&!l.hasOwnProperty(Ve)&&Mf(n,r,Ve,void 0,l,B);for(Y in l)B=l[Y],H=i[Y],!l.hasOwnProperty(Y)||B===H||B===void 0&&H===void 0||Mf(n,r,Y,B,l,H);return}}for(var L in i)B=i[L],i.hasOwnProperty(L)&&B!=null&&!l.hasOwnProperty(L)&&Ge(n,r,L,null,l,B);for(Q in l)B=l[Q],H=i[Q],!l.hasOwnProperty(Q)||B===H||B==null&&H==null||Ge(n,r,Q,B,l,H)}function hy(n){switch(n){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function eT(){if(typeof performance.getEntriesByType=="function"){for(var n=0,r=0,i=performance.getEntriesByType("resource"),l=0;l<i.length;l++){var f=i[l],m=f.transferSize,w=f.initiatorType,T=f.duration;if(m&&T&&hy(w)){for(w=0,T=f.responseEnd,l+=1;l<i.length;l++){var k=i[l],P=k.startTime;if(P>T)break;var Y=k.transferSize,Q=k.initiatorType;Y&&hy(Q)&&(k=k.responseEnd,w+=Y*(k<T?1:(T-P)/(k-P)))}if(--l,r+=8*(m+w)/(f.duration/1e3),n++,10<n)break}}if(0<n)return r/n/1e6}return navigator.connection&&(n=navigator.connection.downlink,typeof n=="number")?n:5}var Df=null,Lf=null;function nc(n){return n.nodeType===9?n:n.ownerDocument}function my(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function py(n,r){if(n===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&r==="foreignObject"?0:n}function Uf(n,r){return n==="textarea"||n==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var zf=null;function tT(){var n=window.event;return n&&n.type==="popstate"?n===zf?!1:(zf=n,!0):(zf=null,!1)}var gy=typeof setTimeout=="function"?setTimeout:void 0,nT=typeof clearTimeout=="function"?clearTimeout:void 0,vy=typeof Promise=="function"?Promise:void 0,rT=typeof queueMicrotask=="function"?queueMicrotask:typeof vy<"u"?function(n){return vy.resolve(null).then(n).catch(aT)}:gy;function aT(n){setTimeout(function(){throw n})}function ta(n){return n==="head"}function yy(n,r){var i=r,l=0;do{var f=i.nextSibling;if(n.removeChild(i),f&&f.nodeType===8)if(i=f.data,i==="/$"||i==="/&"){if(l===0){n.removeChild(f),qs(r);return}l--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")l++;else if(i==="html")io(n.ownerDocument.documentElement);else if(i==="head"){i=n.ownerDocument.head,io(i);for(var m=i.firstChild;m;){var w=m.nextSibling,T=m.nodeName;m[Ei]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&m.rel.toLowerCase()==="stylesheet"||i.removeChild(m),m=w}}else i==="body"&&io(n.ownerDocument.body);i=f}while(i);qs(r)}function by(n,r){var i=n;n=0;do{var l=i.nextSibling;if(i.nodeType===1?r?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(r?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),l&&l.nodeType===8)if(i=l.data,i==="/$"){if(n===0)break;n--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||n++;i=l}while(i)}function Pf(n){var r=n.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var i=r;switch(r=r.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Pf(i),Hu(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}n.removeChild(i)}}function sT(n,r,i,l){for(;n.nodeType===1;){var f=i;if(n.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(l){if(!n[Ei])switch(r){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(m=n.getAttribute("rel"),m==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(m!==f.rel||n.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||n.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||n.getAttribute("title")!==(f.title==null?null:f.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(m=n.getAttribute("src"),(m!==(f.src==null?null:f.src)||n.getAttribute("type")!==(f.type==null?null:f.type)||n.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(r==="input"&&n.type==="hidden"){var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&n.getAttribute("name")===m)return n}else return n;if(n=yn(n.nextSibling),n===null)break}return null}function iT(n,r,i){if(r==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=yn(n.nextSibling),n===null))return null;return n}function wy(n,r){for(;n.nodeType!==8;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!r||(n=yn(n.nextSibling),n===null))return null;return n}function Bf(n){return n.data==="$?"||n.data==="$~"}function If(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState!=="loading"}function oT(n,r){var i=n.ownerDocument;if(n.data==="$~")n._reactRetry=r;else if(n.data!=="$?"||i.readyState!=="loading")r();else{var l=function(){r(),i.removeEventListener("DOMContentLoaded",l)};i.addEventListener("DOMContentLoaded",l),n._reactRetry=l}}function yn(n){for(;n!=null;n=n.nextSibling){var r=n.nodeType;if(r===1||r===3)break;if(r===8){if(r=n.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return n}var $f=null;function Sy(n){n=n.nextSibling;for(var r=0;n;){if(n.nodeType===8){var i=n.data;if(i==="/$"||i==="/&"){if(r===0)return yn(n.nextSibling);r--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||r++}n=n.nextSibling}return null}function _y(n){n=n.previousSibling;for(var r=0;n;){if(n.nodeType===8){var i=n.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(r===0)return n;r--}else i!=="/$"&&i!=="/&"||r++}n=n.previousSibling}return null}function xy(n,r,i){switch(r=nc(i),n){case"html":if(n=r.documentElement,!n)throw Error(s(452));return n;case"head":if(n=r.head,!n)throw Error(s(453));return n;case"body":if(n=r.body,!n)throw Error(s(454));return n;default:throw Error(s(451))}}function io(n){for(var r=n.attributes;r.length;)n.removeAttributeNode(r[0]);Hu(n)}var bn=new Map,Ey=new Set;function rc(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var wr=$.d;$.d={f:lT,r:cT,D:uT,C:dT,L:fT,m:hT,X:pT,S:mT,M:gT};function lT(){var n=wr.f(),r=Fl();return n||r}function cT(n){var r=ls(n);r!==null&&r.tag===5&&r.type==="form"?$g(r):wr.r(n)}var Is=typeof document>"u"?null:document;function Ty(n,r,i){var l=Is;if(l&&typeof r=="string"&&r){var f=dn(r);f='link[rel="'+n+'"][href="'+f+'"]',typeof i=="string"&&(f+='[crossorigin="'+i+'"]'),Ey.has(f)||(Ey.add(f),n={rel:n,crossOrigin:i,href:r},l.querySelector(f)===null&&(r=l.createElement("link"),Ct(r,"link",n),bt(r),l.head.appendChild(r)))}}function uT(n){wr.D(n),Ty("dns-prefetch",n,null)}function dT(n,r){wr.C(n,r),Ty("preconnect",n,r)}function fT(n,r,i){wr.L(n,r,i);var l=Is;if(l&&n&&r){var f='link[rel="preload"][as="'+dn(r)+'"]';r==="image"&&i&&i.imageSrcSet?(f+='[imagesrcset="'+dn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(f+='[imagesizes="'+dn(i.imageSizes)+'"]')):f+='[href="'+dn(n)+'"]';var m=f;switch(r){case"style":m=$s(n);break;case"script":m=Hs(n)}bn.has(m)||(n=g({rel:"preload",href:r==="image"&&i&&i.imageSrcSet?void 0:n,as:r},i),bn.set(m,n),l.querySelector(f)!==null||r==="style"&&l.querySelector(oo(m))||r==="script"&&l.querySelector(lo(m))||(r=l.createElement("link"),Ct(r,"link",n),bt(r),l.head.appendChild(r)))}}function hT(n,r){wr.m(n,r);var i=Is;if(i&&n){var l=r&&typeof r.as=="string"?r.as:"script",f='link[rel="modulepreload"][as="'+dn(l)+'"][href="'+dn(n)+'"]',m=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Hs(n)}if(!bn.has(m)&&(n=g({rel:"modulepreload",href:n},r),bn.set(m,n),i.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(lo(m)))return}l=i.createElement("link"),Ct(l,"link",n),bt(l),i.head.appendChild(l)}}}function mT(n,r,i){wr.S(n,r,i);var l=Is;if(l&&n){var f=cs(l).hoistableStyles,m=$s(n);r=r||"default";var w=f.get(m);if(!w){var T={loading:0,preload:null};if(w=l.querySelector(oo(m)))T.loading=5;else{n=g({rel:"stylesheet",href:n,"data-precedence":r},i),(i=bn.get(m))&&Hf(n,i);var k=w=l.createElement("link");bt(k),Ct(k,"link",n),k._p=new Promise(function(P,Y){k.onload=P,k.onerror=Y}),k.addEventListener("load",function(){T.loading|=1}),k.addEventListener("error",function(){T.loading|=2}),T.loading|=4,ac(w,r,l)}w={type:"stylesheet",instance:w,count:1,state:T},f.set(m,w)}}}function pT(n,r){wr.X(n,r);var i=Is;if(i&&n){var l=cs(i).hoistableScripts,f=Hs(n),m=l.get(f);m||(m=i.querySelector(lo(f)),m||(n=g({src:n,async:!0},r),(r=bn.get(f))&&qf(n,r),m=i.createElement("script"),bt(m),Ct(m,"link",n),i.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(f,m))}}function gT(n,r){wr.M(n,r);var i=Is;if(i&&n){var l=cs(i).hoistableScripts,f=Hs(n),m=l.get(f);m||(m=i.querySelector(lo(f)),m||(n=g({src:n,async:!0,type:"module"},r),(r=bn.get(f))&&qf(n,r),m=i.createElement("script"),bt(m),Ct(m,"link",n),i.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(f,m))}}function Cy(n,r,i,l){var f=(f=se.current)?rc(f):null;if(!f)throw Error(s(446));switch(n){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(r=$s(i.href),i=cs(f).hoistableStyles,l=i.get(r),l||(l={type:"style",instance:null,count:0,state:null},i.set(r,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){n=$s(i.href);var m=cs(f).hoistableStyles,w=m.get(n);if(w||(f=f.ownerDocument||f,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(n,w),(m=f.querySelector(oo(n)))&&!m._p&&(w.instance=m,w.state.loading=5),bn.has(n)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},bn.set(n,i),m||vT(f,n,i,w.state))),r&&l===null)throw Error(s(528,""));return w}if(r&&l!==null)throw Error(s(529,""));return null;case"script":return r=i.async,i=i.src,typeof i=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Hs(i),i=cs(f).hoistableScripts,l=i.get(r),l||(l={type:"script",instance:null,count:0,state:null},i.set(r,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,n))}}function $s(n){return'href="'+dn(n)+'"'}function oo(n){return'link[rel="stylesheet"]['+n+"]"}function Ry(n){return g({},n,{"data-precedence":n.precedence,precedence:null})}function vT(n,r,i,l){n.querySelector('link[rel="preload"][as="style"]['+r+"]")?l.loading=1:(r=n.createElement("link"),l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2}),Ct(r,"link",i),bt(r),n.head.appendChild(r))}function Hs(n){return'[src="'+dn(n)+'"]'}function lo(n){return"script[async]"+n}function Ay(n,r,i){if(r.count++,r.instance===null)switch(r.type){case"style":var l=n.querySelector('style[data-href~="'+dn(i.href)+'"]');if(l)return r.instance=l,bt(l),l;var f=g({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return l=(n.ownerDocument||n).createElement("style"),bt(l),Ct(l,"style",f),ac(l,i.precedence,n),r.instance=l;case"stylesheet":f=$s(i.href);var m=n.querySelector(oo(f));if(m)return r.state.loading|=4,r.instance=m,bt(m),m;l=Ry(i),(f=bn.get(f))&&Hf(l,f),m=(n.ownerDocument||n).createElement("link"),bt(m);var w=m;return w._p=new Promise(function(T,k){w.onload=T,w.onerror=k}),Ct(m,"link",l),r.state.loading|=4,ac(m,i.precedence,n),r.instance=m;case"script":return m=Hs(i.src),(f=n.querySelector(lo(m)))?(r.instance=f,bt(f),f):(l=i,(f=bn.get(m))&&(l=g({},i),qf(l,f)),n=n.ownerDocument||n,f=n.createElement("script"),bt(f),Ct(f,"link",l),n.head.appendChild(f),r.instance=f);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(l=r.instance,r.state.loading|=4,ac(l,i.precedence,n));return r.instance}function ac(n,r,i){for(var l=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,m=f,w=0;w<l.length;w++){var T=l[w];if(T.dataset.precedence===r)m=T;else if(m!==f)break}m?m.parentNode.insertBefore(n,m.nextSibling):(r=i.nodeType===9?i.head:i,r.insertBefore(n,r.firstChild))}function Hf(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.title==null&&(n.title=r.title)}function qf(n,r){n.crossOrigin==null&&(n.crossOrigin=r.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=r.referrerPolicy),n.integrity==null&&(n.integrity=r.integrity)}var sc=null;function Ny(n,r,i){if(sc===null){var l=new Map,f=sc=new Map;f.set(i,l)}else f=sc,l=f.get(i),l||(l=new Map,f.set(i,l));if(l.has(n))return l;for(l.set(n,null),i=i.getElementsByTagName(n),f=0;f<i.length;f++){var m=i[f];if(!(m[Ei]||m[_t]||n==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var w=m.getAttribute(r)||"";w=n+w;var T=l.get(w);T?T.push(m):l.set(w,[m])}}return l}function Oy(n,r,i){n=n.ownerDocument||n,n.head.insertBefore(i,r==="title"?n.querySelector("head > title"):null)}function yT(n,r,i){if(i===1||r.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return n=r.disabled,typeof r.precedence=="string"&&n==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function ky(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function bT(n,r,i,l){if(i.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var f=$s(l.href),m=r.querySelector(oo(f));if(m){r=m._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(n.count++,n=ic.bind(n),r.then(n,n)),i.state.loading|=4,i.instance=m,bt(m);return}m=r.ownerDocument||r,l=Ry(l),(f=bn.get(f))&&Hf(l,f),m=m.createElement("link"),bt(m);var w=m;w._p=new Promise(function(T,k){w.onload=T,w.onerror=k}),Ct(m,"link",l),i.instance=m}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(i,r),(r=i.state.preload)&&(i.state.loading&3)===0&&(n.count++,i=ic.bind(n),r.addEventListener("load",i),r.addEventListener("error",i))}}var Gf=0;function wT(n,r){return n.stylesheets&&n.count===0&&lc(n,n.stylesheets),0<n.count||0<n.imgCount?function(i){var l=setTimeout(function(){if(n.stylesheets&&lc(n,n.stylesheets),n.unsuspend){var m=n.unsuspend;n.unsuspend=null,m()}},6e4+r);0<n.imgBytes&&Gf===0&&(Gf=62500*eT());var f=setTimeout(function(){if(n.waitingForImages=!1,n.count===0&&(n.stylesheets&&lc(n,n.stylesheets),n.unsuspend)){var m=n.unsuspend;n.unsuspend=null,m()}},(n.imgBytes>Gf?50:800)+r);return n.unsuspend=i,function(){n.unsuspend=null,clearTimeout(l),clearTimeout(f)}}:null}function ic(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)lc(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var oc=null;function lc(n,r){n.stylesheets=null,n.unsuspend!==null&&(n.count++,oc=new Map,r.forEach(ST,n),oc=null,ic.call(n))}function ST(n,r){if(!(r.state.loading&4)){var i=oc.get(n);if(i)var l=i.get(null);else{i=new Map,oc.set(n,i);for(var f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var w=f[m];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(i.set(w.dataset.precedence,w),l=w)}l&&i.set(null,l)}f=r.instance,w=f.getAttribute("data-precedence"),m=i.get(w)||l,m===l&&i.set(null,f),i.set(w,f),this.count++,l=ic.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),m?m.parentNode.insertBefore(f,m.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(f,n.firstChild)),r.state.loading|=4}}var co={$$typeof:A,Provider:null,Consumer:null,_currentValue:K,_currentValue2:K,_threadCount:0};function _T(n,r,i,l,f,m,w,T,k){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ur(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ur(0),this.hiddenUpdates=Ur(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function jy(n,r,i,l,f,m,w,T,k,P,Y,Q){return n=new _T(n,r,i,w,k,P,Y,Q,T),r=1,m===!0&&(r|=24),m=Qt(3,null,null,r),n.current=m,m.stateNode=n,r=_d(),r.refCount++,n.pooledCache=r,r.refCount++,m.memoizedState={element:l,isDehydrated:i,cache:r},Cd(m),n}function My(n){return n?(n=bs,n):bs}function Dy(n,r,i,l,f,m){f=My(f),l.context===null?l.context=f:l.pendingContext=f,l=Gr(r),l.payload={element:i},m=m===void 0?null:m,m!==null&&(l.callback=m),i=Vr(n,l,r),i!==null&&(Yt(i,n,r),$i(i,n,r))}function Ly(n,r){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var i=n.retryLane;n.retryLane=i!==0&&i<r?i:r}}function Vf(n,r){Ly(n,r),(n=n.alternate)&&Ly(n,r)}function Uy(n){if(n.tag===13||n.tag===31){var r=Aa(n,67108864);r!==null&&Yt(r,n,67108864),Vf(n,67108864)}}function zy(n){if(n.tag===13||n.tag===31){var r=rn();r=ss(r);var i=Aa(n,r);i!==null&&Yt(i,n,r),Vf(n,r)}}var cc=!0;function xT(n,r,i,l){var f=O.T;O.T=null;var m=$.p;try{$.p=2,Kf(n,r,i,l)}finally{$.p=m,O.T=f}}function ET(n,r,i,l){var f=O.T;O.T=null;var m=$.p;try{$.p=8,Kf(n,r,i,l)}finally{$.p=m,O.T=f}}function Kf(n,r,i,l){if(cc){var f=Yf(l);if(f===null)jf(n,r,l,uc,i),By(n,l);else if(CT(f,n,r,i,l))l.stopPropagation();else if(By(n,l),r&4&&-1<TT.indexOf(n)){for(;f!==null;){var m=ls(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var w=In(m.pendingLanes);if(w!==0){var T=m;for(T.pendingLanes|=2,T.entangledLanes|=2;w;){var k=1<<31-Nt(w);T.entanglements[1]|=k,w&=~k}Gn(m),(Ie&6)===0&&(Kl=Dt()+500,ro(0))}}break;case 31:case 13:T=Aa(m,2),T!==null&&Yt(T,m,2),Fl(),Vf(m,2)}if(m=Yf(l),m===null&&jf(n,r,l,uc,i),m===f)break;f=m}f!==null&&l.stopPropagation()}else jf(n,r,l,null,i)}}function Yf(n){return n=Fu(n),Ff(n)}var uc=null;function Ff(n){if(uc=null,n=os(n),n!==null){var r=c(n);if(r===null)n=null;else{var i=r.tag;if(i===13){if(n=u(r),n!==null)return n;n=null}else if(i===31){if(n=d(r),n!==null)return n;n=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null)}}return uc=n,null}function Py(n){switch(n){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Pu()){case ba:return 2;case nl:return 8;case wa:case _i:return 32;case nr:return 268435456;default:return 32}default:return 32}}var Wf=!1,na=null,ra=null,aa=null,uo=new Map,fo=new Map,sa=[],TT="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".split(" ");function By(n,r){switch(n){case"focusin":case"focusout":na=null;break;case"dragenter":case"dragleave":ra=null;break;case"mouseover":case"mouseout":aa=null;break;case"pointerover":case"pointerout":uo.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":fo.delete(r.pointerId)}}function ho(n,r,i,l,f,m){return n===null||n.nativeEvent!==m?(n={blockedOn:r,domEventName:i,eventSystemFlags:l,nativeEvent:m,targetContainers:[f]},r!==null&&(r=ls(r),r!==null&&Uy(r)),n):(n.eventSystemFlags|=l,r=n.targetContainers,f!==null&&r.indexOf(f)===-1&&r.push(f),n)}function CT(n,r,i,l,f){switch(r){case"focusin":return na=ho(na,n,r,i,l,f),!0;case"dragenter":return ra=ho(ra,n,r,i,l,f),!0;case"mouseover":return aa=ho(aa,n,r,i,l,f),!0;case"pointerover":var m=f.pointerId;return uo.set(m,ho(uo.get(m)||null,n,r,i,l,f)),!0;case"gotpointercapture":return m=f.pointerId,fo.set(m,ho(fo.get(m)||null,n,r,i,l,f)),!0}return!1}function Iy(n){var r=os(n.target);if(r!==null){var i=c(r);if(i!==null){if(r=i.tag,r===13){if(r=u(i),r!==null){n.blockedOn=r,ep(n.priority,function(){zy(i)});return}}else if(r===31){if(r=d(i),r!==null){n.blockedOn=r,ep(n.priority,function(){zy(i)});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){n.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}n.blockedOn=null}function dc(n){if(n.blockedOn!==null)return!1;for(var r=n.targetContainers;0<r.length;){var i=Yf(n.nativeEvent);if(i===null){i=n.nativeEvent;var l=new i.constructor(i.type,i);Yu=l,i.target.dispatchEvent(l),Yu=null}else return r=ls(i),r!==null&&Uy(r),n.blockedOn=i,!1;r.shift()}return!0}function $y(n,r,i){dc(n)&&i.delete(r)}function RT(){Wf=!1,na!==null&&dc(na)&&(na=null),ra!==null&&dc(ra)&&(ra=null),aa!==null&&dc(aa)&&(aa=null),uo.forEach($y),fo.forEach($y)}function fc(n,r){n.blockedOn===r&&(n.blockedOn=null,Wf||(Wf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,RT)))}var hc=null;function Hy(n){hc!==n&&(hc=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){hc===n&&(hc=null);for(var r=0;r<n.length;r+=3){var i=n[r],l=n[r+1],f=n[r+2];if(typeof l!="function"){if(Ff(l||i)===null)continue;break}var m=ls(i);m!==null&&(n.splice(r,3),r-=3,Kd(m,{pending:!0,data:f,method:i.method,action:l},l,f))}}))}function qs(n){function r(k){return fc(k,n)}na!==null&&fc(na,n),ra!==null&&fc(ra,n),aa!==null&&fc(aa,n),uo.forEach(r),fo.forEach(r);for(var i=0;i<sa.length;i++){var l=sa[i];l.blockedOn===n&&(l.blockedOn=null)}for(;0<sa.length&&(i=sa[0],i.blockedOn===null);)Iy(i),i.blockedOn===null&&sa.shift();if(i=(n.ownerDocument||n).$$reactFormReplay,i!=null)for(l=0;l<i.length;l+=3){var f=i[l],m=i[l+1],w=f[$t]||null;if(typeof m=="function")w||Hy(i);else if(w){var T=null;if(m&&m.hasAttribute("formAction")){if(f=m,w=m[$t]||null)T=w.formAction;else if(Ff(f)!==null)continue}else T=w.action;typeof T=="function"?i[l+1]=T:(i.splice(l,3),l-=3),Hy(i)}}}function qy(){function n(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(w){return f=w})},focusReset:"manual",scroll:"manual"})}function r(){f!==null&&(f(),f=null),l||setTimeout(i,20)}function i(){if(!l&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,f=null;return navigation.addEventListener("navigate",n),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(i,100),function(){l=!0,navigation.removeEventListener("navigate",n),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),f!==null&&(f(),f=null)}}}function Xf(n){this._internalRoot=n}mc.prototype.render=Xf.prototype.render=function(n){var r=this._internalRoot;if(r===null)throw Error(s(409));var i=r.current,l=rn();Dy(i,l,n,r,null,null)},mc.prototype.unmount=Xf.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var r=n.containerInfo;Dy(n.current,2,null,n,null,null),Fl(),r[is]=null}};function mc(n){this._internalRoot=n}mc.prototype.unstable_scheduleHydration=function(n){if(n){var r=Iu();n={blockedOn:null,target:n,priority:r};for(var i=0;i<sa.length&&r!==0&&r<sa[i].priority;i++);sa.splice(i,0,n),i===0&&Iy(n)}};var Gy=t.version;if(Gy!=="19.2.6")throw Error(s(527,Gy,"19.2.6"));$.findDOMNode=function(n){var r=n._reactInternals;if(r===void 0)throw typeof n.render=="function"?Error(s(188)):(n=Object.keys(n).join(","),Error(s(268,n)));return n=p(r),n=n!==null?v(n):null,n=n===null?null:n.stateNode,n};var AT={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var pc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!pc.isDisabled&&pc.supportsFiber)try{Sa=pc.inject(AT),Lt=pc}catch{}}return po.createRoot=function(n,r){if(!o(n))throw Error(s(299));var i=!1,l="",f=Jg,m=Qg,w=Zg;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(f=r.onUncaughtError),r.onCaughtError!==void 0&&(m=r.onCaughtError),r.onRecoverableError!==void 0&&(w=r.onRecoverableError)),r=jy(n,1,!1,null,null,i,l,null,f,m,w,qy),n[is]=r.current,kf(n),new Xf(r)},po.hydrateRoot=function(n,r,i){if(!o(n))throw Error(s(299));var l=!1,f="",m=Jg,w=Qg,T=Zg,k=null;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(m=i.onUncaughtError),i.onCaughtError!==void 0&&(w=i.onCaughtError),i.onRecoverableError!==void 0&&(T=i.onRecoverableError),i.formState!==void 0&&(k=i.formState)),r=jy(n,1,!0,r,i??null,l,f,k,m,w,T,qy),r.context=My(null),i=r.current,l=rn(),l=ss(l),f=Gr(l),f.callback=null,Vr(i,f,l),i=l,r.current.lanes=i,tt(r,i),Gn(r),n[is]=r.current,kf(n),new mc(r)},po.version="19.2.6",po}var eb;function PT(){if(eb)return Zf.exports;eb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Zf.exports=zT(),Zf.exports}var BT=PT();/**
|
||
* react-router v7.15.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
|
||
*/var tb="popstate";function nb(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function IT(e={}){function t(s,o){var p;let c=(p=o.state)==null?void 0:p.masked,{pathname:u,search:d,hash:h}=c||s.location;return Ch("",{pathname:u,search:d,hash:h},o.state&&o.state.usr||null,o.state&&o.state.key||"default",c?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function a(s,o){return typeof o=="string"?o:ko(o)}return HT(t,a,null,e)}function nt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function er(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function $T(){return Math.random().toString(36).substring(2,10)}function rb(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Ch(e,t,a=null,s,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?hi(t):t,state:a,key:t&&t.key||s||$T(),mask:o}}function ko({pathname:e="/",search:t="",hash:a=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function hi(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substring(a),e=e.substring(0,a));let s=e.indexOf("?");s>=0&&(t.search=e.substring(s),e=e.substring(0,s)),e&&(t.pathname=e)}return t}function HT(e,t,a,s={}){let{window:o=document.defaultView,v5Compat:c=!1}=s,u=o.history,d="POP",h=null,p=v();p==null&&(p=0,u.replaceState({...u.state,idx:p},""));function v(){return(u.state||{idx:null}).idx}function g(){d="POP";let R=v(),C=R==null?null:R-p;p=R,h&&h({action:d,location:x.location,delta:C})}function S(R,C){d="PUSH";let N=nb(R)?R:Ch(x.location,R,C);p=v()+1;let A=rb(N,p),D=x.createHref(N.mask||N);try{u.pushState(A,"",D)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;o.location.assign(D)}c&&h&&h({action:d,location:x.location,delta:1})}function _(R,C){d="REPLACE";let N=nb(R)?R:Ch(x.location,R,C);p=v();let A=rb(N,p),D=x.createHref(N.mask||N);u.replaceState(A,"",D),c&&h&&h({action:d,location:x.location,delta:0})}function E(R){return qT(R)}let x={get action(){return d},get location(){return e(o,u)},listen(R){if(h)throw new Error("A history only accepts one active listener");return o.addEventListener(tb,g),h=R,()=>{o.removeEventListener(tb,g),h=null}},createHref(R){return t(o,R)},createURL:E,encodeLocation(R){let C=E(R);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:S,replace:_,go(R){return u.go(R)}};return x}function qT(e,t=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),nt(a,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:ko(e);return s=s.replace(/ $/,"%20"),!t&&s.startsWith("//")&&(s=a+s),new URL(s,a)}function z0(e,t,a="/"){return GT(e,t,a,!1)}function GT(e,t,a,s,o){let c=typeof t=="string"?hi(t):t,u=Cr(c.pathname||"/",a);if(u==null)return null;let d=VT(e),h=null,p=rC(u);for(let v=0;h==null&&v<d.length;++v)h=tC(d[v],p,s);return h}function VT(e){let t=P0(e);return KT(t),t}function P0(e,t=[],a=[],s="",o=!1){let c=(u,d,h=o,p)=>{let v={relativePath:p===void 0?u.path||"":p,caseSensitive:u.caseSensitive===!0,childrenIndex:d,route:u};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(s)&&h)return;nt(v.relativePath.startsWith(s),`Absolute route path "${v.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(s.length)}let g=Dn([s,v.relativePath]),S=a.concat(v);u.children&&u.children.length>0&&(nt(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),P0(u.children,t,S,g,h)),!(u.path==null&&!u.index)&&t.push({path:g,score:ZT(g,u.index),routesMeta:S})};return e.forEach((u,d)=>{var h;if(u.path===""||!((h=u.path)!=null&&h.includes("?")))c(u,d);else for(let p of B0(u.path))c(u,d,!0,p)}),t}function B0(e){let t=e.split("/");if(t.length===0)return[];let[a,...s]=t,o=a.endsWith("?"),c=a.replace(/\?$/,"");if(s.length===0)return o?[c,""]:[c];let u=B0(s.join("/")),d=[];return d.push(...u.map(h=>h===""?c:[c,h].join("/"))),o&&d.push(...u),d.map(h=>e.startsWith("/")&&h===""?"/":h)}function KT(e){e.sort((t,a)=>t.score!==a.score?a.score-t.score:eC(t.routesMeta.map(s=>s.childrenIndex),a.routesMeta.map(s=>s.childrenIndex)))}var YT=/^:[\w-]+$/,FT=3,WT=2,XT=1,JT=10,QT=-2,ab=e=>e==="*";function ZT(e,t){let a=e.split("/"),s=a.length;return a.some(ab)&&(s+=QT),t&&(s+=WT),a.filter(o=>!ab(o)).reduce((o,c)=>o+(YT.test(c)?FT:c===""?XT:JT),s)}function eC(e,t){return e.length===t.length&&e.slice(0,-1).every((s,o)=>s===t[o])?e[e.length-1]-t[t.length-1]:0}function tC(e,t,a=!1){let{routesMeta:s}=e,o={},c="/",u=[];for(let d=0;d<s.length;++d){let h=s[d],p=d===s.length-1,v=c==="/"?t:t.slice(c.length)||"/",g=Xc({path:h.relativePath,caseSensitive:h.caseSensitive,end:p},v),S=h.route;if(!g&&p&&a&&!s[s.length-1].route.index&&(g=Xc({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},v)),!g)return null;Object.assign(o,g.params),u.push({params:o,pathname:Dn([c,g.pathname]),pathnameBase:oC(Dn([c,g.pathnameBase])),route:S}),g.pathnameBase!=="/"&&(c=Dn([c,g.pathnameBase]))}return u}function Xc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,s]=nC(e.path,e.caseSensitive,e.end),o=t.match(a);if(!o)return null;let c=o[0],u=c.replace(/(.)\/+$/,"$1"),d=o.slice(1);return{params:s.reduce((p,{paramName:v,isOptional:g},S)=>{if(v==="*"){let E=d[S]||"";u=c.slice(0,c.length-E.length).replace(/(.)\/+$/,"$1")}const _=d[S];return g&&!_?p[v]=void 0:p[v]=(_||"").replace(/%2F/g,"/"),p},{}),pathname:c,pathnameBase:u,pattern:e}}function nC(e,t=!1,a=!0){er(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,d,h,p,v)=>{if(s.push({paramName:d,isOptional:h!=null}),h){let g=v.charAt(p+u.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),s]}function rC(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return er(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Cr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,s=e.charAt(a);return s&&s!=="/"?null:e.slice(a)||"/"}var aC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function sC(e,t="/"){let{pathname:a,search:s="",hash:o=""}=typeof e=="string"?hi(e):e,c;return a?(a=$0(a),a.startsWith("/")?c=sb(a.substring(1),"/"):c=sb(a,t)):c=t,{pathname:c,search:lC(s),hash:cC(o)}}function sb(e,t){let a=Jc(t).split("/");return e.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function rh(e,t,a,s){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function iC(e){return e.filter((t,a)=>a===0||t.route.path&&t.route.path.length>0)}function I0(e){let t=iC(e);return t.map((a,s)=>s===t.length-1?a.pathname:a.pathnameBase)}function lm(e,t,a,s=!1){let o;typeof e=="string"?o=hi(e):(o={...e},nt(!o.pathname||!o.pathname.includes("?"),rh("?","pathname","search",o)),nt(!o.pathname||!o.pathname.includes("#"),rh("#","pathname","hash",o)),nt(!o.search||!o.search.includes("#"),rh("#","search","hash",o)));let c=e===""||o.pathname==="",u=c?"/":o.pathname,d;if(u==null)d=a;else{let g=t.length-1;if(!s&&u.startsWith("..")){let S=u.split("/");for(;S[0]==="..";)S.shift(),g-=1;o.pathname=S.join("/")}d=g>=0?t[g]:"/"}let h=sC(o,d),p=u&&u!=="/"&&u.endsWith("/"),v=(c||u===".")&&a.endsWith("/");return!h.pathname.endsWith("/")&&(p||v)&&(h.pathname+="/"),h}var $0=e=>e.replace(/\/\/+/g,"/"),Dn=e=>$0(e.join("/")),Jc=e=>e.replace(/\/+$/,""),oC=e=>Jc(e).replace(/^\/*/,"/"),lC=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,cC=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,uC=class{constructor(e,t,a,s=!1){this.status=e,this.statusText=t||"",this.internal=s,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function dC(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function fC(e){let t=e.map(a=>a.route.path).filter(Boolean);return Dn(t)||"/"}var H0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function q0(e,t){let a=e;if(typeof a!="string"||!aC.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let s=a,o=!1;if(H0)try{let c=new URL(window.location.href),u=a.startsWith("//")?new URL(c.protocol+a):new URL(a),d=Cr(u.pathname,t);u.origin===c.origin&&d!=null?a=d+u.search+u.hash:o=!0}catch{er(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:o,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var G0=["POST","PUT","PATCH","DELETE"];new Set(G0);var hC=["GET",...G0];new Set(hC);var mi=y.createContext(null);mi.displayName="DataRouter";var pu=y.createContext(null);pu.displayName="DataRouterState";var V0=y.createContext(!1);function mC(){return y.useContext(V0)}var K0=y.createContext({isTransitioning:!1});K0.displayName="ViewTransition";var pC=y.createContext(new Map);pC.displayName="Fetchers";var gC=y.createContext(null);gC.displayName="Await";var xn=y.createContext(null);xn.displayName="Navigation";var Ko=y.createContext(null);Ko.displayName="Location";var Nr=y.createContext({outlet:null,matches:[],isDataRoute:!1});Nr.displayName="Route";var cm=y.createContext(null);cm.displayName="RouteError";var Y0="REACT_ROUTER_ERROR",vC="REDIRECT",yC="ROUTE_ERROR_RESPONSE";function bC(e){if(e.startsWith(`${Y0}:${vC}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function wC(e){if(e.startsWith(`${Y0}:${yC}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new uC(t.status,t.statusText,t.data)}catch{}}function SC(e,{relative:t}={}){nt(Yo(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:s}=y.useContext(xn),{hash:o,pathname:c,search:u}=Fo(e,{relative:t}),d=c;return a!=="/"&&(d=c==="/"?a:Dn([a,c])),s.createHref({pathname:d,search:u,hash:o})}function Yo(){return y.useContext(Ko)!=null}function Or(){return nt(Yo(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(Ko).location}var F0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function W0(e){y.useContext(xn).static||y.useLayoutEffect(e)}function _C(){let{isDataRoute:e}=y.useContext(Nr);return e?LC():xC()}function xC(){nt(Yo(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(mi),{basename:t,navigator:a}=y.useContext(xn),{matches:s}=y.useContext(Nr),{pathname:o}=Or(),c=JSON.stringify(I0(s)),u=y.useRef(!1);return W0(()=>{u.current=!0}),y.useCallback((h,p={})=>{if(er(u.current,F0),!u.current)return;if(typeof h=="number"){a.go(h);return}let v=lm(h,JSON.parse(c),o,p.relative==="path");e==null&&t!=="/"&&(v.pathname=v.pathname==="/"?t:Dn([t,v.pathname])),(p.replace?a.replace:a.push)(v,p.state,p)},[t,a,c,o,e])}y.createContext(null);function Fo(e,{relative:t}={}){let{matches:a}=y.useContext(Nr),{pathname:s}=Or(),o=JSON.stringify(I0(a));return y.useMemo(()=>lm(e,JSON.parse(o),s,t==="path"),[e,o,s,t])}function EC(e,t){return X0(e,t)}function X0(e,t,a){var R;nt(Yo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=y.useContext(xn),{matches:o}=y.useContext(Nr),c=o[o.length-1],u=c?c.params:{},d=c?c.pathname:"/",h=c?c.pathnameBase:"/",p=c&&c.route;{let C=p&&p.path||"";Q0(d,!p||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${C}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
||
|
||
Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let v=Or(),g;if(t){let C=typeof t=="string"?hi(t):t;nt(h==="/"||((R=C.pathname)==null?void 0:R.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${C.pathname}" was given in the \`location\` prop.`),g=C}else g=v;let S=g.pathname||"/",_=S;if(h!=="/"){let C=h.replace(/^\//,"").split("/");_="/"+S.replace(/^\//,"").split("/").slice(C.length).join("/")}let E=a&&a.state.matches.length?a.state.matches.map(C=>Object.assign(C,{route:a.manifest[C.route.id]||C.route})):z0(e,{pathname:_});er(p||E!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),er(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let x=NC(E&&E.map(C=>Object.assign({},C,{params:Object.assign({},u,C.params),pathname:Dn([h,s.encodeLocation?s.encodeLocation(C.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?h:Dn([h,s.encodeLocation?s.encodeLocation(C.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),o,a);return t&&x?y.createElement(Ko.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...g},navigationType:"POP"}},x):x}function TC(){let e=DC(),t=dC(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},c={padding:"2px 4px",backgroundColor:s},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:c},"ErrorBoundary")," or"," ",y.createElement("code",{style:c},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),a?y.createElement("pre",{style:o},a):null,u)}var CC=y.createElement(TC,null),J0=class extends y.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,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const a=wC(e.digest);a&&(e=a)}let t=e!==void 0?y.createElement(Nr.Provider,{value:this.props.routeContext},y.createElement(cm.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(RC,{error:e},t):t}};J0.contextType=V0;var ah=new WeakMap;function RC({children:e,error:t}){let{basename:a}=y.useContext(xn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let s=bC(t.digest);if(s){let o=ah.get(t);if(o)throw o;let c=q0(s.location,a);if(H0&&!ah.get(t))if(c.isExternal||s.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:s.replace}));throw ah.set(t,u),u}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return e}function AC({routeContext:e,match:t,children:a}){let s=y.useContext(mi);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Nr.Provider,{value:e},a)}function NC(e,t=[],a){let s=a==null?void 0:a.state;if(e==null){if(!s)return null;if(s.errors)e=s.matches;else if(t.length===0&&!s.initialized&&s.matches.length>0)e=s.matches;else return null}let o=e,c=s==null?void 0:s.errors;if(c!=null){let v=o.findIndex(g=>g.route.id&&(c==null?void 0:c[g.route.id])!==void 0);nt(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),o=o.slice(0,Math.min(o.length,v+1))}let u=!1,d=-1;if(a&&s){u=s.renderFallback;for(let v=0;v<o.length;v++){let g=o[v];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(d=v),g.route.id){let{loaderData:S,errors:_}=s,E=g.route.loader&&!S.hasOwnProperty(g.route.id)&&(!_||_[g.route.id]===void 0);if(g.route.lazy||E){a.isStatic&&(u=!0),d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}}let h=a==null?void 0:a.onError,p=s&&h?(v,g)=>{var S,_;h(v,{location:s.location,params:((_=(S=s.matches)==null?void 0:S[0])==null?void 0:_.params)??{},pattern:fC(s.matches),errorInfo:g})}:void 0;return o.reduceRight((v,g,S)=>{let _,E=!1,x=null,R=null;s&&(_=c&&g.route.id?c[g.route.id]:void 0,x=g.route.errorElement||CC,u&&(d<0&&S===0?(Q0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,R=null):d===S&&(E=!0,R=g.route.hydrateFallbackElement||null)));let C=t.concat(o.slice(0,S+1)),N=()=>{let A;return _?A=x:E?A=R:g.route.Component?A=y.createElement(g.route.Component,null):g.route.element?A=g.route.element:A=v,y.createElement(AC,{match:g,routeContext:{outlet:v,matches:C,isDataRoute:s!=null},children:A})};return s&&(g.route.ErrorBoundary||g.route.errorElement||S===0)?y.createElement(J0,{location:s.location,revalidation:s.revalidation,component:x,error:_,children:N(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:p}):N()},null)}function um(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function OC(e){let t=y.useContext(mi);return nt(t,um(e)),t}function kC(e){let t=y.useContext(pu);return nt(t,um(e)),t}function jC(e){let t=y.useContext(Nr);return nt(t,um(e)),t}function dm(e){let t=jC(e),a=t.matches[t.matches.length-1];return nt(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function MC(){return dm("useRouteId")}function DC(){var s;let e=y.useContext(cm),t=kC("useRouteError"),a=dm("useRouteError");return e!==void 0?e:(s=t.errors)==null?void 0:s[a]}function LC(){let{router:e}=OC("useNavigate"),t=dm("useNavigate"),a=y.useRef(!1);return W0(()=>{a.current=!0}),y.useCallback(async(o,c={})=>{er(a.current,F0),a.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:t,...c}))},[e,t])}var ib={};function Q0(e,t,a){!t&&!ib[e]&&(ib[e]=!0,er(!1,a))}y.memo(UC);function UC({routes:e,manifest:t,future:a,state:s,isStatic:o,onError:c}){return X0(e,void 0,{manifest:t,state:s,isStatic:o,onError:c})}function Z0(e){nt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function zC({basename:e="/",children:t=null,location:a,navigationType:s="POP",navigator:o,static:c=!1,useTransitions:u}){nt(!Yo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),h=y.useMemo(()=>({basename:d,navigator:o,static:c,useTransitions:u,future:{}}),[d,o,c,u]);typeof a=="string"&&(a=hi(a));let{pathname:p="/",search:v="",hash:g="",state:S=null,key:_="default",mask:E}=a,x=y.useMemo(()=>{let R=Cr(p,d);return R==null?null:{location:{pathname:R,search:v,hash:g,state:S,key:_,mask:E},navigationType:s}},[d,p,v,g,S,_,s,E]);return er(x!=null,`<Router basename="${d}"> is not able to match the URL "${p}${v}${g}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:y.createElement(xn.Provider,{value:h},y.createElement(Ko.Provider,{children:t,value:x}))}function PC({children:e,location:t}){return EC(Rh(e),t)}function Rh(e,t=[]){let a=[];return y.Children.forEach(e,(s,o)=>{if(!y.isValidElement(s))return;let c=[...t,o];if(s.type===y.Fragment){a.push.apply(a,Rh(s.props.children,c));return}nt(s.type===Z0,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),nt(!s.props.index||!s.props.children,"An index route cannot have child routes.");let u={id:s.props.id||c.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(u.children=Rh(s.props.children,c)),a.push(u)}),a}var $c="get",Hc="application/x-www-form-urlencoded";function gu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function BC(e){return gu(e)&&e.tagName.toLowerCase()==="button"}function IC(e){return gu(e)&&e.tagName.toLowerCase()==="form"}function $C(e){return gu(e)&&e.tagName.toLowerCase()==="input"}function HC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function qC(e,t){return e.button===0&&(!t||t==="_self")&&!HC(e)}var gc=null;function GC(){if(gc===null)try{new FormData(document.createElement("form"),0),gc=!1}catch{gc=!0}return gc}var VC=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function sh(e){return e!=null&&!VC.has(e)?(er(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Hc}"`),null):e}function KC(e,t){let a,s,o,c,u;if(IC(e)){let d=e.getAttribute("action");s=d?Cr(d,t):null,a=e.getAttribute("method")||$c,o=sh(e.getAttribute("enctype"))||Hc,c=new FormData(e)}else if(BC(e)||$C(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||d.getAttribute("action");if(s=h?Cr(h,t):null,a=e.getAttribute("formmethod")||d.getAttribute("method")||$c,o=sh(e.getAttribute("formenctype"))||sh(d.getAttribute("enctype"))||Hc,c=new FormData(d,e),!GC()){let{name:p,type:v,value:g}=e;if(v==="image"){let S=p?`${p}.`:"";c.append(`${S}x`,"0"),c.append(`${S}y`,"0")}else p&&c.append(p,g)}}else{if(gu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=$c,s=null,o=Hc,u=e}return c&&o==="text/plain"&&(u=c,c=void 0),{action:s,method:a.toLowerCase(),encType:o,formData:c,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function fm(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ew(e,t,a,s){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${s}`:o.pathname=`${o.pathname}.${s}`:o.pathname==="/"?o.pathname=`_root.${s}`:t&&Cr(o.pathname,t)==="/"?o.pathname=`${Jc(t)}/_root.${s}`:o.pathname=`${Jc(o.pathname)}.${s}`,o}async function YC(e,t){if(e.id in t)return t[e.id];try{let a=await import(e.module);return t[e.id]=a,a}catch(a){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function FC(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function WC(e,t,a){let s=await Promise.all(e.map(async o=>{let c=t.routes[o.route.id];if(c){let u=await YC(c,a);return u.links?u.links():[]}return[]}));return ZC(s.flat(1).filter(FC).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function ob(e,t,a,s,o,c){let u=(h,p)=>a[p]?h.route.id!==a[p].route.id:!0,d=(h,p)=>{var v;return a[p].pathname!==h.pathname||((v=a[p].route.path)==null?void 0:v.endsWith("*"))&&a[p].params["*"]!==h.params["*"]};return c==="assets"?t.filter((h,p)=>u(h,p)||d(h,p)):c==="data"?t.filter((h,p)=>{var g;let v=s.routes[h.route.id];if(!v||!v.hasLoader)return!1;if(u(h,p)||d(h,p))return!0;if(h.route.shouldRevalidate){let S=h.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((g=a[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof S=="boolean")return S}return!0}):[]}function XC(e,t,{includeHydrateFallback:a}={}){return JC(e.map(s=>{let o=t.routes[s.route.id];if(!o)return[];let c=[o.module];return o.clientActionModule&&(c=c.concat(o.clientActionModule)),o.clientLoaderModule&&(c=c.concat(o.clientLoaderModule)),a&&o.hydrateFallbackModule&&(c=c.concat(o.hydrateFallbackModule)),o.imports&&(c=c.concat(o.imports)),c}).flat(1))}function JC(e){return[...new Set(e)]}function QC(e){let t={},a=Object.keys(e).sort();for(let s of a)t[s]=e[s];return t}function ZC(e,t){let a=new Set;return new Set(t),e.reduce((s,o)=>{let c=JSON.stringify(QC(o));return a.has(c)||(a.add(c),s.push({key:c,link:o})),s},[])}function hm(){let e=y.useContext(mi);return fm(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function eR(){let e=y.useContext(pu);return fm(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var mm=y.createContext(void 0);mm.displayName="FrameworkContext";function pm(){let e=y.useContext(mm);return fm(e,"You must render this element inside a <HydratedRouter> element"),e}function tR(e,t){let a=y.useContext(mm),[s,o]=y.useState(!1),[c,u]=y.useState(!1),{onFocus:d,onBlur:h,onMouseEnter:p,onMouseLeave:v,onTouchStart:g}=t,S=y.useRef(null);y.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let x=C=>{C.forEach(N=>{u(N.isIntersecting)})},R=new IntersectionObserver(x,{threshold:.5});return S.current&&R.observe(S.current),()=>{R.disconnect()}}},[e]),y.useEffect(()=>{if(s){let x=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(x)}}},[s]);let _=()=>{o(!0)},E=()=>{o(!1),u(!1)};return a?e!=="intent"?[c,S,{}]:[c,S,{onFocus:go(d,_),onBlur:go(h,E),onMouseEnter:go(p,_),onMouseLeave:go(v,E),onTouchStart:go(g,_)}]:[!1,S,{}]}function go(e,t){return a=>{e&&e(a),a.defaultPrevented||t(a)}}function nR({page:e,...t}){let a=mC(),{router:s}=hm(),o=y.useMemo(()=>z0(s.routes,e,s.basename),[s.routes,e,s.basename]);return o?a?y.createElement(aR,{page:e,matches:o,...t}):y.createElement(sR,{page:e,matches:o,...t}):null}function rR(e){let{manifest:t,routeModules:a}=pm(),[s,o]=y.useState([]);return y.useEffect(()=>{let c=!1;return WC(e,t,a).then(u=>{c||o(u)}),()=>{c=!0}},[e,t,a]),s}function aR({page:e,matches:t,...a}){let s=Or(),{future:o}=pm(),{basename:c}=hm(),u=y.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let d=ew(e,c,o.unstable_trailingSlashAwareDataRequests,"rsc"),h=!1,p=[];for(let v of t)typeof v.route.shouldRevalidate=="function"?h=!0:p.push(v.route.id);return h&&p.length>0&&d.searchParams.set("_routes",p.join(",")),[d.pathname+d.search]},[c,o.unstable_trailingSlashAwareDataRequests,e,s,t]);return y.createElement(y.Fragment,null,u.map(d=>y.createElement("link",{key:d,rel:"prefetch",as:"fetch",href:d,...a})))}function sR({page:e,matches:t,...a}){let s=Or(),{future:o,manifest:c,routeModules:u}=pm(),{basename:d}=hm(),{loaderData:h,matches:p}=eR(),v=y.useMemo(()=>ob(e,t,p,c,s,"data"),[e,t,p,c,s]),g=y.useMemo(()=>ob(e,t,p,c,s,"assets"),[e,t,p,c,s]),S=y.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let x=new Set,R=!1;if(t.forEach(N=>{var D;let A=c.routes[N.route.id];!A||!A.hasLoader||(!v.some(V=>V.route.id===N.route.id)&&N.route.id in h&&((D=u[N.route.id])!=null&&D.shouldRevalidate)||A.hasClientLoader?R=!0:x.add(N.route.id))}),x.size===0)return[];let C=ew(e,d,o.unstable_trailingSlashAwareDataRequests,"data");return R&&x.size>0&&C.searchParams.set("_routes",t.filter(N=>x.has(N.route.id)).map(N=>N.route.id).join(",")),[C.pathname+C.search]},[d,o.unstable_trailingSlashAwareDataRequests,h,s,c,v,t,e,u]),_=y.useMemo(()=>XC(g,c),[g,c]),E=rR(g);return y.createElement(y.Fragment,null,S.map(x=>y.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...a})),_.map(x=>y.createElement("link",{key:x,rel:"modulepreload",href:x,...a})),E.map(({key:x,link:R})=>y.createElement("link",{key:x,nonce:a.nonce,...R,crossOrigin:R.crossOrigin??a.crossOrigin})))}function iR(...e){return t=>{e.forEach(a=>{typeof a=="function"?a(t):a!=null&&(a.current=t)})}}var oR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{oR&&(window.__reactRouterVersion="7.15.1")}catch{}function lR({basename:e,children:t,useTransitions:a,window:s}){let o=y.useRef();o.current==null&&(o.current=IT({window:s,v5Compat:!0}));let c=o.current,[u,d]=y.useState({action:c.action,location:c.location}),h=y.useCallback(p=>{a===!1?d(p):y.startTransition(()=>d(p))},[a]);return y.useLayoutEffect(()=>c.listen(h),[c,h]),y.createElement(zC,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:c,useTransitions:a})}var tw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nw=y.forwardRef(function({onClick:t,discover:a="render",prefetch:s="none",relative:o,reloadDocument:c,replace:u,mask:d,state:h,target:p,to:v,preventScrollReset:g,viewTransition:S,defaultShouldRevalidate:_,...E},x){let{basename:R,navigator:C,useTransitions:N}=y.useContext(xn),A=typeof v=="string"&&tw.test(v),D=q0(v,R);v=D.to;let V=SC(v,{relative:o}),q=Or(),U=null;if(d){let ie=lm(d,[],q.mask?q.mask.pathname:"/",!0);R!=="/"&&(ie.pathname=ie.pathname==="/"?R:Dn([R,ie.pathname])),U=C.createHref(ie)}let[I,ae,me]=tR(s,E),ve=fR(v,{replace:u,mask:d,state:h,target:p,preventScrollReset:g,relative:o,viewTransition:S,defaultShouldRevalidate:_,useTransitions:N});function de(ie){t&&t(ie),ie.defaultPrevented||ve(ie)}let pe=!(D.isExternal||c),J=y.createElement("a",{...E,...me,href:(pe?U:void 0)||D.absoluteURL||V,onClick:pe?de:t,ref:iR(x,ae),target:p,"data-discover":!A&&a==="render"?"true":void 0});return I&&!A?y.createElement(y.Fragment,null,J,y.createElement(nR,{page:V})):J});nw.displayName="Link";var cR=y.forwardRef(function({"aria-current":t="page",caseSensitive:a=!1,className:s="",end:o=!1,style:c,to:u,viewTransition:d,children:h,...p},v){let g=Fo(u,{relative:p.relative}),S=Or(),_=y.useContext(pu),{navigator:E,basename:x}=y.useContext(xn),R=_!=null&&vR(g)&&d===!0,C=E.encodeLocation?E.encodeLocation(g).pathname:g.pathname,N=S.pathname,A=_&&_.navigation&&_.navigation.location?_.navigation.location.pathname:null;a||(N=N.toLowerCase(),A=A?A.toLowerCase():null,C=C.toLowerCase()),A&&x&&(A=Cr(A,x)||A);const D=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let V=N===C||!o&&N.startsWith(C)&&N.charAt(D)==="/",q=A!=null&&(A===C||!o&&A.startsWith(C)&&A.charAt(C.length)==="/"),U={isActive:V,isPending:q,isTransitioning:R},I=V?t:void 0,ae;typeof s=="function"?ae=s(U):ae=[s,V?"active":null,q?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let me=typeof c=="function"?c(U):c;return y.createElement(nw,{...p,"aria-current":I,className:ae,ref:v,style:me,to:u,viewTransition:d},typeof h=="function"?h(U):h)});cR.displayName="NavLink";var uR=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:a,reloadDocument:s,replace:o,state:c,method:u=$c,action:d,onSubmit:h,relative:p,preventScrollReset:v,viewTransition:g,defaultShouldRevalidate:S,..._},E)=>{let{useTransitions:x}=y.useContext(xn),R=pR(),C=gR(d,{relative:p}),N=u.toLowerCase()==="get"?"get":"post",A=typeof d=="string"&&tw.test(d),D=V=>{if(h&&h(V),V.defaultPrevented)return;V.preventDefault();let q=V.nativeEvent.submitter,U=(q==null?void 0:q.getAttribute("formmethod"))||u,I=()=>R(q||V.currentTarget,{fetcherKey:t,method:U,navigate:a,replace:o,state:c,relative:p,preventScrollReset:v,viewTransition:g,defaultShouldRevalidate:S});x&&a!==!1?y.startTransition(()=>I()):I()};return y.createElement("form",{ref:E,method:N,action:C,onSubmit:s?h:D,..._,"data-discover":!A&&e==="render"?"true":void 0})});uR.displayName="Form";function dR(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function rw(e){let t=y.useContext(mi);return nt(t,dR(e)),t}function fR(e,{target:t,replace:a,mask:s,state:o,preventScrollReset:c,relative:u,viewTransition:d,defaultShouldRevalidate:h,useTransitions:p}={}){let v=_C(),g=Or(),S=Fo(e,{relative:u});return y.useCallback(_=>{if(qC(_,t)){_.preventDefault();let E=a!==void 0?a:ko(g)===ko(S),x=()=>v(e,{replace:E,mask:s,state:o,preventScrollReset:c,relative:u,viewTransition:d,defaultShouldRevalidate:h});p?y.startTransition(()=>x()):x()}},[g,v,S,a,s,o,t,e,c,u,d,h,p])}var hR=0,mR=()=>`__${String(++hR)}__`;function pR(){let{router:e}=rw("useSubmit"),{basename:t}=y.useContext(xn),a=MC(),s=e.fetch,o=e.navigate;return y.useCallback(async(c,u={})=>{let{action:d,method:h,encType:p,formData:v,body:g}=KC(c,t);if(u.navigate===!1){let S=u.fetcherKey||mR();await s(S,a,u.action||d,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:v,body:g,formMethod:u.method||h,formEncType:u.encType||p,flushSync:u.flushSync})}else await o(u.action||d,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:v,body:g,formMethod:u.method||h,formEncType:u.encType||p,replace:u.replace,state:u.state,fromRouteId:a,flushSync:u.flushSync,viewTransition:u.viewTransition})},[s,o,t,a])}function gR(e,{relative:t}={}){let{basename:a}=y.useContext(xn),s=y.useContext(Nr);nt(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),c={...Fo(e||".",{relative:t})},u=Or();if(e==null){c.search=u.search;let d=new URLSearchParams(c.search),h=d.getAll("index");if(h.some(v=>v==="")){d.delete("index"),h.filter(g=>g).forEach(g=>d.append("index",g));let v=d.toString();c.search=v?`?${v}`:""}}return(!e||e===".")&&o.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(c.pathname=c.pathname==="/"?a:Dn([a,c.pathname])),ko(c)}function vR(e,{relative:t}={}){let a=y.useContext(K0);nt(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=rw("useViewTransitionState"),o=Fo(e,{relative:t});if(!a.isTransitioning)return!1;let c=Cr(a.currentLocation.pathname,s)||a.currentLocation.pathname,u=Cr(a.nextLocation.pathname,s)||a.nextLocation.pathname;return Xc(o.pathname,u)!=null||Xc(o.pathname,c)!=null}var Wo=U0();const aw=L0(Wo);var Xn=function(){return Xn=Object.assign||function(t){for(var a,s=1,o=arguments.length;s<o;s++){a=arguments[s];for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(t[c]=a[c])}return t},Xn.apply(this,arguments)};function pi(e,t){var a={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(a[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(e);o<s.length;o++)t.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(a[s[o]]=e[s[o]]);return a}function yR(e,t,a,s){function o(c){return c instanceof a?c:new a(function(u){u(c)})}return new(a||(a=Promise))(function(c,u){function d(v){try{p(s.next(v))}catch(g){u(g)}}function h(v){try{p(s.throw(v))}catch(g){u(g)}}function p(v){v.done?c(v.value):o(v.value).then(d,h)}p((s=s.apply(e,t||[])).next())})}function bR(e,t,a){if(a||arguments.length===2)for(var s=0,o=t.length,c;s<o;s++)(c||!(s in t))&&(c||(c=Array.prototype.slice.call(t,0,s)),c[s]=t[s]);return e.concat(c||Array.prototype.slice.call(t))}const wR=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class gm extends Error{constructor(t,a="FunctionsError",s){super(t),this.name=a,this.context=s}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class SR extends gm{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class lb extends gm{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class cb extends gm{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var Ah;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(Ah||(Ah={}));class _R{constructor(t,{headers:a={},customFetch:s,region:o=Ah.Any}={}){this.url=t,this.headers=a,this.region=o,this.fetch=wR(s)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return yR(this,arguments,void 0,function*(a,s={}){var o;let c,u;try{const{headers:d,method:h,body:p,signal:v,timeout:g}=s;let S={},{region:_}=s;_||(_=this.region);const E=new URL(`${this.url}/${a}`);_&&_!=="any"&&(S["x-region"]=_,E.searchParams.set("forceFunctionRegion",_));let x;p&&(d&&!Object.prototype.hasOwnProperty.call(d,"Content-Type")||!d)?typeof Blob<"u"&&p instanceof Blob||p instanceof ArrayBuffer?(S["Content-Type"]="application/octet-stream",x=p):typeof p=="string"?(S["Content-Type"]="text/plain",x=p):typeof FormData<"u"&&p instanceof FormData?x=p:(S["Content-Type"]="application/json",x=JSON.stringify(p)):p&&typeof p!="string"&&!(typeof Blob<"u"&&p instanceof Blob)&&!(p instanceof ArrayBuffer)&&!(typeof FormData<"u"&&p instanceof FormData)?x=JSON.stringify(p):x=p;let R=v;g&&(u=new AbortController,c=setTimeout(()=>u.abort(),g),v?(R=u.signal,v.addEventListener("abort",()=>u.abort())):R=u.signal);const C=yield this.fetch(E.toString(),{method:h||"POST",headers:Object.assign(Object.assign(Object.assign({},S),this.headers),d),body:x,signal:R}).catch(V=>{throw new SR(V)}),N=C.headers.get("x-relay-error");if(N&&N==="true")throw new lb(C);if(!C.ok)throw new cb(C);let A=((o=C.headers.get("Content-Type"))!==null&&o!==void 0?o:"text/plain").split(";")[0].trim(),D;return A==="application/json"?D=yield C.json():A==="application/octet-stream"||A==="application/pdf"?D=yield C.blob():A==="text/event-stream"?D=C:A==="multipart/form-data"?D=yield C.formData():D=yield C.text(),{data:D,error:null,response:C}}catch(d){return{data:null,error:d,response:d instanceof cb||d instanceof lb?d.context:void 0}}finally{c&&clearTimeout(c)}})}}const sw=3,ub=e=>Math.min(1e3*2**e,3e4),xR=[520,503],iw=["GET","HEAD","OPTIONS"];var ER=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function db(e,t){return new Promise(a=>{if(t!=null&&t.aborted){a();return}const s=setTimeout(()=>{t==null||t.removeEventListener("abort",o),a()},e);function o(){clearTimeout(s),a()}t==null||t.addEventListener("abort",o)})}function TR(e,t,a,s){return!(!s||a>=sw||!iw.includes(e)||!xR.includes(t))}var CR=class{constructor(e){var t,a,s,o,c;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(a=e.isMaybeSingle)!==null&&a!==void 0?a:!1,this.shouldStripNulls=(s=e.shouldStripNulls)!==null&&s!==void 0?s:!1,this.urlLengthLimit=(o=e.urlLengthLimit)!==null&&o!==void 0?o:8e3,this.retryEnabled=(c=e.retry)!==null&&c!==void 0?c:!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var a=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const u=this.headers.get("Accept");u==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!u||u==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const s=this.fetch;let c=(async()=>{let u=0;for(;;){const p=new Headers(a.headers);u>0&&p.set("X-Retry-Count",String(u));let v;try{v=await s(a.url.toString(),{method:a.method,headers:p,body:JSON.stringify(a.body,(g,S)=>typeof S=="bigint"?S.toString():S),signal:a.signal})}catch(g){if((g==null?void 0:g.name)==="AbortError"||(g==null?void 0:g.code)==="ABORT_ERR"||!iw.includes(a.method))throw g;if(a.retryEnabled&&u<sw){const S=ub(u);u++,await db(S,a.signal);continue}throw g}if(TR(a.method,v.status,u,a.retryEnabled)){var d,h;const g=(d=(h=v.headers)===null||h===void 0?void 0:h.get("Retry-After"))!==null&&d!==void 0?d:null,S=g!==null?Math.max(0,parseInt(g,10)||0)*1e3:ub(u);await v.text(),u++,await db(S,a.signal);continue}return await a.processResponse(v)}})();return this.shouldThrowOnError||(c=c.catch(u=>{var d;let h="",p="",v="";const g=u==null?void 0:u.cause;if(g){var S,_,E,x;const N=(S=g==null?void 0:g.message)!==null&&S!==void 0?S:"",A=(_=g==null?void 0:g.code)!==null&&_!==void 0?_:"";h=`${(E=u==null?void 0:u.name)!==null&&E!==void 0?E:"FetchError"}: ${u==null?void 0:u.message}`,h+=`
|
||
|
||
Caused by: ${(x=g==null?void 0:g.name)!==null&&x!==void 0?x:"Error"}: ${N}`,A&&(h+=` (${A})`),g!=null&&g.stack&&(h+=`
|
||
${g.stack}`)}else{var R;h=(R=u==null?void 0:u.stack)!==null&&R!==void 0?R:""}const C=this.url.toString().length;return(u==null?void 0:u.name)==="AbortError"||(u==null?void 0:u.code)==="ABORT_ERR"?(v="",p="Request was aborted (timeout or manual cancellation)",C>this.urlLengthLimit&&(p+=`. Note: Your request URL is ${C} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((g==null?void 0:g.name)==="HeadersOverflowError"||(g==null?void 0:g.code)==="UND_ERR_HEADERS_OVERFLOW")&&(v="",p="HTTP headers exceeded server limits (typically 16KB)",C>this.urlLengthLimit&&(p+=`. Your request URL is ${C} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(d=u==null?void 0:u.name)!==null&&d!==void 0?d:"FetchError"}: ${u==null?void 0:u.message}`,details:h,hint:p,code:v},data:null,count:null,status:0,statusText:""}})),c.then(e,t)}async processResponse(e){var t=this;let a=null,s=null,o=null,c=e.status,u=e.statusText;if(e.ok){var d,h;if(t.method!=="HEAD"){var p;const S=await e.text();S===""||(t.headers.get("Accept")==="text/csv"||t.headers.get("Accept")&&(!((p=t.headers.get("Accept"))===null||p===void 0)&&p.includes("application/vnd.pgrst.plan+text"))?s=S:s=JSON.parse(S))}const v=(d=t.headers.get("Prefer"))===null||d===void 0?void 0:d.match(/count=(exact|planned|estimated)/),g=(h=e.headers.get("content-range"))===null||h===void 0?void 0:h.split("/");v&&g&&g.length>1&&(o=parseInt(g[1])),t.isMaybeSingle&&Array.isArray(s)&&(s.length>1?(a={code:"PGRST116",details:`Results contain ${s.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},s=null,o=null,c=406,u="Not Acceptable"):s.length===1?s=s[0]:s=null)}else{const v=await e.text();try{a=JSON.parse(v),Array.isArray(a)&&e.status===404&&(s=[],a=null,c=200,u="OK")}catch{e.status===404&&v===""?(c=204,u="No Content"):a={message:v}}if(a&&t.shouldThrowOnError)throw new ER(a)}return{success:a===null,error:a,data:s,count:o,status:c,statusText:u}}returns(){return this}overrideTypes(){return this}},RR=class extends CR{select(e){let t=!1;const a=(e??"*").split("").map(s=>/\s/.test(s)&&!t?"":(s==='"'&&(t=!t),s)).join("");return this.url.searchParams.set("select",a),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:a,foreignTable:s,referencedTable:o=s}={}){const c=o?`${o}.order`:"order",u=this.url.searchParams.get(c);return this.url.searchParams.set(c,`${u?`${u},`:""}${e}.${t?"asc":"desc"}${a===void 0?"":a?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:a=t}={}){const s=typeof a>"u"?"limit":`${a}.limit`;return this.url.searchParams.set(s,`${e}`),this}range(e,t,{foreignTable:a,referencedTable:s=a}={}){const o=typeof s>"u"?"offset":`${s}.offset`,c=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(c,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:a=!1,buffers:s=!1,wal:o=!1,format:c="text"}={}){var u;const d=[e?"analyze":null,t?"verbose":null,a?"settings":null,s?"buffers":null,o?"wal":null].filter(Boolean).join("|"),h=(u=this.headers.get("Accept"))!==null&&u!==void 0?u:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${c}; for="${h}"; options=${d};`),c==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const fb=new RegExp("[,()]");var Qs=class extends RR{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const a=Array.from(new Set(t)).map(s=>typeof s=="string"&&fb.test(s)?`"${s}"`:`${s}`).join(",");return this.url.searchParams.append(e,`in.(${a})`),this}notIn(e,t){const a=Array.from(new Set(t)).map(s=>typeof s=="string"&&fb.test(s)?`"${s}"`:`${s}`).join(",");return this.url.searchParams.append(e,`not.in.(${a})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:a,type:s}={}){let o="";s==="plain"?o="pl":s==="phrase"?o="ph":s==="websearch"&&(o="w");const c=a===void 0?"":`(${a})`;return this.url.searchParams.append(e,`${o}fts${c}.${t}`),this}match(e){return Object.entries(e).filter(([t,a])=>a!==void 0).forEach(([t,a])=>{this.url.searchParams.append(t,`eq.${a}`)}),this}not(e,t,a){return this.url.searchParams.append(e,`not.${t}.${a}`),this}or(e,{foreignTable:t,referencedTable:a=t}={}){const s=a?`${a}.or`:"or";return this.url.searchParams.append(s,`(${e})`),this}filter(e,t,a){return this.url.searchParams.append(e,`${t}.${a}`),this}},AR=class{constructor(e,{headers:t={},schema:a,fetch:s,urlLengthLimit:o=8e3,retry:c}){this.url=e,this.headers=new Headers(t),this.schema=a,this.fetch=s,this.urlLengthLimit=o,this.retry=c}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:a=!1,count:s}=t??{},o=a?"HEAD":"GET";let c=!1;const u=(e??"*").split("").map(p=>/\s/.test(p)&&!c?"":(p==='"'&&(c=!c),p)).join(""),{url:d,headers:h}=this.cloneRequestState();return d.searchParams.set("select",u),s&&h.append("Prefer",`count=${s}`),new Qs({method:o,url:d,headers:h,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:a=!0}={}){var s;const o="POST",{url:c,headers:u}=this.cloneRequestState();if(t&&u.append("Prefer",`count=${t}`),a||u.append("Prefer","missing=default"),Array.isArray(e)){const d=e.reduce((h,p)=>h.concat(Object.keys(p)),[]);if(d.length>0){const h=[...new Set(d)].map(p=>`"${p}"`);c.searchParams.set("columns",h.join(","))}}return new Qs({method:o,url:c,headers:u,schema:this.schema,body:e,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:a=!1,count:s,defaultToNull:o=!0}={}){var c;const u="POST",{url:d,headers:h}=this.cloneRequestState();if(h.append("Prefer",`resolution=${a?"ignore":"merge"}-duplicates`),t!==void 0&&d.searchParams.set("on_conflict",t),s&&h.append("Prefer",`count=${s}`),o||h.append("Prefer","missing=default"),Array.isArray(e)){const p=e.reduce((v,g)=>v.concat(Object.keys(g)),[]);if(p.length>0){const v=[...new Set(p)].map(g=>`"${g}"`);d.searchParams.set("columns",v.join(","))}}return new Qs({method:u,url:d,headers:h,schema:this.schema,body:e,fetch:(c=this.fetch)!==null&&c!==void 0?c:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var a;const s="PATCH",{url:o,headers:c}=this.cloneRequestState();return t&&c.append("Prefer",`count=${t}`),new Qs({method:s,url:o,headers:c,schema:this.schema,body:e,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const a="DELETE",{url:s,headers:o}=this.cloneRequestState();return e&&o.append("Prefer",`count=${e}`),new Qs({method:a,url:s,headers:o,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function jo(e){"@babel/helpers - typeof";return jo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jo(e)}function NR(e,t){if(jo(e)!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var s=a.call(e,t);if(jo(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function OR(e){var t=NR(e,"string");return jo(t)=="symbol"?t:t+""}function kR(e,t,a){return(t=OR(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function hb(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),a.push.apply(a,s)}return a}function vc(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?hb(Object(a),!0).forEach(function(s){kR(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):hb(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}var jR=class ow{constructor(t,{headers:a={},schema:s,fetch:o,timeout:c,urlLengthLimit:u=8e3,retry:d}={}){this.url=t,this.headers=new Headers(a),this.schemaName=s,this.urlLengthLimit=u;const h=o??globalThis.fetch;c!==void 0&&c>0?this.fetch=(p,v)=>{const g=new AbortController,S=setTimeout(()=>g.abort(),c),_=v==null?void 0:v.signal;if(_){if(_.aborted)return clearTimeout(S),h(p,v);const E=()=>{clearTimeout(S),g.abort()};return _.addEventListener("abort",E,{once:!0}),h(p,vc(vc({},v),{},{signal:g.signal})).finally(()=>{clearTimeout(S),_.removeEventListener("abort",E)})}return h(p,vc(vc({},v),{},{signal:g.signal})).finally(()=>clearTimeout(S))}:this.fetch=h,this.retry=d}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new AR(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new ow(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,a={},{head:s=!1,get:o=!1,count:c}={}){var u;let d;const h=new URL(`${this.url}/rpc/${t}`);let p;const v=_=>_!==null&&typeof _=="object"&&(!Array.isArray(_)||_.some(v)),g=s&&Object.values(a).some(v);g?(d="POST",p=a):s||o?(d=s?"HEAD":"GET",Object.entries(a).filter(([_,E])=>E!==void 0).map(([_,E])=>[_,Array.isArray(E)?`{${E.join(",")}}`:`${E}`]).forEach(([_,E])=>{h.searchParams.append(_,E)})):(d="POST",p=a);const S=new Headers(this.headers);return g?S.set("Prefer",c?`count=${c},return=minimal`:"return=minimal"):c&&S.set("Prefer",`count=${c}`),new Qs({method:d,url:h,headers:S,schema:this.schemaName,body:p,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class MR{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const a=globalThis;if(typeof globalThis<"u"&&typeof a.WebSocket<"u")return{type:"native",wsConstructor:a.WebSocket};const s=typeof global<"u"?global:void 0;if(s&&typeof s.WebSocket<"u")return{type:"native",wsConstructor:s.WebSocket};if(typeof globalThis<"u"&&typeof a.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"&&a.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const o=globalThis.process;if(o){const c=o.versions;if(c&&c.node){const u=c.node,d=parseInt(u.replace(/^v/,"").split(".")[0]);return d>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${d} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${d} 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 t=this.detectEnvironment();if(t.wsConstructor)return t.wsConstructor;let a=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(a+=`
|
||
|
||
Suggested solution: ${t.workaround}`),new Error(a)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const DR="2.106.2",LR=`realtime-js/${DR}`,UR="1.0.0",lw="2.0.0",zR=lw,PR=1e4,BR=100,ua={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},cw={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},Nh={connecting:"connecting",closing:"closing",closed:"closed"};class IR{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,a){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return a(this._binaryEncodeUserBroadcastPush(t));let s=[t.join_ref,t.ref,t.topic,t.event,t.payload];return a(JSON.stringify(s))}_binaryEncodeUserBroadcastPush(t){var a;return this._isArrayBuffer((a=t.payload)===null||a===void 0?void 0:a.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var a,s;const o=(s=(a=t.payload)===null||a===void 0?void 0:a.payload)!==null&&s!==void 0?s:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,o)}_encodeJsonUserBroadcastPush(t){var a,s;const o=(s=(a=t.payload)===null||a===void 0?void 0:a.payload)!==null&&s!==void 0?s:{},u=new TextEncoder().encode(JSON.stringify(o)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,u)}_encodeUserBroadcastPush(t,a,s){var o,c;const u=t.topic,d=(o=t.ref)!==null&&o!==void 0?o:"",h=(c=t.join_ref)!==null&&c!==void 0?c:"",p=t.payload.event,v=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},g=Object.keys(v).length===0?"":JSON.stringify(v);if(h.length>255)throw new Error(`joinRef length ${h.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`ref length ${d.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`topic length ${u.length} exceeds maximum of 255`);if(p.length>255)throw new Error(`userEvent length ${p.length} exceeds maximum of 255`);if(g.length>255)throw new Error(`metadata length ${g.length} exceeds maximum of 255`);const S=this.USER_BROADCAST_PUSH_META_LENGTH+h.length+d.length+u.length+p.length+g.length,_=new ArrayBuffer(this.HEADER_LENGTH+S);let E=new DataView(_),x=0;E.setUint8(x++,this.KINDS.userBroadcastPush),E.setUint8(x++,h.length),E.setUint8(x++,d.length),E.setUint8(x++,u.length),E.setUint8(x++,p.length),E.setUint8(x++,g.length),E.setUint8(x++,a),Array.from(h,C=>E.setUint8(x++,C.charCodeAt(0))),Array.from(d,C=>E.setUint8(x++,C.charCodeAt(0))),Array.from(u,C=>E.setUint8(x++,C.charCodeAt(0))),Array.from(p,C=>E.setUint8(x++,C.charCodeAt(0))),Array.from(g,C=>E.setUint8(x++,C.charCodeAt(0)));var R=new Uint8Array(_.byteLength+s.byteLength);return R.set(new Uint8Array(_),0),R.set(new Uint8Array(s),_.byteLength),R.buffer}decode(t,a){if(this._isArrayBuffer(t)){let s=this._binaryDecode(t);return a(s)}if(typeof t=="string"){const s=JSON.parse(t),[o,c,u,d,h]=s;return a({join_ref:o,ref:c,topic:u,event:d,payload:h})}return a({})}_binaryDecode(t){const a=new DataView(t),s=a.getUint8(0),o=new TextDecoder;switch(s){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,a,o)}}_decodeUserBroadcast(t,a,s){const o=a.getUint8(1),c=a.getUint8(2),u=a.getUint8(3),d=a.getUint8(4);let h=this.HEADER_LENGTH+4;const p=s.decode(t.slice(h,h+o));h=h+o;const v=s.decode(t.slice(h,h+c));h=h+c;const g=s.decode(t.slice(h,h+u));h=h+u;const S=t.slice(h,t.byteLength),_=d===this.JSON_ENCODING?JSON.parse(s.decode(S)):S,E={type:this.BROADCAST_EVENT,event:v,payload:_};return u>0&&(E.meta=JSON.parse(g)),{join_ref:null,ref:null,topic:p,event:this.BROADCAST_EVENT,payload:E}}_isArrayBuffer(t){var a;return t instanceof ArrayBuffer||((a=t==null?void 0:t.constructor)===null||a===void 0?void 0:a.name)==="ArrayBuffer"}_pick(t,a){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([s])=>a.includes(s)))}}var We;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(We||(We={}));const mb=(e,t,a={})=>{var s;const o=(s=a.skipTypes)!==null&&s!==void 0?s:[];return t?Object.keys(t).reduce((c,u)=>(c[u]=$R(u,e,t,o),c),{}):{}},$R=(e,t,a,s)=>{const o=t.find(d=>d.name===e),c=o==null?void 0:o.type,u=a[e];return c&&!s.includes(c)?uw(c,u):Oh(u)},uw=(e,t)=>{if(e.charAt(0)==="_"){const a=e.slice(1,e.length);return VR(t,a)}switch(e){case We.bool:return HR(t);case We.float4:case We.float8:case We.int2:case We.int4:case We.int8:case We.numeric:case We.oid:return qR(t);case We.json:case We.jsonb:return GR(t);case We.timestamp:return KR(t);case We.abstime:case We.date:case We.daterange:case We.int4range:case We.int8range:case We.money:case We.reltime:case We.text:case We.time:case We.timestamptz:case We.timetz:case We.tsrange:case We.tstzrange:return Oh(t);default:return Oh(t)}},Oh=e=>e,HR=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},qR=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},GR=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},VR=(e,t)=>{if(typeof e!="string")return e;const a=e.length-1,s=e[a];if(e[0]==="{"&&s==="}"){let c;const u=e.slice(1,a);try{c=JSON.parse("["+u+"]")}catch{c=u?u.split(","):[]}return c.map(d=>uw(t,d))}return e},KR=e=>typeof e=="string"?e.replace(" ","T"):e,dw=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var Co=e=>typeof e=="function"?e:function(){return e},YR=typeof self<"u"?self:null,Zs=typeof window<"u"?window:null,Fn=YR||Zs||globalThis,FR="2.0.0",WR=1e4,XR=1e3,Wn={connecting:0,open:1,closing:2,closed:3},Ft={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},xr={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},kh={longpoll:"longpoll",websocket:"websocket"},JR={complete:4},jh="base64url.bearer.phx.",yc=class{constructor(e,t,a,s){this.channel=e,this.event=t,this.payload=a||function(){return{}},this.receivedResp=null,this.timeout=s,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:a}){this.recHooks.filter(s=>s.status===e).forEach(s=>s.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},fw=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},QR=class{constructor(e,t,a){this.state=Ft.closed,this.topic=e,this.params=Co(t||{}),this.socket=a,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new yc(this,xr.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new fw(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Ft.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(s=>s.send()),this.pushBuffer=[]}),this.joinPush.receive("error",s=>{this.state=Ft.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,s),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Ft.closed,this.socket.remove(this)}),this.onError(s=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,s),this.isJoining()&&this.joinPush.reset(),this.state=Ft.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new yc(this,xr.leave,Co({}),this.timeout).send(),this.state=Ft.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(xr.reply,(s,o)=>{this.trigger(this.replyEventName(o),s)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Ft.closed,this.bindings=[]}onClose(e){this.on(xr.close,e)}onError(e){return this.on(xr.error,t=>e(t))}on(e,t){let a=this.bindingRef++;return this.bindings.push({event:e,ref:a,callback:t}),a}off(e,t){this.bindings=this.bindings.filter(a=>!(a.event===e&&(typeof t>"u"||t===a.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,a=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let s=new yc(this,e,function(){return t},a);return this.canPush()?s.send():(s.startTimeout(),this.pushBuffer.push(s)),s}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Ft.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(xr.close,"leave")},a=new yc(this,xr.leave,Co({}),e);return a.receive("ok",()=>t()).receive("timeout",()=>t()),a.send(),this.canPush()||a.trigger("ok",{}),a}onMessage(e,t,a){return t}filterBindings(e,t,a){return!0}isMember(e,t,a,s){return this.topic!==e?!1:s&&s!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:a,joinRef:s}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Ft.joining,this.joinPush.resend(e))}trigger(e,t,a,s){let o=this.onMessage(e,t,a,s);if(t&&!o)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let c=this.bindings.filter(u=>u.event===e&&this.filterBindings(u,t,a));for(let u=0;u<c.length;u++)c[u].callback(o,a,s||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===Ft.closed}isErrored(){return this.state===Ft.errored}isJoined(){return this.state===Ft.joined}isJoining(){return this.state===Ft.joining}isLeaving(){return this.state===Ft.leaving}},Qc=class{static request(e,t,a,s,o,c,u){if(Fn.XDomainRequest){let d=new Fn.XDomainRequest;return this.xdomainRequest(d,e,t,s,o,c,u)}else if(Fn.XMLHttpRequest){let d=new Fn.XMLHttpRequest;return this.xhrRequest(d,e,t,a,s,o,c,u)}else{if(Fn.fetch&&Fn.AbortController)return this.fetchRequest(e,t,a,s,o,c,u);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,a,s,o,c,u){let d={method:e,headers:a,body:s},h=null;return o&&(h=new AbortController,setTimeout(()=>h.abort(),o),d.signal=h.signal),Fn.fetch(t,d).then(p=>p.text()).then(p=>this.parseJSON(p)).then(p=>u&&u(p)).catch(p=>{p.name==="AbortError"&&c?c():u&&u(null)}),h}static xdomainRequest(e,t,a,s,o,c,u){return e.timeout=o,e.open(t,a),e.onload=()=>{let d=this.parseJSON(e.responseText);u&&u(d)},c&&(e.ontimeout=c),e.onprogress=()=>{},e.send(s),e}static xhrRequest(e,t,a,s,o,c,u,d){e.open(t,a,!0),e.timeout=c;for(let[h,p]of Object.entries(s))e.setRequestHeader(h,p);return e.onerror=()=>d&&d(null),e.onreadystatechange=()=>{if(e.readyState===JR.complete&&d){let h=this.parseJSON(e.responseText);d(h)}},u&&(e.ontimeout=u),e.send(o),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let a=[];for(var s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let o=t?`${t}[${s}]`:s,c=e[s];typeof c=="object"?a.push(this.serialize(c,o)):a.push(encodeURIComponent(o)+"="+encodeURIComponent(c))}return a.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let a=e.match(/\?/)?"&":"?";return`${e}${a}${this.serialize(t)}`}},ZR=e=>{let t="",a=new Uint8Array(e),s=a.byteLength;for(let o=0;o<s;o++)t+=String.fromCharCode(a[o]);return btoa(t)},Gs=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(jh)&&(this.authToken=atob(t[1].slice(jh.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=Wn.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+kh.websocket),"$1/"+kh.longpoll)}endpointURL(){return Qc.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,a){this.close(e,t,a),this.readyState=Wn.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Wn.open||this.readyState===Wn.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:a,token:s,messages:o}=t;if(a===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=s}else a=0;switch(a){case 200:o.forEach(c=>{setTimeout(()=>this.onmessage({data:c}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Wn.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${a}`)}})}send(e){typeof e!="string"&&(e=ZR(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(`
|
||
`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,a){for(let o of this.reqs)o.abort();this.readyState=Wn.closed;let s=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:a});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",s)):this.onclose(s)}ajax(e,t,a,s,o){let c,u=()=>{this.reqs.delete(c),s()};c=Qc.request(e,this.endpointURL(),t,a,this.timeout,u,d=>{this.reqs.delete(c),this.isActive()&&o(d)}),this.reqs.add(c)}},eA=class wo{constructor(t,a={}){let s=a.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(s.state,o=>{let{onJoin:c,onLeave:u,onSync:d}=this.caller;this.joinRef=this.channel.joinRef(),this.state=wo.syncState(this.state,o,c,u),this.pendingDiffs.forEach(h=>{this.state=wo.syncDiff(this.state,h,c,u)}),this.pendingDiffs=[],d()}),this.channel.on(s.diff,o=>{let{onJoin:c,onLeave:u,onSync:d}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(o):(this.state=wo.syncDiff(this.state,o,c,u),d())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return wo.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,a,s,o){let c=this.clone(t),u={},d={};return this.map(c,(h,p)=>{a[h]||(d[h]=p)}),this.map(a,(h,p)=>{let v=c[h];if(v){let g=p.metas.map(x=>x.phx_ref),S=v.metas.map(x=>x.phx_ref),_=p.metas.filter(x=>S.indexOf(x.phx_ref)<0),E=v.metas.filter(x=>g.indexOf(x.phx_ref)<0);_.length>0&&(u[h]=p,u[h].metas=_),E.length>0&&(d[h]=this.clone(v),d[h].metas=E)}else u[h]=p}),this.syncDiff(c,{joins:u,leaves:d},s,o)}static syncDiff(t,a,s,o){let{joins:c,leaves:u}=this.clone(a);return s||(s=function(){}),o||(o=function(){}),this.map(c,(d,h)=>{let p=t[d];if(t[d]=this.clone(h),p){let v=t[d].metas.map(S=>S.phx_ref),g=p.metas.filter(S=>v.indexOf(S.phx_ref)<0);t[d].metas.unshift(...g)}s(d,p,h)}),this.map(u,(d,h)=>{let p=t[d];if(!p)return;let v=h.metas.map(g=>g.phx_ref);p.metas=p.metas.filter(g=>v.indexOf(g.phx_ref)<0),o(d,p,h),p.metas.length===0&&delete t[d]}),t}static list(t,a){return a||(a=function(s,o){return o}),this.map(t,(s,o)=>a(s,o))}static map(t,a){return Object.getOwnPropertyNames(t).map(s=>a(s,t[s]))}static clone(t){return JSON.parse(JSON.stringify(t))}},bc={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let a=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(a))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[a,s,o,c,u]=JSON.parse(e);return t({join_ref:a,ref:s,topic:o,event:c,payload:u})}},binaryEncode(e){let{join_ref:t,ref:a,event:s,topic:o,payload:c}=e,u=this.META_LENGTH+t.length+a.length+o.length+s.length,d=new ArrayBuffer(this.HEADER_LENGTH+u),h=new DataView(d),p=0;h.setUint8(p++,this.KINDS.push),h.setUint8(p++,t.length),h.setUint8(p++,a.length),h.setUint8(p++,o.length),h.setUint8(p++,s.length),Array.from(t,g=>h.setUint8(p++,g.charCodeAt(0))),Array.from(a,g=>h.setUint8(p++,g.charCodeAt(0))),Array.from(o,g=>h.setUint8(p++,g.charCodeAt(0))),Array.from(s,g=>h.setUint8(p++,g.charCodeAt(0)));var v=new Uint8Array(d.byteLength+c.byteLength);return v.set(new Uint8Array(d),0),v.set(new Uint8Array(c),d.byteLength),v.buffer},binaryDecode(e){let t=new DataView(e),a=t.getUint8(0),s=new TextDecoder;switch(a){case this.KINDS.push:return this.decodePush(e,t,s);case this.KINDS.reply:return this.decodeReply(e,t,s);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,s)}},decodePush(e,t,a){let s=t.getUint8(1),o=t.getUint8(2),c=t.getUint8(3),u=this.HEADER_LENGTH+this.META_LENGTH-1,d=a.decode(e.slice(u,u+s));u=u+s;let h=a.decode(e.slice(u,u+o));u=u+o;let p=a.decode(e.slice(u,u+c));u=u+c;let v=e.slice(u,e.byteLength);return{join_ref:d,ref:null,topic:h,event:p,payload:v}},decodeReply(e,t,a){let s=t.getUint8(1),o=t.getUint8(2),c=t.getUint8(3),u=t.getUint8(4),d=this.HEADER_LENGTH+this.META_LENGTH,h=a.decode(e.slice(d,d+s));d=d+s;let p=a.decode(e.slice(d,d+o));d=d+o;let v=a.decode(e.slice(d,d+c));d=d+c;let g=a.decode(e.slice(d,d+u));d=d+u;let S=e.slice(d,e.byteLength),_={status:g,response:S};return{join_ref:h,ref:p,topic:v,event:xr.reply,payload:_}},decodeBroadcast(e,t,a){let s=t.getUint8(1),o=t.getUint8(2),c=this.HEADER_LENGTH+2,u=a.decode(e.slice(c,c+s));c=c+s;let d=a.decode(e.slice(c,c+o));c=c+o;let h=e.slice(c,e.byteLength);return{join_ref:null,ref:null,topic:u,event:d,payload:h}}},tA=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||WR,this.transport=t.transport||Fn.WebSocket||Gs,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let a=null;try{a=Fn&&Fn.sessionStorage}catch{}this.sessionStore=t.sessionStorage||a,this.establishedConnections=0,this.defaultEncoder=bc.encode.bind(bc),this.defaultDecoder=bc.decode.bind(bc),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Gs?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let s=null;Zs&&Zs.addEventListener&&(Zs.addEventListener("pagehide",o=>{this.conn&&(this.disconnect(),s=this.connectClock)}),Zs.addEventListener("pageshow",o=>{s===this.connectClock&&(s=null,this.connect())}),Zs.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=o=>t.rejoinAfterMs?t.rejoinAfterMs(o):[1e3,2e3,5e3][o-1]||1e4,this.reconnectAfterMs=o=>t.reconnectAfterMs?t.reconnectAfterMs(o):[10,50,100,150,200,250,500,1e3,2e3][o-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(o,c,u)=>{console.log(`${o}: ${c}`,u)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=Co(t.params||{}),this.endPoint=`${e}/${kh.websocket}`,this.vsn=t.vsn||FR,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new fw(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return Gs}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=Qc.appendParams(Qc.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,a){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,a)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Co(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Gs?this.connectWithFallback(Gs,this.longPollFallbackMs):this.transportConnect())}log(e,t,a){this.logger&&this.logger(e,t,a)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),a=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let s=this.onMessage(o=>{o.ref===t&&(this.off([s]),e(Date.now()-a))});return!0}transportName(e){switch(e){case Gs:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${jh}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=t=>this.onConnError(t),this.conn.onmessage=t=>this.onConnMessage(t),this.conn.onclose=t=>this.onConnClose(t)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let a=!1,s=!0,o,c,u=this.transportName(e),d=h=>{this.log("transport",`falling back to ${u}...`,h),this.off([o,c]),s=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${u}`))return d("memorized");this.fallbackTimer=setTimeout(d,t),c=this.onError(h=>{this.log("transport","error",h),s&&!a&&(clearTimeout(this.fallbackTimer),d(h))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(a=!0,!s){let h=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${h}`,"true"),this.log("transport",`established ${h} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(d,t),this.ping(h=>{this.log("transport","connected to primary after",h),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),XR,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,a){if(!this.conn)return e&&e();const s=this.conn;this.waitForBufferDone(s,()=>{t?s.close(t,a||""):s.close(),this.waitForSocketClosed(s,()=>{this.conn===s&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,a=1){if(a===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,a+1)},150*a)}waitForSocketClosed(e,t,a=1){if(a===5||e.readyState===Wn.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,a+1)},150*a)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport","error",e);let t=this.transport,a=this.establishedConnections;this.triggerStateCallbacks("error",e,t,a),(t===this.transport||a>0)&&this.triggerChanError(e)}triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(xr.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case Wn.connecting:return"connecting";case Wn.open:return"open";case Wn.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([a])=>e.indexOf(a)===-1)}channel(e,t={}){let a=new QR(e,t,this);return this.channels.push(a),a}push(e){if(this.hasLogger()){let{topic:t,event:a,payload:s,ref:o,join_ref:c}=e;this.log("push",`${t} ${a} (${c}, ${o})`,s)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:a,event:s,payload:o,ref:c,join_ref:u}=t;if(c&&c===this.pendingHeartbeatRef){const d=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(o.status==="ok"?"ok":"error",d)}catch(h){this.log("error","error in heartbeat callback",h)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${o.status||""} ${a} ${s} ${c&&"("+c+")"||""}`.trim(),o);for(let d=0;d<this.channels.length;d++){const h=this.channels[d];h.isMember(a,s,o,u)&&h.trigger(s,o,c,u)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([a,s])=>{try{s(...t)}catch(o){this.log("error",`error in ${e} callback`,o)}})}catch(a){this.log("error",`error triggering ${e} callbacks`,a)}}leaveOpenTopic(e){let t=this.channels.find(a=>a.topic===e&&(a.isJoined()||a.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class Ro{constructor(t,a){const s=rA(a);this.presence=new eA(t.getChannel(),s),this.presence.onJoin((o,c,u)=>{const d=Ro.onJoinPayload(o,c,u);t.getChannel().trigger("presence",d)}),this.presence.onLeave((o,c,u)=>{const d=Ro.onLeavePayload(o,c,u);t.getChannel().trigger("presence",d)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return Ro.transformState(this.presence.state)}static transformState(t){return t=nA(t),Object.getOwnPropertyNames(t).reduce((a,s)=>{const o=t[s];return a[s]=qc(o),a},{})}static onJoinPayload(t,a,s){const o=pb(a),c=qc(s);return{event:"join",key:t,currentPresences:o,newPresences:c}}static onLeavePayload(t,a,s){const o=pb(a),c=qc(s);return{event:"leave",key:t,currentPresences:o,leftPresences:c}}}function qc(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function nA(e){return JSON.parse(JSON.stringify(e))}function rA(e){return(e==null?void 0:e.events)&&{events:e.events}}function pb(e){return e!=null&&e.metas?qc(e):[]}var gb;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(gb||(gb={}));class aA{get state(){return this.presenceAdapter.state}constructor(t,a){this.channel=t,this.presenceAdapter=new Ro(this.channel.channelAdapter,a)}}function sA(e){if(e instanceof Error)return e;if(typeof e=="string")return new Error(e);if(e&&typeof e=="object"){const t=e;if(typeof t.code=="number"){const a=typeof t.reason=="string"&&t.reason?` (${t.reason})`:"";return new Error(`socket closed: ${t.code}${a}`,{cause:e})}return new Error("channel error: transport failure",{cause:e})}return new Error("channel error: connection lost")}class iA{constructor(t,a,s){const o=oA(s);this.channel=t.getSocket().channel(a,o),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,a){return this.channel.on(t,a)}off(t,a){this.channel.off(t,a)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,a,s){let o;try{o=this.channel.push(t,a,s)}catch{throw new Error(`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>BR){const c=this.channel.pushBuffer.shift();c.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${c.event}`,c.payload())}return o}updateJoinPayload(t){const a=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},a),t)}canPush(){return this.socket.isConnected()&&this.state===ua.joined}isJoined(){return this.state===ua.joined}isJoining(){return this.state===ua.joining}isClosed(){return this.state===ua.closed}isLeaving(){return this.state===ua.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function oA(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}var vb;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(vb||(vb={}));var ri;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(ri||(ri={}));var Er;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Er||(Er={}));class Ao{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(t,a={config:{}},s){var o,c;if(this.topic=t,this.params=a,this.socket=s,this.bindings={},this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},a.config),this.channelAdapter=new iA(this.socket.socketAdapter,t,this.params),this.presence=new aA(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=dw(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((c=(o=this.params.config)===null||o===void 0?void 0:o.broadcast)===null||c===void 0)&&c.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(t,a=this.timeout){var s,o,c;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:u,presence:d,private:h}}=this.params,p=(o=(s=this.bindings.postgres_changes)===null||s===void 0?void 0:s.map(_=>_.filter))!==null&&o!==void 0?o:[],v=!!this.bindings[ri.PRESENCE]&&this.bindings[ri.PRESENCE].length>0||((c=this.params.config.presence)===null||c===void 0?void 0:c.enabled)===!0,g={},S={broadcast:u,presence:Object.assign(Object.assign({},d),{enabled:v}),postgres_changes:p,private:h};this.socket.accessTokenValue&&(g.access_token=this.socket.accessTokenValue),this._onError(_=>{t==null||t(Er.CHANNEL_ERROR,sA(_))}),this._onClose(()=>t==null?void 0:t(Er.CLOSED)),this.updateJoinPayload(Object.assign({config:S},g)),this._updateFilterMessage(),this.channelAdapter.subscribe(a).receive("ok",async({postgres_changes:_})=>{if(this.socket._isManualToken()||this.socket.setAuth(),_===void 0){t==null||t(Er.SUBSCRIBED);return}this._updatePostgresBindings(_,t)}).receive("error",_=>{this.state=ua.errored;const E=Object.values(_).join(", ")||"error";t==null||t(Er.CHANNEL_ERROR,new Error(E,{cause:_}))}).receive("timeout",()=>{t==null||t(Er.TIMED_OUT)})}return this}_updatePostgresBindings(t,a){var s;const o=this.bindings.postgres_changes,c=(s=o==null?void 0:o.length)!==null&&s!==void 0?s:0,u=[];for(let d=0;d<c;d++){const h=o[d],{filter:{event:p,schema:v,table:g,filter:S}}=h,_=t&&t[d];if(_&&_.event===p&&Ao.isFilterValueEqual(_.schema,v)&&Ao.isFilterValueEqual(_.table,g)&&Ao.isFilterValueEqual(_.filter,S))u.push(Object.assign(Object.assign({},h),{id:_.id}));else{this.unsubscribe(),this.state=ua.errored,a==null||a(Er.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=u,this.state!=ua.errored&&a&&a(Er.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,a={}){return await this.send({type:"presence",event:"track",payload:t},a.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,a,s){const o=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),c=t===ri.PRESENCE||t===ri.POSTGRES_CHANGES;if(o&&c)throw this.socket.log("channel",`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(t,a,s)}async httpSend(t,a,s={}){var o;if(a==null)return Promise.reject(new Error("Payload is required for httpSend()"));const c={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(c.Authorization=`Bearer ${this.socket.accessTokenValue}`);const u={method:"POST",headers:c,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:a,private:this.private}]})},d=await this._fetchWithTimeout(this.broadcastEndpointURL,u,(o=s.timeout)!==null&&o!==void 0?o:this.timeout);if(d.status===202)return{success:!0};let h=d.statusText;try{const p=await d.json();h=p.error||p.message||h}catch{}return Promise.reject(new Error(h))}async send(t,a={}){var s,o;if(!this.channelAdapter.canPush()&&t.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:c,payload:u}=t,d={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(d.Authorization=`Bearer ${this.socket.accessTokenValue}`);const h={method:"POST",headers:d,body:JSON.stringify({messages:[{topic:this.subTopic,event:c,payload:u,private:this.private}]})};try{const p=await this._fetchWithTimeout(this.broadcastEndpointURL,h,(s=a.timeout)!==null&&s!==void 0?s:this.timeout);return await((o=p.body)===null||o===void 0?void 0:o.cancel()),p.ok?"ok":"error"}catch(p){return p instanceof Error&&p.name==="AbortError"?"timed out":"error"}}else return new Promise(c=>{var u,d,h;const p=this.channelAdapter.push(t.type,t,a.timeout||this.timeout);t.type==="broadcast"&&!(!((h=(d=(u=this.params)===null||u===void 0?void 0:u.config)===null||d===void 0?void 0:d.broadcast)===null||h===void 0)&&h.ack)&&c("ok"),p.receive("ok",()=>c("ok")),p.receive("error",()=>c("error")),p.receive("timeout",()=>c("timed out"))})}updateJoinPayload(t){this.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(a=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>a("ok")).receive("timeout",()=>a("timed out")).receive("error",()=>a("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,a,s){const o=new AbortController,c=setTimeout(()=>o.abort(),s),u=await this.socket.fetch(t,Object.assign(Object.assign({},a),{signal:o.signal}));return clearTimeout(c),u}_on(t,a,s){const o=t.toLocaleLowerCase(),c=this.channelAdapter.on(t,s),u={type:o,filter:a,callback:s,ref:c};return this.bindings[o]?this.bindings[o].push(u):this.bindings[o]=[u],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,a,s)=>{var o,c,u,d,h,p,v;const g=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(g,s))return!1;const S=(o=this.bindings[g])===null||o===void 0?void 0:o.find(_=>_.ref===t.ref);if(!S)return!0;if(["broadcast","presence","postgres_changes"].includes(g))if("id"in S){const _=S.id,E=(c=S.filter)===null||c===void 0?void 0:c.event;return _&&((u=a.ids)===null||u===void 0?void 0:u.includes(_))&&(E==="*"||(E==null?void 0:E.toLocaleLowerCase())===((d=a.data)===null||d===void 0?void 0:d.type.toLocaleLowerCase()))}else{const _=(p=(h=S==null?void 0:S.filter)===null||h===void 0?void 0:h.event)===null||p===void 0?void 0:p.toLocaleLowerCase();return _==="*"||_===((v=a==null?void 0:a.event)===null||v===void 0?void 0:v.toLocaleLowerCase())}else return S.type.toLocaleLowerCase()===g})}_notThisChannelEvent(t,a){const{close:s,error:o,leave:c,join:u}=cw;return a&&[s,o,c,u].includes(t)&&a!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,a,s)=>{if(typeof a=="object"&&"ids"in a){const o=a.data,{schema:c,table:u,commit_timestamp:d,type:h,errors:p}=o;return Object.assign(Object.assign({},{schema:c,table:u,commit_timestamp:d,eventType:h,new:{},old:{},errors:p}),this._getPayloadRecords(o))}return a})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const a in t.bindings)for(const s of t.bindings[a])this._on(s.type,s.filter,s.callback)}static isFilterValueEqual(t,a){return(t??void 0)===(a??void 0)}_getPayloadRecords(t){const a={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(a.new=mb(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(a.old=mb(t.columns,t.old_record)),a}}class lA{constructor(t,a){this.socket=new tA(t,a)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(t){this.socket.heartbeatCallback=t}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(t,a,s,o=1e4){return new Promise(c=>{setTimeout(()=>c("timeout"),o),this.socket.disconnect(()=>{t(),c("ok")},a,s)})}push(t){this.socket.push(t)}log(t,a,s){this.socket.log(t,a,s)}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Nh.connecting}isDisconnecting(){return this.socket.connectionState()==Nh.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const yb={HEARTBEAT_INTERVAL:25e3},cA=[1e3,2e3,5e3,1e4],uA=1e4;function dA(){const e=new Map;return{get length(){return e.size},clear(){e.clear()},getItem(t){return e.has(t)?e.get(t):null},key(t){var a;return(a=Array.from(e.keys())[t])!==null&&a!==void 0?a:null},removeItem(t){e.delete(t)},setItem(t,a){e.set(t,String(a))}}}function fA(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return dA()}const hA=`
|
||
addEventListener("message", (e) => {
|
||
if (e.data.event === "start") {
|
||
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
|
||
}
|
||
});`;class mA{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(t,a){var s;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new IR,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=c=>c?(...u)=>c(...u):(...u)=>fetch(...u),!(!((s=a==null?void 0:a.params)===null||s===void 0)&&s.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=a.params.apikey;const o=this._initializeOptions(a);this.socketAdapter=new lA(t,o),this.httpEndpoint=dw(t),this.fetch=this._resolveFetch(a==null?void 0:a.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const a=t.message;throw a.includes("Node.js")?new Error(`${a}
|
||
|
||
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: ${a}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,a){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,a)}getChannels(){return this.channels}async removeChannel(t){const a=await t.unsubscribe();return a==="ok"&&t.teardown(),a}async removeAllChannels(){const t=this.channels.map(async s=>{const o=await s.unsubscribe();return s.teardown(),o}),a=await Promise.all(t);return await this.disconnect(),a}log(t,a,s){this.socketAdapter.log(t,a,s)}connectionState(){return this.socketAdapter.connectionState()||Nh.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,a={config:{}}){const s=`realtime:${t}`,o=this.getChannels().find(c=>c.topic===s);if(o)return o;{const c=new Ao(`realtime:${t}`,a,this);return this._cancelPendingDisconnect(),this.channels.push(c),c}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(a=>a.topic!==t.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(t=null){let a,s=!1;if(t)a=t,s=!0;else if(this.accessToken)try{a=await this.accessToken()}catch(o){this.log("error","Error fetching access token from callback",o),a=this.accessTokenValue}else a=this.accessTokenValue;s?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=a&&(this.accessTokenValue=a,this.channels.forEach(o=>{const c={access_token:a,version:LR};a&&o.updateJoinPayload(c),o.joinedOnce&&o.channelAdapter.isJoined()&&o.channelAdapter.push(cw.access_token,{access_token:a})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(a=>{this.log("error",`Error setting auth in ${t}`,a)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(a=>{this.log("error","error waiting for auth on connect",a)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(a,s)=>{a=="sent"&&this._setAuthSafely(),t&&t(a,s)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=a=>{this.log("worker","worker error",a.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=a=>{a.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(t){let a;if(t)a=t;else{const s=new Blob([hA],{type:"application/javascript"});a=URL.createObjectURL(s)}return a}_initializeOptions(t){var a,s,o,c,u,d,h,p,v,g,S,_;this.worker=(a=t==null?void 0:t.worker)!==null&&a!==void 0?a:!1,this.accessToken=(s=t==null?void 0:t.accessToken)!==null&&s!==void 0?s:null;const E={};E.timeout=(o=t==null?void 0:t.timeout)!==null&&o!==void 0?o:PR,E.heartbeatIntervalMs=(c=t==null?void 0:t.heartbeatIntervalMs)!==null&&c!==void 0?c:yb.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(u=t==null?void 0:t.disconnectOnEmptyChannelsAfterMs)!==null&&u!==void 0?u:2*((d=t==null?void 0:t.heartbeatIntervalMs)!==null&&d!==void 0?d:yb.HEARTBEAT_INTERVAL),E.transport=(h=t==null?void 0:t.transport)!==null&&h!==void 0?h:MR.getWebSocketConstructor(),E.params=t==null?void 0:t.params,E.logger=t==null?void 0:t.logger,E.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),E.sessionStorage=(p=t==null?void 0:t.sessionStorage)!==null&&p!==void 0?p:fA(),E.reconnectAfterMs=(v=t==null?void 0:t.reconnectAfterMs)!==null&&v!==void 0?v:(N=>cA[N-1]||uA);let x,R;const C=(g=t==null?void 0:t.vsn)!==null&&g!==void 0?g:zR;switch(C){case UR:x=(N,A)=>A(JSON.stringify(N)),R=(N,A)=>A(JSON.parse(N));break;case lw:x=this.serializer.encode.bind(this.serializer),R=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${E.vsn}`)}if(E.vsn=C,E.encode=(S=t==null?void 0:t.encode)!==null&&S!==void 0?S:x,E.decode=(_=t==null?void 0:t.decode)!==null&&_!==void 0?_:R,E.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,E.params=Object.assign(Object.assign({},E.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl,E.autoSendHeartbeat=!this.worker}return E}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var Mo=class extends Error{constructor(e,t){var a;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((a=t.icebergType)==null?void 0:a.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function pA(e,t,a){const s=new URL(t,e);if(a)for(const[o,c]of Object.entries(a))c!==void 0&&s.searchParams.set(o,c);return s.toString()}async function gA(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function vA(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:a,path:s,query:o,body:c,headers:u}){const d=pA(e.baseUrl,s,o),h=await gA(e.auth),p=await t(d,{method:a,headers:{...c?{"Content-Type":"application/json"}:{},...h,...u},body:c?JSON.stringify(c):void 0}),v=await p.text(),g=(p.headers.get("content-type")||"").includes("application/json"),S=g&&v?JSON.parse(v):v;if(!p.ok){const _=g?S:void 0,E=_==null?void 0:_.error;throw new Mo((E==null?void 0:E.message)??`Request failed with status ${p.status}`,{status:p.status,icebergType:E==null?void 0:E.type,icebergCode:E==null?void 0:E.code,details:_})}return{status:p.status,headers:p.headers,data:S}}}}function wc(e){return e.join("")}var yA=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:wc(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(s=>({namespace:s}))}async createNamespace(e,t){const a={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:a})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${wc(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${wc(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${wc(e.namespace)}`}),!0}catch(t){if(t instanceof Mo&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(a){if(a instanceof Mo&&a.status===409)return;throw a}}};function Vs(e){return e.join("")}var bA=class{constructor(e,t="",a){this.client=e,this.prefix=t,this.accessDelegation=a}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Vs(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const a={};return this.accessDelegation&&(a["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Vs(e.namespace)}/tables`,body:t,headers:a})).data.metadata}async updateTable(e,t){const a=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${Vs(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":a.data["metadata-location"],metadata:a.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Vs(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Vs(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Vs(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(a){if(a instanceof Mo&&a.status===404)return!1;throw a}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(a){if(a instanceof Mo&&a.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw a}}},wA=class{constructor(e){var s;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const a=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=vA({baseUrl:a,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(s=e.accessDelegation)==null?void 0:s.join(","),this.namespaceOps=new yA(this.client,t),this.tableOps=new bA(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function Do(e){"@babel/helpers - typeof";return Do=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Do(e)}function SA(e,t){if(Do(e)!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var s=a.call(e,t);if(Do(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _A(e){var t=SA(e,"string");return Do(t)=="symbol"?t:t+""}function xA(e,t,a){return(t=_A(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function bb(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),a.push.apply(a,s)}return a}function _e(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?bb(Object(a),!0).forEach(function(s){xA(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):bb(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}var vu=class extends Error{constructor(e,t="storage",a,s){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=a,this.statusCode=s}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function yu(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var Mh=class extends vu{constructor(e,t,a,s="storage"){super(e,s,t,a),this.name=s==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=a}toJSON(){return _e({},super.toJSON())}},hw=class extends vu{constructor(e,t,a="storage"){super(e,a),this.name=a==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function Zc(e,t,a){const s=_e({},e),o=t.toLowerCase();for(const c of Object.keys(s))c.toLowerCase()===o&&delete s[c];return s[o]=a,s}function EA(e){const t={};for(const[a,s]of Object.entries(e))t[a.toLowerCase()]=s;return t}const TA=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),CA=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Dh=e=>{if(Array.isArray(e))return e.map(a=>Dh(a));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([a,s])=>{const o=a.replace(/([-_][a-z])/gi,c=>c.toUpperCase().replace(/[-_]/g,""));t[o]=Dh(s)}),t},RA=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),wb=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error;if(typeof t.error=="object"&&t.error!==null){const a=t.error;if(typeof a.message=="string")return a.message}}return JSON.stringify(e)},AA=async(e,t,a,s)=>{if(e!==null&&typeof e=="object"&&"json"in e&&typeof e.json=="function"){const o=e;let c=parseInt(String(o.status),10);Number.isFinite(c)||(c=500),o.json().then(u=>{const d=(u==null?void 0:u.statusCode)||(u==null?void 0:u.code)||c+"";t(new Mh(wb(u),c,d,s))}).catch(()=>{const u=c+"";t(new Mh(o.statusText||`HTTP ${c} error`,c,u,s))})}else t(new hw(wb(e),e,s))},NA=(e,t,a,s)=>{const o={method:e,headers:(t==null?void 0:t.headers)||{}};if(e==="GET"||e==="HEAD"||!s)return _e(_e({},o),a);if(CA(s)){var c;const u=(t==null?void 0:t.headers)||{};let d;for(const[h,p]of Object.entries(u))h.toLowerCase()==="content-type"&&(d=p);o.headers=Zc(u,"Content-Type",(c=d)!==null&&c!==void 0?c:"application/json"),o.body=JSON.stringify(s)}else o.body=s;return t!=null&&t.duplex&&(o.duplex=t.duplex),_e(_e({},o),a)};async function vo(e,t,a,s,o,c,u){return new Promise((d,h)=>{e(a,NA(t,s,o,c)).then(p=>{if(!p.ok)throw p;if(s!=null&&s.noResolveJson)return p;if(u==="vectors"){const v=p.headers.get("content-type");if(p.headers.get("content-length")==="0"||p.status===204)return{};if(!v||!v.includes("application/json"))return{}}return p.json()}).then(p=>d(p)).catch(p=>AA(p,h,s,u))})}function mw(e="storage"){return{get:async(t,a,s,o)=>vo(t,"GET",a,s,o,void 0,e),post:async(t,a,s,o,c)=>vo(t,"POST",a,o,c,s,e),put:async(t,a,s,o,c)=>vo(t,"PUT",a,o,c,s,e),head:async(t,a,s,o)=>vo(t,"HEAD",a,_e(_e({},s),{},{noResolveJson:!0}),o,void 0,e),remove:async(t,a,s,o,c)=>vo(t,"DELETE",a,o,c,s,e)}}const OA=mw("storage"),{get:Lo,post:jn,put:Lh,head:kA,remove:vm}=OA,sn=mw("vectors");var gi=class{constructor(e,t={},a,s="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=EA(t),this.fetch=TA(a),this.namespace=s}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Zc(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(a){if(t.shouldThrowOnError)throw a;if(yu(a))return{data:null,error:a};throw a}}};let pw;pw=Symbol.toStringTag;var jA=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[pw]="StreamDownloadBuilder",this.promise=null}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(yu(t))return{data:null,error:t};throw t}}};let gw;gw=Symbol.toStringTag;var MA=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[gw]="BlobDownloadBuilder",this.promise=null}asStream(){return new jA(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(yu(t))return{data:null,error:t};throw t}}};const DA={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Sb={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var LA=class extends gi{constructor(e,t={},a,s){super(e,t,s,"storage"),this.bucketId=a}async uploadOrUpdate(e,t,a,s){var o=this;return o.handleOperation(async()=>{let c;const u=_e(_e({},Sb),s);let d=_e(_e({},o.headers),e==="POST"&&{"x-upsert":String(u.upsert)});const h=u.metadata;if(typeof Blob<"u"&&a instanceof Blob?(c=new FormData,c.append("cacheControl",u.cacheControl),h&&c.append("metadata",o.encodeMetadata(h)),c.append("",a)):typeof FormData<"u"&&a instanceof FormData?(c=a,c.has("cacheControl")||c.append("cacheControl",u.cacheControl),h&&!c.has("metadata")&&c.append("metadata",o.encodeMetadata(h))):(c=a,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType,h&&(d["x-metadata"]=o.toBase64(o.encodeMetadata(h))),(typeof ReadableStream<"u"&&c instanceof ReadableStream||c&&typeof c=="object"&&"pipe"in c&&typeof c.pipe=="function")&&!u.duplex&&(u.duplex="half")),s!=null&&s.headers)for(const[S,_]of Object.entries(s.headers))d=Zc(d,S,_);const p=o._removeEmptyFolders(t),v=o._getFinalPath(p),g=await(e=="PUT"?Lh:jn)(o.fetch,`${o.url}/object/${v}`,c,_e({headers:d},u!=null&&u.duplex?{duplex:u.duplex}:{}));return{path:p,id:g.Id,fullPath:g.Key}})}async upload(e,t,a){return this.uploadOrUpdate("POST",e,t,a)}async uploadToSignedUrl(e,t,a,s){var o=this;const c=o._removeEmptyFolders(e),u=o._getFinalPath(c),d=new URL(o.url+`/object/upload/sign/${u}`);return d.searchParams.set("token",t),o.handleOperation(async()=>{let h;const p=_e(_e({},Sb),s);let v=_e(_e({},o.headers),{"x-upsert":String(p.upsert)});const g=p.metadata;if(typeof Blob<"u"&&a instanceof Blob?(h=new FormData,h.append("cacheControl",p.cacheControl),g&&h.append("metadata",o.encodeMetadata(g)),h.append("",a)):typeof FormData<"u"&&a instanceof FormData?(h=a,h.has("cacheControl")||h.append("cacheControl",p.cacheControl),g&&!h.has("metadata")&&h.append("metadata",o.encodeMetadata(g))):(h=a,v["cache-control"]=`max-age=${p.cacheControl}`,v["content-type"]=p.contentType,g&&(v["x-metadata"]=o.toBase64(o.encodeMetadata(g))),(typeof ReadableStream<"u"&&h instanceof ReadableStream||h&&typeof h=="object"&&"pipe"in h&&typeof h.pipe=="function")&&!p.duplex&&(p.duplex="half")),s!=null&&s.headers)for(const[S,_]of Object.entries(s.headers))v=Zc(v,S,_);return{path:c,fullPath:(await Lh(o.fetch,d.toString(),h,_e({headers:v},p!=null&&p.duplex?{duplex:p.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var a=this;return a.handleOperation(async()=>{let s=a._getFinalPath(e);const o=_e({},a.headers);t!=null&&t.upsert&&(o["x-upsert"]="true");const c=await jn(a.fetch,`${a.url}/object/upload/sign/${s}`,{},{headers:o}),u=new URL(a.url+c.url),d=u.searchParams.get("token");if(!d)throw new vu("No token returned by API");return{signedUrl:u.toString(),path:e,token:d}})}async update(e,t,a){return this.uploadOrUpdate("PUT",e,t,a)}async move(e,t,a){var s=this;return s.handleOperation(async()=>await jn(s.fetch,`${s.url}/object/move`,{bucketId:s.bucketId,sourceKey:e,destinationKey:t,destinationBucket:a==null?void 0:a.destinationBucket},{headers:s.headers}))}async copy(e,t,a){var s=this;return s.handleOperation(async()=>({path:(await jn(s.fetch,`${s.url}/object/copy`,{bucketId:s.bucketId,sourceKey:e,destinationKey:t,destinationBucket:a==null?void 0:a.destinationBucket},{headers:s.headers})).Key}))}async createSignedUrl(e,t,a){var s=this;return s.handleOperation(async()=>{let o=s._getFinalPath(e);const c=typeof(a==null?void 0:a.transform)=="object"&&a.transform!==null&&Object.keys(a.transform).length>0;let u=await jn(s.fetch,`${s.url}/object/sign/${o}`,_e({expiresIn:t},c?{transform:a.transform}:{}),{headers:s.headers});const d=new URLSearchParams;a!=null&&a.download&&d.set("download",a.download===!0?"":a.download),(a==null?void 0:a.cacheNonce)!=null&&d.set("cacheNonce",String(a.cacheNonce));const h=d.toString();return{signedUrl:encodeURI(`${s.url}${u.signedURL}${h?`&${h}`:""}`)}})}async createSignedUrls(e,t,a){var s=this;return s.handleOperation(async()=>{const o=await jn(s.fetch,`${s.url}/object/sign/${s.bucketId}`,{expiresIn:t,paths:e},{headers:s.headers}),c=new URLSearchParams;a!=null&&a.download&&c.set("download",a.download===!0?"":a.download),(a==null?void 0:a.cacheNonce)!=null&&c.set("cacheNonce",String(a.cacheNonce));const u=c.toString();return o.map(d=>_e(_e({},d),{},{signedUrl:d.signedURL?encodeURI(`${s.url}${d.signedURL}${u?`&${u}`:""}`):null}))})}download(e,t,a){const s=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",o=new URLSearchParams;t!=null&&t.transform&&this.applyTransformOptsToQuery(o,t.transform),(t==null?void 0:t.cacheNonce)!=null&&o.set("cacheNonce",String(t.cacheNonce));const c=o.toString(),u=this._getFinalPath(e),d=()=>Lo(this.fetch,`${this.url}/${s}/${u}${c?`?${c}`:""}`,{headers:this.headers,noResolveJson:!0},a);return new MA(d,this.shouldThrowOnError)}async info(e){var t=this;const a=t._getFinalPath(e);return t.handleOperation(async()=>Dh(await Lo(t.fetch,`${t.url}/object/info/${a}`,{headers:t.headers})))}async exists(e){var t=this;const a=t._getFinalPath(e);try{return await kA(t.fetch,`${t.url}/object/${a}`,{headers:t.headers}),{data:!0,error:null}}catch(o){if(t.shouldThrowOnError)throw o;if(yu(o)){var s;const c=o instanceof Mh?o.status:o instanceof hw?(s=o.originalError)===null||s===void 0?void 0:s.status:void 0;if(c!==void 0&&[400,404].includes(c))return{data:!1,error:o}}throw o}}getPublicUrl(e,t){const a=this._getFinalPath(e),s=new URLSearchParams;t!=null&&t.download&&s.set("download",t.download===!0?"":t.download),t!=null&&t.transform&&this.applyTransformOptsToQuery(s,t.transform),(t==null?void 0:t.cacheNonce)!=null&&s.set("cacheNonce",String(t.cacheNonce));const o=s.toString(),c=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${c}/public/${a}`)+(o?`?${o}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await vm(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,a){var s=this;return s.handleOperation(async()=>{const o=_e(_e(_e({},DA),t),{},{prefix:e||""});return await jn(s.fetch,`${s.url}/object/list/${s.bucketId}`,o,{headers:s.headers},a)})}async listV2(e,t){var a=this;return a.handleOperation(async()=>{const s=_e({},e);return await jn(a.fetch,`${a.url}/object/list-v2/${a.bucketId}`,s,{headers:a.headers},t)})}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,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("quality",t.quality.toString()),e}};const UA="2.106.2",Xo={"X-Client-Info":`storage-js/${UA}`};var zA=class extends gi{constructor(e,t={},a,s){const o=new URL(e);s!=null&&s.useNewHostname&&/supabase\.(co|in|red)$/.test(o.hostname)&&!o.hostname.includes("storage.supabase.")&&(o.hostname=o.hostname.replace("supabase.","storage.supabase."));const c=o.href.replace(/\/$/,""),u=_e(_e({},Xo),t);super(c,u,a,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const a=t.listBucketOptionsToQueryString(e);return await Lo(t.fetch,`${t.url}/bucket${a}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Lo(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var a=this;return a.handleOperation(async()=>await jn(a.fetch,`${a.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:a.headers}))}async updateBucket(e,t){var a=this;return a.handleOperation(async()=>await Lh(a.fetch,`${a.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:a.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await jn(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await vm(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},PA=class extends gi{constructor(e,t={},a){const s=e.replace(/\/$/,""),o=_e(_e({},Xo),t);super(s,o,a,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await jn(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const a=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&a.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&a.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&a.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&a.set("sortOrder",e.sortOrder),e!=null&&e.search&&a.set("search",e.search);const s=a.toString(),o=s?`${t.url}/bucket?${s}`:`${t.url}/bucket`;return await Lo(t.fetch,o,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await vm(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!RA(e))throw new vu("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const a=new wA({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),s=this.shouldThrowOnError;return new Proxy(a,{get(o,c){const u=o[c];return typeof u!="function"?u:async(...d)=>{try{return{data:await u.apply(o,d),error:null}}catch(h){if(s)throw h;return{data:null,error:h}}}}})}},BA=class extends gi{constructor(e,t={},a){const s=e.replace(/\/$/,""),o=_e(_e({},Xo),{},{"Content-Type":"application/json"},t);super(s,o,a,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await sn.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var a=this;return a.handleOperation(async()=>await sn.post(a.fetch,`${a.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:a.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await sn.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var a=this;return a.handleOperation(async()=>await sn.post(a.fetch,`${a.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:a.headers})||{})}},IA=class extends gi{constructor(e,t={},a){const s=e.replace(/\/$/,""),o=_e(_e({},Xo),{},{"Content-Type":"application/json"},t);super(s,o,a,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await sn.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await sn.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;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 t.handleOperation(async()=>await sn.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await sn.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await sn.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},$A=class extends gi{constructor(e,t={},a){const s=e.replace(/\/$/,""),o=_e(_e({},Xo),{},{"Content-Type":"application/json"},t);super(s,o,a,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await sn.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await sn.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await sn.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await sn.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},HA=class extends $A{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new qA(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,a=this;return t().call(a,e)}async getBucket(e){var t=()=>super.getBucket,a=this;return t().call(a,e)}async listBuckets(e={}){var t=()=>super.listBuckets,a=this;return t().call(a,e)}async deleteBucket(e){var t=()=>super.deleteBucket,a=this;return t().call(a,e)}},qA=class extends BA{constructor(e,t,a,s){super(e,t,s),this.vectorBucketName=a}async createIndex(e){var t=()=>super.createIndex,a=this;return t().call(a,_e(_e({},e),{},{vectorBucketName:a.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,a=this;return t().call(a,_e(_e({},e),{},{vectorBucketName:a.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,a=this;return t().call(a,a.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,a=this;return t().call(a,a.vectorBucketName,e)}index(e){return new GA(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},GA=class extends IA{constructor(e,t,a,s,o){super(e,t,o),this.vectorBucketName=a,this.indexName=s}async putVectors(e){var t=()=>super.putVectors,a=this;return t().call(a,_e(_e({},e),{},{vectorBucketName:a.vectorBucketName,indexName:a.indexName}))}async getVectors(e){var t=()=>super.getVectors,a=this;return t().call(a,_e(_e({},e),{},{vectorBucketName:a.vectorBucketName,indexName:a.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,a=this;return t().call(a,_e(_e({},e),{},{vectorBucketName:a.vectorBucketName,indexName:a.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,a=this;return t().call(a,_e(_e({},e),{},{vectorBucketName:a.vectorBucketName,indexName:a.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,a=this;return t().call(a,_e(_e({},e),{},{vectorBucketName:a.vectorBucketName,indexName:a.indexName}))}},VA=class extends zA{constructor(e,t={},a,s){super(e,t,a,s)}from(e){return new LA(this.url,this.headers,e,this.fetch)}get vectors(){return new HA(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new PA(this.url+"/iceberg",this.headers,this.fetch)}};const vw="2.106.2",ei=30*1e3,Uh=3,ih=Uh*ei,KA="http://localhost:9999",YA="supabase.auth.token",FA={"X-Client-Info":`gotrue-js/${vw}`},zh="X-Supabase-Api-Version",yw={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},WA=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,XA=600*1e3;class ci extends Error{constructor(t,a,s){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=a,this.code=s}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function oe(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class JA extends ci{constructor(t,a,s){super(t,a,s),this.name="AuthApiError",this.status=a,this.code=s}}function QA(e){return oe(e)&&e.name==="AuthApiError"}class Mn extends ci{constructor(t,a){super(t),this.name="AuthUnknownError",this.originalError=a}}class kr extends ci{constructor(t,a,s,o){super(t,s,o),this.name=a,this.status=s}}class St extends kr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Sc(e){return oe(e)&&e.name==="AuthSessionMissingError"}class Ks extends kr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class _c extends kr{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class xc extends kr{constructor(t,a=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=a}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function ZA(e){return oe(e)&&e.name==="AuthImplicitGrantRedirectError"}class _b extends kr{constructor(t,a=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=a}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class eN extends kr{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class Ph extends kr{constructor(t,a){super(t,"AuthRetryableFetchError",a,void 0)}}function oh(e){return oe(e)&&e.name==="AuthRetryableFetchError"}class xb extends kr{constructor(t,a,s){super(t,"AuthWeakPasswordError",a,"weak_password"),this.reasons=s}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class Bh extends kr{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const eu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Eb=`
|
||
\r=`.split(""),tN=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<Eb.length;t+=1)e[Eb[t].charCodeAt(0)]=-2;for(let t=0;t<eu.length;t+=1)e[eu[t].charCodeAt(0)]=t;return e})();function Tb(e,t,a){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const s=t.queue>>t.queuedBits-6&63;a(eu[s]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const s=t.queue>>t.queuedBits-6&63;a(eu[s]),t.queuedBits-=6}}function bw(e,t,a){const s=tN[e];if(s>-1)for(t.queue=t.queue<<6|s,t.queuedBits+=6;t.queuedBits>=8;)a(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(s===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function Cb(e){const t=[],a=u=>{t.push(String.fromCodePoint(u))},s={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},c=u=>{aN(u,s,a)};for(let u=0;u<e.length;u+=1)bw(e.charCodeAt(u),o,c);return t.join("")}function nN(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function rN(e,t){for(let a=0;a<e.length;a+=1){let s=e.charCodeAt(a);if(s>55295&&s<=56319){const o=(s-55296)*1024&65535;s=(e.charCodeAt(a+1)-56320&65535|o)+65536,a+=1}nN(s,t)}}function aN(e,t,a){if(t.utf8seq===0){if(e<=127){a(e);return}for(let s=1;s<6;s+=1)if((e>>7-s&1)===0){t.utf8seq=s;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&a(t.codepoint)}}function ii(e){const t=[],a={queue:0,queuedBits:0},s=o=>{t.push(o)};for(let o=0;o<e.length;o+=1)bw(e.charCodeAt(o),a,s);return new Uint8Array(t)}function sN(e){const t=[];return rN(e,a=>t.push(a)),new Uint8Array(t)}function Ka(e){const t=[],a={queue:0,queuedBits:0},s=o=>{t.push(o)};return e.forEach(o=>Tb(o,a,s)),Tb(null,a,s),t.join("")}function iN(e){return Math.round(Date.now()/1e3)+e}function oN(){return Symbol("auth-callback")}const At=()=>typeof window<"u"&&typeof document<"u",$a={tested:!1,writable:!1},ww=()=>{if(!At())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if($a.tested)return $a.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),$a.tested=!0,$a.writable=!0}catch{$a.tested=!0,$a.writable=!1}return $a.writable};function lN(e){const t={},a=new URL(e);if(a.hash&&a.hash[0]==="#")try{new URLSearchParams(a.hash.substring(1)).forEach((o,c)=>{t[c]=o})}catch{}return a.searchParams.forEach((s,o)=>{t[o]=s}),t}const Sw=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),cN=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",ti=async(e,t,a)=>{await e.setItem(t,JSON.stringify(a))},Ha=async(e,t)=>{const a=await e.getItem(t);if(!a)return null;try{return JSON.parse(a)}catch{return null}},Rt=async(e,t)=>{await e.removeItem(t)};class bu{constructor(){this.promise=new bu.promiseConstructor((t,a)=>{this.resolve=t,this.reject=a})}}bu.promiseConstructor=Promise;function Ec(e){const t=e.split(".");if(t.length!==3)throw new Bh("Invalid JWT structure");for(let s=0;s<t.length;s++)if(!WA.test(t[s]))throw new Bh("JWT not in base64url format");return{header:JSON.parse(Cb(t[0])),payload:JSON.parse(Cb(t[1])),signature:ii(t[2]),raw:{header:t[0],payload:t[1]}}}async function uN(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function dN(e,t){return new Promise((s,o)=>{(async()=>{for(let c=0;c<1/0;c++)try{const u=await e(c);if(!t(c,null,u)){s(u);return}}catch(u){if(!t(c,u)){o(u);return}}})()})}function fN(e){return("0"+e.toString(16)).substr(-2)}function hN(){const t=new Uint32Array(56);if(typeof crypto>"u"){const a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",s=a.length;let o="";for(let c=0;c<56;c++)o+=a.charAt(Math.floor(Math.random()*s));return o}return crypto.getRandomValues(t),Array.from(t,fN).join("")}async function mN(e){const a=new TextEncoder().encode(e),s=await crypto.subtle.digest("SHA-256",a),o=new Uint8Array(s);return Array.from(o).map(c=>String.fromCharCode(c)).join("")}async function pN(e){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."),e;const a=await mN(e);return btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Ys(e,t,a=!1){const s=hN();let o=s;a&&(o+="/recovery"),await ti(e,`${t}-code-verifier`,o);const c=await pN(s);return[c,s===c?"plain":"s256"]}const gN=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function vN(e){const t=e.headers.get(zh);if(!t||!t.match(gN))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function yN(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function bN(e){switch(e){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 wN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Sr(e){if(!wN.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function On(e){if(!e.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function lh(){const e={};return new Proxy(e,{get:(t,a)=>{if(a==="__isUserNotAvailableProxy")return!0;if(typeof a=="symbol"){const s=a.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="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 "${a}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,a)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${a}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,a)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${a}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function SN(e,t){return new Proxy(e,{get:(a,s,o)=>{if(s==="__isInsecureUserWarningProxy")return!0;if(typeof s=="symbol"){const c=s.toString();if(c==="Symbol(Symbol.toPrimitive)"||c==="Symbol(Symbol.toStringTag)"||c==="Symbol(util.inspect.custom)"||c==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(a,s,o)}return!t.value&&typeof s=="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."),t.value=!0),Reflect.get(a,s,o)}})}function Rb(e){return JSON.parse(JSON.stringify(e))}const Va=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error}return JSON.stringify(e)},_N=[502,503,504,520,521,522,523,524,530];async function Ab(e){var t;if(!cN(e))throw new Ph(Va(e),0);if(_N.includes(e.status))throw new Ph(Va(e),e.status);let a;try{a=await e.json()}catch(c){throw new Mn(Va(c),c)}let s;const o=vN(e);if(o&&o.getTime()>=yw["2024-01-01"].timestamp&&typeof a=="object"&&a&&typeof a.code=="string"?s=a.code:typeof a=="object"&&a&&typeof a.error_code=="string"&&(s=a.error_code),s){if(s==="weak_password")throw new xb(Va(a),e.status,((t=a.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(s==="session_not_found")throw new St}else if(typeof a=="object"&&a&&typeof a.weak_password=="object"&&a.weak_password&&Array.isArray(a.weak_password.reasons)&&a.weak_password.reasons.length&&a.weak_password.reasons.reduce((c,u)=>c&&typeof u=="string",!0))throw new xb(Va(a),e.status,a.weak_password.reasons);throw new JA(Va(a),e.status||500,s)}const xN=(e,t,a,s)=>{const o={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),o.body=JSON.stringify(s),Object.assign(Object.assign({},o),a))};async function ge(e,t,a,s){var o;const c=Object.assign({},s==null?void 0:s.headers);c[zh]||(c[zh]=yw["2024-01-01"].name),s!=null&&s.jwt&&(c.Authorization=`Bearer ${s.jwt}`);const u=(o=s==null?void 0:s.query)!==null&&o!==void 0?o:{};s!=null&&s.redirectTo&&(u.redirect_to=s.redirectTo);const d=Object.keys(u).length?"?"+new URLSearchParams(u).toString():"",h=await EN(e,t,a+d,{headers:c,noResolveJson:s==null?void 0:s.noResolveJson},{},s==null?void 0:s.body);return s!=null&&s.xform?s==null?void 0:s.xform(h):{data:Object.assign({},h),error:null}}async function EN(e,t,a,s,o,c){const u=xN(t,s,o,c);let d;try{d=await e(a,Object.assign({},u))}catch(h){throw console.error(h),new Ph(Va(h),0)}if(d.ok||await Ab(d),s!=null&&s.noResolveJson)return d;try{return await d.json()}catch(h){await Ab(h)}}function wn(e){var t;let a=null;RN(e)&&(a=Object.assign({},e),e.expires_at||(a.expires_at=iN(e.expires_in)));const s=(t=e.user)!==null&&t!==void 0?t:typeof(e==null?void 0:e.id)=="string"?e:null;return{data:{session:a,user:s},error:null}}function Nb(e){const t=wn(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((a,s)=>a&&typeof s=="string",!0)&&(t.data.weak_password=e.weak_password),t}function da(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function TN(e){return{data:e,error:null}}function CN(e){const{action_link:t,email_otp:a,hashed_token:s,redirect_to:o,verification_type:c}=e,u=pi(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),d={action_link:t,email_otp:a,hashed_token:s,redirect_to:o,verification_type:c},h=Object.assign({},u);return{data:{properties:d,user:h},error:null}}function Ob(e){return e}function RN(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}const ch=["global","local","others"];class AN{_encodePathSegment(t){if(t==="."||t==="..")throw new ci("Invalid path segment");return encodeURIComponent(t)}constructor({url:t="",headers:a={},fetch:s,experimental:o}){this.url=t,this.headers=a,this.fetch=Sw(s),this.experimental=o??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(t,a=ch[0]){if(ch.indexOf(a)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${ch.join(", ")}`);try{return await ge(this.fetch,"POST",`${this.url}/logout?scope=${a}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(s){if(oe(s))return{data:null,error:s};throw s}}async inviteUserByEmail(t,a={}){try{return await ge(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:a.data},headers:this.headers,redirectTo:a.redirectTo,xform:da})}catch(s){if(oe(s))return{data:{user:null},error:s};throw s}}async generateLink(t){try{const{options:a}=t,s=pi(t,["options"]),o=Object.assign(Object.assign({},s),a);return"newEmail"in s&&(o.new_email=s==null?void 0:s.newEmail,delete o.newEmail),await ge(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:CN,redirectTo:a==null?void 0:a.redirectTo})}catch(a){if(oe(a))return{data:{properties:null,user:null},error:a};throw a}}async createUser(t){try{return await ge(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:da})}catch(a){if(oe(a))return{data:{user:null},error:a};throw a}}async listUsers(t){var a,s,o,c,u,d,h;try{const p={nextPage:null,lastPage:0,total:0},v=await ge(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(s=(a=t==null?void 0:t.page)===null||a===void 0?void 0:a.toString())!==null&&s!==void 0?s:"",per_page:(c=(o=t==null?void 0:t.perPage)===null||o===void 0?void 0:o.toString())!==null&&c!==void 0?c:""},xform:Ob});if(v.error)throw v.error;const g=await v.json(),S=(u=v.headers.get("x-total-count"))!==null&&u!==void 0?u:0,_=(h=(d=v.headers.get("link"))===null||d===void 0?void 0:d.split(","))!==null&&h!==void 0?h:[];return _.length>0&&(_.forEach(E=>{const x=parseInt(E.split(";")[0].split("=")[1].substring(0,1)),R=JSON.parse(E.split(";")[1].split("=")[1]);p[`${R}Page`]=x}),p.total=parseInt(S)),{data:Object.assign(Object.assign({},g),p),error:null}}catch(p){if(oe(p))return{data:{users:[]},error:p};throw p}}async getUserById(t){Sr(t);try{return await ge(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:da})}catch(a){if(oe(a))return{data:{user:null},error:a};throw a}}async updateUserById(t,a){Sr(t);try{return await ge(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:a,headers:this.headers,xform:da})}catch(s){if(oe(s))return{data:{user:null},error:s};throw s}}async deleteUser(t,a=!1){Sr(t);try{return await ge(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:a},xform:da})}catch(s){if(oe(s))return{data:{user:null},error:s};throw s}}async _listFactors(t){Sr(t.userId);try{const{data:a,error:s}=await ge(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:o=>({data:{factors:o},error:null})});return{data:a,error:s}}catch(a){if(oe(a))return{data:null,error:a};throw a}}async _deleteFactor(t){Sr(t.userId),Sr(t.id);try{return{data:await ge(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(a){if(oe(a))return{data:null,error:a};throw a}}async _listOAuthClients(t){var a,s,o,c,u,d,h;try{const p={nextPage:null,lastPage:0,total:0},v=await ge(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(s=(a=t==null?void 0:t.page)===null||a===void 0?void 0:a.toString())!==null&&s!==void 0?s:"",per_page:(c=(o=t==null?void 0:t.perPage)===null||o===void 0?void 0:o.toString())!==null&&c!==void 0?c:""},xform:Ob});if(v.error)throw v.error;const g=await v.json(),S=(u=v.headers.get("x-total-count"))!==null&&u!==void 0?u:0,_=(h=(d=v.headers.get("link"))===null||d===void 0?void 0:d.split(","))!==null&&h!==void 0?h:[];return _.length>0&&(_.forEach(E=>{const x=parseInt(E.split(";")[0].split("=")[1].substring(0,1)),R=JSON.parse(E.split(";")[1].split("=")[1]);p[`${R}Page`]=x}),p.total=parseInt(S)),{data:Object.assign(Object.assign({},g),p),error:null}}catch(p){if(oe(p))return{data:{clients:[]},error:p};throw p}}async _createOAuthClient(t){try{return await ge(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:a=>({data:a,error:null})})}catch(a){if(oe(a))return{data:null,error:a};throw a}}async _getOAuthClient(t){try{const a=this._encodePathSegment(t);return await ge(this.fetch,"GET",`${this.url}/admin/oauth/clients/${a}`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(a){if(oe(a))return{data:null,error:a};throw a}}async _updateOAuthClient(t,a){try{const s=this._encodePathSegment(t);return await ge(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${s}`,{body:a,headers:this.headers,xform:o=>({data:o,error:null})})}catch(s){if(oe(s))return{data:null,error:s};throw s}}async _deleteOAuthClient(t){try{const a=this._encodePathSegment(t);return await ge(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${a}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(a){if(oe(a))return{data:null,error:a};throw a}}async _regenerateOAuthClientSecret(t){try{const a=this._encodePathSegment(t);return await ge(this.fetch,"POST",`${this.url}/admin/oauth/clients/${a}/regenerate_secret`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(a){if(oe(a))return{data:null,error:a};throw a}}async _listCustomProviders(t){try{const a={};return t!=null&&t.type&&(a.type=t.type),await ge(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:a,xform:s=>{var o;return{data:{providers:(o=s==null?void 0:s.providers)!==null&&o!==void 0?o:[]},error:null}}})}catch(a){if(oe(a))return{data:{providers:[]},error:a};throw a}}async _createCustomProvider(t){try{return await ge(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:a=>({data:a,error:null})})}catch(a){if(oe(a))return{data:null,error:a};throw a}}async _getCustomProvider(t){try{const a=this._encodePathSegment(t);return await ge(this.fetch,"GET",`${this.url}/admin/custom-providers/${a}`,{headers:this.headers,xform:s=>({data:s,error:null})})}catch(a){if(oe(a))return{data:null,error:a};throw a}}async _updateCustomProvider(t,a){try{const s=this._encodePathSegment(t);return await ge(this.fetch,"PUT",`${this.url}/admin/custom-providers/${s}`,{body:a,headers:this.headers,xform:o=>({data:o,error:null})})}catch(s){if(oe(s))return{data:null,error:s};throw s}}async _deleteCustomProvider(t){try{const a=this._encodePathSegment(t);return await ge(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${a}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(a){if(oe(a))return{data:null,error:a};throw a}}async _adminListPasskeys(t){On(this.experimental),Sr(t.userId);try{return await ge(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/passkeys`,{headers:this.headers,xform:a=>({data:a,error:null})})}catch(a){if(oe(a))return{data:null,error:a};throw a}}async _adminDeletePasskey(t){On(this.experimental),Sr(t.userId),Sr(t.passkeyId);try{return await ge(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/passkeys/${t.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(a){if(oe(a))return{data:null,error:a};throw a}}}function kb(e={}){return{getItem:t=>e[t]||null,setItem:(t,a)=>{e[t]=a},removeItem:t=>{delete e[t]}}}const Vn={debug:!!(globalThis&&ww()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class _w extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class jb extends _w{}async function NN(e,t,a){Vn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const s=new globalThis.AbortController;let o;t>0&&(o=setTimeout(()=>{s.abort(),Vn.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t)),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:s.signal},async c=>{if(c){clearTimeout(o),Vn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,c.name);try{return await a()}finally{Vn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,c.name)}}else{if(t===0)throw Vn.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new jb(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(Vn.debug)try{const u=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(u,null," "))}catch(u){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",u)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(o),await a()}})}catch(c){if(t>0&&clearTimeout(o),c!==null&&typeof c=="object"&&"name"in c&&c.name==="AbortError"&&t>0){if(s.signal.aborted)return Vn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async u=>{if(u){Vn.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,u.name);try{return await a()}finally{Vn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,u.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await a()}));throw Vn.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",e),new jb(`Lock "${e}" was released because another request stole it`)}throw c}}function ON(){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 xw(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function kN(e){return parseInt(e,16)}function jN(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,s=>s.toString(16).padStart(2,"0")).join("")}function MN(e){var t;const{chainId:a,domain:s,expirationTime:o,issuedAt:c=new Date,nonce:u,notBefore:d,requestId:h,resources:p,scheme:v,uri:g,version:S}=e;{if(!Number.isInteger(a))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${a}`);if(!s)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(u&&u.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${u}`);if(!g)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(S!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${S}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
|
||
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const _=xw(e.address),E=v?`${v}://${s}`:s,x=e.statement?`${e.statement}
|
||
`:"",R=`${E} wants you to sign in with your Ethereum account:
|
||
${_}
|
||
|
||
${x}`;let C=`URI: ${g}
|
||
Version: ${S}
|
||
Chain ID: ${a}${u?`
|
||
Nonce: ${u}`:""}
|
||
Issued At: ${c.toISOString()}`;if(o&&(C+=`
|
||
Expiration Time: ${o.toISOString()}`),d&&(C+=`
|
||
Not Before: ${d.toISOString()}`),h&&(C+=`
|
||
Request ID: ${h}`),p){let N=`
|
||
Resources:`;for(const A of p){if(!A||typeof A!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${A}`);N+=`
|
||
- ${A}`}C+=N}return`${R}
|
||
${C}`}class ht extends Error{constructor({message:t,code:a,cause:s,name:o}){var c;super(t,{cause:s}),this.__isWebAuthnError=!0,this.name=(c=o??(s instanceof Error?s.name:void 0))!==null&&c!==void 0?c:"Unknown Error",this.code=a}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class tu extends ht{constructor(t,a){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:a,message:t}),this.name="WebAuthnUnknownError",this.originalError=a}}function DN({error:e,options:t}){var a,s,o;const{publicKey:c}=t;if(!c)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new ht({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((a=c.authenticatorSelection)===null||a===void 0?void 0:a.requireResidentKey)===!0)return new ht({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((s=c.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new ht({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((o=c.authenticatorSelection)===null||o===void 0?void 0:o.userVerification)==="required")return new ht({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new ht({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new ht({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return c.pubKeyCredParams.filter(d=>d.type==="public-key").length===0?new ht({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new ht({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const u=window.location.hostname;if(Ew(u)){if(c.rp.id!==u)return new ht({message:`The RP ID "${c.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new ht({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(c.user.id.byteLength<1||c.user.id.byteLength>64)return new ht({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new ht({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new ht({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function LN({error:e,options:t}){const{publicKey:a}=t;if(!a)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new ht({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new ht({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const s=window.location.hostname;if(Ew(s)){if(a.rpId!==s)return new ht({message:`The RP ID "${a.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new ht({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new ht({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new ht({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class UN{createNewAbortSignal(){if(this.controller){const a=new Error("Cancelling existing WebAuthn API call for new one");a.name="AbortError",this.controller.abort(a)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const Ih=new UN;function Mb(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:a,excludeCredentials:s}=e,o=pi(e,["challenge","user","excludeCredentials"]),c=ii(t).buffer,u=Object.assign(Object.assign({},a),{id:ii(a.id).buffer}),d=Object.assign(Object.assign({},o),{challenge:c,user:u});if(s&&s.length>0){d.excludeCredentials=new Array(s.length);for(let h=0;h<s.length;h++){const p=s[h];d.excludeCredentials[h]=Object.assign(Object.assign({},p),{id:ii(p.id).buffer,type:p.type||"public-key",transports:p.transports})}}return d}function Db(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:a}=e,s=pi(e,["challenge","allowCredentials"]),o=ii(t).buffer,c=Object.assign(Object.assign({},s),{challenge:o});if(a&&a.length>0){c.allowCredentials=new Array(a.length);for(let u=0;u<a.length;u++){const d=a[u];c.allowCredentials[u]=Object.assign(Object.assign({},d),{id:ii(d.id).buffer,type:d.type||"public-key",transports:d.transports})}}return c}function Lb(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const a=e;return{id:e.id,rawId:e.id,response:{attestationObject:Ka(new Uint8Array(e.response.attestationObject)),clientDataJSON:Ka(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=a.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Ub(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const a=e,s=e.getClientExtensionResults(),o=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:Ka(new Uint8Array(o.authenticatorData)),clientDataJSON:Ka(new Uint8Array(o.clientDataJSON)),signature:Ka(new Uint8Array(o.signature)),userHandle:o.userHandle?Ka(new Uint8Array(o.userHandle)):void 0},type:"public-key",clientExtensionResults:s,authenticatorAttachment:(t=a.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Ew(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function nu(){var e,t;return!!(At()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function Tw(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new tu("Browser returned unexpected credential type",t)}:{data:null,error:new tu("Empty credential response",t)}}catch(t){return{data:null,error:DN({error:t,options:e})}}}async function Cw(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new tu("Browser returned unexpected credential type",t)}:{data:null,error:new tu("Empty credential response",t)}}catch(t){return{data:null,error:LN({error:t,options:e})}}}const zN={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},PN={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function ru(...e){const t=o=>o!==null&&typeof o=="object"&&!Array.isArray(o),a=o=>o instanceof ArrayBuffer||ArrayBuffer.isView(o),s={};for(const o of e)if(o)for(const c in o){const u=o[c];if(u!==void 0)if(Array.isArray(u))s[c]=u;else if(a(u))s[c]=u;else if(t(u)){const d=s[c];t(d)?s[c]=ru(d,u):s[c]=ru(u)}else s[c]=u}return s}function BN(e,t){return ru(zN,e,t||{})}function IN(e,t){return ru(PN,e,t||{})}class $N{constructor(t){this.client=t,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(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:a,friendlyName:s,signal:o},c){var u;try{const{data:d,error:h}=await this.client.mfa.challenge({factorId:t,webauthn:a});if(!d)return{data:null,error:h};const p=o??Ih.createNewAbortSignal();if(d.webauthn.type==="create"){const{user:v}=d.webauthn.credential_options.publicKey;if(!v.name){const g=s;if(g)v.name=`${v.id}:${g}`;else{const _=(await this.client.getUser()).data.user,E=((u=_==null?void 0:_.user_metadata)===null||u===void 0?void 0:u.name)||(_==null?void 0:_.email)||(_==null?void 0:_.id)||"User";v.name=`${v.id}:${E}`}}v.displayName||(v.displayName=v.name)}switch(d.webauthn.type){case"create":{const v=BN(d.webauthn.credential_options.publicKey,c==null?void 0:c.create),{data:g,error:S}=await Tw({publicKey:v,signal:p});return g?{data:{factorId:t,challengeId:d.id,webauthn:{type:d.webauthn.type,credential_response:g}},error:null}:{data:null,error:S}}case"request":{const v=IN(d.webauthn.credential_options.publicKey,c==null?void 0:c.request),{data:g,error:S}=await Cw(Object.assign(Object.assign({},d.webauthn.credential_options),{publicKey:v,signal:p}));return g?{data:{factorId:t,challengeId:d.id,webauthn:{type:d.webauthn.type,credential_response:g}},error:null}:{data:null,error:S}}}}catch(d){return oe(d)?{data:null,error:d}:{data:null,error:new Mn("Unexpected error in challenge",d)}}}async _verify({challengeId:t,factorId:a,webauthn:s}){return this.client.mfa.verify({factorId:a,challengeId:t,webauthn:s})}async _authenticate({factorId:t,webauthn:{rpId:a=typeof window<"u"?window.location.hostname:void 0,rpOrigins:s=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},c){if(!a)return{data:null,error:new ci("rpId is required for WebAuthn authentication")};try{if(!nu())return{data:null,error:new Mn("Browser does not support WebAuthn",null)};const{data:u,error:d}=await this.challenge({factorId:t,webauthn:{rpId:a,rpOrigins:s},signal:o},{request:c});if(!u)return{data:null,error:d};const{webauthn:h}=u;return this._verify({factorId:t,challengeId:u.challengeId,webauthn:{type:h.type,rpId:a,rpOrigins:s,credential_response:h.credential_response}})}catch(u){return oe(u)?{data:null,error:u}:{data:null,error:new Mn("Unexpected error in authenticate",u)}}}async _register({friendlyName:t,webauthn:{rpId:a=typeof window<"u"?window.location.hostname:void 0,rpOrigins:s=typeof window<"u"?[window.location.origin]:void 0,signal:o}={}},c){if(!a)return{data:null,error:new ci("rpId is required for WebAuthn registration")};try{if(!nu())return{data:null,error:new Mn("Browser does not support WebAuthn",null)};const{data:u,error:d}=await this._enroll({friendlyName:t});if(!u)return await this.client.mfa.listFactors().then(v=>{var g;return(g=v.data)===null||g===void 0?void 0:g.all.find(S=>S.factor_type==="webauthn"&&S.friendly_name===t&&S.status!=="unverified")}).then(v=>v?this.client.mfa.unenroll({factorId:v==null?void 0:v.id}):void 0),{data:null,error:d};const{data:h,error:p}=await this._challenge({factorId:u.id,friendlyName:u.friendly_name,webauthn:{rpId:a,rpOrigins:s},signal:o},{create:c});return h?this._verify({factorId:u.id,challengeId:h.challengeId,webauthn:{rpId:a,rpOrigins:s,type:h.webauthn.type,credential_response:h.webauthn.credential_response}}):{data:null,error:p}}catch(u){return oe(u)?{data:null,error:u}:{data:null,error:new Mn("Unexpected error in register",u)}}}}ON();const HN={url:KA,storageKey:YA,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:FA,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function zb(e,t,a){return await a()}const Fs={};class Uo{get jwks(){var t,a;return(a=(t=Fs[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&a!==void 0?a:{keys:[]}}set jwks(t){Fs[this.storageKey]=Object.assign(Object.assign({},Fs[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,a;return(a=(t=Fs[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&a!==void 0?a:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Fs[this.storageKey]=Object.assign(Object.assign({},Fs[this.storageKey]),{cachedAt:t})}constructor(t){var a,s,o,c;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const u=Object.assign(Object.assign({},HN),t);if(this.storageKey=u.storageKey,this.instanceID=(a=Uo.nextInstanceID[this.storageKey])!==null&&a!==void 0?a:0,Uo.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!u.debug,typeof u.debug=="function"&&(this.logger=u.debug),this.instanceID>0&&At()){const d=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(d),this.logDebugMessages&&console.trace(d)}if(this.persistSession=u.persistSession,this.autoRefreshToken=u.autoRefreshToken,this.experimental=(s=u.experimental)!==null&&s!==void 0?s:{},this.admin=new AN({url:u.url,headers:u.headers,fetch:u.fetch,experimental:this.experimental}),this.url=u.url,this.headers=u.headers,this.fetch=Sw(u.fetch),this.lock=u.lock||zb,this.detectSessionInUrl=u.detectSessionInUrl,this.flowType=u.flowType,this.hasCustomAuthorizationHeader=u.hasCustomAuthorizationHeader,this.throwOnError=u.throwOnError,this.lockAcquireTimeout=u.lockAcquireTimeout,u.lock?this.lock=u.lock:this.persistSession&&At()&&(!((o=globalThis==null?void 0:globalThis.navigator)===null||o===void 0)&&o.locks)?this.lock=NN:this.lock=zb,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 $N(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(u.storage?this.storage=u.storage:ww()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=kb(this.memoryStorage)),u.userStorage&&(this.userStorage=u.userStorage)):(this.memoryStorage={},this.storage=kb(this.memoryStorage)),At()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(d){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",d)}(c=this.broadcastChannel)===null||c===void 0||c.addEventListener("message",async d=>{this._debug("received broadcast notification from other tab or client",d);try{await this._notifyAllSubscribers(d.data.event,d.data.session,!1)}catch(h){this._debug("#broadcastChannel","error",h)}})}u.skipAutoInitialize||this.initialize().catch(d=>{this._debug("#initialize()","error",d)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${vw}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let a={},s="none";if(At()&&(a=lN(window.location.href),this._isImplicitGrantCallback(a)?s="implicit":await this._isPKCECallback(a)&&(s="pkce")),At()&&this.detectSessionInUrl&&s!=="none"){const{data:o,error:c}=await this._getSessionFromURL(a,s);if(c){if(this._debug("#_initialize()","error detecting session from URL",c),ZA(c)){const h=(t=c.details)===null||t===void 0?void 0:t.code;if(h==="identity_already_exists"||h==="identity_not_found"||h==="single_identity_not_deletable")return{error:c}}return{error:c}}const{session:u,redirectType:d}=o;return this._debug("#_initialize()","detected session in URL",u,"redirect type",d),await this._saveSession(u),setTimeout(async()=>{d==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",u):await this._notifyAllSubscribers("SIGNED_IN",u)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(a){return oe(a)?this._returnResult({error:a}):this._returnResult({error:new Mn("Unexpected error during initialization",a)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var a,s,o;try{const c=await ge(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(s=(a=t==null?void 0:t.options)===null||a===void 0?void 0:a.data)!==null&&s!==void 0?s:{},gotrue_meta_security:{captcha_token:(o=t==null?void 0:t.options)===null||o===void 0?void 0:o.captchaToken}},xform:wn}),{data:u,error:d}=c;if(d||!u)return this._returnResult({data:{user:null,session:null},error:d});const h=u.session,p=u.user;return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",h)),this._returnResult({data:{user:p,session:h},error:null})}catch(c){if(oe(c))return this._returnResult({data:{user:null,session:null},error:c});throw c}}async signUp(t){var a,s,o;try{let c;if("email"in t){const{email:v,password:g,options:S}=t;let _=null,E=null;this.flowType==="pkce"&&([_,E]=await Ys(this.storage,this.storageKey)),c=await ge(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:S==null?void 0:S.emailRedirectTo,body:{email:v,password:g,data:(a=S==null?void 0:S.data)!==null&&a!==void 0?a:{},gotrue_meta_security:{captcha_token:S==null?void 0:S.captchaToken},code_challenge:_,code_challenge_method:E},xform:wn})}else if("phone"in t){const{phone:v,password:g,options:S}=t;c=await ge(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:v,password:g,data:(s=S==null?void 0:S.data)!==null&&s!==void 0?s:{},channel:(o=S==null?void 0:S.channel)!==null&&o!==void 0?o:"sms",gotrue_meta_security:{captcha_token:S==null?void 0:S.captchaToken}},xform:wn})}else throw new _c("You must provide either an email or phone number and a password");const{data:u,error:d}=c;if(d||!u)return await Rt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:d});const h=u.session,p=u.user;return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",h)),this._returnResult({data:{user:p,session:h},error:null})}catch(c){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),oe(c))return this._returnResult({data:{user:null,session:null},error:c});throw c}}async signInWithPassword(t){try{let a;if("email"in t){const{email:c,password:u,options:d}=t;a=await ge(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:c,password:u,gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken}},xform:Nb})}else if("phone"in t){const{phone:c,password:u,options:d}=t;a=await ge(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:c,password:u,gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken}},xform:Nb})}else throw new _c("You must provide either an email or phone number and a password");const{data:s,error:o}=a;if(o)return this._returnResult({data:{user:null,session:null},error:o});if(!s||!s.session||!s.user){const c=new Ks;return this._returnResult({data:{user:null,session:null},error:c})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),this._returnResult({data:Object.assign({user:s.user,session:s.session},s.weak_password?{weakPassword:s.weak_password}:null),error:o})}catch(a){if(oe(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithOAuth(t){var a,s,o,c;return await this._handleProviderSignIn(t.provider,{redirectTo:(a=t.options)===null||a===void 0?void 0:a.redirectTo,scopes:(s=t.options)===null||s===void 0?void 0:s.scopes,queryParams:(o=t.options)===null||o===void 0?void 0:o.queryParams,skipBrowserRedirect:(c=t.options)===null||c===void 0?void 0:c.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:a}=t;switch(a){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${a}"`)}}async signInWithEthereum(t){var a,s,o,c,u,d,h,p,v,g,S;let _,E;if("message"in t)_=t.message,E=t.signature;else{const{chain:x,wallet:R,statement:C,options:N}=t;let A;if(At())if(typeof R=="object")A=R;else{const ae=window;if("ethereum"in ae&&typeof ae.ethereum=="object"&&"request"in ae.ethereum&&typeof ae.ethereum.request=="function")A=ae.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 R!="object"||!(N!=null&&N.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");A=R}const D=new URL((a=N==null?void 0:N.url)!==null&&a!==void 0?a:window.location.href),V=await A.request({method:"eth_requestAccounts"}).then(ae=>ae).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!V||V.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const q=xw(V[0]);let U=(s=N==null?void 0:N.signInWithEthereum)===null||s===void 0?void 0:s.chainId;if(!U){const ae=await A.request({method:"eth_chainId"});U=kN(ae)}const I={domain:D.host,address:q,statement:C,uri:D.href,version:"1",chainId:U,nonce:(o=N==null?void 0:N.signInWithEthereum)===null||o===void 0?void 0:o.nonce,issuedAt:(u=(c=N==null?void 0:N.signInWithEthereum)===null||c===void 0?void 0:c.issuedAt)!==null&&u!==void 0?u:new Date,expirationTime:(d=N==null?void 0:N.signInWithEthereum)===null||d===void 0?void 0:d.expirationTime,notBefore:(h=N==null?void 0:N.signInWithEthereum)===null||h===void 0?void 0:h.notBefore,requestId:(p=N==null?void 0:N.signInWithEthereum)===null||p===void 0?void 0:p.requestId,resources:(v=N==null?void 0:N.signInWithEthereum)===null||v===void 0?void 0:v.resources};_=MN(I),E=await A.request({method:"personal_sign",params:[jN(_),q]})}try{const{data:x,error:R}=await ge(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:_,signature:E},!((g=t.options)===null||g===void 0)&&g.captchaToken?{gotrue_meta_security:{captcha_token:(S=t.options)===null||S===void 0?void 0:S.captchaToken}}:null),xform:wn});if(R)throw R;if(!x||!x.session||!x.user){const C=new Ks;return this._returnResult({data:{user:null,session:null},error:C})}return x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("SIGNED_IN",x.session)),this._returnResult({data:Object.assign({},x),error:R})}catch(x){if(oe(x))return this._returnResult({data:{user:null,session:null},error:x});throw x}}async signInWithSolana(t){var a,s,o,c,u,d,h,p,v,g,S,_;let E,x;if("message"in t)E=t.message,x=t.signature;else{const{chain:R,wallet:C,statement:N,options:A}=t;let D;if(At())if(typeof C=="object")D=C;else{const q=window;if("solana"in q&&typeof q.solana=="object"&&("signIn"in q.solana&&typeof q.solana.signIn=="function"||"signMessage"in q.solana&&typeof q.solana.signMessage=="function"))D=q.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 C!="object"||!(A!=null&&A.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");D=C}const V=new URL((a=A==null?void 0:A.url)!==null&&a!==void 0?a:window.location.href);if("signIn"in D&&D.signIn){const q=await D.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},A==null?void 0:A.signInWithSolana),{version:"1",domain:V.host,uri:V.href}),N?{statement:N}:null));let U;if(Array.isArray(q)&&q[0]&&typeof q[0]=="object")U=q[0];else if(q&&typeof q=="object"&&"signedMessage"in q&&"signature"in q)U=q;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in U&&"signature"in U&&(typeof U.signedMessage=="string"||U.signedMessage instanceof Uint8Array)&&U.signature instanceof Uint8Array)E=typeof U.signedMessage=="string"?U.signedMessage:new TextDecoder().decode(U.signedMessage),x=U.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in D)||typeof D.signMessage!="function"||!("publicKey"in D)||typeof D!="object"||!D.publicKey||!("toBase58"in D.publicKey)||typeof D.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");E=[`${V.host} wants you to sign in with your Solana account:`,D.publicKey.toBase58(),...N?["",N,""]:[""],"Version: 1",`URI: ${V.href}`,`Issued At: ${(o=(s=A==null?void 0:A.signInWithSolana)===null||s===void 0?void 0:s.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((c=A==null?void 0:A.signInWithSolana)===null||c===void 0)&&c.notBefore?[`Not Before: ${A.signInWithSolana.notBefore}`]:[],...!((u=A==null?void 0:A.signInWithSolana)===null||u===void 0)&&u.expirationTime?[`Expiration Time: ${A.signInWithSolana.expirationTime}`]:[],...!((d=A==null?void 0:A.signInWithSolana)===null||d===void 0)&&d.chainId?[`Chain ID: ${A.signInWithSolana.chainId}`]:[],...!((h=A==null?void 0:A.signInWithSolana)===null||h===void 0)&&h.nonce?[`Nonce: ${A.signInWithSolana.nonce}`]:[],...!((p=A==null?void 0:A.signInWithSolana)===null||p===void 0)&&p.requestId?[`Request ID: ${A.signInWithSolana.requestId}`]:[],...!((g=(v=A==null?void 0:A.signInWithSolana)===null||v===void 0?void 0:v.resources)===null||g===void 0)&&g.length?["Resources",...A.signInWithSolana.resources.map(U=>`- ${U}`)]:[]].join(`
|
||
`);const q=await D.signMessage(new TextEncoder().encode(E),"utf8");if(!q||!(q instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");x=q}}try{const{data:R,error:C}=await ge(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:E,signature:Ka(x)},!((S=t.options)===null||S===void 0)&&S.captchaToken?{gotrue_meta_security:{captcha_token:(_=t.options)===null||_===void 0?void 0:_.captchaToken}}:null),xform:wn});if(C)throw C;if(!R||!R.session||!R.user){const N=new Ks;return this._returnResult({data:{user:null,session:null},error:N})}return R.session&&(await this._saveSession(R.session),await this._notifyAllSubscribers("SIGNED_IN",R.session)),this._returnResult({data:Object.assign({},R),error:C})}catch(R){if(oe(R))return this._returnResult({data:{user:null,session:null},error:R});throw R}}async _exchangeCodeForSession(t){const a=await Ha(this.storage,`${this.storageKey}-code-verifier`),[s,o]=(a??"").split("/");try{if(!s&&this.flowType==="pkce")throw new eN;const{data:c,error:u}=await ge(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:s},xform:wn});if(await Rt(this.storage,`${this.storageKey}-code-verifier`),u)throw u;if(!c||!c.session||!c.user){const d=new Ks;return this._returnResult({data:{user:null,session:null,redirectType:null},error:d})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers(o==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c.session)),this._returnResult({data:Object.assign(Object.assign({},c),{redirectType:o??null}),error:u})}catch(c){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),oe(c))return this._returnResult({data:{user:null,session:null,redirectType:null},error:c});throw c}}async signInWithIdToken(t){try{const{options:a,provider:s,token:o,access_token:c,nonce:u}=t,d=await ge(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:s,id_token:o,access_token:c,nonce:u,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:wn}),{data:h,error:p}=d;if(p)return this._returnResult({data:{user:null,session:null},error:p});if(!h||!h.session||!h.user){const v=new Ks;return this._returnResult({data:{user:null,session:null},error:v})}return h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("SIGNED_IN",h.session)),this._returnResult({data:h,error:p})}catch(a){if(oe(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithOtp(t){var a,s,o,c,u;try{if("email"in t){const{email:d,options:h}=t;let p=null,v=null;this.flowType==="pkce"&&([p,v]=await Ys(this.storage,this.storageKey));const{error:g}=await ge(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:d,data:(a=h==null?void 0:h.data)!==null&&a!==void 0?a:{},create_user:(s=h==null?void 0:h.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},code_challenge:p,code_challenge_method:v},redirectTo:h==null?void 0:h.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:g})}if("phone"in t){const{phone:d,options:h}=t,{data:p,error:v}=await ge(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:d,data:(o=h==null?void 0:h.data)!==null&&o!==void 0?o:{},create_user:(c=h==null?void 0:h.shouldCreateUser)!==null&&c!==void 0?c:!0,gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},channel:(u=h==null?void 0:h.channel)!==null&&u!==void 0?u:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:p==null?void 0:p.message_id},error:v})}throw new _c("You must provide either an email or phone number.")}catch(d){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),oe(d))return this._returnResult({data:{user:null,session:null},error:d});throw d}}async verifyOtp(t){var a,s;try{let o,c;"options"in t&&(o=(a=t.options)===null||a===void 0?void 0:a.redirectTo,c=(s=t.options)===null||s===void 0?void 0:s.captchaToken);const{data:u,error:d}=await ge(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:c}}),redirectTo:o,xform:wn});if(d)throw d;if(!u)throw new Error("An error occurred on token verification.");const h=u.session,p=u.user;return h!=null&&h.access_token&&(await this._saveSession(h),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",h)),this._returnResult({data:{user:p,session:h},error:null})}catch(o){if(oe(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithSSO(t){var a,s,o,c,u;try{let d=null,h=null;this.flowType==="pkce"&&([d,h]=await Ys(this.storage,this.storageKey));const p=await ge(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(s=(a=t.options)===null||a===void 0?void 0:a.redirectTo)!==null&&s!==void 0?s:void 0}),!((o=t==null?void 0:t.options)===null||o===void 0)&&o.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:d,code_challenge_method:h}),headers:this.headers,xform:TN});return!((c=p.data)===null||c===void 0)&&c.url&&At()&&!(!((u=t.options)===null||u===void 0)&&u.skipBrowserRedirect)&&window.location.assign(p.data.url),this._returnResult(p)}catch(d){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),oe(d))return this._returnResult({data:null,error:d});throw d}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:a},error:s}=t;if(s)throw s;if(!a)throw new St;const{error:o}=await ge(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:a.access_token});return this._returnResult({data:{user:null,session:null},error:o})})}catch(t){if(oe(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const a=`${this.url}/resend`;if("email"in t){const{email:s,type:o,options:c}=t,{error:u}=await ge(this.fetch,"POST",a,{headers:this.headers,body:{email:s,type:o,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken}},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:u})}else if("phone"in t){const{phone:s,type:o,options:c}=t,{data:u,error:d}=await ge(this.fetch,"POST",a,{headers:this.headers,body:{phone:s,type:o,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d})}throw new _c("You must provide either an email or phone number and a type")}catch(a){if(oe(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async a=>a))}async _acquireLock(t,a){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const s=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),o=(async()=>(await s,await a()))();return this.pendingInLock.push((async()=>{try{await o}catch{}})()),o}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const s=a();for(this.pendingInLock.push((async()=>{try{await s}catch{}})()),await s;this.pendingInLock.length;){const o=[...this.pendingInLock];await Promise.all(o),this.pendingInLock.splice(0,o.length)}return await s}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const a=await this.__loadSession();return await t(a)}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 t=null;const a=await Ha(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",a),a!==null&&(this._isValidSession(a)?t=a:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};const s=t.expires_at?t.expires_at*1e3-Date.now()<ih:!1;if(this._debug("#__loadSession()",`session has${s?"":" not"} expired`,"expires_at",t.expires_at),!s){if(this.userStorage){const u=await Ha(this.userStorage,this.storageKey+"-user");u!=null&&u.user?t.user=u.user:t.user=lh()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const u={value:this.suppressGetSessionWarning};t.user=SN(t.user,u),u.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:o,error:c}=await this._callRefreshToken(t.refresh_token);return c?this._returnResult({data:{session:null},error:c}):this._returnResult({data:{session:o},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const a=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return a.data.user&&(this.suppressGetSessionWarning=!0),a}async _getUser(t){try{return t?await ge(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:da}):await this._useSession(async a=>{var s,o,c;const{data:u,error:d}=a;if(d)throw d;return!(!((s=u.session)===null||s===void 0)&&s.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new St}:await ge(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(c=(o=u.session)===null||o===void 0?void 0:o.access_token)!==null&&c!==void 0?c:void 0,xform:da})})}catch(a){if(oe(a))return Sc(a)&&(await this._removeSession(),await Rt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:a});throw a}}async updateUser(t,a={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,a))}async _updateUser(t,a={}){try{return await this._useSession(async s=>{const{data:o,error:c}=s;if(c)throw c;if(!o.session)throw new St;const u=o.session;let d=null,h=null;this.flowType==="pkce"&&t.email!=null&&([d,h]=await Ys(this.storage,this.storageKey));const{data:p,error:v}=await ge(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:a==null?void 0:a.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:d,code_challenge_method:h}),jwt:u.access_token,xform:da});if(v)throw v;return u.user=p.user,await this._saveSession(u),await this._notifyAllSubscribers("USER_UPDATED",u),this._returnResult({data:{user:u.user},error:null})})}catch(s){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),oe(s))return this._returnResult({data:{user:null},error:s});throw s}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new St;const a=Date.now()/1e3;let s=a,o=!0,c=null;const{payload:u}=Ec(t.access_token);if(u.exp&&(s=u.exp,o=s<=a),o){const{data:d,error:h}=await this._callRefreshToken(t.refresh_token);if(h)return this._returnResult({data:{user:null,session:null},error:h});if(!d)return{data:{user:null,session:null},error:null};c=d}else{const{data:d,error:h}=await this._getUser(t.access_token);if(h)return this._returnResult({data:{user:null,session:null},error:h});c={access_token:t.access_token,refresh_token:t.refresh_token,user:d.user,token_type:"bearer",expires_in:s-a,expires_at:s},await this._saveSession(c),await this._notifyAllSubscribers("SIGNED_IN",c)}return this._returnResult({data:{user:c.user,session:c},error:null})}catch(a){if(oe(a))return this._returnResult({data:{session:null,user:null},error:a});throw a}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async a=>{var s;if(!t){const{data:u,error:d}=a;if(d)throw d;t=(s=u.session)!==null&&s!==void 0?s:void 0}if(!(t!=null&&t.refresh_token))throw new St;const{data:o,error:c}=await this._callRefreshToken(t.refresh_token);return c?this._returnResult({data:{user:null,session:null},error:c}):o?this._returnResult({data:{user:o.user,session:o},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(a){if(oe(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async _getSessionFromURL(t,a){var s;try{if(!At())throw new xc("No browser detected.");if(t.error||t.error_description||t.error_code)throw new xc(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(a){case"implicit":if(this.flowType==="pkce")throw new _b("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new xc("Not a valid implicit grant flow url.");break;default:}if(a==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new _b("No code detected.");const{data:A,error:D}=await this._exchangeCodeForSession(t.code);if(D)throw D;const V=new URL(window.location.href);return V.searchParams.delete("code"),window.history.replaceState(window.history.state,"",V.toString()),{data:{session:A.session,redirectType:(s=A.redirectType)!==null&&s!==void 0?s:null},error:null}}const{provider_token:o,provider_refresh_token:c,access_token:u,refresh_token:d,expires_in:h,expires_at:p,token_type:v}=t;if(!u||!h||!d||!v)throw new xc("No session defined in URL");const g=Math.round(Date.now()/1e3),S=parseInt(h);let _=g+S;p&&(_=parseInt(p));const E=_-g;E*1e3<=ei&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${E}s, should have been closer to ${S}s`);const x=_-S;g-x>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",x,_,g):g-x<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",x,_,g);const{data:R,error:C}=await this._getUser(u);if(C)throw C;const N={provider_token:o,provider_refresh_token:c,access_token:u,expires_in:S,expires_at:_,refresh_token:d,token_type:v,user:R.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:N,redirectType:t.type},error:null})}catch(o){if(oe(o))return this._returnResult({data:{session:null,redirectType:null},error:o});throw o}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const a=await Ha(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&a)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async a=>{var s;const{data:o,error:c}=a;if(c&&!Sc(c))return this._returnResult({error:c});const u=(s=o.session)===null||s===void 0?void 0:s.access_token;if(u){const{error:d}=await this.admin.signOut(u,t);if(d&&!(QA(d)&&(d.status===404||d.status===401||d.status===403)||Sc(d)))return this._returnResult({error:d})}return t!=="others"&&(await this._removeSession(),await Rt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const a=oN(),s={id:a,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",a),this.stateChangeEmitters.delete(a)}};return this._debug("#onAuthStateChange()","registered callback with id",a),this.stateChangeEmitters.set(a,s),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(a)})))(),{data:{subscription:s}}}async _emitInitialSession(t){return await this._useSession(async a=>{var s,o;try{const{data:{session:c},error:u}=a;if(u)throw u;await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",c)),this._debug("INITIAL_SESSION","callback id",t,"session",c)}catch(c){await((o=this.stateChangeEmitters.get(t))===null||o===void 0?void 0:o.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",c),Sc(c)?console.warn(c):console.error(c)}})}async resetPasswordForEmail(t,a={}){let s=null,o=null;this.flowType==="pkce"&&([s,o]=await Ys(this.storage,this.storageKey,!0));try{return await ge(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:s,code_challenge_method:o,gotrue_meta_security:{captcha_token:a.captchaToken}},headers:this.headers,redirectTo:a.redirectTo})}catch(c){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),oe(c))return this._returnResult({data:null,error:c});throw c}}async getUserIdentities(){var t;try{const{data:a,error:s}=await this.getUser();if(s)throw s;return this._returnResult({data:{identities:(t=a.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(a){if(oe(a))return this._returnResult({data:null,error:a});throw a}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var a;try{const{data:s,error:o}=await this._useSession(async c=>{var u,d,h,p,v;const{data:g,error:S}=c;if(S)throw S;const _=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(u=t.options)===null||u===void 0?void 0:u.redirectTo,scopes:(d=t.options)===null||d===void 0?void 0:d.scopes,queryParams:(h=t.options)===null||h===void 0?void 0:h.queryParams,skipBrowserRedirect:!0});return await ge(this.fetch,"GET",_,{headers:this.headers,jwt:(v=(p=g.session)===null||p===void 0?void 0:p.access_token)!==null&&v!==void 0?v:void 0})});if(o)throw o;return At()&&!(!((a=t.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(s==null?void 0:s.url),this._returnResult({data:{provider:t.provider,url:s==null?void 0:s.url},error:null})}catch(s){if(oe(s))return this._returnResult({data:{provider:t.provider,url:null},error:s});throw s}}async linkIdentityIdToken(t){return await this._useSession(async a=>{var s;try{const{error:o,data:{session:c}}=a;if(o)throw o;const{options:u,provider:d,token:h,access_token:p,nonce:v}=t,g=await ge(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(s=c==null?void 0:c.access_token)!==null&&s!==void 0?s:void 0,body:{provider:d,id_token:h,access_token:p,nonce:v,link_identity:!0,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken}},xform:wn}),{data:S,error:_}=g;return _?this._returnResult({data:{user:null,session:null},error:_}):!S||!S.session||!S.user?this._returnResult({data:{user:null,session:null},error:new Ks}):(S.session&&(await this._saveSession(S.session),await this._notifyAllSubscribers("USER_UPDATED",S.session)),this._returnResult({data:S,error:_}))}catch(o){if(await Rt(this.storage,`${this.storageKey}-code-verifier`),oe(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}})}async unlinkIdentity(t){try{return await this._useSession(async a=>{var s,o;const{data:c,error:u}=a;if(u)throw u;return await ge(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(o=(s=c.session)===null||s===void 0?void 0:s.access_token)!==null&&o!==void 0?o:void 0})})}catch(a){if(oe(a))return this._returnResult({data:null,error:a});throw a}}async _refreshAccessToken(t){const a=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(a,"begin");try{const s=Date.now();return await dN(async o=>(o>0&&await uN(200*Math.pow(2,o-1)),this._debug(a,"refreshing attempt",o),await ge(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:wn})),(o,c)=>{const u=200*Math.pow(2,o);return c&&oh(c)&&Date.now()+u-s<ei})}catch(s){if(this._debug(a,"error",s),oe(s))return this._returnResult({data:{session:null,user:null},error:s});throw s}finally{this._debug(a,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,a){const s=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:a.redirectTo,scopes:a.scopes,queryParams:a.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",a,"url",s),At()&&!a.skipBrowserRedirect&&window.location.assign(s),{data:{provider:t,url:s},error:null}}async _recoverAndRefresh(){var t,a;const s="#_recoverAndRefresh()";this._debug(s,"begin");try{const o=await Ha(this.storage,this.storageKey);if(o&&this.userStorage){let u=await Ha(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!u&&(u={user:o.user},await ti(this.userStorage,this.storageKey+"-user",u)),o.user=(t=u==null?void 0:u.user)!==null&&t!==void 0?t:lh()}else if(o&&!o.user&&!o.user){const u=await Ha(this.storage,this.storageKey+"-user");u&&(u!=null&&u.user)?(o.user=u.user,await Rt(this.storage,this.storageKey+"-user"),await ti(this.storage,this.storageKey,o)):o.user=lh()}if(this._debug(s,"session from storage",o),!this._isValidSession(o)){this._debug(s,"session is not valid"),o!==null&&await this._removeSession();return}const c=((a=o.expires_at)!==null&&a!==void 0?a:1/0)*1e3-Date.now()<ih;if(this._debug(s,`session has${c?"":" not"} expired with margin of ${ih}s`),c){if(this.autoRefreshToken&&o.refresh_token){const{error:u}=await this._callRefreshToken(o.refresh_token);u&&(console.error(u),oh(u)||(this._debug(s,"refresh failed with a non-retryable error, removing the session",u),await this._removeSession()))}}else if(o.user&&o.user.__isUserNotAvailableProxy===!0)try{const{data:u,error:d}=await this._getUser(o.access_token);!d&&(u!=null&&u.user)?(o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)):this._debug(s,"could not get user data, skipping SIGNED_IN notification")}catch(u){console.error("Error getting user data:",u),this._debug(s,"error getting user data, skipping SIGNED_IN notification",u)}else await this._notifyAllSubscribers("SIGNED_IN",o)}catch(o){this._debug(s,"error",o),console.error(o);return}finally{this._debug(s,"end")}}async _callRefreshToken(t){var a,s;if(!t)throw new St;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const o=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new bu;const{data:c,error:u}=await this._refreshAccessToken(t);if(u)throw u;if(!c.session)throw new St;await this._saveSession(c.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",c.session);const d={data:c.session,error:null};return this.refreshingDeferred.resolve(d),d}catch(c){if(this._debug(o,"error",c),oe(c)){const u={data:null,error:c};return oh(c)||await this._removeSession(),(a=this.refreshingDeferred)===null||a===void 0||a.resolve(u),u}throw(s=this.refreshingDeferred)===null||s===void 0||s.reject(c),c}finally{this.refreshingDeferred=null,this._debug(o,"end")}}async _notifyAllSubscribers(t,a,s=!0){const o=`#_notifyAllSubscribers(${t})`;this._debug(o,"begin",a,`broadcast = ${s}`);try{this.broadcastChannel&&s&&this.broadcastChannel.postMessage({event:t,session:a});const c=[],u=Array.from(this.stateChangeEmitters.values()).map(async d=>{try{await d.callback(t,a)}catch(h){c.push(h)}});if(await Promise.all(u),c.length>0){for(let d=0;d<c.length;d+=1)console.error(c[d]);throw c[0]}}finally{this._debug(o,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await Rt(this.storage,`${this.storageKey}-code-verifier`);const a=Object.assign({},t),s=a.user&&a.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!s&&a.user&&await ti(this.userStorage,this.storageKey+"-user",{user:a.user});const o=Object.assign({},a);delete o.user;const c=Rb(o);await ti(this.storage,this.storageKey,c)}else{const o=Rb(a);await ti(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Rt(this.storage,this.storageKey),await Rt(this.storage,this.storageKey+"-code-verifier"),await Rt(this.storage,this.storageKey+"-user"),this.userStorage&&await Rt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&At()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(a){console.error("removing visibilitychange callback failed",a)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),ei);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const a=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=a,a&&typeof a=="object"&&typeof a.unref=="function"?a.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(a)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const a=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,a&&clearTimeout(a)}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 t=Date.now();try{return await this._useSession(async a=>{const{data:{session:s}}=a;if(!s||!s.refresh_token||!s.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const o=Math.floor((s.expires_at*1e3-t)/ei);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${ei}ms, refresh threshold is ${Uh} ticks`),o<=Uh&&await this._callRefreshToken(s.refresh_token)})}catch(a){console.error("Auto refresh tick failed with error. This is likely a transient error.",a)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t instanceof _w)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!At()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const a=`#_onVisibilityChanged(${t})`;this._debug(a,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(a,"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(t,a,s){const o=[`provider=${encodeURIComponent(a)}`];if(s!=null&&s.redirectTo&&o.push(`redirect_to=${encodeURIComponent(s.redirectTo)}`),s!=null&&s.scopes&&o.push(`scopes=${encodeURIComponent(s.scopes)}`),this.flowType==="pkce"){const[c,u]=await Ys(this.storage,this.storageKey),d=new URLSearchParams({code_challenge:`${encodeURIComponent(c)}`,code_challenge_method:`${encodeURIComponent(u)}`});o.push(d.toString())}if(s!=null&&s.queryParams){const c=new URLSearchParams(s.queryParams);o.push(c.toString())}return s!=null&&s.skipBrowserRedirect&&o.push(`skip_http_redirect=${s.skipBrowserRedirect}`),`${t}?${o.join("&")}`}async _unenroll(t){try{return await this._useSession(async a=>{var s;const{data:o,error:c}=a;return c?this._returnResult({data:null,error:c}):await ge(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(s=o==null?void 0:o.session)===null||s===void 0?void 0:s.access_token})})}catch(a){if(oe(a))return this._returnResult({data:null,error:a});throw a}}async _enroll(t){try{return await this._useSession(async a=>{var s,o;const{data:c,error:u}=a;if(u)return this._returnResult({data:null,error:u});const d=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:h,error:p}=await ge(this.fetch,"POST",`${this.url}/factors`,{body:d,headers:this.headers,jwt:(s=c==null?void 0:c.session)===null||s===void 0?void 0:s.access_token});return p?this._returnResult({data:null,error:p}):(t.factorType==="totp"&&h.type==="totp"&&(!((o=h==null?void 0:h.totp)===null||o===void 0)&&o.qr_code)&&(h.totp.qr_code=`data:image/svg+xml;utf-8,${h.totp.qr_code}`),this._returnResult({data:h,error:null}))})}catch(a){if(oe(a))return this._returnResult({data:null,error:a});throw a}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async a=>{var s;const{data:o,error:c}=a;if(c)return this._returnResult({data:null,error:c});const u=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?Lb(t.webauthn.credential_response):Ub(t.webauthn.credential_response)})}:{code:t.code}),{data:d,error:h}=await ge(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:u,headers:this.headers,jwt:(s=o==null?void 0:o.session)===null||s===void 0?void 0:s.access_token});return h?this._returnResult({data:null,error:h}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+d.expires_in},d)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",d),this._returnResult({data:d,error:h}))})}catch(a){if(oe(a))return this._returnResult({data:null,error:a});throw a}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async a=>{var s;const{data:o,error:c}=a;if(c)return this._returnResult({data:null,error:c});const u=await ge(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(s=o==null?void 0:o.session)===null||s===void 0?void 0:s.access_token});if(u.error)return u;const{data:d}=u;if(d.type!=="webauthn")return{data:d,error:null};switch(d.webauthn.type){case"create":return{data:Object.assign(Object.assign({},d),{webauthn:Object.assign(Object.assign({},d.webauthn),{credential_options:Object.assign(Object.assign({},d.webauthn.credential_options),{publicKey:Mb(d.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},d),{webauthn:Object.assign(Object.assign({},d.webauthn),{credential_options:Object.assign(Object.assign({},d.webauthn.credential_options),{publicKey:Db(d.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(a){if(oe(a))return this._returnResult({data:null,error:a});throw a}})}async _challengeAndVerify(t){const{data:a,error:s}=await this._challenge({factorId:t.factorId});return s?this._returnResult({data:null,error:s}):await this._verify({factorId:t.factorId,challengeId:a.id,code:t.code})}async _listFactors(){var t;const{data:{user:a},error:s}=await this.getUser();if(s)return{data:null,error:s};const o={all:[],phone:[],totp:[],webauthn:[]};for(const c of(t=a==null?void 0:a.factors)!==null&&t!==void 0?t:[])o.all.push(c),c.status==="verified"&&o[c.factor_type].push(c);return{data:o,error:null}}async _getAuthenticatorAssuranceLevel(t){var a,s,o,c;if(t)try{const{payload:_}=Ec(t);let E=null;_.aal&&(E=_.aal);let x=E;const{data:{user:R},error:C}=await this.getUser(t);if(C)return this._returnResult({data:null,error:C});((s=(a=R==null?void 0:R.factors)===null||a===void 0?void 0:a.filter(D=>D.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(x="aal2");const A=_.amr||[];return{data:{currentLevel:E,nextLevel:x,currentAuthenticationMethods:A},error:null}}catch(_){if(oe(_))return this._returnResult({data:null,error:_});throw _}const{data:{session:u},error:d}=await this.getSession();if(d)return this._returnResult({data:null,error:d});if(!u)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:h}=Ec(u.access_token);let p=null;h.aal&&(p=h.aal);let v=p;((c=(o=u.user.factors)===null||o===void 0?void 0:o.filter(_=>_.status==="verified"))!==null&&c!==void 0?c:[]).length>0&&(v="aal2");const S=h.amr||[];return{data:{currentLevel:p,nextLevel:v,currentAuthenticationMethods:S},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async a=>{const{data:{session:s},error:o}=a;return o?this._returnResult({data:null,error:o}):s?await ge(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:s.access_token,xform:c=>({data:c,error:null})}):this._returnResult({data:null,error:new St})})}catch(a){if(oe(a))return this._returnResult({data:null,error:a});throw a}}async _approveAuthorization(t,a){try{return await this._useSession(async s=>{const{data:{session:o},error:c}=s;if(c)return this._returnResult({data:null,error:c});if(!o)return this._returnResult({data:null,error:new St});const u=await ge(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"approve"},xform:d=>({data:d,error:null})});return u.data&&u.data.redirect_url&&At()&&!(a!=null&&a.skipBrowserRedirect)&&window.location.assign(u.data.redirect_url),u})}catch(s){if(oe(s))return this._returnResult({data:null,error:s});throw s}}async _denyAuthorization(t,a){try{return await this._useSession(async s=>{const{data:{session:o},error:c}=s;if(c)return this._returnResult({data:null,error:c});if(!o)return this._returnResult({data:null,error:new St});const u=await ge(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:o.access_token,body:{action:"deny"},xform:d=>({data:d,error:null})});return u.data&&u.data.redirect_url&&At()&&!(a!=null&&a.skipBrowserRedirect)&&window.location.assign(u.data.redirect_url),u})}catch(s){if(oe(s))return this._returnResult({data:null,error:s});throw s}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:a},error:s}=t;return s?this._returnResult({data:null,error:s}):a?await ge(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:a.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new St})})}catch(t){if(oe(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async a=>{const{data:{session:s},error:o}=a;return o?this._returnResult({data:null,error:o}):s?(await ge(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:s.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new St})})}catch(a){if(oe(a))return this._returnResult({data:null,error:a});throw a}}async fetchJwk(t,a={keys:[]}){let s=a.keys.find(d=>d.kid===t);if(s)return s;const o=Date.now();if(s=this.jwks.keys.find(d=>d.kid===t),s&&this.jwks_cached_at+XA>o)return s;const{data:c,error:u}=await ge(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(u)throw u;return!c.keys||c.keys.length===0||(this.jwks=c,this.jwks_cached_at=o,s=c.keys.find(d=>d.kid===t),!s)?null:s}async getClaims(t,a={}){try{let s=t;if(!s){const{data:_,error:E}=await this.getSession();if(E||!_.session)return this._returnResult({data:null,error:E});s=_.session.access_token}const{header:o,payload:c,signature:u,raw:{header:d,payload:h}}=Ec(s);a!=null&&a.allowExpired||yN(c.exp);const p=!o.alg||o.alg.startsWith("HS")||!o.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(o.kid,a!=null&&a.keys?{keys:a.keys}:a==null?void 0:a.jwks);if(!p){const{error:_}=await this.getUser(s);if(_)throw _;return{data:{claims:c,header:o,signature:u},error:null}}const v=bN(o.alg),g=await crypto.subtle.importKey("jwk",p,v,!0,["verify"]);if(!await crypto.subtle.verify(v,g,u,sN(`${d}.${h}`)))throw new Bh("Invalid JWT signature");return{data:{claims:c,header:o,signature:u},error:null}}catch(s){if(oe(s))return this._returnResult({data:null,error:s});throw s}}async signInWithPasskey(t){var a,s,o;On(this.experimental);try{if(!nu())return this._returnResult({data:null,error:new Mn("Browser does not support WebAuthn",null)});const{data:c,error:u}=await this._startPasskeyAuthentication({options:{captchaToken:(a=t==null?void 0:t.options)===null||a===void 0?void 0:a.captchaToken}});if(u||!c)return this._returnResult({data:null,error:u});const d=Db(c.options),h=(o=(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.signal)!==null&&o!==void 0?o:Ih.createNewAbortSignal(),{data:p,error:v}=await Cw({publicKey:d,signal:h});if(v||!p)return this._returnResult({data:null,error:v??new Mn("WebAuthn ceremony failed",null)});const g=Ub(p);return this._verifyPasskeyAuthentication({challengeId:c.challenge_id,credential:g})}catch(c){if(oe(c))return this._returnResult({data:null,error:c});throw c}}async registerPasskey(t){var a,s;On(this.experimental);try{if(!nu())return this._returnResult({data:null,error:new Mn("Browser does not support WebAuthn",null)});const{data:o,error:c}=await this._startPasskeyRegistration();if(c||!o)return this._returnResult({data:null,error:c});const u=Mb(o.options),d=(s=(a=t==null?void 0:t.options)===null||a===void 0?void 0:a.signal)!==null&&s!==void 0?s:Ih.createNewAbortSignal(),{data:h,error:p}=await Tw({publicKey:u,signal:d});if(p||!h)return this._returnResult({data:null,error:p??new Mn("WebAuthn ceremony failed",null)});const v=Lb(h);return this._verifyPasskeyRegistration({challengeId:o.challenge_id,credential:v})}catch(o){if(oe(o))return this._returnResult({data:null,error:o});throw o}}async _startPasskeyRegistration(){On(this.experimental);try{return await this._useSession(async t=>{const{data:{session:a},error:s}=t;if(s)return this._returnResult({data:null,error:s});if(!a)return this._returnResult({data:null,error:new St});const{data:o,error:c}=await ge(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:a.access_token,body:{}});return c?this._returnResult({data:null,error:c}):this._returnResult({data:o,error:null})})}catch(t){if(oe(t))return this._returnResult({data:null,error:t});throw t}}async _verifyPasskeyRegistration(t){On(this.experimental);try{return await this._useSession(async a=>{const{data:{session:s},error:o}=a;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new St});const{data:c,error:u}=await ge(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:s.access_token,body:{challenge_id:t.challengeId,credential:t.credential}});return u?this._returnResult({data:null,error:u}):this._returnResult({data:c,error:null})})}catch(a){if(oe(a))return this._returnResult({data:null,error:a});throw a}}async _startPasskeyAuthentication(t){var a;On(this.experimental);try{const{data:s,error:o}=await ge(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(a=t==null?void 0:t.options)===null||a===void 0?void 0:a.captchaToken}}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:s,error:null})}catch(s){if(oe(s))return this._returnResult({data:null,error:s});throw s}}async _verifyPasskeyAuthentication(t){On(this.experimental);try{const{data:a,error:s}=await ge(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:t.challengeId,credential:t.credential},xform:wn});return s?this._returnResult({data:null,error:s}):(a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),this._returnResult({data:a,error:null}))}catch(a){if(oe(a))return this._returnResult({data:null,error:a});throw a}}async _listPasskeys(){On(this.experimental);try{return await this._useSession(async t=>{const{data:{session:a},error:s}=t;if(s)return this._returnResult({data:null,error:s});if(!a)return this._returnResult({data:null,error:new St});const{data:o,error:c}=await ge(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:a.access_token,xform:u=>({data:u,error:null})});return c?this._returnResult({data:null,error:c}):this._returnResult({data:o,error:null})})}catch(t){if(oe(t))return this._returnResult({data:null,error:t});throw t}}async _updatePasskey(t){On(this.experimental);try{return await this._useSession(async a=>{const{data:{session:s},error:o}=a;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new St});const{data:c,error:u}=await ge(this.fetch,"PATCH",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:s.access_token,body:{friendly_name:t.friendlyName}});return u?this._returnResult({data:null,error:u}):this._returnResult({data:c,error:null})})}catch(a){if(oe(a))return this._returnResult({data:null,error:a});throw a}}async _deletePasskey(t){On(this.experimental);try{return await this._useSession(async a=>{const{data:{session:s},error:o}=a;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new St});const{error:c}=await ge(this.fetch,"DELETE",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:s.access_token,noResolveJson:!0});return c?this._returnResult({data:null,error:c}):this._returnResult({data:null,error:null})})}catch(a){if(oe(a))return this._returnResult({data:null,error:a});throw a}}}Uo.nextInstanceID={};const qN=Uo,GN="2.106.2";let So="";typeof Deno<"u"?So="deno":typeof document<"u"?So="web":typeof navigator<"u"&&navigator.product==="ReactNative"?So="react-native":So="node";const VN={"X-Client-Info":`supabase-js-${So}/${GN}`},KN={headers:VN},YN={schema:"public"},FN={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},WN={},XN={enabled:!1,respectSamplingDecision:!0};function JN(e,t,a,s){function o(c){return c instanceof a?c:new a(function(u){u(c)})}return new(a||(a=Promise))(function(c,u){function d(v){try{p(s.next(v))}catch(g){u(g)}}function h(v){try{p(s.throw(v))}catch(g){u(g)}}function p(v){v.done?c(v.value):o(v.value).then(d,h)}p((s=s.apply(e,[])).next())})}let uh=null;const QN="@opentelemetry/api";function ZN(){return uh===null&&(uh=import(QN).catch(()=>null)),uh}function eO(){return JN(this,void 0,void 0,function*(){try{const e=yield ZN();if(!e||!e.propagation||!e.context)return null;const t={};e.propagation.inject(e.context.active(),t);const a=t.traceparent;return a?{traceparent:a,tracestate:t.tracestate,baggage:t.baggage}:null}catch{return null}})}function tO(e){if(!e||typeof e!="string")return null;const t=e.split("-");if(t.length!==4)return null;const[a,s,o,c]=t;if(a.length!==2||s.length!==32||o.length!==16||c.length!==2)return null;const u=/^[0-9a-f]+$/i;return!u.test(a)||!u.test(s)||!u.test(o)||!u.test(c)||s==="00000000000000000000000000000000"||o==="0000000000000000"?null:{version:a,traceId:s,parentId:o,traceFlags:c,isSampled:(parseInt(c,16)&1)===1}}function nO(e,t){if(!e||!t||t.length===0)return!1;let a;if(e instanceof URL)a=e;else try{a=new URL(e)}catch{return!1}for(const s of t)try{if(typeof s=="string"){if(rO(a.hostname,s))return!0}else if(s instanceof RegExp){if(s.test(a.hostname))return!0}else if(typeof s=="function"&&s(a))return!0}catch{continue}return!1}function rO(e,t){if(t===e)return!0;if(t.startsWith("*.")){const a=t.slice(2);if(e.endsWith(a)&&(e===a||e.endsWith("."+a)))return!0}return!1}function aO(e){const t=[];try{const a=new URL(e);t.push(a.hostname)}catch{}return t.push("*.supabase.co","*.supabase.in"),t.push("localhost","127.0.0.1","[::1]"),t}function zo(e){"@babel/helpers - typeof";return zo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zo(e)}function sO(e,t){if(zo(e)!="object"||!e)return e;var a=e[Symbol.toPrimitive];if(a!==void 0){var s=a.call(e,t);if(zo(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function iO(e){var t=sO(e,"string");return zo(t)=="symbol"?t:t+""}function oO(e,t,a){return(t=iO(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function Pb(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),a.push.apply(a,s)}return a}function it(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?Pb(Object(a),!0).forEach(function(s){oO(e,s,a[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Pb(Object(a)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(a,s))})}return e}const lO=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),cO=()=>Headers,uO=(e,t,a,s,o)=>{const c=lO(s),u=cO(),d=(o==null?void 0:o.enabled)===!0,h=(o==null?void 0:o.respectSamplingDecision)!==!1,p=d?aO(t):null;return async(v,g)=>{var S;const _=(S=await a())!==null&&S!==void 0?S:e;let E=new u(g==null?void 0:g.headers);if(E.has("apikey")||E.set("apikey",e),E.has("Authorization")||E.set("Authorization",`Bearer ${_}`),p){const x=await dO(v,p,h);x&&(x.traceparent&&!E.has("traceparent")&&E.set("traceparent",x.traceparent),x.tracestate&&!E.has("tracestate")&&E.set("tracestate",x.tracestate),x.baggage&&!E.has("baggage")&&E.set("baggage",x.baggage))}return c(v,it(it({},g),{},{headers:E}))}};async function dO(e,t,a){if(!nO(typeof e=="string"||e instanceof URL?e:e.url,t))return null;const s=await eO();if(!s||!s.traceparent)return null;if(a){const o=tO(s.traceparent);if(o&&!o.isSampled)return null}return s}function Bb(e){return typeof e=="boolean"?{enabled:e}:e}function fO(e){return e.endsWith("/")?e:e+"/"}function hO(e,t){var a,s,o,c,u,d;const{db:h,auth:p,realtime:v,global:g}=e,{db:S,auth:_,realtime:E,global:x}=t,R=Bb(e.tracePropagation),C=Bb(t.tracePropagation),N={db:it(it({},S),h),auth:it(it({},_),p),realtime:it(it({},E),v),storage:{},global:it(it(it({},x),g),{},{headers:it(it({},(a=x==null?void 0:x.headers)!==null&&a!==void 0?a:{}),(s=g==null?void 0:g.headers)!==null&&s!==void 0?s:{})}),tracePropagation:{enabled:(o=(c=R==null?void 0:R.enabled)!==null&&c!==void 0?c:C==null?void 0:C.enabled)!==null&&o!==void 0?o:!1,respectSamplingDecision:(u=(d=R==null?void 0:R.respectSamplingDecision)!==null&&d!==void 0?d:C==null?void 0:C.respectSamplingDecision)!==null&&u!==void 0?u:!0},accessToken:async()=>""};return e.accessToken?N.accessToken=e.accessToken:delete N.accessToken,N}function mO(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(fO(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var pO=class extends qN{constructor(e){super(e)}},gO=class{constructor(e,t,a){var s,o;this.supabaseUrl=e,this.supabaseKey=t;const c=mO(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",c),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",c),this.storageUrl=new URL("storage/v1",c),this.functionsUrl=new URL("functions/v1",c);const u=`sb-${c.hostname.split(".")[0]}-auth-token`,d={db:YN,realtime:WN,auth:it(it({},FN),{},{storageKey:u}),global:KN,tracePropagation:XN},h=hO(a??{},d);if(this.settings=h,this.storageKey=(s=h.auth.storageKey)!==null&&s!==void 0?s:"",this.headers=(o=h.global.headers)!==null&&o!==void 0?o:{},h.accessToken)this.accessToken=h.accessToken,this.auth=new Proxy({},{get:(v,g)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(g)} is not possible`)}});else{var p;this.auth=this._initSupabaseAuthClient((p=h.auth)!==null&&p!==void 0?p:{},this.headers,h.global.fetch)}this.fetch=uO(t,e,this._getAccessToken.bind(this),h.global.fetch,h.tracePropagation),this.realtime=this._initRealtimeClient(it({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},h.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(v=>this.realtime.setAuth(v)).catch(v=>console.warn("Failed to set initial Realtime auth token:",v)),this.rest=new jR(new URL("rest/v1",c).href,{headers:this.headers,schema:h.db.schema,fetch:this.fetch,timeout:h.db.timeout,urlLengthLimit:h.db.urlLengthLimit}),this.storage=new VA(this.storageUrl.href,this.headers,this.fetch,a==null?void 0:a.storage),h.accessToken||this._listenForAuthEvents()}get functions(){return new _R(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,t={},a={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,a)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,a;if(e.accessToken)return await e.accessToken();const{data:s}=await e.auth.getSession();return(t=(a=s.session)===null||a===void 0?void 0:a.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:a,storage:s,userStorage:o,storageKey:c,flowType:u,lock:d,debug:h,throwOnError:p,experimental:v,lockAcquireTimeout:g,skipAutoInitialize:S},_,E){const x={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new pO({url:this.authUrl.href,headers:it(it({},x),_),storageKey:c,autoRefreshToken:e,persistSession:t,detectSessionInUrl:a,storage:s,userStorage:o,flowType:u,lock:d,debug:h,throwOnError:p,experimental:v,fetch:E,lockAcquireTimeout:g,skipAutoInitialize:S,hasCustomAuthorizationHeader:Object.keys(this.headers).some(R=>R.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new mA(this.realtimeUrl.href,it(it({},e),{},{params:it(it({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,a){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==a?(this.changedAccessToken=a,this.realtime.setAuth(a)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const vO=(e,t,a)=>new gO(e,t,a);function yO(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const a=t.match(/^v(\d+)\./);return a?parseInt(a[1],10)<=18:!1}yO()&&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 bO={BASE_URL:"/tablero-cdc/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_SUPABASE_ANON_KEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE",VITE_SUPABASE_URL:"https://dbit.digitalcompass.agency",VITE_WEBHOOK_URL:"https://agenteit.digitalcompass.agency/webhook/tablero-cdc-sync-proyecto"},wO=["VITE_SUPABASE_URL","VITE_SUPABASE_ANON_KEY"],Ib=wO.filter(e=>!bO[e]);if(Ib.length>0)throw new Error(`Faltan variables de entorno de Supabase. Revisa tu archivo .env.
|
||
Variables faltantes: ${Ib.join(", ")}`);const jt=vO("https://dbit.digitalcompass.agency","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE",{auth:{persistSession:!0,autoRefreshToken:!0,detectSessionInUrl:!0}}),Rw="gomezleemarketing.com",SO="gmarrero@gomezleemarketing.com";function _O(e){return e?e.toLowerCase().endsWith(`@${Rw}`):!1}function xO(){return typeof window>"u"?"/tablero-cdc/":new URL("/tablero-cdc/",window.location.origin).toString()}function EO(e){var o;const t=e.user_metadata||{},a=t.full_name||t.name||t.display_name||((o=e.email)==null?void 0:o.split("@")[0])||null,s=t.avatar_url||t.picture||null;return{id:e.id,uid:e.id,email:e.email??null,displayName:a,photoURL:s,raw:e}}const Aw=y.createContext(null);function TO({children:e}){const[t,a]=y.useState(null),[s,o]=y.useState(!0),[c,u]=y.useState(null),d=y.useCallback(async g=>{if(!g){a(null);return}if(!_O(g.email)){await jt.auth.signOut(),a(null),u("Solo se permite acceso con correos corporativos de GomezLee Marketing.");return}a(EO(g)),u(null)},[]);y.useEffect(()=>{let g=!0;jt.auth.getSession().then(async({data:_,error:E})=>{var x;if(g){if(E){console.error("Error al recuperar sesión de Supabase:",E),a(null),u("No se pudo recuperar la sesión. Intenta iniciar sesión de nuevo.");return}await d(((x=_.session)==null?void 0:x.user)??null)}}).catch(_=>{g&&(console.error("Error inesperado al recuperar sesión:",_),a(null),u("No se pudo recuperar la sesión. Intenta iniciar sesión de nuevo."))}).finally(()=>{g&&o(!1)});const{data:S}=jt.auth.onAuthStateChange((_,E)=>{d((E==null?void 0:E.user)??null),o(!1)});return()=>{g=!1,S.subscription.unsubscribe()}},[d]);const h=y.useCallback(async()=>{u(null);const{error:g}=await jt.auth.signInWithOAuth({provider:"google",options:{redirectTo:xO(),queryParams:{prompt:"select_account",hd:Rw}}});g&&(console.error("Error al iniciar sesión con Google:",g),u("No se pudo iniciar sesión. Intenta de nuevo."))},[]),p=y.useCallback(async()=>{const{error:g}=await jt.auth.signOut();if(g){console.error("Error al cerrar sesión:",g),u("No se pudo cerrar sesión. Intenta de nuevo.");return}a(null),u(null)},[]),v=y.useMemo(()=>{var g;return!!t&&((g=t.email)==null?void 0:g.toLowerCase())===SO},[t]);return b.jsx(Aw.Provider,{value:{user:t,loading:s,error:c,isGerardo:v,loginWithGoogle:h,logout:p},children:e})}function Jo(){const e=y.useContext(Aw);if(!e)throw new Error("useAuth debe usarse dentro de <AuthProvider>");return e}/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Nw=(...e)=>e.filter((t,a,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===a).join(" ").trim();/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const CO=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const RO=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,s)=>s?s.toUpperCase():a.toLowerCase());/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const $b=e=>{const t=RO(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/var AO={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.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const NO=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const OO=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:o="",children:c,iconNode:u,...d},h)=>y.createElement("svg",{ref:h,...AO,width:t,height:t,stroke:e,strokeWidth:s?Number(a)*24/Number(t):a,className:Nw("lucide",o),...!c&&!NO(d)&&{"aria-hidden":"true"},...d},[...u.map(([p,v])=>y.createElement(p,v)),...Array.isArray(c)?c:[c]]));/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Qe=(e,t)=>{const a=y.forwardRef(({className:s,...o},c)=>y.createElement(OO,{ref:c,iconNode:t,className:Nw(`lucide-${CO($b(e))}`,`lucide-${e}`,s),...o}));return a.displayName=$b(e),a};/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const kO=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],jO=Qe("calendar",kO);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const MO=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ym=Qe("check",MO);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const DO=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],bm=Qe("chevron-down",DO);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const LO=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],UO=Qe("chevron-left",LO);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const zO=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ow=Qe("chevron-right",zO);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const PO=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],BO=Qe("chevron-up",PO);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const IO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],$h=Qe("circle-alert",IO);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const $O=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],HO=Qe("circle-check",$O);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const qO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],GO=Qe("circle",qO);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const VO=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],KO=Qe("dollar-sign",VO);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const YO=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],FO=Qe("external-link",YO);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const WO=[["path",{d:"M10.5 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v6",key:"g5mvt7"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14 20 2 2 4-4",key:"15kota"}]],XO=Qe("file-check-corner",WO);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const JO=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],wm=Qe("layout-grid",JO);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const QO=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],ZO=Qe("link-2",QO);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ek=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],tk=Qe("link",ek);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const nk=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],dh=Qe("loader-circle",nk);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const rk=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],ak=Qe("lock",rk);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const sk=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],ik=Qe("log-out",sk);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ok=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],lk=Qe("map-pin",ok);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ck=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Sm=Qe("plus",ck);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const uk=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],dk=Qe("refresh-cw",uk);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const fk=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Hb=Qe("search",fk);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const hk=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],qb=Qe("tag",hk);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const mk=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],pk=Qe("user",mk);/**
|
||
* @license lucide-react v0.575.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const gk=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],kw=Qe("x",gk);function Gb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function jr(...e){return t=>{let a=!1;const s=e.map(o=>{const c=Gb(o,t);return!a&&typeof c=="function"&&(a=!0),c});if(a)return()=>{for(let o=0;o<s.length;o++){const c=s[o];typeof c=="function"?c():Gb(e[o],null)}}}}function Fe(...e){return y.useCallback(jr(...e),e)}var vk=Symbol.for("react.lazy"),au=om[" use ".trim().toString()];function yk(e){return typeof e=="object"&&e!==null&&"then"in e}function jw(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===vk&&"_payload"in e&&yk(e._payload)}function wu(e){const t=wk(e),a=y.forwardRef((s,o)=>{let{children:c,...u}=s;jw(c)&&typeof au=="function"&&(c=au(c._payload));const d=y.Children.toArray(c),h=d.find(_k);if(h){const p=h.props.children,v=d.map(g=>g===h?y.Children.count(p)>1?y.Children.only(null):y.isValidElement(p)?p.props.children:null:g);return b.jsx(t,{...u,ref:o,children:y.isValidElement(p)?y.cloneElement(p,void 0,v):null})}return b.jsx(t,{...u,ref:o,children:c})});return a.displayName=`${e}.Slot`,a}var bk=wu("Slot");function wk(e){const t=y.forwardRef((a,s)=>{let{children:o,...c}=a;if(jw(o)&&typeof au=="function"&&(o=au(o._payload)),y.isValidElement(o)){const u=Ek(o),d=xk(c,o.props);return o.type!==y.Fragment&&(d.ref=s?jr(s,u):u),y.cloneElement(o,d)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Sk=Symbol("radix.slottable");function _k(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Sk}function xk(e,t){const a={...t};for(const s in t){const o=e[s],c=t[s];/^on[A-Z]/.test(s)?o&&c?a[s]=(...d)=>{const h=c(...d);return o(...d),h}:o&&(a[s]=o):s==="style"?a[s]={...o,...c}:s==="className"&&(a[s]=[o,c].filter(Boolean).join(" "))}return{...e,...a}}function Ek(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function Mw(e){var t,a,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(a=Mw(e[t]))&&(s&&(s+=" "),s+=a)}else for(a in e)e[a]&&(s&&(s+=" "),s+=a);return s}function Dw(){for(var e,t,a=0,s="",o=arguments.length;a<o;a++)(e=arguments[a])&&(t=Mw(e))&&(s&&(s+=" "),s+=t);return s}const Vb=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Kb=Dw,_m=(e,t)=>a=>{var s;if((t==null?void 0:t.variants)==null)return Kb(e,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:o,defaultVariants:c}=t,u=Object.keys(o).map(p=>{const v=a==null?void 0:a[p],g=c==null?void 0:c[p];if(v===null)return null;const S=Vb(v)||Vb(g);return o[p][S]}),d=a&&Object.entries(a).reduce((p,v)=>{let[g,S]=v;return S===void 0||(p[g]=S),p},{}),h=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((p,v)=>{let{class:g,className:S,..._}=v;return Object.entries(_).every(E=>{let[x,R]=E;return Array.isArray(R)?R.includes({...c,...d}[x]):{...c,...d}[x]===R})?[...p,g,S]:p},[]);return Kb(e,u,h,a==null?void 0:a.class,a==null?void 0:a.className)},Tk=(e,t)=>{const a=new Array(e.length+t.length);for(let s=0;s<e.length;s++)a[s]=e[s];for(let s=0;s<t.length;s++)a[e.length+s]=t[s];return a},Ck=(e,t)=>({classGroupId:e,validator:t}),Lw=(e=new Map,t=null,a)=>({nextPart:e,validators:t,classGroupId:a}),su="-",Yb=[],Rk="arbitrary..",Ak=e=>{const t=Ok(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return Nk(u);const d=u.split(su),h=d[0]===""&&d.length>1?1:0;return Uw(d,h,t)},getConflictingClassGroupIds:(u,d)=>{if(d){const h=s[u],p=a[u];return h?p?Tk(p,h):h:p||Yb}return a[u]||Yb}}},Uw=(e,t,a)=>{if(e.length-t===0)return a.classGroupId;const o=e[t],c=a.nextPart.get(o);if(c){const p=Uw(e,t+1,c);if(p)return p}const u=a.validators;if(u===null)return;const d=t===0?e.join(su):e.slice(t).join(su),h=u.length;for(let p=0;p<h;p++){const v=u[p];if(v.validator(d))return v.classGroupId}},Nk=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),a=t.indexOf(":"),s=t.slice(0,a);return s?Rk+s:void 0})(),Ok=e=>{const{theme:t,classGroups:a}=e;return kk(a,t)},kk=(e,t)=>{const a=Lw();for(const s in e){const o=e[s];xm(o,a,s,t)}return a},xm=(e,t,a,s)=>{const o=e.length;for(let c=0;c<o;c++){const u=e[c];jk(u,t,a,s)}},jk=(e,t,a,s)=>{if(typeof e=="string"){Mk(e,t,a);return}if(typeof e=="function"){Dk(e,t,a,s);return}Lk(e,t,a,s)},Mk=(e,t,a)=>{const s=e===""?t:zw(t,e);s.classGroupId=a},Dk=(e,t,a,s)=>{if(Uk(e)){xm(e(s),t,a,s);return}t.validators===null&&(t.validators=[]),t.validators.push(Ck(a,e))},Lk=(e,t,a,s)=>{const o=Object.entries(e),c=o.length;for(let u=0;u<c;u++){const[d,h]=o[u];xm(h,zw(t,d),a,s)}},zw=(e,t)=>{let a=e;const s=t.split(su),o=s.length;for(let c=0;c<o;c++){const u=s[c];let d=a.nextPart.get(u);d||(d=Lw(),a.nextPart.set(u,d)),a=d}return a},Uk=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,zk=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,a=Object.create(null),s=Object.create(null);const o=(c,u)=>{a[c]=u,t++,t>e&&(t=0,s=a,a=Object.create(null))};return{get(c){let u=a[c];if(u!==void 0)return u;if((u=s[c])!==void 0)return o(c,u),u},set(c,u){c in a?a[c]=u:o(c,u)}}},Hh="!",Fb=":",Pk=[],Wb=(e,t,a,s,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:a,maybePostfixModifierPosition:s,isExternal:o}),Bk=e=>{const{prefix:t,experimentalParseClassName:a}=e;let s=o=>{const c=[];let u=0,d=0,h=0,p;const v=o.length;for(let x=0;x<v;x++){const R=o[x];if(u===0&&d===0){if(R===Fb){c.push(o.slice(h,x)),h=x+1;continue}if(R==="/"){p=x;continue}}R==="["?u++:R==="]"?u--:R==="("?d++:R===")"&&d--}const g=c.length===0?o:o.slice(h);let S=g,_=!1;g.endsWith(Hh)?(S=g.slice(0,-1),_=!0):g.startsWith(Hh)&&(S=g.slice(1),_=!0);const E=p&&p>h?p-h:void 0;return Wb(c,_,S,E)};if(t){const o=t+Fb,c=s;s=u=>u.startsWith(o)?c(u.slice(o.length)):Wb(Pk,!1,u,void 0,!0)}if(a){const o=s;s=c=>a({className:c,parseClassName:o})}return s},Ik=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((a,s)=>{t.set(a,1e6+s)}),a=>{const s=[];let o=[];for(let c=0;c<a.length;c++){const u=a[c],d=u[0]==="[",h=t.has(u);d||h?(o.length>0&&(o.sort(),s.push(...o),o=[]),s.push(u)):o.push(u)}return o.length>0&&(o.sort(),s.push(...o)),s}},$k=e=>({cache:zk(e.cacheSize),parseClassName:Bk(e),sortModifiers:Ik(e),postfixLookupClassGroupIds:Hk(e),...Ak(e)}),Hk=e=>{const t=Object.create(null),a=e.postfixLookupClassGroups;if(a)for(let s=0;s<a.length;s++)t[a[s]]=!0;return t},qk=/\s+/,Gk=(e,t)=>{const{parseClassName:a,getClassGroupId:s,getConflictingClassGroupIds:o,sortModifiers:c,postfixLookupClassGroupIds:u}=t,d=[],h=e.trim().split(qk);let p="";for(let v=h.length-1;v>=0;v-=1){const g=h[v],{isExternal:S,modifiers:_,hasImportantModifier:E,baseClassName:x,maybePostfixModifierPosition:R}=a(g);if(S){p=g+(p.length>0?" "+p:p);continue}let C=!!R,N;if(C){const U=x.substring(0,R);N=s(U);const I=N&&u[N]?s(x):void 0;I&&I!==N&&(N=I,C=!1)}else N=s(x);if(!N){if(!C){p=g+(p.length>0?" "+p:p);continue}if(N=s(x),!N){p=g+(p.length>0?" "+p:p);continue}C=!1}const A=_.length===0?"":_.length===1?_[0]:c(_).join(":"),D=E?A+Hh:A,V=D+N;if(d.indexOf(V)>-1)continue;d.push(V);const q=o(N,C);for(let U=0;U<q.length;++U){const I=q[U];d.push(D+I)}p=g+(p.length>0?" "+p:p)}return p},Vk=(...e)=>{let t=0,a,s,o="";for(;t<e.length;)(a=e[t++])&&(s=Pw(a))&&(o&&(o+=" "),o+=s);return o},Pw=e=>{if(typeof e=="string")return e;let t,a="";for(let s=0;s<e.length;s++)e[s]&&(t=Pw(e[s]))&&(a&&(a+=" "),a+=t);return a},Kk=(e,...t)=>{let a,s,o,c;const u=h=>{const p=t.reduce((v,g)=>g(v),e());return a=$k(p),s=a.cache.get,o=a.cache.set,c=d,d(h)},d=h=>{const p=s(h);if(p)return p;const v=Gk(h,a);return o(h,v),v};return c=u,(...h)=>c(Vk(...h))},Yk=[],pt=e=>{const t=a=>a[e]||Yk;return t.isThemeGetter=!0,t},Bw=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Iw=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Fk=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Wk=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xk=/\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$/,Jk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Qk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oa=e=>Fk.test(e),Oe=e=>!!e&&!Number.isNaN(Number(e)),Kn=e=>!!e&&Number.isInteger(Number(e)),fh=e=>e.endsWith("%")&&Oe(e.slice(0,-1)),_r=e=>Wk.test(e),$w=()=>!0,e2=e=>Xk.test(e)&&!Jk.test(e),Em=()=>!1,t2=e=>Qk.test(e),n2=e=>Zk.test(e),r2=e=>!ue(e)&&!fe(e),a2=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),s2=e=>ma(e,Gw,Em),ue=e=>Bw.test(e),qa=e=>ma(e,Vw,e2),Xb=e=>ma(e,h2,Oe),i2=e=>ma(e,Yw,$w),o2=e=>ma(e,Kw,Em),Jb=e=>ma(e,Hw,Em),l2=e=>ma(e,qw,n2),Tc=e=>ma(e,Fw,t2),fe=e=>Iw.test(e),yo=e=>Za(e,Vw),c2=e=>Za(e,Kw),Qb=e=>Za(e,Hw),u2=e=>Za(e,Gw),d2=e=>Za(e,qw),Cc=e=>Za(e,Fw,!0),f2=e=>Za(e,Yw,!0),ma=(e,t,a)=>{const s=Bw.exec(e);return s?s[1]?t(s[1]):a(s[2]):!1},Za=(e,t,a=!1)=>{const s=Iw.exec(e);return s?s[1]?t(s[1]):a:!1},Hw=e=>e==="position"||e==="percentage",qw=e=>e==="image"||e==="url",Gw=e=>e==="length"||e==="size"||e==="bg-size",Vw=e=>e==="length",h2=e=>e==="number",Kw=e=>e==="family-name",Yw=e=>e==="number"||e==="weight",Fw=e=>e==="shadow",m2=()=>{const e=pt("color"),t=pt("font"),a=pt("text"),s=pt("font-weight"),o=pt("tracking"),c=pt("leading"),u=pt("breakpoint"),d=pt("container"),h=pt("spacing"),p=pt("radius"),v=pt("shadow"),g=pt("inset-shadow"),S=pt("text-shadow"),_=pt("drop-shadow"),E=pt("blur"),x=pt("perspective"),R=pt("aspect"),C=pt("ease"),N=pt("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],V=()=>[...D(),fe,ue],q=()=>["auto","hidden","clip","visible","scroll"],U=()=>["auto","contain","none"],I=()=>[fe,ue,h],ae=()=>[oa,"full","auto",...I()],me=()=>[Kn,"none","subgrid",fe,ue],ve=()=>["auto",{span:["full",Kn,fe,ue]},Kn,fe,ue],de=()=>[Kn,"auto",fe,ue],pe=()=>["auto","min","max","fr",fe,ue],J=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ie=()=>["start","end","center","stretch","center-safe","end-safe"],O=()=>["auto",...I()],$=()=>[oa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],K=()=>[oa,"screen","full","dvw","lvw","svw","min","max","fit",...I()],Z=()=>[oa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...I()],W=()=>[e,fe,ue],j=()=>[...D(),Qb,Jb,{position:[fe,ue]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],F=()=>["auto","cover","contain",u2,s2,{size:[fe,ue]}],ee=()=>[fh,yo,qa],ne=()=>["","none","full",p,fe,ue],se=()=>["",Oe,yo,qa],te=()=>["solid","dashed","dotted","double"],ce=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[Oe,fh,Qb,Jb],Ce=()=>["","none",E,fe,ue],Re=()=>["none",Oe,fe,ue],Ee=()=>["none",Oe,fe,ue],rt=()=>[Oe,fe,ue],Ke=()=>[oa,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[_r],breakpoint:[_r],color:[$w],container:[_r],"drop-shadow":[_r],ease:["in","out","in-out"],font:[r2],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[_r],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[_r],shadow:[_r],spacing:["px",Oe],text:[_r],"text-shadow":[_r],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",oa,ue,fe,R]}],container:["container"],"container-type":[{"@container":["","normal","size",fe,ue]}],"container-named":[a2],columns:[{columns:[Oe,ue,fe,d]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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"],sr:["sr-only","not-sr-only"],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:V()}],overflow:[{overflow:q()}],"overflow-x":[{"overflow-x":q()}],"overflow-y":[{"overflow-y":q()}],overscroll:[{overscroll:U()}],"overscroll-x":[{"overscroll-x":U()}],"overscroll-y":[{"overscroll-y":U()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:ae()}],"inset-x":[{"inset-x":ae()}],"inset-y":[{"inset-y":ae()}],start:[{"inset-s":ae(),start:ae()}],end:[{"inset-e":ae(),end:ae()}],"inset-bs":[{"inset-bs":ae()}],"inset-be":[{"inset-be":ae()}],top:[{top:ae()}],right:[{right:ae()}],bottom:[{bottom:ae()}],left:[{left:ae()}],visibility:["visible","invisible","collapse"],z:[{z:[Kn,"auto",fe,ue]}],basis:[{basis:[oa,"full","auto",d,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Oe,oa,"auto","initial","none",ue]}],grow:[{grow:["",Oe,fe,ue]}],shrink:[{shrink:["",Oe,fe,ue]}],order:[{order:[Kn,"first","last","none",fe,ue]}],"grid-cols":[{"grid-cols":me()}],"col-start-end":[{col:ve()}],"col-start":[{"col-start":de()}],"col-end":[{"col-end":de()}],"grid-rows":[{"grid-rows":me()}],"row-start-end":[{row:ve()}],"row-start":[{"row-start":de()}],"row-end":[{"row-end":de()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":pe()}],"auto-rows":[{"auto-rows":pe()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...J(),"normal"]}],"justify-items":[{"justify-items":[...ie(),"normal"]}],"justify-self":[{"justify-self":["auto",...ie()]}],"align-content":[{content:["normal",...J()]}],"align-items":[{items:[...ie(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ie(),{baseline:["","last"]}]}],"place-content":[{"place-content":J()}],"place-items":[{"place-items":[...ie(),"baseline"]}],"place-self":[{"place-self":["auto",...ie()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pbs:[{pbs:I()}],pbe:[{pbe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mbs:[{mbs:O()}],mbe:[{mbe:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...K()]}],"min-inline-size":[{"min-inline":["auto",...K()]}],"max-inline-size":[{"max-inline":["none",...K()]}],"block-size":[{block:["auto",...Z()]}],"min-block-size":[{"min-block":["auto",...Z()]}],"max-block-size":[{"max-block":["none",...Z()]}],w:[{w:[d,"screen",...$()]}],"min-w":[{"min-w":[d,"screen","none",...$()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",a,yo,qa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,f2,i2]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",fh,ue]}],"font-family":[{font:[c2,o2,t]}],"font-features":[{"font-features":[ue]}],"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:[o,fe,ue]}],"line-clamp":[{"line-clamp":[Oe,"none",fe,Xb]}],leading:[{leading:[c,...I()]}],"list-image":[{"list-image":["none",fe,ue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",fe,ue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...te(),"wavy"]}],"text-decoration-thickness":[{decoration:[Oe,"from-font","auto",fe,qa]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[Oe,"auto",fe,ue]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"tab-size":[{tab:[Kn,fe,ue]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe,ue]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",fe,ue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:j()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Kn,fe,ue],radial:["",fe,ue],conic:[Kn,fe,ue]},d2,l2]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:ne()}],"rounded-s":[{"rounded-s":ne()}],"rounded-e":[{"rounded-e":ne()}],"rounded-t":[{"rounded-t":ne()}],"rounded-r":[{"rounded-r":ne()}],"rounded-b":[{"rounded-b":ne()}],"rounded-l":[{"rounded-l":ne()}],"rounded-ss":[{"rounded-ss":ne()}],"rounded-se":[{"rounded-se":ne()}],"rounded-ee":[{"rounded-ee":ne()}],"rounded-es":[{"rounded-es":ne()}],"rounded-tl":[{"rounded-tl":ne()}],"rounded-tr":[{"rounded-tr":ne()}],"rounded-br":[{"rounded-br":ne()}],"rounded-bl":[{"rounded-bl":ne()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-bs":[{"border-bs":se()}],"border-w-be":[{"border-be":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...te(),"hidden","none"]}],"divide-style":[{divide:[...te(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-bs":[{"border-bs":W()}],"border-color-be":[{"border-be":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...te(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Oe,fe,ue]}],"outline-w":[{outline:["",Oe,yo,qa]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",v,Cc,Tc]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",g,Cc,Tc]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[Oe,qa]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",S,Cc,Tc]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[Oe,fe,ue]}],"mix-blend":[{"mix-blend":[...ce(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ce()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Oe]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[fe,ue]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":D()}],"mask-image-conic-pos":[{"mask-conic":[Oe]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:j()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",fe,ue]}],filter:[{filter:["","none",fe,ue]}],blur:[{blur:Ce()}],brightness:[{brightness:[Oe,fe,ue]}],contrast:[{contrast:[Oe,fe,ue]}],"drop-shadow":[{"drop-shadow":["","none",_,Cc,Tc]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",Oe,fe,ue]}],"hue-rotate":[{"hue-rotate":[Oe,fe,ue]}],invert:[{invert:["",Oe,fe,ue]}],saturate:[{saturate:[Oe,fe,ue]}],sepia:[{sepia:["",Oe,fe,ue]}],"backdrop-filter":[{"backdrop-filter":["","none",fe,ue]}],"backdrop-blur":[{"backdrop-blur":Ce()}],"backdrop-brightness":[{"backdrop-brightness":[Oe,fe,ue]}],"backdrop-contrast":[{"backdrop-contrast":[Oe,fe,ue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Oe,fe,ue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Oe,fe,ue]}],"backdrop-invert":[{"backdrop-invert":["",Oe,fe,ue]}],"backdrop-opacity":[{"backdrop-opacity":[Oe,fe,ue]}],"backdrop-saturate":[{"backdrop-saturate":[Oe,fe,ue]}],"backdrop-sepia":[{"backdrop-sepia":["",Oe,fe,ue]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",fe,ue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Oe,"initial",fe,ue]}],ease:[{ease:["linear","initial",C,fe,ue]}],delay:[{delay:[Oe,fe,ue]}],animate:[{animate:["none",N,fe,ue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[x,fe,ue]}],"perspective-origin":[{"perspective-origin":V()}],rotate:[{rotate:Re()}],"rotate-x":[{"rotate-x":Re()}],"rotate-y":[{"rotate-y":Re()}],"rotate-z":[{"rotate-z":Re()}],scale:[{scale:Ee()}],"scale-x":[{"scale-x":Ee()}],"scale-y":[{"scale-y":Ee()}],"scale-z":[{"scale-z":Ee()}],"scale-3d":["scale-3d"],skew:[{skew:rt()}],"skew-x":[{"skew-x":rt()}],"skew-y":[{"skew-y":rt()}],transform:[{transform:[fe,ue,"","none","gpu","cpu"]}],"transform-origin":[{origin:V()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ke()}],"translate-x":[{"translate-x":Ke()}],"translate-y":[{"translate-y":Ke()}],"translate-z":[{"translate-z":Ke()}],"translate-none":["translate-none"],zoom:[{zoom:[Kn,fe,ue]}],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",fe,ue]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":W()}],"scrollbar-track-color":[{"scrollbar-track":W()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mbs":[{"scroll-mbs":I()}],"scroll-mbe":[{"scroll-mbe":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pbs":[{"scroll-pbs":I()}],"scroll-pbe":[{"scroll-pbe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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",fe,ue]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[Oe,yo,qa,Xb]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","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-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},p2=Kk(m2);function Le(...e){return p2(Dw(e))}const g2=_m("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),on=y.forwardRef(({className:e,variant:t,size:a,asChild:s=!1,...o},c)=>{const u=s?bk:"button";return b.jsx(u,{className:Le(g2({variant:t,size:a,className:e})),ref:c,...o})});on.displayName="Button";function v2(){const{loginWithGoogle:e,error:t,loading:a}=Jo();return b.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center px-4",children:b.jsxs("div",{className:"w-full max-w-sm",children:[b.jsxs("div",{className:"flex flex-col items-center mb-8 gap-3",children:[b.jsx("div",{className:"w-14 h-14 rounded-2xl bg-primary flex items-center justify-center shadow-lg",children:b.jsx(wm,{className:"w-7 h-7 text-primary-foreground"})}),b.jsx("div",{className:"text-center leading-tight",children:b.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Tablero CDC"})})]}),b.jsxs("div",{className:"bg-card border border-border rounded-2xl p-8 shadow-sm",children:[b.jsxs(on,{onClick:e,disabled:a,className:"w-full gap-2.5 h-10 rounded-full font-medium",children:[b.jsxs("svg",{"aria-hidden":"true",className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:[b.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),b.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),b.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),b.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),"Entrar con Google"]}),t&&b.jsx("div",{className:"mt-4 rounded-lg bg-destructive/10 border border-destructive/20 px-4 py-3",children:b.jsx("p",{className:"text-sm text-destructive text-center leading-snug",children:t})})]}),b.jsxs("p",{className:"text-center text-xs text-muted-foreground mt-6",children:["Solo acceso para usuarios ",b.jsx("span",{className:"font-medium",children:"@gomezleemarketing.com"})]})]})})}const Jn=y.forwardRef(({className:e,type:t,...a},s)=>b.jsx("input",{type:t,className:Le("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:s,...a}));Jn.displayName="Input";function be(e,t,{checkForDefaultPrevented:a=!0}={}){return function(o){if(e==null||e(o),a===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function y2(e,t){const a=y.createContext(t),s=c=>{const{children:u,...d}=c,h=y.useMemo(()=>d,Object.values(d));return b.jsx(a.Provider,{value:h,children:u})};s.displayName=e+"Provider";function o(c){const u=y.useContext(a);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${c}\` must be used within \`${e}\``)}return[s,o]}function es(e,t=[]){let a=[];function s(c,u){const d=y.createContext(u),h=a.length;a=[...a,u];const p=g=>{var C;const{scope:S,children:_,...E}=g,x=((C=S==null?void 0:S[e])==null?void 0:C[h])||d,R=y.useMemo(()=>E,Object.values(E));return b.jsx(x.Provider,{value:R,children:_})};p.displayName=c+"Provider";function v(g,S){var x;const _=((x=S==null?void 0:S[e])==null?void 0:x[h])||d,E=y.useContext(_);if(E)return E;if(u!==void 0)return u;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[p,v]}const o=()=>{const c=a.map(u=>y.createContext(u));return function(d){const h=(d==null?void 0:d[e])||c;return y.useMemo(()=>({[`__scope${e}`]:{...d,[e]:h}}),[d,h])}};return o.scopeName=e,[s,b2(o,...t)]}function b2(...e){const t=e[0];if(e.length===1)return t;const a=()=>{const s=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(c){const u=s.reduce((d,{useScope:h,scopeName:p})=>{const g=h(c)[`__scope${p}`];return{...d,...g}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return a.scopeName=t.scopeName,a}var gt=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},w2=om[" useInsertionEffect ".trim().toString()]||gt;function Po({prop:e,defaultProp:t,onChange:a=()=>{},caller:s}){const[o,c,u]=S2({defaultProp:t,onChange:a}),d=e!==void 0,h=d?e:o;{const v=y.useRef(e!==void 0);y.useEffect(()=>{const g=v.current;g!==d&&console.warn(`${s} is changing from ${g?"controlled":"uncontrolled"} to ${d?"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.`),v.current=d},[d,s])}const p=y.useCallback(v=>{var g;if(d){const S=_2(v)?v(e):v;S!==e&&((g=u.current)==null||g.call(u,S))}else c(v)},[d,e,c,u]);return[h,p]}function S2({defaultProp:e,onChange:t}){const[a,s]=y.useState(e),o=y.useRef(a),c=y.useRef(t);return w2(()=>{c.current=t},[t]),y.useEffect(()=>{var u;o.current!==a&&((u=c.current)==null||u.call(c,a),o.current=a)},[a,o]),[a,s,c]}function _2(e){return typeof e=="function"}function x2(e){const t=E2(e),a=y.forwardRef((s,o)=>{const{children:c,...u}=s,d=y.Children.toArray(c),h=d.find(C2);if(h){const p=h.props.children,v=d.map(g=>g===h?y.Children.count(p)>1?y.Children.only(null):y.isValidElement(p)?p.props.children:null:g);return b.jsx(t,{...u,ref:o,children:y.isValidElement(p)?y.cloneElement(p,void 0,v):null})}return b.jsx(t,{...u,ref:o,children:c})});return a.displayName=`${e}.Slot`,a}function E2(e){const t=y.forwardRef((a,s)=>{const{children:o,...c}=a;if(y.isValidElement(o)){const u=A2(o),d=R2(c,o.props);return o.type!==y.Fragment&&(d.ref=s?jr(s,u):u),y.cloneElement(o,d)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var T2=Symbol("radix.slottable");function C2(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===T2}function R2(e,t){const a={...t};for(const s in t){const o=e[s],c=t[s];/^on[A-Z]/.test(s)?o&&c?a[s]=(...d)=>{const h=c(...d);return o(...d),h}:o&&(a[s]=o):s==="style"?a[s]={...o,...c}:s==="className"&&(a[s]=[o,c].filter(Boolean).join(" "))}return{...e,...a}}function A2(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var N2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ze=N2.reduce((e,t)=>{const a=x2(`Primitive.${t}`),s=y.forwardRef((o,c)=>{const{asChild:u,...d}=o,h=u?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(h,{...d,ref:c})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function Ww(e,t){e&&Wo.flushSync(()=>e.dispatchEvent(t))}function Zb(e){const t=O2(e),a=y.forwardRef((s,o)=>{const{children:c,...u}=s,d=y.Children.toArray(c),h=d.find(j2);if(h){const p=h.props.children,v=d.map(g=>g===h?y.Children.count(p)>1?y.Children.only(null):y.isValidElement(p)?p.props.children:null:g);return b.jsx(t,{...u,ref:o,children:y.isValidElement(p)?y.cloneElement(p,void 0,v):null})}return b.jsx(t,{...u,ref:o,children:c})});return a.displayName=`${e}.Slot`,a}function O2(e){const t=y.forwardRef((a,s)=>{const{children:o,...c}=a;if(y.isValidElement(o)){const u=D2(o),d=M2(c,o.props);return o.type!==y.Fragment&&(d.ref=s?jr(s,u):u),y.cloneElement(o,d)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var k2=Symbol("radix.slottable");function j2(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===k2}function M2(e,t){const a={...t};for(const s in t){const o=e[s],c=t[s];/^on[A-Z]/.test(s)?o&&c?a[s]=(...d)=>{const h=c(...d);return o(...d),h}:o&&(a[s]=o):s==="style"?a[s]={...o,...c}:s==="className"&&(a[s]=[o,c].filter(Boolean).join(" "))}return{...e,...a}}function D2(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function Tm(e){const t=e+"CollectionProvider",[a,s]=es(t),[o,c]=a(t,{collectionRef:{current:null},itemMap:new Map}),u=x=>{const{scope:R,children:C}=x,N=re.useRef(null),A=re.useRef(new Map).current;return b.jsx(o,{scope:R,itemMap:A,collectionRef:N,children:C})};u.displayName=t;const d=e+"CollectionSlot",h=Zb(d),p=re.forwardRef((x,R)=>{const{scope:C,children:N}=x,A=c(d,C),D=Fe(R,A.collectionRef);return b.jsx(h,{ref:D,children:N})});p.displayName=d;const v=e+"CollectionItemSlot",g="data-radix-collection-item",S=Zb(v),_=re.forwardRef((x,R)=>{const{scope:C,children:N,...A}=x,D=re.useRef(null),V=Fe(R,D),q=c(v,C);return re.useEffect(()=>(q.itemMap.set(D,{ref:D,...A}),()=>void q.itemMap.delete(D))),b.jsx(S,{[g]:"",ref:V,children:N})});_.displayName=v;function E(x){const R=c(e+"CollectionConsumer",x);return re.useCallback(()=>{const N=R.collectionRef.current;if(!N)return[];const A=Array.from(N.querySelectorAll(`[${g}]`));return Array.from(R.itemMap.values()).sort((q,U)=>A.indexOf(q.ref.current)-A.indexOf(U.ref.current))},[R.collectionRef,R.itemMap])}return[{Provider:u,Slot:p,ItemSlot:_},E,s]}var L2=y.createContext(void 0);function Cm(e){const t=y.useContext(L2);return e||t||"ltr"}function Ln(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...a)=>{var s;return(s=t.current)==null?void 0:s.call(t,...a)},[])}function U2(e,t=globalThis==null?void 0:globalThis.document){const a=Ln(e);y.useEffect(()=>{const s=o=>{o.key==="Escape"&&a(o)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[a,t])}var z2="DismissableLayer",qh="dismissableLayer.update",P2="dismissableLayer.pointerDownOutside",B2="dismissableLayer.focusOutside",e0,Xw=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Su=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:c,onInteractOutside:u,onDismiss:d,...h}=e,p=y.useContext(Xw),[v,g]=y.useState(null),S=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,_]=y.useState({}),E=Fe(t,U=>g(U)),x=Array.from(p.layers),[R]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),C=x.indexOf(R),N=v?x.indexOf(v):-1,A=p.layersWithOutsidePointerEventsDisabled.size>0,D=N>=C,V=H2(U=>{const I=U.target,ae=[...p.branches].some(me=>me.contains(I));!D||ae||(o==null||o(U),u==null||u(U),U.defaultPrevented||d==null||d())},S),q=q2(U=>{const I=U.target;[...p.branches].some(me=>me.contains(I))||(c==null||c(U),u==null||u(U),U.defaultPrevented||d==null||d())},S);return U2(U=>{N===p.layers.size-1&&(s==null||s(U),!U.defaultPrevented&&d&&(U.preventDefault(),d()))},S),y.useEffect(()=>{if(v)return a&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(e0=S.body.style.pointerEvents,S.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(v)),p.layers.add(v),t0(),()=>{a&&p.layersWithOutsidePointerEventsDisabled.size===1&&(S.body.style.pointerEvents=e0)}},[v,S,a,p]),y.useEffect(()=>()=>{v&&(p.layers.delete(v),p.layersWithOutsidePointerEventsDisabled.delete(v),t0())},[v,p]),y.useEffect(()=>{const U=()=>_({});return document.addEventListener(qh,U),()=>document.removeEventListener(qh,U)},[]),b.jsx(ze.div,{...h,ref:E,style:{pointerEvents:A?D?"auto":"none":void 0,...e.style},onFocusCapture:be(e.onFocusCapture,q.onFocusCapture),onBlurCapture:be(e.onBlurCapture,q.onBlurCapture),onPointerDownCapture:be(e.onPointerDownCapture,V.onPointerDownCapture)})});Su.displayName=z2;var I2="DismissableLayerBranch",$2=y.forwardRef((e,t)=>{const a=y.useContext(Xw),s=y.useRef(null),o=Fe(t,s);return y.useEffect(()=>{const c=s.current;if(c)return a.branches.add(c),()=>{a.branches.delete(c)}},[a.branches]),b.jsx(ze.div,{...e,ref:o})});$2.displayName=I2;function H2(e,t=globalThis==null?void 0:globalThis.document){const a=Ln(e),s=y.useRef(!1),o=y.useRef(()=>{});return y.useEffect(()=>{const c=d=>{if(d.target&&!s.current){let h=function(){Jw(P2,a,p,{discrete:!0})};const p={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=h,t.addEventListener("click",o.current,{once:!0})):h()}else t.removeEventListener("click",o.current);s.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",c)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",c),t.removeEventListener("click",o.current)}},[t,a]),{onPointerDownCapture:()=>s.current=!0}}function q2(e,t=globalThis==null?void 0:globalThis.document){const a=Ln(e),s=y.useRef(!1);return y.useEffect(()=>{const o=c=>{c.target&&!s.current&&Jw(B2,a,{originalEvent:c},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,a]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function t0(){const e=new CustomEvent(qh);document.dispatchEvent(e)}function Jw(e,t,a,{discrete:s}){const o=a.originalEvent.target,c=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});t&&o.addEventListener(e,t,{once:!0}),s?Ww(o,c):o.dispatchEvent(c)}var hh=0;function Rm(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??n0()),document.body.insertAdjacentElement("beforeend",e[1]??n0()),hh++,()=>{hh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),hh--}},[])}function n0(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var mh="focusScope.autoFocusOnMount",ph="focusScope.autoFocusOnUnmount",r0={bubbles:!1,cancelable:!0},G2="FocusScope",_u=y.forwardRef((e,t)=>{const{loop:a=!1,trapped:s=!1,onMountAutoFocus:o,onUnmountAutoFocus:c,...u}=e,[d,h]=y.useState(null),p=Ln(o),v=Ln(c),g=y.useRef(null),S=Fe(t,x=>h(x)),_=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(s){let x=function(A){if(_.paused||!d)return;const D=A.target;d.contains(D)?g.current=D:ca(g.current,{select:!0})},R=function(A){if(_.paused||!d)return;const D=A.relatedTarget;D!==null&&(d.contains(D)||ca(g.current,{select:!0}))},C=function(A){if(document.activeElement===document.body)for(const V of A)V.removedNodes.length>0&&ca(d)};document.addEventListener("focusin",x),document.addEventListener("focusout",R);const N=new MutationObserver(C);return d&&N.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",R),N.disconnect()}}},[s,d,_.paused]),y.useEffect(()=>{if(d){s0.add(_);const x=document.activeElement;if(!d.contains(x)){const C=new CustomEvent(mh,r0);d.addEventListener(mh,p),d.dispatchEvent(C),C.defaultPrevented||(V2(X2(Qw(d)),{select:!0}),document.activeElement===x&&ca(d))}return()=>{d.removeEventListener(mh,p),setTimeout(()=>{const C=new CustomEvent(ph,r0);d.addEventListener(ph,v),d.dispatchEvent(C),C.defaultPrevented||ca(x??document.body,{select:!0}),d.removeEventListener(ph,v),s0.remove(_)},0)}}},[d,p,v,_]);const E=y.useCallback(x=>{if(!a&&!s||_.paused)return;const R=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,C=document.activeElement;if(R&&C){const N=x.currentTarget,[A,D]=K2(N);A&&D?!x.shiftKey&&C===D?(x.preventDefault(),a&&ca(A,{select:!0})):x.shiftKey&&C===A&&(x.preventDefault(),a&&ca(D,{select:!0})):C===N&&x.preventDefault()}},[a,s,_.paused]);return b.jsx(ze.div,{tabIndex:-1,...u,ref:S,onKeyDown:E})});_u.displayName=G2;function V2(e,{select:t=!1}={}){const a=document.activeElement;for(const s of e)if(ca(s,{select:t}),document.activeElement!==a)return}function K2(e){const t=Qw(e),a=a0(t,e),s=a0(t.reverse(),e);return[a,s]}function Qw(e){const t=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const o=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||o?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)t.push(a.currentNode);return t}function a0(e,t){for(const a of e)if(!Y2(a,{upTo:t}))return a}function Y2(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function F2(e){return e instanceof HTMLInputElement&&"select"in e}function ca(e,{select:t=!1}={}){if(e&&e.focus){const a=document.activeElement;e.focus({preventScroll:!0}),e!==a&&F2(e)&&t&&e.select()}}var s0=W2();function W2(){let e=[];return{add(t){const a=e[0];t!==a&&(a==null||a.pause()),e=i0(e,t),e.unshift(t)},remove(t){var a;e=i0(e,t),(a=e[0])==null||a.resume()}}}function i0(e,t){const a=[...e],s=a.indexOf(t);return s!==-1&&a.splice(s,1),a}function X2(e){return e.filter(t=>t.tagName!=="A")}var J2=om[" useId ".trim().toString()]||(()=>{}),Q2=0;function Tr(e){const[t,a]=y.useState(J2());return gt(()=>{a(s=>s??String(Q2++))},[e]),t?`radix-${t}`:""}const Z2=["top","right","bottom","left"],fa=Math.min,an=Math.max,iu=Math.round,Rc=Math.floor,Zn=e=>({x:e,y:e}),ej={left:"right",right:"left",bottom:"top",top:"bottom"};function Gh(e,t,a){return an(e,fa(t,a))}function Rr(e,t){return typeof e=="function"?e(t):e}function Ar(e){return e.split("-")[0]}function vi(e){return e.split("-")[1]}function Am(e){return e==="x"?"y":"x"}function Nm(e){return e==="y"?"height":"width"}function Qn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Om(e){return Am(Qn(e))}function tj(e,t,a){a===void 0&&(a=!1);const s=vi(e),o=Om(e),c=Nm(o);let u=o==="x"?s===(a?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[c]>t.floating[c]&&(u=ou(u)),[u,ou(u)]}function nj(e){const t=ou(e);return[Vh(e),t,Vh(t)]}function Vh(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const o0=["left","right"],l0=["right","left"],rj=["top","bottom"],aj=["bottom","top"];function sj(e,t,a){switch(e){case"top":case"bottom":return a?t?l0:o0:t?o0:l0;case"left":case"right":return t?rj:aj;default:return[]}}function ij(e,t,a,s){const o=vi(e);let c=sj(Ar(e),a==="start",s);return o&&(c=c.map(u=>u+"-"+o),t&&(c=c.concat(c.map(Vh)))),c}function ou(e){const t=Ar(e);return ej[t]+e.slice(t.length)}function oj(e){return{top:0,right:0,bottom:0,left:0,...e}}function Zw(e){return typeof e!="number"?oj(e):{top:e,right:e,bottom:e,left:e}}function lu(e){const{x:t,y:a,width:s,height:o}=e;return{width:s,height:o,top:a,left:t,right:t+s,bottom:a+o,x:t,y:a}}function c0(e,t,a){let{reference:s,floating:o}=e;const c=Qn(t),u=Om(t),d=Nm(u),h=Ar(t),p=c==="y",v=s.x+s.width/2-o.width/2,g=s.y+s.height/2-o.height/2,S=s[d]/2-o[d]/2;let _;switch(h){case"top":_={x:v,y:s.y-o.height};break;case"bottom":_={x:v,y:s.y+s.height};break;case"right":_={x:s.x+s.width,y:g};break;case"left":_={x:s.x-o.width,y:g};break;default:_={x:s.x,y:s.y}}switch(vi(t)){case"start":_[u]-=S*(a&&p?-1:1);break;case"end":_[u]+=S*(a&&p?-1:1);break}return _}async function lj(e,t){var a;t===void 0&&(t={});const{x:s,y:o,platform:c,rects:u,elements:d,strategy:h}=e,{boundary:p="clippingAncestors",rootBoundary:v="viewport",elementContext:g="floating",altBoundary:S=!1,padding:_=0}=Rr(t,e),E=Zw(_),R=d[S?g==="floating"?"reference":"floating":g],C=lu(await c.getClippingRect({element:(a=await(c.isElement==null?void 0:c.isElement(R)))==null||a?R:R.contextElement||await(c.getDocumentElement==null?void 0:c.getDocumentElement(d.floating)),boundary:p,rootBoundary:v,strategy:h})),N=g==="floating"?{x:s,y:o,width:u.floating.width,height:u.floating.height}:u.reference,A=await(c.getOffsetParent==null?void 0:c.getOffsetParent(d.floating)),D=await(c.isElement==null?void 0:c.isElement(A))?await(c.getScale==null?void 0:c.getScale(A))||{x:1,y:1}:{x:1,y:1},V=lu(c.convertOffsetParentRelativeRectToViewportRelativeRect?await c.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:N,offsetParent:A,strategy:h}):N);return{top:(C.top-V.top+E.top)/D.y,bottom:(V.bottom-C.bottom+E.bottom)/D.y,left:(C.left-V.left+E.left)/D.x,right:(V.right-C.right+E.right)/D.x}}const cj=50,uj=async(e,t,a)=>{const{placement:s="bottom",strategy:o="absolute",middleware:c=[],platform:u}=a,d=u.detectOverflow?u:{...u,detectOverflow:lj},h=await(u.isRTL==null?void 0:u.isRTL(t));let p=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:v,y:g}=c0(p,s,h),S=s,_=0;const E={};for(let x=0;x<c.length;x++){const R=c[x];if(!R)continue;const{name:C,fn:N}=R,{x:A,y:D,data:V,reset:q}=await N({x:v,y:g,initialPlacement:s,placement:S,strategy:o,middlewareData:E,rects:p,platform:d,elements:{reference:e,floating:t}});v=A??v,g=D??g,E[C]={...E[C],...V},q&&_<cj&&(_++,typeof q=="object"&&(q.placement&&(S=q.placement),q.rects&&(p=q.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:o}):q.rects),{x:v,y:g}=c0(p,S,h)),x=-1)}return{x:v,y:g,placement:S,strategy:o,middlewareData:E}},dj=e=>({name:"arrow",options:e,async fn(t){const{x:a,y:s,placement:o,rects:c,platform:u,elements:d,middlewareData:h}=t,{element:p,padding:v=0}=Rr(e,t)||{};if(p==null)return{};const g=Zw(v),S={x:a,y:s},_=Om(o),E=Nm(_),x=await u.getDimensions(p),R=_==="y",C=R?"top":"left",N=R?"bottom":"right",A=R?"clientHeight":"clientWidth",D=c.reference[E]+c.reference[_]-S[_]-c.floating[E],V=S[_]-c.reference[_],q=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p));let U=q?q[A]:0;(!U||!await(u.isElement==null?void 0:u.isElement(q)))&&(U=d.floating[A]||c.floating[E]);const I=D/2-V/2,ae=U/2-x[E]/2-1,me=fa(g[C],ae),ve=fa(g[N],ae),de=me,pe=U-x[E]-ve,J=U/2-x[E]/2+I,ie=Gh(de,J,pe),O=!h.arrow&&vi(o)!=null&&J!==ie&&c.reference[E]/2-(J<de?me:ve)-x[E]/2<0,$=O?J<de?J-de:J-pe:0;return{[_]:S[_]+$,data:{[_]:ie,centerOffset:J-ie-$,...O&&{alignmentOffset:$}},reset:O}}}),fj=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var a,s;const{placement:o,middlewareData:c,rects:u,initialPlacement:d,platform:h,elements:p}=t,{mainAxis:v=!0,crossAxis:g=!0,fallbackPlacements:S,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:x=!0,...R}=Rr(e,t);if((a=c.arrow)!=null&&a.alignmentOffset)return{};const C=Ar(o),N=Qn(d),A=Ar(d)===d,D=await(h.isRTL==null?void 0:h.isRTL(p.floating)),V=S||(A||!x?[ou(d)]:nj(d)),q=E!=="none";!S&&q&&V.push(...ij(d,x,E,D));const U=[d,...V],I=await h.detectOverflow(t,R),ae=[];let me=((s=c.flip)==null?void 0:s.overflows)||[];if(v&&ae.push(I[C]),g){const J=tj(o,u,D);ae.push(I[J[0]],I[J[1]])}if(me=[...me,{placement:o,overflows:ae}],!ae.every(J=>J<=0)){var ve,de;const J=(((ve=c.flip)==null?void 0:ve.index)||0)+1,ie=U[J];if(ie&&(!(g==="alignment"?N!==Qn(ie):!1)||me.every(K=>Qn(K.placement)===N?K.overflows[0]>0:!0)))return{data:{index:J,overflows:me},reset:{placement:ie}};let O=(de=me.filter($=>$.overflows[0]<=0).sort(($,K)=>$.overflows[1]-K.overflows[1])[0])==null?void 0:de.placement;if(!O)switch(_){case"bestFit":{var pe;const $=(pe=me.filter(K=>{if(q){const Z=Qn(K.placement);return Z===N||Z==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(Z=>Z>0).reduce((Z,W)=>Z+W,0)]).sort((K,Z)=>K[1]-Z[1])[0])==null?void 0:pe[0];$&&(O=$);break}case"initialPlacement":O=d;break}if(o!==O)return{reset:{placement:O}}}return{}}}};function u0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function d0(e){return Z2.some(t=>e[t]>=0)}const hj=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:a,platform:s}=t,{strategy:o="referenceHidden",...c}=Rr(e,t);switch(o){case"referenceHidden":{const u=await s.detectOverflow(t,{...c,elementContext:"reference"}),d=u0(u,a.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:d0(d)}}}case"escaped":{const u=await s.detectOverflow(t,{...c,altBoundary:!0}),d=u0(u,a.floating);return{data:{escapedOffsets:d,escaped:d0(d)}}}default:return{}}}}},eS=new Set(["left","top"]);async function mj(e,t){const{placement:a,platform:s,elements:o}=e,c=await(s.isRTL==null?void 0:s.isRTL(o.floating)),u=Ar(a),d=vi(a),h=Qn(a)==="y",p=eS.has(u)?-1:1,v=c&&h?-1:1,g=Rr(t,e);let{mainAxis:S,crossAxis:_,alignmentAxis:E}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof E=="number"&&(_=d==="end"?E*-1:E),h?{x:_*v,y:S*p}:{x:S*p,y:_*v}}const pj=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var a,s;const{x:o,y:c,placement:u,middlewareData:d}=t,h=await mj(t,e);return u===((a=d.offset)==null?void 0:a.placement)&&(s=d.arrow)!=null&&s.alignmentOffset?{}:{x:o+h.x,y:c+h.y,data:{...h,placement:u}}}}},gj=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:a,y:s,placement:o,platform:c}=t,{mainAxis:u=!0,crossAxis:d=!1,limiter:h={fn:C=>{let{x:N,y:A}=C;return{x:N,y:A}}},...p}=Rr(e,t),v={x:a,y:s},g=await c.detectOverflow(t,p),S=Qn(Ar(o)),_=Am(S);let E=v[_],x=v[S];if(u){const C=_==="y"?"top":"left",N=_==="y"?"bottom":"right",A=E+g[C],D=E-g[N];E=Gh(A,E,D)}if(d){const C=S==="y"?"top":"left",N=S==="y"?"bottom":"right",A=x+g[C],D=x-g[N];x=Gh(A,x,D)}const R=h.fn({...t,[_]:E,[S]:x});return{...R,data:{x:R.x-a,y:R.y-s,enabled:{[_]:u,[S]:d}}}}}},vj=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:a,y:s,placement:o,rects:c,middlewareData:u}=t,{offset:d=0,mainAxis:h=!0,crossAxis:p=!0}=Rr(e,t),v={x:a,y:s},g=Qn(o),S=Am(g);let _=v[S],E=v[g];const x=Rr(d,t),R=typeof x=="number"?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(h){const A=S==="y"?"height":"width",D=c.reference[S]-c.floating[A]+R.mainAxis,V=c.reference[S]+c.reference[A]-R.mainAxis;_<D?_=D:_>V&&(_=V)}if(p){var C,N;const A=S==="y"?"width":"height",D=eS.has(Ar(o)),V=c.reference[g]-c.floating[A]+(D&&((C=u.offset)==null?void 0:C[g])||0)+(D?0:R.crossAxis),q=c.reference[g]+c.reference[A]+(D?0:((N=u.offset)==null?void 0:N[g])||0)-(D?R.crossAxis:0);E<V?E=V:E>q&&(E=q)}return{[S]:_,[g]:E}}}},yj=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var a,s;const{placement:o,rects:c,platform:u,elements:d}=t,{apply:h=()=>{},...p}=Rr(e,t),v=await u.detectOverflow(t,p),g=Ar(o),S=vi(o),_=Qn(o)==="y",{width:E,height:x}=c.floating;let R,C;g==="top"||g==="bottom"?(R=g,C=S===(await(u.isRTL==null?void 0:u.isRTL(d.floating))?"start":"end")?"left":"right"):(C=g,R=S==="end"?"top":"bottom");const N=x-v.top-v.bottom,A=E-v.left-v.right,D=fa(x-v[R],N),V=fa(E-v[C],A),q=!t.middlewareData.shift;let U=D,I=V;if((a=t.middlewareData.shift)!=null&&a.enabled.x&&(I=A),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(U=N),q&&!S){const me=an(v.left,0),ve=an(v.right,0),de=an(v.top,0),pe=an(v.bottom,0);_?I=E-2*(me!==0||ve!==0?me+ve:an(v.left,v.right)):U=x-2*(de!==0||pe!==0?de+pe:an(v.top,v.bottom))}await h({...t,availableWidth:I,availableHeight:U});const ae=await u.getDimensions(d.floating);return E!==ae.width||x!==ae.height?{reset:{rects:!0}}:{}}}};function xu(){return typeof window<"u"}function yi(e){return tS(e)?(e.nodeName||"").toLowerCase():"#document"}function ln(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function tr(e){var t;return(t=(tS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function tS(e){return xu()?e instanceof Node||e instanceof ln(e).Node:!1}function Un(e){return xu()?e instanceof Element||e instanceof ln(e).Element:!1}function Mr(e){return xu()?e instanceof HTMLElement||e instanceof ln(e).HTMLElement:!1}function f0(e){return!xu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ln(e).ShadowRoot}function Qo(e){const{overflow:t,overflowX:a,overflowY:s,display:o}=zn(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+a)&&o!=="inline"&&o!=="contents"}function bj(e){return/^(table|td|th)$/.test(yi(e))}function Eu(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const wj=/transform|translate|scale|rotate|perspective|filter/,Sj=/paint|layout|strict|content/,Ga=e=>!!e&&e!=="none";let gh;function km(e){const t=Un(e)?zn(e):e;return Ga(t.transform)||Ga(t.translate)||Ga(t.scale)||Ga(t.rotate)||Ga(t.perspective)||!jm()&&(Ga(t.backdropFilter)||Ga(t.filter))||wj.test(t.willChange||"")||Sj.test(t.contain||"")}function _j(e){let t=ha(e);for(;Mr(t)&&!ui(t);){if(km(t))return t;if(Eu(t))return null;t=ha(t)}return null}function jm(){return gh==null&&(gh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),gh}function ui(e){return/^(html|body|#document)$/.test(yi(e))}function zn(e){return ln(e).getComputedStyle(e)}function Tu(e){return Un(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ha(e){if(yi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||f0(e)&&e.host||tr(e);return f0(t)?t.host:t}function nS(e){const t=ha(e);return ui(t)?e.ownerDocument?e.ownerDocument.body:e.body:Mr(t)&&Qo(t)?t:nS(t)}function Bo(e,t,a){var s;t===void 0&&(t=[]),a===void 0&&(a=!0);const o=nS(e),c=o===((s=e.ownerDocument)==null?void 0:s.body),u=ln(o);if(c){const d=Kh(u);return t.concat(u,u.visualViewport||[],Qo(o)?o:[],d&&a?Bo(d):[])}else return t.concat(o,Bo(o,[],a))}function Kh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function rS(e){const t=zn(e);let a=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const o=Mr(e),c=o?e.offsetWidth:a,u=o?e.offsetHeight:s,d=iu(a)!==c||iu(s)!==u;return d&&(a=c,s=u),{width:a,height:s,$:d}}function Mm(e){return Un(e)?e:e.contextElement}function oi(e){const t=Mm(e);if(!Mr(t))return Zn(1);const a=t.getBoundingClientRect(),{width:s,height:o,$:c}=rS(t);let u=(c?iu(a.width):a.width)/s,d=(c?iu(a.height):a.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!d||!Number.isFinite(d))&&(d=1),{x:u,y:d}}const xj=Zn(0);function aS(e){const t=ln(e);return!jm()||!t.visualViewport?xj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ej(e,t,a){return t===void 0&&(t=!1),!a||t&&a!==ln(e)?!1:t}function Wa(e,t,a,s){t===void 0&&(t=!1),a===void 0&&(a=!1);const o=e.getBoundingClientRect(),c=Mm(e);let u=Zn(1);t&&(s?Un(s)&&(u=oi(s)):u=oi(e));const d=Ej(c,a,s)?aS(c):Zn(0);let h=(o.left+d.x)/u.x,p=(o.top+d.y)/u.y,v=o.width/u.x,g=o.height/u.y;if(c){const S=ln(c),_=s&&Un(s)?ln(s):s;let E=S,x=Kh(E);for(;x&&s&&_!==E;){const R=oi(x),C=x.getBoundingClientRect(),N=zn(x),A=C.left+(x.clientLeft+parseFloat(N.paddingLeft))*R.x,D=C.top+(x.clientTop+parseFloat(N.paddingTop))*R.y;h*=R.x,p*=R.y,v*=R.x,g*=R.y,h+=A,p+=D,E=ln(x),x=Kh(E)}}return lu({width:v,height:g,x:h,y:p})}function Cu(e,t){const a=Tu(e).scrollLeft;return t?t.left+a:Wa(tr(e)).left+a}function sS(e,t){const a=e.getBoundingClientRect(),s=a.left+t.scrollLeft-Cu(e,a),o=a.top+t.scrollTop;return{x:s,y:o}}function Tj(e){let{elements:t,rect:a,offsetParent:s,strategy:o}=e;const c=o==="fixed",u=tr(s),d=t?Eu(t.floating):!1;if(s===u||d&&c)return a;let h={scrollLeft:0,scrollTop:0},p=Zn(1);const v=Zn(0),g=Mr(s);if((g||!g&&!c)&&((yi(s)!=="body"||Qo(u))&&(h=Tu(s)),g)){const _=Wa(s);p=oi(s),v.x=_.x+s.clientLeft,v.y=_.y+s.clientTop}const S=u&&!g&&!c?sS(u,h):Zn(0);return{width:a.width*p.x,height:a.height*p.y,x:a.x*p.x-h.scrollLeft*p.x+v.x+S.x,y:a.y*p.y-h.scrollTop*p.y+v.y+S.y}}function Cj(e){return Array.from(e.getClientRects())}function Rj(e){const t=tr(e),a=Tu(e),s=e.ownerDocument.body,o=an(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),c=an(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let u=-a.scrollLeft+Cu(e);const d=-a.scrollTop;return zn(s).direction==="rtl"&&(u+=an(t.clientWidth,s.clientWidth)-o),{width:o,height:c,x:u,y:d}}const h0=25;function Aj(e,t){const a=ln(e),s=tr(e),o=a.visualViewport;let c=s.clientWidth,u=s.clientHeight,d=0,h=0;if(o){c=o.width,u=o.height;const v=jm();(!v||v&&t==="fixed")&&(d=o.offsetLeft,h=o.offsetTop)}const p=Cu(s);if(p<=0){const v=s.ownerDocument,g=v.body,S=getComputedStyle(g),_=v.compatMode==="CSS1Compat"&&parseFloat(S.marginLeft)+parseFloat(S.marginRight)||0,E=Math.abs(s.clientWidth-g.clientWidth-_);E<=h0&&(c-=E)}else p<=h0&&(c+=p);return{width:c,height:u,x:d,y:h}}function Nj(e,t){const a=Wa(e,!0,t==="fixed"),s=a.top+e.clientTop,o=a.left+e.clientLeft,c=Mr(e)?oi(e):Zn(1),u=e.clientWidth*c.x,d=e.clientHeight*c.y,h=o*c.x,p=s*c.y;return{width:u,height:d,x:h,y:p}}function m0(e,t,a){let s;if(t==="viewport")s=Aj(e,a);else if(t==="document")s=Rj(tr(e));else if(Un(t))s=Nj(t,a);else{const o=aS(e);s={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return lu(s)}function iS(e,t){const a=ha(e);return a===t||!Un(a)||ui(a)?!1:zn(a).position==="fixed"||iS(a,t)}function Oj(e,t){const a=t.get(e);if(a)return a;let s=Bo(e,[],!1).filter(d=>Un(d)&&yi(d)!=="body"),o=null;const c=zn(e).position==="fixed";let u=c?ha(e):e;for(;Un(u)&&!ui(u);){const d=zn(u),h=km(u);!h&&d.position==="fixed"&&(o=null),(c?!h&&!o:!h&&d.position==="static"&&!!o&&(o.position==="absolute"||o.position==="fixed")||Qo(u)&&!h&&iS(e,u))?s=s.filter(v=>v!==u):o=d,u=ha(u)}return t.set(e,s),s}function kj(e){let{element:t,boundary:a,rootBoundary:s,strategy:o}=e;const u=[...a==="clippingAncestors"?Eu(t)?[]:Oj(t,this._c):[].concat(a),s],d=m0(t,u[0],o);let h=d.top,p=d.right,v=d.bottom,g=d.left;for(let S=1;S<u.length;S++){const _=m0(t,u[S],o);h=an(_.top,h),p=fa(_.right,p),v=fa(_.bottom,v),g=an(_.left,g)}return{width:p-g,height:v-h,x:g,y:h}}function jj(e){const{width:t,height:a}=rS(e);return{width:t,height:a}}function Mj(e,t,a){const s=Mr(t),o=tr(t),c=a==="fixed",u=Wa(e,!0,c,t);let d={scrollLeft:0,scrollTop:0};const h=Zn(0);function p(){h.x=Cu(o)}if(s||!s&&!c)if((yi(t)!=="body"||Qo(o))&&(d=Tu(t)),s){const _=Wa(t,!0,c,t);h.x=_.x+t.clientLeft,h.y=_.y+t.clientTop}else o&&p();c&&!s&&o&&p();const v=o&&!s&&!c?sS(o,d):Zn(0),g=u.left+d.scrollLeft-h.x-v.x,S=u.top+d.scrollTop-h.y-v.y;return{x:g,y:S,width:u.width,height:u.height}}function vh(e){return zn(e).position==="static"}function p0(e,t){if(!Mr(e)||zn(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;return tr(e)===a&&(a=a.ownerDocument.body),a}function oS(e,t){const a=ln(e);if(Eu(e))return a;if(!Mr(e)){let o=ha(e);for(;o&&!ui(o);){if(Un(o)&&!vh(o))return o;o=ha(o)}return a}let s=p0(e,t);for(;s&&bj(s)&&vh(s);)s=p0(s,t);return s&&ui(s)&&vh(s)&&!km(s)?a:s||_j(e)||a}const Dj=async function(e){const t=this.getOffsetParent||oS,a=this.getDimensions,s=await a(e.floating);return{reference:Mj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Lj(e){return zn(e).direction==="rtl"}const Uj={convertOffsetParentRelativeRectToViewportRelativeRect:Tj,getDocumentElement:tr,getClippingRect:kj,getOffsetParent:oS,getElementRects:Dj,getClientRects:Cj,getDimensions:jj,getScale:oi,isElement:Un,isRTL:Lj};function lS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zj(e,t){let a=null,s;const o=tr(e);function c(){var d;clearTimeout(s),(d=a)==null||d.disconnect(),a=null}function u(d,h){d===void 0&&(d=!1),h===void 0&&(h=1),c();const p=e.getBoundingClientRect(),{left:v,top:g,width:S,height:_}=p;if(d||t(),!S||!_)return;const E=Rc(g),x=Rc(o.clientWidth-(v+S)),R=Rc(o.clientHeight-(g+_)),C=Rc(v),A={rootMargin:-E+"px "+-x+"px "+-R+"px "+-C+"px",threshold:an(0,fa(1,h))||1};let D=!0;function V(q){const U=q[0].intersectionRatio;if(U!==h){if(!D)return u();U?u(!1,U):s=setTimeout(()=>{u(!1,1e-7)},1e3)}U===1&&!lS(p,e.getBoundingClientRect())&&u(),D=!1}try{a=new IntersectionObserver(V,{...A,root:o.ownerDocument})}catch{a=new IntersectionObserver(V,A)}a.observe(e)}return u(!0),c}function Pj(e,t,a,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:c=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:h=!1}=s,p=Mm(e),v=o||c?[...p?Bo(p):[],...t?Bo(t):[]]:[];v.forEach(C=>{o&&C.addEventListener("scroll",a,{passive:!0}),c&&C.addEventListener("resize",a)});const g=p&&d?zj(p,a):null;let S=-1,_=null;u&&(_=new ResizeObserver(C=>{let[N]=C;N&&N.target===p&&_&&t&&(_.unobserve(t),cancelAnimationFrame(S),S=requestAnimationFrame(()=>{var A;(A=_)==null||A.observe(t)})),a()}),p&&!h&&_.observe(p),t&&_.observe(t));let E,x=h?Wa(e):null;h&&R();function R(){const C=Wa(e);x&&!lS(x,C)&&a(),x=C,E=requestAnimationFrame(R)}return a(),()=>{var C;v.forEach(N=>{o&&N.removeEventListener("scroll",a),c&&N.removeEventListener("resize",a)}),g==null||g(),(C=_)==null||C.disconnect(),_=null,h&&cancelAnimationFrame(E)}}const Bj=pj,Ij=gj,$j=fj,Hj=yj,qj=hj,g0=dj,Gj=vj,Vj=(e,t,a)=>{const s=new Map,o={platform:Uj,...a},c={...o.platform,_c:s};return uj(e,t,{...o,platform:c})};var Kj=typeof document<"u",Yj=function(){},Gc=Kj?y.useLayoutEffect:Yj;function cu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let a,s,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(a=e.length,a!==t.length)return!1;for(s=a;s--!==0;)if(!cu(e[s],t[s]))return!1;return!0}if(o=Object.keys(e),a=o.length,a!==Object.keys(t).length)return!1;for(s=a;s--!==0;)if(!{}.hasOwnProperty.call(t,o[s]))return!1;for(s=a;s--!==0;){const c=o[s];if(!(c==="_owner"&&e.$$typeof)&&!cu(e[c],t[c]))return!1}return!0}return e!==e&&t!==t}function cS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function v0(e,t){const a=cS(e);return Math.round(t*a)/a}function yh(e){const t=y.useRef(e);return Gc(()=>{t.current=e}),t}function Fj(e){e===void 0&&(e={});const{placement:t="bottom",strategy:a="absolute",middleware:s=[],platform:o,elements:{reference:c,floating:u}={},transform:d=!0,whileElementsMounted:h,open:p}=e,[v,g]=y.useState({x:0,y:0,strategy:a,placement:t,middlewareData:{},isPositioned:!1}),[S,_]=y.useState(s);cu(S,s)||_(s);const[E,x]=y.useState(null),[R,C]=y.useState(null),N=y.useCallback(K=>{K!==q.current&&(q.current=K,x(K))},[]),A=y.useCallback(K=>{K!==U.current&&(U.current=K,C(K))},[]),D=c||E,V=u||R,q=y.useRef(null),U=y.useRef(null),I=y.useRef(v),ae=h!=null,me=yh(h),ve=yh(o),de=yh(p),pe=y.useCallback(()=>{if(!q.current||!U.current)return;const K={placement:t,strategy:a,middleware:S};ve.current&&(K.platform=ve.current),Vj(q.current,U.current,K).then(Z=>{const W={...Z,isPositioned:de.current!==!1};J.current&&!cu(I.current,W)&&(I.current=W,Wo.flushSync(()=>{g(W)}))})},[S,t,a,ve,de]);Gc(()=>{p===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,g(K=>({...K,isPositioned:!1})))},[p]);const J=y.useRef(!1);Gc(()=>(J.current=!0,()=>{J.current=!1}),[]),Gc(()=>{if(D&&(q.current=D),V&&(U.current=V),D&&V){if(me.current)return me.current(D,V,pe);pe()}},[D,V,pe,me,ae]);const ie=y.useMemo(()=>({reference:q,floating:U,setReference:N,setFloating:A}),[N,A]),O=y.useMemo(()=>({reference:D,floating:V}),[D,V]),$=y.useMemo(()=>{const K={position:a,left:0,top:0};if(!O.floating)return K;const Z=v0(O.floating,v.x),W=v0(O.floating,v.y);return d?{...K,transform:"translate("+Z+"px, "+W+"px)",...cS(O.floating)>=1.5&&{willChange:"transform"}}:{position:a,left:Z,top:W}},[a,d,O.floating,v.x,v.y]);return y.useMemo(()=>({...v,update:pe,refs:ie,elements:O,floatingStyles:$}),[v,pe,ie,O,$])}const Wj=e=>{function t(a){return{}.hasOwnProperty.call(a,"current")}return{name:"arrow",options:e,fn(a){const{element:s,padding:o}=typeof e=="function"?e(a):e;return s&&t(s)?s.current!=null?g0({element:s.current,padding:o}).fn(a):{}:s?g0({element:s,padding:o}).fn(a):{}}}},Xj=(e,t)=>{const a=Bj(e);return{name:a.name,fn:a.fn,options:[e,t]}},Jj=(e,t)=>{const a=Ij(e);return{name:a.name,fn:a.fn,options:[e,t]}},Qj=(e,t)=>({fn:Gj(e).fn,options:[e,t]}),Zj=(e,t)=>{const a=$j(e);return{name:a.name,fn:a.fn,options:[e,t]}},eM=(e,t)=>{const a=Hj(e);return{name:a.name,fn:a.fn,options:[e,t]}},tM=(e,t)=>{const a=qj(e);return{name:a.name,fn:a.fn,options:[e,t]}},nM=(e,t)=>{const a=Wj(e);return{name:a.name,fn:a.fn,options:[e,t]}};var rM="Arrow",uS=y.forwardRef((e,t)=>{const{children:a,width:s=10,height:o=5,...c}=e;return b.jsx(ze.svg,{...c,ref:t,width:s,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?a:b.jsx("polygon",{points:"0,0 30,0 15,10"})})});uS.displayName=rM;var aM=uS;function sM(e){const[t,a]=y.useState(void 0);return gt(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const c=o[0];let u,d;if("borderBoxSize"in c){const h=c.borderBoxSize,p=Array.isArray(h)?h[0]:h;u=p.inlineSize,d=p.blockSize}else u=e.offsetWidth,d=e.offsetHeight;a({width:u,height:d})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else a(void 0)},[e]),t}var Dm="Popper",[dS,Ru]=es(Dm),[iM,fS]=dS(Dm),hS=e=>{const{__scopePopper:t,children:a}=e,[s,o]=y.useState(null);return b.jsx(iM,{scope:t,anchor:s,onAnchorChange:o,children:a})};hS.displayName=Dm;var mS="PopperAnchor",pS=y.forwardRef((e,t)=>{const{__scopePopper:a,virtualRef:s,...o}=e,c=fS(mS,a),u=y.useRef(null),d=Fe(t,u),h=y.useRef(null);return y.useEffect(()=>{const p=h.current;h.current=(s==null?void 0:s.current)||u.current,p!==h.current&&c.onAnchorChange(h.current)}),s?null:b.jsx(ze.div,{...o,ref:d})});pS.displayName=mS;var Lm="PopperContent",[oM,lM]=dS(Lm),gS=y.forwardRef((e,t)=>{var te,ce,le,Ce,Re,Ee;const{__scopePopper:a,side:s="bottom",sideOffset:o=0,align:c="center",alignOffset:u=0,arrowPadding:d=0,avoidCollisions:h=!0,collisionBoundary:p=[],collisionPadding:v=0,sticky:g="partial",hideWhenDetached:S=!1,updatePositionStrategy:_="optimized",onPlaced:E,...x}=e,R=fS(Lm,a),[C,N]=y.useState(null),A=Fe(t,rt=>N(rt)),[D,V]=y.useState(null),q=sM(D),U=(q==null?void 0:q.width)??0,I=(q==null?void 0:q.height)??0,ae=s+(c!=="center"?"-"+c:""),me=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},ve=Array.isArray(p)?p:[p],de=ve.length>0,pe={padding:me,boundary:ve.filter(uM),altBoundary:de},{refs:J,floatingStyles:ie,placement:O,isPositioned:$,middlewareData:K}=Fj({strategy:"fixed",placement:ae,whileElementsMounted:(...rt)=>Pj(...rt,{animationFrame:_==="always"}),elements:{reference:R.anchor},middleware:[Xj({mainAxis:o+I,alignmentAxis:u}),h&&Jj({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?Qj():void 0,...pe}),h&&Zj({...pe}),eM({...pe,apply:({elements:rt,rects:Ke,availableWidth:En,availableHeight:cn})=>{const{width:Xt,height:ya}=Ke.reference,vt=rt.floating.style;vt.setProperty("--radix-popper-available-width",`${En}px`),vt.setProperty("--radix-popper-available-height",`${cn}px`),vt.setProperty("--radix-popper-anchor-width",`${Xt}px`),vt.setProperty("--radix-popper-anchor-height",`${ya}px`)}}),D&&nM({element:D,padding:d}),dM({arrowWidth:U,arrowHeight:I}),S&&tM({strategy:"referenceHidden",...pe})]}),[Z,W]=bS(O),j=Ln(E);gt(()=>{$&&(j==null||j())},[$,j]);const G=(te=K.arrow)==null?void 0:te.x,F=(ce=K.arrow)==null?void 0:ce.y,ee=((le=K.arrow)==null?void 0:le.centerOffset)!==0,[ne,se]=y.useState();return gt(()=>{C&&se(window.getComputedStyle(C).zIndex)},[C]),b.jsx("div",{ref:J.setFloating,"data-radix-popper-content-wrapper":"",style:{...ie,transform:$?ie.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ne,"--radix-popper-transform-origin":[(Ce=K.transformOrigin)==null?void 0:Ce.x,(Re=K.transformOrigin)==null?void 0:Re.y].join(" "),...((Ee=K.hide)==null?void 0:Ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:b.jsx(oM,{scope:a,placedSide:Z,onArrowChange:V,arrowX:G,arrowY:F,shouldHideArrow:ee,children:b.jsx(ze.div,{"data-side":Z,"data-align":W,...x,ref:A,style:{...x.style,animation:$?void 0:"none"}})})})});gS.displayName=Lm;var vS="PopperArrow",cM={top:"bottom",right:"left",bottom:"top",left:"right"},yS=y.forwardRef(function(t,a){const{__scopePopper:s,...o}=t,c=lM(vS,s),u=cM[c.placedSide];return b.jsx("span",{ref:c.onArrowChange,style:{position:"absolute",left:c.arrowX,top:c.arrowY,[u]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[c.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[c.placedSide],visibility:c.shouldHideArrow?"hidden":void 0},children:b.jsx(aM,{...o,ref:a,style:{...o.style,display:"block"}})})});yS.displayName=vS;function uM(e){return e!==null}var dM=e=>({name:"transformOrigin",options:e,fn(t){var R,C,N;const{placement:a,rects:s,middlewareData:o}=t,u=((R=o.arrow)==null?void 0:R.centerOffset)!==0,d=u?0:e.arrowWidth,h=u?0:e.arrowHeight,[p,v]=bS(a),g={start:"0%",center:"50%",end:"100%"}[v],S=(((C=o.arrow)==null?void 0:C.x)??0)+d/2,_=(((N=o.arrow)==null?void 0:N.y)??0)+h/2;let E="",x="";return p==="bottom"?(E=u?g:`${S}px`,x=`${-h}px`):p==="top"?(E=u?g:`${S}px`,x=`${s.floating.height+h}px`):p==="right"?(E=`${-h}px`,x=u?g:`${_}px`):p==="left"&&(E=`${s.floating.width+h}px`,x=u?g:`${_}px`),{data:{x:E,y:x}}}});function bS(e){const[t,a="center"]=e.split("-");return[t,a]}var wS=hS,SS=pS,_S=gS,xS=yS,fM="Portal",Au=y.forwardRef((e,t)=>{var d;const{container:a,...s}=e,[o,c]=y.useState(!1);gt(()=>c(!0),[]);const u=a||o&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return u?aw.createPortal(b.jsx(ze.div,{...s,ref:t}),u):null});Au.displayName=fM;function hM(e,t){return y.useReducer((a,s)=>t[a][s]??a,e)}var pa=e=>{const{present:t,children:a}=e,s=mM(t),o=typeof a=="function"?a({present:s.isPresent}):y.Children.only(a),c=Fe(s.ref,pM(o));return typeof a=="function"||s.isPresent?y.cloneElement(o,{ref:c}):null};pa.displayName="Presence";function mM(e){const[t,a]=y.useState(),s=y.useRef(null),o=y.useRef(e),c=y.useRef("none"),u=e?"mounted":"unmounted",[d,h]=hM(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const p=Ac(s.current);c.current=d==="mounted"?p:"none"},[d]),gt(()=>{const p=s.current,v=o.current;if(v!==e){const S=c.current,_=Ac(p);e?h("MOUNT"):_==="none"||(p==null?void 0:p.display)==="none"?h("UNMOUNT"):h(v&&S!==_?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,h]),gt(()=>{if(t){let p;const v=t.ownerDocument.defaultView??window,g=_=>{const x=Ac(s.current).includes(CSS.escape(_.animationName));if(_.target===t&&x&&(h("ANIMATION_END"),!o.current)){const R=t.style.animationFillMode;t.style.animationFillMode="forwards",p=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=R)})}},S=_=>{_.target===t&&(c.current=Ac(s.current))};return t.addEventListener("animationstart",S),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{v.clearTimeout(p),t.removeEventListener("animationstart",S),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else h("ANIMATION_END")},[t,h]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:y.useCallback(p=>{s.current=p?getComputedStyle(p):null,a(p)},[])}}function Ac(e){return(e==null?void 0:e.animationName)||"none"}function pM(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var bh="rovingFocusGroup.onEntryFocus",gM={bubbles:!1,cancelable:!0},Zo="RovingFocusGroup",[Yh,ES,vM]=Tm(Zo),[yM,TS]=es(Zo,[vM]),[bM,wM]=yM(Zo),CS=y.forwardRef((e,t)=>b.jsx(Yh.Provider,{scope:e.__scopeRovingFocusGroup,children:b.jsx(Yh.Slot,{scope:e.__scopeRovingFocusGroup,children:b.jsx(SM,{...e,ref:t})})}));CS.displayName=Zo;var SM=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:a,orientation:s,loop:o=!1,dir:c,currentTabStopId:u,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:h,onEntryFocus:p,preventScrollOnEntryFocus:v=!1,...g}=e,S=y.useRef(null),_=Fe(t,S),E=Cm(c),[x,R]=Po({prop:u,defaultProp:d??null,onChange:h,caller:Zo}),[C,N]=y.useState(!1),A=Ln(p),D=ES(a),V=y.useRef(!1),[q,U]=y.useState(0);return y.useEffect(()=>{const I=S.current;if(I)return I.addEventListener(bh,A),()=>I.removeEventListener(bh,A)},[A]),b.jsx(bM,{scope:a,orientation:s,dir:E,loop:o,currentTabStopId:x,onItemFocus:y.useCallback(I=>R(I),[R]),onItemShiftTab:y.useCallback(()=>N(!0),[]),onFocusableItemAdd:y.useCallback(()=>U(I=>I+1),[]),onFocusableItemRemove:y.useCallback(()=>U(I=>I-1),[]),children:b.jsx(ze.div,{tabIndex:C||q===0?-1:0,"data-orientation":s,...g,ref:_,style:{outline:"none",...e.style},onMouseDown:be(e.onMouseDown,()=>{V.current=!0}),onFocus:be(e.onFocus,I=>{const ae=!V.current;if(I.target===I.currentTarget&&ae&&!C){const me=new CustomEvent(bh,gM);if(I.currentTarget.dispatchEvent(me),!me.defaultPrevented){const ve=D().filter(O=>O.focusable),de=ve.find(O=>O.active),pe=ve.find(O=>O.id===x),ie=[de,pe,...ve].filter(Boolean).map(O=>O.ref.current);NS(ie,v)}}V.current=!1}),onBlur:be(e.onBlur,()=>N(!1))})})}),RS="RovingFocusGroupItem",AS=y.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:a,focusable:s=!0,active:o=!1,tabStopId:c,children:u,...d}=e,h=Tr(),p=c||h,v=wM(RS,a),g=v.currentTabStopId===p,S=ES(a),{onFocusableItemAdd:_,onFocusableItemRemove:E,currentTabStopId:x}=v;return y.useEffect(()=>{if(s)return _(),()=>E()},[s,_,E]),b.jsx(Yh.ItemSlot,{scope:a,id:p,focusable:s,active:o,children:b.jsx(ze.span,{tabIndex:g?0:-1,"data-orientation":v.orientation,...d,ref:t,onMouseDown:be(e.onMouseDown,R=>{s?v.onItemFocus(p):R.preventDefault()}),onFocus:be(e.onFocus,()=>v.onItemFocus(p)),onKeyDown:be(e.onKeyDown,R=>{if(R.key==="Tab"&&R.shiftKey){v.onItemShiftTab();return}if(R.target!==R.currentTarget)return;const C=EM(R,v.orientation,v.dir);if(C!==void 0){if(R.metaKey||R.ctrlKey||R.altKey||R.shiftKey)return;R.preventDefault();let A=S().filter(D=>D.focusable).map(D=>D.ref.current);if(C==="last")A.reverse();else if(C==="prev"||C==="next"){C==="prev"&&A.reverse();const D=A.indexOf(R.currentTarget);A=v.loop?TM(A,D+1):A.slice(D+1)}setTimeout(()=>NS(A))}}),children:typeof u=="function"?u({isCurrentTabStop:g,hasTabStop:x!=null}):u})})});AS.displayName=RS;var _M={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function xM(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function EM(e,t,a){const s=xM(e.key,a);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return _M[s]}function NS(e,t=!1){const a=document.activeElement;for(const s of e)if(s===a||(s.focus({preventScroll:t}),document.activeElement!==a))return}function TM(e,t){return e.map((a,s)=>e[(t+s)%e.length])}var CM=CS,RM=AS;function AM(e){const t=NM(e),a=y.forwardRef((s,o)=>{const{children:c,...u}=s,d=y.Children.toArray(c),h=d.find(kM);if(h){const p=h.props.children,v=d.map(g=>g===h?y.Children.count(p)>1?y.Children.only(null):y.isValidElement(p)?p.props.children:null:g);return b.jsx(t,{...u,ref:o,children:y.isValidElement(p)?y.cloneElement(p,void 0,v):null})}return b.jsx(t,{...u,ref:o,children:c})});return a.displayName=`${e}.Slot`,a}function NM(e){const t=y.forwardRef((a,s)=>{const{children:o,...c}=a;if(y.isValidElement(o)){const u=MM(o),d=jM(c,o.props);return o.type!==y.Fragment&&(d.ref=s?jr(s,u):u),y.cloneElement(o,d)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var OM=Symbol("radix.slottable");function kM(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===OM}function jM(e,t){const a={...t};for(const s in t){const o=e[s],c=t[s];/^on[A-Z]/.test(s)?o&&c?a[s]=(...d)=>{const h=c(...d);return o(...d),h}:o&&(a[s]=o):s==="style"?a[s]={...o,...c}:s==="className"&&(a[s]=[o,c].filter(Boolean).join(" "))}return{...e,...a}}function MM(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var DM=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ws=new WeakMap,Nc=new WeakMap,Oc={},wh=0,OS=function(e){return e&&(e.host||OS(e.parentNode))},LM=function(e,t){return t.map(function(a){if(e.contains(a))return a;var s=OS(a);return s&&e.contains(s)?s:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},UM=function(e,t,a,s){var o=LM(t,Array.isArray(e)?e:[e]);Oc[a]||(Oc[a]=new WeakMap);var c=Oc[a],u=[],d=new Set,h=new Set(o),p=function(g){!g||d.has(g)||(d.add(g),p(g.parentNode))};o.forEach(p);var v=function(g){!g||h.has(g)||Array.prototype.forEach.call(g.children,function(S){if(d.has(S))v(S);else try{var _=S.getAttribute(s),E=_!==null&&_!=="false",x=(Ws.get(S)||0)+1,R=(c.get(S)||0)+1;Ws.set(S,x),c.set(S,R),u.push(S),x===1&&E&&Nc.set(S,!0),R===1&&S.setAttribute(a,"true"),E||S.setAttribute(s,"true")}catch(C){console.error("aria-hidden: cannot operate on ",S,C)}})};return v(t),d.clear(),wh++,function(){u.forEach(function(g){var S=Ws.get(g)-1,_=c.get(g)-1;Ws.set(g,S),c.set(g,_),S||(Nc.has(g)||g.removeAttribute(s),Nc.delete(g)),_||g.removeAttribute(a)}),wh--,wh||(Ws=new WeakMap,Ws=new WeakMap,Nc=new WeakMap,Oc={})}},Um=function(e,t,a){a===void 0&&(a="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),o=DM(e);return o?(s.push.apply(s,Array.from(o.querySelectorAll("[aria-live], script"))),UM(s,o,a,"aria-hidden")):function(){return null}},Vc="right-scroll-bar-position",Kc="width-before-scroll-bar",zM="with-scroll-bars-hidden",PM="--removed-body-scroll-bar-size";function Sh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function BM(e,t){var a=y.useState(function(){return{value:e,callback:t,facade:{get current(){return a.value},set current(s){var o=a.value;o!==s&&(a.value=s,a.callback(s,o))}}}})[0];return a.callback=t,a.facade}var IM=typeof window<"u"?y.useLayoutEffect:y.useEffect,y0=new WeakMap;function $M(e,t){var a=BM(null,function(s){return e.forEach(function(o){return Sh(o,s)})});return IM(function(){var s=y0.get(a);if(s){var o=new Set(s),c=new Set(e),u=a.current;o.forEach(function(d){c.has(d)||Sh(d,null)}),c.forEach(function(d){o.has(d)||Sh(d,u)})}y0.set(a,e)},[e]),a}function HM(e){return e}function qM(e,t){t===void 0&&(t=HM);var a=[],s=!1,o={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(c){var u=t(c,s);return a.push(u),function(){a=a.filter(function(d){return d!==u})}},assignSyncMedium:function(c){for(s=!0;a.length;){var u=a;a=[],u.forEach(c)}a={push:function(d){return c(d)},filter:function(){return a}}},assignMedium:function(c){s=!0;var u=[];if(a.length){var d=a;a=[],d.forEach(c),u=a}var h=function(){var v=u;u=[],v.forEach(c)},p=function(){return Promise.resolve().then(h)};p(),a={push:function(v){u.push(v),p()},filter:function(v){return u=u.filter(v),a}}}};return o}function GM(e){e===void 0&&(e={});var t=qM(null);return t.options=Xn({async:!0,ssr:!1},e),t}var kS=function(e){var t=e.sideCar,a=pi(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=t.read();if(!s)throw new Error("Sidecar medium not found");return y.createElement(s,Xn({},a))};kS.isSideCarExport=!0;function VM(e,t){return e.useMedium(t),kS}var jS=GM(),_h=function(){},Nu=y.forwardRef(function(e,t){var a=y.useRef(null),s=y.useState({onScrollCapture:_h,onWheelCapture:_h,onTouchMoveCapture:_h}),o=s[0],c=s[1],u=e.forwardProps,d=e.children,h=e.className,p=e.removeScrollBar,v=e.enabled,g=e.shards,S=e.sideCar,_=e.noRelative,E=e.noIsolation,x=e.inert,R=e.allowPinchZoom,C=e.as,N=C===void 0?"div":C,A=e.gapMode,D=pi(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),V=S,q=$M([a,t]),U=Xn(Xn({},D),o);return y.createElement(y.Fragment,null,v&&y.createElement(V,{sideCar:jS,removeScrollBar:p,shards:g,noRelative:_,noIsolation:E,inert:x,setCallbacks:c,allowPinchZoom:!!R,lockRef:a,gapMode:A}),u?y.cloneElement(y.Children.only(d),Xn(Xn({},U),{ref:q})):y.createElement(N,Xn({},U,{className:h,ref:q}),d))});Nu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Nu.classNames={fullWidth:Kc,zeroRight:Vc};var KM=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function YM(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=KM();return t&&e.setAttribute("nonce",t),e}function FM(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function WM(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var XM=function(){var e=0,t=null;return{add:function(a){e==0&&(t=YM())&&(FM(t,a),WM(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},JM=function(){var e=XM();return function(t,a){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&a])}},MS=function(){var e=JM(),t=function(a){var s=a.styles,o=a.dynamic;return e(s,o),null};return t},QM={left:0,top:0,right:0,gap:0},xh=function(e){return parseInt(e||"",10)||0},ZM=function(e){var t=window.getComputedStyle(document.body),a=t[e==="padding"?"paddingLeft":"marginLeft"],s=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[xh(a),xh(s),xh(o)]},eD=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return QM;var t=ZM(e),a=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-a+t[2]-t[0])}},tD=MS(),li="data-scroll-locked",nD=function(e,t,a,s){var o=e.left,c=e.top,u=e.right,d=e.gap;return a===void 0&&(a="margin"),`
|
||
.`.concat(zM,` {
|
||
overflow: hidden `).concat(s,`;
|
||
padding-right: `).concat(d,"px ").concat(s,`;
|
||
}
|
||
body[`).concat(li,`] {
|
||
overflow: hidden `).concat(s,`;
|
||
overscroll-behavior: contain;
|
||
`).concat([t&&"position: relative ".concat(s,";"),a==="margin"&&`
|
||
padding-left: `.concat(o,`px;
|
||
padding-top: `).concat(c,`px;
|
||
padding-right: `).concat(u,`px;
|
||
margin-left:0;
|
||
margin-top:0;
|
||
margin-right: `).concat(d,"px ").concat(s,`;
|
||
`),a==="padding"&&"padding-right: ".concat(d,"px ").concat(s,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat(Vc,` {
|
||
right: `).concat(d,"px ").concat(s,`;
|
||
}
|
||
|
||
.`).concat(Kc,` {
|
||
margin-right: `).concat(d,"px ").concat(s,`;
|
||
}
|
||
|
||
.`).concat(Vc," .").concat(Vc,` {
|
||
right: 0 `).concat(s,`;
|
||
}
|
||
|
||
.`).concat(Kc," .").concat(Kc,` {
|
||
margin-right: 0 `).concat(s,`;
|
||
}
|
||
|
||
body[`).concat(li,`] {
|
||
`).concat(PM,": ").concat(d,`px;
|
||
}
|
||
`)},b0=function(){var e=parseInt(document.body.getAttribute(li)||"0",10);return isFinite(e)?e:0},rD=function(){y.useEffect(function(){return document.body.setAttribute(li,(b0()+1).toString()),function(){var e=b0()-1;e<=0?document.body.removeAttribute(li):document.body.setAttribute(li,e.toString())}},[])},aD=function(e){var t=e.noRelative,a=e.noImportant,s=e.gapMode,o=s===void 0?"margin":s;rD();var c=y.useMemo(function(){return eD(o)},[o]);return y.createElement(tD,{styles:nD(c,!t,o,a?"":"!important")})},Fh=!1;if(typeof window<"u")try{var kc=Object.defineProperty({},"passive",{get:function(){return Fh=!0,!0}});window.addEventListener("test",kc,kc),window.removeEventListener("test",kc,kc)}catch{Fh=!1}var Xs=Fh?{passive:!1}:!1,sD=function(e){return e.tagName==="TEXTAREA"},DS=function(e,t){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[t]!=="hidden"&&!(a.overflowY===a.overflowX&&!sD(e)&&a[t]==="visible")},iD=function(e){return DS(e,"overflowY")},oD=function(e){return DS(e,"overflowX")},w0=function(e,t){var a=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var o=LS(e,s);if(o){var c=US(e,s),u=c[1],d=c[2];if(u>d)return!0}s=s.parentNode}while(s&&s!==a.body);return!1},lD=function(e){var t=e.scrollTop,a=e.scrollHeight,s=e.clientHeight;return[t,a,s]},cD=function(e){var t=e.scrollLeft,a=e.scrollWidth,s=e.clientWidth;return[t,a,s]},LS=function(e,t){return e==="v"?iD(t):oD(t)},US=function(e,t){return e==="v"?lD(t):cD(t)},uD=function(e,t){return e==="h"&&t==="rtl"?-1:1},dD=function(e,t,a,s,o){var c=uD(e,window.getComputedStyle(t).direction),u=c*s,d=a.target,h=t.contains(d),p=!1,v=u>0,g=0,S=0;do{if(!d)break;var _=US(e,d),E=_[0],x=_[1],R=_[2],C=x-R-c*E;(E||C)&&LS(e,d)&&(g+=C,S+=E);var N=d.parentNode;d=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!h&&d!==document.body||h&&(t.contains(d)||t===d));return(v&&Math.abs(g)<1||!v&&Math.abs(S)<1)&&(p=!0),p},jc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},S0=function(e){return[e.deltaX,e.deltaY]},_0=function(e){return e&&"current"in e?e.current:e},fD=function(e,t){return e[0]===t[0]&&e[1]===t[1]},hD=function(e){return`
|
||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
`)},mD=0,Js=[];function pD(e){var t=y.useRef([]),a=y.useRef([0,0]),s=y.useRef(),o=y.useState(mD++)[0],c=y.useState(MS)[0],u=y.useRef(e);y.useEffect(function(){u.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var x=bR([e.lockRef.current],(e.shards||[]).map(_0),!0).filter(Boolean);return x.forEach(function(R){return R.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),x.forEach(function(R){return R.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var d=y.useCallback(function(x,R){if("touches"in x&&x.touches.length===2||x.type==="wheel"&&x.ctrlKey)return!u.current.allowPinchZoom;var C=jc(x),N=a.current,A="deltaX"in x?x.deltaX:N[0]-C[0],D="deltaY"in x?x.deltaY:N[1]-C[1],V,q=x.target,U=Math.abs(A)>Math.abs(D)?"h":"v";if("touches"in x&&U==="h"&&q.type==="range")return!1;var I=window.getSelection(),ae=I&&I.anchorNode,me=ae?ae===q||ae.contains(q):!1;if(me)return!1;var ve=w0(U,q);if(!ve)return!0;if(ve?V=U:(V=U==="v"?"h":"v",ve=w0(U,q)),!ve)return!1;if(!s.current&&"changedTouches"in x&&(A||D)&&(s.current=V),!V)return!0;var de=s.current||V;return dD(de,R,x,de==="h"?A:D)},[]),h=y.useCallback(function(x){var R=x;if(!(!Js.length||Js[Js.length-1]!==c)){var C="deltaY"in R?S0(R):jc(R),N=t.current.filter(function(V){return V.name===R.type&&(V.target===R.target||R.target===V.shadowParent)&&fD(V.delta,C)})[0];if(N&&N.should){R.cancelable&&R.preventDefault();return}if(!N){var A=(u.current.shards||[]).map(_0).filter(Boolean).filter(function(V){return V.contains(R.target)}),D=A.length>0?d(R,A[0]):!u.current.noIsolation;D&&R.cancelable&&R.preventDefault()}}},[]),p=y.useCallback(function(x,R,C,N){var A={name:x,delta:R,target:C,should:N,shadowParent:gD(C)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(D){return D!==A})},1)},[]),v=y.useCallback(function(x){a.current=jc(x),s.current=void 0},[]),g=y.useCallback(function(x){p(x.type,S0(x),x.target,d(x,e.lockRef.current))},[]),S=y.useCallback(function(x){p(x.type,jc(x),x.target,d(x,e.lockRef.current))},[]);y.useEffect(function(){return Js.push(c),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:S}),document.addEventListener("wheel",h,Xs),document.addEventListener("touchmove",h,Xs),document.addEventListener("touchstart",v,Xs),function(){Js=Js.filter(function(x){return x!==c}),document.removeEventListener("wheel",h,Xs),document.removeEventListener("touchmove",h,Xs),document.removeEventListener("touchstart",v,Xs)}},[]);var _=e.removeScrollBar,E=e.inert;return y.createElement(y.Fragment,null,E?y.createElement(c,{styles:hD(o)}):null,_?y.createElement(aD,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function gD(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const vD=VM(jS,pD);var Ou=y.forwardRef(function(e,t){return y.createElement(Nu,Xn({},e,{ref:t,sideCar:vD}))});Ou.classNames=Nu.classNames;var Wh=["Enter"," "],yD=["ArrowDown","PageUp","Home"],zS=["ArrowUp","PageDown","End"],bD=[...yD,...zS],wD={ltr:[...Wh,"ArrowRight"],rtl:[...Wh,"ArrowLeft"]},SD={ltr:["ArrowLeft"],rtl:["ArrowRight"]},el="Menu",[Io,_D,xD]=Tm(el),[ts,PS]=es(el,[xD,Ru,TS]),ku=Ru(),BS=TS(),[ED,ns]=ts(el),[TD,tl]=ts(el),IS=e=>{const{__scopeMenu:t,open:a=!1,children:s,dir:o,onOpenChange:c,modal:u=!0}=e,d=ku(t),[h,p]=y.useState(null),v=y.useRef(!1),g=Ln(c),S=Cm(o);return y.useEffect(()=>{const _=()=>{v.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},E=()=>v.current=!1;return document.addEventListener("keydown",_,{capture:!0}),()=>{document.removeEventListener("keydown",_,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),b.jsx(wS,{...d,children:b.jsx(ED,{scope:t,open:a,onOpenChange:g,content:h,onContentChange:p,children:b.jsx(TD,{scope:t,onClose:y.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:v,dir:S,modal:u,children:s})})})};IS.displayName=el;var CD="MenuAnchor",zm=y.forwardRef((e,t)=>{const{__scopeMenu:a,...s}=e,o=ku(a);return b.jsx(SS,{...o,...s,ref:t})});zm.displayName=CD;var Pm="MenuPortal",[RD,$S]=ts(Pm,{forceMount:void 0}),HS=e=>{const{__scopeMenu:t,forceMount:a,children:s,container:o}=e,c=ns(Pm,t);return b.jsx(RD,{scope:t,forceMount:a,children:b.jsx(pa,{present:a||c.open,children:b.jsx(Au,{asChild:!0,container:o,children:s})})})};HS.displayName=Pm;var _n="MenuContent",[AD,Bm]=ts(_n),qS=y.forwardRef((e,t)=>{const a=$S(_n,e.__scopeMenu),{forceMount:s=a.forceMount,...o}=e,c=ns(_n,e.__scopeMenu),u=tl(_n,e.__scopeMenu);return b.jsx(Io.Provider,{scope:e.__scopeMenu,children:b.jsx(pa,{present:s||c.open,children:b.jsx(Io.Slot,{scope:e.__scopeMenu,children:u.modal?b.jsx(ND,{...o,ref:t}):b.jsx(OD,{...o,ref:t})})})})}),ND=y.forwardRef((e,t)=>{const a=ns(_n,e.__scopeMenu),s=y.useRef(null),o=Fe(t,s);return y.useEffect(()=>{const c=s.current;if(c)return Um(c)},[]),b.jsx(Im,{...e,ref:o,trapFocus:a.open,disableOutsidePointerEvents:a.open,disableOutsideScroll:!0,onFocusOutside:be(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>a.onOpenChange(!1)})}),OD=y.forwardRef((e,t)=>{const a=ns(_n,e.__scopeMenu);return b.jsx(Im,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>a.onOpenChange(!1)})}),kD=AM("MenuContent.ScrollLock"),Im=y.forwardRef((e,t)=>{const{__scopeMenu:a,loop:s=!1,trapFocus:o,onOpenAutoFocus:c,onCloseAutoFocus:u,disableOutsidePointerEvents:d,onEntryFocus:h,onEscapeKeyDown:p,onPointerDownOutside:v,onFocusOutside:g,onInteractOutside:S,onDismiss:_,disableOutsideScroll:E,...x}=e,R=ns(_n,a),C=tl(_n,a),N=ku(a),A=BS(a),D=_D(a),[V,q]=y.useState(null),U=y.useRef(null),I=Fe(t,U,R.onContentChange),ae=y.useRef(0),me=y.useRef(""),ve=y.useRef(0),de=y.useRef(null),pe=y.useRef("right"),J=y.useRef(0),ie=E?Ou:y.Fragment,O=E?{as:kD,allowPinchZoom:!0}:void 0,$=Z=>{var te,ce;const W=me.current+Z,j=D().filter(le=>!le.disabled),G=document.activeElement,F=(te=j.find(le=>le.ref.current===G))==null?void 0:te.textValue,ee=j.map(le=>le.textValue),ne=qD(ee,W,F),se=(ce=j.find(le=>le.textValue===ne))==null?void 0:ce.ref.current;(function le(Ce){me.current=Ce,window.clearTimeout(ae.current),Ce!==""&&(ae.current=window.setTimeout(()=>le(""),1e3))})(W),se&&setTimeout(()=>se.focus())};y.useEffect(()=>()=>window.clearTimeout(ae.current),[]),Rm();const K=y.useCallback(Z=>{var j,G;return pe.current===((j=de.current)==null?void 0:j.side)&&VD(Z,(G=de.current)==null?void 0:G.area)},[]);return b.jsx(AD,{scope:a,searchRef:me,onItemEnter:y.useCallback(Z=>{K(Z)&&Z.preventDefault()},[K]),onItemLeave:y.useCallback(Z=>{var W;K(Z)||((W=U.current)==null||W.focus(),q(null))},[K]),onTriggerLeave:y.useCallback(Z=>{K(Z)&&Z.preventDefault()},[K]),pointerGraceTimerRef:ve,onPointerGraceIntentChange:y.useCallback(Z=>{de.current=Z},[]),children:b.jsx(ie,{...O,children:b.jsx(_u,{asChild:!0,trapped:o,onMountAutoFocus:be(c,Z=>{var W;Z.preventDefault(),(W=U.current)==null||W.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:b.jsx(Su,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:p,onPointerDownOutside:v,onFocusOutside:g,onInteractOutside:S,onDismiss:_,children:b.jsx(CM,{asChild:!0,...A,dir:C.dir,orientation:"vertical",loop:s,currentTabStopId:V,onCurrentTabStopIdChange:q,onEntryFocus:be(h,Z=>{C.isUsingKeyboardRef.current||Z.preventDefault()}),preventScrollOnEntryFocus:!0,children:b.jsx(_S,{role:"menu","aria-orientation":"vertical","data-state":s_(R.open),"data-radix-menu-content":"",dir:C.dir,...N,...x,ref:I,style:{outline:"none",...x.style},onKeyDown:be(x.onKeyDown,Z=>{const j=Z.target.closest("[data-radix-menu-content]")===Z.currentTarget,G=Z.ctrlKey||Z.altKey||Z.metaKey,F=Z.key.length===1;j&&(Z.key==="Tab"&&Z.preventDefault(),!G&&F&&$(Z.key));const ee=U.current;if(Z.target!==ee||!bD.includes(Z.key))return;Z.preventDefault();const se=D().filter(te=>!te.disabled).map(te=>te.ref.current);zS.includes(Z.key)&&se.reverse(),$D(se)}),onBlur:be(e.onBlur,Z=>{Z.currentTarget.contains(Z.target)||(window.clearTimeout(ae.current),me.current="")}),onPointerMove:be(e.onPointerMove,$o(Z=>{const W=Z.target,j=J.current!==Z.clientX;if(Z.currentTarget.contains(W)&&j){const G=Z.clientX>J.current?"right":"left";pe.current=G,J.current=Z.clientX}}))})})})})})})});qS.displayName=_n;var jD="MenuGroup",$m=y.forwardRef((e,t)=>{const{__scopeMenu:a,...s}=e;return b.jsx(ze.div,{role:"group",...s,ref:t})});$m.displayName=jD;var MD="MenuLabel",GS=y.forwardRef((e,t)=>{const{__scopeMenu:a,...s}=e;return b.jsx(ze.div,{...s,ref:t})});GS.displayName=MD;var uu="MenuItem",x0="menu.itemSelect",ju=y.forwardRef((e,t)=>{const{disabled:a=!1,onSelect:s,...o}=e,c=y.useRef(null),u=tl(uu,e.__scopeMenu),d=Bm(uu,e.__scopeMenu),h=Fe(t,c),p=y.useRef(!1),v=()=>{const g=c.current;if(!a&&g){const S=new CustomEvent(x0,{bubbles:!0,cancelable:!0});g.addEventListener(x0,_=>s==null?void 0:s(_),{once:!0}),Ww(g,S),S.defaultPrevented?p.current=!1:u.onClose()}};return b.jsx(VS,{...o,ref:h,disabled:a,onClick:be(e.onClick,v),onPointerDown:g=>{var S;(S=e.onPointerDown)==null||S.call(e,g),p.current=!0},onPointerUp:be(e.onPointerUp,g=>{var S;p.current||(S=g.currentTarget)==null||S.click()}),onKeyDown:be(e.onKeyDown,g=>{const S=d.searchRef.current!=="";a||S&&g.key===" "||Wh.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});ju.displayName=uu;var VS=y.forwardRef((e,t)=>{const{__scopeMenu:a,disabled:s=!1,textValue:o,...c}=e,u=Bm(uu,a),d=BS(a),h=y.useRef(null),p=Fe(t,h),[v,g]=y.useState(!1),[S,_]=y.useState("");return y.useEffect(()=>{const E=h.current;E&&_((E.textContent??"").trim())},[c.children]),b.jsx(Io.ItemSlot,{scope:a,disabled:s,textValue:o??S,children:b.jsx(RM,{asChild:!0,...d,focusable:!s,children:b.jsx(ze.div,{role:"menuitem","data-highlighted":v?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...c,ref:p,onPointerMove:be(e.onPointerMove,$o(E=>{s?u.onItemLeave(E):(u.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:be(e.onPointerLeave,$o(E=>u.onItemLeave(E))),onFocus:be(e.onFocus,()=>g(!0)),onBlur:be(e.onBlur,()=>g(!1))})})})}),DD="MenuCheckboxItem",KS=y.forwardRef((e,t)=>{const{checked:a=!1,onCheckedChange:s,...o}=e;return b.jsx(JS,{scope:e.__scopeMenu,checked:a,children:b.jsx(ju,{role:"menuitemcheckbox","aria-checked":du(a)?"mixed":a,...o,ref:t,"data-state":qm(a),onSelect:be(o.onSelect,()=>s==null?void 0:s(du(a)?!0:!a),{checkForDefaultPrevented:!1})})})});KS.displayName=DD;var YS="MenuRadioGroup",[LD,UD]=ts(YS,{value:void 0,onValueChange:()=>{}}),FS=y.forwardRef((e,t)=>{const{value:a,onValueChange:s,...o}=e,c=Ln(s);return b.jsx(LD,{scope:e.__scopeMenu,value:a,onValueChange:c,children:b.jsx($m,{...o,ref:t})})});FS.displayName=YS;var WS="MenuRadioItem",XS=y.forwardRef((e,t)=>{const{value:a,...s}=e,o=UD(WS,e.__scopeMenu),c=a===o.value;return b.jsx(JS,{scope:e.__scopeMenu,checked:c,children:b.jsx(ju,{role:"menuitemradio","aria-checked":c,...s,ref:t,"data-state":qm(c),onSelect:be(s.onSelect,()=>{var u;return(u=o.onValueChange)==null?void 0:u.call(o,a)},{checkForDefaultPrevented:!1})})})});XS.displayName=WS;var Hm="MenuItemIndicator",[JS,zD]=ts(Hm,{checked:!1}),QS=y.forwardRef((e,t)=>{const{__scopeMenu:a,forceMount:s,...o}=e,c=zD(Hm,a);return b.jsx(pa,{present:s||du(c.checked)||c.checked===!0,children:b.jsx(ze.span,{...o,ref:t,"data-state":qm(c.checked)})})});QS.displayName=Hm;var PD="MenuSeparator",ZS=y.forwardRef((e,t)=>{const{__scopeMenu:a,...s}=e;return b.jsx(ze.div,{role:"separator","aria-orientation":"horizontal",...s,ref:t})});ZS.displayName=PD;var BD="MenuArrow",e_=y.forwardRef((e,t)=>{const{__scopeMenu:a,...s}=e,o=ku(a);return b.jsx(xS,{...o,...s,ref:t})});e_.displayName=BD;var ID="MenuSub",[y5,t_]=ts(ID),_o="MenuSubTrigger",n_=y.forwardRef((e,t)=>{const a=ns(_o,e.__scopeMenu),s=tl(_o,e.__scopeMenu),o=t_(_o,e.__scopeMenu),c=Bm(_o,e.__scopeMenu),u=y.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:h}=c,p={__scopeMenu:e.__scopeMenu},v=y.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return y.useEffect(()=>v,[v]),y.useEffect(()=>{const g=d.current;return()=>{window.clearTimeout(g),h(null)}},[d,h]),b.jsx(zm,{asChild:!0,...p,children:b.jsx(VS,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":o.contentId,"data-state":s_(a.open),...e,ref:jr(t,o.onTriggerChange),onClick:g=>{var S;(S=e.onClick)==null||S.call(e,g),!(e.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),a.open||a.onOpenChange(!0))},onPointerMove:be(e.onPointerMove,$o(g=>{c.onItemEnter(g),!g.defaultPrevented&&!e.disabled&&!a.open&&!u.current&&(c.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{a.onOpenChange(!0),v()},100))})),onPointerLeave:be(e.onPointerLeave,$o(g=>{var _,E;v();const S=(_=a.content)==null?void 0:_.getBoundingClientRect();if(S){const x=(E=a.content)==null?void 0:E.dataset.side,R=x==="right",C=R?-5:5,N=S[R?"left":"right"],A=S[R?"right":"left"];c.onPointerGraceIntentChange({area:[{x:g.clientX+C,y:g.clientY},{x:N,y:S.top},{x:A,y:S.top},{x:A,y:S.bottom},{x:N,y:S.bottom}],side:x}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>c.onPointerGraceIntentChange(null),300)}else{if(c.onTriggerLeave(g),g.defaultPrevented)return;c.onPointerGraceIntentChange(null)}})),onKeyDown:be(e.onKeyDown,g=>{var _;const S=c.searchRef.current!=="";e.disabled||S&&g.key===" "||wD[s.dir].includes(g.key)&&(a.onOpenChange(!0),(_=a.content)==null||_.focus(),g.preventDefault())})})})});n_.displayName=_o;var r_="MenuSubContent",a_=y.forwardRef((e,t)=>{const a=$S(_n,e.__scopeMenu),{forceMount:s=a.forceMount,...o}=e,c=ns(_n,e.__scopeMenu),u=tl(_n,e.__scopeMenu),d=t_(r_,e.__scopeMenu),h=y.useRef(null),p=Fe(t,h);return b.jsx(Io.Provider,{scope:e.__scopeMenu,children:b.jsx(pa,{present:s||c.open,children:b.jsx(Io.Slot,{scope:e.__scopeMenu,children:b.jsx(Im,{id:d.contentId,"aria-labelledby":d.triggerId,...o,ref:p,align:"start",side:u.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{var g;u.isUsingKeyboardRef.current&&((g=h.current)==null||g.focus()),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:be(e.onFocusOutside,v=>{v.target!==d.trigger&&c.onOpenChange(!1)}),onEscapeKeyDown:be(e.onEscapeKeyDown,v=>{u.onClose(),v.preventDefault()}),onKeyDown:be(e.onKeyDown,v=>{var _;const g=v.currentTarget.contains(v.target),S=SD[u.dir].includes(v.key);g&&S&&(c.onOpenChange(!1),(_=d.trigger)==null||_.focus(),v.preventDefault())})})})})})});a_.displayName=r_;function s_(e){return e?"open":"closed"}function du(e){return e==="indeterminate"}function qm(e){return du(e)?"indeterminate":e?"checked":"unchecked"}function $D(e){const t=document.activeElement;for(const a of e)if(a===t||(a.focus(),document.activeElement!==t))return}function HD(e,t){return e.map((a,s)=>e[(t+s)%e.length])}function qD(e,t,a){const o=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,c=a?e.indexOf(a):-1;let u=HD(e,Math.max(c,0));o.length===1&&(u=u.filter(p=>p!==a));const h=u.find(p=>p.toLowerCase().startsWith(o.toLowerCase()));return h!==a?h:void 0}function GD(e,t){const{x:a,y:s}=e;let o=!1;for(let c=0,u=t.length-1;c<t.length;u=c++){const d=t[c],h=t[u],p=d.x,v=d.y,g=h.x,S=h.y;v>s!=S>s&&a<(g-p)*(s-v)/(S-v)+p&&(o=!o)}return o}function VD(e,t){if(!t)return!1;const a={x:e.clientX,y:e.clientY};return GD(a,t)}function $o(e){return t=>t.pointerType==="mouse"?e(t):void 0}var KD=IS,YD=zm,FD=HS,WD=qS,XD=$m,JD=GS,QD=ju,ZD=KS,eL=FS,tL=XS,nL=QS,rL=ZS,aL=e_,sL=n_,iL=a_,Mu="DropdownMenu",[oL]=es(Mu,[PS]),zt=PS(),[lL,i_]=oL(Mu),o_=e=>{const{__scopeDropdownMenu:t,children:a,dir:s,open:o,defaultOpen:c,onOpenChange:u,modal:d=!0}=e,h=zt(t),p=y.useRef(null),[v,g]=Po({prop:o,defaultProp:c??!1,onChange:u,caller:Mu});return b.jsx(lL,{scope:t,triggerId:Tr(),triggerRef:p,contentId:Tr(),open:v,onOpenChange:g,onOpenToggle:y.useCallback(()=>g(S=>!S),[g]),modal:d,children:b.jsx(KD,{...h,open:v,onOpenChange:g,dir:s,modal:d,children:a})})};o_.displayName=Mu;var l_="DropdownMenuTrigger",c_=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,disabled:s=!1,...o}=e,c=i_(l_,a),u=zt(a);return b.jsx(YD,{asChild:!0,...u,children:b.jsx(ze.button,{type:"button",id:c.triggerId,"aria-haspopup":"menu","aria-expanded":c.open,"aria-controls":c.open?c.contentId:void 0,"data-state":c.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...o,ref:jr(t,c.triggerRef),onPointerDown:be(e.onPointerDown,d=>{!s&&d.button===0&&d.ctrlKey===!1&&(c.onOpenToggle(),c.open||d.preventDefault())}),onKeyDown:be(e.onKeyDown,d=>{s||(["Enter"," "].includes(d.key)&&c.onOpenToggle(),d.key==="ArrowDown"&&c.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})});c_.displayName=l_;var cL="DropdownMenuPortal",u_=e=>{const{__scopeDropdownMenu:t,...a}=e,s=zt(t);return b.jsx(FD,{...s,...a})};u_.displayName=cL;var d_="DropdownMenuContent",f_=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=i_(d_,a),c=zt(a),u=y.useRef(!1);return b.jsx(WD,{id:o.contentId,"aria-labelledby":o.triggerId,...c,...s,ref:t,onCloseAutoFocus:be(e.onCloseAutoFocus,d=>{var h;u.current||(h=o.triggerRef.current)==null||h.focus(),u.current=!1,d.preventDefault()}),onInteractOutside:be(e.onInteractOutside,d=>{const h=d.detail.originalEvent,p=h.button===0&&h.ctrlKey===!0,v=h.button===2||p;(!o.modal||v)&&(u.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});f_.displayName=d_;var uL="DropdownMenuGroup",dL=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=zt(a);return b.jsx(XD,{...o,...s,ref:t})});dL.displayName=uL;var fL="DropdownMenuLabel",h_=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=zt(a);return b.jsx(JD,{...o,...s,ref:t})});h_.displayName=fL;var hL="DropdownMenuItem",m_=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=zt(a);return b.jsx(QD,{...o,...s,ref:t})});m_.displayName=hL;var mL="DropdownMenuCheckboxItem",p_=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=zt(a);return b.jsx(ZD,{...o,...s,ref:t})});p_.displayName=mL;var pL="DropdownMenuRadioGroup",gL=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=zt(a);return b.jsx(eL,{...o,...s,ref:t})});gL.displayName=pL;var vL="DropdownMenuRadioItem",g_=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=zt(a);return b.jsx(tL,{...o,...s,ref:t})});g_.displayName=vL;var yL="DropdownMenuItemIndicator",v_=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=zt(a);return b.jsx(nL,{...o,...s,ref:t})});v_.displayName=yL;var bL="DropdownMenuSeparator",y_=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=zt(a);return b.jsx(rL,{...o,...s,ref:t})});y_.displayName=bL;var wL="DropdownMenuArrow",SL=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=zt(a);return b.jsx(aL,{...o,...s,ref:t})});SL.displayName=wL;var _L="DropdownMenuSubTrigger",b_=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=zt(a);return b.jsx(sL,{...o,...s,ref:t})});b_.displayName=_L;var xL="DropdownMenuSubContent",w_=y.forwardRef((e,t)=>{const{__scopeDropdownMenu:a,...s}=e,o=zt(a);return b.jsx(iL,{...o,...s,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});w_.displayName=xL;var EL=o_,TL=c_,CL=u_,S_=f_,__=h_,x_=m_,E_=p_,T_=g_,C_=v_,R_=y_,A_=b_,N_=w_;const RL=EL,AL=TL,NL=y.forwardRef(({className:e,inset:t,children:a,...s},o)=>b.jsxs(A_,{ref:o,className:Le("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...s,children:[a,b.jsx(Ow,{className:"ml-auto"})]}));NL.displayName=A_.displayName;const OL=y.forwardRef(({className:e,...t},a)=>b.jsx(N_,{ref:a,className:Le("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 origin-(--radix-dropdown-menu-content-transform-origin)",e),...t}));OL.displayName=N_.displayName;const O_=y.forwardRef(({className:e,sideOffset:t=4,...a},s)=>b.jsx(CL,{children:b.jsx(S_,{ref:s,sideOffset:t,className:Le("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 origin-(--radix-dropdown-menu-content-transform-origin)",e),...a})}));O_.displayName=S_.displayName;const k_=y.forwardRef(({className:e,inset:t,...a},s)=>b.jsx(x_,{ref:s,className:Le("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...a}));k_.displayName=x_.displayName;const kL=y.forwardRef(({className:e,children:t,checked:a,...s},o)=>b.jsxs(E_,{ref:o,className:Le("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:a,...s,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(C_,{children:b.jsx(ym,{className:"h-4 w-4"})})}),t]}));kL.displayName=E_.displayName;const jL=y.forwardRef(({className:e,children:t,...a},s)=>b.jsxs(T_,{ref:s,className:Le("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[b.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(C_,{children:b.jsx(GO,{className:"h-2 w-2 fill-current"})})}),t]}));jL.displayName=T_.displayName;const ML=y.forwardRef(({className:e,inset:t,...a},s)=>b.jsx(__,{ref:s,className:Le("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...a}));ML.displayName=__.displayName;const j_=y.forwardRef(({className:e,...t},a)=>b.jsx(R_,{ref:a,className:Le("-mx-1 my-1 h-px bg-muted",e),...t}));j_.displayName=R_.displayName;function DL(e,t=[]){let a=[];function s(c,u){const d=y.createContext(u);d.displayName=c+"Context";const h=a.length;a=[...a,u];const p=g=>{var C;const{scope:S,children:_,...E}=g,x=((C=S==null?void 0:S[e])==null?void 0:C[h])||d,R=y.useMemo(()=>E,Object.values(E));return b.jsx(x.Provider,{value:R,children:_})};p.displayName=c+"Provider";function v(g,S){var x;const _=((x=S==null?void 0:S[e])==null?void 0:x[h])||d,E=y.useContext(_);if(E)return E;if(u!==void 0)return u;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[p,v]}const o=()=>{const c=a.map(u=>y.createContext(u));return function(d){const h=(d==null?void 0:d[e])||c;return y.useMemo(()=>({[`__scope${e}`]:{...d,[e]:h}}),[d,h])}};return o.scopeName=e,[s,LL(o,...t)]}function LL(...e){const t=e[0];if(e.length===1)return t;const a=()=>{const s=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(c){const u=s.reduce((d,{useScope:h,scopeName:p})=>{const g=h(c)[`__scope${p}`];return{...d,...g}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return a.scopeName=t.scopeName,a}var UL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Gm=UL.reduce((e,t)=>{const a=wu(`Primitive.${t}`),s=y.forwardRef((o,c)=>{const{asChild:u,...d}=o,h=u?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(h,{...d,ref:c})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),Eh={exports:{}},Th={};/**
|
||
* @license React
|
||
* use-sync-external-store-shim.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var E0;function zL(){if(E0)return Th;E0=1;var e=mu();function t(g,S){return g===S&&(g!==0||1/g===1/S)||g!==g&&S!==S}var a=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,c=e.useLayoutEffect,u=e.useDebugValue;function d(g,S){var _=S(),E=s({inst:{value:_,getSnapshot:S}}),x=E[0].inst,R=E[1];return c(function(){x.value=_,x.getSnapshot=S,h(x)&&R({inst:x})},[g,_,S]),o(function(){return h(x)&&R({inst:x}),g(function(){h(x)&&R({inst:x})})},[g]),u(_),_}function h(g){var S=g.getSnapshot;g=g.value;try{var _=S();return!a(g,_)}catch{return!0}}function p(g,S){return S()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:d;return Th.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Th}var T0;function PL(){return T0||(T0=1,Eh.exports=zL()),Eh.exports}var BL=PL();function IL(){return BL.useSyncExternalStore($L,()=>!0,()=>!1)}function $L(){return()=>{}}var Vm="Avatar",[HL]=DL(Vm),[qL,M_]=HL(Vm),D_=y.forwardRef((e,t)=>{const{__scopeAvatar:a,...s}=e,[o,c]=y.useState("idle");return b.jsx(qL,{scope:a,imageLoadingStatus:o,onImageLoadingStatusChange:c,children:b.jsx(Gm.span,{...s,ref:t})})});D_.displayName=Vm;var L_="AvatarImage",U_=y.forwardRef((e,t)=>{const{__scopeAvatar:a,src:s,onLoadingStatusChange:o=()=>{},...c}=e,u=M_(L_,a),d=GL(s,c),h=Ln(p=>{o(p),u.onImageLoadingStatusChange(p)});return gt(()=>{d!=="idle"&&h(d)},[d,h]),d==="loaded"?b.jsx(Gm.img,{...c,ref:t,src:s}):null});U_.displayName=L_;var z_="AvatarFallback",P_=y.forwardRef((e,t)=>{const{__scopeAvatar:a,delayMs:s,...o}=e,c=M_(z_,a),[u,d]=y.useState(s===void 0);return y.useEffect(()=>{if(s!==void 0){const h=window.setTimeout(()=>d(!0),s);return()=>window.clearTimeout(h)}},[s]),u&&c.imageLoadingStatus!=="loaded"?b.jsx(Gm.span,{...o,ref:t}):null});P_.displayName=z_;function C0(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function GL(e,{referrerPolicy:t,crossOrigin:a}){const s=IL(),o=y.useRef(null),c=s?(o.current||(o.current=new window.Image),o.current):null,[u,d]=y.useState(()=>C0(c,e));return gt(()=>{d(C0(c,e))},[c,e]),gt(()=>{const h=g=>()=>{d(g)};if(!c)return;const p=h("loaded"),v=h("error");return c.addEventListener("load",p),c.addEventListener("error",v),t&&(c.referrerPolicy=t),typeof a=="string"&&(c.crossOrigin=a),()=>{c.removeEventListener("load",p),c.removeEventListener("error",v)}},[c,a,t]),u}var B_=D_,I_=U_,$_=P_;const H_=y.forwardRef(({className:e,...t},a)=>b.jsx(B_,{ref:a,className:Le("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));H_.displayName=B_.displayName;const q_=y.forwardRef(({className:e,...t},a)=>b.jsx(I_,{ref:a,className:Le("aspect-square h-full w-full",e),...t}));q_.displayName=I_.displayName;const G_=y.forwardRef(({className:e,...t},a)=>b.jsx($_,{ref:a,className:Le("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));G_.displayName=$_.displayName;const VL=_m("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function V_({className:e,variant:t,...a}){return b.jsx("div",{className:Le(VL({variant:t}),e),...a})}const KL=["Ascenda","Bacardí","Bayer","Benedicto Wong","Big Cola","BMI","Casio","CDC","Colgate","Cordiflex","Diageo","Estelar","Estrella Azul","GLM","In Drive","Mars","Microsoft","Molino Criollo","Naicom","Nestlé","P&G","Pepsico","RRHH","Taco Bell","Us Meat","Vozez","Whirlpool","Little Caesars","Intcomex","Cemix","Súper Xtra","Grupo AJE","Varios","KitchenAid","Maytag","Across","Claro","Bruni","Volt","InDrive","TrueShore","Coca Cola","Más Móvil","US Rice","Café Indio","Café Maya","Jack Daniels","GLM Digital","Compass","Starbucks","Skechers","Ron Bermudez","Nature´s Heart","Larimart","Motorola","Bajaj - Pulsar","Xelet Media","Philip Morris","Malher","Carnation","La Lechera"].sort(),Km={CDC:"Marrero",Colombia:"J. Fernando","Costa Rica":"Poul","El Salvador":"Christian",Estelar:"Pablo",Guatemala:"Gerardo",Honduras:"Lucy",Jamaica:"Liz",Latam:"JL",Mexico:"Poul",Nicaragua:"Poul",OCI:"Liz",Panama:"Gabriel","Puerto Rico":"Liz","Republica Dominicana":"Liz",RRHH:"Maximo",Trinidad:"Liz",Venezuela:"Jose Fer",Vozez:"Nathalia","GLM Digital":"Lil",IQM:"Lil"},YL=Object.keys(Km).sort(),FL=["Carnation","GLM RRHH","La Lechera","Malher","US Meat","Coffee Mate y Nescafé","Nestum y Nido","Whirlpool","Motorola","Philip Morris","US Meat Guatemala","KitKat, Crunch, Choco Trío","Colgate","Kit Kat","UMA","Purina","Maggi e Ideal","Nestlé","Jimador","Multimarcas","Maggi","Covo","El Machetazo","Grupo Bocel","Supply Chain","Carnation y La Lechera","GLM Administración","Nestlé Bice","GLM","Nescafé","Idea, Qué Rico y Maggi","EY","Nesquik","Maggi, Ketchup, Qué Rico","Ideal","Claro Empresas","Nido","Presto","Nestlé RD","GLM Colombia","Motorola RD","GLM Caribe","Mandino","Coffee Mate","GLM Latam","RRHH RD","Philip Morris TT","GLM RD","Smirnoff","Kaspersky","US Pork","Qué Rico y Maggi","Claro y Motorola","Sedal","Maytag","Qué Rico, Maggi y Ketchup","Multimarca","Aviva y Princesa","KitchenAid","Enredé","Ascenda","Lipton Té","Heiniken","Oral B","Aafresh","IQOS","Natures Heart"],WL=["Aprobado","No aprobado","Stand by","Aprobado /no ejecutado","Pre aprobado","On going","Sin respuesta"],Xh=[{id:"blue",name:"Azul",hex:"#4285F4"},{id:"red",name:"Rojo",hex:"#EA4335"},{id:"yellow",name:"Amarillo",hex:"#FBBC04"},{id:"green",name:"Verde",hex:"#34A853"},{id:"purple",name:"Morado",hex:"#A142F4"},{id:"teal",name:"Turquesa",hex:"#00ACC1"},{id:"orange",name:"Naranja",hex:"#FB8C00"},{id:"pink",name:"Rosa",hex:"#E91E63"},{id:"indigo",name:"Índigo",hex:"#3F51B5"},{id:"gray",name:"Gris",hex:"#5F6368"}],XL=["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"];function K_(e){var t;return((t=Xh.find(a=>a.id===e))==null?void 0:t.hex)??Xh[0].hex}function JL({project:e,onClick:t}){const a=!!e.status,{isGerardo:s}=Jo();return b.jsxs("button",{onClick:t,className:Le("group block text-left w-full rounded-2xl bg-card overflow-hidden p-0 ring-1 ring-border","transition-all duration-200 hover:-translate-y-0.5","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a&&"opacity-65 hover:opacity-90"),style:{boxShadow:a?"0 1px 2px oklch(0.5 0.02 280 / 0.04)":"var(--shadow-soft)"},onMouseEnter:o=>{a||(o.currentTarget.style.boxShadow="var(--shadow-hover)")},onMouseLeave:o=>{o.currentTarget.style.boxShadow=a?"0 1px 2px oklch(0.5 0.02 280 / 0.04)":"var(--shadow-soft)"},children:[b.jsx("div",{className:"min-h-14 rounded-t-2xl px-4 py-3",style:{backgroundColor:a?"#9AA0A6":K_(e.color)},children:b.jsx("h3",{className:"text-white font-semibold text-sm leading-snug line-clamp-2 drop-shadow-sm",children:e.nombre||"Sin título"})}),b.jsxs("div",{className:"p-4 space-y-2.5",children:[b.jsx(Mc,{icon:b.jsx(qb,{className:"w-3.5 h-3.5"}),label:"Cliente",value:e.cliente}),b.jsx(Mc,{icon:b.jsx(qb,{className:"w-3.5 h-3.5"}),label:"Marca",value:e.marca}),b.jsx(Mc,{icon:b.jsx(lk,{className:"w-3.5 h-3.5"}),label:"País",value:e.bu}),b.jsx(Mc,{icon:b.jsx(pk,{className:"w-3.5 h-3.5"}),label:"Solicita",value:e.solicitante}),b.jsxs("div",{className:"flex items-center justify-between pt-2 mt-2 border-t border-border/70",children:[b.jsxs("div",{className:"flex items-center gap-3 text-[11px] text-muted-foreground",children:[e.propuestaLinks.length>0&&b.jsxs("span",{className:"flex items-center gap-1",title:"Propuestas",children:[b.jsx(ZO,{className:"w-3 h-3"})," ",e.propuestaLinks.length]}),e.afLinks.length>0&&b.jsxs("span",{className:"flex items-center gap-1",title:"Artes finales",children:[b.jsx(XO,{className:"w-3 h-3"})," AF·",e.afLinks.length]})]}),b.jsxs("div",{className:"flex items-center gap-1.5",children:[s&&e.monto!=null&&b.jsxs("span",{className:"text-[11px] font-medium text-foreground/70",children:["$",e.monto.toLocaleString()]}),e.status&&b.jsxs(V_,{variant:"secondary",className:Le("text-[10px] px-1.5 py-0 h-5 font-medium",e.status==="Aprobado"&&"bg-emerald-100 text-emerald-800 hover:bg-emerald-100",e.status==="No aprobado"&&"bg-red-100 text-red-800 hover:bg-red-100"),children:[e.status==="Aprobado"&&b.jsx(HO,{className:"w-2.5 h-2.5 mr-0.5"}),e.status]})]})]})]})]})}function Mc({icon:e,label:t,value:a}){return b.jsxs("div",{className:"flex items-start gap-2 text-xs",children:[b.jsx("span",{className:"text-muted-foreground mt-0.5 flex-shrink-0",children:e}),b.jsx("span",{className:"text-muted-foreground w-14 flex-shrink-0",children:t}),b.jsx("span",{className:"text-foreground font-medium truncate",children:a||"—"})]})}function QL(e){const t=ZL(e),a=y.forwardRef((s,o)=>{const{children:c,...u}=s,d=y.Children.toArray(c),h=d.find(t3);if(h){const p=h.props.children,v=d.map(g=>g===h?y.Children.count(p)>1?y.Children.only(null):y.isValidElement(p)?p.props.children:null:g);return b.jsx(t,{...u,ref:o,children:y.isValidElement(p)?y.cloneElement(p,void 0,v):null})}return b.jsx(t,{...u,ref:o,children:c})});return a.displayName=`${e}.Slot`,a}function ZL(e){const t=y.forwardRef((a,s)=>{const{children:o,...c}=a;if(y.isValidElement(o)){const u=r3(o),d=n3(c,o.props);return o.type!==y.Fragment&&(d.ref=s?jr(s,u):u),y.cloneElement(o,d)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var e3=Symbol("radix.slottable");function t3(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===e3}function n3(e,t){const a={...t};for(const s in t){const o=e[s],c=t[s];/^on[A-Z]/.test(s)?o&&c?a[s]=(...d)=>{const h=c(...d);return o(...d),h}:o&&(a[s]=o):s==="style"?a[s]={...o,...c}:s==="className"&&(a[s]=[o,c].filter(Boolean).join(" "))}return{...e,...a}}function r3(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var Du="Dialog",[Y_]=es(Du),[a3,Pn]=Y_(Du),F_=e=>{const{__scopeDialog:t,children:a,open:s,defaultOpen:o,onOpenChange:c,modal:u=!0}=e,d=y.useRef(null),h=y.useRef(null),[p,v]=Po({prop:s,defaultProp:o??!1,onChange:c,caller:Du});return b.jsx(a3,{scope:t,triggerRef:d,contentRef:h,contentId:Tr(),titleId:Tr(),descriptionId:Tr(),open:p,onOpenChange:v,onOpenToggle:y.useCallback(()=>v(g=>!g),[v]),modal:u,children:a})};F_.displayName=Du;var W_="DialogTrigger",s3=y.forwardRef((e,t)=>{const{__scopeDialog:a,...s}=e,o=Pn(W_,a),c=Fe(t,o.triggerRef);return b.jsx(ze.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Wm(o.open),...s,ref:c,onClick:be(e.onClick,o.onOpenToggle)})});s3.displayName=W_;var Ym="DialogPortal",[i3,X_]=Y_(Ym,{forceMount:void 0}),J_=e=>{const{__scopeDialog:t,forceMount:a,children:s,container:o}=e,c=Pn(Ym,t);return b.jsx(i3,{scope:t,forceMount:a,children:y.Children.map(s,u=>b.jsx(pa,{present:a||c.open,children:b.jsx(Au,{asChild:!0,container:o,children:u})}))})};J_.displayName=Ym;var fu="DialogOverlay",Q_=y.forwardRef((e,t)=>{const a=X_(fu,e.__scopeDialog),{forceMount:s=a.forceMount,...o}=e,c=Pn(fu,e.__scopeDialog);return c.modal?b.jsx(pa,{present:s||c.open,children:b.jsx(l3,{...o,ref:t})}):null});Q_.displayName=fu;var o3=QL("DialogOverlay.RemoveScroll"),l3=y.forwardRef((e,t)=>{const{__scopeDialog:a,...s}=e,o=Pn(fu,a);return b.jsx(Ou,{as:o3,allowPinchZoom:!0,shards:[o.contentRef],children:b.jsx(ze.div,{"data-state":Wm(o.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),Xa="DialogContent",Z_=y.forwardRef((e,t)=>{const a=X_(Xa,e.__scopeDialog),{forceMount:s=a.forceMount,...o}=e,c=Pn(Xa,e.__scopeDialog);return b.jsx(pa,{present:s||c.open,children:c.modal?b.jsx(c3,{...o,ref:t}):b.jsx(u3,{...o,ref:t})})});Z_.displayName=Xa;var c3=y.forwardRef((e,t)=>{const a=Pn(Xa,e.__scopeDialog),s=y.useRef(null),o=Fe(t,a.contentRef,s);return y.useEffect(()=>{const c=s.current;if(c)return Um(c)},[]),b.jsx(ex,{...e,ref:o,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:be(e.onCloseAutoFocus,c=>{var u;c.preventDefault(),(u=a.triggerRef.current)==null||u.focus()}),onPointerDownOutside:be(e.onPointerDownOutside,c=>{const u=c.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0;(u.button===2||d)&&c.preventDefault()}),onFocusOutside:be(e.onFocusOutside,c=>c.preventDefault())})}),u3=y.forwardRef((e,t)=>{const a=Pn(Xa,e.__scopeDialog),s=y.useRef(!1),o=y.useRef(!1);return b.jsx(ex,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{var u,d;(u=e.onCloseAutoFocus)==null||u.call(e,c),c.defaultPrevented||(s.current||(d=a.triggerRef.current)==null||d.focus(),c.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:c=>{var h,p;(h=e.onInteractOutside)==null||h.call(e,c),c.defaultPrevented||(s.current=!0,c.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const u=c.target;((p=a.triggerRef.current)==null?void 0:p.contains(u))&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&o.current&&c.preventDefault()}})}),ex=y.forwardRef((e,t)=>{const{__scopeDialog:a,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:c,...u}=e,d=Pn(Xa,a),h=y.useRef(null),p=Fe(t,h);return Rm(),b.jsxs(b.Fragment,{children:[b.jsx(_u,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:c,children:b.jsx(Su,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Wm(d.open),...u,ref:p,onDismiss:()=>d.onOpenChange(!1)})}),b.jsxs(b.Fragment,{children:[b.jsx(d3,{titleId:d.titleId}),b.jsx(h3,{contentRef:h,descriptionId:d.descriptionId})]})]})}),Fm="DialogTitle",tx=y.forwardRef((e,t)=>{const{__scopeDialog:a,...s}=e,o=Pn(Fm,a);return b.jsx(ze.h2,{id:o.titleId,...s,ref:t})});tx.displayName=Fm;var nx="DialogDescription",rx=y.forwardRef((e,t)=>{const{__scopeDialog:a,...s}=e,o=Pn(nx,a);return b.jsx(ze.p,{id:o.descriptionId,...s,ref:t})});rx.displayName=nx;var ax="DialogClose",sx=y.forwardRef((e,t)=>{const{__scopeDialog:a,...s}=e,o=Pn(ax,a);return b.jsx(ze.button,{type:"button",...s,ref:t,onClick:be(e.onClick,()=>o.onOpenChange(!1))})});sx.displayName=ax;function Wm(e){return e?"open":"closed"}var ix="DialogTitleWarning",[b5,ox]=y2(ix,{contentName:Xa,titleName:Fm,docsSlug:"dialog"}),d3=({titleId:e})=>{const t=ox(ix),a=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
||
|
||
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
||
|
||
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return y.useEffect(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},f3="DialogDescriptionWarning",h3=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ox(f3).contentName}}.`;return y.useEffect(()=>{var c;const o=(c=e.current)==null?void 0:c.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},m3=F_,p3=J_,lx=Q_,cx=Z_,ux=tx,dx=rx,g3=sx;const v3=m3,y3=p3,fx=y.forwardRef(({className:e,...t},a)=>b.jsx(lx,{ref:a,className:Le("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));fx.displayName=lx.displayName;const hx=y.forwardRef(({className:e,children:t,...a},s)=>b.jsxs(y3,{children:[b.jsx(fx,{}),b.jsxs(cx,{ref:s,className:Le("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg",e),...a,children:[t,b.jsxs(g3,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background cursor-pointer transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[b.jsx(kw,{className:"h-4 w-4"}),b.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));hx.displayName=cx.displayName;const mx=({className:e,...t})=>b.jsx("div",{className:Le("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});mx.displayName="DialogHeader";const px=({className:e,...t})=>b.jsx("div",{className:Le("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});px.displayName="DialogFooter";const gx=y.forwardRef(({className:e,...t},a)=>b.jsx(ux,{ref:a,className:Le("text-lg font-semibold leading-none tracking-tight",e),...t}));gx.displayName=ux.displayName;const vx=y.forwardRef(({className:e,...t},a)=>b.jsx(dx,{ref:a,className:Le("text-sm text-muted-foreground",e),...t}));vx.displayName=dx.displayName;var b3=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],w3=b3.reduce((e,t)=>{const a=wu(`Primitive.${t}`),s=y.forwardRef((o,c)=>{const{asChild:u,...d}=o,h=u?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(h,{...d,ref:c})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),S3="Label",yx=y.forwardRef((e,t)=>b.jsx(w3.label,{...e,ref:t,onMouseDown:a=>{var o;a.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,a),!a.defaultPrevented&&a.detail>1&&a.preventDefault())}}));yx.displayName=S3;var bx=yx;const _3=_m("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Sn=y.forwardRef(({className:e,...t},a)=>b.jsx(bx,{ref:a,className:Le(_3(),e),...t}));Sn.displayName=bx.displayName;const wx=y.forwardRef(({className:e,...t},a)=>b.jsx("textarea",{className:Le("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:a,...t}));wx.displayName="Textarea";function R0(e,[t,a]){return Math.min(a,Math.max(t,e))}function x3(e){const t=E3(e),a=y.forwardRef((s,o)=>{const{children:c,...u}=s,d=y.Children.toArray(c),h=d.find(C3);if(h){const p=h.props.children,v=d.map(g=>g===h?y.Children.count(p)>1?y.Children.only(null):y.isValidElement(p)?p.props.children:null:g);return b.jsx(t,{...u,ref:o,children:y.isValidElement(p)?y.cloneElement(p,void 0,v):null})}return b.jsx(t,{...u,ref:o,children:c})});return a.displayName=`${e}.Slot`,a}function E3(e){const t=y.forwardRef((a,s)=>{const{children:o,...c}=a;if(y.isValidElement(o)){const u=A3(o),d=R3(c,o.props);return o.type!==y.Fragment&&(d.ref=s?jr(s,u):u),y.cloneElement(o,d)}return y.Children.count(o)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var T3=Symbol("radix.slottable");function C3(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===T3}function R3(e,t){const a={...t};for(const s in t){const o=e[s],c=t[s];/^on[A-Z]/.test(s)?o&&c?a[s]=(...d)=>{const h=c(...d);return o(...d),h}:o&&(a[s]=o):s==="style"?a[s]={...o,...c}:s==="className"&&(a[s]=[o,c].filter(Boolean).join(" "))}return{...e,...a}}function A3(e){var s,o;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=t&&"isReactWarning"in t&&t.isReactWarning;return a?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,a=t&&"isReactWarning"in t&&t.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function N3(e){const t=y.useRef({value:e,previous:e});return y.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Sx=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"}),O3="VisuallyHidden",k3=y.forwardRef((e,t)=>b.jsx(ze.span,{...e,ref:t,style:{...Sx,...e.style}}));k3.displayName=O3;var j3=[" ","Enter","ArrowUp","ArrowDown"],M3=[" ","Enter"],Ja="Select",[Lu,Uu,D3]=Tm(Ja),[bi]=es(Ja,[D3,Ru]),zu=Ru(),[L3,ga]=bi(Ja),[U3,z3]=bi(Ja),_x=e=>{const{__scopeSelect:t,children:a,open:s,defaultOpen:o,onOpenChange:c,value:u,defaultValue:d,onValueChange:h,dir:p,name:v,autoComplete:g,disabled:S,required:_,form:E}=e,x=zu(t),[R,C]=y.useState(null),[N,A]=y.useState(null),[D,V]=y.useState(!1),q=Cm(p),[U,I]=Po({prop:s,defaultProp:o??!1,onChange:c,caller:Ja}),[ae,me]=Po({prop:u,defaultProp:d,onChange:h,caller:Ja}),ve=y.useRef(null),de=R?E||!!R.closest("form"):!0,[pe,J]=y.useState(new Set),ie=Array.from(pe).map(O=>O.props.value).join(";");return b.jsx(wS,{...x,children:b.jsxs(L3,{required:_,scope:t,trigger:R,onTriggerChange:C,valueNode:N,onValueNodeChange:A,valueNodeHasChildren:D,onValueNodeHasChildrenChange:V,contentId:Tr(),value:ae,onValueChange:me,open:U,onOpenChange:I,dir:q,triggerPointerDownPosRef:ve,disabled:S,children:[b.jsx(Lu.Provider,{scope:t,children:b.jsx(U3,{scope:e.__scopeSelect,onNativeOptionAdd:y.useCallback(O=>{J($=>new Set($).add(O))},[]),onNativeOptionRemove:y.useCallback(O=>{J($=>{const K=new Set($);return K.delete(O),K})},[]),children:a})}),de?b.jsxs(Kx,{"aria-hidden":!0,required:_,tabIndex:-1,name:v,autoComplete:g,value:ae,onChange:O=>me(O.target.value),disabled:S,form:E,children:[ae===void 0?b.jsx("option",{value:""}):null,Array.from(pe)]},ie):null]})})};_x.displayName=Ja;var xx="SelectTrigger",Ex=y.forwardRef((e,t)=>{const{__scopeSelect:a,disabled:s=!1,...o}=e,c=zu(a),u=ga(xx,a),d=u.disabled||s,h=Fe(t,u.onTriggerChange),p=Uu(a),v=y.useRef("touch"),[g,S,_]=Fx(x=>{const R=p().filter(A=>!A.disabled),C=R.find(A=>A.value===u.value),N=Wx(R,x,C);N!==void 0&&u.onValueChange(N.value)}),E=x=>{d||(u.onOpenChange(!0),_()),x&&(u.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return b.jsx(SS,{asChild:!0,...c,children:b.jsx(ze.button,{type:"button",role:"combobox","aria-controls":u.contentId,"aria-expanded":u.open,"aria-required":u.required,"aria-autocomplete":"none",dir:u.dir,"data-state":u.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":Yx(u.value)?"":void 0,...o,ref:h,onClick:be(o.onClick,x=>{x.currentTarget.focus(),v.current!=="mouse"&&E(x)}),onPointerDown:be(o.onPointerDown,x=>{v.current=x.pointerType;const R=x.target;R.hasPointerCapture(x.pointerId)&&R.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(E(x),x.preventDefault())}),onKeyDown:be(o.onKeyDown,x=>{const R=g.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&S(x.key),!(R&&x.key===" ")&&j3.includes(x.key)&&(E(),x.preventDefault())})})})});Ex.displayName=xx;var Tx="SelectValue",Cx=y.forwardRef((e,t)=>{const{__scopeSelect:a,className:s,style:o,children:c,placeholder:u="",...d}=e,h=ga(Tx,a),{onValueNodeHasChildrenChange:p}=h,v=c!==void 0,g=Fe(t,h.onValueNodeChange);return gt(()=>{p(v)},[p,v]),b.jsx(ze.span,{...d,ref:g,style:{pointerEvents:"none"},children:Yx(h.value)?b.jsx(b.Fragment,{children:u}):c})});Cx.displayName=Tx;var P3="SelectIcon",Rx=y.forwardRef((e,t)=>{const{__scopeSelect:a,children:s,...o}=e;return b.jsx(ze.span,{"aria-hidden":!0,...o,ref:t,children:s||"▼"})});Rx.displayName=P3;var B3="SelectPortal",Ax=e=>b.jsx(Au,{asChild:!0,...e});Ax.displayName=B3;var Qa="SelectContent",Nx=y.forwardRef((e,t)=>{const a=ga(Qa,e.__scopeSelect),[s,o]=y.useState();if(gt(()=>{o(new DocumentFragment)},[]),!a.open){const c=s;return c?Wo.createPortal(b.jsx(Ox,{scope:e.__scopeSelect,children:b.jsx(Lu.Slot,{scope:e.__scopeSelect,children:b.jsx("div",{children:e.children})})}),c):null}return b.jsx(kx,{...e,ref:t})});Nx.displayName=Qa;var kn=10,[Ox,va]=bi(Qa),I3="SelectContentImpl",$3=x3("SelectContent.RemoveScroll"),kx=y.forwardRef((e,t)=>{const{__scopeSelect:a,position:s="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:c,onPointerDownOutside:u,side:d,sideOffset:h,align:p,alignOffset:v,arrowPadding:g,collisionBoundary:S,collisionPadding:_,sticky:E,hideWhenDetached:x,avoidCollisions:R,...C}=e,N=ga(Qa,a),[A,D]=y.useState(null),[V,q]=y.useState(null),U=Fe(t,te=>D(te)),[I,ae]=y.useState(null),[me,ve]=y.useState(null),de=Uu(a),[pe,J]=y.useState(!1),ie=y.useRef(!1);y.useEffect(()=>{if(A)return Um(A)},[A]),Rm();const O=y.useCallback(te=>{const[ce,...le]=de().map(Ee=>Ee.ref.current),[Ce]=le.slice(-1),Re=document.activeElement;for(const Ee of te)if(Ee===Re||(Ee==null||Ee.scrollIntoView({block:"nearest"}),Ee===ce&&V&&(V.scrollTop=0),Ee===Ce&&V&&(V.scrollTop=V.scrollHeight),Ee==null||Ee.focus(),document.activeElement!==Re))return},[de,V]),$=y.useCallback(()=>O([I,A]),[O,I,A]);y.useEffect(()=>{pe&&$()},[pe,$]);const{onOpenChange:K,triggerPointerDownPosRef:Z}=N;y.useEffect(()=>{if(A){let te={x:0,y:0};const ce=Ce=>{var Re,Ee;te={x:Math.abs(Math.round(Ce.pageX)-(((Re=Z.current)==null?void 0:Re.x)??0)),y:Math.abs(Math.round(Ce.pageY)-(((Ee=Z.current)==null?void 0:Ee.y)??0))}},le=Ce=>{te.x<=10&&te.y<=10?Ce.preventDefault():A.contains(Ce.target)||K(!1),document.removeEventListener("pointermove",ce),Z.current=null};return Z.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",le,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",le,{capture:!0})}}},[A,K,Z]),y.useEffect(()=>{const te=()=>K(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[K]);const[W,j]=Fx(te=>{const ce=de().filter(Re=>!Re.disabled),le=ce.find(Re=>Re.ref.current===document.activeElement),Ce=Wx(ce,te,le);Ce&&setTimeout(()=>Ce.ref.current.focus())}),G=y.useCallback((te,ce,le)=>{const Ce=!ie.current&&!le;(N.value!==void 0&&N.value===ce||Ce)&&(ae(te),Ce&&(ie.current=!0))},[N.value]),F=y.useCallback(()=>A==null?void 0:A.focus(),[A]),ee=y.useCallback((te,ce,le)=>{const Ce=!ie.current&&!le;(N.value!==void 0&&N.value===ce||Ce)&&ve(te)},[N.value]),ne=s==="popper"?Jh:jx,se=ne===Jh?{side:d,sideOffset:h,align:p,alignOffset:v,arrowPadding:g,collisionBoundary:S,collisionPadding:_,sticky:E,hideWhenDetached:x,avoidCollisions:R}:{};return b.jsx(Ox,{scope:a,content:A,viewport:V,onViewportChange:q,itemRefCallback:G,selectedItem:I,onItemLeave:F,itemTextRefCallback:ee,focusSelectedItem:$,selectedItemText:me,position:s,isPositioned:pe,searchRef:W,children:b.jsx(Ou,{as:$3,allowPinchZoom:!0,children:b.jsx(_u,{asChild:!0,trapped:N.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:be(o,te=>{var ce;(ce=N.trigger)==null||ce.focus({preventScroll:!0}),te.preventDefault()}),children:b.jsx(Su,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:b.jsx(ne,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:te=>te.preventDefault(),...C,...se,onPlaced:()=>J(!0),ref:U,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:be(C.onKeyDown,te=>{const ce=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!ce&&te.key.length===1&&j(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let Ce=de().filter(Re=>!Re.disabled).map(Re=>Re.ref.current);if(["ArrowUp","End"].includes(te.key)&&(Ce=Ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const Re=te.target,Ee=Ce.indexOf(Re);Ce=Ce.slice(Ee+1)}setTimeout(()=>O(Ce)),te.preventDefault()}})})})})})})});kx.displayName=I3;var H3="SelectItemAlignedPosition",jx=y.forwardRef((e,t)=>{const{__scopeSelect:a,onPlaced:s,...o}=e,c=ga(Qa,a),u=va(Qa,a),[d,h]=y.useState(null),[p,v]=y.useState(null),g=Fe(t,U=>v(U)),S=Uu(a),_=y.useRef(!1),E=y.useRef(!0),{viewport:x,selectedItem:R,selectedItemText:C,focusSelectedItem:N}=u,A=y.useCallback(()=>{if(c.trigger&&c.valueNode&&d&&p&&x&&R&&C){const U=c.trigger.getBoundingClientRect(),I=p.getBoundingClientRect(),ae=c.valueNode.getBoundingClientRect(),me=C.getBoundingClientRect();if(c.dir!=="rtl"){const Re=me.left-I.left,Ee=ae.left-Re,rt=U.left-Ee,Ke=U.width+rt,En=Math.max(Ke,I.width),cn=window.innerWidth-kn,Xt=R0(Ee,[kn,Math.max(kn,cn-En)]);d.style.minWidth=Ke+"px",d.style.left=Xt+"px"}else{const Re=I.right-me.right,Ee=window.innerWidth-ae.right-Re,rt=window.innerWidth-U.right-Ee,Ke=U.width+rt,En=Math.max(Ke,I.width),cn=window.innerWidth-kn,Xt=R0(Ee,[kn,Math.max(kn,cn-En)]);d.style.minWidth=Ke+"px",d.style.right=Xt+"px"}const ve=S(),de=window.innerHeight-kn*2,pe=x.scrollHeight,J=window.getComputedStyle(p),ie=parseInt(J.borderTopWidth,10),O=parseInt(J.paddingTop,10),$=parseInt(J.borderBottomWidth,10),K=parseInt(J.paddingBottom,10),Z=ie+O+pe+K+$,W=Math.min(R.offsetHeight*5,Z),j=window.getComputedStyle(x),G=parseInt(j.paddingTop,10),F=parseInt(j.paddingBottom,10),ee=U.top+U.height/2-kn,ne=de-ee,se=R.offsetHeight/2,te=R.offsetTop+se,ce=ie+O+te,le=Z-ce;if(ce<=ee){const Re=ve.length>0&&R===ve[ve.length-1].ref.current;d.style.bottom="0px";const Ee=p.clientHeight-x.offsetTop-x.offsetHeight,rt=Math.max(ne,se+(Re?F:0)+Ee+$),Ke=ce+rt;d.style.height=Ke+"px"}else{const Re=ve.length>0&&R===ve[0].ref.current;d.style.top="0px";const rt=Math.max(ee,ie+x.offsetTop+(Re?G:0)+se)+le;d.style.height=rt+"px",x.scrollTop=ce-ee+x.offsetTop}d.style.margin=`${kn}px 0`,d.style.minHeight=W+"px",d.style.maxHeight=de+"px",s==null||s(),requestAnimationFrame(()=>_.current=!0)}},[S,c.trigger,c.valueNode,d,p,x,R,C,c.dir,s]);gt(()=>A(),[A]);const[D,V]=y.useState();gt(()=>{p&&V(window.getComputedStyle(p).zIndex)},[p]);const q=y.useCallback(U=>{U&&E.current===!0&&(A(),N==null||N(),E.current=!1)},[A,N]);return b.jsx(G3,{scope:a,contentWrapper:d,shouldExpandOnScrollRef:_,onScrollButtonChange:q,children:b.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:b.jsx(ze.div,{...o,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});jx.displayName=H3;var q3="SelectPopperPosition",Jh=y.forwardRef((e,t)=>{const{__scopeSelect:a,align:s="start",collisionPadding:o=kn,...c}=e,u=zu(a);return b.jsx(_S,{...u,...c,ref:t,align:s,collisionPadding:o,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Jh.displayName=q3;var[G3,Xm]=bi(Qa,{}),Qh="SelectViewport",Mx=y.forwardRef((e,t)=>{const{__scopeSelect:a,nonce:s,...o}=e,c=va(Qh,a),u=Xm(Qh,a),d=Fe(t,c.onViewportChange),h=y.useRef(0);return b.jsxs(b.Fragment,{children:[b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),b.jsx(Lu.Slot,{scope:a,children:b.jsx(ze.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:be(o.onScroll,p=>{const v=p.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:S}=u;if(S!=null&&S.current&&g){const _=Math.abs(h.current-v.scrollTop);if(_>0){const E=window.innerHeight-kn*2,x=parseFloat(g.style.minHeight),R=parseFloat(g.style.height),C=Math.max(x,R);if(C<E){const N=C+_,A=Math.min(E,N),D=N-A;g.style.height=A+"px",g.style.bottom==="0px"&&(v.scrollTop=D>0?D:0,g.style.justifyContent="flex-end")}}}h.current=v.scrollTop})})})]})});Mx.displayName=Qh;var Dx="SelectGroup",[V3,K3]=bi(Dx),Y3=y.forwardRef((e,t)=>{const{__scopeSelect:a,...s}=e,o=Tr();return b.jsx(V3,{scope:a,id:o,children:b.jsx(ze.div,{role:"group","aria-labelledby":o,...s,ref:t})})});Y3.displayName=Dx;var Lx="SelectLabel",Ux=y.forwardRef((e,t)=>{const{__scopeSelect:a,...s}=e,o=K3(Lx,a);return b.jsx(ze.div,{id:o.id,...s,ref:t})});Ux.displayName=Lx;var hu="SelectItem",[F3,zx]=bi(hu),Px=y.forwardRef((e,t)=>{const{__scopeSelect:a,value:s,disabled:o=!1,textValue:c,...u}=e,d=ga(hu,a),h=va(hu,a),p=d.value===s,[v,g]=y.useState(c??""),[S,_]=y.useState(!1),E=Fe(t,N=>{var A;return(A=h.itemRefCallback)==null?void 0:A.call(h,N,s,o)}),x=Tr(),R=y.useRef("touch"),C=()=>{o||(d.onValueChange(s),d.onOpenChange(!1))};if(s==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return b.jsx(F3,{scope:a,value:s,disabled:o,textId:x,isSelected:p,onItemTextChange:y.useCallback(N=>{g(A=>A||((N==null?void 0:N.textContent)??"").trim())},[]),children:b.jsx(Lu.ItemSlot,{scope:a,value:s,disabled:o,textValue:v,children:b.jsx(ze.div,{role:"option","aria-labelledby":x,"data-highlighted":S?"":void 0,"aria-selected":p&&S,"data-state":p?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...u,ref:E,onFocus:be(u.onFocus,()=>_(!0)),onBlur:be(u.onBlur,()=>_(!1)),onClick:be(u.onClick,()=>{R.current!=="mouse"&&C()}),onPointerUp:be(u.onPointerUp,()=>{R.current==="mouse"&&C()}),onPointerDown:be(u.onPointerDown,N=>{R.current=N.pointerType}),onPointerMove:be(u.onPointerMove,N=>{var A;R.current=N.pointerType,o?(A=h.onItemLeave)==null||A.call(h):R.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:be(u.onPointerLeave,N=>{var A;N.currentTarget===document.activeElement&&((A=h.onItemLeave)==null||A.call(h))}),onKeyDown:be(u.onKeyDown,N=>{var D;((D=h.searchRef)==null?void 0:D.current)!==""&&N.key===" "||(M3.includes(N.key)&&C(),N.key===" "&&N.preventDefault())})})})})});Px.displayName=hu;var xo="SelectItemText",Bx=y.forwardRef((e,t)=>{const{__scopeSelect:a,className:s,style:o,...c}=e,u=ga(xo,a),d=va(xo,a),h=zx(xo,a),p=z3(xo,a),[v,g]=y.useState(null),S=Fe(t,C=>g(C),h.onItemTextChange,C=>{var N;return(N=d.itemTextRefCallback)==null?void 0:N.call(d,C,h.value,h.disabled)}),_=v==null?void 0:v.textContent,E=y.useMemo(()=>b.jsx("option",{value:h.value,disabled:h.disabled,children:_},h.value),[h.disabled,h.value,_]),{onNativeOptionAdd:x,onNativeOptionRemove:R}=p;return gt(()=>(x(E),()=>R(E)),[x,R,E]),b.jsxs(b.Fragment,{children:[b.jsx(ze.span,{id:h.textId,...c,ref:S}),h.isSelected&&u.valueNode&&!u.valueNodeHasChildren?Wo.createPortal(c.children,u.valueNode):null]})});Bx.displayName=xo;var Ix="SelectItemIndicator",$x=y.forwardRef((e,t)=>{const{__scopeSelect:a,...s}=e;return zx(Ix,a).isSelected?b.jsx(ze.span,{"aria-hidden":!0,...s,ref:t}):null});$x.displayName=Ix;var Zh="SelectScrollUpButton",Hx=y.forwardRef((e,t)=>{const a=va(Zh,e.__scopeSelect),s=Xm(Zh,e.__scopeSelect),[o,c]=y.useState(!1),u=Fe(t,s.onScrollButtonChange);return gt(()=>{if(a.viewport&&a.isPositioned){let d=function(){const p=h.scrollTop>0;c(p)};const h=a.viewport;return d(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[a.viewport,a.isPositioned]),o?b.jsx(Gx,{...e,ref:u,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=a;d&&h&&(d.scrollTop=d.scrollTop-h.offsetHeight)}}):null});Hx.displayName=Zh;var em="SelectScrollDownButton",qx=y.forwardRef((e,t)=>{const a=va(em,e.__scopeSelect),s=Xm(em,e.__scopeSelect),[o,c]=y.useState(!1),u=Fe(t,s.onScrollButtonChange);return gt(()=>{if(a.viewport&&a.isPositioned){let d=function(){const p=h.scrollHeight-h.clientHeight,v=Math.ceil(h.scrollTop)<p;c(v)};const h=a.viewport;return d(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[a.viewport,a.isPositioned]),o?b.jsx(Gx,{...e,ref:u,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=a;d&&h&&(d.scrollTop=d.scrollTop+h.offsetHeight)}}):null});qx.displayName=em;var Gx=y.forwardRef((e,t)=>{const{__scopeSelect:a,onAutoScroll:s,...o}=e,c=va("SelectScrollButton",a),u=y.useRef(null),d=Uu(a),h=y.useCallback(()=>{u.current!==null&&(window.clearInterval(u.current),u.current=null)},[]);return y.useEffect(()=>()=>h(),[h]),gt(()=>{var v;const p=d().find(g=>g.ref.current===document.activeElement);(v=p==null?void 0:p.ref.current)==null||v.scrollIntoView({block:"nearest"})},[d]),b.jsx(ze.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:be(o.onPointerDown,()=>{u.current===null&&(u.current=window.setInterval(s,50))}),onPointerMove:be(o.onPointerMove,()=>{var p;(p=c.onItemLeave)==null||p.call(c),u.current===null&&(u.current=window.setInterval(s,50))}),onPointerLeave:be(o.onPointerLeave,()=>{h()})})}),W3="SelectSeparator",Vx=y.forwardRef((e,t)=>{const{__scopeSelect:a,...s}=e;return b.jsx(ze.div,{"aria-hidden":!0,...s,ref:t})});Vx.displayName=W3;var tm="SelectArrow",X3=y.forwardRef((e,t)=>{const{__scopeSelect:a,...s}=e,o=zu(a),c=ga(tm,a),u=va(tm,a);return c.open&&u.position==="popper"?b.jsx(xS,{...o,...s,ref:t}):null});X3.displayName=tm;var J3="SelectBubbleInput",Kx=y.forwardRef(({__scopeSelect:e,value:t,...a},s)=>{const o=y.useRef(null),c=Fe(s,o),u=N3(t);return y.useEffect(()=>{const d=o.current;if(!d)return;const h=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(h,"value").set;if(u!==t&&v){const g=new Event("change",{bubbles:!0});v.call(d,t),d.dispatchEvent(g)}},[u,t]),b.jsx(ze.select,{...a,style:{...Sx,...a.style},ref:c,defaultValue:t})});Kx.displayName=J3;function Yx(e){return e===""||e===void 0}function Fx(e){const t=Ln(e),a=y.useRef(""),s=y.useRef(0),o=y.useCallback(u=>{const d=a.current+u;t(d),(function h(p){a.current=p,window.clearTimeout(s.current),p!==""&&(s.current=window.setTimeout(()=>h(""),1e3))})(d)},[t]),c=y.useCallback(()=>{a.current="",window.clearTimeout(s.current)},[]);return y.useEffect(()=>()=>window.clearTimeout(s.current),[]),[a,o,c]}function Wx(e,t,a){const o=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,c=a?e.indexOf(a):-1;let u=Q3(e,Math.max(c,0));o.length===1&&(u=u.filter(p=>p!==a));const h=u.find(p=>p.textValue.toLowerCase().startsWith(o.toLowerCase()));return h!==a?h:void 0}function Q3(e,t){return e.map((a,s)=>e[(t+s)%e.length])}var Z3=_x,Xx=Ex,eU=Cx,tU=Rx,nU=Ax,Jx=Nx,rU=Mx,Qx=Ux,Zx=Px,aU=Bx,sU=$x,eE=Hx,tE=qx,nE=Vx;const Dc=Z3,Lc=eU,Eo=y.forwardRef(({className:e,children:t,...a},s)=>b.jsxs(Xx,{ref:s,className:Le("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background cursor-pointer data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...a,children:[t,b.jsx(tU,{asChild:!0,children:b.jsx(bm,{className:"h-4 w-4 opacity-50"})})]}));Eo.displayName=Xx.displayName;const rE=y.forwardRef(({className:e,...t},a)=>b.jsx(eE,{ref:a,className:Le("flex cursor-default items-center justify-center py-1",e),...t,children:b.jsx(BO,{className:"h-4 w-4"})}));rE.displayName=eE.displayName;const aE=y.forwardRef(({className:e,...t},a)=>b.jsx(tE,{ref:a,className:Le("flex cursor-default items-center justify-center py-1",e),...t,children:b.jsx(bm,{className:"h-4 w-4"})}));aE.displayName=tE.displayName;const To=y.forwardRef(({className:e,children:t,position:a="popper",...s},o)=>b.jsx(nU,{children:b.jsxs(Jx,{ref:o,className:Le("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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 origin-(--radix-select-content-transform-origin)",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...s,children:[b.jsx(rE,{}),b.jsx(rU,{className:Le("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),b.jsx(aE,{})]})}));To.displayName=Jx.displayName;const iU=y.forwardRef(({className:e,...t},a)=>b.jsx(Qx,{ref:a,className:Le("px-2 py-1.5 text-sm font-semibold",e),...t}));iU.displayName=Qx.displayName;const ni=y.forwardRef(({className:e,children:t,...a},s)=>b.jsxs(Zx,{ref:s,className:Le("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[b.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:b.jsx(sU,{children:b.jsx(ym,{className:"h-4 w-4"})})}),b.jsx(aU,{children:t})]}));ni.displayName=Zx.displayName;const oU=y.forwardRef(({className:e,...t},a)=>b.jsx(nE,{ref:a,className:Le("-mx-1 my-1 h-px bg-muted",e),...t}));oU.displayName=nE.displayName;var lU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],cU=lU.reduce((e,t)=>{const a=wu(`Primitive.${t}`),s=y.forwardRef((o,c)=>{const{asChild:u,...d}=o,h=u?a:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),b.jsx(h,{...d,ref:c})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{}),uU="Separator",A0="horizontal",dU=["horizontal","vertical"],sE=y.forwardRef((e,t)=>{const{decorative:a,orientation:s=A0,...o}=e,c=fU(s)?s:A0,d=a?{role:"none"}:{"aria-orientation":c==="vertical"?c:void 0,role:"separator"};return b.jsx(cU.div,{"data-orientation":c,...d,...o,ref:t})});sE.displayName=uU;function fU(e){return dU.includes(e)}var iE=sE;const Yc=y.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...s},o)=>b.jsx(iE,{ref:o,decorative:a,orientation:t,className:Le("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...s}));Yc.displayName=iE.displayName;function hU({value:e,onChange:t}){return b.jsx("div",{className:"flex flex-wrap gap-2",children:Xh.map(a=>b.jsx("button",{type:"button",onClick:()=>t(a.id),title:a.name,className:Le("w-9 h-9 rounded-full flex items-center justify-center transition-all ring-offset-2 ring-offset-background hover:scale-110",e===a.id&&"ring-2 ring-foreground/40 scale-110"),style:{backgroundColor:a.hex},children:e===a.id&&b.jsx(ym,{className:"w-4 h-4 text-white drop-shadow"})},a.id))})}function N0({label:e,prefix:t,links:a,onChange:s,readOnly:o,emptyText:c}){const[u,d]=y.useState(""),h=()=>{const g=u.trim();g&&(s([...a,g]),d(""))},p=(g,S)=>s(a.map((_,E)=>E===g?S:_)),v=g=>s(a.filter((S,_)=>_!==g));return b.jsxs("div",{className:"space-y-2",children:[b.jsxs("div",{className:"flex items-center justify-between",children:[b.jsxs("span",{className:"text-sm font-medium text-foreground",children:[e," ",t&&b.jsxs("span",{className:"text-xs text-muted-foreground font-normal",children:["(",t,")"]})]}),b.jsx("span",{className:"text-xs text-muted-foreground",children:a.length})]}),a.length===0&&b.jsx("p",{className:"text-xs text-muted-foreground italic px-1",children:c??"Sin links aún"}),b.jsx("div",{className:"space-y-1.5",children:a.map((g,S)=>b.jsxs("div",{className:"group flex items-center gap-1.5",children:[b.jsxs("div",{className:"flex-shrink-0 w-7 h-7 rounded-md bg-accent flex items-center justify-center text-[10px] font-semibold text-accent-foreground",children:[t??"·",S+1]}),o?b.jsxs("a",{href:g,target:"_blank",rel:"noreferrer",className:"flex-1 text-sm text-primary hover:underline truncate flex items-center gap-1.5 py-1.5 px-2 rounded-md hover:bg-accent/60 transition-colors",children:[b.jsx(tk,{className:"w-3.5 h-3.5 flex-shrink-0"}),b.jsx("span",{className:"truncate",children:g}),b.jsx(FO,{className:"w-3 h-3 flex-shrink-0 opacity-60"})]}):b.jsxs(b.Fragment,{children:[b.jsx(Jn,{value:g,onChange:_=>p(S,_.target.value),placeholder:"https://…",className:"h-9 text-sm"}),b.jsx(on,{type:"button",variant:"ghost",size:"icon",className:"h-9 w-9 flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>v(S),children:b.jsx(kw,{className:"w-4 h-4"})})]})]},S))}),!o&&b.jsxs("div",{className:"flex gap-1.5 pt-1",children:[b.jsx(Jn,{value:u,onChange:g=>d(g.target.value),onKeyDown:g=>g.key==="Enter"&&(g.preventDefault(),h()),placeholder:"Pegar link y Enter",className:"h-9 text-sm"}),b.jsxs(on,{type:"button",variant:"outline",size:"sm",onClick:h,className:"h-9",children:[b.jsx(Sm,{className:"w-4 h-4 mr-1"})," Añadir"]})]})]})}function oE(e){return String(e||"").replace(/[\u0000-\u001F\u007F-\u009F\u200B-\u200D\uFEFF]/g,"").replace(/\s+/g," ").trim()}function di(e){return oE(e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().replace(/[^\p{L}\p{N}]+/gu," ").trim()}function fi(e){const t=oE(e);return di(t)==="republica dominicana"?"Republica Dominicana":t}function ai(e){const t=new Map;for(const a of e){const s=fi(a);if(!s)continue;const o=di(s);o&&(t.has(o)||t.set(o,s))}return Array.from(t.values())}function Uc(e,t){const a=ai(e),s=fi(t);if(!s)return a;const o=di(s);return a.some(u=>di(u)===o)?a:[s,...a]}const si={clientes:KL,marcas:FL,bus:YL,buCm:Km,status:[...WL]};let Fc=[],nm=si,Ho=!1,lE=!1,Jm=null,No=null,Ya=null,zc=0;function rm(){Fc.forEach(e=>e())}function la(e){return ai(e)}function mU(e){return String(e||"").normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim()}function pU(e){const t=mU(e);return["client","clients","cliente","clientes"].includes(t)?"client":["brand","brands","marca","marcas"].includes(t)?"brand":["country","countries","pais","paises","bu","business_unit","business unit"].includes(t)?"country":["status","estatus","estado","estados"].includes(t)?"status":["country_manager","country manager","cm","bu_cm","bu cm","manager","managers"].includes(t)?"country_manager":t}function gU(e){return fi(String(e.label||e.value||""))}function vU(e){const t=[],a=[],s=[],o=[],c={...Km};for(const u of e){if(u.is_active===!1)continue;const d=pU(u.category),h=gU(u),p=fi(String(u.value||""));if(!(!h&&!p)&&(d==="client"&&t.push(h||p),d==="brand"&&a.push(h||p),d==="country"&&s.push(h||p),d==="status"&&o.push(h||p),d==="country_manager"&&p)){const v=h||p;v&&v!==p&&(c[p]=v)}}return{clientes:t.length?la(t):la(si.clientes),marcas:a.length?la(a):la(si.marcas),bus:s.length?la(s):la(si.bus),buCm:c,status:o.length?la(o):la(si.status)}}function yU(e){Jm=e,rm()}async function am(){Ho=!0,yU(null),rm();try{const{data:e,error:t}=await jt.from("tablero_cdc_app_lists").select("category, value, label, sort_order, is_active").eq("is_active",!0).order("category",{ascending:!0}).order("sort_order",{ascending:!0}).order("label",{ascending:!0});if(t)throw t;nm=vU(e||[]),lE=!0}catch(e){console.error("Error cargando listas desde Supabase:",e),Jm=e instanceof Error?e.message:"No se pudieron cargar los desplegables desde Supabase.",nm=si}finally{Ho=!1,rm()}}function bU(){Ya&&clearTimeout(Ya),Ya=setTimeout(()=>{Ya=null,Ho||am()},350)}function wU(){No||(No=jt.channel("tablero-cdc-app-lists").on("postgres_changes",{event:"*",schema:"public",table:"tablero_cdc_app_lists"},()=>bU()).subscribe(e=>{(e==="CHANNEL_ERROR"||e==="TIMED_OUT")&&console.warn("Supabase Realtime no pudo suscribirse a tablero_cdc_app_lists:",e)}))}function SU(){Ya&&(clearTimeout(Ya),Ya=null),No&&(jt.removeChannel(No),No=null)}function _U(){const[,e]=y.useState(0);return y.useEffect(()=>{const t=()=>e(a=>a+1);return Fc.push(t),zc+=1,wU(),!lE&&!Ho&&am(),()=>{Fc=Fc.filter(a=>a!==t),zc=Math.max(0,zc-1),zc===0&&SU()}},[]),{lists:nm,loading:Ho,error:Jm,refresh:am}}const cE="blue",uE="Activo",xU="gmarrero@gomezleemarketing.com";let Wc=[],Qm=[],qo=!1,dE=!1,Zm=null,Oo=null,Fa=null,Pc=0;function sm(){Wc.forEach(e=>e())}function O0(e,t=""){return typeof e=="string"?e:t}function EU(e,t){return typeof e=="number"&&Number.isFinite(e)?e:t}function TU(e){return!e||e===uE?"":e}function CU(e){return e&&e.trim()?e:uE}function RU(e){const t=e.extra_data||{},a=e.project_links||[],s=a.filter(d=>d.link_type==="proposal").map(d=>d.url||"").filter(Boolean),o=a.filter(d=>d.link_type==="final_art").map(d=>d.url||"").filter(Boolean),c=e.created_at?new Date(e.created_at).getTime():Date.now(),u=Number.isFinite(c)?new Date(c):new Date;return{id:e.id,nombre:e.title||"",color:O0(t.color,cE),cliente:e.client||"",bu:e.country||"",cm:e.country_manager||"",marca:e.brand||"",solicitante:e.requested_by||"",comentarios:e.description||"",briefLink:e.brief_link||"",propuestaLinks:s,afLinks:o,status:TU(e.status),monto:e.internal_amount==null?null:Number(e.internal_amount),mes:O0(t.mes,"")||u.toLocaleString("es-DO",{month:"long"}),anio:EU(t.anio,u.getFullYear()),createdAt:Number.isFinite(c)?c:Date.now()}}async function fE(){const{data:e,error:t}=await jt.auth.getUser();if(t||!e.user)throw new Error("No hay una sesión activa de Supabase.");return e.user}async function hE(){return(await fE()).id}async function mE(){var t;return((t=(await fE()).email)==null?void 0:t.toLowerCase())===xU}function pE(e){return{title:e.nombre,client:e.cliente,brand:e.marca,country:e.bu,requested_by:e.solicitante,country_manager:e.cm,description:e.comentarios,status:CU(e.status),internal_amount:e.monto??null,brief_link:e.briefLink,extra_data:{color:e.color??cE,mes:e.mes,anio:e.anio}}}function AU(e,t){const a=t.propuestaLinks.map(o=>o.trim()).filter(Boolean).map((o,c)=>({project_id:e,link_type:"proposal",url:o,label:`Propuesta ${c+1}`})),s=t.afLinks.map(o=>o.trim()).filter(Boolean).map((o,c)=>({project_id:e,link_type:"final_art",url:o,label:`AF ${c+1}`}));return[...a,...s]}function Go(e){Zm=e,sm()}function NU(){return"https://agenteit.digitalcompass.agency/webhook/tablero-cdc-sync-proyecto".trim()||""}async function gE(e,t){const a=NU();if(!a)return console.info("No se configuró VITE_WEBHOOK_URL; se omite sincronización con Google Sheet."),{sheetSyncStatus:"skipped",sheetSyncMessage:"Proyecto guardado. No hay webhook configurado para sincronizar el Sheet."};const s=new AbortController,o=window.setTimeout(()=>s.abort(),15e3);try{const c=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_id:e,action:t,source:"tablero-cdc",sent_at:new Date().toISOString()}),signal:s.signal});if(!c.ok){const u=await c.text().catch(()=>""),d=u||`${c.status} ${c.statusText}`.trim();return console.warn("El proyecto se guardó en Supabase, pero n8n no respondió correctamente.",{status:c.status,statusText:c.statusText,errorText:u}),{sheetSyncStatus:"failed",sheetSyncMessage:`Proyecto guardado, pero el Sheet no se pudo sincronizar: ${d}`}}return{sheetSyncStatus:"synced",sheetSyncMessage:"Proyecto guardado y sincronizado con el Google Sheet."}}catch(c){const u=c instanceof DOMException&&c.name==="AbortError";return console.warn("El proyecto se guardó en Supabase, pero no se pudo sincronizar con Google Sheet.",c),{sheetSyncStatus:u?"timeout":"failed",sheetSyncMessage:u?"Proyecto guardado, pero n8n tardó demasiado en responder. Revisa el workflow si el Sheet no se actualizó.":"Proyecto guardado, pero no se pudo sincronizar con Google Sheet."}}finally{window.clearTimeout(o)}}function k0(){Fa&&clearTimeout(Fa),Fa=setTimeout(()=>{Fa=null,qo||Vo()},350)}function OU(){Oo||(Oo=jt.channel("tablero-cdc-projects").on("postgres_changes",{event:"*",schema:"public",table:"tablero_cdc_projects"},()=>k0()).on("postgres_changes",{event:"*",schema:"public",table:"tablero_cdc_project_links"},()=>k0()).subscribe(e=>{(e==="CHANNEL_ERROR"||e==="TIMED_OUT")&&console.warn("Supabase Realtime no pudo suscribirse a proyectos:",e)}))}function kU(){Fa&&(clearTimeout(Fa),Fa=null),Oo&&(jt.removeChannel(Oo),Oo=null)}async function vE(e,t){const{error:a}=await jt.from("tablero_cdc_project_links").delete().eq("project_id",e);if(a)throw a;const s=AU(e,t);if(s.length===0)return;const{error:o}=await jt.from("tablero_cdc_project_links").insert(s);if(o)throw o}async function Vo(){qo=!0,Go(null),sm();try{const t=`
|
||
id,
|
||
title,
|
||
client,
|
||
brand,
|
||
country,
|
||
requested_by,
|
||
country_manager,
|
||
description,
|
||
status,
|
||
${await mE()?"internal_amount,":""}
|
||
brief_link,
|
||
created_at,
|
||
extra_data,
|
||
project_links:tablero_cdc_project_links (
|
||
id,
|
||
link_type,
|
||
url,
|
||
label
|
||
)
|
||
`,{data:a,error:s}=await jt.from("tablero_cdc_projects").select(t).order("created_at",{ascending:!1});if(s)throw s;Qm=(a||[]).map(o=>RU(o)),dE=!0}catch(e){console.error("Error cargando proyectos desde Supabase:",e),Zm=e instanceof Error?e.message:"No se pudieron cargar los proyectos desde Supabase."}finally{qo=!1,sm()}}async function jU(e){Go(null);const t=await hE(),a={...pE(e),created_by:t,updated_by:t},{data:s,error:o}=await jt.from("tablero_cdc_projects").insert(a).select("id").single();if(o)throw Go(o.message),o;await vE(s.id,e);const c=await gE(s.id,"create");return await Vo(),{projectId:s.id,...c}}async function MU(e,t){Go(null);const a=await hE(),s=await mE(),o=Qm.find(v=>v.id===e),c=o?{...o,...t}:{...t},u=pE(c),d=s?{...u,updated_by:a}:{title:u.title,client:u.client,brand:u.brand,country:u.country,requested_by:u.requested_by,country_manager:u.country_manager,description:u.description,status:u.status,brief_link:u.brief_link,extra_data:u.extra_data,updated_by:a},{error:h}=await jt.from("tablero_cdc_projects").update(d).eq("id",e);if(h)throw Go(h.message),h;await vE(e,c);const p=await gE(e,"update");return await Vo(),{projectId:e,...p}}function yE(){const[,e]=y.useState(0);return y.useEffect(()=>{const t=()=>e(a=>a+1);return Wc.push(t),Pc+=1,OU(),!dE&&!qo&&Vo(),()=>{Wc=Wc.filter(a=>a!==t),Pc=Math.max(0,Pc-1),Pc===0&&kU()}},[]),{projects:Qm,loading:qo,error:Zm,refresh:Vo,add:jU,update:MU}}function DU(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css",t.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}const LU=e=>{switch(e){case"success":return PU;case"info":return IU;case"warning":return BU;case"error":return $U;default:return null}},UU=Array(12).fill(0),zU=({visible:e,className:t})=>re.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},re.createElement("div",{className:"sonner-spinner"},UU.map((a,s)=>re.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),PU=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.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"})),BU=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},re.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"})),IU=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.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"})),$U=re.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},re.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"})),HU=re.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"},re.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),re.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),qU=()=>{const[e,t]=re.useState(document.hidden);return re.useEffect(()=>{const a=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",a),()=>window.removeEventListener("visibilitychange",a)},[]),e};let im=1;class GU{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const a=this.subscribers.indexOf(t);this.subscribers.splice(a,1)}),this.publish=t=>{this.subscribers.forEach(a=>a(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var a;const{message:s,...o}=t,c=typeof(t==null?void 0:t.id)=="number"||((a=t.id)==null?void 0:a.length)>0?t.id:im++,u=this.toasts.find(h=>h.id===c),d=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),u?this.toasts=this.toasts.map(h=>h.id===c?(this.publish({...h,...t,id:c,title:s}),{...h,...t,id:c,dismissible:d,title:s}):h):this.addToast({title:s,...o,dismissible:d,id:c}),c},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(a=>a({id:t,dismiss:!0})))):this.toasts.forEach(a=>{this.subscribers.forEach(s=>s({id:a.id,dismiss:!0}))}),t),this.message=(t,a)=>this.create({...a,message:t}),this.error=(t,a)=>this.create({...a,message:t,type:"error"}),this.success=(t,a)=>this.create({...a,type:"success",message:t}),this.info=(t,a)=>this.create({...a,type:"info",message:t}),this.warning=(t,a)=>this.create({...a,type:"warning",message:t}),this.loading=(t,a)=>this.create({...a,type:"loading",message:t}),this.promise=(t,a)=>{if(!a)return;let s;a.loading!==void 0&&(s=this.create({...a,promise:t,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));const o=Promise.resolve(t instanceof Function?t():t);let c=s!==void 0,u;const d=o.then(async p=>{if(u=["resolve",p],re.isValidElement(p))c=!1,this.create({id:s,type:"default",message:p});else if(KU(p)&&!p.ok){c=!1;const g=typeof a.error=="function"?await a.error(`HTTP error! status: ${p.status}`):a.error,S=typeof a.description=="function"?await a.description(`HTTP error! status: ${p.status}`):a.description,E=typeof g=="object"&&!re.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:S,...E})}else if(p instanceof Error){c=!1;const g=typeof a.error=="function"?await a.error(p):a.error,S=typeof a.description=="function"?await a.description(p):a.description,E=typeof g=="object"&&!re.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:S,...E})}else if(a.success!==void 0){c=!1;const g=typeof a.success=="function"?await a.success(p):a.success,S=typeof a.description=="function"?await a.description(p):a.description,E=typeof g=="object"&&!re.isValidElement(g)?g:{message:g};this.create({id:s,type:"success",description:S,...E})}}).catch(async p=>{if(u=["reject",p],a.error!==void 0){c=!1;const v=typeof a.error=="function"?await a.error(p):a.error,g=typeof a.description=="function"?await a.description(p):a.description,_=typeof v=="object"&&!re.isValidElement(v)?v:{message:v};this.create({id:s,type:"error",description:g,..._})}}).finally(()=>{c&&(this.dismiss(s),s=void 0),a.finally==null||a.finally.call(a)}),h=()=>new Promise((p,v)=>d.then(()=>u[0]==="reject"?v(u[1]):p(u[1])).catch(v));return typeof s!="string"&&typeof s!="number"?{unwrap:h}:Object.assign(s,{unwrap:h})},this.custom=(t,a)=>{const s=(a==null?void 0:a.id)||im++;return this.create({jsx:t(s),id:s,...a}),s},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Wt=new GU,VU=(e,t)=>{const a=(t==null?void 0:t.id)||im++;return Wt.addToast({title:e,...t,id:a}),a},KU=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",YU=VU,FU=()=>Wt.toasts,WU=()=>Wt.getActiveToasts(),Bc=Object.assign(YU,{success:Wt.success,info:Wt.info,warning:Wt.warning,error:Wt.error,custom:Wt.custom,message:Wt.message,promise:Wt.promise,dismiss:Wt.dismiss,loading:Wt.loading},{getHistory:FU,getToasts:WU});DU("[data-sonner-toaster][dir=ltr],html[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%)}[data-sonner-toaster][dir=rtl],html[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%)}[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:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[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);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[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 rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [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)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [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;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [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);background:var(--normal-bg);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-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[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}[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}[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,0)) translateX(var(--swipe-amount-x,0));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{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{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{from{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-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--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-sonner-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-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-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, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--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-sonner-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-sonner-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]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[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]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[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]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[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]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[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:first-child{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)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{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 Ic(e){return e.label!==void 0}const XU=3,JU="24px",QU="16px",j0=4e3,ZU=356,e5=14,t5=45,n5=200;function Yn(...e){return e.filter(Boolean).join(" ")}function r5(e){const[t,a]=e.split("-"),s=[];return t&&s.push(t),a&&s.push(a),s}const a5=e=>{var t,a,s,o,c,u,d,h,p;const{invert:v,toast:g,unstyled:S,interacting:_,setHeights:E,visibleToasts:x,heights:R,index:C,toasts:N,expanded:A,removeToast:D,defaultRichColors:V,closeButton:q,style:U,cancelButtonStyle:I,actionButtonStyle:ae,className:me="",descriptionClassName:ve="",duration:de,position:pe,gap:J,expandByDefault:ie,classNames:O,icons:$,closeButtonAriaLabel:K="Close toast"}=e,[Z,W]=re.useState(null),[j,G]=re.useState(null),[F,ee]=re.useState(!1),[ne,se]=re.useState(!1),[te,ce]=re.useState(!1),[le,Ce]=re.useState(!1),[Re,Ee]=re.useState(!1),[rt,Ke]=re.useState(0),[En,cn]=re.useState(0),Xt=re.useRef(g.duration||de||j0),ya=re.useRef(null),vt=re.useRef(null),wi=C===0,Si=C+1<=x,Mt=g.type,Dr=g.dismissible!==!1,Dt=g.className||"",Pu=g.descriptionClassName||"",ba=re.useMemo(()=>R.findIndex(xe=>xe.toastId===g.id)||0,[R,g.id]),nl=re.useMemo(()=>{var xe;return(xe=g.closeButton)!=null?xe:q},[g.closeButton,q]),wa=re.useMemo(()=>g.duration||de||j0,[g.duration,de]),_i=re.useRef(0),nr=re.useRef(0),rl=re.useRef(0),Lr=re.useRef(null),[Sa,Lt]=pe.split("-"),Tn=re.useMemo(()=>R.reduce((xe,Ze,yt)=>yt>=ba?xe:xe+Ze.height,0),[R,ba]),Nt=qU(),Bu=g.invert||v,xi=Mt==="loading";nr.current=re.useMemo(()=>ba*J+Tn,[ba,Tn]),re.useEffect(()=>{Xt.current=wa},[wa]),re.useEffect(()=>{ee(!0)},[]),re.useEffect(()=>{const xe=vt.current;if(xe){const Ze=xe.getBoundingClientRect().height;return cn(Ze),E(yt=>[{toastId:g.id,height:Ze,position:g.position},...yt]),()=>E(yt=>yt.filter(Ot=>Ot.toastId!==g.id))}},[E,g.id]),re.useLayoutEffect(()=>{if(!F)return;const xe=vt.current,Ze=xe.style.height;xe.style.height="auto";const yt=xe.getBoundingClientRect().height;xe.style.height=Ze,cn(yt),E(Ot=>Ot.find(tt=>tt.toastId===g.id)?Ot.map(tt=>tt.toastId===g.id?{...tt,height:yt}:tt):[{toastId:g.id,height:yt,position:g.position},...Ot])},[F,g.title,g.description,E,g.id,g.jsx,g.action,g.cancel]);const Bn=re.useCallback(()=>{se(!0),Ke(nr.current),E(xe=>xe.filter(Ze=>Ze.toastId!==g.id)),setTimeout(()=>{D(g)},n5)},[g,D,E,nr]);re.useEffect(()=>{if(g.promise&&Mt==="loading"||g.duration===1/0||g.type==="loading")return;let xe;return A||_||Nt?(()=>{if(rl.current<_i.current){const Ot=new Date().getTime()-_i.current;Xt.current=Xt.current-Ot}rl.current=new Date().getTime()})():(()=>{Xt.current!==1/0&&(_i.current=new Date().getTime(),xe=setTimeout(()=>{g.onAutoClose==null||g.onAutoClose.call(g,g),Bn()},Xt.current))})(),()=>clearTimeout(xe)},[A,_,g,Mt,Nt,Bn]),re.useEffect(()=>{g.delete&&(Bn(),g.onDismiss==null||g.onDismiss.call(g,g))},[Bn,g.delete]);function rs(){var xe;if($!=null&&$.loading){var Ze;return re.createElement("div",{className:Yn(O==null?void 0:O.loader,g==null||(Ze=g.classNames)==null?void 0:Ze.loader,"sonner-loader"),"data-visible":Mt==="loading"},$.loading)}return re.createElement(zU,{className:Yn(O==null?void 0:O.loader,g==null||(xe=g.classNames)==null?void 0:xe.loader),visible:Mt==="loading"})}const as=g.icon||($==null?void 0:$[Mt])||LU(Mt);var _a,In;return re.createElement("li",{tabIndex:0,ref:vt,className:Yn(me,Dt,O==null?void 0:O.toast,g==null||(t=g.classNames)==null?void 0:t.toast,O==null?void 0:O.default,O==null?void 0:O[Mt],g==null||(a=g.classNames)==null?void 0:a[Mt]),"data-sonner-toast":"","data-rich-colors":(_a=g.richColors)!=null?_a:V,"data-styled":!(g.jsx||g.unstyled||S),"data-mounted":F,"data-promise":!!g.promise,"data-swiped":Re,"data-removed":ne,"data-visible":Si,"data-y-position":Sa,"data-x-position":Lt,"data-index":C,"data-front":wi,"data-swiping":te,"data-dismissible":Dr,"data-type":Mt,"data-invert":Bu,"data-swipe-out":le,"data-swipe-direction":j,"data-expanded":!!(A||ie&&F),"data-testid":g.testId,style:{"--index":C,"--toasts-before":C,"--z-index":N.length-C,"--offset":`${ne?rt:nr.current}px`,"--initial-height":ie?"auto":`${En}px`,...U,...g.style},onDragEnd:()=>{ce(!1),W(null),Lr.current=null},onPointerDown:xe=>{xe.button!==2&&(xi||!Dr||(ya.current=new Date,Ke(nr.current),xe.target.setPointerCapture(xe.pointerId),xe.target.tagName!=="BUTTON"&&(ce(!0),Lr.current={x:xe.clientX,y:xe.clientY})))},onPointerUp:()=>{var xe,Ze,yt;if(le||!Dr)return;Lr.current=null;const Ot=Number(((xe=vt.current)==null?void 0:xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Ur=Number(((Ze=vt.current)==null?void 0:Ze.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),tt=new Date().getTime()-((yt=ya.current)==null?void 0:yt.getTime()),Pt=Z==="x"?Ot:Ur,xa=Math.abs(Pt)/tt;if(Math.abs(Pt)>=t5||xa>.11){Ke(nr.current),g.onDismiss==null||g.onDismiss.call(g,g),G(Z==="x"?Ot>0?"right":"left":Ur>0?"down":"up"),Bn(),Ce(!0);return}else{var Bt,It;(Bt=vt.current)==null||Bt.style.setProperty("--swipe-amount-x","0px"),(It=vt.current)==null||It.style.setProperty("--swipe-amount-y","0px")}Ee(!1),ce(!1),W(null)},onPointerMove:xe=>{var Ze,yt,Ot;if(!Lr.current||!Dr||((Ze=window.getSelection())==null?void 0:Ze.toString().length)>0)return;const tt=xe.clientY-Lr.current.y,Pt=xe.clientX-Lr.current.x;var xa;const Bt=(xa=e.swipeDirections)!=null?xa:r5(pe);!Z&&(Math.abs(Pt)>1||Math.abs(tt)>1)&&W(Math.abs(Pt)>Math.abs(tt)?"x":"y");let It={x:0,y:0};const ss=Cn=>1/(1.5+Math.abs(Cn)/20);if(Z==="y"){if(Bt.includes("top")||Bt.includes("bottom"))if(Bt.includes("top")&&tt<0||Bt.includes("bottom")&&tt>0)It.y=tt;else{const Cn=tt*ss(tt);It.y=Math.abs(Cn)<Math.abs(tt)?Cn:tt}}else if(Z==="x"&&(Bt.includes("left")||Bt.includes("right")))if(Bt.includes("left")&&Pt<0||Bt.includes("right")&&Pt>0)It.x=Pt;else{const Cn=Pt*ss(Pt);It.x=Math.abs(Cn)<Math.abs(Pt)?Cn:Pt}(Math.abs(It.x)>0||Math.abs(It.y)>0)&&Ee(!0),(yt=vt.current)==null||yt.style.setProperty("--swipe-amount-x",`${It.x}px`),(Ot=vt.current)==null||Ot.style.setProperty("--swipe-amount-y",`${It.y}px`)}},nl&&!g.jsx&&Mt!=="loading"?re.createElement("button",{"aria-label":K,"data-disabled":xi,"data-close-button":!0,onClick:xi||!Dr?()=>{}:()=>{Bn(),g.onDismiss==null||g.onDismiss.call(g,g)},className:Yn(O==null?void 0:O.closeButton,g==null||(s=g.classNames)==null?void 0:s.closeButton)},(In=$==null?void 0:$.close)!=null?In:HU):null,(Mt||g.icon||g.promise)&&g.icon!==null&&(($==null?void 0:$[Mt])!==null||g.icon)?re.createElement("div",{"data-icon":"",className:Yn(O==null?void 0:O.icon,g==null||(o=g.classNames)==null?void 0:o.icon)},g.promise||g.type==="loading"&&!g.icon?g.icon||rs():null,g.type!=="loading"?as:null):null,re.createElement("div",{"data-content":"",className:Yn(O==null?void 0:O.content,g==null||(c=g.classNames)==null?void 0:c.content)},re.createElement("div",{"data-title":"",className:Yn(O==null?void 0:O.title,g==null||(u=g.classNames)==null?void 0:u.title)},g.jsx?g.jsx:typeof g.title=="function"?g.title():g.title),g.description?re.createElement("div",{"data-description":"",className:Yn(ve,Pu,O==null?void 0:O.description,g==null||(d=g.classNames)==null?void 0:d.description)},typeof g.description=="function"?g.description():g.description):null),re.isValidElement(g.cancel)?g.cancel:g.cancel&&Ic(g.cancel)?re.createElement("button",{"data-button":!0,"data-cancel":!0,style:g.cancelButtonStyle||I,onClick:xe=>{Ic(g.cancel)&&Dr&&(g.cancel.onClick==null||g.cancel.onClick.call(g.cancel,xe),Bn())},className:Yn(O==null?void 0:O.cancelButton,g==null||(h=g.classNames)==null?void 0:h.cancelButton)},g.cancel.label):null,re.isValidElement(g.action)?g.action:g.action&&Ic(g.action)?re.createElement("button",{"data-button":!0,"data-action":!0,style:g.actionButtonStyle||ae,onClick:xe=>{Ic(g.action)&&(g.action.onClick==null||g.action.onClick.call(g.action,xe),!xe.defaultPrevented&&Bn())},className:Yn(O==null?void 0:O.actionButton,g==null||(p=g.classNames)==null?void 0:p.actionButton)},g.action.label):null)};function M0(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function s5(e,t){const a={};return[e,t].forEach((s,o)=>{const c=o===1,u=c?"--mobile-offset":"--offset",d=c?QU:JU;function h(p){["top","right","bottom","left"].forEach(v=>{a[`${u}-${v}`]=typeof p=="number"?`${p}px`:p})}typeof s=="number"||typeof s=="string"?h(s):typeof s=="object"?["top","right","bottom","left"].forEach(p=>{s[p]===void 0?a[`${u}-${p}`]=d:a[`${u}-${p}`]=typeof s[p]=="number"?`${s[p]}px`:s[p]}):h(d)}),a}const i5=re.forwardRef(function(t,a){const{id:s,invert:o,position:c="bottom-right",hotkey:u=["altKey","KeyT"],expand:d,closeButton:h,className:p,offset:v,mobileOffset:g,theme:S="light",richColors:_,duration:E,style:x,visibleToasts:R=XU,toastOptions:C,dir:N=M0(),gap:A=e5,icons:D,containerAriaLabel:V="Notifications"}=t,[q,U]=re.useState([]),I=re.useMemo(()=>s?q.filter(F=>F.toasterId===s):q.filter(F=>!F.toasterId),[q,s]),ae=re.useMemo(()=>Array.from(new Set([c].concat(I.filter(F=>F.position).map(F=>F.position)))),[I,c]),[me,ve]=re.useState([]),[de,pe]=re.useState(!1),[J,ie]=re.useState(!1),[O,$]=re.useState(S!=="system"?S:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),K=re.useRef(null),Z=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=re.useRef(null),j=re.useRef(!1),G=re.useCallback(F=>{U(ee=>{var ne;return(ne=ee.find(se=>se.id===F.id))!=null&&ne.delete||Wt.dismiss(F.id),ee.filter(({id:se})=>se!==F.id)})},[]);return re.useEffect(()=>Wt.subscribe(F=>{if(F.dismiss){requestAnimationFrame(()=>{U(ee=>ee.map(ne=>ne.id===F.id?{...ne,delete:!0}:ne))});return}setTimeout(()=>{aw.flushSync(()=>{U(ee=>{const ne=ee.findIndex(se=>se.id===F.id);return ne!==-1?[...ee.slice(0,ne),{...ee[ne],...F},...ee.slice(ne+1)]:[F,...ee]})})})}),[q]),re.useEffect(()=>{if(S!=="system"){$(S);return}if(S==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;const F=window.matchMedia("(prefers-color-scheme: dark)");try{F.addEventListener("change",({matches:ee})=>{$(ee?"dark":"light")})}catch{F.addListener(({matches:ne})=>{try{$(ne?"dark":"light")}catch(se){console.error(se)}})}},[S]),re.useEffect(()=>{q.length<=1&&pe(!1)},[q]),re.useEffect(()=>{const F=ee=>{var ne;if(u.every(ce=>ee[ce]||ee.code===ce)){var te;pe(!0),(te=K.current)==null||te.focus()}ee.code==="Escape"&&(document.activeElement===K.current||(ne=K.current)!=null&&ne.contains(document.activeElement))&&pe(!1)};return document.addEventListener("keydown",F),()=>document.removeEventListener("keydown",F)},[u]),re.useEffect(()=>{if(K.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,j.current=!1)}},[K.current]),re.createElement("section",{ref:a,"aria-label":`${V} ${Z}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},ae.map((F,ee)=>{var ne;const[se,te]=F.split("-");return I.length?re.createElement("ol",{key:F,dir:N==="auto"?M0():N,tabIndex:-1,ref:K,className:p,"data-sonner-toaster":!0,"data-sonner-theme":O,"data-y-position":se,"data-x-position":te,style:{"--front-toast-height":`${((ne=me[0])==null?void 0:ne.height)||0}px`,"--width":`${ZU}px`,"--gap":`${A}px`,...x,...s5(v,g)},onBlur:ce=>{j.current&&!ce.currentTarget.contains(ce.relatedTarget)&&(j.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:ce=>{ce.target instanceof HTMLElement&&ce.target.dataset.dismissible==="false"||j.current||(j.current=!0,W.current=ce.relatedTarget)},onMouseEnter:()=>pe(!0),onMouseMove:()=>pe(!0),onMouseLeave:()=>{J||pe(!1)},onDragEnd:()=>pe(!1),onPointerDown:ce=>{ce.target instanceof HTMLElement&&ce.target.dataset.dismissible==="false"||ie(!0)},onPointerUp:()=>ie(!1)},I.filter(ce=>!ce.position&&ee===0||ce.position===F).map((ce,le)=>{var Ce,Re;return re.createElement(a5,{key:ce.id,icons:D,index:le,toast:ce,defaultRichColors:_,duration:(Ce=C==null?void 0:C.duration)!=null?Ce:E,className:C==null?void 0:C.className,descriptionClassName:C==null?void 0:C.descriptionClassName,invert:o,visibleToasts:R,closeButton:(Re=C==null?void 0:C.closeButton)!=null?Re:h,interacting:J,position:F,style:C==null?void 0:C.style,unstyled:C==null?void 0:C.unstyled,classNames:C==null?void 0:C.classNames,cancelButtonStyle:C==null?void 0:C.cancelButtonStyle,actionButtonStyle:C==null?void 0:C.actionButtonStyle,closeButtonAriaLabel:C==null?void 0:C.closeButtonAriaLabel,removeToast:G,toasts:I.filter(Ee=>Ee.position==ce.position),heights:me.filter(Ee=>Ee.position==ce.position),setHeights:ve,expandByDefault:d,gap:A,expanded:de,swipeDirections:t.swipeDirections})})):null}))}),D0=()=>{const e=new Date;return{nombre:"",color:"blue",cliente:"",bu:"",cm:"",marca:"",solicitante:"",comentarios:"",briefLink:"",propuestaLinks:[],afLinks:[],status:"",monto:null,mes:XL[e.getMonth()],anio:e.getFullYear()}};function o5({open:e,onOpenChange:t,project:a}){const{add:s,update:o}=yE(),{lists:c,loading:u,error:d,refresh:h}=_U(),{isGerardo:p}=Jo(),v=!!a,[g,S]=y.useState(D0()),[_,E]=y.useState(!1),[x,R]=y.useState(null),[C,N]=y.useState(null),A=ai(Uc(c.clientes,g.cliente)),D=ai(Uc(c.marcas,g.marca)),V=ai(Uc(c.bus,g.bu)),q=ai(Uc(c.status,g.status));y.useEffect(()=>{if(N(null),R(null),a){const{id:J,createdAt:ie,...O}=a;S({...O,bu:fi(O.bu)})}else e&&S(D0())},[a,e]);const U=(J,ie)=>S(O=>({...O,[J]:ie})),I=J=>{const ie=c.buCm[J];if(ie)return ie;const O=di(J),$=Object.entries(c.buCm).find(([K])=>di(K)===O);return($==null?void 0:$[1])??""},ae=J=>{const ie=fi(J);S(O=>({...O,bu:ie,cm:I(ie)}))},me=g.nombre.trim()&&g.cliente&&g.bu&&g.marca&&g.solicitante.trim(),ve=J=>{if(J.sheetSyncStatus==="synced"){Bc.success(v?"Proyecto actualizado":"Proyecto creado",{description:"Se guardó y se sincronizó con el Google Sheet."});return}if(J.sheetSyncStatus==="skipped"){Bc.success(v?"Proyecto actualizado":"Proyecto creado",{description:"Se guardó. La sincronización con Google Sheet no está configurada."});return}Bc.warning("Proyecto guardado con aviso",{description:J.sheetSyncMessage})},de=async()=>{if(!me||_)return;const J=p?g:{...g,status:(a==null?void 0:a.status)??"",monto:(a==null?void 0:a.monto)??null};try{E(!0),N(null),R("Guardando y sincronizando con Google Sheet…");const ie=v&&a?await o(a.id,J):await s({...J,id:crypto.randomUUID(),createdAt:Date.now()});ve(ie),t(!1)}catch(ie){console.error("Error guardando proyecto:",ie);const O=ie instanceof Error?ie.message:"No se pudo guardar el proyecto. Revisa los permisos o intenta de nuevo.";N(O),Bc.error("No se pudo guardar el proyecto",{description:O})}finally{E(!1),R(null)}},pe=!!g.status;return b.jsx(v3,{open:e,onOpenChange:t,children:b.jsxs(hx,{className:"max-w-3xl max-h-[92vh] overflow-y-auto p-0 gap-0",children:[b.jsx("div",{className:"h-2.5 w-full rounded-t-lg",style:{backgroundColor:K_(g.color)}}),b.jsxs("div",{className:"px-7 pt-6 pb-7",children:[b.jsx(mx,{className:"space-y-3",children:b.jsx("div",{className:"flex items-start justify-between gap-4",children:b.jsxs("div",{className:"flex-1",children:[b.jsx(gx,{className:"text-2xl tracking-tight",children:v?g.nombre||"Sin título":"Nuevo proyecto"}),b.jsxs(vx,{className:"mt-1 flex items-center gap-2 text-xs",children:[b.jsx(jO,{className:"w-3.5 h-3.5"}),g.mes," · ",g.anio,pe&&b.jsx(V_,{variant:"secondary",className:"ml-2",children:"Cerrado"})]})]})})}),b.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5 mt-6",children:[b.jsxs("div",{className:"md:col-span-2 space-y-1.5",children:[b.jsxs(Sn,{children:["Nombre del proyecto ",b.jsx("span",{className:"text-destructive",children:"*"})]}),b.jsx(Jn,{value:g.nombre,onChange:J=>U("nombre",J.target.value),placeholder:"Ej: Promoción Día de las Madres",className:"h-10"})]}),b.jsxs("div",{className:"md:col-span-2 space-y-2",children:[b.jsx(Sn,{children:"Etiqueta de color"}),b.jsx(hU,{value:g.color,onChange:J=>U("color",J)})]}),b.jsx(Yc,{className:"md:col-span-2 my-1"}),(u||d)&&b.jsxs("div",{className:Le("md:col-span-2 flex items-center justify-between gap-3 rounded-xl border px-3 py-2 text-xs",d?"border-amber-300/50 bg-amber-50 text-amber-900":"border-border bg-muted/30 text-muted-foreground"),children:[b.jsx("span",{className:"flex items-center gap-2",children:u?b.jsxs(b.Fragment,{children:[b.jsx(dh,{className:"h-3.5 w-3.5 animate-spin"}),"Cargando listas…"]}):b.jsxs(b.Fragment,{children:[b.jsx($h,{className:"h-3.5 w-3.5"}),"No se pudieron cargar las listas. Se usaron opciones locales."]})}),d&&b.jsx("button",{type:"button",onClick:()=>void h(),className:"font-medium text-amber-950 underline-offset-4 hover:underline",children:"Reintentar"})]}),b.jsxs("div",{className:"space-y-1.5",children:[b.jsxs(Sn,{children:["Cliente ",b.jsx("span",{className:"text-destructive",children:"*"})]}),b.jsxs(Dc,{value:g.cliente,onValueChange:J=>U("cliente",J),children:[b.jsx(Eo,{className:"h-10",children:b.jsx(Lc,{placeholder:"Seleccionar…"})}),b.jsx(To,{children:A.map(J=>b.jsx(ni,{value:J,children:J},J))})]})]}),b.jsxs("div",{className:"space-y-1.5",children:[b.jsxs(Sn,{children:["Marca ",b.jsx("span",{className:"text-destructive",children:"*"})]}),b.jsxs(Dc,{value:g.marca,onValueChange:J=>U("marca",J),children:[b.jsx(Eo,{className:"h-10",children:b.jsx(Lc,{placeholder:"Seleccionar…"})}),b.jsx(To,{children:D.map(J=>b.jsx(ni,{value:J,children:J},J))})]})]}),b.jsxs("div",{className:"space-y-1.5",children:[b.jsxs(Sn,{children:["BU Solicita (País) ",b.jsx("span",{className:"text-destructive",children:"*"})]}),b.jsxs(Dc,{value:g.bu,onValueChange:ae,children:[b.jsx(Eo,{className:"h-10",children:b.jsx(Lc,{placeholder:"Seleccionar…"})}),b.jsx(To,{children:V.map(J=>b.jsx(ni,{value:J,children:J},J))})]})]}),b.jsxs("div",{className:"space-y-1.5",children:[b.jsxs(Sn,{className:"flex items-center gap-1.5",children:["Country Manager ",b.jsx("span",{className:"text-xs text-muted-foreground",children:"(automático)"})]}),b.jsx(Jn,{value:g.cm,readOnly:!0,disabled:!0,className:"h-10 bg-muted/50",placeholder:"—"})]}),b.jsxs("div",{className:"space-y-1.5",children:[b.jsxs(Sn,{children:["Solicitado por ",b.jsx("span",{className:"text-destructive",children:"*"})]}),b.jsx(Jn,{value:g.solicitante,onChange:J=>U("solicitante",J.target.value),placeholder:"Nombre de quien solicita",className:"h-10"})]}),b.jsxs("div",{className:"md:col-span-2 space-y-1.5",children:[b.jsx(Sn,{children:"Comentarios"}),b.jsx(wx,{value:g.comentarios,onChange:J=>U("comentarios",J.target.value),placeholder:"Notas adicionales del proyecto…",rows:2})]}),b.jsx(Yc,{className:"md:col-span-2 my-1"}),b.jsxs("div",{className:"md:col-span-2 space-y-1.5",children:[b.jsxs(Sn,{children:["Link del Brief"," ",b.jsx("span",{className:"text-xs text-muted-foreground font-normal",children:"(carpeta de Fulgencio)"})]}),b.jsx(Jn,{value:g.briefLink,onChange:J=>U("briefLink",J.target.value),placeholder:"https://drive.google.com/…",className:"h-10"})]}),b.jsx("div",{className:"md:col-span-2",children:b.jsx(N0,{label:"Links de Propuestas",links:g.propuestaLinks,onChange:J=>U("propuestaLinks",J),emptyText:"Aún no hay propuestas. Pega tantos links como necesites."})}),b.jsx("div",{className:"md:col-span-2",children:b.jsx(N0,{label:"Links de Artes Finales",prefix:"AF",links:g.afLinks,onChange:J=>U("afLinks",J),emptyText:"Aún no hay artes finales."})}),b.jsx(Yc,{className:"md:col-span-2 my-1"}),b.jsxs("div",{className:"space-y-1.5",children:[b.jsxs(Sn,{className:"flex items-center gap-1.5",children:["Estatus",!p&&b.jsx(ak,{className:"w-3 h-3 text-muted-foreground"})]}),p?b.jsxs(Dc,{value:g.status||"_none",onValueChange:J=>U("status",J==="_none"?"":J),children:[b.jsx(Eo,{className:"h-10",children:b.jsx(Lc,{placeholder:"Sin estatus"})}),b.jsxs(To,{children:[b.jsx(ni,{value:"_none",children:"Sin estatus"}),q.map(J=>b.jsx(ni,{value:J,children:J},J))]})]}):b.jsx("div",{className:"h-10 px-3 flex items-center rounded-md border border-border bg-muted/30 text-sm text-foreground",children:g.status||"Sin estatus"}),!p&&b.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Solo Gerardo Marrero puede cambiar el estatus."})]}),p&&b.jsxs("div",{className:"space-y-1.5",children:[b.jsxs(Sn,{className:"flex items-center gap-1.5",children:[b.jsx(KO,{className:"w-3.5 h-3.5"})," Interno Cargado"]}),b.jsx(Jn,{type:"number",value:g.monto??"",onChange:J=>U("monto",J.target.value===""?null:Number(J.target.value)),placeholder:"0.00",className:"h-10"}),b.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Privado · solo Gerardo Marrero."})]})]}),(C||x)&&b.jsxs("div",{className:Le("mt-5 flex items-start gap-2 rounded-xl border px-3 py-2 text-sm",C?"border-destructive/30 bg-destructive/5 text-destructive":"border-primary/20 bg-primary/5 text-primary"),children:[C?b.jsx($h,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}):b.jsx(dh,{className:"mt-0.5 h-4 w-4 flex-shrink-0 animate-spin"}),b.jsx("span",{children:C||x})]})]}),b.jsx(px,{className:"px-7 py-4 border-t bg-muted/30 rounded-b-lg flex-row justify-end sm:justify-end",children:b.jsxs("div",{className:"flex gap-2",children:[b.jsx(on,{variant:"ghost",onClick:()=>t(!1),disabled:_,children:"Cancelar"}),b.jsxs(on,{onClick:de,disabled:!me||_,children:[_&&b.jsx(dh,{className:"mr-1.5 h-4 w-4 animate-spin"}),_?"Guardando…":v?"Guardar cambios":"Crear proyecto"]})]})})]})})}const bo=12;function l5(e,t){if(e){const a=e.trim().split(/\s+/);return a.length>=2?(a[0][0]+a[1][0]).toUpperCase():e.slice(0,2).toUpperCase()}return t?t.slice(0,2).toUpperCase():"?"}function c5(){const{projects:e,loading:t,error:a,refresh:s}=yE(),{user:o,isGerardo:c,logout:u}=Jo(),d=y.useRef(null),[h,p]=y.useState(!1),[v,g]=y.useState(null),[S,_]=y.useState(""),[E,x]=y.useState("todos"),[R,C]=y.useState({todos:1,abiertos:1,cerrados:1}),N=y.useMemo(()=>{const O=S.trim().toLowerCase();return[...e].sort((K,Z)=>Z.createdAt-K.createdAt).filter(K=>E==="abiertos"&&K.status||E==="cerrados"&&!K.status?!1:O?[K.nombre,K.cliente,K.marca,K.bu,K.solicitante].join(" ").toLowerCase().includes(O):!0)},[e,S,E]),A=R[E],D=Math.max(1,Math.ceil(N.length/bo)),V=Math.min(A,D),q=(V-1)*bo,U=N.slice(q,q+bo),I=N.length===0?0:q+1,ae=Math.min(q+bo,N.length);y.useEffect(()=>{C(O=>({...O,[E]:1}))},[S,E]),y.useEffect(()=>{A>D&&C(O=>({...O,[E]:D}))},[A,E,D]);const me=O=>{const $=Math.min(Math.max(O,1),D);C(K=>({...K,[E]:$})),window.requestAnimationFrame(()=>{var K;(K=d.current)==null||K.scrollIntoView({behavior:"smooth",block:"start"})})},ve=()=>{g(null),p(!0)},de=O=>{g(O),p(!0)},pe=(o==null?void 0:o.displayName)??(o==null?void 0:o.email)??"Usuario",J=c?"Jefe CDC":"Usuario CDC",ie=l5(o==null?void 0:o.displayName,o==null?void 0:o.email);return b.jsxs("div",{className:"min-h-screen bg-background",children:[b.jsx("header",{className:"sticky top-0 z-30 bg-background/85 backdrop-blur-md border-b border-border",children:b.jsxs("div",{className:"max-w-[1400px] mx-auto px-6 py-3.5 flex items-center gap-4",children:[b.jsxs("div",{className:"flex items-center gap-2.5",children:[b.jsx("div",{className:"w-9 h-9 rounded-xl bg-primary flex items-center justify-center",children:b.jsx(wm,{className:"w-4 h-4 text-primary-foreground"})}),b.jsxs("div",{className:"leading-tight",children:[b.jsx("h1",{className:"text-[15px] font-semibold tracking-tight",children:"Tablero CDC"}),b.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Aprobaciones de Proyectos"})]})]}),b.jsxs("div",{className:"flex-1 max-w-md ml-4 relative hidden md:block",children:[b.jsx(Hb,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),b.jsx(Jn,{value:S,onChange:O=>_(O.target.value),placeholder:"Buscar proyecto, cliente, marca…",className:"pl-9 h-9 bg-muted/40 border-transparent focus-visible:bg-card focus-visible:border-border"})]}),b.jsx("div",{className:"flex-1 md:flex-none"}),b.jsxs(RL,{children:[b.jsx(AL,{asChild:!0,children:b.jsxs(on,{variant:"ghost",size:"sm",className:"gap-2 h-9 px-2.5",children:[b.jsxs(H_,{className:"w-7 h-7",children:[(o==null?void 0:o.photoURL)&&b.jsx(q_,{src:o.photoURL,alt:pe,referrerPolicy:"no-referrer"}),b.jsx(G_,{className:c?"bg-primary text-primary-foreground text-xs":"bg-accent text-accent-foreground text-xs",children:ie})]}),b.jsxs("div",{className:"text-left leading-tight hidden sm:block",children:[b.jsx("div",{className:"text-xs font-medium",children:pe}),b.jsx("div",{className:"text-[10px] text-muted-foreground",children:J})]}),b.jsx(bm,{className:"w-3.5 h-3.5 text-muted-foreground"})]})}),b.jsxs(O_,{align:"end",className:"w-52",children:[b.jsxs("div",{className:"px-3 py-2",children:[b.jsx("p",{className:"text-xs font-medium truncate",children:pe}),b.jsx("p",{className:"text-[10px] text-muted-foreground truncate",children:o==null?void 0:o.email})]}),b.jsx(j_,{}),b.jsxs(k_,{onClick:u,className:"gap-2 text-destructive focus:text-destructive focus:bg-destructive/10 cursor-pointer",children:[b.jsx(ik,{className:"w-3.5 h-3.5"}),"Cerrar sesión"]})]})]}),b.jsxs(on,{onClick:ve,className:"gap-1.5 h-9 rounded-full px-4 shadow-sm",children:[b.jsx(Sm,{className:"w-4 h-4"})," Nuevo"]})]})}),b.jsxs("div",{ref:d,className:"max-w-[1400px] mx-auto px-6 pt-6 pb-3 space-y-3",children:[b.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[b.jsx("div",{children:b.jsx("h2",{className:"text-2xl font-semibold tracking-tight",children:"Proyectos"})}),b.jsx("div",{className:"flex items-center gap-2",children:b.jsx("div",{className:"inline-flex bg-muted/60 rounded-full p-1 text-xs",children:[["todos","Todos"],["abiertos","Activos"],["cerrados","Cerrados"]].map(([O,$])=>b.jsx("button",{onClick:()=>x(O),className:`px-3.5 py-1.5 rounded-full transition-colors font-medium ${E===O?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:$},O))})})]}),b.jsxs("div",{className:"relative md:hidden",children:[b.jsx(Hb,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),b.jsx(Jn,{value:S,onChange:O=>_(O.target.value),placeholder:"Buscar proyecto, cliente, marca…",className:"pl-9 h-9 bg-muted/40 border-transparent focus-visible:bg-card focus-visible:border-border"})]})]}),b.jsxs("main",{className:"max-w-[1400px] mx-auto px-6 pb-16",children:[a&&b.jsxs("div",{className:"mb-4 flex flex-col gap-3 rounded-2xl border border-destructive/30 bg-destructive/5 px-4 py-3 text-sm text-destructive sm:flex-row sm:items-center sm:justify-between",children:[b.jsxs("span",{className:"flex items-start gap-2",children:[b.jsx($h,{className:"mt-0.5 h-4 w-4 flex-shrink-0"}),b.jsxs("span",{children:[b.jsx("span",{className:"font-medium",children:"No se pudieron cargar los proyectos."})," ",a]})]}),b.jsxs(on,{variant:"outline",size:"sm",onClick:()=>void s(),className:"gap-1.5",children:[b.jsx(dk,{className:"h-3.5 w-3.5"})," Reintentar"]})]}),t&&e.length===0?b.jsx(f5,{}):N.length===0?b.jsx(h5,{onNew:ve,hasProjects:e.length>0,filter:E,query:S}):b.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:U.map(O=>b.jsx(JL,{project:O,onClick:()=>de(O)},O.id))}),N.length>bo&&b.jsx(u5,{currentPage:V,totalPages:D,visibleStart:I,visibleEnd:ae,totalItems:N.length,onPageChange:me})]}),b.jsx(o5,{open:h,onOpenChange:p,project:v})]})}function u5({currentPage:e,totalPages:t,visibleStart:a,visibleEnd:s,totalItems:o,onPageChange:c}){const u=d5(e,t);return b.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row items-center justify-between gap-3 rounded-2xl border border-border bg-card/70 px-4 py-3",children:[b.jsxs("p",{className:"text-xs text-muted-foreground",children:[b.jsxs("span",{className:"font-medium text-foreground",children:[a,"-",s]})," ","de ",b.jsx("span",{className:"font-medium text-foreground",children:o})," proyectos"]}),b.jsxs("div",{className:"flex items-center gap-1.5",children:[b.jsxs(on,{type:"button",variant:"ghost",size:"sm",className:"h-8 gap-1 rounded-full px-2.5",onClick:()=>c(e-1),disabled:e===1,children:[b.jsx(UO,{className:"h-4 w-4"}),b.jsx("span",{className:"hidden sm:inline",children:"Anterior"})]}),b.jsx("div",{className:"flex items-center gap-1",children:u.map((d,h)=>d==="ellipsis"?b.jsx("span",{className:"flex h-8 w-8 items-center justify-center text-xs text-muted-foreground",children:"…"},`ellipsis-${h}`):b.jsx(on,{type:"button",variant:d===e?"default":"ghost",size:"sm",className:"h-8 w-8 rounded-full p-0 text-xs",onClick:()=>c(d),"aria-current":d===e?"page":void 0,children:d},d))}),b.jsxs(on,{type:"button",variant:"ghost",size:"sm",className:"h-8 gap-1 rounded-full px-2.5",onClick:()=>c(e+1),disabled:e===t,children:[b.jsx("span",{className:"hidden sm:inline",children:"Siguiente"}),b.jsx(Ow,{className:"h-4 w-4"})]})]})]})}function d5(e,t){if(t<=7)return Array.from({length:t},(o,c)=>c+1);const a=new Set([1,t,e]);return e>1&&a.add(e-1),e<t&&a.add(e+1),e<=3&&(a.add(2),a.add(3),a.add(4)),e>=t-2&&(a.add(t-3),a.add(t-2),a.add(t-1)),Array.from(a).filter(o=>o>=1&&o<=t).sort((o,c)=>o-c).reduce((o,c)=>{const u=o[o.length-1];return typeof u=="number"&&c-u>1&&o.push("ellipsis"),o.push(c),o},[])}function f5(){return b.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:Array.from({length:8}).map((e,t)=>b.jsxs("div",{className:"min-h-[230px] overflow-hidden rounded-2xl border border-border bg-card",children:[b.jsx("div",{className:"h-14 bg-muted animate-pulse"}),b.jsxs("div",{className:"space-y-3 p-4",children:[b.jsx("div",{className:"h-3 w-3/4 rounded-full bg-muted animate-pulse"}),b.jsx("div",{className:"h-3 w-2/3 rounded-full bg-muted animate-pulse"}),b.jsx("div",{className:"h-3 w-1/2 rounded-full bg-muted animate-pulse"}),b.jsx("div",{className:"mt-6 h-8 rounded-full bg-muted animate-pulse"})]})]},t))})}function h5({onNew:e,hasProjects:t,filter:a,query:s}){const o=s.trim().length>0;let c="Tu tablero está vacío",u="Crea tu primer proyecto para que el equipo pueda darle seguimiento.";return t&&o?(c="Nada coincide con la búsqueda",u="Intenta cambiar la búsqueda o borrar el texto escrito."):t&&a==="abiertos"?(c="No hay proyectos activos",u="Cuando se cree un proyecto nuevo, aparecerá en esta pestaña."):t&&a==="cerrados"?(c="No hay proyectos cerrados",u="Cuando Gerardo asigne un estatus a un proyecto, aparecerá aquí."):t&&(c="Nada coincide con el filtro",u="Intenta quitar el filtro o cambiar la búsqueda."),b.jsxs("div",{className:"text-center py-24 rounded-2xl border border-dashed border-border bg-card/40",children:[b.jsx("div",{className:"w-14 h-14 rounded-2xl bg-primary/10 mx-auto flex items-center justify-center mb-4",children:b.jsx(wm,{className:"w-6 h-6 text-primary"})}),b.jsx("h3",{className:"text-lg font-semibold",children:c}),b.jsx("p",{className:"text-sm text-muted-foreground mt-1 max-w-sm mx-auto",children:u}),!t&&b.jsxs(on,{onClick:e,className:"mt-5 gap-1.5 rounded-full",children:[b.jsx(Sm,{className:"w-4 h-4"})," Crear proyecto"]})]})}const m5=({...e})=>b.jsx(i5,{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"}},...e});class p5 extends y.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,a){console.error("Uncaught error:",t,a)}render(){return this.state.hasError?b.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background px-4",children:b.jsxs("div",{className:"max-w-md text-center",children:[b.jsx("h1",{className:"text-xl font-semibold tracking-tight text-foreground",children:"Ocurrió un error al cargar el tablero."}),b.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Intenta recargar la página."}),b.jsx("div",{className:"mt-6",children:b.jsx("button",{onClick:()=>window.location.reload(),className:"inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90",children:"Recargar"})})]})}):this.props.children}}function g5(){const{user:e,loading:t}=Jo();return t?b.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:b.jsxs("div",{className:"flex flex-col items-center gap-3",children:[b.jsx("div",{className:"w-9 h-9 rounded-xl bg-primary flex items-center justify-center animate-pulse",children:b.jsxs("svg",{className:"w-4 h-4 text-primary-foreground",fill:"none",viewBox:"0 0 24 24",children:[b.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1",fill:"currentColor"}),b.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1",fill:"currentColor",opacity:"0.5"}),b.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",fill:"currentColor",opacity:"0.5"}),b.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1",fill:"currentColor"})]})}),b.jsx("p",{className:"text-sm text-muted-foreground",children:"Cargando tablero…"})]})}):e?b.jsx(PC,{children:b.jsx(Z0,{path:"/*",element:b.jsx(c5,{})})}):b.jsx(v2,{})}function v5(){return b.jsx(p5,{children:b.jsx(TO,{children:b.jsxs(lR,{basename:"/tablero-cdc/",children:[b.jsx(g5,{}),b.jsx(m5,{richColors:!0,position:"top-right"})]})})})}BT.createRoot(document.getElementById("root")).render(b.jsx(y.StrictMode,{children:b.jsx(v5,{})}));
|