mirror of
https://github.com/SamyRai/tercul-frontend.git
synced 2025-12-27 04:51:34 +00:00
* Enforce type safety using zod v4 across the application - Updated `Search.tsx` to align `tags` type with schema (string[]). - Fixed `useQuery` usage in `Search.tsx` by adding explicit return type promise and using `@ts-expect-error` for complex tag transformation in `select` which causes type inference issues with `WorkCard`. - Removed unused variables in `Submit.tsx`, `AuthorProfile.tsx`, `Authors.tsx`, `BlogDetail.tsx`, `NewWorkReading.tsx`, `SimpleWorkReading.tsx`, `WorkReading.tsx`. - Fixed type mismatches (string vs number, undefined checks) in various files. - Fixed server-side import path in `server/routes/blog.ts` and `server/routes/userProfile.ts`. - Updated `server/routes/userProfile.ts` to use correct GraphQL generated members. - Updated `Profile.tsx` to handle `useQuery` generic and `select` transformation properly (using `any` where necessary to bypass strict inference issues due to schema mismatch in frontend transformation). - Successfully built the application. * Enforce type safety using zod v4 across the application - Updated `Search.tsx` to align `tags` type with schema (string[]). - Fixed `useQuery` usage in various files (`Search.tsx`, `Explore.tsx`, `Home.tsx`, `AuthorProfile.tsx`) by adding explicit return types or using `select` with type assertions to handle complex data transformations. - Removed unused variables and files, including several custom hooks that were referencing non-existent API clients. - Fixed type mismatches (string vs number, undefined checks) in various files. - Fixed server-side import path in `server/routes/blog.ts` and `server/routes/userProfile.ts`. - Updated `server/routes/userProfile.ts` to use correct GraphQL generated members. - Replaced usage of missing hooks with direct `useQuery` or `apiRequest` calls. - Fixed `RefObject` type in `comparison-slider.tsx`. - Removed `replaceAll` usage for better compatibility. - Cleaned up unused imports and declarations. --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
610 lines
801 KiB
JavaScript
610 lines
801 KiB
JavaScript
function vR(e,t){for(var r=0;r<t.length;r++){const o=t[r];if(typeof o!="string"&&!Array.isArray(o)){for(const l in o)if(l!=="default"&&!(l in e)){const u=Object.getOwnPropertyDescriptor(o,l);u&&Object.defineProperty(e,l,u.get?u:{enumerable:!0,get:()=>o[l]})}}}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 l of document.querySelectorAll('link[rel="modulepreload"]'))o(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const d of u.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&o(d)}).observe(document,{childList:!0,subtree:!0});function r(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(l){if(l.ep)return;l.ep=!0;const u=r(l);fetch(l.href,u)}})();function S1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dm={exports:{}},vl={};/**
|
||
* @license React
|
||
* react-jsx-runtime.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var wb;function yR(){if(wb)return vl;wb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(o,l,u){var d=null;if(u!==void 0&&(d=""+u),l.key!==void 0&&(d=""+l.key),"key"in l){u={};for(var f in l)f!=="key"&&(u[f]=l[f])}else u=l;return l=u.ref,{$$typeof:e,type:o,key:d,ref:l!==void 0?l:null,props:u}}return vl.Fragment=t,vl.jsx=r,vl.jsxs=r,vl}var jb;function bR(){return jb||(jb=1,Dm.exports=yR()),Dm.exports}var a=bR(),Om={exports:{}},yl={},zm={exports:{}},Pm={};/**
|
||
* @license React
|
||
* scheduler.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Nb;function wR(){return Nb||(Nb=1,(function(e){function t(O,L){var F=O.length;O.push(L);e:for(;0<F;){var Q=F-1>>>1,_=O[Q];if(0<l(_,L))O[Q]=L,O[F]=_,F=Q;else break e}}function r(O){return O.length===0?null:O[0]}function o(O){if(O.length===0)return null;var L=O[0],F=O.pop();if(F!==L){O[0]=F;e:for(var Q=0,_=O.length,B=_>>>1;Q<B;){var ge=2*(Q+1)-1,fe=O[ge],ye=ge+1,_e=O[ye];if(0>l(fe,F))ye<_&&0>l(_e,fe)?(O[Q]=_e,O[ye]=F,Q=ye):(O[Q]=fe,O[ge]=F,Q=ge);else if(ye<_&&0>l(_e,F))O[Q]=_e,O[ye]=F,Q=ye;else break e}}return L}function l(O,L){var F=O.sortIndex-L.sortIndex;return F!==0?F:O.id-L.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var d=Date,f=d.now();e.unstable_now=function(){return d.now()-f}}var m=[],p=[],v=1,y=null,b=3,S=!1,N=!1,w=!1,C=!1,k=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function T(O){for(var L=r(p);L!==null;){if(L.callback===null)o(p);else if(L.startTime<=O)o(p),L.sortIndex=L.expirationTime,t(m,L);else break;L=r(p)}}function z(O){if(w=!1,T(O),!N)if(r(m)!==null)N=!0,ne||(ne=!0,te());else{var L=r(p);L!==null&&me(z,L.startTime-O)}}var ne=!1,$=-1,V=5,J=-1;function se(){return C?!0:!(e.unstable_now()-J<V)}function ie(){if(C=!1,ne){var O=e.unstable_now();J=O;var L=!0;try{e:{N=!1,w&&(w=!1,E($),$=-1),S=!0;var F=b;try{t:{for(T(O),y=r(m);y!==null&&!(y.expirationTime>O&&se());){var Q=y.callback;if(typeof Q=="function"){y.callback=null,b=y.priorityLevel;var _=Q(y.expirationTime<=O);if(O=e.unstable_now(),typeof _=="function"){y.callback=_,T(O),L=!0;break t}y===r(m)&&o(m),T(O)}else o(m);y=r(m)}if(y!==null)L=!0;else{var B=r(p);B!==null&&me(z,B.startTime-O),L=!1}}break e}finally{y=null,b=F,S=!1}L=void 0}}finally{L?te():ne=!1}}}var te;if(typeof R=="function")te=function(){R(ie)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,de=q.port2;q.port1.onmessage=ie,te=function(){de.postMessage(null)}}else te=function(){k(ie,0)};function me(O,L){$=k(function(){O(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):V=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(O){switch(b){case 1:case 2:case 3:var L=3;break;default:L=b}var F=b;b=L;try{return O()}finally{b=F}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(O,L){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var F=b;b=O;try{return L()}finally{b=F}},e.unstable_scheduleCallback=function(O,L,F){var Q=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?Q+F:Q):F=Q,O){case 1:var _=-1;break;case 2:_=250;break;case 5:_=1073741823;break;case 4:_=1e4;break;default:_=5e3}return _=F+_,O={id:v++,callback:L,priorityLevel:O,startTime:F,expirationTime:_,sortIndex:-1},F>Q?(O.sortIndex=F,t(p,O),r(m)===null&&O===r(p)&&(w?(E($),$=-1):w=!0,me(z,F-Q))):(O.sortIndex=_,t(m,O),N||S||(N=!0,ne||(ne=!0,te()))),O},e.unstable_shouldYield=se,e.unstable_wrapCallback=function(O){var L=b;return function(){var F=b;b=L;try{return O.apply(this,arguments)}finally{b=F}}}})(Pm)),Pm}var Sb;function jR(){return Sb||(Sb=1,zm.exports=wR()),zm.exports}var Lm={exports:{}},Ze={};/**
|
||
* @license React
|
||
* react.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var kb;function NR(){if(kb)return Ze;kb=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.iterator;function b(_){return _===null||typeof _!="object"?null:(_=y&&_[y]||_["@@iterator"],typeof _=="function"?_:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,w={};function C(_,B,ge){this.props=_,this.context=B,this.refs=w,this.updater=ge||S}C.prototype.isReactComponent={},C.prototype.setState=function(_,B){if(typeof _!="object"&&typeof _!="function"&&_!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,_,B,"setState")},C.prototype.forceUpdate=function(_){this.updater.enqueueForceUpdate(this,_,"forceUpdate")};function k(){}k.prototype=C.prototype;function E(_,B,ge){this.props=_,this.context=B,this.refs=w,this.updater=ge||S}var R=E.prototype=new k;R.constructor=E,N(R,C.prototype),R.isPureReactComponent=!0;var T=Array.isArray,z={H:null,A:null,T:null,S:null,V:null},ne=Object.prototype.hasOwnProperty;function $(_,B,ge,fe,ye,_e){return ge=_e.ref,{$$typeof:e,type:_,key:B,ref:ge!==void 0?ge:null,props:_e}}function V(_,B){return $(_.type,B,void 0,void 0,void 0,_.props)}function J(_){return typeof _=="object"&&_!==null&&_.$$typeof===e}function se(_){var B={"=":"=0",":":"=2"};return"$"+_.replace(/[=:]/g,function(ge){return B[ge]})}var ie=/\/+/g;function te(_,B){return typeof _=="object"&&_!==null&&_.key!=null?se(""+_.key):B.toString(36)}function q(){}function de(_){switch(_.status){case"fulfilled":return _.value;case"rejected":throw _.reason;default:switch(typeof _.status=="string"?_.then(q,q):(_.status="pending",_.then(function(B){_.status==="pending"&&(_.status="fulfilled",_.value=B)},function(B){_.status==="pending"&&(_.status="rejected",_.reason=B)})),_.status){case"fulfilled":return _.value;case"rejected":throw _.reason}}throw _}function me(_,B,ge,fe,ye){var _e=typeof _;(_e==="undefined"||_e==="boolean")&&(_=null);var G=!1;if(_===null)G=!0;else switch(_e){case"bigint":case"string":case"number":G=!0;break;case"object":switch(_.$$typeof){case e:case t:G=!0;break;case v:return G=_._init,me(G(_._payload),B,ge,fe,ye)}}if(G)return ye=ye(_),G=fe===""?"."+te(_,0):fe,T(ye)?(ge="",G!=null&&(ge=G.replace(ie,"$&/")+"/"),me(ye,B,ge,"",function(Be){return Be})):ye!=null&&(J(ye)&&(ye=V(ye,ge+(ye.key==null||_&&_.key===ye.key?"":(""+ye.key).replace(ie,"$&/")+"/")+G)),B.push(ye)),1;G=0;var M=fe===""?".":fe+":";if(T(_))for(var he=0;he<_.length;he++)fe=_[he],_e=M+te(fe,he),G+=me(fe,B,ge,_e,ye);else if(he=b(_),typeof he=="function")for(_=he.call(_),he=0;!(fe=_.next()).done;)fe=fe.value,_e=M+te(fe,he++),G+=me(fe,B,ge,_e,ye);else if(_e==="object"){if(typeof _.then=="function")return me(de(_),B,ge,fe,ye);throw B=String(_),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(_).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return G}function O(_,B,ge){if(_==null)return _;var fe=[],ye=0;return me(_,fe,"","",function(_e){return B.call(ge,_e,ye++)}),fe}function L(_){if(_._status===-1){var B=_._result;B=B(),B.then(function(ge){(_._status===0||_._status===-1)&&(_._status=1,_._result=ge)},function(ge){(_._status===0||_._status===-1)&&(_._status=2,_._result=ge)}),_._status===-1&&(_._status=0,_._result=B)}if(_._status===1)return _._result.default;throw _._result}var F=typeof reportError=="function"?reportError:function(_){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof _=="object"&&_!==null&&typeof _.message=="string"?String(_.message):String(_),error:_});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",_);return}console.error(_)};function Q(){}return Ze.Children={map:O,forEach:function(_,B,ge){O(_,function(){B.apply(this,arguments)},ge)},count:function(_){var B=0;return O(_,function(){B++}),B},toArray:function(_){return O(_,function(B){return B})||[]},only:function(_){if(!J(_))throw Error("React.Children.only expected to receive a single React element child.");return _}},Ze.Component=C,Ze.Fragment=r,Ze.Profiler=l,Ze.PureComponent=E,Ze.StrictMode=o,Ze.Suspense=m,Ze.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,Ze.__COMPILER_RUNTIME={__proto__:null,c:function(_){return z.H.useMemoCache(_)}},Ze.cache=function(_){return function(){return _.apply(null,arguments)}},Ze.cloneElement=function(_,B,ge){if(_==null)throw Error("The argument must be a React element, but you passed "+_+".");var fe=N({},_.props),ye=_.key,_e=void 0;if(B!=null)for(G in B.ref!==void 0&&(_e=void 0),B.key!==void 0&&(ye=""+B.key),B)!ne.call(B,G)||G==="key"||G==="__self"||G==="__source"||G==="ref"&&B.ref===void 0||(fe[G]=B[G]);var G=arguments.length-2;if(G===1)fe.children=ge;else if(1<G){for(var M=Array(G),he=0;he<G;he++)M[he]=arguments[he+2];fe.children=M}return $(_.type,ye,void 0,void 0,_e,fe)},Ze.createContext=function(_){return _={$$typeof:d,_currentValue:_,_currentValue2:_,_threadCount:0,Provider:null,Consumer:null},_.Provider=_,_.Consumer={$$typeof:u,_context:_},_},Ze.createElement=function(_,B,ge){var fe,ye={},_e=null;if(B!=null)for(fe in B.key!==void 0&&(_e=""+B.key),B)ne.call(B,fe)&&fe!=="key"&&fe!=="__self"&&fe!=="__source"&&(ye[fe]=B[fe]);var G=arguments.length-2;if(G===1)ye.children=ge;else if(1<G){for(var M=Array(G),he=0;he<G;he++)M[he]=arguments[he+2];ye.children=M}if(_&&_.defaultProps)for(fe in G=_.defaultProps,G)ye[fe]===void 0&&(ye[fe]=G[fe]);return $(_,_e,void 0,void 0,null,ye)},Ze.createRef=function(){return{current:null}},Ze.forwardRef=function(_){return{$$typeof:f,render:_}},Ze.isValidElement=J,Ze.lazy=function(_){return{$$typeof:v,_payload:{_status:-1,_result:_},_init:L}},Ze.memo=function(_,B){return{$$typeof:p,type:_,compare:B===void 0?null:B}},Ze.startTransition=function(_){var B=z.T,ge={};z.T=ge;try{var fe=_(),ye=z.S;ye!==null&&ye(ge,fe),typeof fe=="object"&&fe!==null&&typeof fe.then=="function"&&fe.then(Q,F)}catch(_e){F(_e)}finally{z.T=B}},Ze.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},Ze.use=function(_){return z.H.use(_)},Ze.useActionState=function(_,B,ge){return z.H.useActionState(_,B,ge)},Ze.useCallback=function(_,B){return z.H.useCallback(_,B)},Ze.useContext=function(_){return z.H.useContext(_)},Ze.useDebugValue=function(){},Ze.useDeferredValue=function(_,B){return z.H.useDeferredValue(_,B)},Ze.useEffect=function(_,B,ge){var fe=z.H;if(typeof ge=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return fe.useEffect(_,B)},Ze.useId=function(){return z.H.useId()},Ze.useImperativeHandle=function(_,B,ge){return z.H.useImperativeHandle(_,B,ge)},Ze.useInsertionEffect=function(_,B){return z.H.useInsertionEffect(_,B)},Ze.useLayoutEffect=function(_,B){return z.H.useLayoutEffect(_,B)},Ze.useMemo=function(_,B){return z.H.useMemo(_,B)},Ze.useOptimistic=function(_,B){return z.H.useOptimistic(_,B)},Ze.useReducer=function(_,B,ge){return z.H.useReducer(_,B,ge)},Ze.useRef=function(_){return z.H.useRef(_)},Ze.useState=function(_){return z.H.useState(_)},Ze.useSyncExternalStore=function(_,B,ge){return z.H.useSyncExternalStore(_,B,ge)},Ze.useTransition=function(){return z.H.useTransition()},Ze.version="19.1.1",Ze}var Cb;function Sd(){return Cb||(Cb=1,Lm.exports=NR()),Lm.exports}var $m={exports:{}},wn={};/**
|
||
* @license React
|
||
* react-dom.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Eb;function SR(){if(Eb)return wn;Eb=1;var e=Sd();function t(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)p+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var o={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},l=Symbol.for("react.portal");function u(m,p,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:y==null?null:""+y,children:m,containerInfo:p,implementation:v}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return wn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,wn.createPortal=function(m,p){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return u(m,p,null,v)},wn.flushSync=function(m){var p=d.T,v=o.p;try{if(d.T=null,o.p=2,m)return m()}finally{d.T=p,o.p=v,o.d.f()}},wn.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,o.d.C(m,p))},wn.prefetchDNS=function(m){typeof m=="string"&&o.d.D(m)},wn.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var v=p.as,y=f(v,p.crossOrigin),b=typeof p.integrity=="string"?p.integrity:void 0,S=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;v==="style"?o.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:S}):v==="script"&&o.d.X(m,{crossOrigin:y,integrity:b,fetchPriority:S,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},wn.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var v=f(p.as,p.crossOrigin);o.d.M(m,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&o.d.M(m)},wn.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var v=p.as,y=f(v,p.crossOrigin);o.d.L(m,v,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},wn.preloadModule=function(m,p){if(typeof m=="string")if(p){var v=f(p.as,p.crossOrigin);o.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else o.d.m(m)},wn.requestFormReset=function(m){o.d.r(m)},wn.unstable_batchedUpdates=function(m,p){return m(p)},wn.useFormState=function(m,p,v){return d.H.useFormState(m,p,v)},wn.useFormStatus=function(){return d.H.useHostTransitionStatus()},wn.version="19.1.1",wn}var Ab;function k1(){if(Ab)return $m.exports;Ab=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),$m.exports=SR(),$m.exports}/**
|
||
* @license React
|
||
* react-dom-client.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Rb;function kR(){if(Rb)return yl;Rb=1;var e=jR(),t=Sd(),r=k1();function o(n){var s="https://react.dev/errors/"+n;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)s+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+n+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function u(n){var s=n,i=n;if(n.alternate)for(;s.return;)s=s.return;else{n=s;do s=n,(s.flags&4098)!==0&&(i=s.return),n=s.return;while(n)}return s.tag===3?i:null}function d(n){if(n.tag===13){var s=n.memoizedState;if(s===null&&(n=n.alternate,n!==null&&(s=n.memoizedState)),s!==null)return s.dehydrated}return null}function f(n){if(u(n)!==n)throw Error(o(188))}function m(n){var s=n.alternate;if(!s){if(s=u(n),s===null)throw Error(o(188));return s!==n?null:n}for(var i=n,c=s;;){var h=i.return;if(h===null)break;var g=h.alternate;if(g===null){if(c=h.return,c!==null){i=c;continue}break}if(h.child===g.child){for(g=h.child;g;){if(g===i)return f(h),n;if(g===c)return f(h),s;g=g.sibling}throw Error(o(188))}if(i.return!==c.return)i=h,c=g;else{for(var j=!1,A=h.child;A;){if(A===i){j=!0,i=h,c=g;break}if(A===c){j=!0,c=h,i=g;break}A=A.sibling}if(!j){for(A=g.child;A;){if(A===i){j=!0,i=g,c=h;break}if(A===c){j=!0,c=g,i=h;break}A=A.sibling}if(!j)throw Error(o(189))}}if(i.alternate!==c)throw Error(o(190))}if(i.tag!==3)throw Error(o(188));return i.stateNode.current===i?n:s}function p(n){var s=n.tag;if(s===5||s===26||s===27||s===6)return n;for(n=n.child;n!==null;){if(s=p(n),s!==null)return s;n=n.sibling}return null}var v=Object.assign,y=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),E=Symbol.for("react.consumer"),R=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function te(n){return n===null||typeof n!="object"?null:(n=ie&&n[ie]||n["@@iterator"],typeof n=="function"?n:null)}var q=Symbol.for("react.client.reference");function de(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===q?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case N:return"Fragment";case C:return"Profiler";case w:return"StrictMode";case z:return"Suspense";case ne:return"SuspenseList";case J:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case S:return"Portal";case R:return(n.displayName||"Context")+".Provider";case E:return(n._context.displayName||"Context")+".Consumer";case T:var s=n.render;return n=n.displayName,n||(n=s.displayName||s.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case $:return s=n.displayName||null,s!==null?s:de(n.type)||"Memo";case V:s=n._payload,n=n._init;try{return de(n(s))}catch{}}return null}var me=Array.isArray,O=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},Q=[],_=-1;function B(n){return{current:n}}function ge(n){0>_||(n.current=Q[_],Q[_]=null,_--)}function fe(n,s){_++,Q[_]=n.current,n.current=s}var ye=B(null),_e=B(null),G=B(null),M=B(null);function he(n,s){switch(fe(G,s),fe(_e,n),fe(ye,null),s.nodeType){case 9:case 11:n=(n=s.documentElement)&&(n=n.namespaceURI)?K0(n):0;break;default:if(n=s.tagName,s=s.namespaceURI)s=K0(s),n=Q0(s,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}ge(ye),fe(ye,n)}function Be(){ge(ye),ge(_e),ge(G)}function He(n){n.memoizedState!==null&&fe(M,n);var s=ye.current,i=Q0(s,n.type);s!==i&&(fe(_e,n),fe(ye,i))}function pe(n){_e.current===n&&(ge(ye),ge(_e)),M.current===n&&(ge(M),hl._currentValue=F)}var Re=Object.prototype.hasOwnProperty,Ye=e.unstable_scheduleCallback,Ae=e.unstable_cancelCallback,yt=e.unstable_shouldYield,Pt=e.unstable_requestPaint,Nt=e.unstable_now,Ss=e.unstable_getCurrentPriorityLevel,zr=e.unstable_ImmediatePriority,P=e.unstable_UserBlockingPriority,Z=e.unstable_NormalPriority,re=e.unstable_LowPriority,Ne=e.unstable_IdlePriority,xe=e.log,ve=e.unstable_setDisableYieldValue,Se=null,Me=null;function qe(n){if(typeof xe=="function"&&ve(n),Me&&typeof Me.setStrictMode=="function")try{Me.setStrictMode(Se,n)}catch{}}var at=Math.clz32?Math.clz32:br,ar=Math.log,zn=Math.LN2;function br(n){return n>>>=0,n===0?32:31-(ar(n)/zn|0)|0}var Sn=256,Pr=4194304;function wr(n){var s=n&42;if(s!==0)return s;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function na(n,s,i){var c=n.pendingLanes;if(c===0)return 0;var h=0,g=n.suspendedLanes,j=n.pingedLanes;n=n.warmLanes;var A=c&134217727;return A!==0?(c=A&~g,c!==0?h=wr(c):(j&=A,j!==0?h=wr(j):i||(i=A&~n,i!==0&&(h=wr(i))))):(A=c&~g,A!==0?h=wr(A):j!==0?h=wr(j):i||(i=c&~n,i!==0&&(h=wr(i)))),h===0?0:s!==0&&s!==h&&(s&g)===0&&(g=h&-h,i=s&-s,g>=i||g===32&&(i&4194048)!==0)?s:h}function ra(n,s){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&s)===0}function io(n,s){switch(n){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ie(){var n=Sn;return Sn<<=1,(Sn&4194048)===0&&(Sn=256),n}function st(){var n=Pr;return Pr<<=1,(Pr&62914560)===0&&(Pr=4194304),n}function lt(n){for(var s=[],i=0;31>i;i++)s.push(n);return s}function Xe(n,s){n.pendingLanes|=s,s!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function At(n,s,i,c,h,g){var j=n.pendingLanes;n.pendingLanes=i,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=i,n.entangledLanes&=i,n.errorRecoveryDisabledLanes&=i,n.shellSuspendCounter=0;var A=n.entanglements,D=n.expirationTimes,K=n.hiddenUpdates;for(i=j&~i;0<i;){var oe=31-at(i),ue=1<<oe;A[oe]=0,D[oe]=-1;var W=K[oe];if(W!==null)for(K[oe]=null,oe=0;oe<W.length;oe++){var ee=W[oe];ee!==null&&(ee.lane&=-536870913)}i&=~ue}c!==0&&fn(n,c,0),g!==0&&h===0&&n.tag!==0&&(n.suspendedLanes|=g&~(j&~s))}function fn(n,s,i){n.pendingLanes|=s,n.suspendedLanes&=~s;var c=31-at(s);n.entangledLanes|=s,n.entanglements[c]=n.entanglements[c]|1073741824|i&4194090}function rn(n,s){var i=n.entangledLanes|=s;for(n=n.entanglements;i;){var c=31-at(i),h=1<<c;h&s|n[c]&s&&(n[c]|=s),i&=~h}}function sr(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function kn(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function Lr(){var n=L.p;return n!==0?n:(n=window.event,n===void 0?32:pb(n.type))}function $r(n,s){var i=L.p;try{return L.p=n,s()}finally{L.p=i}}var Xt=Math.random().toString(36).slice(2),Lt="__reactFiber$"+Xt,hn="__reactProps$"+Xt,lo="__reactContainer$"+Xt,kf="__reactEvents$"+Xt,lA="__reactListeners$"+Xt,cA="__reactHandles$"+Xt,Lg="__reactResources$"+Xt,Si="__reactMarker$"+Xt;function Cf(n){delete n[Lt],delete n[hn],delete n[kf],delete n[lA],delete n[cA]}function co(n){var s=n[Lt];if(s)return s;for(var i=n.parentNode;i;){if(s=i[lo]||i[Lt]){if(i=s.alternate,s.child!==null||i!==null&&i.child!==null)for(n=eb(n);n!==null;){if(i=n[Lt])return i;n=eb(n)}return s}n=i,i=n.parentNode}return null}function uo(n){if(n=n[Lt]||n[lo]){var s=n.tag;if(s===5||s===6||s===13||s===26||s===27||s===3)return n}return null}function ki(n){var s=n.tag;if(s===5||s===26||s===27||s===6)return n.stateNode;throw Error(o(33))}function fo(n){var s=n[Lg];return s||(s=n[Lg]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function an(n){n[Si]=!0}var $g=new Set,Ig={};function ks(n,s){ho(n,s),ho(n+"Capture",s)}function ho(n,s){for(Ig[n]=s,n=0;n<s.length;n++)$g.add(s[n])}var uA=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ug={},Bg={};function dA(n){return Re.call(Bg,n)?!0:Re.call(Ug,n)?!1:uA.test(n)?Bg[n]=!0:(Ug[n]=!0,!1)}function hc(n,s,i){if(dA(s))if(i===null)n.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":n.removeAttribute(s);return;case"boolean":var c=s.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){n.removeAttribute(s);return}}n.setAttribute(s,""+i)}}function mc(n,s,i){if(i===null)n.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(s);return}n.setAttribute(s,""+i)}}function aa(n,s,i,c){if(c===null)n.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttributeNS(s,i,""+c)}}var Ef,Vg;function mo(n){if(Ef===void 0)try{throw Error()}catch(i){var s=i.stack.trim().match(/\n( *(at )?)/);Ef=s&&s[1]||"",Vg=-1<i.stack.indexOf(`
|
||
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||
`+Ef+n+Vg}var Af=!1;function Rf(n,s){if(!n||Af)return"";Af=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(s){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(ee){var W=ee}Reflect.construct(n,[],ue)}else{try{ue.call()}catch(ee){W=ee}n.call(ue.prototype)}}else{try{throw Error()}catch(ee){W=ee}(ue=n())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(ee){if(ee&&W&&typeof ee.stack=="string")return[ee.stack,W.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=c.DetermineComponentFrameRoot(),j=g[0],A=g[1];if(j&&A){var D=j.split(`
|
||
`),K=A.split(`
|
||
`);for(h=c=0;c<D.length&&!D[c].includes("DetermineComponentFrameRoot");)c++;for(;h<K.length&&!K[h].includes("DetermineComponentFrameRoot");)h++;if(c===D.length||h===K.length)for(c=D.length-1,h=K.length-1;1<=c&&0<=h&&D[c]!==K[h];)h--;for(;1<=c&&0<=h;c--,h--)if(D[c]!==K[h]){if(c!==1||h!==1)do if(c--,h--,0>h||D[c]!==K[h]){var oe=`
|
||
`+D[c].replace(" at new "," at ");return n.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",n.displayName)),oe}while(1<=c&&0<=h);break}}}finally{Af=!1,Error.prepareStackTrace=i}return(i=n?n.displayName||n.name:"")?mo(i):""}function fA(n){switch(n.tag){case 26:case 27:case 5:return mo(n.type);case 16:return mo("Lazy");case 13:return mo("Suspense");case 19:return mo("SuspenseList");case 0:case 15:return Rf(n.type,!1);case 11:return Rf(n.type.render,!1);case 1:return Rf(n.type,!0);case 31:return mo("Activity");default:return""}}function Hg(n){try{var s="";do s+=fA(n),n=n.return;while(n);return s}catch(i){return`
|
||
Error generating stack: `+i.message+`
|
||
`+i.stack}}function or(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function Fg(n){var s=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function hA(n){var s=Fg(n)?"checked":"value",i=Object.getOwnPropertyDescriptor(n.constructor.prototype,s),c=""+n[s];if(!n.hasOwnProperty(s)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var h=i.get,g=i.set;return Object.defineProperty(n,s,{configurable:!0,get:function(){return h.call(this)},set:function(j){c=""+j,g.call(this,j)}}),Object.defineProperty(n,s,{enumerable:i.enumerable}),{getValue:function(){return c},setValue:function(j){c=""+j},stopTracking:function(){n._valueTracker=null,delete n[s]}}}}function pc(n){n._valueTracker||(n._valueTracker=hA(n))}function qg(n){if(!n)return!1;var s=n._valueTracker;if(!s)return!0;var i=s.getValue(),c="";return n&&(c=Fg(n)?n.checked?"true":"false":n.value),n=c,n!==i?(s.setValue(n),!0):!1}function xc(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var mA=/[\n"\\]/g;function ir(n){return n.replace(mA,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Tf(n,s,i,c,h,g,j,A){n.name="",j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?n.type=j:n.removeAttribute("type"),s!=null?j==="number"?(s===0&&n.value===""||n.value!=s)&&(n.value=""+or(s)):n.value!==""+or(s)&&(n.value=""+or(s)):j!=="submit"&&j!=="reset"||n.removeAttribute("value"),s!=null?_f(n,j,or(s)):i!=null?_f(n,j,or(i)):c!=null&&n.removeAttribute("value"),h==null&&g!=null&&(n.defaultChecked=!!g),h!=null&&(n.checked=h&&typeof h!="function"&&typeof h!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?n.name=""+or(A):n.removeAttribute("name")}function Yg(n,s,i,c,h,g,j,A){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(n.type=g),s!=null||i!=null){if(!(g!=="submit"&&g!=="reset"||s!=null))return;i=i!=null?""+or(i):"",s=s!=null?""+or(s):i,A||s===n.value||(n.value=s),n.defaultValue=s}c=c??h,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=A?n.checked:!!c,n.defaultChecked=!!c,j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(n.name=j)}function _f(n,s,i){s==="number"&&xc(n.ownerDocument)===n||n.defaultValue===""+i||(n.defaultValue=""+i)}function po(n,s,i,c){if(n=n.options,s){s={};for(var h=0;h<i.length;h++)s["$"+i[h]]=!0;for(i=0;i<n.length;i++)h=s.hasOwnProperty("$"+n[i].value),n[i].selected!==h&&(n[i].selected=h),h&&c&&(n[i].defaultSelected=!0)}else{for(i=""+or(i),s=null,h=0;h<n.length;h++){if(n[h].value===i){n[h].selected=!0,c&&(n[h].defaultSelected=!0);return}s!==null||n[h].disabled||(s=n[h])}s!==null&&(s.selected=!0)}}function Zg(n,s,i){if(s!=null&&(s=""+or(s),s!==n.value&&(n.value=s),i==null)){n.defaultValue!==s&&(n.defaultValue=s);return}n.defaultValue=i!=null?""+or(i):""}function Gg(n,s,i,c){if(s==null){if(c!=null){if(i!=null)throw Error(o(92));if(me(c)){if(1<c.length)throw Error(o(93));c=c[0]}i=c}i==null&&(i=""),s=i}i=or(s),n.defaultValue=i,c=n.textContent,c===i&&c!==""&&c!==null&&(n.value=c)}function xo(n,s){if(s){var i=n.firstChild;if(i&&i===n.lastChild&&i.nodeType===3){i.nodeValue=s;return}}n.textContent=s}var pA=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Kg(n,s,i){var c=s.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?c?n.setProperty(s,""):s==="float"?n.cssFloat="":n[s]="":c?n.setProperty(s,i):typeof i!="number"||i===0||pA.has(s)?s==="float"?n.cssFloat=i:n[s]=(""+i).trim():n[s]=i+"px"}function Qg(n,s,i){if(s!=null&&typeof s!="object")throw Error(o(62));if(n=n.style,i!=null){for(var c in i)!i.hasOwnProperty(c)||s!=null&&s.hasOwnProperty(c)||(c.indexOf("--")===0?n.setProperty(c,""):c==="float"?n.cssFloat="":n[c]="");for(var h in s)c=s[h],s.hasOwnProperty(h)&&i[h]!==c&&Kg(n,h,c)}else for(var g in s)s.hasOwnProperty(g)&&Kg(n,g,s[g])}function Mf(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xA=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),gA=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function gc(n){return gA.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}var Df=null;function Of(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var go=null,vo=null;function Xg(n){var s=uo(n);if(s&&(n=s.stateNode)){var i=n[hn]||null;e:switch(n=s.stateNode,s.type){case"input":if(Tf(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),s=i.name,i.type==="radio"&&s!=null){for(i=n;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+ir(""+s)+'"][type="radio"]'),s=0;s<i.length;s++){var c=i[s];if(c!==n&&c.form===n.form){var h=c[hn]||null;if(!h)throw Error(o(90));Tf(c,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(s=0;s<i.length;s++)c=i[s],c.form===n.form&&qg(c)}break e;case"textarea":Zg(n,i.value,i.defaultValue);break e;case"select":s=i.value,s!=null&&po(n,!!i.multiple,s,!1)}}}var zf=!1;function Wg(n,s,i){if(zf)return n(s,i);zf=!0;try{var c=n(s);return c}finally{if(zf=!1,(go!==null||vo!==null)&&(nu(),go&&(s=go,n=vo,vo=go=null,Xg(s),n)))for(s=0;s<n.length;s++)Xg(n[s])}}function Ci(n,s){var i=n.stateNode;if(i===null)return null;var c=i[hn]||null;if(c===null)return null;i=c[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(n=n.type,c=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!c;break e;default:n=!1}if(n)return null;if(i&&typeof i!="function")throw Error(o(231,s,typeof i));return i}var sa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pf=!1;if(sa)try{var Ei={};Object.defineProperty(Ei,"passive",{get:function(){Pf=!0}}),window.addEventListener("test",Ei,Ei),window.removeEventListener("test",Ei,Ei)}catch{Pf=!1}var Oa=null,Lf=null,vc=null;function Jg(){if(vc)return vc;var n,s=Lf,i=s.length,c,h="value"in Oa?Oa.value:Oa.textContent,g=h.length;for(n=0;n<i&&s[n]===h[n];n++);var j=i-n;for(c=1;c<=j&&s[i-c]===h[g-c];c++);return vc=h.slice(n,1<c?1-c:void 0)}function yc(n){var s=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&s===13&&(n=13)):n=s,n===10&&(n=13),32<=n||n===13?n:0}function bc(){return!0}function ev(){return!1}function Pn(n){function s(i,c,h,g,j){this._reactName=i,this._targetInst=h,this.type=c,this.nativeEvent=g,this.target=j,this.currentTarget=null;for(var A in n)n.hasOwnProperty(A)&&(i=n[A],this[A]=i?i(g):g[A]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?bc:ev,this.isPropagationStopped=ev,this}return v(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=bc)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=bc)},persist:function(){},isPersistent:bc}),s}var Cs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},wc=Pn(Cs),Ai=v({},Cs,{view:0,detail:0}),vA=Pn(Ai),$f,If,Ri,jc=v({},Ai,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bf,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==Ri&&(Ri&&n.type==="mousemove"?($f=n.screenX-Ri.screenX,If=n.screenY-Ri.screenY):If=$f=0,Ri=n),$f)},movementY:function(n){return"movementY"in n?n.movementY:If}}),tv=Pn(jc),yA=v({},jc,{dataTransfer:0}),bA=Pn(yA),wA=v({},Ai,{relatedTarget:0}),Uf=Pn(wA),jA=v({},Cs,{animationName:0,elapsedTime:0,pseudoElement:0}),NA=Pn(jA),SA=v({},Cs,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),kA=Pn(SA),CA=v({},Cs,{data:0}),nv=Pn(CA),EA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},AA={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"},RA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function TA(n){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(n):(n=RA[n])?!!s[n]:!1}function Bf(){return TA}var _A=v({},Ai,{key:function(n){if(n.key){var s=EA[n.key]||n.key;if(s!=="Unidentified")return s}return n.type==="keypress"?(n=yc(n),n===13?"Enter":String.fromCharCode(n)):n.type==="keydown"||n.type==="keyup"?AA[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bf,charCode:function(n){return n.type==="keypress"?yc(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?yc(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),MA=Pn(_A),DA=v({},jc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rv=Pn(DA),OA=v({},Ai,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bf}),zA=Pn(OA),PA=v({},Cs,{propertyName:0,elapsedTime:0,pseudoElement:0}),LA=Pn(PA),$A=v({},jc,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),IA=Pn($A),UA=v({},Cs,{newState:0,oldState:0}),BA=Pn(UA),VA=[9,13,27,32],Vf=sa&&"CompositionEvent"in window,Ti=null;sa&&"documentMode"in document&&(Ti=document.documentMode);var HA=sa&&"TextEvent"in window&&!Ti,av=sa&&(!Vf||Ti&&8<Ti&&11>=Ti),sv=" ",ov=!1;function iv(n,s){switch(n){case"keyup":return VA.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lv(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var yo=!1;function FA(n,s){switch(n){case"compositionend":return lv(s);case"keypress":return s.which!==32?null:(ov=!0,sv);case"textInput":return n=s.data,n===sv&&ov?null:n;default:return null}}function qA(n,s){if(yo)return n==="compositionend"||!Vf&&iv(n,s)?(n=Jg(),vc=Lf=Oa=null,yo=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return av&&s.locale!=="ko"?null:s.data;default:return null}}var YA={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 cv(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s==="input"?!!YA[n.type]:s==="textarea"}function uv(n,s,i,c){go?vo?vo.push(c):vo=[c]:go=c,s=lu(s,"onChange"),0<s.length&&(i=new wc("onChange","change",null,i,c),n.push({event:i,listeners:s}))}var _i=null,Mi=null;function ZA(n){F0(n,0)}function Nc(n){var s=ki(n);if(qg(s))return n}function dv(n,s){if(n==="change")return s}var fv=!1;if(sa){var Hf;if(sa){var Ff="oninput"in document;if(!Ff){var hv=document.createElement("div");hv.setAttribute("oninput","return;"),Ff=typeof hv.oninput=="function"}Hf=Ff}else Hf=!1;fv=Hf&&(!document.documentMode||9<document.documentMode)}function mv(){_i&&(_i.detachEvent("onpropertychange",pv),Mi=_i=null)}function pv(n){if(n.propertyName==="value"&&Nc(Mi)){var s=[];uv(s,Mi,n,Of(n)),Wg(ZA,s)}}function GA(n,s,i){n==="focusin"?(mv(),_i=s,Mi=i,_i.attachEvent("onpropertychange",pv)):n==="focusout"&&mv()}function KA(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Nc(Mi)}function QA(n,s){if(n==="click")return Nc(s)}function XA(n,s){if(n==="input"||n==="change")return Nc(s)}function WA(n,s){return n===s&&(n!==0||1/n===1/s)||n!==n&&s!==s}var qn=typeof Object.is=="function"?Object.is:WA;function Di(n,s){if(qn(n,s))return!0;if(typeof n!="object"||n===null||typeof s!="object"||s===null)return!1;var i=Object.keys(n),c=Object.keys(s);if(i.length!==c.length)return!1;for(c=0;c<i.length;c++){var h=i[c];if(!Re.call(s,h)||!qn(n[h],s[h]))return!1}return!0}function xv(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function gv(n,s){var i=xv(n);n=0;for(var c;i;){if(i.nodeType===3){if(c=n+i.textContent.length,n<=s&&c>=s)return{node:i,offset:s-n};n=c}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=xv(i)}}function vv(n,s){return n&&s?n===s?!0:n&&n.nodeType===3?!1:s&&s.nodeType===3?vv(n,s.parentNode):"contains"in n?n.contains(s):n.compareDocumentPosition?!!(n.compareDocumentPosition(s)&16):!1:!1}function yv(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var s=xc(n.document);s instanceof n.HTMLIFrameElement;){try{var i=typeof s.contentWindow.location.href=="string"}catch{i=!1}if(i)n=s.contentWindow;else break;s=xc(n.document)}return s}function qf(n){var s=n&&n.nodeName&&n.nodeName.toLowerCase();return s&&(s==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||s==="textarea"||n.contentEditable==="true")}var JA=sa&&"documentMode"in document&&11>=document.documentMode,bo=null,Yf=null,Oi=null,Zf=!1;function bv(n,s,i){var c=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Zf||bo==null||bo!==xc(c)||(c=bo,"selectionStart"in c&&qf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Oi&&Di(Oi,c)||(Oi=c,c=lu(Yf,"onSelect"),0<c.length&&(s=new wc("onSelect","select",null,s,i),n.push({event:s,listeners:c}),s.target=bo)))}function Es(n,s){var i={};return i[n.toLowerCase()]=s.toLowerCase(),i["Webkit"+n]="webkit"+s,i["Moz"+n]="moz"+s,i}var wo={animationend:Es("Animation","AnimationEnd"),animationiteration:Es("Animation","AnimationIteration"),animationstart:Es("Animation","AnimationStart"),transitionrun:Es("Transition","TransitionRun"),transitionstart:Es("Transition","TransitionStart"),transitioncancel:Es("Transition","TransitionCancel"),transitionend:Es("Transition","TransitionEnd")},Gf={},wv={};sa&&(wv=document.createElement("div").style,"AnimationEvent"in window||(delete wo.animationend.animation,delete wo.animationiteration.animation,delete wo.animationstart.animation),"TransitionEvent"in window||delete wo.transitionend.transition);function As(n){if(Gf[n])return Gf[n];if(!wo[n])return n;var s=wo[n],i;for(i in s)if(s.hasOwnProperty(i)&&i in wv)return Gf[n]=s[i];return n}var jv=As("animationend"),Nv=As("animationiteration"),Sv=As("animationstart"),e4=As("transitionrun"),t4=As("transitionstart"),n4=As("transitioncancel"),kv=As("transitionend"),Cv=new Map,Kf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Kf.push("scrollEnd");function jr(n,s){Cv.set(n,s),ks(s,[n])}var Ev=new WeakMap;function lr(n,s){if(typeof n=="object"&&n!==null){var i=Ev.get(n);return i!==void 0?i:(s={value:n,source:s,stack:Hg(s)},Ev.set(n,s),s)}return{value:n,source:s,stack:Hg(s)}}var cr=[],jo=0,Qf=0;function Sc(){for(var n=jo,s=Qf=jo=0;s<n;){var i=cr[s];cr[s++]=null;var c=cr[s];cr[s++]=null;var h=cr[s];cr[s++]=null;var g=cr[s];if(cr[s++]=null,c!==null&&h!==null){var j=c.pending;j===null?h.next=h:(h.next=j.next,j.next=h),c.pending=h}g!==0&&Av(i,h,g)}}function kc(n,s,i,c){cr[jo++]=n,cr[jo++]=s,cr[jo++]=i,cr[jo++]=c,Qf|=c,n.lanes|=c,n=n.alternate,n!==null&&(n.lanes|=c)}function Xf(n,s,i,c){return kc(n,s,i,c),Cc(n)}function No(n,s){return kc(n,null,null,s),Cc(n)}function Av(n,s,i){n.lanes|=i;var c=n.alternate;c!==null&&(c.lanes|=i);for(var h=!1,g=n.return;g!==null;)g.childLanes|=i,c=g.alternate,c!==null&&(c.childLanes|=i),g.tag===22&&(n=g.stateNode,n===null||n._visibility&1||(h=!0)),n=g,g=g.return;return n.tag===3?(g=n.stateNode,h&&s!==null&&(h=31-at(i),n=g.hiddenUpdates,c=n[h],c===null?n[h]=[s]:c.push(s),s.lane=i|536870912),g):null}function Cc(n){if(50<sl)throw sl=0,rm=null,Error(o(185));for(var s=n.return;s!==null;)n=s,s=n.return;return n.tag===3?n.stateNode:null}var So={};function r4(n,s,i,c){this.tag=n,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yn(n,s,i,c){return new r4(n,s,i,c)}function Wf(n){return n=n.prototype,!(!n||!n.isReactComponent)}function oa(n,s){var i=n.alternate;return i===null?(i=Yn(n.tag,s,n.key,n.mode),i.elementType=n.elementType,i.type=n.type,i.stateNode=n.stateNode,i.alternate=n,n.alternate=i):(i.pendingProps=s,i.type=n.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=n.flags&65011712,i.childLanes=n.childLanes,i.lanes=n.lanes,i.child=n.child,i.memoizedProps=n.memoizedProps,i.memoizedState=n.memoizedState,i.updateQueue=n.updateQueue,s=n.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},i.sibling=n.sibling,i.index=n.index,i.ref=n.ref,i.refCleanup=n.refCleanup,i}function Rv(n,s){n.flags&=65011714;var i=n.alternate;return i===null?(n.childLanes=0,n.lanes=s,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=i.childLanes,n.lanes=i.lanes,n.child=i.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=i.memoizedProps,n.memoizedState=i.memoizedState,n.updateQueue=i.updateQueue,n.type=i.type,s=i.dependencies,n.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),n}function Ec(n,s,i,c,h,g){var j=0;if(c=n,typeof n=="function")Wf(n)&&(j=1);else if(typeof n=="string")j=sR(n,i,ye.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case J:return n=Yn(31,i,s,h),n.elementType=J,n.lanes=g,n;case N:return Rs(i.children,h,g,s);case w:j=8,h|=24;break;case C:return n=Yn(12,i,s,h|2),n.elementType=C,n.lanes=g,n;case z:return n=Yn(13,i,s,h),n.elementType=z,n.lanes=g,n;case ne:return n=Yn(19,i,s,h),n.elementType=ne,n.lanes=g,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case k:case R:j=10;break e;case E:j=9;break e;case T:j=11;break e;case $:j=14;break e;case V:j=16,c=null;break e}j=29,i=Error(o(130,n===null?"null":typeof n,"")),c=null}return s=Yn(j,i,s,h),s.elementType=n,s.type=c,s.lanes=g,s}function Rs(n,s,i,c){return n=Yn(7,n,c,s),n.lanes=i,n}function Jf(n,s,i){return n=Yn(6,n,null,s),n.lanes=i,n}function eh(n,s,i){return s=Yn(4,n.children!==null?n.children:[],n.key,s),s.lanes=i,s.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},s}var ko=[],Co=0,Ac=null,Rc=0,ur=[],dr=0,Ts=null,ia=1,la="";function _s(n,s){ko[Co++]=Rc,ko[Co++]=Ac,Ac=n,Rc=s}function Tv(n,s,i){ur[dr++]=ia,ur[dr++]=la,ur[dr++]=Ts,Ts=n;var c=ia;n=la;var h=32-at(c)-1;c&=~(1<<h),i+=1;var g=32-at(s)+h;if(30<g){var j=h-h%5;g=(c&(1<<j)-1).toString(32),c>>=j,h-=j,ia=1<<32-at(s)+h|i<<h|c,la=g+n}else ia=1<<g|i<<h|c,la=n}function th(n){n.return!==null&&(_s(n,1),Tv(n,1,0))}function nh(n){for(;n===Ac;)Ac=ko[--Co],ko[Co]=null,Rc=ko[--Co],ko[Co]=null;for(;n===Ts;)Ts=ur[--dr],ur[dr]=null,la=ur[--dr],ur[dr]=null,ia=ur[--dr],ur[dr]=null}var Cn=null,Dt=null,it=!1,Ms=null,Ir=!1,rh=Error(o(519));function Ds(n){var s=Error(o(418,""));throw Li(lr(s,n)),rh}function _v(n){var s=n.stateNode,i=n.type,c=n.memoizedProps;switch(s[Lt]=n,s[hn]=c,i){case"dialog":et("cancel",s),et("close",s);break;case"iframe":case"object":case"embed":et("load",s);break;case"video":case"audio":for(i=0;i<il.length;i++)et(il[i],s);break;case"source":et("error",s);break;case"img":case"image":case"link":et("error",s),et("load",s);break;case"details":et("toggle",s);break;case"input":et("invalid",s),Yg(s,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0),pc(s);break;case"select":et("invalid",s);break;case"textarea":et("invalid",s),Gg(s,c.value,c.defaultValue,c.children),pc(s)}i=c.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||s.textContent===""+i||c.suppressHydrationWarning===!0||G0(s.textContent,i)?(c.popover!=null&&(et("beforetoggle",s),et("toggle",s)),c.onScroll!=null&&et("scroll",s),c.onScrollEnd!=null&&et("scrollend",s),c.onClick!=null&&(s.onclick=cu),s=!0):s=!1,s||Ds(n)}function Mv(n){for(Cn=n.return;Cn;)switch(Cn.tag){case 5:case 13:Ir=!1;return;case 27:case 3:Ir=!0;return;default:Cn=Cn.return}}function zi(n){if(n!==Cn)return!1;if(!it)return Mv(n),it=!0,!1;var s=n.tag,i;if((i=s!==3&&s!==27)&&((i=s===5)&&(i=n.type,i=!(i!=="form"&&i!=="button")||ym(n.type,n.memoizedProps)),i=!i),i&&Dt&&Ds(n),Mv(n),s===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(o(317));e:{for(n=n.nextSibling,s=0;n;){if(n.nodeType===8)if(i=n.data,i==="/$"){if(s===0){Dt=Sr(n.nextSibling);break e}s--}else i!=="$"&&i!=="$!"&&i!=="$?"||s++;n=n.nextSibling}Dt=null}}else s===27?(s=Dt,Qa(n.type)?(n=Nm,Nm=null,Dt=n):Dt=s):Dt=Cn?Sr(n.stateNode.nextSibling):null;return!0}function Pi(){Dt=Cn=null,it=!1}function Dv(){var n=Ms;return n!==null&&(In===null?In=n:In.push.apply(In,n),Ms=null),n}function Li(n){Ms===null?Ms=[n]:Ms.push(n)}var ah=B(null),Os=null,ca=null;function za(n,s,i){fe(ah,s._currentValue),s._currentValue=i}function ua(n){n._currentValue=ah.current,ge(ah)}function sh(n,s,i){for(;n!==null;){var c=n.alternate;if((n.childLanes&s)!==s?(n.childLanes|=s,c!==null&&(c.childLanes|=s)):c!==null&&(c.childLanes&s)!==s&&(c.childLanes|=s),n===i)break;n=n.return}}function oh(n,s,i,c){var h=n.child;for(h!==null&&(h.return=n);h!==null;){var g=h.dependencies;if(g!==null){var j=h.child;g=g.firstContext;e:for(;g!==null;){var A=g;g=h;for(var D=0;D<s.length;D++)if(A.context===s[D]){g.lanes|=i,A=g.alternate,A!==null&&(A.lanes|=i),sh(g.return,i,n),c||(j=null);break e}g=A.next}}else if(h.tag===18){if(j=h.return,j===null)throw Error(o(341));j.lanes|=i,g=j.alternate,g!==null&&(g.lanes|=i),sh(j,i,n),j=null}else j=h.child;if(j!==null)j.return=h;else for(j=h;j!==null;){if(j===n){j=null;break}if(h=j.sibling,h!==null){h.return=j.return,j=h;break}j=j.return}h=j}}function $i(n,s,i,c){n=null;for(var h=s,g=!1;h!==null;){if(!g){if((h.flags&524288)!==0)g=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var j=h.alternate;if(j===null)throw Error(o(387));if(j=j.memoizedProps,j!==null){var A=h.type;qn(h.pendingProps.value,j.value)||(n!==null?n.push(A):n=[A])}}else if(h===M.current){if(j=h.alternate,j===null)throw Error(o(387));j.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(n!==null?n.push(hl):n=[hl])}h=h.return}n!==null&&oh(s,n,i,c),s.flags|=262144}function Tc(n){for(n=n.firstContext;n!==null;){if(!qn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function zs(n){Os=n,ca=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function bn(n){return Ov(Os,n)}function _c(n,s){return Os===null&&zs(n),Ov(n,s)}function Ov(n,s){var i=s._currentValue;if(s={context:s,memoizedValue:i,next:null},ca===null){if(n===null)throw Error(o(308));ca=s,n.dependencies={lanes:0,firstContext:s},n.flags|=524288}else ca=ca.next=s;return i}var a4=typeof AbortController<"u"?AbortController:function(){var n=[],s=this.signal={aborted:!1,addEventListener:function(i,c){n.push(c)}};this.abort=function(){s.aborted=!0,n.forEach(function(i){return i()})}},s4=e.unstable_scheduleCallback,o4=e.unstable_NormalPriority,Wt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ih(){return{controller:new a4,data:new Map,refCount:0}}function Ii(n){n.refCount--,n.refCount===0&&s4(o4,function(){n.controller.abort()})}var Ui=null,lh=0,Eo=0,Ao=null;function i4(n,s){if(Ui===null){var i=Ui=[];lh=0,Eo=um(),Ao={status:"pending",value:void 0,then:function(c){i.push(c)}}}return lh++,s.then(zv,zv),s}function zv(){if(--lh===0&&Ui!==null){Ao!==null&&(Ao.status="fulfilled");var n=Ui;Ui=null,Eo=0,Ao=null;for(var s=0;s<n.length;s++)(0,n[s])()}}function l4(n,s){var i=[],c={status:"pending",value:null,reason:null,then:function(h){i.push(h)}};return n.then(function(){c.status="fulfilled",c.value=s;for(var h=0;h<i.length;h++)(0,i[h])(s)},function(h){for(c.status="rejected",c.reason=h,h=0;h<i.length;h++)(0,i[h])(void 0)}),c}var Pv=O.S;O.S=function(n,s){typeof s=="object"&&s!==null&&typeof s.then=="function"&&i4(n,s),Pv!==null&&Pv(n,s)};var Ps=B(null);function ch(){var n=Ps.current;return n!==null?n:jt.pooledCache}function Mc(n,s){s===null?fe(Ps,Ps.current):fe(Ps,s.pool)}function Lv(){var n=ch();return n===null?null:{parent:Wt._currentValue,pool:n}}var Bi=Error(o(460)),$v=Error(o(474)),Dc=Error(o(542)),uh={then:function(){}};function Iv(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Oc(){}function Uv(n,s,i){switch(i=n[i],i===void 0?n.push(s):i!==s&&(s.then(Oc,Oc),s=i),s.status){case"fulfilled":return s.value;case"rejected":throw n=s.reason,Vv(n),n;default:if(typeof s.status=="string")s.then(Oc,Oc);else{if(n=jt,n!==null&&100<n.shellSuspendCounter)throw Error(o(482));n=s,n.status="pending",n.then(function(c){if(s.status==="pending"){var h=s;h.status="fulfilled",h.value=c}},function(c){if(s.status==="pending"){var h=s;h.status="rejected",h.reason=c}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw n=s.reason,Vv(n),n}throw Vi=s,Bi}}var Vi=null;function Bv(){if(Vi===null)throw Error(o(459));var n=Vi;return Vi=null,n}function Vv(n){if(n===Bi||n===Dc)throw Error(o(483))}var Pa=!1;function dh(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fh(n,s){n=n.updateQueue,s.updateQueue===n&&(s.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function La(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function $a(n,s,i){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(ct&2)!==0){var h=c.pending;return h===null?s.next=s:(s.next=h.next,h.next=s),c.pending=s,s=Cc(n),Av(n,null,i),s}return kc(n,c,s,i),Cc(n)}function Hi(n,s,i){if(s=s.updateQueue,s!==null&&(s=s.shared,(i&4194048)!==0)){var c=s.lanes;c&=n.pendingLanes,i|=c,s.lanes=i,rn(n,i)}}function hh(n,s){var i=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,i===c)){var h=null,g=null;if(i=i.firstBaseUpdate,i!==null){do{var j={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};g===null?h=g=j:g=g.next=j,i=i.next}while(i!==null);g===null?h=g=s:g=g.next=s}else h=g=s;i={baseState:c.baseState,firstBaseUpdate:h,lastBaseUpdate:g,shared:c.shared,callbacks:c.callbacks},n.updateQueue=i;return}n=i.lastBaseUpdate,n===null?i.firstBaseUpdate=s:n.next=s,i.lastBaseUpdate=s}var mh=!1;function Fi(){if(mh){var n=Ao;if(n!==null)throw n}}function qi(n,s,i,c){mh=!1;var h=n.updateQueue;Pa=!1;var g=h.firstBaseUpdate,j=h.lastBaseUpdate,A=h.shared.pending;if(A!==null){h.shared.pending=null;var D=A,K=D.next;D.next=null,j===null?g=K:j.next=K,j=D;var oe=n.alternate;oe!==null&&(oe=oe.updateQueue,A=oe.lastBaseUpdate,A!==j&&(A===null?oe.firstBaseUpdate=K:A.next=K,oe.lastBaseUpdate=D))}if(g!==null){var ue=h.baseState;j=0,oe=K=D=null,A=g;do{var W=A.lane&-536870913,ee=W!==A.lane;if(ee?(nt&W)===W:(c&W)===W){W!==0&&W===Eo&&(mh=!0),oe!==null&&(oe=oe.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var Fe=n,$e=A;W=s;var xt=i;switch($e.tag){case 1:if(Fe=$e.payload,typeof Fe=="function"){ue=Fe.call(xt,ue,W);break e}ue=Fe;break e;case 3:Fe.flags=Fe.flags&-65537|128;case 0:if(Fe=$e.payload,W=typeof Fe=="function"?Fe.call(xt,ue,W):Fe,W==null)break e;ue=v({},ue,W);break e;case 2:Pa=!0}}W=A.callback,W!==null&&(n.flags|=64,ee&&(n.flags|=8192),ee=h.callbacks,ee===null?h.callbacks=[W]:ee.push(W))}else ee={lane:W,tag:A.tag,payload:A.payload,callback:A.callback,next:null},oe===null?(K=oe=ee,D=ue):oe=oe.next=ee,j|=W;if(A=A.next,A===null){if(A=h.shared.pending,A===null)break;ee=A,A=ee.next,ee.next=null,h.lastBaseUpdate=ee,h.shared.pending=null}}while(!0);oe===null&&(D=ue),h.baseState=D,h.firstBaseUpdate=K,h.lastBaseUpdate=oe,g===null&&(h.shared.lanes=0),Ya|=j,n.lanes=j,n.memoizedState=ue}}function Hv(n,s){if(typeof n!="function")throw Error(o(191,n));n.call(s)}function Fv(n,s){var i=n.callbacks;if(i!==null)for(n.callbacks=null,n=0;n<i.length;n++)Hv(i[n],s)}var Ro=B(null),zc=B(0);function qv(n,s){n=ga,fe(zc,n),fe(Ro,s),ga=n|s.baseLanes}function ph(){fe(zc,ga),fe(Ro,Ro.current)}function xh(){ga=zc.current,ge(Ro),ge(zc)}var Ia=0,Ke=null,mt=null,Ft=null,Pc=!1,To=!1,Ls=!1,Lc=0,Yi=0,_o=null,c4=0;function $t(){throw Error(o(321))}function gh(n,s){if(s===null)return!1;for(var i=0;i<s.length&&i<n.length;i++)if(!qn(n[i],s[i]))return!1;return!0}function vh(n,s,i,c,h,g){return Ia=g,Ke=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,O.H=n===null||n.memoizedState===null?Ay:Ry,Ls=!1,g=i(c,h),Ls=!1,To&&(g=Zv(s,i,c,h)),Yv(n),g}function Yv(n){O.H=Hc;var s=mt!==null&&mt.next!==null;if(Ia=0,Ft=mt=Ke=null,Pc=!1,Yi=0,_o=null,s)throw Error(o(300));n===null||sn||(n=n.dependencies,n!==null&&Tc(n)&&(sn=!0))}function Zv(n,s,i,c){Ke=n;var h=0;do{if(To&&(_o=null),Yi=0,To=!1,25<=h)throw Error(o(301));if(h+=1,Ft=mt=null,n.updateQueue!=null){var g=n.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}O.H=x4,g=s(i,c)}while(To);return g}function u4(){var n=O.H,s=n.useState()[0];return s=typeof s.then=="function"?Zi(s):s,n=n.useState()[0],(mt!==null?mt.memoizedState:null)!==n&&(Ke.flags|=1024),s}function yh(){var n=Lc!==0;return Lc=0,n}function bh(n,s,i){s.updateQueue=n.updateQueue,s.flags&=-2053,n.lanes&=~i}function wh(n){if(Pc){for(n=n.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}Pc=!1}Ia=0,Ft=mt=Ke=null,To=!1,Yi=Lc=0,_o=null}function Ln(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ft===null?Ke.memoizedState=Ft=n:Ft=Ft.next=n,Ft}function qt(){if(mt===null){var n=Ke.alternate;n=n!==null?n.memoizedState:null}else n=mt.next;var s=Ft===null?Ke.memoizedState:Ft.next;if(s!==null)Ft=s,mt=n;else{if(n===null)throw Ke.alternate===null?Error(o(467)):Error(o(310));mt=n,n={memoizedState:mt.memoizedState,baseState:mt.baseState,baseQueue:mt.baseQueue,queue:mt.queue,next:null},Ft===null?Ke.memoizedState=Ft=n:Ft=Ft.next=n}return Ft}function jh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zi(n){var s=Yi;return Yi+=1,_o===null&&(_o=[]),n=Uv(_o,n,s),s=Ke,(Ft===null?s.memoizedState:Ft.next)===null&&(s=s.alternate,O.H=s===null||s.memoizedState===null?Ay:Ry),n}function $c(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return Zi(n);if(n.$$typeof===R)return bn(n)}throw Error(o(438,String(n)))}function Nh(n){var s=null,i=Ke.updateQueue;if(i!==null&&(s=i.memoCache),s==null){var c=Ke.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(s={data:c.data.map(function(h){return h.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),i===null&&(i=jh(),Ke.updateQueue=i),i.memoCache=s,i=s.data[s.index],i===void 0)for(i=s.data[s.index]=Array(n),c=0;c<n;c++)i[c]=se;return s.index++,i}function da(n,s){return typeof s=="function"?s(n):s}function Ic(n){var s=qt();return Sh(s,mt,n)}function Sh(n,s,i){var c=n.queue;if(c===null)throw Error(o(311));c.lastRenderedReducer=i;var h=n.baseQueue,g=c.pending;if(g!==null){if(h!==null){var j=h.next;h.next=g.next,g.next=j}s.baseQueue=h=g,c.pending=null}if(g=n.baseState,h===null)n.memoizedState=g;else{s=h.next;var A=j=null,D=null,K=s,oe=!1;do{var ue=K.lane&-536870913;if(ue!==K.lane?(nt&ue)===ue:(Ia&ue)===ue){var W=K.revertLane;if(W===0)D!==null&&(D=D.next={lane:0,revertLane:0,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),ue===Eo&&(oe=!0);else if((Ia&W)===W){K=K.next,W===Eo&&(oe=!0);continue}else ue={lane:0,revertLane:K.revertLane,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},D===null?(A=D=ue,j=g):D=D.next=ue,Ke.lanes|=W,Ya|=W;ue=K.action,Ls&&i(g,ue),g=K.hasEagerState?K.eagerState:i(g,ue)}else W={lane:ue,revertLane:K.revertLane,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},D===null?(A=D=W,j=g):D=D.next=W,Ke.lanes|=ue,Ya|=ue;K=K.next}while(K!==null&&K!==s);if(D===null?j=g:D.next=A,!qn(g,n.memoizedState)&&(sn=!0,oe&&(i=Ao,i!==null)))throw i;n.memoizedState=g,n.baseState=j,n.baseQueue=D,c.lastRenderedState=g}return h===null&&(c.lanes=0),[n.memoizedState,c.dispatch]}function kh(n){var s=qt(),i=s.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=n;var c=i.dispatch,h=i.pending,g=s.memoizedState;if(h!==null){i.pending=null;var j=h=h.next;do g=n(g,j.action),j=j.next;while(j!==h);qn(g,s.memoizedState)||(sn=!0),s.memoizedState=g,s.baseQueue===null&&(s.baseState=g),i.lastRenderedState=g}return[g,c]}function Gv(n,s,i){var c=Ke,h=qt(),g=it;if(g){if(i===void 0)throw Error(o(407));i=i()}else i=s();var j=!qn((mt||h).memoizedState,i);j&&(h.memoizedState=i,sn=!0),h=h.queue;var A=Xv.bind(null,c,h,n);if(Gi(2048,8,A,[n]),h.getSnapshot!==s||j||Ft!==null&&Ft.memoizedState.tag&1){if(c.flags|=2048,Mo(9,Uc(),Qv.bind(null,c,h,i,s),null),jt===null)throw Error(o(349));g||(Ia&124)!==0||Kv(c,s,i)}return i}function Kv(n,s,i){n.flags|=16384,n={getSnapshot:s,value:i},s=Ke.updateQueue,s===null?(s=jh(),Ke.updateQueue=s,s.stores=[n]):(i=s.stores,i===null?s.stores=[n]:i.push(n))}function Qv(n,s,i,c){s.value=i,s.getSnapshot=c,Wv(s)&&Jv(n)}function Xv(n,s,i){return i(function(){Wv(s)&&Jv(n)})}function Wv(n){var s=n.getSnapshot;n=n.value;try{var i=s();return!qn(n,i)}catch{return!0}}function Jv(n){var s=No(n,2);s!==null&&Xn(s,n,2)}function Ch(n){var s=Ln();if(typeof n=="function"){var i=n;if(n=i(),Ls){qe(!0);try{i()}finally{qe(!1)}}}return s.memoizedState=s.baseState=n,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:n},s}function ey(n,s,i,c){return n.baseState=i,Sh(n,mt,typeof c=="function"?c:da)}function d4(n,s,i,c,h){if(Vc(n))throw Error(o(485));if(n=s.action,n!==null){var g={payload:h,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(j){g.listeners.push(j)}};O.T!==null?i(!0):g.isTransition=!1,c(g),i=s.pending,i===null?(g.next=s.pending=g,ty(s,g)):(g.next=i.next,s.pending=i.next=g)}}function ty(n,s){var i=s.action,c=s.payload,h=n.state;if(s.isTransition){var g=O.T,j={};O.T=j;try{var A=i(h,c),D=O.S;D!==null&&D(j,A),ny(n,s,A)}catch(K){Eh(n,s,K)}finally{O.T=g}}else try{g=i(h,c),ny(n,s,g)}catch(K){Eh(n,s,K)}}function ny(n,s,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(c){ry(n,s,c)},function(c){return Eh(n,s,c)}):ry(n,s,i)}function ry(n,s,i){s.status="fulfilled",s.value=i,ay(s),n.state=i,s=n.pending,s!==null&&(i=s.next,i===s?n.pending=null:(i=i.next,s.next=i,ty(n,i)))}function Eh(n,s,i){var c=n.pending;if(n.pending=null,c!==null){c=c.next;do s.status="rejected",s.reason=i,ay(s),s=s.next;while(s!==c)}n.action=null}function ay(n){n=n.listeners;for(var s=0;s<n.length;s++)(0,n[s])()}function sy(n,s){return s}function oy(n,s){if(it){var i=jt.formState;if(i!==null){e:{var c=Ke;if(it){if(Dt){t:{for(var h=Dt,g=Ir;h.nodeType!==8;){if(!g){h=null;break t}if(h=Sr(h.nextSibling),h===null){h=null;break t}}g=h.data,h=g==="F!"||g==="F"?h:null}if(h){Dt=Sr(h.nextSibling),c=h.data==="F!";break e}}Ds(c)}c=!1}c&&(s=i[0])}}return i=Ln(),i.memoizedState=i.baseState=s,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sy,lastRenderedState:s},i.queue=c,i=ky.bind(null,Ke,c),c.dispatch=i,c=Ch(!1),g=Mh.bind(null,Ke,!1,c.queue),c=Ln(),h={state:s,dispatch:null,action:n,pending:null},c.queue=h,i=d4.bind(null,Ke,h,g,i),h.dispatch=i,c.memoizedState=n,[s,i,!1]}function iy(n){var s=qt();return ly(s,mt,n)}function ly(n,s,i){if(s=Sh(n,s,sy)[0],n=Ic(da)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var c=Zi(s)}catch(j){throw j===Bi?Dc:j}else c=s;s=qt();var h=s.queue,g=h.dispatch;return i!==s.memoizedState&&(Ke.flags|=2048,Mo(9,Uc(),f4.bind(null,h,i),null)),[c,g,n]}function f4(n,s){n.action=s}function cy(n){var s=qt(),i=mt;if(i!==null)return ly(s,i,n);qt(),s=s.memoizedState,i=qt();var c=i.queue.dispatch;return i.memoizedState=n,[s,c,!1]}function Mo(n,s,i,c){return n={tag:n,create:i,deps:c,inst:s,next:null},s=Ke.updateQueue,s===null&&(s=jh(),Ke.updateQueue=s),i=s.lastEffect,i===null?s.lastEffect=n.next=n:(c=i.next,i.next=n,n.next=c,s.lastEffect=n),n}function Uc(){return{destroy:void 0,resource:void 0}}function uy(){return qt().memoizedState}function Bc(n,s,i,c){var h=Ln();c=c===void 0?null:c,Ke.flags|=n,h.memoizedState=Mo(1|s,Uc(),i,c)}function Gi(n,s,i,c){var h=qt();c=c===void 0?null:c;var g=h.memoizedState.inst;mt!==null&&c!==null&&gh(c,mt.memoizedState.deps)?h.memoizedState=Mo(s,g,i,c):(Ke.flags|=n,h.memoizedState=Mo(1|s,g,i,c))}function dy(n,s){Bc(8390656,8,n,s)}function fy(n,s){Gi(2048,8,n,s)}function hy(n,s){return Gi(4,2,n,s)}function my(n,s){return Gi(4,4,n,s)}function py(n,s){if(typeof s=="function"){n=n();var i=s(n);return function(){typeof i=="function"?i():s(null)}}if(s!=null)return n=n(),s.current=n,function(){s.current=null}}function xy(n,s,i){i=i!=null?i.concat([n]):null,Gi(4,4,py.bind(null,s,n),i)}function Ah(){}function gy(n,s){var i=qt();s=s===void 0?null:s;var c=i.memoizedState;return s!==null&&gh(s,c[1])?c[0]:(i.memoizedState=[n,s],n)}function vy(n,s){var i=qt();s=s===void 0?null:s;var c=i.memoizedState;if(s!==null&&gh(s,c[1]))return c[0];if(c=n(),Ls){qe(!0);try{n()}finally{qe(!1)}}return i.memoizedState=[c,s],c}function Rh(n,s,i){return i===void 0||(Ia&1073741824)!==0?n.memoizedState=s:(n.memoizedState=i,n=w0(),Ke.lanes|=n,Ya|=n,i)}function yy(n,s,i,c){return qn(i,s)?i:Ro.current!==null?(n=Rh(n,i,c),qn(n,s)||(sn=!0),n):(Ia&42)===0?(sn=!0,n.memoizedState=i):(n=w0(),Ke.lanes|=n,Ya|=n,s)}function by(n,s,i,c,h){var g=L.p;L.p=g!==0&&8>g?g:8;var j=O.T,A={};O.T=A,Mh(n,!1,s,i);try{var D=h(),K=O.S;if(K!==null&&K(A,D),D!==null&&typeof D=="object"&&typeof D.then=="function"){var oe=l4(D,c);Ki(n,s,oe,Qn(n))}else Ki(n,s,c,Qn(n))}catch(ue){Ki(n,s,{then:function(){},status:"rejected",reason:ue},Qn())}finally{L.p=g,O.T=j}}function h4(){}function Th(n,s,i,c){if(n.tag!==5)throw Error(o(476));var h=wy(n).queue;by(n,h,s,F,i===null?h4:function(){return jy(n),i(c)})}function wy(n){var s=n.memoizedState;if(s!==null)return s;s={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:F},next:null};var i={};return s.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:da,lastRenderedState:i},next:null},n.memoizedState=s,n=n.alternate,n!==null&&(n.memoizedState=s),s}function jy(n){var s=wy(n).next.queue;Ki(n,s,{},Qn())}function _h(){return bn(hl)}function Ny(){return qt().memoizedState}function Sy(){return qt().memoizedState}function m4(n){for(var s=n.return;s!==null;){switch(s.tag){case 24:case 3:var i=Qn();n=La(i);var c=$a(s,n,i);c!==null&&(Xn(c,s,i),Hi(c,s,i)),s={cache:ih()},n.payload=s;return}s=s.return}}function p4(n,s,i){var c=Qn();i={lane:c,revertLane:0,action:i,hasEagerState:!1,eagerState:null,next:null},Vc(n)?Cy(s,i):(i=Xf(n,s,i,c),i!==null&&(Xn(i,n,c),Ey(i,s,c)))}function ky(n,s,i){var c=Qn();Ki(n,s,i,c)}function Ki(n,s,i,c){var h={lane:c,revertLane:0,action:i,hasEagerState:!1,eagerState:null,next:null};if(Vc(n))Cy(s,h);else{var g=n.alternate;if(n.lanes===0&&(g===null||g.lanes===0)&&(g=s.lastRenderedReducer,g!==null))try{var j=s.lastRenderedState,A=g(j,i);if(h.hasEagerState=!0,h.eagerState=A,qn(A,j))return kc(n,s,h,0),jt===null&&Sc(),!1}catch{}finally{}if(i=Xf(n,s,h,c),i!==null)return Xn(i,n,c),Ey(i,s,c),!0}return!1}function Mh(n,s,i,c){if(c={lane:2,revertLane:um(),action:c,hasEagerState:!1,eagerState:null,next:null},Vc(n)){if(s)throw Error(o(479))}else s=Xf(n,i,c,2),s!==null&&Xn(s,n,2)}function Vc(n){var s=n.alternate;return n===Ke||s!==null&&s===Ke}function Cy(n,s){To=Pc=!0;var i=n.pending;i===null?s.next=s:(s.next=i.next,i.next=s),n.pending=s}function Ey(n,s,i){if((i&4194048)!==0){var c=s.lanes;c&=n.pendingLanes,i|=c,s.lanes=i,rn(n,i)}}var Hc={readContext:bn,use:$c,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useLayoutEffect:$t,useInsertionEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useSyncExternalStore:$t,useId:$t,useHostTransitionStatus:$t,useFormState:$t,useActionState:$t,useOptimistic:$t,useMemoCache:$t,useCacheRefresh:$t},Ay={readContext:bn,use:$c,useCallback:function(n,s){return Ln().memoizedState=[n,s===void 0?null:s],n},useContext:bn,useEffect:dy,useImperativeHandle:function(n,s,i){i=i!=null?i.concat([n]):null,Bc(4194308,4,py.bind(null,s,n),i)},useLayoutEffect:function(n,s){return Bc(4194308,4,n,s)},useInsertionEffect:function(n,s){Bc(4,2,n,s)},useMemo:function(n,s){var i=Ln();s=s===void 0?null:s;var c=n();if(Ls){qe(!0);try{n()}finally{qe(!1)}}return i.memoizedState=[c,s],c},useReducer:function(n,s,i){var c=Ln();if(i!==void 0){var h=i(s);if(Ls){qe(!0);try{i(s)}finally{qe(!1)}}}else h=s;return c.memoizedState=c.baseState=h,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:h},c.queue=n,n=n.dispatch=p4.bind(null,Ke,n),[c.memoizedState,n]},useRef:function(n){var s=Ln();return n={current:n},s.memoizedState=n},useState:function(n){n=Ch(n);var s=n.queue,i=ky.bind(null,Ke,s);return s.dispatch=i,[n.memoizedState,i]},useDebugValue:Ah,useDeferredValue:function(n,s){var i=Ln();return Rh(i,n,s)},useTransition:function(){var n=Ch(!1);return n=by.bind(null,Ke,n.queue,!0,!1),Ln().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,s,i){var c=Ke,h=Ln();if(it){if(i===void 0)throw Error(o(407));i=i()}else{if(i=s(),jt===null)throw Error(o(349));(nt&124)!==0||Kv(c,s,i)}h.memoizedState=i;var g={value:i,getSnapshot:s};return h.queue=g,dy(Xv.bind(null,c,g,n),[n]),c.flags|=2048,Mo(9,Uc(),Qv.bind(null,c,g,i,s),null),i},useId:function(){var n=Ln(),s=jt.identifierPrefix;if(it){var i=la,c=ia;i=(c&~(1<<32-at(c)-1)).toString(32)+i,s="«"+s+"R"+i,i=Lc++,0<i&&(s+="H"+i.toString(32)),s+="»"}else i=c4++,s="«"+s+"r"+i.toString(32)+"»";return n.memoizedState=s},useHostTransitionStatus:_h,useFormState:oy,useActionState:oy,useOptimistic:function(n){var s=Ln();s.memoizedState=s.baseState=n;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=i,s=Mh.bind(null,Ke,!0,i),i.dispatch=s,[n,s]},useMemoCache:Nh,useCacheRefresh:function(){return Ln().memoizedState=m4.bind(null,Ke)}},Ry={readContext:bn,use:$c,useCallback:gy,useContext:bn,useEffect:fy,useImperativeHandle:xy,useInsertionEffect:hy,useLayoutEffect:my,useMemo:vy,useReducer:Ic,useRef:uy,useState:function(){return Ic(da)},useDebugValue:Ah,useDeferredValue:function(n,s){var i=qt();return yy(i,mt.memoizedState,n,s)},useTransition:function(){var n=Ic(da)[0],s=qt().memoizedState;return[typeof n=="boolean"?n:Zi(n),s]},useSyncExternalStore:Gv,useId:Ny,useHostTransitionStatus:_h,useFormState:iy,useActionState:iy,useOptimistic:function(n,s){var i=qt();return ey(i,mt,n,s)},useMemoCache:Nh,useCacheRefresh:Sy},x4={readContext:bn,use:$c,useCallback:gy,useContext:bn,useEffect:fy,useImperativeHandle:xy,useInsertionEffect:hy,useLayoutEffect:my,useMemo:vy,useReducer:kh,useRef:uy,useState:function(){return kh(da)},useDebugValue:Ah,useDeferredValue:function(n,s){var i=qt();return mt===null?Rh(i,n,s):yy(i,mt.memoizedState,n,s)},useTransition:function(){var n=kh(da)[0],s=qt().memoizedState;return[typeof n=="boolean"?n:Zi(n),s]},useSyncExternalStore:Gv,useId:Ny,useHostTransitionStatus:_h,useFormState:cy,useActionState:cy,useOptimistic:function(n,s){var i=qt();return mt!==null?ey(i,mt,n,s):(i.baseState=n,[n,i.queue.dispatch])},useMemoCache:Nh,useCacheRefresh:Sy},Do=null,Qi=0;function Fc(n){var s=Qi;return Qi+=1,Do===null&&(Do=[]),Uv(Do,n,s)}function Xi(n,s){s=s.props.ref,n.ref=s!==void 0?s:null}function qc(n,s){throw s.$$typeof===y?Error(o(525)):(n=Object.prototype.toString.call(s),Error(o(31,n==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":n)))}function Ty(n){var s=n._init;return s(n._payload)}function _y(n){function s(H,I){if(n){var Y=H.deletions;Y===null?(H.deletions=[I],H.flags|=16):Y.push(I)}}function i(H,I){if(!n)return null;for(;I!==null;)s(H,I),I=I.sibling;return null}function c(H){for(var I=new Map;H!==null;)H.key!==null?I.set(H.key,H):I.set(H.index,H),H=H.sibling;return I}function h(H,I){return H=oa(H,I),H.index=0,H.sibling=null,H}function g(H,I,Y){return H.index=Y,n?(Y=H.alternate,Y!==null?(Y=Y.index,Y<I?(H.flags|=67108866,I):Y):(H.flags|=67108866,I)):(H.flags|=1048576,I)}function j(H){return n&&H.alternate===null&&(H.flags|=67108866),H}function A(H,I,Y,le){return I===null||I.tag!==6?(I=Jf(Y,H.mode,le),I.return=H,I):(I=h(I,Y),I.return=H,I)}function D(H,I,Y,le){var Te=Y.type;return Te===N?oe(H,I,Y.props.children,le,Y.key):I!==null&&(I.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===V&&Ty(Te)===I.type)?(I=h(I,Y.props),Xi(I,Y),I.return=H,I):(I=Ec(Y.type,Y.key,Y.props,null,H.mode,le),Xi(I,Y),I.return=H,I)}function K(H,I,Y,le){return I===null||I.tag!==4||I.stateNode.containerInfo!==Y.containerInfo||I.stateNode.implementation!==Y.implementation?(I=eh(Y,H.mode,le),I.return=H,I):(I=h(I,Y.children||[]),I.return=H,I)}function oe(H,I,Y,le,Te){return I===null||I.tag!==7?(I=Rs(Y,H.mode,le,Te),I.return=H,I):(I=h(I,Y),I.return=H,I)}function ue(H,I,Y){if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return I=Jf(""+I,H.mode,Y),I.return=H,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case b:return Y=Ec(I.type,I.key,I.props,null,H.mode,Y),Xi(Y,I),Y.return=H,Y;case S:return I=eh(I,H.mode,Y),I.return=H,I;case V:var le=I._init;return I=le(I._payload),ue(H,I,Y)}if(me(I)||te(I))return I=Rs(I,H.mode,Y,null),I.return=H,I;if(typeof I.then=="function")return ue(H,Fc(I),Y);if(I.$$typeof===R)return ue(H,_c(H,I),Y);qc(H,I)}return null}function W(H,I,Y,le){var Te=I!==null?I.key:null;if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Te!==null?null:A(H,I,""+Y,le);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case b:return Y.key===Te?D(H,I,Y,le):null;case S:return Y.key===Te?K(H,I,Y,le):null;case V:return Te=Y._init,Y=Te(Y._payload),W(H,I,Y,le)}if(me(Y)||te(Y))return Te!==null?null:oe(H,I,Y,le,null);if(typeof Y.then=="function")return W(H,I,Fc(Y),le);if(Y.$$typeof===R)return W(H,I,_c(H,Y),le);qc(H,Y)}return null}function ee(H,I,Y,le,Te){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return H=H.get(Y)||null,A(I,H,""+le,Te);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case b:return H=H.get(le.key===null?Y:le.key)||null,D(I,H,le,Te);case S:return H=H.get(le.key===null?Y:le.key)||null,K(I,H,le,Te);case V:var We=le._init;return le=We(le._payload),ee(H,I,Y,le,Te)}if(me(le)||te(le))return H=H.get(Y)||null,oe(I,H,le,Te,null);if(typeof le.then=="function")return ee(H,I,Y,Fc(le),Te);if(le.$$typeof===R)return ee(H,I,Y,_c(I,le),Te);qc(I,le)}return null}function Fe(H,I,Y,le){for(var Te=null,We=null,De=I,Ue=I=0,ln=null;De!==null&&Ue<Y.length;Ue++){De.index>Ue?(ln=De,De=null):ln=De.sibling;var ot=W(H,De,Y[Ue],le);if(ot===null){De===null&&(De=ln);break}n&&De&&ot.alternate===null&&s(H,De),I=g(ot,I,Ue),We===null?Te=ot:We.sibling=ot,We=ot,De=ln}if(Ue===Y.length)return i(H,De),it&&_s(H,Ue),Te;if(De===null){for(;Ue<Y.length;Ue++)De=ue(H,Y[Ue],le),De!==null&&(I=g(De,I,Ue),We===null?Te=De:We.sibling=De,We=De);return it&&_s(H,Ue),Te}for(De=c(De);Ue<Y.length;Ue++)ln=ee(De,H,Ue,Y[Ue],le),ln!==null&&(n&&ln.alternate!==null&&De.delete(ln.key===null?Ue:ln.key),I=g(ln,I,Ue),We===null?Te=ln:We.sibling=ln,We=ln);return n&&De.forEach(function(ts){return s(H,ts)}),it&&_s(H,Ue),Te}function $e(H,I,Y,le){if(Y==null)throw Error(o(151));for(var Te=null,We=null,De=I,Ue=I=0,ln=null,ot=Y.next();De!==null&&!ot.done;Ue++,ot=Y.next()){De.index>Ue?(ln=De,De=null):ln=De.sibling;var ts=W(H,De,ot.value,le);if(ts===null){De===null&&(De=ln);break}n&&De&&ts.alternate===null&&s(H,De),I=g(ts,I,Ue),We===null?Te=ts:We.sibling=ts,We=ts,De=ln}if(ot.done)return i(H,De),it&&_s(H,Ue),Te;if(De===null){for(;!ot.done;Ue++,ot=Y.next())ot=ue(H,ot.value,le),ot!==null&&(I=g(ot,I,Ue),We===null?Te=ot:We.sibling=ot,We=ot);return it&&_s(H,Ue),Te}for(De=c(De);!ot.done;Ue++,ot=Y.next())ot=ee(De,H,Ue,ot.value,le),ot!==null&&(n&&ot.alternate!==null&&De.delete(ot.key===null?Ue:ot.key),I=g(ot,I,Ue),We===null?Te=ot:We.sibling=ot,We=ot);return n&&De.forEach(function(gR){return s(H,gR)}),it&&_s(H,Ue),Te}function xt(H,I,Y,le){if(typeof Y=="object"&&Y!==null&&Y.type===N&&Y.key===null&&(Y=Y.props.children),typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case b:e:{for(var Te=Y.key;I!==null;){if(I.key===Te){if(Te=Y.type,Te===N){if(I.tag===7){i(H,I.sibling),le=h(I,Y.props.children),le.return=H,H=le;break e}}else if(I.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===V&&Ty(Te)===I.type){i(H,I.sibling),le=h(I,Y.props),Xi(le,Y),le.return=H,H=le;break e}i(H,I);break}else s(H,I);I=I.sibling}Y.type===N?(le=Rs(Y.props.children,H.mode,le,Y.key),le.return=H,H=le):(le=Ec(Y.type,Y.key,Y.props,null,H.mode,le),Xi(le,Y),le.return=H,H=le)}return j(H);case S:e:{for(Te=Y.key;I!==null;){if(I.key===Te)if(I.tag===4&&I.stateNode.containerInfo===Y.containerInfo&&I.stateNode.implementation===Y.implementation){i(H,I.sibling),le=h(I,Y.children||[]),le.return=H,H=le;break e}else{i(H,I);break}else s(H,I);I=I.sibling}le=eh(Y,H.mode,le),le.return=H,H=le}return j(H);case V:return Te=Y._init,Y=Te(Y._payload),xt(H,I,Y,le)}if(me(Y))return Fe(H,I,Y,le);if(te(Y)){if(Te=te(Y),typeof Te!="function")throw Error(o(150));return Y=Te.call(Y),$e(H,I,Y,le)}if(typeof Y.then=="function")return xt(H,I,Fc(Y),le);if(Y.$$typeof===R)return xt(H,I,_c(H,Y),le);qc(H,Y)}return typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint"?(Y=""+Y,I!==null&&I.tag===6?(i(H,I.sibling),le=h(I,Y),le.return=H,H=le):(i(H,I),le=Jf(Y,H.mode,le),le.return=H,H=le),j(H)):i(H,I)}return function(H,I,Y,le){try{Qi=0;var Te=xt(H,I,Y,le);return Do=null,Te}catch(De){if(De===Bi||De===Dc)throw De;var We=Yn(29,De,null,H.mode);return We.lanes=le,We.return=H,We}finally{}}}var Oo=_y(!0),My=_y(!1),fr=B(null),Ur=null;function Ua(n){var s=n.alternate;fe(Jt,Jt.current&1),fe(fr,n),Ur===null&&(s===null||Ro.current!==null||s.memoizedState!==null)&&(Ur=n)}function Dy(n){if(n.tag===22){if(fe(Jt,Jt.current),fe(fr,n),Ur===null){var s=n.alternate;s!==null&&s.memoizedState!==null&&(Ur=n)}}else Ba()}function Ba(){fe(Jt,Jt.current),fe(fr,fr.current)}function fa(n){ge(fr),Ur===n&&(Ur=null),ge(Jt)}var Jt=B(0);function Yc(n){for(var s=n;s!==null;){if(s.tag===13){var i=s.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||jm(i)))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}function Dh(n,s,i,c){s=n.memoizedState,i=i(c,s),i=i==null?s:v({},s,i),n.memoizedState=i,n.lanes===0&&(n.updateQueue.baseState=i)}var Oh={enqueueSetState:function(n,s,i){n=n._reactInternals;var c=Qn(),h=La(c);h.payload=s,i!=null&&(h.callback=i),s=$a(n,h,c),s!==null&&(Xn(s,n,c),Hi(s,n,c))},enqueueReplaceState:function(n,s,i){n=n._reactInternals;var c=Qn(),h=La(c);h.tag=1,h.payload=s,i!=null&&(h.callback=i),s=$a(n,h,c),s!==null&&(Xn(s,n,c),Hi(s,n,c))},enqueueForceUpdate:function(n,s){n=n._reactInternals;var i=Qn(),c=La(i);c.tag=2,s!=null&&(c.callback=s),s=$a(n,c,i),s!==null&&(Xn(s,n,i),Hi(s,n,i))}};function Oy(n,s,i,c,h,g,j){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(c,g,j):s.prototype&&s.prototype.isPureReactComponent?!Di(i,c)||!Di(h,g):!0}function zy(n,s,i,c){n=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(i,c),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(i,c),s.state!==n&&Oh.enqueueReplaceState(s,s.state,null)}function $s(n,s){var i=s;if("ref"in s){i={};for(var c in s)c!=="ref"&&(i[c]=s[c])}if(n=n.defaultProps){i===s&&(i=v({},i));for(var h in n)i[h]===void 0&&(i[h]=n[h])}return i}var Zc=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)};function Py(n){Zc(n)}function Ly(n){console.error(n)}function $y(n){Zc(n)}function Gc(n,s){try{var i=n.onUncaughtError;i(s.value,{componentStack:s.stack})}catch(c){setTimeout(function(){throw c})}}function Iy(n,s,i){try{var c=n.onCaughtError;c(i.value,{componentStack:i.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function zh(n,s,i){return i=La(i),i.tag=3,i.payload={element:null},i.callback=function(){Gc(n,s)},i}function Uy(n){return n=La(n),n.tag=3,n}function By(n,s,i,c){var h=i.type.getDerivedStateFromError;if(typeof h=="function"){var g=c.value;n.payload=function(){return h(g)},n.callback=function(){Iy(s,i,c)}}var j=i.stateNode;j!==null&&typeof j.componentDidCatch=="function"&&(n.callback=function(){Iy(s,i,c),typeof h!="function"&&(Za===null?Za=new Set([this]):Za.add(this));var A=c.stack;this.componentDidCatch(c.value,{componentStack:A!==null?A:""})})}function g4(n,s,i,c,h){if(i.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(s=i.alternate,s!==null&&$i(s,i,h,!0),i=fr.current,i!==null){switch(i.tag){case 13:return Ur===null?sm():i.alternate===null&&Ot===0&&(Ot=3),i.flags&=-257,i.flags|=65536,i.lanes=h,c===uh?i.flags|=16384:(s=i.updateQueue,s===null?i.updateQueue=new Set([c]):s.add(c),im(n,c,h)),!1;case 22:return i.flags|=65536,c===uh?i.flags|=16384:(s=i.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([c])},i.updateQueue=s):(i=s.retryQueue,i===null?s.retryQueue=new Set([c]):i.add(c)),im(n,c,h)),!1}throw Error(o(435,i.tag))}return im(n,c,h),sm(),!1}if(it)return s=fr.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=h,c!==rh&&(n=Error(o(422),{cause:c}),Li(lr(n,i)))):(c!==rh&&(s=Error(o(423),{cause:c}),Li(lr(s,i))),n=n.current.alternate,n.flags|=65536,h&=-h,n.lanes|=h,c=lr(c,i),h=zh(n.stateNode,c,h),hh(n,h),Ot!==4&&(Ot=2)),!1;var g=Error(o(520),{cause:c});if(g=lr(g,i),al===null?al=[g]:al.push(g),Ot!==4&&(Ot=2),s===null)return!0;c=lr(c,i),i=s;do{switch(i.tag){case 3:return i.flags|=65536,n=h&-h,i.lanes|=n,n=zh(i.stateNode,c,n),hh(i,n),!1;case 1:if(s=i.type,g=i.stateNode,(i.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Za===null||!Za.has(g))))return i.flags|=65536,h&=-h,i.lanes|=h,h=Uy(h),By(h,n,i,c),hh(i,h),!1}i=i.return}while(i!==null);return!1}var Vy=Error(o(461)),sn=!1;function mn(n,s,i,c){s.child=n===null?My(s,null,i,c):Oo(s,n.child,i,c)}function Hy(n,s,i,c,h){i=i.render;var g=s.ref;if("ref"in c){var j={};for(var A in c)A!=="ref"&&(j[A]=c[A])}else j=c;return zs(s),c=vh(n,s,i,j,g,h),A=yh(),n!==null&&!sn?(bh(n,s,h),ha(n,s,h)):(it&&A&&th(s),s.flags|=1,mn(n,s,c,h),s.child)}function Fy(n,s,i,c,h){if(n===null){var g=i.type;return typeof g=="function"&&!Wf(g)&&g.defaultProps===void 0&&i.compare===null?(s.tag=15,s.type=g,qy(n,s,g,c,h)):(n=Ec(i.type,null,c,s,s.mode,h),n.ref=s.ref,n.return=s,s.child=n)}if(g=n.child,!Hh(n,h)){var j=g.memoizedProps;if(i=i.compare,i=i!==null?i:Di,i(j,c)&&n.ref===s.ref)return ha(n,s,h)}return s.flags|=1,n=oa(g,c),n.ref=s.ref,n.return=s,s.child=n}function qy(n,s,i,c,h){if(n!==null){var g=n.memoizedProps;if(Di(g,c)&&n.ref===s.ref)if(sn=!1,s.pendingProps=c=g,Hh(n,h))(n.flags&131072)!==0&&(sn=!0);else return s.lanes=n.lanes,ha(n,s,h)}return Ph(n,s,i,c,h)}function Yy(n,s,i){var c=s.pendingProps,h=c.children,g=n!==null?n.memoizedState:null;if(c.mode==="hidden"){if((s.flags&128)!==0){if(c=g!==null?g.baseLanes|i:i,n!==null){for(h=s.child=n.child,g=0;h!==null;)g=g|h.lanes|h.childLanes,h=h.sibling;s.childLanes=g&~c}else s.childLanes=0,s.child=null;return Zy(n,s,c,i)}if((i&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},n!==null&&Mc(s,g!==null?g.cachePool:null),g!==null?qv(s,g):ph(),Dy(s);else return s.lanes=s.childLanes=536870912,Zy(n,s,g!==null?g.baseLanes|i:i,i)}else g!==null?(Mc(s,g.cachePool),qv(s,g),Ba(),s.memoizedState=null):(n!==null&&Mc(s,null),ph(),Ba());return mn(n,s,h,i),s.child}function Zy(n,s,i,c){var h=ch();return h=h===null?null:{parent:Wt._currentValue,pool:h},s.memoizedState={baseLanes:i,cachePool:h},n!==null&&Mc(s,null),ph(),Dy(s),n!==null&&$i(n,s,c,!0),null}function Kc(n,s){var i=s.ref;if(i===null)n!==null&&n.ref!==null&&(s.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(o(284));(n===null||n.ref!==i)&&(s.flags|=4194816)}}function Ph(n,s,i,c,h){return zs(s),i=vh(n,s,i,c,void 0,h),c=yh(),n!==null&&!sn?(bh(n,s,h),ha(n,s,h)):(it&&c&&th(s),s.flags|=1,mn(n,s,i,h),s.child)}function Gy(n,s,i,c,h,g){return zs(s),s.updateQueue=null,i=Zv(s,c,i,h),Yv(n),c=yh(),n!==null&&!sn?(bh(n,s,g),ha(n,s,g)):(it&&c&&th(s),s.flags|=1,mn(n,s,i,g),s.child)}function Ky(n,s,i,c,h){if(zs(s),s.stateNode===null){var g=So,j=i.contextType;typeof j=="object"&&j!==null&&(g=bn(j)),g=new i(c,g),s.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Oh,s.stateNode=g,g._reactInternals=s,g=s.stateNode,g.props=c,g.state=s.memoizedState,g.refs={},dh(s),j=i.contextType,g.context=typeof j=="object"&&j!==null?bn(j):So,g.state=s.memoizedState,j=i.getDerivedStateFromProps,typeof j=="function"&&(Dh(s,i,j,c),g.state=s.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(j=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),j!==g.state&&Oh.enqueueReplaceState(g,g.state,null),qi(s,c,g,h),Fi(),g.state=s.memoizedState),typeof g.componentDidMount=="function"&&(s.flags|=4194308),c=!0}else if(n===null){g=s.stateNode;var A=s.memoizedProps,D=$s(i,A);g.props=D;var K=g.context,oe=i.contextType;j=So,typeof oe=="object"&&oe!==null&&(j=bn(oe));var ue=i.getDerivedStateFromProps;oe=typeof ue=="function"||typeof g.getSnapshotBeforeUpdate=="function",A=s.pendingProps!==A,oe||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(A||K!==j)&&zy(s,g,c,j),Pa=!1;var W=s.memoizedState;g.state=W,qi(s,c,g,h),Fi(),K=s.memoizedState,A||W!==K||Pa?(typeof ue=="function"&&(Dh(s,i,ue,c),K=s.memoizedState),(D=Pa||Oy(s,i,D,c,W,K,j))?(oe||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(s.flags|=4194308)):(typeof g.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=c,s.memoizedState=K),g.props=c,g.state=K,g.context=j,c=D):(typeof g.componentDidMount=="function"&&(s.flags|=4194308),c=!1)}else{g=s.stateNode,fh(n,s),j=s.memoizedProps,oe=$s(i,j),g.props=oe,ue=s.pendingProps,W=g.context,K=i.contextType,D=So,typeof K=="object"&&K!==null&&(D=bn(K)),A=i.getDerivedStateFromProps,(K=typeof A=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(j!==ue||W!==D)&&zy(s,g,c,D),Pa=!1,W=s.memoizedState,g.state=W,qi(s,c,g,h),Fi();var ee=s.memoizedState;j!==ue||W!==ee||Pa||n!==null&&n.dependencies!==null&&Tc(n.dependencies)?(typeof A=="function"&&(Dh(s,i,A,c),ee=s.memoizedState),(oe=Pa||Oy(s,i,oe,c,W,ee,D)||n!==null&&n.dependencies!==null&&Tc(n.dependencies))?(K||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(c,ee,D),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(c,ee,D)),typeof g.componentDidUpdate=="function"&&(s.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof g.componentDidUpdate!="function"||j===n.memoizedProps&&W===n.memoizedState||(s.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&W===n.memoizedState||(s.flags|=1024),s.memoizedProps=c,s.memoizedState=ee),g.props=c,g.state=ee,g.context=D,c=oe):(typeof g.componentDidUpdate!="function"||j===n.memoizedProps&&W===n.memoizedState||(s.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||j===n.memoizedProps&&W===n.memoizedState||(s.flags|=1024),c=!1)}return g=c,Kc(n,s),c=(s.flags&128)!==0,g||c?(g=s.stateNode,i=c&&typeof i.getDerivedStateFromError!="function"?null:g.render(),s.flags|=1,n!==null&&c?(s.child=Oo(s,n.child,null,h),s.child=Oo(s,null,i,h)):mn(n,s,i,h),s.memoizedState=g.state,n=s.child):n=ha(n,s,h),n}function Qy(n,s,i,c){return Pi(),s.flags|=256,mn(n,s,i,c),s.child}var Lh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function $h(n){return{baseLanes:n,cachePool:Lv()}}function Ih(n,s,i){return n=n!==null?n.childLanes&~i:0,s&&(n|=hr),n}function Xy(n,s,i){var c=s.pendingProps,h=!1,g=(s.flags&128)!==0,j;if((j=g)||(j=n!==null&&n.memoizedState===null?!1:(Jt.current&2)!==0),j&&(h=!0,s.flags&=-129),j=(s.flags&32)!==0,s.flags&=-33,n===null){if(it){if(h?Ua(s):Ba(),it){var A=Dt,D;if(D=A){e:{for(D=A,A=Ir;D.nodeType!==8;){if(!A){A=null;break e}if(D=Sr(D.nextSibling),D===null){A=null;break e}}A=D}A!==null?(s.memoizedState={dehydrated:A,treeContext:Ts!==null?{id:ia,overflow:la}:null,retryLane:536870912,hydrationErrors:null},D=Yn(18,null,null,0),D.stateNode=A,D.return=s,s.child=D,Cn=s,Dt=null,D=!0):D=!1}D||Ds(s)}if(A=s.memoizedState,A!==null&&(A=A.dehydrated,A!==null))return jm(A)?s.lanes=32:s.lanes=536870912,null;fa(s)}return A=c.children,c=c.fallback,h?(Ba(),h=s.mode,A=Qc({mode:"hidden",children:A},h),c=Rs(c,h,i,null),A.return=s,c.return=s,A.sibling=c,s.child=A,h=s.child,h.memoizedState=$h(i),h.childLanes=Ih(n,j,i),s.memoizedState=Lh,c):(Ua(s),Uh(s,A))}if(D=n.memoizedState,D!==null&&(A=D.dehydrated,A!==null)){if(g)s.flags&256?(Ua(s),s.flags&=-257,s=Bh(n,s,i)):s.memoizedState!==null?(Ba(),s.child=n.child,s.flags|=128,s=null):(Ba(),h=c.fallback,A=s.mode,c=Qc({mode:"visible",children:c.children},A),h=Rs(h,A,i,null),h.flags|=2,c.return=s,h.return=s,c.sibling=h,s.child=c,Oo(s,n.child,null,i),c=s.child,c.memoizedState=$h(i),c.childLanes=Ih(n,j,i),s.memoizedState=Lh,s=h);else if(Ua(s),jm(A)){if(j=A.nextSibling&&A.nextSibling.dataset,j)var K=j.dgst;j=K,c=Error(o(419)),c.stack="",c.digest=j,Li({value:c,source:null,stack:null}),s=Bh(n,s,i)}else if(sn||$i(n,s,i,!1),j=(i&n.childLanes)!==0,sn||j){if(j=jt,j!==null&&(c=i&-i,c=(c&42)!==0?1:sr(c),c=(c&(j.suspendedLanes|i))!==0?0:c,c!==0&&c!==D.retryLane))throw D.retryLane=c,No(n,c),Xn(j,n,c),Vy;A.data==="$?"||sm(),s=Bh(n,s,i)}else A.data==="$?"?(s.flags|=192,s.child=n.child,s=null):(n=D.treeContext,Dt=Sr(A.nextSibling),Cn=s,it=!0,Ms=null,Ir=!1,n!==null&&(ur[dr++]=ia,ur[dr++]=la,ur[dr++]=Ts,ia=n.id,la=n.overflow,Ts=s),s=Uh(s,c.children),s.flags|=4096);return s}return h?(Ba(),h=c.fallback,A=s.mode,D=n.child,K=D.sibling,c=oa(D,{mode:"hidden",children:c.children}),c.subtreeFlags=D.subtreeFlags&65011712,K!==null?h=oa(K,h):(h=Rs(h,A,i,null),h.flags|=2),h.return=s,c.return=s,c.sibling=h,s.child=c,c=h,h=s.child,A=n.child.memoizedState,A===null?A=$h(i):(D=A.cachePool,D!==null?(K=Wt._currentValue,D=D.parent!==K?{parent:K,pool:K}:D):D=Lv(),A={baseLanes:A.baseLanes|i,cachePool:D}),h.memoizedState=A,h.childLanes=Ih(n,j,i),s.memoizedState=Lh,c):(Ua(s),i=n.child,n=i.sibling,i=oa(i,{mode:"visible",children:c.children}),i.return=s,i.sibling=null,n!==null&&(j=s.deletions,j===null?(s.deletions=[n],s.flags|=16):j.push(n)),s.child=i,s.memoizedState=null,i)}function Uh(n,s){return s=Qc({mode:"visible",children:s},n.mode),s.return=n,n.child=s}function Qc(n,s){return n=Yn(22,n,null,s),n.lanes=0,n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},n}function Bh(n,s,i){return Oo(s,n.child,null,i),n=Uh(s,s.pendingProps.children),n.flags|=2,s.memoizedState=null,n}function Wy(n,s,i){n.lanes|=s;var c=n.alternate;c!==null&&(c.lanes|=s),sh(n.return,s,i)}function Vh(n,s,i,c,h){var g=n.memoizedState;g===null?n.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:c,tail:i,tailMode:h}:(g.isBackwards=s,g.rendering=null,g.renderingStartTime=0,g.last=c,g.tail=i,g.tailMode=h)}function Jy(n,s,i){var c=s.pendingProps,h=c.revealOrder,g=c.tail;if(mn(n,s,c.children,i),c=Jt.current,(c&2)!==0)c=c&1|2,s.flags|=128;else{if(n!==null&&(n.flags&128)!==0)e:for(n=s.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&Wy(n,i,s);else if(n.tag===19)Wy(n,i,s);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===s)break e;for(;n.sibling===null;){if(n.return===null||n.return===s)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}c&=1}switch(fe(Jt,c),h){case"forwards":for(i=s.child,h=null;i!==null;)n=i.alternate,n!==null&&Yc(n)===null&&(h=i),i=i.sibling;i=h,i===null?(h=s.child,s.child=null):(h=i.sibling,i.sibling=null),Vh(s,!1,h,i,g);break;case"backwards":for(i=null,h=s.child,s.child=null;h!==null;){if(n=h.alternate,n!==null&&Yc(n)===null){s.child=h;break}n=h.sibling,h.sibling=i,i=h,h=n}Vh(s,!0,i,null,g);break;case"together":Vh(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function ha(n,s,i){if(n!==null&&(s.dependencies=n.dependencies),Ya|=s.lanes,(i&s.childLanes)===0)if(n!==null){if($i(n,s,i,!1),(i&s.childLanes)===0)return null}else return null;if(n!==null&&s.child!==n.child)throw Error(o(153));if(s.child!==null){for(n=s.child,i=oa(n,n.pendingProps),s.child=i,i.return=s;n.sibling!==null;)n=n.sibling,i=i.sibling=oa(n,n.pendingProps),i.return=s;i.sibling=null}return s.child}function Hh(n,s){return(n.lanes&s)!==0?!0:(n=n.dependencies,!!(n!==null&&Tc(n)))}function v4(n,s,i){switch(s.tag){case 3:he(s,s.stateNode.containerInfo),za(s,Wt,n.memoizedState.cache),Pi();break;case 27:case 5:He(s);break;case 4:he(s,s.stateNode.containerInfo);break;case 10:za(s,s.type,s.memoizedProps.value);break;case 13:var c=s.memoizedState;if(c!==null)return c.dehydrated!==null?(Ua(s),s.flags|=128,null):(i&s.child.childLanes)!==0?Xy(n,s,i):(Ua(s),n=ha(n,s,i),n!==null?n.sibling:null);Ua(s);break;case 19:var h=(n.flags&128)!==0;if(c=(i&s.childLanes)!==0,c||($i(n,s,i,!1),c=(i&s.childLanes)!==0),h){if(c)return Jy(n,s,i);s.flags|=128}if(h=s.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),fe(Jt,Jt.current),c)break;return null;case 22:case 23:return s.lanes=0,Yy(n,s,i);case 24:za(s,Wt,n.memoizedState.cache)}return ha(n,s,i)}function e0(n,s,i){if(n!==null)if(n.memoizedProps!==s.pendingProps)sn=!0;else{if(!Hh(n,i)&&(s.flags&128)===0)return sn=!1,v4(n,s,i);sn=(n.flags&131072)!==0}else sn=!1,it&&(s.flags&1048576)!==0&&Tv(s,Rc,s.index);switch(s.lanes=0,s.tag){case 16:e:{n=s.pendingProps;var c=s.elementType,h=c._init;if(c=h(c._payload),s.type=c,typeof c=="function")Wf(c)?(n=$s(c,n),s.tag=1,s=Ky(null,s,c,n,i)):(s.tag=0,s=Ph(null,s,c,n,i));else{if(c!=null){if(h=c.$$typeof,h===T){s.tag=11,s=Hy(null,s,c,n,i);break e}else if(h===$){s.tag=14,s=Fy(null,s,c,n,i);break e}}throw s=de(c)||c,Error(o(306,s,""))}}return s;case 0:return Ph(n,s,s.type,s.pendingProps,i);case 1:return c=s.type,h=$s(c,s.pendingProps),Ky(n,s,c,h,i);case 3:e:{if(he(s,s.stateNode.containerInfo),n===null)throw Error(o(387));c=s.pendingProps;var g=s.memoizedState;h=g.element,fh(n,s),qi(s,c,null,i);var j=s.memoizedState;if(c=j.cache,za(s,Wt,c),c!==g.cache&&oh(s,[Wt],i,!0),Fi(),c=j.element,g.isDehydrated)if(g={element:c,isDehydrated:!1,cache:j.cache},s.updateQueue.baseState=g,s.memoizedState=g,s.flags&256){s=Qy(n,s,c,i);break e}else if(c!==h){h=lr(Error(o(424)),s),Li(h),s=Qy(n,s,c,i);break e}else{switch(n=s.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(Dt=Sr(n.firstChild),Cn=s,it=!0,Ms=null,Ir=!0,i=My(s,null,c,i),s.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Pi(),c===h){s=ha(n,s,i);break e}mn(n,s,c,i)}s=s.child}return s;case 26:return Kc(n,s),n===null?(i=ab(s.type,null,s.pendingProps,null))?s.memoizedState=i:it||(i=s.type,n=s.pendingProps,c=uu(G.current).createElement(i),c[Lt]=s,c[hn]=n,xn(c,i,n),an(c),s.stateNode=c):s.memoizedState=ab(s.type,n.memoizedProps,s.pendingProps,n.memoizedState),null;case 27:return He(s),n===null&&it&&(c=s.stateNode=tb(s.type,s.pendingProps,G.current),Cn=s,Ir=!0,h=Dt,Qa(s.type)?(Nm=h,Dt=Sr(c.firstChild)):Dt=h),mn(n,s,s.pendingProps.children,i),Kc(n,s),n===null&&(s.flags|=4194304),s.child;case 5:return n===null&&it&&((h=c=Dt)&&(c=Y4(c,s.type,s.pendingProps,Ir),c!==null?(s.stateNode=c,Cn=s,Dt=Sr(c.firstChild),Ir=!1,h=!0):h=!1),h||Ds(s)),He(s),h=s.type,g=s.pendingProps,j=n!==null?n.memoizedProps:null,c=g.children,ym(h,g)?c=null:j!==null&&ym(h,j)&&(s.flags|=32),s.memoizedState!==null&&(h=vh(n,s,u4,null,null,i),hl._currentValue=h),Kc(n,s),mn(n,s,c,i),s.child;case 6:return n===null&&it&&((n=i=Dt)&&(i=Z4(i,s.pendingProps,Ir),i!==null?(s.stateNode=i,Cn=s,Dt=null,n=!0):n=!1),n||Ds(s)),null;case 13:return Xy(n,s,i);case 4:return he(s,s.stateNode.containerInfo),c=s.pendingProps,n===null?s.child=Oo(s,null,c,i):mn(n,s,c,i),s.child;case 11:return Hy(n,s,s.type,s.pendingProps,i);case 7:return mn(n,s,s.pendingProps,i),s.child;case 8:return mn(n,s,s.pendingProps.children,i),s.child;case 12:return mn(n,s,s.pendingProps.children,i),s.child;case 10:return c=s.pendingProps,za(s,s.type,c.value),mn(n,s,c.children,i),s.child;case 9:return h=s.type._context,c=s.pendingProps.children,zs(s),h=bn(h),c=c(h),s.flags|=1,mn(n,s,c,i),s.child;case 14:return Fy(n,s,s.type,s.pendingProps,i);case 15:return qy(n,s,s.type,s.pendingProps,i);case 19:return Jy(n,s,i);case 31:return c=s.pendingProps,i=s.mode,c={mode:c.mode,children:c.children},n===null?(i=Qc(c,i),i.ref=s.ref,s.child=i,i.return=s,s=i):(i=oa(n.child,c),i.ref=s.ref,s.child=i,i.return=s,s=i),s;case 22:return Yy(n,s,i);case 24:return zs(s),c=bn(Wt),n===null?(h=ch(),h===null&&(h=jt,g=ih(),h.pooledCache=g,g.refCount++,g!==null&&(h.pooledCacheLanes|=i),h=g),s.memoizedState={parent:c,cache:h},dh(s),za(s,Wt,h)):((n.lanes&i)!==0&&(fh(n,s),qi(s,null,null,i),Fi()),h=n.memoizedState,g=s.memoizedState,h.parent!==c?(h={parent:c,cache:c},s.memoizedState=h,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=h),za(s,Wt,c)):(c=g.cache,za(s,Wt,c),c!==h.cache&&oh(s,[Wt],i,!0))),mn(n,s,s.pendingProps.children,i),s.child;case 29:throw s.pendingProps}throw Error(o(156,s.tag))}function ma(n){n.flags|=4}function t0(n,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!cb(s)){if(s=fr.current,s!==null&&((nt&4194048)===nt?Ur!==null:(nt&62914560)!==nt&&(nt&536870912)===0||s!==Ur))throw Vi=uh,$v;n.flags|=8192}}function Xc(n,s){s!==null&&(n.flags|=4),n.flags&16384&&(s=n.tag!==22?st():536870912,n.lanes|=s,$o|=s)}function Wi(n,s){if(!it)switch(n.tailMode){case"hidden":s=n.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?n.tail=null:i.sibling=null;break;case"collapsed":i=n.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?s||n.tail===null?n.tail=null:n.tail.sibling=null:c.sibling=null}}function Rt(n){var s=n.alternate!==null&&n.alternate.child===n.child,i=0,c=0;if(s)for(var h=n.child;h!==null;)i|=h.lanes|h.childLanes,c|=h.subtreeFlags&65011712,c|=h.flags&65011712,h.return=n,h=h.sibling;else for(h=n.child;h!==null;)i|=h.lanes|h.childLanes,c|=h.subtreeFlags,c|=h.flags,h.return=n,h=h.sibling;return n.subtreeFlags|=c,n.childLanes=i,s}function y4(n,s,i){var c=s.pendingProps;switch(nh(s),s.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rt(s),null;case 1:return Rt(s),null;case 3:return i=s.stateNode,c=null,n!==null&&(c=n.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),ua(Wt),Be(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(zi(s)?ma(s):n===null||n.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Dv())),Rt(s),null;case 26:return i=s.memoizedState,n===null?(ma(s),i!==null?(Rt(s),t0(s,i)):(Rt(s),s.flags&=-16777217)):i?i!==n.memoizedState?(ma(s),Rt(s),t0(s,i)):(Rt(s),s.flags&=-16777217):(n.memoizedProps!==c&&ma(s),Rt(s),s.flags&=-16777217),null;case 27:pe(s),i=G.current;var h=s.type;if(n!==null&&s.stateNode!=null)n.memoizedProps!==c&&ma(s);else{if(!c){if(s.stateNode===null)throw Error(o(166));return Rt(s),null}n=ye.current,zi(s)?_v(s):(n=tb(h,c,i),s.stateNode=n,ma(s))}return Rt(s),null;case 5:if(pe(s),i=s.type,n!==null&&s.stateNode!=null)n.memoizedProps!==c&&ma(s);else{if(!c){if(s.stateNode===null)throw Error(o(166));return Rt(s),null}if(n=ye.current,zi(s))_v(s);else{switch(h=uu(G.current),n){case 1:n=h.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:n=h.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":n=h.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":n=h.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":n=h.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof c.is=="string"?h.createElement("select",{is:c.is}):h.createElement("select"),c.multiple?n.multiple=!0:c.size&&(n.size=c.size);break;default:n=typeof c.is=="string"?h.createElement(i,{is:c.is}):h.createElement(i)}}n[Lt]=s,n[hn]=c;e:for(h=s.child;h!==null;){if(h.tag===5||h.tag===6)n.appendChild(h.stateNode);else if(h.tag!==4&&h.tag!==27&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===s)break e;for(;h.sibling===null;){if(h.return===null||h.return===s)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}s.stateNode=n;e:switch(xn(n,i,c),i){case"button":case"input":case"select":case"textarea":n=!!c.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&ma(s)}}return Rt(s),s.flags&=-16777217,null;case 6:if(n&&s.stateNode!=null)n.memoizedProps!==c&&ma(s);else{if(typeof c!="string"&&s.stateNode===null)throw Error(o(166));if(n=G.current,zi(s)){if(n=s.stateNode,i=s.memoizedProps,c=null,h=Cn,h!==null)switch(h.tag){case 27:case 5:c=h.memoizedProps}n[Lt]=s,n=!!(n.nodeValue===i||c!==null&&c.suppressHydrationWarning===!0||G0(n.nodeValue,i)),n||Ds(s)}else n=uu(n).createTextNode(c),n[Lt]=s,s.stateNode=n}return Rt(s),null;case 13:if(c=s.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(h=zi(s),c!==null&&c.dehydrated!==null){if(n===null){if(!h)throw Error(o(318));if(h=s.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(o(317));h[Lt]=s}else Pi(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Rt(s),h=!1}else h=Dv(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=h),h=!0;if(!h)return s.flags&256?(fa(s),s):(fa(s),null)}if(fa(s),(s.flags&128)!==0)return s.lanes=i,s;if(i=c!==null,n=n!==null&&n.memoizedState!==null,i){c=s.child,h=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(h=c.alternate.memoizedState.cachePool.pool);var g=null;c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==h&&(c.flags|=2048)}return i!==n&&i&&(s.child.flags|=8192),Xc(s,s.updateQueue),Rt(s),null;case 4:return Be(),n===null&&mm(s.stateNode.containerInfo),Rt(s),null;case 10:return ua(s.type),Rt(s),null;case 19:if(ge(Jt),h=s.memoizedState,h===null)return Rt(s),null;if(c=(s.flags&128)!==0,g=h.rendering,g===null)if(c)Wi(h,!1);else{if(Ot!==0||n!==null&&(n.flags&128)!==0)for(n=s.child;n!==null;){if(g=Yc(n),g!==null){for(s.flags|=128,Wi(h,!1),n=g.updateQueue,s.updateQueue=n,Xc(s,n),s.subtreeFlags=0,n=i,i=s.child;i!==null;)Rv(i,n),i=i.sibling;return fe(Jt,Jt.current&1|2),s.child}n=n.sibling}h.tail!==null&&Nt()>eu&&(s.flags|=128,c=!0,Wi(h,!1),s.lanes=4194304)}else{if(!c)if(n=Yc(g),n!==null){if(s.flags|=128,c=!0,n=n.updateQueue,s.updateQueue=n,Xc(s,n),Wi(h,!0),h.tail===null&&h.tailMode==="hidden"&&!g.alternate&&!it)return Rt(s),null}else 2*Nt()-h.renderingStartTime>eu&&i!==536870912&&(s.flags|=128,c=!0,Wi(h,!1),s.lanes=4194304);h.isBackwards?(g.sibling=s.child,s.child=g):(n=h.last,n!==null?n.sibling=g:s.child=g,h.last=g)}return h.tail!==null?(s=h.tail,h.rendering=s,h.tail=s.sibling,h.renderingStartTime=Nt(),s.sibling=null,n=Jt.current,fe(Jt,c?n&1|2:n&1),s):(Rt(s),null);case 22:case 23:return fa(s),xh(),c=s.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(s.flags|=8192):c&&(s.flags|=8192),c?(i&536870912)!==0&&(s.flags&128)===0&&(Rt(s),s.subtreeFlags&6&&(s.flags|=8192)):Rt(s),i=s.updateQueue,i!==null&&Xc(s,i.retryQueue),i=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==i&&(s.flags|=2048),n!==null&&ge(Ps),null;case 24:return i=null,n!==null&&(i=n.memoizedState.cache),s.memoizedState.cache!==i&&(s.flags|=2048),ua(Wt),Rt(s),null;case 25:return null;case 30:return null}throw Error(o(156,s.tag))}function b4(n,s){switch(nh(s),s.tag){case 1:return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 3:return ua(Wt),Be(),n=s.flags,(n&65536)!==0&&(n&128)===0?(s.flags=n&-65537|128,s):null;case 26:case 27:case 5:return pe(s),null;case 13:if(fa(s),n=s.memoizedState,n!==null&&n.dehydrated!==null){if(s.alternate===null)throw Error(o(340));Pi()}return n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 19:return ge(Jt),null;case 4:return Be(),null;case 10:return ua(s.type),null;case 22:case 23:return fa(s),xh(),n!==null&&ge(Ps),n=s.flags,n&65536?(s.flags=n&-65537|128,s):null;case 24:return ua(Wt),null;case 25:return null;default:return null}}function n0(n,s){switch(nh(s),s.tag){case 3:ua(Wt),Be();break;case 26:case 27:case 5:pe(s);break;case 4:Be();break;case 13:fa(s);break;case 19:ge(Jt);break;case 10:ua(s.type);break;case 22:case 23:fa(s),xh(),n!==null&&ge(Ps);break;case 24:ua(Wt)}}function Ji(n,s){try{var i=s.updateQueue,c=i!==null?i.lastEffect:null;if(c!==null){var h=c.next;i=h;do{if((i.tag&n)===n){c=void 0;var g=i.create,j=i.inst;c=g(),j.destroy=c}i=i.next}while(i!==h)}}catch(A){bt(s,s.return,A)}}function Va(n,s,i){try{var c=s.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var g=h.next;c=g;do{if((c.tag&n)===n){var j=c.inst,A=j.destroy;if(A!==void 0){j.destroy=void 0,h=s;var D=i,K=A;try{K()}catch(oe){bt(h,D,oe)}}}c=c.next}while(c!==g)}}catch(oe){bt(s,s.return,oe)}}function r0(n){var s=n.updateQueue;if(s!==null){var i=n.stateNode;try{Fv(s,i)}catch(c){bt(n,n.return,c)}}}function a0(n,s,i){i.props=$s(n.type,n.memoizedProps),i.state=n.memoizedState;try{i.componentWillUnmount()}catch(c){bt(n,s,c)}}function el(n,s){try{var i=n.ref;if(i!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:c=n.stateNode;break;default:c=n.stateNode}typeof i=="function"?n.refCleanup=i(c):i.current=c}}catch(h){bt(n,s,h)}}function Br(n,s){var i=n.ref,c=n.refCleanup;if(i!==null)if(typeof c=="function")try{c()}catch(h){bt(n,s,h)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(h){bt(n,s,h)}else i.current=null}function s0(n){var s=n.type,i=n.memoizedProps,c=n.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":i.autoFocus&&c.focus();break e;case"img":i.src?c.src=i.src:i.srcSet&&(c.srcset=i.srcSet)}}catch(h){bt(n,n.return,h)}}function Fh(n,s,i){try{var c=n.stateNode;B4(c,n.type,i,s),c[hn]=s}catch(h){bt(n,n.return,h)}}function o0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Qa(n.type)||n.tag===4}function qh(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||o0(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Qa(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function Yh(n,s,i){var c=n.tag;if(c===5||c===6)n=n.stateNode,s?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(n,s):(s=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,s.appendChild(n),i=i._reactRootContainer,i!=null||s.onclick!==null||(s.onclick=cu));else if(c!==4&&(c===27&&Qa(n.type)&&(i=n.stateNode,s=null),n=n.child,n!==null))for(Yh(n,s,i),n=n.sibling;n!==null;)Yh(n,s,i),n=n.sibling}function Wc(n,s,i){var c=n.tag;if(c===5||c===6)n=n.stateNode,s?i.insertBefore(n,s):i.appendChild(n);else if(c!==4&&(c===27&&Qa(n.type)&&(i=n.stateNode),n=n.child,n!==null))for(Wc(n,s,i),n=n.sibling;n!==null;)Wc(n,s,i),n=n.sibling}function i0(n){var s=n.stateNode,i=n.memoizedProps;try{for(var c=n.type,h=s.attributes;h.length;)s.removeAttributeNode(h[0]);xn(s,c,i),s[Lt]=n,s[hn]=i}catch(g){bt(n,n.return,g)}}var pa=!1,It=!1,Zh=!1,l0=typeof WeakSet=="function"?WeakSet:Set,on=null;function w4(n,s){if(n=n.containerInfo,gm=xu,n=yv(n),qf(n)){if("selectionStart"in n)var i={start:n.selectionStart,end:n.selectionEnd};else e:{i=(i=n.ownerDocument)&&i.defaultView||window;var c=i.getSelection&&i.getSelection();if(c&&c.rangeCount!==0){i=c.anchorNode;var h=c.anchorOffset,g=c.focusNode;c=c.focusOffset;try{i.nodeType,g.nodeType}catch{i=null;break e}var j=0,A=-1,D=-1,K=0,oe=0,ue=n,W=null;t:for(;;){for(var ee;ue!==i||h!==0&&ue.nodeType!==3||(A=j+h),ue!==g||c!==0&&ue.nodeType!==3||(D=j+c),ue.nodeType===3&&(j+=ue.nodeValue.length),(ee=ue.firstChild)!==null;)W=ue,ue=ee;for(;;){if(ue===n)break t;if(W===i&&++K===h&&(A=j),W===g&&++oe===c&&(D=j),(ee=ue.nextSibling)!==null)break;ue=W,W=ue.parentNode}ue=ee}i=A===-1||D===-1?null:{start:A,end:D}}else i=null}i=i||{start:0,end:0}}else i=null;for(vm={focusedElem:n,selectionRange:i},xu=!1,on=s;on!==null;)if(s=on,n=s.child,(s.subtreeFlags&1024)!==0&&n!==null)n.return=s,on=n;else for(;on!==null;){switch(s=on,g=s.alternate,n=s.flags,s.tag){case 0:break;case 11:case 15:break;case 1:if((n&1024)!==0&&g!==null){n=void 0,i=s,h=g.memoizedProps,g=g.memoizedState,c=i.stateNode;try{var Fe=$s(i.type,h,i.elementType===i.type);n=c.getSnapshotBeforeUpdate(Fe,g),c.__reactInternalSnapshotBeforeUpdate=n}catch($e){bt(i,i.return,$e)}}break;case 3:if((n&1024)!==0){if(n=s.stateNode.containerInfo,i=n.nodeType,i===9)wm(n);else if(i===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":wm(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(o(163))}if(n=s.sibling,n!==null){n.return=s.return,on=n;break}on=s.return}}function c0(n,s,i){var c=i.flags;switch(i.tag){case 0:case 11:case 15:Ha(n,i),c&4&&Ji(5,i);break;case 1:if(Ha(n,i),c&4)if(n=i.stateNode,s===null)try{n.componentDidMount()}catch(j){bt(i,i.return,j)}else{var h=$s(i.type,s.memoizedProps);s=s.memoizedState;try{n.componentDidUpdate(h,s,n.__reactInternalSnapshotBeforeUpdate)}catch(j){bt(i,i.return,j)}}c&64&&r0(i),c&512&&el(i,i.return);break;case 3:if(Ha(n,i),c&64&&(n=i.updateQueue,n!==null)){if(s=null,i.child!==null)switch(i.child.tag){case 27:case 5:s=i.child.stateNode;break;case 1:s=i.child.stateNode}try{Fv(n,s)}catch(j){bt(i,i.return,j)}}break;case 27:s===null&&c&4&&i0(i);case 26:case 5:Ha(n,i),s===null&&c&4&&s0(i),c&512&&el(i,i.return);break;case 12:Ha(n,i);break;case 13:Ha(n,i),c&4&&f0(n,i),c&64&&(n=i.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(i=T4.bind(null,i),G4(n,i))));break;case 22:if(c=i.memoizedState!==null||pa,!c){s=s!==null&&s.memoizedState!==null||It,h=pa;var g=It;pa=c,(It=s)&&!g?Fa(n,i,(i.subtreeFlags&8772)!==0):Ha(n,i),pa=h,It=g}break;case 30:break;default:Ha(n,i)}}function u0(n){var s=n.alternate;s!==null&&(n.alternate=null,u0(s)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(s=n.stateNode,s!==null&&Cf(s)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var kt=null,$n=!1;function xa(n,s,i){for(i=i.child;i!==null;)d0(n,s,i),i=i.sibling}function d0(n,s,i){if(Me&&typeof Me.onCommitFiberUnmount=="function")try{Me.onCommitFiberUnmount(Se,i)}catch{}switch(i.tag){case 26:It||Br(i,s),xa(n,s,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:It||Br(i,s);var c=kt,h=$n;Qa(i.type)&&(kt=i.stateNode,$n=!1),xa(n,s,i),cl(i.stateNode),kt=c,$n=h;break;case 5:It||Br(i,s);case 6:if(c=kt,h=$n,kt=null,xa(n,s,i),kt=c,$n=h,kt!==null)if($n)try{(kt.nodeType===9?kt.body:kt.nodeName==="HTML"?kt.ownerDocument.body:kt).removeChild(i.stateNode)}catch(g){bt(i,s,g)}else try{kt.removeChild(i.stateNode)}catch(g){bt(i,s,g)}break;case 18:kt!==null&&($n?(n=kt,J0(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,i.stateNode),gl(n)):J0(kt,i.stateNode));break;case 4:c=kt,h=$n,kt=i.stateNode.containerInfo,$n=!0,xa(n,s,i),kt=c,$n=h;break;case 0:case 11:case 14:case 15:It||Va(2,i,s),It||Va(4,i,s),xa(n,s,i);break;case 1:It||(Br(i,s),c=i.stateNode,typeof c.componentWillUnmount=="function"&&a0(i,s,c)),xa(n,s,i);break;case 21:xa(n,s,i);break;case 22:It=(c=It)||i.memoizedState!==null,xa(n,s,i),It=c;break;default:xa(n,s,i)}}function f0(n,s){if(s.memoizedState===null&&(n=s.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{gl(n)}catch(i){bt(s,s.return,i)}}function j4(n){switch(n.tag){case 13:case 19:var s=n.stateNode;return s===null&&(s=n.stateNode=new l0),s;case 22:return n=n.stateNode,s=n._retryCache,s===null&&(s=n._retryCache=new l0),s;default:throw Error(o(435,n.tag))}}function Gh(n,s){var i=j4(n);s.forEach(function(c){var h=_4.bind(null,n,c);i.has(c)||(i.add(c),c.then(h,h))})}function Zn(n,s){var i=s.deletions;if(i!==null)for(var c=0;c<i.length;c++){var h=i[c],g=n,j=s,A=j;e:for(;A!==null;){switch(A.tag){case 27:if(Qa(A.type)){kt=A.stateNode,$n=!1;break e}break;case 5:kt=A.stateNode,$n=!1;break e;case 3:case 4:kt=A.stateNode.containerInfo,$n=!0;break e}A=A.return}if(kt===null)throw Error(o(160));d0(g,j,h),kt=null,$n=!1,g=h.alternate,g!==null&&(g.return=null),h.return=null}if(s.subtreeFlags&13878)for(s=s.child;s!==null;)h0(s,n),s=s.sibling}var Nr=null;function h0(n,s){var i=n.alternate,c=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:Zn(s,n),Gn(n),c&4&&(Va(3,n,n.return),Ji(3,n),Va(5,n,n.return));break;case 1:Zn(s,n),Gn(n),c&512&&(It||i===null||Br(i,i.return)),c&64&&pa&&(n=n.updateQueue,n!==null&&(c=n.callbacks,c!==null&&(i=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=i===null?c:i.concat(c))));break;case 26:var h=Nr;if(Zn(s,n),Gn(n),c&512&&(It||i===null||Br(i,i.return)),c&4){var g=i!==null?i.memoizedState:null;if(c=n.memoizedState,i===null)if(c===null)if(n.stateNode===null){e:{c=n.type,i=n.memoizedProps,h=h.ownerDocument||h;t:switch(c){case"title":g=h.getElementsByTagName("title")[0],(!g||g[Si]||g[Lt]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=h.createElement(c),h.head.insertBefore(g,h.querySelector("head > title"))),xn(g,c,i),g[Lt]=n,an(g),c=g;break e;case"link":var j=ib("link","href",h).get(c+(i.href||""));if(j){for(var A=0;A<j.length;A++)if(g=j[A],g.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&g.getAttribute("rel")===(i.rel==null?null:i.rel)&&g.getAttribute("title")===(i.title==null?null:i.title)&&g.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){j.splice(A,1);break t}}g=h.createElement(c),xn(g,c,i),h.head.appendChild(g);break;case"meta":if(j=ib("meta","content",h).get(c+(i.content||""))){for(A=0;A<j.length;A++)if(g=j[A],g.getAttribute("content")===(i.content==null?null:""+i.content)&&g.getAttribute("name")===(i.name==null?null:i.name)&&g.getAttribute("property")===(i.property==null?null:i.property)&&g.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&g.getAttribute("charset")===(i.charSet==null?null:i.charSet)){j.splice(A,1);break t}}g=h.createElement(c),xn(g,c,i),h.head.appendChild(g);break;default:throw Error(o(468,c))}g[Lt]=n,an(g),c=g}n.stateNode=c}else lb(h,n.type,n.stateNode);else n.stateNode=ob(h,c,n.memoizedProps);else g!==c?(g===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):g.count--,c===null?lb(h,n.type,n.stateNode):ob(h,c,n.memoizedProps)):c===null&&n.stateNode!==null&&Fh(n,n.memoizedProps,i.memoizedProps)}break;case 27:Zn(s,n),Gn(n),c&512&&(It||i===null||Br(i,i.return)),i!==null&&c&4&&Fh(n,n.memoizedProps,i.memoizedProps);break;case 5:if(Zn(s,n),Gn(n),c&512&&(It||i===null||Br(i,i.return)),n.flags&32){h=n.stateNode;try{xo(h,"")}catch(ee){bt(n,n.return,ee)}}c&4&&n.stateNode!=null&&(h=n.memoizedProps,Fh(n,h,i!==null?i.memoizedProps:h)),c&1024&&(Zh=!0);break;case 6:if(Zn(s,n),Gn(n),c&4){if(n.stateNode===null)throw Error(o(162));c=n.memoizedProps,i=n.stateNode;try{i.nodeValue=c}catch(ee){bt(n,n.return,ee)}}break;case 3:if(hu=null,h=Nr,Nr=du(s.containerInfo),Zn(s,n),Nr=h,Gn(n),c&4&&i!==null&&i.memoizedState.isDehydrated)try{gl(s.containerInfo)}catch(ee){bt(n,n.return,ee)}Zh&&(Zh=!1,m0(n));break;case 4:c=Nr,Nr=du(n.stateNode.containerInfo),Zn(s,n),Gn(n),Nr=c;break;case 12:Zn(s,n),Gn(n);break;case 13:Zn(s,n),Gn(n),n.child.flags&8192&&n.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(em=Nt()),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,Gh(n,c)));break;case 22:h=n.memoizedState!==null;var D=i!==null&&i.memoizedState!==null,K=pa,oe=It;if(pa=K||h,It=oe||D,Zn(s,n),It=oe,pa=K,Gn(n),c&8192)e:for(s=n.stateNode,s._visibility=h?s._visibility&-2:s._visibility|1,h&&(i===null||D||pa||It||Is(n)),i=null,s=n;;){if(s.tag===5||s.tag===26){if(i===null){D=i=s;try{if(g=D.stateNode,h)j=g.style,typeof j.setProperty=="function"?j.setProperty("display","none","important"):j.display="none";else{A=D.stateNode;var ue=D.memoizedProps.style,W=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;A.style.display=W==null||typeof W=="boolean"?"":(""+W).trim()}}catch(ee){bt(D,D.return,ee)}}}else if(s.tag===6){if(i===null){D=s;try{D.stateNode.nodeValue=h?"":D.memoizedProps}catch(ee){bt(D,D.return,ee)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===n)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===n)break e;for(;s.sibling===null;){if(s.return===null||s.return===n)break e;i===s&&(i=null),s=s.return}i===s&&(i=null),s.sibling.return=s.return,s=s.sibling}c&4&&(c=n.updateQueue,c!==null&&(i=c.retryQueue,i!==null&&(c.retryQueue=null,Gh(n,i))));break;case 19:Zn(s,n),Gn(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,Gh(n,c)));break;case 30:break;case 21:break;default:Zn(s,n),Gn(n)}}function Gn(n){var s=n.flags;if(s&2){try{for(var i,c=n.return;c!==null;){if(o0(c)){i=c;break}c=c.return}if(i==null)throw Error(o(160));switch(i.tag){case 27:var h=i.stateNode,g=qh(n);Wc(n,g,h);break;case 5:var j=i.stateNode;i.flags&32&&(xo(j,""),i.flags&=-33);var A=qh(n);Wc(n,A,j);break;case 3:case 4:var D=i.stateNode.containerInfo,K=qh(n);Yh(n,K,D);break;default:throw Error(o(161))}}catch(oe){bt(n,n.return,oe)}n.flags&=-3}s&4096&&(n.flags&=-4097)}function m0(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var s=n;m0(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),n=n.sibling}}function Ha(n,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)c0(n,s.alternate,s),s=s.sibling}function Is(n){for(n=n.child;n!==null;){var s=n;switch(s.tag){case 0:case 11:case 14:case 15:Va(4,s,s.return),Is(s);break;case 1:Br(s,s.return);var i=s.stateNode;typeof i.componentWillUnmount=="function"&&a0(s,s.return,i),Is(s);break;case 27:cl(s.stateNode);case 26:case 5:Br(s,s.return),Is(s);break;case 22:s.memoizedState===null&&Is(s);break;case 30:Is(s);break;default:Is(s)}n=n.sibling}}function Fa(n,s,i){for(i=i&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var c=s.alternate,h=n,g=s,j=g.flags;switch(g.tag){case 0:case 11:case 15:Fa(h,g,i),Ji(4,g);break;case 1:if(Fa(h,g,i),c=g,h=c.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(K){bt(c,c.return,K)}if(c=g,h=c.updateQueue,h!==null){var A=c.stateNode;try{var D=h.shared.hiddenCallbacks;if(D!==null)for(h.shared.hiddenCallbacks=null,h=0;h<D.length;h++)Hv(D[h],A)}catch(K){bt(c,c.return,K)}}i&&j&64&&r0(g),el(g,g.return);break;case 27:i0(g);case 26:case 5:Fa(h,g,i),i&&c===null&&j&4&&s0(g),el(g,g.return);break;case 12:Fa(h,g,i);break;case 13:Fa(h,g,i),i&&j&4&&f0(h,g);break;case 22:g.memoizedState===null&&Fa(h,g,i),el(g,g.return);break;case 30:break;default:Fa(h,g,i)}s=s.sibling}}function Kh(n,s){var i=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),n=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(n=s.memoizedState.cachePool.pool),n!==i&&(n!=null&&n.refCount++,i!=null&&Ii(i))}function Qh(n,s){n=null,s.alternate!==null&&(n=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==n&&(s.refCount++,n!=null&&Ii(n))}function Vr(n,s,i,c){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)p0(n,s,i,c),s=s.sibling}function p0(n,s,i,c){var h=s.flags;switch(s.tag){case 0:case 11:case 15:Vr(n,s,i,c),h&2048&&Ji(9,s);break;case 1:Vr(n,s,i,c);break;case 3:Vr(n,s,i,c),h&2048&&(n=null,s.alternate!==null&&(n=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==n&&(s.refCount++,n!=null&&Ii(n)));break;case 12:if(h&2048){Vr(n,s,i,c),n=s.stateNode;try{var g=s.memoizedProps,j=g.id,A=g.onPostCommit;typeof A=="function"&&A(j,s.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(D){bt(s,s.return,D)}}else Vr(n,s,i,c);break;case 13:Vr(n,s,i,c);break;case 23:break;case 22:g=s.stateNode,j=s.alternate,s.memoizedState!==null?g._visibility&2?Vr(n,s,i,c):tl(n,s):g._visibility&2?Vr(n,s,i,c):(g._visibility|=2,zo(n,s,i,c,(s.subtreeFlags&10256)!==0)),h&2048&&Kh(j,s);break;case 24:Vr(n,s,i,c),h&2048&&Qh(s.alternate,s);break;default:Vr(n,s,i,c)}}function zo(n,s,i,c,h){for(h=h&&(s.subtreeFlags&10256)!==0,s=s.child;s!==null;){var g=n,j=s,A=i,D=c,K=j.flags;switch(j.tag){case 0:case 11:case 15:zo(g,j,A,D,h),Ji(8,j);break;case 23:break;case 22:var oe=j.stateNode;j.memoizedState!==null?oe._visibility&2?zo(g,j,A,D,h):tl(g,j):(oe._visibility|=2,zo(g,j,A,D,h)),h&&K&2048&&Kh(j.alternate,j);break;case 24:zo(g,j,A,D,h),h&&K&2048&&Qh(j.alternate,j);break;default:zo(g,j,A,D,h)}s=s.sibling}}function tl(n,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var i=n,c=s,h=c.flags;switch(c.tag){case 22:tl(i,c),h&2048&&Kh(c.alternate,c);break;case 24:tl(i,c),h&2048&&Qh(c.alternate,c);break;default:tl(i,c)}s=s.sibling}}var nl=8192;function Po(n){if(n.subtreeFlags&nl)for(n=n.child;n!==null;)x0(n),n=n.sibling}function x0(n){switch(n.tag){case 26:Po(n),n.flags&nl&&n.memoizedState!==null&&iR(Nr,n.memoizedState,n.memoizedProps);break;case 5:Po(n);break;case 3:case 4:var s=Nr;Nr=du(n.stateNode.containerInfo),Po(n),Nr=s;break;case 22:n.memoizedState===null&&(s=n.alternate,s!==null&&s.memoizedState!==null?(s=nl,nl=16777216,Po(n),nl=s):Po(n));break;default:Po(n)}}function g0(n){var s=n.alternate;if(s!==null&&(n=s.child,n!==null)){s.child=null;do s=n.sibling,n.sibling=null,n=s;while(n!==null)}}function rl(n){var s=n.deletions;if((n.flags&16)!==0){if(s!==null)for(var i=0;i<s.length;i++){var c=s[i];on=c,y0(c,n)}g0(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)v0(n),n=n.sibling}function v0(n){switch(n.tag){case 0:case 11:case 15:rl(n),n.flags&2048&&Va(9,n,n.return);break;case 3:rl(n);break;case 12:rl(n);break;case 22:var s=n.stateNode;n.memoizedState!==null&&s._visibility&2&&(n.return===null||n.return.tag!==13)?(s._visibility&=-3,Jc(n)):rl(n);break;default:rl(n)}}function Jc(n){var s=n.deletions;if((n.flags&16)!==0){if(s!==null)for(var i=0;i<s.length;i++){var c=s[i];on=c,y0(c,n)}g0(n)}for(n=n.child;n!==null;){switch(s=n,s.tag){case 0:case 11:case 15:Va(8,s,s.return),Jc(s);break;case 22:i=s.stateNode,i._visibility&2&&(i._visibility&=-3,Jc(s));break;default:Jc(s)}n=n.sibling}}function y0(n,s){for(;on!==null;){var i=on;switch(i.tag){case 0:case 11:case 15:Va(8,i,s);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var c=i.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Ii(i.memoizedState.cache)}if(c=i.child,c!==null)c.return=i,on=c;else e:for(i=n;on!==null;){c=on;var h=c.sibling,g=c.return;if(u0(c),c===i){on=null;break e}if(h!==null){h.return=g,on=h;break e}on=g}}}var N4={getCacheForType:function(n){var s=bn(Wt),i=s.data.get(n);return i===void 0&&(i=n(),s.data.set(n,i)),i}},S4=typeof WeakMap=="function"?WeakMap:Map,ct=0,jt=null,Je=null,nt=0,ut=0,Kn=null,qa=!1,Lo=!1,Xh=!1,ga=0,Ot=0,Ya=0,Us=0,Wh=0,hr=0,$o=0,al=null,In=null,Jh=!1,em=0,eu=1/0,tu=null,Za=null,pn=0,Ga=null,Io=null,Uo=0,tm=0,nm=null,b0=null,sl=0,rm=null;function Qn(){if((ct&2)!==0&&nt!==0)return nt&-nt;if(O.T!==null){var n=Eo;return n!==0?n:um()}return Lr()}function w0(){hr===0&&(hr=(nt&536870912)===0||it?Ie():536870912);var n=fr.current;return n!==null&&(n.flags|=32),hr}function Xn(n,s,i){(n===jt&&(ut===2||ut===9)||n.cancelPendingCommit!==null)&&(Bo(n,0),Ka(n,nt,hr,!1)),Xe(n,i),((ct&2)===0||n!==jt)&&(n===jt&&((ct&2)===0&&(Us|=i),Ot===4&&Ka(n,nt,hr,!1)),Hr(n))}function j0(n,s,i){if((ct&6)!==0)throw Error(o(327));var c=!i&&(s&124)===0&&(s&n.expiredLanes)===0||ra(n,s),h=c?E4(n,s):om(n,s,!0),g=c;do{if(h===0){Lo&&!c&&Ka(n,s,0,!1);break}else{if(i=n.current.alternate,g&&!k4(i)){h=om(n,s,!1),g=!1;continue}if(h===2){if(g=s,n.errorRecoveryDisabledLanes&g)var j=0;else j=n.pendingLanes&-536870913,j=j!==0?j:j&536870912?536870912:0;if(j!==0){s=j;e:{var A=n;h=al;var D=A.current.memoizedState.isDehydrated;if(D&&(Bo(A,j).flags|=256),j=om(A,j,!1),j!==2){if(Xh&&!D){A.errorRecoveryDisabledLanes|=g,Us|=g,h=4;break e}g=In,In=h,g!==null&&(In===null?In=g:In.push.apply(In,g))}h=j}if(g=!1,h!==2)continue}}if(h===1){Bo(n,0),Ka(n,s,0,!0);break}e:{switch(c=n,g=h,g){case 0:case 1:throw Error(o(345));case 4:if((s&4194048)!==s)break;case 6:Ka(c,s,hr,!qa);break e;case 2:In=null;break;case 3:case 5:break;default:throw Error(o(329))}if((s&62914560)===s&&(h=em+300-Nt(),10<h)){if(Ka(c,s,hr,!qa),na(c,0,!0)!==0)break e;c.timeoutHandle=X0(N0.bind(null,c,i,In,tu,Jh,s,hr,Us,$o,qa,g,2,-0,0),h);break e}N0(c,i,In,tu,Jh,s,hr,Us,$o,qa,g,0,-0,0)}}break}while(!0);Hr(n)}function N0(n,s,i,c,h,g,j,A,D,K,oe,ue,W,ee){if(n.timeoutHandle=-1,ue=s.subtreeFlags,(ue&8192||(ue&16785408)===16785408)&&(fl={stylesheets:null,count:0,unsuspend:oR},x0(s),ue=lR(),ue!==null)){n.cancelPendingCommit=ue(T0.bind(null,n,s,g,i,c,h,j,A,D,oe,1,W,ee)),Ka(n,g,j,!K);return}T0(n,s,g,i,c,h,j,A,D)}function k4(n){for(var s=n;;){var i=s.tag;if((i===0||i===11||i===15)&&s.flags&16384&&(i=s.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var c=0;c<i.length;c++){var h=i[c],g=h.getSnapshot;h=h.value;try{if(!qn(g(),h))return!1}catch{return!1}}if(i=s.child,s.subtreeFlags&16384&&i!==null)i.return=s,s=i;else{if(s===n)break;for(;s.sibling===null;){if(s.return===null||s.return===n)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Ka(n,s,i,c){s&=~Wh,s&=~Us,n.suspendedLanes|=s,n.pingedLanes&=~s,c&&(n.warmLanes|=s),c=n.expirationTimes;for(var h=s;0<h;){var g=31-at(h),j=1<<g;c[g]=-1,h&=~j}i!==0&&fn(n,i,s)}function nu(){return(ct&6)===0?(ol(0),!1):!0}function am(){if(Je!==null){if(ut===0)var n=Je.return;else n=Je,ca=Os=null,wh(n),Do=null,Qi=0,n=Je;for(;n!==null;)n0(n.alternate,n),n=n.return;Je=null}}function Bo(n,s){var i=n.timeoutHandle;i!==-1&&(n.timeoutHandle=-1,H4(i)),i=n.cancelPendingCommit,i!==null&&(n.cancelPendingCommit=null,i()),am(),jt=n,Je=i=oa(n.current,null),nt=s,ut=0,Kn=null,qa=!1,Lo=ra(n,s),Xh=!1,$o=hr=Wh=Us=Ya=Ot=0,In=al=null,Jh=!1,(s&8)!==0&&(s|=s&32);var c=n.entangledLanes;if(c!==0)for(n=n.entanglements,c&=s;0<c;){var h=31-at(c),g=1<<h;s|=n[h],c&=~g}return ga=s,Sc(),i}function S0(n,s){Ke=null,O.H=Hc,s===Bi||s===Dc?(s=Bv(),ut=3):s===$v?(s=Bv(),ut=4):ut=s===Vy?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Kn=s,Je===null&&(Ot=1,Gc(n,lr(s,n.current)))}function k0(){var n=O.H;return O.H=Hc,n===null?Hc:n}function C0(){var n=O.A;return O.A=N4,n}function sm(){Ot=4,qa||(nt&4194048)!==nt&&fr.current!==null||(Lo=!0),(Ya&134217727)===0&&(Us&134217727)===0||jt===null||Ka(jt,nt,hr,!1)}function om(n,s,i){var c=ct;ct|=2;var h=k0(),g=C0();(jt!==n||nt!==s)&&(tu=null,Bo(n,s)),s=!1;var j=Ot;e:do try{if(ut!==0&&Je!==null){var A=Je,D=Kn;switch(ut){case 8:am(),j=6;break e;case 3:case 2:case 9:case 6:fr.current===null&&(s=!0);var K=ut;if(ut=0,Kn=null,Vo(n,A,D,K),i&&Lo){j=0;break e}break;default:K=ut,ut=0,Kn=null,Vo(n,A,D,K)}}C4(),j=Ot;break}catch(oe){S0(n,oe)}while(!0);return s&&n.shellSuspendCounter++,ca=Os=null,ct=c,O.H=h,O.A=g,Je===null&&(jt=null,nt=0,Sc()),j}function C4(){for(;Je!==null;)E0(Je)}function E4(n,s){var i=ct;ct|=2;var c=k0(),h=C0();jt!==n||nt!==s?(tu=null,eu=Nt()+500,Bo(n,s)):Lo=ra(n,s);e:do try{if(ut!==0&&Je!==null){s=Je;var g=Kn;t:switch(ut){case 1:ut=0,Kn=null,Vo(n,s,g,1);break;case 2:case 9:if(Iv(g)){ut=0,Kn=null,A0(s);break}s=function(){ut!==2&&ut!==9||jt!==n||(ut=7),Hr(n)},g.then(s,s);break e;case 3:ut=7;break e;case 4:ut=5;break e;case 7:Iv(g)?(ut=0,Kn=null,A0(s)):(ut=0,Kn=null,Vo(n,s,g,7));break;case 5:var j=null;switch(Je.tag){case 26:j=Je.memoizedState;case 5:case 27:var A=Je;if(!j||cb(j)){ut=0,Kn=null;var D=A.sibling;if(D!==null)Je=D;else{var K=A.return;K!==null?(Je=K,ru(K)):Je=null}break t}}ut=0,Kn=null,Vo(n,s,g,5);break;case 6:ut=0,Kn=null,Vo(n,s,g,6);break;case 8:am(),Ot=6;break e;default:throw Error(o(462))}}A4();break}catch(oe){S0(n,oe)}while(!0);return ca=Os=null,O.H=c,O.A=h,ct=i,Je!==null?0:(jt=null,nt=0,Sc(),Ot)}function A4(){for(;Je!==null&&!yt();)E0(Je)}function E0(n){var s=e0(n.alternate,n,ga);n.memoizedProps=n.pendingProps,s===null?ru(n):Je=s}function A0(n){var s=n,i=s.alternate;switch(s.tag){case 15:case 0:s=Gy(i,s,s.pendingProps,s.type,void 0,nt);break;case 11:s=Gy(i,s,s.pendingProps,s.type.render,s.ref,nt);break;case 5:wh(s);default:n0(i,s),s=Je=Rv(s,ga),s=e0(i,s,ga)}n.memoizedProps=n.pendingProps,s===null?ru(n):Je=s}function Vo(n,s,i,c){ca=Os=null,wh(s),Do=null,Qi=0;var h=s.return;try{if(g4(n,h,s,i,nt)){Ot=1,Gc(n,lr(i,n.current)),Je=null;return}}catch(g){if(h!==null)throw Je=h,g;Ot=1,Gc(n,lr(i,n.current)),Je=null;return}s.flags&32768?(it||c===1?n=!0:Lo||(nt&536870912)!==0?n=!1:(qa=n=!0,(c===2||c===9||c===3||c===6)&&(c=fr.current,c!==null&&c.tag===13&&(c.flags|=16384))),R0(s,n)):ru(s)}function ru(n){var s=n;do{if((s.flags&32768)!==0){R0(s,qa);return}n=s.return;var i=y4(s.alternate,s,ga);if(i!==null){Je=i;return}if(s=s.sibling,s!==null){Je=s;return}Je=s=n}while(s!==null);Ot===0&&(Ot=5)}function R0(n,s){do{var i=b4(n.alternate,n);if(i!==null){i.flags&=32767,Je=i;return}if(i=n.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!s&&(n=n.sibling,n!==null)){Je=n;return}Je=n=i}while(n!==null);Ot=6,Je=null}function T0(n,s,i,c,h,g,j,A,D){n.cancelPendingCommit=null;do au();while(pn!==0);if((ct&6)!==0)throw Error(o(327));if(s!==null){if(s===n.current)throw Error(o(177));if(g=s.lanes|s.childLanes,g|=Qf,At(n,i,g,j,A,D),n===jt&&(Je=jt=null,nt=0),Io=s,Ga=n,Uo=i,tm=g,nm=h,b0=c,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,M4(Z,function(){return z0(),null})):(n.callbackNode=null,n.callbackPriority=0),c=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||c){c=O.T,O.T=null,h=L.p,L.p=2,j=ct,ct|=4;try{w4(n,s,i)}finally{ct=j,L.p=h,O.T=c}}pn=1,_0(),M0(),D0()}}function _0(){if(pn===1){pn=0;var n=Ga,s=Io,i=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||i){i=O.T,O.T=null;var c=L.p;L.p=2;var h=ct;ct|=4;try{h0(s,n);var g=vm,j=yv(n.containerInfo),A=g.focusedElem,D=g.selectionRange;if(j!==A&&A&&A.ownerDocument&&vv(A.ownerDocument.documentElement,A)){if(D!==null&&qf(A)){var K=D.start,oe=D.end;if(oe===void 0&&(oe=K),"selectionStart"in A)A.selectionStart=K,A.selectionEnd=Math.min(oe,A.value.length);else{var ue=A.ownerDocument||document,W=ue&&ue.defaultView||window;if(W.getSelection){var ee=W.getSelection(),Fe=A.textContent.length,$e=Math.min(D.start,Fe),xt=D.end===void 0?$e:Math.min(D.end,Fe);!ee.extend&&$e>xt&&(j=xt,xt=$e,$e=j);var H=gv(A,$e),I=gv(A,xt);if(H&&I&&(ee.rangeCount!==1||ee.anchorNode!==H.node||ee.anchorOffset!==H.offset||ee.focusNode!==I.node||ee.focusOffset!==I.offset)){var Y=ue.createRange();Y.setStart(H.node,H.offset),ee.removeAllRanges(),$e>xt?(ee.addRange(Y),ee.extend(I.node,I.offset)):(Y.setEnd(I.node,I.offset),ee.addRange(Y))}}}}for(ue=[],ee=A;ee=ee.parentNode;)ee.nodeType===1&&ue.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<ue.length;A++){var le=ue[A];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}xu=!!gm,vm=gm=null}finally{ct=h,L.p=c,O.T=i}}n.current=s,pn=2}}function M0(){if(pn===2){pn=0;var n=Ga,s=Io,i=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||i){i=O.T,O.T=null;var c=L.p;L.p=2;var h=ct;ct|=4;try{c0(n,s.alternate,s)}finally{ct=h,L.p=c,O.T=i}}pn=3}}function D0(){if(pn===4||pn===3){pn=0,Pt();var n=Ga,s=Io,i=Uo,c=b0;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?pn=5:(pn=0,Io=Ga=null,O0(n,n.pendingLanes));var h=n.pendingLanes;if(h===0&&(Za=null),kn(i),s=s.stateNode,Me&&typeof Me.onCommitFiberRoot=="function")try{Me.onCommitFiberRoot(Se,s,void 0,(s.current.flags&128)===128)}catch{}if(c!==null){s=O.T,h=L.p,L.p=2,O.T=null;try{for(var g=n.onRecoverableError,j=0;j<c.length;j++){var A=c[j];g(A.value,{componentStack:A.stack})}}finally{O.T=s,L.p=h}}(Uo&3)!==0&&au(),Hr(n),h=n.pendingLanes,(i&4194090)!==0&&(h&42)!==0?n===rm?sl++:(sl=0,rm=n):sl=0,ol(0)}}function O0(n,s){(n.pooledCacheLanes&=s)===0&&(s=n.pooledCache,s!=null&&(n.pooledCache=null,Ii(s)))}function au(n){return _0(),M0(),D0(),z0()}function z0(){if(pn!==5)return!1;var n=Ga,s=tm;tm=0;var i=kn(Uo),c=O.T,h=L.p;try{L.p=32>i?32:i,O.T=null,i=nm,nm=null;var g=Ga,j=Uo;if(pn=0,Io=Ga=null,Uo=0,(ct&6)!==0)throw Error(o(331));var A=ct;if(ct|=4,v0(g.current),p0(g,g.current,j,i),ct=A,ol(0,!1),Me&&typeof Me.onPostCommitFiberRoot=="function")try{Me.onPostCommitFiberRoot(Se,g)}catch{}return!0}finally{L.p=h,O.T=c,O0(n,s)}}function P0(n,s,i){s=lr(i,s),s=zh(n.stateNode,s,2),n=$a(n,s,2),n!==null&&(Xe(n,2),Hr(n))}function bt(n,s,i){if(n.tag===3)P0(n,n,i);else for(;s!==null;){if(s.tag===3){P0(s,n,i);break}else if(s.tag===1){var c=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(Za===null||!Za.has(c))){n=lr(i,n),i=Uy(2),c=$a(s,i,2),c!==null&&(By(i,c,s,n),Xe(c,2),Hr(c));break}}s=s.return}}function im(n,s,i){var c=n.pingCache;if(c===null){c=n.pingCache=new S4;var h=new Set;c.set(s,h)}else h=c.get(s),h===void 0&&(h=new Set,c.set(s,h));h.has(i)||(Xh=!0,h.add(i),n=R4.bind(null,n,s,i),s.then(n,n))}function R4(n,s,i){var c=n.pingCache;c!==null&&c.delete(s),n.pingedLanes|=n.suspendedLanes&i,n.warmLanes&=~i,jt===n&&(nt&i)===i&&(Ot===4||Ot===3&&(nt&62914560)===nt&&300>Nt()-em?(ct&2)===0&&Bo(n,0):Wh|=i,$o===nt&&($o=0)),Hr(n)}function L0(n,s){s===0&&(s=st()),n=No(n,s),n!==null&&(Xe(n,s),Hr(n))}function T4(n){var s=n.memoizedState,i=0;s!==null&&(i=s.retryLane),L0(n,i)}function _4(n,s){var i=0;switch(n.tag){case 13:var c=n.stateNode,h=n.memoizedState;h!==null&&(i=h.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(o(314))}c!==null&&c.delete(s),L0(n,i)}function M4(n,s){return Ye(n,s)}var su=null,Ho=null,lm=!1,ou=!1,cm=!1,Bs=0;function Hr(n){n!==Ho&&n.next===null&&(Ho===null?su=Ho=n:Ho=Ho.next=n),ou=!0,lm||(lm=!0,O4())}function ol(n,s){if(!cm&&ou){cm=!0;do for(var i=!1,c=su;c!==null;){if(n!==0){var h=c.pendingLanes;if(h===0)var g=0;else{var j=c.suspendedLanes,A=c.pingedLanes;g=(1<<31-at(42|n)+1)-1,g&=h&~(j&~A),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(i=!0,B0(c,g))}else g=nt,g=na(c,c===jt?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(g&3)===0||ra(c,g)||(i=!0,B0(c,g));c=c.next}while(i);cm=!1}}function D4(){$0()}function $0(){ou=lm=!1;var n=0;Bs!==0&&(V4()&&(n=Bs),Bs=0);for(var s=Nt(),i=null,c=su;c!==null;){var h=c.next,g=I0(c,s);g===0?(c.next=null,i===null?su=h:i.next=h,h===null&&(Ho=i)):(i=c,(n!==0||(g&3)!==0)&&(ou=!0)),c=h}ol(n)}function I0(n,s){for(var i=n.suspendedLanes,c=n.pingedLanes,h=n.expirationTimes,g=n.pendingLanes&-62914561;0<g;){var j=31-at(g),A=1<<j,D=h[j];D===-1?((A&i)===0||(A&c)!==0)&&(h[j]=io(A,s)):D<=s&&(n.expiredLanes|=A),g&=~A}if(s=jt,i=nt,i=na(n,n===s?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c=n.callbackNode,i===0||n===s&&(ut===2||ut===9)||n.cancelPendingCommit!==null)return c!==null&&c!==null&&Ae(c),n.callbackNode=null,n.callbackPriority=0;if((i&3)===0||ra(n,i)){if(s=i&-i,s===n.callbackPriority)return s;switch(c!==null&&Ae(c),kn(i)){case 2:case 8:i=P;break;case 32:i=Z;break;case 268435456:i=Ne;break;default:i=Z}return c=U0.bind(null,n),i=Ye(i,c),n.callbackPriority=s,n.callbackNode=i,s}return c!==null&&c!==null&&Ae(c),n.callbackPriority=2,n.callbackNode=null,2}function U0(n,s){if(pn!==0&&pn!==5)return n.callbackNode=null,n.callbackPriority=0,null;var i=n.callbackNode;if(au()&&n.callbackNode!==i)return null;var c=nt;return c=na(n,n===jt?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c===0?null:(j0(n,c,s),I0(n,Nt()),n.callbackNode!=null&&n.callbackNode===i?U0.bind(null,n):null)}function B0(n,s){if(au())return null;j0(n,s,!0)}function O4(){F4(function(){(ct&6)!==0?Ye(zr,D4):$0()})}function um(){return Bs===0&&(Bs=Ie()),Bs}function V0(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:gc(""+n)}function H0(n,s){var i=s.ownerDocument.createElement("input");return i.name=s.name,i.value=s.value,n.id&&i.setAttribute("form",n.id),s.parentNode.insertBefore(i,s),n=new FormData(n),i.parentNode.removeChild(i),n}function z4(n,s,i,c,h){if(s==="submit"&&i&&i.stateNode===h){var g=V0((h[hn]||null).action),j=c.submitter;j&&(s=(s=j[hn]||null)?V0(s.formAction):j.getAttribute("formAction"),s!==null&&(g=s,j=null));var A=new wc("action","action",null,c,h);n.push({event:A,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(Bs!==0){var D=j?H0(h,j):new FormData(h);Th(i,{pending:!0,data:D,method:h.method,action:g},null,D)}}else typeof g=="function"&&(A.preventDefault(),D=j?H0(h,j):new FormData(h),Th(i,{pending:!0,data:D,method:h.method,action:g},g,D))},currentTarget:h}]})}}for(var dm=0;dm<Kf.length;dm++){var fm=Kf[dm],P4=fm.toLowerCase(),L4=fm[0].toUpperCase()+fm.slice(1);jr(P4,"on"+L4)}jr(jv,"onAnimationEnd"),jr(Nv,"onAnimationIteration"),jr(Sv,"onAnimationStart"),jr("dblclick","onDoubleClick"),jr("focusin","onFocus"),jr("focusout","onBlur"),jr(e4,"onTransitionRun"),jr(t4,"onTransitionStart"),jr(n4,"onTransitionCancel"),jr(kv,"onTransitionEnd"),ho("onMouseEnter",["mouseout","mouseover"]),ho("onMouseLeave",["mouseout","mouseover"]),ho("onPointerEnter",["pointerout","pointerover"]),ho("onPointerLeave",["pointerout","pointerover"]),ks("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ks("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ks("onBeforeInput",["compositionend","keypress","textInput","paste"]),ks("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ks("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ks("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var il="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(" "),$4=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(il));function F0(n,s){s=(s&4)!==0;for(var i=0;i<n.length;i++){var c=n[i],h=c.event;c=c.listeners;e:{var g=void 0;if(s)for(var j=c.length-1;0<=j;j--){var A=c[j],D=A.instance,K=A.currentTarget;if(A=A.listener,D!==g&&h.isPropagationStopped())break e;g=A,h.currentTarget=K;try{g(h)}catch(oe){Zc(oe)}h.currentTarget=null,g=D}else for(j=0;j<c.length;j++){if(A=c[j],D=A.instance,K=A.currentTarget,A=A.listener,D!==g&&h.isPropagationStopped())break e;g=A,h.currentTarget=K;try{g(h)}catch(oe){Zc(oe)}h.currentTarget=null,g=D}}}}function et(n,s){var i=s[kf];i===void 0&&(i=s[kf]=new Set);var c=n+"__bubble";i.has(c)||(q0(s,n,2,!1),i.add(c))}function hm(n,s,i){var c=0;s&&(c|=4),q0(i,n,c,s)}var iu="_reactListening"+Math.random().toString(36).slice(2);function mm(n){if(!n[iu]){n[iu]=!0,$g.forEach(function(i){i!=="selectionchange"&&($4.has(i)||hm(i,!1,n),hm(i,!0,n))});var s=n.nodeType===9?n:n.ownerDocument;s===null||s[iu]||(s[iu]=!0,hm("selectionchange",!1,s))}}function q0(n,s,i,c){switch(pb(s)){case 2:var h=dR;break;case 8:h=fR;break;default:h=Am}i=h.bind(null,s,i,n),h=void 0,!Pf||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(h=!0),c?h!==void 0?n.addEventListener(s,i,{capture:!0,passive:h}):n.addEventListener(s,i,!0):h!==void 0?n.addEventListener(s,i,{passive:h}):n.addEventListener(s,i,!1)}function pm(n,s,i,c,h){var g=c;if((s&1)===0&&(s&2)===0&&c!==null)e:for(;;){if(c===null)return;var j=c.tag;if(j===3||j===4){var A=c.stateNode.containerInfo;if(A===h)break;if(j===4)for(j=c.return;j!==null;){var D=j.tag;if((D===3||D===4)&&j.stateNode.containerInfo===h)return;j=j.return}for(;A!==null;){if(j=co(A),j===null)return;if(D=j.tag,D===5||D===6||D===26||D===27){c=g=j;continue e}A=A.parentNode}}c=c.return}Wg(function(){var K=g,oe=Of(i),ue=[];e:{var W=Cv.get(n);if(W!==void 0){var ee=wc,Fe=n;switch(n){case"keypress":if(yc(i)===0)break e;case"keydown":case"keyup":ee=MA;break;case"focusin":Fe="focus",ee=Uf;break;case"focusout":Fe="blur",ee=Uf;break;case"beforeblur":case"afterblur":ee=Uf;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=tv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=bA;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=zA;break;case jv:case Nv:case Sv:ee=NA;break;case kv:ee=LA;break;case"scroll":case"scrollend":ee=vA;break;case"wheel":ee=IA;break;case"copy":case"cut":case"paste":ee=kA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=rv;break;case"toggle":case"beforetoggle":ee=BA}var $e=(s&4)!==0,xt=!$e&&(n==="scroll"||n==="scrollend"),H=$e?W!==null?W+"Capture":null:W;$e=[];for(var I=K,Y;I!==null;){var le=I;if(Y=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||Y===null||H===null||(le=Ci(I,H),le!=null&&$e.push(ll(I,le,Y))),xt)break;I=I.return}0<$e.length&&(W=new ee(W,Fe,null,i,oe),ue.push({event:W,listeners:$e}))}}if((s&7)===0){e:{if(W=n==="mouseover"||n==="pointerover",ee=n==="mouseout"||n==="pointerout",W&&i!==Df&&(Fe=i.relatedTarget||i.fromElement)&&(co(Fe)||Fe[lo]))break e;if((ee||W)&&(W=oe.window===oe?oe:(W=oe.ownerDocument)?W.defaultView||W.parentWindow:window,ee?(Fe=i.relatedTarget||i.toElement,ee=K,Fe=Fe?co(Fe):null,Fe!==null&&(xt=u(Fe),$e=Fe.tag,Fe!==xt||$e!==5&&$e!==27&&$e!==6)&&(Fe=null)):(ee=null,Fe=K),ee!==Fe)){if($e=tv,le="onMouseLeave",H="onMouseEnter",I="mouse",(n==="pointerout"||n==="pointerover")&&($e=rv,le="onPointerLeave",H="onPointerEnter",I="pointer"),xt=ee==null?W:ki(ee),Y=Fe==null?W:ki(Fe),W=new $e(le,I+"leave",ee,i,oe),W.target=xt,W.relatedTarget=Y,le=null,co(oe)===K&&($e=new $e(H,I+"enter",Fe,i,oe),$e.target=Y,$e.relatedTarget=xt,le=$e),xt=le,ee&&Fe)t:{for($e=ee,H=Fe,I=0,Y=$e;Y;Y=Fo(Y))I++;for(Y=0,le=H;le;le=Fo(le))Y++;for(;0<I-Y;)$e=Fo($e),I--;for(;0<Y-I;)H=Fo(H),Y--;for(;I--;){if($e===H||H!==null&&$e===H.alternate)break t;$e=Fo($e),H=Fo(H)}$e=null}else $e=null;ee!==null&&Y0(ue,W,ee,$e,!1),Fe!==null&&xt!==null&&Y0(ue,xt,Fe,$e,!0)}}e:{if(W=K?ki(K):window,ee=W.nodeName&&W.nodeName.toLowerCase(),ee==="select"||ee==="input"&&W.type==="file")var Te=dv;else if(cv(W))if(fv)Te=XA;else{Te=KA;var We=GA}else ee=W.nodeName,!ee||ee.toLowerCase()!=="input"||W.type!=="checkbox"&&W.type!=="radio"?K&&Mf(K.elementType)&&(Te=dv):Te=QA;if(Te&&(Te=Te(n,K))){uv(ue,Te,i,oe);break e}We&&We(n,W,K),n==="focusout"&&K&&W.type==="number"&&K.memoizedProps.value!=null&&_f(W,"number",W.value)}switch(We=K?ki(K):window,n){case"focusin":(cv(We)||We.contentEditable==="true")&&(bo=We,Yf=K,Oi=null);break;case"focusout":Oi=Yf=bo=null;break;case"mousedown":Zf=!0;break;case"contextmenu":case"mouseup":case"dragend":Zf=!1,bv(ue,i,oe);break;case"selectionchange":if(JA)break;case"keydown":case"keyup":bv(ue,i,oe)}var De;if(Vf)e:{switch(n){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else yo?iv(n,i)&&(Ue="onCompositionEnd"):n==="keydown"&&i.keyCode===229&&(Ue="onCompositionStart");Ue&&(av&&i.locale!=="ko"&&(yo||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&yo&&(De=Jg()):(Oa=oe,Lf="value"in Oa?Oa.value:Oa.textContent,yo=!0)),We=lu(K,Ue),0<We.length&&(Ue=new nv(Ue,n,null,i,oe),ue.push({event:Ue,listeners:We}),De?Ue.data=De:(De=lv(i),De!==null&&(Ue.data=De)))),(De=HA?FA(n,i):qA(n,i))&&(Ue=lu(K,"onBeforeInput"),0<Ue.length&&(We=new nv("onBeforeInput","beforeinput",null,i,oe),ue.push({event:We,listeners:Ue}),We.data=De)),z4(ue,n,K,i,oe)}F0(ue,s)})}function ll(n,s,i){return{instance:n,listener:s,currentTarget:i}}function lu(n,s){for(var i=s+"Capture",c=[];n!==null;){var h=n,g=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||g===null||(h=Ci(n,i),h!=null&&c.unshift(ll(n,h,g)),h=Ci(n,s),h!=null&&c.push(ll(n,h,g))),n.tag===3)return c;n=n.return}return[]}function Fo(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function Y0(n,s,i,c,h){for(var g=s._reactName,j=[];i!==null&&i!==c;){var A=i,D=A.alternate,K=A.stateNode;if(A=A.tag,D!==null&&D===c)break;A!==5&&A!==26&&A!==27||K===null||(D=K,h?(K=Ci(i,g),K!=null&&j.unshift(ll(i,K,D))):h||(K=Ci(i,g),K!=null&&j.push(ll(i,K,D)))),i=i.return}j.length!==0&&n.push({event:s,listeners:j})}var I4=/\r\n?/g,U4=/\u0000|\uFFFD/g;function Z0(n){return(typeof n=="string"?n:""+n).replace(I4,`
|
||
`).replace(U4,"")}function G0(n,s){return s=Z0(s),Z0(n)===s}function cu(){}function pt(n,s,i,c,h,g){switch(i){case"children":typeof c=="string"?s==="body"||s==="textarea"&&c===""||xo(n,c):(typeof c=="number"||typeof c=="bigint")&&s!=="body"&&xo(n,""+c);break;case"className":mc(n,"class",c);break;case"tabIndex":mc(n,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":mc(n,i,c);break;case"style":Qg(n,c,g);break;case"data":if(s!=="object"){mc(n,"data",c);break}case"src":case"href":if(c===""&&(s!=="a"||i!=="href")){n.removeAttribute(i);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(i);break}c=gc(""+c),n.setAttribute(i,c);break;case"action":case"formAction":if(typeof c=="function"){n.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof g=="function"&&(i==="formAction"?(s!=="input"&&pt(n,s,"name",h.name,h,null),pt(n,s,"formEncType",h.formEncType,h,null),pt(n,s,"formMethod",h.formMethod,h,null),pt(n,s,"formTarget",h.formTarget,h,null)):(pt(n,s,"encType",h.encType,h,null),pt(n,s,"method",h.method,h,null),pt(n,s,"target",h.target,h,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(i);break}c=gc(""+c),n.setAttribute(i,c);break;case"onClick":c!=null&&(n.onclick=cu);break;case"onScroll":c!=null&&et("scroll",n);break;case"onScrollEnd":c!=null&&et("scrollend",n);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(o(61));if(i=c.__html,i!=null){if(h.children!=null)throw Error(o(60));n.innerHTML=i}}break;case"multiple":n.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":n.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){n.removeAttribute("xlink:href");break}i=gc(""+c),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(i,""+c):n.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(i,""):n.removeAttribute(i);break;case"capture":case"download":c===!0?n.setAttribute(i,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(i,c):n.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?n.setAttribute(i,c):n.removeAttribute(i);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?n.removeAttribute(i):n.setAttribute(i,c);break;case"popover":et("beforetoggle",n),et("toggle",n),hc(n,"popover",c);break;case"xlinkActuate":aa(n,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":aa(n,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":aa(n,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":aa(n,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":aa(n,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":aa(n,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":aa(n,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":aa(n,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":aa(n,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":hc(n,"is",c);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=xA.get(i)||i,hc(n,i,c))}}function xm(n,s,i,c,h,g){switch(i){case"style":Qg(n,c,g);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(o(61));if(i=c.__html,i!=null){if(h.children!=null)throw Error(o(60));n.innerHTML=i}}break;case"children":typeof c=="string"?xo(n,c):(typeof c=="number"||typeof c=="bigint")&&xo(n,""+c);break;case"onScroll":c!=null&&et("scroll",n);break;case"onScrollEnd":c!=null&&et("scrollend",n);break;case"onClick":c!=null&&(n.onclick=cu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ig.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(h=i.endsWith("Capture"),s=i.slice(2,h?i.length-7:void 0),g=n[hn]||null,g=g!=null?g[i]:null,typeof g=="function"&&n.removeEventListener(s,g,h),typeof c=="function")){typeof g!="function"&&g!==null&&(i in n?n[i]=null:n.hasAttribute(i)&&n.removeAttribute(i)),n.addEventListener(s,c,h);break e}i in n?n[i]=c:c===!0?n.setAttribute(i,""):hc(n,i,c)}}}function xn(n,s,i){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":et("error",n),et("load",n);var c=!1,h=!1,g;for(g in i)if(i.hasOwnProperty(g)){var j=i[g];if(j!=null)switch(g){case"src":c=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,s));default:pt(n,s,g,j,i,null)}}h&&pt(n,s,"srcSet",i.srcSet,i,null),c&&pt(n,s,"src",i.src,i,null);return;case"input":et("invalid",n);var A=g=j=h=null,D=null,K=null;for(c in i)if(i.hasOwnProperty(c)){var oe=i[c];if(oe!=null)switch(c){case"name":h=oe;break;case"type":j=oe;break;case"checked":D=oe;break;case"defaultChecked":K=oe;break;case"value":g=oe;break;case"defaultValue":A=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(o(137,s));break;default:pt(n,s,c,oe,i,null)}}Yg(n,g,A,D,K,j,h,!1),pc(n);return;case"select":et("invalid",n),c=j=g=null;for(h in i)if(i.hasOwnProperty(h)&&(A=i[h],A!=null))switch(h){case"value":g=A;break;case"defaultValue":j=A;break;case"multiple":c=A;default:pt(n,s,h,A,i,null)}s=g,i=j,n.multiple=!!c,s!=null?po(n,!!c,s,!1):i!=null&&po(n,!!c,i,!0);return;case"textarea":et("invalid",n),g=h=c=null;for(j in i)if(i.hasOwnProperty(j)&&(A=i[j],A!=null))switch(j){case"value":c=A;break;case"defaultValue":h=A;break;case"children":g=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(o(91));break;default:pt(n,s,j,A,i,null)}Gg(n,c,h,g),pc(n);return;case"option":for(D in i)if(i.hasOwnProperty(D)&&(c=i[D],c!=null))switch(D){case"selected":n.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:pt(n,s,D,c,i,null)}return;case"dialog":et("beforetoggle",n),et("toggle",n),et("cancel",n),et("close",n);break;case"iframe":case"object":et("load",n);break;case"video":case"audio":for(c=0;c<il.length;c++)et(il[c],n);break;case"image":et("error",n),et("load",n);break;case"details":et("toggle",n);break;case"embed":case"source":case"link":et("error",n),et("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(K in i)if(i.hasOwnProperty(K)&&(c=i[K],c!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,s));default:pt(n,s,K,c,i,null)}return;default:if(Mf(s)){for(oe in i)i.hasOwnProperty(oe)&&(c=i[oe],c!==void 0&&xm(n,s,oe,c,i,void 0));return}}for(A in i)i.hasOwnProperty(A)&&(c=i[A],c!=null&&pt(n,s,A,c,i,null))}function B4(n,s,i,c){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,g=null,j=null,A=null,D=null,K=null,oe=null;for(ee in i){var ue=i[ee];if(i.hasOwnProperty(ee)&&ue!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":D=ue;default:c.hasOwnProperty(ee)||pt(n,s,ee,null,c,ue)}}for(var W in c){var ee=c[W];if(ue=i[W],c.hasOwnProperty(W)&&(ee!=null||ue!=null))switch(W){case"type":g=ee;break;case"name":h=ee;break;case"checked":K=ee;break;case"defaultChecked":oe=ee;break;case"value":j=ee;break;case"defaultValue":A=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(o(137,s));break;default:ee!==ue&&pt(n,s,W,ee,c,ue)}}Tf(n,j,A,D,K,oe,g,h);return;case"select":ee=j=A=W=null;for(g in i)if(D=i[g],i.hasOwnProperty(g)&&D!=null)switch(g){case"value":break;case"multiple":ee=D;default:c.hasOwnProperty(g)||pt(n,s,g,null,c,D)}for(h in c)if(g=c[h],D=i[h],c.hasOwnProperty(h)&&(g!=null||D!=null))switch(h){case"value":W=g;break;case"defaultValue":A=g;break;case"multiple":j=g;default:g!==D&&pt(n,s,h,g,c,D)}s=A,i=j,c=ee,W!=null?po(n,!!i,W,!1):!!c!=!!i&&(s!=null?po(n,!!i,s,!0):po(n,!!i,i?[]:"",!1));return;case"textarea":ee=W=null;for(A in i)if(h=i[A],i.hasOwnProperty(A)&&h!=null&&!c.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:pt(n,s,A,null,c,h)}for(j in c)if(h=c[j],g=i[j],c.hasOwnProperty(j)&&(h!=null||g!=null))switch(j){case"value":W=h;break;case"defaultValue":ee=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(o(91));break;default:h!==g&&pt(n,s,j,h,c,g)}Zg(n,W,ee);return;case"option":for(var Fe in i)if(W=i[Fe],i.hasOwnProperty(Fe)&&W!=null&&!c.hasOwnProperty(Fe))switch(Fe){case"selected":n.selected=!1;break;default:pt(n,s,Fe,null,c,W)}for(D in c)if(W=c[D],ee=i[D],c.hasOwnProperty(D)&&W!==ee&&(W!=null||ee!=null))switch(D){case"selected":n.selected=W&&typeof W!="function"&&typeof W!="symbol";break;default:pt(n,s,D,W,c,ee)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var $e in i)W=i[$e],i.hasOwnProperty($e)&&W!=null&&!c.hasOwnProperty($e)&&pt(n,s,$e,null,c,W);for(K in c)if(W=c[K],ee=i[K],c.hasOwnProperty(K)&&W!==ee&&(W!=null||ee!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(o(137,s));break;default:pt(n,s,K,W,c,ee)}return;default:if(Mf(s)){for(var xt in i)W=i[xt],i.hasOwnProperty(xt)&&W!==void 0&&!c.hasOwnProperty(xt)&&xm(n,s,xt,void 0,c,W);for(oe in c)W=c[oe],ee=i[oe],!c.hasOwnProperty(oe)||W===ee||W===void 0&&ee===void 0||xm(n,s,oe,W,c,ee);return}}for(var H in i)W=i[H],i.hasOwnProperty(H)&&W!=null&&!c.hasOwnProperty(H)&&pt(n,s,H,null,c,W);for(ue in c)W=c[ue],ee=i[ue],!c.hasOwnProperty(ue)||W===ee||W==null&&ee==null||pt(n,s,ue,W,c,ee)}var gm=null,vm=null;function uu(n){return n.nodeType===9?n:n.ownerDocument}function K0(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Q0(n,s){if(n===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&s==="foreignObject"?0:n}function ym(n,s){return n==="textarea"||n==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var bm=null;function V4(){var n=window.event;return n&&n.type==="popstate"?n===bm?!1:(bm=n,!0):(bm=null,!1)}var X0=typeof setTimeout=="function"?setTimeout:void 0,H4=typeof clearTimeout=="function"?clearTimeout:void 0,W0=typeof Promise=="function"?Promise:void 0,F4=typeof queueMicrotask=="function"?queueMicrotask:typeof W0<"u"?function(n){return W0.resolve(null).then(n).catch(q4)}:X0;function q4(n){setTimeout(function(){throw n})}function Qa(n){return n==="head"}function J0(n,s){var i=s,c=0,h=0;do{var g=i.nextSibling;if(n.removeChild(i),g&&g.nodeType===8)if(i=g.data,i==="/$"){if(0<c&&8>c){i=c;var j=n.ownerDocument;if(i&1&&cl(j.documentElement),i&2&&cl(j.body),i&4)for(i=j.head,cl(i),j=i.firstChild;j;){var A=j.nextSibling,D=j.nodeName;j[Si]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&j.rel.toLowerCase()==="stylesheet"||i.removeChild(j),j=A}}if(h===0){n.removeChild(g),gl(s);return}h--}else i==="$"||i==="$?"||i==="$!"?h++:c=i.charCodeAt(0)-48;else c=0;i=g}while(i);gl(s)}function wm(n){var s=n.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var i=s;switch(s=s.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":wm(i),Cf(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}n.removeChild(i)}}function Y4(n,s,i,c){for(;n.nodeType===1;){var h=i;if(n.nodeName.toLowerCase()!==s.toLowerCase()){if(!c&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(c){if(!n[Si])switch(s){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(g=n.getAttribute("rel"),g==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(g!==h.rel||n.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||n.getAttribute("title")!==(h.title==null?null:h.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(g=n.getAttribute("src"),(g!==(h.src==null?null:h.src)||n.getAttribute("type")!==(h.type==null?null:h.type)||n.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&g&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(s==="input"&&n.type==="hidden"){var g=h.name==null?null:""+h.name;if(h.type==="hidden"&&n.getAttribute("name")===g)return n}else return n;if(n=Sr(n.nextSibling),n===null)break}return null}function Z4(n,s,i){if(s==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=Sr(n.nextSibling),n===null))return null;return n}function jm(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState==="complete"}function G4(n,s){var i=n.ownerDocument;if(n.data!=="$?"||i.readyState==="complete")s();else{var c=function(){s(),i.removeEventListener("DOMContentLoaded",c)};i.addEventListener("DOMContentLoaded",c),n._reactRetry=c}}function Sr(n){for(;n!=null;n=n.nextSibling){var s=n.nodeType;if(s===1||s===3)break;if(s===8){if(s=n.data,s==="$"||s==="$!"||s==="$?"||s==="F!"||s==="F")break;if(s==="/$")return null}}return n}var Nm=null;function eb(n){n=n.previousSibling;for(var s=0;n;){if(n.nodeType===8){var i=n.data;if(i==="$"||i==="$!"||i==="$?"){if(s===0)return n;s--}else i==="/$"&&s++}n=n.previousSibling}return null}function tb(n,s,i){switch(s=uu(i),n){case"html":if(n=s.documentElement,!n)throw Error(o(452));return n;case"head":if(n=s.head,!n)throw Error(o(453));return n;case"body":if(n=s.body,!n)throw Error(o(454));return n;default:throw Error(o(451))}}function cl(n){for(var s=n.attributes;s.length;)n.removeAttributeNode(s[0]);Cf(n)}var mr=new Map,nb=new Set;function du(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var va=L.d;L.d={f:K4,r:Q4,D:X4,C:W4,L:J4,m:eR,X:nR,S:tR,M:rR};function K4(){var n=va.f(),s=nu();return n||s}function Q4(n){var s=uo(n);s!==null&&s.tag===5&&s.type==="form"?jy(s):va.r(n)}var qo=typeof document>"u"?null:document;function rb(n,s,i){var c=qo;if(c&&typeof s=="string"&&s){var h=ir(s);h='link[rel="'+n+'"][href="'+h+'"]',typeof i=="string"&&(h+='[crossorigin="'+i+'"]'),nb.has(h)||(nb.add(h),n={rel:n,crossOrigin:i,href:s},c.querySelector(h)===null&&(s=c.createElement("link"),xn(s,"link",n),an(s),c.head.appendChild(s)))}}function X4(n){va.D(n),rb("dns-prefetch",n,null)}function W4(n,s){va.C(n,s),rb("preconnect",n,s)}function J4(n,s,i){va.L(n,s,i);var c=qo;if(c&&n&&s){var h='link[rel="preload"][as="'+ir(s)+'"]';s==="image"&&i&&i.imageSrcSet?(h+='[imagesrcset="'+ir(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(h+='[imagesizes="'+ir(i.imageSizes)+'"]')):h+='[href="'+ir(n)+'"]';var g=h;switch(s){case"style":g=Yo(n);break;case"script":g=Zo(n)}mr.has(g)||(n=v({rel:"preload",href:s==="image"&&i&&i.imageSrcSet?void 0:n,as:s},i),mr.set(g,n),c.querySelector(h)!==null||s==="style"&&c.querySelector(ul(g))||s==="script"&&c.querySelector(dl(g))||(s=c.createElement("link"),xn(s,"link",n),an(s),c.head.appendChild(s)))}}function eR(n,s){va.m(n,s);var i=qo;if(i&&n){var c=s&&typeof s.as=="string"?s.as:"script",h='link[rel="modulepreload"][as="'+ir(c)+'"][href="'+ir(n)+'"]',g=h;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=Zo(n)}if(!mr.has(g)&&(n=v({rel:"modulepreload",href:n},s),mr.set(g,n),i.querySelector(h)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(dl(g)))return}c=i.createElement("link"),xn(c,"link",n),an(c),i.head.appendChild(c)}}}function tR(n,s,i){va.S(n,s,i);var c=qo;if(c&&n){var h=fo(c).hoistableStyles,g=Yo(n);s=s||"default";var j=h.get(g);if(!j){var A={loading:0,preload:null};if(j=c.querySelector(ul(g)))A.loading=5;else{n=v({rel:"stylesheet",href:n,"data-precedence":s},i),(i=mr.get(g))&&Sm(n,i);var D=j=c.createElement("link");an(D),xn(D,"link",n),D._p=new Promise(function(K,oe){D.onload=K,D.onerror=oe}),D.addEventListener("load",function(){A.loading|=1}),D.addEventListener("error",function(){A.loading|=2}),A.loading|=4,fu(j,s,c)}j={type:"stylesheet",instance:j,count:1,state:A},h.set(g,j)}}}function nR(n,s){va.X(n,s);var i=qo;if(i&&n){var c=fo(i).hoistableScripts,h=Zo(n),g=c.get(h);g||(g=i.querySelector(dl(h)),g||(n=v({src:n,async:!0},s),(s=mr.get(h))&&km(n,s),g=i.createElement("script"),an(g),xn(g,"link",n),i.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(h,g))}}function rR(n,s){va.M(n,s);var i=qo;if(i&&n){var c=fo(i).hoistableScripts,h=Zo(n),g=c.get(h);g||(g=i.querySelector(dl(h)),g||(n=v({src:n,async:!0,type:"module"},s),(s=mr.get(h))&&km(n,s),g=i.createElement("script"),an(g),xn(g,"link",n),i.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(h,g))}}function ab(n,s,i,c){var h=(h=G.current)?du(h):null;if(!h)throw Error(o(446));switch(n){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(s=Yo(i.href),i=fo(h).hoistableStyles,c=i.get(s),c||(c={type:"style",instance:null,count:0,state:null},i.set(s,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){n=Yo(i.href);var g=fo(h).hoistableStyles,j=g.get(n);if(j||(h=h.ownerDocument||h,j={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(n,j),(g=h.querySelector(ul(n)))&&!g._p&&(j.instance=g,j.state.loading=5),mr.has(n)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},mr.set(n,i),g||aR(h,n,i,j.state))),s&&c===null)throw Error(o(528,""));return j}if(s&&c!==null)throw Error(o(529,""));return null;case"script":return s=i.async,i=i.src,typeof i=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Zo(i),i=fo(h).hoistableScripts,c=i.get(s),c||(c={type:"script",instance:null,count:0,state:null},i.set(s,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,n))}}function Yo(n){return'href="'+ir(n)+'"'}function ul(n){return'link[rel="stylesheet"]['+n+"]"}function sb(n){return v({},n,{"data-precedence":n.precedence,precedence:null})}function aR(n,s,i,c){n.querySelector('link[rel="preload"][as="style"]['+s+"]")?c.loading=1:(s=n.createElement("link"),c.preload=s,s.addEventListener("load",function(){return c.loading|=1}),s.addEventListener("error",function(){return c.loading|=2}),xn(s,"link",i),an(s),n.head.appendChild(s))}function Zo(n){return'[src="'+ir(n)+'"]'}function dl(n){return"script[async]"+n}function ob(n,s,i){if(s.count++,s.instance===null)switch(s.type){case"style":var c=n.querySelector('style[data-href~="'+ir(i.href)+'"]');if(c)return s.instance=c,an(c),c;var h=v({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),an(c),xn(c,"style",h),fu(c,i.precedence,n),s.instance=c;case"stylesheet":h=Yo(i.href);var g=n.querySelector(ul(h));if(g)return s.state.loading|=4,s.instance=g,an(g),g;c=sb(i),(h=mr.get(h))&&Sm(c,h),g=(n.ownerDocument||n).createElement("link"),an(g);var j=g;return j._p=new Promise(function(A,D){j.onload=A,j.onerror=D}),xn(g,"link",c),s.state.loading|=4,fu(g,i.precedence,n),s.instance=g;case"script":return g=Zo(i.src),(h=n.querySelector(dl(g)))?(s.instance=h,an(h),h):(c=i,(h=mr.get(g))&&(c=v({},i),km(c,h)),n=n.ownerDocument||n,h=n.createElement("script"),an(h),xn(h,"link",c),n.head.appendChild(h),s.instance=h);case"void":return null;default:throw Error(o(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(c=s.instance,s.state.loading|=4,fu(c,i.precedence,n));return s.instance}function fu(n,s,i){for(var c=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=c.length?c[c.length-1]:null,g=h,j=0;j<c.length;j++){var A=c[j];if(A.dataset.precedence===s)g=A;else if(g!==h)break}g?g.parentNode.insertBefore(n,g.nextSibling):(s=i.nodeType===9?i.head:i,s.insertBefore(n,s.firstChild))}function Sm(n,s){n.crossOrigin==null&&(n.crossOrigin=s.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=s.referrerPolicy),n.title==null&&(n.title=s.title)}function km(n,s){n.crossOrigin==null&&(n.crossOrigin=s.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=s.referrerPolicy),n.integrity==null&&(n.integrity=s.integrity)}var hu=null;function ib(n,s,i){if(hu===null){var c=new Map,h=hu=new Map;h.set(i,c)}else h=hu,c=h.get(i),c||(c=new Map,h.set(i,c));if(c.has(n))return c;for(c.set(n,null),i=i.getElementsByTagName(n),h=0;h<i.length;h++){var g=i[h];if(!(g[Si]||g[Lt]||n==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var j=g.getAttribute(s)||"";j=n+j;var A=c.get(j);A?A.push(g):c.set(j,[g])}}return c}function lb(n,s,i){n=n.ownerDocument||n,n.head.insertBefore(i,s==="title"?n.querySelector("head > title"):null)}function sR(n,s,i){if(i===1||s.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return n=s.disabled,typeof s.precedence=="string"&&n==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function cb(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}var fl=null;function oR(){}function iR(n,s,i){if(fl===null)throw Error(o(475));var c=fl;if(s.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var h=Yo(i.href),g=n.querySelector(ul(h));if(g){n=g._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(c.count++,c=mu.bind(c),n.then(c,c)),s.state.loading|=4,s.instance=g,an(g);return}g=n.ownerDocument||n,i=sb(i),(h=mr.get(h))&&Sm(i,h),g=g.createElement("link"),an(g);var j=g;j._p=new Promise(function(A,D){j.onload=A,j.onerror=D}),xn(g,"link",i),s.instance=g}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(s,n),(n=s.state.preload)&&(s.state.loading&3)===0&&(c.count++,s=mu.bind(c),n.addEventListener("load",s),n.addEventListener("error",s))}}function lR(){if(fl===null)throw Error(o(475));var n=fl;return n.stylesheets&&n.count===0&&Cm(n,n.stylesheets),0<n.count?function(s){var i=setTimeout(function(){if(n.stylesheets&&Cm(n,n.stylesheets),n.unsuspend){var c=n.unsuspend;n.unsuspend=null,c()}},6e4);return n.unsuspend=s,function(){n.unsuspend=null,clearTimeout(i)}}:null}function mu(){if(this.count--,this.count===0){if(this.stylesheets)Cm(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var pu=null;function Cm(n,s){n.stylesheets=null,n.unsuspend!==null&&(n.count++,pu=new Map,s.forEach(cR,n),pu=null,mu.call(n))}function cR(n,s){if(!(s.state.loading&4)){var i=pu.get(n);if(i)var c=i.get(null);else{i=new Map,pu.set(n,i);for(var h=n.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<h.length;g++){var j=h[g];(j.nodeName==="LINK"||j.getAttribute("media")!=="not all")&&(i.set(j.dataset.precedence,j),c=j)}c&&i.set(null,c)}h=s.instance,j=h.getAttribute("data-precedence"),g=i.get(j)||c,g===c&&i.set(null,h),i.set(j,h),this.count++,c=mu.bind(this),h.addEventListener("load",c),h.addEventListener("error",c),g?g.parentNode.insertBefore(h,g.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(h,n.firstChild)),s.state.loading|=4}}var hl={$$typeof:R,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function uR(n,s,i,c,h,g,j,A){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=lt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lt(0),this.hiddenUpdates=lt(null),this.identifierPrefix=c,this.onUncaughtError=h,this.onCaughtError=g,this.onRecoverableError=j,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function ub(n,s,i,c,h,g,j,A,D,K,oe,ue){return n=new uR(n,s,i,j,A,D,K,ue),s=1,g===!0&&(s|=24),g=Yn(3,null,null,s),n.current=g,g.stateNode=n,s=ih(),s.refCount++,n.pooledCache=s,s.refCount++,g.memoizedState={element:c,isDehydrated:i,cache:s},dh(g),n}function db(n){return n?(n=So,n):So}function fb(n,s,i,c,h,g){h=db(h),c.context===null?c.context=h:c.pendingContext=h,c=La(s),c.payload={element:i},g=g===void 0?null:g,g!==null&&(c.callback=g),i=$a(n,c,s),i!==null&&(Xn(i,n,s),Hi(i,n,s))}function hb(n,s){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var i=n.retryLane;n.retryLane=i!==0&&i<s?i:s}}function Em(n,s){hb(n,s),(n=n.alternate)&&hb(n,s)}function mb(n){if(n.tag===13){var s=No(n,67108864);s!==null&&Xn(s,n,67108864),Em(n,67108864)}}var xu=!0;function dR(n,s,i,c){var h=O.T;O.T=null;var g=L.p;try{L.p=2,Am(n,s,i,c)}finally{L.p=g,O.T=h}}function fR(n,s,i,c){var h=O.T;O.T=null;var g=L.p;try{L.p=8,Am(n,s,i,c)}finally{L.p=g,O.T=h}}function Am(n,s,i,c){if(xu){var h=Rm(c);if(h===null)pm(n,s,c,gu,i),xb(n,c);else if(mR(h,n,s,i,c))c.stopPropagation();else if(xb(n,c),s&4&&-1<hR.indexOf(n)){for(;h!==null;){var g=uo(h);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var j=wr(g.pendingLanes);if(j!==0){var A=g;for(A.pendingLanes|=2,A.entangledLanes|=2;j;){var D=1<<31-at(j);A.entanglements[1]|=D,j&=~D}Hr(g),(ct&6)===0&&(eu=Nt()+500,ol(0))}}break;case 13:A=No(g,2),A!==null&&Xn(A,g,2),nu(),Em(g,2)}if(g=Rm(c),g===null&&pm(n,s,c,gu,i),g===h)break;h=g}h!==null&&c.stopPropagation()}else pm(n,s,c,null,i)}}function Rm(n){return n=Of(n),Tm(n)}var gu=null;function Tm(n){if(gu=null,n=co(n),n!==null){var s=u(n);if(s===null)n=null;else{var i=s.tag;if(i===13){if(n=d(s),n!==null)return n;n=null}else if(i===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;n=null}else s!==n&&(n=null)}}return gu=n,null}function pb(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ss()){case zr:return 2;case P:return 8;case Z:case re:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var _m=!1,Xa=null,Wa=null,Ja=null,ml=new Map,pl=new Map,es=[],hR="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function xb(n,s){switch(n){case"focusin":case"focusout":Xa=null;break;case"dragenter":case"dragleave":Wa=null;break;case"mouseover":case"mouseout":Ja=null;break;case"pointerover":case"pointerout":ml.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":pl.delete(s.pointerId)}}function xl(n,s,i,c,h,g){return n===null||n.nativeEvent!==g?(n={blockedOn:s,domEventName:i,eventSystemFlags:c,nativeEvent:g,targetContainers:[h]},s!==null&&(s=uo(s),s!==null&&mb(s)),n):(n.eventSystemFlags|=c,s=n.targetContainers,h!==null&&s.indexOf(h)===-1&&s.push(h),n)}function mR(n,s,i,c,h){switch(s){case"focusin":return Xa=xl(Xa,n,s,i,c,h),!0;case"dragenter":return Wa=xl(Wa,n,s,i,c,h),!0;case"mouseover":return Ja=xl(Ja,n,s,i,c,h),!0;case"pointerover":var g=h.pointerId;return ml.set(g,xl(ml.get(g)||null,n,s,i,c,h)),!0;case"gotpointercapture":return g=h.pointerId,pl.set(g,xl(pl.get(g)||null,n,s,i,c,h)),!0}return!1}function gb(n){var s=co(n.target);if(s!==null){var i=u(s);if(i!==null){if(s=i.tag,s===13){if(s=d(i),s!==null){n.blockedOn=s,$r(n.priority,function(){if(i.tag===13){var c=Qn();c=sr(c);var h=No(i,c);h!==null&&Xn(h,i,c),Em(i,c)}});return}}else if(s===3&&i.stateNode.current.memoizedState.isDehydrated){n.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}n.blockedOn=null}function vu(n){if(n.blockedOn!==null)return!1;for(var s=n.targetContainers;0<s.length;){var i=Rm(n.nativeEvent);if(i===null){i=n.nativeEvent;var c=new i.constructor(i.type,i);Df=c,i.target.dispatchEvent(c),Df=null}else return s=uo(i),s!==null&&mb(s),n.blockedOn=i,!1;s.shift()}return!0}function vb(n,s,i){vu(n)&&i.delete(s)}function pR(){_m=!1,Xa!==null&&vu(Xa)&&(Xa=null),Wa!==null&&vu(Wa)&&(Wa=null),Ja!==null&&vu(Ja)&&(Ja=null),ml.forEach(vb),pl.forEach(vb)}function yu(n,s){n.blockedOn===s&&(n.blockedOn=null,_m||(_m=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,pR)))}var bu=null;function yb(n){bu!==n&&(bu=n,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){bu===n&&(bu=null);for(var s=0;s<n.length;s+=3){var i=n[s],c=n[s+1],h=n[s+2];if(typeof c!="function"){if(Tm(c||i)===null)continue;break}var g=uo(i);g!==null&&(n.splice(s,3),s-=3,Th(g,{pending:!0,data:h,method:i.method,action:c},c,h))}}))}function gl(n){function s(D){return yu(D,n)}Xa!==null&&yu(Xa,n),Wa!==null&&yu(Wa,n),Ja!==null&&yu(Ja,n),ml.forEach(s),pl.forEach(s);for(var i=0;i<es.length;i++){var c=es[i];c.blockedOn===n&&(c.blockedOn=null)}for(;0<es.length&&(i=es[0],i.blockedOn===null);)gb(i),i.blockedOn===null&&es.shift();if(i=(n.ownerDocument||n).$$reactFormReplay,i!=null)for(c=0;c<i.length;c+=3){var h=i[c],g=i[c+1],j=h[hn]||null;if(typeof g=="function")j||yb(i);else if(j){var A=null;if(g&&g.hasAttribute("formAction")){if(h=g,j=g[hn]||null)A=j.formAction;else if(Tm(h)!==null)continue}else A=j.action;typeof A=="function"?i[c+1]=A:(i.splice(c,3),c-=3),yb(i)}}}function Mm(n){this._internalRoot=n}wu.prototype.render=Mm.prototype.render=function(n){var s=this._internalRoot;if(s===null)throw Error(o(409));var i=s.current,c=Qn();fb(i,c,n,s,null,null)},wu.prototype.unmount=Mm.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var s=n.containerInfo;fb(n.current,2,null,n,null,null),nu(),s[lo]=null}};function wu(n){this._internalRoot=n}wu.prototype.unstable_scheduleHydration=function(n){if(n){var s=Lr();n={blockedOn:null,target:n,priority:s};for(var i=0;i<es.length&&s!==0&&s<es[i].priority;i++);es.splice(i,0,n),i===0&&gb(n)}};var bb=t.version;if(bb!=="19.1.1")throw Error(o(527,bb,"19.1.1"));L.findDOMNode=function(n){var s=n._reactInternals;if(s===void 0)throw typeof n.render=="function"?Error(o(188)):(n=Object.keys(n).join(","),Error(o(268,n)));return n=m(s),n=n!==null?p(n):null,n=n===null?null:n.stateNode,n};var xR={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ju=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ju.isDisabled&&ju.supportsFiber)try{Se=ju.inject(xR),Me=ju}catch{}}return yl.createRoot=function(n,s){if(!l(n))throw Error(o(299));var i=!1,c="",h=Py,g=Ly,j=$y,A=null;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(g=s.onCaughtError),s.onRecoverableError!==void 0&&(j=s.onRecoverableError),s.unstable_transitionCallbacks!==void 0&&(A=s.unstable_transitionCallbacks)),s=ub(n,1,!1,null,null,i,c,h,g,j,A,null),n[lo]=s.current,mm(n),new Mm(s)},yl.hydrateRoot=function(n,s,i){if(!l(n))throw Error(o(299));var c=!1,h="",g=Py,j=Ly,A=$y,D=null,K=null;return i!=null&&(i.unstable_strictMode===!0&&(c=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onUncaughtError!==void 0&&(g=i.onUncaughtError),i.onCaughtError!==void 0&&(j=i.onCaughtError),i.onRecoverableError!==void 0&&(A=i.onRecoverableError),i.unstable_transitionCallbacks!==void 0&&(D=i.unstable_transitionCallbacks),i.formState!==void 0&&(K=i.formState)),s=ub(n,1,!0,s,i??null,c,h,g,j,A,D,K),s.context=db(null),i=s.current,c=Qn(),c=sr(c),h=La(c),h.callback=null,$a(i,h,c),i=c,s.current.lanes=i,Xe(s,i),Hr(s),n[lo]=s.current,mm(n),new wu(s)},yl.version="19.1.1",yl}var Tb;function CR(){if(Tb)return Om.exports;Tb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Om.exports=kR(),Om.exports}var ER=CR(),hi=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(){}},Gs=typeof window>"u"||"Deno"in globalThis;function Rn(){}function AR(e,t){return typeof e=="function"?e(t):e}function dp(e){return typeof e=="number"&&e>=0&&e!==1/0}function C1(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ls(e,t){return typeof e=="function"?e(t):e}function xr(e,t){return typeof e=="function"?e(t):e}function _b(e,t){const{type:r="all",exact:o,fetchStatus:l,predicate:u,queryKey:d,stale:f}=e;if(d){if(o){if(t.queryHash!==Wp(d,t.options))return!1}else if(!Pl(t.queryKey,d))return!1}if(r!=="all"){const m=t.isActive();if(r==="active"&&!m||r==="inactive"&&m)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||l&&l!==t.state.fetchStatus||u&&!u(t))}function Mb(e,t){const{exact:r,status:o,predicate:l,mutationKey:u}=e;if(u){if(!t.options.mutationKey)return!1;if(r){if(Ks(t.options.mutationKey)!==Ks(u))return!1}else if(!Pl(t.options.mutationKey,u))return!1}return!(o&&t.state.status!==o||l&&!l(t))}function Wp(e,t){return(t?.queryKeyHashFn||Ks)(e)}function Ks(e){return JSON.stringify(e,(t,r)=>fp(r)?Object.keys(r).sort().reduce((o,l)=>(o[l]=r[l],o),{}):r)}function Pl(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Pl(e[r],t[r])):!1}function E1(e,t){if(e===t)return e;const r=Db(e)&&Db(t);if(r||fp(e)&&fp(t)){const o=r?e:Object.keys(e),l=o.length,u=r?t:Object.keys(t),d=u.length,f=r?[]:{},m=new Set(o);let p=0;for(let v=0;v<d;v++){const y=r?v:u[v];(!r&&m.has(y)||r)&&e[y]===void 0&&t[y]===void 0?(f[y]=void 0,p++):(f[y]=E1(e[y],t[y]),f[y]===e[y]&&e[y]!==void 0&&p++)}return l===d&&p===l?e:f}return t}function Qu(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 Db(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function fp(e){if(!Ob(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Ob(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ob(e){return Object.prototype.toString.call(e)==="[object Object]"}function RR(e){return new Promise(t=>{setTimeout(t,e)})}function hp(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?E1(e,t):t}function TR(e,t,r=0){const o=[...e,t];return r&&o.length>r?o.slice(1):o}function _R(e,t,r=0){const o=[t,...e];return r&&o.length>r?o.slice(0,-1):o}var Jp=Symbol();function A1(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Jp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function R1(e,t){return typeof e=="function"?e(...t):!!e}var MR=class extends hi{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!Gs&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},ex=new MR,DR=class extends hi{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!Gs&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(r=>{r(e)}))}isOnline(){return this.#t}},Xu=new DR;function mp(){let e,t;const r=new Promise((l,u)=>{e=l,t=u});r.status="pending",r.catch(()=>{});function o(l){Object.assign(r,l),delete r.resolve,delete r.reject}return r.resolve=l=>{o({status:"fulfilled",value:l}),e(l)},r.reject=l=>{o({status:"rejected",reason:l}),t(l)},r}function OR(e){return Math.min(1e3*2**e,3e4)}function T1(e){return(e??"online")==="online"?Xu.isOnline():!0}var _1=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Im(e){return e instanceof _1}function M1(e){let t=!1,r=0,o=!1,l;const u=mp(),d=w=>{o||(b(new _1(w)),e.abort?.())},f=()=>{t=!0},m=()=>{t=!1},p=()=>ex.isFocused()&&(e.networkMode==="always"||Xu.isOnline())&&e.canRun(),v=()=>T1(e.networkMode)&&e.canRun(),y=w=>{o||(o=!0,e.onSuccess?.(w),l?.(),u.resolve(w))},b=w=>{o||(o=!0,e.onError?.(w),l?.(),u.reject(w))},S=()=>new Promise(w=>{l=C=>{(o||p())&&w(C)},e.onPause?.()}).then(()=>{l=void 0,o||e.onContinue?.()}),N=()=>{if(o)return;let w;const C=r===0?e.initialPromise:void 0;try{w=C??e.fn()}catch(k){w=Promise.reject(k)}Promise.resolve(w).then(y).catch(k=>{if(o)return;const E=e.retry??(Gs?0:3),R=e.retryDelay??OR,T=typeof R=="function"?R(r,k):R,z=E===!0||typeof E=="number"&&r<E||typeof E=="function"&&E(r,k);if(t||!z){b(k);return}r++,e.onFail?.(r,k),RR(T).then(()=>p()?void 0:S()).then(()=>{t?b(k):N()})})};return{promise:u,cancel:d,continue:()=>(l?.(),u),cancelRetry:f,continueRetry:m,canStart:v,start:()=>(v()?N():S().then(N),u)}}var zR=e=>setTimeout(e,0);function PR(){let e=[],t=0,r=f=>{f()},o=f=>{f()},l=zR;const u=f=>{t?e.push(f):l(()=>{r(f)})},d=()=>{const f=e;e=[],f.length&&l(()=>{o(()=>{f.forEach(m=>{r(m)})})})};return{batch:f=>{let m;t++;try{m=f()}finally{t--,t||d()}return m},batchCalls:f=>(...m)=>{u(()=>{f(...m)})},schedule:u,setNotifyFunction:f=>{r=f},setBatchNotifyFunction:f=>{o=f},setScheduler:f=>{l=f}}}var nn=PR(),D1=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),dp(this.gcTime)&&(this.#t=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Gs?1/0:300*1e3))}clearGcTimeout(){this.#t&&(clearTimeout(this.#t),this.#t=void 0)}},LR=class extends D1{#t;#e;#n;#r;#a;#o;#i;constructor(e){super(),this.#i=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=$R(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(e){this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const r=hp(this.state.data,e,this.options);return this.#s({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Rn).catch(Rn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>xr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Jp||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ls(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!C1(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#i?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){const m=this.observers.find(p=>p.options.queryFn);m&&this.setOptions(m.options)}const r=new AbortController,o=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(this.#i=!0,r.signal)})},l=()=>{const m=A1(this.options,t),v=(()=>{const y={client:this.#r,queryKey:this.queryKey,meta:this.meta};return o(y),y})();return this.#i=!1,this.options.persister?this.options.persister(m,v,this):m(v)},d=(()=>{const m={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:l};return o(m),m})();this.options.behavior?.onFetch(d,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==d.fetchOptions?.meta)&&this.#s({type:"fetch",meta:d.fetchOptions?.meta});const f=m=>{Im(m)&&m.silent||this.#s({type:"error",error:m}),Im(m)||(this.#n.config.onError?.(m,this),this.#n.config.onSettled?.(this.state.data,m,this)),this.scheduleGc()};return this.#a=M1({initialPromise:t?.initialPromise,fn:d.fetchFn,abort:r.abort.bind(r),onSuccess:m=>{if(m===void 0){f(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(m)}catch(p){f(p);return}this.#n.config.onSuccess?.(m,this),this.#n.config.onSettled?.(m,this.state.error,this),this.scheduleGc()},onError:f,onFail:(m,p)=>{this.#s({type:"failed",failureCount:m,error:p})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0}),this.#a.start()}#s(e){const t=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...O1(r.data,this.options),fetchMeta:e.meta??null};case"success":return this.#e=void 0,{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=e.error;return Im(o)&&o.revert&&this.#e?{...this.#e,fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=t(this.state),nn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function O1(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:T1(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function $R(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,o=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var IR=class extends hi{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,r){const o=t.queryKey,l=t.queryHash??Wp(o,t);let u=this.get(l);return u||(u=new LR({client:e,queryKey:o,queryHash:l,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(o)}),this.add(u)),u}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){nn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(r=>_b(t,r))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(r=>_b(e,r)):t}notify(e){nn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){nn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){nn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},UR=class extends D1{#t;#e;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#e=e.mutationCache,this.#t=[],this.state=e.state||z1(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#e.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#e.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})};this.#n=M1({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(l,u)=>{this.#r({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#e.canRun(this)});const r=this.state.status==="pending",o=!this.#n.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:o}),await this.#e.config.onMutate?.(e,this);const u=await this.options.onMutate?.(e);u!==this.state.context&&this.#r({type:"pending",context:u,variables:e,isPaused:o})}const l=await this.#n.start();return await this.#e.config.onSuccess?.(l,e,this.state.context,this),await this.options.onSuccess?.(l,e,this.state.context),await this.#e.config.onSettled?.(l,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(l,null,e,this.state.context),this.#r({type:"success",data:l}),l}catch(l){try{throw await this.#e.config.onError?.(l,e,this.state.context,this),await this.options.onError?.(l,e,this.state.context),await this.#e.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,l,e,this.state.context),l}finally{this.#r({type:"error",error:l})}}finally{this.#e.runNext(this)}}#r(e){const t=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),nn.batch(()=>{this.#t.forEach(r=>{r.onMutationUpdate(e)}),this.#e.notify({mutation:this,type:"updated",action:e})})}};function z1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var BR=class extends hi{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,t,r){const o=new UR({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:r});return this.add(o),o}add(e){this.#t.add(e);const t=Nu(e);if(typeof t=="string"){const r=this.#e.get(t);r?r.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=Nu(e);if(typeof t=="string"){const r=this.#e.get(t);if(r)if(r.length>1){const o=r.indexOf(e);o!==-1&&r.splice(o,1)}else r[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Nu(e);if(typeof t=="string"){const o=this.#e.get(t)?.find(l=>l.state.status==="pending");return!o||o===e}else return!0}runNext(e){const t=Nu(e);return typeof t=="string"?this.#e.get(t)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){nn.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(r=>Mb(t,r))}findAll(e={}){return this.getAll().filter(t=>Mb(e,t))}notify(e){nn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return nn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Rn))))}};function Nu(e){return e.options.scope?.id}function zb(e){return{onFetch:(t,r)=>{const o=t.options,l=t.fetchOptions?.meta?.fetchMore?.direction,u=t.state.data?.pages||[],d=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},m=0;const p=async()=>{let v=!1;const y=N=>{Object.defineProperty(N,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},b=A1(t.options,t.fetchOptions),S=async(N,w,C)=>{if(v)return Promise.reject();if(w==null&&N.pages.length)return Promise.resolve(N);const E=(()=>{const ne={client:t.client,queryKey:t.queryKey,pageParam:w,direction:C?"backward":"forward",meta:t.options.meta};return y(ne),ne})(),R=await b(E),{maxPages:T}=t.options,z=C?_R:TR;return{pages:z(N.pages,R,T),pageParams:z(N.pageParams,w,T)}};if(l&&u.length){const N=l==="backward",w=N?VR:Pb,C={pages:u,pageParams:d},k=w(o,C);f=await S(C,k,N)}else{const N=e??u.length;do{const w=m===0?d[0]??o.initialPageParam:Pb(o,f);if(m>0&&w==null)break;f=await S(f,w),m++}while(m<N)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=p}}}function Pb(e,{pages:t,pageParams:r}){const o=t.length-1;return t.length>0?e.getNextPageParam(t[o],t,r[o],r):void 0}function VR(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}var HR=class{#t;#e;#n;#r;#a;#o;#i;#s;constructor(e={}){this.#t=e.queryCache||new IR,this.#e=e.mutationCache||new BR,this.#n=e.defaultOptions||{},this.#r=new Map,this.#a=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#i=ex.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=Xu.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#i?.(),this.#i=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=this.#t.build(this,t),o=r.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(ls(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(o))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:r})=>{const o=r.data;return[t,o]})}setQueryData(e,t,r){const o=this.defaultQueryOptions({queryKey:e}),u=this.#t.get(o.queryHash)?.state.data,d=AR(t,u);if(d!==void 0)return this.#t.build(this,o).setData(d,{...r,manual:!0})}setQueriesData(e,t,r){return nn.batch(()=>this.#t.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,t,r)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;nn.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=this.#t;return nn.batch(()=>(r.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},o=nn.batch(()=>this.#t.findAll(e).map(l=>l.cancel(r)));return Promise.all(o).then(Rn).catch(Rn)}invalidateQueries(e,t={}){return nn.batch(()=>(this.#t.findAll(e).forEach(r=>{r.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},o=nn.batch(()=>this.#t.findAll(e).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let u=l.fetch(void 0,r);return r.throwOnError||(u=u.catch(Rn)),l.state.fetchStatus==="paused"?Promise.resolve():u}));return Promise.all(o).then(Rn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=this.#t.build(this,t);return r.isStaleByTime(ls(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Rn).catch(Rn)}fetchInfiniteQuery(e){return e.behavior=zb(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Rn).catch(Rn)}ensureInfiniteQueryData(e){return e.behavior=zb(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Xu.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Ks(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],r={};return t.forEach(o=>{Pl(e,o.queryKey)&&Object.assign(r,o.defaultOptions)}),r}setMutationDefaults(e,t){this.#a.set(Ks(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#a.values()],r={};return t.forEach(o=>{Pl(e,o.mutationKey)&&Object.assign(r,o.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Wp(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.queryFn===Jp&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},FR=class extends hi{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#i=mp(),this.options.experimental_prefetchInRender||this.#i.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#r=void 0;#a;#o;#i;#s;#p;#f;#h;#c;#u;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),Lb(this.#e,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return pp(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return pp(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#w(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,r=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof xr(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#j(),this.#e.setOptions(this.options),t._defaulted&&!Qu(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const o=this.hasListeners();o&&$b(this.#e,r,this.options,t)&&this.#d(),this.updateResult(),o&&(this.#e!==r||xr(this.options.enabled,this.#e)!==xr(t.enabled,this.#e)||ls(this.options.staleTime,this.#e)!==ls(t.staleTime,this.#e))&&this.#x();const l=this.#g();o&&(this.#e!==r||xr(this.options.enabled,this.#e)!==xr(t.enabled,this.#e)||l!==this.#l)&&this.#v(l)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),r=this.createResult(t,e);return YR(this,r)&&(this.#r=r,this.#o=this.options,this.#a=this.#e.state),r}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(r,o)=>(this.trackProp(o),t?.(o),Reflect.get(r,o))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),r=this.#t.getQueryCache().build(this.#t,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#d(e){this.#j();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Rn)),t}#x(){this.#b();const e=ls(this.options.staleTime,this.#e);if(Gs||this.#r.isStale||!dp(e))return;const r=C1(this.#r.dataUpdatedAt,e)+1;this.#c=setTimeout(()=>{this.#r.isStale||this.updateResult()},r)}#g(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#l=e,!(Gs||xr(this.options.enabled,this.#e)===!1||!dp(this.#l)||this.#l===0)&&(this.#u=setInterval(()=>{(this.options.refetchIntervalInBackground||ex.isFocused())&&this.#d()},this.#l))}#y(){this.#x(),this.#v(this.#g())}#b(){this.#c&&(clearTimeout(this.#c),this.#c=void 0)}#w(){this.#u&&(clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const r=this.#e,o=this.options,l=this.#r,u=this.#a,d=this.#o,m=e!==r?e.state:this.#n,{state:p}=e;let v={...p},y=!1,b;if(t._optimisticResults){const V=this.hasListeners(),J=!V&&Lb(e,t),se=V&&$b(e,r,t,o);(J||se)&&(v={...v,...O1(p.data,e.options)}),t._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:S,errorUpdatedAt:N,status:w}=v;b=v.data;let C=!1;if(t.placeholderData!==void 0&&b===void 0&&w==="pending"){let V;l?.isPlaceholderData&&t.placeholderData===d?.placeholderData?(V=l.data,C=!0):V=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,V!==void 0&&(w="success",b=hp(l?.data,V,t),y=!0)}if(t.select&&b!==void 0&&!C)if(l&&b===u?.data&&t.select===this.#p)b=this.#f;else try{this.#p=t.select,b=t.select(b),b=hp(l?.data,b,t),this.#f=b,this.#s=null}catch(V){this.#s=V}this.#s&&(S=this.#s,b=this.#f,N=Date.now(),w="error");const k=v.fetchStatus==="fetching",E=w==="pending",R=w==="error",T=E&&k,z=b!==void 0,$={status:w,fetchStatus:v.fetchStatus,isPending:E,isSuccess:w==="success",isError:R,isInitialLoading:T,isLoading:T,data:b,dataUpdatedAt:v.dataUpdatedAt,error:S,errorUpdatedAt:N,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>m.dataUpdateCount||v.errorUpdateCount>m.errorUpdateCount,isFetching:k,isRefetching:k&&!E,isLoadingError:R&&!z,isPaused:v.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:R&&z,isStale:tx(e,t),refetch:this.refetch,promise:this.#i,isEnabled:xr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const V=ie=>{$.status==="error"?ie.reject($.error):$.data!==void 0&&ie.resolve($.data)},J=()=>{const ie=this.#i=$.promise=mp();V(ie)},se=this.#i;switch(se.status){case"pending":e.queryHash===r.queryHash&&V(se);break;case"fulfilled":($.status==="error"||$.data!==se.value)&&J();break;case"rejected":($.status!=="error"||$.error!==se.reason)&&J();break}}return $}updateResult(){const e=this.#r,t=this.createResult(this.#e,this.options);if(this.#a=this.#e.state,this.#o=this.options,this.#a.data!==void 0&&(this.#h=this.#e),Qu(t,e))return;this.#r=t;const r=()=>{if(!e)return!0;const{notifyOnChangeProps:o}=this.options,l=typeof o=="function"?o():o;if(l==="all"||!l&&!this.#m.size)return!0;const u=new Set(l??this.#m);return this.options.throwOnError&&u.add("error"),Object.keys(this.#r).some(d=>{const f=d;return this.#r[f]!==e[f]&&u.has(f)})};this.#N({listeners:r()})}#j(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#N(e){nn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function qR(e,t){return xr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Lb(e,t){return qR(e,t)||e.state.data!==void 0&&pp(e,t,t.refetchOnMount)}function pp(e,t,r){if(xr(t.enabled,e)!==!1&&ls(t.staleTime,e)!=="static"){const o=typeof r=="function"?r(e):r;return o==="always"||o!==!1&&tx(e,t)}return!1}function $b(e,t,r,o){return(e!==t||xr(o.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&tx(e,r)}function tx(e,t){return xr(t.enabled,e)!==!1&&e.isStaleByTime(ls(t.staleTime,e))}function YR(e,t){return!Qu(e.getCurrentResult(),t)}var ZR=class extends hi{#t;#e=void 0;#n;#r;constructor(t,r){super(),this.#t=t,this.setOptions(r),this.bindMethods(),this.#a()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const r=this.options;this.options=this.#t.defaultMutationOptions(t),Qu(this.options,r)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),r?.mutationKey&&this.options.mutationKey&&Ks(r.mutationKey)!==Ks(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#a(),this.#o(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#a(),this.#o()}mutate(t,r){return this.#r=r,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#a(){const t=this.#n?.state??z1();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){nn.batch(()=>{if(this.#r&&this.hasListeners()){const r=this.#e.variables,o=this.#e.context;t?.type==="success"?(this.#r.onSuccess?.(t.data,r,o),this.#r.onSettled?.(t.data,null,r,o)):t?.type==="error"&&(this.#r.onError?.(t.error,r,o),this.#r.onSettled?.(void 0,t.error,r,o))}this.listeners.forEach(r=>{r(this.#e)})})}},x=Sd();const ae=S1(x),nx=vR({__proto__:null,default:ae},[x]);var P1=x.createContext(void 0),rx=e=>{const t=x.useContext(P1);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},GR=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),a.jsx(P1.Provider,{value:e,children:t})),L1=x.createContext(!1),KR=()=>x.useContext(L1);L1.Provider;function QR(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var XR=x.createContext(QR()),WR=()=>x.useContext(XR),JR=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},eT=e=>{x.useEffect(()=>{e.clearReset()},[e])},tT=({result:e,errorResetBoundary:t,throwOnError:r,query:o,suspense:l})=>e.isError&&!t.isReset()&&!e.isFetching&&o&&(l&&e.data===void 0||R1(r,[e.error,o])),nT=e=>{if(e.suspense){const t=o=>o==="static"?o:Math.max(o??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...o)=>t(r(...o)):t(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},rT=(e,t)=>e.isLoading&&e.isFetching&&!t,aT=(e,t)=>e?.suspense&&t.isPending,Ib=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function sT(e,t,r){const o=KR(),l=WR(),u=rx(),d=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(d),d._optimisticResults=o?"isRestoring":"optimistic",nT(d),JR(d,l),eT(l);const f=!u.getQueryCache().get(d.queryHash),[m]=x.useState(()=>new t(u,d)),p=m.getOptimisticResult(d),v=!o&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(y=>{const b=v?m.subscribe(nn.batchCalls(y)):Rn;return m.updateResult(),b},[m,v]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),x.useEffect(()=>{m.setOptions(d)},[d,m]),aT(d,p))throw Ib(d,m,l);if(tT({result:p,errorResetBoundary:l,throwOnError:d.throwOnError,query:u.getQueryCache().get(d.queryHash),suspense:d.suspense}))throw p.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(d,p),d.experimental_prefetchInRender&&!Gs&&rT(p,o)&&(f?Ib(d,m,l):u.getQueryCache().get(d.queryHash)?.promise)?.catch(Rn).finally(()=>{m.updateResult()}),d.notifyOnChangeProps?p:m.trackResult(p)}function tt(e,t){return sT(e,FR)}function Ys(e,t){const r=rx(),[o]=x.useState(()=>new ZR(r,e));x.useEffect(()=>{o.setOptions(e)},[o,e]);const l=x.useSyncExternalStore(x.useCallback(d=>o.subscribe(nn.batchCalls(d)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),u=x.useCallback((d,f)=>{o.mutate(d,f).catch(Rn)},[o]);if(l.error&&R1(o.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:u,mutateAsync:l.mutate}}function oT(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var r,o,l,u,d=[],f="",m=e.split("/");for(m[0]||m.shift();l=m.shift();)r=l[0],r==="*"?(d.push(r),f+=l[1]==="?"?"(?:/(.*))?":"/(.*)"):r===":"?(o=l.indexOf("?",1),u=l.indexOf(".",1),d.push(l.substring(1,~o?o:~u?u:l.length)),f+=~o&&!~u?"(?:/([^/]+?))?":"/([^/]+?)",~u&&(f+=(~o?"?":"")+"\\"+l.substring(u))):f+="/"+l;return{keys:d,pattern:new RegExp("^"+f+(t?"(?=$|/)":"/?$"),"i")}}var Um={exports:{}},Bm={};/**
|
||
* @license React
|
||
* use-sync-external-store-shim.production.js
|
||
*
|
||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/var Ub;function iT(){if(Ub)return Bm;Ub=1;var e=Sd();function t(y,b){return y===b&&(y!==0||1/y===1/b)||y!==y&&b!==b}var r=typeof Object.is=="function"?Object.is:t,o=e.useState,l=e.useEffect,u=e.useLayoutEffect,d=e.useDebugValue;function f(y,b){var S=b(),N=o({inst:{value:S,getSnapshot:b}}),w=N[0].inst,C=N[1];return u(function(){w.value=S,w.getSnapshot=b,m(w)&&C({inst:w})},[y,S,b]),l(function(){return m(w)&&C({inst:w}),y(function(){m(w)&&C({inst:w})})},[y]),d(S),S}function m(y){var b=y.getSnapshot;y=y.value;try{var S=b();return!r(y,S)}catch{return!0}}function p(y,b){return b()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return Bm.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,Bm}var Bb;function lT(){return Bb||(Bb=1,Um.exports=iT()),Um.exports}var $1=lT();const cT=nx.useInsertionEffect,uT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",dT=uT?x.useLayoutEffect:x.useEffect,fT=cT||dT,I1=e=>{const t=x.useRef([e,(...r)=>t[0](...r)]).current;return fT(()=>{t[0]=e}),t[1]},hT="popstate",ax="pushState",sx="replaceState",mT="hashchange",Vb=[hT,ax,sx,mT],pT=e=>{for(const t of Vb)addEventListener(t,e);return()=>{for(const t of Vb)removeEventListener(t,e)}},U1=(e,t)=>$1.useSyncExternalStore(pT,e,t),xT=()=>location.search,gT=({ssrSearch:e=""}={})=>U1(xT,()=>e),Hb=()=>location.pathname,vT=({ssrPath:e}={})=>U1(Hb,e?()=>e:Hb),yT=(e,{replace:t=!1,state:r=null}={})=>history[t?sx:ax](r,"",e),bT=(e={})=>[vT(e),yT],Fb=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[Fb]>"u"){for(const e of[ax,sx]){const t=history[e];history[e]=function(){const r=t.apply(this,arguments),o=new Event(e);return o.arguments=arguments,dispatchEvent(o),r}}Object.defineProperty(window,Fb,{value:!0})}const wT=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",B1=(e="")=>e==="/"?"":e,jT=(e,t)=>e[0]==="~"?e.slice(1):B1(t)+e,NT=(e="",t)=>wT(qb(B1(e)),qb(t)),qb=e=>{try{return decodeURI(e)}catch{return e}},V1={hook:bT,searchHook:gT,parser:oT,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e},H1=x.createContext(V1),Kl=()=>x.useContext(H1),F1={},q1=x.createContext(F1),Ql=()=>x.useContext(q1),kd=e=>{const[t,r]=e.hook(e);return[NT(e.base,t),I1((o,l)=>r(jT(o,e.base),l))]},ys=()=>kd(Kl()),Y1=(e,t,r,o)=>{const{pattern:l,keys:u}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",o),d=l.exec(r)||[],[f,...m]=d;return f!==void 0?[!0,(()=>{const p=u!==!1?Object.fromEntries(u.map((y,b)=>[y,m[b]])):d.groups;let v={...m};return p&&Object.assign(v,p),v})(),...o?[f]:[]]:[!1,null]},ST=({children:e,...t})=>{const r=Kl(),o=t.hook?V1:r;let l=o;const[u,d]=t.ssrPath?.split("?")??[];d&&(t.ssrSearch=d,t.ssrPath=u),t.hrefs=t.hrefs??t.hook?.hrefs;let f=x.useRef({}),m=f.current,p=m;for(let v in o){const y=v==="base"?o[v]+(t[v]||""):t[v]||o[v];m===p&&y!==p[v]&&(f.current=p={...p}),p[v]=y,(y!==o[v]||y!==l[v])&&(l=p)}return x.createElement(H1.Provider,{value:l,children:e})},Yb=({children:e,component:t},r)=>t?x.createElement(t,{params:r}):typeof e=="function"?e(r):e,kT=e=>{let t=x.useRef(F1);const r=t.current;return t.current=Object.keys(e).length!==Object.keys(r).length||Object.entries(e).some(([o,l])=>l!==r[o])?e:r},cn=({path:e,nest:t,match:r,...o})=>{const l=Kl(),[u]=kd(l),[d,f,m]=r??Y1(l.parser,e,u,t),p=kT({...Ql(),...f});if(!d)return null;const v=m?x.createElement(ST,{base:m},Yb(o,p)):Yb(o,p);return x.createElement(q1.Provider,{value:p,children:v})},Ce=x.forwardRef((e,t)=>{const r=Kl(),[o,l]=kd(r),{to:u="",href:d=u,onClick:f,asChild:m,children:p,className:v,replace:y,state:b,...S}=e,N=I1(C=>{C.ctrlKey||C.metaKey||C.altKey||C.shiftKey||C.button!==0||(f?.(C),C.defaultPrevented||(C.preventDefault(),l(d,e)))}),w=r.hrefs(d[0]==="~"?d.slice(1):r.base+d,r);return m&&x.isValidElement(p)?x.cloneElement(p,{onClick:N,href:w}):x.createElement("a",{...S,onClick:N,href:w,className:v?.call?v(o===d):v,children:p,ref:t})}),Z1=e=>Array.isArray(e)?e.flatMap(t=>Z1(t&&t.type===x.Fragment?t.props.children:t)):[e],CT=({children:e,location:t})=>{const r=Kl(),[o]=kd(r);for(const l of Z1(e)){let u=0;if(x.isValidElement(l)&&(u=Y1(r.parser,l.props.path,t||o,l.props.nest))[0])return x.cloneElement(l,{match:u})}return null};var mi=k1();const ET=S1(mi);let G1=()=>0;function Vm(e){return G1(e)}function Ta(){const[e,t]=x.useState([]),r=l=>{const u=Date.now(),d={...l,id:u,duration:l.duration||3e3};return t(f=>[...f,d]),setTimeout(()=>{o(u)},d.duration),u};G1=r;const o=l=>{t(l?u=>u.filter(d=>d.id!==l):[])};return{toast:r,dismiss:o,toasts:e}}/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const AT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),K1=(...e)=>e.filter((t,r,o)=>!!t&&o.indexOf(t)===r).join(" ");/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/var RT={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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const TT=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:l="",children:u,iconNode:d,...f},m)=>x.createElement("svg",{ref:m,...RT,width:t,height:t,stroke:e,strokeWidth:o?Number(r)*24/Number(t):r,className:K1("lucide",l),...f},[...d.map(([p,v])=>x.createElement(p,v)),...Array.isArray(u)?u:[u]]));/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const we=(e,t)=>{const r=x.forwardRef(({className:o,...l},u)=>x.createElement(TT,{ref:u,iconNode:t,className:K1(`lucide-${AT(e)}`,o),...l}));return r.displayName=`${e}`,r};/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const _T=we("ArrowDownWideNarrow",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const MT=we("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const xp=we("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const DT=we("ArrowUpNarrowWide",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M11 12h4",key:"q8tih4"}],["path",{d:"M11 16h7",key:"uosisv"}],["path",{d:"M11 20h10",key:"jvxblo"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const OT=we("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const zT=we("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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const PT=we("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ox=we("BookMarked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Rr=we("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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Uu=we("BookText",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Zb=we("Book",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const LT=we("BookmarkPlus",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}],["line",{x1:"12",x2:"12",y1:"7",y2:"13",key:"1cppfj"}],["line",{x1:"15",x2:"9",y1:"10",y2:"10",key:"1gty7f"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Q1=we("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Zs=we("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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const $T=we("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
||
* @license lucide-react v0.453.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=we("ChartLine",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Cd=we("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ed=we("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Xl=we("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ad=we("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const UT=we("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const X1=we("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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const BT=we("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const W1=we("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Wu=we("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const VT=we("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const J1=we("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const HT=we("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const FT=we("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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const qT=we("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const YT=we("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ZT=we("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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ll=we("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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ej=we("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const GT=we("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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const KT=we("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ix=we("Grid3x3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const QT=we("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const XT=we("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const WT=we("HeartHandshake",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M12 5 9.04 7.96a2.17 2.17 0 0 0 0 3.08c.82.82 2.13.85 3 .07l2.07-1.9a2.82 2.82 0 0 1 3.79 0l2.96 2.66",key:"4oyue0"}],["path",{d:"m18 15-2-2",key:"60u0ii"}],["path",{d:"m15 18-2-2",key:"6p76be"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Qs=we("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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const JT=we("Highlighter",[["path",{d:"m9 11-6 6v3h9l3-3",key:"1a3l36"}],["path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4",key:"14a9rk"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const tj=we("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const e_=we("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const t_=we("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Bu=we("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const n_=we("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
|
||
* @license lucide-react v0.453.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_=we("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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const a_=we("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const s_=we("LayoutList",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["path",{d:"M14 4h7",key:"3xa0d5"}],["path",{d:"M14 9h7",key:"1icrd9"}],["path",{d:"M14 15h7",key:"1mj8o2"}],["path",{d:"M14 20h7",key:"11slyb"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Hm=we("Leaf",[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const nj=we("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const o_=we("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Rd=we("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const lx=we("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Gb=we("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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const i_=we("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const l_=we("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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Ju=we("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const $l=we("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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const c_=we("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const rj=we("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const u_=we("PenTool",[["path",{d:"M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z",key:"nt11vn"}],["path",{d:"m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18",key:"15qc1e"}],["path",{d:"m2.3 2.3 7.286 7.286",key:"1wuzzi"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const aj=we("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const d_=we("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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Xs=we("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const sj=we("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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const cx=we("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Kb=we("Snowflake",[["line",{x1:"2",x2:"22",y1:"12",y2:"12",key:"1dnqot"}],["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"m20 16-4-4 4-4",key:"rquw4f"}],["path",{d:"m4 8 4 4-4 4",key:"12s3z9"}],["path",{d:"m16 4-4 4-4-4",key:"1tumq1"}],["path",{d:"m8 20 4-4 4 4",key:"9p200w"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const f_=we("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const cs=we("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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const h_=we("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const m_=we("SunMoon",[["path",{d:"M12 8a2.83 2.83 0 0 0 4 4 4 4 0 1 1-4-4",key:"1fu5g2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.9 4.9 1.4 1.4",key:"b9915j"}],["path",{d:"m17.7 17.7 1.4 1.4",key:"qc3ed3"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.3 17.7-1.4 1.4",key:"5gca6"}],["path",{d:"m19.1 4.9-1.4 1.4",key:"wpu9u6"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const ed=we("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
||
* @license lucide-react v0.453.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_=we("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const oj=we("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const x_=we("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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const g_=we("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Qb=we("Umbrella",[["path",{d:"M22 12a10.06 10.06 1 0 0-20 0Z",key:"1teyop"}],["path",{d:"M12 12v8a2 2 0 0 0 4 0",key:"ulpmoc"}],["path",{d:"M12 2v1",key:"11qlp1"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const v_=we("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const y_=we("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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Il=we("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.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const b_=we("Waves",[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const Td=we("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
||
* @license lucide-react v0.453.0 - ISC
|
||
*
|
||
* This source code is licensed under the ISC license.
|
||
* See the LICENSE file in the root directory of this source tree.
|
||
*/const w_=we("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);function j_({id:e,title:t,description:r,variant:o="default",onDismiss:l}){const[u,d]=x.useState(!0);x.useEffect(()=>{const v=setTimeout(()=>{d(!1),setTimeout(()=>l(e),300)},3e3);return()=>clearTimeout(v)},[e,l]);const f="rounded-md shadow-lg p-4 transition-all duration-300 max-w-sm",m=o==="destructive"?"bg-red-500 text-white":"bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100",p=u?"opacity-100 translate-y-0":"opacity-0 translate-y-2";return a.jsx("div",{className:`${f} ${m} ${p}`,children:a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsxs("div",{children:[t&&a.jsx("h3",{className:"font-medium",children:t}),r&&a.jsx("p",{className:"text-sm mt-1 opacity-80",children:r})]}),a.jsx("button",{onClick:()=>{d(!1),setTimeout(()=>l(e),300)},className:"text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400",children:a.jsx(Td,{size:18})})]})})}function N_(){const{toasts:e,dismiss:t}=Ta();return e.length?mi.createPortal(a.jsx("div",{className:"fixed bottom-0 right-0 z-50 p-4 flex flex-col gap-2",children:e.map(r=>a.jsx(j_,{id:r.id,title:r.title,description:r.description,variant:r.variant,onDismiss:t},r.id))}),document.body):null}function be(e,t,{checkForDefaultPrevented:r=!0}={}){return function(l){if(e?.(l),r===!1||!l.defaultPrevented)return t?.(l)}}function Xb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _d(...e){return t=>{let r=!1;const o=e.map(l=>{const u=Xb(l,t);return!r&&typeof u=="function"&&(r=!0),u});if(r)return()=>{for(let l=0;l<o.length;l++){const u=o[l];typeof u=="function"?u():Xb(e[l],null)}}}}function Le(...e){return x.useCallback(_d(...e),e)}function S_(e,t){const r=x.createContext(t),o=u=>{const{children:d,...f}=u,m=x.useMemo(()=>f,Object.values(f));return a.jsx(r.Provider,{value:m,children:d})};o.displayName=e+"Provider";function l(u){const d=x.useContext(r);if(d)return d;if(t!==void 0)return t;throw new Error(`\`${u}\` must be used within \`${e}\``)}return[o,l]}function Qt(e,t=[]){let r=[];function o(u,d){const f=x.createContext(d),m=r.length;r=[...r,d];const p=y=>{const{scope:b,children:S,...N}=y,w=b?.[e]?.[m]||f,C=x.useMemo(()=>N,Object.values(N));return a.jsx(w.Provider,{value:C,children:S})};p.displayName=u+"Provider";function v(y,b){const S=b?.[e]?.[m]||f,N=x.useContext(S);if(N)return N;if(d!==void 0)return d;throw new Error(`\`${y}\` must be used within \`${u}\``)}return[p,v]}const l=()=>{const u=r.map(d=>x.createContext(d));return function(f){const m=f?.[e]||u;return x.useMemo(()=>({[`__scope${e}`]:{...f,[e]:m}}),[f,m])}};return l.scopeName=e,[o,k_(l,...t)]}function k_(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const o=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(u){const d=o.reduce((f,{useScope:m,scopeName:p})=>{const y=m(u)[`__scope${p}`];return{...f,...y}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:d}),[d])}};return r.scopeName=t.scopeName,r}function Ws(e){const t=C_(e),r=x.forwardRef((o,l)=>{const{children:u,...d}=o,f=x.Children.toArray(u),m=f.find(E_);if(m){const p=m.props.children,v=f.map(y=>y===m?x.Children.count(p)>1?x.Children.only(null):x.isValidElement(p)?p.props.children:null:y);return a.jsx(t,{...d,ref:l,children:x.isValidElement(p)?x.cloneElement(p,void 0,v):null})}return a.jsx(t,{...d,ref:l,children:u})});return r.displayName=`${e}.Slot`,r}var ij=Ws("Slot");function C_(e){const t=x.forwardRef((r,o)=>{const{children:l,...u}=r;if(x.isValidElement(l)){const d=R_(l),f=A_(u,l.props);return l.type!==x.Fragment&&(f.ref=o?_d(o,d):d),x.cloneElement(l,f)}return x.Children.count(l)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lj=Symbol("radix.slottable");function cj(e){const t=({children:r})=>a.jsx(a.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=lj,t}function E_(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lj}function A_(e,t){const r={...t};for(const o in t){const l=e[o],u=t[o];/^on[A-Z]/.test(o)?l&&u?r[o]=(...f)=>{const m=u(...f);return l(...f),m}:l&&(r[o]=l):o==="style"?r[o]={...l,...u}:o==="className"&&(r[o]=[l,u].filter(Boolean).join(" "))}return{...e,...r}}function R_(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var T_=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ee=T_.reduce((e,t)=>{const r=Ws(`Primitive.${t}`),o=x.forwardRef((l,u)=>{const{asChild:d,...f}=l,m=d?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(m,{...f,ref:u})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function uj(e,t){e&&mi.flushSync(()=>e.dispatchEvent(t))}function un(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...r)=>t.current?.(...r),[])}function __(e,t=globalThis?.document){const r=un(e);x.useEffect(()=>{const o=l=>{l.key==="Escape"&&r(l)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[r,t])}var M_="DismissableLayer",gp="dismissableLayer.update",D_="dismissableLayer.pointerDownOutside",O_="dismissableLayer.focusOutside",Wb,dj=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wl=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,onDismiss:f,...m}=e,p=x.useContext(dj),[v,y]=x.useState(null),b=v?.ownerDocument??globalThis?.document,[,S]=x.useState({}),N=Le(t,$=>y($)),w=Array.from(p.layers),[C]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),k=w.indexOf(C),E=v?w.indexOf(v):-1,R=p.layersWithOutsidePointerEventsDisabled.size>0,T=E>=k,z=L_($=>{const V=$.target,J=[...p.branches].some(se=>se.contains(V));!T||J||(l?.($),d?.($),$.defaultPrevented||f?.())},b),ne=$_($=>{const V=$.target;[...p.branches].some(se=>se.contains(V))||(u?.($),d?.($),$.defaultPrevented||f?.())},b);return __($=>{E===p.layers.size-1&&(o?.($),!$.defaultPrevented&&f&&($.preventDefault(),f()))},b),x.useEffect(()=>{if(v)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(Wb=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(v)),p.layers.add(v),Jb(),()=>{r&&p.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=Wb)}},[v,b,r,p]),x.useEffect(()=>()=>{v&&(p.layers.delete(v),p.layersWithOutsidePointerEventsDisabled.delete(v),Jb())},[v,p]),x.useEffect(()=>{const $=()=>S({});return document.addEventListener(gp,$),()=>document.removeEventListener(gp,$)},[]),a.jsx(Ee.div,{...m,ref:N,style:{pointerEvents:R?T?"auto":"none":void 0,...e.style},onFocusCapture:be(e.onFocusCapture,ne.onFocusCapture),onBlurCapture:be(e.onBlurCapture,ne.onBlurCapture),onPointerDownCapture:be(e.onPointerDownCapture,z.onPointerDownCapture)})});Wl.displayName=M_;var z_="DismissableLayerBranch",P_=x.forwardRef((e,t)=>{const r=x.useContext(dj),o=x.useRef(null),l=Le(t,o);return x.useEffect(()=>{const u=o.current;if(u)return r.branches.add(u),()=>{r.branches.delete(u)}},[r.branches]),a.jsx(Ee.div,{...e,ref:l})});P_.displayName=z_;function L_(e,t=globalThis?.document){const r=un(e),o=x.useRef(!1),l=x.useRef(()=>{});return x.useEffect(()=>{const u=f=>{if(f.target&&!o.current){let m=function(){fj(D_,r,p,{discrete:!0})};const p={originalEvent:f};f.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=m,t.addEventListener("click",l.current,{once:!0})):m()}else t.removeEventListener("click",l.current);o.current=!1},d=window.setTimeout(()=>{t.addEventListener("pointerdown",u)},0);return()=>{window.clearTimeout(d),t.removeEventListener("pointerdown",u),t.removeEventListener("click",l.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function $_(e,t=globalThis?.document){const r=un(e),o=x.useRef(!1);return x.useEffect(()=>{const l=u=>{u.target&&!o.current&&fj(O_,r,{originalEvent:u},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Jb(){const e=new CustomEvent(gp);document.dispatchEvent(e)}function fj(e,t,r,{discrete:o}){const l=r.originalEvent.target,u=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&l.addEventListener(e,t,{once:!0}),o?uj(l,u):l.dispatchEvent(u)}var Vt=globalThis?.document?x.useLayoutEffect:()=>{},I_=nx[" useId ".trim().toString()]||(()=>{}),U_=0;function nr(e){const[t,r]=x.useState(I_());return Vt(()=>{r(o=>o??String(U_++))},[e]),t?`radix-${t}`:""}const B_=["top","right","bottom","left"],ds=Math.min,er=Math.max,td=Math.round,Su=Math.floor,Zr=e=>({x:e,y:e}),V_={left:"right",right:"left",bottom:"top",top:"bottom"},H_={start:"end",end:"start"};function vp(e,t,r){return er(e,ds(t,r))}function ka(e,t){return typeof e=="function"?e(t):e}function Ca(e){return e.split("-")[0]}function pi(e){return e.split("-")[1]}function ux(e){return e==="x"?"y":"x"}function dx(e){return e==="y"?"height":"width"}const F_=new Set(["top","bottom"]);function qr(e){return F_.has(Ca(e))?"y":"x"}function fx(e){return ux(qr(e))}function q_(e,t,r){r===void 0&&(r=!1);const o=pi(e),l=fx(e),u=dx(l);let d=l==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[u]>t.floating[u]&&(d=nd(d)),[d,nd(d)]}function Y_(e){const t=nd(e);return[yp(e),t,yp(t)]}function yp(e){return e.replace(/start|end/g,t=>H_[t])}const ew=["left","right"],tw=["right","left"],Z_=["top","bottom"],G_=["bottom","top"];function K_(e,t,r){switch(e){case"top":case"bottom":return r?t?tw:ew:t?ew:tw;case"left":case"right":return t?Z_:G_;default:return[]}}function Q_(e,t,r,o){const l=pi(e);let u=K_(Ca(e),r==="start",o);return l&&(u=u.map(d=>d+"-"+l),t&&(u=u.concat(u.map(yp)))),u}function nd(e){return e.replace(/left|right|bottom|top/g,t=>V_[t])}function X_(e){return{top:0,right:0,bottom:0,left:0,...e}}function hj(e){return typeof e!="number"?X_(e):{top:e,right:e,bottom:e,left:e}}function rd(e){const{x:t,y:r,width:o,height:l}=e;return{width:o,height:l,top:r,left:t,right:t+o,bottom:r+l,x:t,y:r}}function nw(e,t,r){let{reference:o,floating:l}=e;const u=qr(t),d=fx(t),f=dx(d),m=Ca(t),p=u==="y",v=o.x+o.width/2-l.width/2,y=o.y+o.height/2-l.height/2,b=o[f]/2-l[f]/2;let S;switch(m){case"top":S={x:v,y:o.y-l.height};break;case"bottom":S={x:v,y:o.y+o.height};break;case"right":S={x:o.x+o.width,y};break;case"left":S={x:o.x-l.width,y};break;default:S={x:o.x,y:o.y}}switch(pi(t)){case"start":S[d]-=b*(r&&p?-1:1);break;case"end":S[d]+=b*(r&&p?-1:1);break}return S}const W_=async(e,t,r)=>{const{placement:o="bottom",strategy:l="absolute",middleware:u=[],platform:d}=r,f=u.filter(Boolean),m=await(d.isRTL==null?void 0:d.isRTL(t));let p=await d.getElementRects({reference:e,floating:t,strategy:l}),{x:v,y}=nw(p,o,m),b=o,S={},N=0;for(let w=0;w<f.length;w++){const{name:C,fn:k}=f[w],{x:E,y:R,data:T,reset:z}=await k({x:v,y,initialPlacement:o,placement:b,strategy:l,middlewareData:S,rects:p,platform:d,elements:{reference:e,floating:t}});v=E??v,y=R??y,S={...S,[C]:{...S[C],...T}},z&&N<=50&&(N++,typeof z=="object"&&(z.placement&&(b=z.placement),z.rects&&(p=z.rects===!0?await d.getElementRects({reference:e,floating:t,strategy:l}):z.rects),{x:v,y}=nw(p,b,m)),w=-1)}return{x:v,y,placement:b,strategy:l,middlewareData:S}};async function Ul(e,t){var r;t===void 0&&(t={});const{x:o,y:l,platform:u,rects:d,elements:f,strategy:m}=e,{boundary:p="clippingAncestors",rootBoundary:v="viewport",elementContext:y="floating",altBoundary:b=!1,padding:S=0}=ka(t,e),N=hj(S),C=f[b?y==="floating"?"reference":"floating":y],k=rd(await u.getClippingRect({element:(r=await(u.isElement==null?void 0:u.isElement(C)))==null||r?C:C.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(f.floating)),boundary:p,rootBoundary:v,strategy:m})),E=y==="floating"?{x:o,y:l,width:d.floating.width,height:d.floating.height}:d.reference,R=await(u.getOffsetParent==null?void 0:u.getOffsetParent(f.floating)),T=await(u.isElement==null?void 0:u.isElement(R))?await(u.getScale==null?void 0:u.getScale(R))||{x:1,y:1}:{x:1,y:1},z=rd(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:E,offsetParent:R,strategy:m}):E);return{top:(k.top-z.top+N.top)/T.y,bottom:(z.bottom-k.bottom+N.bottom)/T.y,left:(k.left-z.left+N.left)/T.x,right:(z.right-k.right+N.right)/T.x}}const J_=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:o,placement:l,rects:u,platform:d,elements:f,middlewareData:m}=t,{element:p,padding:v=0}=ka(e,t)||{};if(p==null)return{};const y=hj(v),b={x:r,y:o},S=fx(l),N=dx(S),w=await d.getDimensions(p),C=S==="y",k=C?"top":"left",E=C?"bottom":"right",R=C?"clientHeight":"clientWidth",T=u.reference[N]+u.reference[S]-b[S]-u.floating[N],z=b[S]-u.reference[S],ne=await(d.getOffsetParent==null?void 0:d.getOffsetParent(p));let $=ne?ne[R]:0;(!$||!await(d.isElement==null?void 0:d.isElement(ne)))&&($=f.floating[R]||u.floating[N]);const V=T/2-z/2,J=$/2-w[N]/2-1,se=ds(y[k],J),ie=ds(y[E],J),te=se,q=$-w[N]-ie,de=$/2-w[N]/2+V,me=vp(te,de,q),O=!m.arrow&&pi(l)!=null&&de!==me&&u.reference[N]/2-(de<te?se:ie)-w[N]/2<0,L=O?de<te?de-te:de-q:0;return{[S]:b[S]+L,data:{[S]:me,centerOffset:de-me-L,...O&&{alignmentOffset:L}},reset:O}}}),eM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,o;const{placement:l,middlewareData:u,rects:d,initialPlacement:f,platform:m,elements:p}=t,{mainAxis:v=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:N="none",flipAlignment:w=!0,...C}=ka(e,t);if((r=u.arrow)!=null&&r.alignmentOffset)return{};const k=Ca(l),E=qr(f),R=Ca(f)===f,T=await(m.isRTL==null?void 0:m.isRTL(p.floating)),z=b||(R||!w?[nd(f)]:Y_(f)),ne=N!=="none";!b&&ne&&z.push(...Q_(f,w,N,T));const $=[f,...z],V=await Ul(t,C),J=[];let se=((o=u.flip)==null?void 0:o.overflows)||[];if(v&&J.push(V[k]),y){const de=q_(l,d,T);J.push(V[de[0]],V[de[1]])}if(se=[...se,{placement:l,overflows:J}],!J.every(de=>de<=0)){var ie,te;const de=(((ie=u.flip)==null?void 0:ie.index)||0)+1,me=$[de];if(me&&(!(y==="alignment"?E!==qr(me):!1)||se.every(F=>qr(F.placement)===E?F.overflows[0]>0:!0)))return{data:{index:de,overflows:se},reset:{placement:me}};let O=(te=se.filter(L=>L.overflows[0]<=0).sort((L,F)=>L.overflows[1]-F.overflows[1])[0])==null?void 0:te.placement;if(!O)switch(S){case"bestFit":{var q;const L=(q=se.filter(F=>{if(ne){const Q=qr(F.placement);return Q===E||Q==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(Q=>Q>0).reduce((Q,_)=>Q+_,0)]).sort((F,Q)=>F[1]-Q[1])[0])==null?void 0:q[0];L&&(O=L);break}case"initialPlacement":O=f;break}if(l!==O)return{reset:{placement:O}}}return{}}}};function rw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function aw(e){return B_.some(t=>e[t]>=0)}const tM=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:o="referenceHidden",...l}=ka(e,t);switch(o){case"referenceHidden":{const u=await Ul(t,{...l,elementContext:"reference"}),d=rw(u,r.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:aw(d)}}}case"escaped":{const u=await Ul(t,{...l,altBoundary:!0}),d=rw(u,r.floating);return{data:{escapedOffsets:d,escaped:aw(d)}}}default:return{}}}}},mj=new Set(["left","top"]);async function nM(e,t){const{placement:r,platform:o,elements:l}=e,u=await(o.isRTL==null?void 0:o.isRTL(l.floating)),d=Ca(r),f=pi(r),m=qr(r)==="y",p=mj.has(d)?-1:1,v=u&&m?-1:1,y=ka(t,e);let{mainAxis:b,crossAxis:S,alignmentAxis:N}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return f&&typeof N=="number"&&(S=f==="end"?N*-1:N),m?{x:S*v,y:b*p}:{x:b*p,y:S*v}}const rM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,o;const{x:l,y:u,placement:d,middlewareData:f}=t,m=await nM(t,e);return d===((r=f.offset)==null?void 0:r.placement)&&(o=f.arrow)!=null&&o.alignmentOffset?{}:{x:l+m.x,y:u+m.y,data:{...m,placement:d}}}}},aM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:o,placement:l}=t,{mainAxis:u=!0,crossAxis:d=!1,limiter:f={fn:C=>{let{x:k,y:E}=C;return{x:k,y:E}}},...m}=ka(e,t),p={x:r,y:o},v=await Ul(t,m),y=qr(Ca(l)),b=ux(y);let S=p[b],N=p[y];if(u){const C=b==="y"?"top":"left",k=b==="y"?"bottom":"right",E=S+v[C],R=S-v[k];S=vp(E,S,R)}if(d){const C=y==="y"?"top":"left",k=y==="y"?"bottom":"right",E=N+v[C],R=N-v[k];N=vp(E,N,R)}const w=f.fn({...t,[b]:S,[y]:N});return{...w,data:{x:w.x-r,y:w.y-o,enabled:{[b]:u,[y]:d}}}}}},sM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:o,placement:l,rects:u,middlewareData:d}=t,{offset:f=0,mainAxis:m=!0,crossAxis:p=!0}=ka(e,t),v={x:r,y:o},y=qr(l),b=ux(y);let S=v[b],N=v[y];const w=ka(f,t),C=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(m){const R=b==="y"?"height":"width",T=u.reference[b]-u.floating[R]+C.mainAxis,z=u.reference[b]+u.reference[R]-C.mainAxis;S<T?S=T:S>z&&(S=z)}if(p){var k,E;const R=b==="y"?"width":"height",T=mj.has(Ca(l)),z=u.reference[y]-u.floating[R]+(T&&((k=d.offset)==null?void 0:k[y])||0)+(T?0:C.crossAxis),ne=u.reference[y]+u.reference[R]+(T?0:((E=d.offset)==null?void 0:E[y])||0)-(T?C.crossAxis:0);N<z?N=z:N>ne&&(N=ne)}return{[b]:S,[y]:N}}}},oM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,o;const{placement:l,rects:u,platform:d,elements:f}=t,{apply:m=()=>{},...p}=ka(e,t),v=await Ul(t,p),y=Ca(l),b=pi(l),S=qr(l)==="y",{width:N,height:w}=u.floating;let C,k;y==="top"||y==="bottom"?(C=y,k=b===(await(d.isRTL==null?void 0:d.isRTL(f.floating))?"start":"end")?"left":"right"):(k=y,C=b==="end"?"top":"bottom");const E=w-v.top-v.bottom,R=N-v.left-v.right,T=ds(w-v[C],E),z=ds(N-v[k],R),ne=!t.middlewareData.shift;let $=T,V=z;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(V=R),(o=t.middlewareData.shift)!=null&&o.enabled.y&&($=E),ne&&!b){const se=er(v.left,0),ie=er(v.right,0),te=er(v.top,0),q=er(v.bottom,0);S?V=N-2*(se!==0||ie!==0?se+ie:er(v.left,v.right)):$=w-2*(te!==0||q!==0?te+q:er(v.top,v.bottom))}await m({...t,availableWidth:V,availableHeight:$});const J=await d.getDimensions(f.floating);return N!==J.width||w!==J.height?{reset:{rects:!0}}:{}}}};function Md(){return typeof window<"u"}function xi(e){return pj(e)?(e.nodeName||"").toLowerCase():"#document"}function rr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Jr(e){var t;return(t=(pj(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pj(e){return Md()?e instanceof Node||e instanceof rr(e).Node:!1}function Tr(e){return Md()?e instanceof Element||e instanceof rr(e).Element:!1}function Wr(e){return Md()?e instanceof HTMLElement||e instanceof rr(e).HTMLElement:!1}function sw(e){return!Md()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof rr(e).ShadowRoot}const iM=new Set(["inline","contents"]);function Jl(e){const{overflow:t,overflowX:r,overflowY:o,display:l}=_r(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&!iM.has(l)}const lM=new Set(["table","td","th"]);function cM(e){return lM.has(xi(e))}const uM=[":popover-open",":modal"];function Dd(e){return uM.some(t=>{try{return e.matches(t)}catch{return!1}})}const dM=["transform","translate","scale","rotate","perspective"],fM=["transform","translate","scale","rotate","perspective","filter"],hM=["paint","layout","strict","content"];function hx(e){const t=mx(),r=Tr(e)?_r(e):e;return dM.some(o=>r[o]?r[o]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||fM.some(o=>(r.willChange||"").includes(o))||hM.some(o=>(r.contain||"").includes(o))}function mM(e){let t=fs(e);for(;Wr(t)&&!ii(t);){if(hx(t))return t;if(Dd(t))return null;t=fs(t)}return null}function mx(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const pM=new Set(["html","body","#document"]);function ii(e){return pM.has(xi(e))}function _r(e){return rr(e).getComputedStyle(e)}function Od(e){return Tr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function fs(e){if(xi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||sw(e)&&e.host||Jr(e);return sw(t)?t.host:t}function xj(e){const t=fs(e);return ii(t)?e.ownerDocument?e.ownerDocument.body:e.body:Wr(t)&&Jl(t)?t:xj(t)}function Bl(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);const l=xj(e),u=l===((o=e.ownerDocument)==null?void 0:o.body),d=rr(l);if(u){const f=bp(d);return t.concat(d,d.visualViewport||[],Jl(l)?l:[],f&&r?Bl(f):[])}return t.concat(l,Bl(l,[],r))}function bp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gj(e){const t=_r(e);let r=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const l=Wr(e),u=l?e.offsetWidth:r,d=l?e.offsetHeight:o,f=td(r)!==u||td(o)!==d;return f&&(r=u,o=d),{width:r,height:o,$:f}}function px(e){return Tr(e)?e:e.contextElement}function ri(e){const t=px(e);if(!Wr(t))return Zr(1);const r=t.getBoundingClientRect(),{width:o,height:l,$:u}=gj(t);let d=(u?td(r.width):r.width)/o,f=(u?td(r.height):r.height)/l;return(!d||!Number.isFinite(d))&&(d=1),(!f||!Number.isFinite(f))&&(f=1),{x:d,y:f}}const xM=Zr(0);function vj(e){const t=rr(e);return!mx()||!t.visualViewport?xM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gM(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==rr(e)?!1:t}function Js(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);const l=e.getBoundingClientRect(),u=px(e);let d=Zr(1);t&&(o?Tr(o)&&(d=ri(o)):d=ri(e));const f=gM(u,r,o)?vj(u):Zr(0);let m=(l.left+f.x)/d.x,p=(l.top+f.y)/d.y,v=l.width/d.x,y=l.height/d.y;if(u){const b=rr(u),S=o&&Tr(o)?rr(o):o;let N=b,w=bp(N);for(;w&&o&&S!==N;){const C=ri(w),k=w.getBoundingClientRect(),E=_r(w),R=k.left+(w.clientLeft+parseFloat(E.paddingLeft))*C.x,T=k.top+(w.clientTop+parseFloat(E.paddingTop))*C.y;m*=C.x,p*=C.y,v*=C.x,y*=C.y,m+=R,p+=T,N=rr(w),w=bp(N)}}return rd({width:v,height:y,x:m,y:p})}function xx(e,t){const r=Od(e).scrollLeft;return t?t.left+r:Js(Jr(e)).left+r}function yj(e,t,r){r===void 0&&(r=!1);const o=e.getBoundingClientRect(),l=o.left+t.scrollLeft-(r?0:xx(e,o)),u=o.top+t.scrollTop;return{x:l,y:u}}function vM(e){let{elements:t,rect:r,offsetParent:o,strategy:l}=e;const u=l==="fixed",d=Jr(o),f=t?Dd(t.floating):!1;if(o===d||f&&u)return r;let m={scrollLeft:0,scrollTop:0},p=Zr(1);const v=Zr(0),y=Wr(o);if((y||!y&&!u)&&((xi(o)!=="body"||Jl(d))&&(m=Od(o)),Wr(o))){const S=Js(o);p=ri(o),v.x=S.x+o.clientLeft,v.y=S.y+o.clientTop}const b=d&&!y&&!u?yj(d,m,!0):Zr(0);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-m.scrollLeft*p.x+v.x+b.x,y:r.y*p.y-m.scrollTop*p.y+v.y+b.y}}function yM(e){return Array.from(e.getClientRects())}function bM(e){const t=Jr(e),r=Od(e),o=e.ownerDocument.body,l=er(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),u=er(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let d=-r.scrollLeft+xx(e);const f=-r.scrollTop;return _r(o).direction==="rtl"&&(d+=er(t.clientWidth,o.clientWidth)-l),{width:l,height:u,x:d,y:f}}function wM(e,t){const r=rr(e),o=Jr(e),l=r.visualViewport;let u=o.clientWidth,d=o.clientHeight,f=0,m=0;if(l){u=l.width,d=l.height;const p=mx();(!p||p&&t==="fixed")&&(f=l.offsetLeft,m=l.offsetTop)}return{width:u,height:d,x:f,y:m}}const jM=new Set(["absolute","fixed"]);function NM(e,t){const r=Js(e,!0,t==="fixed"),o=r.top+e.clientTop,l=r.left+e.clientLeft,u=Wr(e)?ri(e):Zr(1),d=e.clientWidth*u.x,f=e.clientHeight*u.y,m=l*u.x,p=o*u.y;return{width:d,height:f,x:m,y:p}}function ow(e,t,r){let o;if(t==="viewport")o=wM(e,r);else if(t==="document")o=bM(Jr(e));else if(Tr(t))o=NM(t,r);else{const l=vj(e);o={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return rd(o)}function bj(e,t){const r=fs(e);return r===t||!Tr(r)||ii(r)?!1:_r(r).position==="fixed"||bj(r,t)}function SM(e,t){const r=t.get(e);if(r)return r;let o=Bl(e,[],!1).filter(f=>Tr(f)&&xi(f)!=="body"),l=null;const u=_r(e).position==="fixed";let d=u?fs(e):e;for(;Tr(d)&&!ii(d);){const f=_r(d),m=hx(d);!m&&f.position==="fixed"&&(l=null),(u?!m&&!l:!m&&f.position==="static"&&!!l&&jM.has(l.position)||Jl(d)&&!m&&bj(e,d))?o=o.filter(v=>v!==d):l=f,d=fs(d)}return t.set(e,o),o}function kM(e){let{element:t,boundary:r,rootBoundary:o,strategy:l}=e;const d=[...r==="clippingAncestors"?Dd(t)?[]:SM(t,this._c):[].concat(r),o],f=d[0],m=d.reduce((p,v)=>{const y=ow(t,v,l);return p.top=er(y.top,p.top),p.right=ds(y.right,p.right),p.bottom=ds(y.bottom,p.bottom),p.left=er(y.left,p.left),p},ow(t,f,l));return{width:m.right-m.left,height:m.bottom-m.top,x:m.left,y:m.top}}function CM(e){const{width:t,height:r}=gj(e);return{width:t,height:r}}function EM(e,t,r){const o=Wr(t),l=Jr(t),u=r==="fixed",d=Js(e,!0,u,t);let f={scrollLeft:0,scrollTop:0};const m=Zr(0);function p(){m.x=xx(l)}if(o||!o&&!u)if((xi(t)!=="body"||Jl(l))&&(f=Od(t)),o){const S=Js(t,!0,u,t);m.x=S.x+t.clientLeft,m.y=S.y+t.clientTop}else l&&p();u&&!o&&l&&p();const v=l&&!o&&!u?yj(l,f):Zr(0),y=d.left+f.scrollLeft-m.x-v.x,b=d.top+f.scrollTop-m.y-v.y;return{x:y,y:b,width:d.width,height:d.height}}function Fm(e){return _r(e).position==="static"}function iw(e,t){if(!Wr(e)||_r(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Jr(e)===r&&(r=r.ownerDocument.body),r}function wj(e,t){const r=rr(e);if(Dd(e))return r;if(!Wr(e)){let l=fs(e);for(;l&&!ii(l);){if(Tr(l)&&!Fm(l))return l;l=fs(l)}return r}let o=iw(e,t);for(;o&&cM(o)&&Fm(o);)o=iw(o,t);return o&&ii(o)&&Fm(o)&&!hx(o)?r:o||mM(e)||r}const AM=async function(e){const t=this.getOffsetParent||wj,r=this.getDimensions,o=await r(e.floating);return{reference:EM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function RM(e){return _r(e).direction==="rtl"}const TM={convertOffsetParentRelativeRectToViewportRelativeRect:vM,getDocumentElement:Jr,getClippingRect:kM,getOffsetParent:wj,getElementRects:AM,getClientRects:yM,getDimensions:CM,getScale:ri,isElement:Tr,isRTL:RM};function jj(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function _M(e,t){let r=null,o;const l=Jr(e);function u(){var f;clearTimeout(o),(f=r)==null||f.disconnect(),r=null}function d(f,m){f===void 0&&(f=!1),m===void 0&&(m=1),u();const p=e.getBoundingClientRect(),{left:v,top:y,width:b,height:S}=p;if(f||t(),!b||!S)return;const N=Su(y),w=Su(l.clientWidth-(v+b)),C=Su(l.clientHeight-(y+S)),k=Su(v),R={rootMargin:-N+"px "+-w+"px "+-C+"px "+-k+"px",threshold:er(0,ds(1,m))||1};let T=!0;function z(ne){const $=ne[0].intersectionRatio;if($!==m){if(!T)return d();$?d(!1,$):o=setTimeout(()=>{d(!1,1e-7)},1e3)}$===1&&!jj(p,e.getBoundingClientRect())&&d(),T=!1}try{r=new IntersectionObserver(z,{...R,root:l.ownerDocument})}catch{r=new IntersectionObserver(z,R)}r.observe(e)}return d(!0),u}function MM(e,t,r,o){o===void 0&&(o={});const{ancestorScroll:l=!0,ancestorResize:u=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:m=!1}=o,p=px(e),v=l||u?[...p?Bl(p):[],...Bl(t)]:[];v.forEach(k=>{l&&k.addEventListener("scroll",r,{passive:!0}),u&&k.addEventListener("resize",r)});const y=p&&f?_M(p,r):null;let b=-1,S=null;d&&(S=new ResizeObserver(k=>{let[E]=k;E&&E.target===p&&S&&(S.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var R;(R=S)==null||R.observe(t)})),r()}),p&&!m&&S.observe(p),S.observe(t));let N,w=m?Js(e):null;m&&C();function C(){const k=Js(e);w&&!jj(w,k)&&r(),w=k,N=requestAnimationFrame(C)}return r(),()=>{var k;v.forEach(E=>{l&&E.removeEventListener("scroll",r),u&&E.removeEventListener("resize",r)}),y?.(),(k=S)==null||k.disconnect(),S=null,m&&cancelAnimationFrame(N)}}const DM=rM,OM=aM,zM=eM,PM=oM,LM=tM,lw=J_,$M=sM,IM=(e,t,r)=>{const o=new Map,l={platform:TM,...r},u={...l.platform,_c:o};return W_(e,t,{...l,platform:u})};var UM=typeof document<"u",BM=function(){},Vu=UM?x.useLayoutEffect:BM;function ad(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,o,l;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(o=r;o--!==0;)if(!ad(e[o],t[o]))return!1;return!0}if(l=Object.keys(e),r=l.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!{}.hasOwnProperty.call(t,l[o]))return!1;for(o=r;o--!==0;){const u=l[o];if(!(u==="_owner"&&e.$$typeof)&&!ad(e[u],t[u]))return!1}return!0}return e!==e&&t!==t}function Nj(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cw(e,t){const r=Nj(e);return Math.round(t*r)/r}function qm(e){const t=x.useRef(e);return Vu(()=>{t.current=e}),t}function VM(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:o=[],platform:l,elements:{reference:u,floating:d}={},transform:f=!0,whileElementsMounted:m,open:p}=e,[v,y]=x.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[b,S]=x.useState(o);ad(b,o)||S(o);const[N,w]=x.useState(null),[C,k]=x.useState(null),E=x.useCallback(F=>{F!==ne.current&&(ne.current=F,w(F))},[]),R=x.useCallback(F=>{F!==$.current&&($.current=F,k(F))},[]),T=u||N,z=d||C,ne=x.useRef(null),$=x.useRef(null),V=x.useRef(v),J=m!=null,se=qm(m),ie=qm(l),te=qm(p),q=x.useCallback(()=>{if(!ne.current||!$.current)return;const F={placement:t,strategy:r,middleware:b};ie.current&&(F.platform=ie.current),IM(ne.current,$.current,F).then(Q=>{const _={...Q,isPositioned:te.current!==!1};de.current&&!ad(V.current,_)&&(V.current=_,mi.flushSync(()=>{y(_)}))})},[b,t,r,ie,te]);Vu(()=>{p===!1&&V.current.isPositioned&&(V.current.isPositioned=!1,y(F=>({...F,isPositioned:!1})))},[p]);const de=x.useRef(!1);Vu(()=>(de.current=!0,()=>{de.current=!1}),[]),Vu(()=>{if(T&&(ne.current=T),z&&($.current=z),T&&z){if(se.current)return se.current(T,z,q);q()}},[T,z,q,se,J]);const me=x.useMemo(()=>({reference:ne,floating:$,setReference:E,setFloating:R}),[E,R]),O=x.useMemo(()=>({reference:T,floating:z}),[T,z]),L=x.useMemo(()=>{const F={position:r,left:0,top:0};if(!O.floating)return F;const Q=cw(O.floating,v.x),_=cw(O.floating,v.y);return f?{...F,transform:"translate("+Q+"px, "+_+"px)",...Nj(O.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Q,top:_}},[r,f,O.floating,v.x,v.y]);return x.useMemo(()=>({...v,update:q,refs:me,elements:O,floatingStyles:L}),[v,q,me,O,L])}const HM=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:o,padding:l}=typeof e=="function"?e(r):e;return o&&t(o)?o.current!=null?lw({element:o.current,padding:l}).fn(r):{}:o?lw({element:o,padding:l}).fn(r):{}}}},FM=(e,t)=>({...DM(e),options:[e,t]}),qM=(e,t)=>({...OM(e),options:[e,t]}),YM=(e,t)=>({...$M(e),options:[e,t]}),ZM=(e,t)=>({...zM(e),options:[e,t]}),GM=(e,t)=>({...PM(e),options:[e,t]}),KM=(e,t)=>({...LM(e),options:[e,t]}),QM=(e,t)=>({...HM(e),options:[e,t]});var XM="Arrow",Sj=x.forwardRef((e,t)=>{const{children:r,width:o=10,height:l=5,...u}=e;return a.jsx(Ee.svg,{...u,ref:t,width:o,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});Sj.displayName=XM;var WM=Sj;function ec(e){const[t,r]=x.useState(void 0);return Vt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(l=>{if(!Array.isArray(l)||!l.length)return;const u=l[0];let d,f;if("borderBoxSize"in u){const m=u.borderBoxSize,p=Array.isArray(m)?m[0]:m;d=p.inlineSize,f=p.blockSize}else d=e.offsetWidth,f=e.offsetHeight;r({width:d,height:f})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else r(void 0)},[e]),t}var gx="Popper",[kj,gi]=Qt(gx),[JM,Cj]=kj(gx),Ej=e=>{const{__scopePopper:t,children:r}=e,[o,l]=x.useState(null);return a.jsx(JM,{scope:t,anchor:o,onAnchorChange:l,children:r})};Ej.displayName=gx;var Aj="PopperAnchor",Rj=x.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:o,...l}=e,u=Cj(Aj,r),d=x.useRef(null),f=Le(t,d);return x.useEffect(()=>{u.onAnchorChange(o?.current||d.current)}),o?null:a.jsx(Ee.div,{...l,ref:f})});Rj.displayName=Aj;var vx="PopperContent",[eD,tD]=kj(vx),Tj=x.forwardRef((e,t)=>{const{__scopePopper:r,side:o="bottom",sideOffset:l=0,align:u="center",alignOffset:d=0,arrowPadding:f=0,avoidCollisions:m=!0,collisionBoundary:p=[],collisionPadding:v=0,sticky:y="partial",hideWhenDetached:b=!1,updatePositionStrategy:S="optimized",onPlaced:N,...w}=e,C=Cj(vx,r),[k,E]=x.useState(null),R=Le(t,M=>E(M)),[T,z]=x.useState(null),ne=ec(T),$=ne?.width??0,V=ne?.height??0,J=o+(u!=="center"?"-"+u:""),se=typeof v=="number"?v:{top:0,right:0,bottom:0,left:0,...v},ie=Array.isArray(p)?p:[p],te=ie.length>0,q={padding:se,boundary:ie.filter(rD),altBoundary:te},{refs:de,floatingStyles:me,placement:O,isPositioned:L,middlewareData:F}=VM({strategy:"fixed",placement:J,whileElementsMounted:(...M)=>MM(...M,{animationFrame:S==="always"}),elements:{reference:C.anchor},middleware:[FM({mainAxis:l+V,alignmentAxis:d}),m&&qM({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?YM():void 0,...q}),m&&ZM({...q}),GM({...q,apply:({elements:M,rects:he,availableWidth:Be,availableHeight:He})=>{const{width:pe,height:Re}=he.reference,Ye=M.floating.style;Ye.setProperty("--radix-popper-available-width",`${Be}px`),Ye.setProperty("--radix-popper-available-height",`${He}px`),Ye.setProperty("--radix-popper-anchor-width",`${pe}px`),Ye.setProperty("--radix-popper-anchor-height",`${Re}px`)}}),T&&QM({element:T,padding:f}),aD({arrowWidth:$,arrowHeight:V}),b&&KM({strategy:"referenceHidden",...q})]}),[Q,_]=Dj(O),B=un(N);Vt(()=>{L&&B?.()},[L,B]);const ge=F.arrow?.x,fe=F.arrow?.y,ye=F.arrow?.centerOffset!==0,[_e,G]=x.useState();return Vt(()=>{k&&G(window.getComputedStyle(k).zIndex)},[k]),a.jsx("div",{ref:de.setFloating,"data-radix-popper-content-wrapper":"",style:{...me,transform:L?me.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:_e,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(" "),...F.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(eD,{scope:r,placedSide:Q,onArrowChange:z,arrowX:ge,arrowY:fe,shouldHideArrow:ye,children:a.jsx(Ee.div,{"data-side":Q,"data-align":_,...w,ref:R,style:{...w.style,animation:L?void 0:"none"}})})})});Tj.displayName=vx;var _j="PopperArrow",nD={top:"bottom",right:"left",bottom:"top",left:"right"},Mj=x.forwardRef(function(t,r){const{__scopePopper:o,...l}=t,u=tD(_j,o),d=nD[u.placedSide];return a.jsx("span",{ref:u.onArrowChange,style:{position:"absolute",left:u.arrowX,top:u.arrowY,[d]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[u.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[u.placedSide],visibility:u.shouldHideArrow?"hidden":void 0},children:a.jsx(WM,{...l,ref:r,style:{...l.style,display:"block"}})})});Mj.displayName=_j;function rD(e){return e!==null}var aD=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:o,middlewareData:l}=t,d=l.arrow?.centerOffset!==0,f=d?0:e.arrowWidth,m=d?0:e.arrowHeight,[p,v]=Dj(r),y={start:"0%",center:"50%",end:"100%"}[v],b=(l.arrow?.x??0)+f/2,S=(l.arrow?.y??0)+m/2;let N="",w="";return p==="bottom"?(N=d?y:`${b}px`,w=`${-m}px`):p==="top"?(N=d?y:`${b}px`,w=`${o.floating.height+m}px`):p==="right"?(N=`${-m}px`,w=d?y:`${S}px`):p==="left"&&(N=`${o.floating.width+m}px`,w=d?y:`${S}px`),{data:{x:N,y:w}}}});function Dj(e){const[t,r="center"]=e.split("-");return[t,r]}var yx=Ej,bx=Rj,wx=Tj,jx=Mj,sD="Portal",zd=x.forwardRef((e,t)=>{const{container:r,...o}=e,[l,u]=x.useState(!1);Vt(()=>u(!0),[]);const d=r||l&&globalThis?.document?.body;return d?ET.createPortal(a.jsx(Ee.div,{...o,ref:t}),d):null});zd.displayName=sD;function oD(e,t){return x.useReducer((r,o)=>t[r][o]??r,e)}var yn=e=>{const{present:t,children:r}=e,o=iD(t),l=typeof r=="function"?r({present:o.isPresent}):x.Children.only(r),u=Le(o.ref,lD(l));return typeof r=="function"||o.isPresent?x.cloneElement(l,{ref:u}):null};yn.displayName="Presence";function iD(e){const[t,r]=x.useState(),o=x.useRef(null),l=x.useRef(e),u=x.useRef("none"),d=e?"mounted":"unmounted",[f,m]=oD(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const p=ku(o.current);u.current=f==="mounted"?p:"none"},[f]),Vt(()=>{const p=o.current,v=l.current;if(v!==e){const b=u.current,S=ku(p);e?m("MOUNT"):S==="none"||p?.display==="none"?m("UNMOUNT"):m(v&&b!==S?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,m]),Vt(()=>{if(t){let p;const v=t.ownerDocument.defaultView??window,y=S=>{const w=ku(o.current).includes(S.animationName);if(S.target===t&&w&&(m("ANIMATION_END"),!l.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",p=v.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},b=S=>{S.target===t&&(u.current=ku(o.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{v.clearTimeout(p),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else m("ANIMATION_END")},[t,m]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:x.useCallback(p=>{o.current=p?getComputedStyle(p):null,r(p)},[])}}function ku(e){return e?.animationName||"none"}function lD(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var cD=nx[" useInsertionEffect ".trim().toString()]||Vt;function Hn({prop:e,defaultProp:t,onChange:r=()=>{},caller:o}){const[l,u,d]=uD({defaultProp:t,onChange:r}),f=e!==void 0,m=f?e:l;{const v=x.useRef(e!==void 0);x.useEffect(()=>{const y=v.current;y!==f&&console.warn(`${o} is changing from ${y?"controlled":"uncontrolled"} to ${f?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),v.current=f},[f,o])}const p=x.useCallback(v=>{if(f){const y=dD(v)?v(e):v;y!==e&&d.current?.(y)}else u(v)},[f,e,u,d]);return[m,p]}function uD({defaultProp:e,onChange:t}){const[r,o]=x.useState(e),l=x.useRef(r),u=x.useRef(t);return cD(()=>{u.current=t},[t]),x.useEffect(()=>{l.current!==r&&(u.current?.(r),l.current=r)},[r,l]),[r,o,u]}function dD(e){return typeof e=="function"}var Oj=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),fD="VisuallyHidden",zj=x.forwardRef((e,t)=>a.jsx(Ee.span,{...e,ref:t,style:{...Oj,...e.style}}));zj.displayName=fD;var hD=zj,[Pd,kV]=Qt("Tooltip",[gi]),Ld=gi(),Pj="TooltipProvider",mD=700,wp="tooltip.open",[pD,Nx]=Pd(Pj),Lj=e=>{const{__scopeTooltip:t,delayDuration:r=mD,skipDelayDuration:o=300,disableHoverableContent:l=!1,children:u}=e,d=x.useRef(!0),f=x.useRef(!1),m=x.useRef(0);return x.useEffect(()=>{const p=m.current;return()=>window.clearTimeout(p)},[]),a.jsx(pD,{scope:t,isOpenDelayedRef:d,delayDuration:r,onOpen:x.useCallback(()=>{window.clearTimeout(m.current),d.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>d.current=!0,o)},[o]),isPointerInTransitRef:f,onPointerInTransitChange:x.useCallback(p=>{f.current=p},[]),disableHoverableContent:l,children:u})};Lj.displayName=Pj;var Vl="Tooltip",[xD,$d]=Pd(Vl),$j=e=>{const{__scopeTooltip:t,children:r,open:o,defaultOpen:l,onOpenChange:u,disableHoverableContent:d,delayDuration:f}=e,m=Nx(Vl,e.__scopeTooltip),p=Ld(t),[v,y]=x.useState(null),b=nr(),S=x.useRef(0),N=d??m.disableHoverableContent,w=f??m.delayDuration,C=x.useRef(!1),[k,E]=Hn({prop:o,defaultProp:l??!1,onChange:$=>{$?(m.onOpen(),document.dispatchEvent(new CustomEvent(wp))):m.onClose(),u?.($)},caller:Vl}),R=x.useMemo(()=>k?C.current?"delayed-open":"instant-open":"closed",[k]),T=x.useCallback(()=>{window.clearTimeout(S.current),S.current=0,C.current=!1,E(!0)},[E]),z=x.useCallback(()=>{window.clearTimeout(S.current),S.current=0,E(!1)},[E]),ne=x.useCallback(()=>{window.clearTimeout(S.current),S.current=window.setTimeout(()=>{C.current=!0,E(!0),S.current=0},w)},[w,E]);return x.useEffect(()=>()=>{S.current&&(window.clearTimeout(S.current),S.current=0)},[]),a.jsx(yx,{...p,children:a.jsx(xD,{scope:t,contentId:b,open:k,stateAttribute:R,trigger:v,onTriggerChange:y,onTriggerEnter:x.useCallback(()=>{m.isOpenDelayedRef.current?ne():T()},[m.isOpenDelayedRef,ne,T]),onTriggerLeave:x.useCallback(()=>{N?z():(window.clearTimeout(S.current),S.current=0)},[z,N]),onOpen:T,onClose:z,disableHoverableContent:N,children:r})})};$j.displayName=Vl;var jp="TooltipTrigger",Ij=x.forwardRef((e,t)=>{const{__scopeTooltip:r,...o}=e,l=$d(jp,r),u=Nx(jp,r),d=Ld(r),f=x.useRef(null),m=Le(t,f,l.onTriggerChange),p=x.useRef(!1),v=x.useRef(!1),y=x.useCallback(()=>p.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",y),[y]),a.jsx(bx,{asChild:!0,...d,children:a.jsx(Ee.button,{"aria-describedby":l.open?l.contentId:void 0,"data-state":l.stateAttribute,...o,ref:m,onPointerMove:be(e.onPointerMove,b=>{b.pointerType!=="touch"&&!v.current&&!u.isPointerInTransitRef.current&&(l.onTriggerEnter(),v.current=!0)}),onPointerLeave:be(e.onPointerLeave,()=>{l.onTriggerLeave(),v.current=!1}),onPointerDown:be(e.onPointerDown,()=>{l.open&&l.onClose(),p.current=!0,document.addEventListener("pointerup",y,{once:!0})}),onFocus:be(e.onFocus,()=>{p.current||l.onOpen()}),onBlur:be(e.onBlur,l.onClose),onClick:be(e.onClick,l.onClose)})})});Ij.displayName=jp;var gD="TooltipPortal",[CV,vD]=Pd(gD,{forceMount:void 0}),li="TooltipContent",Uj=x.forwardRef((e,t)=>{const r=vD(li,e.__scopeTooltip),{forceMount:o=r.forceMount,side:l="top",...u}=e,d=$d(li,e.__scopeTooltip);return a.jsx(yn,{present:o||d.open,children:d.disableHoverableContent?a.jsx(Bj,{side:l,...u,ref:t}):a.jsx(yD,{side:l,...u,ref:t})})}),yD=x.forwardRef((e,t)=>{const r=$d(li,e.__scopeTooltip),o=Nx(li,e.__scopeTooltip),l=x.useRef(null),u=Le(t,l),[d,f]=x.useState(null),{trigger:m,onClose:p}=r,v=l.current,{onPointerInTransitChange:y}=o,b=x.useCallback(()=>{f(null),y(!1)},[y]),S=x.useCallback((N,w)=>{const C=N.currentTarget,k={x:N.clientX,y:N.clientY},E=SD(k,C.getBoundingClientRect()),R=kD(k,E),T=CD(w.getBoundingClientRect()),z=AD([...R,...T]);f(z),y(!0)},[y]);return x.useEffect(()=>()=>b(),[b]),x.useEffect(()=>{if(m&&v){const N=C=>S(C,v),w=C=>S(C,m);return m.addEventListener("pointerleave",N),v.addEventListener("pointerleave",w),()=>{m.removeEventListener("pointerleave",N),v.removeEventListener("pointerleave",w)}}},[m,v,S,b]),x.useEffect(()=>{if(d){const N=w=>{const C=w.target,k={x:w.clientX,y:w.clientY},E=m?.contains(C)||v?.contains(C),R=!ED(k,d);E?b():R&&(b(),p())};return document.addEventListener("pointermove",N),()=>document.removeEventListener("pointermove",N)}},[m,v,d,p,b]),a.jsx(Bj,{...e,ref:u})}),[bD,wD]=Pd(Vl,{isInside:!1}),jD=cj("TooltipContent"),Bj=x.forwardRef((e,t)=>{const{__scopeTooltip:r,children:o,"aria-label":l,onEscapeKeyDown:u,onPointerDownOutside:d,...f}=e,m=$d(li,r),p=Ld(r),{onClose:v}=m;return x.useEffect(()=>(document.addEventListener(wp,v),()=>document.removeEventListener(wp,v)),[v]),x.useEffect(()=>{if(m.trigger){const y=b=>{b.target?.contains(m.trigger)&&v()};return window.addEventListener("scroll",y,{capture:!0}),()=>window.removeEventListener("scroll",y,{capture:!0})}},[m.trigger,v]),a.jsx(Wl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:y=>y.preventDefault(),onDismiss:v,children:a.jsxs(wx,{"data-state":m.stateAttribute,...p,...f,ref:t,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[a.jsx(jD,{children:o}),a.jsx(bD,{scope:r,isInside:!0,children:a.jsx(hD,{id:m.contentId,role:"tooltip",children:l||o})})]})})});Uj.displayName=li;var Vj="TooltipArrow",ND=x.forwardRef((e,t)=>{const{__scopeTooltip:r,...o}=e,l=Ld(r);return wD(Vj,r).isInside?null:a.jsx(jx,{...l,...o,ref:t})});ND.displayName=Vj;function SD(e,t){const r=Math.abs(t.top-e.y),o=Math.abs(t.bottom-e.y),l=Math.abs(t.right-e.x),u=Math.abs(t.left-e.x);switch(Math.min(r,o,l,u)){case u:return"left";case l:return"right";case r:return"top";case o:return"bottom";default:throw new Error("unreachable")}}function kD(e,t,r=5){const o=[];switch(t){case"top":o.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":o.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":o.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":o.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return o}function CD(e){const{top:t,right:r,bottom:o,left:l}=e;return[{x:l,y:t},{x:r,y:t},{x:r,y:o},{x:l,y:o}]}function ED(e,t){const{x:r,y:o}=e;let l=!1;for(let u=0,d=t.length-1;u<t.length;d=u++){const f=t[u],m=t[d],p=f.x,v=f.y,y=m.x,b=m.y;v>o!=b>o&&r<(y-p)*(o-v)/(b-v)+p&&(l=!l)}return l}function AD(e){const t=e.slice();return t.sort((r,o)=>r.x<o.x?-1:r.x>o.x?1:r.y<o.y?-1:r.y>o.y?1:0),RD(t)}function RD(e){if(e.length<=1)return e.slice();const t=[];for(let o=0;o<e.length;o++){const l=e[o];for(;t.length>=2;){const u=t[t.length-1],d=t[t.length-2];if((u.x-d.x)*(l.y-d.y)>=(u.y-d.y)*(l.x-d.x))t.pop();else break}t.push(l)}t.pop();const r=[];for(let o=e.length-1;o>=0;o--){const l=e[o];for(;r.length>=2;){const u=r[r.length-1],d=r[r.length-2];if((u.x-d.x)*(l.y-d.y)>=(u.y-d.y)*(l.x-d.x))r.pop();else break}r.push(l)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var TD=Lj,_D=$j,MD=Ij,Hj=Uj;function Fj(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(r=Fj(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function qj(){for(var e,t,r=0,o="",l=arguments.length;r<l;r++)(e=arguments[r])&&(t=Fj(e))&&(o&&(o+=" "),o+=t);return o}const Sx="-",DD=e=>{const t=zD(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:d=>{const f=d.split(Sx);return f[0]===""&&f.length!==1&&f.shift(),Yj(f,t)||OD(d)},getConflictingClassGroupIds:(d,f)=>{const m=r[d]||[];return f&&o[d]?[...m,...o[d]]:m}}},Yj=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],o=t.nextPart.get(r),l=o?Yj(e.slice(1),o):void 0;if(l)return l;if(t.validators.length===0)return;const u=e.join(Sx);return t.validators.find(({validator:d})=>d(u))?.classGroupId},uw=/^\[(.+)\]$/,OD=e=>{if(uw.test(e)){const t=uw.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},zD=e=>{const{theme:t,prefix:r}=e,o={nextPart:new Map,validators:[]};return LD(Object.entries(e.classGroups),r).forEach(([u,d])=>{Np(d,o,u,t)}),o},Np=(e,t,r,o)=>{e.forEach(l=>{if(typeof l=="string"){const u=l===""?t:dw(t,l);u.classGroupId=r;return}if(typeof l=="function"){if(PD(l)){Np(l(o),t,r,o);return}t.validators.push({validator:l,classGroupId:r});return}Object.entries(l).forEach(([u,d])=>{Np(d,dw(t,u),r,o)})})},dw=(e,t)=>{let r=e;return t.split(Sx).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},PD=e=>e.isThemeGetter,LD=(e,t)=>t?e.map(([r,o])=>{const l=o.map(u=>typeof u=="string"?t+u:typeof u=="object"?Object.fromEntries(Object.entries(u).map(([d,f])=>[t+d,f])):u);return[r,l]}):e,$D=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map;const l=(u,d)=>{r.set(u,d),t++,t>e&&(t=0,o=r,r=new Map)};return{get(u){let d=r.get(u);if(d!==void 0)return d;if((d=o.get(u))!==void 0)return l(u,d),d},set(u,d){r.has(u)?r.set(u,d):l(u,d)}}},Zj="!",ID=e=>{const{separator:t,experimentalParseClassName:r}=e,o=t.length===1,l=t[0],u=t.length,d=f=>{const m=[];let p=0,v=0,y;for(let C=0;C<f.length;C++){let k=f[C];if(p===0){if(k===l&&(o||f.slice(C,C+u)===t)){m.push(f.slice(v,C)),v=C+u;continue}if(k==="/"){y=C;continue}}k==="["?p++:k==="]"&&p--}const b=m.length===0?f:f.substring(v),S=b.startsWith(Zj),N=S?b.substring(1):b,w=y&&y>v?y-v:void 0;return{modifiers:m,hasImportantModifier:S,baseClassName:N,maybePostfixModifierPosition:w}};return r?f=>r({className:f,parseClassName:d}):d},UD=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(o=>{o[0]==="["?(t.push(...r.sort(),o),r=[]):r.push(o)}),t.push(...r.sort()),t},BD=e=>({cache:$D(e.cacheSize),parseClassName:ID(e),...DD(e)}),VD=/\s+/,HD=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:l}=t,u=[],d=e.trim().split(VD);let f="";for(let m=d.length-1;m>=0;m-=1){const p=d[m],{modifiers:v,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:S}=r(p);let N=!!S,w=o(N?b.substring(0,S):b);if(!w){if(!N){f=p+(f.length>0?" "+f:f);continue}if(w=o(b),!w){f=p+(f.length>0?" "+f:f);continue}N=!1}const C=UD(v).join(":"),k=y?C+Zj:C,E=k+w;if(u.includes(E))continue;u.push(E);const R=l(w,N);for(let T=0;T<R.length;++T){const z=R[T];u.push(k+z)}f=p+(f.length>0?" "+f:f)}return f};function FD(){let e=0,t,r,o="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Gj(t))&&(o&&(o+=" "),o+=r);return o}const Gj=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=Gj(e[o]))&&(r&&(r+=" "),r+=t);return r};function qD(e,...t){let r,o,l,u=d;function d(m){const p=t.reduce((v,y)=>y(v),e());return r=BD(p),o=r.cache.get,l=r.cache.set,u=f,f(m)}function f(m){const p=o(m);if(p)return p;const v=HD(m,r);return l(m,v),v}return function(){return u(FD.apply(null,arguments))}}const St=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},Kj=/^\[(?:([a-z-]+):)?(.+)\]$/i,YD=/^\d+\/\d+$/,ZD=new Set(["px","full","screen"]),GD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,KD=/\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$/,QD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,XD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,WD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ya=e=>ai(e)||ZD.has(e)||YD.test(e),ns=e=>vi(e,"length",o3),ai=e=>!!e&&!Number.isNaN(Number(e)),Ym=e=>vi(e,"number",ai),bl=e=>!!e&&Number.isInteger(Number(e)),JD=e=>e.endsWith("%")&&ai(e.slice(0,-1)),Ge=e=>Kj.test(e),rs=e=>GD.test(e),e3=new Set(["length","size","percentage"]),t3=e=>vi(e,e3,Qj),n3=e=>vi(e,"position",Qj),r3=new Set(["image","url"]),a3=e=>vi(e,r3,l3),s3=e=>vi(e,"",i3),wl=()=>!0,vi=(e,t,r)=>{const o=Kj.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):r(o[2]):!1},o3=e=>KD.test(e)&&!QD.test(e),Qj=()=>!1,i3=e=>XD.test(e),l3=e=>WD.test(e),c3=()=>{const e=St("colors"),t=St("spacing"),r=St("blur"),o=St("brightness"),l=St("borderColor"),u=St("borderRadius"),d=St("borderSpacing"),f=St("borderWidth"),m=St("contrast"),p=St("grayscale"),v=St("hueRotate"),y=St("invert"),b=St("gap"),S=St("gradientColorStops"),N=St("gradientColorStopPositions"),w=St("inset"),C=St("margin"),k=St("opacity"),E=St("padding"),R=St("saturate"),T=St("scale"),z=St("sepia"),ne=St("skew"),$=St("space"),V=St("translate"),J=()=>["auto","contain","none"],se=()=>["auto","hidden","clip","visible","scroll"],ie=()=>["auto",Ge,t],te=()=>[Ge,t],q=()=>["",ya,ns],de=()=>["auto",ai,Ge],me=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],O=()=>["solid","dashed","dotted","double","none"],L=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],Q=()=>["","0",Ge],_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[ai,Ge];return{cacheSize:500,separator:":",theme:{colors:[wl],spacing:[ya,ns],blur:["none","",rs,Ge],brightness:B(),borderColor:[e],borderRadius:["none","","full",rs,Ge],borderSpacing:te(),borderWidth:q(),contrast:B(),grayscale:Q(),hueRotate:B(),invert:Q(),gap:te(),gradientColorStops:[e],gradientColorStopPositions:[JD,ns],inset:ie(),margin:ie(),opacity:B(),padding:te(),saturate:B(),scale:B(),sepia:Q(),skew:B(),space:te(),translate:te()},classGroups:{aspect:[{aspect:["auto","square","video",Ge]}],container:["container"],columns:[{columns:[rs]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...me(),Ge]}],overflow:[{overflow:se()}],"overflow-x":[{"overflow-x":se()}],"overflow-y":[{"overflow-y":se()}],overscroll:[{overscroll:J()}],"overscroll-x":[{"overscroll-x":J()}],"overscroll-y":[{"overscroll-y":J()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",bl,Ge]}],basis:[{basis:ie()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ge]}],grow:[{grow:Q()}],shrink:[{shrink:Q()}],order:[{order:["first","last","none",bl,Ge]}],"grid-cols":[{"grid-cols":[wl]}],"col-start-end":[{col:["auto",{span:["full",bl,Ge]},Ge]}],"col-start":[{"col-start":de()}],"col-end":[{"col-end":de()}],"grid-rows":[{"grid-rows":[wl]}],"row-start-end":[{row:["auto",{span:[bl,Ge]},Ge]}],"row-start":[{"row-start":de()}],"row-end":[{"row-end":de()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ge]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ge]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[$]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[$]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ge,t]}],"min-w":[{"min-w":[Ge,t,"min","max","fit"]}],"max-w":[{"max-w":[Ge,t,"none","full","min","max","fit","prose",{screen:[rs]},rs]}],h:[{h:[Ge,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ge,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ge,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ge,t,"auto","min","max","fit"]}],"font-size":[{text:["base",rs,ns]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ym]}],"font-family":[{font:[wl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ge]}],"line-clamp":[{"line-clamp":["none",ai,Ym]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ya,Ge]}],"list-image":[{"list-image":["none",Ge]}],"list-style-type":[{list:["none","disc","decimal",Ge]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...O(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ya,ns]}],"underline-offset":[{"underline-offset":["auto",ya,Ge]}],"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:te()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ge]}],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",Ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...me(),n3]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",t3]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},a3]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[N]}],"gradient-via-pos":[{via:[N]}],"gradient-to-pos":[{to:[N]}],"gradient-from":[{from:[S]}],"gradient-via":[{via:[S]}],"gradient-to":[{to:[S]}],rounded:[{rounded:[u]}],"rounded-s":[{"rounded-s":[u]}],"rounded-e":[{"rounded-e":[u]}],"rounded-t":[{"rounded-t":[u]}],"rounded-r":[{"rounded-r":[u]}],"rounded-b":[{"rounded-b":[u]}],"rounded-l":[{"rounded-l":[u]}],"rounded-ss":[{"rounded-ss":[u]}],"rounded-se":[{"rounded-se":[u]}],"rounded-ee":[{"rounded-ee":[u]}],"rounded-es":[{"rounded-es":[u]}],"rounded-tl":[{"rounded-tl":[u]}],"rounded-tr":[{"rounded-tr":[u]}],"rounded-br":[{"rounded-br":[u]}],"rounded-bl":[{"rounded-bl":[u]}],"border-w":[{border:[f]}],"border-w-x":[{"border-x":[f]}],"border-w-y":[{"border-y":[f]}],"border-w-s":[{"border-s":[f]}],"border-w-e":[{"border-e":[f]}],"border-w-t":[{"border-t":[f]}],"border-w-r":[{"border-r":[f]}],"border-w-b":[{"border-b":[f]}],"border-w-l":[{"border-l":[f]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...O(),"hidden"]}],"divide-x":[{"divide-x":[f]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[f]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:O()}],"border-color":[{border:[l]}],"border-color-x":[{"border-x":[l]}],"border-color-y":[{"border-y":[l]}],"border-color-s":[{"border-s":[l]}],"border-color-e":[{"border-e":[l]}],"border-color-t":[{"border-t":[l]}],"border-color-r":[{"border-r":[l]}],"border-color-b":[{"border-b":[l]}],"border-color-l":[{"border-l":[l]}],"divide-color":[{divide:[l]}],"outline-style":[{outline:["",...O()]}],"outline-offset":[{"outline-offset":[ya,Ge]}],"outline-w":[{outline:[ya,ns]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[ya,ns]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",rs,s3]}],"shadow-color":[{shadow:[wl]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...L(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":L()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[o]}],contrast:[{contrast:[m]}],"drop-shadow":[{"drop-shadow":["","none",rs,Ge]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[v]}],invert:[{invert:[y]}],saturate:[{saturate:[R]}],sepia:[{sepia:[z]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[m]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[v]}],"backdrop-invert":[{"backdrop-invert":[y]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[R]}],"backdrop-sepia":[{"backdrop-sepia":[z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[d]}],"border-spacing-x":[{"border-spacing-x":[d]}],"border-spacing-y":[{"border-spacing-y":[d]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ge]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",Ge]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ge]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[bl,Ge]}],"translate-x":[{"translate-x":[V]}],"translate-y":[{"translate-y":[V]}],"skew-x":[{"skew-x":[ne]}],"skew-y":[{"skew-y":[ne]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ge]}],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",Ge]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":te()}],"scroll-mx":[{"scroll-mx":te()}],"scroll-my":[{"scroll-my":te()}],"scroll-ms":[{"scroll-ms":te()}],"scroll-me":[{"scroll-me":te()}],"scroll-mt":[{"scroll-mt":te()}],"scroll-mr":[{"scroll-mr":te()}],"scroll-mb":[{"scroll-mb":te()}],"scroll-ml":[{"scroll-ml":te()}],"scroll-p":[{"scroll-p":te()}],"scroll-px":[{"scroll-px":te()}],"scroll-py":[{"scroll-py":te()}],"scroll-ps":[{"scroll-ps":te()}],"scroll-pe":[{"scroll-pe":te()}],"scroll-pt":[{"scroll-pt":te()}],"scroll-pr":[{"scroll-pr":te()}],"scroll-pb":[{"scroll-pb":te()}],"scroll-pl":[{"scroll-pl":te()}],"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",Ge]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ya,ns,Ym]}],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"]}}},u3=qD(c3);function je(...e){return u3(qj(e))}const Gr=TD,ja=_D,Na=MD,Kr=x.forwardRef(({className:e,sideOffset:t=4,...r},o)=>a.jsx(Hj,{ref:o,sideOffset:t,className:je("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-tooltip-content-transform-origin]",e),...r}));Kr.displayName=Hj.displayName;function d3({events:e,className:t=""}){const r=[...e].sort((o,l)=>o.year-l.year);return r.length?a.jsx("div",{className:`max-w-3xl mx-auto py-4 ${t}`,children:a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"absolute left-8 top-0 bottom-0 w-0.5 bg-sage/30 dark:bg-sage/20"}),a.jsx("div",{className:"space-y-8",children:r.map(o=>a.jsxs("div",{className:"relative flex items-start gap-6",children:[a.jsx("div",{className:"flex-shrink-0 w-16 h-16 rounded-full bg-paper dark:bg-dark-paper border-4 border-cream dark:border-dark-surface flex items-center justify-center z-10",children:a.jsx("span",{className:"text-navy dark:text-cream font-serif font-bold",children:o.year})}),a.jsxs("div",{className:"flex-1 bg-cream dark:bg-dark-surface p-4 rounded-lg shadow-sm border border-sage/10 dark:border-sage/5",children:[a.jsx("h3",{className:"text-lg font-serif font-semibold text-navy dark:text-cream mb-2",children:o.title}),o.description&&a.jsx("p",{className:"text-navy/80 dark:text-cream/80",children:o.description})]})]},o.id))})]})}):a.jsx("div",{className:`text-center py-12 ${t}`,children:a.jsx("p",{className:"text-navy/70 dark:text-cream/70",children:"No timeline events available for this author."})})}function fw({language:e,className:t}){return a.jsxs("div",{className:`flex items-center gap-1 text-xs text-navy/70 dark:text-cream/70 font-sans ${t}`,children:[a.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-sage"}),a.jsx("span",{children:e})]})}const hw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,mw=qj,kx=(e,t)=>r=>{var o;if(t?.variants==null)return mw(e,r?.class,r?.className);const{variants:l,defaultVariants:u}=t,d=Object.keys(l).map(p=>{const v=r?.[p],y=u?.[p];if(v===null)return null;const b=hw(v)||hw(y);return l[p][b]}),f=r&&Object.entries(r).reduce((p,v)=>{let[y,b]=v;return b===void 0||(p[y]=b),p},{}),m=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((p,v)=>{let{class:y,className:b,...S}=v;return Object.entries(S).every(N=>{let[w,C]=N;return Array.isArray(C)?C.includes({...u,...f}[w]):{...u,...f}[w]===C})?[...p,y,b]:p},[]);return mw(e,d,m,r?.class,r?.className)},f3=kx("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 ht({className:e,variant:t,...r}){return a.jsx("div",{className:je(f3({variant:t}),e),...r})}const Cx=kx("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"}}),X=x.forwardRef(({className:e,variant:t,size:r,asChild:o=!1,...l},u)=>{const d=o?ij:"button";return a.jsx(d,{className:je(Cx({variant:t,size:r,className:e})),ref:u,...l})});X.displayName="Button";async function Xj(e){if(!e.ok){const t=await e.text()||e.statusText;throw new Error(`${e.status}: ${t}`)}}async function Qr(e,t,r){const o=await fetch(t,{method:e,headers:r?{"Content-Type":"application/json"}:{},body:r?JSON.stringify(r):void 0,credentials:"include"});return await Xj(o),await o.json()}const h3=({on401:e})=>async({queryKey:t})=>{const r=await fetch(t[0],{credentials:"include"});return await Xj(r),await r.json()},ci=new HR({defaultOptions:{queries:{queryFn:h3({on401:"throw"}),refetchInterval:!1,refetchOnWindowFocus:!1,staleTime:1/0,retry:!1},mutations:{retry:!1}}});function Ar({work:e,compact:t=!1,grid:r=!1}){const[o,l]=x.useState(e.likes||0),[u,d]=x.useState(!1),{toast:f}=Ta(),m=async p=>{p.preventDefault(),p.stopPropagation();try{u?(l(o-1),d(!1)):(await Qr("POST","/api/likes",{userId:1,entityType:"work",entityId:e.id}),l(o+1),d(!0))}catch{f({title:"Error",description:"Could not like this work. Please try again.",variant:"destructive"})}};return r?a.jsx(Ce,{href:`/works/${e.slug}`,children:a.jsxs("div",{className:"card group bg-cream dark:bg-dark-surface p-4 rounded-lg shadow-sm border border-sage/10 dark:border-sage/5 flex flex-col h-full transition-shadow hover:shadow-md",children:[a.jsxs("div",{className:"mb-3",children:[a.jsx("h3",{className:"font-serif text-lg font-semibold mb-1 group-hover:text-russet dark:group-hover:text-russet/90 transition-colors",children:e.title}),a.jsx("p",{className:"text-sm text-navy/70 dark:text-cream/70",children:e.author?.name||"Unknown Author"})]}),a.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:e.tags&&e.tags.length>0?e.tags.slice(0,3).map(p=>a.jsx(ht,{variant:"outline",className:"bg-navy/10 dark:bg-navy/20 text-navy/70 dark:text-cream/70 text-xs border-none",children:p.name},p.id)):a.jsx(ht,{variant:"outline",className:"bg-navy/10 dark:bg-navy/20 text-navy/70 dark:text-cream/70 text-xs border-none",children:"General"})}),a.jsx("p",{className:"text-sm text-navy/80 dark:text-cream/80 mb-3 line-clamp-3 flex-1",children:e.description}),a.jsxs("div",{className:"flex items-center justify-between mt-auto pt-3 border-t border-sage/10 dark:border-sage/5",children:[a.jsx(fw,{language:`${e.language}, ${e.year||"Unknown"}`}),a.jsxs("span",{className:"text-xs text-navy/60 dark:text-cream/60",children:[Math.floor(Math.random()*10)+1," translations"]})]})]})}):a.jsxs("div",{className:"card bg-cream dark:bg-dark-surface p-4 rounded-lg shadow-sm border border-sage/10 dark:border-sage/5 flex flex-col sm:flex-row sm:items-center gap-4",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"font-serif text-lg font-semibold mb-1",children:a.jsx(Ce,{href:`/works/${e.slug}`,className:"text-navy dark:text-cream hover:text-russet dark:hover:text-russet/90 transition-colors",children:e.title})}),a.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 mb-2",children:[a.jsxs("span",{className:"text-xs text-navy/70 dark:text-cream/70 font-sans",children:[e.type==="poem"?"Poem":e.type==="story"?"Short story":e.type==="novel"?"Novel":e.type==="play"?"Play":e.type==="essay"?"Essay":"Work",", ",e.year]}),a.jsx(fw,{language:e.language})]}),!t&&a.jsx("p",{className:"text-navy/80 dark:text-cream/80 text-sm mb-2 line-clamp-2",children:e.description}),a.jsx("div",{className:"flex flex-wrap gap-2",children:e.tags&&e.tags.length>0?e.tags.map(p=>a.jsx(ht,{variant:"outline",className:"inline-block px-2 py-0.5 bg-navy/10 dark:bg-navy/20 rounded text-navy/70 dark:text-cream/70 text-xs font-sans border-none",children:p.name},p.id)):a.jsx(ht,{variant:"outline",className:"inline-block px-2 py-0.5 bg-navy/10 dark:bg-navy/20 rounded text-navy/70 dark:text-cream/70 text-xs font-sans border-none",children:"General"})})]}),a.jsxs("div",{className:"flex items-center sm:flex-col gap-3 sm:gap-2 self-end sm:self-center",children:[a.jsx("div",{className:"flex items-center gap-1",children:a.jsxs("span",{className:"text-xs text-navy/70 dark:text-cream/70 font-sans",children:[Math.floor(Math.random()*10)+1," translations"]})}),a.jsxs(X,{size:"sm",variant:"outline",className:`btn-feedback flex items-center gap-1 py-1 px-2.5 rounded-full ${u?"bg-russet/20 hover:bg-russet/30 dark:bg-russet/30 dark:hover:bg-russet/40 text-russet dark:text-russet/90":"bg-russet/10 hover:bg-russet/20 dark:bg-russet/20 dark:hover:bg-russet/30 text-russet dark:text-russet/90"} font-sans text-xs transition-colors`,onClick:m,children:[a.jsx(Qs,{className:`h-3.5 w-3.5 ${u?"fill-russet":""}`}),a.jsx("span",{children:o})]})]})]})}function m3(){return a.jsx("footer",{className:"site-footer bg-paper dark:bg-dark-paper border-t border-sage/20 dark:border-sage/10",children:a.jsxs("div",{className:"max-w-[var(--content-width)] mx-auto px-4 md:px-6 py-8",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-serif font-medium text-navy dark:text-cream mb-4",children:"Tercul"}),a.jsx("p",{className:"text-sm text-navy/70 dark:text-cream/70 mb-4",children:"Immersive literary archive with thousands of works in original languages and translations."}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("a",{href:"#",className:"text-navy/70 dark:text-cream/70 hover:text-russet dark:hover:text-russet/90 transition-colors",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{d:"M24 4.557c-.883.392-1.832.656-2.828.775 1.017-.609 1.798-1.574 2.165-2.724-.951.564-2.005.974-3.127 1.195-.897-.957-2.178-1.555-3.594-1.555-3.179 0-5.515 2.966-4.797 6.045-4.091-.205-7.719-2.165-10.148-5.144-1.29 2.213-.669 5.108 1.523 6.574-.806-.026-1.566-.247-2.229-.616-.054 2.281 1.581 4.415 3.949 4.89-.693.188-1.452.232-2.224.084.626 1.956 2.444 3.379 4.6 3.419-2.07 1.623-4.678 2.348-7.29 2.04 2.179 1.397 4.768 2.212 7.548 2.212 9.142 0 14.307-7.721 13.995-14.646.962-.695 1.797-1.562 2.457-2.549z"})})}),a.jsx("a",{href:"#",className:"text-navy/70 dark:text-cream/70 hover:text-russet dark:hover:text-russet/90 transition-colors",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{d:"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"})})}),a.jsx("a",{href:"#",className:"text-navy/70 dark:text-cream/70 hover:text-russet dark:hover:text-russet/90 transition-colors",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{d:"M22.675 0h-21.35c-.732 0-1.325.593-1.325 1.325v21.351c0 .731.593 1.324 1.325 1.324h11.495v-9.294h-3.128v-3.622h3.128v-2.671c0-3.1 1.893-4.788 4.659-4.788 1.325 0 2.463.099 2.795.143v3.24l-1.918.001c-1.504 0-1.795.715-1.795 1.763v2.313h3.587l-.467 3.622h-3.12v9.293h6.116c.73 0 1.323-.593 1.323-1.325v-21.35c0-.732-.593-1.325-1.325-1.325z"})})})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-serif font-medium text-navy dark:text-cream mb-4",children:"Browse"}),a.jsxs("ul",{className:"space-y-2",children:[a.jsx("li",{children:a.jsx(Ce,{href:"/authors",className:"text-sm text-navy/70 dark:text-cream/70 hover:text-russet dark:hover:text-russet/90 transition-colors",children:"Authors"})}),a.jsx("li",{children:a.jsx(Ce,{href:"/explore?genre=Poetry",className:"text-sm text-navy/70 dark:text-cream/70 hover:text-russet dark:hover:text-russet/90 transition-colors",children:"Poetry"})}),a.jsx("li",{children:a.jsx(Ce,{href:"/explore?genre=Prose",className:"text-sm text-navy/70 dark:text-cream/70 hover:text-russet dark:hover:text-russet/90 transition-colors",children:"Prose"})}),a.jsx("li",{children:a.jsx(Ce,{href:"/collections",className:"text-sm text-navy/70 dark:text-cream/70 hover:text-russet dark:hover:text-russet/90 transition-colors",children:"Collections"})}),a.jsx("li",{children:a.jsx(Ce,{href:"/blog",className:"text-sm text-navy/70 dark:text-cream/70 hover:text-russet dark:hover:text-russet/90 transition-colors",children:"Blog"})})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-serif font-medium text-navy dark:text-cream mb-4",children:"Contribute"}),a.jsxs("ul",{className:"space-y-2",children:[a.jsx("li",{children:a.jsx(Ce,{href:"/submit",className:"text-sm text-navy/70 dark:text-cream/70 hover:text-russet dark:hover:text-russet/90 transition-colors",children:"Submit Translation"})}),a.jsx("li",{children:a.jsx(Ce,{href:"/guidelines",className:"text-sm text-navy/70 dark:text-cream/70 hover:text-russet dark:hover:text-russet/90 transition-colors",children:"Translation Guidelines"})}),a.jsx("li",{children:a.jsx(Ce,{href:"/contributors",className:"text-sm text-navy/70 dark:text-cream/70 hover:text-russet dark:hover:text-russet/90 transition-colors",children:"Meet Our Contributors"})}),a.jsx("li",{children:a.jsx(Ce,{href:"/faq",className:"text-sm text-navy/70 dark:text-cream/70 hover:text-russet dark:hover:text-russet/90 transition-colors",children:"FAQs"})})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-serif font-medium text-navy dark:text-cream mb-4",children:"About"}),a.jsxs("ul",{className:"space-y-2",children:[a.jsx("li",{children:a.jsx(Ce,{href:"/about",className:"text-sm text-navy/70 dark:text-cream/70 hover:text-russet dark:hover:text-russet/90 transition-colors",children:"Our Mission"})}),a.jsx("li",{children:a.jsx(Ce,{href:"/team",className:"text-sm text-navy/70 dark:text-cream/70 hover:text-russet dark:hover:text-russet/90 transition-colors",children:"Team"})}),a.jsx("li",{children:a.jsx(Ce,{href:"/contact",className:"text-sm text-navy/70 dark:text-cream/70 hover:text-russet dark:hover:text-russet/90 transition-colors",children:"Contact Us"})}),a.jsx("li",{children:a.jsx(Ce,{href:"/terms",className:"text-sm text-navy/70 dark:text-cream/70 hover:text-russet dark:hover:text-russet/90 transition-colors",children:"Terms & Privacy"})})]})]})]}),a.jsxs("div",{className:"mt-8 pt-6 border-t border-sage/20 dark:border-sage/10 flex flex-col md:flex-row md:items-center justify-between gap-4",children:[a.jsxs("p",{className:"text-xs text-navy/60 dark:text-cream/60",children:["© ",new Date().getFullYear()," Tercul. All rights reserved."]}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx(Ce,{href:"/terms",className:"text-xs text-navy/60 dark:text-cream/60 hover:text-navy dark:hover:text-cream transition-colors",children:"Terms"}),a.jsx(Ce,{href:"/privacy",className:"text-xs text-navy/60 dark:text-cream/60 hover:text-navy dark:hover:text-cream transition-colors",children:"Privacy"}),a.jsx(Ce,{href:"/cookies",className:"text-xs text-navy/60 dark:text-cream/60 hover:text-navy dark:hover:text-cream transition-colors",children:"Cookies"})]})]})]})})}function tc(e){const t=e+"CollectionProvider",[r,o]=Qt(t),[l,u]=r(t,{collectionRef:{current:null},itemMap:new Map}),d=w=>{const{scope:C,children:k}=w,E=ae.useRef(null),R=ae.useRef(new Map).current;return a.jsx(l,{scope:C,itemMap:R,collectionRef:E,children:k})};d.displayName=t;const f=e+"CollectionSlot",m=Ws(f),p=ae.forwardRef((w,C)=>{const{scope:k,children:E}=w,R=u(f,k),T=Le(C,R.collectionRef);return a.jsx(m,{ref:T,children:E})});p.displayName=f;const v=e+"CollectionItemSlot",y="data-radix-collection-item",b=Ws(v),S=ae.forwardRef((w,C)=>{const{scope:k,children:E,...R}=w,T=ae.useRef(null),z=Le(C,T),ne=u(v,k);return ae.useEffect(()=>(ne.itemMap.set(T,{ref:T,...R}),()=>void ne.itemMap.delete(T))),a.jsx(b,{[y]:"",ref:z,children:E})});S.displayName=v;function N(w){const C=u(e+"CollectionConsumer",w);return ae.useCallback(()=>{const E=C.collectionRef.current;if(!E)return[];const R=Array.from(E.querySelectorAll(`[${y}]`));return Array.from(C.itemMap.values()).sort((ne,$)=>R.indexOf(ne.ref.current)-R.indexOf($.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:d,Slot:p,ItemSlot:S},N,o]}var p3=x.createContext(void 0);function bs(e){const t=x.useContext(p3);return e||t||"ltr"}var Zm=0;function Ex(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??pw()),document.body.insertAdjacentElement("beforeend",e[1]??pw()),Zm++,()=>{Zm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Zm--}},[])}function pw(){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 Gm="focusScope.autoFocusOnMount",Km="focusScope.autoFocusOnUnmount",xw={bubbles:!1,cancelable:!0},x3="FocusScope",Id=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:l,onUnmountAutoFocus:u,...d}=e,[f,m]=x.useState(null),p=un(l),v=un(u),y=x.useRef(null),b=Le(t,w=>m(w)),S=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(o){let w=function(R){if(S.paused||!f)return;const T=R.target;f.contains(T)?y.current=T:ss(y.current,{select:!0})},C=function(R){if(S.paused||!f)return;const T=R.relatedTarget;T!==null&&(f.contains(T)||ss(y.current,{select:!0}))},k=function(R){if(document.activeElement===document.body)for(const z of R)z.removedNodes.length>0&&ss(f)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const E=new MutationObserver(k);return f&&E.observe(f,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),E.disconnect()}}},[o,f,S.paused]),x.useEffect(()=>{if(f){vw.add(S);const w=document.activeElement;if(!f.contains(w)){const k=new CustomEvent(Gm,xw);f.addEventListener(Gm,p),f.dispatchEvent(k),k.defaultPrevented||(g3(j3(Wj(f)),{select:!0}),document.activeElement===w&&ss(f))}return()=>{f.removeEventListener(Gm,p),setTimeout(()=>{const k=new CustomEvent(Km,xw);f.addEventListener(Km,v),f.dispatchEvent(k),k.defaultPrevented||ss(w??document.body,{select:!0}),f.removeEventListener(Km,v),vw.remove(S)},0)}}},[f,p,v,S]);const N=x.useCallback(w=>{if(!r&&!o||S.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,k=document.activeElement;if(C&&k){const E=w.currentTarget,[R,T]=v3(E);R&&T?!w.shiftKey&&k===T?(w.preventDefault(),r&&ss(R,{select:!0})):w.shiftKey&&k===R&&(w.preventDefault(),r&&ss(T,{select:!0})):k===E&&w.preventDefault()}},[r,o,S.paused]);return a.jsx(Ee.div,{tabIndex:-1,...d,ref:b,onKeyDown:N})});Id.displayName=x3;function g3(e,{select:t=!1}={}){const r=document.activeElement;for(const o of e)if(ss(o,{select:t}),document.activeElement!==r)return}function v3(e){const t=Wj(e),r=gw(t,e),o=gw(t.reverse(),e);return[r,o]}function Wj(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const l=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||l?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function gw(e,t){for(const r of e)if(!y3(r,{upTo:t}))return r}function y3(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 b3(e){return e instanceof HTMLInputElement&&"select"in e}function ss(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&b3(e)&&t&&e.select()}}var vw=w3();function w3(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=yw(e,t),e.unshift(t)},remove(t){e=yw(e,t),e[0]?.resume()}}}function yw(e,t){const r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function j3(e){return e.filter(t=>t.tagName!=="A")}var Qm="rovingFocusGroup.onEntryFocus",N3={bubbles:!1,cancelable:!0},nc="RovingFocusGroup",[Sp,Jj,S3]=tc(nc),[k3,yi]=Qt(nc,[S3]),[C3,E3]=k3(nc),eN=x.forwardRef((e,t)=>a.jsx(Sp.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Sp.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(A3,{...e,ref:t})})}));eN.displayName=nc;var A3=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:l=!1,dir:u,currentTabStopId:d,defaultCurrentTabStopId:f,onCurrentTabStopIdChange:m,onEntryFocus:p,preventScrollOnEntryFocus:v=!1,...y}=e,b=x.useRef(null),S=Le(t,b),N=bs(u),[w,C]=Hn({prop:d,defaultProp:f??null,onChange:m,caller:nc}),[k,E]=x.useState(!1),R=un(p),T=Jj(r),z=x.useRef(!1),[ne,$]=x.useState(0);return x.useEffect(()=>{const V=b.current;if(V)return V.addEventListener(Qm,R),()=>V.removeEventListener(Qm,R)},[R]),a.jsx(C3,{scope:r,orientation:o,dir:N,loop:l,currentTabStopId:w,onItemFocus:x.useCallback(V=>C(V),[C]),onItemShiftTab:x.useCallback(()=>E(!0),[]),onFocusableItemAdd:x.useCallback(()=>$(V=>V+1),[]),onFocusableItemRemove:x.useCallback(()=>$(V=>V-1),[]),children:a.jsx(Ee.div,{tabIndex:k||ne===0?-1:0,"data-orientation":o,...y,ref:S,style:{outline:"none",...e.style},onMouseDown:be(e.onMouseDown,()=>{z.current=!0}),onFocus:be(e.onFocus,V=>{const J=!z.current;if(V.target===V.currentTarget&&J&&!k){const se=new CustomEvent(Qm,N3);if(V.currentTarget.dispatchEvent(se),!se.defaultPrevented){const ie=T().filter(O=>O.focusable),te=ie.find(O=>O.active),q=ie.find(O=>O.id===w),me=[te,q,...ie].filter(Boolean).map(O=>O.ref.current);rN(me,v)}}z.current=!1}),onBlur:be(e.onBlur,()=>E(!1))})})}),tN="RovingFocusGroupItem",nN=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:l=!1,tabStopId:u,children:d,...f}=e,m=nr(),p=u||m,v=E3(tN,r),y=v.currentTabStopId===p,b=Jj(r),{onFocusableItemAdd:S,onFocusableItemRemove:N,currentTabStopId:w}=v;return x.useEffect(()=>{if(o)return S(),()=>N()},[o,S,N]),a.jsx(Sp.ItemSlot,{scope:r,id:p,focusable:o,active:l,children:a.jsx(Ee.span,{tabIndex:y?0:-1,"data-orientation":v.orientation,...f,ref:t,onMouseDown:be(e.onMouseDown,C=>{o?v.onItemFocus(p):C.preventDefault()}),onFocus:be(e.onFocus,()=>v.onItemFocus(p)),onKeyDown:be(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){v.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const k=_3(C,v.orientation,v.dir);if(k!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let R=b().filter(T=>T.focusable).map(T=>T.ref.current);if(k==="last")R.reverse();else if(k==="prev"||k==="next"){k==="prev"&&R.reverse();const T=R.indexOf(C.currentTarget);R=v.loop?M3(R,T+1):R.slice(T+1)}setTimeout(()=>rN(R))}}),children:typeof d=="function"?d({isCurrentTabStop:y,hasTabStop:w!=null}):d})})});nN.displayName=tN;var R3={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function T3(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function _3(e,t,r){const o=T3(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return R3[o]}function rN(e,t=!1){const r=document.activeElement;for(const o of e)if(o===r||(o.focus({preventScroll:t}),document.activeElement!==r))return}function M3(e,t){return e.map((r,o)=>e[(t+o)%e.length])}var Ax=eN,Rx=nN,D3=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Go=new WeakMap,Cu=new WeakMap,Eu={},Xm=0,aN=function(e){return e&&(e.host||aN(e.parentNode))},O3=function(e,t){return t.map(function(r){if(e.contains(r))return r;var o=aN(r);return o&&e.contains(o)?o:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},z3=function(e,t,r,o){var l=O3(t,Array.isArray(e)?e:[e]);Eu[r]||(Eu[r]=new WeakMap);var u=Eu[r],d=[],f=new Set,m=new Set(l),p=function(y){!y||f.has(y)||(f.add(y),p(y.parentNode))};l.forEach(p);var v=function(y){!y||m.has(y)||Array.prototype.forEach.call(y.children,function(b){if(f.has(b))v(b);else try{var S=b.getAttribute(o),N=S!==null&&S!=="false",w=(Go.get(b)||0)+1,C=(u.get(b)||0)+1;Go.set(b,w),u.set(b,C),d.push(b),w===1&&N&&Cu.set(b,!0),C===1&&b.setAttribute(r,"true"),N||b.setAttribute(o,"true")}catch(k){console.error("aria-hidden: cannot operate on ",b,k)}})};return v(t),f.clear(),Xm++,function(){d.forEach(function(y){var b=Go.get(y)-1,S=u.get(y)-1;Go.set(y,b),u.set(y,S),b||(Cu.has(y)||y.removeAttribute(o),Cu.delete(y)),S||y.removeAttribute(r)}),Xm--,Xm||(Go=new WeakMap,Go=new WeakMap,Cu=new WeakMap,Eu={})}},Tx=function(e,t,r){r===void 0&&(r="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),l=D3(e);return l?(o.push.apply(o,Array.from(l.querySelectorAll("[aria-live], script"))),z3(o,l,r,"aria-hidden")):function(){return null}},Fr=function(){return Fr=Object.assign||function(t){for(var r,o=1,l=arguments.length;o<l;o++){r=arguments[o];for(var u in r)Object.prototype.hasOwnProperty.call(r,u)&&(t[u]=r[u])}return t},Fr.apply(this,arguments)};function sN(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,o=Object.getOwnPropertySymbols(e);l<o.length;l++)t.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(e,o[l])&&(r[o[l]]=e[o[l]]);return r}function P3(e,t,r){if(r||arguments.length===2)for(var o=0,l=t.length,u;o<l;o++)(u||!(o in t))&&(u||(u=Array.prototype.slice.call(t,0,o)),u[o]=t[o]);return e.concat(u||Array.prototype.slice.call(t))}var Hu="right-scroll-bar-position",Fu="width-before-scroll-bar",L3="with-scroll-bars-hidden",$3="--removed-body-scroll-bar-size";function Wm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function I3(e,t){var r=x.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(o){var l=r.value;l!==o&&(r.value=o,r.callback(o,l))}}}})[0];return r.callback=t,r.facade}var U3=typeof window<"u"?x.useLayoutEffect:x.useEffect,bw=new WeakMap;function B3(e,t){var r=I3(null,function(o){return e.forEach(function(l){return Wm(l,o)})});return U3(function(){var o=bw.get(r);if(o){var l=new Set(o),u=new Set(e),d=r.current;l.forEach(function(f){u.has(f)||Wm(f,null)}),u.forEach(function(f){l.has(f)||Wm(f,d)})}bw.set(r,e)},[e]),r}function V3(e){return e}function H3(e,t){t===void 0&&(t=V3);var r=[],o=!1,l={read:function(){if(o)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(u){var d=t(u,o);return r.push(d),function(){r=r.filter(function(f){return f!==d})}},assignSyncMedium:function(u){for(o=!0;r.length;){var d=r;r=[],d.forEach(u)}r={push:function(f){return u(f)},filter:function(){return r}}},assignMedium:function(u){o=!0;var d=[];if(r.length){var f=r;r=[],f.forEach(u),d=r}var m=function(){var v=d;d=[],v.forEach(u)},p=function(){return Promise.resolve().then(m)};p(),r={push:function(v){d.push(v),p()},filter:function(v){return d=d.filter(v),r}}}};return l}function F3(e){e===void 0&&(e={});var t=H3(null);return t.options=Fr({async:!0,ssr:!1},e),t}var oN=function(e){var t=e.sideCar,r=sN(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return x.createElement(o,Fr({},r))};oN.isSideCarExport=!0;function q3(e,t){return e.useMedium(t),oN}var iN=F3(),Jm=function(){},Ud=x.forwardRef(function(e,t){var r=x.useRef(null),o=x.useState({onScrollCapture:Jm,onWheelCapture:Jm,onTouchMoveCapture:Jm}),l=o[0],u=o[1],d=e.forwardProps,f=e.children,m=e.className,p=e.removeScrollBar,v=e.enabled,y=e.shards,b=e.sideCar,S=e.noRelative,N=e.noIsolation,w=e.inert,C=e.allowPinchZoom,k=e.as,E=k===void 0?"div":k,R=e.gapMode,T=sN(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),z=b,ne=B3([r,t]),$=Fr(Fr({},T),l);return x.createElement(x.Fragment,null,v&&x.createElement(z,{sideCar:iN,removeScrollBar:p,shards:y,noRelative:S,noIsolation:N,inert:w,setCallbacks:u,allowPinchZoom:!!C,lockRef:r,gapMode:R}),d?x.cloneElement(x.Children.only(f),Fr(Fr({},$),{ref:ne})):x.createElement(E,Fr({},$,{className:m,ref:ne}),f))});Ud.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ud.classNames={fullWidth:Fu,zeroRight:Hu};var Y3=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Z3(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Y3();return t&&e.setAttribute("nonce",t),e}function G3(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function K3(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Q3=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Z3())&&(G3(t,r),K3(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},X3=function(){var e=Q3();return function(t,r){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},lN=function(){var e=X3(),t=function(r){var o=r.styles,l=r.dynamic;return e(o,l),null};return t},W3={left:0,top:0,right:0,gap:0},ep=function(e){return parseInt(e||"",10)||0},J3=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],l=t[e==="padding"?"paddingRight":"marginRight"];return[ep(r),ep(o),ep(l)]},eO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return W3;var t=J3(e),r=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-r+t[2]-t[0])}},tO=lN(),si="data-scroll-locked",nO=function(e,t,r,o){var l=e.left,u=e.top,d=e.right,f=e.gap;return r===void 0&&(r="margin"),`
|
||
.`.concat(L3,` {
|
||
overflow: hidden `).concat(o,`;
|
||
padding-right: `).concat(f,"px ").concat(o,`;
|
||
}
|
||
body[`).concat(si,`] {
|
||
overflow: hidden `).concat(o,`;
|
||
overscroll-behavior: contain;
|
||
`).concat([t&&"position: relative ".concat(o,";"),r==="margin"&&`
|
||
padding-left: `.concat(l,`px;
|
||
padding-top: `).concat(u,`px;
|
||
padding-right: `).concat(d,`px;
|
||
margin-left:0;
|
||
margin-top:0;
|
||
margin-right: `).concat(f,"px ").concat(o,`;
|
||
`),r==="padding"&&"padding-right: ".concat(f,"px ").concat(o,";")].filter(Boolean).join(""),`
|
||
}
|
||
|
||
.`).concat(Hu,` {
|
||
right: `).concat(f,"px ").concat(o,`;
|
||
}
|
||
|
||
.`).concat(Fu,` {
|
||
margin-right: `).concat(f,"px ").concat(o,`;
|
||
}
|
||
|
||
.`).concat(Hu," .").concat(Hu,` {
|
||
right: 0 `).concat(o,`;
|
||
}
|
||
|
||
.`).concat(Fu," .").concat(Fu,` {
|
||
margin-right: 0 `).concat(o,`;
|
||
}
|
||
|
||
body[`).concat(si,`] {
|
||
`).concat($3,": ").concat(f,`px;
|
||
}
|
||
`)},ww=function(){var e=parseInt(document.body.getAttribute(si)||"0",10);return isFinite(e)?e:0},rO=function(){x.useEffect(function(){return document.body.setAttribute(si,(ww()+1).toString()),function(){var e=ww()-1;e<=0?document.body.removeAttribute(si):document.body.setAttribute(si,e.toString())}},[])},aO=function(e){var t=e.noRelative,r=e.noImportant,o=e.gapMode,l=o===void 0?"margin":o;rO();var u=x.useMemo(function(){return eO(l)},[l]);return x.createElement(tO,{styles:nO(u,!t,l,r?"":"!important")})},kp=!1;if(typeof window<"u")try{var Au=Object.defineProperty({},"passive",{get:function(){return kp=!0,!0}});window.addEventListener("test",Au,Au),window.removeEventListener("test",Au,Au)}catch{kp=!1}var Ko=kp?{passive:!1}:!1,sO=function(e){return e.tagName==="TEXTAREA"},cN=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!sO(e)&&r[t]==="visible")},oO=function(e){return cN(e,"overflowY")},iO=function(e){return cN(e,"overflowX")},jw=function(e,t){var r=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var l=uN(e,o);if(l){var u=dN(e,o),d=u[1],f=u[2];if(d>f)return!0}o=o.parentNode}while(o&&o!==r.body);return!1},lO=function(e){var t=e.scrollTop,r=e.scrollHeight,o=e.clientHeight;return[t,r,o]},cO=function(e){var t=e.scrollLeft,r=e.scrollWidth,o=e.clientWidth;return[t,r,o]},uN=function(e,t){return e==="v"?oO(t):iO(t)},dN=function(e,t){return e==="v"?lO(t):cO(t)},uO=function(e,t){return e==="h"&&t==="rtl"?-1:1},dO=function(e,t,r,o,l){var u=uO(e,window.getComputedStyle(t).direction),d=u*o,f=r.target,m=t.contains(f),p=!1,v=d>0,y=0,b=0;do{if(!f)break;var S=dN(e,f),N=S[0],w=S[1],C=S[2],k=w-C-u*N;(N||k)&&uN(e,f)&&(y+=k,b+=N);var E=f.parentNode;f=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!m&&f!==document.body||m&&(t.contains(f)||t===f));return(v&&Math.abs(y)<1||!v&&Math.abs(b)<1)&&(p=!0),p},Ru=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Nw=function(e){return[e.deltaX,e.deltaY]},Sw=function(e){return e&&"current"in e?e.current:e},fO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},hO=function(e){return`
|
||
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
||
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
||
`)},mO=0,Qo=[];function pO(e){var t=x.useRef([]),r=x.useRef([0,0]),o=x.useRef(),l=x.useState(mO++)[0],u=x.useState(lN)[0],d=x.useRef(e);x.useEffect(function(){d.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var w=P3([e.lockRef.current],(e.shards||[]).map(Sw),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var f=x.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!d.current.allowPinchZoom;var k=Ru(w),E=r.current,R="deltaX"in w?w.deltaX:E[0]-k[0],T="deltaY"in w?w.deltaY:E[1]-k[1],z,ne=w.target,$=Math.abs(R)>Math.abs(T)?"h":"v";if("touches"in w&&$==="h"&&ne.type==="range")return!1;var V=jw($,ne);if(!V)return!0;if(V?z=$:(z=$==="v"?"h":"v",V=jw($,ne)),!V)return!1;if(!o.current&&"changedTouches"in w&&(R||T)&&(o.current=z),!z)return!0;var J=o.current||z;return dO(J,C,w,J==="h"?R:T)},[]),m=x.useCallback(function(w){var C=w;if(!(!Qo.length||Qo[Qo.length-1]!==u)){var k="deltaY"in C?Nw(C):Ru(C),E=t.current.filter(function(z){return z.name===C.type&&(z.target===C.target||C.target===z.shadowParent)&&fO(z.delta,k)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var R=(d.current.shards||[]).map(Sw).filter(Boolean).filter(function(z){return z.contains(C.target)}),T=R.length>0?f(C,R[0]):!d.current.noIsolation;T&&C.cancelable&&C.preventDefault()}}},[]),p=x.useCallback(function(w,C,k,E){var R={name:w,delta:C,target:k,should:E,shadowParent:xO(k)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(T){return T!==R})},1)},[]),v=x.useCallback(function(w){r.current=Ru(w),o.current=void 0},[]),y=x.useCallback(function(w){p(w.type,Nw(w),w.target,f(w,e.lockRef.current))},[]),b=x.useCallback(function(w){p(w.type,Ru(w),w.target,f(w,e.lockRef.current))},[]);x.useEffect(function(){return Qo.push(u),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:b}),document.addEventListener("wheel",m,Ko),document.addEventListener("touchmove",m,Ko),document.addEventListener("touchstart",v,Ko),function(){Qo=Qo.filter(function(w){return w!==u}),document.removeEventListener("wheel",m,Ko),document.removeEventListener("touchmove",m,Ko),document.removeEventListener("touchstart",v,Ko)}},[]);var S=e.removeScrollBar,N=e.inert;return x.createElement(x.Fragment,null,N?x.createElement(u,{styles:hO(l)}):null,S?x.createElement(aO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function xO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const gO=q3(iN,pO);var Bd=x.forwardRef(function(e,t){return x.createElement(Ud,Fr({},e,{ref:t,sideCar:gO}))});Bd.classNames=Ud.classNames;var Cp=["Enter"," "],vO=["ArrowDown","PageUp","Home"],fN=["ArrowUp","PageDown","End"],yO=[...vO,...fN],bO={ltr:[...Cp,"ArrowRight"],rtl:[...Cp,"ArrowLeft"]},wO={ltr:["ArrowLeft"],rtl:["ArrowRight"]},rc="Menu",[Hl,jO,NO]=tc(rc),[ro,hN]=Qt(rc,[NO,gi,yi]),Vd=gi(),mN=yi(),[SO,ao]=ro(rc),[kO,ac]=ro(rc),pN=e=>{const{__scopeMenu:t,open:r=!1,children:o,dir:l,onOpenChange:u,modal:d=!0}=e,f=Vd(t),[m,p]=x.useState(null),v=x.useRef(!1),y=un(u),b=bs(l);return x.useEffect(()=>{const S=()=>{v.current=!0,document.addEventListener("pointerdown",N,{capture:!0,once:!0}),document.addEventListener("pointermove",N,{capture:!0,once:!0})},N=()=>v.current=!1;return document.addEventListener("keydown",S,{capture:!0}),()=>{document.removeEventListener("keydown",S,{capture:!0}),document.removeEventListener("pointerdown",N,{capture:!0}),document.removeEventListener("pointermove",N,{capture:!0})}},[]),a.jsx(yx,{...f,children:a.jsx(SO,{scope:t,open:r,onOpenChange:y,content:m,onContentChange:p,children:a.jsx(kO,{scope:t,onClose:x.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:v,dir:b,modal:d,children:o})})})};pN.displayName=rc;var CO="MenuAnchor",_x=x.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e,l=Vd(r);return a.jsx(bx,{...l,...o,ref:t})});_x.displayName=CO;var Mx="MenuPortal",[EO,xN]=ro(Mx,{forceMount:void 0}),gN=e=>{const{__scopeMenu:t,forceMount:r,children:o,container:l}=e,u=ao(Mx,t);return a.jsx(EO,{scope:t,forceMount:r,children:a.jsx(yn,{present:r||u.open,children:a.jsx(zd,{asChild:!0,container:l,children:o})})})};gN.displayName=Mx;var vr="MenuContent",[AO,Dx]=ro(vr),vN=x.forwardRef((e,t)=>{const r=xN(vr,e.__scopeMenu),{forceMount:o=r.forceMount,...l}=e,u=ao(vr,e.__scopeMenu),d=ac(vr,e.__scopeMenu);return a.jsx(Hl.Provider,{scope:e.__scopeMenu,children:a.jsx(yn,{present:o||u.open,children:a.jsx(Hl.Slot,{scope:e.__scopeMenu,children:d.modal?a.jsx(RO,{...l,ref:t}):a.jsx(TO,{...l,ref:t})})})})}),RO=x.forwardRef((e,t)=>{const r=ao(vr,e.__scopeMenu),o=x.useRef(null),l=Le(t,o);return x.useEffect(()=>{const u=o.current;if(u)return Tx(u)},[]),a.jsx(Ox,{...e,ref:l,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:be(e.onFocusOutside,u=>u.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),TO=x.forwardRef((e,t)=>{const r=ao(vr,e.__scopeMenu);return a.jsx(Ox,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),_O=Ws("MenuContent.ScrollLock"),Ox=x.forwardRef((e,t)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:l,onOpenAutoFocus:u,onCloseAutoFocus:d,disableOutsidePointerEvents:f,onEntryFocus:m,onEscapeKeyDown:p,onPointerDownOutside:v,onFocusOutside:y,onInteractOutside:b,onDismiss:S,disableOutsideScroll:N,...w}=e,C=ao(vr,r),k=ac(vr,r),E=Vd(r),R=mN(r),T=jO(r),[z,ne]=x.useState(null),$=x.useRef(null),V=Le(t,$,C.onContentChange),J=x.useRef(0),se=x.useRef(""),ie=x.useRef(0),te=x.useRef(null),q=x.useRef("right"),de=x.useRef(0),me=N?Bd:x.Fragment,O=N?{as:_O,allowPinchZoom:!0}:void 0,L=Q=>{const _=se.current+Q,B=T().filter(M=>!M.disabled),ge=document.activeElement,fe=B.find(M=>M.ref.current===ge)?.textValue,ye=B.map(M=>M.textValue),_e=HO(ye,_,fe),G=B.find(M=>M.textValue===_e)?.ref.current;(function M(he){se.current=he,window.clearTimeout(J.current),he!==""&&(J.current=window.setTimeout(()=>M(""),1e3))})(_),G&&setTimeout(()=>G.focus())};x.useEffect(()=>()=>window.clearTimeout(J.current),[]),Ex();const F=x.useCallback(Q=>q.current===te.current?.side&&qO(Q,te.current?.area),[]);return a.jsx(AO,{scope:r,searchRef:se,onItemEnter:x.useCallback(Q=>{F(Q)&&Q.preventDefault()},[F]),onItemLeave:x.useCallback(Q=>{F(Q)||($.current?.focus(),ne(null))},[F]),onTriggerLeave:x.useCallback(Q=>{F(Q)&&Q.preventDefault()},[F]),pointerGraceTimerRef:ie,onPointerGraceIntentChange:x.useCallback(Q=>{te.current=Q},[]),children:a.jsx(me,{...O,children:a.jsx(Id,{asChild:!0,trapped:l,onMountAutoFocus:be(u,Q=>{Q.preventDefault(),$.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:d,children:a.jsx(Wl,{asChild:!0,disableOutsidePointerEvents:f,onEscapeKeyDown:p,onPointerDownOutside:v,onFocusOutside:y,onInteractOutside:b,onDismiss:S,children:a.jsx(Ax,{asChild:!0,...R,dir:k.dir,orientation:"vertical",loop:o,currentTabStopId:z,onCurrentTabStopIdChange:ne,onEntryFocus:be(m,Q=>{k.isUsingKeyboardRef.current||Q.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(wx,{role:"menu","aria-orientation":"vertical","data-state":ON(C.open),"data-radix-menu-content":"",dir:k.dir,...E,...w,ref:V,style:{outline:"none",...w.style},onKeyDown:be(w.onKeyDown,Q=>{const B=Q.target.closest("[data-radix-menu-content]")===Q.currentTarget,ge=Q.ctrlKey||Q.altKey||Q.metaKey,fe=Q.key.length===1;B&&(Q.key==="Tab"&&Q.preventDefault(),!ge&&fe&&L(Q.key));const ye=$.current;if(Q.target!==ye||!yO.includes(Q.key))return;Q.preventDefault();const G=T().filter(M=>!M.disabled).map(M=>M.ref.current);fN.includes(Q.key)&&G.reverse(),BO(G)}),onBlur:be(e.onBlur,Q=>{Q.currentTarget.contains(Q.target)||(window.clearTimeout(J.current),se.current="")}),onPointerMove:be(e.onPointerMove,Fl(Q=>{const _=Q.target,B=de.current!==Q.clientX;if(Q.currentTarget.contains(_)&&B){const ge=Q.clientX>de.current?"right":"left";q.current=ge,de.current=Q.clientX}}))})})})})})})});vN.displayName=vr;var MO="MenuGroup",zx=x.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return a.jsx(Ee.div,{role:"group",...o,ref:t})});zx.displayName=MO;var DO="MenuLabel",yN=x.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return a.jsx(Ee.div,{...o,ref:t})});yN.displayName=DO;var sd="MenuItem",kw="menu.itemSelect",Hd=x.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:o,...l}=e,u=x.useRef(null),d=ac(sd,e.__scopeMenu),f=Dx(sd,e.__scopeMenu),m=Le(t,u),p=x.useRef(!1),v=()=>{const y=u.current;if(!r&&y){const b=new CustomEvent(kw,{bubbles:!0,cancelable:!0});y.addEventListener(kw,S=>o?.(S),{once:!0}),uj(y,b),b.defaultPrevented?p.current=!1:d.onClose()}};return a.jsx(bN,{...l,ref:m,disabled:r,onClick:be(e.onClick,v),onPointerDown:y=>{e.onPointerDown?.(y),p.current=!0},onPointerUp:be(e.onPointerUp,y=>{p.current||y.currentTarget?.click()}),onKeyDown:be(e.onKeyDown,y=>{const b=f.searchRef.current!=="";r||b&&y.key===" "||Cp.includes(y.key)&&(y.currentTarget.click(),y.preventDefault())})})});Hd.displayName=sd;var bN=x.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:o=!1,textValue:l,...u}=e,d=Dx(sd,r),f=mN(r),m=x.useRef(null),p=Le(t,m),[v,y]=x.useState(!1),[b,S]=x.useState("");return x.useEffect(()=>{const N=m.current;N&&S((N.textContent??"").trim())},[u.children]),a.jsx(Hl.ItemSlot,{scope:r,disabled:o,textValue:l??b,children:a.jsx(Rx,{asChild:!0,...f,focusable:!o,children:a.jsx(Ee.div,{role:"menuitem","data-highlighted":v?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...u,ref:p,onPointerMove:be(e.onPointerMove,Fl(N=>{o?d.onItemLeave(N):(d.onItemEnter(N),N.defaultPrevented||N.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:be(e.onPointerLeave,Fl(N=>d.onItemLeave(N))),onFocus:be(e.onFocus,()=>y(!0)),onBlur:be(e.onBlur,()=>y(!1))})})})}),OO="MenuCheckboxItem",wN=x.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:o,...l}=e;return a.jsx(CN,{scope:e.__scopeMenu,checked:r,children:a.jsx(Hd,{role:"menuitemcheckbox","aria-checked":od(r)?"mixed":r,...l,ref:t,"data-state":Lx(r),onSelect:be(l.onSelect,()=>o?.(od(r)?!0:!r),{checkForDefaultPrevented:!1})})})});wN.displayName=OO;var jN="MenuRadioGroup",[zO,PO]=ro(jN,{value:void 0,onValueChange:()=>{}}),NN=x.forwardRef((e,t)=>{const{value:r,onValueChange:o,...l}=e,u=un(o);return a.jsx(zO,{scope:e.__scopeMenu,value:r,onValueChange:u,children:a.jsx(zx,{...l,ref:t})})});NN.displayName=jN;var SN="MenuRadioItem",kN=x.forwardRef((e,t)=>{const{value:r,...o}=e,l=PO(SN,e.__scopeMenu),u=r===l.value;return a.jsx(CN,{scope:e.__scopeMenu,checked:u,children:a.jsx(Hd,{role:"menuitemradio","aria-checked":u,...o,ref:t,"data-state":Lx(u),onSelect:be(o.onSelect,()=>l.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});kN.displayName=SN;var Px="MenuItemIndicator",[CN,LO]=ro(Px,{checked:!1}),EN=x.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:o,...l}=e,u=LO(Px,r);return a.jsx(yn,{present:o||od(u.checked)||u.checked===!0,children:a.jsx(Ee.span,{...l,ref:t,"data-state":Lx(u.checked)})})});EN.displayName=Px;var $O="MenuSeparator",AN=x.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e;return a.jsx(Ee.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});AN.displayName=$O;var IO="MenuArrow",RN=x.forwardRef((e,t)=>{const{__scopeMenu:r,...o}=e,l=Vd(r);return a.jsx(jx,{...l,...o,ref:t})});RN.displayName=IO;var UO="MenuSub",[EV,TN]=ro(UO),Tl="MenuSubTrigger",_N=x.forwardRef((e,t)=>{const r=ao(Tl,e.__scopeMenu),o=ac(Tl,e.__scopeMenu),l=TN(Tl,e.__scopeMenu),u=Dx(Tl,e.__scopeMenu),d=x.useRef(null),{pointerGraceTimerRef:f,onPointerGraceIntentChange:m}=u,p={__scopeMenu:e.__scopeMenu},v=x.useCallback(()=>{d.current&&window.clearTimeout(d.current),d.current=null},[]);return x.useEffect(()=>v,[v]),x.useEffect(()=>{const y=f.current;return()=>{window.clearTimeout(y),m(null)}},[f,m]),a.jsx(_x,{asChild:!0,...p,children:a.jsx(bN,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":l.contentId,"data-state":ON(r.open),...e,ref:_d(t,l.onTriggerChange),onClick:y=>{e.onClick?.(y),!(e.disabled||y.defaultPrevented)&&(y.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:be(e.onPointerMove,Fl(y=>{u.onItemEnter(y),!y.defaultPrevented&&!e.disabled&&!r.open&&!d.current&&(u.onPointerGraceIntentChange(null),d.current=window.setTimeout(()=>{r.onOpenChange(!0),v()},100))})),onPointerLeave:be(e.onPointerLeave,Fl(y=>{v();const b=r.content?.getBoundingClientRect();if(b){const S=r.content?.dataset.side,N=S==="right",w=N?-5:5,C=b[N?"left":"right"],k=b[N?"right":"left"];u.onPointerGraceIntentChange({area:[{x:y.clientX+w,y:y.clientY},{x:C,y:b.top},{x:k,y:b.top},{x:k,y:b.bottom},{x:C,y:b.bottom}],side:S}),window.clearTimeout(f.current),f.current=window.setTimeout(()=>u.onPointerGraceIntentChange(null),300)}else{if(u.onTriggerLeave(y),y.defaultPrevented)return;u.onPointerGraceIntentChange(null)}})),onKeyDown:be(e.onKeyDown,y=>{const b=u.searchRef.current!=="";e.disabled||b&&y.key===" "||bO[o.dir].includes(y.key)&&(r.onOpenChange(!0),r.content?.focus(),y.preventDefault())})})})});_N.displayName=Tl;var MN="MenuSubContent",DN=x.forwardRef((e,t)=>{const r=xN(vr,e.__scopeMenu),{forceMount:o=r.forceMount,...l}=e,u=ao(vr,e.__scopeMenu),d=ac(vr,e.__scopeMenu),f=TN(MN,e.__scopeMenu),m=x.useRef(null),p=Le(t,m);return a.jsx(Hl.Provider,{scope:e.__scopeMenu,children:a.jsx(yn,{present:o||u.open,children:a.jsx(Hl.Slot,{scope:e.__scopeMenu,children:a.jsx(Ox,{id:f.contentId,"aria-labelledby":f.triggerId,...l,ref:p,align:"start",side:d.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:v=>{d.isUsingKeyboardRef.current&&m.current?.focus(),v.preventDefault()},onCloseAutoFocus:v=>v.preventDefault(),onFocusOutside:be(e.onFocusOutside,v=>{v.target!==f.trigger&&u.onOpenChange(!1)}),onEscapeKeyDown:be(e.onEscapeKeyDown,v=>{d.onClose(),v.preventDefault()}),onKeyDown:be(e.onKeyDown,v=>{const y=v.currentTarget.contains(v.target),b=wO[d.dir].includes(v.key);y&&b&&(u.onOpenChange(!1),f.trigger?.focus(),v.preventDefault())})})})})})});DN.displayName=MN;function ON(e){return e?"open":"closed"}function od(e){return e==="indeterminate"}function Lx(e){return od(e)?"indeterminate":e?"checked":"unchecked"}function BO(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function VO(e,t){return e.map((r,o)=>e[(t+o)%e.length])}function HO(e,t,r){const l=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,u=r?e.indexOf(r):-1;let d=VO(e,Math.max(u,0));l.length===1&&(d=d.filter(p=>p!==r));const m=d.find(p=>p.toLowerCase().startsWith(l.toLowerCase()));return m!==r?m:void 0}function FO(e,t){const{x:r,y:o}=e;let l=!1;for(let u=0,d=t.length-1;u<t.length;d=u++){const f=t[u],m=t[d],p=f.x,v=f.y,y=m.x,b=m.y;v>o!=b>o&&r<(y-p)*(o-v)/(b-v)+p&&(l=!l)}return l}function qO(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return FO(r,t)}function Fl(e){return t=>t.pointerType==="mouse"?e(t):void 0}var YO=pN,ZO=_x,GO=gN,KO=vN,QO=zx,XO=yN,WO=Hd,JO=wN,e6=NN,t6=kN,n6=EN,r6=AN,a6=RN,s6=_N,o6=DN,Fd="DropdownMenu",[i6,AV]=Qt(Fd,[hN]),On=hN(),[l6,zN]=i6(Fd),PN=e=>{const{__scopeDropdownMenu:t,children:r,dir:o,open:l,defaultOpen:u,onOpenChange:d,modal:f=!0}=e,m=On(t),p=x.useRef(null),[v,y]=Hn({prop:l,defaultProp:u??!1,onChange:d,caller:Fd});return a.jsx(l6,{scope:t,triggerId:nr(),triggerRef:p,contentId:nr(),open:v,onOpenChange:y,onOpenToggle:x.useCallback(()=>y(b=>!b),[y]),modal:f,children:a.jsx(YO,{...m,open:v,onOpenChange:y,dir:o,modal:f,children:r})})};PN.displayName=Fd;var LN="DropdownMenuTrigger",$N=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...l}=e,u=zN(LN,r),d=On(r);return a.jsx(ZO,{asChild:!0,...d,children:a.jsx(Ee.button,{type:"button",id:u.triggerId,"aria-haspopup":"menu","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":u.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...l,ref:_d(t,u.triggerRef),onPointerDown:be(e.onPointerDown,f=>{!o&&f.button===0&&f.ctrlKey===!1&&(u.onOpenToggle(),u.open||f.preventDefault())}),onKeyDown:be(e.onKeyDown,f=>{o||(["Enter"," "].includes(f.key)&&u.onOpenToggle(),f.key==="ArrowDown"&&u.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(f.key)&&f.preventDefault())})})})});$N.displayName=LN;var c6="DropdownMenuPortal",IN=e=>{const{__scopeDropdownMenu:t,...r}=e,o=On(t);return a.jsx(GO,{...o,...r})};IN.displayName=c6;var UN="DropdownMenuContent",BN=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,l=zN(UN,r),u=On(r),d=x.useRef(!1);return a.jsx(KO,{id:l.contentId,"aria-labelledby":l.triggerId,...u,...o,ref:t,onCloseAutoFocus:be(e.onCloseAutoFocus,f=>{d.current||l.triggerRef.current?.focus(),d.current=!1,f.preventDefault()}),onInteractOutside:be(e.onInteractOutside,f=>{const m=f.detail.originalEvent,p=m.button===0&&m.ctrlKey===!0,v=m.button===2||p;(!l.modal||v)&&(d.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)"}})});BN.displayName=UN;var u6="DropdownMenuGroup",d6=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,l=On(r);return a.jsx(QO,{...l,...o,ref:t})});d6.displayName=u6;var f6="DropdownMenuLabel",VN=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,l=On(r);return a.jsx(XO,{...l,...o,ref:t})});VN.displayName=f6;var h6="DropdownMenuItem",HN=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,l=On(r);return a.jsx(WO,{...l,...o,ref:t})});HN.displayName=h6;var m6="DropdownMenuCheckboxItem",FN=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,l=On(r);return a.jsx(JO,{...l,...o,ref:t})});FN.displayName=m6;var p6="DropdownMenuRadioGroup",x6=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,l=On(r);return a.jsx(e6,{...l,...o,ref:t})});x6.displayName=p6;var g6="DropdownMenuRadioItem",qN=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,l=On(r);return a.jsx(t6,{...l,...o,ref:t})});qN.displayName=g6;var v6="DropdownMenuItemIndicator",YN=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,l=On(r);return a.jsx(n6,{...l,...o,ref:t})});YN.displayName=v6;var y6="DropdownMenuSeparator",ZN=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,l=On(r);return a.jsx(r6,{...l,...o,ref:t})});ZN.displayName=y6;var b6="DropdownMenuArrow",w6=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,l=On(r);return a.jsx(a6,{...l,...o,ref:t})});w6.displayName=b6;var j6="DropdownMenuSubTrigger",GN=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,l=On(r);return a.jsx(s6,{...l,...o,ref:t})});GN.displayName=j6;var N6="DropdownMenuSubContent",KN=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...o}=e,l=On(r);return a.jsx(o6,{...l,...o,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)"}})});KN.displayName=N6;var S6=PN,k6=$N,C6=IN,QN=BN,XN=VN,WN=HN,JN=FN,eS=qN,tS=YN,nS=ZN,rS=GN,aS=KN;const qd=S6,Yd=k6,E6=x.forwardRef(({className:e,inset:t,children:r,...o},l)=>a.jsxs(rS,{ref:l,className:je("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...o,children:[r,a.jsx(Ad,{className:"ml-auto"})]}));E6.displayName=rS.displayName;const A6=x.forwardRef(({className:e,...t},r)=>a.jsx(aS,{ref:r,className:je("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...t}));A6.displayName=aS.displayName;const sc=x.forwardRef(({className:e,sideOffset:t=4,...r},o)=>a.jsx(C6,{children:a.jsx(QN,{ref:o,sideOffset:t,className:je("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",e),...r})}));sc.displayName=QN.displayName;const gr=x.forwardRef(({className:e,inset:t,...r},o)=>a.jsx(WN,{ref:o,className:je("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r}));gr.displayName=WN.displayName;const R6=x.forwardRef(({className:e,children:t,checked:r,...o},l)=>a.jsxs(JN,{ref:l,className:je("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,...o,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(tS,{children:a.jsx(Cd,{className:"h-4 w-4"})})}),t]}));R6.displayName=JN.displayName;const T6=x.forwardRef(({className:e,children:t,...r},o)=>a.jsxs(eS,{ref:o,className:je("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:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(tS,{children:a.jsx(W1,{className:"h-2 w-2 fill-current"})})}),t]}));T6.displayName=eS.displayName;const _6=x.forwardRef(({className:e,inset:t,...r},o)=>a.jsx(XN,{ref:o,className:je("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...r}));_6.displayName=XN.displayName;const sS=x.forwardRef(({className:e,...t},r)=>a.jsx(nS,{ref:r,className:je("-mx-1 my-1 h-px bg-muted",e),...t}));sS.displayName=nS.displayName;const Ep="spring",oS=x.createContext({season:Ep,setSeason:()=>{}});function M6({children:e}){const[t,r]=x.useState(()=>typeof window<"u"&&localStorage.getItem("season")||Ep);return x.useEffect(()=>{const o=document.documentElement;o.classList.remove("spring","summer","autumn","winter"),o.classList.add(t),localStorage.setItem("season",t)},[t]),a.jsx(oS.Provider,{value:{season:t,setSeason:r},children:e})}const $x=()=>x.useContext(oS);function D6({className:e}){const{season:t,setSeason:r}=$x(),o=()=>{switch(t){case"spring":return a.jsx(Hm,{className:"h-5 w-5"});case"summer":return a.jsx(ed,{className:"h-5 w-5"});case"autumn":return a.jsx(Qb,{className:"h-5 w-5"});case"winter":return a.jsx(Kb,{className:"h-5 w-5"});default:return a.jsx(Hm,{className:"h-5 w-5"})}};return a.jsxs(qd,{children:[a.jsx(Yd,{asChild:!0,children:a.jsxs(X,{variant:"ghost",size:"icon",className:`p-2 rounded-full text-foreground/70 dark:text-foreground/70 hover:bg-accent/20 dark:hover:bg-accent/20 ${e}`,children:[o(),a.jsx("span",{className:"sr-only",children:"Change season theme"})]})}),a.jsxs(sc,{align:"end",children:[a.jsxs(gr,{onClick:()=>r("spring"),children:[a.jsx(Hm,{className:"mr-2 h-4 w-4"}),a.jsx("span",{children:"Spring"})]}),a.jsxs(gr,{onClick:()=>r("summer"),children:[a.jsx(ed,{className:"mr-2 h-4 w-4"}),a.jsx("span",{children:"Summer"})]}),a.jsxs(gr,{onClick:()=>r("autumn"),children:[a.jsx(Qb,{className:"mr-2 h-4 w-4"}),a.jsx("span",{children:"Autumn"})]}),a.jsxs(gr,{onClick:()=>r("winter"),children:[a.jsx(Kb,{className:"mr-2 h-4 w-4"}),a.jsx("span",{children:"Winter"})]})]})]})}function O6(){const[e,t]=x.useState(()=>localStorage.getItem("theme")||"system");return x.useEffect(()=>{const o=window.document.documentElement;if(e==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";o.classList.toggle("dark",l==="dark")}else o.classList.toggle("dark",e==="dark");localStorage.setItem("theme",e)},[e]),x.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),l=()=>{e==="system"&&window.document.documentElement.classList.toggle("dark",o.matches)};return o.addEventListener("change",l),()=>o.removeEventListener("change",l)},[e]),{theme:e,setTheme:o=>{t(o)}}}function z6(){const{theme:e,setTheme:t}=O6(),[r,o]=x.useState(!1);return a.jsxs("header",{className:"navigation-header border-b border-border/30 bg-background dark:bg-background sticky top-0 z-10 shadow-sm",children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-3 md:px-6 max-w-[var(--content-width)] mx-auto",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx(Ce,{href:"/",className:"font-serif text-2xl font-semibold tracking-tight text-primary dark:text-primary-foreground",children:"Tercul"}),a.jsxs("nav",{className:"hidden md:flex items-center space-x-6",children:[a.jsx(Ce,{href:"/explore",className:"text-foreground/80 dark:text-foreground/80 hover:text-primary dark:hover:text-primary/90 transition-colors font-sans text-sm font-medium",children:"Explore"}),a.jsx(Ce,{href:"/authors",className:"text-foreground/80 dark:text-foreground/80 hover:text-primary dark:hover:text-primary/90 transition-colors font-sans text-sm font-medium",children:"Authors"}),a.jsx(Ce,{href:"/collections",className:"text-foreground/80 dark:text-foreground/80 hover:text-primary dark:hover:text-primary/90 transition-colors font-sans text-sm font-medium",children:"Collections"}),a.jsx(Ce,{href:"/blog",className:"text-foreground/80 dark:text-foreground/80 hover:text-primary dark:hover:text-primary/90 transition-colors font-sans text-sm font-medium",children:"Blog"})]})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Ce,{href:"/search",children:a.jsxs(X,{variant:"ghost",size:"icon",className:"p-2 rounded-full text-foreground/70 dark:text-foreground/70 hover:bg-accent/20 dark:hover:bg-accent/20",children:[a.jsx(Xs,{className:"h-5 w-5"}),a.jsx("span",{className:"sr-only",children:"Search"})]})}),a.jsxs(qd,{children:[a.jsx(Yd,{asChild:!0,children:a.jsxs(X,{variant:"ghost",size:"icon",className:"p-2 rounded-full text-foreground/70 dark:text-foreground/70 hover:bg-accent/20 dark:hover:bg-accent/20",children:[e==="dark"?a.jsx(rj,{className:"h-5 w-5"}):a.jsx(ed,{className:"h-5 w-5"}),a.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}),a.jsxs(sc,{align:"end",children:[a.jsx(gr,{onClick:()=>t("light"),children:"Light"}),a.jsx(gr,{onClick:()=>t("dark"),children:"Dark"}),a.jsx(gr,{onClick:()=>t("system"),children:"System"})]})]}),a.jsx(D6,{}),a.jsx("div",{className:"h-6 w-px bg-accent/20 dark:bg-accent/20 mx-1"}),a.jsx(Ce,{href:"/profile",children:a.jsx(X,{className:"flex items-center space-x-2 py-1 px-3 text-sm font-sans font-medium rounded-full bg-accent/20 dark:bg-accent/20 text-foreground dark:text-foreground/90 hover:bg-accent/30 dark:hover:bg-accent/30 transition-colors",children:a.jsx("span",{children:"Sign In"})})}),a.jsxs(X,{variant:"ghost",size:"icon",className:"md:hidden p-2 rounded-full text-foreground/70 dark:text-foreground/70 hover:bg-accent/20 dark:hover:bg-accent/20",onClick:()=>o(!r),children:[a.jsx(l_,{className:"h-5 w-5"}),a.jsx("span",{className:"sr-only",children:"Menu"})]})]})]}),r&&a.jsx("div",{className:"md:hidden px-4 py-3 bg-background dark:bg-background border-t border-border/30 dark:border-border/30",children:a.jsxs("nav",{className:"flex flex-col space-y-3",children:[a.jsx(Ce,{href:"/explore",className:"text-foreground/80 dark:text-foreground/80 hover:text-primary dark:hover:text-primary/90 font-sans text-sm font-medium transition-colors",children:"Explore"}),a.jsx(Ce,{href:"/authors",className:"text-foreground/80 dark:text-foreground/80 hover:text-primary dark:hover:text-primary/90 font-sans text-sm font-medium transition-colors",children:"Authors"}),a.jsx(Ce,{href:"/collections",className:"text-foreground/80 dark:text-foreground/80 hover:text-primary dark:hover:text-primary/90 font-sans text-sm font-medium transition-colors",children:"Collections"}),a.jsx(Ce,{href:"/blog",className:"text-foreground/80 dark:text-foreground/80 hover:text-primary dark:hover:text-primary/90 font-sans text-sm font-medium transition-colors",children:"Blog"})]})})]})}function Kt({children:e,className:t="",noFooter:r=!1,zenMode:o=!1}){const l=`min-h-screen flex flex-col ${o?"zen-mode":""}`;return a.jsxs("div",{className:l,children:[a.jsx(z6,{}),a.jsx("main",{className:`flex-1 ${t}`,children:e}),!r&&a.jsx(m3,{})]})}const Oe=x.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:je("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Oe.displayName="Card";const zt=x.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:je("flex flex-col space-y-1.5 p-6",e),...t}));zt.displayName="CardHeader";const Gt=x.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:je("text-2xl font-semibold leading-none tracking-tight",e),...t}));Gt.displayName="CardTitle";const Xr=x.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:je("text-sm text-muted-foreground",e),...t}));Xr.displayName="CardDescription";const Ve=x.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:je("p-6 pt-0",e),...t}));Ve.displayName="CardContent";const Ea=x.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:je("flex items-center p-6 pt-0",e),...t}));Ea.displayName="CardFooter";var Ix="Progress",Ux=100,[P6,RV]=Qt(Ix),[L6,$6]=P6(Ix),iS=x.forwardRef((e,t)=>{const{__scopeProgress:r,value:o=null,max:l,getValueLabel:u=I6,...d}=e;(l||l===0)&&!Cw(l)&&console.error(U6(`${l}`,"Progress"));const f=Cw(l)?l:Ux;o!==null&&!Ew(o,f)&&console.error(B6(`${o}`,"Progress"));const m=Ew(o,f)?o:null,p=id(m)?u(m,f):void 0;return a.jsx(L6,{scope:r,value:m,max:f,children:a.jsx(Ee.div,{"aria-valuemax":f,"aria-valuemin":0,"aria-valuenow":id(m)?m:void 0,"aria-valuetext":p,role:"progressbar","data-state":uS(m,f),"data-value":m??void 0,"data-max":f,...d,ref:t})})});iS.displayName=Ix;var lS="ProgressIndicator",cS=x.forwardRef((e,t)=>{const{__scopeProgress:r,...o}=e,l=$6(lS,r);return a.jsx(Ee.div,{"data-state":uS(l.value,l.max),"data-value":l.value??void 0,"data-max":l.max,...o,ref:t})});cS.displayName=lS;function I6(e,t){return`${Math.round(e/t*100)}%`}function uS(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function id(e){return typeof e=="number"}function Cw(e){return id(e)&&!isNaN(e)&&e>0}function Ew(e,t){return id(e)&&!isNaN(e)&&e<=t&&e>=0}function U6(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Ux}\`.`}function B6(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 ${Ux} if no \`max\` prop is set)
|
||
- \`null\` or \`undefined\` if the progress is indeterminate.
|
||
|
||
Defaulting to \`null\`.`}var dS=iS,V6=cS;const os=x.forwardRef(({className:e,value:t,...r},o)=>a.jsx(dS,{ref:o,className:je("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:a.jsx(V6,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));os.displayName=dS.displayName;function ql(e,[t,r]){return Math.min(r,Math.max(t,e))}function oc(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var H6=[" ","Enter","ArrowUp","ArrowDown"],F6=[" ","Enter"],eo="Select",[Zd,Gd,q6]=tc(eo),[bi,TV]=Qt(eo,[q6,gi]),Kd=gi(),[Y6,ws]=bi(eo),[Z6,G6]=bi(eo),fS=e=>{const{__scopeSelect:t,children:r,open:o,defaultOpen:l,onOpenChange:u,value:d,defaultValue:f,onValueChange:m,dir:p,name:v,autoComplete:y,disabled:b,required:S,form:N}=e,w=Kd(t),[C,k]=x.useState(null),[E,R]=x.useState(null),[T,z]=x.useState(!1),ne=bs(p),[$,V]=Hn({prop:o,defaultProp:l??!1,onChange:u,caller:eo}),[J,se]=Hn({prop:d,defaultProp:f,onChange:m,caller:eo}),ie=x.useRef(null),te=C?N||!!C.closest("form"):!0,[q,de]=x.useState(new Set),me=Array.from(q).map(O=>O.props.value).join(";");return a.jsx(yx,{...w,children:a.jsxs(Y6,{required:S,scope:t,trigger:C,onTriggerChange:k,valueNode:E,onValueNodeChange:R,valueNodeHasChildren:T,onValueNodeHasChildrenChange:z,contentId:nr(),value:J,onValueChange:se,open:$,onOpenChange:V,dir:ne,triggerPointerDownPosRef:ie,disabled:b,children:[a.jsx(Zd.Provider,{scope:t,children:a.jsx(Z6,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(O=>{de(L=>new Set(L).add(O))},[]),onNativeOptionRemove:x.useCallback(O=>{de(L=>{const F=new Set(L);return F.delete(O),F})},[]),children:r})}),te?a.jsxs(PS,{"aria-hidden":!0,required:S,tabIndex:-1,name:v,autoComplete:y,value:J,onChange:O=>se(O.target.value),disabled:b,form:N,children:[J===void 0?a.jsx("option",{value:""}):null,Array.from(q)]},me):null]})})};fS.displayName=eo;var hS="SelectTrigger",mS=x.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:o=!1,...l}=e,u=Kd(r),d=ws(hS,r),f=d.disabled||o,m=Le(t,d.onTriggerChange),p=Gd(r),v=x.useRef("touch"),[y,b,S]=$S(w=>{const C=p().filter(R=>!R.disabled),k=C.find(R=>R.value===d.value),E=IS(C,w,k);E!==void 0&&d.onValueChange(E.value)}),N=w=>{f||(d.onOpenChange(!0),S()),w&&(d.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})};return a.jsx(bx,{asChild:!0,...u,children:a.jsx(Ee.button,{type:"button",role:"combobox","aria-controls":d.contentId,"aria-expanded":d.open,"aria-required":d.required,"aria-autocomplete":"none",dir:d.dir,"data-state":d.open?"open":"closed",disabled:f,"data-disabled":f?"":void 0,"data-placeholder":LS(d.value)?"":void 0,...l,ref:m,onClick:be(l.onClick,w=>{w.currentTarget.focus(),v.current!=="mouse"&&N(w)}),onPointerDown:be(l.onPointerDown,w=>{v.current=w.pointerType;const C=w.target;C.hasPointerCapture(w.pointerId)&&C.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(N(w),w.preventDefault())}),onKeyDown:be(l.onKeyDown,w=>{const C=y.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&b(w.key),!(C&&w.key===" ")&&H6.includes(w.key)&&(N(),w.preventDefault())})})})});mS.displayName=hS;var pS="SelectValue",xS=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:o,style:l,children:u,placeholder:d="",...f}=e,m=ws(pS,r),{onValueNodeHasChildrenChange:p}=m,v=u!==void 0,y=Le(t,m.onValueNodeChange);return Vt(()=>{p(v)},[p,v]),a.jsx(Ee.span,{...f,ref:y,style:{pointerEvents:"none"},children:LS(m.value)?a.jsx(a.Fragment,{children:d}):u})});xS.displayName=pS;var K6="SelectIcon",gS=x.forwardRef((e,t)=>{const{__scopeSelect:r,children:o,...l}=e;return a.jsx(Ee.span,{"aria-hidden":!0,...l,ref:t,children:o||"▼"})});gS.displayName=K6;var Q6="SelectPortal",vS=e=>a.jsx(zd,{asChild:!0,...e});vS.displayName=Q6;var to="SelectContent",yS=x.forwardRef((e,t)=>{const r=ws(to,e.__scopeSelect),[o,l]=x.useState();if(Vt(()=>{l(new DocumentFragment)},[]),!r.open){const u=o;return u?mi.createPortal(a.jsx(bS,{scope:e.__scopeSelect,children:a.jsx(Zd.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),u):null}return a.jsx(wS,{...e,ref:t})});yS.displayName=to;var kr=10,[bS,js]=bi(to),X6="SelectContentImpl",W6=Ws("SelectContent.RemoveScroll"),wS=x.forwardRef((e,t)=>{const{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,side:f,sideOffset:m,align:p,alignOffset:v,arrowPadding:y,collisionBoundary:b,collisionPadding:S,sticky:N,hideWhenDetached:w,avoidCollisions:C,...k}=e,E=ws(to,r),[R,T]=x.useState(null),[z,ne]=x.useState(null),$=Le(t,M=>T(M)),[V,J]=x.useState(null),[se,ie]=x.useState(null),te=Gd(r),[q,de]=x.useState(!1),me=x.useRef(!1);x.useEffect(()=>{if(R)return Tx(R)},[R]),Ex();const O=x.useCallback(M=>{const[he,...Be]=te().map(Re=>Re.ref.current),[He]=Be.slice(-1),pe=document.activeElement;for(const Re of M)if(Re===pe||(Re?.scrollIntoView({block:"nearest"}),Re===he&&z&&(z.scrollTop=0),Re===He&&z&&(z.scrollTop=z.scrollHeight),Re?.focus(),document.activeElement!==pe))return},[te,z]),L=x.useCallback(()=>O([V,R]),[O,V,R]);x.useEffect(()=>{q&&L()},[q,L]);const{onOpenChange:F,triggerPointerDownPosRef:Q}=E;x.useEffect(()=>{if(R){let M={x:0,y:0};const he=He=>{M={x:Math.abs(Math.round(He.pageX)-(Q.current?.x??0)),y:Math.abs(Math.round(He.pageY)-(Q.current?.y??0))}},Be=He=>{M.x<=10&&M.y<=10?He.preventDefault():R.contains(He.target)||F(!1),document.removeEventListener("pointermove",he),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",he),document.addEventListener("pointerup",Be,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",he),document.removeEventListener("pointerup",Be,{capture:!0})}}},[R,F,Q]),x.useEffect(()=>{const M=()=>F(!1);return window.addEventListener("blur",M),window.addEventListener("resize",M),()=>{window.removeEventListener("blur",M),window.removeEventListener("resize",M)}},[F]);const[_,B]=$S(M=>{const he=te().filter(pe=>!pe.disabled),Be=he.find(pe=>pe.ref.current===document.activeElement),He=IS(he,M,Be);He&&setTimeout(()=>He.ref.current.focus())}),ge=x.useCallback((M,he,Be)=>{const He=!me.current&&!Be;(E.value!==void 0&&E.value===he||He)&&(J(M),He&&(me.current=!0))},[E.value]),fe=x.useCallback(()=>R?.focus(),[R]),ye=x.useCallback((M,he,Be)=>{const He=!me.current&&!Be;(E.value!==void 0&&E.value===he||He)&&ie(M)},[E.value]),_e=o==="popper"?Ap:jS,G=_e===Ap?{side:f,sideOffset:m,align:p,alignOffset:v,arrowPadding:y,collisionBoundary:b,collisionPadding:S,sticky:N,hideWhenDetached:w,avoidCollisions:C}:{};return a.jsx(bS,{scope:r,content:R,viewport:z,onViewportChange:ne,itemRefCallback:ge,selectedItem:V,onItemLeave:fe,itemTextRefCallback:ye,focusSelectedItem:L,selectedItemText:se,position:o,isPositioned:q,searchRef:_,children:a.jsx(Bd,{as:W6,allowPinchZoom:!0,children:a.jsx(Id,{asChild:!0,trapped:E.open,onMountAutoFocus:M=>{M.preventDefault()},onUnmountAutoFocus:be(l,M=>{E.trigger?.focus({preventScroll:!0}),M.preventDefault()}),children:a.jsx(Wl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:M=>M.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:a.jsx(_e,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:M=>M.preventDefault(),...k,...G,onPlaced:()=>de(!0),ref:$,style:{display:"flex",flexDirection:"column",outline:"none",...k.style},onKeyDown:be(k.onKeyDown,M=>{const he=M.ctrlKey||M.altKey||M.metaKey;if(M.key==="Tab"&&M.preventDefault(),!he&&M.key.length===1&&B(M.key),["ArrowUp","ArrowDown","Home","End"].includes(M.key)){let He=te().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);if(["ArrowUp","End"].includes(M.key)&&(He=He.slice().reverse()),["ArrowUp","ArrowDown"].includes(M.key)){const pe=M.target,Re=He.indexOf(pe);He=He.slice(Re+1)}setTimeout(()=>O(He)),M.preventDefault()}})})})})})})});wS.displayName=X6;var J6="SelectItemAlignedPosition",jS=x.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:o,...l}=e,u=ws(to,r),d=js(to,r),[f,m]=x.useState(null),[p,v]=x.useState(null),y=Le(t,$=>v($)),b=Gd(r),S=x.useRef(!1),N=x.useRef(!0),{viewport:w,selectedItem:C,selectedItemText:k,focusSelectedItem:E}=d,R=x.useCallback(()=>{if(u.trigger&&u.valueNode&&f&&p&&w&&C&&k){const $=u.trigger.getBoundingClientRect(),V=p.getBoundingClientRect(),J=u.valueNode.getBoundingClientRect(),se=k.getBoundingClientRect();if(u.dir!=="rtl"){const pe=se.left-V.left,Re=J.left-pe,Ye=$.left-Re,Ae=$.width+Ye,yt=Math.max(Ae,V.width),Pt=window.innerWidth-kr,Nt=ql(Re,[kr,Math.max(kr,Pt-yt)]);f.style.minWidth=Ae+"px",f.style.left=Nt+"px"}else{const pe=V.right-se.right,Re=window.innerWidth-J.right-pe,Ye=window.innerWidth-$.right-Re,Ae=$.width+Ye,yt=Math.max(Ae,V.width),Pt=window.innerWidth-kr,Nt=ql(Re,[kr,Math.max(kr,Pt-yt)]);f.style.minWidth=Ae+"px",f.style.right=Nt+"px"}const ie=b(),te=window.innerHeight-kr*2,q=w.scrollHeight,de=window.getComputedStyle(p),me=parseInt(de.borderTopWidth,10),O=parseInt(de.paddingTop,10),L=parseInt(de.borderBottomWidth,10),F=parseInt(de.paddingBottom,10),Q=me+O+q+F+L,_=Math.min(C.offsetHeight*5,Q),B=window.getComputedStyle(w),ge=parseInt(B.paddingTop,10),fe=parseInt(B.paddingBottom,10),ye=$.top+$.height/2-kr,_e=te-ye,G=C.offsetHeight/2,M=C.offsetTop+G,he=me+O+M,Be=Q-he;if(he<=ye){const pe=ie.length>0&&C===ie[ie.length-1].ref.current;f.style.bottom="0px";const Re=p.clientHeight-w.offsetTop-w.offsetHeight,Ye=Math.max(_e,G+(pe?fe:0)+Re+L),Ae=he+Ye;f.style.height=Ae+"px"}else{const pe=ie.length>0&&C===ie[0].ref.current;f.style.top="0px";const Ye=Math.max(ye,me+w.offsetTop+(pe?ge:0)+G)+Be;f.style.height=Ye+"px",w.scrollTop=he-ye+w.offsetTop}f.style.margin=`${kr}px 0`,f.style.minHeight=_+"px",f.style.maxHeight=te+"px",o?.(),requestAnimationFrame(()=>S.current=!0)}},[b,u.trigger,u.valueNode,f,p,w,C,k,u.dir,o]);Vt(()=>R(),[R]);const[T,z]=x.useState();Vt(()=>{p&&z(window.getComputedStyle(p).zIndex)},[p]);const ne=x.useCallback($=>{$&&N.current===!0&&(R(),E?.(),N.current=!1)},[R,E]);return a.jsx(t5,{scope:r,contentWrapper:f,shouldExpandOnScrollRef:S,onScrollButtonChange:ne,children:a.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:a.jsx(Ee.div,{...l,ref:y,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});jS.displayName=J6;var e5="SelectPopperPosition",Ap=x.forwardRef((e,t)=>{const{__scopeSelect:r,align:o="start",collisionPadding:l=kr,...u}=e,d=Kd(r);return a.jsx(wx,{...d,...u,ref:t,align:o,collisionPadding:l,style:{boxSizing:"border-box",...u.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)"}})});Ap.displayName=e5;var[t5,Bx]=bi(to,{}),Rp="SelectViewport",NS=x.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:o,...l}=e,u=js(Rp,r),d=Bx(Rp,r),f=Le(t,u.onViewportChange),m=x.useRef(0);return a.jsxs(a.Fragment,{children:[a.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:o}),a.jsx(Zd.Slot,{scope:r,children:a.jsx(Ee.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:f,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:be(l.onScroll,p=>{const v=p.currentTarget,{contentWrapper:y,shouldExpandOnScrollRef:b}=d;if(b?.current&&y){const S=Math.abs(m.current-v.scrollTop);if(S>0){const N=window.innerHeight-kr*2,w=parseFloat(y.style.minHeight),C=parseFloat(y.style.height),k=Math.max(w,C);if(k<N){const E=k+S,R=Math.min(N,E),T=E-R;y.style.height=R+"px",y.style.bottom==="0px"&&(v.scrollTop=T>0?T:0,y.style.justifyContent="flex-end")}}}m.current=v.scrollTop})})})]})});NS.displayName=Rp;var SS="SelectGroup",[n5,r5]=bi(SS),a5=x.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,l=nr();return a.jsx(n5,{scope:r,id:l,children:a.jsx(Ee.div,{role:"group","aria-labelledby":l,...o,ref:t})})});a5.displayName=SS;var kS="SelectLabel",CS=x.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,l=r5(kS,r);return a.jsx(Ee.div,{id:l.id,...o,ref:t})});CS.displayName=kS;var ld="SelectItem",[s5,ES]=bi(ld),AS=x.forwardRef((e,t)=>{const{__scopeSelect:r,value:o,disabled:l=!1,textValue:u,...d}=e,f=ws(ld,r),m=js(ld,r),p=f.value===o,[v,y]=x.useState(u??""),[b,S]=x.useState(!1),N=Le(t,E=>m.itemRefCallback?.(E,o,l)),w=nr(),C=x.useRef("touch"),k=()=>{l||(f.onValueChange(o),f.onOpenChange(!1))};if(o==="")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 a.jsx(s5,{scope:r,value:o,disabled:l,textId:w,isSelected:p,onItemTextChange:x.useCallback(E=>{y(R=>R||(E?.textContent??"").trim())},[]),children:a.jsx(Zd.ItemSlot,{scope:r,value:o,disabled:l,textValue:v,children:a.jsx(Ee.div,{role:"option","aria-labelledby":w,"data-highlighted":b?"":void 0,"aria-selected":p&&b,"data-state":p?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...d,ref:N,onFocus:be(d.onFocus,()=>S(!0)),onBlur:be(d.onBlur,()=>S(!1)),onClick:be(d.onClick,()=>{C.current!=="mouse"&&k()}),onPointerUp:be(d.onPointerUp,()=>{C.current==="mouse"&&k()}),onPointerDown:be(d.onPointerDown,E=>{C.current=E.pointerType}),onPointerMove:be(d.onPointerMove,E=>{C.current=E.pointerType,l?m.onItemLeave?.():C.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:be(d.onPointerLeave,E=>{E.currentTarget===document.activeElement&&m.onItemLeave?.()}),onKeyDown:be(d.onKeyDown,E=>{m.searchRef?.current!==""&&E.key===" "||(F6.includes(E.key)&&k(),E.key===" "&&E.preventDefault())})})})})});AS.displayName=ld;var _l="SelectItemText",RS=x.forwardRef((e,t)=>{const{__scopeSelect:r,className:o,style:l,...u}=e,d=ws(_l,r),f=js(_l,r),m=ES(_l,r),p=G6(_l,r),[v,y]=x.useState(null),b=Le(t,k=>y(k),m.onItemTextChange,k=>f.itemTextRefCallback?.(k,m.value,m.disabled)),S=v?.textContent,N=x.useMemo(()=>a.jsx("option",{value:m.value,disabled:m.disabled,children:S},m.value),[m.disabled,m.value,S]),{onNativeOptionAdd:w,onNativeOptionRemove:C}=p;return Vt(()=>(w(N),()=>C(N)),[w,C,N]),a.jsxs(a.Fragment,{children:[a.jsx(Ee.span,{id:m.textId,...u,ref:b}),m.isSelected&&d.valueNode&&!d.valueNodeHasChildren?mi.createPortal(u.children,d.valueNode):null]})});RS.displayName=_l;var TS="SelectItemIndicator",_S=x.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e;return ES(TS,r).isSelected?a.jsx(Ee.span,{"aria-hidden":!0,...o,ref:t}):null});_S.displayName=TS;var Tp="SelectScrollUpButton",MS=x.forwardRef((e,t)=>{const r=js(Tp,e.__scopeSelect),o=Bx(Tp,e.__scopeSelect),[l,u]=x.useState(!1),d=Le(t,o.onScrollButtonChange);return Vt(()=>{if(r.viewport&&r.isPositioned){let f=function(){const p=m.scrollTop>0;u(p)};const m=r.viewport;return f(),m.addEventListener("scroll",f),()=>m.removeEventListener("scroll",f)}},[r.viewport,r.isPositioned]),l?a.jsx(OS,{...e,ref:d,onAutoScroll:()=>{const{viewport:f,selectedItem:m}=r;f&&m&&(f.scrollTop=f.scrollTop-m.offsetHeight)}}):null});MS.displayName=Tp;var _p="SelectScrollDownButton",DS=x.forwardRef((e,t)=>{const r=js(_p,e.__scopeSelect),o=Bx(_p,e.__scopeSelect),[l,u]=x.useState(!1),d=Le(t,o.onScrollButtonChange);return Vt(()=>{if(r.viewport&&r.isPositioned){let f=function(){const p=m.scrollHeight-m.clientHeight,v=Math.ceil(m.scrollTop)<p;u(v)};const m=r.viewport;return f(),m.addEventListener("scroll",f),()=>m.removeEventListener("scroll",f)}},[r.viewport,r.isPositioned]),l?a.jsx(OS,{...e,ref:d,onAutoScroll:()=>{const{viewport:f,selectedItem:m}=r;f&&m&&(f.scrollTop=f.scrollTop+m.offsetHeight)}}):null});DS.displayName=_p;var OS=x.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:o,...l}=e,u=js("SelectScrollButton",r),d=x.useRef(null),f=Gd(r),m=x.useCallback(()=>{d.current!==null&&(window.clearInterval(d.current),d.current=null)},[]);return x.useEffect(()=>()=>m(),[m]),Vt(()=>{f().find(v=>v.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[f]),a.jsx(Ee.div,{"aria-hidden":!0,...l,ref:t,style:{flexShrink:0,...l.style},onPointerDown:be(l.onPointerDown,()=>{d.current===null&&(d.current=window.setInterval(o,50))}),onPointerMove:be(l.onPointerMove,()=>{u.onItemLeave?.(),d.current===null&&(d.current=window.setInterval(o,50))}),onPointerLeave:be(l.onPointerLeave,()=>{m()})})}),o5="SelectSeparator",zS=x.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e;return a.jsx(Ee.div,{"aria-hidden":!0,...o,ref:t})});zS.displayName=o5;var Mp="SelectArrow",i5=x.forwardRef((e,t)=>{const{__scopeSelect:r,...o}=e,l=Kd(r),u=ws(Mp,r),d=js(Mp,r);return u.open&&d.position==="popper"?a.jsx(jx,{...l,...o,ref:t}):null});i5.displayName=Mp;var l5="SelectBubbleInput",PS=x.forwardRef(({__scopeSelect:e,value:t,...r},o)=>{const l=x.useRef(null),u=Le(o,l),d=oc(t);return x.useEffect(()=>{const f=l.current;if(!f)return;const m=window.HTMLSelectElement.prototype,v=Object.getOwnPropertyDescriptor(m,"value").set;if(d!==t&&v){const y=new Event("change",{bubbles:!0});v.call(f,t),f.dispatchEvent(y)}},[d,t]),a.jsx(Ee.select,{...r,style:{...Oj,...r.style},ref:u,defaultValue:t})});PS.displayName=l5;function LS(e){return e===""||e===void 0}function $S(e){const t=un(e),r=x.useRef(""),o=x.useRef(0),l=x.useCallback(d=>{const f=r.current+d;t(f),(function m(p){r.current=p,window.clearTimeout(o.current),p!==""&&(o.current=window.setTimeout(()=>m(""),1e3))})(f)},[t]),u=x.useCallback(()=>{r.current="",window.clearTimeout(o.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(o.current),[]),[r,l,u]}function IS(e,t,r){const l=t.length>1&&Array.from(t).every(p=>p===t[0])?t[0]:t,u=r?e.indexOf(r):-1;let d=c5(e,Math.max(u,0));l.length===1&&(d=d.filter(p=>p!==r));const m=d.find(p=>p.textValue.toLowerCase().startsWith(l.toLowerCase()));return m!==r?m:void 0}function c5(e,t){return e.map((r,o)=>e[(t+o)%e.length])}var u5=fS,US=mS,d5=xS,f5=gS,h5=vS,BS=yS,m5=NS,VS=CS,HS=AS,p5=RS,x5=_S,FS=MS,qS=DS,YS=zS;const Bn=u5,Vn=d5,Mn=x.forwardRef(({className:e,children:t,...r},o)=>a.jsxs(US,{ref:o,className:je("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 data-[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,a.jsx(f5,{asChild:!0,children:a.jsx(Ed,{className:"h-4 w-4 opacity-50"})})]}));Mn.displayName=US.displayName;const ZS=x.forwardRef(({className:e,...t},r)=>a.jsx(FS,{ref:r,className:je("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(UT,{className:"h-4 w-4"})}));ZS.displayName=FS.displayName;const GS=x.forwardRef(({className:e,...t},r)=>a.jsx(qS,{ref:r,className:je("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(Ed,{className:"h-4 w-4"})}));GS.displayName=qS.displayName;const Dn=x.forwardRef(({className:e,children:t,position:r="popper",...o},l)=>a.jsx(h5,{children:a.jsxs(BS,{ref:l,className:je("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",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,...o,children:[a.jsx(ZS,{}),a.jsx(m5,{className:je("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),a.jsx(GS,{})]})}));Dn.displayName=BS.displayName;const g5=x.forwardRef(({className:e,...t},r)=>a.jsx(VS,{ref:r,className:je("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));g5.displayName=VS.displayName;const Qe=x.forwardRef(({className:e,children:t,...r},o)=>a.jsxs(HS,{ref:o,className:je("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:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(x5,{children:a.jsx(Cd,{className:"h-4 w-4"})})}),a.jsx(p5,{children:t})]}));Qe.displayName=HS.displayName;const v5=x.forwardRef(({className:e,...t},r)=>a.jsx(YS,{ref:r,className:je("-mx-1 my-1 h-px bg-muted",e),...t}));v5.displayName=YS.displayName;function Pe({className:e,...t}){return a.jsx("div",{className:je("animate-pulse rounded-md bg-muted",e),...t})}var Qd="Tabs",[y5,_V]=Qt(Qd,[yi]),KS=yi(),[b5,Vx]=y5(Qd),QS=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,onValueChange:l,defaultValue:u,orientation:d="horizontal",dir:f,activationMode:m="automatic",...p}=e,v=bs(f),[y,b]=Hn({prop:o,onChange:l,defaultProp:u??"",caller:Qd});return a.jsx(b5,{scope:r,baseId:nr(),value:y,onValueChange:b,orientation:d,dir:v,activationMode:m,children:a.jsx(Ee.div,{dir:v,"data-orientation":d,...p,ref:t})})});QS.displayName=Qd;var XS="TabsList",WS=x.forwardRef((e,t)=>{const{__scopeTabs:r,loop:o=!0,...l}=e,u=Vx(XS,r),d=KS(r);return a.jsx(Ax,{asChild:!0,...d,orientation:u.orientation,dir:u.dir,loop:o,children:a.jsx(Ee.div,{role:"tablist","aria-orientation":u.orientation,...l,ref:t})})});WS.displayName=XS;var JS="TabsTrigger",e2=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,disabled:l=!1,...u}=e,d=Vx(JS,r),f=KS(r),m=r2(d.baseId,o),p=a2(d.baseId,o),v=o===d.value;return a.jsx(Rx,{asChild:!0,...f,focusable:!l,active:v,children:a.jsx(Ee.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":p,"data-state":v?"active":"inactive","data-disabled":l?"":void 0,disabled:l,id:m,...u,ref:t,onMouseDown:be(e.onMouseDown,y=>{!l&&y.button===0&&y.ctrlKey===!1?d.onValueChange(o):y.preventDefault()}),onKeyDown:be(e.onKeyDown,y=>{[" ","Enter"].includes(y.key)&&d.onValueChange(o)}),onFocus:be(e.onFocus,()=>{const y=d.activationMode!=="manual";!v&&!l&&y&&d.onValueChange(o)})})})});e2.displayName=JS;var t2="TabsContent",n2=x.forwardRef((e,t)=>{const{__scopeTabs:r,value:o,forceMount:l,children:u,...d}=e,f=Vx(t2,r),m=r2(f.baseId,o),p=a2(f.baseId,o),v=o===f.value,y=x.useRef(v);return x.useEffect(()=>{const b=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(b)},[]),a.jsx(yn,{present:l||v,children:({present:b})=>a.jsx(Ee.div,{"data-state":v?"active":"inactive","data-orientation":f.orientation,role:"tabpanel","aria-labelledby":m,hidden:!b,id:p,tabIndex:0,...d,ref:t,style:{...e.style,animationDuration:y.current?"0s":void 0},children:b&&u})})});n2.displayName=t2;function r2(e,t){return`${e}-trigger-${t}`}function a2(e,t){return`${e}-content-${t}`}var w5=QS,s2=WS,o2=e2,i2=n2;const Ns=w5,_a=x.forwardRef(({className:e,...t},r)=>a.jsx(s2,{ref:r,className:je("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));_a.displayName=s2.displayName;const gt=x.forwardRef(({className:e,...t},r)=>a.jsx(o2,{ref:r,className:je("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}));gt.displayName=o2.displayName;const dn=x.forwardRef(({className:e,...t},r)=>a.jsx(i2,{ref:r,className:je("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));dn.displayName=i2.displayName;function j5(){const{slug:e}=Ql(),{season:t}=$x(),{toast:r}=Ta(),[o,l]=x.useState("list"),[u,d]=x.useState(null),[f,m]=x.useState(null),[p,v]=x.useState(null),[y,b]=x.useState(null),S=x.useRef(null),{data:N,isLoading:w}=tt({queryKey:[`/api/authors/${e}`]}),{data:C,isLoading:k}=tt({queryKey:[`/api/authors/${e}/works`],enabled:!!N}),{data:E,isLoading:R}=tt({queryKey:[`/api/authors/${e}/timeline`],enabled:!!N}),[T,z]=x.useState(!1),[ne,$]=x.useState(Math.floor(Math.random()*2e3)),V=N?.country?typeof N.country=="string"?N.country:N.country.name:void 0,J=N?.country&&typeof N.country=="object"?N.country.code:void 0,se=C?.length||0,ie=C?.reduce((G,M)=>G+Math.floor(Math.random()*5),0)||0,te=Math.floor(Math.random()*1e4),q=Math.floor(Math.random()*1e3),de=Math.floor(Math.random()*500),me=Array.from(new Set(C?.map(G=>G.year?.toString()).filter(Boolean))),O=Array.from(new Set(C?.flatMap(G=>G.tags?.map(M=>M.name)||[]).filter(Boolean))),L=Array.from(new Set(C?.map(G=>G.language).filter(Boolean))),F=Array.from(new Set(C?.map(G=>G.type).filter(Boolean))),Q=C?.filter(G=>!(u&&(!G.tags||!G.tags.some(M=>M.name===u))||f&&G.year?.toString()!==f||p&&G.type!==p||y&&G.language!==y)),_=Q?.reduce((G,M)=>{const he=M.type||"Other";return G[he]||(G[he]=[]),G[he].push(M),G},{}),B=()=>{$(T?ne-1:ne+1),z(!T),r({title:T?"Unfollowed":"Following",description:T?`You are no longer following ${N?.name}`:`You are now following ${N?.name}. You'll receive updates when new works are added.`,variant:"default"})},ge=()=>{navigator.clipboard.writeText(window.location.href),r({title:"Link copied",description:"The link to this author has been copied to your clipboard.",variant:"default"})},fe=()=>{d(null),m(null),v(null),b(null)},ye=G=>{switch(G){case"poem":return"Poems";case"story":return"Short Stories";case"novel":return"Novels";case"play":return"Plays";case"essay":return"Essays";default:return"Other Works"}},_e=()=>{switch(t){case"spring":return"bg-green-600 hover:bg-green-700 text-white";case"summer":return"bg-amber-600 hover:bg-amber-700 text-white";case"autumn":return"bg-russet hover:bg-russet/90 text-white";case"winter":return"bg-blue-600 hover:bg-blue-700 text-white";default:return"bg-russet hover:bg-russet/90 text-white"}};return a.jsxs(Kt,{children:[a.jsx("section",{className:`py-10 md:py-12 ${t==="spring"?"bg-gradient-to-b from-green-50 to-paper dark:from-green-950/20 dark:to-dark-paper":t==="summer"?"bg-gradient-to-b from-amber-50 to-paper dark:from-amber-950/20 dark:to-dark-paper":t==="autumn"?"bg-gradient-to-b from-russet/10 to-paper dark:from-russet/10 dark:to-dark-paper":"bg-gradient-to-b from-blue-50 to-paper dark:from-blue-950/20 dark:to-dark-paper"}`,children:a.jsx("div",{className:"max-w-[var(--content-width)] mx-auto px-4 md:px-6",children:w?a.jsxs("div",{className:"flex flex-col md:flex-row gap-6 md:gap-8",children:[a.jsx(Pe,{className:"flex-shrink-0 w-28 h-28 md:w-36 md:h-36 rounded-full"}),a.jsxs("div",{className:"flex-1",children:[a.jsx(Pe,{className:"h-10 w-1/3 mb-2"}),a.jsx(Pe,{className:"h-5 w-1/4 mb-2"}),a.jsx(Pe,{className:"h-20 w-full mb-4"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx(Pe,{className:"h-10 w-40"}),a.jsx(Pe,{className:"h-10 w-40"})]})]})]}):N?a.jsxs("div",{className:"flex flex-col md:flex-row gap-6 md:gap-8",children:[a.jsxs("div",{className:"flex flex-col items-center md:items-start",children:[a.jsx("div",{className:"flex-shrink-0 w-28 h-28 md:w-36 md:h-36 rounded-full bg-navy/10 dark:bg-navy/20 overflow-hidden border-4 border-white dark:border-gray-800 shadow-md",children:a.jsx("img",{src:N.portrait||"https://via.placeholder.com/300",alt:`Photo of ${N.name}`,className:"w-full h-full object-cover"})}),a.jsxs("div",{className:"mt-4 flex flex-col items-center md:items-start",children:[a.jsxs("div",{className:"flex gap-1.5 mb-2",children:[a.jsxs(ht,{className:"bg-navy/10 dark:bg-navy/20 text-navy/80 dark:text-cream/80 text-xs",children:[se," Works"]}),a.jsxs(ht,{className:"bg-navy/10 dark:bg-navy/20 text-navy/80 dark:text-cream/80 text-xs",children:[ne.toLocaleString()," Followers"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(X,{variant:"default",className:`flex items-center gap-1.5 py-1.5 px-3 rounded-full ${T?"bg-navy/20 dark:bg-navy/30 text-navy dark:text-cream":_e()} font-sans font-medium text-sm transition-colors`,onClick:B,children:[a.jsx(Qs,{className:`h-4 w-4 ${T?"fill-navy dark:fill-cream":"fill-white"}`}),a.jsx("span",{children:T?"Following":"Follow"})]}),a.jsx(Gr,{children:a.jsxs(ja,{children:[a.jsx(Na,{asChild:!0,children:a.jsx(X,{variant:"outline",className:"py-1.5 px-3 rounded-full bg-navy/10 hover:bg-navy/20 dark:bg-navy/20 dark:hover:bg-navy/30 text-navy dark:text-cream/90 font-sans font-medium text-sm transition-colors h-8",onClick:ge,children:a.jsx(cx,{className:"h-4 w-4"})})}),a.jsx(Kr,{children:a.jsx("p",{children:"Share this author"})})]})})]})]})]}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-2",children:[a.jsx("h1",{className:"font-serif text-2xl md:text-4xl font-bold text-navy dark:text-cream",children:N.name}),V&&a.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1 bg-navy/5 dark:bg-navy/10 rounded-full",children:[J&&a.jsx("img",{src:`https://flagcdn.com/w20/${J.toLowerCase()}.png`,alt:V,className:"w-5 h-auto rounded-sm"}),a.jsx("span",{className:"text-xs font-medium text-navy/70 dark:text-cream/70",children:V})]})]}),a.jsxs("div",{className:"flex items-center gap-x-4 gap-y-1 flex-wrap mb-4 text-sm text-navy/70 dark:text-cream/70",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Zs,{className:"h-4 w-4"}),a.jsxs("span",{children:[N.birthYear,"–",N.deathYear||"present"]})]}),O.length>0&&a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(p_,{className:"h-4 w-4"}),a.jsxs("span",{children:[O.slice(0,2).join(", "),O.length>2?"...":""]})]}),L.length>0&&a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Bu,{className:"h-4 w-4"}),a.jsxs("span",{children:[L.slice(0,2).join(", "),L.length>2?"...":""]})]})]}),a.jsx("div",{ref:S,className:"prose dark:prose-invert max-w-3xl mb-5 text-navy/90 dark:text-cream/90 line-clamp-3",children:a.jsx("p",{children:N.biography??"No biography available."})}),a.jsx("div",{className:"flex flex-wrap gap-2 items-center",children:a.jsxs("div",{className:"flex flex-wrap items-center gap-5",children:[a.jsxs("div",{className:"flex flex-col items-center",children:[a.jsx("span",{className:"text-lg font-bold text-navy dark:text-cream",children:se}),a.jsx("span",{className:"text-xs text-navy/70 dark:text-cream/70",children:"Works"})]}),a.jsxs("div",{className:"flex flex-col items-center",children:[a.jsx("span",{className:"text-lg font-bold text-navy dark:text-cream",children:ie}),a.jsx("span",{className:"text-xs text-navy/70 dark:text-cream/70",children:"Translations"})]}),a.jsxs("div",{className:"flex flex-col items-center",children:[a.jsx("span",{className:"text-lg font-bold text-navy dark:text-cream",children:q}),a.jsx("span",{className:"text-xs text-navy/70 dark:text-cream/70",children:"Citations"})]})]})})]})]}):a.jsxs("div",{className:"text-center py-8",children:[a.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Author not found"}),a.jsx(Ce,{href:"/authors",children:a.jsx(X,{children:"Back to Authors"})})]})})}),N&&a.jsx("section",{className:"py-6 border-b border-sage/10 dark:border-sage/5",children:a.jsx("div",{className:"max-w-[var(--content-width)] mx-auto px-4 md:px-6",children:a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[a.jsx(Oe,{className:"bg-navy/5 dark:bg-navy/10 border-none shadow-sm",children:a.jsxs(Ve,{className:"p-4 flex items-center gap-4",children:[a.jsx("div",{className:"p-3 rounded-full bg-blue-500/10 text-blue-500 dark:bg-blue-400/20 dark:text-blue-400",children:a.jsx(Rr,{className:"h-6 w-6"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-navy/70 dark:text-cream/70",children:"Total Readers"}),a.jsx("p",{className:"text-2xl font-bold text-navy dark:text-cream",children:te.toLocaleString()})]})]})}),a.jsx(Oe,{className:"bg-navy/5 dark:bg-navy/10 border-none shadow-sm",children:a.jsxs(Ve,{className:"p-4 flex items-center gap-4",children:[a.jsx("div",{className:"p-3 rounded-full bg-amber-500/10 text-amber-500 dark:bg-amber-400/20 dark:text-amber-400",children:a.jsx(h_,{className:"h-6 w-6"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-navy/70 dark:text-cream/70",children:"User Rating"}),a.jsx("p",{className:"text-2xl font-bold text-navy dark:text-cream",children:"4.8/5"})]})]})}),a.jsx(Oe,{className:"bg-navy/5 dark:bg-navy/10 border-none shadow-sm",children:a.jsxs(Ve,{className:"p-4 flex items-center gap-4",children:[a.jsx("div",{className:"p-3 rounded-full bg-green-500/10 text-green-500 dark:bg-green-400/20 dark:text-green-400",children:a.jsx($l,{className:"h-6 w-6"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-navy/70 dark:text-cream/70",children:"Annotations"}),a.jsx("p",{className:"text-2xl font-bold text-navy dark:text-cream",children:de.toLocaleString()})]})]})}),a.jsx(Oe,{className:"bg-navy/5 dark:bg-navy/10 border-none shadow-sm",children:a.jsxs(Ve,{className:"p-4 flex items-center gap-4",children:[a.jsx("div",{className:"p-3 rounded-full bg-purple-500/10 text-purple-500 dark:bg-purple-400/20 dark:text-purple-400",children:a.jsx(KT,{className:"h-6 w-6"})}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-navy/70 dark:text-cream/70",children:"Academic Citations"}),a.jsx("p",{className:"text-2xl font-bold text-navy dark:text-cream",children:q.toLocaleString()})]})]})})]})})}),N&&a.jsx("section",{className:"py-8",children:a.jsx("div",{className:"max-w-[var(--content-width)] mx-auto px-4 md:px-6",children:a.jsxs(Ns,{defaultValue:"works",className:"w-full",children:[a.jsxs(_a,{className:"grid grid-cols-5 mb-8",children:[a.jsx(gt,{value:"works",className:"text-sm md:text-base",children:"Works"}),a.jsx(gt,{value:"timeline",className:"text-sm md:text-base",children:"Timeline"}),a.jsx(gt,{value:"related",className:"text-sm md:text-base",children:"Related Authors"}),a.jsx(gt,{value:"about",className:"text-sm md:text-base",children:"Biography"}),a.jsx(gt,{value:"discussions",className:"text-sm md:text-base",children:"Discussions"})]}),a.jsxs(dn,{value:"works",className:"w-full space-y-6",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row justify-between gap-4 items-start sm:items-center bg-navy/5 dark:bg-navy/10 p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[a.jsxs(Bn,{value:p||"all_types",onValueChange:G=>v(G==="all_types"?null:G),children:[a.jsx(Mn,{className:"w-[130px] text-sm h-9",children:a.jsx(Vn,{placeholder:"Work Type"})}),a.jsxs(Dn,{children:[a.jsx(Qe,{value:"all_types",children:"All Types"}),F.map(G=>a.jsx(Qe,{value:G,children:ye(G)},G))]})]}),a.jsxs(Bn,{value:f||"all_years",onValueChange:G=>m(G==="all_years"||G===void 0?null:G),children:[a.jsx(Mn,{className:"w-[130px] text-sm h-9",children:a.jsx(Vn,{placeholder:"Year"})}),a.jsxs(Dn,{children:[a.jsx(Qe,{value:"all_years",children:"All Years"}),me.sort((G,M)=>parseInt(G)-parseInt(M)).map(G=>a.jsx(Qe,{value:G,children:G},G))]})]}),a.jsxs(Bn,{value:y||"all_languages",onValueChange:G=>b(G==="all_languages"||G===void 0?null:G),children:[a.jsx(Mn,{className:"w-[130px] text-sm h-9",children:a.jsx(Vn,{placeholder:"Language"})}),a.jsxs(Dn,{children:[a.jsx(Qe,{value:"all_languages",children:"All Languages"}),L.map(G=>a.jsx(Qe,{value:G,children:G},G))]})]}),a.jsxs(Bn,{value:u||"all_genres",onValueChange:G=>d(G==="all_genres"||G===void 0?null:G),children:[a.jsx(Mn,{className:"w-[130px] text-sm h-9",children:a.jsx(Vn,{placeholder:"Genre"})}),a.jsxs(Dn,{children:[a.jsx(Qe,{value:"all_genres",children:"All Genres"}),O.map(G=>a.jsx(Qe,{value:G,children:G},G))]})]}),(p||f||y||u)&&a.jsx(X,{variant:"ghost",size:"sm",className:"h-9",onClick:fe,children:"Clear"})]}),a.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[a.jsx("span",{className:"text-sm text-navy/70 dark:text-cream/70",children:"View:"}),a.jsx(Gr,{children:a.jsxs(ja,{children:[a.jsx(Na,{asChild:!0,children:a.jsx(X,{variant:o==="list"?"default":"ghost",size:"icon",className:"h-9 w-9",onClick:()=>l("list"),children:a.jsx(Rd,{className:"h-4 w-4"})})}),a.jsx(Kr,{children:a.jsx("p",{children:"List view"})})]})}),a.jsx(Gr,{children:a.jsxs(ja,{children:[a.jsx(Na,{asChild:!0,children:a.jsx(X,{variant:o==="grid"?"default":"ghost",size:"icon",className:"h-9 w-9",onClick:()=>l("grid"),children:a.jsx(ix,{className:"h-4 w-4"})})}),a.jsx(Kr,{children:a.jsx("p",{children:"Grid view"})})]})})]})]}),k?a.jsx("div",{className:"space-y-4",children:Array.from({length:5}).map((G,M)=>a.jsx(Pe,{className:"h-40"},M))}):Q?.length?p||f?a.jsx("div",{children:o==="list"?a.jsx("div",{className:"space-y-3",children:Q.map(G=>a.jsx(Ar,{work:G},G.id))}):a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Q.map(G=>a.jsx(Ar,{work:G,grid:!0},G.id))})}):a.jsx("div",{className:"space-y-10",children:Object.entries(_||{}).map(([G,M])=>a.jsxs("div",{className:"space-y-4",children:[a.jsxs("h3",{className:"text-xl font-serif font-semibold text-navy dark:text-cream border-b border-sage/10 dark:border-sage/5 pb-2",children:[ye(G)," ",a.jsxs("span",{className:"text-navy/60 dark:text-cream/60 text-base",children:["(",M.length,")"]})]}),o==="list"?a.jsx("div",{className:"space-y-3",children:M.map(he=>a.jsx(Ar,{work:he},he.id))}):a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:M.map(he=>a.jsx(Ar,{work:he,grid:!0},he.id))})]},G))}):a.jsx("div",{className:"text-center py-12 bg-navy/5 dark:bg-navy/10 rounded-lg",children:a.jsxs("div",{className:"flex flex-col items-center",children:[a.jsx(Xs,{className:"h-12 w-12 text-navy/30 dark:text-cream/30 mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-navy dark:text-cream mb-2",children:"No works found"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70 max-w-md mb-6",children:"We couldn't find any works matching your current filters."}),a.jsx(X,{variant:"outline",onClick:fe,children:"Clear Filters"})]})}),a.jsxs("div",{className:"bg-navy/5 dark:bg-navy/10 rounded-lg p-6 mt-8",children:[a.jsx("h3",{className:"text-lg font-medium text-navy dark:text-cream mb-4",children:"Reading Statistics"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("span",{className:"text-sm text-navy/70 dark:text-cream/70",children:"Most Read"}),a.jsx("span",{className:"text-sm font-medium text-navy dark:text-cream",children:C?.[0]?.title||"N/A"})]}),a.jsx(os,{value:85,className:"h-2"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("span",{className:"text-sm text-navy/70 dark:text-cream/70",children:"Most Translated"}),a.jsx("span",{className:"text-sm font-medium text-navy dark:text-cream",children:C?.[1]?.title||"N/A"})]}),a.jsx(os,{value:70,className:"h-2"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("span",{className:"text-sm text-navy/70 dark:text-cream/70",children:"Most Annotated"}),a.jsx("span",{className:"text-sm font-medium text-navy dark:text-cream",children:C?.[2]?.title||"N/A"})]}),a.jsx(os,{value:60,className:"h-2"})]})]})]})]}),a.jsxs(dn,{value:"timeline",className:"w-full space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsx("h2",{className:"text-xl font-serif font-semibold text-navy dark:text-cream",children:"Life & Works Timeline"}),a.jsxs(X,{variant:"outline",size:"sm",className:"text-xs",children:[a.jsx(FT,{className:"h-3.5 w-3.5 mr-1.5"})," Export"]})]}),R?a.jsx("div",{className:"space-y-4 py-8",children:Array.from({length:4}).map((G,M)=>a.jsx(Pe,{className:"h-16"},M))}):E&&Array.isArray(E)&&E.length>0?a.jsx(d3,{events:E}):a.jsx("div",{className:"text-center py-12 bg-navy/5 dark:bg-navy/10 rounded-lg",children:a.jsxs("div",{className:"flex flex-col items-center",children:[a.jsx(tj,{className:"h-12 w-12 text-navy/30 dark:text-cream/30 mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-navy dark:text-cream mb-2",children:"No timeline available"}),a.jsxs("p",{className:"text-navy/70 dark:text-cream/70 max-w-md",children:["We're working on gathering timeline events for"," ",N?.name,". Check back soon for updates on their life and work milestones."]})]})}),a.jsxs("div",{className:"bg-navy/5 dark:bg-navy/10 rounded-lg p-6 mt-8",children:[a.jsx("h3",{className:"text-lg font-medium text-navy dark:text-cream mb-4",children:"Historical Context"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-navy dark:text-cream mb-2",children:"Literary Movements"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:["Romanticism","Realism","Modernism"].map(G=>a.jsx(ht,{variant:"outline",className:"bg-navy/10 dark:bg-navy/20 text-navy/70 dark:text-cream/70 text-xs",children:G},G))}),a.jsxs("p",{className:"text-sm text-navy/70 dark:text-cream/70 mt-3",children:[N?.name," lived during a time of significant literary change, with movements evolving from Romanticism to early Modernist approaches."]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-navy dark:text-cream mb-2",children:"Key Historical Events"}),a.jsxs("ul",{className:"text-sm text-navy/70 dark:text-cream/70 space-y-1",children:[a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-russet/70 dark:bg-russet/60 inline-block"}),"Industrial Revolution (1760-1840)"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-russet/70 dark:bg-russet/60 inline-block"}),"Napoleonic Wars (1803-1815)"]}),a.jsxs("li",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-russet/70 dark:bg-russet/60 inline-block"}),"Reform movements across Europe (1830s-1840s)"]})]})]})]})]})]}),a.jsxs(dn,{value:"related",className:"w-full space-y-6",children:[a.jsx("h2",{className:"text-xl font-serif font-semibold text-navy dark:text-cream mb-6",children:"Related Authors"}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-5",children:[1,2,3,4,5,6].map((G,M)=>{const he={name:["Leo Tolstoy","Fyodor Dostoevsky","Ivan Turgenev","Anton Chekhov","Nikolai Gogol","Anna Akhmatova"][M],slug:["leo-tolstoy","fyodor-dostoevsky","ivan-turgenev","anton-chekhov","nikolai-gogol","anna-akhmatova"][M],birthYear:[1828,1821,1818,1860,1809,1889][M],deathYear:[1910,1881,1883,1904,1852,1966][M],portrait:`https://via.placeholder.com/300?text=${M+1}`};return a.jsxs(Oe,{className:"overflow-hidden bg-cream dark:bg-dark-surface hover:shadow-md transition-shadow",children:[a.jsxs("div",{className:"pt-4 px-4 flex items-center gap-3 pb-3 border-b border-sage/10 dark:border-sage/5",children:[a.jsx("div",{className:"w-12 h-12 rounded-full bg-navy/10 dark:bg-navy/20 overflow-hidden",children:a.jsx("img",{src:he.portrait,alt:he.name,className:"w-full h-full object-cover"})}),a.jsxs("div",{children:[a.jsx(Ce,{href:`/authors/${he.slug}`,children:a.jsx("h3",{className:"text-base font-medium hover:text-russet dark:hover:text-russet/90 transition-colors",children:he.name})}),a.jsxs("p",{className:"text-xs text-navy/70 dark:text-cream/70",children:[he.birthYear,"–",he.deathYear]})]})]}),a.jsxs(Ve,{className:"p-4 text-sm text-navy/80 dark:text-cream/80",children:[a.jsx("div",{className:"flex items-center gap-1 mb-2",children:a.jsx(ht,{variant:"outline",className:"text-xs bg-navy/10 dark:bg-navy/20 border-none",children:["Contemporary","Predecessor","Influence","Influenced By","Friend","Rival"][M]})}),a.jsxs("p",{className:"line-clamp-3 text-xs",children:[M===0&&"Fellow Russian novelist and contemporary of the author. Both explored similar themes and wrote during the same period.",M===1&&"Major influence on the author's work, particularly in psychological characterization and thematic explorations.",M===2&&"Shared literary circles and philosophical ideas that shaped Russian literature of the period.",M===3&&"Continued and evolved the literary tradition established by the author and their contemporaries.",M===4&&"Early influence whose satirical and realistic portrayals set foundations for later Russian literature.",M===5&&"Poetic voice who carried forward literary traditions while evolving new forms of expression."]})]}),a.jsxs(Ea,{className:"p-4 pt-0 flex justify-between",children:[a.jsx(ht,{variant:"outline",className:"text-xs bg-transparent",children:["Realism","Psychological","Naturalism","Social Commentary","Satire","Symbolism"][M]}),a.jsx(Ce,{href:`/authors/${he.slug}`,children:a.jsx(X,{variant:"ghost",size:"sm",className:"text-xs h-8 px-2 text-russet hover:text-russet/90",children:"View Profile"})})]})]},M)})}),a.jsxs("div",{className:"bg-navy/5 dark:bg-navy/10 rounded-lg p-6 mt-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg font-medium text-navy dark:text-cream",children:"Literary Influence Network"}),a.jsxs(X,{variant:"outline",size:"sm",className:"text-xs",children:[a.jsx(YT,{className:"h-3.5 w-3.5 mr-1.5"})," View Full Network"]})]}),a.jsx("div",{className:"aspect-video bg-cream dark:bg-dark-surface rounded-md flex items-center justify-center border border-sage/10 dark:border-sage/5",children:a.jsxs("div",{className:"text-center px-6 py-12",children:[a.jsx(Il,{className:"h-12 w-12 text-navy/30 dark:text-cream/30 mx-auto mb-4"}),a.jsxs("p",{className:"text-navy/70 dark:text-cream/70 max-w-md",children:["Our interactive literary network visualization shows connections between",N?.name," and other authors through influence, collaboration, and shared themes."]})]})})]})]}),a.jsx(dn,{value:"about",className:"w-full",children:a.jsxs("div",{className:"flex flex-col md:flex-row gap-8",children:[a.jsxs("div",{className:"md:w-3/4",children:[a.jsxs("div",{className:"prose dark:prose-invert max-w-none mb-8",children:[a.jsxs("h2",{className:"text-xl font-serif font-semibold text-navy dark:text-cream mb-4",children:["Biography of ",N?.name]}),a.jsx("p",{className:"text-navy/90 dark:text-cream/90",children:N?.biography}),a.jsx("h3",{className:"text-lg font-medium text-navy dark:text-cream mt-6",children:"Early Life"}),a.jsxs("p",{children:["Born in ",N?.birthYear," in"," ",V||"their home country",",",N?.name," ","grew up during a transformative period in history. Their early education and experiences would profoundly shape their literary voice and perspectives."]}),a.jsx("h3",{className:"text-lg font-medium text-navy dark:text-cream mt-6",children:"Literary Career"}),a.jsx("p",{children:"Their first works appeared in the literary journals of the time, quickly establishing them as a voice to watch. Over the course of their career, they published numerous works that explored themes of human psychology, social conditions, and the philosophical questions of their era."}),a.jsx("h3",{className:"text-lg font-medium text-navy dark:text-cream mt-6",children:"Legacy and Influence"}),a.jsxs("p",{children:[N?.name,"'s contributions to literature extend far beyond their lifetime. Their innovative approaches to characterization, narrative structure, and thematic exploration influenced generations of writers that followed. Their work continues to be studied, translated, and adapted worldwide."]})]}),a.jsxs("div",{className:"bg-navy/5 dark:bg-navy/10 rounded-lg p-6 mb-8",children:[a.jsx("h3",{className:"text-lg font-medium text-navy dark:text-cream mb-4",children:"Literary Style Analysis"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-navy dark:text-cream mb-2",children:"Stylistic Features"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("span",{className:"text-sm text-navy/70 dark:text-cream/70",children:"Descriptive Language"}),a.jsx("span",{className:"text-xs font-medium text-navy dark:text-cream",children:"High"})]}),a.jsx(os,{value:85,className:"h-1.5"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("span",{className:"text-sm text-navy/70 dark:text-cream/70",children:"Dialogue Usage"}),a.jsx("span",{className:"text-xs font-medium text-navy dark:text-cream",children:"Medium"})]}),a.jsx(os,{value:60,className:"h-1.5"})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("span",{className:"text-sm text-navy/70 dark:text-cream/70",children:"Metaphorical Language"}),a.jsx("span",{className:"text-xs font-medium text-navy dark:text-cream",children:"Very High"})]}),a.jsx(os,{value:90,className:"h-1.5"})]})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-navy dark:text-cream mb-2",children:"Recurring Themes"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:["Nature","Love","Death","Society","Freedom","Identity","Alienation"].map(G=>a.jsx(ht,{className:`
|
||
${G==="Love"||G==="Nature"?"bg-green-100 text-green-800 dark:bg-green-900/50 dark:text-green-300":G==="Death"||G==="Alienation"?"bg-blue-100 text-blue-800 dark:bg-blue-900/50 dark:text-blue-300":"bg-amber-100 text-amber-800 dark:bg-amber-900/50 dark:text-amber-300"}
|
||
`,children:G},G))}),a.jsxs("p",{className:"text-sm text-navy/70 dark:text-cream/70 mt-3",children:[N?.name,"'s work consistently explores the tension between individual desires and societal expectations, often using natural imagery as metaphors for human experience."]})]})]})]})]}),a.jsx("div",{className:"md:w-1/4",children:a.jsxs("div",{className:"sticky top-24",children:[a.jsxs(Oe,{className:"mb-4 bg-cream dark:bg-dark-surface",children:[a.jsx(zt,{className:"pb-2",children:a.jsx(Gt,{className:"text-base",children:"Key Facts"})}),a.jsxs(Ve,{className:"space-y-3 text-sm",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-navy/70 dark:text-cream/70",children:"Born"}),a.jsx("span",{className:"font-medium",children:N?.birthYear})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-navy/70 dark:text-cream/70",children:"Died"}),a.jsx("span",{className:"font-medium",children:N?.deathYear||"N/A"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-navy/70 dark:text-cream/70",children:"Nationality"}),a.jsx("span",{className:"font-medium",children:V||"Unknown"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-navy/70 dark:text-cream/70",children:"Literary Period"}),a.jsx("span",{className:"font-medium",children:"Romanticism"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-navy/70 dark:text-cream/70",children:"Notable Works"}),a.jsx("span",{className:"font-medium",children:C?.length||0})]})]})]}),a.jsxs(Oe,{className:"mb-4 bg-cream dark:bg-dark-surface",children:[a.jsx(zt,{className:"pb-2",children:a.jsx(Gt,{className:"text-base",children:"Resources"})}),a.jsxs(Ve,{className:"space-y-2 text-sm",children:[a.jsxs(X,{variant:"ghost",size:"sm",className:"w-full justify-start text-xs",children:[a.jsx(Ll,{className:"mr-2 h-4 w-4"}),"Complete Bibliography"]}),a.jsxs(X,{variant:"ghost",size:"sm",className:"w-full justify-start text-xs",children:[a.jsx(Zb,{className:"mr-2 h-4 w-4"}),"Academic Resources"]}),a.jsxs(X,{variant:"ghost",size:"sm",className:"w-full justify-start text-xs",children:[a.jsx(u_,{className:"mr-2 h-4 w-4"}),"Writing Style Guide"]}),a.jsxs(X,{variant:"ghost",size:"sm",className:"w-full justify-start text-xs",children:[a.jsx(zT,{className:"mr-2 h-4 w-4"}),"Awards & Recognition"]})]})]}),a.jsxs(Oe,{className:"bg-cream dark:bg-dark-surface",children:[a.jsx(zt,{className:"pb-2",children:a.jsx(Gt,{className:"text-base",children:"Similar Authors"})}),a.jsx(Ve,{className:"space-y-3",children:["Leo Tolstoy","Fyodor Dostoevsky","Ivan Turgenev"].map((G,M)=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-8 h-8 rounded-full bg-navy/10 dark:bg-navy/20 overflow-hidden",children:a.jsx("img",{src:`https://via.placeholder.com/100?text=${M+1}`,alt:G,className:"w-full h-full object-cover"})}),a.jsx("span",{className:"text-sm",children:G})]},M))})]})]})})]})}),a.jsxs(dn,{value:"discussions",className:"w-full",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("h2",{className:"text-xl font-serif font-semibold text-navy dark:text-cream",children:["Discussions about ",N?.name]}),a.jsx(X,{className:_e(),children:"Start New Discussion"})]}),a.jsx("div",{className:"mb-6 p-4 bg-navy/5 dark:bg-navy/10 rounded-lg",children:a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsxs(Bn,{defaultValue:"recent",children:[a.jsx(Mn,{className:"w-[180px]",children:a.jsx(Vn,{placeholder:"Sort by"})}),a.jsxs(Dn,{children:[a.jsx(Qe,{value:"recent",children:"Most Recent"}),a.jsx(Qe,{value:"popular",children:"Most Popular"}),a.jsx(Qe,{value:"activity",children:"Recent Activity"})]})]}),a.jsxs(Bn,{defaultValue:"all",children:[a.jsx(Mn,{className:"w-[180px]",children:a.jsx(Vn,{placeholder:"Discussion Type"})}),a.jsxs(Dn,{children:[a.jsx(Qe,{value:"all",children:"All Discussions"}),a.jsx(Qe,{value:"literary",children:"Literary Analysis"}),a.jsx(Qe,{value:"themes",children:"Thematic Studies"}),a.jsx(Qe,{value:"questions",children:"Questions"})]})]})]})}),a.jsx("div",{className:"space-y-4",children:[{title:"Themes of isolation in the author's early works",user:"LiteraryScholar",replies:24,views:342,lastActive:"2 hours ago",tags:["Literary Analysis","Themes"]},{title:"Comparing translation styles across different editions",user:"TranslationEnthusiast",replies:18,views:256,lastActive:"1 day ago",tags:["Translations","Comparison"]},{title:"Historical context affecting literary style",user:"HistoricalContext",replies:32,views:420,lastActive:"3 days ago",tags:["Historical","Context"]}].map((G,M)=>a.jsx(Oe,{className:"bg-cream dark:bg-dark-surface hover:shadow-sm transition-shadow",children:a.jsx(Ve,{className:"p-4",children:a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"w-10 h-10 rounded-full bg-navy/10 dark:bg-navy/20 overflow-hidden flex-shrink-0",children:a.jsx("img",{src:`https://via.placeholder.com/100?text=U${M+1}`,alt:G.user,className:"w-full h-full object-cover"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h3",{className:"text-lg font-medium text-navy dark:text-cream hover:text-russet dark:hover:text-russet/90 transition-colors cursor-pointer",children:G.title}),a.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-navy/70 dark:text-cream/70 mt-1 mb-2",children:[a.jsxs("span",{children:["Started by ",G.user]}),a.jsx("span",{children:"•"}),a.jsxs("span",{children:[G.replies," replies"]}),a.jsx("span",{children:"•"}),a.jsxs("span",{children:[G.views," views"]}),a.jsx("span",{children:"•"}),a.jsxs("span",{children:["Last active ",G.lastActive]})]}),a.jsx("div",{className:"flex items-center gap-2",children:G.tags.map(he=>a.jsx(ht,{variant:"outline",className:"text-xs bg-navy/10 dark:bg-navy/20 border-none",children:he},he))})]}),a.jsx("div",{className:"flex-shrink-0 flex flex-col items-end gap-2",children:a.jsx(ht,{variant:"outline",className:`${M===0?"bg-green-100 text-green-800 dark:bg-green-900/40 dark:text-green-300":""} text-xs`,children:M===0?"Active":"Open"})})]})})},M))}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mt-8",children:[a.jsx(Oe,{className:"bg-navy/5 dark:bg-navy/10 border-none",children:a.jsxs(Ve,{className:"p-4 flex items-center gap-4",children:[a.jsx($l,{className:"h-5 w-5 text-navy/70 dark:text-cream/70"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-navy/70 dark:text-cream/70",children:"Discussions"}),a.jsx("p",{className:"text-xl font-bold text-navy dark:text-cream",children:"74"})]})]})}),a.jsx(Oe,{className:"bg-navy/5 dark:bg-navy/10 border-none",children:a.jsxs(Ve,{className:"p-4 flex items-center gap-4",children:[a.jsx(Il,{className:"h-5 w-5 text-navy/70 dark:text-cream/70"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-navy/70 dark:text-cream/70",children:"Contributors"}),a.jsx("p",{className:"text-xl font-bold text-navy dark:text-cream",children:"132"})]})]})}),a.jsx(Oe,{className:"bg-navy/5 dark:bg-navy/10 border-none",children:a.jsxs(Ve,{className:"p-4 flex items-center gap-4",children:[a.jsx(JT,{className:"h-5 w-5 text-navy/70 dark:text-cream/70"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-navy/70 dark:text-cream/70",children:"Annotations"}),a.jsx("p",{className:"text-xl font-bold text-navy dark:text-cream",children:"486"})]})]})}),a.jsx(Oe,{className:"bg-navy/5 dark:bg-navy/10 border-none",children:a.jsxs(Ve,{className:"p-4 flex items-center gap-4",children:[a.jsx(w_,{className:"h-5 w-5 text-navy/70 dark:text-cream/70"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-navy/70 dark:text-cream/70",children:"Activity"}),a.jsx("p",{className:"text-xl font-bold text-navy dark:text-cream",children:"High"})]})]})})]})]})]})})}),N&&a.jsx("section",{className:`py-10 ${t==="spring"?"bg-green-50 dark:bg-green-950/10":t==="summer"?"bg-amber-50 dark:bg-amber-950/10":t==="autumn"?"bg-russet/5 dark:bg-russet/10":"bg-blue-50 dark:bg-blue-950/10"}`,children:a.jsxs("div",{className:"max-w-[var(--content-width)] mx-auto px-4 md:px-6",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsxs("h2",{className:"text-2xl font-serif font-bold text-navy dark:text-cream mb-2",children:["Continue Exploring ",N?.name,"'s World"]}),a.jsxs("p",{className:"text-navy/70 dark:text-cream/70 max-w-2xl mx-auto",children:["Discover more ways to engage with ",N?.name,"'s literary legacy through our interactive features and community resources."]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsx(Oe,{className:"bg-cream dark:bg-dark-surface hover:shadow-md transition-shadow border-none",children:a.jsxs(Ve,{className:"p-6 flex flex-col items-center text-center",children:[a.jsx("div",{className:`p-3 rounded-full ${t==="spring"?"bg-green-100 text-green-600 dark:bg-green-900/30 dark:text-green-400":t==="summer"?"bg-amber-100 text-amber-600 dark:bg-amber-900/30 dark:text-amber-400":t==="autumn"?"bg-russet/10 text-russet dark:bg-russet/20 dark:text-russet/90":"bg-blue-100 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400"} mb-4`,children:a.jsx(Zb,{className:"h-8 w-8"})}),a.jsx("h3",{className:"text-lg font-semibold text-navy dark:text-cream mb-2",children:"Reading Guides"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70 text-sm mb-4",children:"Access in-depth reading guides for all major works, with historical context, analysis, and discussion questions."}),a.jsx(X,{variant:"outline",className:"mt-auto",children:"Explore Guides"})]})}),a.jsx(Oe,{className:"bg-cream dark:bg-dark-surface hover:shadow-md transition-shadow border-none",children:a.jsxs(Ve,{className:"p-6 flex flex-col items-center text-center",children:[a.jsx("div",{className:`p-3 rounded-full ${t==="spring"?"bg-green-100 text-green-600 dark:bg-green-900/30 dark:text-green-400":t==="summer"?"bg-amber-100 text-amber-600 dark:bg-amber-900/30 dark:text-amber-400":t==="autumn"?"bg-russet/10 text-russet dark:bg-russet/20 dark:text-russet/90":"bg-blue-100 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400"} mb-4`,children:a.jsx(WT,{className:"h-8 w-8"})}),a.jsx("h3",{className:"text-lg font-semibold text-navy dark:text-cream mb-2",children:"Community Discussions"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70 text-sm mb-4",children:"Join active discussions with fellow readers, scholars, and enthusiasts about the author's works."}),a.jsx(X,{variant:"outline",className:"mt-auto",children:"Join Conversations"})]})}),a.jsx(Oe,{className:"bg-cream dark:bg-dark-surface hover:shadow-md transition-shadow border-none",children:a.jsxs(Ve,{className:"p-6 flex flex-col items-center text-center",children:[a.jsx("div",{className:`p-3 rounded-full ${t==="spring"?"bg-green-100 text-green-600 dark:bg-green-900/30 dark:text-green-400":t==="summer"?"bg-amber-100 text-amber-600 dark:bg-amber-900/30 dark:text-amber-400":t==="autumn"?"bg-russet/10 text-russet dark:bg-russet/20 dark:text-russet/90":"bg-blue-100 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400"} mb-4`,children:a.jsx(m_,{className:"h-8 w-8"})}),a.jsx("h3",{className:"text-lg font-semibold text-navy dark:text-cream mb-2",children:"Literary Analysis"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70 text-sm mb-4",children:"Explore thematic studies, stylistic analyses, and comparative literary criticism of the author's body of work."}),a.jsx(X,{variant:"outline",className:"mt-auto",children:"Read Analysis"})]})})]})]})})]})}const tr=x.forwardRef(({className:e,type:t,...r},o)=>a.jsx("input",{type:t,className:je("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:o,...r}));tr.displayName="Input";function N5(e,t){const[r,o]=x.useState(e);return x.useEffect(()=>{const l=setTimeout(()=>{o(e)},t);return()=>{clearTimeout(l)}},[e,t]),r}function Xd({placeholder:e="Search by title, author, or keyword",className:t,onSearch:r,fullWidth:o=!1}){const[l,u]=x.useState(""),[d,f]=x.useState(null),[m,p]=x.useState(!1),[v,y]=x.useState(!1),b=N5(l,300),S=x.useRef(null),[N,w]=ys();x.useEffect(()=>{const k=E=>{S.current&&!S.current.contains(E.target)&&y(!1)};return document.addEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}},[]),x.useEffect(()=>{if(b.length<2){f(null);return}(async()=>{p(!0);try{const E=await fetch(`/api/search?q=${encodeURIComponent(b)}`);if(E.ok){const R=await E.json();f(R)}}catch(E){console.error("Search error:",E)}finally{p(!1)}})()},[b]);const C=k=>{k.preventDefault(),l.trim()&&(r?.(l.trim()),w(`/explore?q=${encodeURIComponent(l.trim())}`),y(!1))};return a.jsxs("div",{className:`relative ${t}`,ref:S,children:[a.jsx("form",{onSubmit:C,className:`${o?"w-full":"max-w-md"}`,children:a.jsxs("div",{className:"relative",children:[a.jsx(tr,{type:"text",placeholder:e,className:"pl-10 pr-4 py-2 rounded-lg bg-background dark:bg-background border border-input dark:border-input focus:outline-none focus:ring-2 focus:ring-ring",value:l,onChange:k=>u(k.target.value),onFocus:()=>y(!0)}),a.jsx(Xs,{className:"h-5 w-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground dark:text-muted-foreground"}),l&&a.jsx(X,{type:"submit",size:"sm",className:"absolute right-2 top-1/2 transform -translate-y-1/2 h-7 text-xs",children:"Search"})]})}),v&&d&&a.jsx(Oe,{className:"absolute z-50 w-full mt-1 shadow-lg",children:a.jsxs(Ve,{className:"p-2",children:[d.authors.length>0&&a.jsxs("div",{className:"mb-4",children:[a.jsx("h3",{className:"text-sm font-medium mb-2 text-muted-foreground",children:"Authors"}),a.jsx("ul",{className:"space-y-1",children:d.authors.map(k=>a.jsx("li",{children:a.jsxs(Ce,{href:`/authors/${k.slug}`,className:"block p-2 hover:bg-primary/5 dark:hover:bg-primary/10 rounded",onClick:()=>y(!1),children:[a.jsx("span",{className:"font-medium",children:k.name}),k.country&&a.jsx("span",{className:"text-xs text-muted-foreground ml-2",children:k.country})]})},k.id))})]}),d.works.length>0&&a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium mb-2 text-muted-foreground",children:"Works"}),a.jsx("ul",{className:"space-y-1",children:d.works.map(k=>a.jsx("li",{children:a.jsxs(Ce,{href:`/works/${k.slug}`,className:"block p-2 hover:bg-primary/5 dark:hover:bg-primary/10 rounded",onClick:()=>y(!1),children:[a.jsx("span",{className:"font-medium",children:k.title}),a.jsxs("span",{className:"text-xs text-muted-foreground ml-2",children:[k.language,", ",k.year||"Unknown"]})]})},k.id))})]}),d.authors.length===0&&d.works.length===0&&a.jsxs("p",{className:"py-2 text-muted-foreground text-sm text-center",children:['No results found for "',l,'"']}),a.jsx("div",{className:"mt-2 pt-2 border-t border-border text-center",children:a.jsx(X,{variant:"link",size:"sm",className:"text-xs text-accent",onClick:C,children:"View all results"})})]})})]})}var Wd="Checkbox",[S5,MV]=Qt(Wd),[k5,Hx]=S5(Wd);function C5(e){const{__scopeCheckbox:t,checked:r,children:o,defaultChecked:l,disabled:u,form:d,name:f,onCheckedChange:m,required:p,value:v="on",internal_do_not_use_render:y}=e,[b,S]=Hn({prop:r,defaultProp:l??!1,onChange:m,caller:Wd}),[N,w]=x.useState(null),[C,k]=x.useState(null),E=x.useRef(!1),R=N?!!d||!!N.closest("form"):!0,T={checked:b,disabled:u,setChecked:S,control:N,setControl:w,name:f,form:d,value:v,hasConsumerStoppedPropagationRef:E,required:p,defaultChecked:us(l)?!1:l,isFormControl:R,bubbleInput:C,setBubbleInput:k};return a.jsx(k5,{scope:t,...T,children:E5(y)?y(T):o})}var l2="CheckboxTrigger",c2=x.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...o},l)=>{const{control:u,value:d,disabled:f,checked:m,required:p,setControl:v,setChecked:y,hasConsumerStoppedPropagationRef:b,isFormControl:S,bubbleInput:N}=Hx(l2,e),w=Le(l,v),C=x.useRef(m);return x.useEffect(()=>{const k=u?.form;if(k){const E=()=>y(C.current);return k.addEventListener("reset",E),()=>k.removeEventListener("reset",E)}},[u,y]),a.jsx(Ee.button,{type:"button",role:"checkbox","aria-checked":us(m)?"mixed":m,"aria-required":p,"data-state":m2(m),"data-disabled":f?"":void 0,disabled:f,value:d,...o,ref:w,onKeyDown:be(t,k=>{k.key==="Enter"&&k.preventDefault()}),onClick:be(r,k=>{y(E=>us(E)?!0:!E),N&&S&&(b.current=k.isPropagationStopped(),b.current||k.stopPropagation())})})});c2.displayName=l2;var Fx=x.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:o,checked:l,defaultChecked:u,required:d,disabled:f,value:m,onCheckedChange:p,form:v,...y}=e;return a.jsx(C5,{__scopeCheckbox:r,checked:l,defaultChecked:u,disabled:f,required:d,onCheckedChange:p,name:o,form:v,value:m,internal_do_not_use_render:({isFormControl:b})=>a.jsxs(a.Fragment,{children:[a.jsx(c2,{...y,ref:t,__scopeCheckbox:r}),b&&a.jsx(h2,{__scopeCheckbox:r})]})})});Fx.displayName=Wd;var u2="CheckboxIndicator",d2=x.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:o,...l}=e,u=Hx(u2,r);return a.jsx(yn,{present:o||us(u.checked)||u.checked===!0,children:a.jsx(Ee.span,{"data-state":m2(u.checked),"data-disabled":u.disabled?"":void 0,...l,ref:t,style:{pointerEvents:"none",...e.style}})})});d2.displayName=u2;var f2="CheckboxBubbleInput",h2=x.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:o,hasConsumerStoppedPropagationRef:l,checked:u,defaultChecked:d,required:f,disabled:m,name:p,value:v,form:y,bubbleInput:b,setBubbleInput:S}=Hx(f2,e),N=Le(r,S),w=oc(u),C=ec(o);x.useEffect(()=>{const E=b;if(!E)return;const R=window.HTMLInputElement.prototype,z=Object.getOwnPropertyDescriptor(R,"checked").set,ne=!l.current;if(w!==u&&z){const $=new Event("click",{bubbles:ne});E.indeterminate=us(u),z.call(E,us(u)?!1:u),E.dispatchEvent($)}},[b,w,u,l]);const k=x.useRef(us(u)?!1:u);return a.jsx(Ee.input,{type:"checkbox","aria-hidden":!0,defaultChecked:d??k.current,required:f,disabled:m,name:p,value:v,form:y,...t,tabIndex:-1,ref:N,style:{...t.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});h2.displayName=f2;function E5(e){return typeof e=="function"}function us(e){return e==="indeterminate"}function m2(e){return us(e)?"indeterminate":e?"checked":"unchecked"}const is=x.forwardRef(({className:e,...t},r)=>a.jsx(Fx,{ref:r,className:je("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:a.jsx(d2,{className:je("flex items-center justify-center text-current"),children:a.jsx(Cd,{className:"h-4 w-4"})})}));is.displayName=Fx.displayName;var Jd="Dialog",[p2,x2]=Qt(Jd),[A5,Mr]=p2(Jd),g2=e=>{const{__scopeDialog:t,children:r,open:o,defaultOpen:l,onOpenChange:u,modal:d=!0}=e,f=x.useRef(null),m=x.useRef(null),[p,v]=Hn({prop:o,defaultProp:l??!1,onChange:u,caller:Jd});return a.jsx(A5,{scope:t,triggerRef:f,contentRef:m,contentId:nr(),titleId:nr(),descriptionId:nr(),open:p,onOpenChange:v,onOpenToggle:x.useCallback(()=>v(y=>!y),[v]),modal:d,children:r})};g2.displayName=Jd;var v2="DialogTrigger",y2=x.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,l=Mr(v2,r),u=Le(t,l.triggerRef);return a.jsx(Ee.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":Zx(l.open),...o,ref:u,onClick:be(e.onClick,l.onOpenToggle)})});y2.displayName=v2;var qx="DialogPortal",[R5,b2]=p2(qx,{forceMount:void 0}),w2=e=>{const{__scopeDialog:t,forceMount:r,children:o,container:l}=e,u=Mr(qx,t);return a.jsx(R5,{scope:t,forceMount:r,children:x.Children.map(o,d=>a.jsx(yn,{present:r||u.open,children:a.jsx(zd,{asChild:!0,container:l,children:d})}))})};w2.displayName=qx;var cd="DialogOverlay",j2=x.forwardRef((e,t)=>{const r=b2(cd,e.__scopeDialog),{forceMount:o=r.forceMount,...l}=e,u=Mr(cd,e.__scopeDialog);return u.modal?a.jsx(yn,{present:o||u.open,children:a.jsx(_5,{...l,ref:t})}):null});j2.displayName=cd;var T5=Ws("DialogOverlay.RemoveScroll"),_5=x.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,l=Mr(cd,r);return a.jsx(Bd,{as:T5,allowPinchZoom:!0,shards:[l.contentRef],children:a.jsx(Ee.div,{"data-state":Zx(l.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),no="DialogContent",N2=x.forwardRef((e,t)=>{const r=b2(no,e.__scopeDialog),{forceMount:o=r.forceMount,...l}=e,u=Mr(no,e.__scopeDialog);return a.jsx(yn,{present:o||u.open,children:u.modal?a.jsx(M5,{...l,ref:t}):a.jsx(D5,{...l,ref:t})})});N2.displayName=no;var M5=x.forwardRef((e,t)=>{const r=Mr(no,e.__scopeDialog),o=x.useRef(null),l=Le(t,r.contentRef,o);return x.useEffect(()=>{const u=o.current;if(u)return Tx(u)},[]),a.jsx(S2,{...e,ref:l,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:be(e.onCloseAutoFocus,u=>{u.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:be(e.onPointerDownOutside,u=>{const d=u.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0;(d.button===2||f)&&u.preventDefault()}),onFocusOutside:be(e.onFocusOutside,u=>u.preventDefault())})}),D5=x.forwardRef((e,t)=>{const r=Mr(no,e.__scopeDialog),o=x.useRef(!1),l=x.useRef(!1);return a.jsx(S2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:u=>{e.onCloseAutoFocus?.(u),u.defaultPrevented||(o.current||r.triggerRef.current?.focus(),u.preventDefault()),o.current=!1,l.current=!1},onInteractOutside:u=>{e.onInteractOutside?.(u),u.defaultPrevented||(o.current=!0,u.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const d=u.target;r.triggerRef.current?.contains(d)&&u.preventDefault(),u.detail.originalEvent.type==="focusin"&&l.current&&u.preventDefault()}})}),S2=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:u,...d}=e,f=Mr(no,r),m=x.useRef(null),p=Le(t,m);return Ex(),a.jsxs(a.Fragment,{children:[a.jsx(Id,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:l,onUnmountAutoFocus:u,children:a.jsx(Wl,{role:"dialog",id:f.contentId,"aria-describedby":f.descriptionId,"aria-labelledby":f.titleId,"data-state":Zx(f.open),...d,ref:p,onDismiss:()=>f.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(z5,{titleId:f.titleId}),a.jsx(L5,{contentRef:m,descriptionId:f.descriptionId})]})]})}),Yx="DialogTitle",k2=x.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,l=Mr(Yx,r);return a.jsx(Ee.h2,{id:l.titleId,...o,ref:t})});k2.displayName=Yx;var C2="DialogDescription",E2=x.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,l=Mr(C2,r);return a.jsx(Ee.p,{id:l.descriptionId,...o,ref:t})});E2.displayName=C2;var A2="DialogClose",R2=x.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,l=Mr(A2,r);return a.jsx(Ee.button,{type:"button",...o,ref:t,onClick:be(e.onClick,()=>l.onOpenChange(!1))})});R2.displayName=A2;function Zx(e){return e?"open":"closed"}var T2="DialogTitleWarning",[O5,_2]=S_(T2,{contentName:no,titleName:Yx,docsSlug:"dialog"}),z5=({titleId:e})=>{const t=_2(T2),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 x.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},P5="DialogDescriptionWarning",L5=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${_2(P5).contentName}}.`;return x.useEffect(()=>{const l=e.current?.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Gx=g2,M2=y2,Kx=w2,ef=j2,tf=N2,nf=k2,rf=E2,af=R2;function $5(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}const D2=ae.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),ic=()=>{const e=ae.useContext(D2);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};$5(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
||
[data-state=closed]
|
||
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function I5(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function U5(){return Qx(/^Mac/)}function B5(){return Qx(/^iPhone/)}function Aw(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function V5(){return Qx(/^iPad/)||U5()&&navigator.maxTouchPoints>1}function O2(){return B5()||V5()}function Qx(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const H5=24,F5=typeof window<"u"?x.useLayoutEffect:x.useEffect;function Rw(...e){return(...t)=>{for(let r of e)typeof r=="function"&&r(...t)}}const tp=typeof document<"u"&&window.visualViewport;function Tw(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function z2(e){for(Tw(e)&&(e=e.parentElement);e&&!Tw(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const q5=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Tu=0,np;function Y5(e={}){let{isDisabled:t}=e;F5(()=>{if(!t)return Tu++,Tu===1&&O2()&&(np=Z5()),()=>{Tu--,Tu===0&&np?.()}},[t])}function Z5(){let e,t=0,r=y=>{e=z2(y.target),!(e===document.documentElement&&e===document.body)&&(t=y.changedTouches[0].pageY)},o=y=>{if(!e||e===document.documentElement||e===document.body){y.preventDefault();return}let b=y.changedTouches[0].pageY,S=e.scrollTop,N=e.scrollHeight-e.clientHeight;N!==0&&((S<=0&&b>t||S>=N&&b<t)&&y.preventDefault(),t=b)},l=y=>{let b=y.target;Dp(b)&&b!==document.activeElement&&(y.preventDefault(),b.style.transform="translateY(-2000px)",b.focus(),requestAnimationFrame(()=>{b.style.transform=""}))},u=y=>{let b=y.target;Dp(b)&&(b.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{b.style.transform="",tp&&(tp.height<window.innerHeight?requestAnimationFrame(()=>{_w(b)}):tp.addEventListener("resize",()=>_w(b),{once:!0}))}))},d=()=>{window.scrollTo(0,0)},f=window.pageXOffset,m=window.pageYOffset,p=Rw(G5(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let v=Rw(jl(document,"touchstart",r,{passive:!1,capture:!0}),jl(document,"touchmove",o,{passive:!1,capture:!0}),jl(document,"touchend",l,{passive:!1,capture:!0}),jl(document,"focus",u,!0),jl(window,"scroll",d));return()=>{p(),v(),window.scrollTo(f,m)}}function G5(e,t,r){let o=e.style[t];return e.style[t]=r,()=>{e.style[t]=o}}function jl(e,t,r,o){return e.addEventListener(t,r,o),()=>{e.removeEventListener(t,r,o)}}function _w(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let r=z2(e);if(r!==document.documentElement&&r!==document.body&&r!==e){let o=r.getBoundingClientRect().top,l=e.getBoundingClientRect().top,u=e.getBoundingClientRect().bottom;const d=r.getBoundingClientRect().bottom+H5;u>d&&(r.scrollTop+=l-o)}e=r.parentElement}}function Dp(e){return e instanceof HTMLInputElement&&!q5.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function K5(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Q5(...e){return t=>e.forEach(r=>K5(r,t))}function P2(...e){return x.useCallback(Q5(...e),e)}const L2=new WeakMap;function tn(e,t,r=!1){if(!e||!(e instanceof HTMLElement))return;let o={};Object.entries(t).forEach(([l,u])=>{if(l.startsWith("--")){e.style.setProperty(l,u);return}o[l]=e.style[l],e.style[l]=u}),!r&&L2.set(e,o)}function X5(e,t){if(!e||!(e instanceof HTMLElement))return;let r=L2.get(e);r&&(e.style[t]=r[t])}const Zt=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function _u(e,t){if(!e)return null;const r=window.getComputedStyle(e),o=r.transform||r.webkitTransform||r.mozTransform;let l=o.match(/^matrix3d\((.+)\)$/);return l?parseFloat(l[1].split(", ")[Zt(t)?13:12]):(l=o.match(/^matrix\((.+)\)$/),l?parseFloat(l[1].split(", ")[Zt(t)?5:4]):null)}function W5(e){return 8*(Math.log(e+1)-2)}function rp(e,t){if(!e)return()=>{};const r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}function J5(...e){return(...t)=>{for(const r of e)typeof r=="function"&&r(...t)}}const Tt={DURATION:.5,EASE:[.32,.72,0,1]},$2=.4,ez=.25,tz=100,I2=8,Vs=16,Op=26,ap="vaul-dragging";function U2(e){const t=ae.useRef(e);return ae.useEffect(()=>{t.current=e}),ae.useMemo(()=>(...r)=>t.current==null?void 0:t.current.call(t,...r),[])}function nz({defaultProp:e,onChange:t}){const r=ae.useState(e),[o]=r,l=ae.useRef(o),u=U2(t);return ae.useEffect(()=>{l.current!==o&&(u(o),l.current=o)},[o,l,u]),r}function B2({prop:e,defaultProp:t,onChange:r=()=>{}}){const[o,l]=nz({defaultProp:t,onChange:r}),u=e!==void 0,d=u?e:o,f=U2(r),m=ae.useCallback(p=>{if(u){const y=typeof p=="function"?p(e):p;y!==e&&f(y)}else l(p)},[u,e,l,f]);return[d,m]}function rz({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:r,drawerRef:o,overlayRef:l,fadeFromIndex:u,onSnapPointChange:d,direction:f="bottom",container:m,snapToSequentialPoint:p}){const[v,y]=B2({prop:e,defaultProp:r?.[0],onChange:t}),[b,S]=ae.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);ae.useEffect(()=>{function $(){S({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",$),()=>window.removeEventListener("resize",$)},[]);const N=ae.useMemo(()=>v===r?.[r.length-1]||null,[r,v]),w=ae.useMemo(()=>{var $;return($=r?.findIndex(V=>V===v))!=null?$:null},[r,v]),C=r&&r.length>0&&(u||u===0)&&!Number.isNaN(u)&&r[u]===v||!r,k=ae.useMemo(()=>{const $=m?{width:m.getBoundingClientRect().width,height:m.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var V;return(V=r?.map(J=>{const se=typeof J=="string";let ie=0;if(se&&(ie=parseInt(J,10)),Zt(f)){const q=se?ie:b?J*$.height:0;return b?f==="bottom"?$.height-q:-$.height+q:q}const te=se?ie:b?J*$.width:0;return b?f==="right"?$.width-te:-$.width+te:te}))!=null?V:[]},[r,b,m]),E=ae.useMemo(()=>w!==null?k?.[w]:null,[k,w]),R=ae.useCallback($=>{var V;const J=(V=k?.findIndex(se=>se===$))!=null?V:null;d(J),tn(o.current,{transition:`transform ${Tt.DURATION}s cubic-bezier(${Tt.EASE.join(",")})`,transform:Zt(f)?`translate3d(0, ${$}px, 0)`:`translate3d(${$}px, 0, 0)`}),k&&J!==k.length-1&&u!==void 0&&J!==u&&J<u?tn(l.current,{transition:`opacity ${Tt.DURATION}s cubic-bezier(${Tt.EASE.join(",")})`,opacity:"0"}):tn(l.current,{transition:`opacity ${Tt.DURATION}s cubic-bezier(${Tt.EASE.join(",")})`,opacity:"1"}),y(r?.[Math.max(J,0)])},[o.current,r,k,u,l,y]);ae.useEffect(()=>{if(v||e){var $;const V=($=r?.findIndex(J=>J===e||J===v))!=null?$:-1;k&&V!==-1&&typeof k[V]=="number"&&R(k[V])}},[v,e,r,k,R]);function T({draggedDistance:$,closeDrawer:V,velocity:J,dismissible:se}){if(u===void 0)return;const ie=f==="bottom"||f==="right"?(E??0)-$:(E??0)+$,te=w===u-1,q=w===0,de=$>0;if(te&&tn(l.current,{transition:`opacity ${Tt.DURATION}s cubic-bezier(${Tt.EASE.join(",")})`}),!p&&J>2&&!de){se?V():R(k[0]);return}if(!p&&J>2&&de&&k&&r){R(k[r.length-1]);return}const me=k?.reduce((L,F)=>typeof L!="number"||typeof F!="number"?L:Math.abs(F-ie)<Math.abs(L-ie)?F:L),O=Zt(f)?window.innerHeight:window.innerWidth;if(J>$2&&Math.abs($)<O*.4){const L=de?1:-1;if(L>0&&N&&r){R(k[r.length-1]);return}if(q&&L<0&&se&&V(),w===null)return;R(k[w+L]);return}R(me)}function z({draggedDistance:$}){if(E===null)return;const V=f==="bottom"||f==="right"?E-$:E+$;(f==="bottom"||f==="right")&&V<k[k.length-1]||(f==="top"||f==="left")&&V>k[k.length-1]||tn(o.current,{transform:Zt(f)?`translate3d(0, ${V}px, 0)`:`translate3d(${V}px, 0, 0)`})}function ne($,V){if(!r||typeof w!="number"||!k||u===void 0)return null;const J=w===u-1;if(w>=u&&V)return 0;if(J&&!V)return 1;if(!C&&!J)return null;const ie=J?w+1:w-1,te=J?k[ie]-k[ie-1]:k[ie+1]-k[ie],q=$/Math.abs(te);return J?1-q:q}return{isLastSnapPoint:N,activeSnapPoint:v,shouldFade:C,getPercentageDragged:ne,setActiveSnapPoint:y,activeSnapPointIndex:w,onRelease:T,onDrag:z,snapPointsOffset:k}}const az=()=>()=>{};function sz(){const{direction:e,isOpen:t,shouldScaleBackground:r,setBackgroundColorOnScale:o,noBodyStyles:l}=ic(),u=ae.useRef(null),d=x.useMemo(()=>document.body.style.backgroundColor,[]);function f(){return(window.innerWidth-Op)/window.innerWidth}ae.useEffect(()=>{if(t&&r){u.current&&clearTimeout(u.current);const m=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!m)return;J5(o&&!l?rp(document.body,{background:"black"}):az,rp(m,{transformOrigin:Zt(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${Tt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Tt.EASE.join(",")})`}));const p=rp(m,{borderRadius:`${I2}px`,overflow:"hidden",...Zt(e)?{transform:`scale(${f()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${f()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{p(),u.current=window.setTimeout(()=>{d?document.body.style.background=d:document.body.style.removeProperty("background")},Tt.DURATION*1e3)}}},[t,r,d])}let Nl=null;function oz({isOpen:e,modal:t,nested:r,hasBeenOpened:o,preventScrollRestoration:l,noBodyStyles:u}){const[d,f]=ae.useState(()=>typeof window<"u"?window.location.href:""),m=ae.useRef(0),p=ae.useCallback(()=>{if(Aw()&&Nl===null&&e&&!u){Nl={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:y,innerHeight:b}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-m.current}px`,left:`${-y}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const S=b-window.innerHeight;S&&m.current>=b&&(document.body.style.top=`${-(m.current+S)}px`)}),300)}},[e]),v=ae.useCallback(()=>{if(Aw()&&Nl!==null&&!u){const y=-parseInt(document.body.style.top,10),b=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Nl),window.requestAnimationFrame(()=>{if(l&&d!==window.location.href){f(window.location.href);return}window.scrollTo(b,y)}),Nl=null}},[d]);return ae.useEffect(()=>{function y(){m.current=window.scrollY}return y(),window.addEventListener("scroll",y),()=>{window.removeEventListener("scroll",y)}},[]),ae.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||v()}},[t,v]),ae.useEffect(()=>{r||!o||(e?(!window.matchMedia("(display-mode: standalone)").matches&&p(),t||window.setTimeout(()=>{v()},500)):v())},[e,o,d,t,r,p,v]),{restorePositionSetting:v}}function iz({open:e,onOpenChange:t,children:r,onDrag:o,onRelease:l,snapPoints:u,shouldScaleBackground:d=!1,setBackgroundColorOnScale:f=!0,closeThreshold:m=ez,scrollLockTimeout:p=tz,dismissible:v=!0,handleOnly:y=!1,fadeFromIndex:b=u&&u.length-1,activeSnapPoint:S,setActiveSnapPoint:N,fixed:w,modal:C=!0,onClose:k,nested:E,noBodyStyles:R=!1,direction:T="bottom",defaultOpen:z=!1,disablePreventScroll:ne=!0,snapToSequentialPoint:$=!1,preventScrollRestoration:V=!1,repositionInputs:J=!0,onAnimationEnd:se,container:ie,autoFocus:te=!1}){var q,de;const[me=!1,O]=B2({defaultProp:z,prop:e,onChange:Ie=>{t?.(Ie),!Ie&&!E&&Me(),setTimeout(()=>{se?.(Ie)},Tt.DURATION*1e3),Ie&&!C&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),Ie||(document.body.style.pointerEvents="auto")}}),[L,F]=ae.useState(!1),[Q,_]=ae.useState(!1),[B,ge]=ae.useState(!1),fe=ae.useRef(null),ye=ae.useRef(null),_e=ae.useRef(null),G=ae.useRef(null),M=ae.useRef(null),he=ae.useRef(!1),Be=ae.useRef(null),He=ae.useRef(0),pe=ae.useRef(!1),Re=ae.useRef(!z),Ye=ae.useRef(0),Ae=ae.useRef(null),yt=ae.useRef(((q=Ae.current)==null?void 0:q.getBoundingClientRect().height)||0),Pt=ae.useRef(((de=Ae.current)==null?void 0:de.getBoundingClientRect().width)||0),Nt=ae.useRef(0),Ss=ae.useCallback(Ie=>{u&&Ie===Ne.length-1&&(ye.current=new Date)},[]),{activeSnapPoint:zr,activeSnapPointIndex:P,setActiveSnapPoint:Z,onRelease:re,snapPointsOffset:Ne,onDrag:xe,shouldFade:ve,getPercentageDragged:Se}=rz({snapPoints:u,activeSnapPointProp:S,setActiveSnapPointProp:N,drawerRef:Ae,fadeFromIndex:b,overlayRef:fe,onSnapPointChange:Ss,direction:T,container:ie,snapToSequentialPoint:$});Y5({isDisabled:!me||Q||!C||B||!L||!J||!ne});const{restorePositionSetting:Me}=oz({isOpen:me,modal:C,nested:E??!1,hasBeenOpened:L,preventScrollRestoration:V,noBodyStyles:R});function qe(){return(window.innerWidth-Op)/window.innerWidth}function at(Ie){var st,lt;!v&&!u||Ae.current&&!Ae.current.contains(Ie.target)||(yt.current=((st=Ae.current)==null?void 0:st.getBoundingClientRect().height)||0,Pt.current=((lt=Ae.current)==null?void 0:lt.getBoundingClientRect().width)||0,_(!0),_e.current=new Date,O2()&&window.addEventListener("touchend",()=>he.current=!1,{once:!0}),Ie.target.setPointerCapture(Ie.pointerId),He.current=Zt(T)?Ie.pageY:Ie.pageX)}function ar(Ie,st){var lt;let Xe=Ie;const At=(lt=window.getSelection())==null?void 0:lt.toString(),fn=Ae.current?_u(Ae.current,T):null,rn=new Date;if(Xe.tagName==="SELECT"||Xe.hasAttribute("data-vaul-no-drag")||Xe.closest("[data-vaul-no-drag]"))return!1;if(T==="right"||T==="left")return!0;if(ye.current&&rn.getTime()-ye.current.getTime()<500)return!1;if(fn!==null&&(T==="bottom"?fn>0:fn<0))return!0;if(At&&At.length>0)return!1;if(M.current&&rn.getTime()-M.current.getTime()<p&&fn===0||st)return M.current=rn,!1;for(;Xe;){if(Xe.scrollHeight>Xe.clientHeight){if(Xe.scrollTop!==0)return M.current=new Date,!1;if(Xe.getAttribute("role")==="dialog")return!0}Xe=Xe.parentNode}return!0}function zn(Ie){if(Ae.current&&Q){const st=T==="bottom"||T==="right"?1:-1,lt=(He.current-(Zt(T)?Ie.pageY:Ie.pageX))*st,Xe=lt>0,At=u&&!v&&!Xe;if(At&&P===0)return;const fn=Math.abs(lt),rn=document.querySelector("[data-vaul-drawer-wrapper]"),sr=T==="bottom"||T==="top"?yt.current:Pt.current;let kn=fn/sr;const Lr=Se(fn,Xe);if(Lr!==null&&(kn=Lr),At&&kn>=1||!he.current&&!ar(Ie.target,Xe))return;if(Ae.current.classList.add(ap),he.current=!0,tn(Ae.current,{transition:"none"}),tn(fe.current,{transition:"none"}),u&&xe({draggedDistance:lt}),Xe&&!u){const Xt=W5(lt),Lt=Math.min(Xt*-1,0)*st;tn(Ae.current,{transform:Zt(T)?`translate3d(0, ${Lt}px, 0)`:`translate3d(${Lt}px, 0, 0)`});return}const $r=1-kn;if((ve||b&&P===b-1)&&(o?.(Ie,kn),tn(fe.current,{opacity:`${$r}`,transition:"none"},!0)),rn&&fe.current&&d){const Xt=Math.min(qe()+kn*(1-qe()),1),Lt=8-kn*8,hn=Math.max(0,14-kn*14);tn(rn,{borderRadius:`${Lt}px`,transform:Zt(T)?`scale(${Xt}) translate3d(0, ${hn}px, 0)`:`scale(${Xt}) translate3d(${hn}px, 0, 0)`,transition:"none"},!0)}if(!u){const Xt=fn*st;tn(Ae.current,{transform:Zt(T)?`translate3d(0, ${Xt}px, 0)`:`translate3d(${Xt}px, 0, 0)`})}}}ae.useEffect(()=>{window.requestAnimationFrame(()=>{Re.current=!0})},[]),ae.useEffect(()=>{var Ie;function st(){if(!Ae.current||!J)return;const lt=document.activeElement;if(Dp(lt)||pe.current){var Xe;const At=((Xe=window.visualViewport)==null?void 0:Xe.height)||0,fn=window.innerHeight;let rn=fn-At;const sr=Ae.current.getBoundingClientRect().height||0,kn=sr>fn*.8;Nt.current||(Nt.current=sr);const Lr=Ae.current.getBoundingClientRect().top;if(Math.abs(Ye.current-rn)>60&&(pe.current=!pe.current),u&&u.length>0&&Ne&&P){const $r=Ne[P]||0;rn+=$r}if(Ye.current=rn,sr>At||pe.current){const $r=Ae.current.getBoundingClientRect().height;let Xt=$r;$r>At&&(Xt=At-(kn?Lr:Op)),w?Ae.current.style.height=`${$r-Math.max(rn,0)}px`:Ae.current.style.height=`${Math.max(Xt,At-Lr)}px`}else I5()||(Ae.current.style.height=`${Nt.current}px`);u&&u.length>0&&!pe.current?Ae.current.style.bottom="0px":Ae.current.style.bottom=`${Math.max(rn,0)}px`}}return(Ie=window.visualViewport)==null||Ie.addEventListener("resize",st),()=>{var lt;return(lt=window.visualViewport)==null?void 0:lt.removeEventListener("resize",st)}},[P,u,Ne]);function br(Ie){Pr(),k?.(),Ie||O(!1),setTimeout(()=>{u&&Z(u[0])},Tt.DURATION*1e3)}function Sn(){if(!Ae.current)return;const Ie=document.querySelector("[data-vaul-drawer-wrapper]"),st=_u(Ae.current,T);tn(Ae.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${Tt.DURATION}s cubic-bezier(${Tt.EASE.join(",")})`}),tn(fe.current,{transition:`opacity ${Tt.DURATION}s cubic-bezier(${Tt.EASE.join(",")})`,opacity:"1"}),d&&st&&st>0&&me&&tn(Ie,{borderRadius:`${I2}px`,overflow:"hidden",...Zt(T)?{transform:`scale(${qe()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${qe()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${Tt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${Tt.EASE.join(",")})`},!0)}function Pr(){!Q||!Ae.current||(Ae.current.classList.remove(ap),he.current=!1,_(!1),G.current=new Date)}function wr(Ie){if(!Q||!Ae.current)return;Ae.current.classList.remove(ap),he.current=!1,_(!1),G.current=new Date;const st=_u(Ae.current,T);if(!Ie||!ar(Ie.target,!1)||!st||Number.isNaN(st)||_e.current===null)return;const lt=G.current.getTime()-_e.current.getTime(),Xe=He.current-(Zt(T)?Ie.pageY:Ie.pageX),At=Math.abs(Xe)/lt;if(At>.05&&(ge(!0),setTimeout(()=>{ge(!1)},200)),u){re({draggedDistance:Xe*(T==="bottom"||T==="right"?1:-1),closeDrawer:br,velocity:At,dismissible:v}),l?.(Ie,!0);return}if(T==="bottom"||T==="right"?Xe>0:Xe<0){Sn(),l?.(Ie,!0);return}if(At>$2){br(),l?.(Ie,!1);return}var fn;const rn=Math.min((fn=Ae.current.getBoundingClientRect().height)!=null?fn:0,window.innerHeight);var sr;const kn=Math.min((sr=Ae.current.getBoundingClientRect().width)!=null?sr:0,window.innerWidth),Lr=T==="left"||T==="right";if(Math.abs(st)>=(Lr?kn:rn)*m){br(),l?.(Ie,!1);return}l?.(Ie,!0),Sn()}ae.useEffect(()=>(me&&(tn(document.documentElement,{scrollBehavior:"auto"}),ye.current=new Date),()=>{X5(document.documentElement,"scrollBehavior")}),[me]);function na(Ie){const st=Ie?(window.innerWidth-Vs)/window.innerWidth:1,lt=Ie?-Vs:0;Be.current&&window.clearTimeout(Be.current),tn(Ae.current,{transition:`transform ${Tt.DURATION}s cubic-bezier(${Tt.EASE.join(",")})`,transform:Zt(T)?`scale(${st}) translate3d(0, ${lt}px, 0)`:`scale(${st}) translate3d(${lt}px, 0, 0)`}),!Ie&&Ae.current&&(Be.current=setTimeout(()=>{const Xe=_u(Ae.current,T);tn(Ae.current,{transition:"none",transform:Zt(T)?`translate3d(0, ${Xe}px, 0)`:`translate3d(${Xe}px, 0, 0)`})},500))}function ra(Ie,st){if(st<0)return;const lt=(window.innerWidth-Vs)/window.innerWidth,Xe=lt+st*(1-lt),At=-Vs+st*Vs;tn(Ae.current,{transform:Zt(T)?`scale(${Xe}) translate3d(0, ${At}px, 0)`:`scale(${Xe}) translate3d(${At}px, 0, 0)`,transition:"none"})}function io(Ie,st){const lt=Zt(T)?window.innerHeight:window.innerWidth,Xe=st?(lt-Vs)/lt:1,At=st?-Vs:0;st&&tn(Ae.current,{transition:`transform ${Tt.DURATION}s cubic-bezier(${Tt.EASE.join(",")})`,transform:Zt(T)?`scale(${Xe}) translate3d(0, ${At}px, 0)`:`scale(${Xe}) translate3d(${At}px, 0, 0)`})}return ae.useEffect(()=>{C||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[C]),ae.createElement(Gx,{defaultOpen:z,onOpenChange:Ie=>{!v&&!Ie||(Ie?F(!0):br(!0),O(Ie))},open:me},ae.createElement(D2.Provider,{value:{activeSnapPoint:zr,snapPoints:u,setActiveSnapPoint:Z,drawerRef:Ae,overlayRef:fe,onOpenChange:t,onPress:at,onRelease:wr,onDrag:zn,dismissible:v,shouldAnimate:Re,handleOnly:y,isOpen:me,isDragging:Q,shouldFade:ve,closeDrawer:br,onNestedDrag:ra,onNestedOpenChange:na,onNestedRelease:io,keyboardIsOpen:pe,modal:C,snapPointsOffset:Ne,activeSnapPointIndex:P,direction:T,shouldScaleBackground:d,setBackgroundColorOnScale:f,noBodyStyles:R,container:ie,autoFocus:te}},r))}const V2=ae.forwardRef(function({...e},t){const{overlayRef:r,snapPoints:o,onRelease:l,shouldFade:u,isOpen:d,modal:f,shouldAnimate:m}=ic(),p=P2(t,r),v=o&&o.length>0;if(!f)return null;const y=ae.useCallback(b=>l(b),[l]);return ae.createElement(ef,{onMouseUp:y,ref:p,"data-vaul-overlay":"","data-vaul-snap-points":d&&v?"true":"false","data-vaul-snap-points-overlay":d&&u?"true":"false","data-vaul-animate":m?.current?"true":"false",...e})});V2.displayName="Drawer.Overlay";const H2=ae.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:r,...o},l){const{drawerRef:u,onPress:d,onRelease:f,onDrag:m,keyboardIsOpen:p,snapPointsOffset:v,activeSnapPointIndex:y,modal:b,isOpen:S,direction:N,snapPoints:w,container:C,handleOnly:k,shouldAnimate:E,autoFocus:R}=ic(),[T,z]=ae.useState(!1),ne=P2(l,u),$=ae.useRef(null),V=ae.useRef(null),J=ae.useRef(!1),se=w&&w.length>0;sz();const ie=(q,de,me=0)=>{if(J.current)return!0;const O=Math.abs(q.y),L=Math.abs(q.x),F=L>O,Q=["bottom","right"].includes(de)?1:-1;if(de==="left"||de==="right"){if(!(q.x*Q<0)&&L>=0&&L<=me)return F}else if(!(q.y*Q<0)&&O>=0&&O<=me)return!F;return J.current=!0,!0};ae.useEffect(()=>{se&&window.requestAnimationFrame(()=>{z(!0)})},[]);function te(q){$.current=null,J.current=!1,f(q)}return ae.createElement(tf,{"data-vaul-drawer-direction":N,"data-vaul-drawer":"","data-vaul-delayed-snap-points":T?"true":"false","data-vaul-snap-points":S&&se?"true":"false","data-vaul-custom-container":C?"true":"false","data-vaul-animate":E?.current?"true":"false",...o,ref:ne,style:v&&v.length>0?{"--snap-point-height":`${v[y??0]}px`,...t}:t,onPointerDown:q=>{k||(o.onPointerDown==null||o.onPointerDown.call(o,q),$.current={x:q.pageX,y:q.pageY},d(q))},onOpenAutoFocus:q=>{r?.(q),R||q.preventDefault()},onPointerDownOutside:q=>{if(e?.(q),!b||q.defaultPrevented){q.preventDefault();return}p.current&&(p.current=!1)},onFocusOutside:q=>{if(!b){q.preventDefault();return}},onPointerMove:q=>{if(V.current=q,k||(o.onPointerMove==null||o.onPointerMove.call(o,q),!$.current))return;const de=q.pageY-$.current.y,me=q.pageX-$.current.x,O=q.pointerType==="touch"?10:2;ie({x:me,y:de},N,O)?m(q):(Math.abs(me)>O||Math.abs(de)>O)&&($.current=null)},onPointerUp:q=>{o.onPointerUp==null||o.onPointerUp.call(o,q),$.current=null,J.current=!1,f(q)},onPointerOut:q=>{o.onPointerOut==null||o.onPointerOut.call(o,q),te(V.current)},onContextMenu:q=>{o.onContextMenu==null||o.onContextMenu.call(o,q),V.current&&te(V.current)}})});H2.displayName="Drawer.Content";const lz=250,cz=120,uz=ae.forwardRef(function({preventCycle:e=!1,children:t,...r},o){const{closeDrawer:l,isDragging:u,snapPoints:d,activeSnapPoint:f,setActiveSnapPoint:m,dismissible:p,handleOnly:v,isOpen:y,onPress:b,onDrag:S}=ic(),N=ae.useRef(null),w=ae.useRef(!1);function C(){if(w.current){R();return}window.setTimeout(()=>{k()},cz)}function k(){if(u||e||w.current){R();return}if(R(),!d||d.length===0){p||l();return}if(f===d[d.length-1]&&p){l();return}const z=d.findIndex($=>$===f);if(z===-1)return;const ne=d[z+1];m(ne)}function E(){N.current=window.setTimeout(()=>{w.current=!0},lz)}function R(){N.current&&window.clearTimeout(N.current),w.current=!1}return ae.createElement("div",{onClick:C,onPointerCancel:R,onPointerDown:T=>{v&&b(T),E()},onPointerMove:T=>{v&&S(T)},ref:o,"data-vaul-drawer-visible":y?"true":"false","data-vaul-handle":"","aria-hidden":"true",...r},ae.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});uz.displayName="Drawer.Handle";function dz(e){const t=ic(),{container:r=t.container,...o}=e;return ae.createElement(Kx,{container:r,...o})}const Dr={Root:iz,Content:H2,Overlay:V2,Trigger:M2,Portal:dz,Close:af,Title:nf,Description:rf},F2=({shouldScaleBackground:e=!0,...t})=>a.jsx(Dr.Root,{shouldScaleBackground:e,...t});F2.displayName="Drawer";const fz=Dr.Trigger,hz=Dr.Portal,mz=Dr.Close,q2=x.forwardRef(({className:e,...t},r)=>a.jsx(Dr.Overlay,{ref:r,className:je("fixed inset-0 z-50 bg-black/80",e),...t}));q2.displayName=Dr.Overlay.displayName;const Y2=x.forwardRef(({className:e,children:t,...r},o)=>a.jsxs(hz,{children:[a.jsx(q2,{}),a.jsxs(Dr.Content,{ref:o,className:je("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",e),...r,children:[a.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),t]})]}));Y2.displayName="DrawerContent";const Z2=({className:e,...t})=>a.jsx("div",{className:je("grid gap-1.5 p-4 text-center sm:text-left",e),...t});Z2.displayName="DrawerHeader";const G2=({className:e,...t})=>a.jsx("div",{className:je("mt-auto flex flex-col gap-2 p-4",e),...t});G2.displayName="DrawerFooter";const K2=x.forwardRef(({className:e,...t},r)=>a.jsx(Dr.Title,{ref:r,className:je("text-lg font-semibold leading-none tracking-tight",e),...t}));K2.displayName=Dr.Title.displayName;const Q2=x.forwardRef(({className:e,...t},r)=>a.jsx(Dr.Description,{ref:r,className:je("text-sm text-muted-foreground",e),...t}));Q2.displayName=Dr.Description.displayName;var pz="Label",X2=x.forwardRef((e,t)=>a.jsx(Ee.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));X2.displayName=pz;var W2=X2;const xz=kx("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),_n=x.forwardRef(({className:e,...t},r)=>a.jsx(W2,{ref:r,className:je(xz(),e),...t}));_n.displayName=W2.displayName;function gz(e,t){return x.useReducer((r,o)=>t[r][o]??r,e)}var Xx="ScrollArea",[J2,DV]=Qt(Xx),[vz,yr]=J2(Xx),ek=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:o="hover",dir:l,scrollHideDelay:u=600,...d}=e,[f,m]=x.useState(null),[p,v]=x.useState(null),[y,b]=x.useState(null),[S,N]=x.useState(null),[w,C]=x.useState(null),[k,E]=x.useState(0),[R,T]=x.useState(0),[z,ne]=x.useState(!1),[$,V]=x.useState(!1),J=Le(t,ie=>m(ie)),se=bs(l);return a.jsx(vz,{scope:r,type:o,dir:se,scrollHideDelay:u,scrollArea:f,viewport:p,onViewportChange:v,content:y,onContentChange:b,scrollbarX:S,onScrollbarXChange:N,scrollbarXEnabled:z,onScrollbarXEnabledChange:ne,scrollbarY:w,onScrollbarYChange:C,scrollbarYEnabled:$,onScrollbarYEnabledChange:V,onCornerWidthChange:E,onCornerHeightChange:T,children:a.jsx(Ee.div,{dir:se,...d,ref:J,style:{position:"relative","--radix-scroll-area-corner-width":k+"px","--radix-scroll-area-corner-height":R+"px",...e.style}})})});ek.displayName=Xx;var tk="ScrollAreaViewport",nk=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:o,nonce:l,...u}=e,d=yr(tk,r),f=x.useRef(null),m=Le(t,f,d.onViewportChange);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),a.jsx(Ee.div,{"data-radix-scroll-area-viewport":"",...u,ref:m,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...e.style},children:a.jsx("div",{ref:d.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});nk.displayName=tk;var ea="ScrollAreaScrollbar",Wx=x.forwardRef((e,t)=>{const{forceMount:r,...o}=e,l=yr(ea,e.__scopeScrollArea),{onScrollbarXEnabledChange:u,onScrollbarYEnabledChange:d}=l,f=e.orientation==="horizontal";return x.useEffect(()=>(f?u(!0):d(!0),()=>{f?u(!1):d(!1)}),[f,u,d]),l.type==="hover"?a.jsx(yz,{...o,ref:t,forceMount:r}):l.type==="scroll"?a.jsx(bz,{...o,ref:t,forceMount:r}):l.type==="auto"?a.jsx(rk,{...o,ref:t,forceMount:r}):l.type==="always"?a.jsx(Jx,{...o,ref:t}):null});Wx.displayName=ea;var yz=x.forwardRef((e,t)=>{const{forceMount:r,...o}=e,l=yr(ea,e.__scopeScrollArea),[u,d]=x.useState(!1);return x.useEffect(()=>{const f=l.scrollArea;let m=0;if(f){const p=()=>{window.clearTimeout(m),d(!0)},v=()=>{m=window.setTimeout(()=>d(!1),l.scrollHideDelay)};return f.addEventListener("pointerenter",p),f.addEventListener("pointerleave",v),()=>{window.clearTimeout(m),f.removeEventListener("pointerenter",p),f.removeEventListener("pointerleave",v)}}},[l.scrollArea,l.scrollHideDelay]),a.jsx(yn,{present:r||u,children:a.jsx(rk,{"data-state":u?"visible":"hidden",...o,ref:t})})}),bz=x.forwardRef((e,t)=>{const{forceMount:r,...o}=e,l=yr(ea,e.__scopeScrollArea),u=e.orientation==="horizontal",d=of(()=>m("SCROLL_END"),100),[f,m]=gz("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return x.useEffect(()=>{if(f==="idle"){const p=window.setTimeout(()=>m("HIDE"),l.scrollHideDelay);return()=>window.clearTimeout(p)}},[f,l.scrollHideDelay,m]),x.useEffect(()=>{const p=l.viewport,v=u?"scrollLeft":"scrollTop";if(p){let y=p[v];const b=()=>{const S=p[v];y!==S&&(m("SCROLL"),d()),y=S};return p.addEventListener("scroll",b),()=>p.removeEventListener("scroll",b)}},[l.viewport,u,m,d]),a.jsx(yn,{present:r||f!=="hidden",children:a.jsx(Jx,{"data-state":f==="hidden"?"hidden":"visible",...o,ref:t,onPointerEnter:be(e.onPointerEnter,()=>m("POINTER_ENTER")),onPointerLeave:be(e.onPointerLeave,()=>m("POINTER_LEAVE"))})})}),rk=x.forwardRef((e,t)=>{const r=yr(ea,e.__scopeScrollArea),{forceMount:o,...l}=e,[u,d]=x.useState(!1),f=e.orientation==="horizontal",m=of(()=>{if(r.viewport){const p=r.viewport.offsetWidth<r.viewport.scrollWidth,v=r.viewport.offsetHeight<r.viewport.scrollHeight;d(f?p:v)}},10);return ui(r.viewport,m),ui(r.content,m),a.jsx(yn,{present:o||u,children:a.jsx(Jx,{"data-state":u?"visible":"hidden",...l,ref:t})})}),Jx=x.forwardRef((e,t)=>{const{orientation:r="vertical",...o}=e,l=yr(ea,e.__scopeScrollArea),u=x.useRef(null),d=x.useRef(0),[f,m]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),p=lk(f.viewport,f.content),v={...o,sizes:f,onSizesChange:m,hasThumb:p>0&&p<1,onThumbChange:b=>u.current=b,onThumbPointerUp:()=>d.current=0,onThumbPointerDown:b=>d.current=b};function y(b,S){return Cz(b,d.current,f,S)}return r==="horizontal"?a.jsx(wz,{...v,ref:t,onThumbPositionChange:()=>{if(l.viewport&&u.current){const b=l.viewport.scrollLeft,S=Mw(b,f,l.dir);u.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:b=>{l.viewport&&(l.viewport.scrollLeft=b)},onDragScroll:b=>{l.viewport&&(l.viewport.scrollLeft=y(b,l.dir))}}):r==="vertical"?a.jsx(jz,{...v,ref:t,onThumbPositionChange:()=>{if(l.viewport&&u.current){const b=l.viewport.scrollTop,S=Mw(b,f);u.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:b=>{l.viewport&&(l.viewport.scrollTop=b)},onDragScroll:b=>{l.viewport&&(l.viewport.scrollTop=y(b))}}):null}),wz=x.forwardRef((e,t)=>{const{sizes:r,onSizesChange:o,...l}=e,u=yr(ea,e.__scopeScrollArea),[d,f]=x.useState(),m=x.useRef(null),p=Le(t,m,u.onScrollbarXChange);return x.useEffect(()=>{m.current&&f(getComputedStyle(m.current))},[m]),a.jsx(sk,{"data-orientation":"horizontal",...l,ref:p,sizes:r,style:{bottom:0,left:u.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:u.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":sf(r)+"px",...e.style},onThumbPointerDown:v=>e.onThumbPointerDown(v.x),onDragScroll:v=>e.onDragScroll(v.x),onWheelScroll:(v,y)=>{if(u.viewport){const b=u.viewport.scrollLeft+v.deltaX;e.onWheelScroll(b),uk(b,y)&&v.preventDefault()}},onResize:()=>{m.current&&u.viewport&&d&&o({content:u.viewport.scrollWidth,viewport:u.viewport.offsetWidth,scrollbar:{size:m.current.clientWidth,paddingStart:dd(d.paddingLeft),paddingEnd:dd(d.paddingRight)}})}})}),jz=x.forwardRef((e,t)=>{const{sizes:r,onSizesChange:o,...l}=e,u=yr(ea,e.__scopeScrollArea),[d,f]=x.useState(),m=x.useRef(null),p=Le(t,m,u.onScrollbarYChange);return x.useEffect(()=>{m.current&&f(getComputedStyle(m.current))},[m]),a.jsx(sk,{"data-orientation":"vertical",...l,ref:p,sizes:r,style:{top:0,right:u.dir==="ltr"?0:void 0,left:u.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":sf(r)+"px",...e.style},onThumbPointerDown:v=>e.onThumbPointerDown(v.y),onDragScroll:v=>e.onDragScroll(v.y),onWheelScroll:(v,y)=>{if(u.viewport){const b=u.viewport.scrollTop+v.deltaY;e.onWheelScroll(b),uk(b,y)&&v.preventDefault()}},onResize:()=>{m.current&&u.viewport&&d&&o({content:u.viewport.scrollHeight,viewport:u.viewport.offsetHeight,scrollbar:{size:m.current.clientHeight,paddingStart:dd(d.paddingTop),paddingEnd:dd(d.paddingBottom)}})}})}),[Nz,ak]=J2(ea),sk=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:o,hasThumb:l,onThumbChange:u,onThumbPointerUp:d,onThumbPointerDown:f,onThumbPositionChange:m,onDragScroll:p,onWheelScroll:v,onResize:y,...b}=e,S=yr(ea,r),[N,w]=x.useState(null),C=Le(t,J=>w(J)),k=x.useRef(null),E=x.useRef(""),R=S.viewport,T=o.content-o.viewport,z=un(v),ne=un(m),$=of(y,10);function V(J){if(k.current){const se=J.clientX-k.current.left,ie=J.clientY-k.current.top;p({x:se,y:ie})}}return x.useEffect(()=>{const J=se=>{const ie=se.target;N?.contains(ie)&&z(se,T)};return document.addEventListener("wheel",J,{passive:!1}),()=>document.removeEventListener("wheel",J,{passive:!1})},[R,N,T,z]),x.useEffect(ne,[o,ne]),ui(N,$),ui(S.content,$),a.jsx(Nz,{scope:r,scrollbar:N,hasThumb:l,onThumbChange:un(u),onThumbPointerUp:un(d),onThumbPositionChange:ne,onThumbPointerDown:un(f),children:a.jsx(Ee.div,{...b,ref:C,style:{position:"absolute",...b.style},onPointerDown:be(e.onPointerDown,J=>{J.button===0&&(J.target.setPointerCapture(J.pointerId),k.current=N.getBoundingClientRect(),E.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),V(J))}),onPointerMove:be(e.onPointerMove,V),onPointerUp:be(e.onPointerUp,J=>{const se=J.target;se.hasPointerCapture(J.pointerId)&&se.releasePointerCapture(J.pointerId),document.body.style.webkitUserSelect=E.current,S.viewport&&(S.viewport.style.scrollBehavior=""),k.current=null})})})}),ud="ScrollAreaThumb",ok=x.forwardRef((e,t)=>{const{forceMount:r,...o}=e,l=ak(ud,e.__scopeScrollArea);return a.jsx(yn,{present:r||l.hasThumb,children:a.jsx(Sz,{ref:t,...o})})}),Sz=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:o,...l}=e,u=yr(ud,r),d=ak(ud,r),{onThumbPositionChange:f}=d,m=Le(t,y=>d.onThumbChange(y)),p=x.useRef(void 0),v=of(()=>{p.current&&(p.current(),p.current=void 0)},100);return x.useEffect(()=>{const y=u.viewport;if(y){const b=()=>{if(v(),!p.current){const S=Ez(y,f);p.current=S,f()}};return f(),y.addEventListener("scroll",b),()=>y.removeEventListener("scroll",b)}},[u.viewport,v,f]),a.jsx(Ee.div,{"data-state":d.hasThumb?"visible":"hidden",...l,ref:m,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:be(e.onPointerDownCapture,y=>{const S=y.target.getBoundingClientRect(),N=y.clientX-S.left,w=y.clientY-S.top;d.onThumbPointerDown({x:N,y:w})}),onPointerUp:be(e.onPointerUp,d.onThumbPointerUp)})});ok.displayName=ud;var eg="ScrollAreaCorner",ik=x.forwardRef((e,t)=>{const r=yr(eg,e.__scopeScrollArea),o=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&o?a.jsx(kz,{...e,ref:t}):null});ik.displayName=eg;var kz=x.forwardRef((e,t)=>{const{__scopeScrollArea:r,...o}=e,l=yr(eg,r),[u,d]=x.useState(0),[f,m]=x.useState(0),p=!!(u&&f);return ui(l.scrollbarX,()=>{const v=l.scrollbarX?.offsetHeight||0;l.onCornerHeightChange(v),m(v)}),ui(l.scrollbarY,()=>{const v=l.scrollbarY?.offsetWidth||0;l.onCornerWidthChange(v),d(v)}),p?a.jsx(Ee.div,{...o,ref:t,style:{width:u,height:f,position:"absolute",right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function dd(e){return e?parseInt(e,10):0}function lk(e,t){const r=e/t;return isNaN(r)?0:r}function sf(e){const t=lk(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=(e.scrollbar.size-r)*t;return Math.max(o,18)}function Cz(e,t,r,o="ltr"){const l=sf(r),u=l/2,d=t||u,f=l-d,m=r.scrollbar.paddingStart+d,p=r.scrollbar.size-r.scrollbar.paddingEnd-f,v=r.content-r.viewport,y=o==="ltr"?[0,v]:[v*-1,0];return ck([m,p],y)(e)}function Mw(e,t,r="ltr"){const o=sf(t),l=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,u=t.scrollbar.size-l,d=t.content-t.viewport,f=u-o,m=r==="ltr"?[0,d]:[d*-1,0],p=ql(e,m);return ck([0,d],[0,f])(p)}function ck(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(r-e[0])}}function uk(e,t){return e>0&&e<t}var Ez=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},o=0;return(function l(){const u={left:e.scrollLeft,top:e.scrollTop},d=r.left!==u.left,f=r.top!==u.top;(d||f)&&t(),r=u,o=window.requestAnimationFrame(l)})(),()=>window.cancelAnimationFrame(o)};function of(e,t){const r=un(e),o=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(o.current),[]),x.useCallback(()=>{window.clearTimeout(o.current),o.current=window.setTimeout(r,t)},[r,t])}function ui(e,t){const r=un(t);Vt(()=>{let o=0;if(e){const l=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(r)});return l.observe(e),()=>{window.cancelAnimationFrame(o),l.unobserve(e)}}},[e,r])}var dk=ek,Az=nk,Rz=ik;const fk=x.forwardRef(({className:e,children:t,...r},o)=>a.jsxs(dk,{ref:o,className:je("relative overflow-hidden",e),...r,children:[a.jsx(Az,{className:"h-full w-full rounded-[inherit]",children:t}),a.jsx(hk,{}),a.jsx(Rz,{})]}));fk.displayName=dk.displayName;const hk=x.forwardRef(({className:e,orientation:t="vertical",...r},o)=>a.jsx(Wx,{ref:o,orientation:t,className:je("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:a.jsx(ok,{className:"relative flex-1 rounded-full bg-border"})}));hk.displayName=Wx.displayName;var Tz="Separator",Dw="horizontal",_z=["horizontal","vertical"],mk=x.forwardRef((e,t)=>{const{decorative:r,orientation:o=Dw,...l}=e,u=Mz(o)?o:Dw,f=r?{role:"none"}:{"aria-orientation":u==="vertical"?u:void 0,role:"separator"};return a.jsx(Ee.div,{"data-orientation":u,...f,...l,ref:t})});mk.displayName=Tz;function Mz(e){return _z.includes(e)}var pk=mk;const fd=x.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...o},l)=>a.jsx(pk,{ref:l,decorative:r,orientation:t,className:je("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));fd.displayName=pk.displayName;var xk=["PageUp","PageDown"],gk=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],vk={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},wi="Slider",[zp,Dz,Oz]=tc(wi),[yk,OV]=Qt(wi,[Oz]),[zz,lf]=yk(wi),bk=x.forwardRef((e,t)=>{const{name:r,min:o=0,max:l=100,step:u=1,orientation:d="horizontal",disabled:f=!1,minStepsBetweenThumbs:m=0,defaultValue:p=[o],value:v,onValueChange:y=()=>{},onValueCommit:b=()=>{},inverted:S=!1,form:N,...w}=e,C=x.useRef(new Set),k=x.useRef(0),R=d==="horizontal"?Pz:Lz,[T=[],z]=Hn({prop:v,defaultProp:p,onChange:ie=>{[...C.current][k.current]?.focus(),y(ie)}}),ne=x.useRef(T);function $(ie){const te=Vz(T,ie);se(ie,te)}function V(ie){se(ie,k.current)}function J(){const ie=ne.current[k.current];T[k.current]!==ie&&b(T)}function se(ie,te,{commit:q}={commit:!1}){const de=Yz(u),me=Zz(Math.round((ie-o)/u)*u+o,de),O=ql(me,[o,l]);z((L=[])=>{const F=Uz(L,O,te);if(qz(F,m*u)){k.current=F.indexOf(O);const Q=String(F)!==String(L);return Q&&q&&b(F),Q?F:L}else return L})}return a.jsx(zz,{scope:e.__scopeSlider,name:r,disabled:f,min:o,max:l,valueIndexToChangeRef:k,thumbs:C.current,values:T,orientation:d,form:N,children:a.jsx(zp.Provider,{scope:e.__scopeSlider,children:a.jsx(zp.Slot,{scope:e.__scopeSlider,children:a.jsx(R,{"aria-disabled":f,"data-disabled":f?"":void 0,...w,ref:t,onPointerDown:be(w.onPointerDown,()=>{f||(ne.current=T)}),min:o,max:l,inverted:S,onSlideStart:f?void 0:$,onSlideMove:f?void 0:V,onSlideEnd:f?void 0:J,onHomeKeyDown:()=>!f&&se(o,0,{commit:!0}),onEndKeyDown:()=>!f&&se(l,T.length-1,{commit:!0}),onStepKeyDown:({event:ie,direction:te})=>{if(!f){const me=xk.includes(ie.key)||ie.shiftKey&&gk.includes(ie.key)?10:1,O=k.current,L=T[O],F=u*me*te;se(L+F,O,{commit:!0})}}})})})})});bk.displayName=wi;var[wk,jk]=yk(wi,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Pz=x.forwardRef((e,t)=>{const{min:r,max:o,dir:l,inverted:u,onSlideStart:d,onSlideMove:f,onSlideEnd:m,onStepKeyDown:p,...v}=e,[y,b]=x.useState(null),S=Le(t,R=>b(R)),N=x.useRef(void 0),w=bs(l),C=w==="ltr",k=C&&!u||!C&&u;function E(R){const T=N.current||y.getBoundingClientRect(),z=[0,T.width],$=tg(z,k?[r,o]:[o,r]);return N.current=T,$(R-T.left)}return a.jsx(wk,{scope:e.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:a.jsx(Nk,{dir:w,"data-orientation":"horizontal",...v,ref:S,style:{...v.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:R=>{const T=E(R.clientX);d?.(T)},onSlideMove:R=>{const T=E(R.clientX);f?.(T)},onSlideEnd:()=>{N.current=void 0,m?.()},onStepKeyDown:R=>{const z=vk[k?"from-left":"from-right"].includes(R.key);p?.({event:R,direction:z?-1:1})}})})}),Lz=x.forwardRef((e,t)=>{const{min:r,max:o,inverted:l,onSlideStart:u,onSlideMove:d,onSlideEnd:f,onStepKeyDown:m,...p}=e,v=x.useRef(null),y=Le(t,v),b=x.useRef(void 0),S=!l;function N(w){const C=b.current||v.current.getBoundingClientRect(),k=[0,C.height],R=tg(k,S?[o,r]:[r,o]);return b.current=C,R(w-C.top)}return a.jsx(wk,{scope:e.__scopeSlider,startEdge:S?"bottom":"top",endEdge:S?"top":"bottom",size:"height",direction:S?1:-1,children:a.jsx(Nk,{"data-orientation":"vertical",...p,ref:y,style:{...p.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:w=>{const C=N(w.clientY);u?.(C)},onSlideMove:w=>{const C=N(w.clientY);d?.(C)},onSlideEnd:()=>{b.current=void 0,f?.()},onStepKeyDown:w=>{const k=vk[S?"from-bottom":"from-top"].includes(w.key);m?.({event:w,direction:k?-1:1})}})})}),Nk=x.forwardRef((e,t)=>{const{__scopeSlider:r,onSlideStart:o,onSlideMove:l,onSlideEnd:u,onHomeKeyDown:d,onEndKeyDown:f,onStepKeyDown:m,...p}=e,v=lf(wi,r);return a.jsx(Ee.span,{...p,ref:t,onKeyDown:be(e.onKeyDown,y=>{y.key==="Home"?(d(y),y.preventDefault()):y.key==="End"?(f(y),y.preventDefault()):xk.concat(gk).includes(y.key)&&(m(y),y.preventDefault())}),onPointerDown:be(e.onPointerDown,y=>{const b=y.target;b.setPointerCapture(y.pointerId),y.preventDefault(),v.thumbs.has(b)?b.focus():o(y)}),onPointerMove:be(e.onPointerMove,y=>{y.target.hasPointerCapture(y.pointerId)&&l(y)}),onPointerUp:be(e.onPointerUp,y=>{const b=y.target;b.hasPointerCapture(y.pointerId)&&(b.releasePointerCapture(y.pointerId),u(y))})})}),Sk="SliderTrack",kk=x.forwardRef((e,t)=>{const{__scopeSlider:r,...o}=e,l=lf(Sk,r);return a.jsx(Ee.span,{"data-disabled":l.disabled?"":void 0,"data-orientation":l.orientation,...o,ref:t})});kk.displayName=Sk;var Pp="SliderRange",Ck=x.forwardRef((e,t)=>{const{__scopeSlider:r,...o}=e,l=lf(Pp,r),u=jk(Pp,r),d=x.useRef(null),f=Le(t,d),m=l.values.length,p=l.values.map(b=>Rk(b,l.min,l.max)),v=m>1?Math.min(...p):0,y=100-Math.max(...p);return a.jsx(Ee.span,{"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,...o,ref:f,style:{...e.style,[u.startEdge]:v+"%",[u.endEdge]:y+"%"}})});Ck.displayName=Pp;var Lp="SliderThumb",Ek=x.forwardRef((e,t)=>{const r=Dz(e.__scopeSlider),[o,l]=x.useState(null),u=Le(t,f=>l(f)),d=x.useMemo(()=>o?r().findIndex(f=>f.ref.current===o):-1,[r,o]);return a.jsx($z,{...e,ref:u,index:d})}),$z=x.forwardRef((e,t)=>{const{__scopeSlider:r,index:o,name:l,...u}=e,d=lf(Lp,r),f=jk(Lp,r),[m,p]=x.useState(null),v=Le(t,E=>p(E)),y=m?d.form||!!m.closest("form"):!0,b=ec(m),S=d.values[o],N=S===void 0?0:Rk(S,d.min,d.max),w=Bz(o,d.values.length),C=b?.[f.size],k=C?Hz(C,N,f.direction):0;return x.useEffect(()=>{if(m)return d.thumbs.add(m),()=>{d.thumbs.delete(m)}},[m,d.thumbs]),a.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[f.startEdge]:`calc(${N}% + ${k}px)`},children:[a.jsx(zp.ItemSlot,{scope:e.__scopeSlider,children:a.jsx(Ee.span,{role:"slider","aria-label":e["aria-label"]||w,"aria-valuemin":d.min,"aria-valuenow":S,"aria-valuemax":d.max,"aria-orientation":d.orientation,"data-orientation":d.orientation,"data-disabled":d.disabled?"":void 0,tabIndex:d.disabled?void 0:0,...u,ref:v,style:S===void 0?{display:"none"}:e.style,onFocus:be(e.onFocus,()=>{d.valueIndexToChangeRef.current=o})})}),y&&a.jsx(Ak,{name:l??(d.name?d.name+(d.values.length>1?"[]":""):void 0),form:d.form,value:S},o)]})});Ek.displayName=Lp;var Iz="RadioBubbleInput",Ak=x.forwardRef(({__scopeSlider:e,value:t,...r},o)=>{const l=x.useRef(null),u=Le(l,o),d=oc(t);return x.useEffect(()=>{const f=l.current;if(!f)return;const m=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(m,"value").set;if(d!==t&&v){const y=new Event("input",{bubbles:!0});v.call(f,t),f.dispatchEvent(y)}},[d,t]),a.jsx(Ee.input,{style:{display:"none"},...r,ref:u,defaultValue:t})});Ak.displayName=Iz;function Uz(e=[],t,r){const o=[...e];return o[r]=t,o.sort((l,u)=>l-u)}function Rk(e,t,r){const u=100/(r-t)*(e-t);return ql(u,[0,100])}function Bz(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Vz(e,t){if(e.length===1)return 0;const r=e.map(l=>Math.abs(l-t)),o=Math.min(...r);return r.indexOf(o)}function Hz(e,t,r){const o=e/2,u=tg([0,50],[0,o]);return(o-u(t)*r)*r}function Fz(e){return e.slice(0,-1).map((t,r)=>e[r+1]-t)}function qz(e,t){if(t>0){const r=Fz(e);return Math.min(...r)>=t}return!0}function tg(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(r-e[0])}}function Yz(e){return(String(e).split(".")[1]||"").length}function Zz(e,t){const r=Math.pow(10,t);return Math.round(e*r)/r}var Tk=bk,Gz=kk,Kz=Ck,Qz=Ek;const ng=x.forwardRef(({className:e,...t},r)=>a.jsxs(Tk,{ref:r,className:je("relative flex w-full touch-none select-none items-center",e),...t,children:[a.jsx(Gz,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:a.jsx(Kz,{className:"absolute h-full bg-primary"})}),a.jsx(Qz,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background 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"})]}));ng.displayName=Tk.displayName;function Xz(){const{season:e}=$x();ys();const[t,r]=x.useState(1),[o,l]=x.useState(""),[u,d]=x.useState("grid"),[f,m]=x.useState("name"),[p,v]=x.useState("asc"),[y,b]=x.useState(!1),[S,N]=x.useState([]),[w,C]=x.useState([]),[k,E]=x.useState([]),[R,T]=x.useState([1500,2e3]),[z,ne]=x.useState(null),$=u==="grid"?12:8,{data:V,isLoading:J}=tt({queryKey:[`/api/authors?limit=${$}&offset=${(t-1)*$}`]}),{data:se}=tt({queryKey:["/api/tags"]}),ie=se?.filter(M=>M.type==="genre")||[],te=se?.filter(M=>M.type==="period")||[],{data:q}=tt({queryKey:["/api/authors/count"],queryFn:async()=>120}),de=q?Math.ceil(q/$):0;x.useEffect(()=>{if(V&&V.length>0&&!z){const M=Math.floor(Math.random()*V.length);ne(V[M].id)}},[V,z]);const me=V?.find(M=>M.id===z),O=V?[...V].sort((M,he)=>{if(f==="name")return p==="asc"?M.name.localeCompare(he.name):he.name.localeCompare(M.name);if(f==="birth"){const Be=M.birthYear||0,He=he.birthYear||0;return p==="asc"?Be-He:He-Be}else return p==="asc"?Number(M.id)-Number(he.id):Number(he.id)-Number(M.id)}):[],L=Array.from(new Set(V?.map(M=>M.country).filter(Boolean))),F=M=>{l(M),r(1)},Q=M=>{r(M),window.scrollTo({top:0,behavior:"smooth"})},_=()=>{v(p==="asc"?"desc":"asc")},B=M=>{N(S.includes(M)?S.filter(he=>he!==M):[...S,M])},ge=M=>{C(w.includes(M)?w.filter(he=>he!==M):[...w,M])},fe=M=>{E(k.includes(M)?k.filter(he=>he!==M):[...k,M])},ye=()=>{N([]),C([]),E([]),T([1500,2e3])},_e=M=>{const he=Math.floor(Math.random()*30)+1,Be=Math.floor(Math.random()*5e3);return a.jsxs(Oe,{className:`group bg-cream dark:bg-dark-surface hover:shadow-md transition-all duration-300 overflow-hidden
|
||
${e==="spring"?"hover:border-green-400/50":e==="summer"?"hover:border-amber-400/50":e==="autumn"?"hover:border-russet/50":"hover:border-blue-400/50"}`,children:[a.jsxs(Ve,{className:"p-6 pb-4",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsxs("div",{className:"relative flex-shrink-0",children:[a.jsx("div",{className:"w-16 h-16 md:w-20 md:h-20 rounded-full overflow-hidden bg-navy/10 dark:bg-navy/20",children:a.jsx("img",{src:M.portrait||"https://via.placeholder.com/200",alt:M.name,className:"w-full h-full object-cover"})}),M.country&&a.jsx("div",{className:"absolute -bottom-1 -right-1 w-6 h-6 rounded-full bg-cream dark:bg-dark-surface border-2 border-cream dark:border-dark-surface overflow-hidden flex items-center justify-center",children:a.jsx(Gr,{children:a.jsxs(ja,{children:[a.jsx(Na,{asChild:!0,children:a.jsx("img",{src:`https://flagcdn.com/w20/${M.country.toLowerCase()}.png`,alt:M.country,className:"w-full h-auto"})}),a.jsx(Kr,{children:a.jsx("p",{children:L.find(He=>He.toLowerCase()===M.country?.toLowerCase())})})]})})})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx(Ce,{href:`/authors/${M.slug}`,children:a.jsx("h3",{className:`text-lg md:text-xl font-serif font-semibold text-navy dark:text-cream
|
||
group-hover:text-russet dark:group-hover:text-russet/90 transition-colors`,children:M.name})}),a.jsxs("div",{className:"flex items-center text-xs text-navy/70 dark:text-cream/70 gap-x-3 mt-1",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Zs,{className:"h-3 w-3"}),a.jsxs("span",{children:[M.birthYear,"–",M.deathYear||"present"]})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Rr,{className:"h-3 w-3"}),a.jsxs("span",{children:[he," works"]})]})]})]})]}),a.jsx("div",{className:"mt-4",children:a.jsxs("p",{className:"text-navy/80 dark:text-cream/80 text-sm line-clamp-3",children:[M.biography?.slice(0,150)||"No biography available.",(M.biography?.length??0)>150?"...":""]})}),a.jsx("div",{className:"flex flex-wrap gap-1.5 mt-3",children:Array.from({length:Math.floor(Math.random()*3)+1}).map((He,pe)=>a.jsx(ht,{variant:"outline",className:"bg-navy/10 dark:bg-navy/20 text-navy/70 dark:text-cream/70 text-xs border-none",children:ie[Math.floor(Math.random()*ie.length)]?.name||"Poetry"},pe))})]}),a.jsxs(Ea,{className:"p-4 pt-2 flex items-center justify-between border-t border-sage/10 dark:border-sage/5",children:[a.jsxs("div",{className:"flex items-center text-xs text-navy/60 dark:text-cream/60 gap-2",children:[a.jsx(Qs,{className:"h-3 w-3"}),a.jsxs("span",{children:[Be.toLocaleString()," followers"]})]}),a.jsxs(X,{variant:"ghost",size:"sm",className:"text-russet hover:text-russet/90 p-0",onClick:()=>{window.location.href=`/authors/${M.slug}`},children:["View Profile ",a.jsx(xp,{className:"h-3.5 w-3.5 ml-1"})]})]})]},M.id)},G=M=>{const he=Math.floor(Math.random()*30)+1,Be=Math.floor(Math.random()*5e3);return a.jsx("div",{className:`group p-4 border border-sage/10 dark:border-sage/5 rounded-lg bg-cream dark:bg-dark-surface
|
||
hover:shadow-md transition-all duration-300
|
||
${e==="spring"?"hover:border-green-400/50":e==="summer"?"hover:border-amber-400/50":e==="autumn"?"hover:border-russet/50":"hover:border-blue-400/50"}`,children:a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"relative flex-shrink-0",children:[a.jsx("div",{className:"w-14 h-14 rounded-full overflow-hidden bg-navy/10 dark:bg-navy/20",children:a.jsx("img",{src:M.portrait||"https://via.placeholder.com/200",alt:M.name,className:"w-full h-full object-cover"})}),M.country&&a.jsx("div",{className:"absolute -bottom-1 -right-1 w-5 h-5 rounded-full bg-cream dark:bg-dark-surface border border-cream dark:border-dark-surface overflow-hidden flex items-center justify-center",children:a.jsx("img",{src:`https://flagcdn.com/w20/${M.country.toLowerCase()}.png`,alt:M.country,className:"w-full h-auto"})})]}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Ce,{href:`/authors/${M.slug}`,children:a.jsx("h3",{className:`text-lg font-serif font-semibold text-navy dark:text-cream
|
||
group-hover:text-russet dark:group-hover:text-russet/90 transition-colors`,children:M.name})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ht,{variant:"outline",className:"text-xs border-none bg-navy/10 dark:bg-navy/20",children:te[Math.floor(Math.random()*te.length)]?.name||"Romanticism"}),a.jsx(X,{variant:"ghost",size:"sm",className:"text-russet hover:text-russet/90 p-0 h-6",onClick:()=>{window.location.href=`/authors/${M.slug}`},children:a.jsx(xp,{className:"h-3.5 w-3.5"})})]})]}),a.jsxs("div",{className:"flex flex-wrap items-center text-xs text-navy/70 dark:text-cream/70 gap-x-4 gap-y-1 mt-1",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Zs,{className:"h-3 w-3"}),a.jsxs("span",{children:[M.birthYear,"–",M.deathYear||"present"]})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Gb,{className:"h-3 w-3"}),a.jsx("span",{children:M.country||"Unknown"})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Rr,{className:"h-3 w-3"}),a.jsxs("span",{children:[he," works"]})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Qs,{className:"h-3 w-3"}),a.jsxs("span",{children:[Be.toLocaleString()," followers"]})]})]}),a.jsxs("p",{className:"text-navy/80 dark:text-cream/80 text-xs mt-2 line-clamp-1",children:[M.biography?.slice(0,100)||"No biography available.",(M.biography?.length??0)>100?"...":""]})]})]})},M.id)};return a.jsx(Kt,{children:a.jsxs("div",{className:"max-w-[var(--content-width)] mx-auto px-4 md:px-6 py-8",children:[a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 mb-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl md:text-3xl font-bold font-serif text-navy dark:text-cream",children:"Authors"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70 mt-1",children:"Discover literary voices from across the ages"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Xd,{placeholder:"Search authors...",onSearch:F}),a.jsxs(F2,{open:y,onOpenChange:b,children:[a.jsx(fz,{asChild:!0,children:a.jsx(X,{variant:"outline",size:"icon",className:"shrink-0",children:a.jsx(ej,{className:"h-4 w-4"})})}),a.jsx(Y2,{children:a.jsxs("div",{className:"max-w-md mx-auto p-4",children:[a.jsxs(Z2,{children:[a.jsx(K2,{children:"Filter Authors"}),a.jsx(Q2,{children:"Narrow down the authors by specific criteria"})]}),a.jsxs("div",{className:"space-y-6 py-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium mb-2",children:"Literary Periods"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:te.map(M=>a.jsx(ht,{variant:S.includes(M.name)?"default":"outline",className:"cursor-pointer",onClick:()=>B(M.name),children:M.name},M.id))})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium mb-2",children:"Year Range"}),a.jsxs("div",{className:"px-1",children:[a.jsx(ng,{defaultValue:R,max:2023,min:1400,step:10,onValueChange:M=>T(M)}),a.jsxs("div",{className:"flex justify-between text-xs text-navy/70 dark:text-cream/70 mt-1",children:[a.jsx("span",{children:R[0]}),a.jsx("span",{children:R[1]})]})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium mb-2",children:"Countries"}),a.jsx(fk,{className:"h-40 border rounded-md p-2",children:a.jsx("div",{className:"space-y-1",children:L.map(M=>a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(is,{id:`country-${M}`,checked:w.includes(M),onCheckedChange:()=>ge(M)}),a.jsxs("label",{htmlFor:`country-${M}`,className:"text-sm flex items-center gap-1.5 cursor-pointer",children:[a.jsx("img",{src:`https://flagcdn.com/w20/${M.toLowerCase()}.png`,alt:M,className:"w-4 h-auto"}),M]})]},M))})})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium mb-2",children:"Primary Genres"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:ie.map(M=>a.jsx(ht,{variant:k.includes(M.name)?"default":"outline",className:"cursor-pointer",onClick:()=>fe(M.name),children:M.name},M.id))})]})]}),a.jsx(G2,{children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(X,{variant:"outline",onClick:ye,children:"Reset All"}),a.jsx(mz,{asChild:!0,children:a.jsx(X,{children:"Apply Filters"})})]})})]})})]})]})]}),me&&a.jsxs("div",{className:`mb-8 rounded-xl p-5 md:p-6 overflow-hidden relative
|
||
${e==="spring"?"bg-gradient-to-br from-green-50 to-blue-50 dark:from-green-950/30 dark:to-blue-950/30":e==="summer"?"bg-gradient-to-br from-amber-50 to-orange-50 dark:from-amber-950/30 dark:to-orange-950/30":e==="autumn"?"bg-gradient-to-br from-russet/10 to-amber-50 dark:from-russet/20 dark:to-amber-950/30":"bg-gradient-to-br from-blue-50 to-indigo-50 dark:from-blue-950/30 dark:to-indigo-950/30"}`,children:[a.jsxs("div",{className:"absolute inset-0 overflow-hidden opacity-10",children:[a.jsx("div",{className:"absolute -right-10 -top-10 w-40 h-40 rounded-full bg-navy/10 dark:bg-cream/10"}),a.jsx("div",{className:"absolute right-20 top-1/2 w-20 h-20 rounded-full bg-navy/10 dark:bg-cream/10"}),a.jsx("div",{className:"absolute right-1/3 bottom-5 w-16 h-16 rounded-full bg-navy/10 dark:bg-cream/10"})]}),a.jsx("div",{className:"relative",children:a.jsxs("div",{className:"flex flex-col md:flex-row items-start gap-6",children:[a.jsx("div",{className:"flex-shrink-0 w-24 h-24 md:w-32 md:h-32 rounded-lg overflow-hidden",children:a.jsx("img",{src:me.portrait||"https://via.placeholder.com/300",alt:me.name,className:"w-full h-full object-cover"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"flex items-center gap-2 mb-1",children:a.jsx(ht,{variant:"outline",className:"bg-navy/5 dark:bg-cream/5 text-navy/70 dark:text-cream/70 border-none",children:"Featured Author"})}),a.jsx("h2",{className:"text-2xl md:text-3xl font-serif font-bold text-navy dark:text-cream mb-2",children:me.name}),a.jsxs("div",{className:"flex items-center text-sm text-navy/70 dark:text-cream/70 gap-x-4 mb-3",children:[a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Zs,{className:"h-4 w-4"}),a.jsxs("span",{children:[me.birthYear,"–",me.deathYear||"present"]})]}),me.country&&a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Gb,{className:"h-4 w-4"}),a.jsx("span",{children:me.country})]})]}),a.jsx("p",{className:"text-navy/80 dark:text-cream/80 line-clamp-3 mb-4",children:me.biography}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx(Ce,{href:`/authors/${me.slug}`,children:a.jsx(X,{className:`text-white
|
||
${e==="spring"?"bg-green-500 hover:bg-green-600 dark:bg-green-700 dark:hover:bg-green-800":e==="summer"?"bg-amber-500 hover:bg-amber-600 dark:bg-amber-700 dark:hover:bg-amber-800":e==="autumn"?"bg-russet hover:bg-russet/90 dark:bg-russet/90 dark:hover:bg-russet":"bg-blue-500 hover:bg-blue-600 dark:bg-blue-700 dark:hover:bg-blue-800"}`,children:"Explore Works"})}),a.jsx(X,{variant:"outline",children:"Follow"})]})]})]})})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 mb-6",children:[a.jsx("div",{className:"w-full sm:w-auto",children:a.jsx(Ns,{defaultValue:"all",className:"w-full sm:w-auto",children:a.jsxs(_a,{className:"grid w-full sm:w-auto grid-cols-3",children:[a.jsx(gt,{value:"all",className:"text-sm",children:"All Authors"}),a.jsx(gt,{value:"alphabetical",className:"text-sm",children:"Alphabetical"}),a.jsx(gt,{value:"chronological",className:"text-sm",children:"Chronological"})]})})}),a.jsxs("div",{className:"flex items-center gap-3 w-full sm:w-auto",children:[a.jsxs("div",{className:"flex items-center gap-1 text-sm text-navy/70 dark:text-cream/70",children:[a.jsx(_n,{htmlFor:"sort-by",className:"sr-only",children:"Sort by"}),a.jsxs(Bn,{value:f,onValueChange:M=>m(M),children:[a.jsx(Mn,{id:"sort-by",className:"w-[140px] h-9 text-xs",children:a.jsx(Vn,{placeholder:"Sort by"})}),a.jsxs(Dn,{children:[a.jsx(Qe,{value:"name",children:"Name"}),a.jsx(Qe,{value:"birth",children:"Birth Year"}),a.jsx(Qe,{value:"popularity",children:"Popularity"})]})]}),a.jsx(X,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:_,children:p==="asc"?a.jsx(DT,{className:"h-4 w-4"}):a.jsx(_T,{className:"h-4 w-4"})})]}),a.jsx(fd,{orientation:"vertical",className:"h-8 hidden sm:block"}),a.jsxs("div",{className:"flex items-center",children:[a.jsx(Gr,{children:a.jsxs(ja,{children:[a.jsx(Na,{asChild:!0,children:a.jsx(X,{variant:u==="list"?"default":"ghost",size:"icon",className:"h-9 w-9",onClick:()=>d("list"),children:a.jsx(s_,{className:"h-4 w-4"})})}),a.jsx(Kr,{children:a.jsx("p",{children:"List view"})})]})}),a.jsx(Gr,{children:a.jsxs(ja,{children:[a.jsx(Na,{asChild:!0,children:a.jsx(X,{variant:u==="grid"?"default":"ghost",size:"icon",className:"h-9 w-9",onClick:()=>d("grid"),children:a.jsx(a_,{className:"h-4 w-4"})})}),a.jsx(Kr,{children:a.jsx("p",{children:"Grid view"})})]})})]})]})]}),(S.length>0||w.length>0||k.length>0)&&a.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-6 p-3 bg-navy/5 dark:bg-navy/10 rounded-md",children:[a.jsx("span",{className:"text-sm font-medium text-navy/70 dark:text-cream/70",children:"Active filters:"}),S.map(M=>a.jsxs(ht,{variant:"secondary",className:"flex items-center gap-1",children:[a.jsx(tj,{className:"h-3 w-3"}),M,a.jsx("button",{className:"ml-1 hover:text-navy dark:hover:text-cream",onClick:()=>B(M),children:"×"})]},`period-${M}`)),w.map(M=>a.jsxs(ht,{variant:"secondary",className:"flex items-center gap-1",children:[a.jsx(GT,{className:"h-3 w-3"}),M,a.jsx("button",{className:"ml-1 hover:text-navy dark:hover:text-cream",onClick:()=>ge(M),children:"×"})]},`country-${M}`)),k.map(M=>a.jsxs(ht,{variant:"secondary",className:"flex items-center gap-1",children:[a.jsx(Rr,{className:"h-3 w-3"}),M,a.jsx("button",{className:"ml-1 hover:text-navy dark:hover:text-cream",onClick:()=>fe(M),children:"×"})]},`genre-${M}`)),a.jsx(X,{variant:"link",size:"sm",className:"text-russet hover:text-russet/90 h-6 p-0 ml-auto",onClick:ye,children:"Clear all"})]}),J?a.jsx("div",{className:`grid gap-6 ${u==="grid"?"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4":"grid-cols-1"}`,children:Array.from({length:$}).map((M,he)=>a.jsx(Oe,{className:"bg-cream dark:bg-dark-surface",children:a.jsxs(Ve,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[a.jsx("div",{className:"w-16 h-16 rounded-full bg-navy/10 dark:bg-navy/20 animate-pulse"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"h-5 bg-navy/10 dark:bg-navy/20 rounded-md w-3/4 mb-2 animate-pulse"}),a.jsx("div",{className:"h-4 bg-navy/10 dark:bg-navy/20 rounded-md w-1/2 animate-pulse"})]})]}),a.jsx("div",{className:"h-20 bg-navy/10 dark:bg-navy/20 rounded-md animate-pulse"})]})},he))}):u==="grid"?a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:O.map(M=>_e(M))}):a.jsx("div",{className:"space-y-4",children:O.map(M=>G(M))}),de>1&&a.jsx("div",{className:"mt-8 flex justify-center",children:a.jsxs("nav",{className:"flex items-center gap-1","aria-label":"Pagination",children:[a.jsxs(X,{variant:"ghost",size:"icon",onClick:()=>Q(Math.max(1,t-1)),disabled:t===1,children:[a.jsx(Xl,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Previous"})]}),[...Array(Math.min(5,de))].map((M,he)=>{const Be=he+1;return a.jsx(X,{variant:t===Be?"default":"ghost",size:"sm",onClick:()=>Q(Be),children:Be},Be)}),de>5&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"px-2 text-navy/60 dark:text-cream/60",children:"..."}),a.jsx(X,{variant:"ghost",size:"sm",onClick:()=>Q(de),children:de})]}),a.jsxs(X,{variant:"ghost",size:"icon",onClick:()=>Q(Math.min(de,t+1)),disabled:t===de,children:[a.jsx(Ad,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Next"})]})]})})]})})}var lc=e=>e.type==="checkbox",Fs=e=>e instanceof Date,Tn=e=>e==null;const _k=e=>typeof e=="object";var Bt=e=>!Tn(e)&&!Array.isArray(e)&&_k(e)&&!Fs(e),Mk=e=>Bt(e)&&e.target?lc(e.target)?e.target.checked:e.target.value:e,Wz=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Dk=(e,t)=>e.has(Wz(t)),Jz=e=>{const t=e.constructor&&e.constructor.prototype;return Bt(t)&&t.hasOwnProperty("isPrototypeOf")},rg=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function en(e){let t;const r=Array.isArray(e),o=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(rg&&(e instanceof Blob||o))&&(r||Bt(e)))if(t=r?[]:Object.create(Object.getPrototypeOf(e)),!r&&!Jz(e))t=e;else for(const l in e)e.hasOwnProperty(l)&&(t[l]=en(e[l]));else return e;return t}var cf=e=>/^\w*$/.test(e),Ut=e=>e===void 0,ag=e=>Array.isArray(e)?e.filter(Boolean):[],sg=e=>ag(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ke=(e,t,r)=>{if(!t||!Bt(e))return r;const o=(cf(t)?[t]:sg(t)).reduce((l,u)=>Tn(l)?l:l[u],e);return Ut(o)||o===e?Ut(e[t])?r:e[t]:o},Wn=e=>typeof e=="boolean",dt=(e,t,r)=>{let o=-1;const l=cf(t)?[t]:sg(t),u=l.length,d=u-1;for(;++o<u;){const f=l[o];let m=r;if(o!==d){const p=e[f];m=Bt(p)||Array.isArray(p)?p:isNaN(+l[o+1])?{}:[]}if(f==="__proto__"||f==="constructor"||f==="prototype")return;e[f]=m,e=e[f]}};const hd={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Cr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ba={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},og=ae.createContext(null);og.displayName="HookFormContext";const ji=()=>ae.useContext(og),e8=e=>{const{children:t,...r}=e;return ae.createElement(og.Provider,{value:r},t)};var Ok=(e,t,r,o=!0)=>{const l={defaultValues:t._defaultValues};for(const u in e)Object.defineProperty(l,u,{get:()=>{const d=u;return t._proxyFormState[d]!==Cr.all&&(t._proxyFormState[d]=!o||Cr.all),r&&(r[d]=!0),e[d]}});return l};const ig=typeof window<"u"?ae.useLayoutEffect:ae.useEffect;function t8(e){const t=ji(),{control:r=t.control,disabled:o,name:l,exact:u}=e||{},[d,f]=ae.useState(r._formState),m=ae.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return ig(()=>r._subscribe({name:l,formState:m.current,exact:u,callback:p=>{!o&&f({...r._formState,...p})}}),[l,o,u]),ae.useEffect(()=>{m.current.isValid&&r._setValid(!0)},[r]),ae.useMemo(()=>Ok(d,r,m.current,!1),[d,r])}var Yr=e=>typeof e=="string",zk=(e,t,r,o,l)=>Yr(e)?(o&&t.watch.add(e),ke(r,e,l)):Array.isArray(e)?e.map(u=>(o&&t.watch.add(u),ke(r,u))):(o&&(t.watchAll=!0),r),$p=e=>Tn(e)||!_k(e);function wa(e,t,r=new WeakSet){if($p(e)||$p(t))return e===t;if(Fs(e)&&Fs(t))return e.getTime()===t.getTime();const o=Object.keys(e),l=Object.keys(t);if(o.length!==l.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const u of o){const d=e[u];if(!l.includes(u))return!1;if(u!=="ref"){const f=t[u];if(Fs(d)&&Fs(f)||Bt(d)&&Bt(f)||Array.isArray(d)&&Array.isArray(f)?!wa(d,f,r):d!==f)return!1}}return!0}function n8(e){const t=ji(),{control:r=t.control,name:o,defaultValue:l,disabled:u,exact:d,compute:f}=e||{},m=ae.useRef(l),p=ae.useRef(f),v=ae.useRef(void 0);p.current=f;const y=ae.useMemo(()=>r._getWatch(o,m.current),[r,o]),[b,S]=ae.useState(p.current?p.current(y):y);return ig(()=>r._subscribe({name:o,formState:{values:!0},exact:d,callback:N=>{if(!u){const w=zk(o,r._names,N.values||r._formValues,!1,m.current);if(p.current){const C=p.current(w);wa(C,v.current)||(S(C),v.current=C)}else S(w)}}}),[r,u,o,d]),ae.useEffect(()=>r._removeUnmounted()),b}function r8(e){const t=ji(),{name:r,disabled:o,control:l=t.control,shouldUnregister:u,defaultValue:d}=e,f=Dk(l._names.array,r),m=ae.useMemo(()=>ke(l._formValues,r,ke(l._defaultValues,r,d)),[l,r,d]),p=n8({control:l,name:r,defaultValue:m,exact:!0}),v=t8({control:l,name:r,exact:!0}),y=ae.useRef(e),b=ae.useRef(l.register(r,{...e.rules,value:p,...Wn(e.disabled)?{disabled:e.disabled}:{}}));y.current=e;const S=ae.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ke(v.errors,r)},isDirty:{enumerable:!0,get:()=>!!ke(v.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!ke(v.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!ke(v.validatingFields,r)},error:{enumerable:!0,get:()=>ke(v.errors,r)}}),[v,r]),N=ae.useCallback(E=>b.current.onChange({target:{value:Mk(E),name:r},type:hd.CHANGE}),[r]),w=ae.useCallback(()=>b.current.onBlur({target:{value:ke(l._formValues,r),name:r},type:hd.BLUR}),[r,l._formValues]),C=ae.useCallback(E=>{const R=ke(l._fields,r);R&&E&&(R._f.ref={focus:()=>E.focus&&E.focus(),select:()=>E.select&&E.select(),setCustomValidity:T=>E.setCustomValidity(T),reportValidity:()=>E.reportValidity()})},[l._fields,r]),k=ae.useMemo(()=>({name:r,value:p,...Wn(o)||v.disabled?{disabled:v.disabled||o}:{},onChange:N,onBlur:w,ref:C}),[r,o,v.disabled,N,w,C,p]);return ae.useEffect(()=>{const E=l._options.shouldUnregister||u;l.register(r,{...y.current.rules,...Wn(y.current.disabled)?{disabled:y.current.disabled}:{}});const R=(T,z)=>{const ne=ke(l._fields,T);ne&&ne._f&&(ne._f.mount=z)};if(R(r,!0),E){const T=en(ke(l._options.defaultValues,r));dt(l._defaultValues,r,T),Ut(ke(l._formValues,r))&&dt(l._formValues,r,T)}return!f&&l.register(r),()=>{(f?E&&!l._state.action:E)?l.unregister(r):R(r,!1)}},[r,l,f,u]),ae.useEffect(()=>{l._setDisabledField({disabled:o,name:r})},[o,r,l]),ae.useMemo(()=>({field:k,formState:v,fieldState:S}),[k,v,S])}const a8=e=>e.render(r8(e));var Pk=(e,t,r,o,l)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[o]:l||!0}}:{},Dl=e=>Array.isArray(e)?e:[e],Ow=()=>{let e=[];return{get observers(){return e},next:l=>{for(const u of e)u.next&&u.next(l)},subscribe:l=>(e.push(l),{unsubscribe:()=>{e=e.filter(u=>u!==l)}}),unsubscribe:()=>{e=[]}}},Un=e=>Bt(e)&&!Object.keys(e).length,lg=e=>e.type==="file",Er=e=>typeof e=="function",md=e=>{if(!rg)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Lk=e=>e.type==="select-multiple",cg=e=>e.type==="radio",s8=e=>cg(e)||lc(e),sp=e=>md(e)&&e.isConnected;function o8(e,t){const r=t.slice(0,-1).length;let o=0;for(;o<r;)e=Ut(e)?o++:e[t[o++]];return e}function i8(e){for(const t in e)if(e.hasOwnProperty(t)&&!Ut(e[t]))return!1;return!0}function Yt(e,t){const r=Array.isArray(t)?t:cf(t)?[t]:sg(t),o=r.length===1?e:o8(e,r),l=r.length-1,u=r[l];return o&&delete o[u],l!==0&&(Bt(o)&&Un(o)||Array.isArray(o)&&i8(o))&&Yt(e,r.slice(0,-1)),e}var $k=e=>{for(const t in e)if(Er(e[t]))return!0;return!1};function pd(e,t={}){const r=Array.isArray(e);if(Bt(e)||r)for(const o in e)Array.isArray(e[o])||Bt(e[o])&&!$k(e[o])?(t[o]=Array.isArray(e[o])?[]:{},pd(e[o],t[o])):Tn(e[o])||(t[o]=!0);return t}function Ik(e,t,r){const o=Array.isArray(e);if(Bt(e)||o)for(const l in e)Array.isArray(e[l])||Bt(e[l])&&!$k(e[l])?Ut(t)||$p(r[l])?r[l]=Array.isArray(e[l])?pd(e[l],[]):{...pd(e[l])}:Ik(e[l],Tn(t)?{}:t[l],r[l]):r[l]=!wa(e[l],t[l]);return r}var Sl=(e,t)=>Ik(e,t,pd(t));const zw={value:!1,isValid:!1},Pw={value:!0,isValid:!0};var Uk=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&&!Ut(e[0].attributes.value)?Ut(e[0].value)||e[0].value===""?Pw:{value:e[0].value,isValid:!0}:Pw:zw}return zw},Bk=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:o})=>Ut(e)?e:t?e===""?NaN:e&&+e:r&&Yr(e)?new Date(e):o?o(e):e;const Lw={isValid:!1,value:null};var Vk=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,Lw):Lw;function $w(e){const t=e.ref;return lg(t)?t.files:cg(t)?Vk(e.refs).value:Lk(t)?[...t.selectedOptions].map(({value:r})=>r):lc(t)?Uk(e.refs).value:Bk(Ut(t.value)?e.ref.value:t.value,e)}var l8=(e,t,r,o)=>{const l={};for(const u of e){const d=ke(t,u);d&&dt(l,u,d._f)}return{criteriaMode:r,names:[...e],fields:l,shouldUseNativeValidation:o}},xd=e=>e instanceof RegExp,kl=e=>Ut(e)?e:xd(e)?e.source:Bt(e)?xd(e.value)?e.value.source:e.value:e,Iw=e=>({isOnSubmit:!e||e===Cr.onSubmit,isOnBlur:e===Cr.onBlur,isOnChange:e===Cr.onChange,isOnAll:e===Cr.all,isOnTouch:e===Cr.onTouched});const Uw="AsyncFunction";var c8=e=>!!e&&!!e.validate&&!!(Er(e.validate)&&e.validate.constructor.name===Uw||Bt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Uw)),u8=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Bw=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(o=>e.startsWith(o)&&/^\.\w+/.test(e.slice(o.length))));const Ol=(e,t,r,o)=>{for(const l of r||Object.keys(e)){const u=ke(e,l);if(u){const{_f:d,...f}=u;if(d){if(d.refs&&d.refs[0]&&t(d.refs[0],l)&&!o)return!0;if(d.ref&&t(d.ref,d.name)&&!o)return!0;if(Ol(f,t))break}else if(Bt(f)&&Ol(f,t))break}}};function Vw(e,t,r){const o=ke(e,r);if(o||cf(r))return{error:o,name:r};const l=r.split(".");for(;l.length;){const u=l.join("."),d=ke(t,u),f=ke(e,u);if(d&&!Array.isArray(d)&&r!==u)return{name:r};if(f&&f.type)return{name:u,error:f};if(f&&f.root&&f.root.type)return{name:`${u}.root`,error:f.root};l.pop()}return{name:r}}var d8=(e,t,r,o)=>{r(e);const{name:l,...u}=e;return Un(u)||Object.keys(u).length>=Object.keys(t).length||Object.keys(u).find(d=>t[d]===(!o||Cr.all))},f8=(e,t,r)=>!e||!t||e===t||Dl(e).some(o=>o&&(r?o===t:o.startsWith(t)||t.startsWith(o))),h8=(e,t,r,o,l)=>l.isOnAll?!1:!r&&l.isOnTouch?!(t||e):(r?o.isOnBlur:l.isOnBlur)?!e:(r?o.isOnChange:l.isOnChange)?e:!0,m8=(e,t)=>!ag(ke(e,t)).length&&Yt(e,t),p8=(e,t,r)=>{const o=Dl(ke(e,r));return dt(o,"root",t[r]),dt(e,r,o),e},qu=e=>Yr(e);function Hw(e,t,r="validate"){if(qu(e)||Array.isArray(e)&&e.every(qu)||Wn(e)&&!e)return{type:r,message:qu(e)?e:"",ref:t}}var Xo=e=>Bt(e)&&!xd(e)?e:{value:e,message:""},Fw=async(e,t,r,o,l,u)=>{const{ref:d,refs:f,required:m,maxLength:p,minLength:v,min:y,max:b,pattern:S,validate:N,name:w,valueAsNumber:C,mount:k}=e._f,E=ke(r,w);if(!k||t.has(w))return{};const R=f?f[0]:d,T=te=>{l&&R.reportValidity&&(R.setCustomValidity(Wn(te)?"":te||""),R.reportValidity())},z={},ne=cg(d),$=lc(d),V=ne||$,J=(C||lg(d))&&Ut(d.value)&&Ut(E)||md(d)&&d.value===""||E===""||Array.isArray(E)&&!E.length,se=Pk.bind(null,w,o,z),ie=(te,q,de,me=ba.maxLength,O=ba.minLength)=>{const L=te?q:de;z[w]={type:te?me:O,message:L,ref:d,...se(te?me:O,L)}};if(u?!Array.isArray(E)||!E.length:m&&(!V&&(J||Tn(E))||Wn(E)&&!E||$&&!Uk(f).isValid||ne&&!Vk(f).isValid)){const{value:te,message:q}=qu(m)?{value:!!m,message:m}:Xo(m);if(te&&(z[w]={type:ba.required,message:q,ref:R,...se(ba.required,q)},!o))return T(q),z}if(!J&&(!Tn(y)||!Tn(b))){let te,q;const de=Xo(b),me=Xo(y);if(!Tn(E)&&!isNaN(E)){const O=d.valueAsNumber||E&&+E;Tn(de.value)||(te=O>de.value),Tn(me.value)||(q=O<me.value)}else{const O=d.valueAsDate||new Date(E),L=_=>new Date(new Date().toDateString()+" "+_),F=d.type=="time",Q=d.type=="week";Yr(de.value)&&E&&(te=F?L(E)>L(de.value):Q?E>de.value:O>new Date(de.value)),Yr(me.value)&&E&&(q=F?L(E)<L(me.value):Q?E<me.value:O<new Date(me.value))}if((te||q)&&(ie(!!te,de.message,me.message,ba.max,ba.min),!o))return T(z[w].message),z}if((p||v)&&!J&&(Yr(E)||u&&Array.isArray(E))){const te=Xo(p),q=Xo(v),de=!Tn(te.value)&&E.length>+te.value,me=!Tn(q.value)&&E.length<+q.value;if((de||me)&&(ie(de,te.message,q.message),!o))return T(z[w].message),z}if(S&&!J&&Yr(E)){const{value:te,message:q}=Xo(S);if(xd(te)&&!E.match(te)&&(z[w]={type:ba.pattern,message:q,ref:d,...se(ba.pattern,q)},!o))return T(q),z}if(N){if(Er(N)){const te=await N(E,r),q=Hw(te,R);if(q&&(z[w]={...q,...se(ba.validate,q.message)},!o))return T(q.message),z}else if(Bt(N)){let te={};for(const q in N){if(!Un(te)&&!o)break;const de=Hw(await N[q](E,r),R,q);de&&(te={...de,...se(q,de.message)},T(de.message),o&&(z[w]=te))}if(!Un(te)&&(z[w]={ref:R,...te},!o))return z}}return T(!0),z};const x8={mode:Cr.onSubmit,reValidateMode:Cr.onChange,shouldFocusError:!0};function g8(e={}){let t={...x8,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:Er(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},o={},l=Bt(t.defaultValues)||Bt(t.values)?en(t.defaultValues||t.values)||{}:{},u=t.shouldUnregister?{}:en(l),d={action:!1,mount:!1,watch:!1},f={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},m,p=0;const v={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let y={...v};const b={array:Ow(),state:Ow()},S=t.criteriaMode===Cr.all,N=P=>Z=>{clearTimeout(p),p=setTimeout(P,Z)},w=async P=>{if(!t.disabled&&(v.isValid||y.isValid||P)){const Z=t.resolver?Un((await $()).errors):await J(o,!0);Z!==r.isValid&&b.state.next({isValid:Z})}},C=(P,Z)=>{!t.disabled&&(v.isValidating||v.validatingFields||y.isValidating||y.validatingFields)&&((P||Array.from(f.mount)).forEach(re=>{re&&(Z?dt(r.validatingFields,re,Z):Yt(r.validatingFields,re))}),b.state.next({validatingFields:r.validatingFields,isValidating:!Un(r.validatingFields)}))},k=(P,Z=[],re,Ne,xe=!0,ve=!0)=>{if(Ne&&re&&!t.disabled){if(d.action=!0,ve&&Array.isArray(ke(o,P))){const Se=re(ke(o,P),Ne.argA,Ne.argB);xe&&dt(o,P,Se)}if(ve&&Array.isArray(ke(r.errors,P))){const Se=re(ke(r.errors,P),Ne.argA,Ne.argB);xe&&dt(r.errors,P,Se),m8(r.errors,P)}if((v.touchedFields||y.touchedFields)&&ve&&Array.isArray(ke(r.touchedFields,P))){const Se=re(ke(r.touchedFields,P),Ne.argA,Ne.argB);xe&&dt(r.touchedFields,P,Se)}(v.dirtyFields||y.dirtyFields)&&(r.dirtyFields=Sl(l,u)),b.state.next({name:P,isDirty:ie(P,Z),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else dt(u,P,Z)},E=(P,Z)=>{dt(r.errors,P,Z),b.state.next({errors:r.errors})},R=P=>{r.errors=P,b.state.next({errors:r.errors,isValid:!1})},T=(P,Z,re,Ne)=>{const xe=ke(o,P);if(xe){const ve=ke(u,P,Ut(re)?ke(l,P):re);Ut(ve)||Ne&&Ne.defaultChecked||Z?dt(u,P,Z?ve:$w(xe._f)):de(P,ve),d.mount&&w()}},z=(P,Z,re,Ne,xe)=>{let ve=!1,Se=!1;const Me={name:P};if(!t.disabled){if(!re||Ne){(v.isDirty||y.isDirty)&&(Se=r.isDirty,r.isDirty=Me.isDirty=ie(),ve=Se!==Me.isDirty);const qe=wa(ke(l,P),Z);Se=!!ke(r.dirtyFields,P),qe?Yt(r.dirtyFields,P):dt(r.dirtyFields,P,!0),Me.dirtyFields=r.dirtyFields,ve=ve||(v.dirtyFields||y.dirtyFields)&&Se!==!qe}if(re){const qe=ke(r.touchedFields,P);qe||(dt(r.touchedFields,P,re),Me.touchedFields=r.touchedFields,ve=ve||(v.touchedFields||y.touchedFields)&&qe!==re)}ve&&xe&&b.state.next(Me)}return ve?Me:{}},ne=(P,Z,re,Ne)=>{const xe=ke(r.errors,P),ve=(v.isValid||y.isValid)&&Wn(Z)&&r.isValid!==Z;if(t.delayError&&re?(m=N(()=>E(P,re)),m(t.delayError)):(clearTimeout(p),m=null,re?dt(r.errors,P,re):Yt(r.errors,P)),(re?!wa(xe,re):xe)||!Un(Ne)||ve){const Se={...Ne,...ve&&Wn(Z)?{isValid:Z}:{},errors:r.errors,name:P};r={...r,...Se},b.state.next(Se)}},$=async P=>{C(P,!0);const Z=await t.resolver(u,t.context,l8(P||f.mount,o,t.criteriaMode,t.shouldUseNativeValidation));return C(P),Z},V=async P=>{const{errors:Z}=await $(P);if(P)for(const re of P){const Ne=ke(Z,re);Ne?dt(r.errors,re,Ne):Yt(r.errors,re)}else r.errors=Z;return Z},J=async(P,Z,re={valid:!0})=>{for(const Ne in P){const xe=P[Ne];if(xe){const{_f:ve,...Se}=xe;if(ve){const Me=f.array.has(ve.name),qe=xe._f&&c8(xe._f);qe&&v.validatingFields&&C([Ne],!0);const at=await Fw(xe,f.disabled,u,S,t.shouldUseNativeValidation&&!Z,Me);if(qe&&v.validatingFields&&C([Ne]),at[ve.name]&&(re.valid=!1,Z))break;!Z&&(ke(at,ve.name)?Me?p8(r.errors,at,ve.name):dt(r.errors,ve.name,at[ve.name]):Yt(r.errors,ve.name))}!Un(Se)&&await J(Se,Z,re)}}return re.valid},se=()=>{for(const P of f.unMount){const Z=ke(o,P);Z&&(Z._f.refs?Z._f.refs.every(re=>!sp(re)):!sp(Z._f.ref))&&M(P)}f.unMount=new Set},ie=(P,Z)=>!t.disabled&&(P&&Z&&dt(u,P,Z),!wa(_(),l)),te=(P,Z,re)=>zk(P,f,{...d.mount?u:Ut(Z)?l:Yr(P)?{[P]:Z}:Z},re,Z),q=P=>ag(ke(d.mount?u:l,P,t.shouldUnregister?ke(l,P,[]):[])),de=(P,Z,re={})=>{const Ne=ke(o,P);let xe=Z;if(Ne){const ve=Ne._f;ve&&(!ve.disabled&&dt(u,P,Bk(Z,ve)),xe=md(ve.ref)&&Tn(Z)?"":Z,Lk(ve.ref)?[...ve.ref.options].forEach(Se=>Se.selected=xe.includes(Se.value)):ve.refs?lc(ve.ref)?ve.refs.forEach(Se=>{(!Se.defaultChecked||!Se.disabled)&&(Array.isArray(xe)?Se.checked=!!xe.find(Me=>Me===Se.value):Se.checked=xe===Se.value||!!xe)}):ve.refs.forEach(Se=>Se.checked=Se.value===xe):lg(ve.ref)?ve.ref.value="":(ve.ref.value=xe,ve.ref.type||b.state.next({name:P,values:en(u)})))}(re.shouldDirty||re.shouldTouch)&&z(P,xe,re.shouldTouch,re.shouldDirty,!0),re.shouldValidate&&Q(P)},me=(P,Z,re)=>{for(const Ne in Z){if(!Z.hasOwnProperty(Ne))return;const xe=Z[Ne],ve=P+"."+Ne,Se=ke(o,ve);(f.array.has(P)||Bt(xe)||Se&&!Se._f)&&!Fs(xe)?me(ve,xe,re):de(ve,xe,re)}},O=(P,Z,re={})=>{const Ne=ke(o,P),xe=f.array.has(P),ve=en(Z);dt(u,P,ve),xe?(b.array.next({name:P,values:en(u)}),(v.isDirty||v.dirtyFields||y.isDirty||y.dirtyFields)&&re.shouldDirty&&b.state.next({name:P,dirtyFields:Sl(l,u),isDirty:ie(P,ve)})):Ne&&!Ne._f&&!Tn(ve)?me(P,ve,re):de(P,ve,re),Bw(P,f)&&b.state.next({...r,name:P}),b.state.next({name:d.mount?P:void 0,values:en(u)})},L=async P=>{d.mount=!0;const Z=P.target;let re=Z.name,Ne=!0;const xe=ke(o,re),ve=qe=>{Ne=Number.isNaN(qe)||Fs(qe)&&isNaN(qe.getTime())||wa(qe,ke(u,re,qe))},Se=Iw(t.mode),Me=Iw(t.reValidateMode);if(xe){let qe,at;const ar=Z.type?$w(xe._f):Mk(P),zn=P.type===hd.BLUR||P.type===hd.FOCUS_OUT,br=!u8(xe._f)&&!t.resolver&&!ke(r.errors,re)&&!xe._f.deps||h8(zn,ke(r.touchedFields,re),r.isSubmitted,Me,Se),Sn=Bw(re,f,zn);dt(u,re,ar),zn?(!Z||!Z.readOnly)&&(xe._f.onBlur&&xe._f.onBlur(P),m&&m(0)):xe._f.onChange&&xe._f.onChange(P);const Pr=z(re,ar,zn),wr=!Un(Pr)||Sn;if(!zn&&b.state.next({name:re,type:P.type,values:en(u)}),br)return(v.isValid||y.isValid)&&(t.mode==="onBlur"?zn&&w():zn||w()),wr&&b.state.next({name:re,...Sn?{}:Pr});if(!zn&&Sn&&b.state.next({...r}),t.resolver){const{errors:na}=await $([re]);if(ve(ar),Ne){const ra=Vw(r.errors,o,re),io=Vw(na,o,ra.name||re);qe=io.error,re=io.name,at=Un(na)}}else C([re],!0),qe=(await Fw(xe,f.disabled,u,S,t.shouldUseNativeValidation))[re],C([re]),ve(ar),Ne&&(qe?at=!1:(v.isValid||y.isValid)&&(at=await J(o,!0)));Ne&&(xe._f.deps&&Q(xe._f.deps),ne(re,at,qe,Pr))}},F=(P,Z)=>{if(ke(r.errors,Z)&&P.focus)return P.focus(),1},Q=async(P,Z={})=>{let re,Ne;const xe=Dl(P);if(t.resolver){const ve=await V(Ut(P)?P:xe);re=Un(ve),Ne=P?!xe.some(Se=>ke(ve,Se)):re}else P?(Ne=(await Promise.all(xe.map(async ve=>{const Se=ke(o,ve);return await J(Se&&Se._f?{[ve]:Se}:Se)}))).every(Boolean),!(!Ne&&!r.isValid)&&w()):Ne=re=await J(o);return b.state.next({...!Yr(P)||(v.isValid||y.isValid)&&re!==r.isValid?{}:{name:P},...t.resolver||!P?{isValid:re}:{},errors:r.errors}),Z.shouldFocus&&!Ne&&Ol(o,F,P?xe:f.mount),Ne},_=P=>{const Z={...d.mount?u:l};return Ut(P)?Z:Yr(P)?ke(Z,P):P.map(re=>ke(Z,re))},B=(P,Z)=>({invalid:!!ke((Z||r).errors,P),isDirty:!!ke((Z||r).dirtyFields,P),error:ke((Z||r).errors,P),isValidating:!!ke(r.validatingFields,P),isTouched:!!ke((Z||r).touchedFields,P)}),ge=P=>{P&&Dl(P).forEach(Z=>Yt(r.errors,Z)),b.state.next({errors:P?r.errors:{}})},fe=(P,Z,re)=>{const Ne=(ke(o,P,{_f:{}})._f||{}).ref,xe=ke(r.errors,P)||{},{ref:ve,message:Se,type:Me,...qe}=xe;dt(r.errors,P,{...qe,...Z,ref:Ne}),b.state.next({name:P,errors:r.errors,isValid:!1}),re&&re.shouldFocus&&Ne&&Ne.focus&&Ne.focus()},ye=(P,Z)=>Er(P)?b.state.subscribe({next:re=>"values"in re&&P(te(void 0,Z),re)}):te(P,Z,!0),_e=P=>b.state.subscribe({next:Z=>{f8(P.name,Z.name,P.exact)&&d8(Z,P.formState||v,Nt,P.reRenderRoot)&&P.callback({values:{...u},...r,...Z,defaultValues:l})}}).unsubscribe,G=P=>(d.mount=!0,y={...y,...P.formState},_e({...P,formState:y})),M=(P,Z={})=>{for(const re of P?Dl(P):f.mount)f.mount.delete(re),f.array.delete(re),Z.keepValue||(Yt(o,re),Yt(u,re)),!Z.keepError&&Yt(r.errors,re),!Z.keepDirty&&Yt(r.dirtyFields,re),!Z.keepTouched&&Yt(r.touchedFields,re),!Z.keepIsValidating&&Yt(r.validatingFields,re),!t.shouldUnregister&&!Z.keepDefaultValue&&Yt(l,re);b.state.next({values:en(u)}),b.state.next({...r,...Z.keepDirty?{isDirty:ie()}:{}}),!Z.keepIsValid&&w()},he=({disabled:P,name:Z})=>{(Wn(P)&&d.mount||P||f.disabled.has(Z))&&(P?f.disabled.add(Z):f.disabled.delete(Z))},Be=(P,Z={})=>{let re=ke(o,P);const Ne=Wn(Z.disabled)||Wn(t.disabled);return dt(o,P,{...re||{},_f:{...re&&re._f?re._f:{ref:{name:P}},name:P,mount:!0,...Z}}),f.mount.add(P),re?he({disabled:Wn(Z.disabled)?Z.disabled:t.disabled,name:P}):T(P,!0,Z.value),{...Ne?{disabled:Z.disabled||t.disabled}:{},...t.progressive?{required:!!Z.required,min:kl(Z.min),max:kl(Z.max),minLength:kl(Z.minLength),maxLength:kl(Z.maxLength),pattern:kl(Z.pattern)}:{},name:P,onChange:L,onBlur:L,ref:xe=>{if(xe){Be(P,Z),re=ke(o,P);const ve=Ut(xe.value)&&xe.querySelectorAll&&xe.querySelectorAll("input,select,textarea")[0]||xe,Se=s8(ve),Me=re._f.refs||[];if(Se?Me.find(qe=>qe===ve):ve===re._f.ref)return;dt(o,P,{_f:{...re._f,...Se?{refs:[...Me.filter(sp),ve,...Array.isArray(ke(l,P))?[{}]:[]],ref:{type:ve.type,name:P}}:{ref:ve}}}),T(P,!1,void 0,ve)}else re=ke(o,P,{}),re._f&&(re._f.mount=!1),(t.shouldUnregister||Z.shouldUnregister)&&!(Dk(f.array,P)&&d.action)&&f.unMount.add(P)}}},He=()=>t.shouldFocusError&&Ol(o,F,f.mount),pe=P=>{Wn(P)&&(b.state.next({disabled:P}),Ol(o,(Z,re)=>{const Ne=ke(o,re);Ne&&(Z.disabled=Ne._f.disabled||P,Array.isArray(Ne._f.refs)&&Ne._f.refs.forEach(xe=>{xe.disabled=Ne._f.disabled||P}))},0,!1))},Re=(P,Z)=>async re=>{let Ne;re&&(re.preventDefault&&re.preventDefault(),re.persist&&re.persist());let xe=en(u);if(b.state.next({isSubmitting:!0}),t.resolver){const{errors:ve,values:Se}=await $();r.errors=ve,xe=en(Se)}else await J(o);if(f.disabled.size)for(const ve of f.disabled)Yt(xe,ve);if(Yt(r.errors,"root"),Un(r.errors)){b.state.next({errors:{}});try{await P(xe,re)}catch(ve){Ne=ve}}else Z&&await Z({...r.errors},re),He(),setTimeout(He);if(b.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Un(r.errors)&&!Ne,submitCount:r.submitCount+1,errors:r.errors}),Ne)throw Ne},Ye=(P,Z={})=>{ke(o,P)&&(Ut(Z.defaultValue)?O(P,en(ke(l,P))):(O(P,Z.defaultValue),dt(l,P,en(Z.defaultValue))),Z.keepTouched||Yt(r.touchedFields,P),Z.keepDirty||(Yt(r.dirtyFields,P),r.isDirty=Z.defaultValue?ie(P,en(ke(l,P))):ie()),Z.keepError||(Yt(r.errors,P),v.isValid&&w()),b.state.next({...r}))},Ae=(P,Z={})=>{const re=P?en(P):l,Ne=en(re),xe=Un(P),ve=xe?l:Ne;if(Z.keepDefaultValues||(l=re),!Z.keepValues){if(Z.keepDirtyValues){const Se=new Set([...f.mount,...Object.keys(Sl(l,u))]);for(const Me of Array.from(Se))ke(r.dirtyFields,Me)?dt(ve,Me,ke(u,Me)):O(Me,ke(ve,Me))}else{if(rg&&Ut(P))for(const Se of f.mount){const Me=ke(o,Se);if(Me&&Me._f){const qe=Array.isArray(Me._f.refs)?Me._f.refs[0]:Me._f.ref;if(md(qe)){const at=qe.closest("form");if(at){at.reset();break}}}}if(Z.keepFieldsRef)for(const Se of f.mount)O(Se,ke(ve,Se));else o={}}u=t.shouldUnregister?Z.keepDefaultValues?en(l):{}:en(ve),b.array.next({values:{...ve}}),b.state.next({values:{...ve}})}f={mount:Z.keepDirtyValues?f.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},d.mount=!v.isValid||!!Z.keepIsValid||!!Z.keepDirtyValues,d.watch=!!t.shouldUnregister,b.state.next({submitCount:Z.keepSubmitCount?r.submitCount:0,isDirty:xe?!1:Z.keepDirty?r.isDirty:!!(Z.keepDefaultValues&&!wa(P,l)),isSubmitted:Z.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:xe?{}:Z.keepDirtyValues?Z.keepDefaultValues&&u?Sl(l,u):r.dirtyFields:Z.keepDefaultValues&&P?Sl(l,P):Z.keepDirty?r.dirtyFields:{},touchedFields:Z.keepTouched?r.touchedFields:{},errors:Z.keepErrors?r.errors:{},isSubmitSuccessful:Z.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:l})},yt=(P,Z)=>Ae(Er(P)?P(u):P,Z),Pt=(P,Z={})=>{const re=ke(o,P),Ne=re&&re._f;if(Ne){const xe=Ne.refs?Ne.refs[0]:Ne.ref;xe.focus&&(xe.focus(),Z.shouldSelect&&Er(xe.select)&&xe.select())}},Nt=P=>{r={...r,...P}},zr={control:{register:Be,unregister:M,getFieldState:B,handleSubmit:Re,setError:fe,_subscribe:_e,_runSchema:$,_focusError:He,_getWatch:te,_getDirty:ie,_setValid:w,_setFieldArray:k,_setDisabledField:he,_setErrors:R,_getFieldArray:q,_reset:Ae,_resetDefaultValues:()=>Er(t.defaultValues)&&t.defaultValues().then(P=>{yt(P,t.resetOptions),b.state.next({isLoading:!1})}),_removeUnmounted:se,_disableForm:pe,_subjects:b,_proxyFormState:v,get _fields(){return o},get _formValues(){return u},get _state(){return d},set _state(P){d=P},get _defaultValues(){return l},get _names(){return f},set _names(P){f=P},get _formState(){return r},get _options(){return t},set _options(P){t={...t,...P}}},subscribe:G,trigger:Q,register:Be,handleSubmit:Re,watch:ye,setValue:O,getValues:_,reset:yt,resetField:Ye,clearErrors:ge,unregister:M,setError:fe,setFocus:Pt,getFieldState:B};return{...zr,formControl:zr}}function ug(e={}){const t=ae.useRef(void 0),r=ae.useRef(void 0),[o,l]=ae.useState({isDirty:!1,isValidating:!1,isLoading:Er(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Er(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:o},e.defaultValues&&!Er(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:d,...f}=g8(e);t.current={...f,formState:o}}const u=t.current.control;return u._options=e,ig(()=>{const d=u._subscribe({formState:u._proxyFormState,callback:()=>l({...u._formState}),reRenderRoot:!0});return l(f=>({...f,isReady:!0})),u._formState.isReady=!0,d},[u]),ae.useEffect(()=>u._disableForm(e.disabled),[u,e.disabled]),ae.useEffect(()=>{e.mode&&(u._options.mode=e.mode),e.reValidateMode&&(u._options.reValidateMode=e.reValidateMode)},[u,e.mode,e.reValidateMode]),ae.useEffect(()=>{e.errors&&(u._setErrors(e.errors),u._focusError())},[u,e.errors]),ae.useEffect(()=>{e.shouldUnregister&&u._subjects.state.next({values:u._getWatch()})},[u,e.shouldUnregister]),ae.useEffect(()=>{if(u._proxyFormState.isDirty){const d=u._getDirty();d!==o.isDirty&&u._subjects.state.next({isDirty:d})}},[u,o.isDirty]),ae.useEffect(()=>{e.values&&!wa(e.values,r.current)?(u._reset(e.values,{keepFieldsRef:!0,...u._options.resetOptions}),r.current=e.values,l(d=>({...d}))):u._resetDefaultValues()},[u,e.values]),ae.useEffect(()=>{u._state.mount||(u._setValid(),u._state.mount=!0),u._state.watch&&(u._state.watch=!1,u._subjects.state.next({...u._formState})),u._removeUnmounted()}),t.current.formState=Ok(o,u),t.current}const qw=(e,t,r)=>{if(e&&"reportValidity"in e){const o=ke(r,t);e.setCustomValidity(o&&o.message||""),e.reportValidity()}},Hk=(e,t)=>{for(const r in t.fields){const o=t.fields[r];o&&o.ref&&"reportValidity"in o.ref?qw(o.ref,r,e):o.refs&&o.refs.forEach(l=>qw(l,r,e))}},v8=(e,t)=>{t.shouldUseNativeValidation&&Hk(e,t);const r={};for(const o in e){const l=ke(t.fields,o),u=Object.assign(e[o]||{},{ref:l&&l.ref});if(y8(t.names||Object.keys(e),o)){const d=Object.assign({},ke(r,o));dt(d,"root",u),dt(r,o,d)}else dt(r,o,u)}return r},y8=(e,t)=>e.some(r=>r.startsWith(t+"."));var b8=function(e,t){for(var r={};e.length;){var o=e[0],l=o.code,u=o.message,d=o.path.join(".");if(!r[d])if("unionErrors"in o){var f=o.unionErrors[0].errors[0];r[d]={message:f.message,type:f.code}}else r[d]={message:u,type:l};if("unionErrors"in o&&o.unionErrors.forEach(function(v){return v.errors.forEach(function(y){return e.push(y)})}),t){var m=r[d].types,p=m&&m[o.code];r[d]=Pk(d,t,r,l,p?[].concat(p,o.message):o.message)}e.shift()}return r},dg=function(e,t,r){return r===void 0&&(r={}),function(o,l,u){try{return Promise.resolve((function(d,f){try{var m=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](o,t)).then(function(p){return u.shouldUseNativeValidation&&Hk({},u),{errors:{},values:r.raw?o:p}})}catch(p){return f(p)}return m&&m.then?m.then(void 0,f):m})(0,function(d){if((function(f){return Array.isArray(f?.errors)})(d))return{values:{},errors:v8(b8(d.errors,!u.shouldUseNativeValidation&&u.criteriaMode==="all"),u)};throw d}))}catch(d){return Promise.reject(d)}}};function ce(e,t,r){function o(f,m){var p;Object.defineProperty(f,"_zod",{value:f._zod??{},enumerable:!1}),(p=f._zod).traits??(p.traits=new Set),f._zod.traits.add(e),t(f,m);for(const v in d.prototype)v in f||Object.defineProperty(f,v,{value:d.prototype[v].bind(f)});f._zod.constr=d,f._zod.def=m}const l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(f){var m;const p=r?.Parent?new u:this;o(p,f),(m=p._zod).deferred??(m.deferred=[]);for(const v of p._zod.deferred)v();return p}return Object.defineProperty(d,"init",{value:o}),Object.defineProperty(d,Symbol.hasInstance,{value:f=>r?.Parent&&f instanceof r.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}class Yl extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Fk={};function hs(e){return Fk}function w8(e){const t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,l])=>t.indexOf(+o)===-1).map(([o,l])=>l)}function j8(e,t){return typeof t=="bigint"?t.toString():t}function qk(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function fg(e){return e==null}function hg(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function N8(e,t){const r=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,l=r>o?r:o,u=Number.parseInt(e.toFixed(l).replace(".","")),d=Number.parseInt(t.toFixed(l).replace(".",""));return u%d/10**l}function Ct(e,t,r){Object.defineProperty(e,t,{get(){{const o=r();return e[t]=o,o}},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function mg(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Cl(e){return JSON.stringify(e)}const Yk=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Ip(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const S8=qk(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function gd(e){if(Ip(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(Ip(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}const k8=new Set(["string","number","symbol"]);function uf(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function so(e,t,r){const o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function ze(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function C8(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const E8={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function A8(e,t){const r={},o=e._zod.def;for(const l in t){if(!(l in o.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(r[l]=o.shape[l])}return so(e,{...e._zod.def,shape:r,checks:[]})}function R8(e,t){const r={...e._zod.def.shape},o=e._zod.def;for(const l in t){if(!(l in o.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete r[l]}return so(e,{...e._zod.def,shape:r,checks:[]})}function T8(e,t){if(!gd(t))throw new Error("Invalid input to extend: expected a plain object");const r={...e._zod.def,get shape(){const o={...e._zod.def.shape,...t};return mg(this,"shape",o),o},checks:[]};return so(e,r)}function _8(e,t){return so(e,{...e._zod.def,get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return mg(this,"shape",r),r},catchall:t._zod.def.catchall,checks:[]})}function M8(e,t,r){const o=t._zod.def.shape,l={...o};if(r)for(const u in r){if(!(u in o))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=e?new e({type:"optional",innerType:o[u]}):o[u])}else for(const u in o)l[u]=e?new e({type:"optional",innerType:o[u]}):o[u];return so(t,{...t._zod.def,shape:l,checks:[]})}function D8(e,t,r){const o=t._zod.def.shape,l={...o};if(r)for(const u in r){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(l[u]=new e({type:"nonoptional",innerType:o[u]}))}else for(const u in o)l[u]=new e({type:"nonoptional",innerType:o[u]});return so(t,{...t._zod.def,shape:l,checks:[]})}function zl(e,t=0){for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function qs(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Mu(e){return typeof e=="string"?e:e?.message}function ms(e,t,r){const o={...e,path:e.path??[]};if(!e.message){const l=Mu(e.inst?._zod.def?.error?.(e))??Mu(t?.error?.(e))??Mu(r.customError?.(e))??Mu(r.localeError?.(e))??"Invalid input";o.message=l}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function pg(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Zl(...e){const[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}const Zk=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,j8,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Gk=ce("$ZodError",Zk),Kk=ce("$ZodError",Zk,{Parent:Error});function O8(e,t=r=>r.message){const r={},o=[];for(const l of e.issues)l.path.length>0?(r[l.path[0]]=r[l.path[0]]||[],r[l.path[0]].push(t(l))):o.push(t(l));return{formErrors:o,fieldErrors:r}}function z8(e,t){const r=t||function(u){return u.message},o={_errors:[]},l=u=>{for(const d of u.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(f=>l({issues:f}));else if(d.code==="invalid_key")l({issues:d.issues});else if(d.code==="invalid_element")l({issues:d.issues});else if(d.path.length===0)o._errors.push(r(d));else{let f=o,m=0;for(;m<d.path.length;){const p=d.path[m];m===d.path.length-1?(f[p]=f[p]||{_errors:[]},f[p]._errors.push(r(d))):f[p]=f[p]||{_errors:[]},f=f[p],m++}}};return l(e),o}const P8=e=>(t,r,o,l)=>{const u=o?Object.assign(o,{async:!1}):{async:!1},d=t._zod.run({value:r,issues:[]},u);if(d instanceof Promise)throw new Yl;if(d.issues.length){const f=new(l?.Err??e)(d.issues.map(m=>ms(m,u,hs())));throw Yk(f,l?.callee),f}return d.value},L8=e=>async(t,r,o,l)=>{const u=o?Object.assign(o,{async:!0}):{async:!0};let d=t._zod.run({value:r,issues:[]},u);if(d instanceof Promise&&(d=await d),d.issues.length){const f=new(l?.Err??e)(d.issues.map(m=>ms(m,u,hs())));throw Yk(f,l?.callee),f}return d.value},Qk=e=>(t,r,o)=>{const l=o?{...o,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},l);if(u instanceof Promise)throw new Yl;return u.issues.length?{success:!1,error:new(e??Gk)(u.issues.map(d=>ms(d,l,hs())))}:{success:!0,data:u.value}},$8=Qk(Kk),Xk=e=>async(t,r,o)=>{const l=o?Object.assign(o,{async:!0}):{async:!0};let u=t._zod.run({value:r,issues:[]},l);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(d=>ms(d,l,hs())))}:{success:!0,data:u.value}},I8=Xk(Kk),U8=/^[cC][^\s-]{8,}$/,B8=/^[0-9a-z]+$/,V8=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,H8=/^[0-9a-vA-V]{20}$/,F8=/^[A-Za-z0-9]{27}$/,q8=/^[a-zA-Z0-9_-]{21}$/,Y8=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Z8=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Yw=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,G8=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,K8="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Q8(){return new RegExp(K8,"u")}const X8=/^(?:(?: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])$/,W8=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,J8=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,eP=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tP=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Wk=/^[A-Za-z0-9_-]*$/,nP=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,rP=/^\+(?:[0-9]){6,14}[0-9]$/,Jk="(?:(?:\\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])))",aP=new RegExp(`^${Jk}$`);function eC(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function sP(e){return new RegExp(`^${eC(e)}$`)}function oP(e){const t=eC({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-]\\d{2}:\\d{2})");const o=`${t}(?:${r.join("|")})`;return new RegExp(`^${Jk}T(?:${o})$`)}const iP=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},lP=/^\d+$/,cP=/^-?\d+(?:\.\d+)?/i,uP=/true|false/i,dP=/^[^A-Z]*$/,fP=/^[^a-z]*$/,Fn=ce("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),tC={number:"number",bigint:"bigint",object:"date"},nC=ce("$ZodCheckLessThan",(e,t)=>{Fn.init(e,t);const r=tC[typeof t.value];e._zod.onattach.push(o=>{const l=o._zod.bag,u=(t.inclusive?l.maximum:l.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<u&&(t.inclusive?l.maximum=t.value:l.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rC=ce("$ZodCheckGreaterThan",(e,t)=>{Fn.init(e,t);const r=tC[typeof t.value];e._zod.onattach.push(o=>{const l=o._zod.bag,u=(t.inclusive?l.minimum:l.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>u&&(t.inclusive?l.minimum=t.value:l.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),hP=ce("$ZodCheckMultipleOf",(e,t)=>{Fn.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):N8(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),mP=ce("$ZodCheckNumberFormat",(e,t)=>{Fn.init(e,t),t.format=t.format||"float64";const r=t.format?.includes("int"),o=r?"int":"number",[l,u]=E8[t.format];e._zod.onattach.push(d=>{const f=d._zod.bag;f.format=t.format,f.minimum=l,f.maximum=u,r&&(f.pattern=lP)}),e._zod.check=d=>{const f=d.value;if(r){if(!Number.isInteger(f)){d.issues.push({expected:o,format:t.format,code:"invalid_type",input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?d.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}):d.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort});return}}f<l&&d.issues.push({origin:"number",input:f,code:"too_small",minimum:l,inclusive:!0,inst:e,continue:!t.abort}),f>u&&d.issues.push({origin:"number",input:f,code:"too_big",maximum:u,inst:e})}}),pP=ce("$ZodCheckMaxLength",(e,t)=>{var r;Fn.init(e,t),(r=e._zod.def).when??(r.when=o=>{const l=o.value;return!fg(l)&&l.length!==void 0}),e._zod.onattach.push(o=>{const l=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<l&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{const l=o.value;if(l.length<=t.maximum)return;const d=pg(l);o.issues.push({origin:d,code:"too_big",maximum:t.maximum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),xP=ce("$ZodCheckMinLength",(e,t)=>{var r;Fn.init(e,t),(r=e._zod.def).when??(r.when=o=>{const l=o.value;return!fg(l)&&l.length!==void 0}),e._zod.onattach.push(o=>{const l=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>l&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{const l=o.value;if(l.length>=t.minimum)return;const d=pg(l);o.issues.push({origin:d,code:"too_small",minimum:t.minimum,inclusive:!0,input:l,inst:e,continue:!t.abort})}}),gP=ce("$ZodCheckLengthEquals",(e,t)=>{var r;Fn.init(e,t),(r=e._zod.def).when??(r.when=o=>{const l=o.value;return!fg(l)&&l.length!==void 0}),e._zod.onattach.push(o=>{const l=o._zod.bag;l.minimum=t.length,l.maximum=t.length,l.length=t.length}),e._zod.check=o=>{const l=o.value,u=l.length;if(u===t.length)return;const d=pg(l),f=u>t.length;o.issues.push({origin:d,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),df=ce("$ZodCheckStringFormat",(e,t)=>{var r,o;Fn.init(e,t),e._zod.onattach.push(l=>{const u=l._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=l=>{t.pattern.lastIndex=0,!t.pattern.test(l.value)&&l.issues.push({origin:"string",code:"invalid_format",format:t.format,input:l.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),vP=ce("$ZodCheckRegex",(e,t)=>{df.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),yP=ce("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=dP),df.init(e,t)}),bP=ce("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=fP),df.init(e,t)}),wP=ce("$ZodCheckIncludes",(e,t)=>{Fn.init(e,t);const r=uf(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(l=>{const u=l._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(o)}),e._zod.check=l=>{l.value.includes(t.includes,t.position)||l.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:l.value,inst:e,continue:!t.abort})}}),jP=ce("$ZodCheckStartsWith",(e,t)=>{Fn.init(e,t);const r=new RegExp(`^${uf(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{const l=o._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),NP=ce("$ZodCheckEndsWith",(e,t)=>{Fn.init(e,t);const r=new RegExp(`.*${uf(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{const l=o._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}}),SP=ce("$ZodCheckOverwrite",(e,t)=>{Fn.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class kP{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const o=t.split(`
|
||
`).filter(d=>d),l=Math.min(...o.map(d=>d.length-d.trimStart().length)),u=o.map(d=>d.slice(l)).map(d=>" ".repeat(this.indent*2)+d);for(const d of u)this.content.push(d)}compile(){const t=Function,r=this?.args,l=[...(this?.content??[""]).map(u=>` ${u}`)];return new t(...r,l.join(`
|
||
`))}}const CP={major:4,minor:0,patch:0},_t=ce("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=CP;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const l of o)for(const u of l._zod.onattach)u(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const l=(u,d,f)=>{let m=zl(u),p;for(const v of d){if(v._zod.def.when){if(!v._zod.def.when(u))continue}else if(m)continue;const y=u.issues.length,b=v._zod.check(u);if(b instanceof Promise&&f?.async===!1)throw new Yl;if(p||b instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await b,u.issues.length!==y&&(m||(m=zl(u,y)))});else{if(u.issues.length===y)continue;m||(m=zl(u,y))}}return p?p.then(()=>u):u};e._zod.run=(u,d)=>{const f=e._zod.parse(u,d);if(f instanceof Promise){if(d.async===!1)throw new Yl;return f.then(m=>l(m,o,d))}return l(f,o,d)}}e["~standard"]={validate:l=>{try{const u=$8(e,l);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return I8(e,l).then(d=>d.success?{value:d.data}:{issues:d.error?.issues})}},vendor:"zod",version:1}}),xg=ce("$ZodString",(e,t)=>{_t.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??iP(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Et=ce("$ZodStringFormat",(e,t)=>{df.init(e,t),xg.init(e,t)}),EP=ce("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Z8),Et.init(e,t)}),AP=ce("$ZodUUID",(e,t)=>{if(t.version){const o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Yw(o))}else t.pattern??(t.pattern=Yw());Et.init(e,t)}),RP=ce("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=G8),Et.init(e,t)}),TP=ce("$ZodURL",(e,t)=>{Et.init(e,t),e._zod.check=r=>{try{const o=r.value,l=new URL(o),u=l.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(l.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:nP.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(l.protocol.endsWith(":")?l.protocol.slice(0,-1):l.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),!o.endsWith("/")&&u.endsWith("/")?r.value=u.slice(0,-1):r.value=u;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),_P=ce("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Q8()),Et.init(e,t)}),MP=ce("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=q8),Et.init(e,t)}),DP=ce("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=U8),Et.init(e,t)}),OP=ce("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=B8),Et.init(e,t)}),zP=ce("$ZodULID",(e,t)=>{t.pattern??(t.pattern=V8),Et.init(e,t)}),PP=ce("$ZodXID",(e,t)=>{t.pattern??(t.pattern=H8),Et.init(e,t)}),LP=ce("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=F8),Et.init(e,t)}),$P=ce("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=oP(t)),Et.init(e,t)}),IP=ce("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=aP),Et.init(e,t)}),UP=ce("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=sP(t)),Et.init(e,t)}),BP=ce("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Y8),Et.init(e,t)}),VP=ce("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=X8),Et.init(e,t),e._zod.onattach.push(r=>{const o=r._zod.bag;o.format="ipv4"})}),HP=ce("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=W8),Et.init(e,t),e._zod.onattach.push(r=>{const o=r._zod.bag;o.format="ipv6"}),e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),FP=ce("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=J8),Et.init(e,t)}),qP=ce("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=eP),Et.init(e,t),e._zod.check=r=>{const[o,l]=r.value.split("/");try{if(!l)throw new Error;const u=Number(l);if(`${u}`!==l)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function aC(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const YP=ce("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=tP),Et.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),e._zod.check=r=>{aC(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function ZP(e){if(!Wk.test(e))return!1;const t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return aC(r)}const GP=ce("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Wk),Et.init(e,t),e._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),e._zod.check=r=>{ZP(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),KP=ce("$ZodE164",(e,t)=>{t.pattern??(t.pattern=rP),Et.init(e,t)});function QP(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[o]=r;if(!o)return!1;const l=JSON.parse(atob(o));return!("typ"in l&&l?.typ!=="JWT"||!l.alg||t&&(!("alg"in l)||l.alg!==t))}catch{return!1}}const XP=ce("$ZodJWT",(e,t)=>{Et.init(e,t),e._zod.check=r=>{QP(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),sC=ce("$ZodNumber",(e,t)=>{_t.init(e,t),e._zod.pattern=e._zod.bag.pattern??cP,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const l=r.value;if(typeof l=="number"&&!Number.isNaN(l)&&Number.isFinite(l))return r;const u=typeof l=="number"?Number.isNaN(l)?"NaN":Number.isFinite(l)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:l,inst:e,...u?{received:u}:{}}),r}}),WP=ce("$ZodNumber",(e,t)=>{mP.init(e,t),sC.init(e,t)}),JP=ce("$ZodBoolean",(e,t)=>{_t.init(e,t),e._zod.pattern=uP,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}const l=r.value;return typeof l=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:l,inst:e}),r}}),eL=ce("$ZodUnknown",(e,t)=>{_t.init(e,t),e._zod.parse=r=>r}),tL=ce("$ZodNever",(e,t)=>{_t.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Zw(e,t,r){e.issues.length&&t.issues.push(...qs(r,e.issues)),t.value[r]=e.value}const nL=ce("$ZodArray",(e,t)=>{_t.init(e,t),e._zod.parse=(r,o)=>{const l=r.value;if(!Array.isArray(l))return r.issues.push({expected:"array",code:"invalid_type",input:l,inst:e}),r;r.value=Array(l.length);const u=[];for(let d=0;d<l.length;d++){const f=l[d],m=t.element._zod.run({value:f,issues:[]},o);m instanceof Promise?u.push(m.then(p=>Zw(p,r,d))):Zw(m,r,d)}return u.length?Promise.all(u).then(()=>r):r}});function Du(e,t,r){e.issues.length&&t.issues.push(...qs(r,e.issues)),t.value[r]=e.value}function Gw(e,t,r,o){e.issues.length?o[r]===void 0?r in o?t.value[r]=void 0:t.value[r]=e.value:t.issues.push(...qs(r,e.issues)):e.value===void 0?r in o&&(t.value[r]=void 0):t.value[r]=e.value}const rL=ce("$ZodObject",(e,t)=>{_t.init(e,t);const r=qk(()=>{const y=Object.keys(t.shape);for(const S of y)if(!(t.shape[S]instanceof _t))throw new Error(`Invalid element at key "${S}": expected a Zod schema`);const b=C8(t.shape);return{shape:t.shape,keys:y,keySet:new Set(y),numKeys:y.length,optionalKeys:new Set(b)}});Ct(e._zod,"propValues",()=>{const y=t.shape,b={};for(const S in y){const N=y[S]._zod;if(N.values){b[S]??(b[S]=new Set);for(const w of N.values)b[S].add(w)}}return b});const o=y=>{const b=new kP(["shape","payload","ctx"]),S=r.value,N=E=>{const R=Cl(E);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};b.write("const input = payload.value;");const w=Object.create(null);let C=0;for(const E of S.keys)w[E]=`key_${C++}`;b.write("const newResult = {}");for(const E of S.keys)if(S.optionalKeys.has(E)){const R=w[E];b.write(`const ${R} = ${N(E)};`);const T=Cl(E);b.write(`
|
||
if (${R}.issues.length) {
|
||
if (input[${T}] === undefined) {
|
||
if (${T} in input) {
|
||
newResult[${T}] = undefined;
|
||
}
|
||
} else {
|
||
payload.issues = payload.issues.concat(
|
||
${R}.issues.map((iss) => ({
|
||
...iss,
|
||
path: iss.path ? [${T}, ...iss.path] : [${T}],
|
||
}))
|
||
);
|
||
}
|
||
} else if (${R}.value === undefined) {
|
||
if (${T} in input) newResult[${T}] = undefined;
|
||
} else {
|
||
newResult[${T}] = ${R}.value;
|
||
}
|
||
`)}else{const R=w[E];b.write(`const ${R} = ${N(E)};`),b.write(`
|
||
if (${R}.issues.length) payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
||
...iss,
|
||
path: iss.path ? [${Cl(E)}, ...iss.path] : [${Cl(E)}]
|
||
})));`),b.write(`newResult[${Cl(E)}] = ${R}.value`)}b.write("payload.value = newResult;"),b.write("return payload;");const k=b.compile();return(E,R)=>k(y,E,R)};let l;const u=Ip,d=!Fk.jitless,m=d&&S8.value,p=t.catchall;let v;e._zod.parse=(y,b)=>{v??(v=r.value);const S=y.value;if(!u(S))return y.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),y;const N=[];if(d&&m&&b?.async===!1&&b.jitless!==!0)l||(l=o(t.shape)),y=l(y,b);else{y.value={};const R=v.shape;for(const T of v.keys){const z=R[T],ne=z._zod.run({value:S[T],issues:[]},b),$=z._zod.optin==="optional"&&z._zod.optout==="optional";ne instanceof Promise?N.push(ne.then(V=>$?Gw(V,y,T,S):Du(V,y,T))):$?Gw(ne,y,T,S):Du(ne,y,T)}}if(!p)return N.length?Promise.all(N).then(()=>y):y;const w=[],C=v.keySet,k=p._zod,E=k.def.type;for(const R of Object.keys(S)){if(C.has(R))continue;if(E==="never"){w.push(R);continue}const T=k.run({value:S[R],issues:[]},b);T instanceof Promise?N.push(T.then(z=>Du(z,y,R))):Du(T,y,R)}return w.length&&y.issues.push({code:"unrecognized_keys",keys:w,input:S,inst:e}),N.length?Promise.all(N).then(()=>y):y}});function Kw(e,t,r,o){for(const l of e)if(l.issues.length===0)return t.value=l.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(l=>l.issues.map(u=>ms(u,o,hs())))}),t}const aL=ce("$ZodUnion",(e,t)=>{_t.init(e,t),Ct(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Ct(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Ct(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),Ct(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${r.map(o=>hg(o.source)).join("|")})$`)}}),e._zod.parse=(r,o)=>{let l=!1;const u=[];for(const d of t.options){const f=d._zod.run({value:r.value,issues:[]},o);if(f instanceof Promise)u.push(f),l=!0;else{if(f.issues.length===0)return f;u.push(f)}}return l?Promise.all(u).then(d=>Kw(d,r,e,o)):Kw(u,r,e,o)}}),sL=ce("$ZodIntersection",(e,t)=>{_t.init(e,t),e._zod.parse=(r,o)=>{const l=r.value,u=t.left._zod.run({value:l,issues:[]},o),d=t.right._zod.run({value:l,issues:[]},o);return u instanceof Promise||d instanceof Promise?Promise.all([u,d]).then(([m,p])=>Qw(r,m,p)):Qw(r,u,d)}});function Up(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(gd(e)&&gd(t)){const r=Object.keys(t),o=Object.keys(e).filter(u=>r.indexOf(u)!==-1),l={...e,...t};for(const u of o){const d=Up(e[u],t[u]);if(!d.valid)return{valid:!1,mergeErrorPath:[u,...d.mergeErrorPath]};l[u]=d.data}return{valid:!0,data:l}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let o=0;o<e.length;o++){const l=e[o],u=t[o],d=Up(l,u);if(!d.valid)return{valid:!1,mergeErrorPath:[o,...d.mergeErrorPath]};r.push(d.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Qw(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),zl(e))return e;const o=Up(t.value,r.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const oL=ce("$ZodRecord",(e,t)=>{_t.init(e,t),e._zod.parse=(r,o)=>{const l=r.value;if(!gd(l))return r.issues.push({expected:"record",code:"invalid_type",input:l,inst:e}),r;const u=[];if(t.keyType._zod.values){const d=t.keyType._zod.values;r.value={};for(const m of d)if(typeof m=="string"||typeof m=="number"||typeof m=="symbol"){const p=t.valueType._zod.run({value:l[m],issues:[]},o);p instanceof Promise?u.push(p.then(v=>{v.issues.length&&r.issues.push(...qs(m,v.issues)),r.value[m]=v.value})):(p.issues.length&&r.issues.push(...qs(m,p.issues)),r.value[m]=p.value)}let f;for(const m in l)d.has(m)||(f=f??[],f.push(m));f&&f.length>0&&r.issues.push({code:"unrecognized_keys",input:l,inst:e,keys:f})}else{r.value={};for(const d of Reflect.ownKeys(l)){if(d==="__proto__")continue;const f=t.keyType._zod.run({value:d,issues:[]},o);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(f.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:f.issues.map(p=>ms(p,o,hs())),input:d,path:[d],inst:e}),r.value[f.value]=f.value;continue}const m=t.valueType._zod.run({value:l[d],issues:[]},o);m instanceof Promise?u.push(m.then(p=>{p.issues.length&&r.issues.push(...qs(d,p.issues)),r.value[f.value]=p.value})):(m.issues.length&&r.issues.push(...qs(d,m.issues)),r.value[f.value]=m.value)}}return u.length?Promise.all(u).then(()=>r):r}}),iL=ce("$ZodEnum",(e,t)=>{_t.init(e,t);const r=w8(t.entries);e._zod.values=new Set(r),e._zod.pattern=new RegExp(`^(${r.filter(o=>k8.has(typeof o)).map(o=>typeof o=="string"?uf(o):o.toString()).join("|")})$`),e._zod.parse=(o,l)=>{const u=o.value;return e._zod.values.has(u)||o.issues.push({code:"invalid_value",values:r,input:u,inst:e}),o}}),lL=ce("$ZodTransform",(e,t)=>{_t.init(e,t),e._zod.parse=(r,o)=>{const l=t.transform(r.value,r);if(o.async)return(l instanceof Promise?l:Promise.resolve(l)).then(d=>(r.value=d,r));if(l instanceof Promise)throw new Yl;return r.value=l,r}}),cL=ce("$ZodOptional",(e,t)=>{_t.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ct(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ct(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${hg(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(r,o):r.value===void 0?r:t.innerType._zod.run(r,o)}),uL=ce("$ZodNullable",(e,t)=>{_t.init(e,t),Ct(e._zod,"optin",()=>t.innerType._zod.optin),Ct(e._zod,"optout",()=>t.innerType._zod.optout),Ct(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${hg(r.source)}|null)$`):void 0}),Ct(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>r.value===null?r:t.innerType._zod.run(r,o)}),dL=ce("$ZodDefault",(e,t)=>{_t.init(e,t),e._zod.optin="optional",Ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(r.value===void 0)return r.value=t.defaultValue,r;const l=t.innerType._zod.run(r,o);return l instanceof Promise?l.then(u=>Xw(u,t)):Xw(l,t)}});function Xw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const fL=ce("$ZodPrefault",(e,t)=>{_t.init(e,t),e._zod.optin="optional",Ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>(r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,o))}),hL=ce("$ZodNonOptional",(e,t)=>{_t.init(e,t),Ct(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{const l=t.innerType._zod.run(r,o);return l instanceof Promise?l.then(u=>Ww(u,e)):Ww(l,e)}});function Ww(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const mL=ce("$ZodCatch",(e,t)=>{_t.init(e,t),e._zod.optin="optional",Ct(e._zod,"optout",()=>t.innerType._zod.optout),Ct(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{const l=t.innerType._zod.run(r,o);return l instanceof Promise?l.then(u=>(r.value=u.value,u.issues.length&&(r.value=t.catchValue({...r,error:{issues:u.issues.map(d=>ms(d,o,hs()))},input:r.value}),r.issues=[]),r)):(r.value=l.value,l.issues.length&&(r.value=t.catchValue({...r,error:{issues:l.issues.map(u=>ms(u,o,hs()))},input:r.value}),r.issues=[]),r)}}),pL=ce("$ZodPipe",(e,t)=>{_t.init(e,t),Ct(e._zod,"values",()=>t.in._zod.values),Ct(e._zod,"optin",()=>t.in._zod.optin),Ct(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(r,o)=>{const l=t.in._zod.run(r,o);return l instanceof Promise?l.then(u=>Jw(u,t,o)):Jw(l,t,o)}});function Jw(e,t,r){return zl(e)?e:t.out._zod.run({value:e.value,issues:e.issues},r)}const xL=ce("$ZodReadonly",(e,t)=>{_t.init(e,t),Ct(e._zod,"propValues",()=>t.innerType._zod.propValues),Ct(e._zod,"values",()=>t.innerType._zod.values),Ct(e._zod,"optin",()=>t.innerType._zod.optin),Ct(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,o)=>{const l=t.innerType._zod.run(r,o);return l instanceof Promise?l.then(e1):e1(l)}});function e1(e){return e.value=Object.freeze(e.value),e}const gL=ce("$ZodCustom",(e,t)=>{Fn.init(e,t),_t.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=r=>{const o=r.value,l=t.fn(o);if(l instanceof Promise)return l.then(u=>t1(u,r,o,e));t1(l,r,o,e)}});function t1(e,t,r,o){if(!e){const l={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(l.params=o._zod.def.params),t.issues.push(Zl(l))}}class vL{constructor(){this._map=new Map,this._idmap=new Map}add(t,...r){const o=r[0];if(this._map.set(t,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const o={...this.get(r)??{}};return delete o.id,{...o,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function yL(){return new vL}const Ou=yL();function bL(e,t){return new e({type:"string",...ze(t)})}function wL(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ze(t)})}function n1(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ze(t)})}function jL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ze(t)})}function NL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ze(t)})}function SL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ze(t)})}function kL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ze(t)})}function CL(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ze(t)})}function EL(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ze(t)})}function AL(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ze(t)})}function RL(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ze(t)})}function TL(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ze(t)})}function _L(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ze(t)})}function ML(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ze(t)})}function DL(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ze(t)})}function OL(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ze(t)})}function zL(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ze(t)})}function PL(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ze(t)})}function LL(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ze(t)})}function $L(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ze(t)})}function IL(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ze(t)})}function UL(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ze(t)})}function BL(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ze(t)})}function VL(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ze(t)})}function HL(e,t){return new e({type:"string",format:"date",check:"string_format",...ze(t)})}function FL(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ze(t)})}function qL(e,t){return new e({type:"string",format:"duration",check:"string_format",...ze(t)})}function YL(e,t){return new e({type:"number",checks:[],...ze(t)})}function ZL(e,t){return new e({type:"number",coerce:!0,checks:[],...ze(t)})}function GL(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ze(t)})}function KL(e,t){return new e({type:"boolean",...ze(t)})}function QL(e){return new e({type:"unknown"})}function XL(e,t){return new e({type:"never",...ze(t)})}function r1(e,t){return new nC({check:"less_than",...ze(t),value:e,inclusive:!1})}function op(e,t){return new nC({check:"less_than",...ze(t),value:e,inclusive:!0})}function a1(e,t){return new rC({check:"greater_than",...ze(t),value:e,inclusive:!1})}function ip(e,t){return new rC({check:"greater_than",...ze(t),value:e,inclusive:!0})}function s1(e,t){return new hP({check:"multiple_of",...ze(t),value:e})}function oC(e,t){return new pP({check:"max_length",...ze(t),maximum:e})}function vd(e,t){return new xP({check:"min_length",...ze(t),minimum:e})}function iC(e,t){return new gP({check:"length_equals",...ze(t),length:e})}function WL(e,t){return new vP({check:"string_format",format:"regex",...ze(t),pattern:e})}function JL(e){return new yP({check:"string_format",format:"lowercase",...ze(e)})}function e7(e){return new bP({check:"string_format",format:"uppercase",...ze(e)})}function t7(e,t){return new wP({check:"string_format",format:"includes",...ze(t),includes:e})}function n7(e,t){return new jP({check:"string_format",format:"starts_with",...ze(t),prefix:e})}function r7(e,t){return new NP({check:"string_format",format:"ends_with",...ze(t),suffix:e})}function cc(e){return new SP({check:"overwrite",tx:e})}function a7(e){return cc(t=>t.normalize(e))}function s7(){return cc(e=>e.trim())}function o7(){return cc(e=>e.toLowerCase())}function i7(){return cc(e=>e.toUpperCase())}function l7(e,t,r){return new e({type:"array",element:t,...ze(r)})}function c7(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ze(r)})}const u7=ce("ZodISODateTime",(e,t)=>{$P.init(e,t),Mt.init(e,t)});function d7(e){return VL(u7,e)}const f7=ce("ZodISODate",(e,t)=>{IP.init(e,t),Mt.init(e,t)});function h7(e){return HL(f7,e)}const m7=ce("ZodISOTime",(e,t)=>{UP.init(e,t),Mt.init(e,t)});function p7(e){return FL(m7,e)}const x7=ce("ZodISODuration",(e,t)=>{BP.init(e,t),Mt.init(e,t)});function g7(e){return qL(x7,e)}const v7=(e,t)=>{Gk.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>z8(e,r)},flatten:{value:r=>O8(e,r)},addIssue:{value:r=>e.issues.push(r)},addIssues:{value:r=>e.issues.push(...r)},isEmpty:{get(){return e.issues.length===0}}})},ff=ce("ZodError",v7,{Parent:Error}),y7=P8(ff),b7=L8(ff),w7=Qk(ff),j7=Xk(ff),Ht=ce("ZodType",(e,t)=>(_t.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),e.clone=(r,o)=>so(e,r,o),e.brand=()=>e,e.register=((r,o)=>(r.add(e,o),e)),e.parse=(r,o)=>y7(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>w7(e,r,o),e.parseAsync=async(r,o)=>b7(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>j7(e,r,o),e.spa=e.safeParseAsync,e.refine=(r,o)=>e.check(m9(r,o)),e.superRefine=r=>e.check(p9(r)),e.overwrite=r=>e.check(cc(r)),e.optional=()=>l1(e),e.nullable=()=>c1(e),e.nullish=()=>l1(c1(e)),e.nonoptional=r=>o9(e,r),e.array=()=>hf(e),e.or=r=>K7([e,r]),e.and=r=>X7(e,r),e.transform=r=>u1(e,e9(r)),e.default=r=>r9(e,r),e.prefault=r=>s9(e,r),e.catch=r=>l9(e,r),e.pipe=r=>u1(e,r),e.readonly=()=>d9(e),e.describe=r=>{const o=e.clone();return Ou.add(o,{description:r}),o},Object.defineProperty(e,"description",{get(){return Ou.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return Ou.get(e);const o=e.clone();return Ou.add(o,r[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),lC=ce("_ZodString",(e,t)=>{xg.init(e,t),Ht.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...o)=>e.check(WL(...o)),e.includes=(...o)=>e.check(t7(...o)),e.startsWith=(...o)=>e.check(n7(...o)),e.endsWith=(...o)=>e.check(r7(...o)),e.min=(...o)=>e.check(vd(...o)),e.max=(...o)=>e.check(oC(...o)),e.length=(...o)=>e.check(iC(...o)),e.nonempty=(...o)=>e.check(vd(1,...o)),e.lowercase=o=>e.check(JL(o)),e.uppercase=o=>e.check(e7(o)),e.trim=()=>e.check(s7()),e.normalize=(...o)=>e.check(a7(...o)),e.toLowerCase=()=>e.check(o7()),e.toUpperCase=()=>e.check(i7())}),N7=ce("ZodString",(e,t)=>{xg.init(e,t),lC.init(e,t),e.email=r=>e.check(wL(S7,r)),e.url=r=>e.check(CL(k7,r)),e.jwt=r=>e.check(BL(U7,r)),e.emoji=r=>e.check(EL(C7,r)),e.guid=r=>e.check(n1(o1,r)),e.uuid=r=>e.check(jL(zu,r)),e.uuidv4=r=>e.check(NL(zu,r)),e.uuidv6=r=>e.check(SL(zu,r)),e.uuidv7=r=>e.check(kL(zu,r)),e.nanoid=r=>e.check(AL(E7,r)),e.guid=r=>e.check(n1(o1,r)),e.cuid=r=>e.check(RL(A7,r)),e.cuid2=r=>e.check(TL(R7,r)),e.ulid=r=>e.check(_L(T7,r)),e.base64=r=>e.check($L(L7,r)),e.base64url=r=>e.check(IL($7,r)),e.xid=r=>e.check(ML(_7,r)),e.ksuid=r=>e.check(DL(M7,r)),e.ipv4=r=>e.check(OL(D7,r)),e.ipv6=r=>e.check(zL(O7,r)),e.cidrv4=r=>e.check(PL(z7,r)),e.cidrv6=r=>e.check(LL(P7,r)),e.e164=r=>e.check(UL(I7,r)),e.datetime=r=>e.check(d7(r)),e.date=r=>e.check(h7(r)),e.time=r=>e.check(p7(r)),e.duration=r=>e.check(g7(r))});function U(e){return bL(N7,e)}const Mt=ce("ZodStringFormat",(e,t)=>{Et.init(e,t),lC.init(e,t)}),S7=ce("ZodEmail",(e,t)=>{RP.init(e,t),Mt.init(e,t)}),o1=ce("ZodGUID",(e,t)=>{EP.init(e,t),Mt.init(e,t)}),zu=ce("ZodUUID",(e,t)=>{AP.init(e,t),Mt.init(e,t)}),k7=ce("ZodURL",(e,t)=>{TP.init(e,t),Mt.init(e,t)}),C7=ce("ZodEmoji",(e,t)=>{_P.init(e,t),Mt.init(e,t)}),E7=ce("ZodNanoID",(e,t)=>{MP.init(e,t),Mt.init(e,t)}),A7=ce("ZodCUID",(e,t)=>{DP.init(e,t),Mt.init(e,t)}),R7=ce("ZodCUID2",(e,t)=>{OP.init(e,t),Mt.init(e,t)}),T7=ce("ZodULID",(e,t)=>{zP.init(e,t),Mt.init(e,t)}),_7=ce("ZodXID",(e,t)=>{PP.init(e,t),Mt.init(e,t)}),M7=ce("ZodKSUID",(e,t)=>{LP.init(e,t),Mt.init(e,t)}),D7=ce("ZodIPv4",(e,t)=>{VP.init(e,t),Mt.init(e,t)}),O7=ce("ZodIPv6",(e,t)=>{HP.init(e,t),Mt.init(e,t)}),z7=ce("ZodCIDRv4",(e,t)=>{FP.init(e,t),Mt.init(e,t)}),P7=ce("ZodCIDRv6",(e,t)=>{qP.init(e,t),Mt.init(e,t)}),L7=ce("ZodBase64",(e,t)=>{YP.init(e,t),Mt.init(e,t)}),$7=ce("ZodBase64URL",(e,t)=>{GP.init(e,t),Mt.init(e,t)}),I7=ce("ZodE164",(e,t)=>{KP.init(e,t),Mt.init(e,t)}),U7=ce("ZodJWT",(e,t)=>{XP.init(e,t),Mt.init(e,t)}),gg=ce("ZodNumber",(e,t)=>{sC.init(e,t),Ht.init(e,t),e.gt=(o,l)=>e.check(a1(o,l)),e.gte=(o,l)=>e.check(ip(o,l)),e.min=(o,l)=>e.check(ip(o,l)),e.lt=(o,l)=>e.check(r1(o,l)),e.lte=(o,l)=>e.check(op(o,l)),e.max=(o,l)=>e.check(op(o,l)),e.int=o=>e.check(i1(o)),e.safe=o=>e.check(i1(o)),e.positive=o=>e.check(a1(0,o)),e.nonnegative=o=>e.check(ip(0,o)),e.negative=o=>e.check(r1(0,o)),e.nonpositive=o=>e.check(op(0,o)),e.multipleOf=(o,l)=>e.check(s1(o,l)),e.step=(o,l)=>e.check(s1(o,l)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function vt(e){return YL(gg,e)}const B7=ce("ZodNumberFormat",(e,t)=>{WP.init(e,t),gg.init(e,t)});function i1(e){return GL(B7,e)}const V7=ce("ZodBoolean",(e,t)=>{JP.init(e,t),Ht.init(e,t)});function Aa(e){return KL(V7,e)}const H7=ce("ZodUnknown",(e,t)=>{eL.init(e,t),Ht.init(e,t)});function ps(){return QL(H7)}const F7=ce("ZodNever",(e,t)=>{tL.init(e,t),Ht.init(e,t)});function q7(e){return XL(F7,e)}const Y7=ce("ZodArray",(e,t)=>{nL.init(e,t),Ht.init(e,t),e.element=t.element,e.min=(r,o)=>e.check(vd(r,o)),e.nonempty=r=>e.check(vd(1,r)),e.max=(r,o)=>e.check(oC(r,o)),e.length=(r,o)=>e.check(iC(r,o)),e.unwrap=()=>e.element});function hf(e,t){return l7(Y7,e,t)}const Z7=ce("ZodObject",(e,t)=>{rL.init(e,t),Ht.init(e,t),Ct(e,"shape",()=>t.shape),e.keyof=()=>mf(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ps()}),e.loose=()=>e.clone({...e._zod.def,catchall:ps()}),e.strict=()=>e.clone({...e._zod.def,catchall:q7()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>T8(e,r),e.merge=r=>_8(e,r),e.pick=r=>A8(e,r),e.omit=r=>R8(e,r),e.partial=(...r)=>M8(cC,e,r[0]),e.required=(...r)=>D8(uC,e,r[0])});function rt(e,t){const r={type:"object",get shape(){return mg(this,"shape",{...e}),this.shape},...ze(t)};return new Z7(r)}const G7=ce("ZodUnion",(e,t)=>{aL.init(e,t),Ht.init(e,t),e.options=t.options});function K7(e,t){return new G7({type:"union",options:e,...ze(t)})}const Q7=ce("ZodIntersection",(e,t)=>{sL.init(e,t),Ht.init(e,t)});function X7(e,t){return new Q7({type:"intersection",left:e,right:t})}const W7=ce("ZodRecord",(e,t)=>{oL.init(e,t),Ht.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function yd(e,t,r){return new W7({type:"record",keyType:e,valueType:t,...ze(r)})}const Bp=ce("ZodEnum",(e,t)=>{iL.init(e,t),Ht.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(o,l)=>{const u={};for(const d of o)if(r.has(d))u[d]=t.entries[d];else throw new Error(`Key ${d} not found in enum`);return new Bp({...t,checks:[],...ze(l),entries:u})},e.exclude=(o,l)=>{const u={...t.entries};for(const d of o)if(r.has(d))delete u[d];else throw new Error(`Key ${d} not found in enum`);return new Bp({...t,checks:[],...ze(l),entries:u})}});function mf(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new Bp({type:"enum",entries:r,...ze(t)})}const J7=ce("ZodTransform",(e,t)=>{lL.init(e,t),Ht.init(e,t),e._zod.parse=(r,o)=>{r.addIssue=u=>{if(typeof u=="string")r.issues.push(Zl(u,r.value,t));else{const d=u;d.fatal&&(d.continue=!1),d.code??(d.code="custom"),d.input??(d.input=r.value),d.inst??(d.inst=e),d.continue??(d.continue=!0),r.issues.push(Zl(d))}};const l=t.transform(r.value,r);return l instanceof Promise?l.then(u=>(r.value=u,r)):(r.value=l,r)}});function e9(e){return new J7({type:"transform",transform:e})}const cC=ce("ZodOptional",(e,t)=>{cL.init(e,t),Ht.init(e,t),e.unwrap=()=>e._zod.def.innerType});function l1(e){return new cC({type:"optional",innerType:e})}const t9=ce("ZodNullable",(e,t)=>{uL.init(e,t),Ht.init(e,t),e.unwrap=()=>e._zod.def.innerType});function c1(e){return new t9({type:"nullable",innerType:e})}const n9=ce("ZodDefault",(e,t)=>{dL.init(e,t),Ht.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function r9(e,t){return new n9({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const a9=ce("ZodPrefault",(e,t)=>{fL.init(e,t),Ht.init(e,t),e.unwrap=()=>e._zod.def.innerType});function s9(e,t){return new a9({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const uC=ce("ZodNonOptional",(e,t)=>{hL.init(e,t),Ht.init(e,t),e.unwrap=()=>e._zod.def.innerType});function o9(e,t){return new uC({type:"nonoptional",innerType:e,...ze(t)})}const i9=ce("ZodCatch",(e,t)=>{mL.init(e,t),Ht.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function l9(e,t){return new i9({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const c9=ce("ZodPipe",(e,t)=>{pL.init(e,t),Ht.init(e,t),e.in=t.in,e.out=t.out});function u1(e,t){return new c9({type:"pipe",in:e,out:t})}const u9=ce("ZodReadonly",(e,t)=>{xL.init(e,t),Ht.init(e,t)});function d9(e){return new u9({type:"readonly",innerType:e})}const f9=ce("ZodCustom",(e,t)=>{gL.init(e,t),Ht.init(e,t)});function h9(e){const t=new Fn({check:"custom"});return t._zod.check=e,t}function m9(e,t={}){return c7(f9,e,t)}function p9(e){const t=h9(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(Zl(o,r.value,t._zod.def));else{const l=o;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=r.value),l.inst??(l.inst=t),l.continue??(l.continue=!t._zod.def.abort),r.issues.push(Zl(l))}},e(r.value,r)));return t}function Pu(e){return ZL(gg,e)}const x9=mf(["user","contributor","reviewer","editor","admin"]),g9=mf(["poem","story","novel","play","essay","other"]),v9=mf(["draft","submitted","under_review","approved","rejected"]),y9=rt({id:U(),username:U(),email:U(),displayName:U().optional(),firstName:U().optional(),lastName:U().optional(),bio:U().optional(),avatar:U().optional(),role:x9,verified:Aa().optional(),active:Aa().optional(),lastLoginAt:U().optional(),createdAt:U(),updatedAt:U().optional(),countryId:U().optional(),cityId:U().optional()}),vg=rt({id:U(),name:U(),slug:U(),birthYear:vt().optional(),deathYear:vt().optional(),country:U().optional(),biography:U().optional(),portrait:U().optional(),createdAt:U(),createdBy:U().optional(),updatedAt:U().optional(),countryId:U().optional(),cityId:U().optional(),copyrightId:U().optional()}),b9=rt({id:U(),title:U(),slug:U(),authorId:U(),year:vt().optional(),type:g9,language:U(),content:U(),description:U().optional(),createdAt:U(),createdBy:U().optional(),updatedAt:U().optional(),tags:hf(U()).optional(),likes:vt().optional(),views:vt().optional(),author:vg.optional(),readabilityScore:vt().optional(),copyrightId:U().optional()}),w9=rt({id:U(),workId:U(),title:U(),language:U(),content:U(),translatorId:U(),year:vt().optional(),notes:U().optional(),description:U().optional(),createdAt:U()}),j9=rt({id:U(),name:U(),type:U(),createdAt:U()}),N9=rt({id:U(),userId:U(),workId:U(),note:U().optional(),createdAt:U()}),S9=rt({id:U(),userId:U(),workId:U().optional(),translationId:U().optional(),lineNumber:vt().optional(),content:U(),parentId:U().optional(),entityType:U().optional(),entityId:U().optional(),createdAt:U()}),k9=rt({id:U(),userId:U(),entityType:U(),entityId:U(),createdAt:U()}),C9=rt({id:U(),name:U(),slug:U(),description:U().optional(),userId:U(),isPublic:Aa(),createdAt:U()}),E9=rt({id:U(),collectionId:U(),workId:U(),order:vt(),addedAt:U()}),A9=rt({id:U(),authorId:U(),year:vt(),title:U(),description:U().optional(),createdAt:U()}),R9=rt({id:U(),title:U(),slug:U(),content:U(),authorId:U(),excerpt:U().optional(),publishedAt:U().optional(),createdAt:U()}),T9=rt({id:U(),userId:U(),workId:U(),translationId:U().optional(),progress:vt().min(0).max(100),lastReadAt:U()}),dC=rt({id:U(),workId:U(),translationId:U().optional(),lineNumber:vt().optional(),content:U(),type:U(),userId:U(),isOfficial:Aa(),createdAt:U()}),_9=rt({id:U(),workId:U(),type:U(),data:yd(U(),ps()),createdAt:U()}),M9=rt({id:U(),name:U(),code:U(),language:U(),createdAt:U(),updatedAt:U().optional()}),D9=rt({id:U(),name:U(),countryId:U(),language:U(),createdAt:U(),updatedAt:U().optional()}),O9=rt({id:U(),title:U(),slug:U(),language:U(),authorId:U(),copyrightId:U().optional(),createdAt:U(),updatedAt:U().optional()}),z9=rt({id:U(),name:U(),language:U(),details:U().optional(),createdAt:U(),updatedAt:U().optional()}),P9=rt({id:U(),name:U(),status:v9,userId:U(),workId:U().optional(),translationId:U().optional(),createdAt:U(),updatedAt:U().optional()}),L9=rt({id:U(),userId:U(),phoneNumber:U().optional(),website:U().optional(),twitter:U().optional(),facebook:U().optional(),linkedIn:U().optional(),github:U().optional(),preferences:yd(U(),ps()).optional(),settings:yd(U(),ps()).optional(),createdAt:U(),updatedAt:U().optional()}),$9=rt({id:U(),workId:U(),score:vt(),language:U(),createdAt:U(),updatedAt:U().optional()}),I9=rt({id:U(),workId:U(),name:U(),language:U(),characteristics:yd(U(),ps()).optional(),createdAt:U(),updatedAt:U().optional()}),U9=rt({id:U(),name:U(),workId:U().optional(),userId:U().optional(),collectionId:U().optional(),language:U(),intensity:vt().optional(),createdAt:U(),updatedAt:U().optional()}),B9=rt({id:U(),name:U(),description:U().optional(),createdAt:U(),updatedAt:U().optional()}),V9=rt({id:U(),name:U(),description:U().optional(),createdAt:U(),updatedAt:U().optional()}),H9=rt({id:U(),workId:U(),views:vt(),likes:vt(),bookmarks:vt(),comments:vt(),createdAt:U(),updatedAt:U().optional()}),F9=rt({id:U(),userId:U(),activity:vt(),contributions:vt(),likes:vt(),comments:vt(),createdAt:U(),updatedAt:U().optional()}),q9=y9.omit({id:!0,createdAt:!0,role:!0}),Y9=vg.omit({id:!0,createdAt:!0}),Z9=b9.omit({id:!0,createdAt:!0,author:!0}),fC=w9.omit({id:!0,createdAt:!0}),G9=j9.omit({id:!0,createdAt:!0}),K9=N9.omit({id:!0,createdAt:!0}),Q9=S9.omit({id:!0,createdAt:!0});k9.omit({id:!0,createdAt:!0});const X9=C9.omit({id:!0,createdAt:!0});E9.omit({id:!0,addedAt:!0});const W9=A9.omit({id:!0,createdAt:!0}),hC=R9.omit({id:!0,createdAt:!0}),J9=T9.omit({id:!0,lastReadAt:!0}),e$=dC.omit({id:!0,createdAt:!0});_9.omit({id:!0,createdAt:!0});const t$=M9.omit({id:!0,createdAt:!0,updatedAt:!0}),n$=D9.omit({id:!0,createdAt:!0,updatedAt:!0}),r$=O9.omit({id:!0,createdAt:!0,updatedAt:!0}),a$=z9.omit({id:!0,createdAt:!0,updatedAt:!0}),s$=P9.omit({id:!0,createdAt:!0,updatedAt:!0}),o$=L9.omit({id:!0,createdAt:!0,updatedAt:!0}),i$=$9.omit({id:!0,createdAt:!0,updatedAt:!0}),l$=I9.omit({id:!0,createdAt:!0,updatedAt:!0}),c$=U9.omit({id:!0,createdAt:!0,updatedAt:!0}),u$=B9.omit({id:!0,createdAt:!0,updatedAt:!0}),d$=V9.omit({id:!0,createdAt:!0,updatedAt:!0}),f$=H9.omit({id:!0,createdAt:!0,updatedAt:!0}),h$=F9.omit({id:!0,createdAt:!0,updatedAt:!0});q9.partial();Y9.partial();Z9.partial();fC.partial();G9.partial();K9.partial();Q9.partial();X9.partial();W9.partial();hC.partial();J9.partial();e$.partial();t$.partial();n$.partial();r$.partial();a$.partial();s$.partial();o$.partial();i$.partial();l$.partial();c$.partial();u$.partial();d$.partial();f$.partial();h$.partial();dC.extend({user:rt({name:U(),avatar:U().optional()}),likes:vt().optional(),liked:Aa().optional()});vg.extend({works_count:Pu().int().optional(),average_rating:Pu().optional(),followers_count:Pu().int().optional(),total_reads:Pu().int().optional()});rt({success:Aa(),data:ps().optional(),error:U().optional(),message:U().optional()});rt({data:hf(ps()),pagination:rt({page:vt(),limit:vt(),total:vt(),totalPages:vt()})});const yg=e8,mC=x.createContext({}),En=({...e})=>a.jsx(mC.Provider,{value:{name:e.name},children:a.jsx(a8,{...e})}),pf=()=>{const e=x.useContext(mC),t=x.useContext(pC),{getFieldState:r,formState:o}=ji(),l=r(e.name,o);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:u}=t;return{id:u,name:e.name,formItemId:`${u}-form-item`,formDescriptionId:`${u}-form-item-description`,formMessageId:`${u}-form-item-message`,...l}},pC=x.createContext({}),jn=x.forwardRef(({className:e,...t},r)=>{const o=x.useId();return a.jsx(pC.Provider,{value:{id:o},children:a.jsx("div",{ref:r,className:je("space-y-2",e),...t})})});jn.displayName="FormItem";const gn=x.forwardRef(({className:e,...t},r)=>{const{error:o,formItemId:l}=pf();return a.jsx(_n,{ref:r,className:je(o&&"text-destructive",e),htmlFor:l,...t})});gn.displayName="FormLabel";const Nn=x.forwardRef(({...e},t)=>{const{error:r,formItemId:o,formDescriptionId:l,formMessageId:u}=pf();return a.jsx(ij,{ref:t,id:o,"aria-describedby":r?`${l} ${u}`:`${l}`,"aria-invalid":!!r,...e})});Nn.displayName="FormControl";const An=x.forwardRef(({className:e,...t},r)=>{const{formDescriptionId:o}=pf();return a.jsx("p",{ref:r,id:o,className:je("text-sm text-muted-foreground",e),...t})});An.displayName="FormDescription";const Jn=x.forwardRef(({className:e,children:t,...r},o)=>{const{error:l,formMessageId:u}=pf(),d=l?String(l?.message??""):t;return d?a.jsx("p",{ref:o,id:u,className:je("text-sm font-medium text-destructive",e),...r,children:d}):null});Jn.displayName="FormMessage";const d1=Gx,m$=Kx,xC=x.forwardRef(({className:e,...t},r)=>a.jsx(ef,{ref:r,className:je("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}));xC.displayName=ef.displayName;const Vp=x.forwardRef(({className:e,children:t,...r},o)=>a.jsxs(m$,{children:[a.jsx(xC,{}),a.jsxs(tf,{ref:o,className:je("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,a.jsxs(af,{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:[a.jsx(Td,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Vp.displayName=tf.displayName;const Hp=({className:e,...t})=>a.jsx("div",{className:je("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Hp.displayName="DialogHeader";const Fp=({className:e,...t})=>a.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Fp.displayName="DialogFooter";const qp=x.forwardRef(({className:e,...t},r)=>a.jsx(nf,{ref:r,className:je("text-lg font-semibold leading-none tracking-tight",e),...t}));qp.displayName=nf.displayName;const Yp=x.forwardRef(({className:e,...t},r)=>a.jsx(rf,{ref:r,className:je("text-sm text-muted-foreground",e),...t}));Yp.displayName=rf.displayName;const xs=x.forwardRef(({className:e,...t},r)=>a.jsx("textarea",{className:je("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base 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 md:text-sm",e),ref:r,...t}));xs.displayName="Textarea";function p$({value:e="",onChange:t,placeholder:r="Write your content here...",height:o="min-h-[300px]",showPreview:l=!0,className:u="",disabled:d=!1}){const[f,m]=x.useState(e),[p,v]=x.useState("write"),[y,b]=x.useState(!1),[S,N]=x.useState(!1),[w,C]=x.useState(""),[k,E]=x.useState(""),[R,T]=x.useState(""),[z,ne]=x.useState(""),$=x.useRef(null);x.useEffect(()=>{e!==f&&m(e)},[e,f]),x.useEffect(()=>{t&&f!==e&&t(f)},[f,t,e]);const V=(B,ge="",fe="")=>{if(!$.current)return;const ye=$.current,_e=ye.selectionStart,G=ye.selectionEnd,he=ye.value.substring(_e,G)||fe,Be=ye.value.substring(0,_e)+B+he+ge+ye.value.substring(G);m(Be),setTimeout(()=>{ye.focus();const He=_e+B.length+he.length+ge.length;ye.setSelectionRange(He,He)},0)},J=()=>V("**","**","bold text"),se=()=>V("*","*","italic text"),ie=()=>V("<u>","</u>","underlined text"),te=()=>V("# ","","Heading 1"),q=()=>V("## ","","Heading 2"),de=()=>V("- ","","List item"),me=()=>V("1. ","","List item"),O=()=>V("> ","","Blockquote"),L=()=>V("```\n","\n```","code"),F=()=>{if(!w)return;const B=`[${k||w}](${w})`;V(B,"",""),b(!1),C(""),E("")},Q=()=>{if(!R)return;const B=``;V(B,"",""),N(!1),T(""),ne("")},_=()=>{let B=f;return B=B.replace(/^# (.*$)/gm,"<h1>$1</h1>"),B=B.replace(/^## (.*$)/gm,"<h2>$1</h2>"),B=B.replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>"),B=B.replace(/\*(.*?)\*/g,"<em>$1</em>"),B=B.replace(/\[(.*?)\]\((.*?)\)/g,'<a href="$2" class="text-primary hover:underline">$1</a>'),B=B.replace(/!\[(.*?)\]\((.*?)\)/g,'<img src="$2" alt="$1" class="max-w-full h-auto" />'),B=B.replace(/^- (.*$)/gm,"<li>$1</li>"),B=B.replace(/(<li>.*<\/li>)/g,"<ul>$1</ul>"),B=B.replace(/^\d+\. (.*$)/gm,"<li>$1</li>"),B=B.replace(/(<li>.*<\/li>)/g,"<ol>$1</ol>"),B=B.replace(/^> (.*$)/gm,"<blockquote class='pl-4 border-l-4 border-gray-300 italic'>$1</blockquote>"),B=B.replace(/```([\s\S]*?)```/g,'<pre class="bg-gray-100 dark:bg-gray-800 p-4 rounded overflow-x-auto"><code>$1</code></pre>'),B=B.replace(/\n/g,"<br />"),B};return a.jsxs("div",{className:`border rounded-md ${u}`,children:[l?a.jsxs(Ns,{defaultValue:"write",value:p,onValueChange:v,children:[a.jsx("div",{className:"border-b px-3 py-1",children:a.jsxs(_a,{className:"grid w-[200px] grid-cols-2",children:[a.jsx(gt,{value:"write",children:"Write"}),a.jsx(gt,{value:"preview",children:"Preview"})]})}),a.jsxs(dn,{value:"write",className:"mt-0",children:[a.jsx(f1,{onBold:J,onItalic:se,onUnderline:ie,onH1:te,onH2:q,onUl:de,onOl:me,onLink:()=>b(!0),onQuote:O,onCode:L,onImage:()=>N(!0),disabled:d}),a.jsx(xs,{ref:$,value:f,onChange:B=>m(B.target.value),placeholder:r,className:`resize-y border-0 focus-visible:ring-0 focus-visible:ring-transparent ${o}`,disabled:d})]}),a.jsx(dn,{value:"preview",className:"mt-0",children:f?a.jsx("div",{className:`p-3 prose prose-sm md:prose dark:prose-invert max-w-none ${o} overflow-auto`,dangerouslySetInnerHTML:{__html:_()}}):a.jsx("div",{className:`p-3 text-gray-400 italic ${o}`,children:'Nothing to preview. Start writing in the "Write" tab.'})})]}):a.jsxs(a.Fragment,{children:[a.jsx(f1,{onBold:J,onItalic:se,onUnderline:ie,onH1:te,onH2:q,onUl:de,onOl:me,onLink:()=>b(!0),onQuote:O,onCode:L,onImage:()=>N(!0),disabled:d}),a.jsx(xs,{ref:$,value:f,onChange:B=>m(B.target.value),placeholder:r,className:`resize-y border-0 focus-visible:ring-0 focus-visible:ring-transparent ${o}`,disabled:d})]}),a.jsx(d1,{open:y,onOpenChange:b,children:a.jsxs(Vp,{children:[a.jsxs(Hp,{children:[a.jsx(qp,{children:"Insert Link"}),a.jsx(Yp,{children:"Add the URL and text for your link"})]}),a.jsxs("div",{className:"grid gap-4 py-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(_n,{htmlFor:"url",children:"URL"}),a.jsx(tr,{id:"url",value:w,onChange:B=>C(B.target.value),placeholder:"https://example.com"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(_n,{htmlFor:"text",children:"Text"}),a.jsx(tr,{id:"text",value:k,onChange:B=>E(B.target.value),placeholder:"Link text (optional)"})]})]}),a.jsxs(Fp,{children:[a.jsx(X,{variant:"outline",onClick:()=>b(!1),children:"Cancel"}),a.jsx(X,{onClick:F,children:"Insert Link"})]})]})}),a.jsx(d1,{open:S,onOpenChange:N,children:a.jsxs(Vp,{children:[a.jsxs(Hp,{children:[a.jsx(qp,{children:"Insert Image"}),a.jsx(Yp,{children:"Add the URL and alt text for your image"})]}),a.jsxs("div",{className:"grid gap-4 py-4",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(_n,{htmlFor:"imageUrl",children:"Image URL"}),a.jsx(tr,{id:"imageUrl",value:R,onChange:B=>T(B.target.value),placeholder:"https://example.com/image.jpg"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(_n,{htmlFor:"imageAlt",children:"Alt Text"}),a.jsx(tr,{id:"imageAlt",value:z,onChange:B=>ne(B.target.value),placeholder:"Image description (for accessibility)"})]})]}),a.jsxs(Fp,{children:[a.jsx(X,{variant:"outline",onClick:()=>N(!1),children:"Cancel"}),a.jsx(X,{onClick:Q,children:"Insert Image"})]})]})})]})}function f1({onBold:e,onItalic:t,onUnderline:r,onH1:o,onH2:l,onUl:u,onOl:d,onLink:f,onQuote:m,onCode:p,onImage:v,disabled:y=!1}){return a.jsxs("div",{className:"flex flex-wrap gap-1 border-b p-2",children:[a.jsx(X,{type:"button",variant:"ghost",size:"sm",className:"px-2 h-8 w-8",onClick:e,disabled:y,title:"Bold",children:a.jsx(PT,{className:"h-4 w-4"})}),a.jsx(X,{type:"button",variant:"ghost",size:"sm",className:"px-2 h-8 w-8",onClick:t,disabled:y,title:"Italic",children:a.jsx(t_,{className:"h-4 w-4"})}),a.jsx(X,{type:"button",variant:"ghost",size:"sm",className:"px-2 h-8 w-8",onClick:r,disabled:y,title:"Underline",children:a.jsx(v_,{className:"h-4 w-4"})}),a.jsx("span",{className:"w-px h-6 bg-gray-300 dark:bg-gray-600 mx-1 self-center"}),a.jsx(X,{type:"button",variant:"ghost",size:"sm",className:"px-2 h-8 w-8",onClick:o,disabled:y,title:"Heading 1",children:a.jsx(QT,{className:"h-4 w-4"})}),a.jsx(X,{type:"button",variant:"ghost",size:"sm",className:"px-2 h-8 w-8",onClick:l,disabled:y,title:"Heading 2",children:a.jsx(XT,{className:"h-4 w-4"})}),a.jsx("span",{className:"w-px h-6 bg-gray-300 dark:bg-gray-600 mx-1 self-center"}),a.jsx(X,{type:"button",variant:"ghost",size:"sm",className:"px-2 h-8 w-8",onClick:u,disabled:y,title:"Bullet List",children:a.jsx(Rd,{className:"h-4 w-4"})}),a.jsx(X,{type:"button",variant:"ghost",size:"sm",className:"px-2 h-8 w-8",onClick:d,disabled:y,title:"Numbered List",children:a.jsx(o_,{className:"h-4 w-4"})}),a.jsx("span",{className:"w-px h-6 bg-gray-300 dark:bg-gray-600 mx-1 self-center"}),a.jsx(X,{type:"button",variant:"ghost",size:"sm",className:"px-2 h-8 w-8",onClick:f,disabled:y,title:"Insert Link",children:a.jsx(nj,{className:"h-4 w-4"})}),a.jsx(X,{type:"button",variant:"ghost",size:"sm",className:"px-2 h-8 w-8",onClick:v,disabled:y,title:"Insert Image",children:a.jsx(e_,{className:"h-4 w-4"})}),a.jsx(X,{type:"button",variant:"ghost",size:"sm",className:"px-2 h-8 w-8",onClick:m,disabled:y,title:"Blockquote",children:a.jsx(d_,{className:"h-4 w-4"})}),a.jsx(X,{type:"button",variant:"ghost",size:"sm",className:"px-2 h-8 w-8",onClick:p,disabled:y,title:"Code Block",children:a.jsx(VT,{className:"h-4 w-4"})})]})}function x$({name:e,label:t="Content",description:r="You can use markdown formatting. The article will be attributed to your account.",placeholder:o="Write your article content here..."}){const l=ji(),[u,d]=x.useState(l.getValues(e)||""),f=m=>{d(m),l.setValue(e,m,{shouldValidate:!0,shouldDirty:!0})};return a.jsx(En,{control:l.control,name:e,render:({field:m})=>a.jsxs(jn,{children:[a.jsx(gn,{children:t}),a.jsx(Nn,{children:a.jsx(p$,{value:m.value||"",onChange:f,placeholder:o,height:"min-h-96",className:"font-serif leading-relaxed"})}),a.jsx(An,{children:r}),a.jsx(Jn,{})]})})}function g$({name:e,tags:t,label:r="Tags"}){const o=ji(),[l,u]=x.useState([]),[d,f]=x.useState("");x.useEffect(()=>{const v=o.getValues(e)||[];if(t&&v.length>0){const y=v.map(b=>t.find(S=>S.id===b)).filter(Boolean);u(y)}},[t,o,e]);const m=()=>{if(!d)return;const v=t?.find(y=>y.id===d);if(v&&!l.some(y=>y.id===v.id)){u([...l,v]);const y=o.getValues(e)||[];o.setValue(e,[...y,v.id],{shouldValidate:!0})}f("")},p=v=>{u(l.filter(b=>b.id!==v));const y=o.getValues(e)||[];o.setValue(e,y.filter(b=>b!==v),{shouldValidate:!0})};return a.jsxs("div",{children:[a.jsx(gn,{children:r}),a.jsxs("div",{className:"flex flex-wrap gap-2 mb-2",children:[l.map(v=>a.jsxs(ht,{variant:"secondary",className:"px-2 py-1 flex items-center gap-1",children:[v.name,a.jsxs(X,{type:"button",variant:"ghost",size:"sm",className:"h-4 w-4 p-0 text-navy/60 dark:text-cream/60 hover:text-navy hover:dark:text-cream hover:bg-transparent",onClick:()=>p(v.id),children:[a.jsx(Td,{className:"h-3 w-3"}),a.jsxs("span",{className:"sr-only",children:["Remove ",v.name]})]})]},v.id)),l.length===0&&a.jsx("p",{className:"text-sm text-navy/60 dark:text-cream/60",children:"No tags selected"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(Bn,{value:d,onValueChange:f,children:[a.jsx(Mn,{className:"w-[200px]",children:a.jsx(Vn,{placeholder:"Select a tag"})}),a.jsx(Dn,{children:t?.map(v=>a.jsx(Qe,{value:v.id.toString(),disabled:l.some(y=>y.id===v.id),children:v.name},v.id))})]}),a.jsxs(X,{type:"button",variant:"outline",onClick:m,disabled:!d,className:"flex items-center gap-1",children:[a.jsx(aj,{className:"h-4 w-4"}),a.jsx("span",{children:"Add Tag"})]})]})]})}var xf="Switch",[v$,zV]=Qt(xf),[y$,b$]=v$(xf),gC=x.forwardRef((e,t)=>{const{__scopeSwitch:r,name:o,checked:l,defaultChecked:u,required:d,disabled:f,value:m="on",onCheckedChange:p,form:v,...y}=e,[b,S]=x.useState(null),N=Le(t,R=>S(R)),w=x.useRef(!1),C=b?v||!!b.closest("form"):!0,[k,E]=Hn({prop:l,defaultProp:u??!1,onChange:p,caller:xf});return a.jsxs(y$,{scope:r,checked:k,disabled:f,children:[a.jsx(Ee.button,{type:"button",role:"switch","aria-checked":k,"aria-required":d,"data-state":wC(k),"data-disabled":f?"":void 0,disabled:f,value:m,...y,ref:N,onClick:be(e.onClick,R=>{E(T=>!T),C&&(w.current=R.isPropagationStopped(),w.current||R.stopPropagation())})}),C&&a.jsx(bC,{control:b,bubbles:!w.current,name:o,value:m,checked:k,required:d,disabled:f,form:v,style:{transform:"translateX(-100%)"}})]})});gC.displayName=xf;var vC="SwitchThumb",yC=x.forwardRef((e,t)=>{const{__scopeSwitch:r,...o}=e,l=b$(vC,r);return a.jsx(Ee.span,{"data-state":wC(l.checked),"data-disabled":l.disabled?"":void 0,...o,ref:t})});yC.displayName=vC;var w$="SwitchBubbleInput",bC=x.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:o=!0,...l},u)=>{const d=x.useRef(null),f=Le(d,u),m=oc(r),p=ec(t);return x.useEffect(()=>{const v=d.current;if(!v)return;const y=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(y,"checked").set;if(m!==r&&S){const N=new Event("click",{bubbles:o});S.call(v,r),v.dispatchEvent(N)}},[m,r,o]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...l,tabIndex:-1,ref:f,style:{...l.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});bC.displayName=w$;function wC(e){return e?"checked":"unchecked"}var jC=gC,j$=yC;const gf=x.forwardRef(({className:e,...t},r)=>a.jsx(jC,{className:je("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r,children:a.jsx(j$,{className:je("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));gf.displayName=jC.displayName;const N$=hC.extend({tags:hf(vt()).optional()});function S$(){const[,e]=ys(),{toast:t}=Ta(),[r,o]=x.useState(!0),{data:l}=tt({queryKey:["/api/tags"]}),u=ug({resolver:dg(N$),defaultValues:{title:"",content:"",excerpt:"",authorId:"",tags:[]}}),d=Ys({mutationFn:async m=>{const p=r?{...m,publishedAt:new Date().toISOString()}:m;return await Qr("POST","/api/blog",p)},onSuccess:()=>{t({title:"Success",description:r?"Your article has been published":"Your article has been saved as a draft"}),ci.invalidateQueries({queryKey:["/api/blog"]}),e("/blog")},onError:m=>{t({title:"Error",description:"Failed to create blog post",variant:"destructive"})}}),f=m=>{d.mutate(m)};return a.jsx(Kt,{children:a.jsxs("div",{className:"max-w-5xl mx-auto px-4 py-8",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx(Ce,{href:"/blog",children:a.jsxs(X,{variant:"ghost",className:"px-0 text-navy/70 dark:text-cream/70 hover:text-navy dark:hover:text-cream hover:bg-transparent",children:[a.jsx(Xl,{className:"h-4 w-4 mr-1"}),"Back to Blog"]})}),a.jsx("h1",{className:"text-3xl font-serif font-bold text-navy dark:text-cream mt-4",children:"Write an Article"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70 mt-1",children:"Share your knowledge, insights, and perspectives on literature and translations"})]}),a.jsx("div",{className:"bg-cream dark:bg-dark-surface rounded-lg border border-sage/20 dark:border-sage/10 p-6",children:a.jsx(yg,{...u,children:a.jsxs("form",{onSubmit:u.handleSubmit(f),className:"space-y-6",children:[a.jsx(En,{control:u.control,name:"title",render:({field:m})=>a.jsxs(jn,{children:[a.jsx(gn,{children:"Title"}),a.jsx(Nn,{children:a.jsx(tr,{placeholder:"Enter a descriptive title for your article",className:"text-lg font-medium",...m})}),a.jsx(Jn,{})]})}),a.jsx(En,{control:u.control,name:"excerpt",render:({field:m})=>a.jsxs(jn,{children:[a.jsx(gn,{children:"Excerpt (Summary)"}),a.jsx(Nn,{children:a.jsx(xs,{placeholder:"Provide a short summary of your article (will appear in previews)",className:"resize-y h-20",value:m.value||"",onChange:m.onChange,onBlur:m.onBlur,name:m.name,ref:m.ref})}),a.jsx(An,{children:"A brief summary helps readers decide if they want to read the full article."}),a.jsx(Jn,{})]})}),a.jsx(g$,{name:"tags",tags:l,label:"Tags"}),a.jsx(x$,{name:"content",label:"Content",placeholder:"Write your article content here..."}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(gf,{id:"publish-now",checked:r,onCheckedChange:o}),a.jsx(_n,{htmlFor:"publish-now",children:r?"Publish immediately":"Save as draft"})]}),a.jsxs("div",{className:"flex justify-end gap-3",children:[a.jsx(X,{type:"button",variant:"outline",onClick:()=>e("/blog"),children:"Cancel"}),a.jsxs(X,{type:"submit",className:"bg-russet hover:bg-russet/90",disabled:d.isPending,children:[d.isPending&&a.jsx(lx,{className:"mr-2 h-4 w-4 animate-spin"}),r?"Publish Article":"Save Draft"]})]})]})})})]})})}function wt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function gs(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const NC=6048e5,k$=864e5,Lu=43200,h1=1440;let C$={};function uc(){return C$}function Gl(e,t){const r=uc(),o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,l=wt(e),u=l.getDay(),d=(u<o?7:0)+u-o;return l.setDate(l.getDate()-d),l.setHours(0,0,0,0),l}function bd(e){return Gl(e,{weekStartsOn:1})}function SC(e){const t=wt(e),r=t.getFullYear(),o=gs(e,0);o.setFullYear(r+1,0,4),o.setHours(0,0,0,0);const l=bd(o),u=gs(e,0);u.setFullYear(r,0,4),u.setHours(0,0,0,0);const d=bd(u);return t.getTime()>=l.getTime()?r+1:t.getTime()>=d.getTime()?r:r-1}function m1(e){const t=wt(e);return t.setHours(0,0,0,0),t}function wd(e){const t=wt(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function E$(e,t){const r=m1(e),o=m1(t),l=+r-wd(r),u=+o-wd(o);return Math.round((l-u)/k$)}function A$(e){const t=SC(e),r=gs(e,0);return r.setFullYear(t,0,4),r.setHours(0,0,0,0),bd(r)}function Yu(e,t){const r=wt(e),o=wt(t),l=r.getTime()-o.getTime();return l<0?-1:l>0?1:l}function R$(e){return gs(e,Date.now())}function T$(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function _$(e){if(!T$(e)&&typeof e!="number")return!1;const t=wt(e);return!isNaN(Number(t))}function M$(e,t){const r=wt(e),o=wt(t),l=r.getFullYear()-o.getFullYear(),u=r.getMonth()-o.getMonth();return l*12+u}function D$(e){return t=>{const o=(e?Math[e]:Math.trunc)(t);return o===0?0:o}}function O$(e,t){return+wt(e)-+wt(t)}function z$(e){const t=wt(e);return t.setHours(23,59,59,999),t}function P$(e){const t=wt(e),r=t.getMonth();return t.setFullYear(t.getFullYear(),r+1,0),t.setHours(23,59,59,999),t}function L$(e){const t=wt(e);return+z$(t)==+P$(t)}function $$(e,t){const r=wt(e),o=wt(t),l=Yu(r,o),u=Math.abs(M$(r,o));let d;if(u<1)d=0;else{r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-l*u);let f=Yu(r,o)===-l;L$(wt(e))&&u===1&&Yu(e,o)===1&&(f=!1),d=l*(u-Number(f))}return d===0?0:d}function I$(e,t,r){const o=O$(e,t)/1e3;return D$(r?.roundingMethod)(o)}function U$(e){const t=wt(e),r=gs(e,0);return r.setFullYear(t.getFullYear(),0,1),r.setHours(0,0,0,0),r}const B$={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},V$=(e,t,r)=>{let o;const l=B$[e];return typeof l=="string"?o=l:t===1?o=l.one:o=l.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+o:o+" ago":o};function lp(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const H$={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},F$={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},q$={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Y$={date:lp({formats:H$,defaultWidth:"full"}),time:lp({formats:F$,defaultWidth:"full"}),dateTime:lp({formats:q$,defaultWidth:"full"})},Z$={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},G$=(e,t,r,o)=>Z$[e];function El(e){return(t,r)=>{const o=r?.context?String(r.context):"standalone";let l;if(o==="formatting"&&e.formattingValues){const d=e.defaultFormattingWidth||e.defaultWidth,f=r?.width?String(r.width):d;l=e.formattingValues[f]||e.formattingValues[d]}else{const d=e.defaultWidth,f=r?.width?String(r.width):e.defaultWidth;l=e.values[f]||e.values[d]}const u=e.argumentCallback?e.argumentCallback(t):t;return l[u]}}const K$={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Q$={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},X$={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},W$={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},J$={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},eI={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},tI=(e,t)=>{const r=Number(e),o=r%100;if(o>20||o<10)switch(o%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},nI={ordinalNumber:tI,era:El({values:K$,defaultWidth:"wide"}),quarter:El({values:Q$,defaultWidth:"wide",argumentCallback:e=>e-1}),month:El({values:X$,defaultWidth:"wide"}),day:El({values:W$,defaultWidth:"wide"}),dayPeriod:El({values:J$,defaultWidth:"wide",formattingValues:eI,defaultFormattingWidth:"wide"})};function Al(e){return(t,r={})=>{const o=r.width,l=o&&e.matchPatterns[o]||e.matchPatterns[e.defaultMatchWidth],u=t.match(l);if(!u)return null;const d=u[0],f=o&&e.parsePatterns[o]||e.parsePatterns[e.defaultParseWidth],m=Array.isArray(f)?aI(f,y=>y.test(d)):rI(f,y=>y.test(d));let p;p=e.valueCallback?e.valueCallback(m):m,p=r.valueCallback?r.valueCallback(p):p;const v=t.slice(d.length);return{value:p,rest:v}}}function rI(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function aI(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return r}function sI(e){return(t,r={})=>{const o=t.match(e.matchPattern);if(!o)return null;const l=o[0],u=t.match(e.parsePattern);if(!u)return null;let d=e.valueCallback?e.valueCallback(u[0]):u[0];d=r.valueCallback?r.valueCallback(d):d;const f=t.slice(l.length);return{value:d,rest:f}}}const oI=/^(\d+)(th|st|nd|rd)?/i,iI=/\d+/i,lI={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},cI={any:[/^b/i,/^(a|c)/i]},uI={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},dI={any:[/1/i,/2/i,/3/i,/4/i]},fI={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},hI={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},mI={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},pI={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},xI={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},gI={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},vI={ordinalNumber:sI({matchPattern:oI,parsePattern:iI,valueCallback:e=>parseInt(e,10)}),era:Al({matchPatterns:lI,defaultMatchWidth:"wide",parsePatterns:cI,defaultParseWidth:"any"}),quarter:Al({matchPatterns:uI,defaultMatchWidth:"wide",parsePatterns:dI,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Al({matchPatterns:fI,defaultMatchWidth:"wide",parsePatterns:hI,defaultParseWidth:"any"}),day:Al({matchPatterns:mI,defaultMatchWidth:"wide",parsePatterns:pI,defaultParseWidth:"any"}),dayPeriod:Al({matchPatterns:xI,defaultMatchWidth:"any",parsePatterns:gI,defaultParseWidth:"any"})},kC={code:"en-US",formatDistance:V$,formatLong:Y$,formatRelative:G$,localize:nI,match:vI,options:{weekStartsOn:0,firstWeekContainsDate:1}};function yI(e){const t=wt(e);return E$(t,U$(t))+1}function bI(e){const t=wt(e),r=+bd(t)-+A$(t);return Math.round(r/NC)+1}function CC(e,t){const r=wt(e),o=r.getFullYear(),l=uc(),u=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??l.firstWeekContainsDate??l.locale?.options?.firstWeekContainsDate??1,d=gs(e,0);d.setFullYear(o+1,0,u),d.setHours(0,0,0,0);const f=Gl(d,t),m=gs(e,0);m.setFullYear(o,0,u),m.setHours(0,0,0,0);const p=Gl(m,t);return r.getTime()>=f.getTime()?o+1:r.getTime()>=p.getTime()?o:o-1}function wI(e,t){const r=uc(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,l=CC(e,t),u=gs(e,0);return u.setFullYear(l,0,o),u.setHours(0,0,0,0),Gl(u,t)}function jI(e,t){const r=wt(e),o=+Gl(r,t)-+wI(r,t);return Math.round(o/NC)+1}function ft(e,t){const r=e<0?"-":"",o=Math.abs(e).toString().padStart(t,"0");return r+o}const as={y(e,t){const r=e.getFullYear(),o=r>0?r:1-r;return ft(t==="yy"?o%100:o,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):ft(r+1,2)},d(e,t){return ft(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(e,t){return ft(e.getHours()%12||12,t.length)},H(e,t){return ft(e.getHours(),t.length)},m(e,t){return ft(e.getMinutes(),t.length)},s(e,t){return ft(e.getSeconds(),t.length)},S(e,t){const r=t.length,o=e.getMilliseconds(),l=Math.trunc(o*Math.pow(10,r-3));return ft(l,t.length)}},Wo={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},p1={G:function(e,t,r){const o=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(o,{width:"abbreviated"});case"GGGGG":return r.era(o,{width:"narrow"});case"GGGG":default:return r.era(o,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const o=e.getFullYear(),l=o>0?o:1-o;return r.ordinalNumber(l,{unit:"year"})}return as.y(e,t)},Y:function(e,t,r,o){const l=CC(e,o),u=l>0?l:1-l;if(t==="YY"){const d=u%100;return ft(d,2)}return t==="Yo"?r.ordinalNumber(u,{unit:"year"}):ft(u,t.length)},R:function(e,t){const r=SC(e);return ft(r,t.length)},u:function(e,t){const r=e.getFullYear();return ft(r,t.length)},Q:function(e,t,r){const o=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(o);case"QQ":return ft(o,2);case"Qo":return r.ordinalNumber(o,{unit:"quarter"});case"QQQ":return r.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(o,{width:"wide",context:"formatting"})}},q:function(e,t,r){const o=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(o);case"qq":return ft(o,2);case"qo":return r.ordinalNumber(o,{unit:"quarter"});case"qqq":return r.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(o,{width:"wide",context:"standalone"})}},M:function(e,t,r){const o=e.getMonth();switch(t){case"M":case"MM":return as.M(e,t);case"Mo":return r.ordinalNumber(o+1,{unit:"month"});case"MMM":return r.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(o,{width:"wide",context:"formatting"})}},L:function(e,t,r){const o=e.getMonth();switch(t){case"L":return String(o+1);case"LL":return ft(o+1,2);case"Lo":return r.ordinalNumber(o+1,{unit:"month"});case"LLL":return r.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(o,{width:"wide",context:"standalone"})}},w:function(e,t,r,o){const l=jI(e,o);return t==="wo"?r.ordinalNumber(l,{unit:"week"}):ft(l,t.length)},I:function(e,t,r){const o=bI(e);return t==="Io"?r.ordinalNumber(o,{unit:"week"}):ft(o,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):as.d(e,t)},D:function(e,t,r){const o=yI(e);return t==="Do"?r.ordinalNumber(o,{unit:"dayOfYear"}):ft(o,t.length)},E:function(e,t,r){const o=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(o,{width:"short",context:"formatting"});case"EEEE":default:return r.day(o,{width:"wide",context:"formatting"})}},e:function(e,t,r,o){const l=e.getDay(),u=(l-o.weekStartsOn+8)%7||7;switch(t){case"e":return String(u);case"ee":return ft(u,2);case"eo":return r.ordinalNumber(u,{unit:"day"});case"eee":return r.day(l,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(l,{width:"short",context:"formatting"});case"eeee":default:return r.day(l,{width:"wide",context:"formatting"})}},c:function(e,t,r,o){const l=e.getDay(),u=(l-o.weekStartsOn+8)%7||7;switch(t){case"c":return String(u);case"cc":return ft(u,t.length);case"co":return r.ordinalNumber(u,{unit:"day"});case"ccc":return r.day(l,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(l,{width:"narrow",context:"standalone"});case"cccccc":return r.day(l,{width:"short",context:"standalone"});case"cccc":default:return r.day(l,{width:"wide",context:"standalone"})}},i:function(e,t,r){const o=e.getDay(),l=o===0?7:o;switch(t){case"i":return String(l);case"ii":return ft(l,t.length);case"io":return r.ordinalNumber(l,{unit:"day"});case"iii":return r.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(o,{width:"short",context:"formatting"});case"iiii":default:return r.day(o,{width:"wide",context:"formatting"})}},a:function(e,t,r){const l=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(e,t,r){const o=e.getHours();let l;switch(o===12?l=Wo.noon:o===0?l=Wo.midnight:l=o/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(e,t,r){const o=e.getHours();let l;switch(o>=17?l=Wo.evening:o>=12?l=Wo.afternoon:o>=4?l=Wo.morning:l=Wo.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let o=e.getHours()%12;return o===0&&(o=12),r.ordinalNumber(o,{unit:"hour"})}return as.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):as.H(e,t)},K:function(e,t,r){const o=e.getHours()%12;return t==="Ko"?r.ordinalNumber(o,{unit:"hour"}):ft(o,t.length)},k:function(e,t,r){let o=e.getHours();return o===0&&(o=24),t==="ko"?r.ordinalNumber(o,{unit:"hour"}):ft(o,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):as.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):as.s(e,t)},S:function(e,t){return as.S(e,t)},X:function(e,t,r){const o=e.getTimezoneOffset();if(o===0)return"Z";switch(t){case"X":return g1(o);case"XXXX":case"XX":return Hs(o);case"XXXXX":case"XXX":default:return Hs(o,":")}},x:function(e,t,r){const o=e.getTimezoneOffset();switch(t){case"x":return g1(o);case"xxxx":case"xx":return Hs(o);case"xxxxx":case"xxx":default:return Hs(o,":")}},O:function(e,t,r){const o=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+x1(o,":");case"OOOO":default:return"GMT"+Hs(o,":")}},z:function(e,t,r){const o=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+x1(o,":");case"zzzz":default:return"GMT"+Hs(o,":")}},t:function(e,t,r){const o=Math.trunc(e.getTime()/1e3);return ft(o,t.length)},T:function(e,t,r){const o=e.getTime();return ft(o,t.length)}};function x1(e,t=""){const r=e>0?"-":"+",o=Math.abs(e),l=Math.trunc(o/60),u=o%60;return u===0?r+String(l):r+String(l)+t+ft(u,2)}function g1(e,t){return e%60===0?(e>0?"-":"+")+ft(Math.abs(e)/60,2):Hs(e,t)}function Hs(e,t=""){const r=e>0?"-":"+",o=Math.abs(e),l=ft(Math.trunc(o/60),2),u=ft(o%60,2);return r+l+t+u}const v1=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},EC=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},NI=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],o=r[1],l=r[2];if(!l)return v1(e,t);let u;switch(o){case"P":u=t.dateTime({width:"short"});break;case"PP":u=t.dateTime({width:"medium"});break;case"PPP":u=t.dateTime({width:"long"});break;case"PPPP":default:u=t.dateTime({width:"full"});break}return u.replace("{{date}}",v1(o,t)).replace("{{time}}",EC(l,t))},SI={p:EC,P:NI},kI=/^D+$/,CI=/^Y+$/,EI=["D","DD","YY","YYYY"];function AI(e){return kI.test(e)}function RI(e){return CI.test(e)}function TI(e,t,r){const o=_I(e,t,r);if(console.warn(o),EI.includes(e))throw new RangeError(o)}function _I(e,t,r){const o=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${o} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const MI=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,DI=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,OI=/^'([^]*?)'?$/,zI=/''/g,PI=/[a-zA-Z]/;function Zp(e,t,r){const o=uc(),l=o.locale??kC,u=o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,d=o.weekStartsOn??o.locale?.options?.weekStartsOn??0,f=wt(e);if(!_$(f))throw new RangeError("Invalid time value");let m=t.match(DI).map(v=>{const y=v[0];if(y==="p"||y==="P"){const b=SI[y];return b(v,l.formatLong)}return v}).join("").match(MI).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const y=v[0];if(y==="'")return{isToken:!1,value:LI(v)};if(p1[y])return{isToken:!0,value:v};if(y.match(PI))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:v}});l.localize.preprocessor&&(m=l.localize.preprocessor(f,m));const p={firstWeekContainsDate:u,weekStartsOn:d,locale:l};return m.map(v=>{if(!v.isToken)return v.value;const y=v.value;(RI(y)||AI(y))&&TI(y,t,String(e));const b=p1[y[0]];return b(f,y,l.localize,p)}).join("")}function LI(e){const t=e.match(OI);return t?t[1].replace(zI,"'"):e}function $I(e,t,r){const o=uc(),l=r?.locale??o.locale??kC,u=2520,d=Yu(e,t);if(isNaN(d))throw new RangeError("Invalid time value");const f=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:d});let m,p;d>0?(m=wt(t),p=wt(e)):(m=wt(e),p=wt(t));const v=I$(p,m),y=(wd(p)-wd(m))/1e3,b=Math.round((v-y)/60);let S;if(b<2)return r?.includeSeconds?v<5?l.formatDistance("lessThanXSeconds",5,f):v<10?l.formatDistance("lessThanXSeconds",10,f):v<20?l.formatDistance("lessThanXSeconds",20,f):v<40?l.formatDistance("halfAMinute",0,f):v<60?l.formatDistance("lessThanXMinutes",1,f):l.formatDistance("xMinutes",1,f):b===0?l.formatDistance("lessThanXMinutes",1,f):l.formatDistance("xMinutes",b,f);if(b<45)return l.formatDistance("xMinutes",b,f);if(b<90)return l.formatDistance("aboutXHours",1,f);if(b<h1){const N=Math.round(b/60);return l.formatDistance("aboutXHours",N,f)}else{if(b<u)return l.formatDistance("xDays",1,f);if(b<Lu){const N=Math.round(b/h1);return l.formatDistance("xDays",N,f)}else if(b<Lu*2)return S=Math.round(b/Lu),l.formatDistance("aboutXMonths",S,f)}if(S=$$(p,m),S<12){const N=Math.round(b/Lu);return l.formatDistance("xMonths",N,f)}else{const N=S%12,w=Math.trunc(S/12);return N<3?l.formatDistance("aboutXYears",w,f):N<9?l.formatDistance("overXYears",w,f):l.formatDistance("almostXYears",w+1,f)}}function II(e,t){return $I(e,R$(e),t)}function UI(){return $1.useSyncExternalStore(BI,()=>!0,()=>!1)}function BI(){return()=>{}}var bg="Avatar",[VI,PV]=Qt(bg),[HI,AC]=VI(bg),RC=x.forwardRef((e,t)=>{const{__scopeAvatar:r,...o}=e,[l,u]=x.useState("idle");return a.jsx(HI,{scope:r,imageLoadingStatus:l,onImageLoadingStatusChange:u,children:a.jsx(Ee.span,{...o,ref:t})})});RC.displayName=bg;var TC="AvatarImage",_C=x.forwardRef((e,t)=>{const{__scopeAvatar:r,src:o,onLoadingStatusChange:l=()=>{},...u}=e,d=AC(TC,r),f=FI(o,u),m=un(p=>{l(p),d.onImageLoadingStatusChange(p)});return Vt(()=>{f!=="idle"&&m(f)},[f,m]),f==="loaded"?a.jsx(Ee.img,{...u,ref:t,src:o}):null});_C.displayName=TC;var MC="AvatarFallback",DC=x.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:o,...l}=e,u=AC(MC,r),[d,f]=x.useState(o===void 0);return x.useEffect(()=>{if(o!==void 0){const m=window.setTimeout(()=>f(!0),o);return()=>window.clearTimeout(m)}},[o]),d&&u.imageLoadingStatus!=="loaded"?a.jsx(Ee.span,{...l,ref:t}):null});DC.displayName=MC;function y1(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function FI(e,{referrerPolicy:t,crossOrigin:r}){const o=UI(),l=x.useRef(null),u=o?(l.current||(l.current=new window.Image),l.current):null,[d,f]=x.useState(()=>y1(u,e));return Vt(()=>{f(y1(u,e))},[u,e]),Vt(()=>{const m=y=>()=>{f(y)};if(!u)return;const p=m("loaded"),v=m("error");return u.addEventListener("load",p),u.addEventListener("error",v),t&&(u.referrerPolicy=t),typeof r=="string"&&(u.crossOrigin=r),()=>{u.removeEventListener("load",p),u.removeEventListener("error",v)}},[u,r,t]),d}var OC=RC,zC=_C,PC=DC;const di=x.forwardRef(({className:e,...t},r)=>a.jsx(OC,{ref:r,className:je("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));di.displayName=OC.displayName;const dc=x.forwardRef(({className:e,...t},r)=>a.jsx(zC,{ref:r,className:je("aspect-square h-full w-full",e),...t}));dc.displayName=zC.displayName;const fi=x.forwardRef(({className:e,...t},r)=>a.jsx(PC,{ref:r,className:je("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));fi.displayName=PC.displayName;function qI(){const{slug:e}=Ql(),{toast:t}=Ta(),[r,o]=x.useState(""),[l,u]=x.useState(!1),[d,f]=x.useState(!1),{data:m,isLoading:p,error:v}=tt({queryKey:[`/api/blog/${e}`]}),y=Ys({mutationFn:async k=>await Qr("POST","/api/comments",{userId:1,content:k,entityType:"blogPost",entityId:m?.id}),onSuccess:()=>{t({description:"Comment added successfully"}),o(""),ci.invalidateQueries({queryKey:[`/api/blog/${e}`]})},onError:k=>{t({title:"Error",description:"Failed to add comment",variant:"destructive"})}}),b=Ys({mutationFn:async()=>await Qr("POST","/api/likes",{userId:1,entityType:"blogPost",entityId:m?.id}),onSuccess:()=>{u(!l),t({description:l?"Removed like":"Added like"}),ci.invalidateQueries({queryKey:[`/api/blog/${e}`]})},onError:k=>{t({title:"Error",description:"Failed to update like",variant:"destructive"})}}),S=Ys({mutationFn:async()=>await Qr("POST","/api/bookmarks",{userId:1,entityType:"blogPost",entityId:m?.id}),onSuccess:()=>{f(!d),t({description:d?"Removed from bookmarks":"Added to bookmarks"})},onError:k=>{t({title:"Error",description:"Failed to update bookmark",variant:"destructive"})}}),N=async()=>{try{navigator.share?await navigator.share({title:m?.title||"Tercul Blog Post",text:m?.excerpt||"Check out this article on Tercul",url:window.location.href}):(navigator.clipboard.writeText(window.location.href),t({description:"Link copied to clipboard"}))}catch(k){console.error("Error sharing:",k)}},w=()=>{r.trim()&&y.mutate(r)},C=k=>k?Zp(new Date(k),"MMMM d, yyyy"):"";return p?a.jsx(Kt,{children:a.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-8",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx(Pe,{className:"h-8 w-3/4 mb-2"}),a.jsx(Pe,{className:"h-4 w-1/3 mb-4"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Pe,{className:"h-10 w-10 rounded-full"}),a.jsx(Pe,{className:"h-4 w-32"})]})]}),a.jsx(Pe,{className:"h-64 w-full mb-8"}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(Pe,{className:"h-20 w-full"}),a.jsx(Pe,{className:"h-20 w-full"}),a.jsx(Pe,{className:"h-20 w-full"})]})]})}):v||!m?a.jsx(Kt,{children:a.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-16 text-center",children:[a.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Blog post not found"}),a.jsx("p",{className:"mb-6",children:"The article you're looking for could not be found."}),a.jsx(Ce,{href:"/blog",children:a.jsx(X,{className:"bg-russet hover:bg-russet/90",children:"Back to Blog"})})]})}):a.jsx(Kt,{children:a.jsxs("article",{className:"max-w-4xl mx-auto px-4 py-8",children:[a.jsx("div",{className:"mb-4",children:a.jsx(Ce,{href:"/blog",children:a.jsxs(X,{variant:"ghost",className:"px-0 text-navy/70 dark:text-cream/70 hover:text-navy dark:hover:text-cream hover:bg-transparent",children:[a.jsx(Xl,{className:"h-4 w-4 mr-1"}),"Back to Blog"]})})}),a.jsxs("header",{className:"mb-8",children:[a.jsx("h1",{className:"text-3xl md:text-4xl font-serif font-bold text-navy dark:text-cream mb-3",children:m.title}),a.jsxs("div",{className:"flex items-center gap-3 mb-4 flex-wrap",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm text-navy/60 dark:text-cream/60",children:[a.jsx(Zs,{className:"h-4 w-4"}),a.jsx("span",{children:C(m.publishedAt||m.createdAt)})]}),a.jsx(fd,{orientation:"vertical",className:"h-4"}),a.jsxs("div",{className:"flex items-center gap-2 text-sm text-navy/60 dark:text-cream/60",children:[a.jsx(Wu,{className:"h-4 w-4"}),a.jsxs("span",{children:[Math.ceil(m.content.length/1e3)," min read"]})]}),m.tags&&m.tags.length>0&&a.jsxs(a.Fragment,{children:[a.jsx(fd,{orientation:"vertical",className:"h-4"}),a.jsx("div",{className:"flex flex-wrap gap-1",children:m.tags.map(k=>a.jsx(ht,{variant:"outline",className:"text-xs",children:k.name},k.id))})]})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs(di,{className:"h-10 w-10",children:[a.jsx(dc,{src:m.author?.avatar||"",alt:m.author?.displayName||"Author"}),a.jsx(fi,{children:m.author?.displayName?.charAt(0)||"A"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-navy dark:text-cream",children:m.author?.displayName||"Anonymous"}),a.jsx("p",{className:"text-xs text-navy/60 dark:text-cream/60",children:m.author?.role||"Contributor"})]})]})]}),a.jsx("div",{className:"blog-content prose prose-russet dark:prose-invert max-w-none mb-8",children:a.jsx("div",{dangerouslySetInnerHTML:{__html:m.content}})}),a.jsxs("footer",{className:"border-t border-sage/20 dark:border-sage/10 pt-6",children:[a.jsxs("div",{className:"flex flex-wrap justify-between items-center mb-8",children:[a.jsxs("div",{className:"flex gap-4",children:[a.jsxs(X,{variant:"outline",size:"sm",className:`flex items-center gap-1 ${l?"text-russet":""}`,onClick:()=>b.mutate(),disabled:b.isPending,children:[a.jsx(oj,{className:`h-4 w-4 ${l?"fill-russet":""}`}),a.jsxs("span",{children:[m.likeCount||0," Likes"]})]}),a.jsxs(X,{variant:"outline",size:"sm",className:"flex items-center gap-1",onClick:N,children:[a.jsx(cx,{className:"h-4 w-4"}),a.jsx("span",{children:"Share"})]}),a.jsxs(X,{variant:"outline",size:"sm",className:`flex items-center gap-1 ${d?"text-russet":""}`,onClick:()=>S.mutate(),disabled:S.isPending,children:[d?a.jsx(Q1,{className:"h-4 w-4 fill-russet"}):a.jsx(LT,{className:"h-4 w-4"}),a.jsx("span",{children:d?"Saved":"Save"})]})]}),m.author?.id==="1"&&a.jsx(Ce,{href:`/blog/${e}/edit`,children:a.jsxs(X,{variant:"outline",size:"sm",className:"flex items-center gap-1",children:[a.jsx(cs,{className:"h-4 w-4"}),a.jsx("span",{children:"Edit Article"})]})})]}),a.jsxs("div",{className:"mb-8",children:[a.jsxs("h3",{className:"text-xl font-serif font-medium mb-4 flex items-center gap-2",children:[a.jsx($l,{className:"h-5 w-5 text-russet"}),a.jsxs("span",{children:["Comments (",m.commentCount||0,")"]})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx(xs,{placeholder:"Share your thoughts on this article...",value:r,onChange:k=>o(k.target.value),className:"min-h-24 resize-y mb-2"}),a.jsx("div",{className:"flex justify-end",children:a.jsxs(X,{className:"bg-russet hover:bg-russet/90",onClick:w,disabled:!r.trim()||y.isPending,children:[a.jsx(HT,{className:"h-4 w-4 mr-2"}),y.isPending?"Posting...":"Post Comment"]})})]}),m.comments&&m.comments.length>0?a.jsx("div",{className:"space-y-6",children:a.jsxs("div",{className:"p-4 border border-sage/20 dark:border-sage/10 rounded-lg",children:[a.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[a.jsx(di,{className:"h-8 w-8",children:a.jsx(fi,{children:"U"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-navy dark:text-cream",children:"Reader"}),a.jsx("p",{className:"text-xs text-navy/60 dark:text-cream/60",children:"3 days ago"})]})]}),a.jsx("p",{className:"text-navy/80 dark:text-cream/80",children:"This is a sample comment. In a real implementation, comments would be loaded from the API."})]})}):a.jsxs("div",{className:"text-center py-8 border border-dashed border-navy/20 dark:border-cream/20 rounded-lg",children:[a.jsx($l,{className:"h-12 w-12 mx-auto text-navy/30 dark:text-cream/30 mb-3"}),a.jsx("h4",{className:"text-lg font-medium mb-2",children:"No comments yet"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70 mb-4",children:"Be the first to share your thoughts on this article."})]})]}),a.jsxs("div",{children:[a.jsxs("h3",{className:"text-xl font-serif font-medium mb-4 flex items-center gap-2",children:[a.jsx(Rr,{className:"h-5 w-5 text-russet"}),a.jsx("span",{children:"Related Articles"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:a.jsx("div",{className:"p-4 border border-sage/20 dark:border-sage/10 rounded-lg",children:a.jsx("p",{className:"text-navy/60 dark:text-cream/60 text-sm mb-2",children:"Related articles will be displayed here based on similar tags or topics."})})})]})]})]})})}function YI(){const[e,t]=x.useState(""),[r,o]=x.useState("all"),{data:l,isLoading:u,error:d}=tt({queryKey:["/api/blog"]}),f=l?.filter(p=>{const v=e===""||p.title.toLowerCase().includes(e.toLowerCase())||p.excerpt?.toLowerCase().includes(e.toLowerCase())||p.tags?.some(y=>y.name.toLowerCase().includes(e.toLowerCase()));if(r==="all")return v;if(r==="popular")return v&&p.likeCount>5;if(r==="recent"){const y=new Date;return y.setDate(y.getDate()-30),v&&new Date(p.publishedAt||p.createdAt)>=y}return v}),m=p=>p?II(new Date(p),{addSuffix:!0}):"";return a.jsx(Kt,{children:a.jsxs("section",{className:"max-w-5xl mx-auto px-4 py-8",children:[a.jsxs("div",{className:"flex justify-between items-center mb-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-3xl font-serif font-bold text-navy dark:text-cream",children:"Literary Blog"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70 mt-1",children:"Articles, essays, and discussions on literature, translations, and the literary world"})]}),a.jsx(Ce,{href:"/blog/create",children:a.jsxs(X,{className:"bg-russet text-white hover:bg-russet/90 flex items-center gap-2",children:[a.jsx(cs,{className:"h-4 w-4"}),a.jsx("span",{children:"Write Article"})]})})]}),a.jsxs("div",{className:"mb-8 flex flex-col sm:flex-row justify-between gap-4",children:[a.jsx(Ns,{defaultValue:"all",className:"w-full sm:w-auto",onValueChange:o,children:a.jsxs(_a,{children:[a.jsx(gt,{value:"all",children:"All Articles"}),a.jsx(gt,{value:"popular",children:"Popular"}),a.jsx(gt,{value:"recent",children:"Recent"})]})}),a.jsxs("div",{className:"relative w-full sm:w-64",children:[a.jsx(Xs,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-navy/50 dark:text-cream/50"}),a.jsx(tr,{type:"search",placeholder:"Search articles...",className:"pl-9 w-full",value:e,onChange:p=>t(p.target.value)})]})]}),u?a.jsx("div",{className:"space-y-6",children:Array.from({length:3}).map((p,v)=>a.jsxs(Oe,{className:"relative overflow-hidden",children:[a.jsxs(zt,{className:"pb-2",children:[a.jsx(Pe,{className:"h-4 w-20 mb-1"}),a.jsx(Pe,{className:"h-7 w-3/4 mb-1"}),a.jsx(Pe,{className:"h-5 w-1/3"})]}),a.jsx(Ve,{className:"pb-2",children:a.jsx(Pe,{className:"h-24 w-full"})}),a.jsx(Ea,{children:a.jsx(Pe,{className:"h-4 w-32"})})]},v))}):d?a.jsxs("div",{className:"text-center py-12",children:[a.jsx("h3",{className:"text-xl font-medium mb-2",children:"Failed to load blog posts"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70 mb-4",children:"There was an error retrieving the blog articles. Please try again later."}),a.jsx(X,{variant:"outline",onClick:()=>window.location.reload(),children:"Refresh"})]}):f?.length===0?a.jsxs("div",{className:"text-center py-12 border border-dashed border-navy/20 dark:border-cream/20 rounded-lg",children:[a.jsx(Rr,{className:"h-16 w-16 mx-auto text-navy/30 dark:text-cream/30 mb-4"}),a.jsx("h3",{className:"text-xl font-medium mb-2",children:"No articles found"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70 mb-4",children:e?"No articles match your search query. Try different keywords.":"There are no blog posts yet. Be the first to contribute!"}),a.jsx(Ce,{href:"/blog/create",children:a.jsx(X,{className:"bg-russet text-white hover:bg-russet/90",children:"Write an Article"})})]}):a.jsxs("div",{className:"space-y-6",children:[f?.map(p=>a.jsx(Ce,{href:`/blog/${p.slug}`,children:a.jsxs(Oe,{className:"hover:shadow-md transition-shadow cursor-pointer relative overflow-hidden group",children:[p.likeCount>10&&a.jsx("div",{className:"absolute top-0 right-0 bg-russet text-white text-xs py-1 px-2 rounded-bl-md",children:"Popular"}),a.jsxs(zt,{className:"pb-2",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm text-navy/60 dark:text-cream/60",children:[a.jsx(Zs,{className:"h-3.5 w-3.5"}),a.jsx("span",{children:m(p.publishedAt||p.createdAt)})]}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"flex items-center gap-1 text-sm text-navy/60 dark:text-cream/60",children:[a.jsx($l,{className:"h-3.5 w-3.5"}),a.jsx("span",{children:p.commentCount})]}),a.jsxs("div",{className:"flex items-center gap-1 text-sm text-navy/60 dark:text-cream/60",children:[a.jsx(oj,{className:"h-3.5 w-3.5"}),a.jsx("span",{children:p.likeCount})]})]})]}),a.jsx(Gt,{className:"text-xl font-serif group-hover:text-russet transition-colors",children:p.title}),p.tags&&p.tags.length>0&&a.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:p.tags.map(v=>a.jsx(ht,{variant:"outline",className:"text-xs",children:v.name},v.id))})]}),a.jsx(Ve,{className:"pb-2",children:a.jsx(Xr,{className:"text-navy/70 dark:text-cream/70 line-clamp-3",children:p.excerpt||""})}),a.jsx(Ea,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(di,{className:"h-6 w-6",children:[a.jsx(dc,{src:p.author?.avatar||"",alt:p.author?.displayName||"Author"}),a.jsx(fi,{className:"text-xs",children:p.author?.displayName?.charAt(0)||"A"})]}),a.jsx("span",{className:"text-sm text-navy/80 dark:text-cream/80",children:p.author?.displayName||"Anonymous"})]})})]})},p.id)),l&&l.length>0&&a.jsx("div",{className:"flex justify-center pt-4",children:a.jsxs(X,{variant:"outline",disabled:!0,children:[a.jsx(Wu,{className:"mr-2 h-4 w-4"}),"Load more articles"]})})]})]})})}function ZI(){const[e,t]=x.useState(""),{data:r,isLoading:o}=tt({queryKey:["/api/collections"]}),l=r?.filter(u=>e?u.name.toLowerCase().includes(e.toLowerCase())||u.description?.toLowerCase().includes(e.toLowerCase()):!0);return a.jsx(Kt,{children:a.jsxs("div",{className:"max-w-[var(--content-width)] mx-auto px-4 md:px-6 py-8",children:[a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 mb-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl md:text-3xl font-bold font-serif text-navy dark:text-cream",children:"Collections"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70 mt-1",children:"Curated sets of works organized by theme, author, or genre"})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Xd,{placeholder:"Search collections...",onSearch:u=>t(u)}),a.jsx(Ce,{href:"/collections/create",children:a.jsxs(X,{className:"bg-russet hover:bg-russet/90 text-white",children:[a.jsx(aj,{className:"mr-1 h-4 w-4"})," Create"]})})]})]}),o?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:Array.from({length:6}).map((u,d)=>a.jsxs(Oe,{className:"bg-cream dark:bg-dark-surface",children:[a.jsxs(zt,{children:[a.jsx(Pe,{className:"h-7 w-3/4 mb-2"}),a.jsx(Pe,{className:"h-4 w-full"})]}),a.jsx(Ve,{children:a.jsx(Pe,{className:"h-16 w-full"})}),a.jsx(Ea,{children:a.jsx(Pe,{className:"h-8 w-full"})})]},d))}):l?.length?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:l.map(u=>a.jsxs(Oe,{className:"bg-cream dark:bg-dark-surface hover:shadow-md transition-shadow",children:[a.jsxs(zt,{children:[a.jsx(Gt,{className:"font-serif",children:u.name}),a.jsxs(Xr,{children:[u.description?.slice(0,100),(u.description?.length??0)>100?"...":""]})]}),a.jsxs(Ve,{className:"text-sm text-navy/70 dark:text-cream/70 space-y-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(y_,{className:"h-4 w-4"}),a.jsxs("span",{children:["Created by User ",u.userId]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Rr,{className:"h-4 w-4"}),a.jsxs("span",{children:[Math.floor(Math.random()*20)+1," works"]})," "]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Zs,{className:"h-4 w-4"}),a.jsxs("span",{children:["Updated"," ",new Date(u.createdAt).toLocaleDateString()]})]})]}),a.jsx(Ea,{children:a.jsx(Ce,{href:`/collections/${u.slug}`,className:"w-full",children:a.jsx(X,{variant:"outline",className:"w-full text-russet border-russet/30",children:"Explore Collection"})})})]},u.id))}):a.jsxs("div",{className:"text-center py-12",children:[a.jsx("h2",{className:"text-xl font-serif mb-2",children:"No collections found"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70 mb-6",children:e?`No collections matching "${e}"`:"There are no collections yet"}),a.jsx(Ce,{href:"/collections/create",children:a.jsx(X,{children:"Create a Collection"})})]})]})})}const GI=rt({name:U().min(3,{message:"Collection name must be at least 3 characters"}).max(100),description:U().max(500,{message:"Description must not exceed 500 characters"}).optional(),isPublic:Aa().default(!0)});function KI(){const[,e]=ys(),{toast:t}=Ta(),r=ug({resolver:dg(GI),defaultValues:{name:"",description:"",isPublic:!0}}),o=Ys({mutationFn:async u=>await Qr("POST","/api/collections",{name:u.name,description:u.description||"",isPublic:u.isPublic,userId:1}),onSuccess:u=>{t({title:"Collection created",description:"Your collection has been created successfully"}),ci.invalidateQueries({queryKey:["/api/collections"]}),e("/collections")},onError:u=>{t({title:"Error",description:`Failed to create collection: ${u.message}`,variant:"destructive"})}}),l=u=>{o.mutate(u)};return a.jsx(Kt,{children:a.jsxs("div",{className:"max-w-3xl mx-auto py-8 px-4 md:px-6",children:[a.jsxs("div",{className:"mb-8",children:[a.jsx("h1",{className:"text-2xl md:text-3xl font-bold font-serif text-navy dark:text-cream mb-2",children:"Create a Collection"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70",children:"Collections help you organize literary works into themed groups that you can share with others."})]}),a.jsx("div",{className:"bg-cream dark:bg-dark-surface p-6 rounded-lg shadow-sm border border-sage/10 dark:border-sage/5",children:a.jsx(yg,{...r,children:a.jsxs("form",{onSubmit:r.handleSubmit(l),className:"space-y-6",children:[a.jsx(En,{control:r.control,name:"name",render:({field:u})=>a.jsxs(jn,{children:[a.jsx(gn,{children:"Collection Name"}),a.jsx(Nn,{children:a.jsx(tr,{placeholder:"Enter collection name",...u})}),a.jsx(An,{children:"Choose a descriptive name for your collection"}),a.jsx(Jn,{})]})}),a.jsx(En,{control:r.control,name:"description",render:({field:u})=>a.jsxs(jn,{children:[a.jsx(gn,{children:"Description"}),a.jsx(Nn,{children:a.jsx(xs,{placeholder:"Describe what this collection is about",className:"min-h-24 resize-y",...u})}),a.jsx(An,{children:"Provide a brief description of your collection (optional)"}),a.jsx(Jn,{})]})}),a.jsx(En,{control:r.control,name:"isPublic",render:({field:u})=>a.jsxs(jn,{className:"flex flex-row items-center justify-between rounded-lg border border-sage/10 dark:border-sage/5 p-4",children:[a.jsxs("div",{className:"space-y-0.5",children:[a.jsx(gn,{className:"text-base",children:"Public Collection"}),a.jsxs(An,{children:["When enabled, your collection will be visible to all users.",a.jsx("br",{}),"Private collections are only visible to you."]})]}),a.jsx(Nn,{children:a.jsx(gf,{checked:u.value,onCheckedChange:u.onChange})})]})}),a.jsxs("div",{className:"flex justify-end gap-4 pt-4",children:[a.jsx(X,{type:"button",variant:"outline",onClick:()=>e("/collections"),children:"Cancel"}),a.jsxs(X,{type:"submit",disabled:o.isPending,children:[o.isPending&&a.jsx(lx,{className:"mr-2 h-4 w-4 animate-spin"}),"Create Collection"]})]})]})})})]})})}async function QI(e){return Qr("GET",`/api/blog/${e}`)}async function XI(e,t){return Qr("PUT",`/api/blog/${e}`,t)}/**
|
||
* react-router v7.8.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 vn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ra(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Gp({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function wg(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let o=e.indexOf("?");o>=0&&(t.search=e.substring(o),e=e.substring(0,o)),e&&(t.pathname=e)}return t}function LC(e,t,r="/"){return WI(e,t,r,!1)}function WI(e,t,r,o){let l=typeof t=="string"?wg(t):t,u=vs(l.pathname||"/",r);if(u==null)return null;let d=$C(e);JI(d);let f=null;for(let m=0;f==null&&m<d.length;++m){let p=uU(u);f=lU(d[m],p,o)}return f}function $C(e,t=[],r=[],o=""){let l=(u,d,f)=>{let m={relativePath:f===void 0?u.path||"":f,caseSensitive:u.caseSensitive===!0,childrenIndex:d,route:u};m.relativePath.startsWith("/")&&(vn(m.relativePath.startsWith(o),`Absolute route path "${m.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(o.length));let p=Sa([o,m.relativePath]),v=r.concat(m);u.children&&u.children.length>0&&(vn(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),$C(u.children,t,v,p)),!(u.path==null&&!u.index)&&t.push({path:p,score:oU(p,u.index),routesMeta:v})};return e.forEach((u,d)=>{if(u.path===""||!u.path?.includes("?"))l(u,d);else for(let f of IC(u.path))l(u,d,f)}),t}function IC(e){let t=e.split("/");if(t.length===0)return[];let[r,...o]=t,l=r.endsWith("?"),u=r.replace(/\?$/,"");if(o.length===0)return l?[u,""]:[u];let d=IC(o.join("/")),f=[];return f.push(...d.map(m=>m===""?u:[u,m].join("/"))),l&&f.push(...d),f.map(m=>e.startsWith("/")&&m===""?"/":m)}function JI(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:iU(t.routesMeta.map(o=>o.childrenIndex),r.routesMeta.map(o=>o.childrenIndex)))}var eU=/^:[\w-]+$/,tU=3,nU=2,rU=1,aU=10,sU=-2,b1=e=>e==="*";function oU(e,t){let r=e.split("/"),o=r.length;return r.some(b1)&&(o+=sU),t&&(o+=nU),r.filter(l=>!b1(l)).reduce((l,u)=>l+(eU.test(u)?tU:u===""?rU:aU),o)}function iU(e,t){return e.length===t.length&&e.slice(0,-1).every((o,l)=>o===t[l])?e[e.length-1]-t[t.length-1]:0}function lU(e,t,r=!1){let{routesMeta:o}=e,l={},u="/",d=[];for(let f=0;f<o.length;++f){let m=o[f],p=f===o.length-1,v=u==="/"?t:t.slice(u.length)||"/",y=jd({path:m.relativePath,caseSensitive:m.caseSensitive,end:p},v),b=m.route;if(!y&&p&&r&&!o[o.length-1].route.index&&(y=jd({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},v)),!y)return null;Object.assign(l,y.params),d.push({params:l,pathname:Sa([u,y.pathname]),pathnameBase:mU(Sa([u,y.pathnameBase])),route:b}),y.pathnameBase!=="/"&&(u=Sa([u,y.pathnameBase]))}return d}function jd(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,o]=cU(e.path,e.caseSensitive,e.end),l=t.match(r);if(!l)return null;let u=l[0],d=u.replace(/(.)\/+$/,"$1"),f=l.slice(1);return{params:o.reduce((p,{paramName:v,isOptional:y},b)=>{if(v==="*"){let N=f[b]||"";d=u.slice(0,u.length-N.length).replace(/(.)\/+$/,"$1")}const S=f[b];return y&&!S?p[v]=void 0:p[v]=(S||"").replace(/%2F/g,"/"),p},{}),pathname:u,pathnameBase:d,pattern:e}}function cU(e,t=!1,r=!0){Ra(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 o=[],l="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,f,m)=>(o.push({paramName:f,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(o.push({paramName:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,t?void 0:"i"),o]}function uU(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ra(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function vs(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,o=e.charAt(r);return o&&o!=="/"?null:e.slice(r)||"/"}function dU(e,t="/"){let{pathname:r,search:o="",hash:l=""}=typeof e=="string"?wg(e):e;return{pathname:r?r.startsWith("/")?r:fU(r,t):t,search:pU(o),hash:xU(l)}}function fU(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(l=>{l===".."?r.length>1&&r.pop():l!=="."&&r.push(l)}),r.length>1?r.join("/"):"/"}function cp(e,t,r,o){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(o)}]. 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 hU(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function UC(e){let t=hU(e);return t.map((r,o)=>o===t.length-1?r.pathname:r.pathnameBase)}function BC(e,t,r,o=!1){let l;typeof e=="string"?l=wg(e):(l={...e},vn(!l.pathname||!l.pathname.includes("?"),cp("?","pathname","search",l)),vn(!l.pathname||!l.pathname.includes("#"),cp("#","pathname","hash",l)),vn(!l.search||!l.search.includes("#"),cp("#","search","hash",l)));let u=e===""||l.pathname==="",d=u?"/":l.pathname,f;if(d==null)f=r;else{let y=t.length-1;if(!o&&d.startsWith("..")){let b=d.split("/");for(;b[0]==="..";)b.shift(),y-=1;l.pathname=b.join("/")}f=y>=0?t[y]:"/"}let m=dU(l,f),p=d&&d!=="/"&&d.endsWith("/"),v=(u||d===".")&&r.endsWith("/");return!m.pathname.endsWith("/")&&(p||v)&&(m.pathname+="/"),m}var Sa=e=>e.join("/").replace(/\/\/+/g,"/"),mU=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),pU=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,xU=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function gU(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var VC=["POST","PUT","PATCH","DELETE"];new Set(VC);var vU=["GET",...VC];new Set(vU);var Ni=x.createContext(null);Ni.displayName="DataRouter";var vf=x.createContext(null);vf.displayName="DataRouterState";x.createContext(!1);var HC=x.createContext({isTransitioning:!1});HC.displayName="ViewTransition";var yU=x.createContext(new Map);yU.displayName="Fetchers";var bU=x.createContext(null);bU.displayName="Await";var Ma=x.createContext(null);Ma.displayName="Navigation";var jg=x.createContext(null);jg.displayName="Location";var ta=x.createContext({outlet:null,matches:[],isDataRoute:!1});ta.displayName="Route";var Ng=x.createContext(null);Ng.displayName="RouteError";function wU(e,{relative:t}={}){vn(yf(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:o}=x.useContext(Ma),{hash:l,pathname:u,search:d}=fc(e,{relative:t}),f=u;return r!=="/"&&(f=u==="/"?r:Sa([r,u])),o.createHref({pathname:f,search:d,hash:l})}function yf(){return x.useContext(jg)!=null}function oo(){return vn(yf(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(jg).location}var FC="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function qC(e){x.useContext(Ma).static||x.useLayoutEffect(e)}function jU(){let{isDataRoute:e}=x.useContext(ta);return e?PU():NU()}function NU(){vn(yf(),"useNavigate() may be used only in the context of a <Router> component.");let e=x.useContext(Ni),{basename:t,navigator:r}=x.useContext(Ma),{matches:o}=x.useContext(ta),{pathname:l}=oo(),u=JSON.stringify(UC(o)),d=x.useRef(!1);return qC(()=>{d.current=!0}),x.useCallback((m,p={})=>{if(Ra(d.current,FC),!d.current)return;if(typeof m=="number"){r.go(m);return}let v=BC(m,JSON.parse(u),l,p.relative==="path");e==null&&t!=="/"&&(v.pathname=v.pathname==="/"?t:Sa([t,v.pathname])),(p.replace?r.replace:r.push)(v,p.state,p)},[t,r,u,l,e])}x.createContext(null);function SU(){let{matches:e}=x.useContext(ta),t=e[e.length-1];return t?t.params:{}}function fc(e,{relative:t}={}){let{matches:r}=x.useContext(ta),{pathname:o}=oo(),l=JSON.stringify(UC(r));return x.useMemo(()=>BC(e,JSON.parse(l),o,t==="path"),[e,l,o,t])}function kU(e,t,r,o){vn(yf(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=x.useContext(Ma),{matches:u}=x.useContext(ta),d=u[u.length-1],f=d?d.params:{},m=d?d.pathname:"/",p=d?d.pathnameBase:"/",v=d&&d.route;{let k=v&&v.path||"";YC(m,!v||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
||
|
||
Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let y=oo(),b;b=y;let S=b.pathname||"/",N=S;if(p!=="/"){let k=p.replace(/^\//,"").split("/");N="/"+S.replace(/^\//,"").split("/").slice(k.length).join("/")}let w=LC(e,{pathname:N});return Ra(v||w!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Ra(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),TU(w&&w.map(k=>Object.assign({},k,{params:Object.assign({},f,k.params),pathname:Sa([p,l.encodeLocation?l.encodeLocation(k.pathname).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?p:Sa([p,l.encodeLocation?l.encodeLocation(k.pathnameBase).pathname:k.pathnameBase])})),u,r,o)}function CU(){let e=zU(),t=gU(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,o="rgba(200,200,200, 0.5)",l={padding:"0.5rem",backgroundColor:o},u={padding:"2px 4px",backgroundColor:o},d=null;return console.error("Error handled by React Router default ErrorBoundary:",e),d=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:u},"ErrorBoundary")," or"," ",x.createElement("code",{style:u},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),r?x.createElement("pre",{style:l},r):null,d)}var EU=x.createElement(CU,null),AU=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?x.createElement(ta.Provider,{value:this.props.routeContext},x.createElement(Ng.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function RU({routeContext:e,match:t,children:r}){let o=x.useContext(Ni);return o&&o.static&&o.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(ta.Provider,{value:e},r)}function TU(e,t=[],r=null,o=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let l=e,u=r?.errors;if(u!=null){let m=l.findIndex(p=>p.route.id&&u?.[p.route.id]!==void 0);vn(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),l=l.slice(0,Math.min(l.length,m+1))}let d=!1,f=-1;if(r)for(let m=0;m<l.length;m++){let p=l[m];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(f=m),p.route.id){let{loaderData:v,errors:y}=r,b=p.route.loader&&!v.hasOwnProperty(p.route.id)&&(!y||y[p.route.id]===void 0);if(p.route.lazy||b){d=!0,f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}return l.reduceRight((m,p,v)=>{let y,b=!1,S=null,N=null;r&&(y=u&&p.route.id?u[p.route.id]:void 0,S=p.route.errorElement||EU,d&&(f<0&&v===0?(YC("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,N=null):f===v&&(b=!0,N=p.route.hydrateFallbackElement||null)));let w=t.concat(l.slice(0,v+1)),C=()=>{let k;return y?k=S:b?k=N:p.route.Component?k=x.createElement(p.route.Component,null):p.route.element?k=p.route.element:k=m,x.createElement(RU,{match:p,routeContext:{outlet:m,matches:w,isDataRoute:r!=null},children:k})};return r&&(p.route.ErrorBoundary||p.route.errorElement||v===0)?x.createElement(AU,{location:r.location,revalidation:r.revalidation,component:S,error:y,children:C(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):C()},null)}function Sg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _U(e){let t=x.useContext(Ni);return vn(t,Sg(e)),t}function MU(e){let t=x.useContext(vf);return vn(t,Sg(e)),t}function DU(e){let t=x.useContext(ta);return vn(t,Sg(e)),t}function kg(e){let t=DU(e),r=t.matches[t.matches.length-1];return vn(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function OU(){return kg("useRouteId")}function zU(){let e=x.useContext(Ng),t=MU("useRouteError"),r=kg("useRouteError");return e!==void 0?e:t.errors?.[r]}function PU(){let{router:e}=_U("useNavigate"),t=kg("useNavigate"),r=x.useRef(!1);return qC(()=>{r.current=!0}),x.useCallback(async(l,u={})=>{Ra(r.current,FC),r.current&&(typeof l=="number"?e.navigate(l):await e.navigate(l,{fromRouteId:t,...u}))},[e,t])}var w1={};function YC(e,t,r){!t&&!w1[e]&&(w1[e]=!0,Ra(!1,r))}x.memo(LU);function LU({routes:e,future:t,state:r}){return kU(e,void 0,r,t)}var Zu="get",Gu="application/x-www-form-urlencoded";function bf(e){return e!=null&&typeof e.tagName=="string"}function $U(e){return bf(e)&&e.tagName.toLowerCase()==="button"}function IU(e){return bf(e)&&e.tagName.toLowerCase()==="form"}function UU(e){return bf(e)&&e.tagName.toLowerCase()==="input"}function BU(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function VU(e,t){return e.button===0&&(!t||t==="_self")&&!BU(e)}var $u=null;function HU(){if($u===null)try{new FormData(document.createElement("form"),0),$u=!1}catch{$u=!0}return $u}var FU=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function up(e){return e!=null&&!FU.has(e)?(Ra(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Gu}"`),null):e}function qU(e,t){let r,o,l,u,d;if(IU(e)){let f=e.getAttribute("action");o=f?vs(f,t):null,r=e.getAttribute("method")||Zu,l=up(e.getAttribute("enctype"))||Gu,u=new FormData(e)}else if($U(e)||UU(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=e.getAttribute("formaction")||f.getAttribute("action");if(o=m?vs(m,t):null,r=e.getAttribute("formmethod")||f.getAttribute("method")||Zu,l=up(e.getAttribute("formenctype"))||up(f.getAttribute("enctype"))||Gu,u=new FormData(f,e),!HU()){let{name:p,type:v,value:y}=e;if(v==="image"){let b=p?`${p}.`:"";u.append(`${b}x`,"0"),u.append(`${b}y`,"0")}else p&&u.append(p,y)}}else{if(bf(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Zu,o=null,l=Gu,d=e}return u&&l==="text/plain"&&(d=u,u=void 0),{action:o,method:r.toLowerCase(),encType:l,formData:u,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Cg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function YU(e,t,r){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return o.pathname==="/"?o.pathname=`_root.${r}`:t&&vs(o.pathname,t)==="/"?o.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${r}`,o}async function ZU(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function GU(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function KU(e,t,r){let o=await Promise.all(e.map(async l=>{let u=t.routes[l.route.id];if(u){let d=await ZU(u,r);return d.links?d.links():[]}return[]}));return JU(o.flat(1).filter(GU).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function j1(e,t,r,o,l,u){let d=(m,p)=>r[p]?m.route.id!==r[p].route.id:!0,f=(m,p)=>r[p].pathname!==m.pathname||r[p].route.path?.endsWith("*")&&r[p].params["*"]!==m.params["*"];return u==="assets"?t.filter((m,p)=>d(m,p)||f(m,p)):u==="data"?t.filter((m,p)=>{let v=o.routes[m.route.id];if(!v||!v.hasLoader)return!1;if(d(m,p)||f(m,p))return!0;if(m.route.shouldRevalidate){let y=m.route.shouldRevalidate({currentUrl:new URL(l.pathname+l.search+l.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function QU(e,t,{includeHydrateFallback:r}={}){return XU(e.map(o=>{let l=t.routes[o.route.id];if(!l)return[];let u=[l.module];return l.clientActionModule&&(u=u.concat(l.clientActionModule)),l.clientLoaderModule&&(u=u.concat(l.clientLoaderModule)),r&&l.hydrateFallbackModule&&(u=u.concat(l.hydrateFallbackModule)),l.imports&&(u=u.concat(l.imports)),u}).flat(1))}function XU(e){return[...new Set(e)]}function WU(e){let t={},r=Object.keys(e).sort();for(let o of r)t[o]=e[o];return t}function JU(e,t){let r=new Set;return new Set(t),e.reduce((o,l)=>{let u=JSON.stringify(WU(l));return r.has(u)||(r.add(u),o.push({key:u,link:l})),o},[])}function ZC(){let e=x.useContext(Ni);return Cg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function eB(){let e=x.useContext(vf);return Cg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Eg=x.createContext(void 0);Eg.displayName="FrameworkContext";function GC(){let e=x.useContext(Eg);return Cg(e,"You must render this element inside a <HydratedRouter> element"),e}function tB(e,t){let r=x.useContext(Eg),[o,l]=x.useState(!1),[u,d]=x.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:p,onMouseLeave:v,onTouchStart:y}=t,b=x.useRef(null);x.useEffect(()=>{if(e==="render"&&d(!0),e==="viewport"){let w=k=>{k.forEach(E=>{d(E.isIntersecting)})},C=new IntersectionObserver(w,{threshold:.5});return b.current&&C.observe(b.current),()=>{C.disconnect()}}},[e]),x.useEffect(()=>{if(o){let w=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(w)}}},[o]);let S=()=>{l(!0)},N=()=>{l(!1),d(!1)};return r?e!=="intent"?[u,b,{}]:[u,b,{onFocus:Rl(f,S),onBlur:Rl(m,N),onMouseEnter:Rl(p,S),onMouseLeave:Rl(v,N),onTouchStart:Rl(y,S)}]:[!1,b,{}]}function Rl(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function nB({page:e,...t}){let{router:r}=ZC(),o=x.useMemo(()=>LC(r.routes,e,r.basename),[r.routes,e,r.basename]);return o?x.createElement(aB,{page:e,matches:o,...t}):null}function rB(e){let{manifest:t,routeModules:r}=GC(),[o,l]=x.useState([]);return x.useEffect(()=>{let u=!1;return KU(e,t,r).then(d=>{u||l(d)}),()=>{u=!0}},[e,t,r]),o}function aB({page:e,matches:t,...r}){let o=oo(),{manifest:l,routeModules:u}=GC(),{basename:d}=ZC(),{loaderData:f,matches:m}=eB(),p=x.useMemo(()=>j1(e,t,m,l,o,"data"),[e,t,m,l,o]),v=x.useMemo(()=>j1(e,t,m,l,o,"assets"),[e,t,m,l,o]),y=x.useMemo(()=>{if(e===o.pathname+o.search+o.hash)return[];let N=new Set,w=!1;if(t.forEach(k=>{let E=l.routes[k.route.id];!E||!E.hasLoader||(!p.some(R=>R.route.id===k.route.id)&&k.route.id in f&&u[k.route.id]?.shouldRevalidate||E.hasClientLoader?w=!0:N.add(k.route.id))}),N.size===0)return[];let C=YU(e,d,"data");return w&&N.size>0&&C.searchParams.set("_routes",t.filter(k=>N.has(k.route.id)).map(k=>k.route.id).join(",")),[C.pathname+C.search]},[d,f,o,l,p,t,e,u]),b=x.useMemo(()=>QU(v,l),[v,l]),S=rB(v);return x.createElement(x.Fragment,null,y.map(N=>x.createElement("link",{key:N,rel:"prefetch",as:"fetch",href:N,...r})),b.map(N=>x.createElement("link",{key:N,rel:"modulepreload",href:N,...r})),S.map(({key:N,link:w})=>x.createElement("link",{key:N,nonce:r.nonce,...w})))}function sB(...e){return t=>{e.forEach(r=>{typeof r=="function"?r(t):r!=null&&(r.current=t)})}}var KC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{KC&&(window.__reactRouterVersion="7.8.0")}catch{}var QC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,XC=x.forwardRef(function({onClick:t,discover:r="render",prefetch:o="none",relative:l,reloadDocument:u,replace:d,state:f,target:m,to:p,preventScrollReset:v,viewTransition:y,...b},S){let{basename:N}=x.useContext(Ma),w=typeof p=="string"&&QC.test(p),C,k=!1;if(typeof p=="string"&&w&&(C=p,KC))try{let J=new URL(window.location.href),se=p.startsWith("//")?new URL(J.protocol+p):new URL(p),ie=vs(se.pathname,N);se.origin===J.origin&&ie!=null?p=ie+se.search+se.hash:k=!0}catch{Ra(!1,`<Link to="${p}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let E=wU(p,{relative:l}),[R,T,z]=tB(o,b),ne=cB(p,{replace:d,state:f,target:m,preventScrollReset:v,relative:l,viewTransition:y});function $(J){t&&t(J),J.defaultPrevented||ne(J)}let V=x.createElement("a",{...b,...z,href:C||E,onClick:k||u?t:$,ref:sB(S,T),target:m,"data-discover":!w&&r==="render"?"true":void 0});return R&&!w?x.createElement(x.Fragment,null,V,x.createElement(nB,{page:E})):V});XC.displayName="Link";var oB=x.forwardRef(function({"aria-current":t="page",caseSensitive:r=!1,className:o="",end:l=!1,style:u,to:d,viewTransition:f,children:m,...p},v){let y=fc(d,{relative:p.relative}),b=oo(),S=x.useContext(vf),{navigator:N,basename:w}=x.useContext(Ma),C=S!=null&&mB(y)&&f===!0,k=N.encodeLocation?N.encodeLocation(y).pathname:y.pathname,E=b.pathname,R=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;r||(E=E.toLowerCase(),R=R?R.toLowerCase():null,k=k.toLowerCase()),R&&w&&(R=vs(R,w)||R);const T=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let z=E===k||!l&&E.startsWith(k)&&E.charAt(T)==="/",ne=R!=null&&(R===k||!l&&R.startsWith(k)&&R.charAt(k.length)==="/"),$={isActive:z,isPending:ne,isTransitioning:C},V=z?t:void 0,J;typeof o=="function"?J=o($):J=[o,z?"active":null,ne?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let se=typeof u=="function"?u($):u;return x.createElement(XC,{...p,"aria-current":V,className:J,ref:v,style:se,to:d,viewTransition:f},typeof m=="function"?m($):m)});oB.displayName="NavLink";var iB=x.forwardRef(({discover:e="render",fetcherKey:t,navigate:r,reloadDocument:o,replace:l,state:u,method:d=Zu,action:f,onSubmit:m,relative:p,preventScrollReset:v,viewTransition:y,...b},S)=>{let N=fB(),w=hB(f,{relative:p}),C=d.toLowerCase()==="get"?"get":"post",k=typeof f=="string"&&QC.test(f),E=R=>{if(m&&m(R),R.defaultPrevented)return;R.preventDefault();let T=R.nativeEvent.submitter,z=T?.getAttribute("formmethod")||d;N(T||R.currentTarget,{fetcherKey:t,method:z,navigate:r,replace:l,state:u,relative:p,preventScrollReset:v,viewTransition:y})};return x.createElement("form",{ref:S,method:C,action:w,onSubmit:o?m:E,...b,"data-discover":!k&&e==="render"?"true":void 0})});iB.displayName="Form";function lB(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function WC(e){let t=x.useContext(Ni);return vn(t,lB(e)),t}function cB(e,{target:t,replace:r,state:o,preventScrollReset:l,relative:u,viewTransition:d}={}){let f=jU(),m=oo(),p=fc(e,{relative:u});return x.useCallback(v=>{if(VU(v,t)){v.preventDefault();let y=r!==void 0?r:Gp(m)===Gp(p);f(e,{replace:y,state:o,preventScrollReset:l,relative:u,viewTransition:d})}},[m,f,p,r,o,t,e,l,u,d])}var uB=0,dB=()=>`__${String(++uB)}__`;function fB(){let{router:e}=WC("useSubmit"),{basename:t}=x.useContext(Ma),r=OU();return x.useCallback(async(o,l={})=>{let{action:u,method:d,encType:f,formData:m,body:p}=qU(o,t);if(l.navigate===!1){let v=l.fetcherKey||dB();await e.fetch(v,r,l.action||u,{preventScrollReset:l.preventScrollReset,formData:m,body:p,formMethod:l.method||d,formEncType:l.encType||f,flushSync:l.flushSync})}else await e.navigate(l.action||u,{preventScrollReset:l.preventScrollReset,formData:m,body:p,formMethod:l.method||d,formEncType:l.encType||f,replace:l.replace,state:l.state,fromRouteId:r,flushSync:l.flushSync,viewTransition:l.viewTransition})},[e,t,r])}function hB(e,{relative:t}={}){let{basename:r}=x.useContext(Ma),o=x.useContext(ta);vn(o,"useFormAction must be used inside a RouteContext");let[l]=o.matches.slice(-1),u={...fc(e||".",{relative:t})},d=oo();if(e==null){u.search=d.search;let f=new URLSearchParams(u.search),m=f.getAll("index");if(m.some(v=>v==="")){f.delete("index"),m.filter(y=>y).forEach(y=>f.append("index",y));let v=f.toString();u.search=v?`?${v}`:""}}return(!e||e===".")&&l.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(u.pathname=u.pathname==="/"?r:Sa([r,u.pathname])),Gp(u)}function mB(e,{relative:t}={}){let r=x.useContext(HC);vn(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=WC("useViewTransitionState"),l=fc(e,{relative:t});if(!r.isTransitioning)return!1;let u=vs(r.currentLocation.pathname,o)||r.currentLocation.pathname,d=vs(r.nextLocation.pathname,o)||r.nextLocation.pathname;return jd(l.pathname,d)!=null||jd(l.pathname,u)!=null}const pB=()=>{const{id:e}=SU(),[t,r]=x.useState(null),[o,l]=x.useState(!0),[u,d]=x.useState(null);x.useEffect(()=>{async function v(){try{const y=await QI(e);r(y)}catch{d("Failed to load blog post.")}finally{l(!1)}}e&&v()},[e]);const f=v=>{t&&r({...t,[v.target.name]:v.target.value})},m=v=>{t&&r({...t,status:v})},p=async v=>{if(v.preventDefault(),!!t){l(!0);try{await XI(t.id,t)}catch{d("Failed to update blog post.")}finally{l(!1)}}};return o?a.jsx("div",{children:"Loading..."}):u?a.jsx("div",{children:u}):t?a.jsxs("form",{onSubmit:p,className:"space-y-4",children:[a.jsx("input",{type:"text",name:"title",value:t.title,onChange:f,placeholder:"Title",className:"input input-bordered w-full",required:!0}),a.jsx("textarea",{name:"content",value:t.content,onChange:f,placeholder:"Content",className:"textarea textarea-bordered w-full h-40",required:!0}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium mb-2",children:"Tags"}),a.jsx("input",{type:"text",value:t.tags.join(", "),onChange:v=>{const y=v.target.value.split(",").map(b=>b.trim()).filter(b=>b);r({...t,tags:y})},placeholder:"Enter tags separated by commas",className:"input input-bordered w-full"}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Separate tags with commas"})]}),a.jsxs("div",{className:"flex gap-2 items-center",children:[a.jsx("label",{htmlFor:"status",children:"Status:"}),a.jsxs("select",{id:"status",value:t.status,onChange:v=>m(v.target.value),children:[a.jsx("option",{value:"draft",children:"Draft"}),a.jsx("option",{value:"published",children:"Published"}),a.jsx("option",{value:"scheduled",children:"Scheduled"})]})]}),a.jsx("button",{type:"submit",className:"btn btn-primary",children:"Save Changes"})]}):a.jsx("div",{children:"Blog post not found."})},N1=1;function Ag(){const{data:e,isLoading:t,error:r}=tt({queryKey:[`/api/users/${N1}`]}),o=!!e,l=N=>e?(Array.isArray(N)?N:[N]).includes(e.role):!1,u=e?.role==="admin",d=l(["admin","editor"]),f=l(["admin","editor","reviewer"]),m=l(["admin","editor","reviewer","contributor"]);return{user:e,isLoading:t,isAuthenticated:o,error:r,hasRole:l,isAdmin:u,isEditor:d,isReviewer:f,isContributor:m,canManageUsers:u,canManageContent:d,canReviewContent:f,canCreateContent:m,canAccessDashboard:m,currentUserId:N1}}function JC({children:e,title:t="Dashboard"}){const{user:r,isLoading:o,canManageUsers:l,canManageContent:u,canReviewContent:d,canCreateContent:f}=Ag(),[m]=ys();if(!o&&!(f||d||u||l))return a.jsx("div",{className:"max-w-[1200px] mx-auto px-4 md:px-6 py-8",children:a.jsx(Oe,{className:"border-red-400 dark:border-red-600",children:a.jsxs(Ve,{className:"pt-6 flex flex-col items-center",children:[a.jsx(g_,{className:"h-12 w-12 text-red-500 mb-4"}),a.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Access Denied"}),a.jsx("p",{className:"text-muted-foreground mb-4 text-center",children:"You don't have permission to access this area. Please contact an administrator if you believe this is an error."}),a.jsx(Ce,{href:"/",className:"text-primary hover:underline",children:"Return to Home"})]})})});const v=(()=>{const y=[{href:"/dashboard",label:"Overview",icon:a.jsx(r_,{className:"h-4 w-4 mr-2"})}];return f&&y.push({href:"/dashboard/blog",label:"Blog Posts",icon:a.jsx(Ll,{className:"h-4 w-4 mr-2"})},{href:"/dashboard/works",label:"Literary Works",icon:a.jsx(Uu,{className:"h-4 w-4 mr-2"})},{href:"/dashboard/collections",label:"Collections",icon:a.jsx(ox,{className:"h-4 w-4 mr-2"})},{href:"/dashboard/annotations",label:"Annotations",icon:a.jsx(cs,{className:"h-4 w-4 mr-2"})}),d&&y.push({href:"/dashboard/analysis",label:"Analysis Results",icon:a.jsx($T,{className:"h-4 w-4 mr-2"})},{href:"/dashboard/comments",label:"Comments",icon:a.jsx(Ju,{className:"h-4 w-4 mr-2"})}),u&&y.push({href:"/dashboard/translations",label:"Translations",icon:a.jsx(Rr,{className:"h-4 w-4 mr-2"})},{href:"/dashboard/authors",label:"Authors",icon:a.jsx(Il,{className:"h-4 w-4 mr-2"})},{href:"/dashboard/tags",label:"Tags",icon:a.jsx(n_,{className:"h-4 w-4 mr-2"})}),l&&y.push({href:"/dashboard/users",label:"User Management",icon:a.jsx(Il,{className:"h-4 w-4 mr-2"})},{href:"/dashboard/settings",label:"Settings",icon:a.jsx(sj,{className:"h-4 w-4 mr-2"})}),y})();return a.jsx("div",{className:"max-w-[1200px] mx-auto px-4 md:px-6 pt-6 pb-16",children:a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[240px_1fr] gap-8",children:[a.jsx("div",{children:a.jsxs("div",{className:"sticky top-24",children:[a.jsxs("div",{className:"mb-8",children:[a.jsx("h1",{className:"text-2xl font-bold",children:"Editorial Dashboard"}),o?a.jsx("div",{className:"h-5 w-32 mt-1 bg-gray-200 animate-pulse rounded"}):a.jsxs("p",{className:"text-muted-foreground",children:["Welcome, ",r?.displayName||r?.username]})]}),a.jsx("div",{className:"h-[calc(100vh-250px)] overflow-auto pr-4",children:a.jsx("nav",{className:"flex flex-col space-y-1",children:v.map(y=>{const b=m===y.href;return a.jsxs(Ce,{href:y.href,className:`flex items-center px-3 py-2 text-sm font-medium rounded-md ${b?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[y.icon,y.label]},y.href)})})})]})}),a.jsxs("div",{children:[a.jsx("div",{className:"pb-4 mb-6 border-b",children:a.jsx("h2",{className:"text-xl font-semibold",children:t})}),o?a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"h-8 w-full bg-gray-200 animate-pulse rounded"}),a.jsx("div",{className:"h-64 w-full bg-gray-200 animate-pulse rounded"})]}):e]})]})})}var eE="AlertDialog",[xB,LV]=Qt(eE,[x2]),Da=x2(),tE=e=>{const{__scopeAlertDialog:t,...r}=e,o=Da(t);return a.jsx(Gx,{...o,...r,modal:!0})};tE.displayName=eE;var gB="AlertDialogTrigger",vB=x.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...o}=e,l=Da(r);return a.jsx(M2,{...l,...o,ref:t})});vB.displayName=gB;var yB="AlertDialogPortal",nE=e=>{const{__scopeAlertDialog:t,...r}=e,o=Da(t);return a.jsx(Kx,{...o,...r})};nE.displayName=yB;var bB="AlertDialogOverlay",rE=x.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...o}=e,l=Da(r);return a.jsx(ef,{...l,...o,ref:t})});rE.displayName=bB;var oi="AlertDialogContent",[wB,jB]=xB(oi),NB=cj("AlertDialogContent"),aE=x.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:o,...l}=e,u=Da(r),d=x.useRef(null),f=Le(t,d),m=x.useRef(null);return a.jsx(O5,{contentName:oi,titleName:sE,docsSlug:"alert-dialog",children:a.jsx(wB,{scope:r,cancelRef:m,children:a.jsxs(tf,{role:"alertdialog",...u,...l,ref:f,onOpenAutoFocus:be(l.onOpenAutoFocus,p=>{p.preventDefault(),m.current?.focus({preventScroll:!0})}),onPointerDownOutside:p=>p.preventDefault(),onInteractOutside:p=>p.preventDefault(),children:[a.jsx(NB,{children:o}),a.jsx(kB,{contentRef:d})]})})})});aE.displayName=oi;var sE="AlertDialogTitle",oE=x.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...o}=e,l=Da(r);return a.jsx(nf,{...l,...o,ref:t})});oE.displayName=sE;var iE="AlertDialogDescription",lE=x.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...o}=e,l=Da(r);return a.jsx(rf,{...l,...o,ref:t})});lE.displayName=iE;var SB="AlertDialogAction",cE=x.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...o}=e,l=Da(r);return a.jsx(af,{...l,...o,ref:t})});cE.displayName=SB;var uE="AlertDialogCancel",dE=x.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...o}=e,{cancelRef:l}=jB(uE,r),u=Da(r),d=Le(t,l);return a.jsx(af,{...u,...o,ref:d})});dE.displayName=uE;var kB=({contentRef:e})=>{const t=`\`${oi}\` requires a description for the component to be accessible for screen reader users.
|
||
|
||
You can add a description to the \`${oi}\` by passing a \`${iE}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
||
|
||
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${oi}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
||
|
||
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return x.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},CB=tE,EB=nE,fE=rE,hE=aE,mE=cE,pE=dE,xE=oE,gE=lE;const AB=CB,RB=EB,vE=x.forwardRef(({className:e,...t},r)=>a.jsx(fE,{className:je("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,ref:r}));vE.displayName=fE.displayName;const yE=x.forwardRef(({className:e,...t},r)=>a.jsxs(RB,{children:[a.jsx(vE,{}),a.jsx(hE,{ref:r,className:je("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),...t})]}));yE.displayName=hE.displayName;const bE=({className:e,...t})=>a.jsx("div",{className:je("flex flex-col space-y-2 text-center sm:text-left",e),...t});bE.displayName="AlertDialogHeader";const wE=({className:e,...t})=>a.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});wE.displayName="AlertDialogFooter";const jE=x.forwardRef(({className:e,...t},r)=>a.jsx(xE,{ref:r,className:je("text-lg font-semibold",e),...t}));jE.displayName=xE.displayName;const NE=x.forwardRef(({className:e,...t},r)=>a.jsx(gE,{ref:r,className:je("text-sm text-muted-foreground",e),...t}));NE.displayName=gE.displayName;const SE=x.forwardRef(({className:e,...t},r)=>a.jsx(mE,{ref:r,className:je(Cx(),e),...t}));SE.displayName=mE.displayName;const kE=x.forwardRef(({className:e,...t},r)=>a.jsx(pE,{ref:r,className:je(Cx({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));kE.displayName=pE.displayName;const CE=x.forwardRef(({className:e,...t},r)=>a.jsx("div",{className:"relative w-full overflow-auto",children:a.jsx("table",{ref:r,className:je("w-full caption-bottom text-sm",e),...t})}));CE.displayName="Table";const EE=x.forwardRef(({className:e,...t},r)=>a.jsx("thead",{ref:r,className:je("[&_tr]:border-b",e),...t}));EE.displayName="TableHeader";const AE=x.forwardRef(({className:e,...t},r)=>a.jsx("tbody",{ref:r,className:je("[&_tr:last-child]:border-0",e),...t}));AE.displayName="TableBody";const TB=x.forwardRef(({className:e,...t},r)=>a.jsx("tfoot",{ref:r,className:je("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));TB.displayName="TableFooter";const Ml=x.forwardRef(({className:e,...t},r)=>a.jsx("tr",{ref:r,className:je("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Ml.displayName="TableRow";const Jo=x.forwardRef(({className:e,...t},r)=>a.jsx("th",{ref:r,className:je("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));Jo.displayName="TableHead";const pr=x.forwardRef(({className:e,...t},r)=>a.jsx("td",{ref:r,className:je("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));pr.displayName="TableCell";const _B=x.forwardRef(({className:e,...t},r)=>a.jsx("caption",{ref:r,className:je("mt-4 text-sm text-muted-foreground",e),...t}));_B.displayName="TableCaption";function MB(){const{canManageContent:e}=Ag(),[t,r]=x.useState(""),[o,l]=x.useState(null),u=rx(),{toast:d}=Ta(),{data:f,isLoading:m}=tt({queryKey:["/api/blog"]}),p=Ys({mutationFn:async y=>Qr(`/api/blog/${y}`,{method:"DELETE"}),onSuccess:()=>{u.invalidateQueries({queryKey:["/api/blog"]}),d({title:"Post deleted",description:"The blog post has been successfully deleted."}),l(null)},onError:y=>{d({title:"Error",description:"Failed to delete the blog post. Please try again.",variant:"destructive"}),console.error("Delete error:",y)}}),v=f?.filter(y=>y.title.toLowerCase().includes(t.toLowerCase())||y.excerpt?.toLowerCase().includes(t.toLowerCase()));return a.jsxs(JC,{title:"Blog Management",children:[a.jsxs("div",{className:"mb-6 flex flex-col sm:flex-row justify-between gap-4",children:[a.jsxs("div",{className:"relative max-w-sm w-full",children:[a.jsx(Xs,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),a.jsx(tr,{type:"search",placeholder:"Search posts...",className:"pl-8",value:t,onChange:y=>r(y.target.value)})]}),a.jsx(Ce,{href:"/dashboard/blog/create",children:a.jsxs(X,{children:[a.jsx(BT,{className:"mr-2 h-4 w-4"}),"New Post"]})})]}),a.jsx("div",{className:"rounded-md border",children:a.jsxs(CE,{children:[a.jsx(EE,{children:a.jsxs(Ml,{children:[a.jsx(Jo,{children:"Title"}),a.jsx(Jo,{children:"Status"}),a.jsx(Jo,{children:"Author"}),a.jsx(Jo,{children:"Date"}),a.jsx(Jo,{className:"w-[100px]",children:"Actions"})]})}),a.jsx(AE,{children:m?Array.from({length:5}).map((y,b)=>a.jsxs(Ml,{children:[a.jsx(pr,{children:a.jsx(Pe,{className:"h-5 w-[250px]"})}),a.jsx(pr,{children:a.jsx(Pe,{className:"h-5 w-[80px]"})}),a.jsx(pr,{children:a.jsx(Pe,{className:"h-5 w-[120px]"})}),a.jsx(pr,{children:a.jsx(Pe,{className:"h-5 w-[100px]"})}),a.jsx(pr,{children:a.jsx(Pe,{className:"h-9 w-9 rounded-md"})})]},b)):v&&v.length>0?v.map(y=>a.jsxs(Ml,{children:[a.jsx(pr,{className:"font-medium",children:y.title}),a.jsx(pr,{children:y.publishedAt?a.jsx(ht,{variant:"outline",className:"bg-green-50 text-green-700 hover:bg-green-50 dark:bg-green-900/20 dark:text-green-400",children:"Published"}):a.jsx(ht,{variant:"outline",className:"bg-orange-50 text-orange-700 hover:bg-orange-50 dark:bg-orange-900/20 dark:text-orange-400",children:"Draft"})}),a.jsx(pr,{children:y.author?.displayName||"Anonymous"}),a.jsx(pr,{children:y.publishedAt?Zp(new Date(y.publishedAt),"MMM d, yyyy"):Zp(new Date(y.createdAt),"MMM d, yyyy")}),a.jsx(pr,{children:a.jsxs(qd,{children:[a.jsx(Yd,{asChild:!0,children:a.jsxs(X,{variant:"ghost",className:"h-8 w-8 p-0",children:[a.jsx("span",{className:"sr-only",children:"Open menu"}),a.jsx(qT,{className:"h-4 w-4"})]})}),a.jsxs(sc,{align:"end",children:[a.jsx(gr,{children:a.jsx(Ce,{href:`/blog/${y.slug}`,children:a.jsxs("span",{className:"flex items-center",children:[a.jsx(ZT,{className:"mr-2 h-4 w-4"}),"View"]})})}),a.jsx(gr,{children:a.jsx(Ce,{href:`/dashboard/blog/edit/${y.id}`,children:a.jsxs("span",{className:"flex items-center",children:[a.jsx(cs,{className:"mr-2 h-4 w-4"}),"Edit"]})})}),e&&a.jsxs(a.Fragment,{children:[a.jsx(sS,{}),a.jsxs(gr,{className:"text-red-600 focus:text-red-600 dark:text-red-400 dark:focus:text-red-400",onClick:()=>l(y.id),children:[a.jsx(x_,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]})})]},y.id)):a.jsx(Ml,{children:a.jsx(pr,{colSpan:5,className:"h-24 text-center",children:a.jsxs("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:[a.jsx(Ll,{className:"h-8 w-8 mb-2"}),a.jsx("p",{children:"No blog posts found"}),t&&a.jsx("p",{className:"text-sm mt-1",children:"Try adjusting your search query"})]})})})})]})}),a.jsx(AB,{open:!!o,onOpenChange:y=>!y&&l(null),children:a.jsxs(yE,{children:[a.jsxs(bE,{children:[a.jsx(jE,{children:"Are you sure?"}),a.jsx(NE,{children:"This action cannot be undone. This will permanently delete the blog post and remove it from the platform."})]}),a.jsxs(wE,{children:[a.jsx(kE,{children:"Cancel"}),a.jsx(SE,{onClick:()=>{o&&p.mutate(o)},className:"bg-red-600 hover:bg-red-700 focus:ring-red-600",children:"Delete"})]})]})})]})}function DB(){const{canManageContent:e,canReviewContent:t}=Ag(),{data:r,isLoading:o}=tt({queryKey:["/api/stats/works"],enabled:t||e}),{data:l,isLoading:u}=tt({queryKey:["/api/stats/users"],enabled:e}),{data:d,isLoading:f}=tt({queryKey:["/api/stats/blog"],enabled:t||e}),{data:m,isLoading:p}=tt({queryKey:["/api/stats/comments"],enabled:t||e}),{data:v,isLoading:y}=tt({queryKey:["/api/works",{limit:5}]}),b=(k,E,R)=>k?a.jsx(Pe,{className:"h-8 w-24"}):E?.count||R,S=b(o,r,6),N=b(u,l,5),w=b(f,d,3),C=b(p,m,12);return a.jsxs(JC,{title:"Dashboard Overview",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:[a.jsxs(Oe,{children:[a.jsxs(zt,{className:"flex flex-row items-center justify-between pb-2",children:[a.jsx(Gt,{className:"text-sm font-medium",children:"Total Works"}),a.jsx(Uu,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(Ve,{children:[a.jsx("div",{className:"text-2xl font-bold",children:S}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Literary works in library"})]})]}),a.jsxs(Oe,{children:[a.jsxs(zt,{className:"flex flex-row items-center justify-between pb-2",children:[a.jsx(Gt,{className:"text-sm font-medium",children:"Blog Posts"}),a.jsx(Ll,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(Ve,{children:[a.jsx("div",{className:"text-2xl font-bold",children:w}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Published articles"})]})]}),a.jsxs(Oe,{children:[a.jsxs(zt,{className:"flex flex-row items-center justify-between pb-2",children:[a.jsx(Gt,{className:"text-sm font-medium",children:"Users"}),a.jsx(Il,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(Ve,{children:[a.jsx("div",{className:"text-2xl font-bold",children:N}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Registered accounts"})]})]}),a.jsxs(Oe,{children:[a.jsxs(zt,{className:"flex flex-row items-center justify-between pb-2",children:[a.jsx(Gt,{className:"text-sm font-medium",children:"Comments"}),a.jsx(Ju,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs(Ve,{children:[a.jsx("div",{className:"text-2xl font-bold",children:C}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"User discussions"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs(Oe,{children:[a.jsxs(zt,{children:[a.jsx(Gt,{children:"Quick Actions"}),a.jsx(Xr,{children:"Common tasks and content management"})]}),a.jsx(Ve,{children:a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx(Ce,{href:"/dashboard/blog/create",children:a.jsxs(X,{variant:"outline",className:"w-full justify-start h-auto py-4",children:[a.jsx(Ll,{className:"h-5 w-5 mr-2"}),a.jsxs("div",{className:"flex flex-col items-start",children:[a.jsx("span",{children:"Create Post"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"Add a new blog post"})]})]})}),a.jsx(Ce,{href:"/dashboard/works/add",children:a.jsxs(X,{variant:"outline",className:"w-full justify-start h-auto py-4",children:[a.jsx(Uu,{className:"h-5 w-5 mr-2"}),a.jsxs("div",{className:"flex flex-col items-start",children:[a.jsx("span",{children:"Add Work"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"New literary work"})]})]})}),a.jsx(Ce,{href:"/dashboard/collections/create",children:a.jsxs(X,{variant:"outline",className:"w-full justify-start h-auto py-4",children:[a.jsx(ox,{className:"h-5 w-5 mr-2"}),a.jsxs("div",{className:"flex flex-col items-start",children:[a.jsx("span",{children:"Create Collection"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"Curate works"})]})]})}),a.jsx(Ce,{href:"/dashboard/annotations",children:a.jsxs(X,{variant:"outline",className:"w-full justify-start h-auto py-4",children:[a.jsx(cs,{className:"h-5 w-5 mr-2"}),a.jsxs("div",{className:"flex flex-col items-start",children:[a.jsx("span",{children:"Manage Annotations"}),a.jsx("span",{className:"text-xs text-muted-foreground",children:"Review & edit"})]})]})})]})})]}),a.jsxs(Oe,{children:[a.jsxs(zt,{className:"flex flex-row items-center justify-between",children:[a.jsxs("div",{children:[a.jsx(Gt,{children:"Recent Content"}),a.jsx(Xr,{children:"Latest additions to the platform"})]}),a.jsx(Ce,{href:"/dashboard/works",children:a.jsxs(X,{variant:"ghost",size:"sm",className:"gap-1",children:[a.jsx("span",{children:"View all"}),a.jsx(OT,{className:"h-4 w-4"})]})})]}),a.jsx(Ve,{children:a.jsx("div",{className:"space-y-4",children:y?Array.from({length:3}).map((k,E)=>a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(Pe,{className:"h-12 w-12 rounded-md"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{className:"h-4 w-48"}),a.jsx(Pe,{className:"h-3 w-32"})]})]},E)):v?.slice(0,3).map(k=>a.jsx(Ce,{href:`/works/${k.slug}`,children:a.jsxs("div",{className:"flex items-center gap-4 group cursor-pointer",children:[a.jsx("div",{className:"h-12 w-12 rounded-md bg-muted flex items-center justify-center",children:a.jsx(Uu,{className:"h-6 w-6 text-muted-foreground"})}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium group-hover:text-primary",children:k.title}),a.jsxs("p",{className:"text-sm text-muted-foreground",children:[k.type," - Added recently"]})]})]})},k.id))})})]})]})]})}var wf="Collapsible",[OB,RE]=Qt(wf),[zB,Rg]=OB(wf),TE=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:o,defaultOpen:l,disabled:u,onOpenChange:d,...f}=e,[m,p]=Hn({prop:o,defaultProp:l??!1,onChange:d,caller:wf});return a.jsx(zB,{scope:r,disabled:u,contentId:nr(),open:m,onOpenToggle:x.useCallback(()=>p(v=>!v),[p]),children:a.jsx(Ee.div,{"data-state":_g(m),"data-disabled":u?"":void 0,...f,ref:t})})});TE.displayName=wf;var _E="CollapsibleTrigger",ME=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,...o}=e,l=Rg(_E,r);return a.jsx(Ee.button,{type:"button","aria-controls":l.contentId,"aria-expanded":l.open||!1,"data-state":_g(l.open),"data-disabled":l.disabled?"":void 0,disabled:l.disabled,...o,ref:t,onClick:be(e.onClick,l.onOpenToggle)})});ME.displayName=_E;var Tg="CollapsibleContent",DE=x.forwardRef((e,t)=>{const{forceMount:r,...o}=e,l=Rg(Tg,e.__scopeCollapsible);return a.jsx(yn,{present:r||l.open,children:({present:u})=>a.jsx(PB,{...o,ref:t,present:u})})});DE.displayName=Tg;var PB=x.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:o,children:l,...u}=e,d=Rg(Tg,r),[f,m]=x.useState(o),p=x.useRef(null),v=Le(t,p),y=x.useRef(0),b=y.current,S=x.useRef(0),N=S.current,w=d.open||f,C=x.useRef(w),k=x.useRef(void 0);return x.useEffect(()=>{const E=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(E)},[]),Vt(()=>{const E=p.current;if(E){k.current=k.current||{transitionDuration:E.style.transitionDuration,animationName:E.style.animationName},E.style.transitionDuration="0s",E.style.animationName="none";const R=E.getBoundingClientRect();y.current=R.height,S.current=R.width,C.current||(E.style.transitionDuration=k.current.transitionDuration,E.style.animationName=k.current.animationName),m(o)}},[d.open,o]),a.jsx(Ee.div,{"data-state":_g(d.open),"data-disabled":d.disabled?"":void 0,id:d.contentId,hidden:!w,...u,ref:v,style:{"--radix-collapsible-content-height":b?`${b}px`:void 0,"--radix-collapsible-content-width":N?`${N}px`:void 0,...e.style},children:w&&l})});function _g(e){return e?"open":"closed"}var LB=TE,$B=ME,IB=DE,Or="Accordion",UB=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Mg,BB,VB]=tc(Or),[jf,$V]=Qt(Or,[VB,RE]),Dg=RE(),OE=ae.forwardRef((e,t)=>{const{type:r,...o}=e,l=o,u=o;return a.jsx(Mg.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?a.jsx(YB,{...u,ref:t}):a.jsx(qB,{...l,ref:t})})});OE.displayName=Or;var[zE,HB]=jf(Or),[PE,FB]=jf(Or,{collapsible:!1}),qB=ae.forwardRef((e,t)=>{const{value:r,defaultValue:o,onValueChange:l=()=>{},collapsible:u=!1,...d}=e,[f,m]=Hn({prop:r,defaultProp:o??"",onChange:l,caller:Or});return a.jsx(zE,{scope:e.__scopeAccordion,value:ae.useMemo(()=>f?[f]:[],[f]),onItemOpen:m,onItemClose:ae.useCallback(()=>u&&m(""),[u,m]),children:a.jsx(PE,{scope:e.__scopeAccordion,collapsible:u,children:a.jsx(LE,{...d,ref:t})})})}),YB=ae.forwardRef((e,t)=>{const{value:r,defaultValue:o,onValueChange:l=()=>{},...u}=e,[d,f]=Hn({prop:r,defaultProp:o??[],onChange:l,caller:Or}),m=ae.useCallback(v=>f((y=[])=>[...y,v]),[f]),p=ae.useCallback(v=>f((y=[])=>y.filter(b=>b!==v)),[f]);return a.jsx(zE,{scope:e.__scopeAccordion,value:d,onItemOpen:m,onItemClose:p,children:a.jsx(PE,{scope:e.__scopeAccordion,collapsible:!0,children:a.jsx(LE,{...u,ref:t})})})}),[ZB,Nf]=jf(Or),LE=ae.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:o,dir:l,orientation:u="vertical",...d}=e,f=ae.useRef(null),m=Le(f,t),p=BB(r),y=bs(l)==="ltr",b=be(e.onKeyDown,S=>{if(!UB.includes(S.key))return;const N=S.target,w=p().filter(V=>!V.ref.current?.disabled),C=w.findIndex(V=>V.ref.current===N),k=w.length;if(C===-1)return;S.preventDefault();let E=C;const R=0,T=k-1,z=()=>{E=C+1,E>T&&(E=R)},ne=()=>{E=C-1,E<R&&(E=T)};switch(S.key){case"Home":E=R;break;case"End":E=T;break;case"ArrowRight":u==="horizontal"&&(y?z():ne());break;case"ArrowDown":u==="vertical"&&z();break;case"ArrowLeft":u==="horizontal"&&(y?ne():z());break;case"ArrowUp":u==="vertical"&&ne();break}const $=E%k;w[$].ref.current?.focus()});return a.jsx(ZB,{scope:r,disabled:o,direction:l,orientation:u,children:a.jsx(Mg.Slot,{scope:r,children:a.jsx(Ee.div,{...d,"data-orientation":u,ref:m,onKeyDown:o?void 0:b})})})}),Nd="AccordionItem",[GB,Og]=jf(Nd),$E=ae.forwardRef((e,t)=>{const{__scopeAccordion:r,value:o,...l}=e,u=Nf(Nd,r),d=HB(Nd,r),f=Dg(r),m=nr(),p=o&&d.value.includes(o)||!1,v=u.disabled||e.disabled;return a.jsx(GB,{scope:r,open:p,disabled:v,triggerId:m,children:a.jsx(LB,{"data-orientation":u.orientation,"data-state":FE(p),...f,...l,ref:t,disabled:v,open:p,onOpenChange:y=>{y?d.onItemOpen(o):d.onItemClose(o)}})})});$E.displayName=Nd;var IE="AccordionHeader",UE=ae.forwardRef((e,t)=>{const{__scopeAccordion:r,...o}=e,l=Nf(Or,r),u=Og(IE,r);return a.jsx(Ee.h3,{"data-orientation":l.orientation,"data-state":FE(u.open),"data-disabled":u.disabled?"":void 0,...o,ref:t})});UE.displayName=IE;var Kp="AccordionTrigger",BE=ae.forwardRef((e,t)=>{const{__scopeAccordion:r,...o}=e,l=Nf(Or,r),u=Og(Kp,r),d=FB(Kp,r),f=Dg(r);return a.jsx(Mg.ItemSlot,{scope:r,children:a.jsx($B,{"aria-disabled":u.open&&!d.collapsible||void 0,"data-orientation":l.orientation,id:u.triggerId,...f,...o,ref:t})})});BE.displayName=Kp;var VE="AccordionContent",HE=ae.forwardRef((e,t)=>{const{__scopeAccordion:r,...o}=e,l=Nf(Or,r),u=Og(VE,r),d=Dg(r);return a.jsx(IB,{role:"region","aria-labelledby":u.triggerId,"data-orientation":l.orientation,...d,...o,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});HE.displayName=VE;function FE(e){return e?"open":"closed"}var KB=OE,QB=$E,XB=UE,qE=BE,YE=HE;const WB=KB,ei=x.forwardRef(({className:e,...t},r)=>a.jsx(QB,{ref:r,className:je("border-b",e),...t}));ei.displayName="AccordionItem";const ti=x.forwardRef(({className:e,children:t,...r},o)=>a.jsx(XB,{className:"flex",children:a.jsxs(qE,{ref:o,className:je("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,a.jsx(Ed,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));ti.displayName=qE.displayName;const ni=x.forwardRef(({className:e,children:t,...r},o)=>a.jsx(YE,{ref:o,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:a.jsx("div",{className:je("pb-4 pt-0",e),children:t})}));ni.displayName=YE.displayName;var zg="Radio",[JB,ZE]=Qt(zg),[eV,tV]=JB(zg),GE=x.forwardRef((e,t)=>{const{__scopeRadio:r,name:o,checked:l=!1,required:u,disabled:d,value:f="on",onCheck:m,form:p,...v}=e,[y,b]=x.useState(null),S=Le(t,C=>b(C)),N=x.useRef(!1),w=y?p||!!y.closest("form"):!0;return a.jsxs(eV,{scope:r,checked:l,disabled:d,children:[a.jsx(Ee.button,{type:"button",role:"radio","aria-checked":l,"data-state":WE(l),"data-disabled":d?"":void 0,disabled:d,value:f,...v,ref:S,onClick:be(e.onClick,C=>{l||m?.(),w&&(N.current=C.isPropagationStopped(),N.current||C.stopPropagation())})}),w&&a.jsx(XE,{control:y,bubbles:!N.current,name:o,value:f,checked:l,required:u,disabled:d,form:p,style:{transform:"translateX(-100%)"}})]})});GE.displayName=zg;var KE="RadioIndicator",QE=x.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:o,...l}=e,u=tV(KE,r);return a.jsx(yn,{present:o||u.checked,children:a.jsx(Ee.span,{"data-state":WE(u.checked),"data-disabled":u.disabled?"":void 0,...l,ref:t})})});QE.displayName=KE;var nV="RadioBubbleInput",XE=x.forwardRef(({__scopeRadio:e,control:t,checked:r,bubbles:o=!0,...l},u)=>{const d=x.useRef(null),f=Le(d,u),m=oc(r),p=ec(t);return x.useEffect(()=>{const v=d.current;if(!v)return;const y=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(y,"checked").set;if(m!==r&&S){const N=new Event("click",{bubbles:o});S.call(v,r),v.dispatchEvent(N)}},[m,r,o]),a.jsx(Ee.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...l,tabIndex:-1,ref:f,style:{...l.style,...p,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});XE.displayName=nV;function WE(e){return e?"checked":"unchecked"}var rV=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Sf="RadioGroup",[aV,IV]=Qt(Sf,[yi,ZE]),JE=yi(),eA=ZE(),[sV,oV]=aV(Sf),tA=x.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:o,defaultValue:l,value:u,required:d=!1,disabled:f=!1,orientation:m,dir:p,loop:v=!0,onValueChange:y,...b}=e,S=JE(r),N=bs(p),[w,C]=Hn({prop:u,defaultProp:l??null,onChange:y,caller:Sf});return a.jsx(sV,{scope:r,name:o,required:d,disabled:f,value:w,onValueChange:C,children:a.jsx(Ax,{asChild:!0,...S,orientation:m,dir:N,loop:v,children:a.jsx(Ee.div,{role:"radiogroup","aria-required":d,"aria-orientation":m,"data-disabled":f?"":void 0,dir:N,...b,ref:t})})})});tA.displayName=Sf;var nA="RadioGroupItem",rA=x.forwardRef((e,t)=>{const{__scopeRadioGroup:r,disabled:o,...l}=e,u=oV(nA,r),d=u.disabled||o,f=JE(r),m=eA(r),p=x.useRef(null),v=Le(t,p),y=u.value===l.value,b=x.useRef(!1);return x.useEffect(()=>{const S=w=>{rV.includes(w.key)&&(b.current=!0)},N=()=>b.current=!1;return document.addEventListener("keydown",S),document.addEventListener("keyup",N),()=>{document.removeEventListener("keydown",S),document.removeEventListener("keyup",N)}},[]),a.jsx(Rx,{asChild:!0,...f,focusable:!d,active:y,children:a.jsx(GE,{disabled:d,required:u.required,checked:y,...m,...l,name:u.name,ref:v,onCheck:()=>u.onValueChange(l.value),onKeyDown:be(S=>{S.key==="Enter"&&S.preventDefault()}),onFocus:be(l.onFocus,()=>{b.current&&p.current?.click()})})})});rA.displayName=nA;var iV="RadioGroupIndicator",aA=x.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...o}=e,l=eA(r);return a.jsx(QE,{...l,...o,ref:t})});aA.displayName=iV;var sA=tA,oA=rA,lV=aA;const Qp=x.forwardRef(({className:e,...t},r)=>a.jsx(sA,{className:je("grid gap-2",e),...t,ref:r}));Qp.displayName=sA.displayName;const Ku=x.forwardRef(({className:e,...t},r)=>a.jsx(oA,{ref:r,className:je("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:a.jsx(lV,{className:"flex items-center justify-center",children:a.jsx(W1,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Ku.displayName=oA.displayName;function iA({filters:e,onFilterChange:t,tags:r}){const[o,l]=x.useState(!0),u=r.reduce((b,S)=>(b[S.type]||(b[S.type]=[]),b[S.type].push(S),b),{}),d=["English","Russian","French","German","Spanish","Italian","Chinese","Japanese"],f=[{value:"poem",label:"Poetry"},{value:"story",label:"Short Story"},{value:"novel",label:"Novel"},{value:"play",label:"Play"},{value:"essay",label:"Essay"},{value:"other",label:"Other"}],m=[{value:[1700,1799],label:"18th Century"},{value:[1800,1899],label:"19th Century"},{value:[1900,1999],label:"20th Century"},{value:[2e3,2099],label:"21st Century"}],p=[{value:"popularity",label:"Popularity"},{value:"recent",label:"Recently Added"},{value:"title_asc",label:"Title (A-Z)"},{value:"title_desc",label:"Title (Z-A)"},{value:"year_desc",label:"Year (Newest)"},{value:"year_asc",label:"Year (Oldest)"}],v=(b,S)=>{if(!e.tags){S&&t({tags:[b]});return}t(S?{tags:[...e.tags,b]}:{tags:e.tags.filter(N=>N!==b)})},y=()=>{t({language:void 0,type:void 0,yearStart:void 0,yearEnd:void 0,tags:void 0,sort:"popularity"})};return a.jsx("div",{className:"lg:w-64 flex-shrink-0",children:a.jsxs("div",{className:"lg:sticky lg:top-24 space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between lg:hidden mb-2",children:[a.jsx("h3",{className:"text-lg font-medium",children:"Filters"}),a.jsx(X,{variant:"outline",size:"sm",onClick:()=>l(!o),children:o?"Hide filters":"Show filters"})]}),(o||window.innerWidth>=1024)&&a.jsxs(a.Fragment,{children:[a.jsxs(WB,{type:"multiple",defaultValue:["language","type","period","sort","tags"],children:[a.jsxs(ei,{value:"language",children:[a.jsx(ti,{children:"Language"}),a.jsx(ni,{children:a.jsx("div",{className:"space-y-2",children:d.map(b=>a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(is,{id:`language-${b}`,checked:e.language===b,onCheckedChange:S=>{t(S?{language:b}:{language:void 0})}}),a.jsx(_n,{htmlFor:`language-${b}`,className:"text-sm text-navy/80 dark:text-cream/80 cursor-pointer",children:b})]},b))})})]}),a.jsxs(ei,{value:"type",children:[a.jsx(ti,{children:"Work Type"}),a.jsx(ni,{children:a.jsxs(Qp,{value:e.type||"",onValueChange:b=>t({type:b||void 0}),children:[f.map(b=>a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Ku,{value:b.value,id:`type-${b.value}`}),a.jsx(_n,{htmlFor:`type-${b.value}`,className:"text-sm text-navy/80 dark:text-cream/80 cursor-pointer",children:b.label})]},b.value)),a.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[a.jsx(Ku,{value:"",id:"type-all"}),a.jsx(_n,{htmlFor:"type-all",className:"text-sm text-navy/80 dark:text-cream/80 cursor-pointer",children:"All Types"})]})]})})]}),a.jsxs(ei,{value:"period",children:[a.jsx(ti,{children:"Time Period"}),a.jsx(ni,{children:a.jsxs("div",{className:"space-y-2",children:[m.map(b=>a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(is,{id:`century-${b.label}`,checked:e.yearStart===b.value[0]&&e.yearEnd===b.value[1],onCheckedChange:S=>{S?t({yearStart:b.value[0],yearEnd:b.value[1]}):e.yearStart===b.value[0]&&e.yearEnd===b.value[1]&&t({yearStart:void 0,yearEnd:void 0})}}),a.jsx(_n,{htmlFor:`century-${b.label}`,className:"text-sm text-navy/80 dark:text-cream/80 cursor-pointer",children:b.label})]},b.label)),a.jsx("div",{className:"mt-4 flex items-center gap-2",children:a.jsx(_n,{className:"text-sm",children:"Custom range:"})}),a.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[a.jsxs(Bn,{value:e.yearStart?.toString()||"",onValueChange:b=>{const S=b?parseInt(b,10):void 0;t({yearStart:S})},children:[a.jsx(Mn,{className:"w-24 h-8 text-xs",children:a.jsx(Vn,{placeholder:"From"})}),a.jsxs(Dn,{children:[a.jsx(Qe,{value:"any",children:"Any"}),Array.from({length:10},(b,S)=>1500+S*50).map(b=>a.jsx(Qe,{value:b.toString(),children:b},b))]})]}),a.jsx("span",{children:"-"}),a.jsxs(Bn,{value:e.yearEnd?.toString()||"",onValueChange:b=>{const S=b?parseInt(b,10):void 0;t({yearEnd:S})},children:[a.jsx(Mn,{className:"w-24 h-8 text-xs",children:a.jsx(Vn,{placeholder:"To"})}),a.jsxs(Dn,{children:[a.jsx(Qe,{value:"any",children:"Any"}),Array.from({length:11},(b,S)=>1550+S*50).map(b=>a.jsx(Qe,{value:b.toString(),children:b},b))]})]})]})]})})]}),a.jsxs(ei,{value:"sort",children:[a.jsx(ti,{children:"Sort By"}),a.jsx(ni,{children:a.jsx(Qp,{value:e.sort||"popularity",onValueChange:b=>t({sort:b}),children:p.map(b=>a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Ku,{value:b.value,id:`sort-${b.value}`}),a.jsx(_n,{htmlFor:`sort-${b.value}`,className:"text-sm text-navy/80 dark:text-cream/80 cursor-pointer",children:b.label})]},b.value))})})]}),Object.entries(u).length>0&&a.jsxs(ei,{value:"tags",children:[a.jsx(ti,{children:"Tags"}),a.jsx(ni,{children:Object.entries(u).map(([b,S])=>a.jsxs("div",{className:"mb-4",children:[a.jsx("h4",{className:"text-sm font-medium mb-2 capitalize",children:b}),a.jsxs("div",{className:"space-y-2",children:[S.slice(0,5).map(N=>a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(is,{id:`tag-${N.id}`,checked:e.tags?.includes(N.id)||!1,onCheckedChange:w=>{v(N.id,w===!0)}}),a.jsx(_n,{htmlFor:`tag-${N.id}`,className:"text-sm text-navy/80 dark:text-cream/80 cursor-pointer",children:N.name})]},N.id)),S.length>5&&a.jsxs(qd,{children:[a.jsx(Yd,{asChild:!0,children:a.jsxs(X,{variant:"link",size:"sm",className:"p-0 text-xs text-russet",children:["Show more"," ",a.jsx(Ed,{className:"ml-1 h-3 w-3"})]})}),a.jsx(sc,{children:S.slice(5).map(N=>a.jsxs(gr,{onClick:()=>{v(N.id,!e.tags?.includes(N.id))},children:[a.jsx(is,{id:`dropdown-tag-${N.id}`,className:"mr-2",checked:e.tags?.includes(N.id)||!1}),N.name]},N.id))})]})]})]},b))})]})]}),a.jsx(X,{variant:"outline",size:"sm",className:"w-full",onClick:y,children:"Clear All Filters"})]})]})})}function cV(){const[e]=ys(),[t,r]=x.useState({page:1}),[o,l]=x.useState("list");x.useEffect(()=>{const R=new URLSearchParams(e.split("?")[1]),T={page:1};R.has("q")&&(T.query=R.get("q")||void 0),R.has("language")&&(T.language=R.get("language")||void 0),R.has("type")&&(T.type=R.get("type")||void 0),R.has("yearStart")&&(T.yearStart=parseInt(R.get("yearStart")||"0",10)||void 0),R.has("yearEnd")&&(T.yearEnd=parseInt(R.get("yearEnd")||"0",10)||void 0),R.has("tags")&&(T.tags=R.get("tags")?.split(",").map(Number)||void 0),R.has("sort")&&(T.sort=R.get("sort")||void 0),R.has("page")&&(T.page=parseInt(R.get("page")||"1",10)),r(T)},[e]);const d=(()=>{const R=new URLSearchParams;t.query&&R.append("q",t.query),t.language&&R.append("language",t.language),t.type&&R.append("type",t.type),t.yearStart&&R.append("yearStart",t.yearStart.toString()),t.yearEnd&&R.append("yearEnd",t.yearEnd.toString()),t.tags&&t.tags.length>0&&R.append("tags",t.tags.join(",")),t.sort&&R.append("sort",t.sort);const T=10,z=(t.page-1)*T;return R.append("limit",T.toString()),R.append("offset",z.toString()),R.toString()})(),{data:f,isLoading:m}=tt({queryKey:[`/api/filter?${d}`],select:R=>R.map(T=>({...T,tags:T.tags?.map(z=>typeof z=="string"?{name:z}:z)}))}),{data:p}=tt({queryKey:["/api/tags"]}),v=R=>{r(T=>({...T,...R,page:1}))},y=R=>{r(T=>({...T,page:R})),window.scrollTo({top:0,behavior:"smooth"})},b=f?.length||0,N=Math.ceil(b/10),w=[],C=5;let k=Math.max(1,t.page-Math.floor(C/2));const E=Math.min(N,k+C-1);E-k+1<C&&(k=Math.max(1,E-C+1));for(let R=k;R<=E;R++)w.push(R);return a.jsx(Kt,{children:a.jsxs("div",{className:"max-w-[var(--content-width)] mx-auto px-4 md:px-6 py-8",children:[a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 mb-8",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl md:text-3xl font-bold font-serif text-navy dark:text-cream",children:"Explore Literature"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70 mt-1",children:"Discover works across languages, genres, and time periods"})]}),a.jsx("div",{className:"flex items-center gap-3",children:a.jsx(Xd,{})})]}),a.jsxs("div",{className:"flex flex-col lg:flex-row gap-8",children:[a.jsx(iA,{filters:t,onFilterChange:v,tags:p||[]}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[a.jsxs("div",{className:"text-sm text-navy/70 dark:text-cream/70",children:["Showing"," ",a.jsx("span",{className:"font-medium text-navy dark:text-cream",children:f?.length||0})," ","results",t.query&&a.jsxs("span",{children:[" ","for"," ",a.jsxs("span",{className:"font-medium text-navy dark:text-cream",children:['"',t.query,'"']})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-navy/70 dark:text-cream/70",children:"Display:"}),a.jsxs(X,{size:"icon",variant:o==="grid"?"default":"ghost",className:"h-8 w-8 p-0",onClick:()=>l("grid"),children:[a.jsx(ix,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Grid view"})]}),a.jsxs(X,{size:"icon",variant:o==="list"?"default":"ghost",className:"h-8 w-8 p-0",onClick:()=>l("list"),children:[a.jsx(Rd,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"List view"})]})]})]}),m?a.jsx("div",{className:"space-y-4",children:Array.from({length:5}).map((R,T)=>a.jsx("div",{className:"h-40 bg-cream dark:bg-dark-surface rounded-lg animate-pulse"},T))}):o==="list"?a.jsx("div",{className:"space-y-3",children:f?.map(R=>a.jsx(Ar,{work:R},R.id))}):a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:f?.map(R=>a.jsx(Ar,{work:R,grid:!0},R.id))}),N>1&&a.jsx("div",{className:"mt-8 flex justify-center",children:a.jsxs("nav",{className:"flex items-center gap-1","aria-label":"Pagination",children:[a.jsxs(X,{variant:"ghost",size:"icon",onClick:()=>y(Math.max(1,t.page-1)),disabled:t.page===1,children:[a.jsx(Xl,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Previous"})]}),k>1&&a.jsxs(a.Fragment,{children:[a.jsx(X,{variant:t.page===1?"default":"ghost",size:"sm",onClick:()=>y(1),children:"1"}),k>2&&a.jsx("span",{className:"px-2 text-navy/60 dark:text-cream/60",children:"..."})]}),w.map(R=>a.jsx(X,{variant:t.page===R?"default":"ghost",size:"sm",onClick:()=>y(R),children:R},R)),E<N&&a.jsxs(a.Fragment,{children:[E<N-1&&a.jsx("span",{className:"px-2 text-navy/60 dark:text-cream/60",children:"..."}),a.jsx(X,{variant:t.page===N?"default":"ghost",size:"sm",onClick:()=>y(N),children:N})]}),a.jsxs(X,{variant:"ghost",size:"icon",onClick:()=>y(Math.min(N,t.page+1)),disabled:t.page===N,children:[a.jsx(Ad,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Next"})]})]})})]})]})]})})}function Pg({author:e,size:t="md",withLifeDates:r=!1,className:o=""}){function l(){switch(t){case"sm":return"w-8 h-8";case"lg":return"w-12 h-12";default:return"w-10 h-10"}}function u(){switch(t){case"sm":return"text-sm";case"lg":return"text-lg";default:return"text-base"}}function d(f){return f.split(" ").map(m=>m.charAt(0)).join("").toUpperCase().slice(0,2)}return e?a.jsx(Ce,{href:`/authors/${e.slug}`,children:a.jsxs("div",{className:`flex items-center gap-2 group ${o}`,children:[a.jsxs(di,{className:`rounded-full bg-navy/10 dark:bg-navy/20 overflow-hidden flex-shrink-0 ${l()}`,children:[a.jsx(dc,{src:e.portrait||"",alt:e.name}),a.jsx(fi,{className:"bg-navy/10 dark:bg-navy/20 text-navy dark:text-cream",children:d(e.name)})]}),a.jsxs("div",{children:[a.jsx("h3",{className:`${u()} text-navy dark:text-cream font-medium group-hover:text-russet dark:group-hover:text-russet/90 transition-colors`,children:e.name}),r&&e.birthYear&&a.jsxs("p",{className:"text-xs text-navy/70 dark:text-cream/70",children:[e.birthYear,"–",e.deathYear||"present"]})]})]})}):a.jsxs("div",{className:`flex items-center gap-2 ${o}`,children:[a.jsx("div",{className:`flex items-center justify-center rounded-full bg-navy/10 dark:bg-navy/20 overflow-hidden flex-shrink-0 ${l()}`,children:a.jsx("span",{className:"text-navy/60 dark:text-cream/60",children:"?"})}),a.jsx("div",{children:a.jsx("h3",{className:`${u()} text-navy/70 dark:text-cream/70 font-medium`,children:"Unknown Author"})})]})}function uV(){const{data:e,isLoading:t}=tt({queryKey:["/api/authors?limit=4"],select:d=>d.map(f=>({...f,country:f.country&&typeof f.country=="object"?f.country.name:f.country}))}),{data:r,isLoading:o}=tt({queryKey:["/api/works?limit=3"]}),l=[{text:"The world is a book and those who do not travel read only one page.",author:"St. Augustine"},{text:"In a good book the best is between the lines.",author:"Swedish Proverb"},{text:"We read to know we are not alone.",author:"C.S. Lewis"},{text:"A reader lives a thousand lives before he dies. The man who never reads lives only one.",author:"George R.R. Martin"}],u=l[Math.floor(Math.random()*l.length)];return a.jsxs(Kt,{children:[a.jsx("section",{className:"bg-primary/10 dark:bg-primary/20 py-16 md:py-24",children:a.jsxs("div",{className:"max-w-[var(--content-width)] mx-auto px-4 md:px-6 text-center",children:[a.jsxs("div",{className:"max-w-3xl mx-auto mb-8",children:[a.jsx("h1",{className:"text-3xl md:text-4xl lg:text-5xl font-serif font-bold text-primary dark:text-primary-foreground mb-6",children:"Discover the world's literary heritage"}),a.jsxs("p",{className:"text-lg md:text-xl text-foreground/80 dark:text-foreground/80 italic font-serif mb-2",children:['"',u.text,'"']}),a.jsxs("p",{className:"text-foreground/60 dark:text-foreground/60",children:["— ",u.author]})]}),a.jsx(Xd,{className:"max-w-xl mx-auto",fullWidth:!0})]})}),a.jsx("section",{className:"py-12 md:py-16",children:a.jsxs("div",{className:"max-w-[var(--content-width)] mx-auto px-4 md:px-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-8",children:[a.jsx("h2",{className:"text-2xl md:text-3xl font-serif font-bold text-primary dark:text-primary-foreground",children:"Featured Authors"}),a.jsx(Ce,{href:"/authors",children:a.jsx(X,{variant:"link",className:"text-accent dark:text-accent",children:"View all authors"})})]}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6",children:t?Array.from({length:4}).map((d,f)=>a.jsx(Oe,{className:"bg-card dark:bg-card",children:a.jsxs(Ve,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[a.jsx("div",{className:"w-16 h-16 rounded-full bg-primary/10 dark:bg-primary/20 animate-pulse"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{className:"h-5 bg-primary/10 dark:bg-primary/20 rounded-md w-3/4 mb-2 animate-pulse"}),a.jsx("div",{className:"h-4 bg-primary/10 dark:bg-primary/20 rounded-md w-1/2 animate-pulse"})]})]}),a.jsx("div",{className:"h-20 bg-primary/10 dark:bg-primary/20 rounded-md animate-pulse"})]})},f)):e?.map(d=>a.jsx(Oe,{className:"bg-card dark:bg-card hover:shadow-md transition-shadow",children:a.jsxs(Ve,{className:"p-6",children:[a.jsx(Pg,{author:d,size:"lg",withLifeDates:!0,className:"mb-4"}),a.jsxs("p",{className:"text-foreground/80 dark:text-foreground/80 text-sm line-clamp-4 mb-4",children:[d.biography?.slice(0,150),"..."]}),a.jsx(Ce,{href:`/authors/${d.slug}`,children:a.jsx(X,{size:"sm",variant:"outline",className:"w-full text-primary dark:text-primary border-primary/50 hover:bg-primary/10",children:"Explore works"})})]})},d.id))})]})}),a.jsx("section",{className:"py-12 md:py-16 bg-muted dark:bg-muted",children:a.jsxs("div",{className:"max-w-[var(--content-width)] mx-auto px-4 md:px-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-8",children:[a.jsx("h2",{className:"text-2xl md:text-3xl font-serif font-bold text-primary dark:text-primary-foreground",children:"Trending Works"}),a.jsx(Ce,{href:"/explore",children:a.jsx(X,{variant:"link",className:"text-accent dark:text-accent",children:"Explore all works"})})]}),a.jsx("div",{className:"space-y-6",children:o?Array.from({length:3}).map((d,f)=>a.jsx("div",{className:"h-40 bg-card dark:bg-card rounded-lg animate-pulse"},f)):r?.map(d=>a.jsx(Ar,{work:d},d.id))})]})}),a.jsx("section",{className:"py-12 md:py-16",children:a.jsxs("div",{className:"max-w-[var(--content-width)] mx-auto px-4 md:px-6",children:[a.jsxs("div",{className:"flex justify-between items-center mb-8",children:[a.jsx("h2",{className:"text-2xl md:text-3xl font-serif font-bold text-primary dark:text-primary-foreground",children:"Recently Translated"}),a.jsx(Ce,{href:"/explore?sort=recent",children:a.jsx(X,{variant:"link",className:"text-accent dark:text-accent",children:"See more"})})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:o?Array.from({length:3}).map((d,f)=>a.jsx("div",{className:"h-64 bg-card dark:bg-card rounded-lg animate-pulse"},f)):r?.map(d=>a.jsx(Ar,{work:d,grid:!0},d.id))})]})}),a.jsx("section",{className:"py-16 md:py-24 bg-russet text-white",children:a.jsxs("div",{className:"max-w-[var(--content-width)] mx-auto px-4 md:px-6 text-center",children:[a.jsx("h2",{className:"text-2xl md:text-3xl font-serif font-bold mb-4",children:"Contribute to Literary Heritage"}),a.jsx("p",{className:"text-lg max-w-2xl mx-auto mb-8 text-white/90",children:"Share your translations, engage with other readers, and help preserve and spread literary works across languages."}),a.jsxs("div",{className:"flex gap-4 justify-center flex-wrap",children:[a.jsx(Ce,{href:"/submit",children:a.jsx(X,{size:"lg",className:"bg-white hover:bg-white/90 text-russet",children:"Submit a Translation"})}),a.jsx(Ce,{href:"/explore",children:a.jsx(X,{size:"lg",variant:"outline",className:"text-white border-white/30 hover:bg-white/10",children:"Explore the Archive"})})]})]})})]})}function dV(){return a.jsx("div",{className:"min-h-screen w-full flex items-center justify-center bg-gray-50",children:a.jsx(Oe,{className:"w-full max-w-md mx-4",children:a.jsxs(Ve,{className:"pt-6",children:[a.jsxs("div",{className:"flex mb-4 gap-2",children:[a.jsx(X1,{className:"h-8 w-8 text-red-500"}),a.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"404 Page Not Found"})]}),a.jsx("p",{className:"mt-4 text-sm text-gray-600",children:"Did you forget to add the page to the router?"})]})})})}function fV(){const[e,t]=ys(),[r,o]=x.useState(""),[l,u]=x.useState("all"),[d,f]=x.useState("list"),[m,p]=x.useState(!1),[v,y]=x.useState({page:1});x.useEffect(()=>{const L=new URLSearchParams(e.split("?")[1]),F=L.get("q");F&&o(F);const Q=L.get("language"),_=L.get("type"),B=L.get("yearStart"),ge=L.get("yearEnd"),fe=L.get("tags");y({language:Q||void 0,type:_||void 0,yearStart:B?parseInt(B):void 0,yearEnd:ge?parseInt(ge):void 0,tags:fe?fe.split(","):void 0,page:parseInt(L.get("page")||"1")})},[e]);const{data:b,isLoading:S}=tt({queryKey:["/api/search",r],queryFn:async()=>!r||r.length<2?{works:[],authors:[]}:await(await fetch(`/api/search?q=${encodeURIComponent(r)}`)).json(),enabled:r.length>=2,select:L=>({...L,works:L.works.map(F=>({...F,tags:F.tags?.map(Q=>typeof Q=="string"?{name:Q,id:Q,type:"general",createdAt:""}:Q)}))})}),{data:N,isLoading:w}=tt({queryKey:["/api/filter",v],queryFn:async()=>{const L=new URLSearchParams;return r&&L.append("q",r),v.language&&L.append("language",v.language),v.type&&L.append("type",v.type),v.yearStart&&L.append("yearStart",v.yearStart.toString()),v.yearEnd&&L.append("yearEnd",v.yearEnd.toString()),v.tags&&v.tags.length>0&&L.append("tags",v.tags.join(",")),await(await fetch(`/api/filter?${L.toString()}`)).json()},enabled:l==="advanced"&&(!!v.language||!!v.type||!!v.yearStart||!!v.yearEnd||!!(v.tags&&v.tags.length>0)),select:L=>L.map(F=>({...F,tags:F.tags?.map(Q=>typeof Q=="string"?{name:Q,id:Q,type:"general",createdAt:""}:Q)}))}),{data:C}=tt({queryKey:["/api/tags"]}),k=L=>{if(L.preventDefault(),r.trim()){const F=new URLSearchParams;F.append("q",r.trim()),l==="advanced"&&(v.language&&F.append("language",v.language),v.type&&F.append("type",v.type),v.yearStart&&F.append("yearStart",v.yearStart.toString()),v.yearEnd&&F.append("yearEnd",v.yearEnd.toString()),v.tags&&v.tags.length>0&&F.append("tags",v.tags.join(","))),t(`/search?${F.toString()}`)}},E=L=>{y(F=>({...F,...L,page:1}))},R=()=>{o(""),t("/search")},T=L=>{y(F=>({...F,page:L})),window.scrollTo({top:0,behavior:"smooth"})},z=l==="works"?b?.works.length||0:l==="authors"?b?.authors.length||0:l==="advanced"?N?.length||0:(b?.works.length||0)+(b?.authors.length||0),$=Math.ceil(z/10),V=v.page,J=5;let se=Math.max(1,V-Math.floor(J/2));const ie=Math.min($,se+J-1);ie-se+1<J&&(se=Math.max(1,ie-J+1));const te=[];for(let L=se;L<=ie;L++)te.push(L);const q=l==="advanced"?N||[]:b?.works||[],de=S&&l!=="advanced"||w&&l==="advanced",me=r.length>=2&&!de&&(l==="all"||l==="works"||l==="advanced")&&q.length===0,O=r.length>=2&&!de&&(l==="all"||l==="authors")&&(b?.authors.length||0)===0;return a.jsx(Kt,{children:a.jsxs("div",{className:"max-w-[var(--content-width)] mx-auto px-4 md:px-6 py-8",children:[a.jsxs("div",{className:"mb-8",children:[a.jsx("h1",{className:"text-2xl md:text-3xl font-bold font-serif text-primary dark:text-primary-foreground mb-2",children:"Search Literary Works"}),a.jsx("p",{className:"text-foreground/70 dark:text-foreground/70",children:"Discover literary treasures from our extensive collection"})]}),a.jsx("form",{onSubmit:k,className:"mb-8",children:a.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(Xs,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),a.jsx(tr,{type:"text",placeholder:"Search by title, author, or keyword...",value:r,onChange:L=>o(L.target.value),className:"pl-10 h-11 pr-10"}),r&&a.jsxs(X,{type:"button",variant:"ghost",size:"icon",onClick:R,className:"absolute right-2 top-1/2 transform -translate-y-1/2 h-7 w-7 p-0",children:[a.jsx(Td,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Clear search"})]})]}),a.jsx(X,{type:"submit",className:"h-11 px-6",children:"Search"})]})}),a.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-6 gap-4",children:[a.jsx(Ns,{defaultValue:"all",value:l,onValueChange:u,className:"w-full sm:w-auto",children:a.jsxs(_a,{children:[a.jsx(gt,{value:"all",children:"All Results"}),a.jsx(gt,{value:"works",children:"Works"}),a.jsx(gt,{value:"authors",children:"Authors"}),a.jsx(gt,{value:"advanced",children:"Advanced"})]})}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(X,{variant:"outline",size:"sm",onClick:()=>p(!m),className:"sm:hidden",children:[a.jsx(ej,{className:"h-4 w-4 mr-2"}),m?"Hide Filters":"Show Filters"]}),a.jsxs("div",{className:"hidden sm:flex items-center gap-2",children:[a.jsx("span",{className:"text-sm text-foreground/70",children:"View:"}),a.jsxs(X,{size:"icon",variant:d==="grid"?"default":"ghost",className:"h-8 w-8 p-0",onClick:()=>f("grid"),children:[a.jsx(ix,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Grid view"})]}),a.jsxs(X,{size:"icon",variant:d==="list"?"default":"ghost",className:"h-8 w-8 p-0",onClick:()=>f("list"),children:[a.jsx(Rd,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"List view"})]})]})]})]}),a.jsxs("div",{className:"flex flex-col lg:flex-row gap-8",children:[(l==="advanced"||m)&&a.jsx(iA,{filters:v,onFilterChange:E,tags:C||[]}),a.jsxs("div",{className:"flex-1",children:[r&&r.length>=2&&a.jsx("div",{className:"mb-4 text-sm text-foreground/70",children:de?a.jsxs("p",{children:['Searching for "',r,'"...']}):a.jsxs("p",{children:['Showing results for "',a.jsx("span",{className:"font-medium text-foreground",children:r}),'"',l!=="advanced"&&b&&a.jsxs("span",{children:[" ","- ",b.works.length," works,"," ",b.authors.length," authors found"]}),l==="advanced"&&N&&a.jsxs("span",{children:[" ","- ",N.length," works match your filters"]})]})}),(l==="all"||l==="authors")&&r.length>=2&&a.jsxs(a.Fragment,{children:[l==="all"&&b?.authors&&b.authors.length>0&&a.jsx("h2",{className:"text-xl font-medium font-serif mb-4 text-primary dark:text-primary-foreground",children:"Authors"}),de?a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-8",children:Array.from({length:3}).map((L,F)=>a.jsx(Oe,{className:"bg-card",children:a.jsxs(Ve,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[a.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 animate-pulse"}),a.jsxs("div",{children:[a.jsx("div",{className:"h-4 w-32 bg-primary/10 rounded animate-pulse mb-2"}),a.jsx("div",{className:"h-3 w-24 bg-primary/10 rounded animate-pulse"})]})]}),a.jsx("div",{className:"h-16 bg-primary/10 rounded animate-pulse"})]})},F))}):a.jsxs(a.Fragment,{children:[b?.authors&&b.authors.length>0&&a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 mb-8",children:b.authors.map(L=>a.jsx(Oe,{className:"bg-card hover:shadow-md transition-shadow",children:a.jsxs(Ve,{className:"p-6",children:[a.jsx(Pg,{author:L,size:"lg",withLifeDates:!0,className:"mb-3"}),a.jsxs("p",{className:"text-foreground/80 text-sm line-clamp-3 mb-3",children:[L.biography?.slice(0,120),"..."]}),a.jsx(X,{size:"sm",variant:"outline",className:"w-full",onClick:()=>t(`/authors/${L.slug}`),children:"View Profile"})]})},L.id))}),O&&l==="authors"&&a.jsxs("div",{className:"text-center py-12 bg-muted/30 rounded-lg mb-8",children:[a.jsxs("p",{className:"text-lg text-foreground/70 mb-2",children:['No authors found matching "',r,'"']}),a.jsx("p",{className:"text-sm text-foreground/60",children:"Try a different search term or check your spelling"})]})]})]}),(l==="all"||l==="works"||l==="advanced")&&a.jsxs(a.Fragment,{children:[l==="all"&&b?.works&&b.works.length>0&&a.jsx("h2",{className:"text-xl font-medium font-serif mb-4 text-primary dark:text-primary-foreground",children:"Works"}),de?d==="list"?a.jsx("div",{className:"space-y-4",children:Array.from({length:5}).map((L,F)=>a.jsx("div",{className:"h-28 bg-card rounded-lg animate-pulse"},F))}):a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Array.from({length:6}).map((L,F)=>a.jsx("div",{className:"h-48 bg-card rounded-lg animate-pulse"},F))}):q.length>0?d==="list"?a.jsx("div",{className:"space-y-3",children:q.map(L=>a.jsx(Ar,{work:L},L.id))}):a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:q.map(L=>a.jsx(Ar,{work:L,grid:!0},L.id))}):me&&a.jsxs("div",{className:"text-center py-12 bg-muted/30 rounded-lg",children:[a.jsxs("p",{className:"text-lg text-foreground/70 mb-2",children:['No works found matching "',r,'"']}),a.jsx("p",{className:"text-sm text-foreground/60",children:l==="advanced"?"Try adjusting your filters or using different search terms":"Try a different search term or check your spelling"})]})]}),r.length<2&&a.jsxs("div",{className:"text-center py-16 bg-muted/30 rounded-lg",children:[a.jsx(Xs,{className:"h-12 w-12 mx-auto mb-4 text-primary/50"}),a.jsx("h3",{className:"text-xl font-medium mb-2 text-foreground",children:"Start Your Literary Journey"}),a.jsx("p",{className:"text-foreground/70 max-w-md mx-auto mb-6",children:"Enter a search term above to discover works by title, author, or keyword"}),a.jsx("div",{className:"flex flex-wrap justify-center gap-2 max-w-md mx-auto",children:["Poetry","Novel","Tolstoy","Shakespeare","Modernism","Love"].map(L=>a.jsx(X,{variant:"outline",size:"sm",onClick:()=>{o(L);const F=new URLSearchParams;F.append("q",L),t(`/search?${F.toString()}`)},children:L},L))})]}),$>1&&!de&&a.jsx("div",{className:"mt-8 flex justify-center",children:a.jsxs("nav",{className:"flex items-center gap-1","aria-label":"Pagination",children:[a.jsxs(X,{variant:"ghost",size:"icon",onClick:()=>T(Math.max(1,V-1)),disabled:V===1,children:[a.jsx(Xl,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Previous"})]}),se>1&&a.jsxs(a.Fragment,{children:[a.jsx(X,{variant:V===1?"default":"ghost",size:"sm",onClick:()=>T(1),children:"1"}),se>2&&a.jsx("span",{className:"px-2 text-foreground/60",children:"..."})]}),te.map(L=>a.jsx(X,{variant:V===L?"default":"ghost",size:"sm",onClick:()=>T(L),children:L},L)),ie<$&&a.jsxs(a.Fragment,{children:[ie<$-1&&a.jsx("span",{className:"px-2 text-foreground/60",children:"..."}),a.jsx(X,{variant:V===$?"default":"ghost",size:"sm",onClick:()=>T($),children:$})]}),a.jsxs(X,{variant:"ghost",size:"icon",onClick:()=>T(Math.min($,V+1)),disabled:V===$,children:[a.jsx(Ad,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Next"})]})]})})]})]})]})})}function Xp({content:e,fontSizeClass:t="text-size-md",onLineClick:r,highlightedLine:o}){const{toast:l}=Ta(),[u,d]=x.useState(null),f=e.split(`
|
||
`),m=b=>{d(b)},p=()=>{d(null)},v=(b,S)=>{navigator.clipboard.writeText(S),l({description:"Line copied to clipboard",duration:2e3})},y=b=>{const S=new URL(window.location.href);S.hash=`line-${b}`,navigator.clipboard.writeText(S.toString()),l({description:"Link to line copied to clipboard",duration:2e3})};return a.jsx("div",{className:`reading-text ${t}`,children:f.map((b,S)=>{const N=S+1,w=N===o,C=N===u;return a.jsxs("div",{id:`line-${N}`,className:`text-line group ${w?"bg-navy/10 dark:bg-cream/10":"hover:bg-navy/5 dark:hover:bg-cream/5"} py-1 rounded flex`,onMouseEnter:()=>m(N),onMouseLeave:p,onClick:()=>r?.(N),children:[a.jsx("span",{className:"line-number",children:N}),a.jsx("p",{className:"flex-1",children:b}),C&&a.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity ml-2",children:[a.jsxs(X,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:k=>{k.stopPropagation(),v(N,b)},children:[a.jsx(J1,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Copy line"})]}),a.jsxs(X,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:k=>{k.stopPropagation(),y(N)},children:[a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"h-4 w-4",children:[a.jsx("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}),a.jsx("path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"})]}),a.jsx("span",{className:"sr-only",children:"Copy link to line"})]})]})]},`line-${N}`)})})}const hV=fC.extend({acknowledgment:Aa().refine(e=>e===!0,{message:"You must acknowledge that you have the rights to submit this translation"}),terms:Aa().refine(e=>e===!0,{message:"You must agree to the terms and conditions"})});function mV(){const[e,t]=x.useState("translation"),[r,o]=x.useState(1),[l,u]=x.useState(null),[d,f]=x.useState(!1),{toast:m}=Ta(),{data:p,isLoading:v}=tt({queryKey:["/api/authors"]}),y=ug({resolver:dg(hV),defaultValues:{workId:"",title:"",language:"",content:"",translatorId:"",year:new Date().getFullYear(),notes:"",acknowledgment:!1,terms:!1}}),b=y.watch("workId"),{data:S,isLoading:N}=tt({queryKey:["/api/authors/works",b],enabled:!!b}),w=Array.isArray(S)?S:[],C=Ys({mutationFn:async T=>{const{acknowledgment:z,terms:ne,...$}=T;return await Qr("POST","/api/translations",$)},onSuccess:()=>{m({title:"Success!",description:"Your translation has been submitted for review"}),ci.invalidateQueries({queryKey:["/api/translations"]}),y.reset(),o(1),f(!1)},onError:T=>{m({title:"Error",description:`Failed to submit translation: ${T.message}`,variant:"destructive"})}}),k=T=>{r<4?o(r+1):C.mutate(T)},E=()=>{r>1&&o(r-1)},R=async T=>{if(T)try{const z=await fetch(`/api/works/${T}`);if(z.ok){const ne=await z.json();u(ne),y.setValue("title",ne.title)}}catch(z){console.error("Error fetching work details:",z)}else u(null)};return a.jsx(Kt,{children:a.jsxs("div",{className:"max-w-[var(--content-width)] mx-auto px-4 md:px-6 py-8",children:[a.jsxs("div",{className:"mb-8 text-center",children:[a.jsx("h1",{className:"text-2xl md:text-3xl font-bold font-serif text-navy dark:text-cream mb-2",children:"Contribute to Tercul"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70 max-w-2xl mx-auto",children:"Share translations of literary works with readers around the world. Your contributions help preserve and spread literary heritage across languages."})]}),a.jsxs(Oe,{className:"bg-cream dark:bg-dark-surface mb-8",children:[a.jsxs(zt,{children:[a.jsx(Gt,{className:"font-serif",children:"Choose Contribution Type"}),a.jsx(Xr,{children:"Select whether you're submitting a new translation or an original work"})]}),a.jsx(Ve,{children:a.jsxs(Ns,{defaultValue:"translation",onValueChange:T=>t(T),children:[a.jsxs(_a,{className:"grid w-full grid-cols-2",children:[a.jsx(gt,{value:"translation",children:"Translation"}),a.jsx(gt,{value:"original",children:"Original Work"})]}),a.jsx(dn,{value:"translation",className:"pt-4",children:a.jsx("p",{className:"text-navy/80 dark:text-cream/80 mb-2",children:"Submit a translation of an existing work in the Tercul library. You'll need to select the original work and provide your translation."})}),a.jsxs(dn,{value:"original",className:"pt-4",children:[a.jsx("p",{className:"text-navy/80 dark:text-cream/80 mb-2",children:"Submit an original work not yet in the Tercul library. This feature is coming soon!"}),a.jsxs("div",{className:"flex items-center p-4 bg-navy/10 dark:bg-navy/20 rounded-lg mt-2",children:[a.jsx(X1,{className:"h-5 w-5 text-navy/70 dark:text-cream/70 mr-2"}),a.jsx("p",{className:"text-sm text-navy/70 dark:text-cream/70",children:"Original work submission is currently under development. Please check back later or contact us to submit original works."})]})]})]})})]}),e==="translation"&&a.jsxs("div",{className:"space-y-8",children:[a.jsxs("div",{className:"mb-8",children:[a.jsxs("div",{className:"flex justify-between mb-2",children:[a.jsxs("span",{className:"text-sm text-navy/70 dark:text-cream/70",children:["Step ",r," of 4"]}),a.jsxs("span",{className:"text-sm text-navy/70 dark:text-cream/70",children:[Math.round(r/4*100),"% Complete"]})]}),a.jsx(os,{value:r/4*100,className:"h-2"})]}),a.jsx(yg,{...y,children:a.jsxs("form",{onSubmit:y.handleSubmit(k),className:"space-y-8",children:[r===1&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("h2",{className:"text-lg font-serif font-semibold text-navy dark:text-cream",children:"Select the original work"}),a.jsx(En,{control:y.control,name:"workId",render:()=>a.jsxs(jn,{children:[a.jsx(gn,{children:"Author"}),a.jsxs(Bn,{disabled:v,onValueChange:T=>{},children:[a.jsx(Nn,{children:a.jsx(Mn,{children:a.jsx(Vn,{placeholder:"Select author"})})}),a.jsx(Dn,{children:v?a.jsx(Qe,{value:"loading",disabled:!0,children:"Loading authors..."}):p&&p.length>0?p.map(T=>a.jsx(Qe,{value:T.id.toString(),children:T.name},T.id)):a.jsx(Qe,{value:"empty",disabled:!0,children:"No authors found"})})]}),a.jsx(An,{children:"Select the author of the original work"}),a.jsx(Jn,{})]})}),a.jsx(En,{control:y.control,name:"workId",render:({field:T})=>a.jsxs(jn,{children:[a.jsx(gn,{children:"Original Work"}),a.jsxs(Bn,{disabled:!y.watch("workId")||N,onValueChange:z=>{T.onChange(parseInt(z,10)),R(parseInt(z,10))},value:T.value?T.value.toString():void 0,children:[a.jsx(Nn,{children:a.jsx(Mn,{children:a.jsx(Vn,{placeholder:"Select work"})})}),a.jsx(Dn,{children:N?a.jsx(Qe,{value:"loading",disabled:!0,children:"Loading works..."}):w.length>0?w.map(z=>a.jsx(Qe,{value:z.id.toString(),children:z.title},z.id)):a.jsx(Qe,{value:"empty",disabled:!0,children:y.watch("workId")?"No works found for this author":"Select an author first"})})]}),a.jsx(An,{children:"Select the original work you're translating"}),a.jsx(Jn,{})]})}),l&&a.jsxs("div",{className:"mt-4 p-4 border border-sage/20 dark:border-sage/10 rounded-lg bg-paper dark:bg-dark-paper",children:[a.jsx("h3",{className:"font-medium mb-2",children:"Original Work Preview"}),a.jsxs("p",{className:"text-sm text-navy/70 dark:text-cream/70 mb-2",children:["Language: ",l.language," • Published:"," ",l.year||"Unknown"]}),a.jsx("div",{className:"max-h-40 overflow-y-auto border border-sage/20 dark:border-sage/10 rounded p-3 bg-cream dark:bg-dark-surface",children:a.jsxs("p",{className:"text-sm whitespace-pre-line",children:[l.content.substring(0,300),"..."]})})]})]}),r===2&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("h2",{className:"text-lg font-serif font-semibold text-navy dark:text-cream",children:"Translation Details"}),a.jsx(En,{control:y.control,name:"title",render:({field:T})=>a.jsxs(jn,{children:[a.jsx(gn,{children:"Translation Title"}),a.jsx(Nn,{children:a.jsx(tr,{placeholder:"Enter the title of your translation",...T})}),a.jsx(An,{children:"You can use the original title or provide a translated title"}),a.jsx(Jn,{})]})}),a.jsx(En,{control:y.control,name:"language",render:({field:T})=>a.jsxs(jn,{children:[a.jsx(gn,{children:"Target Language"}),a.jsxs(Bn,{onValueChange:T.onChange,value:T.value,children:[a.jsx(Nn,{children:a.jsx(Mn,{children:a.jsx(Vn,{placeholder:"Select language"})})}),a.jsxs(Dn,{children:[a.jsx(Qe,{value:"English",children:"English"}),a.jsx(Qe,{value:"French",children:"French"}),a.jsx(Qe,{value:"German",children:"German"}),a.jsx(Qe,{value:"Spanish",children:"Spanish"}),a.jsx(Qe,{value:"Italian",children:"Italian"}),a.jsx(Qe,{value:"Russian",children:"Russian"}),a.jsx(Qe,{value:"Chinese",children:"Chinese"}),a.jsx(Qe,{value:"Japanese",children:"Japanese"})]})]}),a.jsx(An,{children:"The language you're translating into"}),a.jsx(Jn,{})]})}),a.jsx(En,{control:y.control,name:"year",render:({field:T})=>a.jsxs(jn,{children:[a.jsx(gn,{children:"Year of Translation"}),a.jsx(Nn,{children:a.jsx(tr,{type:"number",min:"1800",max:new Date().getFullYear(),placeholder:"Enter year",...T,onChange:z=>T.onChange(parseInt(z.target.value,10))})}),a.jsx(An,{children:"When was this translation created"}),a.jsx(Jn,{})]})})]}),r===3&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("h2",{className:"text-lg font-serif font-semibold text-navy dark:text-cream",children:"Translation Content"}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[l&&a.jsxs("div",{className:"border border-sage/20 dark:border-sage/10 rounded-lg p-4",children:[a.jsxs("h3",{className:"font-medium mb-2",children:["Original Text (",l.language,")"]}),a.jsx("div",{className:"max-h-[400px] overflow-y-auto p-2",children:a.jsx("pre",{className:"whitespace-pre-wrap font-serif text-sm",children:l.content})})]}),a.jsx(En,{control:y.control,name:"content",render:({field:T})=>a.jsxs(jn,{children:[a.jsx(gn,{children:"Your Translation"}),a.jsx(Nn,{children:a.jsx(xs,{placeholder:"Enter your translation here",className:"min-h-[400px] font-serif",...T})}),a.jsx(An,{children:"Paste or type your translation, preserving line breaks where appropriate"}),a.jsx(Jn,{})]})})]}),a.jsx(En,{control:y.control,name:"notes",render:({field:T})=>a.jsxs(jn,{children:[a.jsx(gn,{children:"Translation Notes (Optional)"}),a.jsx(Nn,{children:a.jsx(xs,{placeholder:"Add any notes about your translation approach, challenges, or other relevant information",className:"min-h-[100px]",...T})}),a.jsx(An,{children:"These notes will be displayed to readers alongside your translation"}),a.jsx(Jn,{})]})})]}),r===4&&a.jsxs("div",{className:"space-y-6",children:[a.jsx("h2",{className:"text-lg font-serif font-semibold text-navy dark:text-cream",children:"Review and Submit"}),a.jsx("div",{className:"flex justify-end mb-2",children:a.jsx(X,{type:"button",variant:"outline",onClick:()=>f(!d),children:d?"Show Details":"Preview Translation"})}),d?a.jsxs(Oe,{className:"bg-cream dark:bg-dark-surface",children:[a.jsxs(zt,{children:[a.jsx(Gt,{children:y.getValues().title}),a.jsxs(Xr,{children:["Translated to ",y.getValues().language," (",y.getValues().year,")"]})]}),a.jsx(Ve,{children:a.jsxs("div",{className:"prose dark:prose-invert max-w-none",children:[a.jsx(Xp,{content:y.getValues().content,fontSizeClass:"text-size-md"}),y.getValues().notes&&a.jsxs("div",{className:"mt-6 pt-4 border-t border-sage/20 dark:border-sage/10",children:[a.jsx("h3",{className:"text-lg font-medium font-serif mb-2",children:"Translation Notes"}),a.jsx("p",{className:"whitespace-pre-line text-sm",children:y.getValues().notes})]})]})})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium mb-2",children:"Original Work"}),a.jsxs("p",{className:"text-navy/80 dark:text-cream/80",children:[l?.title," by"," ",l?.author?.name]}),a.jsxs("p",{className:"text-sm text-navy/70 dark:text-cream/70",children:[l?.language,","," ",l?.year||"Unknown year"]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium mb-2",children:"Translation"}),a.jsx("p",{className:"text-navy/80 dark:text-cream/80",children:y.getValues().title}),a.jsxs("p",{className:"text-sm text-navy/70 dark:text-cream/70",children:[y.getValues().language,","," ",y.getValues().year]})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium mb-2",children:"Content"}),a.jsxs("p",{className:"text-sm text-navy/70 dark:text-cream/70",children:["Translation length:"," ",y.getValues().content.split(`
|
||
`).length," lines,"," ",y.getValues().content.length," characters"]}),a.jsx("div",{className:"mt-2 p-2 border border-sage/20 dark:border-sage/10 rounded bg-paper dark:bg-dark-paper max-h-40 overflow-y-auto",children:a.jsxs("p",{className:"text-sm whitespace-pre-line",children:[y.getValues().content.substring(0,300),y.getValues().content.length>300?"...":""]})})]}),y.getValues().notes&&a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium mb-2",children:"Notes"}),a.jsx("div",{className:"p-2 border border-sage/20 dark:border-sage/10 rounded bg-paper dark:bg-dark-paper",children:a.jsxs("p",{className:"text-sm whitespace-pre-line",children:[(y.getValues().notes??"").substring(0,200),(y.getValues().notes??"").length>200?"...":""]})})]})]}),a.jsxs("div",{className:"space-y-4 mt-6 pt-6 border-t border-sage/20 dark:border-sage/10",children:[a.jsx(En,{control:y.control,name:"acknowledgment",render:({field:T})=>a.jsxs(jn,{className:"flex flex-row items-start space-x-3 space-y-0",children:[a.jsx(Nn,{children:a.jsx(is,{checked:T.value,onCheckedChange:T.onChange})}),a.jsxs("div",{className:"space-y-1 leading-none",children:[a.jsx(gn,{children:"I acknowledge that I have the rights to submit this translation"}),a.jsx(An,{children:"You confirm that this translation is your own work or you have permission to submit it"})]})]})}),a.jsx(En,{control:y.control,name:"terms",render:({field:T})=>a.jsxs(jn,{className:"flex flex-row items-start space-x-3 space-y-0",children:[a.jsx(Nn,{children:a.jsx(is,{checked:T.value,onCheckedChange:T.onChange})}),a.jsxs("div",{className:"space-y-1 leading-none",children:[a.jsx(gn,{children:"I agree to the terms and conditions"}),a.jsxs(An,{children:["By submitting this translation, you agree to our"," ",a.jsx("a",{href:"/terms",className:"text-russet hover:underline",children:"terms and conditions"})]})]})]})})]})]}),a.jsxs("div",{className:"flex justify-between pt-4",children:[a.jsx(X,{type:"button",variant:"outline",onClick:E,disabled:r===1||C.isPending,children:"Back"}),a.jsx(X,{type:"submit",disabled:C.isPending,children:C.isPending?a.jsxs(a.Fragment,{children:[a.jsx(lx,{className:"mr-2 h-4 w-4 animate-spin"}),"Submitting..."]}):r<4?"Continue":a.jsxs(a.Fragment,{children:[a.jsx(Cd,{className:"mr-2 h-4 w-4"}),"Submit Translation"]})})]})]})})]}),e==="original"&&a.jsx(Oe,{className:"bg-cream dark:bg-dark-surface",children:a.jsxs(Ve,{className:"flex flex-col items-center justify-center text-center py-16",children:[a.jsx("div",{className:"w-16 h-16 bg-navy/10 dark:bg-navy/20 rounded-full flex items-center justify-center mb-4",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8 text-navy dark:text-cream",viewBox:"0 0 24 24",children:a.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 8V8.5M12 12v4M3.08 5.65A10 10 0 0 1 12 2c5.5 0 10 4.5 10 10s-4.5 10-10 10S2 17.5 2 12c0-1.23.22-2.4.62-3.5"})})}),a.jsx("h2",{className:"text-xl font-serif font-semibold mb-2",children:"Coming Soon"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70 max-w-md mx-auto mb-6",children:"The ability to submit original works is currently under development. Please check back soon or contact us if you have an original work to contribute."}),a.jsx(X,{variant:"outline",asChild:!0,children:a.jsx("a",{href:"mailto:contact@tercul.com",children:"Contact Us"})})]})})]})})}const Iu=1;function pV(){const[e,t]=x.useState("bookmarks"),{data:r,isLoading:o}=tt({queryKey:[`/api/users/${Iu}`]}),{data:l,isLoading:u}=tt({queryKey:[`/api/users/${Iu}/bookmarks`],select:v=>v.map(y=>({...y,work:{...y.work,tags:y.work.tags?.map(b=>typeof b=="string"?{name:b,id:b,type:"general",createdAt:""}:b)}}))}),{data:d,isLoading:f}=tt({queryKey:[`/api/users/${Iu}/contributions`]}),{data:m,isLoading:p}=tt({queryKey:[`/api/users/${Iu}/reading-progress`]});return a.jsx(Kt,{children:a.jsxs("div",{className:"max-w-[var(--content-width)] mx-auto px-4 md:px-6 py-8",children:[a.jsx("div",{className:"mb-8",children:o?a.jsxs("div",{className:"flex flex-col md:flex-row gap-6 items-center md:items-start",children:[a.jsx(Pe,{className:"w-24 h-24 rounded-full"}),a.jsxs("div",{className:"flex-1 text-center md:text-left",children:[a.jsx(Pe,{className:"h-8 w-48 mb-2 mx-auto md:mx-0"}),a.jsx(Pe,{className:"h-4 w-32 mb-4 mx-auto md:mx-0"}),a.jsx(Pe,{className:"h-16 w-full"})]})]}):r?a.jsxs("div",{className:"flex flex-col md:flex-row gap-6 items-center md:items-start",children:[a.jsxs(di,{className:"w-24 h-24 border-2 border-sage/20",children:[a.jsx(dc,{src:r.avatar||void 0,alt:r.displayName||r.username}),a.jsx(fi,{className:"text-2xl bg-navy/10 dark:bg-navy/20 text-navy dark:text-cream",children:(r.displayName||r.username).slice(0,2).toUpperCase()})]}),a.jsxs("div",{className:"flex-1 text-center md:text-left",children:[a.jsx("h1",{className:"text-2xl md:text-3xl font-bold font-serif text-navy dark:text-cream mb-1",children:r.displayName||r.username}),a.jsxs("p",{className:"text-navy/70 dark:text-cream/70 mb-4",children:["@",r.username]}),a.jsx("p",{className:"text-navy/80 dark:text-cream/80 max-w-2xl mb-6",children:r.bio||"No bio provided. Tell us about yourself and your literary interests."}),a.jsxs("div",{className:"flex flex-wrap gap-3 justify-center md:justify-start",children:[a.jsxs(X,{variant:"outline",size:"sm",className:"gap-2",children:[a.jsx(sj,{className:"h-4 w-4"}),"Edit Profile"]}),a.jsx(Ce,{href:"/submit",children:a.jsxs(X,{size:"sm",className:"gap-2 bg-russet hover:bg-russet/90 text-white",children:[a.jsx(cs,{className:"h-4 w-4"}),"Submit New Translation"]})})]})]})]}):a.jsxs("div",{className:"text-center py-8",children:[a.jsx("h1",{className:"text-2xl font-bold mb-4",children:"User not found"}),a.jsx("p",{className:"mb-4",children:"Please sign in to view your profile"}),a.jsx(X,{children:"Sign In"})]})}),a.jsxs(Ns,{defaultValue:"bookmarks",value:e,onValueChange:t,children:[a.jsxs(_a,{className:"mb-6",children:[a.jsxs(gt,{value:"bookmarks",className:"gap-2",children:[a.jsx(Rr,{className:"h-4 w-4"}),a.jsx("span",{children:"Bookmarks"})]}),a.jsxs(gt,{value:"contributions",className:"gap-2",children:[a.jsx(cs,{className:"h-4 w-4"}),a.jsx("span",{children:"Contributions"})]}),a.jsxs(gt,{value:"reading",className:"gap-2",children:[a.jsx(Wu,{className:"h-4 w-4"}),a.jsx("span",{children:"Reading History"})]}),a.jsxs(gt,{value:"likes",className:"gap-2",children:[a.jsx(Qs,{className:"h-4 w-4"}),a.jsx("span",{children:"Likes"})]})]}),a.jsxs(dn,{value:"bookmarks",children:[a.jsx("h2",{className:"text-xl font-serif font-semibold text-navy dark:text-cream mb-4",children:"Your Bookmarked Works"}),u?a.jsx("div",{className:"space-y-4",children:Array.from({length:3}).map((v,y)=>a.jsx(Pe,{className:"h-40"},y))}):l&&Array.isArray(l)&&l.length>0?a.jsx("div",{className:"space-y-3",children:l.map(v=>a.jsx(Ar,{work:v.work},v.id))}):a.jsx(Oe,{className:"bg-cream dark:bg-dark-surface",children:a.jsxs(Ve,{className:"text-center py-12",children:[a.jsx(Rr,{className:"h-12 w-12 mx-auto mb-4 text-navy/40 dark:text-cream/40"}),a.jsx("h3",{className:"text-lg font-medium mb-2",children:"No bookmarks yet"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70 mb-6",children:"Save your favorite works for easy access later"}),a.jsx(Ce,{href:"/explore",children:a.jsx(X,{children:"Explore Works"})})]})})]}),a.jsxs(dn,{value:"contributions",children:[a.jsx("h2",{className:"text-xl font-serif font-semibold text-navy dark:text-cream mb-4",children:"Your Contributions"}),f?a.jsx("div",{className:"space-y-4",children:Array.from({length:2}).map((v,y)=>a.jsx(Pe,{className:"h-40"},y))}):d&&Array.isArray(d)&&d.length>0?a.jsx("div",{className:"space-y-3",children:a.jsx("p",{children:"Contributions would appear here"})}):a.jsx(Oe,{className:"bg-cream dark:bg-dark-surface",children:a.jsxs(Ve,{className:"text-center py-12",children:[a.jsx(cs,{className:"h-12 w-12 mx-auto mb-4 text-navy/40 dark:text-cream/40"}),a.jsx("h3",{className:"text-lg font-medium mb-2",children:"No contributions yet"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70 mb-6",children:"Share your translations with the Tercul community"}),a.jsx(Ce,{href:"/submit",children:a.jsx(X,{className:"bg-russet hover:bg-russet/90 text-white",children:"Submit Translation"})})]})})]}),a.jsxs(dn,{value:"reading",children:[a.jsx("h2",{className:"text-xl font-serif font-semibold text-navy dark:text-cream mb-4",children:"Reading History"}),p?a.jsx("div",{className:"space-y-4",children:Array.from({length:3}).map((v,y)=>a.jsx(Pe,{className:"h-20"},y))}):m&&Array.isArray(m)&&m.length>0?a.jsx("div",{className:"space-y-3",children:a.jsx("p",{children:"Reading progress would appear here"})}):a.jsx(Oe,{className:"bg-cream dark:bg-dark-surface",children:a.jsxs(Ve,{className:"text-center py-12",children:[a.jsx(Wu,{className:"h-12 w-12 mx-auto mb-4 text-navy/40 dark:text-cream/40"}),a.jsx("h3",{className:"text-lg font-medium mb-2",children:"No reading history"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70 mb-6",children:"Your reading progress will be saved here"}),a.jsx(Ce,{href:"/explore",children:a.jsx(X,{children:"Start Reading"})})]})})]}),a.jsxs(dn,{value:"likes",children:[a.jsx("h2",{className:"text-xl font-serif font-semibold text-navy dark:text-cream mb-4",children:"Your Liked Works"}),a.jsx(Oe,{className:"bg-cream dark:bg-dark-surface",children:a.jsxs(Ve,{className:"text-center py-12",children:[a.jsx(Qs,{className:"h-12 w-12 mx-auto mb-4 text-navy/40 dark:text-cream/40"}),a.jsx("h3",{className:"text-lg font-medium mb-2",children:"No liked works yet"}),a.jsx("p",{className:"text-navy/70 dark:text-cream/70 mb-6",children:"Show your appreciation for authors and translators"}),a.jsx(Ce,{href:"/explore",children:a.jsx(X,{children:"Explore Works"})})]})})]})]})]})})}function xV(){const{slug:e}=Ql(),[,t]=ys(),[r,o]=x.useState(1),[l,u]=x.useState(void 0),[d,f]=x.useState(void 0),[m,p]=x.useState(!1),[v,y]=x.useState(!1),[b,S]=x.useState(!1),[N,w]=x.useState(16),[C,k]=x.useState("text"),[E,R]=x.useState("traditional"),[T,z]=x.useState(null),[ne,$]=x.useState("none"),[V,J]=x.useState(null),[se,ie]=x.useState(!1),te=x.useRef(null),{data:q,isLoading:de,error:me}=tt({queryKey:[`/api/works/${e}`]}),{data:O}=tt({queryKey:[`/api/works/${e}/translations`],enabled:!!q});x.useEffect(()=>{if(q){const pe=Q(),Re=_(pe),Ye=Math.ceil(Re.length/20),Ae=Math.min(Math.max(1,r),Math.max(1,Ye));Ae!==r&&o(Ae)}},[q,r,_,Q]),x.useEffect(()=>{q&&C==="analysis"&&!V&&(ie(!0),setTimeout(()=>{F(Q()),ie(!1)},1e3))},[q,C,V,F,Q]);function L(){return!q||!d?"":O?.find(Re=>Re.id===String(d))?.content||""}function F(pe){const Re=pe.split(`
|
||
`),Ye={},Ae={},yt={},Pt={};Re.forEach((xe,ve)=>{if(xe.trim().length===0)return;const Se=ve+1,Me=xe.split(" ").filter(at=>at.trim().length>0);Ye[Se]=Me.map(at=>{const ar=["NOUN","VERB","ADJ","ADV","PRON","DET","ADP","CONJ","PRT"],zn=["#8884d8","#83a6ed","#8dd1e1","#82ca9d","#a4de6c","#d0ed57","#ffc658","#ff8042","#ff6361"],br=["Noun","Verb","Adjective","Adverb","Pronoun","Determiner","Adposition","Conjunction","Particle"],Sn=Math.floor(Math.random()*ar.length);return{term:at.replace(/[.,;!?]/g,""),tag:ar[Sn],color:zn[Sn],explanation:br[Sn]}}),Math.random()>.7&&(Ae[Se]=[Me[Math.floor(Math.random()*Me.length)]]);const qe=Math.random()*2-1;yt[Se]={score:qe,label:qe>.3?"positive":qe<-.3?"negative":"neutral",intensity:Math.abs(qe)>.7?"strong":Math.abs(qe)>.4?"moderate":"mild"},Pt[Se]=Array(Me.length).fill("").map(()=>Math.random()>.5?"/":"\\")});const Nt={},Ss=new Set;Re.forEach(xe=>{xe.split(" ").forEach(ve=>{const Se=ve.replace(/[.,;!?]/g,"").toLowerCase();Se.length>0&&Ss.add(Se)})}),Array.from(Ss).forEach(xe=>{const ve=Math.ceil(xe.length/3),Se=[];for(let Me=0;Me<xe.length;Me+=3)Se.push(xe.substring(Me,Math.min(Me+3,xe.length)));Nt[xe]={count:ve,breakdown:Se}});const zr=["A","B","C","D","E"],P=[];Re.forEach((xe,ve)=>{if(xe.trim().length===0||Math.random()>.3)return;const Se=xe.split(" ");if(Se.length===0)return;const Me=Se[Se.length-1].replace(/[.,;!?]/g,"");Me.length!==0&&P.push({word:Me,lineNumber:ve+1,rhymeGroup:zr[Math.floor(Math.random()*zr.length)],lineText:xe})});const Z=["love","nature","time","death","art"],re={},Ne=Re.join(" ").split(" ").map(xe=>xe.replace(/[.,;!?]/g,"").toLowerCase()).filter(xe=>xe.length>0);Z.forEach(xe=>{re[xe]=Ne.filter(()=>Math.random()>.95).slice(0,10)}),J({partOfSpeech:Ye,entityRecognition:Ae,syllableCount:Nt,sentiment:yt,rhymes:P,meter:Pt,themeLexicon:re,readabilityScore:Math.floor(Math.random()*40)+60})}function Q(){return q?l&&O?.find(Re=>Re.id===String(l))?.content||q.content:""}function _(pe){return pe.split(`
|
||
`).filter(Re=>Re.length>0)}function B(pe,Re=20){const Ye=_(pe),Ae=Math.ceil(Ye.length/Re),yt=Math.min(Math.max(1,r),Math.max(1,Ae)),Pt=(yt-1)*Re,Nt=Pt+Re;return{lines:Ye.slice(Pt,Nt),page:yt,totalPages:Ae,startLineNumber:Pt+1}}function ge(){p(!m),Vm({description:m?"Removed from your bookmarks":"Added to your bookmarks",duration:3e3})}function fe(){y(!v),Vm({description:v?"Removed from your favorites":"Added to your favorites",duration:3e3})}async function ye(){try{navigator.share?await navigator.share({title:q?.title||"Literary Work",text:`Reading ${q?.title||"a work"} on Tercul`,url:window.location.href}):(navigator.clipboard.writeText(window.location.href),Vm({description:"Link copied to clipboard",duration:3e3}))}catch(pe){console.error("Error sharing:",pe)}}function _e(){if(!q)return;const{totalPages:pe}=B(Q());r<pe&&(o(r+1),te.current&&te.current.scrollIntoView({behavior:"smooth"}))}function G(){r>1&&(o(r-1),te.current&&te.current.scrollIntoView({behavior:"smooth"}))}if(de)return a.jsx(Kt,{children:a.jsxs("div",{className:"max-w-full mx-auto px-4 py-8",children:[a.jsxs("div",{className:"flex items-center space-x-4 mb-6",children:[a.jsx(Pe,{className:"h-12 w-12 rounded-full"}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Pe,{className:"h-5 w-48"}),a.jsx(Pe,{className:"h-4 w-32"})]})]}),a.jsxs("div",{className:"flex flex-col lg:flex-row gap-8",children:[a.jsx("div",{className:"lg:w-64 flex-shrink-0",children:a.jsx(Pe,{className:"h-64 w-full rounded-lg"})}),a.jsxs("div",{className:"flex-1",children:[a.jsx(Pe,{className:"h-8 w-3/4 mb-4"}),a.jsx("div",{className:"space-y-3",children:Array.from({length:15}).map((pe,Re)=>a.jsx(Pe,{className:"h-6 w-full"},Re))})]})]})]})});if(me||!q)return a.jsx(Kt,{children:a.jsxs("div",{className:"max-w-[var(--content-width)] mx-auto px-4 py-16 text-center",children:[a.jsx("h1",{className:"text-2xl font-bold mb-4 text-primary",children:"Work not found"}),a.jsx("p",{className:"mb-6 text-muted-foreground",children:"The literary work you're looking for could not be found."}),a.jsxs("div",{className:"flex flex-col items-center gap-4",children:[a.jsx(Rr,{className:"h-16 w-16 text-primary/30"}),a.jsx(X,{onClick:()=>t("/explore"),className:"bg-primary hover:bg-primary/90 text-primary-foreground",children:"Explore Works"})]})]})});const M=B(Q()),he=O?.find(pe=>pe.id===String(l)),Be=Q().split(/\s+/).length,He=Math.ceil(Be/200);return a.jsx(Kt,{children:a.jsxs("div",{className:"max-w-[var(--content-width)] mx-auto pt-4 px-4",children:[a.jsxs("div",{className:"mb-8",children:[a.jsx("h1",{className:"text-3xl font-serif font-bold text-primary mb-2",children:q.title}),a.jsxs("div",{className:"flex items-center gap-4 flex-wrap mb-4",children:[a.jsx(Pg,{author:q.author,withLifeDates:!0}),q.year&&a.jsxs("span",{className:"text-muted-foreground",children:["Published: ",q.year]}),a.jsxs("span",{className:"text-muted-foreground",children:["Reading time: ~",He," min"]})]}),a.jsx("div",{className:"flex flex-wrap gap-2 mb-4",children:q.tags?.map(pe=>a.jsx(ht,{variant:"outline",className:"bg-primary/5 hover:bg-primary/10 text-primary/80",children:pe.name},pe.id))}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs(X,{variant:"outline",size:"sm",className:`flex items-center gap-1 ${v?"text-accent border-accent":""}`,onClick:fe,children:[a.jsx(Qs,{className:`h-4 w-4 ${v?"fill-accent":""}`}),v?"Unlike":"Like"]}),a.jsxs(X,{variant:"outline",size:"sm",className:`flex items-center gap-1 ${m?"text-accent border-accent":""}`,onClick:ge,children:[a.jsx(Q1,{className:`h-4 w-4 ${m?"fill-accent":""}`}),"Bookmark"]}),a.jsxs(X,{variant:"outline",size:"sm",className:"flex items-center gap-1",onClick:ye,children:[a.jsx(cx,{className:"h-4 w-4"}),"Share"]})]})]}),O&&O.length>0&&a.jsxs("div",{className:"mb-6",children:[a.jsx("h3",{className:"text-md font-medium mb-2",children:"Translations"}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsxs(X,{variant:l?"outline":"default",size:"sm",onClick:()=>u(void 0),children:[a.jsx(Bu,{className:"mr-2 h-4 w-4"}),"Original (",q.language,")"]}),O.map(pe=>a.jsxs(X,{variant:l===Number(pe.id)?"default":"outline",size:"sm",onClick:()=>u(Number(pe.id)),children:[a.jsx(Bu,{className:"mr-2 h-4 w-4"}),pe.language]},pe.id))]})]}),a.jsxs("div",{className:"reading-content mb-8 prose dark:prose-invert max-w-none",ref:te,children:[a.jsx("div",{className:"mb-6 flex flex-wrap justify-between items-center gap-4",children:a.jsxs("div",{className:"space-y-2",children:[a.jsx("h3",{className:"text-sm font-medium",children:"Reading Settings"}),a.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm",children:"Font Size:"}),a.jsx("div",{className:"w-32",children:a.jsx(ng,{value:[N],min:12,max:24,step:1,onValueChange:pe=>w(pe[0])})}),a.jsxs("span",{className:"text-sm",children:[N,"px"]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm",children:"Dark Mode:"}),a.jsx(gf,{checked:b,onCheckedChange:S}),b?a.jsx(rj,{className:"h-4 w-4 text-muted-foreground"}):a.jsx(ed,{className:"h-4 w-4 text-muted-foreground"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm",children:"View Mode:"}),a.jsxs("div",{className:"flex border rounded-md",children:[a.jsx(X,{variant:E==="traditional"?"default":"ghost",size:"sm",onClick:()=>R("traditional"),className:"rounded-r-none",children:"Traditional"}),a.jsx(X,{variant:E==="enhanced"?"default":"ghost",size:"sm",onClick:()=>R("enhanced"),className:"rounded-none border-x",children:"Enhanced"}),a.jsx(X,{variant:E==="parallel"?"default":"ghost",size:"sm",onClick:()=>R("parallel"),className:"rounded-l-none",children:"Parallel"})]})]})]})]})}),a.jsxs(Ns,{value:C,onValueChange:k,children:[a.jsxs(_a,{className:"mb-6",children:[a.jsx(gt,{value:"text",children:"Text"}),a.jsx(gt,{value:"annotations",children:"Annotations"}),a.jsx(gt,{value:"analysis",children:"Analysis"}),O&&O.length>0&&a.jsx(gt,{value:"compare",children:"Compare"})]}),a.jsx(dn,{value:"text",children:a.jsxs(Oe,{className:"p-6",children:[E==="traditional"&&a.jsx("div",{style:{fontSize:`${N}px`},children:M.lines.map((pe,Re)=>a.jsx("div",{className:"mb-3",children:pe},Re))}),E==="enhanced"&&a.jsx("div",{style:{fontSize:`${N}px`},children:M.lines.map((pe,Re)=>{const Ye=M.startLineNumber+Re;return a.jsxs("div",{className:"flex group hover:bg-muted/20 rounded transition-colors mb-2 py-1",onClick:()=>z(Ye),children:[a.jsx("div",{className:"text-muted-foreground w-10 flex-shrink-0 text-right pr-3 select-none",children:Ye}),a.jsxs("div",{className:"flex-1 relative",children:[pe,a.jsxs("div",{className:"absolute right-0 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 transition-opacity bg-card/80 backdrop-blur-sm rounded flex items-center",children:[a.jsx(Gr,{children:a.jsxs(ja,{children:[a.jsx(Na,{asChild:!0,children:a.jsx(X,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(J1,{className:"h-4 w-4"})})}),a.jsx(Kr,{children:a.jsx("p",{children:"Copy line"})})]})}),a.jsx(Gr,{children:a.jsxs(ja,{children:[a.jsx(Na,{asChild:!0,children:a.jsx(X,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(nj,{className:"h-4 w-4"})})}),a.jsx(Kr,{children:a.jsx("p",{children:"Copy link to line"})})]})}),a.jsx(Gr,{children:a.jsxs(ja,{children:[a.jsx(Na,{asChild:!0,children:a.jsx(X,{variant:"ghost",size:"icon",className:"h-8 w-8",children:a.jsx(Ju,{className:"h-4 w-4"})})}),a.jsx(Kr,{children:a.jsx("p",{children:"Add annotation"})})]})})]})]})]},Re)})}),E==="parallel"&&d===void 0&&a.jsxs("div",{className:"text-center py-6",children:[a.jsx("h3",{className:"text-lg font-medium mb-4",children:"Parallel View"}),a.jsx("p",{className:"text-muted-foreground mb-6",children:"Select a second translation to enable parallel view"}),O&&O.length>0?a.jsx("div",{className:"flex flex-wrap justify-center gap-2 max-w-md mx-auto",children:O.filter(pe=>pe.id!==String(l)).map(pe=>a.jsxs(X,{variant:"outline",size:"sm",onClick:()=>f(Number(pe.id)),children:[a.jsx(Bu,{className:"mr-2 h-4 w-4"}),pe.language]},pe.id))}):a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:"text-muted-foreground mb-4",children:"No translations available for this work."}),a.jsx("p",{className:"text-sm text-muted-foreground",children:"Try another work or check back later as we add more translations."})]})]}),E==="parallel"&&d!==void 0&&a.jsxs("div",{style:{fontSize:`${N}px`},children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsx("div",{className:"flex-1",children:a.jsx("h3",{className:"text-lg font-medium",children:l?`${he?.language} Translation`:`Original (${q.language})`})}),a.jsx("div",{className:"w-8"}),a.jsx("div",{className:"flex-1",children:a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("h3",{className:"text-lg font-medium",children:O?.find(pe=>pe.id===String(d))?.language||"Translation"}),a.jsx(X,{variant:"ghost",size:"sm",onClick:()=>f(void 0),children:"Clear"})]})})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[a.jsx("div",{children:M.lines.map((pe,Re)=>a.jsx("div",{className:"mb-3 py-1 px-2 hover:bg-muted/20 rounded transition-colors",children:pe},Re))}),a.jsx("div",{children:B(L()).lines.map((pe,Re)=>a.jsx("div",{className:"mb-3 py-1 px-2 hover:bg-muted/20 rounded transition-colors",children:pe},Re))})]})]})]})}),a.jsx(dn,{value:"annotations",children:a.jsx(Oe,{className:"p-6",children:T?a.jsxs("div",{children:[a.jsxs("div",{className:"bg-muted/30 p-3 rounded mb-4",children:[a.jsxs("h3",{className:"text-sm font-medium mb-2",children:["Line ",T]}),a.jsx("p",{className:"italic",children:Q().split(`
|
||
`)[T-1]||""})]}),a.jsx("h3",{className:"text-lg font-medium mb-4",children:"Annotations"}),a.jsx("p",{className:"text-center text-muted-foreground py-4",children:"No annotations for this line yet."}),a.jsxs("div",{className:"mt-6",children:[a.jsx("h4",{className:"text-sm font-medium mb-2",children:"Add your annotation"}),a.jsx("textarea",{className:"w-full min-h-[100px] p-3 border rounded-md",placeholder:"Share your thoughts or insights about this line..."}),a.jsx("div",{className:"flex justify-end mt-2",children:a.jsx(X,{children:"Add Annotation"})})]})]}):a.jsxs("div",{className:"text-center py-8",children:[a.jsx(Ju,{className:"mx-auto h-12 w-12 text-muted-foreground/50 mb-4"}),a.jsx("h3",{className:"text-lg font-medium mb-2",children:"Line Annotations"}),a.jsx("p",{className:"text-muted-foreground",children:"Select a line from the text to view or add annotations."})]})})}),a.jsx(dn,{value:"analysis",children:se?a.jsx(Oe,{className:"p-6",children:a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"inline-block h-12 w-12 border-4 border-primary/30 border-t-primary rounded-full animate-spin mb-4"}),a.jsx("p",{className:"text-muted-foreground",children:"Analyzing text patterns..."})]})}):V?a.jsxs("div",{className:"space-y-6",children:[a.jsxs(Oe,{children:[a.jsxs(zt,{children:[a.jsx(Gt,{className:"text-lg",children:"Analysis Tools"}),a.jsx(Xr,{children:"Select different views to explore the linguistic patterns"})]}),a.jsx(Ve,{children:a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:[a.jsxs(X,{variant:ne==="partOfSpeech"?"default":"outline",size:"sm",onClick:()=>$(ne==="partOfSpeech"?"none":"partOfSpeech"),children:[a.jsx(ox,{className:"mr-2 h-4 w-4"}),"Parts of Speech"]}),a.jsxs(X,{variant:ne==="sentiment"?"default":"outline",size:"sm",onClick:()=>$(ne==="sentiment"?"none":"sentiment"),children:[a.jsx(IT,{className:"mr-2 h-4 w-4"}),"Sentiment"]}),a.jsxs(X,{variant:ne==="meter"?"default":"outline",size:"sm",onClick:()=>$(ne==="meter"?"none":"meter"),children:[a.jsx(b_,{className:"mr-2 h-4 w-4"}),"Meter"]}),a.jsxs(X,{variant:ne==="themes"?"default":"outline",size:"sm",onClick:()=>$(ne==="themes"?"none":"themes"),children:[a.jsx(f_,{className:"mr-2 h-4 w-4"}),"Themes"]})]})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs(Oe,{children:[a.jsx(zt,{className:"pb-2",children:a.jsx(Gt,{className:"text-lg",children:"Readability"})}),a.jsx(Ve,{children:a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{children:"Score"}),a.jsxs("span",{className:"font-medium",children:[V.readabilityScore,"/100"]})]}),a.jsx("div",{className:"h-2 bg-muted rounded-full mt-1",children:a.jsx("div",{className:"h-full bg-primary rounded-full",style:{width:`${V.readabilityScore}%`}})})]}),a.jsx("p",{className:"text-sm text-muted-foreground",children:V.readabilityScore>80?"Very accessible text with simple language and structure":V.readabilityScore>60?"Moderately complex text suitable for general readers":"Complex text with sophisticated vocabulary and structure"})]})})]}),a.jsxs(Oe,{children:[a.jsx(zt,{className:"pb-2",children:a.jsx(Gt,{className:"text-lg",children:"Structure"})}),a.jsx(Ve,{children:a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Lines"}),a.jsx("p",{className:"text-2xl font-medium",children:_(Q()).length})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Words"}),a.jsx("p",{className:"text-2xl font-medium",children:Be})]})]})})]}),a.jsxs(Oe,{children:[a.jsx(zt,{className:"pb-2",children:a.jsx(Gt,{className:"text-lg",children:"Themes"})}),a.jsx(Ve,{children:a.jsx("div",{className:"flex flex-wrap gap-1",children:Object.keys(V.themeLexicon).map(pe=>a.jsx(ht,{variant:"outline",className:"capitalize",children:pe},pe))})})]})]}),a.jsx(Oe,{className:"p-6",children:a.jsx("div",{style:{fontSize:`${N}px`},children:M.lines.map((pe,Re)=>{const Ye=M.startLineNumber+Re;let Ae=null;if(ne==="partOfSpeech"&&V.partOfSpeech[Ye])Ae=a.jsx("div",{className:"text-xs text-muted-foreground mt-1 flex gap-1 flex-wrap",children:V.partOfSpeech[Ye].map((yt,Pt)=>a.jsxs(ht,{variant:"outline",className:"border-[0.5px]",style:{borderColor:yt.color},children:[yt.term,": ",yt.tag]},Pt))});else if(ne==="sentiment"&&V.sentiment[Ye]){const yt=V.sentiment[Ye],Pt=yt.label==="positive"?"border-green-500":yt.label==="negative"?"border-red-500":"border-gray-400";Ae=a.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:a.jsxs(ht,{variant:"outline",className:Pt,children:[yt.label.charAt(0).toUpperCase()+yt.label.slice(1),"(",yt.intensity,")"]})})}else ne==="meter"&&V.meter[Ye]&&(Ae=a.jsx("div",{className:"text-xs font-mono mt-1",children:V.meter[Ye].join(" ")}));return a.jsx("div",{className:"mb-4 p-2 rounded hover:bg-muted/30 transition-colors",children:a.jsxs("div",{className:"flex",children:[a.jsx("div",{className:"w-10 text-right pr-3 text-muted-foreground select-none",children:Ye}),a.jsxs("div",{className:"flex-1",children:[a.jsx("div",{children:pe}),Ae]})]})},Re)})})})]}):a.jsx(Oe,{className:"p-6",children:a.jsxs("div",{className:"text-center py-8",children:[a.jsx("p",{children:"Click to analyze the text"}),a.jsx(X,{className:"mt-4",onClick:()=>F(Q()),children:"Analyze Text"})]})})}),O&&O.length>0&&a.jsx(dn,{value:"compare",children:a.jsxs(Oe,{className:"p-6",children:[a.jsx("h3",{className:"text-lg font-medium mb-4",children:"Compare Translations"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[a.jsxs(Oe,{children:[a.jsxs(zt,{className:"pb-2",children:[a.jsx(Gt,{children:"Original"}),a.jsxs(Xr,{children:[q.language," • ",q.year||"Unknown year"]})]}),a.jsx(Ve,{className:"h-48 overflow-y-auto",children:a.jsxs("div",{className:"space-y-1 text-sm",children:[_(q.content).slice(0,10).map((pe,Re)=>a.jsx("div",{className:"text-muted-foreground hover:text-foreground transition-colors",children:pe},Re)),_(q.content).length>10&&a.jsxs("div",{className:"italic text-muted-foreground",children:["... ",_(q.content).length-10," ","more lines"]})]})}),a.jsx(Ea,{children:a.jsx(X,{variant:"outline",size:"sm",className:"w-full",onClick:()=>{u(void 0),k("text")},children:"Read Original"})})]}),O.map(pe=>a.jsxs(Oe,{children:[a.jsxs(zt,{className:"pb-2",children:[a.jsxs(Gt,{children:[pe.language," Translation"]}),a.jsxs(Xr,{children:[pe.translator?.displayName||`Translator #${pe.translatorId}`,pe.year&&` • ${pe.year}`]})]}),a.jsx(Ve,{className:"h-48 overflow-y-auto",children:a.jsxs("div",{className:"space-y-1 text-sm",children:[_(pe.content).slice(0,10).map((Re,Ye)=>a.jsx("div",{className:"text-muted-foreground hover:text-foreground transition-colors",children:Re},Ye)),_(pe.content).length>10&&a.jsxs("div",{className:"italic text-muted-foreground",children:["..."," ",_(pe.content).length-10," ","more lines"]})]})}),a.jsxs(Ea,{className:"flex flex-col gap-2",children:[a.jsx(X,{variant:"outline",size:"sm",className:"w-full",onClick:()=>{u(Number(pe.id)),k("text")},children:"Read Translation"}),a.jsx(X,{variant:"ghost",size:"sm",className:"w-full",onClick:()=>{E!=="parallel"&&R("parallel"),u(void 0),f(Number(pe.id)),k("text")},children:"Compare with Original"})]})]},pe.id))]})]})})]})]}),M.totalPages>1&&a.jsxs("div",{className:"flex items-center justify-between mt-8 border-t pt-4 mb-10",children:[a.jsxs(X,{variant:"outline",onClick:G,disabled:r===1,children:[a.jsx(MT,{className:"mr-2 h-4 w-4"}),"Previous"]}),a.jsxs("div",{className:"text-sm text-muted-foreground",children:["Page ",r," of ",M.totalPages]}),a.jsxs(X,{variant:"outline",onClick:_e,disabled:r===M.totalPages,children:["Next",a.jsx(xp,{className:"ml-2 h-4 w-4"})]})]})]})})}function gV(){const[e,t]=x.useState(()=>{const u=localStorage.getItem("reading-settings");return u?JSON.parse(u):{fontSize:"text-size-md",zenMode:!1,darkMode:!1}});return x.useEffect(()=>{localStorage.setItem("reading-settings",JSON.stringify(e))},[e]),{settings:e,increaseFontSize:()=>{t(u=>{const d=["text-size-sm","text-size-md","text-size-lg","text-size-xl"],f=d.indexOf(u.fontSize),m=Math.min(f+1,d.length-1);return{...u,fontSize:d[m]}})},decreaseFontSize:()=>{t(u=>{const d=["text-size-sm","text-size-md","text-size-lg","text-size-xl"],f=d.indexOf(u.fontSize),m=Math.max(f-1,0);return{...u,fontSize:d[m]}})},toggleZenMode:()=>{t(u=>({...u,zenMode:!u.zenMode}))}}}function vV(){const{slug:e,translationId:t}=Ql(),{settings:r,toggleZenMode:o}=gV(),[l,u]=x.useState(parseInt(t||"0",10)),[d,f]=x.useState(null),{data:m,isLoading:p}=tt({queryKey:[`/api/works/${e}`]}),{data:v,isLoading:y}=tt({queryKey:[`/api/works/${e}/translations`],enabled:!!m}),{data:b,isLoading:S}=tt({queryKey:[`/api/translations/${l}`],enabled:!!l}),N=w=>{f(w);const C=document.getElementById(`line-${w}-other`);C&&C.scrollIntoView({behavior:"smooth",block:"center"})};return p||y||S?a.jsx(Kt,{children:a.jsxs("div",{className:"max-w-[var(--content-width)] mx-auto px-4 py-8",children:[a.jsx(Pe,{className:"h-12 w-3/4 mb-8"}),a.jsxs("div",{className:"flex flex-col md:flex-row gap-8",children:[a.jsxs("div",{className:"flex-1",children:[a.jsx(Pe,{className:"h-8 w-1/2 mb-4"}),a.jsx("div",{className:"space-y-2",children:Array.from({length:8}).map((w,C)=>a.jsx(Pe,{className:"h-6"},C))})]}),a.jsxs("div",{className:"flex-1",children:[a.jsx(Pe,{className:"h-8 w-1/2 mb-4"}),a.jsx("div",{className:"space-y-2",children:Array.from({length:8}).map((w,C)=>a.jsx(Pe,{className:"h-6"},C))})]})]})]})}):!m||!v||!b?a.jsx(Kt,{children:a.jsxs("div",{className:"max-w-[var(--content-width)] mx-auto px-4 py-16 text-center",children:[a.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Content not found"}),a.jsx("p",{className:"mb-6",children:"The work or translation you're looking for could not be found."}),a.jsx(Ce,{href:"/explore",children:a.jsx(X,{children:"Explore Works"})})]})}):a.jsx(Kt,{zenMode:r.zenMode,children:a.jsxs("div",{className:`compare-view ${r.zenMode?"zen-mode":""}`,children:[a.jsx("div",{className:"sticky top-16 z-10 bg-cream dark:bg-dark-bg border-b border-sage/20 dark:border-sage/10 shadow-sm",children:a.jsx("div",{className:"max-w-[var(--content-width)] mx-auto px-4 md:px-6 py-3",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("h1",{className:"text-xl font-bold font-serif text-navy dark:text-cream",children:[m.title," ",a.jsx("span",{className:"text-navy/60 dark:text-cream/60 font-normal text-base",children:"— Translation Comparison"})]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(X,{variant:"ghost",size:"icon",className:"btn-feedback p-2 rounded-full text-navy/70 dark:text-cream/70 hover:bg-navy/10 dark:hover:bg-cream/10",onClick:o,children:[r.zenMode?a.jsx(c_,{className:"h-5 w-5"}):a.jsx(i_,{className:"h-5 w-5"}),a.jsx("span",{className:"sr-only",children:r.zenMode?"Exit zen mode":"Zen mode"})]}),a.jsx(Ce,{href:`/works/${e}`,children:a.jsx(X,{variant:"outline",className:"py-1.5 px-3 rounded-full bg-navy/10 hover:bg-navy/20 dark:bg-navy/20 dark:hover:bg-navy/30 text-navy dark:text-cream/90 font-sans text-sm transition-colors",children:"Exit Compare"})})]})]})})}),a.jsxs("div",{className:"flex flex-col md:flex-row max-w-[var(--content-width)] mx-auto px-4 md:px-6 py-6",children:[a.jsxs("div",{className:"flex-1 md:pr-6 md:border-r border-sage/20 dark:border-sage/10",children:[a.jsx("div",{className:"mb-4",children:a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{children:[a.jsxs("h2",{className:"text-lg font-medium font-serif text-navy dark:text-cream",children:[m.language," (Original)"]}),a.jsxs("p",{className:"text-sm text-navy/70 dark:text-cream/70",children:[m.author?.name||"Unknown author",","," ",m.year||"Unknown year"]})]})})}),a.jsx(Xp,{content:m.content,fontSizeClass:r.fontSize,onLineClick:N,highlightedLine:d||void 0})]}),a.jsxs("div",{className:"flex-1 md:pl-6 mt-8 md:mt-0",children:[a.jsx("div",{className:"mb-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-medium font-serif text-navy dark:text-cream",children:b.language}),a.jsxs("p",{className:"text-sm text-navy/70 dark:text-cream/70",children:["Translated by Translator ",b.translatorId,","," ",b.year||"Unknown year"]})]}),a.jsx("div",{children:a.jsxs(Bn,{value:l.toString(),onValueChange:w=>u(parseInt(w,10)),children:[a.jsx(Mn,{className:"w-[200px]",children:a.jsx(Vn,{placeholder:"Select translation"})}),a.jsx(Dn,{children:v.map(w=>a.jsxs(Qe,{value:w.id.toString(),children:[w.language," - Translator"," ",w.translatorId," ",w.year?`(${w.year})`:""]},w.id))})]})})]})}),a.jsx(Xp,{content:b.content,fontSizeClass:r.fontSize,onLineClick:N,highlightedLine:d||void 0})]})]})]})})}function yV(){return a.jsxs(CT,{children:[a.jsx(cn,{path:"/",component:uV}),a.jsx(cn,{path:"/explore",component:cV}),a.jsx(cn,{path:"/search",component:fV}),a.jsx(cn,{path:"/authors",component:Xz}),a.jsx(cn,{path:"/authors/:slug",component:j5}),a.jsx(cn,{path:"/works/:slug",component:xV}),a.jsx(cn,{path:"/works/:slug/compare/:translationId",component:vV}),a.jsx(cn,{path:"/collections",component:ZI}),a.jsx(cn,{path:"/collections/create",component:KI}),a.jsx(cn,{path:"/profile",component:pV}),a.jsx(cn,{path:"/submit",component:mV}),a.jsx(cn,{path:"/blog",component:YI}),a.jsx(cn,{path:"/blog/create",component:S$}),a.jsx(cn,{path:"/blog/:slug",component:qI}),a.jsx(cn,{path:"/dashboard",component:DB}),a.jsx(cn,{path:"/dashboard/blog",component:MB}),a.jsx(cn,{path:"/dashboard/blog/edit/:id",component:pB}),a.jsx(cn,{component:dV})]})}function bV(){return a.jsx(GR,{client:ci,children:a.jsxs(Gr,{children:[a.jsx(N_,{}),a.jsx(yV,{})]})})}const wV={theme:"system",setTheme:()=>null},jV=x.createContext(wV);function NV({children:e,defaultTheme:t="system"}){const[r,o]=x.useState(()=>localStorage.getItem("theme")||t);x.useEffect(()=>{const u=window.document.documentElement;if(u.classList.remove("light","dark"),r==="system"){const d=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";u.classList.add(d);return}u.classList.add(r)},[r]);const l={theme:r,setTheme:u=>{localStorage.setItem("theme",u),o(u)}};return a.jsx(jV.Provider,{value:l,children:e})}ER.createRoot(document.getElementById("root")).render(a.jsx(NV,{defaultTheme:"system",children:a.jsx(M6,{children:a.jsx(bV,{})})}));
|