var MS=Object.defineProperty;var Ug=e=>{throw TypeError(e)};var OS=(e,t,r)=>t in e?MS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Gl=(e,t,r)=>OS(e,typeof t!="symbol"?t+"":t,r),rf=(e,t,r)=>t.has(e)||Ug("Cannot "+r);var _=(e,t,r)=>(rf(e,t,"read from private field"),r?r.call(e):t.get(e)),pe=(e,t,r)=>t.has(e)?Ug("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),re=(e,t,r,n)=>(rf(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Te=(e,t,r)=>(rf(e,t,"access private method"),r);var Ql=(e,t,r,n)=>({set _(a){re(e,t,a,r)},get _(){return _(e,t,n)}});function DS(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(n,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>n[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();function jy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ny={exports:{}},Qu={},Cy={exports:{}},Oe={};/**
 * @license React
 * react.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Rl=Symbol.for("react.element"),FS=Symbol.for("react.portal"),LS=Symbol.for("react.fragment"),$S=Symbol.for("react.strict_mode"),US=Symbol.for("react.profiler"),zS=Symbol.for("react.provider"),VS=Symbol.for("react.context"),BS=Symbol.for("react.forward_ref"),HS=Symbol.for("react.suspense"),WS=Symbol.for("react.memo"),qS=Symbol.for("react.lazy"),zg=Symbol.iterator;function KS(e){return e===null||typeof e!="object"?null:(e=zg&&e[zg]||e["@@iterator"],typeof e=="function"?e:null)}var Sy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_y=Object.assign,Ey={};function Ji(e,t,r){this.props=e,this.context=t,this.refs=Ey,this.updater=r||Sy}Ji.prototype.isReactComponent={};Ji.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ji.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ky(){}ky.prototype=Ji.prototype;function Uh(e,t,r){this.props=e,this.context=t,this.refs=Ey,this.updater=r||Sy}var zh=Uh.prototype=new ky;zh.constructor=Uh;_y(zh,Ji.prototype);zh.isPureReactComponent=!0;var Vg=Array.isArray,Ty=Object.prototype.hasOwnProperty,Vh={current:null},Py={key:!0,ref:!0,__self:!0,__source:!0};function Ry(e,t,r){var n,a={},i=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Ty.call(t,n)&&!Py.hasOwnProperty(n)&&(a[n]=t[n]);var l=arguments.length-2;if(l===1)a.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];a.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)a[n]===void 0&&(a[n]=l[n]);return{$$typeof:Rl,type:e,key:i,ref:o,props:a,_owner:Vh.current}}function GS(e,t){return{$$typeof:Rl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Bh(e){return typeof e=="object"&&e!==null&&e.$$typeof===Rl}function QS(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Bg=/\/+/g;function nf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?QS(""+e.key):t.toString(36)}function Cc(e,t,r,n,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Rl:case FS:o=!0}}if(o)return o=e,a=a(o),e=n===""?"."+nf(o,0):n,Vg(a)?(r="",e!=null&&(r=e.replace(Bg,"$&/")+"/"),Cc(a,t,r,"",function(u){return u})):a!=null&&(Bh(a)&&(a=GS(a,r+(!a.key||o&&o.key===a.key?"":(""+a.key).replace(Bg,"$&/")+"/")+e)),t.push(a)),1;if(o=0,n=n===""?".":n+":",Vg(e))for(var l=0;l<e.length;l++){i=e[l];var c=n+nf(i,l);o+=Cc(i,t,r,c,a)}else if(c=KS(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=n+nf(i,l++),o+=Cc(i,t,r,c,a);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Yl(e,t,r){if(e==null)return e;var n=[],a=0;return Cc(e,n,"","",function(i){return t.call(r,i,a++)}),n}function YS(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var rr={current:null},Sc={transition:null},ZS={ReactCurrentDispatcher:rr,ReactCurrentBatchConfig:Sc,ReactCurrentOwner:Vh};function Ay(){throw Error("act(...) is not supported in production builds of React.")}Oe.Children={map:Yl,forEach:function(e,t,r){Yl(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Yl(e,function(){t++}),t},toArray:function(e){return Yl(e,function(t){return t})||[]},only:function(e){if(!Bh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Oe.Component=Ji;Oe.Fragment=LS;Oe.Profiler=US;Oe.PureComponent=Uh;Oe.StrictMode=$S;Oe.Suspense=HS;Oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ZS;Oe.act=Ay;Oe.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=_y({},e.props),a=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=Vh.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)Ty.call(t,c)&&!Py.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];n.children=l}return{$$typeof:Rl,type:e.type,key:a,ref:i,props:n,_owner:o}};Oe.createContext=function(e){return e={$$typeof:VS,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:zS,_context:e},e.Consumer=e};Oe.createElement=Ry;Oe.createFactory=function(e){var t=Ry.bind(null,e);return t.type=e,t};Oe.createRef=function(){return{current:null}};Oe.forwardRef=function(e){return{$$typeof:BS,render:e}};Oe.isValidElement=Bh;Oe.lazy=function(e){return{$$typeof:qS,_payload:{_status:-1,_result:e},_init:YS}};Oe.memo=function(e,t){return{$$typeof:WS,type:e,compare:t===void 0?null:t}};Oe.startTransition=function(e){var t=Sc.transition;Sc.transition={};try{e()}finally{Sc.transition=t}};Oe.unstable_act=Ay;Oe.useCallback=function(e,t){return rr.current.useCallback(e,t)};Oe.useContext=function(e){return rr.current.useContext(e)};Oe.useDebugValue=function(){};Oe.useDeferredValue=function(e){return rr.current.useDeferredValue(e)};Oe.useEffect=function(e,t){return rr.current.useEffect(e,t)};Oe.useId=function(){return rr.current.useId()};Oe.useImperativeHandle=function(e,t,r){return rr.current.useImperativeHandle(e,t,r)};Oe.useInsertionEffect=function(e,t){return rr.current.useInsertionEffect(e,t)};Oe.useLayoutEffect=function(e,t){return rr.current.useLayoutEffect(e,t)};Oe.useMemo=function(e,t){return rr.current.useMemo(e,t)};Oe.useReducer=function(e,t,r){return rr.current.useReducer(e,t,r)};Oe.useRef=function(e){return rr.current.useRef(e)};Oe.useState=function(e){return rr.current.useState(e)};Oe.useSyncExternalStore=function(e,t,r){return rr.current.useSyncExternalStore(e,t,r)};Oe.useTransition=function(){return rr.current.useTransition()};Oe.version="18.3.1";Cy.exports=Oe;var d=Cy.exports;const z=jy(d),Yu=DS({__proto__:null,default:z},[d]);/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var XS=d,JS=Symbol.for("react.element"),e_=Symbol.for("react.fragment"),t_=Object.prototype.hasOwnProperty,r_=XS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,n_={key:!0,ref:!0,__self:!0,__source:!0};function Iy(e,t,r){var n,a={},i=null,o=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)t_.call(t,n)&&!n_.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)a[n]===void 0&&(a[n]=t[n]);return{$$typeof:JS,type:e,key:i,ref:o,props:a,_owner:r_.current}}Qu.Fragment=e_;Qu.jsx=Iy;Qu.jsxs=Iy;Ny.exports=Qu;var s=Ny.exports,My={exports:{}},Er={},Oy={exports:{}},Dy={};/**
 * @license React
 * scheduler.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */(function(e){function t(A,O){var Y=A.length;A.push(O);e:for(;0<Y;){var K=Y-1>>>1,te=A[K];if(0<a(te,O))A[K]=O,A[Y]=te,Y=K;else break e}}function r(A){return A.length===0?null:A[0]}function n(A){if(A.length===0)return null;var O=A[0],Y=A.pop();if(Y!==O){A[0]=Y;e:for(var K=0,te=A.length,ge=te>>>1;K<ge;){var ke=2*(K+1)-1,Ze=A[ke],ye=ke+1,ae=A[ye];if(0>a(Ze,Y))ye<te&&0>a(ae,Ze)?(A[K]=ae,A[ye]=Y,K=ye):(A[K]=Ze,A[ke]=Y,K=ke);else if(ye<te&&0>a(ae,Y))A[K]=ae,A[ye]=Y,K=ye;else break e}}return O}function a(A,O){var Y=A.sortIndex-O.sortIndex;return Y!==0?Y:A.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],h=1,f=null,m=3,y=!1,v=!1,p=!1,b=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(A){for(var O=r(u);O!==null;){if(O.callback===null)n(u);else if(O.startTime<=A)n(u),O.sortIndex=O.expirationTime,t(c,O);else break;O=r(u)}}function N(A){if(p=!1,w(A),!v)if(r(c)!==null)v=!0,F(C);else{var O=r(u);O!==null&&X(N,O.startTime-A)}}function C(A,O){v=!1,p&&(p=!1,g(P),P=-1),y=!0;var Y=m;try{for(w(O),f=r(c);f!==null&&(!(f.expirationTime>O)||A&&!E());){var K=f.callback;if(typeof K=="function"){f.callback=null,m=f.priorityLevel;var te=K(f.expirationTime<=O);O=e.unstable_now(),typeof te=="function"?f.callback=te:f===r(c)&&n(c),w(O)}else n(c);f=r(c)}if(f!==null)var ge=!0;else{var ke=r(u);ke!==null&&X(N,ke.startTime-O),ge=!1}return ge}finally{f=null,m=Y,y=!1}}var k=!1,T=null,P=-1,I=5,D=-1;function E(){return!(e.unstable_now()-D<I)}function M(){if(T!==null){var A=e.unstable_now();D=A;var O=!0;try{O=T(!0,A)}finally{O?U():(k=!1,T=null)}}else k=!1}var U;if(typeof x=="function")U=function(){x(M)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,G=$.port2;$.port1.onmessage=M,U=function(){G.postMessage(null)}}else U=function(){b(M,0)};function F(A){T=A,k||(k=!0,U())}function X(A,O){P=b(function(){A(e.unstable_now())},O)}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(A){A.callback=null},e.unstable_continueExecution=function(){v||y||(v=!0,F(C))},e.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<A?Math.floor(1e3/A):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(A){switch(m){case 1:case 2:case 3:var O=3;break;default:O=m}var Y=m;m=O;try{return A()}finally{m=Y}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(A,O){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var Y=m;m=A;try{return O()}finally{m=Y}},e.unstable_scheduleCallback=function(A,O,Y){var K=e.unstable_now();switch(typeof Y=="object"&&Y!==null?(Y=Y.delay,Y=typeof Y=="number"&&0<Y?K+Y:K):Y=K,A){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=Y+te,A={id:h++,callback:O,priorityLevel:A,startTime:Y,expirationTime:te,sortIndex:-1},Y>K?(A.sortIndex=Y,t(u,A),r(c)===null&&A===r(u)&&(p?(g(P),P=-1):p=!0,X(N,Y-K))):(A.sortIndex=te,t(c,A),v||y||(v=!0,F(C))),A},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(A){var O=m;return function(){var Y=m;m=O;try{return A.apply(this,arguments)}finally{m=Y}}}})(Dy);Oy.exports=Dy;var s_=Oy.exports;/**
 * @license React
 * react-dom.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var a_=d,_r=s_;function W(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Fy=new Set,Zo={};function Va(e,t){zi(e,t),zi(e+"Capture",t)}function zi(e,t){for(Zo[e]=t,e=0;e<t.length;e++)Fy.add(t[e])}var es=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xf=Object.prototype.hasOwnProperty,i_=/^[: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]*$/,Hg={},Wg={};function o_(e){return Xf.call(Wg,e)?!0:Xf.call(Hg,e)?!1:i_.test(e)?Wg[e]=!0:(Hg[e]=!0,!1)}function l_(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function c_(e,t,r,n){if(t===null||typeof t>"u"||l_(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function nr(e,t,r,n,a,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Mt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Mt[e]=new nr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Mt[t]=new nr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Mt[e]=new nr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Mt[e]=new nr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Mt[e]=new nr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Mt[e]=new nr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Mt[e]=new nr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Mt[e]=new nr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Mt[e]=new nr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Hh=/[\-:]([a-z])/g;function Wh(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Hh,Wh);Mt[t]=new nr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Hh,Wh);Mt[t]=new nr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Hh,Wh);Mt[t]=new nr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Mt[e]=new nr(e,1,!1,e.toLowerCase(),null,!1,!1)});Mt.xlinkHref=new nr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Mt[e]=new nr(e,1,!1,e.toLowerCase(),null,!0,!0)});function qh(e,t,r,n){var a=Mt.hasOwnProperty(t)?Mt[t]:null;(a!==null?a.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(c_(t,r,a,n)&&(r=null),n||a===null?o_(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):a.mustUseProperty?e[a.propertyName]=r===null?a.type===3?!1:"":r:(t=a.attributeName,n=a.attributeNamespace,r===null?e.removeAttribute(t):(a=a.type,r=a===3||a===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var ls=a_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Zl=Symbol.for("react.element"),si=Symbol.for("react.portal"),ai=Symbol.for("react.fragment"),Kh=Symbol.for("react.strict_mode"),Jf=Symbol.for("react.profiler"),Ly=Symbol.for("react.provider"),$y=Symbol.for("react.context"),Gh=Symbol.for("react.forward_ref"),em=Symbol.for("react.suspense"),tm=Symbol.for("react.suspense_list"),Qh=Symbol.for("react.memo"),xs=Symbol.for("react.lazy"),Uy=Symbol.for("react.offscreen"),qg=Symbol.iterator;function po(e){return e===null||typeof e!="object"?null:(e=qg&&e[qg]||e["@@iterator"],typeof e=="function"?e:null)}var ct=Object.assign,sf;function ko(e){if(sf===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);sf=t&&t[1]||""}return`
`+sf+e}var af=!1;function of(e,t){if(!e||af)return"";af=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var a=u.stack.split(`
`),i=n.stack.split(`
`),o=a.length-1,l=i.length-1;1<=o&&0<=l&&a[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(a[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||a[o]!==i[l]){var c=`
`+a[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{af=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?ko(e):""}function u_(e){switch(e.tag){case 5:return ko(e.type);case 16:return ko("Lazy");case 13:return ko("Suspense");case 19:return ko("SuspenseList");case 0:case 2:case 15:return e=of(e.type,!1),e;case 11:return e=of(e.type.render,!1),e;case 1:return e=of(e.type,!0),e;default:return""}}function rm(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ai:return"Fragment";case si:return"Portal";case Jf:return"Profiler";case Kh:return"StrictMode";case em:return"Suspense";case tm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $y:return(e.displayName||"Context")+".Consumer";case Ly:return(e._context.displayName||"Context")+".Provider";case Gh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Qh:return t=e.displayName||null,t!==null?t:rm(e.type)||"Memo";case xs:t=e._payload,e=e._init;try{return rm(e(t))}catch{}}return null}function d_(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return rm(t);case 8:return t===Kh?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function qs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function zy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function f_(e){var t=zy(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Xl(e){e._valueTracker||(e._valueTracker=f_(e))}function Vy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=zy(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Hc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function nm(e,t){var r=t.checked;return ct({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Kg(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=qs(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function By(e,t){t=t.checked,t!=null&&qh(e,"checked",t,!1)}function sm(e,t){By(e,t);var r=qs(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?am(e,t.type,r):t.hasOwnProperty("defaultValue")&&am(e,t.type,qs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Gg(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function am(e,t,r){(t!=="number"||Hc(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var To=Array.isArray;function xi(e,t,r,n){if(e=e.options,t){t={};for(var a=0;a<r.length;a++)t["$"+r[a]]=!0;for(r=0;r<e.length;r++)a=t.hasOwnProperty("$"+e[r].value),e[r].selected!==a&&(e[r].selected=a),a&&n&&(e[r].defaultSelected=!0)}else{for(r=""+qs(r),t=null,a=0;a<e.length;a++){if(e[a].value===r){e[a].selected=!0,n&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function im(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(W(91));return ct({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Qg(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(W(92));if(To(r)){if(1<r.length)throw Error(W(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:qs(r)}}function Hy(e,t){var r=qs(t.value),n=qs(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Yg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Wy(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function om(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Wy(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Jl,qy=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,a){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Jl=Jl||document.createElement("div"),Jl.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Jl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xo(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var $o={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},m_=["Webkit","ms","Moz","O"];Object.keys($o).forEach(function(e){m_.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),$o[t]=$o[e]})});function Ky(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||$o.hasOwnProperty(e)&&$o[e]?(""+t).trim():t+"px"}function Gy(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=Ky(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,a):e[r]=a}}var h_=ct({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function lm(e,t){if(t){if(h_[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(W(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(W(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(W(61))}if(t.style!=null&&typeof t.style!="object")throw Error(W(62))}}function cm(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var um=null;function Yh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var dm=null,vi=null,yi=null;function Zg(e){if(e=Ml(e)){if(typeof dm!="function")throw Error(W(280));var t=e.stateNode;t&&(t=td(t),dm(e.stateNode,e.type,t))}}function Qy(e){vi?yi?yi.push(e):yi=[e]:vi=e}function Yy(){if(vi){var e=vi,t=yi;if(yi=vi=null,Zg(e),t)for(e=0;e<t.length;e++)Zg(t[e])}}function Zy(e,t){return e(t)}function Xy(){}var lf=!1;function Jy(e,t,r){if(lf)return e(t,r);lf=!0;try{return Zy(e,t,r)}finally{lf=!1,(vi!==null||yi!==null)&&(Xy(),Yy())}}function Jo(e,t){var r=e.stateNode;if(r===null)return null;var n=td(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(W(231,t,typeof r));return r}var fm=!1;if(es)try{var go={};Object.defineProperty(go,"passive",{get:function(){fm=!0}}),window.addEventListener("test",go,go),window.removeEventListener("test",go,go)}catch{fm=!1}function p_(e,t,r,n,a,i,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(h){this.onError(h)}}var Uo=!1,Wc=null,qc=!1,mm=null,g_={onError:function(e){Uo=!0,Wc=e}};function x_(e,t,r,n,a,i,o,l,c){Uo=!1,Wc=null,p_.apply(g_,arguments)}function v_(e,t,r,n,a,i,o,l,c){if(x_.apply(this,arguments),Uo){if(Uo){var u=Wc;Uo=!1,Wc=null}else throw Error(W(198));qc||(qc=!0,mm=u)}}function Ba(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function e0(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Xg(e){if(Ba(e)!==e)throw Error(W(188))}function y_(e){var t=e.alternate;if(!t){if(t=Ba(e),t===null)throw Error(W(188));return t!==e?null:e}for(var r=e,n=t;;){var a=r.return;if(a===null)break;var i=a.alternate;if(i===null){if(n=a.return,n!==null){r=n;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===r)return Xg(a),e;if(i===n)return Xg(a),t;i=i.sibling}throw Error(W(188))}if(r.return!==n.return)r=a,n=i;else{for(var o=!1,l=a.child;l;){if(l===r){o=!0,r=a,n=i;break}if(l===n){o=!0,n=a,r=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===r){o=!0,r=i,n=a;break}if(l===n){o=!0,n=i,r=a;break}l=l.sibling}if(!o)throw Error(W(189))}}if(r.alternate!==n)throw Error(W(190))}if(r.tag!==3)throw Error(W(188));return r.stateNode.current===r?e:t}function t0(e){return e=y_(e),e!==null?r0(e):null}function r0(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=r0(e);if(t!==null)return t;e=e.sibling}return null}var n0=_r.unstable_scheduleCallback,Jg=_r.unstable_cancelCallback,w_=_r.unstable_shouldYield,b_=_r.unstable_requestPaint,vt=_r.unstable_now,j_=_r.unstable_getCurrentPriorityLevel,Zh=_r.unstable_ImmediatePriority,s0=_r.unstable_UserBlockingPriority,Kc=_r.unstable_NormalPriority,N_=_r.unstable_LowPriority,a0=_r.unstable_IdlePriority,Zu=null,En=null;function C_(e){if(En&&typeof En.onCommitFiberRoot=="function")try{En.onCommitFiberRoot(Zu,e,void 0,(e.current.flags&128)===128)}catch{}}var tn=Math.clz32?Math.clz32:E_,S_=Math.log,__=Math.LN2;function E_(e){return e>>>=0,e===0?32:31-(S_(e)/__|0)|0}var ec=64,tc=4194304;function Po(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Gc(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,a=e.suspendedLanes,i=e.pingedLanes,o=r&268435455;if(o!==0){var l=o&~a;l!==0?n=Po(l):(i&=o,i!==0&&(n=Po(i)))}else o=r&~a,o!==0?n=Po(o):i!==0&&(n=Po(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&a)&&(a=n&-n,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-tn(t),a=1<<r,n|=e[r],t&=~a;return n}function k_(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function T_(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-tn(i),l=1<<o,c=a[o];c===-1?(!(l&r)||l&n)&&(a[o]=k_(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function hm(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function i0(){var e=ec;return ec<<=1,!(ec&4194240)&&(ec=64),e}function cf(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Al(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-tn(t),e[t]=r}function P_(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var a=31-tn(r),i=1<<a;t[a]=0,n[a]=-1,e[a]=-1,r&=~i}}function Xh(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-tn(r),a=1<<n;a&t|e[n]&t&&(e[n]|=t),r&=~a}}var Qe=0;function o0(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var l0,Jh,c0,u0,d0,pm=!1,rc=[],Fs=null,Ls=null,$s=null,el=new Map,tl=new Map,ws=[],R_="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ex(e,t){switch(e){case"focusin":case"focusout":Fs=null;break;case"dragenter":case"dragleave":Ls=null;break;case"mouseover":case"mouseout":$s=null;break;case"pointerover":case"pointerout":el.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":tl.delete(t.pointerId)}}function xo(e,t,r,n,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[a]},t!==null&&(t=Ml(t),t!==null&&Jh(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function A_(e,t,r,n,a){switch(t){case"focusin":return Fs=xo(Fs,e,t,r,n,a),!0;case"dragenter":return Ls=xo(Ls,e,t,r,n,a),!0;case"mouseover":return $s=xo($s,e,t,r,n,a),!0;case"pointerover":var i=a.pointerId;return el.set(i,xo(el.get(i)||null,e,t,r,n,a)),!0;case"gotpointercapture":return i=a.pointerId,tl.set(i,xo(tl.get(i)||null,e,t,r,n,a)),!0}return!1}function f0(e){var t=pa(e.target);if(t!==null){var r=Ba(t);if(r!==null){if(t=r.tag,t===13){if(t=e0(r),t!==null){e.blockedOn=t,d0(e.priority,function(){c0(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function _c(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=gm(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);um=n,r.target.dispatchEvent(n),um=null}else return t=Ml(r),t!==null&&Jh(t),e.blockedOn=r,!1;t.shift()}return!0}function tx(e,t,r){_c(e)&&r.delete(t)}function I_(){pm=!1,Fs!==null&&_c(Fs)&&(Fs=null),Ls!==null&&_c(Ls)&&(Ls=null),$s!==null&&_c($s)&&($s=null),el.forEach(tx),tl.forEach(tx)}function vo(e,t){e.blockedOn===t&&(e.blockedOn=null,pm||(pm=!0,_r.unstable_scheduleCallback(_r.unstable_NormalPriority,I_)))}function rl(e){function t(a){return vo(a,e)}if(0<rc.length){vo(rc[0],e);for(var r=1;r<rc.length;r++){var n=rc[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Fs!==null&&vo(Fs,e),Ls!==null&&vo(Ls,e),$s!==null&&vo($s,e),el.forEach(t),tl.forEach(t),r=0;r<ws.length;r++)n=ws[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<ws.length&&(r=ws[0],r.blockedOn===null);)f0(r),r.blockedOn===null&&ws.shift()}var wi=ls.ReactCurrentBatchConfig,Qc=!0;function M_(e,t,r,n){var a=Qe,i=wi.transition;wi.transition=null;try{Qe=1,ep(e,t,r,n)}finally{Qe=a,wi.transition=i}}function O_(e,t,r,n){var a=Qe,i=wi.transition;wi.transition=null;try{Qe=4,ep(e,t,r,n)}finally{Qe=a,wi.transition=i}}function ep(e,t,r,n){if(Qc){var a=gm(e,t,r,n);if(a===null)yf(e,t,n,Yc,r),ex(e,n);else if(A_(a,e,t,r,n))n.stopPropagation();else if(ex(e,n),t&4&&-1<R_.indexOf(e)){for(;a!==null;){var i=Ml(a);if(i!==null&&l0(i),i=gm(e,t,r,n),i===null&&yf(e,t,n,Yc,r),i===a)break;a=i}a!==null&&n.stopPropagation()}else yf(e,t,n,null,r)}}var Yc=null;function gm(e,t,r,n){if(Yc=null,e=Yh(n),e=pa(e),e!==null)if(t=Ba(e),t===null)e=null;else if(r=t.tag,r===13){if(e=e0(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Yc=e,null}function m0(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(j_()){case Zh:return 1;case s0:return 4;case Kc:case N_:return 16;case a0:return 536870912;default:return 16}default:return 16}}var As=null,tp=null,Ec=null;function h0(){if(Ec)return Ec;var e,t=tp,r=t.length,n,a="value"in As?As.value:As.textContent,i=a.length;for(e=0;e<r&&t[e]===a[e];e++);var o=r-e;for(n=1;n<=o&&t[r-n]===a[i-n];n++);return Ec=a.slice(e,1<n?1-n:void 0)}function kc(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function nc(){return!0}function rx(){return!1}function kr(e){function t(r,n,a,i,o){this._reactName=r,this._targetInst=a,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?nc:rx,this.isPropagationStopped=rx,this}return ct(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=nc)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=nc)},persist:function(){},isPersistent:nc}),t}var eo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rp=kr(eo),Il=ct({},eo,{view:0,detail:0}),D_=kr(Il),uf,df,yo,Xu=ct({},Il,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:np,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==yo&&(yo&&e.type==="mousemove"?(uf=e.screenX-yo.screenX,df=e.screenY-yo.screenY):df=uf=0,yo=e),uf)},movementY:function(e){return"movementY"in e?e.movementY:df}}),nx=kr(Xu),F_=ct({},Xu,{dataTransfer:0}),L_=kr(F_),$_=ct({},Il,{relatedTarget:0}),ff=kr($_),U_=ct({},eo,{animationName:0,elapsedTime:0,pseudoElement:0}),z_=kr(U_),V_=ct({},eo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),B_=kr(V_),H_=ct({},eo,{data:0}),sx=kr(H_),W_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},q_={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"},K_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function G_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=K_[e])?!!t[e]:!1}function np(){return G_}var Q_=ct({},Il,{key:function(e){if(e.key){var t=W_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=kc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?q_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:np,charCode:function(e){return e.type==="keypress"?kc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?kc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Y_=kr(Q_),Z_=ct({},Xu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ax=kr(Z_),X_=ct({},Il,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:np}),J_=kr(X_),e2=ct({},eo,{propertyName:0,elapsedTime:0,pseudoElement:0}),t2=kr(e2),r2=ct({},Xu,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),n2=kr(r2),s2=[9,13,27,32],sp=es&&"CompositionEvent"in window,zo=null;es&&"documentMode"in document&&(zo=document.documentMode);var a2=es&&"TextEvent"in window&&!zo,p0=es&&(!sp||zo&&8<zo&&11>=zo),ix=" ",ox=!1;function g0(e,t){switch(e){case"keyup":return s2.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function x0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ii=!1;function i2(e,t){switch(e){case"compositionend":return x0(t);case"keypress":return t.which!==32?null:(ox=!0,ix);case"textInput":return e=t.data,e===ix&&ox?null:e;default:return null}}function o2(e,t){if(ii)return e==="compositionend"||!sp&&g0(e,t)?(e=h0(),Ec=tp=As=null,ii=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return p0&&t.locale!=="ko"?null:t.data;default:return null}}var l2={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 lx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!l2[e.type]:t==="textarea"}function v0(e,t,r,n){Qy(n),t=Zc(t,"onChange"),0<t.length&&(r=new rp("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Vo=null,nl=null;function c2(e){T0(e,0)}function Ju(e){var t=ci(e);if(Vy(t))return e}function u2(e,t){if(e==="change")return t}var y0=!1;if(es){var mf;if(es){var hf="oninput"in document;if(!hf){var cx=document.createElement("div");cx.setAttribute("oninput","return;"),hf=typeof cx.oninput=="function"}mf=hf}else mf=!1;y0=mf&&(!document.documentMode||9<document.documentMode)}function ux(){Vo&&(Vo.detachEvent("onpropertychange",w0),nl=Vo=null)}function w0(e){if(e.propertyName==="value"&&Ju(nl)){var t=[];v0(t,nl,e,Yh(e)),Jy(c2,t)}}function d2(e,t,r){e==="focusin"?(ux(),Vo=t,nl=r,Vo.attachEvent("onpropertychange",w0)):e==="focusout"&&ux()}function f2(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ju(nl)}function m2(e,t){if(e==="click")return Ju(t)}function h2(e,t){if(e==="input"||e==="change")return Ju(t)}function p2(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var nn=typeof Object.is=="function"?Object.is:p2;function sl(e,t){if(nn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var a=r[n];if(!Xf.call(t,a)||!nn(e[a],t[a]))return!1}return!0}function dx(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fx(e,t){var r=dx(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=dx(r)}}function b0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?b0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function j0(){for(var e=window,t=Hc();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Hc(e.document)}return t}function ap(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function g2(e){var t=j0(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&b0(r.ownerDocument.documentElement,r)){if(n!==null&&ap(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!e.extend&&i>n&&(a=n,n=i,i=a),a=fx(r,i);var o=fx(r,n);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var x2=es&&"documentMode"in document&&11>=document.documentMode,oi=null,xm=null,Bo=null,vm=!1;function mx(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;vm||oi==null||oi!==Hc(n)||(n=oi,"selectionStart"in n&&ap(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Bo&&sl(Bo,n)||(Bo=n,n=Zc(xm,"onSelect"),0<n.length&&(t=new rp("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=oi)))}function sc(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var li={animationend:sc("Animation","AnimationEnd"),animationiteration:sc("Animation","AnimationIteration"),animationstart:sc("Animation","AnimationStart"),transitionend:sc("Transition","TransitionEnd")},pf={},N0={};es&&(N0=document.createElement("div").style,"AnimationEvent"in window||(delete li.animationend.animation,delete li.animationiteration.animation,delete li.animationstart.animation),"TransitionEvent"in window||delete li.transitionend.transition);function ed(e){if(pf[e])return pf[e];if(!li[e])return e;var t=li[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in N0)return pf[e]=t[r];return e}var C0=ed("animationend"),S0=ed("animationiteration"),_0=ed("animationstart"),E0=ed("transitionend"),k0=new Map,hx="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ea(e,t){k0.set(e,t),Va(t,[e])}for(var gf=0;gf<hx.length;gf++){var xf=hx[gf],v2=xf.toLowerCase(),y2=xf[0].toUpperCase()+xf.slice(1);ea(v2,"on"+y2)}ea(C0,"onAnimationEnd");ea(S0,"onAnimationIteration");ea(_0,"onAnimationStart");ea("dblclick","onDoubleClick");ea("focusin","onFocus");ea("focusout","onBlur");ea(E0,"onTransitionEnd");zi("onMouseEnter",["mouseout","mouseover"]);zi("onMouseLeave",["mouseout","mouseover"]);zi("onPointerEnter",["pointerout","pointerover"]);zi("onPointerLeave",["pointerout","pointerover"]);Va("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Va("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Va("onBeforeInput",["compositionend","keypress","textInput","paste"]);Va("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Va("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Va("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ro="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(" "),w2=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ro));function px(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,v_(n,t,void 0,e),e.currentTarget=null}function T0(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],a=n.event;n=n.listeners;e:{var i=void 0;if(t)for(var o=n.length-1;0<=o;o--){var l=n[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&a.isPropagationStopped())break e;px(a,l,u),i=c}else for(o=0;o<n.length;o++){if(l=n[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&a.isPropagationStopped())break e;px(a,l,u),i=c}}}if(qc)throw e=mm,qc=!1,mm=null,e}function rt(e,t){var r=t[Nm];r===void 0&&(r=t[Nm]=new Set);var n=e+"__bubble";r.has(n)||(P0(t,e,2,!1),r.add(n))}function vf(e,t,r){var n=0;t&&(n|=4),P0(r,e,n,t)}var ac="_reactListening"+Math.random().toString(36).slice(2);function al(e){if(!e[ac]){e[ac]=!0,Fy.forEach(function(r){r!=="selectionchange"&&(w2.has(r)||vf(r,!1,e),vf(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ac]||(t[ac]=!0,vf("selectionchange",!1,t))}}function P0(e,t,r,n){switch(m0(t)){case 1:var a=M_;break;case 4:a=O_;break;default:a=ep}r=a.bind(null,t,r,e),a=void 0,!fm||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),n?a!==void 0?e.addEventListener(t,r,{capture:!0,passive:a}):e.addEventListener(t,r,!0):a!==void 0?e.addEventListener(t,r,{passive:a}):e.addEventListener(t,r,!1)}function yf(e,t,r,n,a){var i=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;if(l===a||l.nodeType===8&&l.parentNode===a)break;if(o===4)for(o=n.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;o=o.return}for(;l!==null;){if(o=pa(l),o===null)return;if(c=o.tag,c===5||c===6){n=i=o;continue e}l=l.parentNode}}n=n.return}Jy(function(){var u=i,h=Yh(r),f=[];e:{var m=k0.get(e);if(m!==void 0){var y=rp,v=e;switch(e){case"keypress":if(kc(r)===0)break e;case"keydown":case"keyup":y=Y_;break;case"focusin":v="focus",y=ff;break;case"focusout":v="blur",y=ff;break;case"beforeblur":case"afterblur":y=ff;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=nx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=L_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=J_;break;case C0:case S0:case _0:y=z_;break;case E0:y=t2;break;case"scroll":y=D_;break;case"wheel":y=n2;break;case"copy":case"cut":case"paste":y=B_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=ax}var p=(t&4)!==0,b=!p&&e==="scroll",g=p?m!==null?m+"Capture":null:m;p=[];for(var x=u,w;x!==null;){w=x;var N=w.stateNode;if(w.tag===5&&N!==null&&(w=N,g!==null&&(N=Jo(x,g),N!=null&&p.push(il(x,N,w)))),b)break;x=x.return}0<p.length&&(m=new y(m,v,null,r,h),f.push({event:m,listeners:p}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",m&&r!==um&&(v=r.relatedTarget||r.fromElement)&&(pa(v)||v[ts]))break e;if((y||m)&&(m=h.window===h?h:(m=h.ownerDocument)?m.defaultView||m.parentWindow:window,y?(v=r.relatedTarget||r.toElement,y=u,v=v?pa(v):null,v!==null&&(b=Ba(v),v!==b||v.tag!==5&&v.tag!==6)&&(v=null)):(y=null,v=u),y!==v)){if(p=nx,N="onMouseLeave",g="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(p=ax,N="onPointerLeave",g="onPointerEnter",x="pointer"),b=y==null?m:ci(y),w=v==null?m:ci(v),m=new p(N,x+"leave",y,r,h),m.target=b,m.relatedTarget=w,N=null,pa(h)===u&&(p=new p(g,x+"enter",v,r,h),p.target=w,p.relatedTarget=b,N=p),b=N,y&&v)t:{for(p=y,g=v,x=0,w=p;w;w=Qa(w))x++;for(w=0,N=g;N;N=Qa(N))w++;for(;0<x-w;)p=Qa(p),x--;for(;0<w-x;)g=Qa(g),w--;for(;x--;){if(p===g||g!==null&&p===g.alternate)break t;p=Qa(p),g=Qa(g)}p=null}else p=null;y!==null&&gx(f,m,y,p,!1),v!==null&&b!==null&&gx(f,b,v,p,!0)}}e:{if(m=u?ci(u):window,y=m.nodeName&&m.nodeName.toLowerCase(),y==="select"||y==="input"&&m.type==="file")var C=u2;else if(lx(m))if(y0)C=h2;else{C=f2;var k=d2}else(y=m.nodeName)&&y.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(C=m2);if(C&&(C=C(e,u))){v0(f,C,r,h);break e}k&&k(e,m,u),e==="focusout"&&(k=m._wrapperState)&&k.controlled&&m.type==="number"&&am(m,"number",m.value)}switch(k=u?ci(u):window,e){case"focusin":(lx(k)||k.contentEditable==="true")&&(oi=k,xm=u,Bo=null);break;case"focusout":Bo=xm=oi=null;break;case"mousedown":vm=!0;break;case"contextmenu":case"mouseup":case"dragend":vm=!1,mx(f,r,h);break;case"selectionchange":if(x2)break;case"keydown":case"keyup":mx(f,r,h)}var T;if(sp)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else ii?g0(e,r)&&(P="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(P="onCompositionStart");P&&(p0&&r.locale!=="ko"&&(ii||P!=="onCompositionStart"?P==="onCompositionEnd"&&ii&&(T=h0()):(As=h,tp="value"in As?As.value:As.textContent,ii=!0)),k=Zc(u,P),0<k.length&&(P=new sx(P,e,null,r,h),f.push({event:P,listeners:k}),T?P.data=T:(T=x0(r),T!==null&&(P.data=T)))),(T=a2?i2(e,r):o2(e,r))&&(u=Zc(u,"onBeforeInput"),0<u.length&&(h=new sx("onBeforeInput","beforeinput",null,r,h),f.push({event:h,listeners:u}),h.data=T))}T0(f,t)})}function il(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Zc(e,t){for(var r=t+"Capture",n=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=Jo(e,r),i!=null&&n.unshift(il(e,i,a)),i=Jo(e,t),i!=null&&n.push(il(e,i,a))),e=e.return}return n}function Qa(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function gx(e,t,r,n,a){for(var i=t._reactName,o=[];r!==null&&r!==n;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&u!==null&&(l=u,a?(c=Jo(r,i),c!=null&&o.unshift(il(r,c,l))):a||(c=Jo(r,i),c!=null&&o.push(il(r,c,l)))),r=r.return}o.length!==0&&e.push({event:t,listeners:o})}var b2=/\r\n?/g,j2=/\u0000|\uFFFD/g;function xx(e){return(typeof e=="string"?e:""+e).replace(b2,`
`).replace(j2,"")}function ic(e,t,r){if(t=xx(t),xx(e)!==t&&r)throw Error(W(425))}function Xc(){}var ym=null,wm=null;function bm(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var jm=typeof setTimeout=="function"?setTimeout:void 0,N2=typeof clearTimeout=="function"?clearTimeout:void 0,vx=typeof Promise=="function"?Promise:void 0,C2=typeof queueMicrotask=="function"?queueMicrotask:typeof vx<"u"?function(e){return vx.resolve(null).then(e).catch(S2)}:jm;function S2(e){setTimeout(function(){throw e})}function wf(e,t){var r=t,n=0;do{var a=r.nextSibling;if(e.removeChild(r),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(n===0){e.removeChild(a),rl(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=a}while(r);rl(t)}function Us(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function yx(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var to=Math.random().toString(36).slice(2),Nn="__reactFiber$"+to,ol="__reactProps$"+to,ts="__reactContainer$"+to,Nm="__reactEvents$"+to,_2="__reactListeners$"+to,E2="__reactHandles$"+to;function pa(e){var t=e[Nn];if(t)return t;for(var r=e.parentNode;r;){if(t=r[ts]||r[Nn]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=yx(e);e!==null;){if(r=e[Nn])return r;e=yx(e)}return t}e=r,r=e.parentNode}return null}function Ml(e){return e=e[Nn]||e[ts],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ci(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(W(33))}function td(e){return e[ol]||null}var Cm=[],ui=-1;function ta(e){return{current:e}}function nt(e){0>ui||(e.current=Cm[ui],Cm[ui]=null,ui--)}function Je(e,t){ui++,Cm[ui]=e.current,e.current=t}var Ks={},Ht=ta(Ks),mr=ta(!1),ka=Ks;function Vi(e,t){var r=e.type.contextTypes;if(!r)return Ks;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in r)a[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function hr(e){return e=e.childContextTypes,e!=null}function Jc(){nt(mr),nt(Ht)}function wx(e,t,r){if(Ht.current!==Ks)throw Error(W(168));Je(Ht,t),Je(mr,r)}function R0(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in t))throw Error(W(108,d_(e)||"Unknown",a));return ct({},r,n)}function eu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ks,ka=Ht.current,Je(Ht,e),Je(mr,mr.current),!0}function bx(e,t,r){var n=e.stateNode;if(!n)throw Error(W(169));r?(e=R0(e,t,ka),n.__reactInternalMemoizedMergedChildContext=e,nt(mr),nt(Ht),Je(Ht,e)):nt(mr),Je(mr,r)}var Un=null,rd=!1,bf=!1;function A0(e){Un===null?Un=[e]:Un.push(e)}function k2(e){rd=!0,A0(e)}function ra(){if(!bf&&Un!==null){bf=!0;var e=0,t=Qe;try{var r=Un;for(Qe=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Un=null,rd=!1}catch(a){throw Un!==null&&(Un=Un.slice(e+1)),n0(Zh,ra),a}finally{Qe=t,bf=!1}}return null}var di=[],fi=0,tu=null,ru=0,Or=[],Dr=0,Ta=null,Vn=1,Bn="";function ua(e,t){di[fi++]=ru,di[fi++]=tu,tu=e,ru=t}function I0(e,t,r){Or[Dr++]=Vn,Or[Dr++]=Bn,Or[Dr++]=Ta,Ta=e;var n=Vn;e=Bn;var a=32-tn(n)-1;n&=~(1<<a),r+=1;var i=32-tn(t)+a;if(30<i){var o=a-a%5;i=(n&(1<<o)-1).toString(32),n>>=o,a-=o,Vn=1<<32-tn(t)+a|r<<a|n,Bn=i+e}else Vn=1<<i|r<<a|n,Bn=e}function ip(e){e.return!==null&&(ua(e,1),I0(e,1,0))}function op(e){for(;e===tu;)tu=di[--fi],di[fi]=null,ru=di[--fi],di[fi]=null;for(;e===Ta;)Ta=Or[--Dr],Or[Dr]=null,Bn=Or[--Dr],Or[Dr]=null,Vn=Or[--Dr],Or[Dr]=null}var Cr=null,Nr=null,at=!1,Xr=null;function M0(e,t){var r=Fr(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function jx(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Cr=e,Nr=Us(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Cr=e,Nr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Ta!==null?{id:Vn,overflow:Bn}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Fr(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Cr=e,Nr=null,!0):!1;default:return!1}}function Sm(e){return(e.mode&1)!==0&&(e.flags&128)===0}function _m(e){if(at){var t=Nr;if(t){var r=t;if(!jx(e,t)){if(Sm(e))throw Error(W(418));t=Us(r.nextSibling);var n=Cr;t&&jx(e,t)?M0(n,r):(e.flags=e.flags&-4097|2,at=!1,Cr=e)}}else{if(Sm(e))throw Error(W(418));e.flags=e.flags&-4097|2,at=!1,Cr=e}}}function Nx(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Cr=e}function oc(e){if(e!==Cr)return!1;if(!at)return Nx(e),at=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!bm(e.type,e.memoizedProps)),t&&(t=Nr)){if(Sm(e))throw O0(),Error(W(418));for(;t;)M0(e,t),t=Us(t.nextSibling)}if(Nx(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(W(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Nr=Us(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Nr=null}}else Nr=Cr?Us(e.stateNode.nextSibling):null;return!0}function O0(){for(var e=Nr;e;)e=Us(e.nextSibling)}function Bi(){Nr=Cr=null,at=!1}function lp(e){Xr===null?Xr=[e]:Xr.push(e)}var T2=ls.ReactCurrentBatchConfig;function wo(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(W(309));var n=r.stateNode}if(!n)throw Error(W(147,e));var a=n,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var l=a.refs;o===null?delete l[i]:l[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(W(284));if(!r._owner)throw Error(W(290,e))}return e}function lc(e,t){throw e=Object.prototype.toString.call(t),Error(W(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Cx(e){var t=e._init;return t(e._payload)}function D0(e){function t(g,x){if(e){var w=g.deletions;w===null?(g.deletions=[x],g.flags|=16):w.push(x)}}function r(g,x){if(!e)return null;for(;x!==null;)t(g,x),x=x.sibling;return null}function n(g,x){for(g=new Map;x!==null;)x.key!==null?g.set(x.key,x):g.set(x.index,x),x=x.sibling;return g}function a(g,x){return g=Hs(g,x),g.index=0,g.sibling=null,g}function i(g,x,w){return g.index=w,e?(w=g.alternate,w!==null?(w=w.index,w<x?(g.flags|=2,x):w):(g.flags|=2,x)):(g.flags|=1048576,x)}function o(g){return e&&g.alternate===null&&(g.flags|=2),g}function l(g,x,w,N){return x===null||x.tag!==6?(x=kf(w,g.mode,N),x.return=g,x):(x=a(x,w),x.return=g,x)}function c(g,x,w,N){var C=w.type;return C===ai?h(g,x,w.props.children,N,w.key):x!==null&&(x.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===xs&&Cx(C)===x.type)?(N=a(x,w.props),N.ref=wo(g,x,w),N.return=g,N):(N=Oc(w.type,w.key,w.props,null,g.mode,N),N.ref=wo(g,x,w),N.return=g,N)}function u(g,x,w,N){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=Tf(w,g.mode,N),x.return=g,x):(x=a(x,w.children||[]),x.return=g,x)}function h(g,x,w,N,C){return x===null||x.tag!==7?(x=Ea(w,g.mode,N,C),x.return=g,x):(x=a(x,w),x.return=g,x)}function f(g,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=kf(""+x,g.mode,w),x.return=g,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Zl:return w=Oc(x.type,x.key,x.props,null,g.mode,w),w.ref=wo(g,null,x),w.return=g,w;case si:return x=Tf(x,g.mode,w),x.return=g,x;case xs:var N=x._init;return f(g,N(x._payload),w)}if(To(x)||po(x))return x=Ea(x,g.mode,w,null),x.return=g,x;lc(g,x)}return null}function m(g,x,w,N){var C=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return C!==null?null:l(g,x,""+w,N);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Zl:return w.key===C?c(g,x,w,N):null;case si:return w.key===C?u(g,x,w,N):null;case xs:return C=w._init,m(g,x,C(w._payload),N)}if(To(w)||po(w))return C!==null?null:h(g,x,w,N,null);lc(g,w)}return null}function y(g,x,w,N,C){if(typeof N=="string"&&N!==""||typeof N=="number")return g=g.get(w)||null,l(x,g,""+N,C);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case Zl:return g=g.get(N.key===null?w:N.key)||null,c(x,g,N,C);case si:return g=g.get(N.key===null?w:N.key)||null,u(x,g,N,C);case xs:var k=N._init;return y(g,x,w,k(N._payload),C)}if(To(N)||po(N))return g=g.get(w)||null,h(x,g,N,C,null);lc(x,N)}return null}function v(g,x,w,N){for(var C=null,k=null,T=x,P=x=0,I=null;T!==null&&P<w.length;P++){T.index>P?(I=T,T=null):I=T.sibling;var D=m(g,T,w[P],N);if(D===null){T===null&&(T=I);break}e&&T&&D.alternate===null&&t(g,T),x=i(D,x,P),k===null?C=D:k.sibling=D,k=D,T=I}if(P===w.length)return r(g,T),at&&ua(g,P),C;if(T===null){for(;P<w.length;P++)T=f(g,w[P],N),T!==null&&(x=i(T,x,P),k===null?C=T:k.sibling=T,k=T);return at&&ua(g,P),C}for(T=n(g,T);P<w.length;P++)I=y(T,g,P,w[P],N),I!==null&&(e&&I.alternate!==null&&T.delete(I.key===null?P:I.key),x=i(I,x,P),k===null?C=I:k.sibling=I,k=I);return e&&T.forEach(function(E){return t(g,E)}),at&&ua(g,P),C}function p(g,x,w,N){var C=po(w);if(typeof C!="function")throw Error(W(150));if(w=C.call(w),w==null)throw Error(W(151));for(var k=C=null,T=x,P=x=0,I=null,D=w.next();T!==null&&!D.done;P++,D=w.next()){T.index>P?(I=T,T=null):I=T.sibling;var E=m(g,T,D.value,N);if(E===null){T===null&&(T=I);break}e&&T&&E.alternate===null&&t(g,T),x=i(E,x,P),k===null?C=E:k.sibling=E,k=E,T=I}if(D.done)return r(g,T),at&&ua(g,P),C;if(T===null){for(;!D.done;P++,D=w.next())D=f(g,D.value,N),D!==null&&(x=i(D,x,P),k===null?C=D:k.sibling=D,k=D);return at&&ua(g,P),C}for(T=n(g,T);!D.done;P++,D=w.next())D=y(T,g,P,D.value,N),D!==null&&(e&&D.alternate!==null&&T.delete(D.key===null?P:D.key),x=i(D,x,P),k===null?C=D:k.sibling=D,k=D);return e&&T.forEach(function(M){return t(g,M)}),at&&ua(g,P),C}function b(g,x,w,N){if(typeof w=="object"&&w!==null&&w.type===ai&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Zl:e:{for(var C=w.key,k=x;k!==null;){if(k.key===C){if(C=w.type,C===ai){if(k.tag===7){r(g,k.sibling),x=a(k,w.props.children),x.return=g,g=x;break e}}else if(k.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===xs&&Cx(C)===k.type){r(g,k.sibling),x=a(k,w.props),x.ref=wo(g,k,w),x.return=g,g=x;break e}r(g,k);break}else t(g,k);k=k.sibling}w.type===ai?(x=Ea(w.props.children,g.mode,N,w.key),x.return=g,g=x):(N=Oc(w.type,w.key,w.props,null,g.mode,N),N.ref=wo(g,x,w),N.return=g,g=N)}return o(g);case si:e:{for(k=w.key;x!==null;){if(x.key===k)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){r(g,x.sibling),x=a(x,w.children||[]),x.return=g,g=x;break e}else{r(g,x);break}else t(g,x);x=x.sibling}x=Tf(w,g.mode,N),x.return=g,g=x}return o(g);case xs:return k=w._init,b(g,x,k(w._payload),N)}if(To(w))return v(g,x,w,N);if(po(w))return p(g,x,w,N);lc(g,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(r(g,x.sibling),x=a(x,w),x.return=g,g=x):(r(g,x),x=kf(w,g.mode,N),x.return=g,g=x),o(g)):r(g,x)}return b}var Hi=D0(!0),F0=D0(!1),nu=ta(null),su=null,mi=null,cp=null;function up(){cp=mi=su=null}function dp(e){var t=nu.current;nt(nu),e._currentValue=t}function Em(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function bi(e,t){su=e,cp=mi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(fr=!0),e.firstContext=null)}function Vr(e){var t=e._currentValue;if(cp!==e)if(e={context:e,memoizedValue:t,next:null},mi===null){if(su===null)throw Error(W(308));mi=e,su.dependencies={lanes:0,firstContext:e}}else mi=mi.next=e;return t}var ga=null;function fp(e){ga===null?ga=[e]:ga.push(e)}function L0(e,t,r,n){var a=t.interleaved;return a===null?(r.next=r,fp(t)):(r.next=a.next,a.next=r),t.interleaved=r,rs(e,n)}function rs(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var vs=!1;function mp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Gn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function zs(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Ve&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,rs(e,r)}return a=n.interleaved,a===null?(t.next=t,fp(n)):(t.next=a.next,a.next=t),n.interleaved=t,rs(e,r)}function Tc(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Xh(e,r)}}function Sx(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?a=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?a=i=t:i=i.next=t}else a=i=t;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function au(e,t,r,n){var a=e.updateQueue;vs=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var h=e.alternate;h!==null&&(h=h.updateQueue,l=h.lastBaseUpdate,l!==o&&(l===null?h.firstBaseUpdate=u:l.next=u,h.lastBaseUpdate=c))}if(i!==null){var f=a.baseState;o=0,h=u=c=null,l=i;do{var m=l.lane,y=l.eventTime;if((n&m)===m){h!==null&&(h=h.next={eventTime:y,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,p=l;switch(m=t,y=r,p.tag){case 1:if(v=p.payload,typeof v=="function"){f=v.call(y,f,m);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=p.payload,m=typeof v=="function"?v.call(y,f,m):v,m==null)break e;f=ct({},f,m);break e;case 2:vs=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,m=a.effects,m===null?a.effects=[l]:m.push(l))}else y={eventTime:y,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},h===null?(u=h=y,c=f):h=h.next=y,o|=m;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;m=l,l=m.next,m.next=null,a.lastBaseUpdate=m,a.shared.pending=null}}while(!0);if(h===null&&(c=f),a.baseState=c,a.firstBaseUpdate=u,a.lastBaseUpdate=h,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);Ra|=o,e.lanes=o,e.memoizedState=f}}function _x(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],a=n.callback;if(a!==null){if(n.callback=null,n=r,typeof a!="function")throw Error(W(191,a));a.call(n)}}}var Ol={},kn=ta(Ol),ll=ta(Ol),cl=ta(Ol);function xa(e){if(e===Ol)throw Error(W(174));return e}function hp(e,t){switch(Je(cl,t),Je(ll,e),Je(kn,Ol),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:om(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=om(t,e)}nt(kn),Je(kn,t)}function Wi(){nt(kn),nt(ll),nt(cl)}function U0(e){xa(cl.current);var t=xa(kn.current),r=om(t,e.type);t!==r&&(Je(ll,e),Je(kn,r))}function pp(e){ll.current===e&&(nt(kn),nt(ll))}var ot=ta(0);function iu(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var jf=[];function gp(){for(var e=0;e<jf.length;e++)jf[e]._workInProgressVersionPrimary=null;jf.length=0}var Pc=ls.ReactCurrentDispatcher,Nf=ls.ReactCurrentBatchConfig,Pa=0,lt=null,Nt=null,Et=null,ou=!1,Ho=!1,ul=0,P2=0;function Dt(){throw Error(W(321))}function xp(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!nn(e[r],t[r]))return!1;return!0}function vp(e,t,r,n,a,i){if(Pa=i,lt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Pc.current=e===null||e.memoizedState===null?M2:O2,e=r(n,a),Ho){i=0;do{if(Ho=!1,ul=0,25<=i)throw Error(W(301));i+=1,Et=Nt=null,t.updateQueue=null,Pc.current=D2,e=r(n,a)}while(Ho)}if(Pc.current=lu,t=Nt!==null&&Nt.next!==null,Pa=0,Et=Nt=lt=null,ou=!1,t)throw Error(W(300));return e}function yp(){var e=ul!==0;return ul=0,e}function hn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Et===null?lt.memoizedState=Et=e:Et=Et.next=e,Et}function Br(){if(Nt===null){var e=lt.alternate;e=e!==null?e.memoizedState:null}else e=Nt.next;var t=Et===null?lt.memoizedState:Et.next;if(t!==null)Et=t,Nt=e;else{if(e===null)throw Error(W(310));Nt=e,e={memoizedState:Nt.memoizedState,baseState:Nt.baseState,baseQueue:Nt.baseQueue,queue:Nt.queue,next:null},Et===null?lt.memoizedState=Et=e:Et=Et.next=e}return Et}function dl(e,t){return typeof t=="function"?t(e):t}function Cf(e){var t=Br(),r=t.queue;if(r===null)throw Error(W(311));r.lastRenderedReducer=e;var n=Nt,a=n.baseQueue,i=r.pending;if(i!==null){if(a!==null){var o=a.next;a.next=i.next,i.next=o}n.baseQueue=a=i,r.pending=null}if(a!==null){i=a.next,n=n.baseState;var l=o=null,c=null,u=i;do{var h=u.lane;if((Pa&h)===h)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var f={lane:h,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,o=n):c=c.next=f,lt.lanes|=h,Ra|=h}u=u.next}while(u!==null&&u!==i);c===null?o=n:c.next=l,nn(n,t.memoizedState)||(fr=!0),t.memoizedState=n,t.baseState=o,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){a=e;do i=a.lane,lt.lanes|=i,Ra|=i,a=a.next;while(a!==e)}else a===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Sf(e){var t=Br(),r=t.queue;if(r===null)throw Error(W(311));r.lastRenderedReducer=e;var n=r.dispatch,a=r.pending,i=t.memoizedState;if(a!==null){r.pending=null;var o=a=a.next;do i=e(i,o.action),o=o.next;while(o!==a);nn(i,t.memoizedState)||(fr=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),r.lastRenderedState=i}return[i,n]}function z0(){}function V0(e,t){var r=lt,n=Br(),a=t(),i=!nn(n.memoizedState,a);if(i&&(n.memoizedState=a,fr=!0),n=n.queue,wp(W0.bind(null,r,n,e),[e]),n.getSnapshot!==t||i||Et!==null&&Et.memoizedState.tag&1){if(r.flags|=2048,fl(9,H0.bind(null,r,n,a,t),void 0,null),kt===null)throw Error(W(349));Pa&30||B0(r,t,a)}return a}function B0(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=lt.updateQueue,t===null?(t={lastEffect:null,stores:null},lt.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function H0(e,t,r,n){t.value=r,t.getSnapshot=n,q0(t)&&K0(e)}function W0(e,t,r){return r(function(){q0(t)&&K0(e)})}function q0(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!nn(e,r)}catch{return!0}}function K0(e){var t=rs(e,1);t!==null&&rn(t,e,1,-1)}function Ex(e){var t=hn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:dl,lastRenderedState:e},t.queue=e,e=e.dispatch=I2.bind(null,lt,e),[t.memoizedState,e]}function fl(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=lt.updateQueue,t===null?(t={lastEffect:null,stores:null},lt.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function G0(){return Br().memoizedState}function Rc(e,t,r,n){var a=hn();lt.flags|=e,a.memoizedState=fl(1|t,r,void 0,n===void 0?null:n)}function nd(e,t,r,n){var a=Br();n=n===void 0?null:n;var i=void 0;if(Nt!==null){var o=Nt.memoizedState;if(i=o.destroy,n!==null&&xp(n,o.deps)){a.memoizedState=fl(t,r,i,n);return}}lt.flags|=e,a.memoizedState=fl(1|t,r,i,n)}function kx(e,t){return Rc(8390656,8,e,t)}function wp(e,t){return nd(2048,8,e,t)}function Q0(e,t){return nd(4,2,e,t)}function Y0(e,t){return nd(4,4,e,t)}function Z0(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function X0(e,t,r){return r=r!=null?r.concat([e]):null,nd(4,4,Z0.bind(null,t,e),r)}function bp(){}function J0(e,t){var r=Br();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&xp(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function ew(e,t){var r=Br();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&xp(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function tw(e,t,r){return Pa&21?(nn(r,t)||(r=i0(),lt.lanes|=r,Ra|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,fr=!0),e.memoizedState=r)}function R2(e,t){var r=Qe;Qe=r!==0&&4>r?r:4,e(!0);var n=Nf.transition;Nf.transition={};try{e(!1),t()}finally{Qe=r,Nf.transition=n}}function rw(){return Br().memoizedState}function A2(e,t,r){var n=Bs(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},nw(e))sw(t,r);else if(r=L0(e,t,r,n),r!==null){var a=er();rn(r,e,n,a),aw(r,t,n)}}function I2(e,t,r){var n=Bs(e),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(nw(e))sw(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,r);if(a.hasEagerState=!0,a.eagerState=l,nn(l,o)){var c=t.interleaved;c===null?(a.next=a,fp(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}r=L0(e,t,a,n),r!==null&&(a=er(),rn(r,e,n,a),aw(r,t,n))}}function nw(e){var t=e.alternate;return e===lt||t!==null&&t===lt}function sw(e,t){Ho=ou=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function aw(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Xh(e,r)}}var lu={readContext:Vr,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useInsertionEffect:Dt,useLayoutEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useMutableSource:Dt,useSyncExternalStore:Dt,useId:Dt,unstable_isNewReconciler:!1},M2={readContext:Vr,useCallback:function(e,t){return hn().memoizedState=[e,t===void 0?null:t],e},useContext:Vr,useEffect:kx,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Rc(4194308,4,Z0.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Rc(4194308,4,e,t)},useInsertionEffect:function(e,t){return Rc(4,2,e,t)},useMemo:function(e,t){var r=hn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=hn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=A2.bind(null,lt,e),[n.memoizedState,e]},useRef:function(e){var t=hn();return e={current:e},t.memoizedState=e},useState:Ex,useDebugValue:bp,useDeferredValue:function(e){return hn().memoizedState=e},useTransition:function(){var e=Ex(!1),t=e[0];return e=R2.bind(null,e[1]),hn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=lt,a=hn();if(at){if(r===void 0)throw Error(W(407));r=r()}else{if(r=t(),kt===null)throw Error(W(349));Pa&30||B0(n,t,r)}a.memoizedState=r;var i={value:r,getSnapshot:t};return a.queue=i,kx(W0.bind(null,n,i,e),[e]),n.flags|=2048,fl(9,H0.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=hn(),t=kt.identifierPrefix;if(at){var r=Bn,n=Vn;r=(n&~(1<<32-tn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=ul++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=P2++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},O2={readContext:Vr,useCallback:J0,useContext:Vr,useEffect:wp,useImperativeHandle:X0,useInsertionEffect:Q0,useLayoutEffect:Y0,useMemo:ew,useReducer:Cf,useRef:G0,useState:function(){return Cf(dl)},useDebugValue:bp,useDeferredValue:function(e){var t=Br();return tw(t,Nt.memoizedState,e)},useTransition:function(){var e=Cf(dl)[0],t=Br().memoizedState;return[e,t]},useMutableSource:z0,useSyncExternalStore:V0,useId:rw,unstable_isNewReconciler:!1},D2={readContext:Vr,useCallback:J0,useContext:Vr,useEffect:wp,useImperativeHandle:X0,useInsertionEffect:Q0,useLayoutEffect:Y0,useMemo:ew,useReducer:Sf,useRef:G0,useState:function(){return Sf(dl)},useDebugValue:bp,useDeferredValue:function(e){var t=Br();return Nt===null?t.memoizedState=e:tw(t,Nt.memoizedState,e)},useTransition:function(){var e=Sf(dl)[0],t=Br().memoizedState;return[e,t]},useMutableSource:z0,useSyncExternalStore:V0,useId:rw,unstable_isNewReconciler:!1};function Qr(e,t){if(e&&e.defaultProps){t=ct({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function km(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:ct({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var sd={isMounted:function(e){return(e=e._reactInternals)?Ba(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=er(),a=Bs(e),i=Gn(n,a);i.payload=t,r!=null&&(i.callback=r),t=zs(e,i,a),t!==null&&(rn(t,e,a,n),Tc(t,e,a))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=er(),a=Bs(e),i=Gn(n,a);i.tag=1,i.payload=t,r!=null&&(i.callback=r),t=zs(e,i,a),t!==null&&(rn(t,e,a,n),Tc(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=er(),n=Bs(e),a=Gn(r,n);a.tag=2,t!=null&&(a.callback=t),t=zs(e,a,n),t!==null&&(rn(t,e,n,r),Tc(t,e,n))}};function Tx(e,t,r,n,a,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,i,o):t.prototype&&t.prototype.isPureReactComponent?!sl(r,n)||!sl(a,i):!0}function iw(e,t,r){var n=!1,a=Ks,i=t.contextType;return typeof i=="object"&&i!==null?i=Vr(i):(a=hr(t)?ka:Ht.current,n=t.contextTypes,i=(n=n!=null)?Vi(e,a):Ks),t=new t(r,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=sd,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function Px(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&sd.enqueueReplaceState(t,t.state,null)}function Tm(e,t,r,n){var a=e.stateNode;a.props=r,a.state=e.memoizedState,a.refs={},mp(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=Vr(i):(i=hr(t)?ka:Ht.current,a.context=Vi(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(km(e,t,i,r),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&sd.enqueueReplaceState(a,a.state,null),au(e,r,a,n),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function qi(e,t){try{var r="",n=t;do r+=u_(n),n=n.return;while(n);var a=r}catch(i){a=`
Error generating stack: `+i.message+`
`+i.stack}return{value:e,source:t,stack:a,digest:null}}function _f(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Pm(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var F2=typeof WeakMap=="function"?WeakMap:Map;function ow(e,t,r){r=Gn(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){uu||(uu=!0,Um=n),Pm(e,t)},r}function lw(e,t,r){r=Gn(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var a=t.value;r.payload=function(){return n(a)},r.callback=function(){Pm(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){Pm(e,t),typeof n!="function"&&(Vs===null?Vs=new Set([this]):Vs.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function Rx(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new F2;var a=new Set;n.set(t,a)}else a=n.get(t),a===void 0&&(a=new Set,n.set(t,a));a.has(r)||(a.add(r),e=Z2.bind(null,e,t,r),t.then(e,e))}function Ax(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ix(e,t,r,n,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Gn(-1,1),t.tag=2,zs(r,t,1))),r.lanes|=1),e)}var L2=ls.ReactCurrentOwner,fr=!1;function Qt(e,t,r,n){t.child=e===null?F0(t,null,r,n):Hi(t,e.child,r,n)}function Mx(e,t,r,n,a){r=r.render;var i=t.ref;return bi(t,a),n=vp(e,t,r,n,i,a),r=yp(),e!==null&&!fr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,ns(e,t,a)):(at&&r&&ip(t),t.flags|=1,Qt(e,t,n,a),t.child)}function Ox(e,t,r,n,a){if(e===null){var i=r.type;return typeof i=="function"&&!Tp(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,cw(e,t,i,n,a)):(e=Oc(r.type,null,n,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var o=i.memoizedProps;if(r=r.compare,r=r!==null?r:sl,r(o,n)&&e.ref===t.ref)return ns(e,t,a)}return t.flags|=1,e=Hs(i,n),e.ref=t.ref,e.return=t,t.child=e}function cw(e,t,r,n,a){if(e!==null){var i=e.memoizedProps;if(sl(i,n)&&e.ref===t.ref)if(fr=!1,t.pendingProps=n=i,(e.lanes&a)!==0)e.flags&131072&&(fr=!0);else return t.lanes=e.lanes,ns(e,t,a)}return Rm(e,t,r,n,a)}function uw(e,t,r){var n=t.pendingProps,a=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Je(pi,br),br|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Je(pi,br),br|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,Je(pi,br),br|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,Je(pi,br),br|=n;return Qt(e,t,a,r),t.child}function dw(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Rm(e,t,r,n,a){var i=hr(r)?ka:Ht.current;return i=Vi(t,i),bi(t,a),r=vp(e,t,r,n,i,a),n=yp(),e!==null&&!fr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,ns(e,t,a)):(at&&n&&ip(t),t.flags|=1,Qt(e,t,r,a),t.child)}function Dx(e,t,r,n,a){if(hr(r)){var i=!0;eu(t)}else i=!1;if(bi(t,a),t.stateNode===null)Ac(e,t),iw(t,r,n),Tm(t,r,n,a),n=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=Vr(u):(u=hr(r)?ka:Ht.current,u=Vi(t,u));var h=r.getDerivedStateFromProps,f=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||c!==u)&&Px(t,o,n,u),vs=!1;var m=t.memoizedState;o.state=m,au(t,n,o,a),c=t.memoizedState,l!==n||m!==c||mr.current||vs?(typeof h=="function"&&(km(t,r,h,n),c=t.memoizedState),(l=vs||Tx(t,r,l,n,m,c,u))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),o.props=n,o.state=c,o.context=u,n=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,$0(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Qr(t.type,l),o.props=u,f=t.pendingProps,m=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=Vr(c):(c=hr(r)?ka:Ht.current,c=Vi(t,c));var y=r.getDerivedStateFromProps;(h=typeof y=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==f||m!==c)&&Px(t,o,n,c),vs=!1,m=t.memoizedState,o.state=m,au(t,n,o,a);var v=t.memoizedState;l!==f||m!==v||mr.current||vs?(typeof y=="function"&&(km(t,r,y,n),v=t.memoizedState),(u=vs||Tx(t,r,u,n,m,v,c)||!1)?(h||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,v,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,v,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=v),o.props=n,o.state=v,o.context=c,n=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),n=!1)}return Am(e,t,r,n,i,a)}function Am(e,t,r,n,a,i){dw(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return a&&bx(t,r,!1),ns(e,t,i);n=t.stateNode,L2.current=t;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=Hi(t,e.child,null,i),t.child=Hi(t,null,l,i)):Qt(e,t,l,i),t.memoizedState=n.state,a&&bx(t,r,!0),t.child}function fw(e){var t=e.stateNode;t.pendingContext?wx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&wx(e,t.context,!1),hp(e,t.containerInfo)}function Fx(e,t,r,n,a){return Bi(),lp(a),t.flags|=256,Qt(e,t,r,n),t.child}var Im={dehydrated:null,treeContext:null,retryLane:0};function Mm(e){return{baseLanes:e,cachePool:null,transitions:null}}function mw(e,t,r){var n=t.pendingProps,a=ot.current,i=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),Je(ot,a&1),e===null)return _m(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,i?(n=t.mode,i=t.child,o={mode:"hidden",children:o},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=od(o,n,0,null),e=Ea(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Mm(r),t.memoizedState=Im,e):jp(t,o));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return $2(e,t,o,n,l,a,r);if(i){i=n.fallback,o=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:n.children};return!(o&1)&&t.child!==a?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=Hs(a,c),n.subtreeFlags=a.subtreeFlags&14680064),l!==null?i=Hs(l,i):(i=Ea(i,o,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,o=e.child.memoizedState,o=o===null?Mm(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~r,t.memoizedState=Im,n}return i=e.child,e=i.sibling,n=Hs(i,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function jp(e,t){return t=od({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function cc(e,t,r,n){return n!==null&&lp(n),Hi(t,e.child,null,r),e=jp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $2(e,t,r,n,a,i,o){if(r)return t.flags&256?(t.flags&=-257,n=_f(Error(W(422))),cc(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,a=t.mode,n=od({mode:"visible",children:n.children},a,0,null),i=Ea(i,a,o,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&Hi(t,e.child,null,o),t.child.memoizedState=Mm(o),t.memoizedState=Im,i);if(!(t.mode&1))return cc(e,t,o,null);if(a.data==="$!"){if(n=a.nextSibling&&a.nextSibling.dataset,n)var l=n.dgst;return n=l,i=Error(W(419)),n=_f(i,n,void 0),cc(e,t,o,n)}if(l=(o&e.childLanes)!==0,fr||l){if(n=kt,n!==null){switch(o&-o){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(n.suspendedLanes|o)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,rs(e,a),rn(n,e,a,-1))}return kp(),n=_f(Error(W(421))),cc(e,t,o,n)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=X2.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,Nr=Us(a.nextSibling),Cr=t,at=!0,Xr=null,e!==null&&(Or[Dr++]=Vn,Or[Dr++]=Bn,Or[Dr++]=Ta,Vn=e.id,Bn=e.overflow,Ta=t),t=jp(t,n.children),t.flags|=4096,t)}function Lx(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Em(e.return,t,r)}function Ef(e,t,r,n,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=a)}function hw(e,t,r){var n=t.pendingProps,a=n.revealOrder,i=n.tail;if(Qt(e,t,n.children,r),n=ot.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Lx(e,r,t);else if(e.tag===19)Lx(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Je(ot,n),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(r=t.child,a=null;r!==null;)e=r.alternate,e!==null&&iu(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),Ef(t,!1,a,r,i);break;case"backwards":for(r=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&iu(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}Ef(t,!0,r,null,i);break;case"together":Ef(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ac(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ns(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Ra|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(W(153));if(t.child!==null){for(e=t.child,r=Hs(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Hs(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function U2(e,t,r){switch(t.tag){case 3:fw(t),Bi();break;case 5:U0(t);break;case 1:hr(t.type)&&eu(t);break;case 4:hp(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,a=t.memoizedProps.value;Je(nu,n._currentValue),n._currentValue=a;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Je(ot,ot.current&1),t.flags|=128,null):r&t.child.childLanes?mw(e,t,r):(Je(ot,ot.current&1),e=ns(e,t,r),e!==null?e.sibling:null);Je(ot,ot.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return hw(e,t,r);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Je(ot,ot.current),n)break;return null;case 22:case 23:return t.lanes=0,uw(e,t,r)}return ns(e,t,r)}var pw,Om,gw,xw;pw=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Om=function(){};gw=function(e,t,r,n){var a=e.memoizedProps;if(a!==n){e=t.stateNode,xa(kn.current);var i=null;switch(r){case"input":a=nm(e,a),n=nm(e,n),i=[];break;case"select":a=ct({},a,{value:void 0}),n=ct({},n,{value:void 0}),i=[];break;case"textarea":a=im(e,a),n=im(e,n),i=[];break;default:typeof a.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Xc)}lm(r,n);var o;r=null;for(u in a)if(!n.hasOwnProperty(u)&&a.hasOwnProperty(u)&&a[u]!=null)if(u==="style"){var l=a[u];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Zo.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var c=n[u];if(l=a!=null?a[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(i||(i=[]),i.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Zo.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&rt("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}r&&(i=i||[]).push("style",r);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};xw=function(e,t,r,n){r!==n&&(t.flags|=4)};function bo(e,t){if(!at)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ft(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags&14680064,n|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function z2(e,t,r){var n=t.pendingProps;switch(op(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ft(t),null;case 1:return hr(t.type)&&Jc(),Ft(t),null;case 3:return n=t.stateNode,Wi(),nt(mr),nt(Ht),gp(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(oc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Xr!==null&&(Bm(Xr),Xr=null))),Om(e,t),Ft(t),null;case 5:pp(t);var a=xa(cl.current);if(r=t.type,e!==null&&t.stateNode!=null)gw(e,t,r,n,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(W(166));return Ft(t),null}if(e=xa(kn.current),oc(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[Nn]=t,n[ol]=i,e=(t.mode&1)!==0,r){case"dialog":rt("cancel",n),rt("close",n);break;case"iframe":case"object":case"embed":rt("load",n);break;case"video":case"audio":for(a=0;a<Ro.length;a++)rt(Ro[a],n);break;case"source":rt("error",n);break;case"img":case"image":case"link":rt("error",n),rt("load",n);break;case"details":rt("toggle",n);break;case"input":Kg(n,i),rt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},rt("invalid",n);break;case"textarea":Qg(n,i),rt("invalid",n)}lm(r,i),a=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?n.textContent!==l&&(i.suppressHydrationWarning!==!0&&ic(n.textContent,l,e),a=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&ic(n.textContent,l,e),a=["children",""+l]):Zo.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&rt("scroll",n)}switch(r){case"input":Xl(n),Gg(n,i,!0);break;case"textarea":Xl(n),Yg(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=Xc)}n=a,t.updateQueue=n,n!==null&&(t.flags|=4)}else{o=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Wy(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Nn]=t,e[ol]=n,pw(e,t,!1,!1),t.stateNode=e;e:{switch(o=cm(r,n),r){case"dialog":rt("cancel",e),rt("close",e),a=n;break;case"iframe":case"object":case"embed":rt("load",e),a=n;break;case"video":case"audio":for(a=0;a<Ro.length;a++)rt(Ro[a],e);a=n;break;case"source":rt("error",e),a=n;break;case"img":case"image":case"link":rt("error",e),rt("load",e),a=n;break;case"details":rt("toggle",e),a=n;break;case"input":Kg(e,n),a=nm(e,n),rt("invalid",e);break;case"option":a=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},a=ct({},n,{value:void 0}),rt("invalid",e);break;case"textarea":Qg(e,n),a=im(e,n),rt("invalid",e);break;default:a=n}lm(r,a),l=a;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?Gy(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&qy(e,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&Xo(e,c):typeof c=="number"&&Xo(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Zo.hasOwnProperty(i)?c!=null&&i==="onScroll"&&rt("scroll",e):c!=null&&qh(e,i,c,o))}switch(r){case"input":Xl(e),Gg(e,n,!1);break;case"textarea":Xl(e),Yg(e);break;case"option":n.value!=null&&e.setAttribute("value",""+qs(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?xi(e,!!n.multiple,i,!1):n.defaultValue!=null&&xi(e,!!n.multiple,n.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=Xc)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ft(t),null;case 6:if(e&&t.stateNode!=null)xw(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(W(166));if(r=xa(cl.current),xa(kn.current),oc(t)){if(n=t.stateNode,r=t.memoizedProps,n[Nn]=t,(i=n.nodeValue!==r)&&(e=Cr,e!==null))switch(e.tag){case 3:ic(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ic(n.nodeValue,r,(e.mode&1)!==0)}i&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Nn]=t,t.stateNode=n}return Ft(t),null;case 13:if(nt(ot),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(at&&Nr!==null&&t.mode&1&&!(t.flags&128))O0(),Bi(),t.flags|=98560,i=!1;else if(i=oc(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(W(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(W(317));i[Nn]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ft(t),i=!1}else Xr!==null&&(Bm(Xr),Xr=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||ot.current&1?St===0&&(St=3):kp())),t.updateQueue!==null&&(t.flags|=4),Ft(t),null);case 4:return Wi(),Om(e,t),e===null&&al(t.stateNode.containerInfo),Ft(t),null;case 10:return dp(t.type._context),Ft(t),null;case 17:return hr(t.type)&&Jc(),Ft(t),null;case 19:if(nt(ot),i=t.memoizedState,i===null)return Ft(t),null;if(n=(t.flags&128)!==0,o=i.rendering,o===null)if(n)bo(i,!1);else{if(St!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=iu(e),o!==null){for(t.flags|=128,bo(i,!1),n=o.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)i=r,e=n,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Je(ot,ot.current&1|2),t.child}e=e.sibling}i.tail!==null&&vt()>Ki&&(t.flags|=128,n=!0,bo(i,!1),t.lanes=4194304)}else{if(!n)if(e=iu(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),bo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!at)return Ft(t),null}else 2*vt()-i.renderingStartTime>Ki&&r!==1073741824&&(t.flags|=128,n=!0,bo(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(r=i.last,r!==null?r.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=vt(),t.sibling=null,r=ot.current,Je(ot,n?r&1|2:r&1),t):(Ft(t),null);case 22:case 23:return Ep(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?br&1073741824&&(Ft(t),t.subtreeFlags&6&&(t.flags|=8192)):Ft(t),null;case 24:return null;case 25:return null}throw Error(W(156,t.tag))}function V2(e,t){switch(op(t),t.tag){case 1:return hr(t.type)&&Jc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wi(),nt(mr),nt(Ht),gp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return pp(t),null;case 13:if(nt(ot),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(W(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return nt(ot),null;case 4:return Wi(),null;case 10:return dp(t.type._context),null;case 22:case 23:return Ep(),null;case 24:return null;default:return null}}var uc=!1,Bt=!1,B2=typeof WeakSet=="function"?WeakSet:Set,oe=null;function hi(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){mt(e,t,n)}else r.current=null}function Dm(e,t,r){try{r()}catch(n){mt(e,t,n)}}var $x=!1;function H2(e,t){if(ym=Qc,e=j0(),ap(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,l=-1,c=-1,u=0,h=0,f=e,m=null;t:for(;;){for(var y;f!==r||a!==0&&f.nodeType!==3||(l=o+a),f!==i||n!==0&&f.nodeType!==3||(c=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(y=f.firstChild)!==null;)m=f,f=y;for(;;){if(f===e)break t;if(m===r&&++u===a&&(l=o),m===i&&++h===n&&(c=o),(y=f.nextSibling)!==null)break;f=m,m=f.parentNode}f=y}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(wm={focusedElem:e,selectionRange:r},Qc=!1,oe=t;oe!==null;)if(t=oe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,oe=e;else for(;oe!==null;){t=oe;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var p=v.memoizedProps,b=v.memoizedState,g=t.stateNode,x=g.getSnapshotBeforeUpdate(t.elementType===t.type?p:Qr(t.type,p),b);g.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(W(163))}}catch(N){mt(t,t.return,N)}if(e=t.sibling,e!==null){e.return=t.return,oe=e;break}oe=t.return}return v=$x,$x=!1,v}function Wo(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&Dm(t,r,i)}a=a.next}while(a!==n)}}function ad(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Fm(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function vw(e){var t=e.alternate;t!==null&&(e.alternate=null,vw(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Nn],delete t[ol],delete t[Nm],delete t[_2],delete t[E2])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function yw(e){return e.tag===5||e.tag===3||e.tag===4}function Ux(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||yw(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Lm(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Xc));else if(n!==4&&(e=e.child,e!==null))for(Lm(e,t,r),e=e.sibling;e!==null;)Lm(e,t,r),e=e.sibling}function $m(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for($m(e,t,r),e=e.sibling;e!==null;)$m(e,t,r),e=e.sibling}var Rt=null,Zr=!1;function fs(e,t,r){for(r=r.child;r!==null;)ww(e,t,r),r=r.sibling}function ww(e,t,r){if(En&&typeof En.onCommitFiberUnmount=="function")try{En.onCommitFiberUnmount(Zu,r)}catch{}switch(r.tag){case 5:Bt||hi(r,t);case 6:var n=Rt,a=Zr;Rt=null,fs(e,t,r),Rt=n,Zr=a,Rt!==null&&(Zr?(e=Rt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Rt.removeChild(r.stateNode));break;case 18:Rt!==null&&(Zr?(e=Rt,r=r.stateNode,e.nodeType===8?wf(e.parentNode,r):e.nodeType===1&&wf(e,r),rl(e)):wf(Rt,r.stateNode));break;case 4:n=Rt,a=Zr,Rt=r.stateNode.containerInfo,Zr=!0,fs(e,t,r),Rt=n,Zr=a;break;case 0:case 11:case 14:case 15:if(!Bt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Dm(r,t,o),a=a.next}while(a!==n)}fs(e,t,r);break;case 1:if(!Bt&&(hi(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){mt(r,t,l)}fs(e,t,r);break;case 21:fs(e,t,r);break;case 22:r.mode&1?(Bt=(n=Bt)||r.memoizedState!==null,fs(e,t,r),Bt=n):fs(e,t,r);break;default:fs(e,t,r)}}function zx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new B2),t.forEach(function(n){var a=J2.bind(null,e,n);r.has(n)||(r.add(n),n.then(a,a))})}}function Wr(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var a=r[n];try{var i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:Rt=l.stateNode,Zr=!1;break e;case 3:Rt=l.stateNode.containerInfo,Zr=!0;break e;case 4:Rt=l.stateNode.containerInfo,Zr=!0;break e}l=l.return}if(Rt===null)throw Error(W(160));ww(i,o,a),Rt=null,Zr=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(u){mt(a,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)bw(t,e),t=t.sibling}function bw(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Wr(t,e),mn(e),n&4){try{Wo(3,e,e.return),ad(3,e)}catch(p){mt(e,e.return,p)}try{Wo(5,e,e.return)}catch(p){mt(e,e.return,p)}}break;case 1:Wr(t,e),mn(e),n&512&&r!==null&&hi(r,r.return);break;case 5:if(Wr(t,e),mn(e),n&512&&r!==null&&hi(r,r.return),e.flags&32){var a=e.stateNode;try{Xo(a,"")}catch(p){mt(e,e.return,p)}}if(n&4&&(a=e.stateNode,a!=null)){var i=e.memoizedProps,o=r!==null?r.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&By(a,i),cm(l,o);var u=cm(l,i);for(o=0;o<c.length;o+=2){var h=c[o],f=c[o+1];h==="style"?Gy(a,f):h==="dangerouslySetInnerHTML"?qy(a,f):h==="children"?Xo(a,f):qh(a,h,f,u)}switch(l){case"input":sm(a,i);break;case"textarea":Hy(a,i);break;case"select":var m=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var y=i.value;y!=null?xi(a,!!i.multiple,y,!1):m!==!!i.multiple&&(i.defaultValue!=null?xi(a,!!i.multiple,i.defaultValue,!0):xi(a,!!i.multiple,i.multiple?[]:"",!1))}a[ol]=i}catch(p){mt(e,e.return,p)}}break;case 6:if(Wr(t,e),mn(e),n&4){if(e.stateNode===null)throw Error(W(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(p){mt(e,e.return,p)}}break;case 3:if(Wr(t,e),mn(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{rl(t.containerInfo)}catch(p){mt(e,e.return,p)}break;case 4:Wr(t,e),mn(e);break;case 13:Wr(t,e),mn(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(Sp=vt())),n&4&&zx(e);break;case 22:if(h=r!==null&&r.memoizedState!==null,e.mode&1?(Bt=(u=Bt)||h,Wr(t,e),Bt=u):Wr(t,e),mn(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!h&&e.mode&1)for(oe=e,h=e.child;h!==null;){for(f=oe=h;oe!==null;){switch(m=oe,y=m.child,m.tag){case 0:case 11:case 14:case 15:Wo(4,m,m.return);break;case 1:hi(m,m.return);var v=m.stateNode;if(typeof v.componentWillUnmount=="function"){n=m,r=m.return;try{t=n,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(p){mt(n,r,p)}}break;case 5:hi(m,m.return);break;case 22:if(m.memoizedState!==null){Bx(f);continue}}y!==null?(y.return=m,oe=y):Bx(f)}h=h.sibling}e:for(h=null,f=e;;){if(f.tag===5){if(h===null){h=f;try{a=f.stateNode,u?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,c=f.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=Ky("display",o))}catch(p){mt(e,e.return,p)}}}else if(f.tag===6){if(h===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(p){mt(e,e.return,p)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;h===f&&(h=null),f=f.return}h===f&&(h=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Wr(t,e),mn(e),n&4&&zx(e);break;case 21:break;default:Wr(t,e),mn(e)}}function mn(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(yw(r)){var n=r;break e}r=r.return}throw Error(W(160))}switch(n.tag){case 5:var a=n.stateNode;n.flags&32&&(Xo(a,""),n.flags&=-33);var i=Ux(e);$m(e,i,a);break;case 3:case 4:var o=n.stateNode.containerInfo,l=Ux(e);Lm(e,l,o);break;default:throw Error(W(161))}}catch(c){mt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function W2(e,t,r){oe=e,jw(e)}function jw(e,t,r){for(var n=(e.mode&1)!==0;oe!==null;){var a=oe,i=a.child;if(a.tag===22&&n){var o=a.memoizedState!==null||uc;if(!o){var l=a.alternate,c=l!==null&&l.memoizedState!==null||Bt;l=uc;var u=Bt;if(uc=o,(Bt=c)&&!u)for(oe=a;oe!==null;)o=oe,c=o.child,o.tag===22&&o.memoizedState!==null?Hx(a):c!==null?(c.return=o,oe=c):Hx(a);for(;i!==null;)oe=i,jw(i),i=i.sibling;oe=a,uc=l,Bt=u}Vx(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,oe=i):Vx(e)}}function Vx(e){for(;oe!==null;){var t=oe;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Bt||ad(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Bt)if(r===null)n.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:Qr(t.type,r.memoizedProps);n.componentDidUpdate(a,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&_x(t,i,n);break;case 3:var o=t.updateQueue;if(o!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}_x(t,o,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var h=u.memoizedState;if(h!==null){var f=h.dehydrated;f!==null&&rl(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(W(163))}Bt||t.flags&512&&Fm(t)}catch(m){mt(t,t.return,m)}}if(t===e){oe=null;break}if(r=t.sibling,r!==null){r.return=t.return,oe=r;break}oe=t.return}}function Bx(e){for(;oe!==null;){var t=oe;if(t===e){oe=null;break}var r=t.sibling;if(r!==null){r.return=t.return,oe=r;break}oe=t.return}}function Hx(e){for(;oe!==null;){var t=oe;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{ad(4,t)}catch(c){mt(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var a=t.return;try{n.componentDidMount()}catch(c){mt(t,a,c)}}var i=t.return;try{Fm(t)}catch(c){mt(t,i,c)}break;case 5:var o=t.return;try{Fm(t)}catch(c){mt(t,o,c)}}}catch(c){mt(t,t.return,c)}if(t===e){oe=null;break}var l=t.sibling;if(l!==null){l.return=t.return,oe=l;break}oe=t.return}}var q2=Math.ceil,cu=ls.ReactCurrentDispatcher,Np=ls.ReactCurrentOwner,Lr=ls.ReactCurrentBatchConfig,Ve=0,kt=null,bt=null,It=0,br=0,pi=ta(0),St=0,ml=null,Ra=0,id=0,Cp=0,qo=null,dr=null,Sp=0,Ki=1/0,$n=null,uu=!1,Um=null,Vs=null,dc=!1,Is=null,du=0,Ko=0,zm=null,Ic=-1,Mc=0;function er(){return Ve&6?vt():Ic!==-1?Ic:Ic=vt()}function Bs(e){return e.mode&1?Ve&2&&It!==0?It&-It:T2.transition!==null?(Mc===0&&(Mc=i0()),Mc):(e=Qe,e!==0||(e=window.event,e=e===void 0?16:m0(e.type)),e):1}function rn(e,t,r,n){if(50<Ko)throw Ko=0,zm=null,Error(W(185));Al(e,r,n),(!(Ve&2)||e!==kt)&&(e===kt&&(!(Ve&2)&&(id|=r),St===4&&bs(e,It)),pr(e,n),r===1&&Ve===0&&!(t.mode&1)&&(Ki=vt()+500,rd&&ra()))}function pr(e,t){var r=e.callbackNode;T_(e,t);var n=Gc(e,e===kt?It:0);if(n===0)r!==null&&Jg(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&Jg(r),t===1)e.tag===0?k2(Wx.bind(null,e)):A0(Wx.bind(null,e)),C2(function(){!(Ve&6)&&ra()}),r=null;else{switch(o0(n)){case 1:r=Zh;break;case 4:r=s0;break;case 16:r=Kc;break;case 536870912:r=a0;break;default:r=Kc}r=Pw(r,Nw.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Nw(e,t){if(Ic=-1,Mc=0,Ve&6)throw Error(W(327));var r=e.callbackNode;if(ji()&&e.callbackNode!==r)return null;var n=Gc(e,e===kt?It:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=fu(e,n);else{t=n;var a=Ve;Ve|=2;var i=Sw();(kt!==e||It!==t)&&($n=null,Ki=vt()+500,_a(e,t));do try{Q2();break}catch(l){Cw(e,l)}while(!0);up(),cu.current=i,Ve=a,bt!==null?t=0:(kt=null,It=0,t=St)}if(t!==0){if(t===2&&(a=hm(e),a!==0&&(n=a,t=Vm(e,a))),t===1)throw r=ml,_a(e,0),bs(e,n),pr(e,vt()),r;if(t===6)bs(e,n);else{if(a=e.current.alternate,!(n&30)&&!K2(a)&&(t=fu(e,n),t===2&&(i=hm(e),i!==0&&(n=i,t=Vm(e,i))),t===1))throw r=ml,_a(e,0),bs(e,n),pr(e,vt()),r;switch(e.finishedWork=a,e.finishedLanes=n,t){case 0:case 1:throw Error(W(345));case 2:da(e,dr,$n);break;case 3:if(bs(e,n),(n&130023424)===n&&(t=Sp+500-vt(),10<t)){if(Gc(e,0)!==0)break;if(a=e.suspendedLanes,(a&n)!==n){er(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=jm(da.bind(null,e,dr,$n),t);break}da(e,dr,$n);break;case 4:if(bs(e,n),(n&4194240)===n)break;for(t=e.eventTimes,a=-1;0<n;){var o=31-tn(n);i=1<<o,o=t[o],o>a&&(a=o),n&=~i}if(n=a,n=vt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*q2(n/1960))-n,10<n){e.timeoutHandle=jm(da.bind(null,e,dr,$n),n);break}da(e,dr,$n);break;case 5:da(e,dr,$n);break;default:throw Error(W(329))}}}return pr(e,vt()),e.callbackNode===r?Nw.bind(null,e):null}function Vm(e,t){var r=qo;return e.current.memoizedState.isDehydrated&&(_a(e,t).flags|=256),e=fu(e,t),e!==2&&(t=dr,dr=r,t!==null&&Bm(t)),e}function Bm(e){dr===null?dr=e:dr.push.apply(dr,e)}function K2(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var a=r[n],i=a.getSnapshot;a=a.value;try{if(!nn(i(),a))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function bs(e,t){for(t&=~Cp,t&=~id,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-tn(t),n=1<<r;e[r]=-1,t&=~n}}function Wx(e){if(Ve&6)throw Error(W(327));ji();var t=Gc(e,0);if(!(t&1))return pr(e,vt()),null;var r=fu(e,t);if(e.tag!==0&&r===2){var n=hm(e);n!==0&&(t=n,r=Vm(e,n))}if(r===1)throw r=ml,_a(e,0),bs(e,t),pr(e,vt()),r;if(r===6)throw Error(W(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,da(e,dr,$n),pr(e,vt()),null}function _p(e,t){var r=Ve;Ve|=1;try{return e(t)}finally{Ve=r,Ve===0&&(Ki=vt()+500,rd&&ra())}}function Aa(e){Is!==null&&Is.tag===0&&!(Ve&6)&&ji();var t=Ve;Ve|=1;var r=Lr.transition,n=Qe;try{if(Lr.transition=null,Qe=1,e)return e()}finally{Qe=n,Lr.transition=r,Ve=t,!(Ve&6)&&ra()}}function Ep(){br=pi.current,nt(pi)}function _a(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,N2(r)),bt!==null)for(r=bt.return;r!==null;){var n=r;switch(op(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Jc();break;case 3:Wi(),nt(mr),nt(Ht),gp();break;case 5:pp(n);break;case 4:Wi();break;case 13:nt(ot);break;case 19:nt(ot);break;case 10:dp(n.type._context);break;case 22:case 23:Ep()}r=r.return}if(kt=e,bt=e=Hs(e.current,null),It=br=t,St=0,ml=null,Cp=id=Ra=0,dr=qo=null,ga!==null){for(t=0;t<ga.length;t++)if(r=ga[t],n=r.interleaved,n!==null){r.interleaved=null;var a=n.next,i=r.pending;if(i!==null){var o=i.next;i.next=a,n.next=o}r.pending=n}ga=null}return e}function Cw(e,t){do{var r=bt;try{if(up(),Pc.current=lu,ou){for(var n=lt.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}ou=!1}if(Pa=0,Et=Nt=lt=null,Ho=!1,ul=0,Np.current=null,r===null||r.return===null){St=1,ml=t,bt=null;break}e:{var i=e,o=r.return,l=r,c=t;if(t=It,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,h=l,f=h.tag;if(!(h.mode&1)&&(f===0||f===11||f===15)){var m=h.alternate;m?(h.updateQueue=m.updateQueue,h.memoizedState=m.memoizedState,h.lanes=m.lanes):(h.updateQueue=null,h.memoizedState=null)}var y=Ax(o);if(y!==null){y.flags&=-257,Ix(y,o,l,i,t),y.mode&1&&Rx(i,u,t),t=y,c=u;var v=t.updateQueue;if(v===null){var p=new Set;p.add(c),t.updateQueue=p}else v.add(c);break e}else{if(!(t&1)){Rx(i,u,t),kp();break e}c=Error(W(426))}}else if(at&&l.mode&1){var b=Ax(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Ix(b,o,l,i,t),lp(qi(c,l));break e}}i=c=qi(c,l),St!==4&&(St=2),qo===null?qo=[i]:qo.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=ow(i,c,t);Sx(i,g);break e;case 1:l=c;var x=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Vs===null||!Vs.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var N=lw(i,l,t);Sx(i,N);break e}}i=i.return}while(i!==null)}Ew(r)}catch(C){t=C,bt===r&&r!==null&&(bt=r=r.return);continue}break}while(!0)}function Sw(){var e=cu.current;return cu.current=lu,e===null?lu:e}function kp(){(St===0||St===3||St===2)&&(St=4),kt===null||!(Ra&268435455)&&!(id&268435455)||bs(kt,It)}function fu(e,t){var r=Ve;Ve|=2;var n=Sw();(kt!==e||It!==t)&&($n=null,_a(e,t));do try{G2();break}catch(a){Cw(e,a)}while(!0);if(up(),Ve=r,cu.current=n,bt!==null)throw Error(W(261));return kt=null,It=0,St}function G2(){for(;bt!==null;)_w(bt)}function Q2(){for(;bt!==null&&!w_();)_w(bt)}function _w(e){var t=Tw(e.alternate,e,br);e.memoizedProps=e.pendingProps,t===null?Ew(e):bt=t,Np.current=null}function Ew(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=V2(r,t),r!==null){r.flags&=32767,bt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{St=6,bt=null;return}}else if(r=z2(r,t,br),r!==null){bt=r;return}if(t=t.sibling,t!==null){bt=t;return}bt=t=e}while(t!==null);St===0&&(St=5)}function da(e,t,r){var n=Qe,a=Lr.transition;try{Lr.transition=null,Qe=1,Y2(e,t,r,n)}finally{Lr.transition=a,Qe=n}return null}function Y2(e,t,r,n){do ji();while(Is!==null);if(Ve&6)throw Error(W(327));r=e.finishedWork;var a=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(W(177));e.callbackNode=null,e.callbackPriority=0;var i=r.lanes|r.childLanes;if(P_(e,i),e===kt&&(bt=kt=null,It=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||dc||(dc=!0,Pw(Kc,function(){return ji(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=Lr.transition,Lr.transition=null;var o=Qe;Qe=1;var l=Ve;Ve|=4,Np.current=null,H2(e,r),bw(r,e),g2(wm),Qc=!!ym,wm=ym=null,e.current=r,W2(r),b_(),Ve=l,Qe=o,Lr.transition=i}else e.current=r;if(dc&&(dc=!1,Is=e,du=a),i=e.pendingLanes,i===0&&(Vs=null),C_(r.stateNode),pr(e,vt()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)a=t[r],n(a.value,{componentStack:a.stack,digest:a.digest});if(uu)throw uu=!1,e=Um,Um=null,e;return du&1&&e.tag!==0&&ji(),i=e.pendingLanes,i&1?e===zm?Ko++:(Ko=0,zm=e):Ko=0,ra(),null}function ji(){if(Is!==null){var e=o0(du),t=Lr.transition,r=Qe;try{if(Lr.transition=null,Qe=16>e?16:e,Is===null)var n=!1;else{if(e=Is,Is=null,du=0,Ve&6)throw Error(W(331));var a=Ve;for(Ve|=4,oe=e.current;oe!==null;){var i=oe,o=i.child;if(oe.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(oe=u;oe!==null;){var h=oe;switch(h.tag){case 0:case 11:case 15:Wo(8,h,i)}var f=h.child;if(f!==null)f.return=h,oe=f;else for(;oe!==null;){h=oe;var m=h.sibling,y=h.return;if(vw(h),h===u){oe=null;break}if(m!==null){m.return=y,oe=m;break}oe=y}}}var v=i.alternate;if(v!==null){var p=v.child;if(p!==null){v.child=null;do{var b=p.sibling;p.sibling=null,p=b}while(p!==null)}}oe=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,oe=o;else e:for(;oe!==null;){if(i=oe,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Wo(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,oe=g;break e}oe=i.return}}var x=e.current;for(oe=x;oe!==null;){o=oe;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,oe=w;else e:for(o=x;oe!==null;){if(l=oe,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:ad(9,l)}}catch(C){mt(l,l.return,C)}if(l===o){oe=null;break e}var N=l.sibling;if(N!==null){N.return=l.return,oe=N;break e}oe=l.return}}if(Ve=a,ra(),En&&typeof En.onPostCommitFiberRoot=="function")try{En.onPostCommitFiberRoot(Zu,e)}catch{}n=!0}return n}finally{Qe=r,Lr.transition=t}}return!1}function qx(e,t,r){t=qi(r,t),t=ow(e,t,1),e=zs(e,t,1),t=er(),e!==null&&(Al(e,1,t),pr(e,t))}function mt(e,t,r){if(e.tag===3)qx(e,e,r);else for(;t!==null;){if(t.tag===3){qx(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Vs===null||!Vs.has(n))){e=qi(r,e),e=lw(t,e,1),t=zs(t,e,1),e=er(),t!==null&&(Al(t,1,e),pr(t,e));break}}t=t.return}}function Z2(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=er(),e.pingedLanes|=e.suspendedLanes&r,kt===e&&(It&r)===r&&(St===4||St===3&&(It&130023424)===It&&500>vt()-Sp?_a(e,0):Cp|=r),pr(e,t)}function kw(e,t){t===0&&(e.mode&1?(t=tc,tc<<=1,!(tc&130023424)&&(tc=4194304)):t=1);var r=er();e=rs(e,t),e!==null&&(Al(e,t,r),pr(e,r))}function X2(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),kw(e,r)}function J2(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(W(314))}n!==null&&n.delete(t),kw(e,r)}var Tw;Tw=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||mr.current)fr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return fr=!1,U2(e,t,r);fr=!!(e.flags&131072)}else fr=!1,at&&t.flags&1048576&&I0(t,ru,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Ac(e,t),e=t.pendingProps;var a=Vi(t,Ht.current);bi(t,r),a=vp(null,t,n,e,a,r);var i=yp();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,hr(n)?(i=!0,eu(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,mp(t),a.updater=sd,t.stateNode=a,a._reactInternals=t,Tm(t,n,e,r),t=Am(null,t,n,!0,i,r)):(t.tag=0,at&&i&&ip(t),Qt(null,t,a,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Ac(e,t),e=t.pendingProps,a=n._init,n=a(n._payload),t.type=n,a=t.tag=tE(n),e=Qr(n,e),a){case 0:t=Rm(null,t,n,e,r);break e;case 1:t=Dx(null,t,n,e,r);break e;case 11:t=Mx(null,t,n,e,r);break e;case 14:t=Ox(null,t,n,Qr(n.type,e),r);break e}throw Error(W(306,n,""))}return t;case 0:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Qr(n,a),Rm(e,t,n,a,r);case 1:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Qr(n,a),Dx(e,t,n,a,r);case 3:e:{if(fw(t),e===null)throw Error(W(387));n=t.pendingProps,i=t.memoizedState,a=i.element,$0(e,t),au(t,n,null,r);var o=t.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=qi(Error(W(423)),t),t=Fx(e,t,n,r,a);break e}else if(n!==a){a=qi(Error(W(424)),t),t=Fx(e,t,n,r,a);break e}else for(Nr=Us(t.stateNode.containerInfo.firstChild),Cr=t,at=!0,Xr=null,r=F0(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Bi(),n===a){t=ns(e,t,r);break e}Qt(e,t,n,r)}t=t.child}return t;case 5:return U0(t),e===null&&_m(t),n=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,bm(n,a)?o=null:i!==null&&bm(n,i)&&(t.flags|=32),dw(e,t),Qt(e,t,o,r),t.child;case 6:return e===null&&_m(t),null;case 13:return mw(e,t,r);case 4:return hp(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Hi(t,null,n,r):Qt(e,t,n,r),t.child;case 11:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Qr(n,a),Mx(e,t,n,a,r);case 7:return Qt(e,t,t.pendingProps,r),t.child;case 8:return Qt(e,t,t.pendingProps.children,r),t.child;case 12:return Qt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,a=t.pendingProps,i=t.memoizedProps,o=a.value,Je(nu,n._currentValue),n._currentValue=o,i!==null)if(nn(i.value,o)){if(i.children===a.children&&!mr.current){t=ns(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=Gn(-1,r&-r),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var h=u.pending;h===null?c.next=c:(c.next=h.next,h.next=c),u.pending=c}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),Em(i.return,r,t),l.lanes|=r;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(W(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Em(o,r,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Qt(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,n=t.pendingProps.children,bi(t,r),a=Vr(a),n=n(a),t.flags|=1,Qt(e,t,n,r),t.child;case 14:return n=t.type,a=Qr(n,t.pendingProps),a=Qr(n.type,a),Ox(e,t,n,a,r);case 15:return cw(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:Qr(n,a),Ac(e,t),t.tag=1,hr(n)?(e=!0,eu(t)):e=!1,bi(t,r),iw(t,n,a),Tm(t,n,a,r),Am(null,t,n,!0,e,r);case 19:return hw(e,t,r);case 22:return uw(e,t,r)}throw Error(W(156,t.tag))};function Pw(e,t){return n0(e,t)}function eE(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fr(e,t,r,n){return new eE(e,t,r,n)}function Tp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function tE(e){if(typeof e=="function")return Tp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Gh)return 11;if(e===Qh)return 14}return 2}function Hs(e,t){var r=e.alternate;return r===null?(r=Fr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Oc(e,t,r,n,a,i){var o=2;if(n=e,typeof e=="function")Tp(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ai:return Ea(r.children,a,i,t);case Kh:o=8,a|=8;break;case Jf:return e=Fr(12,r,t,a|2),e.elementType=Jf,e.lanes=i,e;case em:return e=Fr(13,r,t,a),e.elementType=em,e.lanes=i,e;case tm:return e=Fr(19,r,t,a),e.elementType=tm,e.lanes=i,e;case Uy:return od(r,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ly:o=10;break e;case $y:o=9;break e;case Gh:o=11;break e;case Qh:o=14;break e;case xs:o=16,n=null;break e}throw Error(W(130,e==null?e:typeof e,""))}return t=Fr(o,r,t,a),t.elementType=e,t.type=n,t.lanes=i,t}function Ea(e,t,r,n){return e=Fr(7,e,n,t),e.lanes=r,e}function od(e,t,r,n){return e=Fr(22,e,n,t),e.elementType=Uy,e.lanes=r,e.stateNode={isHidden:!1},e}function kf(e,t,r){return e=Fr(6,e,null,t),e.lanes=r,e}function Tf(e,t,r){return t=Fr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function rE(e,t,r,n,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=cf(0),this.expirationTimes=cf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=cf(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Pp(e,t,r,n,a,i,o,l,c){return e=new rE(e,t,r,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Fr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},mp(i),e}function nE(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:si,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function Rw(e){if(!e)return Ks;e=e._reactInternals;e:{if(Ba(e)!==e||e.tag!==1)throw Error(W(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(hr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(W(171))}if(e.tag===1){var r=e.type;if(hr(r))return R0(e,r,t)}return t}function Aw(e,t,r,n,a,i,o,l,c){return e=Pp(r,n,!0,e,a,i,o,l,c),e.context=Rw(null),r=e.current,n=er(),a=Bs(r),i=Gn(n,a),i.callback=t??null,zs(r,i,a),e.current.lanes=a,Al(e,a,n),pr(e,n),e}function ld(e,t,r,n){var a=t.current,i=er(),o=Bs(a);return r=Rw(r),t.context===null?t.context=r:t.pendingContext=r,t=Gn(i,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=zs(a,t,o),e!==null&&(rn(e,a,o,i),Tc(e,a,o)),o}function mu(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Kx(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Rp(e,t){Kx(e,t),(e=e.alternate)&&Kx(e,t)}function sE(){return null}var Iw=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ap(e){this._internalRoot=e}cd.prototype.render=Ap.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(W(409));ld(e,t,null,null)};cd.prototype.unmount=Ap.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Aa(function(){ld(null,e,null,null)}),t[ts]=null}};function cd(e){this._internalRoot=e}cd.prototype.unstable_scheduleHydration=function(e){if(e){var t=u0();e={blockedOn:null,target:e,priority:t};for(var r=0;r<ws.length&&t!==0&&t<ws[r].priority;r++);ws.splice(r,0,e),r===0&&f0(e)}};function Ip(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ud(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Gx(){}function aE(e,t,r,n,a){if(a){if(typeof n=="function"){var i=n;n=function(){var u=mu(o);i.call(u)}}var o=Aw(t,n,e,0,null,!1,!1,"",Gx);return e._reactRootContainer=o,e[ts]=o.current,al(e.nodeType===8?e.parentNode:e),Aa(),o}for(;a=e.lastChild;)e.removeChild(a);if(typeof n=="function"){var l=n;n=function(){var u=mu(c);l.call(u)}}var c=Pp(e,0,!1,null,null,!1,!1,"",Gx);return e._reactRootContainer=c,e[ts]=c.current,al(e.nodeType===8?e.parentNode:e),Aa(function(){ld(t,c,r,n)}),c}function dd(e,t,r,n,a){var i=r._reactRootContainer;if(i){var o=i;if(typeof a=="function"){var l=a;a=function(){var c=mu(o);l.call(c)}}ld(t,o,e,a)}else o=aE(r,t,e,a,n);return mu(o)}l0=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Po(t.pendingLanes);r!==0&&(Xh(t,r|1),pr(t,vt()),!(Ve&6)&&(Ki=vt()+500,ra()))}break;case 13:Aa(function(){var n=rs(e,1);if(n!==null){var a=er();rn(n,e,1,a)}}),Rp(e,1)}};Jh=function(e){if(e.tag===13){var t=rs(e,134217728);if(t!==null){var r=er();rn(t,e,134217728,r)}Rp(e,134217728)}};c0=function(e){if(e.tag===13){var t=Bs(e),r=rs(e,t);if(r!==null){var n=er();rn(r,e,t,n)}Rp(e,t)}};u0=function(){return Qe};d0=function(e,t){var r=Qe;try{return Qe=e,t()}finally{Qe=r}};dm=function(e,t,r){switch(t){case"input":if(sm(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var a=td(n);if(!a)throw Error(W(90));Vy(n),sm(n,a)}}}break;case"textarea":Hy(e,r);break;case"select":t=r.value,t!=null&&xi(e,!!r.multiple,t,!1)}};Zy=_p;Xy=Aa;var iE={usingClientEntryPoint:!1,Events:[Ml,ci,td,Qy,Yy,_p]},jo={findFiberByHostInstance:pa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},oE={bundleType:jo.bundleType,version:jo.version,rendererPackageName:jo.rendererPackageName,rendererConfig:jo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ls.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=t0(e),e===null?null:e.stateNode},findFiberByHostInstance:jo.findFiberByHostInstance||sE,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fc.isDisabled&&fc.supportsFiber)try{Zu=fc.inject(oE),En=fc}catch{}}Er.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=iE;Er.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ip(t))throw Error(W(200));return nE(e,t,null,r)};Er.createRoot=function(e,t){if(!Ip(e))throw Error(W(299));var r=!1,n="",a=Iw;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=Pp(e,1,!1,null,null,r,!1,n,a),e[ts]=t.current,al(e.nodeType===8?e.parentNode:e),new Ap(t)};Er.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(W(188)):(e=Object.keys(e).join(","),Error(W(268,e)));return e=t0(t),e=e===null?null:e.stateNode,e};Er.flushSync=function(e){return Aa(e)};Er.hydrate=function(e,t,r){if(!ud(t))throw Error(W(200));return dd(null,e,t,!0,r)};Er.hydrateRoot=function(e,t,r){if(!Ip(e))throw Error(W(405));var n=r!=null&&r.hydratedSources||null,a=!1,i="",o=Iw;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),t=Aw(t,null,e,1,r??null,a,!1,i,o),e[ts]=t.current,al(e),n)for(e=0;e<n.length;e++)r=n[e],a=r._getVersion,a=a(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,a]:t.mutableSourceEagerHydrationData.push(r,a);return new cd(t)};Er.render=function(e,t,r){if(!ud(t))throw Error(W(200));return dd(null,e,t,!1,r)};Er.unmountComponentAtNode=function(e){if(!ud(e))throw Error(W(40));return e._reactRootContainer?(Aa(function(){dd(null,null,e,!1,function(){e._reactRootContainer=null,e[ts]=null})}),!0):!1};Er.unstable_batchedUpdates=_p;Er.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!ud(r))throw Error(W(200));if(e==null||e._reactInternals===void 0)throw Error(W(38));return dd(e,t,r,!1,n)};Er.version="18.3.1-next-f1338f8080-20240426";function Mw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Mw)}catch(e){console.error(e)}}Mw(),My.exports=Er;var Ha=My.exports;const Ow=jy(Ha);var Dw,Qx=Ha;Dw=Qx.createRoot,Qx.hydrateRoot;const lE=1,cE=1e6;let Pf=0;function uE(){return Pf=(Pf+1)%Number.MAX_SAFE_INTEGER,Pf.toString()}const Rf=new Map,Yx=e=>{if(Rf.has(e))return;const t=setTimeout(()=>{Rf.delete(e),Go({type:"REMOVE_TOAST",toastId:e})},cE);Rf.set(e,t)},dE=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,lE)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?Yx(r):e.toasts.forEach(n=>{Yx(n.id)}),{...e,toasts:e.toasts.map(n=>n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},Dc=[];let Fc={toasts:[]};function Go(e){Fc=dE(Fc,e),Dc.forEach(t=>{t(Fc)})}function Hm({...e}){const t=uE(),r=a=>Go({type:"UPDATE_TOAST",toast:{...a,id:t}}),n=()=>Go({type:"DISMISS_TOAST",toastId:t});return Go({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||n()}}}),{id:t,dismiss:n,update:r}}function na(){const[e,t]=d.useState(Fc);return d.useEffect(()=>(Dc.push(t),()=>{const r=Dc.indexOf(t);r>-1&&Dc.splice(r,1)}),[e]),{...e,toast:Hm,dismiss:r=>Go({type:"DISMISS_TOAST",toastId:r})}}function ne(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function fE(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function fd(...e){return t=>e.forEach(r=>fE(r,t))}function He(...e){return d.useCallback(fd(...e),e)}function mE(e,t=[]){let r=[];function n(i,o){const l=d.createContext(o),c=r.length;r=[...r,o];function u(f){const{scope:m,children:y,...v}=f,p=(m==null?void 0:m[e][c])||l,b=d.useMemo(()=>v,Object.values(v));return s.jsx(p.Provider,{value:b,children:y})}function h(f,m){const y=(m==null?void 0:m[e][c])||l,v=d.useContext(y);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,h]}const a=()=>{const i=r.map(o=>d.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return d.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[n,hE(a,...t)]}function hE(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:u})=>{const f=c(i)[`__scope${u}`];return{...l,...f}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var Gs=d.forwardRef((e,t)=>{const{children:r,...n}=e,a=d.Children.toArray(r),i=a.find(gE);if(i){const o=i.props.children,l=a.map(c=>c===i?d.Children.count(o)>1?d.Children.only(null):d.isValidElement(o)?o.props.children:null:c);return s.jsx(Wm,{...n,ref:t,children:d.isValidElement(o)?d.cloneElement(o,void 0,l):null})}return s.jsx(Wm,{...n,ref:t,children:r})});Gs.displayName="Slot";var Wm=d.forwardRef((e,t)=>{const{children:r,...n}=e;if(d.isValidElement(r)){const a=vE(r);return d.cloneElement(r,{...xE(n,r.props),ref:t?fd(t,a):a})}return d.Children.count(r)>1?d.Children.only(null):null});Wm.displayName="SlotClone";var pE=({children:e})=>s.jsx(s.Fragment,{children:e});function gE(e){return d.isValidElement(e)&&e.type===pE}function xE(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...l)=>{i(...l),a(...l)}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function vE(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function md(e){const t=e+"CollectionProvider",[r,n]=mE(t),[a,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=y=>{const{scope:v,children:p}=y,b=z.useRef(null),g=z.useRef(new Map).current;return s.jsx(a,{scope:v,itemMap:g,collectionRef:b,children:p})};o.displayName=t;const l=e+"CollectionSlot",c=z.forwardRef((y,v)=>{const{scope:p,children:b}=y,g=i(l,p),x=He(v,g.collectionRef);return s.jsx(Gs,{ref:x,children:b})});c.displayName=l;const u=e+"CollectionItemSlot",h="data-radix-collection-item",f=z.forwardRef((y,v)=>{const{scope:p,children:b,...g}=y,x=z.useRef(null),w=He(v,x),N=i(u,p);return z.useEffect(()=>(N.itemMap.set(x,{ref:x,...g}),()=>void N.itemMap.delete(x))),s.jsx(Gs,{[h]:"",ref:w,children:b})});f.displayName=u;function m(y){const v=i(e+"CollectionConsumer",y);return z.useCallback(()=>{const b=v.collectionRef.current;if(!b)return[];const g=Array.from(b.querySelectorAll(`[${h}]`));return Array.from(v.itemMap.values()).sort((N,C)=>g.indexOf(N.ref.current)-g.indexOf(C.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:o,Slot:c,ItemSlot:f},m,n]}function yE(e,t){const r=d.createContext(t),n=i=>{const{children:o,...l}=i,c=d.useMemo(()=>l,Object.values(l));return s.jsx(r.Provider,{value:c,children:o})};n.displayName=e+"Provider";function a(i){const o=d.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,a]}function sa(e,t=[]){let r=[];function n(i,o){const l=d.createContext(o),c=r.length;r=[...r,o];const u=f=>{var g;const{scope:m,children:y,...v}=f,p=((g=m==null?void 0:m[e])==null?void 0:g[c])||l,b=d.useMemo(()=>v,Object.values(v));return s.jsx(p.Provider,{value:b,children:y})};u.displayName=i+"Provider";function h(f,m){var p;const y=((p=m==null?void 0:m[e])==null?void 0:p[c])||l,v=d.useContext(y);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,h]}const a=()=>{const i=r.map(o=>d.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return d.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[n,wE(a,...t)]}function wE(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:u})=>{const f=c(i)[`__scope${u}`];return{...l,...f}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var bE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],xe=bE.reduce((e,t)=>{const r=d.forwardRef((n,a)=>{const{asChild:i,...o}=n,l=i?Gs:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(l,{...o,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Mp(e,t){e&&Ha.flushSync(()=>e.dispatchEvent(t))}function Ot(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function jE(e,t=globalThis==null?void 0:globalThis.document){const r=Ot(e);d.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var NE="DismissableLayer",qm="dismissableLayer.update",CE="dismissableLayer.pointerDownOutside",SE="dismissableLayer.focusOutside",Zx,Fw=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Dl=d.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,u=d.useContext(Fw),[h,f]=d.useState(null),m=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=d.useState({}),v=He(t,T=>f(T)),p=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=p.indexOf(b),x=h?p.indexOf(h):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,N=x>=g,C=EE(T=>{const P=T.target,I=[...u.branches].some(D=>D.contains(P));!N||I||(a==null||a(T),o==null||o(T),T.defaultPrevented||l==null||l())},m),k=kE(T=>{const P=T.target;[...u.branches].some(D=>D.contains(P))||(i==null||i(T),o==null||o(T),T.defaultPrevented||l==null||l())},m);return jE(T=>{x===u.layers.size-1&&(n==null||n(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},m),d.useEffect(()=>{if(h)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Zx=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(h)),u.layers.add(h),Xx(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Zx)}},[h,m,r,u]),d.useEffect(()=>()=>{h&&(u.layers.delete(h),u.layersWithOutsidePointerEventsDisabled.delete(h),Xx())},[h,u]),d.useEffect(()=>{const T=()=>y({});return document.addEventListener(qm,T),()=>document.removeEventListener(qm,T)},[]),s.jsx(xe.div,{...c,ref:v,style:{pointerEvents:w?N?"auto":"none":void 0,...e.style},onFocusCapture:ne(e.onFocusCapture,k.onFocusCapture),onBlurCapture:ne(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:ne(e.onPointerDownCapture,C.onPointerDownCapture)})});Dl.displayName=NE;var _E="DismissableLayerBranch",Lw=d.forwardRef((e,t)=>{const r=d.useContext(Fw),n=d.useRef(null),a=He(t,n);return d.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),s.jsx(xe.div,{...e,ref:a})});Lw.displayName=_E;function EE(e,t=globalThis==null?void 0:globalThis.document){const r=Ot(e),n=d.useRef(!1),a=d.useRef(()=>{});return d.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){$w(CE,r,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function kE(e,t=globalThis==null?void 0:globalThis.document){const r=Ot(e),n=d.useRef(!1);return d.useEffect(()=>{const a=i=>{i.target&&!n.current&&$w(SE,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Xx(){const e=new CustomEvent(qm);document.dispatchEvent(e)}function $w(e,t,r,{discrete:n}){const a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?Mp(a,i):a.dispatchEvent(i)}var TE=Dl,PE=Lw,Tt=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{},RE="Portal",Fl=d.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[a,i]=d.useState(!1);Tt(()=>i(!0),[]);const o=r||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?Ow.createPortal(s.jsx(xe.div,{...n,ref:t}),o):null});Fl.displayName=RE;function AE(e,t){return d.useReducer((r,n)=>t[r][n]??r,e)}var An=e=>{const{present:t,children:r}=e,n=IE(t),a=typeof r=="function"?r({present:n.isPresent}):d.Children.only(r),i=He(n.ref,ME(a));return typeof r=="function"||n.isPresent?d.cloneElement(a,{ref:i}):null};An.displayName="Presence";function IE(e){const[t,r]=d.useState(),n=d.useRef({}),a=d.useRef(e),i=d.useRef("none"),o=e?"mounted":"unmounted",[l,c]=AE(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const u=mc(n.current);i.current=l==="mounted"?u:"none"},[l]),Tt(()=>{const u=n.current,h=a.current;if(h!==e){const m=i.current,y=mc(u);e?c("MOUNT"):y==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(h&&m!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),Tt(()=>{if(t){let u;const h=t.ownerDocument.defaultView??window,f=y=>{const p=mc(n.current).includes(y.animationName);if(y.target===t&&p&&(c("ANIMATION_END"),!a.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",u=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=y=>{y.target===t&&(i.current=mc(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{h.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:d.useCallback(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function mc(e){return(e==null?void 0:e.animationName)||"none"}function ME(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Ia({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,a]=OE({defaultProp:t,onChange:r}),i=e!==void 0,o=i?e:n,l=Ot(r),c=d.useCallback(u=>{if(i){const f=typeof u=="function"?u(e):u;f!==e&&l(f)}else a(u)},[i,e,a,l]);return[o,c]}function OE({defaultProp:e,onChange:t}){const r=d.useState(e),[n]=r,a=d.useRef(n),i=Ot(t);return d.useEffect(()=>{a.current!==n&&(i(n),a.current=n)},[n,a,i]),r}var DE="VisuallyHidden",hd=d.forwardRef((e,t)=>s.jsx(xe.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));hd.displayName=DE;var Op="ToastProvider",[Dp,FE,LE]=md("Toast"),[Uw,gD]=sa("Toast",[LE]),[$E,pd]=Uw(Op),zw=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:o}=e,[l,c]=d.useState(null),[u,h]=d.useState(0),f=d.useRef(!1),m=d.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Op}\`. Expected non-empty \`string\`.`),s.jsx(Dp.Provider,{scope:t,children:s.jsx($E,{scope:t,label:r,duration:n,swipeDirection:a,swipeThreshold:i,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:d.useCallback(()=>h(y=>y+1),[]),onToastRemove:d.useCallback(()=>h(y=>y-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:m,children:o})})};zw.displayName=Op;var Vw="ToastViewport",UE=["F8"],Km="toast.viewportPause",Gm="toast.viewportResume",Bw=d.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:n=UE,label:a="Notifications ({hotkey})",...i}=e,o=pd(Vw,r),l=FE(r),c=d.useRef(null),u=d.useRef(null),h=d.useRef(null),f=d.useRef(null),m=He(t,f,o.onViewportChange),y=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=o.toastCount>0;d.useEffect(()=>{const b=g=>{var w;n.length!==0&&n.every(N=>g[N]||g.code===N)&&((w=f.current)==null||w.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[n]),d.useEffect(()=>{const b=c.current,g=f.current;if(v&&b&&g){const x=()=>{if(!o.isClosePausedRef.current){const k=new CustomEvent(Km);g.dispatchEvent(k),o.isClosePausedRef.current=!0}},w=()=>{if(o.isClosePausedRef.current){const k=new CustomEvent(Gm);g.dispatchEvent(k),o.isClosePausedRef.current=!1}},N=k=>{!b.contains(k.relatedTarget)&&w()},C=()=>{b.contains(document.activeElement)||w()};return b.addEventListener("focusin",x),b.addEventListener("focusout",N),b.addEventListener("pointermove",x),b.addEventListener("pointerleave",C),window.addEventListener("blur",x),window.addEventListener("focus",w),()=>{b.removeEventListener("focusin",x),b.removeEventListener("focusout",N),b.removeEventListener("pointermove",x),b.removeEventListener("pointerleave",C),window.removeEventListener("blur",x),window.removeEventListener("focus",w)}}},[v,o.isClosePausedRef]);const p=d.useCallback(({tabbingDirection:b})=>{const x=l().map(w=>{const N=w.ref.current,C=[N,...JE(N)];return b==="forwards"?C:C.reverse()});return(b==="forwards"?x.reverse():x).flat()},[l]);return d.useEffect(()=>{const b=f.current;if(b){const g=x=>{var C,k,T;const w=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!w){const P=document.activeElement,I=x.shiftKey;if(x.target===b&&I){(C=u.current)==null||C.focus();return}const M=p({tabbingDirection:I?"backwards":"forwards"}),U=M.findIndex($=>$===P);Af(M.slice(U+1))?x.preventDefault():I?(k=u.current)==null||k.focus():(T=h.current)==null||T.focus()}};return b.addEventListener("keydown",g),()=>b.removeEventListener("keydown",g)}},[l,p]),s.jsxs(PE,{ref:c,role:"region","aria-label":a.replace("{hotkey}",y),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&s.jsx(Qm,{ref:u,onFocusFromOutsideViewport:()=>{const b=p({tabbingDirection:"forwards"});Af(b)}}),s.jsx(Dp.Slot,{scope:r,children:s.jsx(xe.ol,{tabIndex:-1,...i,ref:m})}),v&&s.jsx(Qm,{ref:h,onFocusFromOutsideViewport:()=>{const b=p({tabbingDirection:"backwards"});Af(b)}})]})});Bw.displayName=Vw;var Hw="ToastFocusProxy",Qm=d.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...a}=e,i=pd(Hw,r);return s.jsx(hd,{"aria-hidden":!0,tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const l=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(l))&&n()}})});Qm.displayName=Hw;var gd="Toast",zE="toast.swipeStart",VE="toast.swipeMove",BE="toast.swipeCancel",HE="toast.swipeEnd",Ww=d.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:a,onOpenChange:i,...o}=e,[l=!0,c]=Ia({prop:n,defaultProp:a,onChange:i});return s.jsx(An,{present:r||l,children:s.jsx(KE,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:Ot(e.onPause),onResume:Ot(e.onResume),onSwipeStart:ne(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ne(e.onSwipeMove,u=>{const{x:h,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${h}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:ne(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ne(e.onSwipeEnd,u=>{const{x:h,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${h}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});Ww.displayName=gd;var[WE,qE]=Uw(gd,{onClose(){}}),KE=d.forwardRef((e,t)=>{const{__scopeToast:r,type:n="foreground",duration:a,open:i,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:h,onSwipeMove:f,onSwipeCancel:m,onSwipeEnd:y,...v}=e,p=pd(gd,r),[b,g]=d.useState(null),x=He(t,$=>g($)),w=d.useRef(null),N=d.useRef(null),C=a||p.duration,k=d.useRef(0),T=d.useRef(C),P=d.useRef(0),{onToastAdd:I,onToastRemove:D}=p,E=Ot(()=>{var G;(b==null?void 0:b.contains(document.activeElement))&&((G=p.viewport)==null||G.focus()),o()}),M=d.useCallback($=>{!$||$===1/0||(window.clearTimeout(P.current),k.current=new Date().getTime(),P.current=window.setTimeout(E,$))},[E]);d.useEffect(()=>{const $=p.viewport;if($){const G=()=>{M(T.current),u==null||u()},F=()=>{const X=new Date().getTime()-k.current;T.current=T.current-X,window.clearTimeout(P.current),c==null||c()};return $.addEventListener(Km,F),$.addEventListener(Gm,G),()=>{$.removeEventListener(Km,F),$.removeEventListener(Gm,G)}}},[p.viewport,C,c,u,M]),d.useEffect(()=>{i&&!p.isClosePausedRef.current&&M(C)},[i,C,p.isClosePausedRef,M]),d.useEffect(()=>(I(),()=>D()),[I,D]);const U=d.useMemo(()=>b?Xw(b):null,[b]);return p.viewport?s.jsxs(s.Fragment,{children:[U&&s.jsx(GE,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:U}),s.jsx(WE,{scope:r,onClose:E,children:Ha.createPortal(s.jsx(Dp.ItemSlot,{scope:r,children:s.jsx(TE,{asChild:!0,onEscapeKeyDown:ne(l,()=>{p.isFocusedToastEscapeKeyDownRef.current||E(),p.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(xe.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":p.swipeDirection,...v,ref:x,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ne(e.onKeyDown,$=>{$.key==="Escape"&&(l==null||l($.nativeEvent),$.nativeEvent.defaultPrevented||(p.isFocusedToastEscapeKeyDownRef.current=!0,E()))}),onPointerDown:ne(e.onPointerDown,$=>{$.button===0&&(w.current={x:$.clientX,y:$.clientY})}),onPointerMove:ne(e.onPointerMove,$=>{if(!w.current)return;const G=$.clientX-w.current.x,F=$.clientY-w.current.y,X=!!N.current,A=["left","right"].includes(p.swipeDirection),O=["left","up"].includes(p.swipeDirection)?Math.min:Math.max,Y=A?O(0,G):0,K=A?0:O(0,F),te=$.pointerType==="touch"?10:2,ge={x:Y,y:K},ke={originalEvent:$,delta:ge};X?(N.current=ge,hc(VE,f,ke,{discrete:!1})):Jx(ge,p.swipeDirection,te)?(N.current=ge,hc(zE,h,ke,{discrete:!1}),$.target.setPointerCapture($.pointerId)):(Math.abs(G)>te||Math.abs(F)>te)&&(w.current=null)}),onPointerUp:ne(e.onPointerUp,$=>{const G=N.current,F=$.target;if(F.hasPointerCapture($.pointerId)&&F.releasePointerCapture($.pointerId),N.current=null,w.current=null,G){const X=$.currentTarget,A={originalEvent:$,delta:G};Jx(G,p.swipeDirection,p.swipeThreshold)?hc(HE,y,A,{discrete:!0}):hc(BE,m,A,{discrete:!0}),X.addEventListener("click",O=>O.preventDefault(),{once:!0})}})})})}),p.viewport)})]}):null}),GE=e=>{const{__scopeToast:t,children:r,...n}=e,a=pd(gd,t),[i,o]=d.useState(!1),[l,c]=d.useState(!1);return ZE(()=>o(!0)),d.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:s.jsx(Fl,{asChild:!0,children:s.jsx(hd,{...n,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",r]})})})},QE="ToastTitle",qw=d.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return s.jsx(xe.div,{...n,ref:t})});qw.displayName=QE;var YE="ToastDescription",Kw=d.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return s.jsx(xe.div,{...n,ref:t})});Kw.displayName=YE;var Gw="ToastAction",Qw=d.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?s.jsx(Zw,{altText:r,asChild:!0,children:s.jsx(Fp,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Gw}\`. Expected non-empty \`string\`.`),null)});Qw.displayName=Gw;var Yw="ToastClose",Fp=d.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,a=qE(Yw,r);return s.jsx(Zw,{asChild:!0,children:s.jsx(xe.button,{type:"button",...n,ref:t,onClick:ne(e.onClick,a.onClose)})})});Fp.displayName=Yw;var Zw=d.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...a}=e;return s.jsx(xe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...a,ref:t})});function Xw(e){const t=[];return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),XE(n)){const a=n.ariaHidden||n.hidden||n.style.display==="none",i=n.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const o=n.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...Xw(n))}}),t}function hc(e,t,r,{discrete:n}){const a=r.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?Mp(a,i):a.dispatchEvent(i)}var Jx=(e,t,r=0)=>{const n=Math.abs(e.x),a=Math.abs(e.y),i=n>a;return t==="left"||t==="right"?i&&n>r:!i&&a>r};function ZE(e=()=>{}){const t=Ot(e);Tt(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function XE(e){return e.nodeType===e.ELEMENT_NODE}function JE(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Af(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var ek=zw,Jw=Bw,eb=Ww,tb=qw,rb=Kw,nb=Qw,sb=Fp;function ab(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=ab(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function ib(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=ab(e))&&(n&&(n+=" "),n+=t);return n}const ev=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,tv=ib,xd=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return tv(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(u=>{const h=r==null?void 0:r[u],f=i==null?void 0:i[u];if(h===null)return null;const m=ev(h)||ev(f);return a[u][m]}),l=r&&Object.entries(r).reduce((u,h)=>{let[f,m]=h;return m===void 0||(u[f]=m),u},{}),c=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,h)=>{let{class:f,className:m,...y}=h;return Object.entries(y).every(v=>{let[p,b]=v;return Array.isArray(b)?b.includes({...i,...l}[p]):{...i,...l}[p]===b})?[...u,f,m]:u},[]);return tv(e,o,c,r==null?void 0:r.class,r==null?void 0:r.className)};/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const tk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ob=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */var rk={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nk=d.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:o,...l},c)=>d.createElement("svg",{ref:c,...rk,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ob("lucide",a),...l},[...o.map(([u,h])=>d.createElement(u,h)),...Array.isArray(i)?i:[i]]));/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ve=(e,t)=>{const r=d.forwardRef(({className:n,...a},i)=>d.createElement(nk,{ref:i,iconNode:t,className:ob(`lucide-${tk(e)}`,n),...a}));return r.displayName=`${e}`,r};/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Qn=ve("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Lp=ve("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Sn=ve("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $r=ve("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vd=ve("Calendar",[["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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const $p=ve("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Up=ve("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const rv=ve("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ym=ve("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sk=ve("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ak=ve("CircleAlert",[["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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const zp=ve("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ik=ve("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lb=ve("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Gi=ve("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ok=ve("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const lk=ve("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ck=ve("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const uk=ve("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dk=ve("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fk=ve("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const cb=ve("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mk=ve("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hk=ve("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ub=ve("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pk=ve("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const it=ve("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gk=ve("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const db=ve("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yd=ve("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fb=ve("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xk=ve("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vk=ve("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const nv=ve("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hu=ve("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const If=ve("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const fa=ve("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const sv=ve("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Vp=ve("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mb=ve("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yk=ve("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const gi=ve("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wa=ve("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ys=ve("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wk=ve("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const bk=ve("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const av=ve("User",[["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"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ma=ve("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ro=ve("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Bp="-",jk=e=>{const t=Ck(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:o=>{const l=o.split(Bp);return l[0]===""&&l.length!==1&&l.shift(),hb(l,t)||Nk(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},hb=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?hb(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(Bp);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},iv=/^\[(.+)\]$/,Nk=e=>{if(iv.test(e)){const t=iv.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Ck=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return _k(Object.entries(e.classGroups),r).forEach(([i,o])=>{Zm(o,n,i,t)}),n},Zm=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:ov(t,a);i.classGroupId=r;return}if(typeof a=="function"){if(Sk(a)){Zm(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,o])=>{Zm(o,ov(t,i),r,n)})})},ov=(e,t)=>{let r=e;return t.split(Bp).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Sk=e=>e.isThemeGetter,_k=(e,t)=>t?e.map(([r,n])=>{const a=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[r,a]}):e,Ek=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(i,o)=>{r.set(i,o),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return a(i,o),o},set(i,o){r.has(i)?r.set(i,o):a(i,o)}}},pb="!",kk=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,a=t[0],i=t.length,o=l=>{const c=[];let u=0,h=0,f;for(let b=0;b<l.length;b++){let g=l[b];if(u===0){if(g===a&&(n||l.slice(b,b+i)===t)){c.push(l.slice(h,b)),h=b+i;continue}if(g==="/"){f=b;continue}}g==="["?u++:g==="]"&&u--}const m=c.length===0?l:l.substring(h),y=m.startsWith(pb),v=y?m.substring(1):m,p=f&&f>h?f-h:void 0;return{modifiers:c,hasImportantModifier:y,baseClassName:v,maybePostfixModifierPosition:p}};return r?l=>r({className:l,parseClassName:o}):o},Tk=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},Pk=e=>({cache:Ek(e.cacheSize),parseClassName:kk(e),...jk(e)}),Rk=/\s+/,Ak=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(Rk);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:h,hasImportantModifier:f,baseClassName:m,maybePostfixModifierPosition:y}=r(u);let v=!!y,p=n(v?m.substring(0,y):m);if(!p){if(!v){l=u+(l.length>0?" "+l:l);continue}if(p=n(m),!p){l=u+(l.length>0?" "+l:l);continue}v=!1}const b=Tk(h).join(":"),g=f?b+pb:b,x=g+p;if(i.includes(x))continue;i.push(x);const w=a(p,v);for(let N=0;N<w.length;++N){const C=w[N];i.push(g+C)}l=u+(l.length>0?" "+l:l)}return l};function Ik(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=gb(t))&&(n&&(n+=" "),n+=r);return n}const gb=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=gb(e[n]))&&(r&&(r+=" "),r+=t);return r};function Mk(e,...t){let r,n,a,i=o;function o(c){const u=t.reduce((h,f)=>f(h),e());return r=Pk(u),n=r.cache.get,a=r.cache.set,i=l,l(c)}function l(c){const u=n(c);if(u)return u;const h=Ak(c,r);return a(c,h),h}return function(){return i(Ik.apply(null,arguments))}}const tt=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},xb=/^\[(?:([a-z-]+):)?(.+)\]$/i,Ok=/^\d+\/\d+$/,Dk=new Set(["px","full","screen"]),Fk=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Lk=/\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$/,$k=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Uk=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,On=e=>Ni(e)||Dk.has(e)||Ok.test(e),ms=e=>no(e,"length",Qk),Ni=e=>!!e&&!Number.isNaN(Number(e)),Mf=e=>no(e,"number",Ni),No=e=>!!e&&Number.isInteger(Number(e)),Vk=e=>e.endsWith("%")&&Ni(e.slice(0,-1)),Ee=e=>xb.test(e),hs=e=>Fk.test(e),Bk=new Set(["length","size","percentage"]),Hk=e=>no(e,Bk,vb),Wk=e=>no(e,"position",vb),qk=new Set(["image","url"]),Kk=e=>no(e,qk,Zk),Gk=e=>no(e,"",Yk),Co=()=>!0,no=(e,t,r)=>{const n=xb.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},Qk=e=>Lk.test(e)&&!$k.test(e),vb=()=>!1,Yk=e=>Uk.test(e),Zk=e=>zk.test(e),Xk=()=>{const e=tt("colors"),t=tt("spacing"),r=tt("blur"),n=tt("brightness"),a=tt("borderColor"),i=tt("borderRadius"),o=tt("borderSpacing"),l=tt("borderWidth"),c=tt("contrast"),u=tt("grayscale"),h=tt("hueRotate"),f=tt("invert"),m=tt("gap"),y=tt("gradientColorStops"),v=tt("gradientColorStopPositions"),p=tt("inset"),b=tt("margin"),g=tt("opacity"),x=tt("padding"),w=tt("saturate"),N=tt("scale"),C=tt("sepia"),k=tt("skew"),T=tt("space"),P=tt("translate"),I=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],E=()=>["auto",Ee,t],M=()=>[Ee,t],U=()=>["",On,ms],$=()=>["auto",Ni,Ee],G=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],X=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],A=()=>["start","end","center","between","around","evenly","stretch"],O=()=>["","0",Ee],Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[Ni,Ee];return{cacheSize:500,separator:":",theme:{colors:[Co],spacing:[On,ms],blur:["none","",hs,Ee],brightness:K(),borderColor:[e],borderRadius:["none","","full",hs,Ee],borderSpacing:M(),borderWidth:U(),contrast:K(),grayscale:O(),hueRotate:K(),invert:O(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[Vk,ms],inset:E(),margin:E(),opacity:K(),padding:M(),saturate:K(),scale:K(),sepia:O(),skew:K(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",Ee]}],container:["container"],columns:[{columns:[hs]}],"break-after":[{"break-after":Y()}],"break-before":[{"break-before":Y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...G(),Ee]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[p]}],"inset-x":[{"inset-x":[p]}],"inset-y":[{"inset-y":[p]}],start:[{start:[p]}],end:[{end:[p]}],top:[{top:[p]}],right:[{right:[p]}],bottom:[{bottom:[p]}],left:[{left:[p]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",No,Ee]}],basis:[{basis:E()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ee]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",No,Ee]}],"grid-cols":[{"grid-cols":[Co]}],"col-start-end":[{col:["auto",{span:["full",No,Ee]},Ee]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[Co]}],"row-start-end":[{row:["auto",{span:[No,Ee]},Ee]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ee]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ee]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...A()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...A(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...A(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ee,t]}],"min-w":[{"min-w":[Ee,t,"min","max","fit"]}],"max-w":[{"max-w":[Ee,t,"none","full","min","max","fit","prose",{screen:[hs]},hs]}],h:[{h:[Ee,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ee,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ee,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ee,t,"auto","min","max","fit"]}],"font-size":[{text:["base",hs,ms]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Mf]}],"font-family":[{font:[Co]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ee]}],"line-clamp":[{"line-clamp":["none",Ni,Mf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",On,Ee]}],"list-image":[{"list-image":["none",Ee]}],"list-style-type":[{list:["none","disc","decimal",Ee]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",On,ms]}],"underline-offset":[{"underline-offset":["auto",On,Ee]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...G(),Wk]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Hk]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Kk]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[y]}],"gradient-via":[{via:[y]}],"gradient-to":[{to:[y]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...F(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:F()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...F()]}],"outline-offset":[{"outline-offset":[On,Ee]}],"outline-w":[{outline:[On,ms]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[On,ms]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",hs,Gk]}],"shadow-color":[{shadow:[Co]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...X(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":X()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",hs,Ee]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ee]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",Ee]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ee]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[No,Ee]}],"translate-x":[{"translate-x":[P]}],"translate-y":[{"translate-y":[P]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ee]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ee]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ee]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[On,ms,Mf]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Jk=Mk(Xk);function le(...e){return Jk(ib(e))}const eT=ek,yb=d.forwardRef(({className:e,...t},r)=>s.jsx(Jw,{ref:r,className:le("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));yb.displayName=Jw.displayName;const tT=xd("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),wb=d.forwardRef(({className:e,variant:t,...r},n)=>s.jsx(eb,{ref:n,className:le(tT({variant:t}),e),...r}));wb.displayName=eb.displayName;const rT=d.forwardRef(({className:e,...t},r)=>s.jsx(nb,{ref:r,className:le("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));rT.displayName=nb.displayName;const bb=d.forwardRef(({className:e,...t},r)=>s.jsx(sb,{ref:r,className:le("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:s.jsx(ro,{className:"h-4 w-4"})}));bb.displayName=sb.displayName;const jb=d.forwardRef(({className:e,...t},r)=>s.jsx(tb,{ref:r,className:le("text-sm font-semibold",e),...t}));jb.displayName=tb.displayName;const Nb=d.forwardRef(({className:e,...t},r)=>s.jsx(rb,{ref:r,className:le("text-sm opacity-90",e),...t}));Nb.displayName=rb.displayName;function nT(){const{toasts:e}=na();return s.jsxs(eT,{children:[e.map(function({id:t,title:r,description:n,action:a,...i}){return s.jsxs(wb,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[r&&s.jsx(jb,{children:r}),n&&s.jsx(Nb,{children:n})]}),a,s.jsx(bb,{})]},t)}),s.jsx(yb,{})]})}var lv=["light","dark"],sT="(prefers-color-scheme: dark)",aT=d.createContext(void 0),iT={setTheme:e=>{},themes:[]},oT=()=>{var e;return(e=d.useContext(aT))!=null?e:iT};d.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:a,defaultTheme:i,value:o,attrs:l,nonce:c})=>{let u=i==="system",h=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(v=>`'${v}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,f=a?lv.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",m=(v,p=!1,b=!0)=>{let g=o?o[v]:v,x=p?v+"|| ''":`'${g}'`,w="";return a&&b&&!p&&lv.includes(v)&&(w+=`d.style.colorScheme = '${v}';`),r==="class"?p||g?w+=`c.add(${x})`:w+="null":g&&(w+=`d[s](n,${x})`),w},y=e?`!function(){${h}${m(e)}}()`:n?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${sT}',m=window.matchMedia(t);if(m.media!==t||m.matches){${m("dark")}}else{${m("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${m(o?"x[e]":"e",!0)}}${u?"":"else{"+m(i,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${m(o?"x[e]":"e",!0)}}else{${m(i,!1,!1)};}${f}}catch(t){}}();`;return d.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:y}})});var lT=e=>{switch(e){case"success":return dT;case"info":return mT;case"warning":return fT;case"error":return hT;default:return null}},cT=Array(12).fill(0),uT=({visible:e})=>z.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},z.createElement("div",{className:"sonner-spinner"},cT.map((t,r)=>z.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),dT=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.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"})),fT=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},z.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"})),mT=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.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"})),hT=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.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"})),pT=()=>{let[e,t]=z.useState(document.hidden);return z.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},Xm=1,gT=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Xm++,i=this.toasts.find(l=>l.id===a),o=e.dismissible===void 0?!0:e.dismissible;return i?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...e,id:a,title:r}),{...l,...e,id:a,dismissible:o,title:r}):l):this.addToast({title:r,...n,dismissible:o,id:a}),a},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),a=r!==void 0;return n.then(async i=>{if(vT(i)&&!i.ok){a=!1;let o=typeof t.error=="function"?await t.error(`HTTP error! status: ${i.status}`):t.error,l=typeof t.description=="function"?await t.description(`HTTP error! status: ${i.status}`):t.description;this.create({id:r,type:"error",message:o,description:l})}else if(t.success!==void 0){a=!1;let o=typeof t.success=="function"?await t.success(i):t.success,l=typeof t.description=="function"?await t.description(i):t.description;this.create({id:r,type:"success",message:o,description:l})}}).catch(async i=>{if(t.error!==void 0){a=!1;let o=typeof t.error=="function"?await t.error(i):t.error,l=typeof t.description=="function"?await t.description(i):t.description;this.create({id:r,type:"error",message:o,description:l})}}).finally(()=>{var i;a&&(this.dismiss(r),r=void 0),(i=t.finally)==null||i.call(t)}),r},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||Xm++;return this.create({jsx:e(r),id:r,...t}),r},this.subscribers=[],this.toasts=[]}},wr=new gT,xT=(e,t)=>{let r=(t==null?void 0:t.id)||Xm++;return wr.addToast({title:e,...t,id:r}),r},vT=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",yT=xT,wT=()=>wr.toasts,Jt=Object.assign(yT,{success:wr.success,info:wr.info,warning:wr.warning,error:wr.error,custom:wr.custom,message:wr.message,promise:wr.promise,dismiss:wr.dismiss,loading:wr.loading},{getHistory:wT});function bT(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}bT(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
`);function pc(e){return e.label!==void 0}var jT=3,NT="32px",CT=4e3,ST=356,_T=14,ET=20,kT=200;function TT(...e){return e.filter(Boolean).join(" ")}var PT=e=>{var t,r,n,a,i,o,l,c,u,h;let{invert:f,toast:m,unstyled:y,interacting:v,setHeights:p,visibleToasts:b,heights:g,index:x,toasts:w,expanded:N,removeToast:C,defaultRichColors:k,closeButton:T,style:P,cancelButtonStyle:I,actionButtonStyle:D,className:E="",descriptionClassName:M="",duration:U,position:$,gap:G,loadingIcon:F,expandByDefault:X,classNames:A,icons:O,closeButtonAriaLabel:Y="Close toast",pauseWhenPageIsHidden:K,cn:te}=e,[ge,ke]=z.useState(!1),[Ze,ye]=z.useState(!1),[ae,Se]=z.useState(!1),[Pe,Ne]=z.useState(!1),[Ie,fe]=z.useState(0),[We,_t]=z.useState(0),ar=z.useRef(null),Xe=z.useRef(null),Wt=x===0,S=x+1<=b,R=m.type,L=m.dismissible!==!1,J=m.className||"",Z=m.descriptionClassName||"",B=z.useMemo(()=>g.findIndex(ce=>ce.toastId===m.id)||0,[g,m.id]),me=z.useMemo(()=>{var ce;return(ce=m.closeButton)!=null?ce:T},[m.closeButton,T]),je=z.useMemo(()=>m.duration||U||CT,[m.duration,U]),et=z.useRef(0),Ge=z.useRef(0),xr=z.useRef(0),Tr=z.useRef(null),[un,Mn]=$.split("-"),Hr=z.useMemo(()=>g.reduce((ce,De,Le)=>Le>=B?ce:ce+De.height,0),[g,B]),dn=pT(),fo=m.invert||f,fn=R==="loading";Ge.current=z.useMemo(()=>B*G+Hr,[B,Hr]),z.useEffect(()=>{ke(!0)},[]),z.useLayoutEffect(()=>{if(!ge)return;let ce=Xe.current,De=ce.style.height;ce.style.height="auto";let Le=ce.getBoundingClientRect().height;ce.style.height=De,_t(Le),p(vr=>vr.find(Pr=>Pr.toastId===m.id)?vr.map(Pr=>Pr.toastId===m.id?{...Pr,height:Le}:Pr):[{toastId:m.id,height:Le,position:m.position},...vr])},[ge,m.title,m.description,p,m.id]);let Pt=z.useCallback(()=>{ye(!0),fe(Ge.current),p(ce=>ce.filter(De=>De.toastId!==m.id)),setTimeout(()=>{C(m)},kT)},[m,C,p,Ge]);z.useEffect(()=>{if(m.promise&&R==="loading"||m.duration===1/0||m.type==="loading")return;let ce,De=je;return N||v||K&&dn?(()=>{if(xr.current<et.current){let Le=new Date().getTime()-et.current;De=De-Le}xr.current=new Date().getTime()})():De!==1/0&&(et.current=new Date().getTime(),ce=setTimeout(()=>{var Le;(Le=m.onAutoClose)==null||Le.call(m,m),Pt()},De)),()=>clearTimeout(ce)},[N,v,X,m,je,Pt,m.promise,R,K,dn]),z.useEffect(()=>{let ce=Xe.current;if(ce){let De=ce.getBoundingClientRect().height;return _t(De),p(Le=>[{toastId:m.id,height:De,position:m.position},...Le]),()=>p(Le=>Le.filter(vr=>vr.toastId!==m.id))}},[p,m.id]),z.useEffect(()=>{m.delete&&Pt()},[Pt,m.delete]);function ql(){return O!=null&&O.loading?z.createElement("div",{className:"sonner-loader","data-visible":R==="loading"},O.loading):F?z.createElement("div",{className:"sonner-loader","data-visible":R==="loading"},F):z.createElement(uT,{visible:R==="loading"})}return z.createElement("li",{"aria-live":m.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Xe,className:te(E,J,A==null?void 0:A.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,A==null?void 0:A.default,A==null?void 0:A[R],(r=m==null?void 0:m.classNames)==null?void 0:r[R]),"data-sonner-toast":"","data-rich-colors":(n=m.richColors)!=null?n:k,"data-styled":!(m.jsx||m.unstyled||y),"data-mounted":ge,"data-promise":!!m.promise,"data-removed":Ze,"data-visible":S,"data-y-position":un,"data-x-position":Mn,"data-index":x,"data-front":Wt,"data-swiping":ae,"data-dismissible":L,"data-type":R,"data-invert":fo,"data-swipe-out":Pe,"data-expanded":!!(N||X&&ge),style:{"--index":x,"--toasts-before":x,"--z-index":w.length-x,"--offset":`${Ze?Ie:Ge.current}px`,"--initial-height":X?"auto":`${We}px`,...P,...m.style},onPointerDown:ce=>{fn||!L||(ar.current=new Date,fe(Ge.current),ce.target.setPointerCapture(ce.pointerId),ce.target.tagName!=="BUTTON"&&(Se(!0),Tr.current={x:ce.clientX,y:ce.clientY}))},onPointerUp:()=>{var ce,De,Le,vr;if(Pe||!L)return;Tr.current=null;let Pr=Number(((ce=Xe.current)==null?void 0:ce.style.getPropertyValue("--swipe-amount").replace("px",""))||0),us=new Date().getTime()-((De=ar.current)==null?void 0:De.getTime()),mo=Math.abs(Pr)/us;if(Math.abs(Pr)>=ET||mo>.11){fe(Ge.current),(Le=m.onDismiss)==null||Le.call(m,m),Pt(),Ne(!0);return}(vr=Xe.current)==null||vr.style.setProperty("--swipe-amount","0px"),Se(!1)},onPointerMove:ce=>{var De;if(!Tr.current||!L)return;let Le=ce.clientY-Tr.current.y,vr=ce.clientX-Tr.current.x,Pr=(un==="top"?Math.min:Math.max)(0,Le),us=ce.pointerType==="touch"?10:2;Math.abs(Pr)>us?(De=Xe.current)==null||De.style.setProperty("--swipe-amount",`${Le}px`):Math.abs(vr)>us&&(Tr.current=null)}},me&&!m.jsx?z.createElement("button",{"aria-label":Y,"data-disabled":fn,"data-close-button":!0,onClick:fn||!L?()=>{}:()=>{var ce;Pt(),(ce=m.onDismiss)==null||ce.call(m,m)},className:te(A==null?void 0:A.closeButton,(a=m==null?void 0:m.classNames)==null?void 0:a.closeButton)},z.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"},z.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),z.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,m.jsx||z.isValidElement(m.title)?m.jsx||m.title:z.createElement(z.Fragment,null,R||m.icon||m.promise?z.createElement("div",{"data-icon":"",className:te(A==null?void 0:A.icon,(i=m==null?void 0:m.classNames)==null?void 0:i.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||ql():null,m.type!=="loading"?m.icon||(O==null?void 0:O[R])||lT(R):null):null,z.createElement("div",{"data-content":"",className:te(A==null?void 0:A.content,(o=m==null?void 0:m.classNames)==null?void 0:o.content)},z.createElement("div",{"data-title":"",className:te(A==null?void 0:A.title,(l=m==null?void 0:m.classNames)==null?void 0:l.title)},m.title),m.description?z.createElement("div",{"data-description":"",className:te(M,Z,A==null?void 0:A.description,(c=m==null?void 0:m.classNames)==null?void 0:c.description)},m.description):null),z.isValidElement(m.cancel)?m.cancel:m.cancel&&pc(m.cancel)?z.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||I,onClick:ce=>{var De,Le;pc(m.cancel)&&L&&((Le=(De=m.cancel).onClick)==null||Le.call(De,ce),Pt())},className:te(A==null?void 0:A.cancelButton,(u=m==null?void 0:m.classNames)==null?void 0:u.cancelButton)},m.cancel.label):null,z.isValidElement(m.action)?m.action:m.action&&pc(m.action)?z.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||D,onClick:ce=>{var De,Le;pc(m.action)&&(ce.defaultPrevented||((Le=(De=m.action).onClick)==null||Le.call(De,ce),Pt()))},className:te(A==null?void 0:A.actionButton,(h=m==null?void 0:m.classNames)==null?void 0:h.actionButton)},m.action.label):null))};function cv(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var RT=e=>{let{invert:t,position:r="bottom-right",hotkey:n=["altKey","KeyT"],expand:a,closeButton:i,className:o,offset:l,theme:c="light",richColors:u,duration:h,style:f,visibleToasts:m=jT,toastOptions:y,dir:v=cv(),gap:p=_T,loadingIcon:b,icons:g,containerAriaLabel:x="Notifications",pauseWhenPageIsHidden:w,cn:N=TT}=e,[C,k]=z.useState([]),T=z.useMemo(()=>Array.from(new Set([r].concat(C.filter(K=>K.position).map(K=>K.position)))),[C,r]),[P,I]=z.useState([]),[D,E]=z.useState(!1),[M,U]=z.useState(!1),[$,G]=z.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),F=z.useRef(null),X=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),A=z.useRef(null),O=z.useRef(!1),Y=z.useCallback(K=>{var te;(te=C.find(ge=>ge.id===K.id))!=null&&te.delete||wr.dismiss(K.id),k(ge=>ge.filter(({id:ke})=>ke!==K.id))},[C]);return z.useEffect(()=>wr.subscribe(K=>{if(K.dismiss){k(te=>te.map(ge=>ge.id===K.id?{...ge,delete:!0}:ge));return}setTimeout(()=>{Ow.flushSync(()=>{k(te=>{let ge=te.findIndex(ke=>ke.id===K.id);return ge!==-1?[...te.slice(0,ge),{...te[ge],...K},...te.slice(ge+1)]:[K,...te]})})})}),[]),z.useEffect(()=>{if(c!=="system"){G(c);return}c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:K})=>{G(K?"dark":"light")})},[c]),z.useEffect(()=>{C.length<=1&&E(!1)},[C]),z.useEffect(()=>{let K=te=>{var ge,ke;n.every(Ze=>te[Ze]||te.code===Ze)&&(E(!0),(ge=F.current)==null||ge.focus()),te.code==="Escape"&&(document.activeElement===F.current||(ke=F.current)!=null&&ke.contains(document.activeElement))&&E(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[n]),z.useEffect(()=>{if(F.current)return()=>{A.current&&(A.current.focus({preventScroll:!0}),A.current=null,O.current=!1)}},[F.current]),C.length?z.createElement("section",{"aria-label":`${x} ${X}`,tabIndex:-1},T.map((K,te)=>{var ge;let[ke,Ze]=K.split("-");return z.createElement("ol",{key:K,dir:v==="auto"?cv():v,tabIndex:-1,ref:F,className:o,"data-sonner-toaster":!0,"data-theme":$,"data-y-position":ke,"data-x-position":Ze,style:{"--front-toast-height":`${((ge=P[0])==null?void 0:ge.height)||0}px`,"--offset":typeof l=="number"?`${l}px`:l||NT,"--width":`${ST}px`,"--gap":`${p}px`,...f},onBlur:ye=>{O.current&&!ye.currentTarget.contains(ye.relatedTarget)&&(O.current=!1,A.current&&(A.current.focus({preventScroll:!0}),A.current=null))},onFocus:ye=>{ye.target instanceof HTMLElement&&ye.target.dataset.dismissible==="false"||O.current||(O.current=!0,A.current=ye.relatedTarget)},onMouseEnter:()=>E(!0),onMouseMove:()=>E(!0),onMouseLeave:()=>{M||E(!1)},onPointerDown:ye=>{ye.target instanceof HTMLElement&&ye.target.dataset.dismissible==="false"||U(!0)},onPointerUp:()=>U(!1)},C.filter(ye=>!ye.position&&te===0||ye.position===K).map((ye,ae)=>{var Se,Pe;return z.createElement(PT,{key:ye.id,icons:g,index:ae,toast:ye,defaultRichColors:u,duration:(Se=y==null?void 0:y.duration)!=null?Se:h,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:t,visibleToasts:m,closeButton:(Pe=y==null?void 0:y.closeButton)!=null?Pe:i,interacting:M,position:K,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:Y,toasts:C.filter(Ne=>Ne.position==ye.position),heights:P.filter(Ne=>Ne.position==ye.position),setHeights:I,expandByDefault:a,gap:p,loadingIcon:b,expanded:D,pauseWhenPageIsHidden:w,cn:N})}))})):null};const AT=({...e})=>{const{theme:t="system"}=oT();return s.jsx(RT,{theme:t,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})};/**
 * @remix-run/router v1.20.0
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function hl(){return hl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hl.apply(this,arguments)}var Ms;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ms||(Ms={}));const uv="popstate";function IT(e){e===void 0&&(e={});function t(n,a){let{pathname:i,search:o,hash:l}=n.location;return Jm("",{pathname:i,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:pu(a)}return OT(t,r,null,e)}function yt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Cb(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function MT(){return Math.random().toString(36).substr(2,8)}function dv(e,t){return{usr:e.state,key:e.key,idx:t}}function Jm(e,t,r,n){return r===void 0&&(r=null),hl({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?so(t):t,{state:r,key:t&&t.key||n||MT()})}function pu(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function so(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function OT(e,t,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,o=a.history,l=Ms.Pop,c=null,u=h();u==null&&(u=0,o.replaceState(hl({},o.state,{idx:u}),""));function h(){return(o.state||{idx:null}).idx}function f(){l=Ms.Pop;let b=h(),g=b==null?null:b-u;u=b,c&&c({action:l,location:p.location,delta:g})}function m(b,g){l=Ms.Push;let x=Jm(p.location,b,g);u=h()+1;let w=dv(x,u),N=p.createHref(x);try{o.pushState(w,"",N)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;a.location.assign(N)}i&&c&&c({action:l,location:p.location,delta:1})}function y(b,g){l=Ms.Replace;let x=Jm(p.location,b,g);u=h();let w=dv(x,u),N=p.createHref(x);o.replaceState(w,"",N),i&&c&&c({action:l,location:p.location,delta:0})}function v(b){let g=a.location.origin!=="null"?a.location.origin:a.location.href,x=typeof b=="string"?b:pu(b);return x=x.replace(/ $/,"%20"),yt(g,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,g)}let p={get action(){return l},get location(){return e(a,o)},listen(b){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(uv,f),c=b,()=>{a.removeEventListener(uv,f),c=null}},createHref(b){return t(a,b)},createURL:v,encodeLocation(b){let g=v(b);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:m,replace:y,go(b){return o.go(b)}};return p}var fv;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(fv||(fv={}));function DT(e,t,r){return r===void 0&&(r="/"),FT(e,t,r,!1)}function FT(e,t,r,n){let a=typeof t=="string"?so(t):t,i=Hp(a.pathname||"/",r);if(i==null)return null;let o=Sb(e);LT(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=QT(i);l=KT(o[c],u,n)}return l}function Sb(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(yt(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=Ws([n,c.relativePath]),h=r.concat(c);i.children&&i.children.length>0&&(yt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Sb(i.children,t,h,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:WT(u,i.index),routesMeta:h})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,o);else for(let c of _b(i.path))a(i,o,c)}),t}function _b(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let o=_b(n.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),a&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function LT(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:qT(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const $T=/^:[\w-]+$/,UT=3,zT=2,VT=1,BT=10,HT=-2,mv=e=>e==="*";function WT(e,t){let r=e.split("/"),n=r.length;return r.some(mv)&&(n+=HT),t&&(n+=zT),r.filter(a=>!mv(a)).reduce((a,i)=>a+($T.test(i)?UT:i===""?VT:BT),n)}function qT(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function KT(e,t,r){let{routesMeta:n}=e,a={},i="/",o=[];for(let l=0;l<n.length;++l){let c=n[l],u=l===n.length-1,h=i==="/"?t:t.slice(i.length)||"/",f=hv({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},h),m=c.route;if(!f&&u&&r&&!n[n.length-1].route.index&&(f=hv({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},h)),!f)return null;Object.assign(a,f.params),o.push({params:a,pathname:Ws([i,f.pathname]),pathnameBase:JT(Ws([i,f.pathnameBase])),route:m}),f.pathnameBase!=="/"&&(i=Ws([i,f.pathnameBase]))}return o}function hv(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=GT(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((u,h,f)=>{let{paramName:m,isOptional:y}=h;if(m==="*"){let p=l[f]||"";o=i.slice(0,i.length-p.length).replace(/(.)\/+$/,"$1")}const v=l[f];return y&&!v?u[m]=void 0:u[m]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function GT(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Cb(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 n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function QT(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Cb(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Hp(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function YT(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?so(e):e;return{pathname:r?r.startsWith("/")?r:ZT(r,t):t,search:eP(n),hash:tP(a)}}function ZT(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Of(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function XT(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Wp(e,t){let r=XT(e);return t?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function qp(e,t,r,n){n===void 0&&(n=!1);let a;typeof e=="string"?a=so(e):(a=hl({},e),yt(!a.pathname||!a.pathname.includes("?"),Of("?","pathname","search",a)),yt(!a.pathname||!a.pathname.includes("#"),Of("#","pathname","hash",a)),yt(!a.search||!a.search.includes("#"),Of("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,l;if(o==null)l=r;else{let f=t.length-1;if(!n&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),f-=1;a.pathname=m.join("/")}l=f>=0?t[f]:"/"}let c=YT(a,l),u=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||h)&&(c.pathname+="/"),c}const Ws=e=>e.join("/").replace(/\/\/+/g,"/"),JT=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),eP=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,tP=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function rP(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Eb=["post","put","patch","delete"];new Set(Eb);const nP=["get",...Eb];new Set(nP);/**
 * React Router v6.27.0
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function pl(){return pl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pl.apply(this,arguments)}const Kp=d.createContext(null),sP=d.createContext(null),aa=d.createContext(null),wd=d.createContext(null),cs=d.createContext({outlet:null,matches:[],isDataRoute:!1}),kb=d.createContext(null);function aP(e,t){let{relative:r}=t===void 0?{}:t;ao()||yt(!1);let{basename:n,navigator:a}=d.useContext(aa),{hash:i,pathname:o,search:l}=Pb(e,{relative:r}),c=o;return n!=="/"&&(c=o==="/"?n:Ws([n,o])),a.createHref({pathname:c,search:l,hash:i})}function ao(){return d.useContext(wd)!=null}function qa(){return ao()||yt(!1),d.useContext(wd).location}function Tb(e){d.useContext(aa).static||d.useLayoutEffect(e)}function ln(){let{isDataRoute:e}=d.useContext(cs);return e?vP():iP()}function iP(){ao()||yt(!1);let e=d.useContext(Kp),{basename:t,future:r,navigator:n}=d.useContext(aa),{matches:a}=d.useContext(cs),{pathname:i}=qa(),o=JSON.stringify(Wp(a,r.v7_relativeSplatPath)),l=d.useRef(!1);return Tb(()=>{l.current=!0}),d.useCallback(function(u,h){if(h===void 0&&(h={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let f=qp(u,JSON.parse(o),i,h.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ws([t,f.pathname])),(h.replace?n.replace:n.push)(f,h.state,h)},[t,n,o,i,e])}function Ll(){let{matches:e}=d.useContext(cs),t=e[e.length-1];return t?t.params:{}}function Pb(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=d.useContext(aa),{matches:a}=d.useContext(cs),{pathname:i}=qa(),o=JSON.stringify(Wp(a,n.v7_relativeSplatPath));return d.useMemo(()=>qp(e,JSON.parse(o),i,r==="path"),[e,o,i,r])}function oP(e,t){return lP(e,t)}function lP(e,t,r,n){ao()||yt(!1);let{navigator:a}=d.useContext(aa),{matches:i}=d.useContext(cs),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=qa(),h;if(t){var f;let b=typeof t=="string"?so(t):t;c==="/"||(f=b.pathname)!=null&&f.startsWith(c)||yt(!1),h=b}else h=u;let m=h.pathname||"/",y=m;if(c!=="/"){let b=c.replace(/^\//,"").split("/");y="/"+m.replace(/^\//,"").split("/").slice(b.length).join("/")}let v=DT(e,{pathname:y}),p=mP(v&&v.map(b=>Object.assign({},b,{params:Object.assign({},l,b.params),pathname:Ws([c,a.encodeLocation?a.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:Ws([c,a.encodeLocation?a.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,r,n);return t&&p?d.createElement(wd.Provider,{value:{location:pl({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Ms.Pop}},p):p}function cP(){let e=xP(),t=rP(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return d.createElement(d.Fragment,null,d.createElement("h2",null,"Unexpected Application Error!"),d.createElement("h3",{style:{fontStyle:"italic"}},t),r?d.createElement("pre",{style:a},r):null,null)}const uP=d.createElement(cP,null);class dP extends d.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?d.createElement(cs.Provider,{value:this.props.routeContext},d.createElement(kb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function fP(e){let{routeContext:t,match:r,children:n}=e,a=d.useContext(Kp);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),d.createElement(cs.Provider,{value:t},n)}function mP(e,t,r,n){var a;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var i;if(!r)return null;if(r.errors)e=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,l=(a=r)==null?void 0:a.errors;if(l!=null){let h=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);h>=0||yt(!1),o=o.slice(0,Math.min(o.length,h+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let h=0;h<o.length;h++){let f=o[h];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=h),f.route.id){let{loaderData:m,errors:y}=r,v=f.route.loader&&m[f.route.id]===void 0&&(!y||y[f.route.id]===void 0);if(f.route.lazy||v){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((h,f,m)=>{let y,v=!1,p=null,b=null;r&&(y=l&&f.route.id?l[f.route.id]:void 0,p=f.route.errorElement||uP,c&&(u<0&&m===0?(v=!0,b=null):u===m&&(v=!0,b=f.route.hydrateFallbackElement||null)));let g=t.concat(o.slice(0,m+1)),x=()=>{let w;return y?w=p:v?w=b:f.route.Component?w=d.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=h,d.createElement(fP,{match:f,routeContext:{outlet:h,matches:g,isDataRoute:r!=null},children:w})};return r&&(f.route.ErrorBoundary||f.route.errorElement||m===0)?d.createElement(dP,{location:r.location,revalidation:r.revalidation,component:p,error:y,children:x(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):x()},null)}var Rb=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Rb||{}),gu=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(gu||{});function hP(e){let t=d.useContext(Kp);return t||yt(!1),t}function pP(e){let t=d.useContext(sP);return t||yt(!1),t}function gP(e){let t=d.useContext(cs);return t||yt(!1),t}function Ab(e){let t=gP(),r=t.matches[t.matches.length-1];return r.route.id||yt(!1),r.route.id}function xP(){var e;let t=d.useContext(kb),r=pP(gu.UseRouteError),n=Ab(gu.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function vP(){let{router:e}=hP(Rb.UseNavigateStable),t=Ab(gu.UseNavigateStable),r=d.useRef(!1);return Tb(()=>{r.current=!0}),d.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,pl({fromRouteId:t},i)))},[e,t])}function Ib(e){let{to:t,replace:r,state:n,relative:a}=e;ao()||yt(!1);let{future:i,static:o}=d.useContext(aa),{matches:l}=d.useContext(cs),{pathname:c}=qa(),u=ln(),h=qp(t,Wp(l,i.v7_relativeSplatPath),c,a==="path"),f=JSON.stringify(h);return d.useEffect(()=>u(JSON.parse(f),{replace:r,state:n,relative:a}),[u,f,a,r,n]),null}function ir(e){yt(!1)}function yP(e){let{basename:t="/",children:r=null,location:n,navigationType:a=Ms.Pop,navigator:i,static:o=!1,future:l}=e;ao()&&yt(!1);let c=t.replace(/^\/*/,"/"),u=d.useMemo(()=>({basename:c,navigator:i,static:o,future:pl({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof n=="string"&&(n=so(n));let{pathname:h="/",search:f="",hash:m="",state:y=null,key:v="default"}=n,p=d.useMemo(()=>{let b=Hp(h,c);return b==null?null:{location:{pathname:b,search:f,hash:m,state:y,key:v},navigationType:a}},[c,h,f,m,y,v,a]);return p==null?null:d.createElement(aa.Provider,{value:u},d.createElement(wd.Provider,{children:r,value:p}))}function wP(e){let{children:t,location:r}=e;return oP(eh(t),r)}new Promise(()=>{});function eh(e,t){t===void 0&&(t=[]);let r=[];return d.Children.forEach(e,(n,a)=>{if(!d.isValidElement(n))return;let i=[...t,a];if(n.type===d.Fragment){r.push.apply(r,eh(n.props.children,i));return}n.type!==ir&&yt(!1),!n.props.index||!n.props.children||yt(!1);let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=eh(n.props.children,i)),r.push(o)}),r}/**
 * React Router DOM v6.27.0
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */function th(){return th=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},th.apply(this,arguments)}function bP(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,i;for(i=0;i<n.length;i++)a=n[i],!(t.indexOf(a)>=0)&&(r[a]=e[a]);return r}function jP(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function NP(e,t){return e.button===0&&(!t||t==="_self")&&!jP(e)}const CP=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],SP="6";try{window.__reactRouterVersion=SP}catch{}const _P="startTransition",pv=Yu[_P];function EP(e){let{basename:t,children:r,future:n,window:a}=e,i=d.useRef();i.current==null&&(i.current=IT({window:a,v5Compat:!0}));let o=i.current,[l,c]=d.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},h=d.useCallback(f=>{u&&pv?pv(()=>c(f)):c(f)},[c,u]);return d.useLayoutEffect(()=>o.listen(h),[o,h]),d.createElement(yP,{basename:t,children:r,location:l.location,navigationType:l.action,navigator:o,future:n})}const kP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",TP=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ht=d.forwardRef(function(t,r){let{onClick:n,relative:a,reloadDocument:i,replace:o,state:l,target:c,to:u,preventScrollReset:h,viewTransition:f}=t,m=bP(t,CP),{basename:y}=d.useContext(aa),v,p=!1;if(typeof u=="string"&&TP.test(u)&&(v=u,kP))try{let w=new URL(window.location.href),N=u.startsWith("//")?new URL(w.protocol+u):new URL(u),C=Hp(N.pathname,y);N.origin===w.origin&&C!=null?u=C+N.search+N.hash:p=!0}catch{}let b=aP(u,{relative:a}),g=PP(u,{replace:o,state:l,target:c,preventScrollReset:h,relative:a,viewTransition:f});function x(w){n&&n(w),w.defaultPrevented||g(w)}return d.createElement("a",th({},m,{href:v||b,onClick:p||i?n:x,ref:r,target:c}))});var gv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(gv||(gv={}));var xv;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(xv||(xv={}));function PP(e,t){let{target:r,replace:n,state:a,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=ln(),u=qa(),h=Pb(e,{relative:o});return d.useCallback(f=>{if(NP(f,r)){f.preventDefault();let m=n!==void 0?n:pu(u)===pu(h);c(e,{replace:m,state:a,preventScrollReset:i,relative:o,viewTransition:l})}},[u,c,h,n,a,r,e,i,o,l])}const RP=xd("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),V=d.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...a},i)=>{const o=n?Gs:"button";return s.jsx(o,{className:le(RP({variant:t,size:r,className:e})),ref:i,...a})});V.displayName="Button";const AP="/backend",ha=class ha{constructor(){Gl(this,"baseUrl");Gl(this,"token",null);this.baseUrl=AP,this.token=localStorage.getItem("auth_token")}static getInstance(){return ha.instance||(ha.instance=new ha),ha.instance}async request(t,r={}){const n=`${this.baseUrl}/${t}`,a={...r.headers};!(r.body instanceof FormData)&&!a["Content-Type"]&&(a["Content-Type"]="application/json"),this.token&&(a.Authorization=`Bearer ${this.token}`);const i=await fetch(n,{...r,headers:a}),o=await i.json();if(!i.ok)throw new Error(o.message||`HTTP error! status: ${i.status}`);return o}async login(t,r){const n=await this.request("auth/login",{method:"POST",body:JSON.stringify({email:t,password:r})});return n.success&&n.token&&(this.token=n.token,localStorage.setItem("auth_token",n.token),localStorage.setItem("user",JSON.stringify(n.user))),n}async register(t,r,n,a){const i=await this.request("auth/register",{method:"POST",body:JSON.stringify({email:t,password:r,first_name:n,last_name:a})});return i.success&&i.token&&(this.token=i.token,localStorage.setItem("auth_token",i.token),localStorage.setItem("user",JSON.stringify(i.user))),i}async getUser(){return this.request("auth/user")}async updateUser(t){return this.request("auth/user",{method:"POST",body:JSON.stringify(t)})}async googleLogin(t){const r=await this.request("auth/google",{method:"POST",body:JSON.stringify({token:t})});return r.success&&r.token&&(this.token=r.token,localStorage.setItem("auth_token",r.token),localStorage.setItem("user",JSON.stringify(r.user))),r}logout(){this.token=null,localStorage.removeItem("auth_token"),localStorage.removeItem("user")}async getCourses(t){const r=new URLSearchParams(t||{}).toString();return this.request(`courses${r?`?${r}`:""}`)}async getCourse(t){return this.request(`courses/${t}`)}async getCategories(){return this.request("courses?action=categories")}async createCourse(t){return this.request("courses",{method:"POST",body:JSON.stringify(t)})}async updateCourse(t,r){return this.request(`courses/${t}`,{method:"PUT",body:JSON.stringify(r)})}async deleteCourse(t){return this.request(`courses/${t}`,{method:"DELETE"})}async getUserEnrollments(){return this.request("enrollments")}async enrollInCourse(t,r){if(r){const n=new FormData;return n.append("course_id",t),n.append("action","enroll"),n.append("payment_proof",r),this.request("enrollments",{method:"POST",body:n,headers:{}})}else return this.request("enrollments",{method:"POST",body:JSON.stringify({course_id:t,action:"enroll"})})}async unenrollFromCourse(t){return this.request("enrollments",{method:"POST",body:JSON.stringify({course_id:t,action:"unenroll"})})}async updateProgress(t,r){return this.request("enrollments",{method:"POST",body:JSON.stringify({course_id:t,action:"update_progress",progress:r})})}async checkEnrollment(t){return this.request("enrollments",{method:"POST",body:JSON.stringify({course_id:t,action:"check_enrollment"})})}async getExams(t){const r=t?`?course_id=${t}`:"";return this.request(`exams${r}`)}async getExam(t){return this.request(`exams/${t}`)}async getExamQuestions(t){return this.request(`exams/${t}/questions`)}async startExam(t,r){return this.request("exams",{method:"POST",body:JSON.stringify({action:"start_exam",exam_id:t,exam_key:r})})}async submitAnswer(t,r,n){return this.request("exams",{method:"POST",body:JSON.stringify({action:"submit_answer",attempt_id:t,question_id:r,answer:n})})}async completeExam(t){return this.request("exams",{method:"POST",body:JSON.stringify({action:"complete_exam",attempt_id:t})})}async getUserAttempts(t){return this.request("exams",{method:"POST",body:JSON.stringify({action:"get_attempts",exam_id:t})})}async generateExamKey(t,r=1,n){return this.request("exams",{method:"POST",body:JSON.stringify({action:"generate_key",exam_id:t,max_uses:r,expires_in_hours:n})})}async getAchievements(){return this.request("achievements")}async getComments(t){const r=new URLSearchParams({course_id:t}).toString();return this.request(`comments?${r}`)}async createComment(t,r,n){return this.request("comments",{method:"POST",body:JSON.stringify({course_id:t,content:r,name:n})})}async getUserAchievements(){return this.request("achievements/user")}async getUserStats(){return this.request("achievements/user/stats")}async checkAchievements(){return this.request("achievements",{method:"POST",body:JSON.stringify({action:"check_achievements"})})}async awardAchievement(t,r){return this.request("achievements",{method:"POST",body:JSON.stringify({action:"award_achievement",achievement_id:t,target_user_id:r})})}async getAllUsers(){return this.request("admin?action=users")}async getDashboardStats(){return this.request("admin?action=stats")}async updateUserAdmin(t,r){return this.request("admin",{method:"PUT",body:JSON.stringify({user_id:t,...r})})}async deleteUserAdmin(t){return this.request("admin",{method:"DELETE",body:JSON.stringify({user_id:t})})}async createAdminUser(t,r,n,a){return this.request("admin?action=create_admin",{method:"POST",body:JSON.stringify({email:t,password:r,first_name:n,last_name:a})})}async getAllCoursesAdmin(){return this.request("admin?action=courses")}async createCourseAdmin(t){return this.request("admin?action=create_course",{method:"POST",body:JSON.stringify(t)})}async updateCourseAdmin(t,r){return this.request("admin?action=update_course",{method:"POST",body:JSON.stringify({course_id:t,...r})})}async deleteCourseAdmin(t){return this.request("admin?action=delete_course",{method:"POST",body:JSON.stringify({course_id:t})})}async getAllAchievementsAdmin(){return this.request("admin?action=achievements")}async createAchievementAdmin(t){console.log("apiClient.createAchievementAdmin called with:",t);const r=await this.request("admin?action=create_achievement",{method:"POST",body:JSON.stringify(t)});if(console.log("apiClient.createAchievementAdmin response:",r),!r.success)throw new Error(r.message||"Failed to create achievement");return r}async uploadAchievementImage(t){const r=new FormData;r.append("image",t);const n=`${this.baseUrl}/admin?action=upload_achievement_image`,a={};this.token&&(a.Authorization=`Bearer ${this.token}`);const i=await fetch(n,{method:"POST",headers:a,body:r}),o=await i.json();if(!i.ok||!o.success)throw new Error(o.message||"Failed to upload image");return o}async uploadCourseImage(t){const r=new FormData;r.append("image",t);const n=`${this.baseUrl}/admin?action=upload_course_image`,a={};this.token&&(a.Authorization=`Bearer ${this.token}`);const i=await fetch(n,{method:"POST",headers:a,body:r}),o=await i.json();if(!i.ok||!o.success)throw new Error(o.message||"Failed to upload course image");return o}async updateAchievementAdmin(t,r){return this.request("admin?action=update_achievement",{method:"POST",body:JSON.stringify({achievement_id:t,...r})})}async deleteAchievementAdmin(t){return this.request("admin?action=delete_achievement",{method:"POST",body:JSON.stringify({achievement_id:t})})}async getHeroImages(){return(await this.request("hero")).images||[]}async uploadHeroImageAdmin(t){const r=`${this.baseUrl}/hero?action=upload`,n=new FormData;n.append("file",t);const a={};this.token&&(a.Authorization=`Bearer ${this.token}`);const i=await fetch(r,{method:"POST",headers:a,body:n}),o=await i.json();if(!i.ok)throw new Error(o.message||"Upload failed");return o}async setActiveHeroAdmin(t){return this.request("hero?action=set_active",{method:"POST",body:JSON.stringify({id:t})})}async deleteHeroImageAdmin(t){return this.request("hero?action=delete",{method:"POST",body:JSON.stringify({id:t})})}async getTestimonials(t=!1){const r=t?"testimonials?admin=true":"testimonials";return this.request(r)}async createTestimonialAdmin(t){return this.request("testimonials",{method:"POST",body:JSON.stringify(t)})}async updateTestimonialAdmin(t,r){return this.request("testimonials",{method:"PUT",body:JSON.stringify({id:t,...r})})}async deleteTestimonialAdmin(t){return this.request(`testimonials?id=${t}`,{method:"DELETE"})}async uploadTestimonialImage(t){const r=new FormData;r.append("image",t);const n=`${this.baseUrl}/admin?action=upload_testimonial_image`,a={};this.token&&(a.Authorization=`Bearer ${this.token}`);const i=await fetch(n,{method:"POST",headers:a,body:r}),o=await i.json();if(!i.ok||!o.success)throw new Error(o.message||"Failed to upload image");return o}async getAllEnrollmentsAdmin(){const t=await fetch(`${this.baseUrl}/enrollments?admin=true`,{method:"GET",headers:{Authorization:`Bearer ${this.token}`}});if(!t.ok)throw new Error("Failed to fetch enrollments");return await t.json()}async updateEnrollmentApproval(t,r){const n=await fetch(`${this.baseUrl}/enrollments?admin=true`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.token}`},body:JSON.stringify({enrollment_id:t,action:"update_approval",approval_status:r})});if(!n.ok)throw new Error("Failed to update approval status");return await n.json()}async updateEnrollmentDate(t,r){const n=await fetch(`${this.baseUrl}/enrollments?admin=true`,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.token}`},body:JSON.stringify({enrollment_id:t,action:"update_date",enrolled_at:r})});if(!n.ok)throw new Error("Failed to update enrollment date");return await n.json()}async deleteEnrollmentAdmin(t){const r=await fetch(`${this.baseUrl}/enrollments?admin=true&enrollment_id=${t}`,{method:"DELETE",headers:{Authorization:`Bearer ${this.token}`}});if(!r.ok)throw new Error("Failed to delete enrollment");return await r.json()}async getAllCategoriesAdmin(){return this.request("admin?action=categories")}async createCategoryAdmin(t){return this.request("admin?action=create_category",{method:"POST",body:JSON.stringify(t)})}async updateCategoryAdmin(t,r){return this.request("admin?action=update_category",{method:"POST",body:JSON.stringify({category_id:t,...r})})}async deleteCategoryAdmin(t){return this.request("admin?action=delete_category",{method:"POST",body:JSON.stringify({category_id:t})})}isAuthenticated(){return!!this.token}getCurrentUser(){const t=localStorage.getItem("user");return t?JSON.parse(t):null}};Gl(ha,"instance");let rh=ha;const ue=rh.getInstance(),Mb=d.createContext({user:null,isLoading:!0,login:async()=>{},register:async()=>{},googleLogin:async()=>{},logout:()=>{},updateUser:async()=>{}}),IP=({children:e})=>{const[t,r]=d.useState(null),[n,a]=d.useState(!0);d.useEffect(()=>{(async()=>{try{if(ue.isAuthenticated()&&ue.getCurrentUser()){const m=await ue.getUser();m.success?r(m.user):(ue.logout(),r(null))}}catch(f){console.error("Error checking user:",f),ue.logout(),r(null)}finally{a(!1)}})()},[]);const i=async(h,f)=>{try{const m=await ue.login(h,f);return m.success&&r(m.user),m}catch(m){throw console.error("Login error:",m),m}},o=async(h,f,m,y)=>{try{const v=await ue.register(h,f,m,y);return v.success&&r(v.user),v}catch(v){throw console.error("Registration error:",v),v}},l=()=>{ue.logout(),r(null)},c=async h=>{try{const f=await ue.googleLogin(h);return f.success&&r(f.user),f}catch(f){throw console.error("Google login error:",f),f}},u=async h=>{try{const f=await ue.updateUser(h);return f.success&&r(f.user),f}catch(f){throw console.error("Update user error:",f),f}};return s.jsx(Mb.Provider,{value:{user:t,isLoading:n,login:i,register:o,googleLogin:c,logout:l,updateUser:u},children:e})},ia=()=>d.useContext(Mb),MP=()=>{var N;const{user:e,isLoading:t,logout:r}=ia(),[n,a]=d.useState(!1),[i,o]=d.useState(!1),[l,c]=d.useState(!1),[u,h]=d.useState(!1),f=ln(),m=qa(),y=d.useRef(null),v=e&&(`${e.first_name||""} ${e.last_name||""}`.trim()||((N=e.email)==null?void 0:N.split("@")[0]))||"User",p=[{name:"Home",path:"/",section:"home"},{name:"Courses",path:"/#courses",section:"courses"},{name:"About",path:"/#about",section:"about"},{name:"Testimonials",path:"/#testimonials",section:"testimonials"},{name:"Contact",path:"/#contact",section:"contact"},...n?[{name:"Admin",path:"/admin",section:"admin",isExternal:!0}]:[]],b=(C,k,T=!1)=>{if(T)return;const[P,I]=C.split("#");if(m.pathname==="/"&&I){event==null||event.preventDefault();const E=document.getElementById(I);E&&E.scrollIntoView({behavior:"smooth"})}else I&&(event==null||event.preventDefault(),f(`/#${I}`))};d.useEffect(()=>{const C=()=>{window.scrollY>10?h(!0):h(!1)};return window.addEventListener("scroll",C),()=>window.removeEventListener("scroll",C)},[]),d.useEffect(()=>{c(!1)},[m]);const g=C=>C==="/"?m.pathname==="/":m.pathname.startsWith(C),x=async C=>{try{const k=["dev.mobile20244@gmail.com"];a(e!=null&&e.email?k.includes(e.email):!1)}catch(k){console.error("Error checking admin status:",k),a(!1)}};d.useEffect(()=>{e!=null&&e.id?x(e.id):a(!1)},[e]);const w=async()=>{try{r(),o(!1),f("/"),Hm({title:"Signed out",description:"You have been successfully signed out."})}catch(C){console.error("Error signing out:",C),Hm({title:"Error",description:"Failed to sign out. Please try again.",variant:"destructive"})}};return d.useEffect(()=>{const C=k=>{i&&!k.target.closest(".user-menu")&&o(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[i]),t?s.jsx("header",{className:"bg-white shadow-sm border-b",children:s.jsxs("div",{className:"max-w-7xl mx-auto px-4 h-16 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx($r,{className:"h-6 w-6 text-blue-600 animate-pulse"}),s.jsx("span",{className:"font-medium text-gray-600",children:"Loading..."})]}),s.jsx("div",{className:"flex items-center space-x-4",children:s.jsx("div",{className:"h-8 w-24 bg-gray-200 rounded animate-pulse"})})]})}):s.jsxs("header",{ref:y,className:le("sticky top-0 z-50 w-full transition-all duration-300",u?"bg-white/95 backdrop-blur-md shadow-md border-b border-gray-100":"bg-white/90 backdrop-blur-sm border-b border-transparent"),children:[s.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"flex justify-between h-20 md:h-24",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx(ht,{to:"/",className:"flex items-center space-x-2 group",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),children:s.jsx("div",{className:"flex items-center h-20 md:h-24 -my-3",children:s.jsx("img",{src:"/lovable-uploads/b47b5e69-6b45-458a-965b-79ed3cf76f51.png",alt:"Logo",className:"h-20 md:h-24 w-auto object-contain transition-all duration-300"})})}),s.jsx("nav",{className:"hidden md:ml-10 md:flex md:items-center md:space-x-2",children:p.map(C=>s.jsxs(ht,{to:C.path,onClick:k=>b(C.path,C.section,C.isExternal),className:le("px-4 py-2.5 text-base font-medium rounded-lg transition-all duration-200 cursor-pointer",g(C.path)?"text-primary-600 bg-primary-50":"text-gray-700 hover:text-primary-600 hover:bg-primary-50/50"),children:[C.name,g(C.path)&&s.jsx("span",{className:"block h-0.5 w-6 bg-primary-600 mx-auto mt-1 rounded-full"})]},C.path))})]}),s.jsx("div",{className:"flex items-center md:hidden",children:s.jsxs("button",{onClick:()=>c(!l),className:"inline-flex items-center justify-center p-2 rounded-md text-gray-700 hover:text-blue-600 hover:bg-gray-100 focus:outline-none","aria-expanded":"false",children:[s.jsx("span",{className:"sr-only",children:"Open main menu"}),l?s.jsx(ro,{className:"block h-6 w-6","aria-hidden":"true"}):s.jsx(xk,{className:"block h-6 w-6","aria-hidden":"true"})]})}),s.jsx("div",{className:"hidden md:flex md:items-center md:space-x-4",children:e?s.jsxs("div",{className:"relative user-menu",children:[s.jsxs("button",{onClick:()=>o(!i),className:"flex items-center space-x-3 focus:outline-none group",children:[s.jsxs("div",{className:"h-11 w-11 rounded-full bg-gradient-to-r from-blue-50 to-purple-50 flex items-center justify-center overflow-hidden border-2 border-white shadow-sm group-hover:shadow-md transition-all duration-200",children:[e.avatar_url?s.jsx("img",{src:e.avatar_url,alt:v,className:"h-full w-full object-cover",onError:C=>{const k=C.target;k.style.display="none";const T=k.nextElementSibling;T&&(T.style.display="flex")}}):null,s.jsx("div",{className:"h-full w-full flex items-center justify-center bg-gradient-to-r from-blue-100 to-purple-100",children:s.jsx("span",{className:"text-base font-medium text-blue-700",children:v.charAt(0).toUpperCase()})})]}),s.jsx("span",{className:"hidden lg:inline text-base font-medium text-gray-700 group-hover:text-blue-600 transition-colors",children:v.split(" ")[0]})]}),i&&s.jsxs("div",{className:"absolute right-0 mt-2 w-60 bg-white rounded-lg shadow-lg py-2 z-50 border border-gray-100",children:[s.jsxs("div",{className:"px-4 py-3 border-b border-gray-100",children:[s.jsx("p",{className:"text-base font-medium text-gray-900",children:v}),s.jsx("p",{className:"text-sm text-gray-500 truncate",children:e.email})]}),s.jsxs("button",{onClick:()=>{f("/profile"),o(!1)},className:"w-full text-left px-4 py-3 text-sm text-gray-700 hover:bg-gray-50 flex items-center space-x-3",children:[s.jsx(ik,{className:"h-5 w-5"}),s.jsx("span",{children:"My Profile"})]}),n&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"border-t my-1"}),s.jsx("p",{className:"px-4 py-1 text-xs font-medium text-gray-500",children:"Admin"}),s.jsxs("button",{onClick:()=>{f("/admin/dashboard"),o(!1)},className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 flex items-center space-x-2",children:[s.jsx(pk,{className:"h-4 w-4"}),s.jsx("span",{children:"Dashboard"})]}),s.jsxs("button",{onClick:()=>{f("/admin/users"),o(!1)},className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 flex items-center space-x-2",children:[s.jsx(av,{className:"h-4 w-4"}),s.jsx("span",{children:"Manage Users"})]}),s.jsxs("button",{onClick:()=>{f("/exam-management"),o(!1)},className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 flex items-center space-x-2",children:[s.jsx(uk,{className:"h-4 w-4"}),s.jsx("span",{children:"Manage Exams"})]})]}),s.jsx("div",{className:"border-t my-1"}),s.jsxs("button",{onClick:async()=>{await w(),o(!1)},className:"w-full text-left px-4 py-2 text-sm text-red-600 hover:bg-gray-100 flex items-center space-x-2",children:[s.jsx(db,{className:"h-4 w-4"}),s.jsx("span",{children:"Sign out"})]})]})]}):s.jsxs(s.Fragment,{children:[s.jsx(V,{asChild:!0,variant:"outline",size:"sm",className:"hidden md:flex items-center space-x-1.5 border-gray-200 hover:border-blue-200 hover:bg-blue-50 hover:text-blue-600 transition-colors",children:s.jsxs(ht,{to:"/login",className:"flex items-center",children:[s.jsx(av,{className:"h-4 w-4 mr-1.5"}),s.jsx("span",{children:"Sign In"})]})}),s.jsx(V,{asChild:!0,size:"sm",className:"hidden md:flex items-center space-x-1.5 bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 shadow-md hover:shadow-lg transition-all",onClick:C=>{if(C.preventDefault(),m.pathname==="/"){const k=document.getElementById("courses");k&&k.scrollIntoView({behavior:"smooth"})}else f("/#courses")},children:s.jsx(ht,{to:"#courses",className:"flex items-center text-white",children:s.jsx("span",{children:"Get Started"})})})]})})]})}),s.jsx("div",{className:le("md:hidden transition-all duration-300 ease-in-out overflow-hidden",l?"max-h-96 opacity-100":"max-h-0 opacity-0"),children:s.jsxs("div",{className:"pt-2 pb-3 space-y-1",children:[p.map(C=>s.jsx(ht,{to:C.path,className:le("block px-4 py-3 text-base font-medium transition-colors",g(C.path)?"bg-blue-50 text-blue-700 border-l-4 border-blue-600":"text-gray-700 hover:bg-gray-50 hover:text-blue-600"),onClick:k=>{b(C.path,C.section,C.isExternal),c(!1)},children:C.name},C.path)),e?null:s.jsxs("div",{className:"px-4 pt-2 pb-3 space-y-2 border-t border-gray-200",children:[s.jsx(ht,{to:"/login",className:"block w-full text-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700",onClick:()=>c(!1),children:"Sign in"}),s.jsx(ht,{to:"/register",className:"block w-full text-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-blue-700 bg-blue-100 hover:bg-blue-200",onClick:()=>c(!1),children:"Create account"})]})]})})]})},OP=()=>s.jsx("footer",{className:"bg-slate-800 text-white",children:s.jsxs("div",{className:"container mx-auto px-4 lg:px-6",children:[s.jsx("div",{className:"py-8 sm:py-10 md:py-12",children:s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6 sm:gap-8",children:[s.jsxs("div",{className:"sm:col-span-2 lg:col-span-1 space-y-4 sm:space-y-6",children:[s.jsx("div",{className:"flex items-center justify-center lg:justify-start",children:s.jsx("img",{src:"/Trabsparent Whute.png",alt:"You Talk Academy",className:"h-16 w-16 sm:h-24 sm:w-24 object-contain",onError:e=>{e.currentTarget.src="/logo-fallback.svg"}})}),s.jsxs("div",{className:"text-center lg:text-left",children:[s.jsx("h2",{className:"text-xl sm:text-2xl md:text-3xl font-bold text-white mb-3 sm:mb-4",children:"You Talk Academy"}),s.jsx("p",{className:"text-gray-300 text-xs sm:text-sm md:text-base leading-relaxed px-2 sm:px-0",children:"You Talk Academy is your trusted partner in mastering English language skills. We provide high-quality education with expert instructors and flexible learning options."})]}),s.jsxs("div",{className:"space-y-2 sm:space-y-3 text-center lg:text-left",children:[s.jsxs("div",{className:"flex items-center justify-center lg:justify-start gap-2 sm:gap-3",children:[s.jsx(fb,{className:"h-4 w-4 sm:h-5 sm:w-5 text-cyan-400 flex-shrink-0"}),s.jsxs("div",{className:"text-xs sm:text-sm text-gray-300",children:[s.jsx("div",{children:"East Jakarta, Indonesia"}),s.jsx("div",{children:"Madrid, Spain"})]})]}),s.jsxs("div",{className:"flex items-center justify-center lg:justify-start gap-2 sm:gap-3",children:[s.jsx(hu,{className:"h-4 w-4 sm:h-5 sm:w-5 text-cyan-400 flex-shrink-0"}),s.jsxs("div",{className:"text-xs sm:text-sm text-gray-300",children:[s.jsx("div",{children:"+62 852 9110 8001"}),s.jsx("div",{children:"+34 642 135 185"})]})]}),s.jsxs("div",{className:"flex items-center justify-center lg:justify-start gap-2 sm:gap-3",children:[s.jsx(yd,{className:"h-4 w-4 sm:h-5 sm:w-5 text-cyan-400 flex-shrink-0"}),s.jsx("div",{className:"text-xs sm:text-sm text-gray-300",children:"support@youtalkacademy.com"})]})]})]}),s.jsxs("div",{className:"text-center lg:text-left",children:[s.jsxs("h3",{className:"text-lg sm:text-xl font-bold text-white mb-4 sm:mb-6 relative",children:["QUICK LINKS",s.jsx("div",{className:"absolute -bottom-2 left-0 right-0 lg:right-auto lg:w-12 h-1 bg-gradient-to-r from-cyan-400 to-blue-500 mx-auto lg:mx-0"})]}),s.jsxs("ul",{className:"space-y-2 sm:space-y-3",children:[s.jsx("li",{children:s.jsxs("a",{href:"#home",className:"text-gray-300 hover:text-cyan-400 transition-all duration-300 flex items-center justify-center lg:justify-start gap-2 sm:gap-3 group text-sm sm:text-base",children:[s.jsx(cb,{className:"h-4 w-4 sm:h-5 sm:w-5 text-cyan-400 group-hover:scale-110 transition-transform"}),s.jsx("span",{className:"group-hover:translate-x-1 transition-transform",children:"Home"})]})}),s.jsx("li",{children:s.jsxs("a",{href:"#about",className:"text-gray-300 hover:text-cyan-400 transition-all duration-300 flex items-center justify-center lg:justify-start gap-2 sm:gap-3 group text-sm sm:text-base",children:[s.jsx(mk,{className:"h-4 w-4 sm:h-5 sm:w-5 text-cyan-400 group-hover:scale-110 transition-transform"}),s.jsx("span",{className:"group-hover:translate-x-1 transition-transform",children:"About Us"})]})}),s.jsx("li",{children:s.jsxs("a",{href:"#courses",className:"text-gray-300 hover:text-cyan-400 transition-all duration-300 flex items-center justify-center lg:justify-start gap-2 sm:gap-3 group text-sm sm:text-base",children:[s.jsx($r,{className:"h-4 w-4 sm:h-5 sm:w-5 text-cyan-400 group-hover:scale-110 transition-transform"}),s.jsx("span",{className:"group-hover:translate-x-1 transition-transform",children:"Courses"})]})}),s.jsx("li",{children:s.jsxs("a",{href:"#events",className:"text-gray-300 hover:text-cyan-400 transition-all duration-300 flex items-center justify-center lg:justify-start gap-2 sm:gap-3 group text-sm sm:text-base",children:[s.jsx(vd,{className:"h-4 w-4 sm:h-5 sm:w-5 text-cyan-400 group-hover:scale-110 transition-transform"}),s.jsx("span",{className:"group-hover:translate-x-1 transition-transform",children:"Achievements"})]})}),s.jsx("li",{children:s.jsxs("a",{href:"#contact",className:"text-gray-300 hover:text-cyan-400 transition-all duration-300 flex items-center justify-center lg:justify-start gap-2 sm:gap-3 group text-sm sm:text-base",children:[s.jsx(hu,{className:"h-4 w-4 sm:h-5 sm:w-5 text-cyan-400 group-hover:scale-110 transition-transform"}),s.jsx("span",{className:"group-hover:translate-x-1 transition-transform",children:"Contact"})]})})]})]}),s.jsxs("div",{className:"text-center lg:text-left",children:[s.jsxs("h3",{className:"text-lg sm:text-xl font-bold text-white mb-4 sm:mb-6 relative",children:["OUR PROGRAMS",s.jsx("div",{className:"absolute -bottom-2 left-0 right-0 lg:right-auto lg:w-12 h-1 bg-gradient-to-r from-cyan-400 to-blue-500 mx-auto lg:mx-0"})]}),s.jsxs("ul",{className:"space-y-2 sm:space-y-3",children:[s.jsx("li",{children:s.jsxs("a",{href:"#",className:"text-gray-300 hover:text-cyan-400 transition-all duration-300 flex items-center justify-center lg:justify-start gap-2 sm:gap-3 group text-sm sm:text-base",children:[s.jsx("div",{className:"w-1.5 h-1.5 sm:w-2 sm:h-2 bg-cyan-400 rounded-full group-hover:scale-150 transition-transform"}),s.jsx("span",{className:"group-hover:translate-x-1 transition-transform",children:"IELTS Training"})]})}),s.jsx("li",{children:s.jsxs("a",{href:"#",className:"text-gray-300 hover:text-cyan-400 transition-all duration-300 flex items-center justify-center lg:justify-start gap-2 sm:gap-3 group text-sm sm:text-base",children:[s.jsx("div",{className:"w-1.5 h-1.5 sm:w-2 sm:h-2 bg-cyan-400 rounded-full group-hover:scale-150 transition-transform"}),s.jsx("span",{className:"group-hover:translate-x-1 transition-transform",children:"TOEFL Preparation"})]})}),s.jsx("li",{children:s.jsxs("a",{href:"#",className:"text-gray-300 hover:text-cyan-400 transition-all duration-300 flex items-center justify-center lg:justify-start gap-2 sm:gap-3 group text-sm sm:text-base",children:[s.jsx("div",{className:"w-1.5 h-1.5 sm:w-2 sm:h-2 bg-cyan-400 rounded-full group-hover:scale-150 transition-transform"}),s.jsx("span",{className:"group-hover:translate-x-1 transition-transform",children:"Lest-Best Test Training"})]})}),s.jsx("li",{children:s.jsxs("a",{href:"#",className:"text-gray-300 hover:text-cyan-400 transition-all duration-300 flex items-center justify-center lg:justify-start gap-2 sm:gap-3 group text-sm sm:text-base",children:[s.jsx("div",{className:"w-1.5 h-1.5 sm:w-2 sm:h-2 bg-cyan-400 rounded-full group-hover:scale-150 transition-transform"}),s.jsx("span",{className:"group-hover:translate-x-1 transition-transform",children:"Oxford Test Training"})]})}),s.jsx("li",{children:s.jsxs("a",{href:"#",className:"text-gray-300 hover:text-cyan-400 transition-all duration-300 flex items-center justify-center lg:justify-start gap-2 sm:gap-3 group text-sm sm:text-base",children:[s.jsx("div",{className:"w-1.5 h-1.5 sm:w-2 sm:h-2 bg-cyan-400 rounded-full group-hover:scale-150 transition-transform"}),s.jsx("span",{className:"group-hover:translate-x-1 transition-transform",children:"STEP Test Preparation"})]})}),s.jsx("li",{children:s.jsxs("a",{href:"#",className:"text-gray-300 hover:text-cyan-400 transition-all duration-300 flex items-center justify-center lg:justify-start gap-2 sm:gap-3 group text-sm sm:text-base",children:[s.jsx("div",{className:"w-1.5 h-1.5 sm:w-2 sm:h-2 bg-cyan-400 rounded-full group-hover:scale-150 transition-transform"}),s.jsx("span",{className:"group-hover:translate-x-1 transition-transform",children:"General English"})]})}),s.jsx("li",{children:s.jsxs("a",{href:"#",className:"text-gray-300 hover:text-cyan-400 transition-all duration-300 flex items-center justify-center lg:justify-start gap-2 sm:gap-3 group text-sm sm:text-base",children:[s.jsx("div",{className:"w-1.5 h-1.5 sm:w-2 sm:h-2 bg-cyan-400 rounded-full group-hover:scale-150 transition-transform"}),s.jsx("span",{className:"group-hover:translate-x-1 transition-transform",children:"Business English"})]})}),s.jsx("li",{children:s.jsxs("a",{href:"#",className:"text-gray-300 hover:text-cyan-400 transition-all duration-300 flex items-center justify-center lg:justify-start gap-2 sm:gap-3 group text-sm sm:text-base",children:[s.jsx("div",{className:"w-1.5 h-1.5 sm:w-2 sm:h-2 bg-cyan-400 rounded-full group-hover:scale-150 transition-transform"}),s.jsx("span",{className:"group-hover:translate-x-1 transition-transform",children:"Academic English"})]})}),s.jsx("li",{children:s.jsxs("a",{href:"#",className:"text-gray-300 hover:text-cyan-400 transition-all duration-300 flex items-center justify-center lg:justify-start gap-2 sm:gap-3 group text-sm sm:text-base",children:[s.jsx("div",{className:"w-1.5 h-1.5 sm:w-2 sm:h-2 bg-cyan-400 rounded-full group-hover:scale-150 transition-transform"}),s.jsx("span",{className:"group-hover:translate-x-1 transition-transform",children:"Online Classes"})]})})]})]}),s.jsxs("div",{className:"text-center lg:text-left",children:[s.jsxs("h3",{className:"text-lg sm:text-xl font-bold text-white mb-4 sm:mb-6 relative",children:["STAY CONNECTED",s.jsx("div",{className:"absolute -bottom-2 left-0 right-0 lg:right-auto lg:w-12 h-1 bg-gradient-to-r from-cyan-400 to-blue-500 mx-auto lg:mx-0"})]}),s.jsx("p",{className:"text-gray-300 mb-4 sm:mb-6 text-xs sm:text-sm",children:"Follow Us"}),s.jsxs("div",{className:"flex justify-center lg:justify-start space-x-3 sm:space-x-4",children:[s.jsx("a",{href:"https://www.instagram.com/youta.official?igsh=aDN3bWpvYTVtODg=",target:"_blank",rel:"noopener noreferrer",className:"group",children:s.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 bg-slate-700 rounded-full flex items-center justify-center group-hover:bg-pink-500 transition-all duration-300 group-hover:scale-110 group-hover:shadow-lg",children:s.jsx(hk,{className:"h-4 w-4 sm:h-5 sm:w-5 text-gray-300 group-hover:text-white transition-colors"})})}),s.jsx("a",{href:"https://wa.me/6285291108001",target:"_blank",rel:"noopener noreferrer",className:"group",children:s.jsx("div",{className:"w-10 h-10 sm:w-12 sm:h-12 bg-slate-700 rounded-full flex items-center justify-center group-hover:bg-green-500 transition-all duration-300 group-hover:scale-110 group-hover:shadow-lg",children:s.jsx(vk,{className:"h-4 w-4 sm:h-5 sm:w-5 text-gray-300 group-hover:text-white transition-colors"})})})]})]})]})}),s.jsx("div",{className:"border-t border-slate-700 py-4 sm:py-6 text-center",children:s.jsxs("p",{className:"text-gray-400 text-xs sm:text-sm",children:["Copyright © 2025 ",s.jsx("span",{className:"text-cyan-400 font-semibold",children:"You Talk Academy"}),". All Rights Reserved."]})})]})});var io=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Oa=typeof window>"u"||"Deno"in globalThis;function Mr(){}function DP(e,t){return typeof e=="function"?e(t):e}function nh(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ob(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ci(e,t){return typeof e=="function"?e(t):e}function Jr(e,t){return typeof e=="function"?e(t):e}function vv(e,t){const{type:r="all",exact:n,fetchStatus:a,predicate:i,queryKey:o,stale:l}=e;if(o){if(n){if(t.queryHash!==Gp(o,t.options))return!1}else if(!gl(t.queryKey,o))return!1}if(r!=="all"){const c=t.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||a&&a!==t.state.fetchStatus||i&&!i(t))}function yv(e,t){const{exact:r,status:n,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(Da(t.options.mutationKey)!==Da(i))return!1}else if(!gl(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||a&&!a(t))}function Gp(e,t){return((t==null?void 0:t.queryKeyHashFn)||Da)(e)}function Da(e){return JSON.stringify(e,(t,r)=>sh(r)?Object.keys(r).sort().reduce((n,a)=>(n[a]=r[a],n),{}):r)}function gl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!gl(e[r],t[r])):!1}function Db(e,t){if(e===t)return e;const r=wv(e)&&wv(t);if(r||sh(e)&&sh(t)){const n=r?e:Object.keys(e),a=n.length,i=r?t:Object.keys(t),o=i.length,l=r?[]:{};let c=0;for(let u=0;u<o;u++){const h=r?u:i[u];(!r&&n.includes(h)||r)&&e[h]===void 0&&t[h]===void 0?(l[h]=void 0,c++):(l[h]=Db(e[h],t[h]),l[h]===e[h]&&e[h]!==void 0&&c++)}return a===o&&c===a?e:l}return t}function xu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function wv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function sh(e){if(!bv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!bv(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function bv(e){return Object.prototype.toString.call(e)==="[object Object]"}function FP(e){return new Promise(t=>{setTimeout(t,e)})}function ah(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Db(e,t):t}function LP(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function $P(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Qp=Symbol();function Fb(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Qp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var ya,Ns,ki,fy,UP=(fy=class extends io{constructor(){super();pe(this,ya);pe(this,Ns);pe(this,ki);re(this,ki,t=>{if(!Oa&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){_(this,Ns)||this.setEventListener(_(this,ki))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Ns))==null||t.call(this),re(this,Ns,void 0))}setEventListener(t){var r;re(this,ki,t),(r=_(this,Ns))==null||r.call(this),re(this,Ns,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){_(this,ya)!==t&&(re(this,ya,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof _(this,ya)=="boolean"?_(this,ya):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ya=new WeakMap,Ns=new WeakMap,ki=new WeakMap,fy),Yp=new UP,Ti,Cs,Pi,my,zP=(my=class extends io{constructor(){super();pe(this,Ti,!0);pe(this,Cs);pe(this,Pi);re(this,Pi,t=>{if(!Oa&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){_(this,Cs)||this.setEventListener(_(this,Pi))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Cs))==null||t.call(this),re(this,Cs,void 0))}setEventListener(t){var r;re(this,Pi,t),(r=_(this,Cs))==null||r.call(this),re(this,Cs,t(this.setOnline.bind(this)))}setOnline(t){_(this,Ti)!==t&&(re(this,Ti,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return _(this,Ti)}},Ti=new WeakMap,Cs=new WeakMap,Pi=new WeakMap,my),vu=new zP;function ih(){let e,t;const r=new Promise((a,i)=>{e=a,t=i});r.status="pending",r.catch(()=>{});function n(a){Object.assign(r,a),delete r.resolve,delete r.reject}return r.resolve=a=>{n({status:"fulfilled",value:a}),e(a)},r.reject=a=>{n({status:"rejected",reason:a}),t(a)},r}function VP(e){return Math.min(1e3*2**e,3e4)}function Lb(e){return(e??"online")==="online"?vu.isOnline():!0}var $b=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Df(e){return e instanceof $b}function Ub(e){let t=!1,r=0,n=!1,a;const i=ih(),o=p=>{var b;n||(m(new $b(p)),(b=e.abort)==null||b.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>Yp.isFocused()&&(e.networkMode==="always"||vu.isOnline())&&e.canRun(),h=()=>Lb(e.networkMode)&&e.canRun(),f=p=>{var b;n||(n=!0,(b=e.onSuccess)==null||b.call(e,p),a==null||a(),i.resolve(p))},m=p=>{var b;n||(n=!0,(b=e.onError)==null||b.call(e,p),a==null||a(),i.reject(p))},y=()=>new Promise(p=>{var b;a=g=>{(n||u())&&p(g)},(b=e.onPause)==null||b.call(e)}).then(()=>{var p;a=void 0,n||(p=e.onContinue)==null||p.call(e)}),v=()=>{if(n)return;let p;const b=r===0?e.initialPromise:void 0;try{p=b??e.fn()}catch(g){p=Promise.reject(g)}Promise.resolve(p).then(f).catch(g=>{var k;if(n)return;const x=e.retry??(Oa?0:3),w=e.retryDelay??VP,N=typeof w=="function"?w(r,g):w,C=x===!0||typeof x=="number"&&r<x||typeof x=="function"&&x(r,g);if(t||!C){m(g);return}r++,(k=e.onFail)==null||k.call(e,r,g),FP(N).then(()=>u()?void 0:y()).then(()=>{t?m(g):v()})})};return{promise:i,cancel:o,continue:()=>(a==null||a(),i),cancelRetry:l,continueRetry:c,canStart:h,start:()=>(h()?v():y().then(v),i)}}function BP(){let e=[],t=0,r=l=>{l()},n=l=>{l()},a=l=>setTimeout(l,0);const i=l=>{t?e.push(l):a(()=>{r(l)})},o=()=>{const l=e;e=[],l.length&&a(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{a=l}}}var Ct=BP(),wa,hy,zb=(hy=class{constructor(){pe(this,wa)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),nh(this.gcTime)&&re(this,wa,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Oa?1/0:5*60*1e3))}clearGcTimeout(){_(this,wa)&&(clearTimeout(_(this,wa)),re(this,wa,void 0))}},wa=new WeakMap,hy),Ri,Ai,Ir,Lt,El,ba,Yr,Fn,py,HP=(py=class extends zb{constructor(t){super();pe(this,Yr);pe(this,Ri);pe(this,Ai);pe(this,Ir);pe(this,Lt);pe(this,El);pe(this,ba);re(this,ba,!1),re(this,El,t.defaultOptions),this.setOptions(t.options),this.observers=[],re(this,Ir,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,re(this,Ri,WP(this.options)),this.state=t.state??_(this,Ri),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=_(this,Lt))==null?void 0:t.promise}setOptions(t){this.options={..._(this,El),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,Ir).remove(this)}setData(t,r){const n=ah(this.state.data,t,this.options);return Te(this,Yr,Fn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Te(this,Yr,Fn).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,a;const r=(n=_(this,Lt))==null?void 0:n.promise;return(a=_(this,Lt))==null||a.cancel(t),r?r.then(Mr).catch(Mr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,Ri))}isActive(){return this.observers.some(t=>Jr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Qp||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!Ob(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=_(this,Lt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=_(this,Lt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,Ir).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(_(this,Lt)&&(_(this,ba)?_(this,Lt).cancel({revert:!0}):_(this,Lt).cancelRetry()),this.scheduleGc()),_(this,Ir).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Te(this,Yr,Fn).call(this,{type:"invalidate"})}fetch(t,r){var c,u,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(_(this,Lt))return _(this,Lt).continueRetry(),_(this,Lt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(m=>m.options.queryFn);f&&this.setOptions(f.options)}const n=new AbortController,a=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(re(this,ba,!0),n.signal)})},i=()=>{const f=Fb(this.options,r),m={queryKey:this.queryKey,meta:this.meta};return a(m),re(this,ba,!1),this.options.persister?this.options.persister(f,m,this):f(m)},o={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};a(o),(c=this.options.behavior)==null||c.onFetch(o,this),re(this,Ai,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=o.fetchOptions)==null?void 0:u.meta))&&Te(this,Yr,Fn).call(this,{type:"fetch",meta:(h=o.fetchOptions)==null?void 0:h.meta});const l=f=>{var m,y,v,p;Df(f)&&f.silent||Te(this,Yr,Fn).call(this,{type:"error",error:f}),Df(f)||((y=(m=_(this,Ir).config).onError)==null||y.call(m,f,this),(p=(v=_(this,Ir).config).onSettled)==null||p.call(v,this.state.data,f,this)),this.scheduleGc()};return re(this,Lt,Ub({initialPromise:r==null?void 0:r.initialPromise,fn:o.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{var m,y,v,p;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(b){l(b);return}(y=(m=_(this,Ir).config).onSuccess)==null||y.call(m,f,this),(p=(v=_(this,Ir).config).onSettled)==null||p.call(v,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,m)=>{Te(this,Yr,Fn).call(this,{type:"failed",failureCount:f,error:m})},onPause:()=>{Te(this,Yr,Fn).call(this,{type:"pause"})},onContinue:()=>{Te(this,Yr,Fn).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),_(this,Lt).start()}},Ri=new WeakMap,Ai=new WeakMap,Ir=new WeakMap,Lt=new WeakMap,El=new WeakMap,ba=new WeakMap,Yr=new WeakSet,Fn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Vb(n.data,this.options),fetchMeta:t.meta??null};case"success":return{...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const a=t.error;return Df(a)&&a.revert&&_(this,Ai)?{..._(this,Ai),fetchStatus:"idle"}:{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Ct.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),_(this,Ir).notify({query:this,type:"updated",action:t})})},py);function Vb(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Lb(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function WP(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var yn,gy,qP=(gy=class extends io{constructor(t={}){super();pe(this,yn);this.config=t,re(this,yn,new Map)}build(t,r,n){const a=r.queryKey,i=r.queryHash??Gp(a,r);let o=this.get(i);return o||(o=new HP({cache:this,queryKey:a,queryHash:i,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(a)}),this.add(o)),o}add(t){_(this,yn).has(t.queryHash)||(_(this,yn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=_(this,yn).get(t.queryHash);r&&(t.destroy(),r===t&&_(this,yn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ct.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,yn).get(t)}getAll(){return[..._(this,yn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>vv(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>vv(t,n)):r}notify(t){Ct.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Ct.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ct.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},yn=new WeakMap,gy),wn,qt,ja,bn,ps,xy,KP=(xy=class extends zb{constructor(t){super();pe(this,bn);pe(this,wn);pe(this,qt);pe(this,ja);this.mutationId=t.mutationId,re(this,qt,t.mutationCache),re(this,wn,[]),this.state=t.state||Bb(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,wn).includes(t)||(_(this,wn).push(t),this.clearGcTimeout(),_(this,qt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){re(this,wn,_(this,wn).filter(r=>r!==t)),this.scheduleGc(),_(this,qt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,wn).length||(this.state.status==="pending"?this.scheduleGc():_(this,qt).remove(this))}continue(){var t;return((t=_(this,ja))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var a,i,o,l,c,u,h,f,m,y,v,p,b,g,x,w,N,C,k,T;re(this,ja,Ub({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(P,I)=>{Te(this,bn,ps).call(this,{type:"failed",failureCount:P,error:I})},onPause:()=>{Te(this,bn,ps).call(this,{type:"pause"})},onContinue:()=>{Te(this,bn,ps).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,qt).canRun(this)}));const r=this.state.status==="pending",n=!_(this,ja).canStart();try{if(!r){Te(this,bn,ps).call(this,{type:"pending",variables:t,isPaused:n}),await((i=(a=_(this,qt).config).onMutate)==null?void 0:i.call(a,t,this));const I=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,t));I!==this.state.context&&Te(this,bn,ps).call(this,{type:"pending",context:I,variables:t,isPaused:n})}const P=await _(this,ja).start();return await((u=(c=_(this,qt).config).onSuccess)==null?void 0:u.call(c,P,t,this.state.context,this)),await((f=(h=this.options).onSuccess)==null?void 0:f.call(h,P,t,this.state.context)),await((y=(m=_(this,qt).config).onSettled)==null?void 0:y.call(m,P,null,this.state.variables,this.state.context,this)),await((p=(v=this.options).onSettled)==null?void 0:p.call(v,P,null,t,this.state.context)),Te(this,bn,ps).call(this,{type:"success",data:P}),P}catch(P){try{throw await((g=(b=_(this,qt).config).onError)==null?void 0:g.call(b,P,t,this.state.context,this)),await((w=(x=this.options).onError)==null?void 0:w.call(x,P,t,this.state.context)),await((C=(N=_(this,qt).config).onSettled)==null?void 0:C.call(N,void 0,P,this.state.variables,this.state.context,this)),await((T=(k=this.options).onSettled)==null?void 0:T.call(k,void 0,P,t,this.state.context)),P}finally{Te(this,bn,ps).call(this,{type:"error",error:P})}}finally{_(this,qt).runNext(this)}}},wn=new WeakMap,qt=new WeakMap,ja=new WeakMap,bn=new WeakSet,ps=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Ct.batch(()=>{_(this,wn).forEach(n=>{n.onMutationUpdate(t)}),_(this,qt).notify({mutation:this,type:"updated",action:t})})},xy);function Bb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var yr,kl,vy,GP=(vy=class extends io{constructor(t={}){super();pe(this,yr);pe(this,kl);this.config=t,re(this,yr,new Map),re(this,kl,Date.now())}build(t,r,n){const a=new KP({mutationCache:this,mutationId:++Ql(this,kl)._,options:t.defaultMutationOptions(r),state:n});return this.add(a),a}add(t){const r=gc(t),n=_(this,yr).get(r)??[];n.push(t),_(this,yr).set(r,n),this.notify({type:"added",mutation:t})}remove(t){var n;const r=gc(t);if(_(this,yr).has(r)){const a=(n=_(this,yr).get(r))==null?void 0:n.filter(i=>i!==t);a&&(a.length===0?_(this,yr).delete(r):_(this,yr).set(r,a))}this.notify({type:"removed",mutation:t})}canRun(t){var n;const r=(n=_(this,yr).get(gc(t)))==null?void 0:n.find(a=>a.state.status==="pending");return!r||r===t}runNext(t){var n;const r=(n=_(this,yr).get(gc(t)))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}clear(){Ct.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[..._(this,yr).values()].flat()}find(t){const r={exact:!0,...t};return this.getAll().find(n=>yv(r,n))}findAll(t={}){return this.getAll().filter(r=>yv(t,r))}notify(t){Ct.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Ct.batch(()=>Promise.all(t.map(r=>r.continue().catch(Mr))))}},yr=new WeakMap,kl=new WeakMap,vy);function gc(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function jv(e){return{onFetch:(t,r)=>{var h,f,m,y,v;const n=t.options,a=(m=(f=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:f.fetchMore)==null?void 0:m.direction,i=((y=t.state.data)==null?void 0:y.pages)||[],o=((v=t.state.data)==null?void 0:v.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let p=!1;const b=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},g=Fb(t.options,t.fetchOptions),x=async(w,N,C)=>{if(p)return Promise.reject();if(N==null&&w.pages.length)return Promise.resolve(w);const k={queryKey:t.queryKey,pageParam:N,direction:C?"backward":"forward",meta:t.options.meta};b(k);const T=await g(k),{maxPages:P}=t.options,I=C?$P:LP;return{pages:I(w.pages,T,P),pageParams:I(w.pageParams,N,P)}};if(a&&i.length){const w=a==="backward",N=w?QP:Nv,C={pages:i,pageParams:o},k=N(n,C);l=await x(C,k,w)}else{const w=e??i.length;do{const N=c===0?o[0]??n.initialPageParam:Nv(n,l);if(c>0&&N==null)break;l=await x(l,N),c++}while(c<w)}return l};t.options.persister?t.fetchFn=()=>{var p,b;return(b=(p=t.options).persister)==null?void 0:b.call(p,u,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function Nv(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function QP(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var ut,Ss,_s,Ii,Mi,Es,Oi,Di,yy,YP=(yy=class{constructor(e={}){pe(this,ut);pe(this,Ss);pe(this,_s);pe(this,Ii);pe(this,Mi);pe(this,Es);pe(this,Oi);pe(this,Di);re(this,ut,e.queryCache||new qP),re(this,Ss,e.mutationCache||new GP),re(this,_s,e.defaultOptions||{}),re(this,Ii,new Map),re(this,Mi,new Map),re(this,Es,0)}mount(){Ql(this,Es)._++,_(this,Es)===1&&(re(this,Oi,Yp.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,ut).onFocus())})),re(this,Di,vu.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,ut).onOnline())})))}unmount(){var e,t;Ql(this,Es)._--,_(this,Es)===0&&((e=_(this,Oi))==null||e.call(this),re(this,Oi,void 0),(t=_(this,Di))==null||t.call(this),re(this,Di,void 0))}isFetching(e){return _(this,ut).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,Ss).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=_(this,ut).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const r=this.defaultQueryOptions(e),n=_(this,ut).build(this,r);return e.revalidateIfStale&&n.isStaleByTime(Ci(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(t)}}getQueriesData(e){return _(this,ut).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),a=_(this,ut).get(n.queryHash),i=a==null?void 0:a.state.data,o=DP(t,i);if(o!==void 0)return _(this,ut).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return Ct.batch(()=>_(this,ut).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=_(this,ut).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=_(this,ut);Ct.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=_(this,ut),n={type:"active",...e};return Ct.batch(()=>(r.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries(n,t)))}cancelQueries(e={},t={}){const r={revert:!0,...t},n=Ct.batch(()=>_(this,ut).findAll(e).map(a=>a.cancel(r)));return Promise.all(n).then(Mr).catch(Mr)}invalidateQueries(e={},t={}){return Ct.batch(()=>{if(_(this,ut).findAll(e).forEach(n=>{n.invalidate()}),e.refetchType==="none")return Promise.resolve();const r={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(r,t)})}refetchQueries(e={},t){const r={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},n=Ct.batch(()=>_(this,ut).findAll(e).filter(a=>!a.isDisabled()).map(a=>{let i=a.fetch(void 0,r);return r.throwOnError||(i=i.catch(Mr)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(Mr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=_(this,ut).build(this,t);return r.isStaleByTime(Ci(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Mr).catch(Mr)}fetchInfiniteQuery(e){return e.behavior=jv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Mr).catch(Mr)}ensureInfiniteQueryData(e){return e.behavior=jv(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return vu.isOnline()?_(this,Ss).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,ut)}getMutationCache(){return _(this,Ss)}getDefaultOptions(){return _(this,_s)}setDefaultOptions(e){re(this,_s,e)}setQueryDefaults(e,t){_(this,Ii).set(Da(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,Ii).values()];let r={};return t.forEach(n=>{gl(e,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(e,t){_(this,Mi).set(Da(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,Mi).values()];let r={};return t.forEach(n=>{gl(e,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,_s).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Gp(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===Qp&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,_s).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,ut).clear(),_(this,Ss).clear()}},ut=new WeakMap,Ss=new WeakMap,_s=new WeakMap,Ii=new WeakMap,Mi=new WeakMap,Es=new WeakMap,Oi=new WeakMap,Di=new WeakMap,yy),lr,$e,Tl,Kt,Na,Fi,ks,jn,Pl,Li,$i,Ca,Sa,Ts,Ui,Ke,Ao,oh,lh,ch,uh,dh,fh,mh,Hb,wy,ZP=(wy=class extends io{constructor(t,r){super();pe(this,Ke);pe(this,lr);pe(this,$e);pe(this,Tl);pe(this,Kt);pe(this,Na);pe(this,Fi);pe(this,ks);pe(this,jn);pe(this,Pl);pe(this,Li);pe(this,$i);pe(this,Ca);pe(this,Sa);pe(this,Ts);pe(this,Ui,new Set);this.options=r,re(this,lr,t),re(this,jn,null),re(this,ks,ih()),this.options.experimental_prefetchInRender||_(this,ks).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,$e).addObserver(this),Cv(_(this,$e),this.options)?Te(this,Ke,Ao).call(this):this.updateResult(),Te(this,Ke,uh).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return hh(_(this,$e),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return hh(_(this,$e),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Te(this,Ke,dh).call(this),Te(this,Ke,fh).call(this),_(this,$e).removeObserver(this)}setOptions(t,r){const n=this.options,a=_(this,$e);if(this.options=_(this,lr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Jr(this.options.enabled,_(this,$e))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Te(this,Ke,mh).call(this),_(this,$e).setOptions(this.options),n._defaulted&&!xu(this.options,n)&&_(this,lr).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,$e),observer:this});const i=this.hasListeners();i&&Sv(_(this,$e),a,this.options,n)&&Te(this,Ke,Ao).call(this),this.updateResult(r),i&&(_(this,$e)!==a||Jr(this.options.enabled,_(this,$e))!==Jr(n.enabled,_(this,$e))||Ci(this.options.staleTime,_(this,$e))!==Ci(n.staleTime,_(this,$e)))&&Te(this,Ke,oh).call(this);const o=Te(this,Ke,lh).call(this);i&&(_(this,$e)!==a||Jr(this.options.enabled,_(this,$e))!==Jr(n.enabled,_(this,$e))||o!==_(this,Ts))&&Te(this,Ke,ch).call(this,o)}getOptimisticResult(t){const r=_(this,lr).getQueryCache().build(_(this,lr),t),n=this.createResult(r,t);return JP(this,n)&&(re(this,Kt,n),re(this,Fi,this.options),re(this,Na,_(this,$e).state)),n}getCurrentResult(){return _(this,Kt)}trackResult(t,r){const n={};return Object.keys(t).forEach(a=>{Object.defineProperty(n,a,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(a),r==null||r(a),t[a])})}),n}trackProp(t){_(this,Ui).add(t)}getCurrentQuery(){return _(this,$e)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=_(this,lr).defaultQueryOptions(t),n=_(this,lr).getQueryCache().build(_(this,lr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Te(this,Ke,Ao).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,Kt)))}createResult(t,r){var P;const n=_(this,$e),a=this.options,i=_(this,Kt),o=_(this,Na),l=_(this,Fi),u=t!==n?t.state:_(this,Tl),{state:h}=t;let f={...h},m=!1,y;if(r._optimisticResults){const I=this.hasListeners(),D=!I&&Cv(t,r),E=I&&Sv(t,n,r,a);(D||E)&&(f={...f,...Vb(h.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:p,status:b}=f;if(r.select&&f.data!==void 0)if(i&&f.data===(o==null?void 0:o.data)&&r.select===_(this,Pl))y=_(this,Li);else try{re(this,Pl,r.select),y=r.select(f.data),y=ah(i==null?void 0:i.data,y,r),re(this,Li,y),re(this,jn,null)}catch(I){re(this,jn,I)}else y=f.data;if(r.placeholderData!==void 0&&y===void 0&&b==="pending"){let I;if(i!=null&&i.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData))I=i.data;else if(I=typeof r.placeholderData=="function"?r.placeholderData((P=_(this,$i))==null?void 0:P.state.data,_(this,$i)):r.placeholderData,r.select&&I!==void 0)try{I=r.select(I),re(this,jn,null)}catch(D){re(this,jn,D)}I!==void 0&&(b="success",y=ah(i==null?void 0:i.data,I,r),m=!0)}_(this,jn)&&(v=_(this,jn),y=_(this,Li),p=Date.now(),b="error");const g=f.fetchStatus==="fetching",x=b==="pending",w=b==="error",N=x&&g,C=y!==void 0,T={status:b,fetchStatus:f.fetchStatus,isPending:x,isSuccess:b==="success",isError:w,isInitialLoading:N,isLoading:N,data:y,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:p,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!x,isLoadingError:w&&!C,isPaused:f.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:w&&C,isStale:Zp(t,r),refetch:this.refetch,promise:_(this,ks)};if(this.options.experimental_prefetchInRender){const I=M=>{T.status==="error"?M.reject(T.error):T.data!==void 0&&M.resolve(T.data)},D=()=>{const M=re(this,ks,T.promise=ih());I(M)},E=_(this,ks);switch(E.status){case"pending":t.queryHash===n.queryHash&&I(E);break;case"fulfilled":(T.status==="error"||T.data!==E.value)&&D();break;case"rejected":(T.status!=="error"||T.error!==E.reason)&&D();break}}return T}updateResult(t){const r=_(this,Kt),n=this.createResult(_(this,$e),this.options);if(re(this,Na,_(this,$e).state),re(this,Fi,this.options),_(this,Na).data!==void 0&&re(this,$i,_(this,$e)),xu(n,r))return;re(this,Kt,n);const a={},i=()=>{if(!r)return!0;const{notifyOnChangeProps:o}=this.options,l=typeof o=="function"?o():o;if(l==="all"||!l&&!_(this,Ui).size)return!0;const c=new Set(l??_(this,Ui));return this.options.throwOnError&&c.add("error"),Object.keys(_(this,Kt)).some(u=>{const h=u;return _(this,Kt)[h]!==r[h]&&c.has(h)})};(t==null?void 0:t.listeners)!==!1&&i()&&(a.listeners=!0),Te(this,Ke,Hb).call(this,{...a,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Te(this,Ke,uh).call(this)}},lr=new WeakMap,$e=new WeakMap,Tl=new WeakMap,Kt=new WeakMap,Na=new WeakMap,Fi=new WeakMap,ks=new WeakMap,jn=new WeakMap,Pl=new WeakMap,Li=new WeakMap,$i=new WeakMap,Ca=new WeakMap,Sa=new WeakMap,Ts=new WeakMap,Ui=new WeakMap,Ke=new WeakSet,Ao=function(t){Te(this,Ke,mh).call(this);let r=_(this,$e).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Mr)),r},oh=function(){Te(this,Ke,dh).call(this);const t=Ci(this.options.staleTime,_(this,$e));if(Oa||_(this,Kt).isStale||!nh(t))return;const n=Ob(_(this,Kt).dataUpdatedAt,t)+1;re(this,Ca,setTimeout(()=>{_(this,Kt).isStale||this.updateResult()},n))},lh=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,$e)):this.options.refetchInterval)??!1},ch=function(t){Te(this,Ke,fh).call(this),re(this,Ts,t),!(Oa||Jr(this.options.enabled,_(this,$e))===!1||!nh(_(this,Ts))||_(this,Ts)===0)&&re(this,Sa,setInterval(()=>{(this.options.refetchIntervalInBackground||Yp.isFocused())&&Te(this,Ke,Ao).call(this)},_(this,Ts)))},uh=function(){Te(this,Ke,oh).call(this),Te(this,Ke,ch).call(this,Te(this,Ke,lh).call(this))},dh=function(){_(this,Ca)&&(clearTimeout(_(this,Ca)),re(this,Ca,void 0))},fh=function(){_(this,Sa)&&(clearInterval(_(this,Sa)),re(this,Sa,void 0))},mh=function(){const t=_(this,lr).getQueryCache().build(_(this,lr),this.options);if(t===_(this,$e))return;const r=_(this,$e);re(this,$e,t),re(this,Tl,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Hb=function(t){Ct.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(_(this,Kt))}),_(this,lr).getQueryCache().notify({query:_(this,$e),type:"observerResultsUpdated"})})},wy);function XP(e,t){return Jr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Cv(e,t){return XP(e,t)||e.state.data!==void 0&&hh(e,t,t.refetchOnMount)}function hh(e,t,r){if(Jr(t.enabled,e)!==!1){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Zp(e,t)}return!1}function Sv(e,t,r,n){return(e!==t||Jr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Zp(e,r)}function Zp(e,t){return Jr(t.enabled,e)!==!1&&e.isStaleByTime(Ci(t.staleTime,e))}function JP(e,t){return!xu(e.getCurrentResult(),t)}var Ps,Rs,cr,zn,Jn,Lc,ph,by,eR=(by=class extends io{constructor(r,n){super();pe(this,Jn);pe(this,Ps);pe(this,Rs);pe(this,cr);pe(this,zn);re(this,Ps,r),this.setOptions(n),this.bindMethods(),Te(this,Jn,Lc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var a;const n=this.options;this.options=_(this,Ps).defaultMutationOptions(r),xu(this.options,n)||_(this,Ps).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,cr),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Da(n.mutationKey)!==Da(this.options.mutationKey)?this.reset():((a=_(this,cr))==null?void 0:a.state.status)==="pending"&&_(this,cr).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=_(this,cr))==null||r.removeObserver(this)}onMutationUpdate(r){Te(this,Jn,Lc).call(this),Te(this,Jn,ph).call(this,r)}getCurrentResult(){return _(this,Rs)}reset(){var r;(r=_(this,cr))==null||r.removeObserver(this),re(this,cr,void 0),Te(this,Jn,Lc).call(this),Te(this,Jn,ph).call(this)}mutate(r,n){var a;return re(this,zn,n),(a=_(this,cr))==null||a.removeObserver(this),re(this,cr,_(this,Ps).getMutationCache().build(_(this,Ps),this.options)),_(this,cr).addObserver(this),_(this,cr).execute(r)}},Ps=new WeakMap,Rs=new WeakMap,cr=new WeakMap,zn=new WeakMap,Jn=new WeakSet,Lc=function(){var n;const r=((n=_(this,cr))==null?void 0:n.state)??Bb();re(this,Rs,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},ph=function(r){Ct.batch(()=>{var n,a,i,o,l,c,u,h;if(_(this,zn)&&this.hasListeners()){const f=_(this,Rs).variables,m=_(this,Rs).context;(r==null?void 0:r.type)==="success"?((a=(n=_(this,zn)).onSuccess)==null||a.call(n,r.data,f,m),(o=(i=_(this,zn)).onSettled)==null||o.call(i,r.data,null,f,m)):(r==null?void 0:r.type)==="error"&&((c=(l=_(this,zn)).onError)==null||c.call(l,r.error,f,m),(h=(u=_(this,zn)).onSettled)==null||h.call(u,void 0,r.error,f,m))}this.listeners.forEach(f=>{f(_(this,Rs))})})},by),Wb=d.createContext(void 0),bd=e=>{const t=d.useContext(Wb);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},tR=({client:e,children:t})=>(d.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(Wb.Provider,{value:e,children:t})),qb=d.createContext(!1),rR=()=>d.useContext(qb);qb.Provider;function nR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var sR=d.createContext(nR()),aR=()=>d.useContext(sR);function Kb(e,t){return typeof e=="function"?e(...t):!!e}function Gb(){}var iR=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},oR=e=>{d.useEffect(()=>{e.clearReset()},[e])},lR=({result:e,errorResetBoundary:t,throwOnError:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&Kb(r,[e.error,n]),cR=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},uR=(e,t)=>e.isLoading&&e.isFetching&&!t,dR=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,_v=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function fR(e,t,r){var h,f,m,y,v;const n=bd(),a=rR(),i=aR(),o=n.defaultQueryOptions(e);(f=(h=n.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||f.call(h,o),o._optimisticResults=a?"isRestoring":"optimistic",cR(o),iR(o,i),oR(i);const l=!n.getQueryCache().get(o.queryHash),[c]=d.useState(()=>new t(n,o)),u=c.getOptimisticResult(o);if(d.useSyncExternalStore(d.useCallback(p=>{const b=a?()=>{}:c.subscribe(Ct.batchCalls(p));return c.updateResult(),b},[c,a]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),d.useEffect(()=>{c.setOptions(o,{listeners:!1})},[o,c]),dR(o,u))throw _v(o,c,i);if(lR({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:n.getQueryCache().get(o.queryHash)}))throw u.error;if((y=(m=n.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||y.call(m,o,u),o.experimental_prefetchInRender&&!Oa&&uR(u,a)){const p=l?_v(o,c,i):(v=n.getQueryCache().get(o.queryHash))==null?void 0:v.promise;p==null||p.catch(Gb).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function Yt(e,t){return fR(e,ZP)}function gt(e,t){const r=bd(),[n]=d.useState(()=>new eR(r,e));d.useEffect(()=>{n.setOptions(e)},[n,e]);const a=d.useSyncExternalStore(d.useCallback(o=>n.subscribe(Ct.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=d.useCallback((o,l)=>{n.mutate(o,l).catch(Gb)},[n]);if(a.error&&Kb(n.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}const mR=()=>{const{data:e}=Yt({queryKey:["heroImages"],queryFn:async()=>{try{return await ue.getHeroImages()}catch(n){return console.error("Failed to load hero images",n),[]}},staleTime:36e5}),[t,r]=d.useState(0);return d.useEffect(()=>{if(!e||e.length===0)return;const n=e.findIndex(i=>i.is_active);if(r(n>=0?n:0),e.length<=1)return;const a=setInterval(()=>{r(i=>(i+1)%e.length)},3e3);return()=>clearInterval(a)},[e]),s.jsxs("section",{id:"home",className:"relative overflow-hidden bg-gradient-to-br from-cyan-50 via-white to-blue-50 px-3 sm:px-0 py-12 sm:py-16 lg:py-20",children:[s.jsx("div",{className:"absolute inset-0 opacity-5",children:s.jsx("div",{className:"absolute inset-0",style:{backgroundImage:`url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2300BCD4' fill-opacity='0.3'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")`}})}),s.jsx("div",{className:"absolute top-20 left-10 w-64 h-64 bg-cyan-300 rounded-full mix-blend-multiply filter blur-3xl opacity-20 animate-blob"}),s.jsx("div",{className:"absolute top-40 right-10 w-64 h-64 bg-blue-300 rounded-full mix-blend-multiply filter blur-3xl opacity-20 animate-blob animation-delay-2000"}),s.jsx("div",{className:"absolute -bottom-8 left-1/2 w-64 h-64 bg-purple-300 rounded-full mix-blend-multiply filter blur-3xl opacity-20 animate-blob animation-delay-4000"}),s.jsx("div",{className:"container mx-auto px-3 sm:px-4 lg:px-6 relative z-10 w-full",children:s.jsxs("div",{className:"grid lg:grid-cols-2 gap-6 sm:gap-8 lg:gap-16 items-center",children:[s.jsxs("div",{className:"space-y-4 sm:space-y-6 lg:space-y-8 text-center lg:text-left order-2 lg:order-1",children:[s.jsxs("div",{className:"space-y-2 sm:space-y-3 lg:space-y-4",children:[s.jsx("div",{className:"inline-block px-4 py-2 bg-gradient-to-r from-cyan-100 to-blue-100 rounded-full mb-4",children:s.jsx("span",{className:"text-sm font-semibold text-cyan-700",children:"🎓 Welcome to You Talk Academy"})}),s.jsx("h1",{className:"text-2xl sm:text-3xl md:text-4xl lg:text-6xl xl:text-7xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-cyan-600 via-blue-600 to-purple-600 leading-tight px-1 sm:px-2 animate-gradient",children:"Master English with Confidence"}),s.jsx("p",{className:"text-base sm:text-lg md:text-xl lg:text-2xl text-gray-600 max-w-2xl mx-auto lg:mx-0 px-1 sm:px-2 leading-relaxed",children:"Transform your future with world-class English training. Join thousands of successful learners at You Talk Academy."})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 sm:gap-3 lg:gap-4 justify-center lg:justify-start px-1 sm:px-2",children:[s.jsx(V,{size:"lg",className:"bg-gradient-to-r from-cyan-500 via-blue-500 to-blue-600 hover:from-cyan-600 hover:via-blue-600 hover:to-blue-700 text-white px-4 sm:px-6 lg:px-8 py-3 sm:py-4 lg:py-6 text-sm sm:text-base lg:text-lg w-full sm:w-auto shadow-xl hover:shadow-2xl transform hover:scale-105 transition-all duration-300",onClick:()=>{var n;(n=document.getElementById("courses"))==null||n.scrollIntoView({behavior:"smooth"})},children:"Start Learning Now"}),s.jsx(V,{size:"lg",variant:"outline",className:"border-2 border-cyan-500 text-cyan-600 hover:bg-cyan-50 px-4 sm:px-6 lg:px-8 py-3 sm:py-4 lg:py-6 text-sm sm:text-base lg:text-lg w-full sm:w-auto hover:shadow-lg transform hover:scale-105 transition-all duration-300",onClick:()=>{var n;(n=document.getElementById("about"))==null||n.scrollIntoView({behavior:"smooth"})},children:"📖 Learn More"})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2 sm:gap-3 lg:gap-4 pt-4 sm:pt-6 lg:pt-8 px-1 sm:px-2",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row items-center sm:space-x-2 lg:space-x-3 space-y-1 sm:space-y-0 justify-center lg:justify-start bg-white/70 backdrop-blur-sm p-3 sm:p-3 lg:p-4 rounded-xl shadow-lg border border-white/50 hover:shadow-xl transition-all duration-300 hover:scale-105",children:[s.jsx("div",{className:"w-10 h-10 sm:w-10 sm:h-10 lg:w-12 lg:h-12 bg-gradient-to-r from-cyan-400 to-blue-500 rounded-full flex items-center justify-center shadow-lg",children:s.jsx($r,{className:"h-5 w-5 sm:h-5 sm:w-5 lg:h-6 lg:w-6 text-white"})}),s.jsxs("div",{className:"text-center sm:text-left",children:[s.jsx("div",{className:"font-bold text-gray-900 text-sm sm:text-sm lg:text-base",children:"Grammar"}),s.jsx("div",{className:"text-sm sm:text-xs lg:text-sm text-gray-600",children:"Perfect Foundation"})]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-center sm:space-x-3 space-y-2 sm:space-y-0 justify-center lg:justify-start bg-white/70 backdrop-blur-sm p-4 sm:p-3 rounded-xl shadow-lg border border-white/50 hover:shadow-xl transition-all duration-300 hover:scale-105",children:[s.jsx("div",{className:"w-12 h-12 sm:w-10 sm:h-10 lg:w-12 lg:h-12 bg-gradient-to-r from-cyan-400 to-blue-500 rounded-full flex items-center justify-center shadow-lg",children:s.jsx(Ma,{className:"h-6 w-6 sm:h-5 sm:w-5 lg:h-6 lg:w-6 text-white"})}),s.jsxs("div",{className:"text-center sm:text-left",children:[s.jsx("div",{className:"font-bold text-gray-900 text-base sm:text-sm lg:text-base",children:"Speaking"}),s.jsx("div",{className:"text-sm sm:text-xs lg:text-sm text-gray-600",children:"Confidence Building"})]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-center sm:space-x-3 space-y-2 sm:space-y-0 justify-center lg:justify-start bg-white/70 backdrop-blur-sm p-4 sm:p-3 rounded-xl shadow-lg border border-white/50 hover:shadow-xl transition-all duration-300 hover:scale-105",children:[s.jsx("div",{className:"w-12 h-12 sm:w-10 sm:h-10 lg:w-12 lg:h-12 bg-gradient-to-r from-cyan-400 to-blue-500 rounded-full flex items-center justify-center shadow-lg",children:s.jsx(Sn,{className:"h-6 w-6 sm:h-5 sm:w-5 lg:h-6 lg:w-6 text-white"})}),s.jsxs("div",{className:"text-center sm:text-left",children:[s.jsx("div",{className:"font-bold text-gray-900 text-base sm:text-sm lg:text-base",children:"Preparation"}),s.jsx("div",{className:"text-sm sm:text-xs lg:text-sm text-gray-600",children:"IELTS & TOEFL"})]})]})]})]}),s.jsxs("div",{className:"relative order-1 lg:order-2 mb-4 lg:mb-0",children:[s.jsxs("div",{className:"relative z-10 group",children:[s.jsxs("div",{className:"relative overflow-hidden rounded-2xl shadow-2xl transform group-hover:scale-[1.02] transition-all duration-500",children:[s.jsx("div",{className:"absolute inset-0 bg-gradient-to-tr from-cyan-500/20 via-transparent to-blue-500/20 z-10 group-hover:opacity-0 transition-opacity duration-500"}),s.jsx("div",{className:"relative w-full",style:{aspectRatio:"4/3"},children:(()=>{var i;const n=(e||[]).find(o=>o.is_active)||e&&e[0];let a=(n==null?void 0:n.url)||"https://images.unsplash.com/photo-1434030216411-0b793f4b4173?w=800";if(e&&e.length>1){const o=Math.max(0,Math.min(e.length-1,t||0));a=((i=e[o])==null?void 0:i.url)||a}return s.jsx("img",{src:a,alt:"English Learning",className:"absolute inset-0 w-full h-full object-cover transition-transform duration-700 group-hover:scale-110"})})()}),e&&e.length>1&&s.jsx("div",{className:"absolute bottom-4 left-1/2 transform -translate-x-1/2 flex gap-2 z-20",children:e.map((n,a)=>s.jsx("button",{onClick:()=>r(a),className:`w-2 h-2 rounded-full transition-all duration-300 ${a===t?"bg-white w-8":"bg-white/50 hover:bg-white/75"}`,"aria-label":`Go to image ${a+1}`},a))})]}),s.jsx("div",{className:"absolute -inset-1 bg-gradient-to-r from-cyan-500 via-blue-500 to-purple-500 rounded-2xl opacity-20 blur group-hover:opacity-40 transition-opacity duration-500"})]}),s.jsx("div",{className:"hidden lg:block absolute -top-6 -right-6 w-72 h-72 bg-gradient-to-r from-cyan-200 to-blue-200 rounded-full mix-blend-multiply filter blur-xl opacity-20 animate-pulse -z-10"}),s.jsx("div",{className:"hidden lg:block absolute -bottom-6 -left-6 w-72 h-72 bg-gradient-to-r from-blue-200 to-purple-200 rounded-full mix-blend-multiply filter blur-xl opacity-20 animate-pulse delay-1000 -z-10"})]})]})})]})},Fe=d.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:le("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Fe.displayName="Card";const st=d.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:le("flex flex-col space-y-1.5 p-6",e),...t}));st.displayName="CardHeader";const dt=d.forwardRef(({className:e,...t},r)=>s.jsx("h3",{ref:r,className:le("text-2xl font-semibold leading-none tracking-tight",e),...t}));dt.displayName="CardTitle";const pn=d.forwardRef(({className:e,...t},r)=>s.jsx("p",{ref:r,className:le("text-sm text-muted-foreground",e),...t}));pn.displayName="CardDescription";const Ue=d.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:le("p-6 pt-0",e),...t}));Ue.displayName="CardContent";const hR=d.forwardRef(({className:e,...t},r)=>s.jsx("div",{ref:r,className:le("flex items-center p-6 pt-0",e),...t}));hR.displayName="CardFooter";const pR=()=>{const e=[{icon:$r,title:"Expert English Training",description:"Master English with proven methods combining grammar, vocabulary, and practical communication skills.",color:"from-cyan-500 to-blue-500"},{icon:Ma,title:"Certified Instructors",description:"Learn from qualified native speakers and certified English teachers with years of experience.",color:"from-blue-500 to-cyan-500"},{icon:Sn,title:"IELTS & TOEFL Prep",description:"Comprehensive test preparation programs to help you achieve your target scores.",color:"from-cyan-600 to-blue-400"},{icon:fk,title:"Confidence Building",description:"Build speaking confidence through interactive sessions and personalized feedback.",color:"from-blue-600 to-cyan-400"},{icon:Wa,title:"Modern Methods",description:"Learn with cutting-edge technology and interactive learning platforms.",color:"from-cyan-500 to-blue-600"},{icon:dk,title:"Global Community",description:"Join students worldwide in our diverse English learning community.",color:"from-blue-500 to-cyan-600"}];return s.jsx("section",{id:"about",className:"py-12 sm:py-16 md:py-20 bg-white",children:s.jsxs("div",{className:"container mx-auto px-3 sm:px-4 lg:px-6",children:[s.jsxs("div",{className:"text-center mb-8 sm:mb-12 md:mb-16",children:[s.jsx("h2",{className:"text-xl sm:text-2xl md:text-3xl lg:text-4xl xl:text-5xl font-bold text-gray-900 mb-3 sm:mb-4 px-2",children:"About You Talk Academy"}),s.jsx("p",{className:"text-base sm:text-lg md:text-xl text-gray-600 max-w-3xl mx-auto px-2 sm:px-4",children:"Dedicated to empowering students with excellent English language skills through innovative teaching methods. Our academy provides comprehensive English education for personal and professional success."})]}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-6 md:gap-8 mb-8 sm:mb-12 md:mb-16",children:e.map((t,r)=>{const n=t.icon;return s.jsx(Fe,{className:"group hover:shadow-xl transition-all duration-300 border-0 shadow-lg",children:s.jsxs(Ue,{className:"p-4 sm:p-6 md:p-8 text-center",children:[s.jsx("div",{className:`w-12 h-12 sm:w-14 sm:h-14 md:w-16 md:h-16 mx-auto mb-4 sm:mb-6 rounded-full bg-gradient-to-r ${t.color} flex items-center justify-center group-hover:scale-110 transition-transform duration-300`,children:s.jsx(n,{className:"h-6 w-6 sm:h-7 sm:w-7 md:h-8 md:w-8 text-white"})}),s.jsx("h3",{className:"text-lg sm:text-xl font-bold text-gray-900 mb-3 sm:mb-4",children:t.title}),s.jsx("p",{className:"text-sm sm:text-base text-gray-600 leading-relaxed",children:t.description})]})},r)})}),s.jsxs("div",{className:"grid lg:grid-cols-2 gap-8 sm:gap-10 lg:gap-12 items-center",children:[s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsx("h3",{className:"text-xl sm:text-2xl md:text-3xl font-bold text-gray-900",children:"Our Mission & Vision"}),s.jsxs("div",{className:"space-y-3 sm:space-y-4 text-gray-600 leading-relaxed",children:[s.jsxs("p",{className:"text-sm sm:text-base md:text-lg",children:[s.jsx("strong",{className:"text-cyan-600",children:"Mission:"})," To provide excellent English language education with modern teaching methods, helping students achieve fluency and confidence in professional and personal communication."]}),s.jsxs("p",{className:"text-sm sm:text-base md:text-lg",children:[s.jsx("strong",{className:"text-cyan-600",children:"Vision:"})," To become a leading center for English education that produces confident, fluent, and articulate English speakers ready for global opportunities."]}),s.jsxs("div",{className:"bg-gradient-to-r from-cyan-50 to-blue-50 p-6 rounded-lg border-l-4 border-cyan-500",children:[s.jsx("p",{className:"text-cyan-800 font-medium italic",children:'"To have another language is to possess a second soul."'}),s.jsx("p",{className:"text-cyan-600 text-sm mt-2",children:"- Charlemagne"})]})]})]}),s.jsxs("div",{className:"relative",children:[s.jsx("img",{src:"https://images.unsplash.com/photo-1434030216411-0b793f4b4173?w=600",alt:"English Learning",className:"w-full h-auto rounded-2xl shadow-xl"}),s.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-cyan-900/20 to-transparent rounded-2xl"})]})]})]})})},gR=xd("inline-flex items-center rounded-full 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 hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function sn({className:e,variant:t,...r}){return s.jsx("div",{className:le(gR({variant:t}),e),...r})}const xR=()=>{const[e,t]=d.useState("All"),[r,n]=d.useState([]),[a,i]=d.useState(!0),[o,l]=d.useState(null);d.useEffect(()=>{(async()=>{try{i(!0),l(null),console.log("Loading courses from PHP backend...");const m=await ue.getCourses();m.success?(console.log("Courses loaded successfully:",m.courses),n(m.courses)):(console.error("Failed to load courses:",m.message),l(m.message))}catch(m){console.error("Error loading courses:",m),l(m.message||"Failed to load courses")}finally{i(!1)}})()},[]);const u=["All",...Array.from(new Set(r==null?void 0:r.map(f=>typeof f.category=="string"?f.category.trim():"").filter(f=>!!f))).sort()],h=(r==null?void 0:r.filter(f=>e==="All"||f.category===e).sort((f,m)=>f.title.localeCompare(m.title)))||[];return console.log("Courses component state:",{isLoading:a,coursesCount:r==null?void 0:r.length,error:o}),a?s.jsx("section",{className:"py-20 bg-muted/30",children:s.jsx("div",{className:"container mx-auto px-4 lg:px-6",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-secondary mx-auto"}),s.jsx("p",{className:"mt-4 text-muted-foreground",children:"Loading courses..."})]})})}):o?s.jsx("section",{className:"py-20 bg-muted/30",children:s.jsx("div",{className:"container mx-auto px-4 lg:px-6",children:s.jsxs("div",{className:"text-center",children:[s.jsxs("p",{className:"text-destructive mb-4",children:["Error loading courses: ",o]}),s.jsx(V,{onClick:()=>window.location.reload(),className:"mt-4",variant:"outline",children:"Try Again"})]})})}):s.jsx("section",{id:"courses",className:"py-20 bg-muted/30",children:s.jsxs("div",{className:"container mx-auto px-4 lg:px-6",children:[s.jsxs("div",{className:"text-center mb-16",children:[s.jsxs("h2",{className:"text-3xl md:text-5xl font-bold text-foreground mb-4",children:["Our ",s.jsx("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-primary to-secondary",children:"Courses"})]}),s.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto mb-8",children:"Discover our comprehensive English learning programs designed by certified instructors to help you master the English language."}),s.jsx("div",{className:"flex flex-wrap justify-center gap-2 sm:gap-4 mb-12",children:u.map(f=>s.jsx(V,{variant:e===f?"default":"outline",onClick:()=>t(f),className:`text-xs sm:text-sm px-3 sm:px-4 py-2 ${e===f?"bg-gradient-to-r from-primary to-secondary hover:from-primary/90 hover:to-secondary/90":"border-primary text-primary hover:bg-primary/5"}`,size:"sm",children:f},f))})]}),h.length===0?s.jsx("div",{className:"text-center py-12",children:s.jsx("p",{className:"text-muted-foreground",children:"No courses found for the selected category."})}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 lg:gap-8",children:h.map(f=>{const m=typeof f.instructor=="string"?f.instructor.trim():"";return s.jsxs(Fe,{className:"group hover:shadow-xl transition-all duration-300 border-0 shadow-lg overflow-hidden h-full flex flex-col",children:[s.jsxs("div",{className:"relative overflow-hidden",children:[s.jsx("img",{src:f.image_url||"https://images.unsplash.com/photo-1522202176988-66273c2fd55f?w=400",alt:f.title,className:"w-full h-48 object-cover group-hover:scale-105 transition-transform duration-300"}),s.jsx("div",{className:"absolute top-4 left-4",children:s.jsx(sn,{className:"bg-gradient-to-r from-primary to-secondary text-xs",children:f.category||"General"})})]}),s.jsxs(st,{className:"pb-3 flex-grow",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx(sn,{variant:"outline",className:"text-xs border-primary/30 text-primary",children:f.level||"Beginner"}),s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx(Wa,{className:"h-4 w-4 fill-yellow-400 text-yellow-400"}),s.jsx("span",{className:"text-sm font-medium",children:f.rating||"0.0"})]})]}),s.jsx("h3",{className:"text-lg sm:text-xl font-bold text-foreground line-clamp-2 mb-2",children:f.title}),s.jsx("p",{className:"text-muted-foreground line-clamp-2 text-sm",children:f.description})]}),s.jsxs(Ue,{className:"space-y-4 mt-auto",children:[s.jsxs("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx(Gi,{className:"h-4 w-4 text-secondary"}),s.jsx("span",{className:"text-xs sm:text-sm",children:f.duration||"4 weeks"})]}),s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx(Ma,{className:"h-4 w-4 text-secondary"}),s.jsxs("span",{className:"text-xs sm:text-sm",children:[f.students_enrolled||0," students"]})]})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"text-xl sm:text-2xl font-bold text-foreground",children:["$",f.price||0]}),m&&s.jsxs("div",{className:"text-xs sm:text-sm text-muted-foreground",children:["By ",m]})]}),s.jsxs("div",{className:"flex flex-col space-y-2",children:[s.jsx(ht,{to:`/course/${f.id}`,children:s.jsx(V,{variant:"outline",size:"sm",className:"text-xs border-primary text-primary hover:bg-primary/5",children:"Details"})}),s.jsx(ht,{to:`/enroll/${f.id}`,children:s.jsx(V,{className:"bg-gradient-to-r from-primary to-secondary hover:from-primary/90 hover:to-secondary/90 text-xs px-3",children:"Enroll Now"})})]})]})]})]},f.id)})}),s.jsx("div",{className:"text-center mt-12",children:s.jsxs(V,{size:"lg",variant:"outline",className:"border-primary text-primary hover:bg-gradient-to-r hover:from-primary hover:to-secondary hover:text-white transition-all duration-300",children:["View All Courses",s.jsx(Lp,{className:"ml-2 h-5 w-5"})]})})]})})},vR=()=>{const[e,t]=d.useState([]),[r,n]=d.useState(!0),[a,i]=d.useState(null);return d.useEffect(()=>{(async()=>{try{n(!0),i(null),console.log("Loading achievements from PHP backend...");const l=await ue.getAchievements();l.success?(console.log("Achievements loaded successfully:",l.achievements),t(l.achievements)):(console.error("Failed to load achievements:",l.message),i(l.message))}catch(l){console.error("Error loading achievements:",l),i(l.message||"Failed to load achievements")}finally{n(!1)}})()},[]),console.log("Events component state:",{isLoading:r,achievementsCount:e==null?void 0:e.length,error:a}),r?s.jsx("section",{id:"events",className:"py-20 bg-gradient-to-br from-cyan-50 to-blue-50",children:s.jsx("div",{className:"container mx-auto px-4 lg:px-6",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-secondary mx-auto"}),s.jsx("p",{className:"mt-4 text-muted-foreground",children:"Loading achievements..."})]})})}):a?s.jsx("section",{id:"events",className:"py-20 bg-gradient-to-br from-cyan-50 to-blue-50",children:s.jsx("div",{className:"container mx-auto px-4 lg:px-6",children:s.jsxs("div",{className:"text-center",children:[s.jsxs("p",{className:"text-destructive mb-4",children:["Error loading achievements: ",a]}),s.jsx(V,{onClick:()=>window.location.reload(),className:"mt-4",variant:"outline",children:"Try Again"})]})})}):s.jsx("section",{id:"events",className:"py-20 bg-gradient-to-br from-cyan-50 to-blue-50",children:s.jsxs("div",{className:"container mx-auto px-4 lg:px-6",children:[s.jsxs("div",{className:"text-center mb-16",children:[s.jsxs("h2",{className:"text-3xl md:text-5xl font-bold text-foreground mb-4",children:["Student ",s.jsx("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-primary to-secondary",children:"Achievements"})]}),s.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:"Celebrating the incredible journey and achievements of our students in their English language learning and mastery."})]}),e.length===0?s.jsx("div",{className:"text-center py-12",children:s.jsx("p",{className:"text-muted-foreground",children:"No achievements found."})}):s.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-2 gap-8",children:e.map(o=>s.jsxs(Fe,{className:"group hover:shadow-xl transition-all duration-300 border-0 shadow-lg overflow-hidden",children:[s.jsxs("div",{className:"relative overflow-hidden",children:[s.jsx("img",{src:o.image_url||"https://images.unsplash.com/photo-1522202176988-66273c2fd55f?w=400",alt:o.title,className:"w-full h-48 object-cover group-hover:scale-105 transition-transform duration-300"}),s.jsx("div",{className:"absolute top-4 left-4",children:s.jsx(sn,{className:"bg-gradient-to-r from-primary to-secondary",children:o.category||"Achievement"})}),s.jsx("div",{className:"absolute top-4 right-4",children:s.jsx("div",{className:"bg-white/90 backdrop-blur-sm rounded-full p-2",children:s.jsx(Sn,{className:"h-5 w-5 text-secondary"})})})]}),s.jsxs(st,{className:"pb-3",children:[s.jsx("h3",{className:"text-xl font-bold text-foreground mb-2",children:o.title}),s.jsx("p",{className:"text-muted-foreground text-sm line-clamp-3",children:o.description})]}),s.jsx(Ue,{className:"space-y-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Wa,{className:"h-4 w-4 fill-secondary text-secondary"}),s.jsx("span",{className:"text-sm text-muted-foreground font-medium",children:"Excellent!"})]}),s.jsx(ht,{to:`/achievement/${o.id}`,children:s.jsxs("button",{className:"flex items-center space-x-2 text-primary hover:text-primary/80 transition-colors font-medium",children:[s.jsx("span",{children:"Read More"}),s.jsx(Lp,{className:"h-4 w-4"})]})})]})})]},o.id))}),s.jsxs("div",{className:"text-center mt-12",children:[s.jsx("p",{className:"text-lg text-muted-foreground mb-4",children:'"The limits of my language mean the limits of my world."'}),s.jsx("p",{className:"text-sm text-primary font-semibold",children:"- Ludwig Wittgenstein"})]})]})})};var Xp="Avatar",[yR,vD]=sa(Xp),[wR,Qb]=yR(Xp),Yb=d.forwardRef((e,t)=>{const{__scopeAvatar:r,...n}=e,[a,i]=d.useState("idle");return s.jsx(wR,{scope:r,imageLoadingStatus:a,onImageLoadingStatusChange:i,children:s.jsx(xe.span,{...n,ref:t})})});Yb.displayName=Xp;var Zb="AvatarImage",Xb=d.forwardRef((e,t)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:a=()=>{},...i}=e,o=Qb(Zb,r),l=bR(n,i.referrerPolicy),c=Ot(u=>{a(u),o.onImageLoadingStatusChange(u)});return Tt(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?s.jsx(xe.img,{...i,ref:t,src:n}):null});Xb.displayName=Zb;var Jb="AvatarFallback",e1=d.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:n,...a}=e,i=Qb(Jb,r),[o,l]=d.useState(n===void 0);return d.useEffect(()=>{if(n!==void 0){const c=window.setTimeout(()=>l(!0),n);return()=>window.clearTimeout(c)}},[n]),o&&i.imageLoadingStatus!=="loaded"?s.jsx(xe.span,{...a,ref:t}):null});e1.displayName=Jb;function bR(e,t){const[r,n]=d.useState("idle");return Tt(()=>{if(!e){n("error");return}let a=!0;const i=new window.Image,o=l=>()=>{a&&n(l)};return n("loading"),i.onload=o("loaded"),i.onerror=o("error"),i.src=e,t&&(i.referrerPolicy=t),()=>{a=!1}},[e,t]),r}var t1=Yb,r1=Xb,n1=e1;const xl=d.forwardRef(({className:e,...t},r)=>s.jsx(t1,{ref:r,className:le("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));xl.displayName=t1.displayName;const vl=d.forwardRef(({className:e,...t},r)=>s.jsx(r1,{ref:r,className:le("aspect-square h-full w-full",e),...t}));vl.displayName=r1.displayName;const yl=d.forwardRef(({className:e,...t},r)=>s.jsx(n1,{ref:r,className:le("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));yl.displayName=n1.displayName;const jR=()=>{const[e,t]=d.useState([]),[r,n]=d.useState(0),[a,i]=d.useState(!0),[o,l]=d.useState(!0),c=3;d.useEffect(()=>{(async()=>{try{const p=await ue.getTestimonials(!1);p.success&&p.testimonials&&t(p.testimonials)}catch(p){console.error("Failed to fetch testimonials:",p)}finally{l(!1)}})()},[]),d.useEffect(()=>{if(!a||e.length===0)return;const v=setInterval(()=>{n(p=>p+c>=e.length?0:p+c)},5e3);return()=>clearInterval(v)},[a,e.length]);const u=()=>{i(!1),n(v=>v-c<0?Math.max(0,e.length-c):v-c)},h=()=>{i(!1),n(v=>v+c>=e.length?0:v+c)},f=e.slice(r,r+c),m=v=>Array.from({length:5},(p,b)=>s.jsx(Wa,{className:`h-4 w-4 ${b<v?"text-yellow-400 fill-yellow-400":"text-gray-300"}`},b)),y=v=>v.split(" ").map(p=>p[0]).join("").toUpperCase();return s.jsx("section",{id:"testimonials",className:"py-20 bg-gradient-to-br from-cyan-50 via-white to-blue-50",children:s.jsxs("div",{className:"container mx-auto px-4 lg:px-6",children:[s.jsxs("div",{className:"text-center mb-16",children:[s.jsxs("div",{className:"inline-flex items-center gap-2 bg-secondary/10 text-secondary px-4 py-2 rounded-full text-sm font-medium mb-4",children:[s.jsx(sv,{className:"h-4 w-4"}),"Student Testimonials"]}),s.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-gray-900 mb-4",children:"What Our Students Say"}),s.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"Hear from our community of learners who have transformed their English skills and achieved their goals with our courses."})]}),o?s.jsx("div",{className:"text-center py-12",children:s.jsx("p",{className:"text-muted-foreground",children:"Loading testimonials..."})}):e.length===0?s.jsx("div",{className:"text-center py-12",children:s.jsx("p",{className:"text-muted-foreground",children:"No testimonials available yet."})}):s.jsx(s.Fragment,{children:s.jsxs("div",{className:"relative",children:[s.jsx(V,{variant:"outline",size:"icon",className:"absolute left-0 top-1/2 -translate-y-1/2 -translate-x-4 z-10 hidden md:flex bg-white shadow-lg hover:bg-cyan-50",onClick:u,children:s.jsx(rv,{className:"h-5 w-5"})}),s.jsx(V,{variant:"outline",size:"icon",className:"absolute right-0 top-1/2 -translate-y-1/2 translate-x-4 z-10 hidden md:flex bg-white shadow-lg hover:bg-cyan-50",onClick:h,children:s.jsx(Ym,{className:"h-5 w-5"})}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 px-4 md:px-8",children:f.map((v,p)=>s.jsx(Fe,{className:"bg-white border-0 shadow-lg hover:shadow-xl transition-all duration-300 transform hover:-translate-y-1",style:{animationDelay:`${p*100}ms`},children:s.jsxs(Ue,{className:"p-6",children:[s.jsx(sv,{className:"h-8 w-8 text-cyan-200 mb-4"}),s.jsx("div",{className:"flex gap-1 mb-4",children:m(v.rating)}),s.jsxs("p",{className:"text-gray-600 mb-6 leading-relaxed italic",children:['"',v.content,'"']}),v.course&&s.jsx("div",{className:"mb-4",children:s.jsx("span",{className:"inline-block bg-secondary/10 text-secondary text-xs px-3 py-1 rounded-full",children:v.course})}),s.jsxs("div",{className:"flex items-center gap-3 pt-4 border-t border-gray-100",children:[s.jsxs(xl,{className:"h-12 w-12 border-2 border-cyan-100",children:[v.image_url?s.jsx(vl,{src:v.image_url,alt:v.name}):null,s.jsx(yl,{className:"bg-gradient-to-br from-cyan-500 to-blue-500 text-white font-semibold",children:y(v.name)})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold text-gray-900",children:v.name}),s.jsx("p",{className:"text-sm text-muted-foreground",children:v.role})]})]})]})},v.id))}),s.jsxs("div",{className:"flex justify-center gap-4 mt-8 md:hidden",children:[s.jsx(V,{variant:"outline",size:"icon",onClick:u,className:"bg-white shadow-lg",children:s.jsx(rv,{className:"h-5 w-5"})}),s.jsx(V,{variant:"outline",size:"icon",onClick:h,className:"bg-white shadow-lg",children:s.jsx(Ym,{className:"h-5 w-5"})})]}),s.jsx("div",{className:"flex justify-center gap-2 mt-8",children:Array.from({length:Math.ceil(e.length/c)},(v,p)=>s.jsx("button",{onClick:()=>{i(!1),n(p*c)},className:`w-2 h-2 rounded-full transition-all duration-300 ${Math.floor(r/c)===p?"bg-secondary w-6":"bg-cyan-200 hover:bg-cyan-300"}`},p))})]})}),s.jsxs("div",{className:"mt-16 grid grid-cols-2 md:grid-cols-4 gap-8",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"text-4xl font-bold text-secondary mb-2",children:"500+"}),s.jsx("div",{className:"text-muted-foreground",children:"Happy Students"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"text-4xl font-bold text-secondary mb-2",children:"4.9"}),s.jsx("div",{className:"text-muted-foreground",children:"Average Rating"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"text-4xl font-bold text-secondary mb-2",children:"95%"}),s.jsx("div",{className:"text-muted-foreground",children:"Success Rate"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"text-4xl font-bold text-secondary mb-2",children:"50+"}),s.jsx("div",{className:"text-muted-foreground",children:"Expert Teachers"})]})]})]})})};class $l{constructor(t=0,r="Network Error"){this.status=t,this.text=r}}const NR=()=>{if(!(typeof localStorage>"u"))return{get:e=>Promise.resolve(localStorage.getItem(e)),set:(e,t)=>Promise.resolve(localStorage.setItem(e,t)),remove:e=>Promise.resolve(localStorage.removeItem(e))}},At={origin:"https://api.emailjs.com",blockHeadless:!1,storageProvider:NR()},Jp=e=>e?typeof e=="string"?{publicKey:e}:e.toString()==="[object Object]"?e:{}:{},CR=(e,t="https://api.emailjs.com")=>{if(!e)return;const r=Jp(e);At.publicKey=r.publicKey,At.blockHeadless=r.blockHeadless,At.storageProvider=r.storageProvider,At.blockList=r.blockList,At.limitRate=r.limitRate,At.origin=r.origin||t},s1=async(e,t,r={})=>{const n=await fetch(At.origin+e,{method:"POST",headers:r,body:t}),a=await n.text(),i=new $l(n.status,a);if(n.ok)return i;throw i},a1=(e,t,r)=>{if(!e||typeof e!="string")throw"The public key is required. Visit https://dashboard.emailjs.com/admin/account";if(!t||typeof t!="string")throw"The service ID is required. Visit https://dashboard.emailjs.com/admin";if(!r||typeof r!="string")throw"The template ID is required. Visit https://dashboard.emailjs.com/admin/templates"},SR=e=>{if(e&&e.toString()!=="[object Object]")throw"The template params have to be the object. Visit https://www.emailjs.com/docs/sdk/send/"},i1=e=>e.webdriver||!e.languages||e.languages.length===0,o1=()=>new $l(451,"Unavailable For Headless Browser"),_R=(e,t)=>{if(!Array.isArray(e))throw"The BlockList list has to be an array";if(typeof t!="string")throw"The BlockList watchVariable has to be a string"},ER=e=>{var t;return!((t=e.list)!=null&&t.length)||!e.watchVariable},kR=(e,t)=>e instanceof FormData?e.get(t):e[t],l1=(e,t)=>{if(ER(e))return!1;_R(e.list,e.watchVariable);const r=kR(t,e.watchVariable);return typeof r!="string"?!1:e.list.includes(r)},c1=()=>new $l(403,"Forbidden"),TR=(e,t)=>{if(typeof e!="number"||e<0)throw"The LimitRate throttle has to be a positive number";if(t&&typeof t!="string")throw"The LimitRate ID has to be a non-empty string"},PR=async(e,t,r)=>{const n=Number(await r.get(e)||0);return t-Date.now()+n},u1=async(e,t,r)=>{if(!t.throttle||!r)return!1;TR(t.throttle,t.id);const n=t.id||e;return await PR(n,t.throttle,r)>0?!0:(await r.set(n,Date.now().toString()),!1)},d1=()=>new $l(429,"Too Many Requests"),RR=async(e,t,r,n)=>{const a=Jp(n),i=a.publicKey||At.publicKey,o=a.blockHeadless||At.blockHeadless,l=a.storageProvider||At.storageProvider,c={...At.blockList,...a.blockList},u={...At.limitRate,...a.limitRate};return o&&i1(navigator)?Promise.reject(o1()):(a1(i,e,t),SR(r),r&&l1(c,r)?Promise.reject(c1()):await u1(location.pathname,u,l)?Promise.reject(d1()):s1("/api/v1.0/email/send",JSON.stringify({lib_version:"4.4.1",user_id:i,service_id:e,template_id:t,template_params:r}),{"Content-type":"application/json"}))},AR=e=>{if(!e||e.nodeName!=="FORM")throw"The 3rd parameter is expected to be the HTML form element or the style selector of the form"},IR=e=>typeof e=="string"?document.querySelector(e):e,MR=async(e,t,r,n)=>{const a=Jp(n),i=a.publicKey||At.publicKey,o=a.blockHeadless||At.blockHeadless,l=At.storageProvider||a.storageProvider,c={...At.blockList,...a.blockList},u={...At.limitRate,...a.limitRate};if(o&&i1(navigator))return Promise.reject(o1());const h=IR(r);a1(i,e,t),AR(h);const f=new FormData(h);return l1(c,f)?Promise.reject(c1()):await u1(location.pathname,u,l)?Promise.reject(d1()):(f.append("lib_version","4.4.1"),f.append("service_id",e),f.append("template_id",t),f.append("user_id",i),s1("/api/v1.0/email/send-form",f))},yu={init:CR,send:RR,sendForm:MR,EmailJSResponseStatus:$l},Q=d.forwardRef(({className:e,type:t,...r},n)=>s.jsx("input",{type:t,className:le("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));Q.displayName="Input";const Zt=d.forwardRef(({className:e,...t},r)=>s.jsx("textarea",{className:le("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));Zt.displayName="Textarea";const OR=()=>{const[e,t]=d.useState(!1),[r,n]=d.useState({name:"",email:"",message:""}),a=o=>{const{name:l,value:c}=o.target;n(u=>({...u,[l]:c}))},i=async o=>{if(o.preventDefault(),!r.name||!r.email||!r.message){Jt.error("Please fill in all fields");return}t(!0);const l={to_email:"support@youtalkacademy.com",from_name:r.name,reply_to:r.email,name:r.name,time:new Date().toLocaleString(),message:`Email: ${r.email}

Message:
${r.message}`};try{if(yu.init("vM-y2cWvRM3WGdSNg"),(await yu.send("default_service","template_w7lidsa",l)).status===200)Jt.success("Message sent successfully! We will get back to you soon.",{duration:5e3,style:{background:"#10b981",color:"#fff",fontSize:"16px",padding:"16px"}}),n({name:"",email:"",message:""});else throw new Error("Failed to send email")}catch(c){console.error("Error sending email:",c),Jt.error(`Failed to send message: ${c.message||"Please try again later."}`,{duration:5e3})}finally{t(!1)}};return s.jsx("section",{id:"contact",className:"py-20 bg-gray-50",children:s.jsxs("div",{className:"container mx-auto px-4 lg:px-6",children:[s.jsxs("div",{className:"text-center mb-16",children:[s.jsxs("h2",{className:"text-3xl md:text-5xl font-bold text-gray-900 mb-4",children:["Get In ",s.jsx("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-cyan-500 to-blue-600",children:"Touch"})]}),s.jsx("p",{className:"text-xl text-gray-600 max-w-3xl mx-auto",children:"Have questions about our English courses or need guidance on your learning journey? We're here to help!"})]}),s.jsxs("form",{onSubmit:i,className:"grid lg:grid-cols-2 gap-12","data-gramm":"false","data-gramm_editor":"false",children:[s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-1",children:"Your Name"}),s.jsx(Q,{id:"name",name:"name",type:"text",placeholder:"John Doe",value:r.name,onChange:a,className:"w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-blue-500 focus:border-transparent",required:!0,"data-gramm":"false","data-gramm_editor":"false"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-1",children:"Email Address"}),s.jsx(Q,{id:"email",name:"email",type:"email",placeholder:"your.email@example.com",value:r.email,onChange:a,className:"w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-blue-500 focus:border-transparent",required:!0,"data-gramm":"false","data-gramm_editor":"false"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"message",className:"block text-sm font-medium text-gray-700 mb-1",children:"Your Message"}),s.jsx(Zt,{id:"message",name:"message",rows:5,placeholder:"How can we help you?",value:r.message,onChange:a,className:"w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-blue-500 focus:border-transparent",required:!0,"data-gramm":"false","data-gramm_editor":"false"})]}),s.jsx(V,{type:"submit",className:"w-full bg-gradient-to-r from-cyan-500 to-blue-600 hover:from-cyan-600 hover:to-blue-700 text-white py-3 px-6 rounded-lg font-medium transition-all duration-300 flex items-center justify-center gap-2",disabled:e,children:e?s.jsxs(s.Fragment,{children:[s.jsx(it,{className:"h-5 w-5 animate-spin"}),"Sending..."]}):s.jsxs(s.Fragment,{children:[s.jsx(mb,{className:"h-5 w-5"}),"Send Message"]})})]}),s.jsxs("div",{className:"space-y-8",children:[s.jsx(Fe,{className:"border-0 shadow-lg rounded-xl overflow-hidden",children:s.jsxs(Ue,{className:"p-6",children:[s.jsx("h3",{className:"text-xl font-bold text-gray-900 mb-6",children:"Contact Information"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsx("div",{className:"bg-cyan-100 p-3 rounded-full",children:s.jsx(yd,{className:"h-6 w-6 text-cyan-600"})}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium text-gray-900",children:"Email Us"}),s.jsx("p",{className:"text-gray-600",children:"support@youtalkacademy.com"})]})]}),s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsx("div",{className:"bg-cyan-100 p-3 rounded-full",children:s.jsx(hu,{className:"h-6 w-6 text-cyan-600"})}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium text-gray-900",children:"Call Us"}),s.jsx("p",{className:"text-gray-600",children:"+62 852 9110 8001"}),s.jsx("p",{className:"text-gray-600",children:"+34 642 135 185"})]})]}),s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsx("div",{className:"bg-cyan-100 p-3 rounded-full",children:s.jsx(fb,{className:"h-6 w-6 text-cyan-600"})}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium text-gray-900",children:"Location"}),s.jsx("p",{className:"text-gray-600",children:"East Jakarta, Indonesia"}),s.jsx("p",{className:"text-gray-600",children:"Madrid, Spain"})]})]})]})]})}),s.jsxs("div",{className:"bg-gradient-to-r from-cyan-50 via-white to-blue-50 p-6 rounded-xl",children:[s.jsx("h3",{className:"text-xl font-bold text-gray-900 mb-3",children:"Office Hours"}),s.jsx("p",{className:"text-gray-600 mb-4",children:"We're available to help you during the following hours:"}),s.jsxs("ul",{className:"space-y-2",children:[s.jsxs("li",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-600",children:"Monday - Friday"}),s.jsx("span",{className:"font-medium",children:"9:00 AM - 6:00 PM"})]}),s.jsxs("li",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-600",children:"Saturday"}),s.jsx("span",{className:"font-medium",children:"10:00 AM - 4:00 PM"})]}),s.jsxs("li",{className:"flex justify-between",children:[s.jsx("span",{className:"text-gray-600",children:"Sunday"}),s.jsx("span",{className:"font-medium",children:"Closed"})]})]})]})]})]})]})})},DR=()=>s.jsxs("div",{children:[s.jsx("div",{id:"home",children:s.jsx(mR,{})}),s.jsx("div",{id:"about",children:s.jsx(pR,{})}),s.jsx("div",{id:"courses",children:s.jsx(xR,{})}),s.jsx("div",{id:"events",children:s.jsx(vR,{})}),s.jsx("div",{id:"testimonials",children:s.jsx(jR,{})}),s.jsx("div",{id:"contact",children:s.jsx(OR,{})})]});var FR="Separator",Ev="horizontal",LR=["horizontal","vertical"],f1=d.forwardRef((e,t)=>{const{decorative:r,orientation:n=Ev,...a}=e,i=$R(n)?n:Ev,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx(xe.div,{"data-orientation":i,...l,...a,ref:t})});f1.displayName=FR;function $R(e){return LR.includes(e)}var m1=f1;const wu=d.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},a)=>s.jsx(m1,{ref:a,decorative:r,orientation:t,className:le("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));wu.displayName=m1.displayName;const UR=e=>{if(!e)return"";try{const t=new Date(e),n=new Date().getTime()-t.getTime(),a=Math.floor(n/6e4),i=Math.floor(n/36e5),o=Math.floor(n/864e5);return a<1?"Just now":a<60?`${a} minute${a>1?"s":""} ago`:i<24?`${i} hour${i>1?"s":""} ago`:o<7?`${o} day${o>1?"s":""} ago`:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}catch{return e}},zR=({courseId:e})=>{var g,x;const t=bd(),{user:r}=ia(),[n,a]=d.useState(""),[i,o]=d.useState(""),[l,c]=d.useState(!1),{data:u,isLoading:h,isError:f,error:m}=Yt({queryKey:["comments",e],queryFn:async()=>{console.log("Fetching comments for course:",e);const w=await ue.getComments(e);if(console.log("Comments response:",w),!w.success)throw new Error(w.message||"Failed to load comments");return w.comments},enabled:!!e,staleTime:1e3*60}),y=gt({mutationFn:async({content:w,name:N})=>{const C=await ue.createComment(e,w,N);if(!C.success)throw new Error(C.message||"Failed to post comment");return C.comment},onSuccess:()=>{a(""),o(""),Jt.success("Comment posted successfully!"),t.invalidateQueries({queryKey:["comments",e]})},onError:w=>{Jt.error(w.message||"Failed to post comment")}}),v=w=>{w.preventDefault();const N=r?`${r.first_name||""} ${r.last_name||""}`.trim():i.trim();if(!N){Jt.error("Please enter your name");return}if(!n.trim()){Jt.error("Please enter a comment");return}if(n.trim().length<3){Jt.error("Comment must be at least 3 characters long");return}y.mutate({content:n.trim(),name:N})},p=u,b=(p==null?void 0:p.length)||0;return s.jsx(Fe,{className:"border-0 shadow-lg overflow-hidden",children:s.jsxs(Ue,{className:"p-0",children:[s.jsx("div",{className:"bg-gradient-to-r from-blue-50 to-purple-50 p-5 sm:p-6 border-b",children:s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"bg-gradient-to-r from-blue-600 to-purple-600 p-2 rounded-lg",children:s.jsx(nv,{className:"h-5 w-5 text-white"})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-gray-900",children:"Discussion"}),s.jsx("p",{className:"text-sm text-gray-600",children:b===0?"Start the conversation":`${b} comment${b>1?"s":""}`})]})]})})}),s.jsxs("div",{className:"p-5 sm:p-6 md:p-8 space-y-6",children:[s.jsx("form",{onSubmit:v,className:"bg-white rounded-xl border-2 border-gray-100 p-4 transition-all duration-200 hover:border-blue-200 focus-within:border-blue-400 focus-within:shadow-lg",children:s.jsxs("div",{className:"flex items-start space-x-3",children:[s.jsxs(xl,{className:"h-10 w-10 ring-2 ring-blue-100",children:[s.jsx(vl,{src:(r==null?void 0:r.avatar_url)||`https://ui-avatars.com/api/?name=${encodeURIComponent(i||"Guest")}&background=0D8ABC&color=fff`}),s.jsx(yl,{className:"bg-gradient-to-r from-blue-500 to-purple-500 text-white font-semibold",children:r?((((g=r.first_name)==null?void 0:g[0])||"")+(((x=r.last_name)==null?void 0:x[0])||"")).toUpperCase()||"U":((i==null?void 0:i[0])||"G").toUpperCase()})]}),s.jsxs("div",{className:"flex-1 space-y-3",children:[!r&&s.jsx("input",{type:"text",className:"w-full p-3 border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 text-gray-700 placeholder-gray-400",placeholder:"Your name *",value:i,onChange:w=>o(w.target.value),maxLength:100,required:!0}),s.jsx("textarea",{className:"w-full p-3 border-0 focus:outline-none resize-none text-gray-700 placeholder-gray-400",rows:l?4:3,placeholder:"Share your thoughts about this course...",value:n,onChange:w=>a(w.target.value),onFocus:()=>c(!0),onBlur:()=>!n&&c(!1),maxLength:1e3,required:!0}),s.jsxs("div",{className:"flex items-center justify-between pt-2 border-t",children:[s.jsxs("span",{className:"text-xs text-gray-500",children:[n.length,"/1000 characters"]}),s.jsx(V,{type:"submit",disabled:y.status==="pending"||!n.trim()||!r&&!i.trim(),className:"bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-white shadow-md hover:shadow-lg transition-all duration-200",children:y.status==="pending"?s.jsxs(s.Fragment,{children:[s.jsx(it,{className:"h-4 w-4 mr-2 animate-spin"}),"Posting..."]}):s.jsxs(s.Fragment,{children:[s.jsx(mb,{className:"h-4 w-4 mr-2"}),"Post Comment"]})})]})]})]})}),s.jsx("div",{className:"space-y-4",children:h?s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsxs("div",{className:"text-center space-y-3",children:[s.jsx(it,{className:"h-8 w-8 animate-spin text-blue-600 mx-auto"}),s.jsx("p",{className:"text-sm text-gray-600",children:"Loading comments..."})]})}):f?s.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-xl p-6 text-center",children:[s.jsx("div",{className:"text-red-600 font-medium mb-1",children:"Failed to load comments"}),s.jsx("p",{className:"text-sm text-red-500",children:m==null?void 0:m.message})]}):!p||p.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx("div",{className:"bg-gradient-to-r from-gray-50 to-gray-100 rounded-full w-16 h-16 flex items-center justify-center mx-auto mb-4",children:s.jsx(nv,{className:"h-8 w-8 text-gray-400"})}),s.jsx("p",{className:"text-gray-600 font-medium mb-1",children:"No comments yet"}),s.jsx("p",{className:"text-sm text-gray-500",children:"Be the first to share your thoughts about this course!"})]}):s.jsx("div",{className:"space-y-4",children:p.map(w=>{var N,C,k;return s.jsx("div",{className:"group bg-white rounded-xl border border-gray-100 p-4 transition-all duration-200 hover:shadow-md hover:border-blue-200",children:s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsxs(xl,{className:"h-10 w-10 ring-2 ring-gray-100 group-hover:ring-blue-200 transition-all",children:[s.jsx(vl,{src:w.avatar_url||`https://ui-avatars.com/api/?name=${encodeURIComponent(w.guest_name||(w.first_name||"")+" "+(w.last_name||""))}&background=A78BFA&color=fff`}),s.jsx(yl,{className:"bg-gradient-to-r from-purple-500 to-pink-500 text-white font-semibold text-sm",children:(((N=w.guest_name)==null?void 0:N[0])||((C=w.first_name)==null?void 0:C[0])||((k=w.last_name)==null?void 0:k[0])||"A").toUpperCase()})]}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"flex items-center justify-between mb-2",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("span",{className:"text-sm font-semibold text-gray-900",children:w.guest_name||`${w.first_name||""} ${w.last_name||""}`.trim()||"Anonymous"}),s.jsx("span",{className:"text-xs text-gray-400",children:"•"}),s.jsx("span",{className:"text-xs text-gray-500",children:UR(w.created_at)})]})}),s.jsx("p",{className:"text-sm text-gray-700 leading-relaxed whitespace-pre-wrap break-words",children:w.content})]})]})},w.id)})})})]})]})})},VR=()=>{const{id:e}=Ll(),t=ln();d.useEffect(()=>{window.scrollTo(0,0)},[]);const{data:r,isLoading:n,error:a}=Yt({queryKey:["course",e],queryFn:async()=>{var l,c;console.log("Fetching course details for ID:",e);try{const u=await ue.getCourse(e);if(!u||!u.success||!u.course){if(console.error("Error fetching course:",(u==null?void 0:u.message)||"No course data returned"),(l=u==null?void 0:u.message)!=null&&l.includes("not found"))return null;throw new Error((u==null?void 0:u.message)||"Failed to fetch course - no data returned")}return console.log("Course details fetched:",u.course),u.course}catch(u){if(console.error("Error in course details query:",u),(c=u==null?void 0:u.message)!=null&&c.includes("not found"))return null;throw u}},enabled:!!e,retry:2,refetchOnWindowFocus:!1,staleTime:5*60*1e3}),o=(l=>!l||l.trim()===""?[{title:"Introduction and Setup",duration:"45 min",completed:!1},{title:"Basic Concepts",duration:"1h 20min",completed:!1},{title:"Hands-on Project 1",duration:"2h 15min",completed:!1},{title:"Advanced Techniques",duration:"1h 45min",completed:!1},{title:"Real-world Applications",duration:"2h 30min",completed:!1},{title:"Final Project",duration:"3h",completed:!1}]:l.split(`
`).filter(u=>u.trim()!=="").map((u,h)=>({title:u.trim(),duration:"30 min",completed:!1})))(r==null?void 0:r.curriculum);return d.useEffect(()=>{a&&Jt.error("Failed to load course details")},[a]),n?s.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx("div",{className:"animate-spin rounded-full h-16 w-16 border-4 border-amber-500 border-t-transparent mx-auto"}),s.jsx("p",{className:"text-lg font-medium text-gray-700",children:"Loading course details..."}),s.jsx("p",{className:"text-sm text-gray-500",children:"Please wait while we fetch the course information"})]})}):a?s.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center p-4",children:s.jsxs("div",{className:"text-center max-w-md bg-white p-8 rounded-xl shadow-lg",children:[s.jsx("div",{className:"bg-red-100 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx("svg",{className:"w-8 h-8 text-red-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Error Loading Course"}),s.jsxs("p",{className:"text-gray-600 mb-6",children:["We couldn't load the course details. ",a.message||"Please try again later."]}),s.jsxs("div",{className:"flex gap-3 justify-center",children:[s.jsx(V,{variant:"outline",onClick:()=>window.location.reload(),className:"border-gray-300",children:"Try Again"}),s.jsx(V,{onClick:()=>t("/"),children:"Back to Home"})]})]})}):r?s.jsxs("div",{className:"min-h-screen bg-gray-50 flex flex-col",children:[s.jsx("button",{onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),className:"fixed bottom-4 right-4 md:bottom-8 md:right-8 bg-blue-600 text-white p-2.5 md:p-3 rounded-full shadow-lg hover:bg-blue-700 transition-all transform hover:scale-110 z-50","aria-label":"Scroll to top",children:s.jsx(Qn,{className:"h-4 w-4 md:h-5 md:w-5 transform rotate-90"})}),s.jsx("div",{className:"bg-white border-b sticky top-0 z-40",children:s.jsx("div",{className:"container mx-auto px-4 sm:px-6 py-3 md:py-4",children:s.jsxs(ht,{to:"/",className:"inline-flex items-center space-x-1.5 text-sm sm:text-base text-gray-600 hover:text-gray-900 transition-colors",children:[s.jsx(Qn,{className:"h-4 w-4 flex-shrink-0"}),s.jsx("span",{children:"Back to Courses"})]})})}),s.jsx("div",{className:"container mx-auto px-4 sm:px-6 py-6 md:py-8",children:s.jsxs("div",{className:"grid lg:grid-cols-3 gap-6 md:gap-8",children:[s.jsxs("div",{className:"lg:col-span-2 space-y-6 md:space-y-8",children:[s.jsxs("div",{className:"bg-white rounded-xl md:rounded-2xl shadow-lg overflow-hidden",children:[s.jsxs("div",{className:"relative aspect-video",children:[s.jsx("img",{src:r.image_url||"https://images.unsplash.com/photo-1516321318423-f06f85e504b3?w=800",alt:r.title,className:"w-full h-full object-cover"}),s.jsx("div",{className:"absolute inset-0 bg-black/40 flex items-center justify-center p-4",children:s.jsxs(V,{size:"lg",className:"bg-white/20 backdrop-blur-md hover:bg-white/30 text-white border-white/30 transition-all duration-300 transform hover:scale-105",children:[s.jsx(If,{className:"h-4 w-4 sm:h-5 sm:w-5 mr-2"}),s.jsx("span",{className:"text-sm sm:text-base",children:"Preview Course"})]})})]}),s.jsxs("div",{className:"p-5 sm:p-6 md:p-8",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3 mb-4",children:[s.jsx(sn,{className:"bg-gradient-to-r from-blue-600 to-purple-600 text-xs sm:text-sm",children:r.category}),s.jsx(sn,{variant:"outline",className:"text-xs sm:text-sm",children:r.level}),s.jsxs("div",{className:"flex items-center space-x-1 text-xs sm:text-sm",children:[s.jsx(Wa,{className:"h-3 w-3 sm:h-4 sm:w-4 fill-yellow-400 text-yellow-400"}),s.jsx("span",{className:"font-medium",children:r.rating||"0.0"}),s.jsxs("span",{className:"text-gray-500",children:["(",r.students_enrolled||0,")"]})]})]}),s.jsx("h1",{className:"text-2xl sm:text-3xl font-bold text-gray-900 mb-3 sm:mb-4",children:r.title}),s.jsx("p",{className:"text-gray-600 text-base sm:text-lg leading-relaxed mb-4 sm:mb-6",children:r.description}),s.jsxs("div",{className:"flex flex-wrap items-center gap-4 sm:gap-6 text-xs sm:text-sm text-gray-600",children:[s.jsxs("div",{className:"flex items-center space-x-1.5",children:[s.jsx(Gi,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4 flex-shrink-0"}),s.jsx("span",{children:r.duration})]}),s.jsxs("div",{className:"flex items-center space-x-1.5",children:[s.jsx(Ma,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4 flex-shrink-0"}),s.jsxs("span",{children:[r.students_enrolled||0," students"]})]}),s.jsxs("div",{className:"flex items-center space-x-1.5",children:[s.jsx($r,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4 flex-shrink-0"}),s.jsxs("span",{children:[o?o.length:6," modules"]})]}),s.jsxs("div",{className:"flex items-center space-x-1.5",children:[s.jsx(Sn,{className:"h-3.5 w-3.5 sm:h-4 sm:w-4 flex-shrink-0"}),s.jsx("span",{children:"Certificate"})]})]})]})]}),s.jsx(Fe,{className:"border-0 shadow-lg",children:s.jsxs(Ue,{className:"p-5 sm:p-6 md:p-8",children:[s.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-gray-900 mb-4 sm:mb-6",children:"Course Curriculum"}),s.jsx("div",{className:"space-y-3 sm:space-y-4",children:o&&o.length>0?o.map((l,c)=>s.jsxs("div",{className:"flex items-center justify-between p-3 sm:p-4 bg-gray-50 rounded-lg hover:bg-gray-100 transition-colors",children:[s.jsxs("div",{className:"flex items-start space-x-3 sm:space-x-4 flex-1 min-w-0",children:[s.jsx("div",{className:"w-7 h-7 sm:w-8 sm:h-8 bg-gradient-to-r from-blue-500 to-purple-500 rounded-full flex-shrink-0 flex items-center justify-center text-white text-xs sm:text-sm font-medium mt-0.5",children:c+1}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h3",{className:"text-sm sm:text-base font-medium text-gray-900",children:l.title}),s.jsx("p",{className:"text-xs sm:text-sm text-gray-600",children:l.duration})]})]}),s.jsx(If,{className:"h-4 w-4 sm:h-5 sm:w-5 text-gray-400 flex-shrink-0 ml-2"})]},c)):s.jsx("p",{className:"text-sm sm:text-base text-gray-600 text-center py-4",children:"Curriculum information not available."})})]})}),s.jsx(zR,{courseId:r.id})]}),s.jsx("div",{className:"space-y-4 sm:space-y-6",children:s.jsx(Fe,{className:"border-0 shadow-lg sticky top-6",children:s.jsxs(Ue,{className:"p-5 sm:p-6 md:p-8",children:[s.jsxs("div",{className:"text-center mb-4 sm:mb-6",children:[s.jsxs("div",{className:"text-3xl sm:text-4xl font-bold text-gray-900 mb-1 sm:mb-2",children:["$",r.price]}),s.jsx("p",{className:"text-gray-600",children:"One-time payment"})]}),s.jsxs("div",{className:"space-y-4 mb-6",children:[s.jsx(ht,{to:`/enroll/${r.id}`,className:"w-full block",children:s.jsx(V,{className:"w-full bg-gradient-to-r from-blue-600 to-purple-600 hover:from-blue-700 hover:to-purple-700 text-lg py-6",children:"Enroll Now"})}),s.jsx(V,{variant:"outline",className:"w-full",children:"Add to Wishlist"})]}),s.jsx(wu,{className:"my-6"}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"font-semibold text-gray-900",children:"This course includes:"}),s.jsxs("ul",{className:"space-y-3 text-sm text-gray-600",children:[s.jsxs("li",{className:"flex items-center space-x-3",children:[s.jsx(Gi,{className:"h-4 w-4 text-green-500"}),s.jsx("span",{children:"Lifetime access"})]}),s.jsxs("li",{className:"flex items-center space-x-3",children:[s.jsx(If,{className:"h-4 w-4 text-green-500"}),s.jsx("span",{children:"24 hours of video content"})]}),s.jsxs("li",{className:"flex items-center space-x-3",children:[s.jsx(ok,{className:"h-4 w-4 text-green-500"}),s.jsx("span",{children:"Downloadable resources"})]}),s.jsxs("li",{className:"flex items-center space-x-3",children:[s.jsx(Sn,{className:"h-4 w-4 text-green-500"}),s.jsx("span",{children:"Certificate of completion"})]}),s.jsxs("li",{className:"flex items-center space-x-3",children:[s.jsx(Ma,{className:"h-4 w-4 text-green-500"}),s.jsx("span",{children:"Community access"})]})]})]})]})})})]})})]}):s.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center p-4",children:s.jsxs("div",{className:"text-center max-w-md",children:[s.jsx("div",{className:"bg-amber-100 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx("svg",{className:"w-8 h-8 text-amber-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Course Not Found"}),s.jsx("p",{className:"text-gray-600 mb-6",children:"The course you're looking for doesn't exist or may have been removed."}),s.jsx(V,{onClick:()=>t("/"),children:"Browse All Courses"})]})})};var Ul=e=>e.type==="checkbox",va=e=>e instanceof Date,Xt=e=>e==null;const h1=e=>typeof e=="object";var wt=e=>!Xt(e)&&!Array.isArray(e)&&h1(e)&&!va(e),BR=e=>wt(e)&&e.target?Ul(e.target)?e.target.checked:e.target.value:e,HR=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,WR=(e,t)=>e.has(HR(t)),qR=e=>{const t=e.constructor&&e.constructor.prototype;return wt(t)&&t.hasOwnProperty("isPrototypeOf")},eg=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ar(e){let t;const r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(eg&&(e instanceof Blob||e instanceof FileList))&&(r||wt(e)))if(t=r?[]:{},!r&&!qR(e))t=e;else for(const n in e)e.hasOwnProperty(n)&&(t[n]=Ar(e[n]));else return e;return t}var jd=e=>Array.isArray(e)?e.filter(Boolean):[],xt=e=>e===void 0,ie=(e,t,r)=>{if(!t||!wt(e))return r;const n=jd(t.split(/[,[\].]+?/)).reduce((a,i)=>Xt(a)?a:a[i],e);return xt(n)||n===e?xt(e[t])?r:e[t]:n},gn=e=>typeof e=="boolean",tg=e=>/^\w*$/.test(e),p1=e=>jd(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ye=(e,t,r)=>{let n=-1;const a=tg(t)?[t]:p1(t),i=a.length,o=i-1;for(;++n<i;){const l=a[n];let c=r;if(n!==o){const u=e[l];c=wt(u)||Array.isArray(u)?u:isNaN(+a[n+1])?{}:[]}if(l==="__proto__")return;e[l]=c,e=e[l]}return e};const kv={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},en={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Dn={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"};z.createContext(null);var KR=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(a,i,{get:()=>{const o=i;return t._proxyFormState[o]!==en.all&&(t._proxyFormState[o]=!n||en.all),e[o]}});return a},ur=e=>wt(e)&&!Object.keys(e).length,GR=(e,t,r,n)=>{r(e);const{name:a,...i}=e;return ur(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(o=>t[o]===en.all)},$c=e=>Array.isArray(e)?e:[e];function QR(e){const t=z.useRef(e);t.current=e,z.useEffect(()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}var _n=e=>typeof e=="string",YR=(e,t,r,n,a)=>_n(e)?(n&&t.watch.add(e),ie(r,e,a)):Array.isArray(e)?e.map(i=>(n&&t.watch.add(i),ie(r,i))):(n&&(t.watchAll=!0),r),g1=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},Tv=e=>({isOnSubmit:!e||e===en.onSubmit,isOnBlur:e===en.onBlur,isOnChange:e===en.onChange,isOnAll:e===en.all,isOnTouch:e===en.onTouched}),Pv=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Qo=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const i=ie(e,a);if(i){const{_f:o,...l}=i;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],a)&&!n)return!0;if(o.ref&&t(o.ref,o.name)&&!n)return!0;if(Qo(l,t))break}else if(wt(l)&&Qo(l,t))break}}};var ZR=(e,t,r)=>{const n=$c(ie(e,r));return Ye(n,"root",t[r]),Ye(e,r,n),e},rg=e=>e.type==="file",Hn=e=>typeof e=="function",bu=e=>{if(!eg)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Uc=e=>_n(e),ng=e=>e.type==="radio",ju=e=>e instanceof RegExp;const Rv={value:!1,isValid:!1},Av={value:!0,isValid:!0};var x1=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!xt(e[0].attributes.value)?xt(e[0].value)||e[0].value===""?Av:{value:e[0].value,isValid:!0}:Av:Rv}return Rv};const Iv={isValid:!1,value:null};var v1=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Iv):Iv;function Mv(e,t,r="validate"){if(Uc(e)||Array.isArray(e)&&e.every(Uc)||gn(e)&&!e)return{type:r,message:Uc(e)?e:"",ref:t}}var Ya=e=>wt(e)&&!ju(e)?e:{value:e,message:""},Ov=async(e,t,r,n,a)=>{const{ref:i,refs:o,required:l,maxLength:c,minLength:u,min:h,max:f,pattern:m,validate:y,name:v,valueAsNumber:p,mount:b,disabled:g}=e._f,x=ie(t,v);if(!b||g)return{};const w=o?o[0]:i,N=M=>{n&&w.reportValidity&&(w.setCustomValidity(gn(M)?"":M||""),w.reportValidity())},C={},k=ng(i),T=Ul(i),P=k||T,I=(p||rg(i))&&xt(i.value)&&xt(x)||bu(i)&&i.value===""||x===""||Array.isArray(x)&&!x.length,D=g1.bind(null,v,r,C),E=(M,U,$,G=Dn.maxLength,F=Dn.minLength)=>{const X=M?U:$;C[v]={type:M?G:F,message:X,ref:i,...D(M?G:F,X)}};if(a?!Array.isArray(x)||!x.length:l&&(!P&&(I||Xt(x))||gn(x)&&!x||T&&!x1(o).isValid||k&&!v1(o).isValid)){const{value:M,message:U}=Uc(l)?{value:!!l,message:l}:Ya(l);if(M&&(C[v]={type:Dn.required,message:U,ref:w,...D(Dn.required,U)},!r))return N(U),C}if(!I&&(!Xt(h)||!Xt(f))){let M,U;const $=Ya(f),G=Ya(h);if(!Xt(x)&&!isNaN(x)){const F=i.valueAsNumber||x&&+x;Xt($.value)||(M=F>$.value),Xt(G.value)||(U=F<G.value)}else{const F=i.valueAsDate||new Date(x),X=Y=>new Date(new Date().toDateString()+" "+Y),A=i.type=="time",O=i.type=="week";_n($.value)&&x&&(M=A?X(x)>X($.value):O?x>$.value:F>new Date($.value)),_n(G.value)&&x&&(U=A?X(x)<X(G.value):O?x<G.value:F<new Date(G.value))}if((M||U)&&(E(!!M,$.message,G.message,Dn.max,Dn.min),!r))return N(C[v].message),C}if((c||u)&&!I&&(_n(x)||a&&Array.isArray(x))){const M=Ya(c),U=Ya(u),$=!Xt(M.value)&&x.length>+M.value,G=!Xt(U.value)&&x.length<+U.value;if(($||G)&&(E($,M.message,U.message),!r))return N(C[v].message),C}if(m&&!I&&_n(x)){const{value:M,message:U}=Ya(m);if(ju(M)&&!x.match(M)&&(C[v]={type:Dn.pattern,message:U,ref:i,...D(Dn.pattern,U)},!r))return N(U),C}if(y){if(Hn(y)){const M=await y(x,t),U=Mv(M,w);if(U&&(C[v]={...U,...D(Dn.validate,U.message)},!r))return N(U.message),C}else if(wt(y)){let M={};for(const U in y){if(!ur(M)&&!r)break;const $=Mv(await y[U](x,t),w,U);$&&(M={...$,...D(U,$.message)},N($.message),r&&(C[v]=M))}if(!ur(M)&&(C[v]={ref:w,...M},!r))return C}}return N(!0),C};function XR(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=xt(e)?n++:e[t[n++]];return e}function JR(e){for(const t in e)if(e.hasOwnProperty(t)&&!xt(e[t]))return!1;return!0}function jt(e,t){const r=Array.isArray(t)?t:tg(t)?[t]:p1(t),n=r.length===1?e:XR(e,r),a=r.length-1,i=r[a];return n&&delete n[i],a!==0&&(wt(n)&&ur(n)||Array.isArray(n)&&JR(n))&&jt(e,r.slice(0,-1)),e}var Ff=()=>{let e=[];return{get observers(){return e},next:a=>{for(const i of e)i.next&&i.next(a)},subscribe:a=>(e.push(a),{unsubscribe:()=>{e=e.filter(i=>i!==a)}}),unsubscribe:()=>{e=[]}}},gh=e=>Xt(e)||!h1(e);function js(e,t){if(gh(e)||gh(t))return e===t;if(va(e)&&va(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const a of r){const i=e[a];if(!n.includes(a))return!1;if(a!=="ref"){const o=t[a];if(va(i)&&va(o)||wt(i)&&wt(o)||Array.isArray(i)&&Array.isArray(o)?!js(i,o):i!==o)return!1}}return!0}var y1=e=>e.type==="select-multiple",e4=e=>ng(e)||Ul(e),Lf=e=>bu(e)&&e.isConnected,w1=e=>{for(const t in e)if(Hn(e[t]))return!0;return!1};function Nu(e,t={}){const r=Array.isArray(e);if(wt(e)||r)for(const n in e)Array.isArray(e[n])||wt(e[n])&&!w1(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Nu(e[n],t[n])):Xt(e[n])||(t[n]=!0);return t}function b1(e,t,r){const n=Array.isArray(e);if(wt(e)||n)for(const a in e)Array.isArray(e[a])||wt(e[a])&&!w1(e[a])?xt(t)||gh(r[a])?r[a]=Array.isArray(e[a])?Nu(e[a],[]):{...Nu(e[a])}:b1(e[a],Xt(t)?{}:t[a],r[a]):r[a]=!js(e[a],t[a]);return r}var So=(e,t)=>b1(e,t,Nu(t)),j1=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>xt(e)?e:t?e===""?NaN:e&&+e:r&&_n(e)?new Date(e):n?n(e):e;function $f(e){const t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return rg(t)?t.files:ng(t)?v1(e.refs).value:y1(t)?[...t.selectedOptions].map(({value:r})=>r):Ul(t)?x1(e.refs).value:j1(xt(t.value)?e.ref.value:t.value,e)}var t4=(e,t,r,n)=>{const a={};for(const i of e){const o=ie(t,i);o&&Ye(a,i,o._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}},_o=e=>xt(e)?e:ju(e)?e.source:wt(e)?ju(e.value)?e.value.source:e.value:e;const Dv="AsyncFunction";var r4=e=>(!e||!e.validate)&&!!(Hn(e.validate)&&e.validate.constructor.name===Dv||wt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Dv)),n4=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Fv(e,t,r){const n=ie(e,r);if(n||tg(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const i=a.join("."),o=ie(t,i),l=ie(e,i);if(o&&!Array.isArray(o)&&r!==i)return{name:r};if(l&&l.type)return{name:i,error:l};a.pop()}return{name:r}}var s4=(e,t,r,n,a)=>a.isOnAll?!1:!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:(r?n.isOnChange:a.isOnChange)?e:!0,a4=(e,t)=>!jd(ie(e,t)).length&&jt(e,t);const i4={mode:en.onSubmit,reValidateMode:en.onChange,shouldFocusError:!0};function o4(e={}){let t={...i4,...e},r={submitCount:0,isDirty:!1,isLoading:Hn(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},a=wt(t.defaultValues)||wt(t.values)?Ar(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:Ar(a),o={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const h={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},f={values:Ff(),array:Ff(),state:Ff()},m=Tv(t.mode),y=Tv(t.reValidateMode),v=t.criteriaMode===en.all,p=S=>R=>{clearTimeout(u),u=setTimeout(S,R)},b=async S=>{if(!e.disabled&&(h.isValid||S)){const R=t.resolver?ur((await P()).errors):await D(n,!0);R!==r.isValid&&f.state.next({isValid:R})}},g=(S,R)=>{!e.disabled&&(h.isValidating||h.validatingFields)&&((S||Array.from(l.mount)).forEach(L=>{L&&(R?Ye(r.validatingFields,L,R):jt(r.validatingFields,L))}),f.state.next({validatingFields:r.validatingFields,isValidating:!ur(r.validatingFields)}))},x=(S,R=[],L,J,Z=!0,B=!0)=>{if(J&&L&&!e.disabled){if(o.action=!0,B&&Array.isArray(ie(n,S))){const me=L(ie(n,S),J.argA,J.argB);Z&&Ye(n,S,me)}if(B&&Array.isArray(ie(r.errors,S))){const me=L(ie(r.errors,S),J.argA,J.argB);Z&&Ye(r.errors,S,me),a4(r.errors,S)}if(h.touchedFields&&B&&Array.isArray(ie(r.touchedFields,S))){const me=L(ie(r.touchedFields,S),J.argA,J.argB);Z&&Ye(r.touchedFields,S,me)}h.dirtyFields&&(r.dirtyFields=So(a,i)),f.state.next({name:S,isDirty:M(S,R),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Ye(i,S,R)},w=(S,R)=>{Ye(r.errors,S,R),f.state.next({errors:r.errors})},N=S=>{r.errors=S,f.state.next({errors:r.errors,isValid:!1})},C=(S,R,L,J)=>{const Z=ie(n,S);if(Z){const B=ie(i,S,xt(L)?ie(a,S):L);xt(B)||J&&J.defaultChecked||R?Ye(i,S,R?B:$f(Z._f)):G(S,B),o.mount&&b()}},k=(S,R,L,J,Z)=>{let B=!1,me=!1;const je={name:S};if(!e.disabled){const et=!!(ie(n,S)&&ie(n,S)._f&&ie(n,S)._f.disabled);if(!L||J){h.isDirty&&(me=r.isDirty,r.isDirty=je.isDirty=M(),B=me!==je.isDirty);const Ge=et||js(ie(a,S),R);me=!!(!et&&ie(r.dirtyFields,S)),Ge||et?jt(r.dirtyFields,S):Ye(r.dirtyFields,S,!0),je.dirtyFields=r.dirtyFields,B=B||h.dirtyFields&&me!==!Ge}if(L){const Ge=ie(r.touchedFields,S);Ge||(Ye(r.touchedFields,S,L),je.touchedFields=r.touchedFields,B=B||h.touchedFields&&Ge!==L)}B&&Z&&f.state.next(je)}return B?je:{}},T=(S,R,L,J)=>{const Z=ie(r.errors,S),B=h.isValid&&gn(R)&&r.isValid!==R;if(e.delayError&&L?(c=p(()=>w(S,L)),c(e.delayError)):(clearTimeout(u),c=null,L?Ye(r.errors,S,L):jt(r.errors,S)),(L?!js(Z,L):Z)||!ur(J)||B){const me={...J,...B&&gn(R)?{isValid:R}:{},errors:r.errors,name:S};r={...r,...me},f.state.next(me)}},P=async S=>{g(S,!0);const R=await t.resolver(i,t.context,t4(S||l.mount,n,t.criteriaMode,t.shouldUseNativeValidation));return g(S),R},I=async S=>{const{errors:R}=await P(S);if(S)for(const L of S){const J=ie(R,L);J?Ye(r.errors,L,J):jt(r.errors,L)}else r.errors=R;return R},D=async(S,R,L={valid:!0})=>{for(const J in S){const Z=S[J];if(Z){const{_f:B,...me}=Z;if(B){const je=l.array.has(B.name),et=Z._f&&r4(Z._f);et&&h.validatingFields&&g([J],!0);const Ge=await Ov(Z,i,v,t.shouldUseNativeValidation&&!R,je);if(et&&h.validatingFields&&g([J]),Ge[B.name]&&(L.valid=!1,R))break;!R&&(ie(Ge,B.name)?je?ZR(r.errors,Ge,B.name):Ye(r.errors,B.name,Ge[B.name]):jt(r.errors,B.name))}!ur(me)&&await D(me,R,L)}}return L.valid},E=()=>{for(const S of l.unMount){const R=ie(n,S);R&&(R._f.refs?R._f.refs.every(L=>!Lf(L)):!Lf(R._f.ref))&&ye(S)}l.unMount=new Set},M=(S,R)=>!e.disabled&&(S&&R&&Ye(i,S,R),!js(K(),a)),U=(S,R,L)=>YR(S,l,{...o.mount?i:xt(R)?a:_n(S)?{[S]:R}:R},L,R),$=S=>jd(ie(o.mount?i:a,S,e.shouldUnregister?ie(a,S,[]):[])),G=(S,R,L={})=>{const J=ie(n,S);let Z=R;if(J){const B=J._f;B&&(!B.disabled&&Ye(i,S,j1(R,B)),Z=bu(B.ref)&&Xt(R)?"":R,y1(B.ref)?[...B.ref.options].forEach(me=>me.selected=Z.includes(me.value)):B.refs?Ul(B.ref)?B.refs.length>1?B.refs.forEach(me=>(!me.defaultChecked||!me.disabled)&&(me.checked=Array.isArray(Z)?!!Z.find(je=>je===me.value):Z===me.value)):B.refs[0]&&(B.refs[0].checked=!!Z):B.refs.forEach(me=>me.checked=me.value===Z):rg(B.ref)?B.ref.value="":(B.ref.value=Z,B.ref.type||f.values.next({name:S,values:{...i}})))}(L.shouldDirty||L.shouldTouch)&&k(S,Z,L.shouldTouch,L.shouldDirty,!0),L.shouldValidate&&Y(S)},F=(S,R,L)=>{for(const J in R){const Z=R[J],B=`${S}.${J}`,me=ie(n,B);(l.array.has(S)||wt(Z)||me&&!me._f)&&!va(Z)?F(B,Z,L):G(B,Z,L)}},X=(S,R,L={})=>{const J=ie(n,S),Z=l.array.has(S),B=Ar(R);Ye(i,S,B),Z?(f.array.next({name:S,values:{...i}}),(h.isDirty||h.dirtyFields)&&L.shouldDirty&&f.state.next({name:S,dirtyFields:So(a,i),isDirty:M(S,B)})):J&&!J._f&&!Xt(B)?F(S,B,L):G(S,B,L),Pv(S,l)&&f.state.next({...r}),f.values.next({name:o.mount?S:void 0,values:{...i}})},A=async S=>{o.mount=!0;const R=S.target;let L=R.name,J=!0;const Z=ie(n,L),B=()=>R.type?$f(Z._f):BR(S),me=je=>{J=Number.isNaN(je)||va(je)&&isNaN(je.getTime())||js(je,ie(i,L,je))};if(Z){let je,et;const Ge=B(),xr=S.type===kv.BLUR||S.type===kv.FOCUS_OUT,Tr=!n4(Z._f)&&!t.resolver&&!ie(r.errors,L)&&!Z._f.deps||s4(xr,ie(r.touchedFields,L),r.isSubmitted,y,m),un=Pv(L,l,xr);Ye(i,L,Ge),xr?(Z._f.onBlur&&Z._f.onBlur(S),c&&c(0)):Z._f.onChange&&Z._f.onChange(S);const Mn=k(L,Ge,xr,!1),Hr=!ur(Mn)||un;if(!xr&&f.values.next({name:L,type:S.type,values:{...i}}),Tr)return h.isValid&&(e.mode==="onBlur"?xr&&b():b()),Hr&&f.state.next({name:L,...un?{}:Mn});if(!xr&&un&&f.state.next({...r}),t.resolver){const{errors:dn}=await P([L]);if(me(Ge),J){const fo=Fv(r.errors,n,L),fn=Fv(dn,n,fo.name||L);je=fn.error,L=fn.name,et=ur(dn)}}else g([L],!0),je=(await Ov(Z,i,v,t.shouldUseNativeValidation))[L],g([L]),me(Ge),J&&(je?et=!1:h.isValid&&(et=await D(n,!0)));J&&(Z._f.deps&&Y(Z._f.deps),T(L,et,je,Mn))}},O=(S,R)=>{if(ie(r.errors,R)&&S.focus)return S.focus(),1},Y=async(S,R={})=>{let L,J;const Z=$c(S);if(t.resolver){const B=await I(xt(S)?S:Z);L=ur(B),J=S?!Z.some(me=>ie(B,me)):L}else S?(J=(await Promise.all(Z.map(async B=>{const me=ie(n,B);return await D(me&&me._f?{[B]:me}:me)}))).every(Boolean),!(!J&&!r.isValid)&&b()):J=L=await D(n);return f.state.next({...!_n(S)||h.isValid&&L!==r.isValid?{}:{name:S},...t.resolver||!S?{isValid:L}:{},errors:r.errors}),R.shouldFocus&&!J&&Qo(n,O,S?Z:l.mount),J},K=S=>{const R={...o.mount?i:a};return xt(S)?R:_n(S)?ie(R,S):S.map(L=>ie(R,L))},te=(S,R)=>({invalid:!!ie((R||r).errors,S),isDirty:!!ie((R||r).dirtyFields,S),error:ie((R||r).errors,S),isValidating:!!ie(r.validatingFields,S),isTouched:!!ie((R||r).touchedFields,S)}),ge=S=>{S&&$c(S).forEach(R=>jt(r.errors,R)),f.state.next({errors:S?r.errors:{}})},ke=(S,R,L)=>{const J=(ie(n,S,{_f:{}})._f||{}).ref,Z=ie(r.errors,S)||{},{ref:B,message:me,type:je,...et}=Z;Ye(r.errors,S,{...et,...R,ref:J}),f.state.next({name:S,errors:r.errors,isValid:!1}),L&&L.shouldFocus&&J&&J.focus&&J.focus()},Ze=(S,R)=>Hn(S)?f.values.subscribe({next:L=>S(U(void 0,R),L)}):U(S,R,!0),ye=(S,R={})=>{for(const L of S?$c(S):l.mount)l.mount.delete(L),l.array.delete(L),R.keepValue||(jt(n,L),jt(i,L)),!R.keepError&&jt(r.errors,L),!R.keepDirty&&jt(r.dirtyFields,L),!R.keepTouched&&jt(r.touchedFields,L),!R.keepIsValidating&&jt(r.validatingFields,L),!t.shouldUnregister&&!R.keepDefaultValue&&jt(a,L);f.values.next({values:{...i}}),f.state.next({...r,...R.keepDirty?{isDirty:M()}:{}}),!R.keepIsValid&&b()},ae=({disabled:S,name:R,field:L,fields:J,value:Z})=>{if(gn(S)&&o.mount||S){const B=S?void 0:xt(Z)?$f(L?L._f:ie(J,R)._f):Z;Ye(i,R,B),k(R,B,!1,!1,!0)}},Se=(S,R={})=>{let L=ie(n,S);const J=gn(R.disabled)||gn(e.disabled);return Ye(n,S,{...L||{},_f:{...L&&L._f?L._f:{ref:{name:S}},name:S,mount:!0,...R}}),l.mount.add(S),L?ae({field:L,disabled:gn(R.disabled)?R.disabled:e.disabled,name:S,value:R.value}):C(S,!0,R.value),{...J?{disabled:R.disabled||e.disabled}:{},...t.progressive?{required:!!R.required,min:_o(R.min),max:_o(R.max),minLength:_o(R.minLength),maxLength:_o(R.maxLength),pattern:_o(R.pattern)}:{},name:S,onChange:A,onBlur:A,ref:Z=>{if(Z){Se(S,R),L=ie(n,S);const B=xt(Z.value)&&Z.querySelectorAll&&Z.querySelectorAll("input,select,textarea")[0]||Z,me=e4(B),je=L._f.refs||[];if(me?je.find(et=>et===B):B===L._f.ref)return;Ye(n,S,{_f:{...L._f,...me?{refs:[...je.filter(Lf),B,...Array.isArray(ie(a,S))?[{}]:[]],ref:{type:B.type,name:S}}:{ref:B}}}),C(S,!1,void 0,B)}else L=ie(n,S,{}),L._f&&(L._f.mount=!1),(t.shouldUnregister||R.shouldUnregister)&&!(WR(l.array,S)&&o.action)&&l.unMount.add(S)}}},Pe=()=>t.shouldFocusError&&Qo(n,O,l.mount),Ne=S=>{gn(S)&&(f.state.next({disabled:S}),Qo(n,(R,L)=>{const J=ie(n,L);J&&(R.disabled=J._f.disabled||S,Array.isArray(J._f.refs)&&J._f.refs.forEach(Z=>{Z.disabled=J._f.disabled||S}))},0,!1))},Ie=(S,R)=>async L=>{let J;L&&(L.preventDefault&&L.preventDefault(),L.persist&&L.persist());let Z=Ar(i);if(f.state.next({isSubmitting:!0}),t.resolver){const{errors:B,values:me}=await P();r.errors=B,Z=me}else await D(n);if(jt(r.errors,"root"),ur(r.errors)){f.state.next({errors:{}});try{await S(Z,L)}catch(B){J=B}}else R&&await R({...r.errors},L),Pe(),setTimeout(Pe);if(f.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ur(r.errors)&&!J,submitCount:r.submitCount+1,errors:r.errors}),J)throw J},fe=(S,R={})=>{ie(n,S)&&(xt(R.defaultValue)?X(S,Ar(ie(a,S))):(X(S,R.defaultValue),Ye(a,S,Ar(R.defaultValue))),R.keepTouched||jt(r.touchedFields,S),R.keepDirty||(jt(r.dirtyFields,S),r.isDirty=R.defaultValue?M(S,Ar(ie(a,S))):M()),R.keepError||(jt(r.errors,S),h.isValid&&b()),f.state.next({...r}))},We=(S,R={})=>{const L=S?Ar(S):a,J=Ar(L),Z=ur(S),B=Z?a:J;if(R.keepDefaultValues||(a=L),!R.keepValues){if(R.keepDirtyValues){const me=new Set([...l.mount,...Object.keys(So(a,i))]);for(const je of Array.from(me))ie(r.dirtyFields,je)?Ye(B,je,ie(i,je)):X(je,ie(B,je))}else{if(eg&&xt(S))for(const me of l.mount){const je=ie(n,me);if(je&&je._f){const et=Array.isArray(je._f.refs)?je._f.refs[0]:je._f.ref;if(bu(et)){const Ge=et.closest("form");if(Ge){Ge.reset();break}}}}n={}}i=e.shouldUnregister?R.keepDefaultValues?Ar(a):{}:Ar(B),f.array.next({values:{...B}}),f.values.next({values:{...B}})}l={mount:R.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!h.isValid||!!R.keepIsValid||!!R.keepDirtyValues,o.watch=!!e.shouldUnregister,f.state.next({submitCount:R.keepSubmitCount?r.submitCount:0,isDirty:Z?!1:R.keepDirty?r.isDirty:!!(R.keepDefaultValues&&!js(S,a)),isSubmitted:R.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:Z?{}:R.keepDirtyValues?R.keepDefaultValues&&i?So(a,i):r.dirtyFields:R.keepDefaultValues&&S?So(a,S):R.keepDirty?r.dirtyFields:{},touchedFields:R.keepTouched?r.touchedFields:{},errors:R.keepErrors?r.errors:{},isSubmitSuccessful:R.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},_t=(S,R)=>We(Hn(S)?S(i):S,R);return{control:{register:Se,unregister:ye,getFieldState:te,handleSubmit:Ie,setError:ke,_executeSchema:P,_getWatch:U,_getDirty:M,_updateValid:b,_removeUnmounted:E,_updateFieldArray:x,_updateDisabledField:ae,_getFieldArray:$,_reset:We,_resetDefaultValues:()=>Hn(t.defaultValues)&&t.defaultValues().then(S=>{_t(S,t.resetOptions),f.state.next({isLoading:!1})}),_updateFormState:S=>{r={...r,...S}},_disableForm:Ne,_subjects:f,_proxyFormState:h,_setErrors:N,get _fields(){return n},get _formValues(){return i},get _state(){return o},set _state(S){o=S},get _defaultValues(){return a},get _names(){return l},set _names(S){l=S},get _formState(){return r},set _formState(S){r=S},get _options(){return t},set _options(S){t={...t,...S}}},trigger:Y,register:Se,handleSubmit:Ie,watch:Ze,setValue:X,getValues:K,reset:_t,resetField:fe,clearErrors:ge,unregister:ye,setError:ke,setFocus:(S,R={})=>{const L=ie(n,S),J=L&&L._f;if(J){const Z=J.refs?J.refs[0]:J.ref;Z.focus&&(Z.focus(),R.shouldSelect&&Z.select())}},getFieldState:te}}function l4(e={}){const t=z.useRef(),r=z.useRef(),[n,a]=z.useState({isDirty:!1,isValidating:!1,isLoading:Hn(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Hn(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...o4(e),formState:n});const i=t.current.control;return i._options=e,QR({subject:i._subjects.state,next:o=>{GR(o,i._proxyFormState,i._updateFormState)&&a({...i._formState})}}),z.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),z.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==n.isDirty&&i._subjects.state.next({isDirty:o})}},[i,n.isDirty]),z.useEffect(()=>{e.values&&!js(e.values,r.current)?(i._reset(e.values,i._options.resetOptions),r.current=e.values,a(o=>({...o}))):i._resetDefaultValues()},[e.values,i]),z.useEffect(()=>{e.errors&&i._setErrors(e.errors)},[e.errors,i]),z.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),z.useEffect(()=>{e.shouldUnregister&&i._subjects.values.next({values:i._getWatch()})},[e.shouldUnregister,i]),z.useEffect(()=>{t.current&&(t.current.watch=t.current.watch.bind({}))},[n]),t.current.formState=KR(n,i),t.current}const Lv=(e,t,r)=>{if(e&&"reportValidity"in e){const n=ie(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},N1=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Lv(n.ref,r,e):n.refs&&n.refs.forEach(a=>Lv(a,r,e))}},c4=(e,t)=>{t.shouldUseNativeValidation&&N1(e,t);const r={};for(const n in e){const a=ie(t.fields,n),i=Object.assign(e[n]||{},{ref:a&&a.ref});if(u4(t.names||Object.keys(e),n)){const o=Object.assign({},ie(r,n));Ye(o,"root",i),Ye(r,n,o)}else Ye(r,n,i)}return r},u4=(e,t)=>e.some(r=>r.startsWith(t+"."));var d4=function(e,t){for(var r={};e.length;){var n=e[0],a=n.code,i=n.message,o=n.path.join(".");if(!r[o])if("unionErrors"in n){var l=n.unionErrors[0].errors[0];r[o]={message:l.message,type:l.code}}else r[o]={message:i,type:a};if("unionErrors"in n&&n.unionErrors.forEach(function(h){return h.errors.forEach(function(f){return e.push(f)})}),t){var c=r[o].types,u=c&&c[n.code];r[o]=g1(o,t,r,a,u?[].concat(u,n.message):n.message)}e.shift()}return r},f4=function(e,t,r){return r===void 0&&(r={}),function(n,a,i){try{return Promise.resolve(function(o,l){try{var c=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(u){return i.shouldUseNativeValidation&&N1({},i),{errors:{},values:r.raw?n:u}})}catch(u){return l(u)}return c&&c.then?c.then(void 0,l):c}(0,function(o){if(function(l){return Array.isArray(l==null?void 0:l.errors)}(o))return{values:{},errors:c4(d4(o.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw o}))}catch(o){return Promise.reject(o)}}},ze;(function(e){e.assertEqual=a=>a;function t(a){}e.assertIs=t;function r(a){throw new Error}e.assertNever=r,e.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},e.getValidEnumValues=a=>{const i=e.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),o={};for(const l of i)o[l]=a[l];return e.objectValues(o)},e.objectValues=a=>e.objectKeys(a).map(function(i){return a[i]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},e.find=(a,i)=>{for(const o of a)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(ze||(ze={}));var $v;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})($v||($v={}));const se=ze.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ma=e=>{switch(typeof e){case"undefined":return se.undefined;case"string":return se.string;case"number":return isNaN(e)?se.nan:se.number;case"boolean":return se.boolean;case"function":return se.function;case"bigint":return se.bigint;case"symbol":return se.symbol;case"object":return Array.isArray(e)?se.array:e===null?se.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?se.promise:typeof Map<"u"&&e instanceof Map?se.map:typeof Set<"u"&&e instanceof Set?se.set:typeof Date<"u"&&e instanceof Date?se.date:se.object;default:return se.unknown}},q=ze.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Ur extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const r=t||function(i){return i.message},n={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let l=n,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(r(o))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}};return a(this),n}static assert(t){if(!(t instanceof Ur))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ze.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r={},n=[];for(const a of this.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Ur.create=e=>new Ur(e);const wl=(e,t)=>{let r;switch(e.code){case q.invalid_type:e.received===se.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case q.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,ze.jsonStringifyReplacer)}`;break;case q.unrecognized_keys:r=`Unrecognized key(s) in object: ${ze.joinValues(e.keys,", ")}`;break;case q.invalid_union:r="Invalid input";break;case q.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ze.joinValues(e.options)}`;break;case q.invalid_enum_value:r=`Invalid enum value. Expected ${ze.joinValues(e.options)}, received '${e.received}'`;break;case q.invalid_arguments:r="Invalid function arguments";break;case q.invalid_return_type:r="Invalid function return type";break;case q.invalid_date:r="Invalid date";break;case q.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:ze.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case q.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case q.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case q.custom:r="Invalid input";break;case q.invalid_intersection_types:r="Intersection results could not be merged";break;case q.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case q.not_finite:r="Number must be finite";break;default:r=t.defaultError,ze.assertNever(e)}return{message:r}};let m4=wl;function xh(){return m4}const vh=e=>{const{data:t,path:r,errorMaps:n,issueData:a}=e,i=[...r,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let l="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)l=u(o,{data:t,defaultError:l}).message;return{...a,path:i,message:l}};function ee(e,t){const r=xh(),n=vh({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===wl?void 0:wl].filter(a=>!!a)});e.common.issues.push(n)}class tr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const a of r){if(a.status==="aborted")return be;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const a of r){const i=await a.key,o=await a.value;n.push({key:i,value:o})}return tr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const a of r){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return be;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[i.value]=o.value)}return{status:t.value,value:n}}}const be=Object.freeze({status:"aborted"}),Io=e=>({status:"dirty",value:e}),gr=e=>({status:"valid",value:e}),Uv=e=>e.status==="aborted",zv=e=>e.status==="dirty",Cu=e=>e.status==="valid",Su=e=>typeof Promise<"u"&&e instanceof Promise;function _u(e,t,r,n){if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function C1(e,t,r,n,a){if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var de;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(de||(de={}));var Mo,Oo;class Pn{constructor(t,r,n,a){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Vv=(e,t)=>{if(Cu(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Ur(e.common.issues);return this._error=r,this._error}}};function _e(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:a}:{errorMap:(o,l)=>{var c,u;const{message:h}=e;return o.code==="invalid_enum_value"?{message:h??l.defaultError}:typeof l.data>"u"?{message:(c=h??n)!==null&&c!==void 0?c:l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:(u=h??r)!==null&&u!==void 0?u:l.defaultError}},description:a}}class Me{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return ma(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:ma(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new tr,ctx:{common:t.parent.common,data:t.data,parsedType:ma(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(Su(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;const a={common:{issues:[],async:(n=r==null?void 0:r.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ma(t)},i=this._parseSync({data:t,path:a.path,parent:a});return Vv(a,i)}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:ma(t)},a=this._parse({data:t,path:n.path,parent:n}),i=await(Su(a)?a:Promise.resolve(a));return Vv(n,i)}refine(t,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,i)=>{const o=t(a),l=()=>i.addIssue({code:q.custom,...n(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(t,r){return this._refinement((n,a)=>t(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(t){return new as({schema:this,typeName:we.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Yn.create(this,this._def)}nullable(){return La.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Tn.create(this,this._def)}promise(){return jl.create(this,this._def)}or(t){return Tu.create([this,t],this._def)}and(t){return Pu.create(this,t,this._def)}transform(t){return new as({..._e(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new Ou({..._e(this._def),innerType:this,defaultValue:r,typeName:we.ZodDefault})}brand(){return new k1({typeName:we.ZodBranded,type:this,..._e(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new Du({..._e(this._def),innerType:this,catchValue:r,typeName:we.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Nd.create(this,t)}readonly(){return Fu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const h4=/^c[^\s-]{8,}$/i,p4=/^[0-9a-z]+$/,g4=/^[0-9A-HJKMNP-TV-Z]{26}$/,x4=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,v4=/^[a-z0-9_-]{21}$/i,y4=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,w4=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,b4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Uf;const j4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,N4=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,C4=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,S1="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",S4=new RegExp(`^${S1}$`);function _1(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function _4(e){return new RegExp(`^${_1(e)}$`)}function E4(e){let t=`${S1}T${_1(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function k4(e,t){return!!((t==="v4"||!t)&&j4.test(e)||(t==="v6"||!t)&&N4.test(e))}class Wn extends Me{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==se.string){const i=this._getOrReturnCtx(t);return ee(i,{code:q.invalid_type,expected:se.string,received:i.parsedType}),be}const n=new tr;let a;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(a=this._getOrReturnCtx(t,a),ee(a,{code:q.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(a=this._getOrReturnCtx(t,a),ee(a,{code:q.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,l=t.data.length<i.value;(o||l)&&(a=this._getOrReturnCtx(t,a),o?ee(a,{code:q.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&ee(a,{code:q.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")w4.test(t.data)||(a=this._getOrReturnCtx(t,a),ee(a,{validation:"email",code:q.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Uf||(Uf=new RegExp(b4,"u")),Uf.test(t.data)||(a=this._getOrReturnCtx(t,a),ee(a,{validation:"emoji",code:q.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")x4.test(t.data)||(a=this._getOrReturnCtx(t,a),ee(a,{validation:"uuid",code:q.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")v4.test(t.data)||(a=this._getOrReturnCtx(t,a),ee(a,{validation:"nanoid",code:q.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")h4.test(t.data)||(a=this._getOrReturnCtx(t,a),ee(a,{validation:"cuid",code:q.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")p4.test(t.data)||(a=this._getOrReturnCtx(t,a),ee(a,{validation:"cuid2",code:q.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")g4.test(t.data)||(a=this._getOrReturnCtx(t,a),ee(a,{validation:"ulid",code:q.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),ee(a,{validation:"url",code:q.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),ee(a,{validation:"regex",code:q.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(t,a),ee(a,{code:q.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(a=this._getOrReturnCtx(t,a),ee(a,{code:q.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(a=this._getOrReturnCtx(t,a),ee(a,{code:q.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?E4(i).test(t.data)||(a=this._getOrReturnCtx(t,a),ee(a,{code:q.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?S4.test(t.data)||(a=this._getOrReturnCtx(t,a),ee(a,{code:q.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?_4(i).test(t.data)||(a=this._getOrReturnCtx(t,a),ee(a,{code:q.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?y4.test(t.data)||(a=this._getOrReturnCtx(t,a),ee(a,{validation:"duration",code:q.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?k4(t.data,i.version)||(a=this._getOrReturnCtx(t,a),ee(a,{validation:"ip",code:q.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?C4.test(t.data)||(a=this._getOrReturnCtx(t,a),ee(a,{validation:"base64",code:q.invalid_string,message:i.message}),n.dirty()):ze.assertNever(i);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(a=>t.test(a),{validation:r,code:q.invalid_string,...de.errToObj(n)})}_addCheck(t){return new Wn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...de.errToObj(t)})}url(t){return this._addCheck({kind:"url",...de.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...de.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...de.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...de.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...de.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...de.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...de.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...de.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...de.errToObj(t)})}datetime(t){var r,n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(r=t==null?void 0:t.offset)!==null&&r!==void 0?r:!1,local:(n=t==null?void 0:t.local)!==null&&n!==void 0?n:!1,...de.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...de.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...de.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...de.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...de.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...de.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...de.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...de.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...de.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...de.errToObj(r)})}nonempty(t){return this.min(1,de.errToObj(t))}trim(){return new Wn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Wn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Wn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Wn.create=e=>{var t;return new Wn({checks:[],typeName:we.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,..._e(e)})};function T4(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,i=parseInt(e.toFixed(a).replace(".","")),o=parseInt(t.toFixed(a).replace(".",""));return i%o/Math.pow(10,a)}class Qi extends Me{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==se.number){const i=this._getOrReturnCtx(t);return ee(i,{code:q.invalid_type,expected:se.number,received:i.parsedType}),be}let n;const a=new tr;for(const i of this._def.checks)i.kind==="int"?ze.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ee(n,{code:q.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:q.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:q.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?T4(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),ee(n,{code:q.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ee(n,{code:q.not_finite,message:i.message}),a.dirty()):ze.assertNever(i);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,de.toString(r))}gt(t,r){return this.setLimit("min",t,!1,de.toString(r))}lte(t,r){return this.setLimit("max",t,!0,de.toString(r))}lt(t,r){return this.setLimit("max",t,!1,de.toString(r))}setLimit(t,r,n,a){return new Qi({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:de.toString(a)}]})}_addCheck(t){return new Qi({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:de.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:de.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:de.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:de.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:de.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ze.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}}Qi.create=e=>new Qi({checks:[],typeName:we.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,..._e(e)});class Yi extends Me{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==se.bigint){const i=this._getOrReturnCtx(t);return ee(i,{code:q.invalid_type,expected:se.bigint,received:i.parsedType}),be}let n;const a=new tr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:q.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:q.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ee(n,{code:q.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):ze.assertNever(i);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,de.toString(r))}gt(t,r){return this.setLimit("min",t,!1,de.toString(r))}lte(t,r){return this.setLimit("max",t,!0,de.toString(r))}lt(t,r){return this.setLimit("max",t,!1,de.toString(r))}setLimit(t,r,n,a){return new Yi({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:de.toString(a)}]})}_addCheck(t){return new Yi({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:de.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:de.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:de.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:de.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:de.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}}Yi.create=e=>{var t;return new Yi({checks:[],typeName:we.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,..._e(e)})};class yh extends Me{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==se.boolean){const n=this._getOrReturnCtx(t);return ee(n,{code:q.invalid_type,expected:se.boolean,received:n.parsedType}),be}return gr(t.data)}}yh.create=e=>new yh({typeName:we.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,..._e(e)});class bl extends Me{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==se.date){const i=this._getOrReturnCtx(t);return ee(i,{code:q.invalid_type,expected:se.date,received:i.parsedType}),be}if(isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return ee(i,{code:q.invalid_date}),be}const n=new tr;let a;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(a=this._getOrReturnCtx(t,a),ee(a,{code:q.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(a=this._getOrReturnCtx(t,a),ee(a,{code:q.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):ze.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new bl({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:de.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:de.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}}bl.create=e=>new bl({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:we.ZodDate,..._e(e)});class wh extends Me{_parse(t){if(this._getType(t)!==se.symbol){const n=this._getOrReturnCtx(t);return ee(n,{code:q.invalid_type,expected:se.symbol,received:n.parsedType}),be}return gr(t.data)}}wh.create=e=>new wh({typeName:we.ZodSymbol,..._e(e)});class Eu extends Me{_parse(t){if(this._getType(t)!==se.undefined){const n=this._getOrReturnCtx(t);return ee(n,{code:q.invalid_type,expected:se.undefined,received:n.parsedType}),be}return gr(t.data)}}Eu.create=e=>new Eu({typeName:we.ZodUndefined,..._e(e)});class ku extends Me{_parse(t){if(this._getType(t)!==se.null){const n=this._getOrReturnCtx(t);return ee(n,{code:q.invalid_type,expected:se.null,received:n.parsedType}),be}return gr(t.data)}}ku.create=e=>new ku({typeName:we.ZodNull,..._e(e)});class bh extends Me{constructor(){super(...arguments),this._any=!0}_parse(t){return gr(t.data)}}bh.create=e=>new bh({typeName:we.ZodAny,..._e(e)});class Si extends Me{constructor(){super(...arguments),this._unknown=!0}_parse(t){return gr(t.data)}}Si.create=e=>new Si({typeName:we.ZodUnknown,..._e(e)});class Qs extends Me{_parse(t){const r=this._getOrReturnCtx(t);return ee(r,{code:q.invalid_type,expected:se.never,received:r.parsedType}),be}}Qs.create=e=>new Qs({typeName:we.ZodNever,..._e(e)});class jh extends Me{_parse(t){if(this._getType(t)!==se.undefined){const n=this._getOrReturnCtx(t);return ee(n,{code:q.invalid_type,expected:se.void,received:n.parsedType}),be}return gr(t.data)}}jh.create=e=>new jh({typeName:we.ZodVoid,..._e(e)});class Tn extends Me{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==se.array)return ee(r,{code:q.invalid_type,expected:se.array,received:r.parsedType}),be;if(a.exactLength!==null){const o=r.data.length>a.exactLength.value,l=r.data.length<a.exactLength.value;(o||l)&&(ee(r,{code:o?q.too_big:q.too_small,minimum:l?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(ee(r,{code:q.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(ee(r,{code:q.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,l)=>a.type._parseAsync(new Pn(r,o,r.path,l)))).then(o=>tr.mergeArray(n,o));const i=[...r.data].map((o,l)=>a.type._parseSync(new Pn(r,o,r.path,l)));return tr.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new Tn({...this._def,minLength:{value:t,message:de.toString(r)}})}max(t,r){return new Tn({...this._def,maxLength:{value:t,message:de.toString(r)}})}length(t,r){return new Tn({...this._def,exactLength:{value:t,message:de.toString(r)}})}nonempty(t){return this.min(1,t)}}Tn.create=(e,t)=>new Tn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,..._e(t)});function ei(e){if(e instanceof ft){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Yn.create(ei(n))}return new ft({...e._def,shape:()=>t})}else return e instanceof Tn?new Tn({...e._def,type:ei(e.element)}):e instanceof Yn?Yn.create(ei(e.unwrap())):e instanceof La?La.create(ei(e.unwrap())):e instanceof ss?ss.create(e.items.map(t=>ei(t))):e}class ft extends Me{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=ze.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==se.object){const u=this._getOrReturnCtx(t);return ee(u,{code:q.invalid_type,expected:se.object,received:u.parsedType}),be}const{status:n,ctx:a}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof Qs&&this._def.unknownKeys==="strip"))for(const u in a.data)o.includes(u)||l.push(u);const c=[];for(const u of o){const h=i[u],f=a.data[u];c.push({key:{status:"valid",value:u},value:h._parse(new Pn(a,f,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof Qs){const u=this._def.unknownKeys;if(u==="passthrough")for(const h of l)c.push({key:{status:"valid",value:h},value:{status:"valid",value:a.data[h]}});else if(u==="strict")l.length>0&&(ee(a,{code:q.unrecognized_keys,keys:l}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const h of l){const f=a.data[h];c.push({key:{status:"valid",value:h},value:u._parse(new Pn(a,f,a.path,h)),alwaysSet:h in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const u=[];for(const h of c){const f=await h.key,m=await h.value;u.push({key:f,value:m,alwaysSet:h.alwaysSet})}return u}).then(u=>tr.mergeObjectSync(n,u)):tr.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(t){return de.errToObj,new ft({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var a,i,o,l;const c=(o=(i=(a=this._def).errorMap)===null||i===void 0?void 0:i.call(a,r,n).message)!==null&&o!==void 0?o:n.defaultError;return r.code==="unrecognized_keys"?{message:(l=de.errToObj(t).message)!==null&&l!==void 0?l:c}:{message:c}}}:{}})}strip(){return new ft({...this._def,unknownKeys:"strip"})}passthrough(){return new ft({...this._def,unknownKeys:"passthrough"})}extend(t){return new ft({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ft({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:we.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new ft({...this._def,catchall:t})}pick(t){const r={};return ze.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new ft({...this._def,shape:()=>r})}omit(t){const r={};return ze.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new ft({...this._def,shape:()=>r})}deepPartial(){return ei(this)}partial(t){const r={};return ze.objectKeys(this.shape).forEach(n=>{const a=this.shape[n];t&&!t[n]?r[n]=a:r[n]=a.optional()}),new ft({...this._def,shape:()=>r})}required(t){const r={};return ze.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Yn;)i=i._def.innerType;r[n]=i}}),new ft({...this._def,shape:()=>r})}keyof(){return E1(ze.objectKeys(this.shape))}}ft.create=(e,t)=>new ft({shape:()=>e,unknownKeys:"strip",catchall:Qs.create(),typeName:we.ZodObject,..._e(t)});ft.strictCreate=(e,t)=>new ft({shape:()=>e,unknownKeys:"strict",catchall:Qs.create(),typeName:we.ZodObject,..._e(t)});ft.lazycreate=(e,t)=>new ft({shape:e,unknownKeys:"strip",catchall:Qs.create(),typeName:we.ZodObject,..._e(t)});class Tu extends Me{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function a(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new Ur(l.ctx.common.issues));return ee(r,{code:q.invalid_union,unionErrors:o}),be}if(r.common.async)return Promise.all(n.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},h=c._parseSync({data:r.data,path:r.path,parent:u});if(h.status==="valid")return h;h.status==="dirty"&&!i&&(i={result:h,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(c=>new Ur(c));return ee(r,{code:q.invalid_union,unionErrors:l}),be}}get options(){return this._def.options}}Tu.create=(e,t)=>new Tu({options:e,typeName:we.ZodUnion,..._e(t)});const Ln=e=>e instanceof Au?Ln(e.schema):e instanceof as?Ln(e.innerType()):e instanceof Iu?[e.value]:e instanceof Fa?e.options:e instanceof Mu?ze.objectValues(e.enum):e instanceof Ou?Ln(e._def.innerType):e instanceof Eu?[void 0]:e instanceof ku?[null]:e instanceof Yn?[void 0,...Ln(e.unwrap())]:e instanceof La?[null,...Ln(e.unwrap())]:e instanceof k1||e instanceof Fu?Ln(e.unwrap()):e instanceof Du?Ln(e._def.innerType):[];class sg extends Me{_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==se.object)return ee(r,{code:q.invalid_type,expected:se.object,received:r.parsedType}),be;const n=this.discriminator,a=r.data[n],i=this.optionsMap.get(a);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(ee(r,{code:q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){const a=new Map;for(const i of r){const o=Ln(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const l of o){if(a.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);a.set(l,i)}}return new sg({typeName:we.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:a,..._e(n)})}}function Nh(e,t){const r=ma(e),n=ma(t);if(e===t)return{valid:!0,data:e};if(r===se.object&&n===se.object){const a=ze.objectKeys(t),i=ze.objectKeys(e).filter(l=>a.indexOf(l)!==-1),o={...e,...t};for(const l of i){const c=Nh(e[l],t[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(r===se.array&&n===se.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let i=0;i<e.length;i++){const o=e[i],l=t[i],c=Nh(o,l);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return r===se.date&&n===se.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Pu extends Me{_parse(t){const{status:r,ctx:n}=this._processInputParams(t),a=(i,o)=>{if(Uv(i)||Uv(o))return be;const l=Nh(i.value,o.value);return l.valid?((zv(i)||zv(o))&&r.dirty(),{status:r.value,value:l.data}):(ee(n,{code:q.invalid_intersection_types}),be)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Pu.create=(e,t,r)=>new Pu({left:e,right:t,typeName:we.ZodIntersection,..._e(r)});class ss extends Me{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==se.array)return ee(n,{code:q.invalid_type,expected:se.array,received:n.parsedType}),be;if(n.data.length<this._def.items.length)return ee(n,{code:q.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&n.data.length>this._def.items.length&&(ee(n,{code:q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new Pn(n,o,n.path,l)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>tr.mergeArray(r,o)):tr.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new ss({...this._def,rest:t})}}ss.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ss({items:e,typeName:we.ZodTuple,rest:null,..._e(t)})};class Ru extends Me{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==se.object)return ee(n,{code:q.invalid_type,expected:se.object,received:n.parsedType}),be;const a=[],i=this._def.keyType,o=this._def.valueType;for(const l in n.data)a.push({key:i._parse(new Pn(n,l,n.path,l)),value:o._parse(new Pn(n,n.data[l],n.path,l)),alwaysSet:l in n.data});return n.common.async?tr.mergeObjectAsync(r,a):tr.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Me?new Ru({keyType:t,valueType:r,typeName:we.ZodRecord,..._e(n)}):new Ru({keyType:Wn.create(),valueType:t,typeName:we.ZodRecord,..._e(r)})}}class Ch extends Me{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==se.map)return ee(n,{code:q.invalid_type,expected:se.map,received:n.parsedType}),be;const a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([l,c],u)=>({key:a._parse(new Pn(n,l,n.path,[u,"key"])),value:i._parse(new Pn(n,c,n.path,[u,"value"]))}));if(n.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,h=await c.value;if(u.status==="aborted"||h.status==="aborted")return be;(u.status==="dirty"||h.status==="dirty")&&r.dirty(),l.set(u.value,h.value)}return{status:r.value,value:l}})}else{const l=new Map;for(const c of o){const u=c.key,h=c.value;if(u.status==="aborted"||h.status==="aborted")return be;(u.status==="dirty"||h.status==="dirty")&&r.dirty(),l.set(u.value,h.value)}return{status:r.value,value:l}}}}Ch.create=(e,t,r)=>new Ch({valueType:t,keyType:e,typeName:we.ZodMap,..._e(r)});class Zi extends Me{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==se.set)return ee(n,{code:q.invalid_type,expected:se.set,received:n.parsedType}),be;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(ee(n,{code:q.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(ee(n,{code:q.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const i=this._def.valueType;function o(c){const u=new Set;for(const h of c){if(h.status==="aborted")return be;h.status==="dirty"&&r.dirty(),u.add(h.value)}return{status:r.value,value:u}}const l=[...n.data.values()].map((c,u)=>i._parse(new Pn(n,c,n.path,u)));return n.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(t,r){return new Zi({...this._def,minSize:{value:t,message:de.toString(r)}})}max(t,r){return new Zi({...this._def,maxSize:{value:t,message:de.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}Zi.create=(e,t)=>new Zi({valueType:e,minSize:null,maxSize:null,typeName:we.ZodSet,..._e(t)});class Yo extends Me{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==se.function)return ee(r,{code:q.invalid_type,expected:se.function,received:r.parsedType}),be;function n(l,c){return vh({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,xh(),wl].filter(u=>!!u),issueData:{code:q.invalid_arguments,argumentsError:c}})}function a(l,c){return vh({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,xh(),wl].filter(u=>!!u),issueData:{code:q.invalid_return_type,returnTypeError:c}})}const i={errorMap:r.common.contextualErrorMap},o=r.data;if(this._def.returns instanceof jl){const l=this;return gr(async function(...c){const u=new Ur([]),h=await l._def.args.parseAsync(c,i).catch(y=>{throw u.addIssue(n(c,y)),u}),f=await Reflect.apply(o,this,h);return await l._def.returns._def.type.parseAsync(f,i).catch(y=>{throw u.addIssue(a(f,y)),u})})}else{const l=this;return gr(function(...c){const u=l._def.args.safeParse(c,i);if(!u.success)throw new Ur([n(c,u.error)]);const h=Reflect.apply(o,this,u.data),f=l._def.returns.safeParse(h,i);if(!f.success)throw new Ur([a(h,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new Yo({...this._def,args:ss.create(t).rest(Si.create())})}returns(t){return new Yo({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new Yo({args:t||ss.create([]).rest(Si.create()),returns:r||Si.create(),typeName:we.ZodFunction,..._e(n)})}}class Au extends Me{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Au.create=(e,t)=>new Au({getter:e,typeName:we.ZodLazy,..._e(t)});class Iu extends Me{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return ee(r,{received:r.data,code:q.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:t.data}}get value(){return this._def.value}}Iu.create=(e,t)=>new Iu({value:e,typeName:we.ZodLiteral,..._e(t)});function E1(e,t){return new Fa({values:e,typeName:we.ZodEnum,..._e(t)})}class Fa extends Me{constructor(){super(...arguments),Mo.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return ee(r,{expected:ze.joinValues(n),received:r.parsedType,code:q.invalid_type}),be}if(_u(this,Mo)||C1(this,Mo,new Set(this._def.values)),!_u(this,Mo).has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return ee(r,{received:r.data,code:q.invalid_enum_value,options:n}),be}return gr(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return Fa.create(t,{...this._def,...r})}exclude(t,r=this._def){return Fa.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}Mo=new WeakMap;Fa.create=E1;class Mu extends Me{constructor(){super(...arguments),Oo.set(this,void 0)}_parse(t){const r=ze.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==se.string&&n.parsedType!==se.number){const a=ze.objectValues(r);return ee(n,{expected:ze.joinValues(a),received:n.parsedType,code:q.invalid_type}),be}if(_u(this,Oo)||C1(this,Oo,new Set(ze.getValidEnumValues(this._def.values))),!_u(this,Oo).has(t.data)){const a=ze.objectValues(r);return ee(n,{received:n.data,code:q.invalid_enum_value,options:a}),be}return gr(t.data)}get enum(){return this._def.values}}Oo=new WeakMap;Mu.create=(e,t)=>new Mu({values:e,typeName:we.ZodNativeEnum,..._e(t)});class jl extends Me{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==se.promise&&r.common.async===!1)return ee(r,{code:q.invalid_type,expected:se.promise,received:r.parsedType}),be;const n=r.parsedType===se.promise?r.data:Promise.resolve(r.data);return gr(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}jl.create=(e,t)=>new jl({type:e,typeName:we.ZodPromise,..._e(t)});class as extends Me{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===we.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),a=this._def.effect||null,i={addIssue:o=>{ee(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async l=>{if(r.value==="aborted")return be;const c=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return c.status==="aborted"?be:c.status==="dirty"||r.value==="dirty"?Io(c.value):c});{if(r.value==="aborted")return be;const l=this._def.schema._parseSync({data:o,path:n.path,parent:n});return l.status==="aborted"?be:l.status==="dirty"||r.value==="dirty"?Io(l.value):l}}if(a.type==="refinement"){const o=l=>{const c=a.refinement(l,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?be:(l.status==="dirty"&&r.dirty(),o(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?be:(l.status==="dirty"&&r.dirty(),o(l.value).then(()=>({status:r.value,value:l.value}))))}if(a.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Cu(o))return o;const l=a.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Cu(o)?Promise.resolve(a.transform(o.value,i)).then(l=>({status:r.value,value:l})):o);ze.assertNever(a)}}as.create=(e,t,r)=>new as({schema:e,typeName:we.ZodEffects,effect:t,..._e(r)});as.createWithPreprocess=(e,t,r)=>new as({schema:t,effect:{type:"preprocess",transform:e},typeName:we.ZodEffects,..._e(r)});class Yn extends Me{_parse(t){return this._getType(t)===se.undefined?gr(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Yn.create=(e,t)=>new Yn({innerType:e,typeName:we.ZodOptional,..._e(t)});class La extends Me{_parse(t){return this._getType(t)===se.null?gr(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}La.create=(e,t)=>new La({innerType:e,typeName:we.ZodNullable,..._e(t)});class Ou extends Me{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===se.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Ou.create=(e,t)=>new Ou({innerType:e,typeName:we.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,..._e(t)});class Du extends Me{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Su(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ur(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ur(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Du.create=(e,t)=>new Du({innerType:e,typeName:we.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,..._e(t)});class Sh extends Me{_parse(t){if(this._getType(t)!==se.nan){const n=this._getOrReturnCtx(t);return ee(n,{code:q.invalid_type,expected:se.nan,received:n.parsedType}),be}return{status:"valid",value:t.data}}}Sh.create=e=>new Sh({typeName:we.ZodNaN,..._e(e)});class k1 extends Me{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Nd extends Me{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?be:i.status==="dirty"?(r.dirty(),Io(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?be:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new Nd({in:t,out:r,typeName:we.ZodPipeline})}}class Fu extends Me{_parse(t){const r=this._def.innerType._parse(t),n=a=>(Cu(a)&&(a.value=Object.freeze(a.value)),a);return Su(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}Fu.create=(e,t)=>new Fu({innerType:e,typeName:we.ZodReadonly,..._e(t)});ft.lazycreate;var we;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(we||(we={}));const Eo=Wn.create,P4=Qi.create;Sh.create;Yi.create;yh.create;bl.create;wh.create;Eu.create;ku.create;bh.create;Si.create;Qs.create;jh.create;Tn.create;const R4=ft.create;ft.strictCreate;Tu.create;sg.create;Pu.create;ss.create;Ru.create;Ch.create;Zi.create;Yo.create;Au.create;Iu.create;Fa.create;Mu.create;jl.create;as.create;Yn.create;La.create;as.createWithPreprocess;Nd.create;var A4="Label",T1=d.forwardRef((e,t)=>s.jsx(xe.label,{...e,ref:t,onMouseDown:r=>{var a;r.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));T1.displayName=A4;var P1=T1;const I4=xd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),H=d.forwardRef(({className:e,...t},r)=>s.jsx(P1,{ref:r,className:le(I4(),e),...t}));H.displayName=P1.displayName;yu.init("vM-y2cWvRM3WGdSNg");const M4=async e=>{try{const t={to_email:"support@youtalkacademy.com",from_name:e.fullName,reply_to:e.email,name:e.fullName,time:new Date().toLocaleString(),message:`New Enrollment Application Details:

Full Name: ${e.fullName}
Email: ${e.email}
Phone: ${e.phoneNumber}
Age: ${e.age}
Education Level: ${e.educationLevel}
Course: ${e.courseTitle}
Price: $${e.coursePrice}
Instructor: ${e.courseInstructor}
Bank Reference: ${e.bankReference}
`};console.log("Sending enrollment notification with params:",t);const r=await yu.send("default_service","template_w7lidsa",t);return console.log("Email sent successfully:",r),r.status===200}catch(t){return console.error("Failed to send enrollment notification:",t),!1}},O4=R4({fullName:Eo().min(2,"Full name must be at least 2 characters"),email:Eo().email("Please enter a valid email address"),phoneNumber:Eo().min(10,"Phone number must be at least 10 digits"),age:P4().min(16,"Must be at least 16 years old").max(80,"Must be under 80 years old"),educationLevel:Eo().min(1,"Please select your education level"),bankReference:Eo().min(8,"Bank reference must be at least 8 characters")}),D4=({courseId:e,courseTitle:t,coursePrice:r,courseInstructor:n="N/A",onSuccess:a})=>{const[i,o]=d.useState(null),[l,c]=d.useState(!1),[u,h]=d.useState(!0),{toast:f}=na(),{user:m}=ia(),{register:y,handleSubmit:v,formState:{errors:p},setValue:b}=l4({resolver:f4(O4)});d.useEffect(()=>{m&&m.email&&(b("email",m.email),b("fullName",`${m.first_name||""} ${m.last_name||""}`.trim())),h(!1)},[m,b]);const g=w=>{var C;const N=(C=w.target.files)==null?void 0:C[0];if(N){if(!["image/jpeg","image/png","image/jpg","application/pdf"].includes(N.type)){f({title:"Invalid file type",description:"Please upload a JPG, PNG, or PDF file",variant:"destructive"});return}if(N.size>5242880){f({title:"File too large",description:"Please upload a file smaller than 5MB",variant:"destructive"});return}o(N)}},x=async w=>{if(!i){f({title:"Payment proof required",description:"Please upload your payment proof before submitting",variant:"destructive"});return}c(!0);try{const N=await ue.enrollInCourse(e,i);if(!N.success)throw new Error(N.message||"Enrollment failed");await M4({fullName:w.fullName,email:w.email,phoneNumber:w.phoneNumber,age:w.age,educationLevel:w.educationLevel,courseTitle:t,coursePrice:r,courseInstructor:n,bankReference:w.bankReference})||console.warn("Email notification failed to send, but enrollment was successful"),f({title:"Application Submitted!",description:"Your enrollment application has been submitted successfully. You will receive a confirmation email once approved."}),a()}catch(N){console.error("Error submitting application:",N),f({title:"Submission failed",description:N.message||"Failed to submit application. Please try again.",variant:"destructive"})}finally{c(!1)}};return u?s.jsx(Fe,{className:"border-0 shadow-xl",children:s.jsxs(Ue,{className:"p-8 text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-amber-600 mx-auto mb-4"}),s.jsx("p",{className:"text-gray-600",children:"Loading enrollment form..."})]})}):m?s.jsxs(Fe,{className:"border-0 shadow-xl",children:[s.jsxs(st,{children:[s.jsx(dt,{className:"text-2xl text-center",children:"Enrollment Application"}),s.jsxs("div",{className:"text-center space-y-2",children:[s.jsx(sn,{className:"bg-gradient-to-r from-amber-600 to-yellow-600",children:t}),s.jsxs("p",{className:"text-lg font-semibold text-gray-900",children:["$",r]}),s.jsxs("p",{className:"text-sm text-gray-600",children:["Signed in as: ",s.jsx("span",{className:"font-medium",children:m.email})]})]})]}),s.jsx(Ue,{className:"space-y-6",children:s.jsxs("form",{onSubmit:v(x),className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(H,{htmlFor:"fullName",children:"Full Name *"}),s.jsx(Q,{id:"fullName",...y("fullName"),placeholder:"Enter your full name"}),p.fullName&&s.jsx("p",{className:"text-sm text-red-600 mt-1",children:p.fullName.message})]}),s.jsxs("div",{children:[s.jsx(H,{htmlFor:"email",children:"Email Address *"}),s.jsx(Q,{id:"email",type:"email",...y("email"),placeholder:"Enter your email address",value:(m==null?void 0:m.email)||"",disabled:!0,className:"bg-gray-50"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"This email is automatically filled from your Google account and cannot be changed."}),p.email&&s.jsx("p",{className:"text-sm text-red-600 mt-1",children:p.email.message})]}),s.jsxs("div",{children:[s.jsx(H,{htmlFor:"phoneNumber",children:"Phone Number *"}),s.jsx(Q,{id:"phoneNumber",...y("phoneNumber"),placeholder:"Enter your phone number"}),p.phoneNumber&&s.jsx("p",{className:"text-sm text-red-600 mt-1",children:p.phoneNumber.message})]}),s.jsxs("div",{children:[s.jsx(H,{htmlFor:"age",children:"Age *"}),s.jsx(Q,{id:"age",type:"number",...y("age",{valueAsNumber:!0}),placeholder:"Enter your age"}),p.age&&s.jsx("p",{className:"text-sm text-red-600 mt-1",children:p.age.message})]}),s.jsxs("div",{children:[s.jsx(H,{htmlFor:"educationLevel",children:"Education Level *"}),s.jsx(Q,{id:"educationLevel",...y("educationLevel"),placeholder:"e.g., High School, Bachelor's, etc."}),p.educationLevel&&s.jsx("p",{className:"text-sm text-red-600 mt-1",children:p.educationLevel.message})]}),s.jsxs("div",{children:[s.jsx(H,{htmlFor:"bankReference",children:"Bank Reference Number *"}),s.jsx(Q,{id:"bankReference",...y("bankReference"),placeholder:"Enter your bank transaction reference"}),p.bankReference&&s.jsx("p",{className:"text-sm text-red-600 mt-1",children:p.bankReference.message})]}),s.jsxs("div",{children:[s.jsx(H,{htmlFor:"paymentProof",children:"Payment Proof * (JPG, PNG, or PDF - Max 5MB)"}),s.jsx("div",{className:"mt-2",children:s.jsxs("label",{htmlFor:"paymentProof",className:"flex flex-col items-center justify-center w-full h-32 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 hover:bg-gray-100",children:[s.jsx("div",{className:"flex flex-col items-center justify-center pt-5 pb-6",children:i?s.jsxs(s.Fragment,{children:[s.jsx(zp,{className:"w-8 h-8 mb-2 text-green-500"}),s.jsx("p",{className:"text-sm text-gray-600",children:i.name})]}):s.jsxs(s.Fragment,{children:[s.jsx(bk,{className:"w-8 h-8 mb-2 text-gray-400"}),s.jsx("p",{className:"text-sm text-gray-600",children:"Click to upload payment proof"})]})}),s.jsx("input",{id:"paymentProof",type:"file",className:"hidden",accept:"image/jpeg,image/png,image/jpg,application/pdf",onChange:g})]})})]}),s.jsxs("div",{className:"bg-amber-50 p-4 rounded-lg",children:[s.jsx("h3",{className:"font-semibold text-amber-800 mb-2",children:"Payment Instructions:"}),s.jsxs("div",{className:"space-y-2 text-sm text-amber-700",children:[s.jsxs("p",{children:[s.jsx("strong",{children:"Amount:"})," $",r]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Bank Name:"})," You Talk Academy Bank"]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Account Number:"})," 9876543210"]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Account Name:"})," You Talk Academy"]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Reference:"})," ",t," - ",m==null?void 0:m.email]})]}),s.jsx("p",{className:"text-xs text-amber-600 mt-3",children:"Please transfer the exact amount and upload the receipt as payment proof. Your application will be reviewed within 24-48 hours after submission."})]}),s.jsx(V,{type:"submit",disabled:l,className:"w-full bg-gradient-to-r from-amber-600 to-yellow-600 hover:from-amber-700 hover:to-yellow-700 py-3 text-lg",children:l?"Submitting Application...":"Submit Application"})]})})]}):s.jsx(Fe,{className:"border-0 shadow-xl",children:s.jsxs(Ue,{className:"p-8 text-center",children:[s.jsx(ak,{className:"h-12 w-12 text-amber-600 mx-auto mb-4"}),s.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Authentication Required"}),s.jsx("p",{className:"text-gray-600 mb-6",children:"You must be signed in with Google to enroll in courses. Please sign in to continue."}),s.jsx(ht,{to:"/login",children:s.jsx(V,{className:"bg-gradient-to-r from-amber-600 to-yellow-600 hover:from-amber-700 hover:to-yellow-700",children:"Sign In with Google"})})]})})},F4=()=>{const{id:e}=Ll(),[t,r]=d.useState(!1),{data:n,isLoading:a,error:i}=Yt({queryKey:["course",e],queryFn:async()=>{const o=await ue.getCourse(e);if(!o.success)throw new Error(o.message||"Failed to fetch course");return o.course},enabled:!!e});return e?a?s.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:s.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-amber-600"})}):i||!n?s.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:s.jsx(Fe,{className:"max-w-md mx-auto",children:s.jsxs(Ue,{className:"p-8 text-center",children:[s.jsx($r,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),s.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Course Not Found"}),s.jsx("p",{className:"text-gray-600 mb-4",children:"The course you're looking for doesn't exist."}),s.jsxs(ht,{to:"/",className:"inline-flex items-center text-amber-600 hover:text-amber-700",children:[s.jsx(Qn,{className:"h-4 w-4 mr-2"}),"Back to Courses"]})]})})}):t?s.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:s.jsx(Fe,{className:"max-w-md mx-auto",children:s.jsxs(Ue,{className:"p-8 text-center",children:[s.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx($r,{className:"h-8 w-8 text-green-600"})}),s.jsx("h2",{className:"text-2xl font-semibold text-gray-900 mb-2",children:"Application Submitted!"}),s.jsx("p",{className:"text-gray-600 mb-6",children:"Thank you for your enrollment application. You will receive a confirmation email once your application is reviewed and approved."}),s.jsxs(ht,{to:"/",className:"inline-flex items-center bg-amber-600 text-white px-6 py-2 rounded-lg hover:bg-amber-700 transition-colors",children:[s.jsx(Qn,{className:"h-4 w-4 mr-2"}),"Back to Home"]})]})})}):s.jsx("div",{className:"min-h-screen bg-gray-50 py-12 px-4",children:s.jsxs("div",{className:"max-w-2xl mx-auto",children:[s.jsxs(ht,{to:"/",className:"inline-flex items-center space-x-2 text-gray-600 hover:text-amber-700 transition-colors mb-8",children:[s.jsx(Qn,{className:"h-4 w-4"}),s.jsx("span",{children:"Back to Courses"})]}),s.jsx(D4,{courseId:n.id,courseTitle:n.title,coursePrice:n.price,courseInstructor:n.instructor,onSuccess:()=>r(!0)})]})}):s.jsx(Ib,{to:"/",replace:!0})},L4=({onSuccess:e,onError:t,disabled:r})=>{const{googleLogin:n}=ia();console.log("Google Client ID loaded:","Yes"),d.useEffect(()=>{if(window.google)a();else{const c=document.createElement("script");c.src="https://accounts.google.com/gsi/client",c.async=!0,c.defer=!0,document.head.appendChild(c),c.onload=()=>{a()}}},[]);const a=()=>{window.google&&window.google.accounts.id.initialize({client_id:"683313301201-keg4psp0h64u0rpi8sft54u4el8je3fm.apps.googleusercontent.com",callback:i,use_fedcm_for_prompt:!1,auto_select:!1,cancel_on_tap_outside:!0})},i=async c=>{try{const u=await n(c.credential);u.success?(Jt.success("Successfully logged in with Google!"),e==null||e()):(Jt.error(u.message||"Google login failed"),t==null||t(u))}catch(u){console.error("Google login error:",u),Jt.error("Failed to login with Google"),t==null||t(u)}},o=()=>{if(!window.google){Jt.error("Google services not loaded. Please try again.");return}try{window.google.accounts.id.prompt(c=>{c.isNotDisplayed()?(console.log("Prompt not displayed, using button fallback"),l()):c.isSkippedMoment()?console.log("User skipped the prompt"):c.isDismissedMoment()&&console.log("User dismissed the prompt")})}catch(c){console.error("Google prompt error:",c),l()}},l=()=>{const c=document.createElement("div");document.body.appendChild(c),window.google&&(window.google.accounts.id.renderButton(c,{theme:"outline",size:"large",width:300,text:"continue_with"}),setTimeout(()=>{const u=c.querySelector('div[role="button"]');u&&u.click(),document.body.removeChild(c)},100))};return s.jsxs("div",{className:"space-y-2",children:[s.jsxs(V,{type:"button",variant:"outline",className:"w-full flex items-center justify-center gap-3 border-gray-300 hover:bg-gray-50",onClick:o,disabled:r,children:[s.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",className:"flex-shrink-0",children:[s.jsx("path",{fill:"#4285F4",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"}),s.jsx("path",{fill:"#34A853",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"}),s.jsx("path",{fill:"#FBBC05",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"}),s.jsx("path",{fill:"#EA4335",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"})]}),"Continue with Google"]}),s.jsx("div",{className:"text-center text-xs text-gray-500",children:"Need to configure authorized origins in Google Cloud Console"})]})},$4=()=>{const[e,t]=d.useState(!1),[r,n]=d.useState(!1),[a,i]=d.useState(!1),[o,l]=d.useState({email:"",password:"",firstName:"",lastName:"",confirmPassword:""}),{toast:c}=na(),u=ln(),{user:h,login:f,register:m}=ia();d.useEffect(()=>{h&&u("/",{replace:!0})},[h,u]);const y=b=>{l(g=>({...g,[b.target.name]:b.target.value}))},v=async b=>{b.preventDefault(),t(!0);try{const g=await f(o.email,o.password);g.success?(c({title:"Welcome back!",description:"You have successfully signed in."}),u("/",{replace:!0})):c({title:"Login Failed",description:g.message||"Invalid email or password.",variant:"destructive"})}catch(g){console.error("Login error:",g),c({title:"Login Error",description:g.message||"Failed to sign in. Please try again.",variant:"destructive"})}finally{t(!1)}},p=async b=>{if(b.preventDefault(),o.password!==o.confirmPassword){c({title:"Password Mismatch",description:"Passwords do not match.",variant:"destructive"});return}if(o.password.length<6){c({title:"Password Too Short",description:"Password must be at least 6 characters long.",variant:"destructive"});return}t(!0);try{const g=await m(o.email,o.password,o.firstName,o.lastName);g.success?(c({title:"Account Created!",description:"Welcome to You Talk Academy!"}),u("/",{replace:!0})):c({title:"Registration Failed",description:g.message||"Failed to create account.",variant:"destructive"})}catch(g){console.error("Registration error:",g),c({title:"Registration Error",description:g.message||"Failed to create account. Please try again.",variant:"destructive"})}finally{t(!1)}};return s.jsx("div",{className:"min-h-screen bg-gradient-to-br from-amber-50 via-white to-yellow-50 flex items-center justify-center p-4",children:s.jsxs("div",{className:"w-full max-w-md",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsxs(ht,{to:"/",className:"inline-flex items-center space-x-2 text-gray-600 hover:text-amber-700 transition-colors mb-6",children:[s.jsx(Qn,{className:"h-4 w-4"}),s.jsx("span",{children:"Back to Home"})]}),s.jsxs("div",{className:"flex flex-col items-center space-y-4 mb-6",children:[s.jsx("div",{className:"w-24 h-24 rounded-full overflow-hidden border-2 border-white shadow-lg",children:s.jsx("img",{src:"/lovable-uploads/b47b5e69-6b45-458a-965b-79ed3cf76f51.png",alt:"You Talk Academy Logo",className:"w-full h-full object-cover"})}),s.jsxs("div",{className:"text-center",children:[s.jsxs("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:["Welcome to ",s.jsx("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-cyan-500 to-blue-600",children:"You Talk Academy"})]}),s.jsx("p",{className:"text-gray-600",children:r?"Create your account":"Sign in to continue your English learning journey"})]})]})]}),s.jsxs(Fe,{className:"border-0 shadow-xl",children:[s.jsxs(st,{className:"text-center pb-4",children:[s.jsx(dt,{className:"text-xl",children:r?"Create Account":"Sign In"}),s.jsx("p",{className:"text-sm text-gray-600 mt-2",children:r?"Fill in your details to create a new account":"Enter your credentials to access your dashboard"})]}),s.jsxs(Ue,{className:"space-y-6",children:[s.jsxs("form",{onSubmit:r?p:v,className:"space-y-4",children:[r&&s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx("div",{children:s.jsx(Q,{name:"firstName",placeholder:"First Name",value:o.firstName,onChange:y,required:!0})}),s.jsx("div",{children:s.jsx(Q,{name:"lastName",placeholder:"Last Name",value:o.lastName,onChange:y,required:!0})})]}),s.jsx("div",{children:s.jsx(Q,{name:"email",type:"email",placeholder:"Email address",value:o.email,onChange:y,required:!0})}),s.jsxs("div",{className:"relative",children:[s.jsx(Q,{name:"password",type:a?"text":"password",placeholder:"Password",value:o.password,onChange:y,required:!0}),s.jsx(V,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3",onClick:()=>i(!a),children:a?s.jsx(lk,{className:"h-4 w-4"}):s.jsx(ck,{className:"h-4 w-4"})})]}),r&&s.jsx("div",{className:"relative",children:s.jsx(Q,{name:"confirmPassword",type:a?"text":"password",placeholder:"Confirm Password",value:o.confirmPassword,onChange:y,required:!0})}),s.jsx(V,{type:"submit",disabled:e,className:"w-full bg-gradient-to-r from-cyan-500 to-blue-600 hover:from-cyan-600 hover:to-blue-700",children:e?"Processing...":r?"Create Account":"Sign In"})]}),s.jsx(wu,{className:"my-6"}),s.jsx(L4,{onSuccess:()=>{c({title:"Success!",description:"Successfully signed in with Google"}),u("/",{replace:!0})},onError:b=>{c({title:"Login Failed",description:b.message||"Failed to sign in with Google",variant:"destructive"})},disabled:e}),s.jsx(wu,{className:"my-6"}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-sm text-gray-600",children:r?"Already have an account?":"Don't have an account?"}),s.jsx(V,{type:"button",variant:"link",className:"text-cyan-600 hover:text-cyan-700",onClick:()=>{n(!r),l({email:"",password:"",firstName:"",lastName:"",confirmPassword:""})},children:r?"Sign In":"Create Account"})]})]})]})]})})};function xc({className:e,...t}){return s.jsx("div",{className:le("animate-pulse rounded-md bg-muted",e),...t})}function Zn(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function ag(e,t=[]){let r=[];function n(i,o){const l=d.createContext(o),c=r.length;r=[...r,o];const u=f=>{var g;const{scope:m,children:y,...v}=f,p=((g=m==null?void 0:m[e])==null?void 0:g[c])||l,b=d.useMemo(()=>v,Object.values(v));return s.jsx(p.Provider,{value:b,children:y})};u.displayName=i+"Provider";function h(f,m){var p;const y=((p=m==null?void 0:m[e])==null?void 0:p[c])||l,v=d.useContext(y);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,h]}const a=()=>{const i=r.map(o=>d.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return d.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[n,U4(a,...t)]}function U4(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:u})=>{const f=c(i)[`__scope${u}`];return{...l,...f}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function Bv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function R1(...e){return t=>{let r=!1;const n=e.map(a=>{const i=Bv(a,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a<n.length;a++){const i=n[a];typeof i=="function"?i():Bv(e[a],null)}}}}function Lu(...e){return d.useCallback(R1(...e),e)}function _h(e){const t=z4(e),r=d.forwardRef((n,a)=>{const{children:i,...o}=n,l=d.Children.toArray(i),c=l.find(B4);if(c){const u=c.props.children,h=l.map(f=>f===c?d.Children.count(u)>1?d.Children.only(null):d.isValidElement(u)?u.props.children:null:f);return s.jsx(t,{...o,ref:a,children:d.isValidElement(u)?d.cloneElement(u,void 0,h):null})}return s.jsx(t,{...o,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}function z4(e){const t=d.forwardRef((r,n)=>{const{children:a,...i}=r;if(d.isValidElement(a)){const o=W4(a),l=H4(i,a.props);return a.type!==d.Fragment&&(l.ref=n?R1(n,o):o),d.cloneElement(a,l)}return d.Children.count(a)>1?d.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var V4=Symbol("radix.slottable");function B4(e){return d.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===V4}function H4(e,t){const r={...t};for(const n in t){const a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...l)=>{const c=i(...l);return a(...l),c}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function W4(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function q4(e){const t=e+"CollectionProvider",[r,n]=ag(t),[a,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:b,children:g}=p,x=z.useRef(null),w=z.useRef(new Map).current;return s.jsx(a,{scope:b,itemMap:w,collectionRef:x,children:g})};o.displayName=t;const l=e+"CollectionSlot",c=_h(l),u=z.forwardRef((p,b)=>{const{scope:g,children:x}=p,w=i(l,g),N=Lu(b,w.collectionRef);return s.jsx(c,{ref:N,children:x})});u.displayName=l;const h=e+"CollectionItemSlot",f="data-radix-collection-item",m=_h(h),y=z.forwardRef((p,b)=>{const{scope:g,children:x,...w}=p,N=z.useRef(null),C=Lu(b,N),k=i(h,g);return z.useEffect(()=>(k.itemMap.set(N,{ref:N,...w}),()=>void k.itemMap.delete(N))),s.jsx(m,{[f]:"",ref:C,children:x})});y.displayName=h;function v(p){const b=i(e+"CollectionConsumer",p);return z.useCallback(()=>{const x=b.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((k,T)=>w.indexOf(k.ref.current)-w.indexOf(T.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:o,Slot:u,ItemSlot:y},v,n]}var $u=globalThis!=null&&globalThis.document?d.useLayoutEffect:()=>{},K4=Yu[" useId ".trim().toString()]||(()=>{}),G4=0;function A1(e){const[t,r]=d.useState(K4());return $u(()=>{e||r(n=>n??String(G4++))},[e]),e||(t?`radix-${t}`:"")}var Q4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],oo=Q4.reduce((e,t)=>{const r=_h(`Primitive.${t}`),n=d.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Y4(e){const t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}var Z4=Yu[" useInsertionEffect ".trim().toString()]||$u;function I1({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[a,i,o]=X4({defaultProp:t,onChange:r}),l=e!==void 0,c=l?e:a;{const h=d.useRef(e!==void 0);d.useEffect(()=>{const f=h.current;f!==l&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${l?"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.`),h.current=l},[l,n])}const u=d.useCallback(h=>{var f;if(l){const m=J4(h)?h(e):h;m!==e&&((f=o.current)==null||f.call(o,m))}else i(h)},[l,e,i,o]);return[c,u]}function X4({defaultProp:e,onChange:t}){const[r,n]=d.useState(e),a=d.useRef(r),i=d.useRef(t);return Z4(()=>{i.current=t},[t]),d.useEffect(()=>{var o;a.current!==r&&((o=i.current)==null||o.call(i,r),a.current=r)},[r,a]),[r,n,i]}function J4(e){return typeof e=="function"}var eA=d.createContext(void 0);function M1(e){const t=d.useContext(eA);return e||t||"ltr"}var zf="rovingFocusGroup.onEntryFocus",tA={bubbles:!1,cancelable:!0},zl="RovingFocusGroup",[Eh,O1,rA]=q4(zl),[nA,D1]=ag(zl,[rA]),[sA,aA]=nA(zl),F1=d.forwardRef((e,t)=>s.jsx(Eh.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Eh.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(iA,{...e,ref:t})})}));F1.displayName=zl;var iA=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:h=!1,...f}=e,m=d.useRef(null),y=Lu(t,m),v=M1(i),[p,b]=I1({prop:o,defaultProp:l??null,onChange:c,caller:zl}),[g,x]=d.useState(!1),w=Y4(u),N=O1(r),C=d.useRef(!1),[k,T]=d.useState(0);return d.useEffect(()=>{const P=m.current;if(P)return P.addEventListener(zf,w),()=>P.removeEventListener(zf,w)},[w]),s.jsx(sA,{scope:r,orientation:n,dir:v,loop:a,currentTabStopId:p,onItemFocus:d.useCallback(P=>b(P),[b]),onItemShiftTab:d.useCallback(()=>x(!0),[]),onFocusableItemAdd:d.useCallback(()=>T(P=>P+1),[]),onFocusableItemRemove:d.useCallback(()=>T(P=>P-1),[]),children:s.jsx(oo.div,{tabIndex:g||k===0?-1:0,"data-orientation":n,...f,ref:y,style:{outline:"none",...e.style},onMouseDown:Zn(e.onMouseDown,()=>{C.current=!0}),onFocus:Zn(e.onFocus,P=>{const I=!C.current;if(P.target===P.currentTarget&&I&&!g){const D=new CustomEvent(zf,tA);if(P.currentTarget.dispatchEvent(D),!D.defaultPrevented){const E=N().filter(F=>F.focusable),M=E.find(F=>F.active),U=E.find(F=>F.id===p),G=[M,U,...E].filter(Boolean).map(F=>F.ref.current);U1(G,h)}}C.current=!1}),onBlur:Zn(e.onBlur,()=>x(!1))})})}),L1="RovingFocusGroupItem",$1=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:i,children:o,...l}=e,c=A1(),u=i||c,h=aA(L1,r),f=h.currentTabStopId===u,m=O1(r),{onFocusableItemAdd:y,onFocusableItemRemove:v,currentTabStopId:p}=h;return d.useEffect(()=>{if(n)return y(),()=>v()},[n,y,v]),s.jsx(Eh.ItemSlot,{scope:r,id:u,focusable:n,active:a,children:s.jsx(oo.span,{tabIndex:f?0:-1,"data-orientation":h.orientation,...l,ref:t,onMouseDown:Zn(e.onMouseDown,b=>{n?h.onItemFocus(u):b.preventDefault()}),onFocus:Zn(e.onFocus,()=>h.onItemFocus(u)),onKeyDown:Zn(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){h.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const g=cA(b,h.orientation,h.dir);if(g!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let w=m().filter(N=>N.focusable).map(N=>N.ref.current);if(g==="last")w.reverse();else if(g==="prev"||g==="next"){g==="prev"&&w.reverse();const N=w.indexOf(b.currentTarget);w=h.loop?uA(w,N+1):w.slice(N+1)}setTimeout(()=>U1(w))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:p!=null}):o})})});$1.displayName=L1;var oA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lA(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cA(e,t,r){const n=lA(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return oA[n]}function U1(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function uA(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var dA=F1,fA=$1;function mA(e,t){return d.useReducer((r,n)=>t[r][n]??r,e)}var z1=e=>{const{present:t,children:r}=e,n=hA(t),a=typeof r=="function"?r({present:n.isPresent}):d.Children.only(r),i=Lu(n.ref,pA(a));return typeof r=="function"||n.isPresent?d.cloneElement(a,{ref:i}):null};z1.displayName="Presence";function hA(e){const[t,r]=d.useState(),n=d.useRef(null),a=d.useRef(e),i=d.useRef("none"),o=e?"mounted":"unmounted",[l,c]=mA(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{const u=vc(n.current);i.current=l==="mounted"?u:"none"},[l]),$u(()=>{const u=n.current,h=a.current;if(h!==e){const m=i.current,y=vc(u);e?c("MOUNT"):y==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(h&&m!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),$u(()=>{if(t){let u;const h=t.ownerDocument.defaultView??window,f=y=>{const p=vc(n.current).includes(y.animationName);if(y.target===t&&p&&(c("ANIMATION_END"),!a.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",u=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},m=y=>{y.target===t&&(i.current=vc(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{h.clearTimeout(u),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:d.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function vc(e){return(e==null?void 0:e.animationName)||"none"}function pA(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Cd="Tabs",[gA,yD]=ag(Cd,[D1]),V1=D1(),[xA,ig]=gA(Cd),B1=d.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=e,h=M1(l),[f,m]=I1({prop:n,onChange:a,defaultProp:i??"",caller:Cd});return s.jsx(xA,{scope:r,baseId:A1(),value:f,onValueChange:m,orientation:o,dir:h,activationMode:c,children:s.jsx(oo.div,{dir:h,"data-orientation":o,...u,ref:t})})});B1.displayName=Cd;var H1="TabsList",W1=d.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...a}=e,i=ig(H1,r),o=V1(r);return s.jsx(dA,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:n,children:s.jsx(oo.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});W1.displayName=H1;var q1="TabsTrigger",K1=d.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:a=!1,...i}=e,o=ig(q1,r),l=V1(r),c=Y1(o.baseId,n),u=Z1(o.baseId,n),h=n===o.value;return s.jsx(fA,{asChild:!0,...l,focusable:!a,active:h,children:s.jsx(oo.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":u,"data-state":h?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:t,onMouseDown:Zn(e.onMouseDown,f=>{!a&&f.button===0&&f.ctrlKey===!1?o.onValueChange(n):f.preventDefault()}),onKeyDown:Zn(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(n)}),onFocus:Zn(e.onFocus,()=>{const f=o.activationMode!=="manual";!h&&!a&&f&&o.onValueChange(n)})})})});K1.displayName=q1;var G1="TabsContent",Q1=d.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:a,children:i,...o}=e,l=ig(G1,r),c=Y1(l.baseId,n),u=Z1(l.baseId,n),h=n===l.value,f=d.useRef(h);return d.useEffect(()=>{const m=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(m)},[]),s.jsx(z1,{present:a||h,children:({present:m})=>s.jsx(oo.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:m&&i})})});Q1.displayName=G1;function Y1(e,t){return`${e}-trigger-${t}`}function Z1(e,t){return`${e}-content-${t}`}var vA=B1,X1=W1,J1=K1,ej=Q1;const tj=vA,og=d.forwardRef(({className:e,...t},r)=>s.jsx(X1,{ref:r,className:le("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));og.displayName=X1.displayName;const xn=d.forwardRef(({className:e,...t},r)=>s.jsx(J1,{ref:r,className:le("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));xn.displayName=J1.displayName;const vn=d.forwardRef(({className:e,...t},r)=>s.jsx(ej,{ref:r,className:le("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));vn.displayName=ej.displayName;const yA=()=>{var p,b;const{user:e,logout:t,updateUser:r}=ia(),n=ln(),[a,i]=d.useState(!1),[o,l]=d.useState({first_name:"",last_name:"",phone:""}),{data:c,isLoading:u}=Yt({queryKey:["userEnrollments"],queryFn:async()=>{const g=await ue.getUserEnrollments();return g.success?g.enrollments:[]},enabled:!!e}),{data:h,isLoading:f}=Yt({queryKey:["userAchievements"],queryFn:async()=>{const g=await ue.getUserAchievements();return g.success?g.achievements:[]},enabled:!!e});Yt({queryKey:["userStats"],queryFn:async()=>{const g=await ue.getUserStats();return g.success?g.stats:null},enabled:!!e}),d.useEffect(()=>{e||n("/login")},[e,n]);const m=(e==null?void 0:e.is_admin)===!0||(e==null?void 0:e.is_admin)===1;d.useEffect(()=>{m&&n("/admin")},[m,n]),d.useEffect(()=>{e&&l({first_name:e.first_name||"",last_name:e.last_name||"",phone:e.phone||""})},[e]);const y=()=>{t(),n("/login")},v=async g=>{g.preventDefault();try{await r(o),i(!1),Jt.success("Profile updated successfully")}catch(x){Jt.error(x.message||"Failed to update profile")}};return e?m?null:s.jsx("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50",children:s.jsxs("div",{className:"container mx-auto px-4 py-8",children:[s.jsxs("div",{className:"mb-8",children:[s.jsxs(ht,{to:"/",className:"inline-flex items-center space-x-2 text-gray-600 hover:text-blue-700 transition-colors mb-6",children:[s.jsx(Qn,{className:"h-4 w-4"}),s.jsx("span",{children:"Back to Home"})]}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"My Profile"}),s.jsxs(V,{variant:"outline",onClick:y,className:"border-red-300 text-red-600 hover:bg-red-50",children:[s.jsx(db,{className:"h-4 w-4 mr-2"}),"Sign Out"]})]})]}),s.jsxs("div",{className:"grid lg:grid-cols-3 gap-8",children:[s.jsx("div",{className:"lg:col-span-1",children:s.jsxs(Fe,{className:"border-0 shadow-xl",children:[s.jsxs(st,{className:"text-center",children:[s.jsxs(xl,{className:"h-24 w-24 mx-auto mb-4 ring-4 ring-blue-100",children:[s.jsx(vl,{src:e.avatar_url||`https://ui-avatars.com/api/?name=${encodeURIComponent((e.first_name||"")+" "+(e.last_name||""))}&background=0D8ABC&color=fff&size=200`}),s.jsx(yl,{className:"bg-gradient-to-r from-blue-500 to-purple-500 text-white text-2xl",children:((((p=e.first_name)==null?void 0:p[0])||"")+(((b=e.last_name)==null?void 0:b[0])||"")).toUpperCase()||"U"})]}),s.jsx(dt,{className:"text-xl",children:`${e.first_name||""} ${e.last_name||""}`.trim()||"Student"}),s.jsxs("div",{className:"flex items-center justify-center space-x-2 text-gray-600 mt-2",children:[s.jsx(yd,{className:"h-4 w-4"}),s.jsx("span",{className:"text-sm",children:e.email})]})]}),s.jsx(Ue,{className:"space-y-4",children:a?s.jsxs("form",{onSubmit:v,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-sm font-medium text-gray-700 mb-1 block",children:"First Name"}),s.jsx(Q,{value:o.first_name,onChange:g=>l({...o,first_name:g.target.value}),placeholder:"Enter first name",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-sm font-medium text-gray-700 mb-1 block",children:"Last Name"}),s.jsx(Q,{value:o.last_name,onChange:g=>l({...o,last_name:g.target.value}),placeholder:"Enter last name",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-sm font-medium text-gray-700 mb-1 block",children:"Phone"}),s.jsx(Q,{value:o.phone,onChange:g=>l({...o,phone:g.target.value}),placeholder:"Enter phone number"})]}),s.jsxs("div",{className:"flex space-x-2",children:[s.jsxs(V,{type:"submit",className:"flex-1 bg-gradient-to-r from-blue-600 to-purple-600",children:[s.jsx(Vp,{className:"h-4 w-4 mr-2"}),"Save"]}),s.jsxs(V,{type:"button",variant:"outline",onClick:()=>i(!1),className:"flex-1",children:[s.jsx(ro,{className:"h-4 w-4 mr-2"}),"Cancel"]})]})]}):s.jsxs(s.Fragment,{children:[e.phone&&s.jsxs("div",{className:"flex items-center space-x-2 text-gray-600 pb-4 border-b",children:[s.jsx(hu,{className:"h-4 w-4"}),s.jsx("span",{className:"text-sm",children:e.phone})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between p-3 bg-blue-50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx($r,{className:"h-5 w-5 text-blue-600"}),s.jsx("span",{className:"text-sm font-medium",children:"Enrolled Courses"})]}),s.jsx("span",{className:"text-lg font-bold text-blue-600",children:(c==null?void 0:c.length)||0})]}),s.jsxs("div",{className:"flex items-center justify-between p-3 bg-purple-50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Sn,{className:"h-5 w-5 text-purple-600"}),s.jsx("span",{className:"text-sm font-medium",children:"Achievements"})]}),s.jsx("span",{className:"text-lg font-bold text-purple-600",children:(h==null?void 0:h.length)||0})]})]}),s.jsxs(V,{onClick:()=>i(!0),className:"w-full bg-gradient-to-r from-blue-600 to-purple-600 mt-4",children:[s.jsx(gi,{className:"h-4 w-4 mr-2"}),"Edit Profile"]})]})})]})}),s.jsx("div",{className:"lg:col-span-2",children:s.jsxs(tj,{defaultValue:"courses",className:"w-full",children:[s.jsxs(og,{className:"grid w-full grid-cols-2",children:[s.jsx(xn,{value:"courses",children:"My Courses"}),s.jsx(xn,{value:"achievements",children:"Achievements"})]}),s.jsx(vn,{value:"courses",className:"mt-6",children:s.jsxs(Fe,{className:"border-0 shadow-xl",children:[s.jsx(st,{children:s.jsxs(dt,{className:"flex items-center space-x-2",children:[s.jsx($r,{className:"h-5 w-5 text-blue-600"}),s.jsx("span",{children:"Enrolled Courses"})]})}),s.jsx(Ue,{children:u?s.jsx("div",{className:"space-y-4",children:[1,2,3].map(g=>s.jsx(xc,{className:"h-32 w-full"},g))}):c&&c.length>0?s.jsx("div",{className:"space-y-4",children:c.map(g=>s.jsx("div",{className:"border rounded-lg p-4 hover:shadow-md transition-shadow",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{className:"font-semibold text-gray-900 mb-1",children:g.course_title||"Course"}),s.jsxs("div",{className:"flex items-center space-x-4 text-sm text-gray-600 mb-3",children:[s.jsxs("div",{className:"flex items-center space-x-1",children:[s.jsx(vd,{className:"h-3 w-3"}),s.jsxs("span",{children:["Enrolled ",new Date(g.enrolled_at).toLocaleDateString()]})]}),s.jsx(sn,{variant:"outline",className:g.status==="active"?"bg-green-50 text-green-700 border-green-200":g.status==="completed"?"bg-blue-50 text-blue-700 border-blue-200":"bg-gray-50 text-gray-700",children:g.status})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-gray-600",children:"Progress"}),s.jsxs("span",{className:"font-medium text-blue-600",children:[g.progress||0,"%"]})]}),s.jsx("div",{className:"h-2 w-full bg-gray-200 rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-gradient-to-r from-blue-500 to-purple-500 transition-all duration-300",style:{width:`${g.progress||0}%`}})})]})]}),s.jsx(ht,{to:`/course/${g.course_id}`,children:s.jsx(V,{size:"sm",variant:"outline",className:"ml-4",children:"View Course"})})]})},g.id))}):s.jsxs("div",{className:"text-center py-12",children:[s.jsx($r,{className:"h-16 w-16 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No courses yet"}),s.jsx("p",{className:"text-gray-600 mb-4",children:"Start learning by enrolling in a course!"}),s.jsx(ht,{to:"/#courses",children:s.jsx(V,{className:"bg-gradient-to-r from-blue-600 to-purple-600",children:"Browse Courses"})})]})})]})}),s.jsx(vn,{value:"achievements",className:"mt-6",children:s.jsxs(Fe,{className:"border-0 shadow-xl",children:[s.jsx(st,{children:s.jsxs(dt,{className:"flex items-center space-x-2",children:[s.jsx(Sn,{className:"h-5 w-5 text-purple-600"}),s.jsx("span",{children:"My Achievements"})]})}),s.jsx(Ue,{children:f?s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[1,2,3,4].map(g=>s.jsx(xc,{className:"h-32 w-full"},g))}):h&&h.length>0?s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:h.map(g=>s.jsx("div",{className:"border rounded-lg p-4 hover:shadow-md transition-shadow bg-gradient-to-br from-purple-50 to-pink-50",children:s.jsxs("div",{className:"flex items-start space-x-3",children:[s.jsx("div",{className:"w-12 h-12 bg-gradient-to-r from-purple-500 to-pink-500 rounded-full flex items-center justify-center flex-shrink-0",children:s.jsx(Sn,{className:"h-6 w-6 text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{className:"font-semibold text-gray-900 mb-1",children:g.title||"Achievement"}),s.jsx("p",{className:"text-sm text-gray-600 mb-2",children:g.description||"Earned achievement"}),s.jsxs("div",{className:"flex items-center space-x-1 text-xs text-gray-500",children:[s.jsx(Gi,{className:"h-3 w-3"}),s.jsxs("span",{children:["Earned ",new Date(g.earned_at).toLocaleDateString()]})]})]})]})},g.id))}):s.jsxs("div",{className:"text-center py-12",children:[s.jsx(Sn,{className:"h-16 w-16 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No achievements yet"}),s.jsx("p",{className:"text-gray-600",children:"Complete courses and exams to earn achievements!"})]})})]})})]})})]})]})}):s.jsx("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50 flex items-center justify-center",children:s.jsxs("div",{className:"text-center",children:[s.jsx(xc,{className:"h-12 w-12 rounded-full mx-auto mb-4"}),s.jsx(xc,{className:"h-4 w-48 mx-auto"})]})})},ti=d.forwardRef(({className:e,...t},r)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:r,className:le("w-full caption-bottom text-sm",e),...t})}));ti.displayName="Table";const ri=d.forwardRef(({className:e,...t},r)=>s.jsx("thead",{ref:r,className:le("[&_tr]:border-b",e),...t}));ri.displayName="TableHeader";const ni=d.forwardRef(({className:e,...t},r)=>s.jsx("tbody",{ref:r,className:le("[&_tr:last-child]:border-0",e),...t}));ni.displayName="TableBody";const wA=d.forwardRef(({className:e,...t},r)=>s.jsx("tfoot",{ref:r,className:le("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));wA.displayName="TableFooter";const qr=d.forwardRef(({className:e,...t},r)=>s.jsx("tr",{ref:r,className:le("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));qr.displayName="TableRow";const Re=d.forwardRef(({className:e,...t},r)=>s.jsx("th",{ref:r,className:le("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Re.displayName="TableHead";const Ae=d.forwardRef(({className:e,...t},r)=>s.jsx("td",{ref:r,className:le("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Ae.displayName="TableCell";const bA=d.forwardRef(({className:e,...t},r)=>s.jsx("caption",{ref:r,className:le("mt-4 text-sm text-muted-foreground",e),...t}));bA.displayName="TableCaption";var jA=Yu.useId||(()=>{}),NA=0;function Xn(e){const[t,r]=d.useState(jA());return Tt(()=>{r(n=>n??String(NA++))},[e]),t?`radix-${t}`:""}var Vf="focusScope.autoFocusOnMount",Bf="focusScope.autoFocusOnUnmount",Hv={bubbles:!1,cancelable:!0},CA="FocusScope",Sd=d.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[l,c]=d.useState(null),u=Ot(a),h=Ot(i),f=d.useRef(null),m=He(t,p=>c(p)),y=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(n){let p=function(w){if(y.paused||!l)return;const N=w.target;l.contains(N)?f.current=N:gs(f.current,{select:!0})},b=function(w){if(y.paused||!l)return;const N=w.relatedTarget;N!==null&&(l.contains(N)||gs(f.current,{select:!0}))},g=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&gs(l)};document.addEventListener("focusin",p),document.addEventListener("focusout",b);const x=new MutationObserver(g);return l&&x.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",b),x.disconnect()}}},[n,l,y.paused]),d.useEffect(()=>{if(l){qv.add(y);const p=document.activeElement;if(!l.contains(p)){const g=new CustomEvent(Vf,Hv);l.addEventListener(Vf,u),l.dispatchEvent(g),g.defaultPrevented||(SA(PA(rj(l)),{select:!0}),document.activeElement===p&&gs(l))}return()=>{l.removeEventListener(Vf,u),setTimeout(()=>{const g=new CustomEvent(Bf,Hv);l.addEventListener(Bf,h),l.dispatchEvent(g),g.defaultPrevented||gs(p??document.body,{select:!0}),l.removeEventListener(Bf,h),qv.remove(y)},0)}}},[l,u,h,y]);const v=d.useCallback(p=>{if(!r&&!n||y.paused)return;const b=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,g=document.activeElement;if(b&&g){const x=p.currentTarget,[w,N]=_A(x);w&&N?!p.shiftKey&&g===N?(p.preventDefault(),r&&gs(w,{select:!0})):p.shiftKey&&g===w&&(p.preventDefault(),r&&gs(N,{select:!0})):g===x&&p.preventDefault()}},[r,n,y.paused]);return s.jsx(xe.div,{tabIndex:-1,...o,ref:m,onKeyDown:v})});Sd.displayName=CA;function SA(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(gs(n,{select:t}),document.activeElement!==r)return}function _A(e){const t=rj(e),r=Wv(t,e),n=Wv(t.reverse(),e);return[r,n]}function rj(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Wv(e,t){for(const r of e)if(!EA(r,{upTo:t}))return r}function EA(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 kA(e){return e instanceof HTMLInputElement&&"select"in e}function gs(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&kA(e)&&t&&e.select()}}var qv=TA();function TA(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Kv(e,t),e.unshift(t)},remove(t){var r;e=Kv(e,t),(r=e[0])==null||r.resume()}}}function Kv(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function PA(e){return e.filter(t=>t.tagName!=="A")}var Hf=0;function lg(){d.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Gv()),document.body.insertAdjacentElement("beforeend",e[1]??Gv()),Hf++,()=>{Hf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Hf--}},[])}function Gv(){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 Cn=function(){return Cn=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Cn.apply(this,arguments)};function nj(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function RA(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,i;n<a;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}var zc="right-scroll-bar-position",Vc="width-before-scroll-bar",AA="with-scroll-bars-hidden",IA="--removed-body-scroll-bar-size";function Wf(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function MA(e,t){var r=d.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var a=r.value;a!==n&&(r.value=n,r.callback(n,a))}}}})[0];return r.callback=t,r.facade}var OA=typeof window<"u"?d.useLayoutEffect:d.useEffect,Qv=new WeakMap;function DA(e,t){var r=MA(null,function(n){return e.forEach(function(a){return Wf(a,n)})});return OA(function(){var n=Qv.get(r);if(n){var a=new Set(n),i=new Set(e),o=r.current;a.forEach(function(l){i.has(l)||Wf(l,null)}),i.forEach(function(l){a.has(l)||Wf(l,o)})}Qv.set(r,e)},[e]),r}function FA(e){return e}function LA(e,t){t===void 0&&(t=FA);var r=[],n=!1,a={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(i){var o=t(i,n);return r.push(o),function(){r=r.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(n=!0;r.length;){var o=r;r=[],o.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var o=[];if(r.length){var l=r;r=[],l.forEach(i),o=r}var c=function(){var h=o;o=[],h.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(h){o.push(h),u()},filter:function(h){return o=o.filter(h),r}}}};return a}function $A(e){e===void 0&&(e={});var t=LA(null);return t.options=Cn({async:!0,ssr:!1},e),t}var sj=function(e){var t=e.sideCar,r=nj(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return d.createElement(n,Cn({},r))};sj.isSideCarExport=!0;function UA(e,t){return e.useMedium(t),sj}var aj=$A(),qf=function(){},_d=d.forwardRef(function(e,t){var r=d.useRef(null),n=d.useState({onScrollCapture:qf,onWheelCapture:qf,onTouchMoveCapture:qf}),a=n[0],i=n[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,h=e.enabled,f=e.shards,m=e.sideCar,y=e.noIsolation,v=e.inert,p=e.allowPinchZoom,b=e.as,g=b===void 0?"div":b,x=e.gapMode,w=nj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=m,C=DA([r,t]),k=Cn(Cn({},w),a);return d.createElement(d.Fragment,null,h&&d.createElement(N,{sideCar:aj,removeScrollBar:u,shards:f,noIsolation:y,inert:v,setCallbacks:i,allowPinchZoom:!!p,lockRef:r,gapMode:x}),o?d.cloneElement(d.Children.only(l),Cn(Cn({},k),{ref:C})):d.createElement(g,Cn({},k,{className:c,ref:C}),l))});_d.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};_d.classNames={fullWidth:Vc,zeroRight:zc};var zA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function VA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=zA();return t&&e.setAttribute("nonce",t),e}function BA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function HA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var WA=function(){var e=0,t=null;return{add:function(r){e==0&&(t=VA())&&(BA(t,r),HA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},qA=function(){var e=WA();return function(t,r){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},ij=function(){var e=qA(),t=function(r){var n=r.styles,a=r.dynamic;return e(n,a),null};return t},KA={left:0,top:0,right:0,gap:0},Kf=function(e){return parseInt(e||"",10)||0},GA=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[Kf(r),Kf(n),Kf(a)]},QA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return KA;var t=GA(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},YA=ij(),_i="data-scroll-locked",ZA=function(e,t,r,n){var a=e.left,i=e.top,o=e.right,l=e.gap;return r===void 0&&(r="margin"),`
  .`.concat(AA,` {
   overflow: hidden `).concat(n,`;
   padding-right: `).concat(l,"px ").concat(n,`;
  }
  body[`).concat(_i,`] {
    overflow: hidden `).concat(n,`;
    overscroll-behavior: contain;
    `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
    padding-left: `.concat(a,`px;
    padding-top: `).concat(i,`px;
    padding-right: `).concat(o,`px;
    margin-left:0;
    margin-top:0;
    margin-right: `).concat(l,"px ").concat(n,`;
    `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),`
  }
  
  .`).concat(zc,` {
    right: `).concat(l,"px ").concat(n,`;
  }
  
  .`).concat(Vc,` {
    margin-right: `).concat(l,"px ").concat(n,`;
  }
  
  .`).concat(zc," .").concat(zc,` {
    right: 0 `).concat(n,`;
  }
  
  .`).concat(Vc," .").concat(Vc,` {
    margin-right: 0 `).concat(n,`;
  }
  
  body[`).concat(_i,`] {
    `).concat(IA,": ").concat(l,`px;
  }
`)},Yv=function(){var e=parseInt(document.body.getAttribute(_i)||"0",10);return isFinite(e)?e:0},XA=function(){d.useEffect(function(){return document.body.setAttribute(_i,(Yv()+1).toString()),function(){var e=Yv()-1;e<=0?document.body.removeAttribute(_i):document.body.setAttribute(_i,e.toString())}},[])},JA=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=n===void 0?"margin":n;XA();var i=d.useMemo(function(){return QA(a)},[a]);return d.createElement(YA,{styles:ZA(i,!t,a,r?"":"!important")})},kh=!1;if(typeof window<"u")try{var yc=Object.defineProperty({},"passive",{get:function(){return kh=!0,!0}});window.addEventListener("test",yc,yc),window.removeEventListener("test",yc,yc)}catch{kh=!1}var Za=kh?{passive:!1}:!1,eI=function(e){return e.tagName==="TEXTAREA"},oj=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!eI(e)&&r[t]==="visible")},tI=function(e){return oj(e,"overflowY")},rI=function(e){return oj(e,"overflowX")},Zv=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var a=lj(e,n);if(a){var i=cj(e,n),o=i[1],l=i[2];if(o>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},nI=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},sI=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},lj=function(e,t){return e==="v"?tI(t):rI(t)},cj=function(e,t){return e==="v"?nI(t):sI(t)},aI=function(e,t){return e==="h"&&t==="rtl"?-1:1},iI=function(e,t,r,n,a){var i=aI(e,window.getComputedStyle(t).direction),o=i*n,l=r.target,c=t.contains(l),u=!1,h=o>0,f=0,m=0;do{var y=cj(e,l),v=y[0],p=y[1],b=y[2],g=p-b-i*v;(v||g)&&lj(e,l)&&(f+=g,m+=v),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(h&&(Math.abs(f)<1||!a)||!h&&(Math.abs(m)<1||!a))&&(u=!0),u},wc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Xv=function(e){return[e.deltaX,e.deltaY]},Jv=function(e){return e&&"current"in e?e.current:e},oI=function(e,t){return e[0]===t[0]&&e[1]===t[1]},lI=function(e){return`
  .block-interactivity-`.concat(e,` {pointer-events: none;}
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},cI=0,Xa=[];function uI(e){var t=d.useRef([]),r=d.useRef([0,0]),n=d.useRef(),a=d.useState(cI++)[0],i=d.useState(ij)[0],o=d.useRef(e);d.useEffect(function(){o.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var p=RA([e.lockRef.current],(e.shards||[]).map(Jv),!0).filter(Boolean);return p.forEach(function(b){return b.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),p.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=d.useCallback(function(p,b){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!o.current.allowPinchZoom;var g=wc(p),x=r.current,w="deltaX"in p?p.deltaX:x[0]-g[0],N="deltaY"in p?p.deltaY:x[1]-g[1],C,k=p.target,T=Math.abs(w)>Math.abs(N)?"h":"v";if("touches"in p&&T==="h"&&k.type==="range")return!1;var P=Zv(T,k);if(!P)return!0;if(P?C=T:(C=T==="v"?"h":"v",P=Zv(T,k)),!P)return!1;if(!n.current&&"changedTouches"in p&&(w||N)&&(n.current=C),!C)return!0;var I=n.current||C;return iI(I,b,p,I==="h"?w:N,!0)},[]),c=d.useCallback(function(p){var b=p;if(!(!Xa.length||Xa[Xa.length-1]!==i)){var g="deltaY"in b?Xv(b):wc(b),x=t.current.filter(function(C){return C.name===b.type&&(C.target===b.target||b.target===C.shadowParent)&&oI(C.delta,g)})[0];if(x&&x.should){b.cancelable&&b.preventDefault();return}if(!x){var w=(o.current.shards||[]).map(Jv).filter(Boolean).filter(function(C){return C.contains(b.target)}),N=w.length>0?l(b,w[0]):!o.current.noIsolation;N&&b.cancelable&&b.preventDefault()}}},[]),u=d.useCallback(function(p,b,g,x){var w={name:p,delta:b,target:g,should:x,shadowParent:dI(g)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(N){return N!==w})},1)},[]),h=d.useCallback(function(p){r.current=wc(p),n.current=void 0},[]),f=d.useCallback(function(p){u(p.type,Xv(p),p.target,l(p,e.lockRef.current))},[]),m=d.useCallback(function(p){u(p.type,wc(p),p.target,l(p,e.lockRef.current))},[]);d.useEffect(function(){return Xa.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:m}),document.addEventListener("wheel",c,Za),document.addEventListener("touchmove",c,Za),document.addEventListener("touchstart",h,Za),function(){Xa=Xa.filter(function(p){return p!==i}),document.removeEventListener("wheel",c,Za),document.removeEventListener("touchmove",c,Za),document.removeEventListener("touchstart",h,Za)}},[]);var y=e.removeScrollBar,v=e.inert;return d.createElement(d.Fragment,null,v?d.createElement(i,{styles:lI(a)}):null,y?d.createElement(JA,{gapMode:e.gapMode}):null)}function dI(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const fI=UA(aj,uI);var Ed=d.forwardRef(function(e,t){return d.createElement(_d,Cn({},e,{ref:t,sideCar:fI}))});Ed.classNames=_d.classNames;var mI=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ja=new WeakMap,bc=new WeakMap,jc={},Gf=0,uj=function(e){return e&&(e.host||uj(e.parentNode))},hI=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=uj(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},pI=function(e,t,r,n){var a=hI(t,Array.isArray(e)?e:[e]);jc[r]||(jc[r]=new WeakMap);var i=jc[r],o=[],l=new Set,c=new Set(a),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};a.forEach(u);var h=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(m){if(l.has(m))h(m);else try{var y=m.getAttribute(n),v=y!==null&&y!=="false",p=(Ja.get(m)||0)+1,b=(i.get(m)||0)+1;Ja.set(m,p),i.set(m,b),o.push(m),p===1&&v&&bc.set(m,!0),b===1&&m.setAttribute(r,"true"),v||m.setAttribute(n,"true")}catch(g){console.error("aria-hidden: cannot operate on ",m,g)}})};return h(t),l.clear(),Gf++,function(){o.forEach(function(f){var m=Ja.get(f)-1,y=i.get(f)-1;Ja.set(f,m),i.set(f,y),m||(bc.has(f)||f.removeAttribute(n),bc.delete(f)),y||f.removeAttribute(r)}),Gf--,Gf||(Ja=new WeakMap,Ja=new WeakMap,bc=new WeakMap,jc={})}},cg=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=mI(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live]"))),pI(n,a,r,"aria-hidden")):function(){return null}},ug="Dialog",[dj,wD]=sa(ug),[gI,cn]=dj(ug),fj=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,l=d.useRef(null),c=d.useRef(null),[u=!1,h]=Ia({prop:n,defaultProp:a,onChange:i});return s.jsx(gI,{scope:t,triggerRef:l,contentRef:c,contentId:Xn(),titleId:Xn(),descriptionId:Xn(),open:u,onOpenChange:h,onOpenToggle:d.useCallback(()=>h(f=>!f),[h]),modal:o,children:r})};fj.displayName=ug;var mj="DialogTrigger",hj=d.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=cn(mj,r),i=He(t,a.triggerRef);return s.jsx(xe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":mg(a.open),...n,ref:i,onClick:ne(e.onClick,a.onOpenToggle)})});hj.displayName=mj;var dg="DialogPortal",[xI,pj]=dj(dg,{forceMount:void 0}),gj=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:a}=e,i=cn(dg,t);return s.jsx(xI,{scope:t,forceMount:r,children:d.Children.map(n,o=>s.jsx(An,{present:r||i.open,children:s.jsx(Fl,{asChild:!0,container:a,children:o})}))})};gj.displayName=dg;var Uu="DialogOverlay",xj=d.forwardRef((e,t)=>{const r=pj(Uu,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=cn(Uu,e.__scopeDialog);return i.modal?s.jsx(An,{present:n||i.open,children:s.jsx(vI,{...a,ref:t})}):null});xj.displayName=Uu;var vI=d.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=cn(Uu,r);return s.jsx(Ed,{as:Gs,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(xe.div,{"data-state":mg(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),$a="DialogContent",vj=d.forwardRef((e,t)=>{const r=pj($a,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=cn($a,e.__scopeDialog);return s.jsx(An,{present:n||i.open,children:i.modal?s.jsx(yI,{...a,ref:t}):s.jsx(wI,{...a,ref:t})})});vj.displayName=$a;var yI=d.forwardRef((e,t)=>{const r=cn($a,e.__scopeDialog),n=d.useRef(null),a=He(t,r.contentRef,n);return d.useEffect(()=>{const i=n.current;if(i)return cg(i)},[]),s.jsx(yj,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ne(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ne(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:ne(e.onFocusOutside,i=>i.preventDefault())})}),wI=d.forwardRef((e,t)=>{const r=cn($a,e.__scopeDialog),n=d.useRef(!1),a=d.useRef(!1);return s.jsx(yj,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),i.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((u=r.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),yj=d.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,l=cn($a,r),c=d.useRef(null),u=He(t,c);return lg(),s.jsxs(s.Fragment,{children:[s.jsx(Sd,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Dl,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":mg(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(bI,{titleId:l.titleId}),s.jsx(NI,{contentRef:c,descriptionId:l.descriptionId})]})]})}),fg="DialogTitle",wj=d.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=cn(fg,r);return s.jsx(xe.h2,{id:a.titleId,...n,ref:t})});wj.displayName=fg;var bj="DialogDescription",jj=d.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=cn(bj,r);return s.jsx(xe.p,{id:a.descriptionId,...n,ref:t})});jj.displayName=bj;var Nj="DialogClose",Cj=d.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=cn(Nj,r);return s.jsx(xe.button,{type:"button",...n,ref:t,onClick:ne(e.onClick,()=>a.onOpenChange(!1))})});Cj.displayName=Nj;function mg(e){return e?"open":"closed"}var Sj="DialogTitleWarning",[bD,_j]=yE(Sj,{contentName:$a,titleName:fg,docsSlug:"dialog"}),bI=({titleId:e})=>{const t=_j(Sj),r=`\`${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 d.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},jI="DialogDescriptionWarning",NI=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${_j(jI).contentName}}.`;return d.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},CI=fj,SI=hj,_I=gj,Ej=xj,kj=vj,Tj=wj,Pj=jj,EI=Cj;const Gt=CI,Rj=SI,kI=_I,Aj=d.forwardRef(({className:e,...t},r)=>s.jsx(Ej,{ref:r,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}));Aj.displayName=Ej.displayName;const $t=d.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(kI,{children:[s.jsx(Aj,{}),s.jsxs(kj,{ref:n,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 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,s.jsxs(EI,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background 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:[s.jsx(ro,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));$t.displayName=kj.displayName;const Ut=({className:e,...t})=>s.jsx("div",{className:le("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ut.displayName="DialogHeader";const Kr=({className:e,...t})=>s.jsx("div",{className:le("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Kr.displayName="DialogFooter";const zt=d.forwardRef(({className:e,...t},r)=>s.jsx(Tj,{ref:r,className:le("text-lg font-semibold leading-none tracking-tight",e),...t}));zt.displayName=Tj.displayName;const or=d.forwardRef(({className:e,...t},r)=>s.jsx(Pj,{ref:r,className:le("text-sm text-muted-foreground",e),...t}));or.displayName=Pj.displayName;function ey(e,[t,r]){return Math.min(r,Math.max(t,e))}var TI=d.createContext(void 0);function kd(e){const t=d.useContext(TI);return e||t||"ltr"}const PI=["top","right","bottom","left"],Ys=Math.min,jr=Math.max,zu=Math.round,Nc=Math.floor,Zs=e=>({x:e,y:e}),RI={left:"right",right:"left",bottom:"top",top:"bottom"},AI={start:"end",end:"start"};function Th(e,t,r){return jr(e,Ys(t,r))}function is(e,t){return typeof e=="function"?e(t):e}function os(e){return e.split("-")[0]}function lo(e){return e.split("-")[1]}function hg(e){return e==="x"?"y":"x"}function pg(e){return e==="y"?"height":"width"}function Xs(e){return["top","bottom"].includes(os(e))?"y":"x"}function gg(e){return hg(Xs(e))}function II(e,t,r){r===void 0&&(r=!1);const n=lo(e),a=gg(e),i=pg(a);let o=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Vu(o)),[o,Vu(o)]}function MI(e){const t=Vu(e);return[Ph(e),t,Ph(t)]}function Ph(e){return e.replace(/start|end/g,t=>AI[t])}function OI(e,t,r){const n=["left","right"],a=["right","left"],i=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return r?t?a:n:t?n:a;case"left":case"right":return t?i:o;default:return[]}}function DI(e,t,r,n){const a=lo(e);let i=OI(os(e),r==="start",n);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(Ph)))),i}function Vu(e){return e.replace(/left|right|bottom|top/g,t=>RI[t])}function FI(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ij(e){return typeof e!="number"?FI(e):{top:e,right:e,bottom:e,left:e}}function Bu(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function ty(e,t,r){let{reference:n,floating:a}=e;const i=Xs(t),o=gg(t),l=pg(o),c=os(t),u=i==="y",h=n.x+n.width/2-a.width/2,f=n.y+n.height/2-a.height/2,m=n[l]/2-a[l]/2;let y;switch(c){case"top":y={x:h,y:n.y-a.height};break;case"bottom":y={x:h,y:n.y+n.height};break;case"right":y={x:n.x+n.width,y:f};break;case"left":y={x:n.x-a.width,y:f};break;default:y={x:n.x,y:n.y}}switch(lo(t)){case"start":y[o]-=m*(r&&u?-1:1);break;case"end":y[o]+=m*(r&&u?-1:1);break}return y}const LI=async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:o}=r,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:f}=ty(u,n,c),m=n,y={},v=0;for(let p=0;p<l.length;p++){const{name:b,fn:g}=l[p],{x,y:w,data:N,reset:C}=await g({x:h,y:f,initialPlacement:n,placement:m,strategy:a,middlewareData:y,rects:u,platform:o,elements:{reference:e,floating:t}});h=x??h,f=w??f,y={...y,[b]:{...y[b],...N}},C&&v<=50&&(v++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(u=C.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):C.rects),{x:h,y:f}=ty(u,m,c)),p=-1)}return{x:h,y:f,placement:m,strategy:a,middlewareData:y}};async function Nl(e,t){var r;t===void 0&&(t={});const{x:n,y:a,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:m=!1,padding:y=0}=is(t,e),v=Ij(y),b=l[m?f==="floating"?"reference":"floating":f],g=Bu(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(b)))==null||r?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:h,strategy:c})),x=f==="floating"?{x:n,y:a,width:o.floating.width,height:o.floating.height}:o.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),N=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},C=Bu(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:w,strategy:c}):x);return{top:(g.top-C.top+v.top)/N.y,bottom:(C.bottom-g.bottom+v.bottom)/N.y,left:(g.left-C.left+v.left)/N.x,right:(C.right-g.right+v.right)/N.x}}const $I=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:h=0}=is(e,t)||{};if(u==null)return{};const f=Ij(h),m={x:r,y:n},y=gg(a),v=pg(y),p=await o.getDimensions(u),b=y==="y",g=b?"top":"left",x=b?"bottom":"right",w=b?"clientHeight":"clientWidth",N=i.reference[v]+i.reference[y]-m[y]-i.floating[v],C=m[y]-i.reference[y],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let T=k?k[w]:0;(!T||!await(o.isElement==null?void 0:o.isElement(k)))&&(T=l.floating[w]||i.floating[v]);const P=N/2-C/2,I=T/2-p[v]/2-1,D=Ys(f[g],I),E=Ys(f[x],I),M=D,U=T-p[v]-E,$=T/2-p[v]/2+P,G=Th(M,$,U),F=!c.arrow&&lo(a)!=null&&$!==G&&i.reference[v]/2-($<M?D:E)-p[v]/2<0,X=F?$<M?$-M:$-U:0;return{[y]:m[y]+X,data:{[y]:G,centerOffset:$-G-X,...F&&{alignmentOffset:X}},reset:F}}}),UI=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:p=!0,...b}=is(e,t);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const g=os(a),x=Xs(l),w=os(l)===l,N=await(c.isRTL==null?void 0:c.isRTL(u.floating)),C=m||(w||!p?[Vu(l)]:MI(l)),k=v!=="none";!m&&k&&C.push(...DI(l,p,v,N));const T=[l,...C],P=await Nl(t,b),I=[];let D=((n=i.flip)==null?void 0:n.overflows)||[];if(h&&I.push(P[g]),f){const $=II(a,o,N);I.push(P[$[0]],P[$[1]])}if(D=[...D,{placement:a,overflows:I}],!I.every($=>$<=0)){var E,M;const $=(((E=i.flip)==null?void 0:E.index)||0)+1,G=T[$];if(G)return{data:{index:$,overflows:D},reset:{placement:G}};let F=(M=D.filter(X=>X.overflows[0]<=0).sort((X,A)=>X.overflows[1]-A.overflows[1])[0])==null?void 0:M.placement;if(!F)switch(y){case"bestFit":{var U;const X=(U=D.filter(A=>{if(k){const O=Xs(A.placement);return O===x||O==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(O=>O>0).reduce((O,Y)=>O+Y,0)]).sort((A,O)=>A[1]-O[1])[0])==null?void 0:U[0];X&&(F=X);break}case"initialPlacement":F=l;break}if(a!==F)return{reset:{placement:F}}}return{}}}};function ry(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ny(e){return PI.some(t=>e[t]>=0)}const zI=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...a}=is(e,t);switch(n){case"referenceHidden":{const i=await Nl(t,{...a,elementContext:"reference"}),o=ry(i,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:ny(o)}}}case"escaped":{const i=await Nl(t,{...a,altBoundary:!0}),o=ry(i,r.floating);return{data:{escapedOffsets:o,escaped:ny(o)}}}default:return{}}}}};async function VI(e,t){const{placement:r,platform:n,elements:a}=e,i=await(n.isRTL==null?void 0:n.isRTL(a.floating)),o=os(r),l=lo(r),c=Xs(r)==="y",u=["left","top"].includes(o)?-1:1,h=i&&c?-1:1,f=is(t,e);let{mainAxis:m,crossAxis:y,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof v=="number"&&(y=l==="end"?v*-1:v),c?{x:y*h,y:m*u}:{x:m*u,y:y*h}}const BI=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:i,placement:o,middlewareData:l}=t,c=await VI(t,e);return o===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:o}}}}},HI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:b=>{let{x:g,y:x}=b;return{x:g,y:x}}},...c}=is(e,t),u={x:r,y:n},h=await Nl(t,c),f=Xs(os(a)),m=hg(f);let y=u[m],v=u[f];if(i){const b=m==="y"?"top":"left",g=m==="y"?"bottom":"right",x=y+h[b],w=y-h[g];y=Th(x,y,w)}if(o){const b=f==="y"?"top":"left",g=f==="y"?"bottom":"right",x=v+h[b],w=v-h[g];v=Th(x,v,w)}const p=l.fn({...t,[m]:y,[f]:v});return{...p,data:{x:p.x-r,y:p.y-n,enabled:{[m]:i,[f]:o}}}}}},WI=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=is(e,t),h={x:r,y:n},f=Xs(a),m=hg(f);let y=h[m],v=h[f];const p=is(l,t),b=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(c){const w=m==="y"?"height":"width",N=i.reference[m]-i.floating[w]+b.mainAxis,C=i.reference[m]+i.reference[w]-b.mainAxis;y<N?y=N:y>C&&(y=C)}if(u){var g,x;const w=m==="y"?"width":"height",N=["top","left"].includes(os(a)),C=i.reference[f]-i.floating[w]+(N&&((g=o.offset)==null?void 0:g[f])||0)+(N?0:b.crossAxis),k=i.reference[f]+i.reference[w]+(N?0:((x=o.offset)==null?void 0:x[f])||0)-(N?b.crossAxis:0);v<C?v=C:v>k&&(v=k)}return{[m]:y,[f]:v}}}},qI=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...u}=is(e,t),h=await Nl(t,u),f=os(a),m=lo(a),y=Xs(a)==="y",{width:v,height:p}=i.floating;let b,g;f==="top"||f==="bottom"?(b=f,g=m===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(g=f,b=m==="end"?"top":"bottom");const x=p-h.top-h.bottom,w=v-h.left-h.right,N=Ys(p-h[b],x),C=Ys(v-h[g],w),k=!t.middlewareData.shift;let T=N,P=C;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(P=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=x),k&&!m){const D=jr(h.left,0),E=jr(h.right,0),M=jr(h.top,0),U=jr(h.bottom,0);y?P=v-2*(D!==0||E!==0?D+E:jr(h.left,h.right)):T=p-2*(M!==0||U!==0?M+U:jr(h.top,h.bottom))}await c({...t,availableWidth:P,availableHeight:T});const I=await o.getDimensions(l.floating);return v!==I.width||p!==I.height?{reset:{rects:!0}}:{}}}};function Td(){return typeof window<"u"}function co(e){return Mj(e)?(e.nodeName||"").toLowerCase():"#document"}function Sr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function In(e){var t;return(t=(Mj(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Mj(e){return Td()?e instanceof Node||e instanceof Sr(e).Node:!1}function an(e){return Td()?e instanceof Element||e instanceof Sr(e).Element:!1}function Rn(e){return Td()?e instanceof HTMLElement||e instanceof Sr(e).HTMLElement:!1}function sy(e){return!Td()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Sr(e).ShadowRoot}function Vl(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=on(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(a)}function KI(e){return["table","td","th"].includes(co(e))}function Pd(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function xg(e){const t=vg(),r=an(e)?on(e):e;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function GI(e){let t=Js(e);for(;Rn(t)&&!Xi(t);){if(xg(t))return t;if(Pd(t))return null;t=Js(t)}return null}function vg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Xi(e){return["html","body","#document"].includes(co(e))}function on(e){return Sr(e).getComputedStyle(e)}function Rd(e){return an(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Js(e){if(co(e)==="html")return e;const t=e.assignedSlot||e.parentNode||sy(e)&&e.host||In(e);return sy(t)?t.host:t}function Oj(e){const t=Js(e);return Xi(t)?e.ownerDocument?e.ownerDocument.body:e.body:Rn(t)&&Vl(t)?t:Oj(t)}function Cl(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const a=Oj(e),i=a===((n=e.ownerDocument)==null?void 0:n.body),o=Sr(a);if(i){const l=Rh(o);return t.concat(o,o.visualViewport||[],Vl(a)?a:[],l&&r?Cl(l):[])}return t.concat(a,Cl(a,[],r))}function Rh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Dj(e){const t=on(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=Rn(e),i=a?e.offsetWidth:r,o=a?e.offsetHeight:n,l=zu(r)!==i||zu(n)!==o;return l&&(r=i,n=o),{width:r,height:n,$:l}}function yg(e){return an(e)?e:e.contextElement}function Ei(e){const t=yg(e);if(!Rn(t))return Zs(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:i}=Dj(t);let o=(i?zu(r.width):r.width)/n,l=(i?zu(r.height):r.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const QI=Zs(0);function Fj(e){const t=Sr(e);return!vg()||!t.visualViewport?QI:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function YI(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Sr(e)?!1:t}function Ua(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const a=e.getBoundingClientRect(),i=yg(e);let o=Zs(1);t&&(n?an(n)&&(o=Ei(n)):o=Ei(e));const l=YI(i,r,n)?Fj(i):Zs(0);let c=(a.left+l.x)/o.x,u=(a.top+l.y)/o.y,h=a.width/o.x,f=a.height/o.y;if(i){const m=Sr(i),y=n&&an(n)?Sr(n):n;let v=m,p=Rh(v);for(;p&&n&&y!==v;){const b=Ei(p),g=p.getBoundingClientRect(),x=on(p),w=g.left+(p.clientLeft+parseFloat(x.paddingLeft))*b.x,N=g.top+(p.clientTop+parseFloat(x.paddingTop))*b.y;c*=b.x,u*=b.y,h*=b.x,f*=b.y,c+=w,u+=N,v=Sr(p),p=Rh(v)}}return Bu({width:h,height:f,x:c,y:u})}function ZI(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const i=a==="fixed",o=In(n),l=t?Pd(t.floating):!1;if(n===o||l&&i)return r;let c={scrollLeft:0,scrollTop:0},u=Zs(1);const h=Zs(0),f=Rn(n);if((f||!f&&!i)&&((co(n)!=="body"||Vl(o))&&(c=Rd(n)),Rn(n))){const m=Ua(n);u=Ei(n),h.x=m.x+n.clientLeft,h.y=m.y+n.clientTop}return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+h.x,y:r.y*u.y-c.scrollTop*u.y+h.y}}function XI(e){return Array.from(e.getClientRects())}function Ah(e,t){const r=Rd(e).scrollLeft;return t?t.left+r:Ua(In(e)).left+r}function JI(e){const t=In(e),r=Rd(e),n=e.ownerDocument.body,a=jr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=jr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+Ah(e);const l=-r.scrollTop;return on(n).direction==="rtl"&&(o+=jr(t.clientWidth,n.clientWidth)-a),{width:a,height:i,x:o,y:l}}function eM(e,t){const r=Sr(e),n=In(e),a=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,l=0,c=0;if(a){i=a.width,o=a.height;const u=vg();(!u||u&&t==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}return{width:i,height:o,x:l,y:c}}function tM(e,t){const r=Ua(e,!0,t==="fixed"),n=r.top+e.clientTop,a=r.left+e.clientLeft,i=Rn(e)?Ei(e):Zs(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=a*i.x,u=n*i.y;return{width:o,height:l,x:c,y:u}}function ay(e,t,r){let n;if(t==="viewport")n=eM(e,r);else if(t==="document")n=JI(In(e));else if(an(t))n=tM(t,r);else{const a=Fj(e);n={...t,x:t.x-a.x,y:t.y-a.y}}return Bu(n)}function Lj(e,t){const r=Js(e);return r===t||!an(r)||Xi(r)?!1:on(r).position==="fixed"||Lj(r,t)}function rM(e,t){const r=t.get(e);if(r)return r;let n=Cl(e,[],!1).filter(l=>an(l)&&co(l)!=="body"),a=null;const i=on(e).position==="fixed";let o=i?Js(e):e;for(;an(o)&&!Xi(o);){const l=on(o),c=xg(o);!c&&l.position==="fixed"&&(a=null),(i?!c&&!a:!c&&l.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||Vl(o)&&!c&&Lj(e,o))?n=n.filter(h=>h!==o):a=l,o=Js(o)}return t.set(e,n),n}function nM(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o=[...r==="clippingAncestors"?Pd(t)?[]:rM(t,this._c):[].concat(r),n],l=o[0],c=o.reduce((u,h)=>{const f=ay(t,h,a);return u.top=jr(f.top,u.top),u.right=Ys(f.right,u.right),u.bottom=Ys(f.bottom,u.bottom),u.left=jr(f.left,u.left),u},ay(t,l,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function sM(e){const{width:t,height:r}=Dj(e);return{width:t,height:r}}function aM(e,t,r){const n=Rn(t),a=In(t),i=r==="fixed",o=Ua(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Zs(0);if(n||!n&&!i)if((co(t)!=="body"||Vl(a))&&(l=Rd(t)),n){const y=Ua(t,!0,i,t);c.x=y.x+t.clientLeft,c.y=y.y+t.clientTop}else a&&(c.x=Ah(a));let u=0,h=0;if(a&&!n&&!i){const y=a.getBoundingClientRect();h=y.top+l.scrollTop,u=y.left+l.scrollLeft-Ah(a,y)}const f=o.left+l.scrollLeft-c.x-u,m=o.top+l.scrollTop-c.y-h;return{x:f,y:m,width:o.width,height:o.height}}function Qf(e){return on(e).position==="static"}function iy(e,t){if(!Rn(e)||on(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return In(e)===r&&(r=r.ownerDocument.body),r}function $j(e,t){const r=Sr(e);if(Pd(e))return r;if(!Rn(e)){let a=Js(e);for(;a&&!Xi(a);){if(an(a)&&!Qf(a))return a;a=Js(a)}return r}let n=iy(e,t);for(;n&&KI(n)&&Qf(n);)n=iy(n,t);return n&&Xi(n)&&Qf(n)&&!xg(n)?r:n||GI(e)||r}const iM=async function(e){const t=this.getOffsetParent||$j,r=this.getDimensions,n=await r(e.floating);return{reference:aM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function oM(e){return on(e).direction==="rtl"}const lM={convertOffsetParentRelativeRectToViewportRelativeRect:ZI,getDocumentElement:In,getClippingRect:nM,getOffsetParent:$j,getElementRects:iM,getClientRects:XI,getDimensions:sM,getScale:Ei,isElement:an,isRTL:oM};function cM(e,t){let r=null,n;const a=In(e);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const{left:u,top:h,width:f,height:m}=e.getBoundingClientRect();if(l||t(),!f||!m)return;const y=Nc(h),v=Nc(a.clientWidth-(u+f)),p=Nc(a.clientHeight-(h+m)),b=Nc(u),x={rootMargin:-y+"px "+-v+"px "+-p+"px "+-b+"px",threshold:jr(0,Ys(1,c))||1};let w=!0;function N(C){const k=C[0].intersectionRatio;if(k!==c){if(!w)return o();k?o(!1,k):n=setTimeout(()=>{o(!1,1e-7)},1e3)}w=!1}try{r=new IntersectionObserver(N,{...x,root:a.ownerDocument})}catch{r=new IntersectionObserver(N,x)}r.observe(e)}return o(!0),i}function uM(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=yg(e),h=a||i?[...u?Cl(u):[],...Cl(t)]:[];h.forEach(g=>{a&&g.addEventListener("scroll",r,{passive:!0}),i&&g.addEventListener("resize",r)});const f=u&&l?cM(u,r):null;let m=-1,y=null;o&&(y=new ResizeObserver(g=>{let[x]=g;x&&x.target===u&&y&&(y.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=y)==null||w.observe(t)})),r()}),u&&!c&&y.observe(u),y.observe(t));let v,p=c?Ua(e):null;c&&b();function b(){const g=Ua(e);p&&(g.x!==p.x||g.y!==p.y||g.width!==p.width||g.height!==p.height)&&r(),p=g,v=requestAnimationFrame(b)}return r(),()=>{var g;h.forEach(x=>{a&&x.removeEventListener("scroll",r),i&&x.removeEventListener("resize",r)}),f==null||f(),(g=y)==null||g.disconnect(),y=null,c&&cancelAnimationFrame(v)}}const dM=BI,fM=HI,mM=UI,hM=qI,pM=zI,oy=$I,gM=WI,xM=(e,t,r)=>{const n=new Map,a={platform:lM,...r},i={...a.platform,_c:n};return LI(e,t,{...a,platform:i})};var Bc=typeof document<"u"?d.useLayoutEffect:d.useEffect;function Hu(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 r,n,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Hu(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;n--!==0;){const i=a[n];if(!(i==="_owner"&&e.$$typeof)&&!Hu(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Uj(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ly(e,t){const r=Uj(e);return Math.round(t*r)/r}function Yf(e){const t=d.useRef(e);return Bc(()=>{t.current=e}),t}function vM(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[h,f]=d.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,y]=d.useState(n);Hu(m,n)||y(n);const[v,p]=d.useState(null),[b,g]=d.useState(null),x=d.useCallback(A=>{A!==k.current&&(k.current=A,p(A))},[]),w=d.useCallback(A=>{A!==T.current&&(T.current=A,g(A))},[]),N=i||v,C=o||b,k=d.useRef(null),T=d.useRef(null),P=d.useRef(h),I=c!=null,D=Yf(c),E=Yf(a),M=Yf(u),U=d.useCallback(()=>{if(!k.current||!T.current)return;const A={placement:t,strategy:r,middleware:m};E.current&&(A.platform=E.current),xM(k.current,T.current,A).then(O=>{const Y={...O,isPositioned:M.current!==!1};$.current&&!Hu(P.current,Y)&&(P.current=Y,Ha.flushSync(()=>{f(Y)}))})},[m,t,r,E,M]);Bc(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(A=>({...A,isPositioned:!1})))},[u]);const $=d.useRef(!1);Bc(()=>($.current=!0,()=>{$.current=!1}),[]),Bc(()=>{if(N&&(k.current=N),C&&(T.current=C),N&&C){if(D.current)return D.current(N,C,U);U()}},[N,C,U,D,I]);const G=d.useMemo(()=>({reference:k,floating:T,setReference:x,setFloating:w}),[x,w]),F=d.useMemo(()=>({reference:N,floating:C}),[N,C]),X=d.useMemo(()=>{const A={position:r,left:0,top:0};if(!F.floating)return A;const O=ly(F.floating,h.x),Y=ly(F.floating,h.y);return l?{...A,transform:"translate("+O+"px, "+Y+"px)",...Uj(F.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:O,top:Y}},[r,l,F.floating,h.x,h.y]);return d.useMemo(()=>({...h,update:U,refs:G,elements:F,floatingStyles:X}),[h,U,G,F,X])}const yM=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:a}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?oy({element:n.current,padding:a}).fn(r):{}:n?oy({element:n,padding:a}).fn(r):{}}}},wM=(e,t)=>({...dM(e),options:[e,t]}),bM=(e,t)=>({...fM(e),options:[e,t]}),jM=(e,t)=>({...gM(e),options:[e,t]}),NM=(e,t)=>({...mM(e),options:[e,t]}),CM=(e,t)=>({...hM(e),options:[e,t]}),SM=(e,t)=>({...pM(e),options:[e,t]}),_M=(e,t)=>({...yM(e),options:[e,t]});var EM="Arrow",zj=d.forwardRef((e,t)=>{const{children:r,width:n=10,height:a=5,...i}=e;return s.jsx(xe.svg,{...i,ref:t,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});zj.displayName=EM;var kM=zj;function TM(e,t=[]){let r=[];function n(i,o){const l=d.createContext(o),c=r.length;r=[...r,o];function u(f){const{scope:m,children:y,...v}=f,p=(m==null?void 0:m[e][c])||l,b=d.useMemo(()=>v,Object.values(v));return s.jsx(p.Provider,{value:b,children:y})}function h(f,m){const y=(m==null?void 0:m[e][c])||l,v=d.useContext(y);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,h]}const a=()=>{const i=r.map(o=>d.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return d.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[n,PM(a,...t)]}function PM(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:u})=>{const f=c(i)[`__scope${u}`];return{...l,...f}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function Vj(e){const[t,r]=d.useState(void 0);return Tt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;r({width:o,height:l})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var wg="Popper",[Bj,Ad]=TM(wg),[RM,Hj]=Bj(wg),Wj=e=>{const{__scopePopper:t,children:r}=e,[n,a]=d.useState(null);return s.jsx(RM,{scope:t,anchor:n,onAnchorChange:a,children:r})};Wj.displayName=wg;var qj="PopperAnchor",Kj=d.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...a}=e,i=Hj(qj,r),o=d.useRef(null),l=He(t,o);return d.useEffect(()=>{i.onAnchorChange((n==null?void 0:n.current)||o.current)}),n?null:s.jsx(xe.div,{...a,ref:l})});Kj.displayName=qj;var bg="PopperContent",[AM,IM]=Bj(bg),Gj=d.forwardRef((e,t)=>{var ae,Se,Pe,Ne,Ie,fe;const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:h=0,sticky:f="partial",hideWhenDetached:m=!1,updatePositionStrategy:y="optimized",onPlaced:v,...p}=e,b=Hj(bg,r),[g,x]=d.useState(null),w=He(t,We=>x(We)),[N,C]=d.useState(null),k=Vj(N),T=(k==null?void 0:k.width)??0,P=(k==null?void 0:k.height)??0,I=n+(i!=="center"?"-"+i:""),D=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},E=Array.isArray(u)?u:[u],M=E.length>0,U={padding:D,boundary:E.filter(OM),altBoundary:M},{refs:$,floatingStyles:G,placement:F,isPositioned:X,middlewareData:A}=vM({strategy:"fixed",placement:I,whileElementsMounted:(...We)=>uM(...We,{animationFrame:y==="always"}),elements:{reference:b.anchor},middleware:[wM({mainAxis:a+P,alignmentAxis:o}),c&&bM({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?jM():void 0,...U}),c&&NM({...U}),CM({...U,apply:({elements:We,rects:_t,availableWidth:ar,availableHeight:Xe})=>{const{width:Wt,height:S}=_t.reference,R=We.floating.style;R.setProperty("--radix-popper-available-width",`${ar}px`),R.setProperty("--radix-popper-available-height",`${Xe}px`),R.setProperty("--radix-popper-anchor-width",`${Wt}px`),R.setProperty("--radix-popper-anchor-height",`${S}px`)}}),N&&_M({element:N,padding:l}),DM({arrowWidth:T,arrowHeight:P}),m&&SM({strategy:"referenceHidden",...U})]}),[O,Y]=Zj(F),K=Ot(v);Tt(()=>{X&&(K==null||K())},[X,K]);const te=(ae=A.arrow)==null?void 0:ae.x,ge=(Se=A.arrow)==null?void 0:Se.y,ke=((Pe=A.arrow)==null?void 0:Pe.centerOffset)!==0,[Ze,ye]=d.useState();return Tt(()=>{g&&ye(window.getComputedStyle(g).zIndex)},[g]),s.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:X?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ze,"--radix-popper-transform-origin":[(Ne=A.transformOrigin)==null?void 0:Ne.x,(Ie=A.transformOrigin)==null?void 0:Ie.y].join(" "),...((fe=A.hide)==null?void 0:fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(AM,{scope:r,placedSide:O,onArrowChange:C,arrowX:te,arrowY:ge,shouldHideArrow:ke,children:s.jsx(xe.div,{"data-side":O,"data-align":Y,...p,ref:w,style:{...p.style,animation:X?void 0:"none"}})})})});Gj.displayName=bg;var Qj="PopperArrow",MM={top:"bottom",right:"left",bottom:"top",left:"right"},Yj=d.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,i=IM(Qj,n),o=MM[i.placedSide];return s.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:s.jsx(kM,{...a,ref:r,style:{...a.style,display:"block"}})})});Yj.displayName=Qj;function OM(e){return e!==null}var DM=e=>({name:"transformOrigin",options:e,fn(t){var b,g,x;const{placement:r,rects:n,middlewareData:a}=t,o=((b=a.arrow)==null?void 0:b.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,h]=Zj(r),f={start:"0%",center:"50%",end:"100%"}[h],m=(((g=a.arrow)==null?void 0:g.x)??0)+l/2,y=(((x=a.arrow)==null?void 0:x.y)??0)+c/2;let v="",p="";return u==="bottom"?(v=o?f:`${m}px`,p=`${-c}px`):u==="top"?(v=o?f:`${m}px`,p=`${n.floating.height+c}px`):u==="right"?(v=`${-c}px`,p=o?f:`${y}px`):u==="left"&&(v=`${n.floating.width+c}px`,p=o?f:`${y}px`),{data:{x:v,y:p}}}});function Zj(e){const[t,r="center"]=e.split("-");return[t,r]}var Xj=Wj,Jj=Kj,eN=Gj,tN=Yj;function rN(e){const t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var FM=[" ","Enter","ArrowUp","ArrowDown"],LM=[" ","Enter"],Bl="Select",[Id,Md,$M]=md(Bl),[uo,jD]=sa(Bl,[$M,Ad]),Od=Ad(),[UM,oa]=uo(Bl),[zM,VM]=uo(Bl),nN=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:a,onOpenChange:i,value:o,defaultValue:l,onValueChange:c,dir:u,name:h,autoComplete:f,disabled:m,required:y,form:v}=e,p=Od(t),[b,g]=d.useState(null),[x,w]=d.useState(null),[N,C]=d.useState(!1),k=kd(u),[T=!1,P]=Ia({prop:n,defaultProp:a,onChange:i}),[I,D]=Ia({prop:o,defaultProp:l,onChange:c}),E=d.useRef(null),M=b?v||!!b.closest("form"):!0,[U,$]=d.useState(new Set),G=Array.from(U).map(F=>F.props.value).join(";");return s.jsx(Xj,{...p,children:s.jsxs(UM,{required:y,scope:t,trigger:b,onTriggerChange:g,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:N,onValueNodeHasChildrenChange:C,contentId:Xn(),value:I,onValueChange:D,open:T,onOpenChange:P,dir:k,triggerPointerDownPosRef:E,disabled:m,children:[s.jsx(Id.Provider,{scope:t,children:s.jsx(zM,{scope:e.__scopeSelect,onNativeOptionAdd:d.useCallback(F=>{$(X=>new Set(X).add(F))},[]),onNativeOptionRemove:d.useCallback(F=>{$(X=>{const A=new Set(X);return A.delete(F),A})},[]),children:r})}),M?s.jsxs(kN,{"aria-hidden":!0,required:y,tabIndex:-1,name:h,autoComplete:f,value:I,onChange:F=>D(F.target.value),disabled:m,form:v,children:[I===void 0?s.jsx("option",{value:""}):null,Array.from(U)]},G):null]})})};nN.displayName=Bl;var sN="SelectTrigger",aN=d.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...a}=e,i=Od(r),o=oa(sN,r),l=o.disabled||n,c=He(t,o.onTriggerChange),u=Md(r),h=d.useRef("touch"),[f,m,y]=TN(p=>{const b=u().filter(w=>!w.disabled),g=b.find(w=>w.value===o.value),x=PN(b,p,g);x!==void 0&&o.onValueChange(x.value)}),v=p=>{l||(o.onOpenChange(!0),y()),p&&(o.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return s.jsx(Jj,{asChild:!0,...i,children:s.jsx(xe.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":EN(o.value)?"":void 0,...a,ref:c,onClick:ne(a.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&v(p)}),onPointerDown:ne(a.onPointerDown,p=>{h.current=p.pointerType;const b=p.target;b.hasPointerCapture(p.pointerId)&&b.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(v(p),p.preventDefault())}),onKeyDown:ne(a.onKeyDown,p=>{const b=f.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&m(p.key),!(b&&p.key===" ")&&FM.includes(p.key)&&(v(),p.preventDefault())})})})});aN.displayName=sN;var iN="SelectValue",oN=d.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:a,children:i,placeholder:o="",...l}=e,c=oa(iN,r),{onValueNodeHasChildrenChange:u}=c,h=i!==void 0,f=He(t,c.onValueNodeChange);return Tt(()=>{u(h)},[u,h]),s.jsx(xe.span,{...l,ref:f,style:{pointerEvents:"none"},children:EN(c.value)?s.jsx(s.Fragment,{children:o}):i})});oN.displayName=iN;var BM="SelectIcon",lN=d.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...a}=e;return s.jsx(xe.span,{"aria-hidden":!0,...a,ref:t,children:n||"▼"})});lN.displayName=BM;var HM="SelectPortal",cN=e=>s.jsx(Fl,{asChild:!0,...e});cN.displayName=HM;var za="SelectContent",uN=d.forwardRef((e,t)=>{const r=oa(za,e.__scopeSelect),[n,a]=d.useState();if(Tt(()=>{a(new DocumentFragment)},[]),!r.open){const i=n;return i?Ha.createPortal(s.jsx(dN,{scope:e.__scopeSelect,children:s.jsx(Id.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(fN,{...e,ref:t})});uN.displayName=za;var Gr=10,[dN,la]=uo(za),WM="SelectContentImpl",fN=d.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:h,arrowPadding:f,collisionBoundary:m,collisionPadding:y,sticky:v,hideWhenDetached:p,avoidCollisions:b,...g}=e,x=oa(za,r),[w,N]=d.useState(null),[C,k]=d.useState(null),T=He(t,ae=>N(ae)),[P,I]=d.useState(null),[D,E]=d.useState(null),M=Md(r),[U,$]=d.useState(!1),G=d.useRef(!1);d.useEffect(()=>{if(w)return cg(w)},[w]),lg();const F=d.useCallback(ae=>{const[Se,...Pe]=M().map(fe=>fe.ref.current),[Ne]=Pe.slice(-1),Ie=document.activeElement;for(const fe of ae)if(fe===Ie||(fe==null||fe.scrollIntoView({block:"nearest"}),fe===Se&&C&&(C.scrollTop=0),fe===Ne&&C&&(C.scrollTop=C.scrollHeight),fe==null||fe.focus(),document.activeElement!==Ie))return},[M,C]),X=d.useCallback(()=>F([P,w]),[F,P,w]);d.useEffect(()=>{U&&X()},[U,X]);const{onOpenChange:A,triggerPointerDownPosRef:O}=x;d.useEffect(()=>{if(w){let ae={x:0,y:0};const Se=Ne=>{var Ie,fe;ae={x:Math.abs(Math.round(Ne.pageX)-(((Ie=O.current)==null?void 0:Ie.x)??0)),y:Math.abs(Math.round(Ne.pageY)-(((fe=O.current)==null?void 0:fe.y)??0))}},Pe=Ne=>{ae.x<=10&&ae.y<=10?Ne.preventDefault():w.contains(Ne.target)||A(!1),document.removeEventListener("pointermove",Se),O.current=null};return O.current!==null&&(document.addEventListener("pointermove",Se),document.addEventListener("pointerup",Pe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Se),document.removeEventListener("pointerup",Pe,{capture:!0})}}},[w,A,O]),d.useEffect(()=>{const ae=()=>A(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[A]);const[Y,K]=TN(ae=>{const Se=M().filter(Ie=>!Ie.disabled),Pe=Se.find(Ie=>Ie.ref.current===document.activeElement),Ne=PN(Se,ae,Pe);Ne&&setTimeout(()=>Ne.ref.current.focus())}),te=d.useCallback((ae,Se,Pe)=>{const Ne=!G.current&&!Pe;(x.value!==void 0&&x.value===Se||Ne)&&(I(ae),Ne&&(G.current=!0))},[x.value]),ge=d.useCallback(()=>w==null?void 0:w.focus(),[w]),ke=d.useCallback((ae,Se,Pe)=>{const Ne=!G.current&&!Pe;(x.value!==void 0&&x.value===Se||Ne)&&E(ae)},[x.value]),Ze=n==="popper"?Ih:mN,ye=Ze===Ih?{side:l,sideOffset:c,align:u,alignOffset:h,arrowPadding:f,collisionBoundary:m,collisionPadding:y,sticky:v,hideWhenDetached:p,avoidCollisions:b}:{};return s.jsx(dN,{scope:r,content:w,viewport:C,onViewportChange:k,itemRefCallback:te,selectedItem:P,onItemLeave:ge,itemTextRefCallback:ke,focusSelectedItem:X,selectedItemText:D,position:n,isPositioned:U,searchRef:Y,children:s.jsx(Ed,{as:Gs,allowPinchZoom:!0,children:s.jsx(Sd,{asChild:!0,trapped:x.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:ne(a,ae=>{var Se;(Se=x.trigger)==null||Se.focus({preventScroll:!0}),ae.preventDefault()}),children:s.jsx(Dl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:s.jsx(Ze,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:ae=>ae.preventDefault(),...g,...ye,onPlaced:()=>$(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:ne(g.onKeyDown,ae=>{const Se=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!Se&&ae.key.length===1&&K(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let Ne=M().filter(Ie=>!Ie.disabled).map(Ie=>Ie.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(Ne=Ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const Ie=ae.target,fe=Ne.indexOf(Ie);Ne=Ne.slice(fe+1)}setTimeout(()=>F(Ne)),ae.preventDefault()}})})})})})})});fN.displayName=WM;var qM="SelectItemAlignedPosition",mN=d.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...a}=e,i=oa(za,r),o=la(za,r),[l,c]=d.useState(null),[u,h]=d.useState(null),f=He(t,T=>h(T)),m=Md(r),y=d.useRef(!1),v=d.useRef(!0),{viewport:p,selectedItem:b,selectedItemText:g,focusSelectedItem:x}=o,w=d.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&p&&b&&g){const T=i.trigger.getBoundingClientRect(),P=u.getBoundingClientRect(),I=i.valueNode.getBoundingClientRect(),D=g.getBoundingClientRect();if(i.dir!=="rtl"){const Ie=D.left-P.left,fe=I.left-Ie,We=T.left-fe,_t=T.width+We,ar=Math.max(_t,P.width),Xe=window.innerWidth-Gr,Wt=ey(fe,[Gr,Math.max(Gr,Xe-ar)]);l.style.minWidth=_t+"px",l.style.left=Wt+"px"}else{const Ie=P.right-D.right,fe=window.innerWidth-I.right-Ie,We=window.innerWidth-T.right-fe,_t=T.width+We,ar=Math.max(_t,P.width),Xe=window.innerWidth-Gr,Wt=ey(fe,[Gr,Math.max(Gr,Xe-ar)]);l.style.minWidth=_t+"px",l.style.right=Wt+"px"}const E=m(),M=window.innerHeight-Gr*2,U=p.scrollHeight,$=window.getComputedStyle(u),G=parseInt($.borderTopWidth,10),F=parseInt($.paddingTop,10),X=parseInt($.borderBottomWidth,10),A=parseInt($.paddingBottom,10),O=G+F+U+A+X,Y=Math.min(b.offsetHeight*5,O),K=window.getComputedStyle(p),te=parseInt(K.paddingTop,10),ge=parseInt(K.paddingBottom,10),ke=T.top+T.height/2-Gr,Ze=M-ke,ye=b.offsetHeight/2,ae=b.offsetTop+ye,Se=G+F+ae,Pe=O-Se;if(Se<=ke){const Ie=E.length>0&&b===E[E.length-1].ref.current;l.style.bottom="0px";const fe=u.clientHeight-p.offsetTop-p.offsetHeight,We=Math.max(Ze,ye+(Ie?ge:0)+fe+X),_t=Se+We;l.style.height=_t+"px"}else{const Ie=E.length>0&&b===E[0].ref.current;l.style.top="0px";const We=Math.max(ke,G+p.offsetTop+(Ie?te:0)+ye)+Pe;l.style.height=We+"px",p.scrollTop=Se-ke+p.offsetTop}l.style.margin=`${Gr}px 0`,l.style.minHeight=Y+"px",l.style.maxHeight=M+"px",n==null||n(),requestAnimationFrame(()=>y.current=!0)}},[m,i.trigger,i.valueNode,l,u,p,b,g,i.dir,n]);Tt(()=>w(),[w]);const[N,C]=d.useState();Tt(()=>{u&&C(window.getComputedStyle(u).zIndex)},[u]);const k=d.useCallback(T=>{T&&v.current===!0&&(w(),x==null||x(),v.current=!1)},[w,x]);return s.jsx(GM,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:k,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:s.jsx(xe.div,{...a,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});mN.displayName=qM;var KM="SelectPopperPosition",Ih=d.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:a=Gr,...i}=e,o=Od(r);return s.jsx(eN,{...o,...i,ref:t,align:n,collisionPadding:a,style:{boxSizing:"border-box",...i.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)"}})});Ih.displayName=KM;var[GM,jg]=uo(za,{}),Mh="SelectViewport",hN=d.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...a}=e,i=la(Mh,r),o=jg(Mh,r),l=He(t,i.onViewportChange),c=d.useRef(0);return s.jsxs(s.Fragment,{children:[s.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:n}),s.jsx(Id.Slot,{scope:r,children:s.jsx(xe.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:ne(a.onScroll,u=>{const h=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:m}=o;if(m!=null&&m.current&&f){const y=Math.abs(c.current-h.scrollTop);if(y>0){const v=window.innerHeight-Gr*2,p=parseFloat(f.style.minHeight),b=parseFloat(f.style.height),g=Math.max(p,b);if(g<v){const x=g+y,w=Math.min(v,x),N=x-w;f.style.height=w+"px",f.style.bottom==="0px"&&(h.scrollTop=N>0?N:0,f.style.justifyContent="flex-end")}}}c.current=h.scrollTop})})})]})});hN.displayName=Mh;var pN="SelectGroup",[QM,YM]=uo(pN),ZM=d.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=Xn();return s.jsx(QM,{scope:r,id:a,children:s.jsx(xe.div,{role:"group","aria-labelledby":a,...n,ref:t})})});ZM.displayName=pN;var gN="SelectLabel",xN=d.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=YM(gN,r);return s.jsx(xe.div,{id:a.id,...n,ref:t})});xN.displayName=gN;var Wu="SelectItem",[XM,vN]=uo(Wu),yN=d.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:a=!1,textValue:i,...o}=e,l=oa(Wu,r),c=la(Wu,r),u=l.value===n,[h,f]=d.useState(i??""),[m,y]=d.useState(!1),v=He(t,x=>{var w;return(w=c.itemRefCallback)==null?void 0:w.call(c,x,n,a)}),p=Xn(),b=d.useRef("touch"),g=()=>{a||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")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 s.jsx(XM,{scope:r,value:n,disabled:a,textId:p,isSelected:u,onItemTextChange:d.useCallback(x=>{f(w=>w||((x==null?void 0:x.textContent)??"").trim())},[]),children:s.jsx(Id.ItemSlot,{scope:r,value:n,disabled:a,textValue:h,children:s.jsx(xe.div,{role:"option","aria-labelledby":p,"data-highlighted":m?"":void 0,"aria-selected":u&&m,"data-state":u?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:v,onFocus:ne(o.onFocus,()=>y(!0)),onBlur:ne(o.onBlur,()=>y(!1)),onClick:ne(o.onClick,()=>{b.current!=="mouse"&&g()}),onPointerUp:ne(o.onPointerUp,()=>{b.current==="mouse"&&g()}),onPointerDown:ne(o.onPointerDown,x=>{b.current=x.pointerType}),onPointerMove:ne(o.onPointerMove,x=>{var w;b.current=x.pointerType,a?(w=c.onItemLeave)==null||w.call(c):b.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ne(o.onPointerLeave,x=>{var w;x.currentTarget===document.activeElement&&((w=c.onItemLeave)==null||w.call(c))}),onKeyDown:ne(o.onKeyDown,x=>{var N;((N=c.searchRef)==null?void 0:N.current)!==""&&x.key===" "||(LM.includes(x.key)&&g(),x.key===" "&&x.preventDefault())})})})})});yN.displayName=Wu;var Do="SelectItemText",wN=d.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:a,...i}=e,o=oa(Do,r),l=la(Do,r),c=vN(Do,r),u=VM(Do,r),[h,f]=d.useState(null),m=He(t,g=>f(g),c.onItemTextChange,g=>{var x;return(x=l.itemTextRefCallback)==null?void 0:x.call(l,g,c.value,c.disabled)}),y=h==null?void 0:h.textContent,v=d.useMemo(()=>s.jsx("option",{value:c.value,disabled:c.disabled,children:y},c.value),[c.disabled,c.value,y]),{onNativeOptionAdd:p,onNativeOptionRemove:b}=u;return Tt(()=>(p(v),()=>b(v)),[p,b,v]),s.jsxs(s.Fragment,{children:[s.jsx(xe.span,{id:c.textId,...i,ref:m}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Ha.createPortal(i.children,o.valueNode):null]})});wN.displayName=Do;var bN="SelectItemIndicator",jN=d.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return vN(bN,r).isSelected?s.jsx(xe.span,{"aria-hidden":!0,...n,ref:t}):null});jN.displayName=bN;var Oh="SelectScrollUpButton",NN=d.forwardRef((e,t)=>{const r=la(Oh,e.__scopeSelect),n=jg(Oh,e.__scopeSelect),[a,i]=d.useState(!1),o=He(t,n.onScrollButtonChange);return Tt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollTop>0;i(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),a?s.jsx(SN,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});NN.displayName=Oh;var Dh="SelectScrollDownButton",CN=d.forwardRef((e,t)=>{const r=la(Dh,e.__scopeSelect),n=jg(Dh,e.__scopeSelect),[a,i]=d.useState(!1),o=He(t,n.onScrollButtonChange);return Tt(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,h=Math.ceil(c.scrollTop)<u;i(h)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),a?s.jsx(SN,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});CN.displayName=Dh;var SN=d.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...a}=e,i=la("SelectScrollButton",r),o=d.useRef(null),l=Md(r),c=d.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return d.useEffect(()=>()=>c(),[c]),Tt(()=>{var h;const u=l().find(f=>f.ref.current===document.activeElement);(h=u==null?void 0:u.ref.current)==null||h.scrollIntoView({block:"nearest"})},[l]),s.jsx(xe.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:ne(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:ne(a.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:ne(a.onPointerLeave,()=>{c()})})}),JM="SelectSeparator",_N=d.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return s.jsx(xe.div,{"aria-hidden":!0,...n,ref:t})});_N.displayName=JM;var Fh="SelectArrow",eO=d.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,a=Od(r),i=oa(Fh,r),o=la(Fh,r);return i.open&&o.position==="popper"?s.jsx(tN,{...a,...n,ref:t}):null});eO.displayName=Fh;function EN(e){return e===""||e===void 0}var kN=d.forwardRef((e,t)=>{const{value:r,...n}=e,a=d.useRef(null),i=He(t,a),o=rN(r);return d.useEffect(()=>{const l=a.current,c=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==r&&h){const f=new Event("change",{bubbles:!0});h.call(l,r),l.dispatchEvent(f)}},[o,r]),s.jsx(hd,{asChild:!0,children:s.jsx("select",{...n,ref:i,defaultValue:r})})});kN.displayName="BubbleSelect";function TN(e){const t=Ot(e),r=d.useRef(""),n=d.useRef(0),a=d.useCallback(o=>{const l=r.current+o;t(l),function c(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),i=d.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,a,i]}function PN(e,t,r){const a=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let o=tO(e,Math.max(i,0));a.length===1&&(o=o.filter(u=>u!==r));const c=o.find(u=>u.textValue.toLowerCase().startsWith(a.toLowerCase()));return c!==r?c:void 0}function tO(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var rO=nN,RN=aN,nO=oN,sO=lN,aO=cN,AN=uN,iO=hN,IN=xN,MN=yN,oO=wN,lO=jN,ON=NN,DN=CN,FN=_N;const Os=rO,Ds=nO,qn=d.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(RN,{ref:n,className:le("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,s.jsx(sO,{asChild:!0,children:s.jsx(Up,{className:"h-4 w-4 opacity-50"})})]}));qn.displayName=RN.displayName;const LN=d.forwardRef(({className:e,...t},r)=>s.jsx(ON,{ref:r,className:le("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(sk,{className:"h-4 w-4"})}));LN.displayName=ON.displayName;const $N=d.forwardRef(({className:e,...t},r)=>s.jsx(DN,{ref:r,className:le("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Up,{className:"h-4 w-4"})}));$N.displayName=DN.displayName;const Kn=d.forwardRef(({className:e,children:t,position:r="popper",...n},a)=>s.jsx(aO,{children:s.jsxs(AN,{ref:a,className:le("relative z-50 max-h-96 min-w-[8rem] overflow-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",r==="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:r,...n,children:[s.jsx(LN,{}),s.jsx(iO,{className:le("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx($N,{})]})}));Kn.displayName=AN.displayName;const cO=d.forwardRef(({className:e,...t},r)=>s.jsx(IN,{ref:r,className:le("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));cO.displayName=IN.displayName;const Vt=d.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(MN,{ref:n,className:le("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(lO,{children:s.jsx($p,{className:"h-4 w-4"})})}),s.jsx(oO,{children:t})]}));Vt.displayName=MN.displayName;const uO=d.forwardRef(({className:e,...t},r)=>s.jsx(FN,{ref:r,className:le("-mx-1 my-1 h-px bg-muted",e),...t}));uO.displayName=FN.displayName;const dO=()=>{const{user:e}=ia(),t=ln(),{toast:r}=na(),n=bd(),[a,i]=d.useState(null),[o,l]=d.useState(!1),[c,u]=d.useState(null),[h,f]=d.useState(!1),[m,y]=d.useState(!1),[v,p]=d.useState({title:"",description:"",curriculum:"",instructor:"",duration:"",level:"Beginner",price:0,image_url:"",category:"All",is_published:1}),[b,g]=d.useState(null),[x,w]=d.useState(""),[N,C]=d.useState(null),[k,T]=d.useState(""),[P,I]=d.useState(!1),[D,E]=d.useState(""),[M,U]=d.useState(!1),[$,G]=d.useState(!1),[F,X]=d.useState(null),[A,O]=d.useState(!1),[Y,K]=d.useState(!1),[te,ge]=d.useState(null),[ke,Ze]=d.useState(""),[ye,ae]=d.useState(null),[Se,Pe]=d.useState(""),[Ne,Ie]=d.useState(!1),[fe,We]=d.useState({title:"",description:"",points:0,icon:"🏆",criteria:"",image_url:"",student_name:"",achievement_date:"",category:""}),[_t,ar]=d.useState(!1),[Xe,Wt]=d.useState({email:"",password:"",first_name:"",last_name:""}),[S,R]=d.useState(null),[L,J]=d.useState(!1),[Z,B]=d.useState(!1),[me,je]=d.useState(null),[et,Ge]=d.useState(""),[xr,Tr]=d.useState(null),[un,Mn]=d.useState(""),[Hr,dn]=d.useState(!1),[fo,fn]=d.useState(!1),[Pt,ql]=d.useState(null),[ce,De]=d.useState({name:"",role:"",rating:5,content:"",course:"",image_url:"",is_published:1,display_order:0}),[Le,vr]=d.useState(null),[Pr,us]=d.useState(!1),[mo,lS]=d.useState("all"),[ho,Og]=d.useState(new Date),cS=(e==null?void 0:e.email)==="ahmedalghili74@gmail.com";d.useEffect(()=>{e&&!e.is_admin&&(r({title:"Access Denied",description:"You do not have permission to access this page",variant:"destructive"}),t("/"))},[e,t,r]);const{data:Rr,isLoading:Kl}=Yt({queryKey:["dashboardStats"],queryFn:async()=>(await ue.getDashboardStats()).stats}),{data:Ud,isLoading:uS}=Yt({queryKey:["allUsers"],queryFn:async()=>(await ue.getAllUsers()).users}),{data:zd,isLoading:dS}=Yt({queryKey:["allCourses"],queryFn:async()=>(await ue.getAllCoursesAdmin()).courses.sort((he,pt)=>he.title.localeCompare(pt.title))}),{data:Vd,isLoading:fS}=Yt({queryKey:["allAchievements"],queryFn:async()=>(await ue.getAllAchievementsAdmin()).achievements}),{data:Bd,isLoading:mS}=Yt({queryKey:["allTestimonials"],queryFn:async()=>(await ue.getTestimonials(!0)).testimonials}),{data:Hd,isLoading:hS}=Yt({queryKey:["allEnrollments"],queryFn:async()=>(await ue.getAllEnrollmentsAdmin()).enrollments}),{data:ds,isLoading:pS}=Yt({queryKey:["allCategories"],queryFn:async()=>(await ue.getAllCategoriesAdmin()).categories}),Wd=(ds==null?void 0:ds.map(j=>j.name))||["All"],qd=gt({mutationFn:async({userId:j,userData:Ce})=>await ue.updateUserAdmin(j,Ce),onSuccess:()=>{n.invalidateQueries({queryKey:["allUsers"]}),l(!1),i(null),r({title:"Success",description:"User updated successfully"})},onError:j=>{r({title:"Error",description:j.message||"Failed to update user",variant:"destructive"})}}),gS=gt({mutationFn:async j=>await ue.deleteUserAdmin(j),onSuccess:()=>{n.invalidateQueries({queryKey:["allUsers"]}),r({title:"Success",description:"User deleted successfully"})},onError:j=>{r({title:"Error",description:j.message||"Failed to delete user",variant:"destructive"})}}),Kd=gt({mutationFn:async j=>await ue.createAdminUser(j.email,j.password,j.first_name,j.last_name),onSuccess:()=>{n.invalidateQueries({queryKey:["allUsers"]}),ar(!1),Wt({email:"",password:"",first_name:"",last_name:""}),r({title:"Success",description:"Admin user created successfully"})},onError:j=>{r({title:"Error",description:j.message||"Failed to create admin user",variant:"destructive"})}}),Gd=gt({mutationFn:async j=>await ue.createCourseAdmin(j),onSuccess:()=>{n.invalidateQueries({queryKey:["allCourses"]}),n.invalidateQueries({queryKey:["dashboardStats"]}),y(!1),p({title:"",description:"",curriculum:"",instructor:"",duration:"",level:"Beginner",price:0,image_url:"",category:"All",is_published:1}),r({title:"Success",description:"Course created successfully"})},onError:j=>{r({title:"Error",description:j.message||"Failed to create course",variant:"destructive"})}}),Qd=gt({mutationFn:async({courseId:j,courseData:Ce})=>await ue.updateCourseAdmin(j,Ce),onSuccess:()=>{n.invalidateQueries({queryKey:["allCourses"]}),f(!1),u(null),r({title:"Success",description:"Course updated successfully"})},onError:j=>{r({title:"Error",description:j.message||"Failed to update course",variant:"destructive"})}}),xS=gt({mutationFn:async j=>await ue.deleteCourseAdmin(j),onSuccess:()=>{n.invalidateQueries({queryKey:["allCourses"]}),n.invalidateQueries({queryKey:["dashboardStats"]}),r({title:"Success",description:"Course deleted successfully"})},onError:j=>{r({title:"Error",description:j.message||"Failed to delete course",variant:"destructive"})}}),Yd=gt({mutationFn:async j=>await ue.createCategoryAdmin(j),onSuccess:()=>{n.invalidateQueries({queryKey:["allCategories"]}),U(!1),E(""),r({title:"Success",description:"Category created successfully"})},onError:j=>{r({title:"Error",description:j.message||"Failed to create category",variant:"destructive"})}}),Zd=gt({mutationFn:async j=>await ue.deleteCategoryAdmin(j),onSuccess:()=>{n.invalidateQueries({queryKey:["allCategories"]}),n.invalidateQueries({queryKey:["allCourses"]}),G(!1),r({title:"Success",description:"Category deleted successfully"})},onError:j=>{G(!1),r({title:"Error",description:j.message||"Failed to delete category",variant:"destructive"})}}),Dg=(j,Ce=!1)=>{var pt;const he=(pt=j.target.files)==null?void 0:pt[0];if(he)if(Ce){C(he);const Be=new FileReader;Be.onloadend=()=>{T(Be.result)},Be.readAsDataURL(he)}else{g(he);const Be=new FileReader;Be.onloadend=()=>{w(Be.result)},Be.readAsDataURL(he)}},Fg=(j,Ce=!1)=>{var pt;const he=(pt=j.target.files)==null?void 0:pt[0];if(he)if(Ce){ae(he);const Be=new FileReader;Be.onloadend=()=>{Pe(Be.result)},Be.readAsDataURL(he)}else{ge(he);const Be=new FileReader;Be.onloadend=()=>{Ze(Be.result)},Be.readAsDataURL(he)}},Xd=gt({mutationFn:async j=>{console.log("Creating achievement with data:",j);let Ce=j.image_url;if(te){Ie(!0);try{Ce=(await ue.uploadAchievementImage(te)).url,console.log("Image uploaded:",Ce)}catch(Be){throw console.error("Image upload failed:",Be),new Error("Failed to upload image")}finally{Ie(!1)}}const he={...j,image_url:Ce};console.log("Final achievement data:",he);const pt=await ue.createAchievementAdmin(he);return console.log("Create achievement response:",pt),pt},onSuccess:j=>{console.log("Achievement creation success callback, data:",j),n.invalidateQueries({queryKey:["allAchievements"]}),n.invalidateQueries({queryKey:["dashboardStats"]}),K(!1),ge(null),Ze(""),We({title:"",description:"",points:0,icon:"🏆",criteria:""}),r({title:"Success",description:"Achievement created successfully"})},onError:j=>{console.error("Achievement creation error:",j),r({title:"Error",description:j.message||"Failed to create achievement",variant:"destructive"})}}),Jd=gt({mutationFn:async({achievementId:j,achievementData:Ce})=>{console.log("Updating achievement with data:",Ce);let he=Ce.image_url;if(ye){Ie(!0);try{he=(await ue.uploadAchievementImage(ye)).url,console.log("Image uploaded:",he)}catch(Be){throw console.error("Image upload failed:",Be),new Error("Failed to upload image")}finally{Ie(!1)}}const pt={...Ce,image_url:he};return console.log("Final achievement update data:",pt),await ue.updateAchievementAdmin(j,pt)},onSuccess:()=>{n.invalidateQueries({queryKey:["allAchievements"]}),O(!1),X(null),ae(null),Pe(""),r({title:"Success",description:"Achievement updated successfully"})},onError:j=>{r({title:"Error",description:j.message||"Failed to update achievement",variant:"destructive"})}}),vS=gt({mutationFn:async j=>await ue.deleteAchievementAdmin(j),onSuccess:()=>{n.invalidateQueries({queryKey:["allAchievements"]}),n.invalidateQueries({queryKey:["dashboardStats"]}),r({title:"Success",description:"Achievement deleted successfully"})},onError:j=>{r({title:"Error",description:j.message||"Failed to delete achievement",variant:"destructive"})}}),Lg=(j,Ce=!1)=>{var pt;const he=(pt=j.target.files)==null?void 0:pt[0];if(he)if(Ce){Tr(he);const Be=new FileReader;Be.onloadend=()=>{Mn(Be.result)},Be.readAsDataURL(he)}else{je(he);const Be=new FileReader;Be.onloadend=()=>{Ge(Be.result)},Be.readAsDataURL(he)}},ef=gt({mutationFn:async j=>{let Ce=j.image_url;if(me){dn(!0);try{Ce=(await ue.uploadTestimonialImage(me)).url}catch(pt){throw console.error("Image upload failed:",pt),new Error("Failed to upload image")}finally{dn(!1)}}const he={...j,image_url:Ce};return await ue.createTestimonialAdmin(he)},onSuccess:()=>{n.invalidateQueries({queryKey:["allTestimonials"]}),B(!1),je(null),Ge(""),De({name:"",role:"",rating:5,content:"",course:"",image_url:"",is_published:1,display_order:0}),r({title:"Success",description:"Testimonial created successfully"})},onError:j=>{r({title:"Error",description:j.message||"Failed to create testimonial",variant:"destructive"})}}),tf=gt({mutationFn:async({testimonialId:j,testimonialData:Ce})=>{let he=Ce.image_url;if(xr){dn(!0);try{he=(await ue.uploadTestimonialImage(xr)).url}catch(Be){throw console.error("Image upload failed:",Be),new Error("Failed to upload image")}finally{dn(!1)}}const pt={...Ce,image_url:he};return await ue.updateTestimonialAdmin(j,pt)},onSuccess:()=>{n.invalidateQueries({queryKey:["allTestimonials"]}),J(!1),R(null),Tr(null),Mn(""),r({title:"Success",description:"Testimonial updated successfully"})},onError:j=>{r({title:"Error",description:j.message||"Failed to update testimonial",variant:"destructive"})}}),yS=gt({mutationFn:async j=>await ue.deleteTestimonialAdmin(j),onSuccess:()=>{n.invalidateQueries({queryKey:["allTestimonials"]}),r({title:"Success",description:"Testimonial deleted successfully"})},onError:j=>{r({title:"Error",description:j.message||"Failed to delete testimonial",variant:"destructive"})}}),$g=gt({mutationFn:async({enrollmentId:j,approvalStatus:Ce})=>await ue.updateEnrollmentApproval(j,Ce),onSuccess:()=>{n.invalidateQueries({queryKey:["allEnrollments"]}),r({title:"Success",description:"Enrollment approval status updated successfully"})},onError:j=>{r({title:"Error",description:j.message||"Failed to update approval status",variant:"destructive"})}}),wS=gt({mutationFn:async({enrollmentId:j,enrolledAt:Ce})=>await ue.updateEnrollmentDate(j,Ce),onSuccess:()=>{n.invalidateQueries({queryKey:["allEnrollments"]}),us(!1),vr(null),r({title:"Success",description:"Enrollment date updated successfully"})},onError:j=>{r({title:"Error",description:j.message||"Failed to update enrollment date",variant:"destructive"})}}),bS=gt({mutationFn:async j=>await ue.deleteEnrollmentAdmin(j),onSuccess:()=>{n.invalidateQueries({queryKey:["allEnrollments"]}),r({title:"Success",description:"Enrollment deleted successfully"})},onError:j=>{r({title:"Error",description:j.message||"Failed to delete enrollment",variant:"destructive"})}}),jS=gt({mutationFn:async j=>await ue.uploadHeroImageAdmin(j),onSuccess:()=>{n.invalidateQueries({queryKey:["heroImages"]}),n.invalidateQueries({queryKey:["dashboardStats"]}),r({title:"Success",description:"Hero image uploaded"})},onError:j=>{r({title:"Error",description:j.message||"Failed to upload image",variant:"destructive"})}}),NS=gt({mutationFn:async j=>await ue.setActiveHeroAdmin(j),onSuccess:()=>{n.invalidateQueries({queryKey:["heroImages"]}),r({title:"Success",description:"Hero image set active"})},onError:j=>{r({title:"Error",description:j.message||"Failed to set active",variant:"destructive"})}}),CS=gt({mutationFn:async j=>await ue.deleteHeroImageAdmin(j),onSuccess:()=>{n.invalidateQueries({queryKey:["heroImages"]}),n.invalidateQueries({queryKey:["dashboardStats"]}),r({title:"Success",description:"Hero image deleted"})},onError:j=>{r({title:"Error",description:j.message||"Failed to delete image",variant:"destructive"})}}),SS=()=>{const{data:j,isLoading:Ce}=Yt({queryKey:["heroImages"],queryFn:async()=>{try{return await ue.getHeroImages()}catch(he){return console.error("Failed to load hero images",he),[]}}});return Ce?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(it,{className:"h-8 w-8 animate-spin"})}):!j||j.length===0?s.jsx("p",{className:"text-sm text-gray-600",children:"No hero images uploaded yet."}):s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:j.map(he=>s.jsxs("div",{className:"bg-white rounded-lg p-3 shadow-sm border",children:[s.jsx("img",{src:he.url,alt:he.filename,className:"w-full h-40 object-cover rounded-md mb-2"}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[he.is_active?s.jsx(sn,{children:"Active"}):null,s.jsx("div",{className:"text-sm font-medium",children:he.filename})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[!he.is_active&&s.jsx(V,{size:"sm",onClick:()=>NS.mutate(he.id),children:"Set Active"}),s.jsx(V,{size:"sm",variant:"destructive",onClick:()=>CS.mutate(he.id),children:"Delete"})]})]})]},he.id))})},_S=j=>{i(j),l(!0)},ES=()=>{a&&qd.mutate({userId:a.id,userData:{first_name:a.first_name,last_name:a.last_name,email:a.email,phone:a.phone,is_admin:a.is_admin}})},kS=j=>{confirm("Are you sure you want to delete this user? This action cannot be undone.")&&gS.mutate(j)},TS=()=>{if(!Xe.email||!Xe.password){r({title:"Error",description:"Email and password are required",variant:"destructive"});return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(Xe.email)){r({title:"Error",description:"Please enter a valid email address",variant:"destructive"});return}if(Xe.password.length<6){r({title:"Error",description:"Password must be at least 6 characters",variant:"destructive"});return}Kd.mutate(Xe)},PS=j=>{var Ce;u({...j,instructor:((Ce=j.instructor)==null?void 0:Ce.trim())||""}),f(!0)},RS=async()=>{var Ce;if(!c)return;let j=c.image_url;if(N){I(!0);try{j=(await ue.uploadCourseImage(N)).url}catch(he){r({title:"Error",description:he.message||"Failed to upload image",variant:"destructive"}),I(!1);return}I(!1)}Qd.mutate({courseId:c.id,courseData:{title:c.title,description:c.description,curriculum:c.curriculum,instructor:((Ce=c.instructor)==null?void 0:Ce.trim())||"",duration:c.duration,level:c.level,price:c.price,image_url:j,category:c.category,is_published:c.is_published}}),C(null),T("")},AS=async()=>{if(!v.title){r({title:"Error",description:"Course title is required",variant:"destructive"});return}let j={...v};const Ce=typeof j.instructor=="string"?j.instructor.trim():"";if(j={...j,instructor:Ce},b){I(!0);try{const he=await ue.uploadCourseImage(b);j.image_url=he.url}catch(he){r({title:"Error",description:he.message||"Failed to upload image",variant:"destructive"}),I(!1);return}I(!1)}Gd.mutate(j),g(null),w("")},IS=j=>{confirm("Are you sure you want to delete this course? This action cannot be undone.")&&xS.mutate(j)};return!e||!e.is_admin?null:s.jsxs("div",{className:"container mx-auto px-4 py-8",children:[s.jsx("h1",{className:"text-4xl font-bold mb-8",children:"Admin Dashboard"}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4 mb-8",children:[s.jsxs(Fe,{children:[s.jsxs(st,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(dt,{className:"text-sm font-medium",children:"Total Users"}),s.jsx(Ma,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx(Ue,{children:s.jsx("div",{className:"text-2xl font-bold",children:Kl?s.jsx(it,{className:"h-6 w-6 animate-spin"}):(Rr==null?void 0:Rr.total_users)||0})})]}),s.jsxs(Fe,{children:[s.jsxs(st,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(dt,{className:"text-sm font-medium",children:"Total Courses"}),s.jsx($r,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx(Ue,{children:s.jsx("div",{className:"text-2xl font-bold",children:Kl?s.jsx(it,{className:"h-6 w-6 animate-spin"}):(Rr==null?void 0:Rr.total_courses)||0})})]}),s.jsxs(Fe,{children:[s.jsxs(st,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(dt,{className:"text-sm font-medium",children:"Total Enrollments"}),s.jsx(Ma,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx(Ue,{children:s.jsx("div",{className:"text-2xl font-bold",children:Kl?s.jsx(it,{className:"h-6 w-6 animate-spin"}):(Rr==null?void 0:Rr.total_enrollments)||0})})]}),s.jsxs(Fe,{children:[s.jsxs(st,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(dt,{className:"text-sm font-medium",children:"Total Achievements"}),s.jsx(wk,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsx(Ue,{children:s.jsx("div",{className:"text-2xl font-bold",children:Kl?s.jsx(it,{className:"h-6 w-6 animate-spin"}):(Rr==null?void 0:Rr.total_achievements)||0})})]})]}),s.jsxs(tj,{defaultValue:"users",className:"space-y-4",children:[s.jsxs(og,{children:[s.jsx(xn,{value:"users",children:"Users Management"}),s.jsx(xn,{value:"courses",children:"Courses Management"}),s.jsx(xn,{value:"categories",children:"Categories Management"}),s.jsx(xn,{value:"achievements",children:"Achievements Management"}),s.jsx(xn,{value:"testimonials",children:"Testimonials Management"}),s.jsx(xn,{value:"enrollments",children:"Enrollments Management"}),s.jsx(xn,{value:"hero",children:"Hero Images"})]}),s.jsx(vn,{value:"users",className:"space-y-4",children:s.jsxs(Fe,{children:[s.jsxs(st,{className:"flex flex-row items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(dt,{children:"All Users"}),s.jsx(pn,{children:"Manage user accounts and permissions"})]}),cS&&s.jsxs(V,{onClick:()=>ar(!0),children:[s.jsx(fa,{className:"mr-2 h-4 w-4"}),"Add Admin"]})]}),s.jsx(Ue,{children:uS?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(it,{className:"h-8 w-8 animate-spin"})}):s.jsxs(ti,{children:[s.jsx(ri,{children:s.jsxs(qr,{children:[s.jsx(Re,{children:"Email"}),s.jsx(Re,{children:"Name"}),s.jsx(Re,{children:"Phone"}),s.jsx(Re,{children:"Admin"}),s.jsx(Re,{children:"Created"}),s.jsx(Re,{children:"Actions"})]})}),s.jsx(ni,{children:Ud==null?void 0:Ud.map(j=>s.jsxs(qr,{children:[s.jsx(Ae,{className:"font-medium",children:j.email}),s.jsx(Ae,{children:`${j.first_name} ${j.last_name}`}),s.jsx(Ae,{children:j.phone||"N/A"}),s.jsx(Ae,{children:j.is_admin?"Yes":"No"}),s.jsx(Ae,{children:new Date(j.created_at).toLocaleDateString()}),s.jsx(Ae,{children:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(V,{variant:"outline",size:"sm",onClick:()=>_S(j),children:s.jsx(gi,{className:"h-4 w-4"})}),!j.is_admin&&s.jsx(V,{variant:"destructive",size:"sm",onClick:()=>kS(j.id),children:s.jsx(ys,{className:"h-4 w-4"})})]})})]},j.id))})]})})]})}),s.jsx(vn,{value:"testimonials",className:"space-y-4",children:s.jsxs(Fe,{children:[s.jsxs(st,{className:"flex flex-row items-center justify-between space-y-0 pb-4",children:[s.jsxs("div",{children:[s.jsx(dt,{children:"Testimonials Management"}),s.jsx(pn,{children:"Manage student testimonials and reviews"})]}),s.jsxs(V,{onClick:()=>B(!0),children:[s.jsx(fa,{className:"mr-2 h-4 w-4"}),"Add Testimonial"]})]}),s.jsx(Ue,{children:mS?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(it,{className:"h-8 w-8 animate-spin"})}):s.jsxs(ti,{children:[s.jsx(ri,{children:s.jsxs(qr,{children:[s.jsx(Re,{children:"Image"}),s.jsx(Re,{children:"Name"}),s.jsx(Re,{children:"Role"}),s.jsx(Re,{children:"Rating"}),s.jsx(Re,{children:"Course"}),s.jsx(Re,{children:"Published"}),s.jsx(Re,{children:"Order"}),s.jsx(Re,{children:"Actions"})]})}),s.jsx(ni,{children:Bd==null?void 0:Bd.map(j=>s.jsxs(qr,{children:[s.jsx(Ae,{children:j.image_url?s.jsx("img",{src:j.image_url,alt:j.name,className:"w-10 h-10 rounded-full object-cover cursor-pointer hover:ring-2 hover:ring-cyan-500 transition-all",onClick:()=>{ql({url:j.image_url,name:j.name}),fn(!0)}}):s.jsx("div",{className:"w-10 h-10 rounded-full bg-cyan-100 flex items-center justify-center text-cyan-600 font-semibold",children:j.name.split(" ").map(Ce=>Ce[0]).join("").toUpperCase()})}),s.jsx(Ae,{className:"font-medium",children:j.name}),s.jsx(Ae,{children:j.role}),s.jsx(Ae,{children:s.jsx("div",{className:"flex gap-0.5",children:Array.from({length:j.rating},(Ce,he)=>s.jsx(Wa,{className:"h-4 w-4 text-yellow-400 fill-yellow-400"},he))})}),s.jsx(Ae,{children:j.course||"N/A"}),s.jsx(Ae,{children:s.jsx(sn,{variant:j.is_published?"default":"secondary",children:j.is_published?"Published":"Draft"})}),s.jsx(Ae,{children:j.display_order}),s.jsx(Ae,{children:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(V,{variant:"outline",size:"sm",onClick:()=>{R(j),J(!0)},children:s.jsx(gi,{className:"h-4 w-4"})}),s.jsx(V,{variant:"destructive",size:"sm",onClick:()=>yS.mutate(j.id),children:s.jsx(ys,{className:"h-4 w-4"})})]})})]},j.id))})]})})]})}),s.jsx(vn,{value:"enrollments",className:"space-y-4",children:s.jsxs(Fe,{children:[s.jsxs(st,{children:[s.jsx(dt,{children:"Enrollments Management"}),s.jsx(pn,{children:"Approve enrollments and manage enrollment dates"}),s.jsx("div",{className:"flex gap-2 mt-4",children:s.jsxs("select",{className:"px-3 py-2 border rounded-md",value:mo,onChange:j=>lS(j.target.value),children:[s.jsx("option",{value:"all",children:"All Enrollments"}),s.jsx("option",{value:"pending",children:"Pending"}),s.jsx("option",{value:"approved",children:"Approved"}),s.jsx("option",{value:"rejected",children:"Rejected"})]})})]}),s.jsx(Ue,{children:hS?s.jsx("p",{children:"Loading enrollments..."}):s.jsxs(ti,{children:[s.jsx(ri,{children:s.jsxs(qr,{children:[s.jsx(Re,{children:"Student"}),s.jsx(Re,{children:"Email"}),s.jsx(Re,{children:"Uploaded Image"}),s.jsx(Re,{children:"Course"}),s.jsx(Re,{children:"Category"}),s.jsx(Re,{children:"Enrolled Date"}),s.jsx(Re,{children:"Status"}),s.jsx(Re,{children:"Approval Status"}),s.jsx(Re,{children:"Approval Date"}),s.jsx(Re,{children:"Approved By"}),s.jsx(Re,{children:"Actions"})]})}),s.jsx(ni,{children:Hd==null?void 0:Hd.filter(j=>mo==="all"||j.approval_status===mo).map(j=>s.jsxs(qr,{children:[s.jsx(Ae,{children:`${j.first_name} ${j.last_name}`}),s.jsx(Ae,{children:j.email}),s.jsx(Ae,{children:j.image_url?s.jsx("img",{src:j.image_url,alt:`${j.first_name} ${j.last_name} enrollment`,className:"w-16 h-10 rounded object-cover cursor-pointer hover:ring-2 hover:ring-cyan-500 transition-all",onClick:()=>{ql({url:j.image_url,name:`${j.first_name} ${j.last_name} - ${j.course_title}`}),fn(!0)}}):s.jsx("div",{className:"w-16 h-10 rounded bg-gray-100 flex items-center justify-center text-xs text-gray-500",children:"No image"})}),s.jsx(Ae,{children:j.course_title}),s.jsx(Ae,{children:j.category}),s.jsx(Ae,{children:new Date(j.enrolled_at).toLocaleDateString()}),s.jsx(Ae,{children:s.jsx("span",{className:`px-2 py-1 rounded-full text-xs ${j.status==="active"?"bg-green-100 text-green-800":j.status==="completed"?"bg-blue-100 text-blue-800":"bg-gray-100 text-gray-800"}`,children:j.status})}),s.jsx(Ae,{children:s.jsx("span",{className:`px-2 py-1 rounded-full text-xs ${j.approval_status==="approved"?"bg-green-100 text-green-800":j.approval_status==="rejected"?"bg-red-100 text-red-800":"bg-yellow-100 text-yellow-800"}`,children:j.approval_status})}),s.jsx(Ae,{children:j.approval_date?new Date(j.approval_date).toLocaleDateString()+" "+new Date(j.approval_date).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"-"}),s.jsx(Ae,{children:j.approver_first_name?`${j.approver_first_name} ${j.approver_last_name}`:"-"}),s.jsx(Ae,{children:s.jsxs("div",{className:"flex gap-2",children:[j.approval_status==="pending"&&s.jsxs(s.Fragment,{children:[s.jsx(V,{size:"sm",variant:"default",onClick:()=>{$g.mutate({enrollmentId:j.id,approvalStatus:"approved"})},children:s.jsx($p,{className:"h-4 w-4"})}),s.jsx(V,{size:"sm",variant:"destructive",onClick:()=>{$g.mutate({enrollmentId:j.id,approvalStatus:"rejected"})},children:s.jsx(ro,{className:"h-4 w-4"})})]}),s.jsx(V,{size:"sm",variant:"outline",onClick:()=>{vr(j),Og(new Date(j.enrolled_at)),us(!0)},children:s.jsx(vd,{className:"h-4 w-4"})}),s.jsx(V,{size:"sm",variant:"destructive",onClick:()=>{confirm(`Are you sure you want to delete this enrollment for ${j.first_name} ${j.last_name}?`)&&bS.mutate(j.id)},children:s.jsx(ys,{className:"h-4 w-4"})})]})})]},j.id))})]})})]})}),s.jsx(vn,{value:"hero",className:"space-y-4",children:s.jsxs(Fe,{children:[s.jsx(st,{className:"flex flex-row items-center justify-between space-y-0 pb-4",children:s.jsxs("div",{children:[s.jsx(dt,{children:"Hero Images"}),s.jsx(pn,{children:"Upload and manage hero background images"})]})}),s.jsx(Ue,{children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex items-center gap-4",children:s.jsx("input",{id:"heroUpload",type:"file",accept:"image/*",onChange:j=>{var he;const Ce=(he=j.target.files)==null?void 0:he[0];Ce&&(jS.mutate(Ce),j.currentTarget.value="")}})}),s.jsx("div",{children:s.jsx(SS,{})})]})})]})}),s.jsx(vn,{value:"courses",className:"space-y-4",children:s.jsxs(Fe,{children:[s.jsxs(st,{className:"flex flex-row items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(dt,{children:"Courses Management"}),s.jsx(pn,{children:"Create, update, and manage all courses"})]}),s.jsxs(V,{onClick:()=>y(!0),children:[s.jsx(fa,{className:"mr-2 h-4 w-4"}),"Add Course"]})]}),s.jsx(Ue,{children:dS?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(it,{className:"h-8 w-8 animate-spin"})}):s.jsxs(ti,{children:[s.jsx(ri,{children:s.jsxs(qr,{children:[s.jsx(Re,{children:"Title"}),s.jsx(Re,{children:"Category"}),s.jsx(Re,{children:"Level"}),s.jsx(Re,{children:"Price"}),s.jsx(Re,{children:"Published"}),s.jsx(Re,{children:"Created"}),s.jsx(Re,{children:"Actions"})]})}),s.jsx(ni,{children:zd==null?void 0:zd.map(j=>s.jsxs(qr,{children:[s.jsx(Ae,{className:"font-medium",children:j.title}),s.jsx(Ae,{children:j.category}),s.jsx(Ae,{children:j.level}),s.jsxs(Ae,{children:["$",j.price]}),s.jsx(Ae,{children:j.is_published?"Yes":"No"}),s.jsx(Ae,{children:new Date(j.created_at).toLocaleDateString()}),s.jsx(Ae,{children:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(V,{variant:"outline",size:"sm",onClick:()=>PS(j),children:s.jsx(gi,{className:"h-4 w-4"})}),s.jsx(V,{variant:"destructive",size:"sm",onClick:()=>IS(j.id),children:s.jsx(ys,{className:"h-4 w-4"})})]})})]},j.id))})]})})]})}),s.jsx(vn,{value:"categories",className:"space-y-4",children:s.jsxs(Fe,{children:[s.jsxs(st,{className:"flex flex-row items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(dt,{children:"Course Categories Management"}),s.jsx(pn,{children:"Add or remove course categories"})]}),s.jsxs(V,{onClick:()=>U(!0),children:[s.jsx(fa,{className:"mr-2 h-4 w-4"}),"Add Category"]})]}),s.jsx(Ue,{children:pS?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(it,{className:"h-8 w-8 animate-spin"})}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:ds==null?void 0:ds.map(j=>s.jsxs(Fe,{className:"flex items-center justify-between p-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx($r,{className:"h-5 w-5 text-primary"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-medium",children:j.name}),j.description&&s.jsx("p",{className:"text-sm text-muted-foreground",children:j.description})]})]}),j.name!=="All"&&s.jsx(V,{variant:"ghost",size:"sm",disabled:Zd.isPending,onClick:()=>{confirm(`Are you sure you want to delete "${j.name}" category? Courses using this category will be moved to "All".`)&&Zd.mutate(j.id)},children:Zd.isPending?s.jsx(it,{className:"h-4 w-4 animate-spin"}):s.jsx(ys,{className:"h-4 w-4 text-destructive"})})]},j.id))}),(!ds||ds.length===0)&&s.jsx("p",{className:"text-center text-muted-foreground mt-8",children:'No categories yet. Click "Add Category" to create one.'})]})})]})}),s.jsx(vn,{value:"achievements",className:"space-y-4",children:s.jsxs(Fe,{children:[s.jsxs(st,{className:"flex flex-row items-center justify-between space-y-0 pb-4",children:[s.jsxs("div",{children:[s.jsx(dt,{children:"Achievements Management"}),s.jsx(pn,{children:"Manage achievements and awards for users"})]}),s.jsxs(V,{onClick:()=>K(!0),children:[s.jsx(fa,{className:"mr-2 h-4 w-4"}),"Add Achievement"]})]}),s.jsx(Ue,{children:fS?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(it,{className:"h-8 w-8 animate-spin"})}):s.jsxs(ti,{children:[s.jsx(ri,{children:s.jsxs(qr,{children:[s.jsx(Re,{children:"Icon"}),s.jsx(Re,{children:"Title"}),s.jsx(Re,{children:"Description"}),s.jsx(Re,{children:"Points"}),s.jsx(Re,{children:"Criteria"}),s.jsx(Re,{children:"Actions"})]})}),s.jsx(ni,{children:Vd==null?void 0:Vd.map(j=>s.jsxs(qr,{children:[s.jsx(Ae,{className:"text-2xl",children:j.icon}),s.jsx(Ae,{className:"font-medium",children:j.title}),s.jsx(Ae,{className:"max-w-xs truncate",children:j.description}),s.jsx(Ae,{children:j.points}),s.jsx(Ae,{className:"max-w-xs truncate",children:j.criteria||"N/A"}),s.jsx(Ae,{children:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(V,{variant:"outline",size:"sm",onClick:()=>{X(j),O(!0)},children:s.jsx(gi,{className:"h-4 w-4"})}),s.jsx(V,{variant:"destructive",size:"sm",onClick:()=>vS.mutate(j.id),children:s.jsx(ys,{className:"h-4 w-4"})})]})})]},j.id))})]})})]})})]}),s.jsx(Gt,{open:o,onOpenChange:l,children:s.jsxs($t,{children:[s.jsxs(Ut,{children:[s.jsx(zt,{children:"Edit User"}),s.jsx(or,{children:"Update user information and permissions"})]}),a&&s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"email",children:"Email"}),s.jsx(Q,{id:"email",value:a.email,onChange:j=>i({...a,email:j.target.value})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"firstName",children:"First Name"}),s.jsx(Q,{id:"firstName",value:a.first_name,onChange:j=>i({...a,first_name:j.target.value})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"lastName",children:"Last Name"}),s.jsx(Q,{id:"lastName",value:a.last_name,onChange:j=>i({...a,last_name:j.target.value})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"phone",children:"Phone"}),s.jsx(Q,{id:"phone",value:a.phone||"",onChange:j=>i({...a,phone:j.target.value})})]}),s.jsx("div",{className:"flex items-center space-x-2",children:s.jsxs(H,{htmlFor:"isAdmin",className:"flex items-center space-x-2 cursor-pointer",children:[s.jsx("input",{type:"checkbox",id:"isAdmin",checked:a.is_admin===1,onChange:j=>i({...a,is_admin:j.target.checked?1:0}),className:"h-4 w-4","aria-label":"Admin Access"}),s.jsx("span",{children:"Admin Access"})]})})]}),s.jsxs(Kr,{children:[s.jsx(V,{variant:"outline",onClick:()=>l(!1),children:"Cancel"}),s.jsxs(V,{onClick:ES,disabled:qd.isPending,children:[qd.isPending&&s.jsx(it,{className:"mr-2 h-4 w-4 animate-spin"}),"Save Changes"]})]})]})}),s.jsx(Gt,{open:m,onOpenChange:y,children:s.jsxs($t,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(Ut,{children:[s.jsx(zt,{children:"Add New Course"}),s.jsx(or,{children:"Create a new course in the system"})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"newTitle",children:"Title *"}),s.jsx(Q,{id:"newTitle",value:v.title,onChange:j=>p({...v,title:j.target.value}),placeholder:"Course title"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"newDescription",children:"Description"}),s.jsx(Zt,{id:"newDescription",value:v.description,onChange:j=>p({...v,description:j.target.value}),placeholder:"Course description",rows:4})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"newCurriculum",children:"Curriculum"}),s.jsx(Zt,{id:"newCurriculum",value:v.curriculum,onChange:j=>p({...v,curriculum:j.target.value}),placeholder:"Course curriculum details (one item per line)",rows:6}),s.jsx("p",{className:"text-xs text-muted-foreground",children:'Enter curriculum items, one per line. Example: "Module 1: Introduction to English"'})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"newInstructor",children:"Instructor"}),s.jsx(Q,{id:"newInstructor",value:v.instructor,onChange:j=>p({...v,instructor:j.target.value}),placeholder:"Instructor name"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"newDuration",children:"Duration"}),s.jsx(Q,{id:"newDuration",value:v.duration,onChange:j=>p({...v,duration:j.target.value}),placeholder:"e.g., 8 weeks"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"newPrice",children:"Price"}),s.jsx(Q,{id:"newPrice",type:"number",value:v.price,onChange:j=>p({...v,price:parseFloat(j.target.value)||0}),placeholder:"0"})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"newLevel",children:"Level"}),s.jsxs(Os,{value:v.level,onValueChange:j=>p({...v,level:j}),children:[s.jsx(qn,{children:s.jsx(Ds,{placeholder:"Select level"})}),s.jsxs(Kn,{children:[s.jsx(Vt,{value:"Beginner",children:"Beginner"}),s.jsx(Vt,{value:"Intermediate",children:"Intermediate"}),s.jsx(Vt,{value:"Advanced",children:"Advanced"})]})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"newCategory",children:"Category"}),s.jsxs(Os,{value:v.category,onValueChange:j=>p({...v,category:j}),children:[s.jsx(qn,{children:s.jsx(Ds,{placeholder:"Select category"})}),s.jsx(Kn,{children:Wd.map(j=>s.jsx(Vt,{value:j,children:j},j))})]})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{children:"Course Image"}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Q,{id:"newCourseImage",type:"file",accept:"image/*",onChange:j=>Dg(j,!1),className:"cursor-pointer"})}),x&&s.jsx("div",{className:"mt-2",children:s.jsx("img",{src:x,alt:"Preview",className:"w-32 h-20 object-cover rounded-lg border"})}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Or enter image URL:"}),s.jsx(Q,{id:"newImageUrl",value:v.image_url,onChange:j=>p({...v,image_url:j.target.value}),placeholder:"https://example.com/image.jpg"})]})]}),s.jsx("div",{className:"flex items-center space-x-2",children:s.jsxs(H,{htmlFor:"newPublished",className:"flex items-center space-x-2 cursor-pointer",children:[s.jsx("input",{type:"checkbox",id:"newPublished",checked:v.is_published===1,onChange:j=>p({...v,is_published:j.target.checked?1:0}),className:"h-4 w-4","aria-label":"Published"}),s.jsx("span",{children:"Published"})]})})]}),s.jsxs(Kr,{children:[s.jsx(V,{variant:"outline",onClick:()=>{y(!1),g(null),w("")},children:"Cancel"}),s.jsxs(V,{onClick:AS,disabled:Gd.isPending||P,children:[(Gd.isPending||P)&&s.jsx(it,{className:"mr-2 h-4 w-4 animate-spin"}),P?"Uploading...":"Create Course"]})]})]})}),s.jsx(Gt,{open:h,onOpenChange:f,children:s.jsxs($t,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(Ut,{children:[s.jsx(zt,{children:"Edit Course"}),s.jsx(or,{children:"Update course information"})]}),c&&s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editTitle",children:"Title"}),s.jsx(Q,{id:"editTitle",value:c.title,onChange:j=>u({...c,title:j.target.value})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editDescription",children:"Description"}),s.jsx(Zt,{id:"editDescription",value:c.description,onChange:j=>u({...c,description:j.target.value}),rows:4})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editCurriculum",children:"Curriculum"}),s.jsx(Zt,{id:"editCurriculum",value:c.curriculum||"",onChange:j=>u({...c,curriculum:j.target.value}),rows:6}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter curriculum items, one per line"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editInstructor",children:"Instructor"}),s.jsx(Q,{id:"editInstructor",value:c.instructor,onChange:j=>u({...c,instructor:j.target.value})})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editDuration",children:"Duration"}),s.jsx(Q,{id:"editDuration",value:c.duration,onChange:j=>u({...c,duration:j.target.value})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editPrice",children:"Price"}),s.jsx(Q,{id:"editPrice",type:"number",value:c.price,onChange:j=>u({...c,price:parseFloat(j.target.value)||0})})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editLevel",children:"Level"}),s.jsxs(Os,{value:c.level,onValueChange:j=>u({...c,level:j}),children:[s.jsx(qn,{children:s.jsx(Ds,{})}),s.jsxs(Kn,{children:[s.jsx(Vt,{value:"Beginner",children:"Beginner"}),s.jsx(Vt,{value:"Intermediate",children:"Intermediate"}),s.jsx(Vt,{value:"Advanced",children:"Advanced"})]})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editCategory",children:"Category"}),s.jsxs(Os,{value:c.category,onValueChange:j=>u({...c,category:j}),children:[s.jsx(qn,{children:s.jsx(Ds,{})}),s.jsx(Kn,{children:Wd.map(j=>s.jsx(Vt,{value:j,children:j},j))})]})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{children:"Course Image"}),s.jsxs("div",{className:"space-y-3",children:[c.image_url&&!k&&s.jsxs("div",{className:"mb-2",children:[s.jsx("img",{src:c.image_url,alt:"Current",className:"w-32 h-20 object-cover rounded-lg border"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Current image"})]}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Q,{id:"editCourseImage",type:"file",accept:"image/*",onChange:j=>Dg(j,!0),className:"cursor-pointer"})}),k&&s.jsxs("div",{className:"mt-2",children:[s.jsx("img",{src:k,alt:"New Preview",className:"w-32 h-20 object-cover rounded-lg border"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"New image preview"})]}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Or enter image URL:"}),s.jsx(Q,{id:"editImageUrl",value:c.image_url,onChange:j=>u({...c,image_url:j.target.value}),placeholder:"https://example.com/image.jpg"})]})]}),s.jsx("div",{className:"flex items-center space-x-2",children:s.jsxs(H,{htmlFor:"editPublished",className:"flex items-center space-x-2 cursor-pointer",children:[s.jsx("input",{type:"checkbox",id:"editPublished",checked:c.is_published===1,onChange:j=>u({...c,is_published:j.target.checked?1:0}),className:"h-4 w-4","aria-label":"Published"}),s.jsx("span",{children:"Published"})]})})]}),s.jsxs(Kr,{children:[s.jsx(V,{variant:"outline",onClick:()=>{f(!1),C(null),T("")},children:"Cancel"}),s.jsxs(V,{onClick:RS,disabled:Qd.isPending||P,children:[(Qd.isPending||P)&&s.jsx(it,{className:"mr-2 h-4 w-4 animate-spin"}),P?"Uploading...":"Save Changes"]})]})]})}),s.jsx(Gt,{open:Y,onOpenChange:K,children:s.jsxs($t,{children:[s.jsxs(Ut,{children:[s.jsx(zt,{children:"Add New Achievement"}),s.jsx(or,{children:"Create a new achievement for users to earn"})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"achievementTitle",children:"Title"}),s.jsx(Q,{id:"achievementTitle",value:fe.title,onChange:j=>We({...fe,title:j.target.value}),placeholder:"e.g., First Course Complete"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"achievementDescription",children:"Description"}),s.jsx(Zt,{id:"achievementDescription",value:fe.description,onChange:j=>We({...fe,description:j.target.value}),placeholder:"Describe what this achievement represents"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"achievementPoints",children:"Points"}),s.jsx(Q,{id:"achievementPoints",type:"number",value:fe.points,onChange:j=>We({...fe,points:parseInt(j.target.value)||0}),placeholder:"100"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"achievementIcon",children:"Icon (Emoji)"}),s.jsx(Q,{id:"achievementIcon",value:fe.icon,onChange:j=>We({...fe,icon:j.target.value}),placeholder:"🏆"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"achievementCriteria",children:"Criteria (Optional)"}),s.jsx(Q,{id:"achievementCriteria",value:fe.criteria,onChange:j=>We({...fe,criteria:j.target.value}),placeholder:"e.g., Complete 1 course"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{children:"Achievement Image"}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Q,{id:"achievementImage",type:"file",accept:"image/*",onChange:Fg,className:"cursor-pointer"})}),ke&&s.jsxs("div",{className:"mt-2",children:[s.jsx("img",{src:ke,alt:"Preview",className:"w-32 h-32 object-cover rounded-lg border"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Image preview"})]}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Or enter image URL:"}),s.jsx(Q,{id:"achievementImageUrl",value:fe.image_url||"",onChange:j=>We({...fe,image_url:j.target.value}),placeholder:"https://example.com/image.jpg"})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"achievementStudentName",children:"Student Name (Optional)"}),s.jsx(Q,{id:"achievementStudentName",value:fe.student_name,onChange:j=>We({...fe,student_name:j.target.value}),placeholder:"e.g., John Doe"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"achievementDate",children:"Achievement Date (Optional)"}),s.jsx(Q,{id:"achievementDate",value:fe.achievement_date,onChange:j=>We({...fe,achievement_date:j.target.value}),placeholder:"e.g., January 2026"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"achievementCategory",children:"Category (Optional)"}),s.jsx(Q,{id:"achievementCategory",value:fe.category,onChange:j=>We({...fe,category:j.target.value}),placeholder:"e.g., Excellence Award"})]})]}),s.jsxs(Kr,{children:[s.jsx(V,{variant:"outline",onClick:()=>{K(!1),ge(null),Ze(""),We({title:"",description:"",points:0,icon:"🏆",criteria:"",image_url:"",student_name:"",achievement_date:"",category:""})},children:"Cancel"}),s.jsxs(V,{onClick:async()=>{if(console.log("=== Add Achievement button clicked! ==="),console.log("Submitting achievement data:",JSON.stringify(fe)),!fe.title){r({title:"Error",description:"Title is required",variant:"destructive"});return}try{Xd.mutate(fe)}catch(j){console.error("Mutation error:",j)}},disabled:Xd.isPending||Ne,children:[(Xd.isPending||Ne)&&s.jsx(it,{className:"mr-2 h-4 w-4 animate-spin"}),Ne?"Uploading Image...":"Add Achievement"]})]})]})}),s.jsx(Gt,{open:A,onOpenChange:O,children:s.jsxs($t,{children:[s.jsxs(Ut,{children:[s.jsx(zt,{children:"Edit Achievement"}),s.jsx(or,{children:"Update achievement details"})]}),F&&s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editAchievementTitle",children:"Title"}),s.jsx(Q,{id:"editAchievementTitle",value:F.title,onChange:j=>X({...F,title:j.target.value})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editAchievementDescription",children:"Description"}),s.jsx(Zt,{id:"editAchievementDescription",value:F.description,onChange:j=>X({...F,description:j.target.value})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editAchievementPoints",children:"Points"}),s.jsx(Q,{id:"editAchievementPoints",type:"number",value:F.points,onChange:j=>X({...F,points:parseInt(j.target.value)||0})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editAchievementIcon",children:"Icon (Emoji)"}),s.jsx(Q,{id:"editAchievementIcon",value:F.icon,onChange:j=>X({...F,icon:j.target.value})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editAchievementCriteria",children:"Criteria"}),s.jsx(Q,{id:"editAchievementCriteria",value:F.criteria||"",onChange:j=>X({...F,criteria:j.target.value})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{children:"Achievement Image"}),s.jsxs("div",{className:"space-y-3",children:[F.image_url&&!Se&&s.jsxs("div",{className:"mb-2",children:[s.jsx("img",{src:F.image_url,alt:"Current",className:"w-32 h-32 object-cover rounded-lg border"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Current image"})]}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Q,{id:"editAchievementImage",type:"file",accept:"image/*",onChange:j=>Fg(j,!0),className:"cursor-pointer"})}),Se&&s.jsxs("div",{className:"mt-2",children:[s.jsx("img",{src:Se,alt:"New Preview",className:"w-32 h-32 object-cover rounded-lg border"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"New image preview"})]}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Or enter image URL:"}),s.jsx(Q,{id:"editAchievementImageUrl",value:F.image_url||"",onChange:j=>X({...F,image_url:j.target.value}),placeholder:"https://example.com/image.jpg"})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editAchievementStudentName",children:"Student Name"}),s.jsx(Q,{id:"editAchievementStudentName",value:F.student_name||"",onChange:j=>X({...F,student_name:j.target.value})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editAchievementDate",children:"Achievement Date"}),s.jsx(Q,{id:"editAchievementDate",value:F.achievement_date||"",onChange:j=>X({...F,achievement_date:j.target.value})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editAchievementCategory",children:"Category"}),s.jsx(Q,{id:"editAchievementCategory",value:F.category||"",onChange:j=>X({...F,category:j.target.value})})]})]}),s.jsxs(Kr,{children:[s.jsx(V,{variant:"outline",onClick:()=>{O(!1),X(null),ae(null),Pe("")},children:"Cancel"}),s.jsxs(V,{onClick:()=>{F&&Jd.mutate({achievementId:F.id,achievementData:{title:F.title,description:F.description,points:F.points,icon:F.icon,criteria:F.criteria,image_url:F.image_url,student_name:F.student_name,achievement_date:F.achievement_date,category:F.category}})},disabled:Jd.isPending||Ne,children:[(Jd.isPending||Ne)&&s.jsx(it,{className:"mr-2 h-4 w-4 animate-spin"}),Ne?"Uploading Image...":"Save Changes"]})]})]})}),s.jsx(Gt,{open:_t,onOpenChange:ar,children:s.jsxs($t,{children:[s.jsxs(Ut,{children:[s.jsx(zt,{children:"Add New Admin User"}),s.jsx(or,{children:"Create a new administrator account with custom credentials. Only super admin can perform this action."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"adminEmail",children:"Email *"}),s.jsx(Q,{id:"adminEmail",type:"email",value:Xe.email,onChange:j=>Wt({...Xe,email:j.target.value}),placeholder:"admin@example.com"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"adminPassword",children:"Password *"}),s.jsx(Q,{id:"adminPassword",type:"password",value:Xe.password,onChange:j=>Wt({...Xe,password:j.target.value}),placeholder:"Minimum 6 characters"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"adminFirstName",children:"First Name"}),s.jsx(Q,{id:"adminFirstName",value:Xe.first_name,onChange:j=>Wt({...Xe,first_name:j.target.value}),placeholder:"John"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"adminLastName",children:"Last Name"}),s.jsx(Q,{id:"adminLastName",value:Xe.last_name,onChange:j=>Wt({...Xe,last_name:j.target.value}),placeholder:"Doe"})]})]}),s.jsxs(Kr,{children:[s.jsx(V,{variant:"outline",onClick:()=>{ar(!1),Wt({email:"",password:"",first_name:"",last_name:""})},children:"Cancel"}),s.jsxs(V,{onClick:TS,disabled:Kd.isPending,children:[Kd.isPending&&s.jsx(it,{className:"mr-2 h-4 w-4 animate-spin"}),"Create Admin"]})]})]})}),s.jsx(Gt,{open:Pr,onOpenChange:us,children:s.jsxs($t,{children:[s.jsxs(Ut,{children:[s.jsx(zt,{children:"Edit Enrollment Date"}),s.jsxs(or,{children:["Change the enrollment date for ",Le==null?void 0:Le.first_name," ",Le==null?void 0:Le.last_name]})]}),s.jsx("div",{className:"grid gap-4 py-4",children:s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"enrollment-date",children:"Enrollment Date"}),s.jsx("input",{id:"enrollment-date",type:"datetime-local",className:"px-3 py-2 border rounded-md",value:ho?new Date(ho.getTime()-ho.getTimezoneOffset()*6e4).toISOString().slice(0,16):"",onChange:j=>Og(new Date(j.target.value))})]})}),s.jsx(Kr,{children:s.jsx(V,{onClick:()=>{Le&&ho&&wS.mutate({enrollmentId:Le.id,enrolledAt:ho.toISOString().slice(0,19).replace("T"," ")})},children:"Save Changes"})})]})}),s.jsx(Gt,{open:Z,onOpenChange:B,children:s.jsxs($t,{className:"max-h-[90vh] overflow-y-auto",children:[s.jsxs(Ut,{children:[s.jsx(zt,{children:"Add New Testimonial"}),s.jsx(or,{children:"Create a new student testimonial"})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"testimonialName",children:"Student Name *"}),s.jsx(Q,{id:"testimonialName",value:ce.name,onChange:j=>De({...ce,name:j.target.value}),placeholder:"e.g., Sarah Ahmed"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"testimonialRole",children:"Role/Occupation *"}),s.jsx(Q,{id:"testimonialRole",value:ce.role,onChange:j=>De({...ce,role:j.target.value}),placeholder:"e.g., Business Professional"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"testimonialRating",children:"Rating (1-5)"}),s.jsx(Q,{id:"testimonialRating",type:"number",min:"1",max:"5",value:ce.rating,onChange:j=>De({...ce,rating:parseInt(j.target.value)||5})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"testimonialContent",children:"Testimonial Content *"}),s.jsx(Zt,{id:"testimonialContent",value:ce.content,onChange:j=>De({...ce,content:j.target.value}),placeholder:"Write the testimonial text here...",rows:4})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"testimonialCourse",children:"Course (Optional)"}),s.jsx(Q,{id:"testimonialCourse",value:ce.course,onChange:j=>De({...ce,course:j.target.value}),placeholder:"e.g., Business English"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{children:"Student Image"}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Q,{id:"testimonialImage",type:"file",accept:"image/*",onChange:Lg,className:"cursor-pointer"})}),et&&s.jsxs("div",{className:"mt-2",children:[s.jsx("img",{src:et,alt:"Preview",className:"w-20 h-20 object-cover rounded-full border"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Image preview"})]}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Or enter image URL:"}),s.jsx(Q,{id:"testimonialImageUrl",value:ce.image_url||"",onChange:j=>De({...ce,image_url:j.target.value}),placeholder:"https://example.com/image.jpg"})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"testimonialOrder",children:"Display Order"}),s.jsx(Q,{id:"testimonialOrder",type:"number",value:ce.display_order,onChange:j=>De({...ce,display_order:parseInt(j.target.value)||0}),placeholder:"0"})]}),s.jsx("div",{className:"flex items-center space-x-2",children:s.jsxs(H,{htmlFor:"testimonialPublished",className:"flex items-center space-x-2 cursor-pointer",children:[s.jsx("input",{type:"checkbox",id:"testimonialPublished",checked:ce.is_published===1,onChange:j=>De({...ce,is_published:j.target.checked?1:0}),className:"h-4 w-4"}),s.jsx("span",{children:"Published"})]})})]}),s.jsxs(Kr,{children:[s.jsx(V,{variant:"outline",onClick:()=>{B(!1),je(null),Ge(""),De({name:"",role:"",rating:5,content:"",course:"",image_url:"",is_published:1,display_order:0})},children:"Cancel"}),s.jsxs(V,{onClick:()=>ef.mutate(ce),disabled:ef.isPending||Hr,children:[(ef.isPending||Hr)&&s.jsx(it,{className:"mr-2 h-4 w-4 animate-spin"}),Hr?"Uploading Image...":"Add Testimonial"]})]})]})}),s.jsx(Gt,{open:L,onOpenChange:J,children:s.jsxs($t,{className:"max-h-[90vh] overflow-y-auto",children:[s.jsxs(Ut,{children:[s.jsx(zt,{children:"Edit Testimonial"}),s.jsx(or,{children:"Update testimonial details"})]}),S&&s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editTestimonialName",children:"Student Name *"}),s.jsx(Q,{id:"editTestimonialName",value:S.name,onChange:j=>R({...S,name:j.target.value})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editTestimonialRole",children:"Role/Occupation *"}),s.jsx(Q,{id:"editTestimonialRole",value:S.role,onChange:j=>R({...S,role:j.target.value})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editTestimonialRating",children:"Rating (1-5)"}),s.jsx(Q,{id:"editTestimonialRating",type:"number",min:"1",max:"5",value:S.rating,onChange:j=>R({...S,rating:parseInt(j.target.value)||5})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editTestimonialContent",children:"Testimonial Content *"}),s.jsx(Zt,{id:"editTestimonialContent",value:S.content,onChange:j=>R({...S,content:j.target.value}),rows:4})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editTestimonialCourse",children:"Course"}),s.jsx(Q,{id:"editTestimonialCourse",value:S.course||"",onChange:j=>R({...S,course:j.target.value})})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{children:"Student Image"}),s.jsxs("div",{className:"space-y-3",children:[S.image_url&&!un&&s.jsxs("div",{className:"mb-2",children:[s.jsx("img",{src:S.image_url,alt:"Current",className:"w-20 h-20 object-cover rounded-full border"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Current image"})]}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Q,{id:"editTestimonialImage",type:"file",accept:"image/*",onChange:j=>Lg(j,!0),className:"cursor-pointer"})}),un&&s.jsxs("div",{className:"mt-2",children:[s.jsx("img",{src:un,alt:"New Preview",className:"w-20 h-20 object-cover rounded-full border"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"New image preview"})]}),s.jsx("div",{className:"text-sm text-muted-foreground",children:"Or enter image URL:"}),s.jsx(Q,{id:"editTestimonialImageUrl",value:S.image_url||"",onChange:j=>R({...S,image_url:j.target.value}),placeholder:"https://example.com/image.jpg"})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"editTestimonialOrder",children:"Display Order"}),s.jsx(Q,{id:"editTestimonialOrder",type:"number",value:S.display_order,onChange:j=>R({...S,display_order:parseInt(j.target.value)||0})})]}),s.jsx("div",{className:"flex items-center space-x-2",children:s.jsxs(H,{htmlFor:"editTestimonialPublished",className:"flex items-center space-x-2 cursor-pointer",children:[s.jsx("input",{type:"checkbox",id:"editTestimonialPublished",checked:S.is_published===1,onChange:j=>R({...S,is_published:j.target.checked?1:0}),className:"h-4 w-4"}),s.jsx("span",{children:"Published"})]})})]}),s.jsxs(Kr,{children:[s.jsx(V,{variant:"outline",onClick:()=>{J(!1),R(null),Tr(null),Mn("")},children:"Cancel"}),s.jsxs(V,{onClick:()=>{S&&tf.mutate({testimonialId:S.id,testimonialData:{name:S.name,role:S.role,rating:S.rating,content:S.content,course:S.course,image_url:S.image_url,is_published:S.is_published,display_order:S.display_order}})},disabled:tf.isPending||Hr,children:[(tf.isPending||Hr)&&s.jsx(it,{className:"mr-2 h-4 w-4 animate-spin"}),Hr?"Uploading Image...":"Save Changes"]})]})]})}),s.jsx(Gt,{open:M,onOpenChange:U,children:s.jsxs($t,{children:[s.jsxs(Ut,{children:[s.jsx(zt,{children:"Add New Category"}),s.jsx(or,{children:"Create a new course category. It will be available when creating or editing courses."})]}),s.jsx("div",{className:"grid gap-4 py-4",children:s.jsxs("div",{className:"grid gap-2",children:[s.jsx(H,{htmlFor:"categoryName",children:"Category Name"}),s.jsx(Q,{id:"categoryName",value:D,onChange:j=>E(j.target.value),placeholder:"e.g., IELTS Training, TOEFL Preparation"})]})}),s.jsxs(Kr,{children:[s.jsx(V,{variant:"outline",onClick:()=>{U(!1),E("")},children:"Cancel"}),s.jsxs(V,{disabled:Yd.isPending,onClick:()=>{if(!D.trim()){r({title:"Error",description:"Category name cannot be empty",variant:"destructive"});return}if(Wd.includes(D.trim())){r({title:"Error",description:"This category already exists",variant:"destructive"});return}Yd.mutate({name:D.trim()})},children:[Yd.isPending&&s.jsx(it,{className:"mr-2 h-4 w-4 animate-spin"}),"Add Category"]})]})]})}),s.jsx(Gt,{open:fo,onOpenChange:fn,children:s.jsxs($t,{className:"max-w-3xl",children:[s.jsxs(Ut,{children:[s.jsxs(zt,{children:[Pt==null?void 0:Pt.name,"'s Photo"]}),s.jsx(or,{children:"Click the download button to save this image"})]}),s.jsx("div",{className:"relative",children:Pt&&s.jsxs(s.Fragment,{children:[s.jsx("img",{src:Pt.url,alt:Pt.name,className:"w-full h-auto rounded-lg"}),s.jsx(V,{className:"absolute top-4 right-4 bg-white/90 hover:bg-white text-gray-900",onClick:()=>{const j=document.createElement("a");j.href=Pt.url,j.download=`${Pt.name.replace(/\s+/g,"_")}_testimonial.jpg`,document.body.appendChild(j),j.click(),document.body.removeChild(j)},children:"Download Image"})]})})]})})]})},fO=()=>{const{id:e}=Ll(),[t,r]=d.useState(null),[n,a]=d.useState(!0),[i,o]=d.useState(null);return d.useEffect(()=>{window.scrollTo(0,0),(async()=>{if(!e){o("No achievement ID provided"),a(!1);return}try{const c=await ue.getAchievements();if(!c||!c.success)console.error("Error fetching achievements:",c==null?void 0:c.message),o("Achievement not found");else{const u=(c.achievements||[]).find(h=>h.id===e);u?r(u):o("Achievement not found")}}catch(c){console.error("Unexpected error:",c),o("Failed to load achievement")}finally{a(!1)}})()},[e]),n?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-50 to-cyan-50",children:s.jsxs("div",{className:"text-center",children:[s.jsx(gk,{className:"h-8 w-8 animate-spin text-primary mx-auto mb-4"}),s.jsx("p",{className:"text-muted-foreground",children:"Loading achievement..."})]})}):i||!t?s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-50 to-cyan-50",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-2xl font-bold text-foreground mb-4",children:"Achievement Not Found"}),s.jsx("p",{className:"text-muted-foreground mb-6",children:"The achievement you're looking for doesn't exist or has been removed."}),s.jsx(ht,{to:"/",children:s.jsx(V,{className:"bg-primary hover:bg-primary/90",children:"Return Home"})})]})}):s.jsx("div",{className:"min-h-screen bg-gradient-to-br from-blue-50 to-cyan-50",children:s.jsx("main",{className:"min-h-[calc(100vh-64px)] pt-24 pb-16",children:s.jsx("div",{className:"container mx-auto px-4 lg:px-6",children:s.jsxs("div",{className:"max-w-4xl mx-auto",children:[s.jsxs(ht,{to:"/#events",className:"inline-flex items-center text-primary hover:text-primary/80 mb-8",children:[s.jsx(Qn,{className:"h-4 w-4 mr-2"}),"Back to Achievements"]}),s.jsxs(Fe,{className:"overflow-hidden shadow-2xl border-0",children:[s.jsxs("div",{className:"relative h-64 md:h-96",children:[s.jsx("img",{src:t.image_url||"https://images.unsplash.com/photo-1503676260728-1c00da094a0b",alt:t.title,className:"w-full h-full object-cover"}),s.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/50 to-transparent"}),s.jsxs("div",{className:"absolute bottom-6 left-6",children:[s.jsx(sn,{className:"bg-primary text-primary-foreground mb-4",children:t.category||"Achievement"}),s.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-white mb-2",children:t.title}),t.student_name&&s.jsxs("p",{className:"text-white/90 text-lg",children:["Student: ",t.student_name]})]})]}),s.jsx(Ue,{className:"p-8",children:s.jsxs("div",{className:"prose prose-lg max-w-none",children:[s.jsx("p",{className:"text-xl text-muted-foreground mb-6 leading-relaxed",children:t.description}),s.jsxs("h3",{className:"text-2xl font-bold text-foreground mb-4 flex items-center",children:[s.jsx(Sn,{className:"h-6 w-6 text-primary mr-2"}),"Achievement Details"]}),t.achievement_date&&s.jsxs("div",{className:"bg-gradient-to-r from-blue-50 to-cyan-50 p-6 rounded-xl mb-8",children:[s.jsxs("h4",{className:"text-xl font-bold text-foreground mb-3 flex items-center",children:[s.jsx(Wa,{className:"h-5 w-5 text-primary mr-2"}),"Achievement Date"]}),s.jsx("p",{className:"text-muted-foreground",children:t.achievement_date})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-lg text-muted-foreground mb-2 italic",children:'"Success is not the key to happiness. Happiness is the key to success."'}),s.jsx("p",{className:"text-sm text-primary font-semibold",children:"- Inspirational Quote"})]})]})})]})]})})})})};console.warn("Supabase is no longer available - please update your code to use the new API client");const qe={auth:{getSession:()=>Promise.resolve({data:{session:null},error:null}),getUser:()=>Promise.resolve({data:{user:null},error:null}),signOut:()=>Promise.resolve({error:null}),onAuthStateChange:()=>({data:{subscription:{unsubscribe:()=>{}}}}),admin:{listUsers:()=>Promise.resolve({data:[],error:null})}},from:()=>({select:()=>({eq:()=>({order:()=>Promise.resolve({data:[],error:null})})}),insert:()=>Promise.resolve({data:null,error:null}),update:()=>Promise.resolve({data:null,error:null}),delete:()=>Promise.resolve({data:null,error:null})}),rpc:()=>Promise.resolve({data:null,error:null}),storage:{from:()=>({upload:()=>Promise.resolve({data:null,error:null}),getPublicUrl:()=>({data:{publicUrl:""}})})},functions:{invoke:()=>Promise.resolve({data:null,error:new Error("Supabase functions are no longer available")})}};function mO(e,t=[]){let r=[];function n(i,o){const l=d.createContext(o),c=r.length;r=[...r,o];function u(f){const{scope:m,children:y,...v}=f,p=(m==null?void 0:m[e][c])||l,b=d.useMemo(()=>v,Object.values(v));return s.jsx(p.Provider,{value:b,children:y})}function h(f,m){const y=(m==null?void 0:m[e][c])||l,v=d.useContext(y);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,h]}const a=()=>{const i=r.map(o=>d.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return d.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[n,hO(a,...t)]}function hO(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:u})=>{const f=c(i)[`__scope${u}`];return{...l,...f}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var Zf="rovingFocusGroup.onEntryFocus",pO={bubbles:!1,cancelable:!0},Dd="RovingFocusGroup",[Lh,UN,gO]=md(Dd),[xO,Fd]=mO(Dd,[gO]),[vO,yO]=xO(Dd),zN=d.forwardRef((e,t)=>s.jsx(Lh.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Lh.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(wO,{...e,ref:t})})}));zN.displayName=Dd;var wO=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:h=!1,...f}=e,m=d.useRef(null),y=He(t,m),v=kd(i),[p=null,b]=Ia({prop:o,defaultProp:l,onChange:c}),[g,x]=d.useState(!1),w=Ot(u),N=UN(r),C=d.useRef(!1),[k,T]=d.useState(0);return d.useEffect(()=>{const P=m.current;if(P)return P.addEventListener(Zf,w),()=>P.removeEventListener(Zf,w)},[w]),s.jsx(vO,{scope:r,orientation:n,dir:v,loop:a,currentTabStopId:p,onItemFocus:d.useCallback(P=>b(P),[b]),onItemShiftTab:d.useCallback(()=>x(!0),[]),onFocusableItemAdd:d.useCallback(()=>T(P=>P+1),[]),onFocusableItemRemove:d.useCallback(()=>T(P=>P-1),[]),children:s.jsx(xe.div,{tabIndex:g||k===0?-1:0,"data-orientation":n,...f,ref:y,style:{outline:"none",...e.style},onMouseDown:ne(e.onMouseDown,()=>{C.current=!0}),onFocus:ne(e.onFocus,P=>{const I=!C.current;if(P.target===P.currentTarget&&I&&!g){const D=new CustomEvent(Zf,pO);if(P.currentTarget.dispatchEvent(D),!D.defaultPrevented){const E=N().filter(F=>F.focusable),M=E.find(F=>F.active),U=E.find(F=>F.id===p),G=[M,U,...E].filter(Boolean).map(F=>F.ref.current);HN(G,h)}}C.current=!1}),onBlur:ne(e.onBlur,()=>x(!1))})})}),VN="RovingFocusGroupItem",BN=d.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:i,...o}=e,l=Xn(),c=i||l,u=yO(VN,r),h=u.currentTabStopId===c,f=UN(r),{onFocusableItemAdd:m,onFocusableItemRemove:y}=u;return d.useEffect(()=>{if(n)return m(),()=>y()},[n,m,y]),s.jsx(Lh.ItemSlot,{scope:r,id:c,focusable:n,active:a,children:s.jsx(xe.span,{tabIndex:h?0:-1,"data-orientation":u.orientation,...o,ref:t,onMouseDown:ne(e.onMouseDown,v=>{n?u.onItemFocus(c):v.preventDefault()}),onFocus:ne(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:ne(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){u.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const p=NO(v,u.orientation,u.dir);if(p!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let g=f().filter(x=>x.focusable).map(x=>x.ref.current);if(p==="last")g.reverse();else if(p==="prev"||p==="next"){p==="prev"&&g.reverse();const x=g.indexOf(v.currentTarget);g=u.loop?CO(g,x+1):g.slice(x+1)}setTimeout(()=>HN(g))}})})})});BN.displayName=VN;var bO={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function jO(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function NO(e,t,r){const n=jO(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return bO[n]}function HN(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function CO(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var WN=zN,qN=BN,$h=["Enter"," "],SO=["ArrowDown","PageUp","Home"],KN=["ArrowUp","PageDown","End"],_O=[...SO,...KN],EO={ltr:[...$h,"ArrowRight"],rtl:[...$h,"ArrowLeft"]},kO={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Hl="Menu",[Sl,TO,PO]=md(Hl),[Ka,GN]=sa(Hl,[PO,Ad,Fd]),Ld=Ad(),QN=Fd(),[RO,Ga]=Ka(Hl),[AO,Wl]=Ka(Hl),YN=e=>{const{__scopeMenu:t,open:r=!1,children:n,dir:a,onOpenChange:i,modal:o=!0}=e,l=Ld(t),[c,u]=d.useState(null),h=d.useRef(!1),f=Ot(i),m=kd(a);return d.useEffect(()=>{const y=()=>{h.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>h.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),s.jsx(Xj,{...l,children:s.jsx(RO,{scope:t,open:r,onOpenChange:f,content:c,onContentChange:u,children:s.jsx(AO,{scope:t,onClose:d.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:h,dir:m,modal:o,children:n})})})};YN.displayName=Hl;var IO="MenuAnchor",Ng=d.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,a=Ld(r);return s.jsx(Jj,{...a,...n,ref:t})});Ng.displayName=IO;var Cg="MenuPortal",[MO,ZN]=Ka(Cg,{forceMount:void 0}),XN=e=>{const{__scopeMenu:t,forceMount:r,children:n,container:a}=e,i=Ga(Cg,t);return s.jsx(MO,{scope:t,forceMount:r,children:s.jsx(An,{present:r||i.open,children:s.jsx(Fl,{asChild:!0,container:a,children:n})})})};XN.displayName=Cg;var zr="MenuContent",[OO,Sg]=Ka(zr),JN=d.forwardRef((e,t)=>{const r=ZN(zr,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,i=Ga(zr,e.__scopeMenu),o=Wl(zr,e.__scopeMenu);return s.jsx(Sl.Provider,{scope:e.__scopeMenu,children:s.jsx(An,{present:n||i.open,children:s.jsx(Sl.Slot,{scope:e.__scopeMenu,children:o.modal?s.jsx(DO,{...a,ref:t}):s.jsx(FO,{...a,ref:t})})})})}),DO=d.forwardRef((e,t)=>{const r=Ga(zr,e.__scopeMenu),n=d.useRef(null),a=He(t,n);return d.useEffect(()=>{const i=n.current;if(i)return cg(i)},[]),s.jsx(_g,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:ne(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),FO=d.forwardRef((e,t)=>{const r=Ga(zr,e.__scopeMenu);return s.jsx(_g,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),_g=d.forwardRef((e,t)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:m,onDismiss:y,disableOutsideScroll:v,...p}=e,b=Ga(zr,r),g=Wl(zr,r),x=Ld(r),w=QN(r),N=TO(r),[C,k]=d.useState(null),T=d.useRef(null),P=He(t,T,b.onContentChange),I=d.useRef(0),D=d.useRef(""),E=d.useRef(0),M=d.useRef(null),U=d.useRef("right"),$=d.useRef(0),G=v?Ed:d.Fragment,F=v?{as:Gs,allowPinchZoom:!0}:void 0,X=O=>{var ae,Se;const Y=D.current+O,K=N().filter(Pe=>!Pe.disabled),te=document.activeElement,ge=(ae=K.find(Pe=>Pe.ref.current===te))==null?void 0:ae.textValue,ke=K.map(Pe=>Pe.textValue),Ze=QO(ke,Y,ge),ye=(Se=K.find(Pe=>Pe.textValue===Ze))==null?void 0:Se.ref.current;(function Pe(Ne){D.current=Ne,window.clearTimeout(I.current),Ne!==""&&(I.current=window.setTimeout(()=>Pe(""),1e3))})(Y),ye&&setTimeout(()=>ye.focus())};d.useEffect(()=>()=>window.clearTimeout(I.current),[]),lg();const A=d.useCallback(O=>{var K,te;return U.current===((K=M.current)==null?void 0:K.side)&&ZO(O,(te=M.current)==null?void 0:te.area)},[]);return s.jsx(OO,{scope:r,searchRef:D,onItemEnter:d.useCallback(O=>{A(O)&&O.preventDefault()},[A]),onItemLeave:d.useCallback(O=>{var Y;A(O)||((Y=T.current)==null||Y.focus(),k(null))},[A]),onTriggerLeave:d.useCallback(O=>{A(O)&&O.preventDefault()},[A]),pointerGraceTimerRef:E,onPointerGraceIntentChange:d.useCallback(O=>{M.current=O},[]),children:s.jsx(G,{...F,children:s.jsx(Sd,{asChild:!0,trapped:a,onMountAutoFocus:ne(i,O=>{var Y;O.preventDefault(),(Y=T.current)==null||Y.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:s.jsx(Dl,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:h,onFocusOutside:f,onInteractOutside:m,onDismiss:y,children:s.jsx(WN,{asChild:!0,...w,dir:g.dir,orientation:"vertical",loop:n,currentTabStopId:C,onCurrentTabStopIdChange:k,onEntryFocus:ne(c,O=>{g.isUsingKeyboardRef.current||O.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(eN,{role:"menu","aria-orientation":"vertical","data-state":pC(b.open),"data-radix-menu-content":"",dir:g.dir,...x,...p,ref:P,style:{outline:"none",...p.style},onKeyDown:ne(p.onKeyDown,O=>{const K=O.target.closest("[data-radix-menu-content]")===O.currentTarget,te=O.ctrlKey||O.altKey||O.metaKey,ge=O.key.length===1;K&&(O.key==="Tab"&&O.preventDefault(),!te&&ge&&X(O.key));const ke=T.current;if(O.target!==ke||!_O.includes(O.key))return;O.preventDefault();const ye=N().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);KN.includes(O.key)&&ye.reverse(),KO(ye)}),onBlur:ne(e.onBlur,O=>{O.currentTarget.contains(O.target)||(window.clearTimeout(I.current),D.current="")}),onPointerMove:ne(e.onPointerMove,_l(O=>{const Y=O.target,K=$.current!==O.clientX;if(O.currentTarget.contains(Y)&&K){const te=O.clientX>$.current?"right":"left";U.current=te,$.current=O.clientX}}))})})})})})})});JN.displayName=zr;var LO="MenuGroup",Eg=d.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return s.jsx(xe.div,{role:"group",...n,ref:t})});Eg.displayName=LO;var $O="MenuLabel",eC=d.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return s.jsx(xe.div,{...n,ref:t})});eC.displayName=$O;var qu="MenuItem",cy="menu.itemSelect",$d=d.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:n,...a}=e,i=d.useRef(null),o=Wl(qu,e.__scopeMenu),l=Sg(qu,e.__scopeMenu),c=He(t,i),u=d.useRef(!1),h=()=>{const f=i.current;if(!r&&f){const m=new CustomEvent(cy,{bubbles:!0,cancelable:!0});f.addEventListener(cy,y=>n==null?void 0:n(y),{once:!0}),Mp(f,m),m.defaultPrevented?u.current=!1:o.onClose()}};return s.jsx(tC,{...a,ref:c,disabled:r,onClick:ne(e.onClick,h),onPointerDown:f=>{var m;(m=e.onPointerDown)==null||m.call(e,f),u.current=!0},onPointerUp:ne(e.onPointerUp,f=>{var m;u.current||(m=f.currentTarget)==null||m.click()}),onKeyDown:ne(e.onKeyDown,f=>{const m=l.searchRef.current!=="";r||m&&f.key===" "||$h.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});$d.displayName=qu;var tC=d.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:n=!1,textValue:a,...i}=e,o=Sg(qu,r),l=QN(r),c=d.useRef(null),u=He(t,c),[h,f]=d.useState(!1),[m,y]=d.useState("");return d.useEffect(()=>{const v=c.current;v&&y((v.textContent??"").trim())},[i.children]),s.jsx(Sl.ItemSlot,{scope:r,disabled:n,textValue:a??m,children:s.jsx(qN,{asChild:!0,...l,focusable:!n,children:s.jsx(xe.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:u,onPointerMove:ne(e.onPointerMove,_l(v=>{n?o.onItemLeave(v):(o.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ne(e.onPointerLeave,_l(v=>o.onItemLeave(v))),onFocus:ne(e.onFocus,()=>f(!0)),onBlur:ne(e.onBlur,()=>f(!1))})})})}),UO="MenuCheckboxItem",rC=d.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:n,...a}=e;return s.jsx(oC,{scope:e.__scopeMenu,checked:r,children:s.jsx($d,{role:"menuitemcheckbox","aria-checked":Ku(r)?"mixed":r,...a,ref:t,"data-state":Tg(r),onSelect:ne(a.onSelect,()=>n==null?void 0:n(Ku(r)?!0:!r),{checkForDefaultPrevented:!1})})})});rC.displayName=UO;var nC="MenuRadioGroup",[zO,VO]=Ka(nC,{value:void 0,onValueChange:()=>{}}),sC=d.forwardRef((e,t)=>{const{value:r,onValueChange:n,...a}=e,i=Ot(n);return s.jsx(zO,{scope:e.__scopeMenu,value:r,onValueChange:i,children:s.jsx(Eg,{...a,ref:t})})});sC.displayName=nC;var aC="MenuRadioItem",iC=d.forwardRef((e,t)=>{const{value:r,...n}=e,a=VO(aC,e.__scopeMenu),i=r===a.value;return s.jsx(oC,{scope:e.__scopeMenu,checked:i,children:s.jsx($d,{role:"menuitemradio","aria-checked":i,...n,ref:t,"data-state":Tg(i),onSelect:ne(n.onSelect,()=>{var o;return(o=a.onValueChange)==null?void 0:o.call(a,r)},{checkForDefaultPrevented:!1})})})});iC.displayName=aC;var kg="MenuItemIndicator",[oC,BO]=Ka(kg,{checked:!1}),lC=d.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:n,...a}=e,i=BO(kg,r);return s.jsx(An,{present:n||Ku(i.checked)||i.checked===!0,children:s.jsx(xe.span,{...a,ref:t,"data-state":Tg(i.checked)})})});lC.displayName=kg;var HO="MenuSeparator",cC=d.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e;return s.jsx(xe.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});cC.displayName=HO;var WO="MenuArrow",uC=d.forwardRef((e,t)=>{const{__scopeMenu:r,...n}=e,a=Ld(r);return s.jsx(tN,{...a,...n,ref:t})});uC.displayName=WO;var qO="MenuSub",[ND,dC]=Ka(qO),Fo="MenuSubTrigger",fC=d.forwardRef((e,t)=>{const r=Ga(Fo,e.__scopeMenu),n=Wl(Fo,e.__scopeMenu),a=dC(Fo,e.__scopeMenu),i=Sg(Fo,e.__scopeMenu),o=d.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,u={__scopeMenu:e.__scopeMenu},h=d.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return d.useEffect(()=>h,[h]),d.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),c(null)}},[l,c]),s.jsx(Ng,{asChild:!0,...u,children:s.jsx(tC,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":pC(r.open),...e,ref:fd(t,a.onTriggerChange),onClick:f=>{var m;(m=e.onClick)==null||m.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:ne(e.onPointerMove,_l(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!r.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),h()},100))})),onPointerLeave:ne(e.onPointerLeave,_l(f=>{var y,v;h();const m=(y=r.content)==null?void 0:y.getBoundingClientRect();if(m){const p=(v=r.content)==null?void 0:v.dataset.side,b=p==="right",g=b?-5:5,x=m[b?"left":"right"],w=m[b?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+g,y:f.clientY},{x,y:m.top},{x:w,y:m.top},{x:w,y:m.bottom},{x,y:m.bottom}],side:p}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ne(e.onKeyDown,f=>{var y;const m=i.searchRef.current!=="";e.disabled||m&&f.key===" "||EO[n.dir].includes(f.key)&&(r.onOpenChange(!0),(y=r.content)==null||y.focus(),f.preventDefault())})})})});fC.displayName=Fo;var mC="MenuSubContent",hC=d.forwardRef((e,t)=>{const r=ZN(zr,e.__scopeMenu),{forceMount:n=r.forceMount,...a}=e,i=Ga(zr,e.__scopeMenu),o=Wl(zr,e.__scopeMenu),l=dC(mC,e.__scopeMenu),c=d.useRef(null),u=He(t,c);return s.jsx(Sl.Provider,{scope:e.__scopeMenu,children:s.jsx(An,{present:n||i.open,children:s.jsx(Sl.Slot,{scope:e.__scopeMenu,children:s.jsx(_g,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:h=>{var f;o.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:ne(e.onFocusOutside,h=>{h.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ne(e.onEscapeKeyDown,h=>{o.onClose(),h.preventDefault()}),onKeyDown:ne(e.onKeyDown,h=>{var y;const f=h.currentTarget.contains(h.target),m=kO[o.dir].includes(h.key);f&&m&&(i.onOpenChange(!1),(y=l.trigger)==null||y.focus(),h.preventDefault())})})})})})});hC.displayName=mC;function pC(e){return e?"open":"closed"}function Ku(e){return e==="indeterminate"}function Tg(e){return Ku(e)?"indeterminate":e?"checked":"unchecked"}function KO(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function GO(e,t){return e.map((r,n)=>e[(t+n)%e.length])}function QO(e,t,r){const a=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let o=GO(e,Math.max(i,0));a.length===1&&(o=o.filter(u=>u!==r));const c=o.find(u=>u.toLowerCase().startsWith(a.toLowerCase()));return c!==r?c:void 0}function YO(e,t){const{x:r,y:n}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i].x,c=t[i].y,u=t[o].x,h=t[o].y;c>n!=h>n&&r<(u-l)*(n-c)/(h-c)+l&&(a=!a)}return a}function ZO(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return YO(r,t)}function _l(e){return t=>t.pointerType==="mouse"?e(t):void 0}var XO=YN,JO=Ng,e5=XN,t5=JN,r5=Eg,n5=eC,s5=$d,a5=rC,i5=sC,o5=iC,l5=lC,c5=cC,u5=uC,d5=fC,f5=hC,Pg="DropdownMenu",[m5,CD]=sa(Pg,[GN]),sr=GN(),[h5,gC]=m5(Pg),xC=e=>{const{__scopeDropdownMenu:t,children:r,dir:n,open:a,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,c=sr(t),u=d.useRef(null),[h=!1,f]=Ia({prop:a,defaultProp:i,onChange:o});return s.jsx(h5,{scope:t,triggerId:Xn(),triggerRef:u,contentId:Xn(),open:h,onOpenChange:f,onOpenToggle:d.useCallback(()=>f(m=>!m),[f]),modal:l,children:s.jsx(XO,{...c,open:h,onOpenChange:f,dir:n,modal:l,children:r})})};xC.displayName=Pg;var vC="DropdownMenuTrigger",yC=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...a}=e,i=gC(vC,r),o=sr(r);return s.jsx(JO,{asChild:!0,...o,children:s.jsx(xe.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...a,ref:fd(t,i.triggerRef),onPointerDown:ne(e.onPointerDown,l=>{!n&&l.button===0&&l.ctrlKey===!1&&(i.onOpenToggle(),i.open||l.preventDefault())}),onKeyDown:ne(e.onKeyDown,l=>{n||(["Enter"," "].includes(l.key)&&i.onOpenToggle(),l.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});yC.displayName=vC;var p5="DropdownMenuPortal",wC=e=>{const{__scopeDropdownMenu:t,...r}=e,n=sr(t);return s.jsx(e5,{...n,...r})};wC.displayName=p5;var bC="DropdownMenuContent",jC=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=gC(bC,r),i=sr(r),o=d.useRef(!1);return s.jsx(t5,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...n,ref:t,onCloseAutoFocus:ne(e.onCloseAutoFocus,l=>{var c;o.current||(c=a.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:ne(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,h=c.button===2||u;(!a.modal||h)&&(o.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)"}})});jC.displayName=bC;var g5="DropdownMenuGroup",x5=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=sr(r);return s.jsx(r5,{...a,...n,ref:t})});x5.displayName=g5;var v5="DropdownMenuLabel",NC=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=sr(r);return s.jsx(n5,{...a,...n,ref:t})});NC.displayName=v5;var y5="DropdownMenuItem",CC=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=sr(r);return s.jsx(s5,{...a,...n,ref:t})});CC.displayName=y5;var w5="DropdownMenuCheckboxItem",SC=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=sr(r);return s.jsx(a5,{...a,...n,ref:t})});SC.displayName=w5;var b5="DropdownMenuRadioGroup",j5=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=sr(r);return s.jsx(i5,{...a,...n,ref:t})});j5.displayName=b5;var N5="DropdownMenuRadioItem",_C=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=sr(r);return s.jsx(o5,{...a,...n,ref:t})});_C.displayName=N5;var C5="DropdownMenuItemIndicator",EC=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=sr(r);return s.jsx(l5,{...a,...n,ref:t})});EC.displayName=C5;var S5="DropdownMenuSeparator",kC=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=sr(r);return s.jsx(c5,{...a,...n,ref:t})});kC.displayName=S5;var _5="DropdownMenuArrow",E5=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=sr(r);return s.jsx(u5,{...a,...n,ref:t})});E5.displayName=_5;var k5="DropdownMenuSubTrigger",TC=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=sr(r);return s.jsx(d5,{...a,...n,ref:t})});TC.displayName=k5;var T5="DropdownMenuSubContent",PC=d.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...n}=e,a=sr(r);return s.jsx(f5,{...a,...n,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)"}})});PC.displayName=T5;var P5=xC,R5=yC,A5=wC,RC=jC,AC=NC,IC=CC,MC=SC,OC=_C,DC=EC,FC=kC,LC=TC,$C=PC;const I5=P5,M5=R5,O5=d.forwardRef(({className:e,inset:t,children:r,...n},a)=>s.jsxs(LC,{ref:a,className:le("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...n,children:[r,s.jsx(Ym,{className:"ml-auto h-4 w-4"})]}));O5.displayName=LC.displayName;const D5=d.forwardRef(({className:e,...t},r)=>s.jsx($C,{ref:r,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",e),...t}));D5.displayName=$C.displayName;const UC=d.forwardRef(({className:e,sideOffset:t=4,...r},n)=>s.jsx(A5,{children:s.jsx(RC,{ref:n,sideOffset:t,className:le("z-50 min-w-[8rem] overflow-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",e),...r})}));UC.displayName=RC.displayName;const Lo=d.forwardRef(({className:e,inset:t,...r},n)=>s.jsx(IC,{ref:n,className:le("relative flex cursor-default select-none items-center 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",t&&"pl-8",e),...r}));Lo.displayName=IC.displayName;const F5=d.forwardRef(({className:e,children:t,checked:r,...n},a)=>s.jsxs(MC,{ref:a,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:r,...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(DC,{children:s.jsx($p,{className:"h-4 w-4"})})}),t]}));F5.displayName=MC.displayName;const L5=d.forwardRef(({className:e,children:t,...r},n)=>s.jsxs(OC,{ref:n,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),...r,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(DC,{children:s.jsx(lb,{className:"h-2 w-2 fill-current"})})}),t]}));L5.displayName=OC.displayName;const $5=d.forwardRef(({className:e,inset:t,...r},n)=>s.jsx(AC,{ref:n,className:le("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));$5.displayName=AC.displayName;const U5=d.forwardRef(({className:e,...t},r)=>s.jsx(FC,{ref:r,className:le("-mx-1 my-1 h-px bg-muted",e),...t}));U5.displayName=FC.displayName;const z5=()=>{const[e,t]=d.useState([]),[r,n]=d.useState([]),[a,i]=d.useState(!0),[o,l]=d.useState(!1),[c,u]=d.useState(null),[h,f]=d.useState(!1),[m,y]=d.useState(null),[v,p]=d.useState(null),{toast:b}=na(),[g,x]=d.useState({title:"",description:"",course_id:"",start_time:"",end_time:"",duration_minutes:60});d.useEffect(()=>{w()},[]);const w=async()=>{try{const{data:E,error:M}=await qe.from("courses").select("id, title").eq("is_published",!0);if(M)throw M;t(E||[]);const{data:U,error:$}=await qe.from("exams").select(`
          *,
          courses(title)
        `).order("created_at",{ascending:!1});if($)throw $;n(U||[])}catch(E){console.error("Error fetching data:",E),b({title:"Error",description:"Failed to load data",variant:"destructive"})}finally{i(!1)}},N=E=>{if(!E)return"";const M=new Date(E),U=M.getTimezoneOffset()*6e4;return new Date(M.getTime()-U).toISOString().slice(0,16)},C=async()=>{try{const{data:{user:E}}=await qe.auth.getUser();if(!E)throw new Error("Not authenticated");const{error:M}=await qe.from("exams").insert([{...g,created_by:E.id,status:"draft"}]);if(M)throw M;b({title:"Success",description:"Exam created successfully"}),l(!1),x({title:"",description:"",course_id:"",start_time:"",end_time:"",duration_minutes:60}),w()}catch(E){console.error("Error creating exam:",E),b({title:"Error",description:"Failed to create exam",variant:"destructive"})}},k=async()=>{if(c)try{const{error:E}=await qe.from("exams").update({title:c.title,description:c.description,course_id:c.course_id,start_time:c.start_time,end_time:c.end_time,duration_minutes:c.duration_minutes}).eq("id",c.id);if(E)throw E;u(null),w(),b({title:"Success",description:"Exam updated successfully"})}catch(E){console.error("Error updating exam:",E),b({title:"Error",description:"Failed to update exam",variant:"destructive"})}},T=async()=>{if(m)try{await qe.from("exam_questions").delete().eq("exam_id",m),await qe.from("exam_keys").delete().eq("exam_id",m);const{error:E}=await qe.from("exams").delete().eq("id",m);if(E)throw E;f(!1),y(null),w(),b({title:"Success",description:"Exam deleted successfully"})}catch(E){console.error("Error deleting exam:",E),b({title:"Error",description:"Failed to delete exam",variant:"destructive"})}},P=async E=>{try{const{data:{user:M}}=await qe.auth.getUser();if(!M)throw new Error("Not authenticated");const{error:U}=await qe.from("exam_keys").update({is_active:!1}).eq("exam_id",E).eq("is_active",!0);if(U)throw U;const{data:$,error:G}=await qe.rpc("generate_exam_key");if(G)throw G;const{error:F}=await qe.from("exam_keys").insert([{key_value:$,exam_id:E,created_by:M.id,is_active:!0}]);if(F)throw F;p({key:$,examId:E}),b({title:"Success",description:"New exam key generated and previous keys deactivated. The key has been copied to your clipboard!"}),await navigator.clipboard.writeText($),w()}catch(M){console.error("Error generating exam key:",M),b({title:"Error",description:"Failed to generate exam key",variant:"destructive"})}},I=async(E,M)=>{try{const{error:U}=await qe.from("exams").update({status:M}).eq("id",E);if(U)throw U;b({title:"Success",description:"Exam status updated"}),w()}catch(U){console.error("Error updating exam status:",U),b({title:"Error",description:"Failed to update exam status",variant:"destructive"})}},D=E=>{switch(E){case"draft":return"bg-gray-500";case"scheduled":return"bg-blue-500";case"active":return"bg-green-500";case"closed":return"bg-red-500";default:return"bg-gray-500"}};return a?s.jsx("div",{className:"flex justify-center items-center h-64",children:"Loading..."}):s.jsxs("div",{className:"container mx-auto px-4 py-8",children:[s.jsx(Gt,{open:h,onOpenChange:f,children:s.jsxs($t,{children:[s.jsxs(Ut,{children:[s.jsx(zt,{children:"Delete Exam"}),s.jsx(or,{children:"Are you sure you want to delete this exam? This action cannot be undone and will also delete all related questions and keys."})]}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(V,{variant:"outline",onClick:()=>{f(!1),y(null)},children:"Cancel"}),s.jsx(V,{variant:"destructive",onClick:T,children:"Delete"})]})]})}),s.jsx(Gt,{open:!!c,onOpenChange:E=>!E&&u(null),children:s.jsxs($t,{className:"max-w-md",children:[s.jsx(Ut,{children:s.jsx(zt,{children:"Edit Exam"})}),c&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(H,{htmlFor:"edit-title",children:"Title"}),s.jsx(Q,{id:"edit-title",value:c.title,onChange:E=>u({...c,title:E.target.value}),placeholder:"Exam title"})]}),s.jsxs("div",{children:[s.jsx(H,{htmlFor:"edit-description",children:"Description"}),s.jsx(Zt,{id:"edit-description",value:c.description,onChange:E=>u({...c,description:E.target.value}),placeholder:"Exam description"})]}),s.jsxs("div",{children:[s.jsx(H,{htmlFor:"edit-course",children:"Course"}),s.jsxs(Os,{value:c.course_id,onValueChange:E=>u({...c,course_id:E}),children:[s.jsx(qn,{children:s.jsx(Ds,{placeholder:"Select a course"})}),s.jsx(Kn,{children:e.map(E=>s.jsx(Vt,{value:E.id,children:E.title},E.id))})]})]}),s.jsxs("div",{children:[s.jsx(H,{htmlFor:"edit-start-time",children:"Start Time"}),s.jsx(Q,{id:"edit-start-time",type:"datetime-local",value:N(c.start_time),onChange:E=>u({...c,start_time:E.target.value})})]}),s.jsxs("div",{children:[s.jsx(H,{htmlFor:"edit-end-time",children:"End Time"}),s.jsx(Q,{id:"edit-end-time",type:"datetime-local",value:N(c.end_time),onChange:E=>u({...c,end_time:E.target.value})})]}),s.jsxs("div",{children:[s.jsx(H,{htmlFor:"edit-duration",children:"Duration (minutes)"}),s.jsx(Q,{id:"edit-duration",type:"number",value:c.duration_minutes,onChange:E=>u({...c,duration_minutes:parseInt(E.target.value)})})]}),s.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[s.jsxs(V,{variant:"outline",onClick:()=>u(null),children:[s.jsx(ro,{className:"w-4 h-4 mr-2"}),"Cancel"]}),s.jsxs(V,{onClick:k,children:[s.jsx(Vp,{className:"w-4 h-4 mr-2"}),"Save Changes"]})]})]})]})}),s.jsxs("div",{className:"flex justify-between items-center mb-8",children:[s.jsx("h1",{className:"text-3xl font-bold",children:"Exam Management"}),s.jsxs(Gt,{open:o,onOpenChange:l,children:[s.jsx(Rj,{asChild:!0,children:s.jsxs(V,{children:[s.jsx(fa,{className:"w-4 h-4 mr-2"}),"Create Exam"]})}),s.jsxs($t,{className:"max-w-md",children:[s.jsxs(Ut,{children:[s.jsx(zt,{children:"Create New Exam"}),s.jsx(or,{children:"Set up a new exam for your course"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(H,{htmlFor:"title",children:"Title"}),s.jsx(Q,{id:"title",value:g.title,onChange:E=>x({...g,title:E.target.value}),placeholder:"Exam title"})]}),s.jsxs("div",{children:[s.jsx(H,{htmlFor:"description",children:"Description"}),s.jsx(Zt,{id:"description",value:g.description,onChange:E=>x({...g,description:E.target.value}),placeholder:"Exam description"})]}),s.jsxs("div",{children:[s.jsx(H,{htmlFor:"course",children:"Course"}),s.jsxs(Os,{value:g.course_id,onValueChange:E=>x({...g,course_id:E}),children:[s.jsx(qn,{children:s.jsx(Ds,{placeholder:"Select a course"})}),s.jsx(Kn,{children:e.map(E=>s.jsx(Vt,{value:E.id,children:E.title},E.id))})]})]}),s.jsxs("div",{children:[s.jsx(H,{htmlFor:"start_time",children:"Start Time"}),s.jsx(Q,{id:"start_time",type:"datetime-local",value:g.start_time,onChange:E=>x({...g,start_time:E.target.value})})]}),s.jsxs("div",{children:[s.jsx(H,{htmlFor:"end_time",children:"End Time"}),s.jsx(Q,{id:"end_time",type:"datetime-local",value:g.end_time,onChange:E=>x({...g,end_time:E.target.value})})]}),s.jsxs("div",{children:[s.jsx(H,{htmlFor:"duration",children:"Duration (minutes)"}),s.jsx(Q,{id:"duration",type:"number",value:g.duration_minutes,onChange:E=>x({...g,duration_minutes:parseInt(E.target.value)})})]}),s.jsx(V,{onClick:C,className:"w-full",children:"Create Exam"})]})]})]})]}),s.jsx("div",{className:"grid gap-6",children:r.map(E=>{var M;return s.jsxs(Fe,{children:[s.jsx(st,{children:s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsxs("div",{children:[s.jsx(dt,{className:"flex items-center gap-2",children:(c==null?void 0:c.id)===E.id?s.jsx(Q,{value:c.title,onChange:U=>u({...c,title:U.target.value}),className:"text-lg font-bold border-0 shadow-none px-0"}):E.title}),s.jsx(pn,{className:"mt-1",children:(c==null?void 0:c.id)===E.id?s.jsx(Zt,{value:c.description,onChange:U=>u({...c,description:U.target.value}),className:"border-0 shadow-none p-0 min-h-[60px]",placeholder:"Exam description"}):E.description})]}),s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(sn,{className:D(E.status),children:E.status}),s.jsxs("div",{className:"flex gap-1",children:[s.jsx(V,{variant:"ghost",size:"sm",onClick:()=>u({...E}),className:"h-8 w-8 p-0",children:s.jsx(gi,{className:"h-4 w-4"})}),s.jsx(V,{variant:"ghost",size:"sm",onClick:()=>{y(E.id),f(!0)},className:"h-8 w-8 p-0 text-red-500 hover:text-red-600 hover:bg-red-50",children:s.jsx(ys,{className:"h-4 w-4"})})]})]})]})}),s.jsxs(Ue,{children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(vd,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm",children:new Date(E.start_time).toLocaleString()})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Gi,{className:"w-4 h-4"}),s.jsxs("span",{className:"text-sm",children:[E.duration_minutes," minutes"]})]}),s.jsxs("div",{className:"text-sm",children:["Course: ",(M=E.courses)==null?void 0:M.title]})]}),s.jsxs("div",{className:"flex flex-col gap-4",children:[(v==null?void 0:v.examId)===E.id&&s.jsxs("div",{className:"flex items-center gap-2 p-2 bg-gray-100 dark:bg-gray-800 rounded-md",children:[s.jsx("span",{className:"font-mono text-sm",children:v.key}),s.jsx(V,{variant:"ghost",size:"sm",className:"ml-auto",onClick:()=>{navigator.clipboard.writeText(v.key),b({title:"Copied!",description:"Exam key copied to clipboard"})},children:"Copy"})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(V,{variant:"outline",size:"sm",onClick:()=>P(E.id),className:"flex-1 sm:flex-none",children:[s.jsx(ub,{className:"w-4 h-4 mr-2"}),(v==null?void 0:v.examId)===E.id?"Regenerate Key":"Generate Key"]}),s.jsxs(I5,{children:[s.jsx(M5,{asChild:!0,children:s.jsxs(V,{variant:"outline",size:"sm",className:"flex-1 sm:flex-none",children:[s.jsx("span",{className:"mr-2",children:"Set Status"}),s.jsx(Up,{className:"h-4 w-4"})]})}),s.jsxs(UC,{align:"end",children:[s.jsx(Lo,{onClick:()=>I(E.id,"draft"),className:E.status==="draft"?"bg-gray-100 font-medium":"",children:"Draft"}),s.jsx(Lo,{onClick:()=>I(E.id,"scheduled"),className:E.status==="scheduled"?"bg-gray-100 font-medium":"",children:"Scheduled"}),s.jsx(Lo,{onClick:()=>I(E.id,"active"),className:E.status==="active"?"bg-green-50 text-green-700 font-medium":"",children:"Active"}),s.jsx(Lo,{onClick:()=>I(E.id,"closed"),className:E.status==="closed"?"bg-red-50 text-red-700 font-medium":"",children:"Closed"})]})]}),s.jsxs(V,{variant:"outline",size:"sm",onClick:()=>window.location.href=`/exam-questions/${E.id}`,className:"flex-1 sm:flex-none",children:[s.jsx(yk,{className:"w-4 h-4 mr-2"}),"Manage Questions"]})]})]})]})]},E.id)})})]})},V5=()=>{const[e,t]=d.useState("key"),[r,n]=d.useState(""),[a,i]=d.useState(""),[o,l]=d.useState(null),[c,u]=d.useState(!1),{toast:h}=na(),f=ln(),m=async()=>{if(!r.trim()){h({title:"Error",description:"Please enter an exam key",variant:"destructive"});return}u(!0);try{let v=qe.from("exam_keys").select(`
          *,
          exams (
            id,
            title,
            course_id,
            status,
            start_time,
            end_time
          )
        `).eq("key_value",r.toUpperCase()).single();const{data:p,error:b}=await v;if(b||!p){h({title:"Invalid Key",description:"The exam key you entered is not valid",variant:"destructive"});return}if(p.is_active===!1){h({title:"Key Inactive",description:"This exam key is no longer active",variant:"destructive"});return}const g=p.exams;if(g.status!=="active"){h({title:"Exam Not Available",description:"This exam is not currently active",variant:"destructive"});return}if(new Date>new Date(g.end_time)){h({title:"Exam Ended",description:"This exam has already ended",variant:"destructive"});return}l(p),t("email")}catch(v){console.error("Error verifying exam key:",v),h({title:"Error",description:"Failed to verify exam key",variant:"destructive"})}finally{u(!1)}},y=async()=>{if(!a.trim()){h({title:"Error",description:"Please enter your email address",variant:"destructive"});return}u(!0);try{const{data:v,error:p}=await qe.from("enrollments").select("user_id").eq("course_id",o.exams.course_id).eq("status","active");if(p)throw p;const{data:b,error:g}=await qe.from("profiles").select("id").eq("email",a).single();let x=!1;if(b?x=(v==null?void 0:v.some(C=>C.user_id===b.id))||!1:x=!0,!x){h({title:"Access Denied",description:"You are not enrolled in the course associated with this exam",variant:"destructive"});return}const{data:w,error:N}=await qe.from("exam_attempts").insert([{exam_id:o.exams.id,user_email:a,user_id:(b==null?void 0:b.id)||null}]).select().single();if(N)throw N;f(`/take-exam/${w.id}`)}catch(v){console.error("Error verifying email:",v),h({title:"Error",description:"Failed to verify enrollment",variant:"destructive"})}finally{u(!1)}};return s.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center px-4",children:s.jsxs(Fe,{className:"w-full max-w-md",children:[s.jsxs(st,{className:"text-center",children:[s.jsxs(dt,{className:"flex items-center justify-center gap-2",children:[s.jsx(ub,{className:"w-6 h-6"}),"Exam Access"]}),s.jsx(pn,{children:e==="key"?"Enter your exam access key to continue":"Verify your email to start the exam"})]}),s.jsx(Ue,{className:"space-y-4",children:e==="key"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(H,{htmlFor:"examKey",children:"Exam Key"}),s.jsx(Q,{id:"examKey",value:r,onChange:v=>n(v.target.value),placeholder:"Enter exam key",className:"text-center font-mono text-lg"})]}),s.jsxs(V,{onClick:m,disabled:c,className:"w-full",children:[c?"Verifying...":"Verify Key",s.jsx(Lp,{className:"w-4 h-4 ml-2"})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bg-blue-50 p-4 rounded-lg",children:[s.jsx("h3",{className:"font-semibold text-blue-900",children:o.exams.title}),s.jsx("p",{className:"text-sm text-blue-700",children:"Valid key accepted. Please verify your email to continue."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(H,{htmlFor:"email",children:"Email Address"}),s.jsx(Q,{id:"email",type:"email",value:a,onChange:v=>i(v.target.value),placeholder:"Enter your email"})]}),s.jsxs(V,{onClick:y,disabled:c,className:"w-full",children:[c?"Verifying...":"Start Exam",s.jsx(yd,{className:"w-4 h-4 ml-2"})]}),s.jsx(V,{variant:"outline",onClick:()=>t("key"),className:"w-full",children:"Back to Key Entry"})]})})]})})};var Rg="Radio",[B5,zC]=sa(Rg),[H5,W5]=B5(Rg),VC=d.forwardRef((e,t)=>{const{__scopeRadio:r,name:n,checked:a=!1,required:i,disabled:o,value:l="on",onCheck:c,form:u,...h}=e,[f,m]=d.useState(null),y=He(t,b=>m(b)),v=d.useRef(!1),p=f?u||!!f.closest("form"):!0;return s.jsxs(H5,{scope:r,checked:a,disabled:o,children:[s.jsx(xe.button,{type:"button",role:"radio","aria-checked":a,"data-state":WC(a),"data-disabled":o?"":void 0,disabled:o,value:l,...h,ref:y,onClick:ne(e.onClick,b=>{a||c==null||c(),p&&(v.current=b.isPropagationStopped(),v.current||b.stopPropagation())})}),p&&s.jsx(q5,{control:f,bubbles:!v.current,name:n,value:l,checked:a,required:i,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});VC.displayName=Rg;var BC="RadioIndicator",HC=d.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:n,...a}=e,i=W5(BC,r);return s.jsx(An,{present:n||i.checked,children:s.jsx(xe.span,{"data-state":WC(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t})})});HC.displayName=BC;var q5=e=>{const{control:t,checked:r,bubbles:n=!0,...a}=e,i=d.useRef(null),o=rN(r),l=Vj(t);return d.useEffect(()=>{const c=i.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(o!==r&&f){const m=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(m)}},[o,r,n]),s.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:i,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function WC(e){return e?"checked":"unchecked"}var K5=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ag="RadioGroup",[G5,SD]=sa(Ag,[Fd,zC]),qC=Fd(),KC=zC(),[Q5,Y5]=G5(Ag),GC=d.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:a,value:i,required:o=!1,disabled:l=!1,orientation:c,dir:u,loop:h=!0,onValueChange:f,...m}=e,y=qC(r),v=kd(u),[p,b]=Ia({prop:i,defaultProp:a,onChange:f});return s.jsx(Q5,{scope:r,name:n,required:o,disabled:l,value:p,onValueChange:b,children:s.jsx(WN,{asChild:!0,...y,orientation:c,dir:v,loop:h,children:s.jsx(xe.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:v,...m,ref:t})})})});GC.displayName=Ag;var QC="RadioGroupItem",YC=d.forwardRef((e,t)=>{const{__scopeRadioGroup:r,disabled:n,...a}=e,i=Y5(QC,r),o=i.disabled||n,l=qC(r),c=KC(r),u=d.useRef(null),h=He(t,u),f=i.value===a.value,m=d.useRef(!1);return d.useEffect(()=>{const y=p=>{K5.includes(p.key)&&(m.current=!0)},v=()=>m.current=!1;return document.addEventListener("keydown",y),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",y),document.removeEventListener("keyup",v)}},[]),s.jsx(qN,{asChild:!0,...l,focusable:!o,active:f,children:s.jsx(VC,{disabled:o,required:i.required,checked:f,...c,...a,name:i.name,ref:h,onCheck:()=>i.onValueChange(a.value),onKeyDown:ne(y=>{y.key==="Enter"&&y.preventDefault()}),onFocus:ne(a.onFocus,()=>{var y;m.current&&((y=u.current)==null||y.click())})})})});YC.displayName=QC;var Z5="RadioGroupIndicator",ZC=d.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...n}=e,a=KC(r);return s.jsx(HC,{...a,...n,ref:t})});ZC.displayName=Z5;var XC=GC,JC=YC,X5=ZC;const eS=d.forwardRef(({className:e,...t},r)=>s.jsx(XC,{className:le("grid gap-2",e),...t,ref:r}));eS.displayName=XC.displayName;const tS=d.forwardRef(({className:e,...t},r)=>s.jsx(JC,{ref:r,className:le("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:s.jsx(X5,{className:"flex items-center justify-center",children:s.jsx(lb,{className:"h-2.5 w-2.5 fill-current text-current"})})}));tS.displayName=JC.displayName;function J5(e,t=[]){let r=[];function n(i,o){const l=d.createContext(o),c=r.length;r=[...r,o];function u(f){const{scope:m,children:y,...v}=f,p=(m==null?void 0:m[e][c])||l,b=d.useMemo(()=>v,Object.values(v));return s.jsx(p.Provider,{value:b,children:y})}function h(f,m){const y=(m==null?void 0:m[e][c])||l,v=d.useContext(y);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,h]}const a=()=>{const i=r.map(o=>d.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return d.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[n,eD(a,...t)]}function eD(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:u})=>{const f=c(i)[`__scope${u}`];return{...l,...f}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var Ig="Progress",Mg=100,[tD,_D]=J5(Ig),[rD,nD]=tD(Ig),rS=d.forwardRef((e,t)=>{const{__scopeProgress:r,value:n=null,max:a,getValueLabel:i=sD,...o}=e;(a||a===0)&&!uy(a)&&console.error(aD(`${a}`,"Progress"));const l=uy(a)?a:Mg;n!==null&&!dy(n,l)&&console.error(iD(`${n}`,"Progress"));const c=dy(n,l)?n:null,u=Gu(c)?i(c,l):void 0;return s.jsx(rD,{scope:r,value:c,max:l,children:s.jsx(xe.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":Gu(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":aS(c,l),"data-value":c??void 0,"data-max":l,...o,ref:t})})});rS.displayName=Ig;var nS="ProgressIndicator",sS=d.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,a=nD(nS,r);return s.jsx(xe.div,{"data-state":aS(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...n,ref:t})});sS.displayName=nS;function sD(e,t){return`${Math.round(e/t*100)}%`}function aS(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Gu(e){return typeof e=="number"}function uy(e){return Gu(e)&&!isNaN(e)&&e>0}function dy(e,t){return Gu(e)&&!isNaN(e)&&e<=t&&e>=0}function aD(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Mg}\`.`}function iD(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
  - a positive number
  - less than the value passed to \`max\` (or ${Mg} if no \`max\` prop is set)
  - \`null\` or \`undefined\` if the progress is indeterminate.

Defaulting to \`null\`.`}var iS=rS,oD=sS;const oS=d.forwardRef(({className:e,value:t,...r},n)=>s.jsx(iS,{ref:n,className:le("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:s.jsx(oD,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));oS.displayName=iS.displayName;const lD=()=>{var T,P;const{attemptId:e}=Ll(),t=ln(),{toast:r}=na(),[n,a]=d.useState(null),[i,o]=d.useState([]),[l,c]=d.useState(0),[u,h]=d.useState({}),[f,m]=d.useState(0),[y,v]=d.useState(!0),[p,b]=d.useState(!1);d.useEffect(()=>{e&&g()},[e]),d.useEffect(()=>{if(!n)return;const D=(()=>{const E=new Date,M=new Date(n.exams.start_time),U=new Date(n.exams.end_time);if(E<M)return Math.max(0,Math.floor((M.getTime()-E.getTime())/1e3));const $=new Date(n.started_at),G=new Date($.getTime()+n.exams.duration_minutes*60*1e3),F=G<U?G:U;return Math.max(0,Math.floor((F.getTime()-E.getTime())/1e3))})();if(m(D),D>0&&!n.is_completed){const E=setInterval(()=>{m(M=>{const U=M-1;return U<=0?(clearInterval(E),n&&!n.is_completed&&w(),0):U})},1e3);return()=>clearInterval(E)}else D<=0&&!n.is_completed&&w()},[n]);const g=async()=>{try{const{data:I,error:D}=await qe.from("exam_attempts").select(`
          *,
          exams (
            title,
            duration_minutes,
            start_time,
            end_time
          )
        `).eq("id",e).single();if(D)throw D;if(I.is_completed){r({title:"Exam Completed",description:"You have already completed this exam and cannot retake it.",variant:"destructive"}),t("/");return}if(!I.started_at){const{error:F}=await qe.from("exam_attempts").update({started_at:new Date().toISOString()}).eq("id",e);if(F)throw F;I.started_at=new Date().toISOString()}const E=new Date,M=new Date(I.exams.start_time),U=new Date(I.exams.end_time);if(E<M){r({title:"Exam Not Started",description:`The exam will be available at ${M.toLocaleString()}`,variant:"destructive"}),t("/");return}if(E>U){r({title:"Exam Has Ended",description:"The exam time has already ended.",variant:"destructive"}),t("/");return}a(I);const{data:$,error:G}=await qe.from("exam_questions").select("*").eq("exam_id",I.exam_id).order("question_order");if(G)throw G;o($||[])}catch(I){console.error("Error fetching exam data:",I),r({title:"Error",description:"Failed to load exam",variant:"destructive"}),t("/")}finally{v(!1)}},x=(I,D)=>{h(E=>({...E,[I]:D}))},w=async()=>{b(!0);try{let I=0;const D=[],{data:E,error:M}=await qe.from("exam_questions").select("id, correct_answer").eq("exam_id",n==null?void 0:n.exam_id);if(M)throw M;E==null||E.forEach(F=>{const X=u[F.id],A=X&&X===F.correct_answer;A&&I++,D.push({question_id:F.id,answer_text:X||"",is_correct:A,points_earned:A?1:0})});const U=(E==null?void 0:E.length)||1,$=Math.round(I/U*100),{error:G}=await qe.from("exam_attempts").update({is_completed:!0,submitted_at:new Date().toISOString(),answers:u,score:$,correct_answers:I,total_questions:U,status:"graded"}).eq("id",e);if(G)throw G;if(D.length>0){const{error:F}=await qe.from("exam_answers").insert(D);if(F)throw F}r({title:"Success",description:"Exam submitted successfully"}),t("/exam-completed")}catch(I){console.error("Error submitting exam:",I),r({title:"Error",description:"Failed to submit exam",variant:"destructive"})}finally{b(!1)}},N=I=>{const D=Math.floor(I/3600),E=Math.floor(I%3600/60),M=I%60;return`${D.toString().padStart(2,"0")}:${E.toString().padStart(2,"0")}:${M.toString().padStart(2,"0")}`};if(y)return s.jsx("div",{className:"flex justify-center items-center h-64",children:"Loading exam..."});if(!n||i.length===0)return s.jsx("div",{className:"text-center",children:"Exam not found"});const C=i[l],k=(l+1)/i.length*100;return s.jsx("div",{className:"min-h-screen bg-gray-50 py-8",children:s.jsxs("div",{className:"container mx-auto px-4 max-w-4xl",children:[s.jsxs("div",{className:"bg-white rounded-lg shadow-sm p-6 mb-6",children:[s.jsxs("div",{className:"flex justify-between items-center mb-4",children:[s.jsx("h1",{className:"text-2xl font-bold",children:n.exams.title}),s.jsx("div",{className:"flex items-center gap-4",children:s.jsxs("div",{className:"flex items-center gap-2 text-red-600",children:[s.jsx(Gi,{className:"w-5 h-5"}),s.jsx("span",{className:"font-mono text-lg",children:N(f)})]})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between text-sm text-gray-600",children:[s.jsxs("span",{children:["Question ",l+1," of ",i.length]}),s.jsxs("span",{children:[Math.round(k),"% Complete"]})]}),s.jsx(oS,{value:k,className:"h-2"})]})]}),s.jsxs(Fe,{className:"mb-6",children:[s.jsx(st,{children:s.jsxs(dt,{className:"text-lg",children:["Question ",C.question_order,s.jsxs("span",{className:"ml-2 text-sm font-normal text-gray-500",children:["(",C.points," ",C.points===1?"point":"points",")"]})]})}),s.jsxs(Ue,{className:"space-y-4",children:[s.jsx("p",{className:"text-gray-800",children:C.question_text}),C.question_type==="audio"&&C.audio_url&&s.jsx("div",{className:"bg-blue-50 p-4 rounded-lg",children:s.jsxs("audio",{controls:!0,className:"w-full",children:[s.jsx("source",{src:C.audio_url,type:"audio/mpeg"}),"Your browser does not support the audio element."]})}),C.question_type==="image"&&C.image_url&&s.jsx("div",{className:"flex justify-center",children:s.jsx("img",{src:C.image_url,alt:"Question image",className:"max-w-full h-auto rounded-lg shadow-sm"})}),s.jsx("div",{className:"space-y-4",children:C.question_type==="multiple_choice"?s.jsx(eS,{value:u[C.id]||"",onValueChange:I=>x(C.id,I),children:(P=(T=C.multiple_choice_options)==null?void 0:T.options)==null?void 0:P.map((I,D)=>s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(tS,{value:I,id:`option-${D}`}),s.jsx(H,{htmlFor:`option-${D}`,children:I})]},D))}):s.jsx(Zt,{placeholder:"Enter your answer here...",value:u[C.id]||"",onChange:I=>x(C.id,I.target.value),rows:4})})]})]}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx(V,{variant:"outline",onClick:()=>c(l-1),disabled:l===0,children:"Previous"}),s.jsx("div",{className:"flex gap-2",children:l===i.length-1?s.jsxs(V,{onClick:w,disabled:p,className:"bg-green-600 hover:bg-green-700",children:[p?"Submitting...":"Submit Exam",s.jsx(zp,{className:"w-4 h-4 ml-2"})]}):s.jsx(V,{onClick:()=>c(l+1),children:"Next"})})]})]})})},cD=()=>{const e=ln();return s.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center px-4",children:s.jsxs(Fe,{className:"w-full max-w-md text-center",children:[s.jsxs(st,{children:[s.jsx("div",{className:"flex justify-center mb-4",children:s.jsx(zp,{className:"w-16 h-16 text-green-500"})}),s.jsx(dt,{className:"text-2xl text-green-700",children:"Exam Completed!"})]}),s.jsxs(Ue,{className:"space-y-4",children:[s.jsx("p",{className:"text-gray-600",children:"Thank you for completing the exam. Your answers have been submitted successfully."}),s.jsx("p",{className:"text-sm text-gray-500",children:"You will be notified about your results once they are available."}),s.jsxs(V,{onClick:()=>e("/"),className:"w-full",children:[s.jsx(cb,{className:"w-4 h-4 mr-2"}),"Return to Home"]})]})]})})},uD=()=>{var w;const{examId:e}=Ll(),t=ln(),{toast:r}=na(),[n,a]=d.useState(null),[i,o]=d.useState([]),[l,c]=d.useState(!0),[u,h]=d.useState(null),[f,m]=d.useState(!1),[y,v]=d.useState({question_type:"text",question_text:"",question_order:1,points:1,multiple_choice_options:{options:["","","",""]},correct_answer:""});d.useEffect(()=>{e&&p()},[e]);const p=async()=>{if(!e){h("Invalid exam ID"),c(!1);return}try{c(!0),h(null);const{data:{user:N},error:C}=await qe.auth.getUser();if(C||!N)throw new Error((C==null?void 0:C.message)||"User not authenticated");const{data:k,error:T}=await qe.rpc("is_admin",{user_id:N.id});T&&console.error("Admin check error:",T);const P=!!k,{data:I,error:D}=await qe.from("exams").select("*, courses(title)").eq("id",e).single();if(D||!I)throw new Error((D==null?void 0:D.message)||"Exam not found");if(!P){const{data:U,error:$}=await qe.from("enrollments").select("id").eq("user_id",N.id).eq("course_id",I.course_id).single();if($||!U)throw new Error(($==null?void 0:$.message)||"You do not have access to this exam")}a(I);const{data:E,error:M}=await qe.from("exam_questions").select("*").eq("exam_id",e).order("question_order");if(M)throw M;o(E||[])}catch(N){console.error("Error in fetchData:",N),h(N instanceof Error?N.message:"An unknown error occurred"),(!(N instanceof Error)||!N.message.includes("not authenticated"))&&r({title:"Error",description:N instanceof Error?N.message:"Failed to load exam data",variant:"destructive"}),!(N instanceof Error)||!N.message.includes("not authenticated")?t("/exam-management"):t("/login")}finally{c(!1)}},b=async()=>{try{const N={...y,exam_id:e,question_order:i.length+1},{error:C}=await qe.from("exam_questions").insert([N]);if(C)throw C;r({title:"Success",description:"Question added successfully"}),m(!1),v({question_type:"text",question_text:"",question_order:1,points:1,multiple_choice_options:{options:["","","",""]},correct_answer:""}),p()}catch(N){console.error("Error adding question:",N),r({title:"Error",description:"Failed to add question",variant:"destructive"})}},g=async N=>{try{const{error:C}=await qe.from("exam_questions").delete().eq("id",N);if(C)throw C;r({title:"Success",description:"Question deleted successfully"}),p()}catch(C){console.error("Error deleting question:",C),r({title:"Error",description:"Failed to delete question",variant:"destructive"})}},x=(N,C)=>{const k=[...y.multiple_choice_options.options];k[N]=C,v({...y,multiple_choice_options:{options:k}})};return l?s.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-gray-50 p-4",children:[s.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 mb-4"}),s.jsx("p",{className:"text-gray-600",children:"Loading exam questions..."})]}):u?s.jsxs("div",{className:"min-h-screen flex flex-col items-center justify-center bg-gray-50 p-4",children:[s.jsxs("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative mb-4 max-w-md w-full",role:"alert",children:[s.jsx("strong",{className:"font-bold",children:"Error: "}),s.jsx("span",{className:"block sm:inline",children:u})]}),s.jsx(V,{onClick:()=>window.location.reload(),className:"mt-4",children:"Try Again"})]}):s.jsxs("div",{className:"container mx-auto px-4 py-8",children:[s.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[s.jsxs(V,{variant:"outline",onClick:()=>t("/exam-management"),children:[s.jsx(Qn,{className:"w-4 h-4 mr-2"}),"Back to Exams"]}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold",children:n==null?void 0:n.title}),s.jsxs("p",{className:"text-gray-600",children:["Course: ",(w=n==null?void 0:n.courses)==null?void 0:w.title]})]})]}),s.jsxs("div",{className:"flex justify-between items-center mb-6",children:[s.jsxs("h2",{className:"text-xl font-semibold",children:["Questions (",i.length,")"]}),s.jsxs(Gt,{open:f,onOpenChange:m,children:[s.jsx(Rj,{asChild:!0,children:s.jsxs(V,{children:[s.jsx(fa,{className:"w-4 h-4 mr-2"}),"Add Question"]})}),s.jsxs($t,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[s.jsx(Ut,{children:s.jsx(zt,{children:"Add New Question"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(H,{children:"Question Type"}),s.jsxs(Os,{value:y.question_type,onValueChange:N=>v({...y,question_type:N}),children:[s.jsx(qn,{children:s.jsx(Ds,{})}),s.jsxs(Kn,{children:[s.jsx(Vt,{value:"text",children:"Text (Open-ended)"}),s.jsx(Vt,{value:"multiple_choice",children:"Multiple Choice"}),s.jsx(Vt,{value:"audio",children:"Audio Question"}),s.jsx(Vt,{value:"image",children:"Image Question"})]})]})]}),s.jsxs("div",{children:[s.jsx(H,{children:"Question Text"}),s.jsx(Zt,{value:y.question_text,onChange:N=>v({...y,question_text:N.target.value}),placeholder:"Enter your question..."})]}),s.jsxs("div",{children:[s.jsx(H,{children:"Points"}),s.jsx(Q,{type:"number",min:"1",value:y.points,onChange:N=>v({...y,points:parseInt(N.target.value)})})]}),y.question_type==="multiple_choice"&&s.jsxs("div",{children:[s.jsx(H,{children:"Answer Options"}),s.jsx("div",{className:"space-y-2",children:y.multiple_choice_options.options.map((N,C)=>s.jsx(Q,{value:N,onChange:k=>x(C,k.target.value),placeholder:`Option ${C+1}`},C))}),s.jsxs("div",{className:"mt-2",children:[s.jsx(H,{children:"Correct Answer"}),s.jsxs(Os,{value:y.correct_answer,onValueChange:N=>v({...y,correct_answer:N}),children:[s.jsx(qn,{children:s.jsx(Ds,{placeholder:"Select correct answer"})}),s.jsx(Kn,{children:y.multiple_choice_options.options.map((N,C)=>N&&s.jsx(Vt,{value:N,children:N},C))})]})]})]}),y.question_type==="audio"&&s.jsxs("div",{children:[s.jsx(H,{children:"Audio URL"}),s.jsx(Q,{value:y.audio_url||"",onChange:N=>v({...y,audio_url:N.target.value}),placeholder:"Enter audio file URL"})]}),y.question_type==="image"&&s.jsxs("div",{children:[s.jsx(H,{children:"Image URL"}),s.jsx(Q,{value:y.image_url||"",onChange:N=>v({...y,image_url:N.target.value}),placeholder:"Enter image file URL"})]}),s.jsxs(V,{onClick:b,className:"w-full",children:[s.jsx(Vp,{className:"w-4 h-4 mr-2"}),"Add Question"]})]})]})]})]}),s.jsx("div",{className:"grid gap-4",children:i.map((N,C)=>s.jsxs(Fe,{children:[s.jsx(st,{children:s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsxs(dt,{className:"text-lg",children:["Question ",C+1,s.jsxs("span",{className:"ml-2 text-sm font-normal text-gray-500",children:["(",N.points," ",N.points===1?"point":"points",")"]})]}),s.jsx(V,{variant:"outline",size:"sm",onClick:()=>g(N.id),className:"text-red-600 hover:text-red-700",children:s.jsx(ys,{className:"w-4 h-4"})})]})}),s.jsx(Ue,{children:s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"flex items-center gap-2",children:s.jsx("span",{className:"text-sm font-medium bg-blue-100 text-blue-800 px-2 py-1 rounded",children:N.question_type.replace("_"," ").toUpperCase()})}),s.jsx("p",{className:"text-gray-800",children:N.question_text}),N.question_type==="multiple_choice"&&N.multiple_choice_options&&s.jsxs("div",{className:"mt-2",children:[s.jsx("p",{className:"text-sm font-medium text-gray-600 mb-1",children:"Options:"}),s.jsx("ul",{className:"list-disc list-inside space-y-1",children:N.multiple_choice_options.options.map((k,T)=>s.jsxs("li",{className:`text-sm ${k===N.correct_answer?"text-green-600 font-medium":"text-gray-600"}`,children:[k," ",k===N.correct_answer&&"(Correct)"]},T))})]}),N.audio_url&&s.jsx("div",{className:"mt-2",children:s.jsxs("audio",{controls:!0,className:"w-full max-w-sm",children:[s.jsx("source",{src:N.audio_url,type:"audio/mpeg"}),"Your browser does not support the audio element."]})}),N.image_url&&s.jsx("div",{className:"mt-2",children:s.jsx("img",{src:N.image_url,alt:"Question image",className:"max-w-sm h-auto rounded border"})})]})})]},N.id))}),i.length===0&&s.jsx("div",{className:"text-center py-12 text-gray-500",children:s.jsx("p",{children:'No questions added yet. Click "Add Question" to get started.'})})]})},dD=()=>{const e=qa();return d.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),s.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),s.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})},fD=new YP,ca=({children:e})=>{const{user:t,isLoading:r}=ia();return r?s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:"Loading..."}):t?e:s.jsx(Ib,{to:"/login",replace:!0})};function mD(){return s.jsxs(wP,{children:[s.jsx(ir,{path:"/",element:s.jsx(DR,{})}),s.jsx(ir,{path:"/course/:id",element:s.jsx(VR,{})}),s.jsx(ir,{path:"/enroll/:id",element:s.jsx(F4,{})}),s.jsx(ir,{path:"/login",element:s.jsx($4,{})}),s.jsx(ir,{path:"/achievement/:id",element:s.jsx(fO,{})}),s.jsx(ir,{path:"/profile",element:s.jsx(ca,{children:s.jsx(yA,{})})}),s.jsx(ir,{path:"/admin",element:s.jsx(ca,{children:s.jsx(dO,{})})}),s.jsx(ir,{path:"/exam-management",element:s.jsx(ca,{children:s.jsx(z5,{})})}),s.jsx(ir,{path:"/exam-access",element:s.jsx(ca,{children:s.jsx(V5,{})})}),s.jsx(ir,{path:"/take-exam/:attemptId",element:s.jsx(ca,{children:s.jsx(lD,{})})}),s.jsx(ir,{path:"/exam-completed",element:s.jsx(ca,{children:s.jsx(cD,{})})}),s.jsx(ir,{path:"/exam-questions/:examId",element:s.jsx(ca,{children:s.jsx(uD,{})})}),s.jsx(ir,{path:"*",element:s.jsx(dD,{})})]})}function hD(){return s.jsx(tR,{client:fD,children:s.jsx(IP,{children:s.jsxs(EP,{children:[s.jsxs("div",{className:"min-h-screen flex flex-col",children:[s.jsx(MP,{}),s.jsx("main",{className:"flex-1",children:s.jsx(mD,{})}),s.jsx(OP,{})]}),s.jsx(nT,{}),s.jsx(AT,{position:"top-right"})]})})})}Dw(document.getElementById("root")).render(s.jsx(hD,{}));
