ldrouter 1.6.7 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,286 @@
1
+ var ry=a=>{throw TypeError(a)};var oy=(a,l,o)=>l.has(a)||ry("Cannot "+o);var qt=(a,l,o)=>(oy(a,l,"read from private field"),o?o.call(a):l.get(a)),sy=(a,l,o)=>l.has(a)?ry("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(a):l.set(a,o),of=(a,l,o,i)=>(oy(a,l,"write to private field"),i?i.call(a,o):l.set(a,o),o);function _w(a,l){for(var o=0;o<l.length;o++){const i=l[o];if(typeof i!="string"&&!Array.isArray(i)){for(const u in i)if(u!=="default"&&!(u in a)){const f=Object.getOwnPropertyDescriptor(i,u);f&&Object.defineProperty(a,u,f.get?f:{enumerable:!0,get:()=>i[u]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&i(h)}).observe(document,{childList:!0,subtree:!0});function o(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function i(u){if(u.ep)return;u.ep=!0;const f=o(u);fetch(u.href,f)}})();function ah(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var sf={exports:{}},ms={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var iy;function Ow(){if(iy)return ms;iy=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function o(i,u,f){var h=null;if(f!==void 0&&(h=""+f),u.key!==void 0&&(h=""+u.key),"key"in u){f={};for(var m in u)m!=="key"&&(f[m]=u[m])}else f=u;return u=f.ref,{$$typeof:a,type:i,key:h,ref:u!==void 0?u:null,props:f}}return ms.Fragment=l,ms.jsx=o,ms.jsxs=o,ms}var cy;function Dw(){return cy||(cy=1,sf.exports=Ow()),sf.exports}var s=Dw(),cf={exports:{}},Te={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var uy;function zw(){if(uy)return Te;uy=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),x=Symbol.iterator;function w(M){return M===null||typeof M!="object"?null:(M=x&&M[x]||M["@@iterator"],typeof M=="function"?M:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function N(M,B,F){this.props=M,this.context=B,this.refs=C,this.updater=F||R}N.prototype.isReactComponent={},N.prototype.setState=function(M,B){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,B,"setState")},N.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function T(){}T.prototype=N.prototype;function A(M,B,F){this.props=M,this.context=B,this.refs=C,this.updater=F||R}var _=A.prototype=new T;_.constructor=A,j(_,N.prototype),_.isPureReactComponent=!0;var H=Array.isArray;function P(){}var I={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function ne(M,B,F){var ae=F.ref;return{$$typeof:a,type:M,key:B,ref:ae!==void 0?ae:null,props:F}}function se(M,B){return ne(M.type,B,M.props)}function Q(M){return typeof M=="object"&&M!==null&&M.$$typeof===a}function G(M){var B={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(F){return B[F]})}var re=/\/+/g;function le(M,B){return typeof M=="object"&&M!==null&&M.key!=null?G(""+M.key):B.toString(36)}function fe(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(P,P):(M.status="pending",M.then(function(B){M.status==="pending"&&(M.status="fulfilled",M.value=B)},function(B){M.status==="pending"&&(M.status="rejected",M.reason=B)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function z(M,B,F,ae,ue){var J=typeof M;(J==="undefined"||J==="boolean")&&(M=null);var oe=!1;if(M===null)oe=!0;else switch(J){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(M.$$typeof){case a:case l:oe=!0;break;case S:return oe=M._init,z(oe(M._payload),B,F,ae,ue)}}if(oe)return ue=ue(M),oe=ae===""?"."+le(M,0):ae,H(ue)?(F="",oe!=null&&(F=oe.replace(re,"$&/")+"/"),z(ue,B,F,"",function(De){return De})):ue!=null&&(Q(ue)&&(ue=se(ue,F+(ue.key==null||M&&M.key===ue.key?"":(""+ue.key).replace(re,"$&/")+"/")+oe)),B.push(ue)),1;oe=0;var ie=ae===""?".":ae+":";if(H(M))for(var me=0;me<M.length;me++)ae=M[me],J=ie+le(ae,me),oe+=z(ae,B,F,J,ue);else if(me=w(M),typeof me=="function")for(M=me.call(M),me=0;!(ae=M.next()).done;)ae=ae.value,J=ie+le(ae,me++),oe+=z(ae,B,F,J,ue);else if(J==="object"){if(typeof M.then=="function")return z(fe(M),B,F,ae,ue);throw B=String(M),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return oe}function $(M,B,F){if(M==null)return M;var ae=[],ue=0;return z(M,ae,"","",function(J){return B.call(F,J,ue++)}),ae}function te(M){if(M._status===-1){var B=M._result;B=B(),B.then(function(F){(M._status===0||M._status===-1)&&(M._status=1,M._result=F)},function(F){(M._status===0||M._status===-1)&&(M._status=2,M._result=F)}),M._status===-1&&(M._status=0,M._result=B)}if(M._status===1)return M._result.default;throw M._result}var L=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},X={map:$,forEach:function(M,B,F){$(M,function(){B.apply(this,arguments)},F)},count:function(M){var B=0;return $(M,function(){B++}),B},toArray:function(M){return $(M,function(B){return B})||[]},only:function(M){if(!Q(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return Te.Activity=b,Te.Children=X,Te.Component=N,Te.Fragment=o,Te.Profiler=u,Te.PureComponent=A,Te.StrictMode=i,Te.Suspense=g,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=I,Te.__COMPILER_RUNTIME={__proto__:null,c:function(M){return I.H.useMemoCache(M)}},Te.cache=function(M){return function(){return M.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(M,B,F){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var ae=j({},M.props),ue=M.key;if(B!=null)for(J in B.key!==void 0&&(ue=""+B.key),B)!k.call(B,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&B.ref===void 0||(ae[J]=B[J]);var J=arguments.length-2;if(J===1)ae.children=F;else if(1<J){for(var oe=Array(J),ie=0;ie<J;ie++)oe[ie]=arguments[ie+2];ae.children=oe}return ne(M.type,ue,ae)},Te.createContext=function(M){return M={$$typeof:h,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:f,_context:M},M},Te.createElement=function(M,B,F){var ae,ue={},J=null;if(B!=null)for(ae in B.key!==void 0&&(J=""+B.key),B)k.call(B,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ue[ae]=B[ae]);var oe=arguments.length-2;if(oe===1)ue.children=F;else if(1<oe){for(var ie=Array(oe),me=0;me<oe;me++)ie[me]=arguments[me+2];ue.children=ie}if(M&&M.defaultProps)for(ae in oe=M.defaultProps,oe)ue[ae]===void 0&&(ue[ae]=oe[ae]);return ne(M,J,ue)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(M){return{$$typeof:m,render:M}},Te.isValidElement=Q,Te.lazy=function(M){return{$$typeof:S,_payload:{_status:-1,_result:M},_init:te}},Te.memo=function(M,B){return{$$typeof:v,type:M,compare:B===void 0?null:B}},Te.startTransition=function(M){var B=I.T,F={};I.T=F;try{var ae=M(),ue=I.S;ue!==null&&ue(F,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(P,L)}catch(J){L(J)}finally{B!==null&&F.types!==null&&(B.types=F.types),I.T=B}},Te.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},Te.use=function(M){return I.H.use(M)},Te.useActionState=function(M,B,F){return I.H.useActionState(M,B,F)},Te.useCallback=function(M,B){return I.H.useCallback(M,B)},Te.useContext=function(M){return I.H.useContext(M)},Te.useDebugValue=function(){},Te.useDeferredValue=function(M,B){return I.H.useDeferredValue(M,B)},Te.useEffect=function(M,B){return I.H.useEffect(M,B)},Te.useEffectEvent=function(M){return I.H.useEffectEvent(M)},Te.useId=function(){return I.H.useId()},Te.useImperativeHandle=function(M,B,F){return I.H.useImperativeHandle(M,B,F)},Te.useInsertionEffect=function(M,B){return I.H.useInsertionEffect(M,B)},Te.useLayoutEffect=function(M,B){return I.H.useLayoutEffect(M,B)},Te.useMemo=function(M,B){return I.H.useMemo(M,B)},Te.useOptimistic=function(M,B){return I.H.useOptimistic(M,B)},Te.useReducer=function(M,B,F){return I.H.useReducer(M,B,F)},Te.useRef=function(M){return I.H.useRef(M)},Te.useState=function(M){return I.H.useState(M)},Te.useSyncExternalStore=function(M,B,F){return I.H.useSyncExternalStore(M,B,F)},Te.useTransition=function(){return I.H.useTransition()},Te.version="19.2.8",Te}var dy;function lh(){return dy||(dy=1,cf.exports=zw()),cf.exports}var p=lh();const ce=ah(p),ho=_w({__proto__:null,default:ce},[p]);var uf={exports:{}},ps={},df={exports:{}},ff={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var fy;function kw(){return fy||(fy=1,(function(a){function l(z,$){var te=z.length;z.push($);e:for(;0<te;){var L=te-1>>>1,X=z[L];if(0<u(X,$))z[L]=$,z[te]=X,te=L;else break e}}function o(z){return z.length===0?null:z[0]}function i(z){if(z.length===0)return null;var $=z[0],te=z.pop();if(te!==$){z[0]=te;e:for(var L=0,X=z.length,M=X>>>1;L<M;){var B=2*(L+1)-1,F=z[B],ae=B+1,ue=z[ae];if(0>u(F,te))ae<X&&0>u(ue,F)?(z[L]=ue,z[ae]=te,L=ae):(z[L]=F,z[B]=te,L=B);else if(ae<X&&0>u(ue,te))z[L]=ue,z[ae]=te,L=ae;else break e}}return $}function u(z,$){var te=z.sortIndex-$.sortIndex;return te!==0?te:z.id-$.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;a.unstable_now=function(){return f.now()}}else{var h=Date,m=h.now();a.unstable_now=function(){return h.now()-m}}var g=[],v=[],S=1,b=null,x=3,w=!1,R=!1,j=!1,C=!1,N=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function _(z){for(var $=o(v);$!==null;){if($.callback===null)i(v);else if($.startTime<=z)i(v),$.sortIndex=$.expirationTime,l(g,$);else break;$=o(v)}}function H(z){if(j=!1,_(z),!R)if(o(g)!==null)R=!0,P||(P=!0,G());else{var $=o(v);$!==null&&fe(H,$.startTime-z)}}var P=!1,I=-1,k=5,ne=-1;function se(){return C?!0:!(a.unstable_now()-ne<k)}function Q(){if(C=!1,P){var z=a.unstable_now();ne=z;var $=!0;try{e:{R=!1,j&&(j=!1,T(I),I=-1),w=!0;var te=x;try{t:{for(_(z),b=o(g);b!==null&&!(b.expirationTime>z&&se());){var L=b.callback;if(typeof L=="function"){b.callback=null,x=b.priorityLevel;var X=L(b.expirationTime<=z);if(z=a.unstable_now(),typeof X=="function"){b.callback=X,_(z),$=!0;break t}b===o(g)&&i(g),_(z)}else i(g);b=o(g)}if(b!==null)$=!0;else{var M=o(v);M!==null&&fe(H,M.startTime-z),$=!1}}break e}finally{b=null,x=te,w=!1}$=void 0}}finally{$?G():P=!1}}}var G;if(typeof A=="function")G=function(){A(Q)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,le=re.port2;re.port1.onmessage=Q,G=function(){le.postMessage(null)}}else G=function(){N(Q,0)};function fe(z,$){I=N(function(){z(a.unstable_now())},$)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(z){z.callback=null},a.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<z?Math.floor(1e3/z):5},a.unstable_getCurrentPriorityLevel=function(){return x},a.unstable_next=function(z){switch(x){case 1:case 2:case 3:var $=3;break;default:$=x}var te=x;x=$;try{return z()}finally{x=te}},a.unstable_requestPaint=function(){C=!0},a.unstable_runWithPriority=function(z,$){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var te=x;x=z;try{return $()}finally{x=te}},a.unstable_scheduleCallback=function(z,$,te){var L=a.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?L+te:L):te=L,z){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=te+X,z={id:S++,callback:$,priorityLevel:z,startTime:te,expirationTime:X,sortIndex:-1},te>L?(z.sortIndex=te,l(v,z),o(g)===null&&z===o(v)&&(j?(T(I),I=-1):j=!0,fe(H,te-L))):(z.sortIndex=X,l(g,z),R||w||(R=!0,P||(P=!0,G()))),z},a.unstable_shouldYield=se,a.unstable_wrapCallback=function(z){var $=x;return function(){var te=x;x=$;try{return z.apply(this,arguments)}finally{x=te}}}})(ff)),ff}var hy;function Lw(){return hy||(hy=1,df.exports=kw()),df.exports}var hf={exports:{}},Vt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var my;function Uw(){if(my)return Vt;my=1;var a=lh();function l(g){var v="https://react.dev/errors/"+g;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var S=2;S<arguments.length;S++)v+="&args[]="+encodeURIComponent(arguments[S])}return"Minified React error #"+g+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var i={d:{f:o,r:function(){throw Error(l(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},u=Symbol.for("react.portal");function f(g,v,S){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:b==null?null:""+b,children:g,containerInfo:v,implementation:S}}var h=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,v){if(g==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return Vt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Vt.createPortal=function(g,v){var S=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(l(299));return f(g,v,null,S)},Vt.flushSync=function(g){var v=h.T,S=i.p;try{if(h.T=null,i.p=2,g)return g()}finally{h.T=v,i.p=S,i.d.f()}},Vt.preconnect=function(g,v){typeof g=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,i.d.C(g,v))},Vt.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},Vt.preinit=function(g,v){if(typeof g=="string"&&v&&typeof v.as=="string"){var S=v.as,b=m(S,v.crossOrigin),x=typeof v.integrity=="string"?v.integrity:void 0,w=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;S==="style"?i.d.S(g,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:b,integrity:x,fetchPriority:w}):S==="script"&&i.d.X(g,{crossOrigin:b,integrity:x,fetchPriority:w,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},Vt.preinitModule=function(g,v){if(typeof g=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var S=m(v.as,v.crossOrigin);i.d.M(g,{crossOrigin:S,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&i.d.M(g)},Vt.preload=function(g,v){if(typeof g=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var S=v.as,b=m(S,v.crossOrigin);i.d.L(g,S,{crossOrigin:b,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},Vt.preloadModule=function(g,v){if(typeof g=="string")if(v){var S=m(v.as,v.crossOrigin);i.d.m(g,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:S,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else i.d.m(g)},Vt.requestFormReset=function(g){i.d.r(g)},Vt.unstable_batchedUpdates=function(g,v){return g(v)},Vt.useFormState=function(g,v,S){return h.H.useFormState(g,v,S)},Vt.useFormStatus=function(){return h.H.useHostTransitionStatus()},Vt.version="19.2.8",Vt}var py;function lx(){if(py)return hf.exports;py=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),hf.exports=Uw(),hf.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var gy;function Hw(){if(gy)return ps;gy=1;var a=Lw(),l=lh(),o=lx();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(f(e)!==e)throw Error(i(188))}function v(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var c=n.return;if(c===null)break;var d=c.alternate;if(d===null){if(r=c.return,r!==null){n=r;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===n)return g(c),e;if(d===r)return g(c),t;d=d.sibling}throw Error(i(188))}if(n.return!==r.return)n=c,r=d;else{for(var y=!1,E=c.child;E;){if(E===n){y=!0,n=c,r=d;break}if(E===r){y=!0,r=c,n=d;break}E=E.sibling}if(!y){for(E=d.child;E;){if(E===n){y=!0,n=d,r=c;break}if(E===r){y=!0,r=d,n=c;break}E=E.sibling}if(!y)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function S(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=S(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,x=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),A=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),Q=Symbol.iterator;function G(e){return e===null||typeof e!="object"?null:(e=Q&&e[Q]||e["@@iterator"],typeof e=="function"?e:null)}var re=Symbol.for("react.client.reference");function le(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case N:return"Profiler";case C:return"StrictMode";case H:return"Suspense";case P:return"SuspenseList";case ne:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case R:return"Portal";case A:return e.displayName||"Context";case T:return(e._context.displayName||"Context")+".Consumer";case _:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case I:return t=e.displayName||null,t!==null?t:le(e.type)||"Memo";case k:t=e._payload,e=e._init;try{return le(e(t))}catch{}}return null}var fe=Array.isArray,z=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},L=[],X=-1;function M(e){return{current:e}}function B(e){0>X||(e.current=L[X],L[X]=null,X--)}function F(e,t){X++,L[X]=e.current,e.current=t}var ae=M(null),ue=M(null),J=M(null),oe=M(null);function ie(e,t){switch(F(J,t),F(ue,e),F(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Nv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Nv(t),e=Av(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}B(ae),F(ae,e)}function me(){B(ae),B(ue),B(J)}function De(e){e.memoizedState!==null&&F(oe,e);var t=ae.current,n=Av(t,e.type);t!==n&&(F(ue,e),F(ae,n))}function _e(e){ue.current===e&&(B(ae),B(ue)),oe.current===e&&(B(oe),us._currentValue=te)}var Oe,qe;function yt(e){if(Oe===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Oe=t&&t[1]||"",qe=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Oe+e+qe}var Bt=!1;function Xt(e,t){if(!e||Bt)return"";Bt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var ee=function(){throw Error()};if(Object.defineProperty(ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ee,[])}catch(K){var Y=K}Reflect.construct(e,[],ee)}else{try{ee.call()}catch(K){Y=K}e.call(ee.prototype)}}else{try{throw Error()}catch(K){Y=K}(ee=e())&&typeof ee.catch=="function"&&ee.catch(function(){})}}catch(K){if(K&&Y&&typeof K.stack=="string")return[K.stack,Y.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=r.DetermineComponentFrameRoot(),y=d[0],E=d[1];if(y&&E){var O=y.split(`
44
+ `),V=E.split(`
45
+ `);for(c=r=0;r<O.length&&!O[r].includes("DetermineComponentFrameRoot");)r++;for(;c<V.length&&!V[c].includes("DetermineComponentFrameRoot");)c++;if(r===O.length||c===V.length)for(r=O.length-1,c=V.length-1;1<=r&&0<=c&&O[r]!==V[c];)c--;for(;1<=r&&0<=c;r--,c--)if(O[r]!==V[c]){if(r!==1||c!==1)do if(r--,c--,0>c||O[r]!==V[c]){var Z=`
46
+ `+O[r].replace(" at new "," at ");return e.displayName&&Z.includes("<anonymous>")&&(Z=Z.replace("<anonymous>",e.displayName)),Z}while(1<=r&&0<=c);break}}}finally{Bt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?yt(n):""}function la(e,t){switch(e.tag){case 26:case 27:case 5:return yt(e.type);case 16:return yt("Lazy");case 13:return e.child!==t&&t!==null?yt("Suspense Fallback"):yt("Suspense");case 19:return yt("SuspenseList");case 0:case 15:return Xt(e.type,!1);case 11:return Xt(e.type.render,!1);case 1:return Xt(e.type,!0);case 31:return yt("Activity");default:return""}}function Rn(e){try{var t="",n=null;do t+=la(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
47
+ Error generating stack: `+r.message+`
48
+ `+r.stack}}var Pl=Object.prototype.hasOwnProperty,nl=a.unstable_scheduleCallback,Yn=a.unstable_cancelCallback,ba=a.unstable_shouldYield,Sa=a.unstable_requestPaint,It=a.unstable_now,Yc=a.unstable_getCurrentPriorityLevel,Yt=a.unstable_ImmediatePriority,wa=a.unstable_UserBlockingPriority,vr=a.unstable_NormalPriority,Gc=a.unstable_LowPriority,ql=a.unstable_IdlePriority,$c=a.log,Us=a.unstable_setDisableYieldValue,ja=null,xt=null;function Gn(e){if(typeof $c=="function"&&Us(e),xt&&typeof xt.setStrictMode=="function")try{xt.setStrictMode(ja,e)}catch{}}var bt=Math.clz32?Math.clz32:Hs,Kc=Math.log,Xc=Math.LN2;function Hs(e){return e>>>=0,e===0?32:31-(Kc(e)/Xc|0)|0}var Vl=256,yr=262144,al=4194304;function Pt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function xr(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var c=0,d=e.suspendedLanes,y=e.pingedLanes;e=e.warmLanes;var E=r&134217727;return E!==0?(r=E&~d,r!==0?c=Pt(r):(y&=E,y!==0?c=Pt(y):n||(n=E&~e,n!==0&&(c=Pt(n))))):(E=r&~d,E!==0?c=Pt(E):y!==0?c=Pt(y):n||(n=r&~e,n!==0&&(c=Pt(n)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,n=t&-t,d>=n||d===32&&(n&4194048)!==0)?t:c}function Ee(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Fe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ot(){var e=al;return al<<=1,(al&62914560)===0&&(al=4194304),e}function Gt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ot(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ra(e,t,n,r,c,d){var y=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var E=e.entanglements,O=e.expirationTimes,V=e.hiddenUpdates;for(n=y&~n;0<n;){var Z=31-bt(n),ee=1<<Z;E[Z]=0,O[Z]=-1;var Y=V[Z];if(Y!==null)for(V[Z]=null,Z=0;Z<Y.length;Z++){var K=Y[Z];K!==null&&(K.lane&=-536870913)}n&=~ee}r!==0&&oa(e,r,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(y&~t))}function oa(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-bt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Qt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-bt(n),c=1<<r;c&t|e[r]&t&&(e[r]|=t),n&=~c}}function $n(e,t){var n=t&-t;return n=(n&42)!==0?1:Qc(n),(n&(e.suspendedLanes|t))!==0?0:n}function Qc(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Fc(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function hm(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:Jv(e.type))}function mm(e,t){var n=$.p;try{return $.p=e,t()}finally{$.p=n}}var ll=Math.random().toString(36).slice(2),Dt="__reactFiber$"+ll,Ft="__reactProps$"+ll,br="__reactContainer$"+ll,Zc="__reactEvents$"+ll,b1="__reactListeners$"+ll,S1="__reactHandles$"+ll,pm="__reactResources$"+ll,Eo="__reactMarker$"+ll;function Jc(e){delete e[Dt],delete e[Ft],delete e[Zc],delete e[b1],delete e[S1]}function Sr(e){var t=e[Dt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[br]||n[Dt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Lv(e);e!==null;){if(n=e[Dt])return n;e=Lv(e)}return t}e=n,n=e.parentNode}return null}function wr(e){if(e=e[Dt]||e[br]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ro(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function jr(e){var t=e[pm];return t||(t=e[pm]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Nt(e){e[Eo]=!0}var gm=new Set,vm={};function Il(e,t){Cr(e,t),Cr(e+"Capture",t)}function Cr(e,t){for(vm[e]=t,e=0;e<t.length;e++)gm.add(t[e])}var w1=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]*$"),ym={},xm={};function j1(e){return Pl.call(xm,e)?!0:Pl.call(ym,e)?!1:w1.test(e)?xm[e]=!0:(ym[e]=!0,!1)}function Bs(e,t,n){if(j1(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Ps(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Ca(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}function Tn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function bm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function C1(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,d=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(y){n=""+y,d.call(this,y)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(y){n=""+y},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Wc(e){if(!e._valueTracker){var t=bm(e)?"checked":"value";e._valueTracker=C1(e,t,""+e[t])}}function Sm(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=bm(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function qs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var E1=/[\n"\\]/g;function Nn(e){return e.replace(E1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function eu(e,t,n,r,c,d,y,E){e.name="",y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.type=y:e.removeAttribute("type"),t!=null?y==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Tn(t)):e.value!==""+Tn(t)&&(e.value=""+Tn(t)):y!=="submit"&&y!=="reset"||e.removeAttribute("value"),t!=null?tu(e,y,Tn(t)):n!=null?tu(e,y,Tn(n)):r!=null&&e.removeAttribute("value"),c==null&&d!=null&&(e.defaultChecked=!!d),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?e.name=""+Tn(E):e.removeAttribute("name")}function wm(e,t,n,r,c,d,y,E){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||n!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){Wc(e);return}n=n!=null?""+Tn(n):"",t=t!=null?""+Tn(t):n,E||t===e.value||(e.value=t),e.defaultValue=t}r=r??c,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=E?e.checked:!!r,e.defaultChecked=!!r,y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(e.name=y),Wc(e)}function tu(e,t,n){t==="number"&&qs(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Er(e,t,n,r){if(e=e.options,t){t={};for(var c=0;c<n.length;c++)t["$"+n[c]]=!0;for(n=0;n<e.length;n++)c=t.hasOwnProperty("$"+e[n].value),e[n].selected!==c&&(e[n].selected=c),c&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Tn(n),t=null,c=0;c<e.length;c++){if(e[c].value===n){e[c].selected=!0,r&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function jm(e,t,n){if(t!=null&&(t=""+Tn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Tn(n):""}function Cm(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(fe(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=Tn(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),Wc(e)}function Rr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var R1=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 Em(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||R1.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Rm(e,t,n){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var c in t)r=t[c],t.hasOwnProperty(c)&&n[c]!==r&&Em(e,c,r)}else for(var d in t)t.hasOwnProperty(d)&&Em(e,d,t[d])}function nu(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var T1=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"]]),N1=/^[\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 Vs(e){return N1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ea(){}var au=null;function lu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Tr=null,Nr=null;function Tm(e){var t=wr(e);if(t&&(e=t.stateNode)){var n=e[Ft]||null;e:switch(e=t.stateNode,t.type){case"input":if(eu(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Nn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var c=r[Ft]||null;if(!c)throw Error(i(90));eu(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Sm(r)}break e;case"textarea":jm(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Er(e,!!n.multiple,t,!1)}}}var ru=!1;function Nm(e,t,n){if(ru)return e(t,n);ru=!0;try{var r=e(t);return r}finally{if(ru=!1,(Tr!==null||Nr!==null)&&(Ai(),Tr&&(t=Tr,e=Nr,Nr=Tr=null,Tm(t),e)))for(t=0;t<e.length;t++)Tm(e[t])}}function To(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Ft]||null;if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(i(231,t,typeof n));return n}var Ra=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ou=!1;if(Ra)try{var No={};Object.defineProperty(No,"passive",{get:function(){ou=!0}}),window.addEventListener("test",No,No),window.removeEventListener("test",No,No)}catch{ou=!1}var rl=null,su=null,Is=null;function Am(){if(Is)return Is;var e,t=su,n=t.length,r,c="value"in rl?rl.value:rl.textContent,d=c.length;for(e=0;e<n&&t[e]===c[e];e++);var y=n-e;for(r=1;r<=y&&t[n-r]===c[d-r];r++);return Is=c.slice(e,1<r?1-r:void 0)}function Ys(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Gs(){return!0}function Mm(){return!1}function Zt(e){function t(n,r,c,d,y){this._reactName=n,this._targetInst=c,this.type=r,this.nativeEvent=d,this.target=y,this.currentTarget=null;for(var E in e)e.hasOwnProperty(E)&&(n=e[E],this[E]=n?n(d):d[E]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Gs:Mm,this.isPropagationStopped=Mm,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Gs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Gs)},persist:function(){},isPersistent:Gs}),t}var Yl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$s=Zt(Yl),Ao=b({},Yl,{view:0,detail:0}),A1=Zt(Ao),iu,cu,Mo,Ks=b({},Ao,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:du,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Mo&&(Mo&&e.type==="mousemove"?(iu=e.screenX-Mo.screenX,cu=e.screenY-Mo.screenY):cu=iu=0,Mo=e),iu)},movementY:function(e){return"movementY"in e?e.movementY:cu}}),_m=Zt(Ks),M1=b({},Ks,{dataTransfer:0}),_1=Zt(M1),O1=b({},Ao,{relatedTarget:0}),uu=Zt(O1),D1=b({},Yl,{animationName:0,elapsedTime:0,pseudoElement:0}),z1=Zt(D1),k1=b({},Yl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),L1=Zt(k1),U1=b({},Yl,{data:0}),Om=Zt(U1),H1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},B1={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"},P1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function q1(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=P1[e])?!!t[e]:!1}function du(){return q1}var V1=b({},Ao,{key:function(e){if(e.key){var t=H1[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ys(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?B1[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:du,charCode:function(e){return e.type==="keypress"?Ys(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ys(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),I1=Zt(V1),Y1=b({},Ks,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dm=Zt(Y1),G1=b({},Ao,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:du}),$1=Zt(G1),K1=b({},Yl,{propertyName:0,elapsedTime:0,pseudoElement:0}),X1=Zt(K1),Q1=b({},Ks,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),F1=Zt(Q1),Z1=b({},Yl,{newState:0,oldState:0}),J1=Zt(Z1),W1=[9,13,27,32],fu=Ra&&"CompositionEvent"in window,_o=null;Ra&&"documentMode"in document&&(_o=document.documentMode);var eS=Ra&&"TextEvent"in window&&!_o,zm=Ra&&(!fu||_o&&8<_o&&11>=_o),km=" ",Lm=!1;function Um(e,t){switch(e){case"keyup":return W1.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ar=!1;function tS(e,t){switch(e){case"compositionend":return Hm(t);case"keypress":return t.which!==32?null:(Lm=!0,km);case"textInput":return e=t.data,e===km&&Lm?null:e;default:return null}}function nS(e,t){if(Ar)return e==="compositionend"||!fu&&Um(e,t)?(e=Am(),Is=su=rl=null,Ar=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return zm&&t.locale!=="ko"?null:t.data;default:return null}}var aS={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 Bm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!aS[e.type]:t==="textarea"}function Pm(e,t,n,r){Tr?Nr?Nr.push(r):Nr=[r]:Tr=r,t=Li(t,"onChange"),0<t.length&&(n=new $s("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Oo=null,Do=null;function lS(e){wv(e,0)}function Xs(e){var t=Ro(e);if(Sm(t))return e}function qm(e,t){if(e==="change")return t}var Vm=!1;if(Ra){var hu;if(Ra){var mu="oninput"in document;if(!mu){var Im=document.createElement("div");Im.setAttribute("oninput","return;"),mu=typeof Im.oninput=="function"}hu=mu}else hu=!1;Vm=hu&&(!document.documentMode||9<document.documentMode)}function Ym(){Oo&&(Oo.detachEvent("onpropertychange",Gm),Do=Oo=null)}function Gm(e){if(e.propertyName==="value"&&Xs(Do)){var t=[];Pm(t,Do,e,lu(e)),Nm(lS,t)}}function rS(e,t,n){e==="focusin"?(Ym(),Oo=t,Do=n,Oo.attachEvent("onpropertychange",Gm)):e==="focusout"&&Ym()}function oS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Xs(Do)}function sS(e,t){if(e==="click")return Xs(t)}function iS(e,t){if(e==="input"||e==="change")return Xs(t)}function cS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dn=typeof Object.is=="function"?Object.is:cS;function zo(e,t){if(dn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var c=n[r];if(!Pl.call(t,c)||!dn(e[c],t[c]))return!1}return!0}function $m(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Km(e,t){var n=$m(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=$m(n)}}function Xm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Xm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qs(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=qs(e.document)}return t}function pu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var uS=Ra&&"documentMode"in document&&11>=document.documentMode,Mr=null,gu=null,ko=null,vu=!1;function Fm(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;vu||Mr==null||Mr!==qs(r)||(r=Mr,"selectionStart"in r&&pu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ko&&zo(ko,r)||(ko=r,r=Li(gu,"onSelect"),0<r.length&&(t=new $s("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Mr)))}function Gl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var _r={animationend:Gl("Animation","AnimationEnd"),animationiteration:Gl("Animation","AnimationIteration"),animationstart:Gl("Animation","AnimationStart"),transitionrun:Gl("Transition","TransitionRun"),transitionstart:Gl("Transition","TransitionStart"),transitioncancel:Gl("Transition","TransitionCancel"),transitionend:Gl("Transition","TransitionEnd")},yu={},Zm={};Ra&&(Zm=document.createElement("div").style,"AnimationEvent"in window||(delete _r.animationend.animation,delete _r.animationiteration.animation,delete _r.animationstart.animation),"TransitionEvent"in window||delete _r.transitionend.transition);function $l(e){if(yu[e])return yu[e];if(!_r[e])return e;var t=_r[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Zm)return yu[e]=t[n];return e}var Jm=$l("animationend"),Wm=$l("animationiteration"),ep=$l("animationstart"),dS=$l("transitionrun"),fS=$l("transitionstart"),hS=$l("transitioncancel"),tp=$l("transitionend"),np=new Map,xu="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(" ");xu.push("scrollEnd");function Kn(e,t){np.set(e,t),Il(t,[e])}var Qs=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},An=[],Or=0,bu=0;function Fs(){for(var e=Or,t=bu=Or=0;t<e;){var n=An[t];An[t++]=null;var r=An[t];An[t++]=null;var c=An[t];An[t++]=null;var d=An[t];if(An[t++]=null,r!==null&&c!==null){var y=r.pending;y===null?c.next=c:(c.next=y.next,y.next=c),r.pending=c}d!==0&&ap(n,c,d)}}function Zs(e,t,n,r){An[Or++]=e,An[Or++]=t,An[Or++]=n,An[Or++]=r,bu|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Su(e,t,n,r){return Zs(e,t,n,r),Js(e)}function Kl(e,t){return Zs(e,null,null,t),Js(e)}function ap(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var c=!1,d=e.return;d!==null;)d.childLanes|=n,r=d.alternate,r!==null&&(r.childLanes|=n),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(c=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,c&&t!==null&&(c=31-bt(n),e=d.hiddenUpdates,r=e[c],r===null?e[c]=[t]:r.push(t),t.lane=n|536870912),d):null}function Js(e){if(50<as)throw as=0,Md=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Dr={};function mS(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fn(e,t,n,r){return new mS(e,t,n,r)}function wu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ta(e,t){var n=e.alternate;return n===null?(n=fn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function lp(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Ws(e,t,n,r,c,d){var y=0;if(r=e,typeof e=="function")wu(e)&&(y=1);else if(typeof e=="string")y=xw(e,n,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ne:return e=fn(31,n,t,c),e.elementType=ne,e.lanes=d,e;case j:return Xl(n.children,c,d,t);case C:y=8,c|=24;break;case N:return e=fn(12,n,t,c|2),e.elementType=N,e.lanes=d,e;case H:return e=fn(13,n,t,c),e.elementType=H,e.lanes=d,e;case P:return e=fn(19,n,t,c),e.elementType=P,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:y=10;break e;case T:y=9;break e;case _:y=11;break e;case I:y=14;break e;case k:y=16,r=null;break e}y=29,n=Error(i(130,e===null?"null":typeof e,"")),r=null}return t=fn(y,n,t,c),t.elementType=e,t.type=r,t.lanes=d,t}function Xl(e,t,n,r){return e=fn(7,e,r,t),e.lanes=n,e}function ju(e,t,n){return e=fn(6,e,null,t),e.lanes=n,e}function rp(e){var t=fn(18,null,null,0);return t.stateNode=e,t}function Cu(e,t,n){return t=fn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var op=new WeakMap;function Mn(e,t){if(typeof e=="object"&&e!==null){var n=op.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Rn(t)},op.set(e,t),t)}return{value:e,source:t,stack:Rn(t)}}var zr=[],kr=0,ei=null,Lo=0,_n=[],On=0,ol=null,sa=1,ia="";function Na(e,t){zr[kr++]=Lo,zr[kr++]=ei,ei=e,Lo=t}function sp(e,t,n){_n[On++]=sa,_n[On++]=ia,_n[On++]=ol,ol=e;var r=sa;e=ia;var c=32-bt(r)-1;r&=~(1<<c),n+=1;var d=32-bt(t)+c;if(30<d){var y=c-c%5;d=(r&(1<<y)-1).toString(32),r>>=y,c-=y,sa=1<<32-bt(t)+c|n<<c|r,ia=d+e}else sa=1<<d|n<<c|r,ia=e}function Eu(e){e.return!==null&&(Na(e,1),sp(e,1,0))}function Ru(e){for(;e===ei;)ei=zr[--kr],zr[kr]=null,Lo=zr[--kr],zr[kr]=null;for(;e===ol;)ol=_n[--On],_n[On]=null,ia=_n[--On],_n[On]=null,sa=_n[--On],_n[On]=null}function ip(e,t){_n[On++]=sa,_n[On++]=ia,_n[On++]=ol,sa=t.id,ia=t.overflow,ol=e}var zt=null,ct=null,Be=!1,sl=null,Dn=!1,Tu=Error(i(519));function il(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Uo(Mn(t,e)),Tu}function cp(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Dt]=e,t[Ft]=r,n){case"dialog":ke("cancel",t),ke("close",t);break;case"iframe":case"object":case"embed":ke("load",t);break;case"video":case"audio":for(n=0;n<rs.length;n++)ke(rs[n],t);break;case"source":ke("error",t);break;case"img":case"image":case"link":ke("error",t),ke("load",t);break;case"details":ke("toggle",t);break;case"input":ke("invalid",t),wm(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ke("invalid",t);break;case"textarea":ke("invalid",t),Cm(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||Rv(t.textContent,n)?(r.popover!=null&&(ke("beforetoggle",t),ke("toggle",t)),r.onScroll!=null&&ke("scroll",t),r.onScrollEnd!=null&&ke("scrollend",t),r.onClick!=null&&(t.onclick=Ea),t=!0):t=!1,t||il(e,!0)}function up(e){for(zt=e.return;zt;)switch(zt.tag){case 5:case 31:case 13:Dn=!1;return;case 27:case 3:Dn=!0;return;default:zt=zt.return}}function Lr(e){if(e!==zt)return!1;if(!Be)return up(e),Be=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Gd(e.type,e.memoizedProps)),n=!n),n&&ct&&il(e),up(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));ct=kv(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));ct=kv(e)}else t===27?(t=ct,wl(e.type)?(e=Fd,Fd=null,ct=e):ct=t):ct=zt?kn(e.stateNode.nextSibling):null;return!0}function Ql(){ct=zt=null,Be=!1}function Nu(){var e=sl;return e!==null&&(tn===null?tn=e:tn.push.apply(tn,e),sl=null),e}function Uo(e){sl===null?sl=[e]:sl.push(e)}var Au=M(null),Fl=null,Aa=null;function cl(e,t,n){F(Au,t._currentValue),t._currentValue=n}function Ma(e){e._currentValue=Au.current,B(Au)}function Mu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function _u(e,t,n,r){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var d=c.dependencies;if(d!==null){var y=c.child;d=d.firstContext;e:for(;d!==null;){var E=d;d=c;for(var O=0;O<t.length;O++)if(E.context===t[O]){d.lanes|=n,E=d.alternate,E!==null&&(E.lanes|=n),Mu(d.return,n,e),r||(y=null);break e}d=E.next}}else if(c.tag===18){if(y=c.return,y===null)throw Error(i(341));y.lanes|=n,d=y.alternate,d!==null&&(d.lanes|=n),Mu(y,n,e),y=null}else y=c.child;if(y!==null)y.return=c;else for(y=c;y!==null;){if(y===e){y=null;break}if(c=y.sibling,c!==null){c.return=y.return,y=c;break}y=y.return}c=y}}function Ur(e,t,n,r){e=null;for(var c=t,d=!1;c!==null;){if(!d){if((c.flags&524288)!==0)d=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var y=c.alternate;if(y===null)throw Error(i(387));if(y=y.memoizedProps,y!==null){var E=c.type;dn(c.pendingProps.value,y.value)||(e!==null?e.push(E):e=[E])}}else if(c===oe.current){if(y=c.alternate,y===null)throw Error(i(387));y.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(us):e=[us])}c=c.return}e!==null&&_u(t,e,n,r),t.flags|=262144}function ti(e){for(e=e.firstContext;e!==null;){if(!dn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Zl(e){Fl=e,Aa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function kt(e){return dp(Fl,e)}function ni(e,t){return Fl===null&&Zl(e),dp(e,t)}function dp(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Aa===null){if(e===null)throw Error(i(308));Aa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Aa=Aa.next=t;return n}var pS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},gS=a.unstable_scheduleCallback,vS=a.unstable_NormalPriority,St={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ou(){return{controller:new pS,data:new Map,refCount:0}}function Ho(e){e.refCount--,e.refCount===0&&gS(vS,function(){e.controller.abort()})}var Bo=null,Du=0,Hr=0,Br=null;function yS(e,t){if(Bo===null){var n=Bo=[];Du=0,Hr=Ld(),Br={status:"pending",value:void 0,then:function(r){n.push(r)}}}return Du++,t.then(fp,fp),t}function fp(){if(--Du===0&&Bo!==null){Br!==null&&(Br.status="fulfilled");var e=Bo;Bo=null,Hr=0,Br=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function xS(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(c){n.push(c)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var c=0;c<n.length;c++)(0,n[c])(t)},function(c){for(r.status="rejected",r.reason=c,c=0;c<n.length;c++)(0,n[c])(void 0)}),r}var hp=z.S;z.S=function(e,t){Fg=It(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&yS(e,t),hp!==null&&hp(e,t)};var Jl=M(null);function zu(){var e=Jl.current;return e!==null?e:st.pooledCache}function ai(e,t){t===null?F(Jl,Jl.current):F(Jl,t.pool)}function mp(){var e=zu();return e===null?null:{parent:St._currentValue,pool:e}}var Pr=Error(i(460)),ku=Error(i(474)),li=Error(i(542)),ri={then:function(){}};function pp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function gp(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ea,Ea),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,yp(e),e;default:if(typeof t.status=="string")t.then(Ea,Ea);else{if(e=st,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=r}},function(r){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,yp(e),e}throw er=t,Pr}}function Wl(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(er=n,Pr):n}}var er=null;function vp(){if(er===null)throw Error(i(459));var e=er;return er=null,e}function yp(e){if(e===Pr||e===li)throw Error(i(483))}var qr=null,Po=0;function oi(e){var t=Po;return Po+=1,qr===null&&(qr=[]),gp(qr,e,t)}function qo(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function si(e,t){throw t.$$typeof===x?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function xp(e){function t(U,D){if(e){var q=U.deletions;q===null?(U.deletions=[D],U.flags|=16):q.push(D)}}function n(U,D){if(!e)return null;for(;D!==null;)t(U,D),D=D.sibling;return null}function r(U){for(var D=new Map;U!==null;)U.key!==null?D.set(U.key,U):D.set(U.index,U),U=U.sibling;return D}function c(U,D){return U=Ta(U,D),U.index=0,U.sibling=null,U}function d(U,D,q){return U.index=q,e?(q=U.alternate,q!==null?(q=q.index,q<D?(U.flags|=67108866,D):q):(U.flags|=67108866,D)):(U.flags|=1048576,D)}function y(U){return e&&U.alternate===null&&(U.flags|=67108866),U}function E(U,D,q,W){return D===null||D.tag!==6?(D=ju(q,U.mode,W),D.return=U,D):(D=c(D,q),D.return=U,D)}function O(U,D,q,W){var be=q.type;return be===j?Z(U,D,q.props.children,W,q.key):D!==null&&(D.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===k&&Wl(be)===D.type)?(D=c(D,q.props),qo(D,q),D.return=U,D):(D=Ws(q.type,q.key,q.props,null,U.mode,W),qo(D,q),D.return=U,D)}function V(U,D,q,W){return D===null||D.tag!==4||D.stateNode.containerInfo!==q.containerInfo||D.stateNode.implementation!==q.implementation?(D=Cu(q,U.mode,W),D.return=U,D):(D=c(D,q.children||[]),D.return=U,D)}function Z(U,D,q,W,be){return D===null||D.tag!==7?(D=Xl(q,U.mode,W,be),D.return=U,D):(D=c(D,q),D.return=U,D)}function ee(U,D,q){if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return D=ju(""+D,U.mode,q),D.return=U,D;if(typeof D=="object"&&D!==null){switch(D.$$typeof){case w:return q=Ws(D.type,D.key,D.props,null,U.mode,q),qo(q,D),q.return=U,q;case R:return D=Cu(D,U.mode,q),D.return=U,D;case k:return D=Wl(D),ee(U,D,q)}if(fe(D)||G(D))return D=Xl(D,U.mode,q,null),D.return=U,D;if(typeof D.then=="function")return ee(U,oi(D),q);if(D.$$typeof===A)return ee(U,ni(U,D),q);si(U,D)}return null}function Y(U,D,q,W){var be=D!==null?D.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return be!==null?null:E(U,D,""+q,W);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case w:return q.key===be?O(U,D,q,W):null;case R:return q.key===be?V(U,D,q,W):null;case k:return q=Wl(q),Y(U,D,q,W)}if(fe(q)||G(q))return be!==null?null:Z(U,D,q,W,null);if(typeof q.then=="function")return Y(U,D,oi(q),W);if(q.$$typeof===A)return Y(U,D,ni(U,q),W);si(U,q)}return null}function K(U,D,q,W,be){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return U=U.get(q)||null,E(D,U,""+W,be);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case w:return U=U.get(W.key===null?q:W.key)||null,O(D,U,W,be);case R:return U=U.get(W.key===null?q:W.key)||null,V(D,U,W,be);case k:return W=Wl(W),K(U,D,q,W,be)}if(fe(W)||G(W))return U=U.get(q)||null,Z(D,U,W,be,null);if(typeof W.then=="function")return K(U,D,q,oi(W),be);if(W.$$typeof===A)return K(U,D,q,ni(D,W),be);si(D,W)}return null}function pe(U,D,q,W){for(var be=null,Ie=null,ge=D,Ae=D=0,He=null;ge!==null&&Ae<q.length;Ae++){ge.index>Ae?(He=ge,ge=null):He=ge.sibling;var Ye=Y(U,ge,q[Ae],W);if(Ye===null){ge===null&&(ge=He);break}e&&ge&&Ye.alternate===null&&t(U,ge),D=d(Ye,D,Ae),Ie===null?be=Ye:Ie.sibling=Ye,Ie=Ye,ge=He}if(Ae===q.length)return n(U,ge),Be&&Na(U,Ae),be;if(ge===null){for(;Ae<q.length;Ae++)ge=ee(U,q[Ae],W),ge!==null&&(D=d(ge,D,Ae),Ie===null?be=ge:Ie.sibling=ge,Ie=ge);return Be&&Na(U,Ae),be}for(ge=r(ge);Ae<q.length;Ae++)He=K(ge,U,Ae,q[Ae],W),He!==null&&(e&&He.alternate!==null&&ge.delete(He.key===null?Ae:He.key),D=d(He,D,Ae),Ie===null?be=He:Ie.sibling=He,Ie=He);return e&&ge.forEach(function(Tl){return t(U,Tl)}),Be&&Na(U,Ae),be}function je(U,D,q,W){if(q==null)throw Error(i(151));for(var be=null,Ie=null,ge=D,Ae=D=0,He=null,Ye=q.next();ge!==null&&!Ye.done;Ae++,Ye=q.next()){ge.index>Ae?(He=ge,ge=null):He=ge.sibling;var Tl=Y(U,ge,Ye.value,W);if(Tl===null){ge===null&&(ge=He);break}e&&ge&&Tl.alternate===null&&t(U,ge),D=d(Tl,D,Ae),Ie===null?be=Tl:Ie.sibling=Tl,Ie=Tl,ge=He}if(Ye.done)return n(U,ge),Be&&Na(U,Ae),be;if(ge===null){for(;!Ye.done;Ae++,Ye=q.next())Ye=ee(U,Ye.value,W),Ye!==null&&(D=d(Ye,D,Ae),Ie===null?be=Ye:Ie.sibling=Ye,Ie=Ye);return Be&&Na(U,Ae),be}for(ge=r(ge);!Ye.done;Ae++,Ye=q.next())Ye=K(ge,U,Ae,Ye.value,W),Ye!==null&&(e&&Ye.alternate!==null&&ge.delete(Ye.key===null?Ae:Ye.key),D=d(Ye,D,Ae),Ie===null?be=Ye:Ie.sibling=Ye,Ie=Ye);return e&&ge.forEach(function(Mw){return t(U,Mw)}),Be&&Na(U,Ae),be}function at(U,D,q,W){if(typeof q=="object"&&q!==null&&q.type===j&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case w:e:{for(var be=q.key;D!==null;){if(D.key===be){if(be=q.type,be===j){if(D.tag===7){n(U,D.sibling),W=c(D,q.props.children),W.return=U,U=W;break e}}else if(D.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===k&&Wl(be)===D.type){n(U,D.sibling),W=c(D,q.props),qo(W,q),W.return=U,U=W;break e}n(U,D);break}else t(U,D);D=D.sibling}q.type===j?(W=Xl(q.props.children,U.mode,W,q.key),W.return=U,U=W):(W=Ws(q.type,q.key,q.props,null,U.mode,W),qo(W,q),W.return=U,U=W)}return y(U);case R:e:{for(be=q.key;D!==null;){if(D.key===be)if(D.tag===4&&D.stateNode.containerInfo===q.containerInfo&&D.stateNode.implementation===q.implementation){n(U,D.sibling),W=c(D,q.children||[]),W.return=U,U=W;break e}else{n(U,D);break}else t(U,D);D=D.sibling}W=Cu(q,U.mode,W),W.return=U,U=W}return y(U);case k:return q=Wl(q),at(U,D,q,W)}if(fe(q))return pe(U,D,q,W);if(G(q)){if(be=G(q),typeof be!="function")throw Error(i(150));return q=be.call(q),je(U,D,q,W)}if(typeof q.then=="function")return at(U,D,oi(q),W);if(q.$$typeof===A)return at(U,D,ni(U,q),W);si(U,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,D!==null&&D.tag===6?(n(U,D.sibling),W=c(D,q),W.return=U,U=W):(n(U,D),W=ju(q,U.mode,W),W.return=U,U=W),y(U)):n(U,D)}return function(U,D,q,W){try{Po=0;var be=at(U,D,q,W);return qr=null,be}catch(ge){if(ge===Pr||ge===li)throw ge;var Ie=fn(29,ge,null,U.mode);return Ie.lanes=W,Ie.return=U,Ie}finally{}}}var tr=xp(!0),bp=xp(!1),ul=!1;function Lu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Uu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function dl(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function fl(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Qe&2)!==0){var c=r.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),r.pending=t,t=Js(e),ap(e,null,n),t}return Zs(e,r,t,n),Js(e)}function Vo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qt(e,n)}}function Hu(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var c=null,d=null;if(n=n.firstBaseUpdate,n!==null){do{var y={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};d===null?c=d=y:d=d.next=y,n=n.next}while(n!==null);d===null?c=d=t:d=d.next=t}else c=d=t;n={baseState:r.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Bu=!1;function Io(){if(Bu){var e=Br;if(e!==null)throw e}}function Yo(e,t,n,r){Bu=!1;var c=e.updateQueue;ul=!1;var d=c.firstBaseUpdate,y=c.lastBaseUpdate,E=c.shared.pending;if(E!==null){c.shared.pending=null;var O=E,V=O.next;O.next=null,y===null?d=V:y.next=V,y=O;var Z=e.alternate;Z!==null&&(Z=Z.updateQueue,E=Z.lastBaseUpdate,E!==y&&(E===null?Z.firstBaseUpdate=V:E.next=V,Z.lastBaseUpdate=O))}if(d!==null){var ee=c.baseState;y=0,Z=V=O=null,E=d;do{var Y=E.lane&-536870913,K=Y!==E.lane;if(K?(Ue&Y)===Y:(r&Y)===Y){Y!==0&&Y===Hr&&(Bu=!0),Z!==null&&(Z=Z.next={lane:0,tag:E.tag,payload:E.payload,callback:null,next:null});e:{var pe=e,je=E;Y=t;var at=n;switch(je.tag){case 1:if(pe=je.payload,typeof pe=="function"){ee=pe.call(at,ee,Y);break e}ee=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=je.payload,Y=typeof pe=="function"?pe.call(at,ee,Y):pe,Y==null)break e;ee=b({},ee,Y);break e;case 2:ul=!0}}Y=E.callback,Y!==null&&(e.flags|=64,K&&(e.flags|=8192),K=c.callbacks,K===null?c.callbacks=[Y]:K.push(Y))}else K={lane:Y,tag:E.tag,payload:E.payload,callback:E.callback,next:null},Z===null?(V=Z=K,O=ee):Z=Z.next=K,y|=Y;if(E=E.next,E===null){if(E=c.shared.pending,E===null)break;K=E,E=K.next,K.next=null,c.lastBaseUpdate=K,c.shared.pending=null}}while(!0);Z===null&&(O=ee),c.baseState=O,c.firstBaseUpdate=V,c.lastBaseUpdate=Z,d===null&&(c.shared.lanes=0),vl|=y,e.lanes=y,e.memoizedState=ee}}function Sp(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function wp(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Sp(n[e],t)}var Vr=M(null),ii=M(0);function jp(e,t){e=Ba,F(ii,e),F(Vr,t),Ba=e|t.baseLanes}function Pu(){F(ii,Ba),F(Vr,Vr.current)}function qu(){Ba=ii.current,B(Vr),B(ii)}var hn=M(null),zn=null;function hl(e){var t=e.alternate;F(gt,gt.current&1),F(hn,e),zn===null&&(t===null||Vr.current!==null||t.memoizedState!==null)&&(zn=e)}function Vu(e){F(gt,gt.current),F(hn,e),zn===null&&(zn=e)}function Cp(e){e.tag===22?(F(gt,gt.current),F(hn,e),zn===null&&(zn=e)):ml()}function ml(){F(gt,gt.current),F(hn,hn.current)}function mn(e){B(hn),zn===e&&(zn=null),B(gt)}var gt=M(0);function ci(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Xd(n)||Qd(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var _a=0,Ne=null,tt=null,wt=null,ui=!1,Ir=!1,nr=!1,di=0,Go=0,Yr=null,bS=0;function mt(){throw Error(i(321))}function Iu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!dn(e[n],t[n]))return!1;return!0}function Yu(e,t,n,r,c,d){return _a=d,Ne=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,z.H=e===null||e.memoizedState===null?sg:rd,nr=!1,d=n(r,c),nr=!1,Ir&&(d=Rp(t,n,r,c)),Ep(e),d}function Ep(e){z.H=Xo;var t=tt!==null&&tt.next!==null;if(_a=0,wt=tt=Ne=null,ui=!1,Go=0,Yr=null,t)throw Error(i(300));e===null||jt||(e=e.dependencies,e!==null&&ti(e)&&(jt=!0))}function Rp(e,t,n,r){Ne=e;var c=0;do{if(Ir&&(Yr=null),Go=0,Ir=!1,25<=c)throw Error(i(301));if(c+=1,wt=tt=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}z.H=ig,d=t(n,r)}while(Ir);return d}function SS(){var e=z.H,t=e.useState()[0];return t=typeof t.then=="function"?$o(t):t,e=e.useState()[0],(tt!==null?tt.memoizedState:null)!==e&&(Ne.flags|=1024),t}function Gu(){var e=di!==0;return di=0,e}function $u(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ku(e){if(ui){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ui=!1}_a=0,wt=tt=Ne=null,Ir=!1,Go=di=0,Yr=null}function $t(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wt===null?Ne.memoizedState=wt=e:wt=wt.next=e,wt}function vt(){if(tt===null){var e=Ne.alternate;e=e!==null?e.memoizedState:null}else e=tt.next;var t=wt===null?Ne.memoizedState:wt.next;if(t!==null)wt=t,tt=e;else{if(e===null)throw Ne.alternate===null?Error(i(467)):Error(i(310));tt=e,e={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},wt===null?Ne.memoizedState=wt=e:wt=wt.next=e}return wt}function fi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $o(e){var t=Go;return Go+=1,Yr===null&&(Yr=[]),e=gp(Yr,e,t),t=Ne,(wt===null?t.memoizedState:wt.next)===null&&(t=t.alternate,z.H=t===null||t.memoizedState===null?sg:rd),e}function hi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return $o(e);if(e.$$typeof===A)return kt(e)}throw Error(i(438,String(e)))}function Xu(e){var t=null,n=Ne.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Ne.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=fi(),Ne.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=se;return t.index++,n}function Oa(e,t){return typeof t=="function"?t(e):t}function mi(e){var t=vt();return Qu(t,tt,e)}function Qu(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var c=e.baseQueue,d=r.pending;if(d!==null){if(c!==null){var y=c.next;c.next=d.next,d.next=y}t.baseQueue=c=d,r.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var E=y=null,O=null,V=t,Z=!1;do{var ee=V.lane&-536870913;if(ee!==V.lane?(Ue&ee)===ee:(_a&ee)===ee){var Y=V.revertLane;if(Y===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null}),ee===Hr&&(Z=!0);else if((_a&Y)===Y){V=V.next,Y===Hr&&(Z=!0);continue}else ee={lane:0,revertLane:V.revertLane,gesture:null,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},O===null?(E=O=ee,y=d):O=O.next=ee,Ne.lanes|=Y,vl|=Y;ee=V.action,nr&&n(d,ee),d=V.hasEagerState?V.eagerState:n(d,ee)}else Y={lane:ee,revertLane:V.revertLane,gesture:V.gesture,action:V.action,hasEagerState:V.hasEagerState,eagerState:V.eagerState,next:null},O===null?(E=O=Y,y=d):O=O.next=Y,Ne.lanes|=ee,vl|=ee;V=V.next}while(V!==null&&V!==t);if(O===null?y=d:O.next=E,!dn(d,e.memoizedState)&&(jt=!0,Z&&(n=Br,n!==null)))throw n;e.memoizedState=d,e.baseState=y,e.baseQueue=O,r.lastRenderedState=d}return c===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Fu(e){var t=vt(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,c=n.pending,d=t.memoizedState;if(c!==null){n.pending=null;var y=c=c.next;do d=e(d,y.action),y=y.next;while(y!==c);dn(d,t.memoizedState)||(jt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),n.lastRenderedState=d}return[d,r]}function Tp(e,t,n){var r=Ne,c=vt(),d=Be;if(d){if(n===void 0)throw Error(i(407));n=n()}else n=t();var y=!dn((tt||c).memoizedState,n);if(y&&(c.memoizedState=n,jt=!0),c=c.queue,Wu(Mp.bind(null,r,c,e),[e]),c.getSnapshot!==t||y||wt!==null&&wt.memoizedState.tag&1){if(r.flags|=2048,Gr(9,{destroy:void 0},Ap.bind(null,r,c,n,t),null),st===null)throw Error(i(349));d||(_a&127)!==0||Np(r,t,n)}return n}function Np(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ne.updateQueue,t===null?(t=fi(),Ne.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ap(e,t,n,r){t.value=n,t.getSnapshot=r,_p(t)&&Op(e)}function Mp(e,t,n){return n(function(){_p(t)&&Op(e)})}function _p(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!dn(e,n)}catch{return!0}}function Op(e){var t=Kl(e,2);t!==null&&nn(t,e,2)}function Zu(e){var t=$t();if(typeof e=="function"){var n=e;if(e=n(),nr){Gn(!0);try{n()}finally{Gn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oa,lastRenderedState:e},t}function Dp(e,t,n,r){return e.baseState=n,Qu(e,tt,typeof r=="function"?r:Oa)}function wS(e,t,n,r,c){if(vi(e))throw Error(i(485));if(e=t.action,e!==null){var d={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(y){d.listeners.push(y)}};z.T!==null?n(!0):d.isTransition=!1,r(d),n=t.pending,n===null?(d.next=t.pending=d,zp(t,d)):(d.next=n.next,t.pending=n.next=d)}}function zp(e,t){var n=t.action,r=t.payload,c=e.state;if(t.isTransition){var d=z.T,y={};z.T=y;try{var E=n(c,r),O=z.S;O!==null&&O(y,E),kp(e,t,E)}catch(V){Ju(e,t,V)}finally{d!==null&&y.types!==null&&(d.types=y.types),z.T=d}}else try{d=n(c,r),kp(e,t,d)}catch(V){Ju(e,t,V)}}function kp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){Lp(e,t,r)},function(r){return Ju(e,t,r)}):Lp(e,t,n)}function Lp(e,t,n){t.status="fulfilled",t.value=n,Up(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,zp(e,n)))}function Ju(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,Up(t),t=t.next;while(t!==r)}e.action=null}function Up(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Hp(e,t){return t}function Bp(e,t){if(Be){var n=st.formState;if(n!==null){e:{var r=Ne;if(Be){if(ct){t:{for(var c=ct,d=Dn;c.nodeType!==8;){if(!d){c=null;break t}if(c=kn(c.nextSibling),c===null){c=null;break t}}d=c.data,c=d==="F!"||d==="F"?c:null}if(c){ct=kn(c.nextSibling),r=c.data==="F!";break e}}il(r)}r=!1}r&&(t=n[0])}}return n=$t(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hp,lastRenderedState:t},n.queue=r,n=lg.bind(null,Ne,r),r.dispatch=n,r=Zu(!1),d=ld.bind(null,Ne,!1,r.queue),r=$t(),c={state:t,dispatch:null,action:e,pending:null},r.queue=c,n=wS.bind(null,Ne,c,d,n),c.dispatch=n,r.memoizedState=e,[t,n,!1]}function Pp(e){var t=vt();return qp(t,tt,e)}function qp(e,t,n){if(t=Qu(e,t,Hp)[0],e=mi(Oa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=$o(t)}catch(y){throw y===Pr?li:y}else r=t;t=vt();var c=t.queue,d=c.dispatch;return n!==t.memoizedState&&(Ne.flags|=2048,Gr(9,{destroy:void 0},jS.bind(null,c,n),null)),[r,d,e]}function jS(e,t){e.action=t}function Vp(e){var t=vt(),n=tt;if(n!==null)return qp(t,n,e);vt(),t=t.memoizedState,n=vt();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Gr(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Ne.updateQueue,t===null&&(t=fi(),Ne.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ip(){return vt().memoizedState}function pi(e,t,n,r){var c=$t();Ne.flags|=e,c.memoizedState=Gr(1|t,{destroy:void 0},n,r===void 0?null:r)}function gi(e,t,n,r){var c=vt();r=r===void 0?null:r;var d=c.memoizedState.inst;tt!==null&&r!==null&&Iu(r,tt.memoizedState.deps)?c.memoizedState=Gr(t,d,n,r):(Ne.flags|=e,c.memoizedState=Gr(1|t,d,n,r))}function Yp(e,t){pi(8390656,8,e,t)}function Wu(e,t){gi(2048,8,e,t)}function CS(e){Ne.flags|=4;var t=Ne.updateQueue;if(t===null)t=fi(),Ne.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Gp(e){var t=vt().memoizedState;return CS({ref:t,nextImpl:e}),function(){if((Qe&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function $p(e,t){return gi(4,2,e,t)}function Kp(e,t){return gi(4,4,e,t)}function Xp(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Qp(e,t,n){n=n!=null?n.concat([e]):null,gi(4,4,Xp.bind(null,t,e),n)}function ed(){}function Fp(e,t){var n=vt();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Iu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Zp(e,t){var n=vt();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Iu(t,r[1]))return r[0];if(r=e(),nr){Gn(!0);try{e()}finally{Gn(!1)}}return n.memoizedState=[r,t],r}function td(e,t,n){return n===void 0||(_a&1073741824)!==0&&(Ue&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Jg(),Ne.lanes|=e,vl|=e,n)}function Jp(e,t,n,r){return dn(n,t)?n:Vr.current!==null?(e=td(e,n,r),dn(e,t)||(jt=!0),e):(_a&42)===0||(_a&1073741824)!==0&&(Ue&261930)===0?(jt=!0,e.memoizedState=n):(e=Jg(),Ne.lanes|=e,vl|=e,t)}function Wp(e,t,n,r,c){var d=$.p;$.p=d!==0&&8>d?d:8;var y=z.T,E={};z.T=E,ld(e,!1,t,n);try{var O=c(),V=z.S;if(V!==null&&V(E,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var Z=xS(O,r);Ko(e,t,Z,vn(e))}else Ko(e,t,r,vn(e))}catch(ee){Ko(e,t,{then:function(){},status:"rejected",reason:ee},vn())}finally{$.p=d,y!==null&&E.types!==null&&(y.types=E.types),z.T=y}}function ES(){}function nd(e,t,n,r){if(e.tag!==5)throw Error(i(476));var c=eg(e).queue;Wp(e,c,t,te,n===null?ES:function(){return tg(e),n(r)})}function eg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oa,lastRenderedState:te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Oa,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function tg(e){var t=eg(e);t.next===null&&(t=e.alternate.memoizedState),Ko(e,t.next.queue,{},vn())}function ad(){return kt(us)}function ng(){return vt().memoizedState}function ag(){return vt().memoizedState}function RS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=vn();e=dl(n);var r=fl(t,e,n);r!==null&&(nn(r,t,n),Vo(r,t,n)),t={cache:Ou()},e.payload=t;return}t=t.return}}function TS(e,t,n){var r=vn();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},vi(e)?rg(t,n):(n=Su(e,t,n,r),n!==null&&(nn(n,e,r),og(n,t,r)))}function lg(e,t,n){var r=vn();Ko(e,t,n,r)}function Ko(e,t,n,r){var c={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(vi(e))rg(t,c);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var y=t.lastRenderedState,E=d(y,n);if(c.hasEagerState=!0,c.eagerState=E,dn(E,y))return Zs(e,t,c,0),st===null&&Fs(),!1}catch{}finally{}if(n=Su(e,t,c,r),n!==null)return nn(n,e,r),og(n,t,r),!0}return!1}function ld(e,t,n,r){if(r={lane:2,revertLane:Ld(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},vi(e)){if(t)throw Error(i(479))}else t=Su(e,n,r,2),t!==null&&nn(t,e,2)}function vi(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function rg(e,t){Ir=ui=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function og(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Qt(e,n)}}var Xo={readContext:kt,use:hi,useCallback:mt,useContext:mt,useEffect:mt,useImperativeHandle:mt,useLayoutEffect:mt,useInsertionEffect:mt,useMemo:mt,useReducer:mt,useRef:mt,useState:mt,useDebugValue:mt,useDeferredValue:mt,useTransition:mt,useSyncExternalStore:mt,useId:mt,useHostTransitionStatus:mt,useFormState:mt,useActionState:mt,useOptimistic:mt,useMemoCache:mt,useCacheRefresh:mt};Xo.useEffectEvent=mt;var sg={readContext:kt,use:hi,useCallback:function(e,t){return $t().memoizedState=[e,t===void 0?null:t],e},useContext:kt,useEffect:Yp,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,pi(4194308,4,Xp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return pi(4194308,4,e,t)},useInsertionEffect:function(e,t){pi(4,2,e,t)},useMemo:function(e,t){var n=$t();t=t===void 0?null:t;var r=e();if(nr){Gn(!0);try{e()}finally{Gn(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=$t();if(n!==void 0){var c=n(t);if(nr){Gn(!0);try{n(t)}finally{Gn(!1)}}}else c=t;return r.memoizedState=r.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},r.queue=e,e=e.dispatch=TS.bind(null,Ne,e),[r.memoizedState,e]},useRef:function(e){var t=$t();return e={current:e},t.memoizedState=e},useState:function(e){e=Zu(e);var t=e.queue,n=lg.bind(null,Ne,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ed,useDeferredValue:function(e,t){var n=$t();return td(n,e,t)},useTransition:function(){var e=Zu(!1);return e=Wp.bind(null,Ne,e.queue,!0,!1),$t().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Ne,c=$t();if(Be){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),st===null)throw Error(i(349));(Ue&127)!==0||Np(r,t,n)}c.memoizedState=n;var d={value:n,getSnapshot:t};return c.queue=d,Yp(Mp.bind(null,r,d,e),[e]),r.flags|=2048,Gr(9,{destroy:void 0},Ap.bind(null,r,d,n,t),null),n},useId:function(){var e=$t(),t=st.identifierPrefix;if(Be){var n=ia,r=sa;n=(r&~(1<<32-bt(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=di++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=bS++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:ad,useFormState:Bp,useActionState:Bp,useOptimistic:function(e){var t=$t();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ld.bind(null,Ne,!0,n),n.dispatch=t,[e,t]},useMemoCache:Xu,useCacheRefresh:function(){return $t().memoizedState=RS.bind(null,Ne)},useEffectEvent:function(e){var t=$t(),n={impl:e};return t.memoizedState=n,function(){if((Qe&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},rd={readContext:kt,use:hi,useCallback:Fp,useContext:kt,useEffect:Wu,useImperativeHandle:Qp,useInsertionEffect:$p,useLayoutEffect:Kp,useMemo:Zp,useReducer:mi,useRef:Ip,useState:function(){return mi(Oa)},useDebugValue:ed,useDeferredValue:function(e,t){var n=vt();return Jp(n,tt.memoizedState,e,t)},useTransition:function(){var e=mi(Oa)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:$o(e),t]},useSyncExternalStore:Tp,useId:ng,useHostTransitionStatus:ad,useFormState:Pp,useActionState:Pp,useOptimistic:function(e,t){var n=vt();return Dp(n,tt,e,t)},useMemoCache:Xu,useCacheRefresh:ag};rd.useEffectEvent=Gp;var ig={readContext:kt,use:hi,useCallback:Fp,useContext:kt,useEffect:Wu,useImperativeHandle:Qp,useInsertionEffect:$p,useLayoutEffect:Kp,useMemo:Zp,useReducer:Fu,useRef:Ip,useState:function(){return Fu(Oa)},useDebugValue:ed,useDeferredValue:function(e,t){var n=vt();return tt===null?td(n,e,t):Jp(n,tt.memoizedState,e,t)},useTransition:function(){var e=Fu(Oa)[0],t=vt().memoizedState;return[typeof e=="boolean"?e:$o(e),t]},useSyncExternalStore:Tp,useId:ng,useHostTransitionStatus:ad,useFormState:Vp,useActionState:Vp,useOptimistic:function(e,t){var n=vt();return tt!==null?Dp(n,tt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Xu,useCacheRefresh:ag};ig.useEffectEvent=Gp;function od(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:b({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var sd={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=vn(),c=dl(r);c.payload=t,n!=null&&(c.callback=n),t=fl(e,c,r),t!==null&&(nn(t,e,r),Vo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=vn(),c=dl(r);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=fl(e,c,r),t!==null&&(nn(t,e,r),Vo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=vn(),r=dl(n);r.tag=2,t!=null&&(r.callback=t),t=fl(e,r,n),t!==null&&(nn(t,e,n),Vo(t,e,n))}};function cg(e,t,n,r,c,d,y){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,d,y):t.prototype&&t.prototype.isPureReactComponent?!zo(n,r)||!zo(c,d):!0}function ug(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&sd.enqueueReplaceState(t,t.state,null)}function ar(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=b({},n));for(var c in e)n[c]===void 0&&(n[c]=e[c])}return n}function dg(e){Qs(e)}function fg(e){console.error(e)}function hg(e){Qs(e)}function yi(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function mg(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function id(e,t,n){return n=dl(n),n.tag=3,n.payload={element:null},n.callback=function(){yi(e,t)},n}function pg(e){return e=dl(e),e.tag=3,e}function gg(e,t,n,r){var c=n.type.getDerivedStateFromError;if(typeof c=="function"){var d=r.value;e.payload=function(){return c(d)},e.callback=function(){mg(t,n,r)}}var y=n.stateNode;y!==null&&typeof y.componentDidCatch=="function"&&(e.callback=function(){mg(t,n,r),typeof c!="function"&&(yl===null?yl=new Set([this]):yl.add(this));var E=r.stack;this.componentDidCatch(r.value,{componentStack:E!==null?E:""})})}function NS(e,t,n,r,c){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&Ur(t,n,c,!0),n=hn.current,n!==null){switch(n.tag){case 31:case 13:return zn===null?Mi():n.alternate===null&&pt===0&&(pt=3),n.flags&=-257,n.flags|=65536,n.lanes=c,r===ri?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Dd(e,r,c)),!1;case 22:return n.flags|=65536,r===ri?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Dd(e,r,c)),!1}throw Error(i(435,n.tag))}return Dd(e,r,c),Mi(),!1}if(Be)return t=hn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,r!==Tu&&(e=Error(i(422),{cause:r}),Uo(Mn(e,n)))):(r!==Tu&&(t=Error(i(423),{cause:r}),Uo(Mn(t,n))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,r=Mn(r,n),c=id(e.stateNode,r,c),Hu(e,c),pt!==4&&(pt=2)),!1;var d=Error(i(520),{cause:r});if(d=Mn(d,n),ns===null?ns=[d]:ns.push(d),pt!==4&&(pt=2),t===null)return!0;r=Mn(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=c&-c,n.lanes|=e,e=id(n.stateNode,r,e),Hu(n,e),!1;case 1:if(t=n.type,d=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(yl===null||!yl.has(d))))return n.flags|=65536,c&=-c,n.lanes|=c,c=pg(c),gg(c,e,n,r),Hu(n,c),!1}n=n.return}while(n!==null);return!1}var cd=Error(i(461)),jt=!1;function Lt(e,t,n,r){t.child=e===null?bp(t,null,n,r):tr(t,e.child,n,r)}function vg(e,t,n,r,c){n=n.render;var d=t.ref;if("ref"in r){var y={};for(var E in r)E!=="ref"&&(y[E]=r[E])}else y=r;return Zl(t),r=Yu(e,t,n,y,d,c),E=Gu(),e!==null&&!jt?($u(e,t,c),Da(e,t,c)):(Be&&E&&Eu(t),t.flags|=1,Lt(e,t,r,c),t.child)}function yg(e,t,n,r,c){if(e===null){var d=n.type;return typeof d=="function"&&!wu(d)&&d.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=d,xg(e,t,d,r,c)):(e=Ws(n.type,null,r,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!vd(e,c)){var y=d.memoizedProps;if(n=n.compare,n=n!==null?n:zo,n(y,r)&&e.ref===t.ref)return Da(e,t,c)}return t.flags|=1,e=Ta(d,r),e.ref=t.ref,e.return=t,t.child=e}function xg(e,t,n,r,c){if(e!==null){var d=e.memoizedProps;if(zo(d,r)&&e.ref===t.ref)if(jt=!1,t.pendingProps=r=d,vd(e,c))(e.flags&131072)!==0&&(jt=!0);else return t.lanes=e.lanes,Da(e,t,c)}return ud(e,t,n,r,c)}function bg(e,t,n,r){var c=r.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|n:n,e!==null){for(r=t.child=e.child,c=0;r!==null;)c=c|r.lanes|r.childLanes,r=r.sibling;r=c&~d}else r=0,t.child=null;return Sg(e,t,d,n,r)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ai(t,d!==null?d.cachePool:null),d!==null?jp(t,d):Pu(),Cp(t);else return r=t.lanes=536870912,Sg(e,t,d!==null?d.baseLanes|n:n,n,r)}else d!==null?(ai(t,d.cachePool),jp(t,d),ml(),t.memoizedState=null):(e!==null&&ai(t,null),Pu(),ml());return Lt(e,t,c,n),t.child}function Qo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Sg(e,t,n,r,c){var d=zu();return d=d===null?null:{parent:St._currentValue,pool:d},t.memoizedState={baseLanes:n,cachePool:d},e!==null&&ai(t,null),Pu(),Cp(t),e!==null&&Ur(e,t,r,!0),t.childLanes=c,null}function xi(e,t){return t=Si({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function wg(e,t,n){return tr(t,e.child,null,n),e=xi(t,t.pendingProps),e.flags|=2,mn(t),t.memoizedState=null,e}function AS(e,t,n){var r=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Be){if(r.mode==="hidden")return e=xi(t,r),t.lanes=536870912,Qo(null,e);if(Vu(t),(e=ct)?(e=zv(e,Dn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ol!==null?{id:sa,overflow:ia}:null,retryLane:536870912,hydrationErrors:null},n=rp(e),n.return=t,t.child=n,zt=t,ct=null)):e=null,e===null)throw il(t);return t.lanes=536870912,null}return xi(t,r)}var d=e.memoizedState;if(d!==null){var y=d.dehydrated;if(Vu(t),c)if(t.flags&256)t.flags&=-257,t=wg(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(jt||Ur(e,t,n,!1),c=(n&e.childLanes)!==0,jt||c){if(r=st,r!==null&&(y=$n(r,n),y!==0&&y!==d.retryLane))throw d.retryLane=y,Kl(e,y),nn(r,e,y),cd;Mi(),t=wg(e,t,n)}else e=d.treeContext,ct=kn(y.nextSibling),zt=t,Be=!0,sl=null,Dn=!1,e!==null&&ip(t,e),t=xi(t,r),t.flags|=4096;return t}return e=Ta(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function bi(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function ud(e,t,n,r,c){return Zl(t),n=Yu(e,t,n,r,void 0,c),r=Gu(),e!==null&&!jt?($u(e,t,c),Da(e,t,c)):(Be&&r&&Eu(t),t.flags|=1,Lt(e,t,n,c),t.child)}function jg(e,t,n,r,c,d){return Zl(t),t.updateQueue=null,n=Rp(t,r,n,c),Ep(e),r=Gu(),e!==null&&!jt?($u(e,t,d),Da(e,t,d)):(Be&&r&&Eu(t),t.flags|=1,Lt(e,t,n,d),t.child)}function Cg(e,t,n,r,c){if(Zl(t),t.stateNode===null){var d=Dr,y=n.contextType;typeof y=="object"&&y!==null&&(d=kt(y)),d=new n(r,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=sd,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=r,d.state=t.memoizedState,d.refs={},Lu(t),y=n.contextType,d.context=typeof y=="object"&&y!==null?kt(y):Dr,d.state=t.memoizedState,y=n.getDerivedStateFromProps,typeof y=="function"&&(od(t,n,y,r),d.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(y=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),y!==d.state&&sd.enqueueReplaceState(d,d.state,null),Yo(t,r,d,c),Io(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){d=t.stateNode;var E=t.memoizedProps,O=ar(n,E);d.props=O;var V=d.context,Z=n.contextType;y=Dr,typeof Z=="object"&&Z!==null&&(y=kt(Z));var ee=n.getDerivedStateFromProps;Z=typeof ee=="function"||typeof d.getSnapshotBeforeUpdate=="function",E=t.pendingProps!==E,Z||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(E||V!==y)&&ug(t,d,r,y),ul=!1;var Y=t.memoizedState;d.state=Y,Yo(t,r,d,c),Io(),V=t.memoizedState,E||Y!==V||ul?(typeof ee=="function"&&(od(t,n,ee,r),V=t.memoizedState),(O=ul||cg(t,n,O,r,Y,V,y))?(Z||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=V),d.props=r,d.state=V,d.context=y,r=O):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{d=t.stateNode,Uu(e,t),y=t.memoizedProps,Z=ar(n,y),d.props=Z,ee=t.pendingProps,Y=d.context,V=n.contextType,O=Dr,typeof V=="object"&&V!==null&&(O=kt(V)),E=n.getDerivedStateFromProps,(V=typeof E=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(y!==ee||Y!==O)&&ug(t,d,r,O),ul=!1,Y=t.memoizedState,d.state=Y,Yo(t,r,d,c),Io();var K=t.memoizedState;y!==ee||Y!==K||ul||e!==null&&e.dependencies!==null&&ti(e.dependencies)?(typeof E=="function"&&(od(t,n,E,r),K=t.memoizedState),(Z=ul||cg(t,n,Z,r,Y,K,O)||e!==null&&e.dependencies!==null&&ti(e.dependencies))?(V||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(r,K,O),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(r,K,O)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||y===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=K),d.props=r,d.state=K,d.context=O,r=Z):(typeof d.componentDidUpdate!="function"||y===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),r=!1)}return d=r,bi(e,t),r=(t.flags&128)!==0,d||r?(d=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&r?(t.child=tr(t,e.child,null,c),t.child=tr(t,null,n,c)):Lt(e,t,n,c),t.memoizedState=d.state,e=t.child):e=Da(e,t,c),e}function Eg(e,t,n,r){return Ql(),t.flags|=256,Lt(e,t,n,r),t.child}var dd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function fd(e){return{baseLanes:e,cachePool:mp()}}function hd(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=gn),e}function Rg(e,t,n){var r=t.pendingProps,c=!1,d=(t.flags&128)!==0,y;if((y=d)||(y=e!==null&&e.memoizedState===null?!1:(gt.current&2)!==0),y&&(c=!0,t.flags&=-129),y=(t.flags&32)!==0,t.flags&=-33,e===null){if(Be){if(c?hl(t):ml(),(e=ct)?(e=zv(e,Dn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ol!==null?{id:sa,overflow:ia}:null,retryLane:536870912,hydrationErrors:null},n=rp(e),n.return=t,t.child=n,zt=t,ct=null)):e=null,e===null)throw il(t);return Qd(e)?t.lanes=32:t.lanes=536870912,null}var E=r.children;return r=r.fallback,c?(ml(),c=t.mode,E=Si({mode:"hidden",children:E},c),r=Xl(r,c,n,null),E.return=t,r.return=t,E.sibling=r,t.child=E,r=t.child,r.memoizedState=fd(n),r.childLanes=hd(e,y,n),t.memoizedState=dd,Qo(null,r)):(hl(t),md(t,E))}var O=e.memoizedState;if(O!==null&&(E=O.dehydrated,E!==null)){if(d)t.flags&256?(hl(t),t.flags&=-257,t=pd(e,t,n)):t.memoizedState!==null?(ml(),t.child=e.child,t.flags|=128,t=null):(ml(),E=r.fallback,c=t.mode,r=Si({mode:"visible",children:r.children},c),E=Xl(E,c,n,null),E.flags|=2,r.return=t,E.return=t,r.sibling=E,t.child=r,tr(t,e.child,null,n),r=t.child,r.memoizedState=fd(n),r.childLanes=hd(e,y,n),t.memoizedState=dd,t=Qo(null,r));else if(hl(t),Qd(E)){if(y=E.nextSibling&&E.nextSibling.dataset,y)var V=y.dgst;y=V,r=Error(i(419)),r.stack="",r.digest=y,Uo({value:r,source:null,stack:null}),t=pd(e,t,n)}else if(jt||Ur(e,t,n,!1),y=(n&e.childLanes)!==0,jt||y){if(y=st,y!==null&&(r=$n(y,n),r!==0&&r!==O.retryLane))throw O.retryLane=r,Kl(e,r),nn(y,e,r),cd;Xd(E)||Mi(),t=pd(e,t,n)}else Xd(E)?(t.flags|=192,t.child=e.child,t=null):(e=O.treeContext,ct=kn(E.nextSibling),zt=t,Be=!0,sl=null,Dn=!1,e!==null&&ip(t,e),t=md(t,r.children),t.flags|=4096);return t}return c?(ml(),E=r.fallback,c=t.mode,O=e.child,V=O.sibling,r=Ta(O,{mode:"hidden",children:r.children}),r.subtreeFlags=O.subtreeFlags&65011712,V!==null?E=Ta(V,E):(E=Xl(E,c,n,null),E.flags|=2),E.return=t,r.return=t,r.sibling=E,t.child=r,Qo(null,r),r=t.child,E=e.child.memoizedState,E===null?E=fd(n):(c=E.cachePool,c!==null?(O=St._currentValue,c=c.parent!==O?{parent:O,pool:O}:c):c=mp(),E={baseLanes:E.baseLanes|n,cachePool:c}),r.memoizedState=E,r.childLanes=hd(e,y,n),t.memoizedState=dd,Qo(e.child,r)):(hl(t),n=e.child,e=n.sibling,n=Ta(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(y=t.deletions,y===null?(t.deletions=[e],t.flags|=16):y.push(e)),t.child=n,t.memoizedState=null,n)}function md(e,t){return t=Si({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Si(e,t){return e=fn(22,e,null,t),e.lanes=0,e}function pd(e,t,n){return tr(t,e.child,null,n),e=md(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Tg(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Mu(e.return,t,n)}function gd(e,t,n,r,c,d){var y=e.memoizedState;y===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:c,treeForkCount:d}:(y.isBackwards=t,y.rendering=null,y.renderingStartTime=0,y.last=r,y.tail=n,y.tailMode=c,y.treeForkCount=d)}function Ng(e,t,n){var r=t.pendingProps,c=r.revealOrder,d=r.tail;r=r.children;var y=gt.current,E=(y&2)!==0;if(E?(y=y&1|2,t.flags|=128):y&=1,F(gt,y),Lt(e,t,r,n),r=Be?Lo:0,!E&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Tg(e,n,t);else if(e.tag===19)Tg(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(n=t.child,c=null;n!==null;)e=n.alternate,e!==null&&ci(e)===null&&(c=n),n=n.sibling;n=c,n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null),gd(t,!1,c,n,d,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&ci(e)===null){t.child=c;break}e=c.sibling,c.sibling=n,n=c,c=e}gd(t,!0,n,null,d,r);break;case"together":gd(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Da(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),vl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ur(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Ta(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ta(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function vd(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ti(e)))}function MS(e,t,n){switch(t.tag){case 3:ie(t,t.stateNode.containerInfo),cl(t,St,e.memoizedState.cache),Ql();break;case 27:case 5:De(t);break;case 4:ie(t,t.stateNode.containerInfo);break;case 10:cl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Vu(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(hl(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Rg(e,t,n):(hl(t),e=Da(e,t,n),e!==null?e.sibling:null);hl(t);break;case 19:var c=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(Ur(e,t,n,!1),r=(n&t.childLanes)!==0),c){if(r)return Ng(e,t,n);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),F(gt,gt.current),r)break;return null;case 22:return t.lanes=0,bg(e,t,n,t.pendingProps);case 24:cl(t,St,e.memoizedState.cache)}return Da(e,t,n)}function Ag(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)jt=!0;else{if(!vd(e,n)&&(t.flags&128)===0)return jt=!1,MS(e,t,n);jt=(e.flags&131072)!==0}else jt=!1,Be&&(t.flags&1048576)!==0&&sp(t,Lo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Wl(t.elementType),t.type=e,typeof e=="function")wu(e)?(r=ar(e,r),t.tag=1,t=Cg(null,t,e,r,n)):(t.tag=0,t=ud(null,t,e,r,n));else{if(e!=null){var c=e.$$typeof;if(c===_){t.tag=11,t=vg(null,t,e,r,n);break e}else if(c===I){t.tag=14,t=yg(null,t,e,r,n);break e}}throw t=le(e)||e,Error(i(306,t,""))}}return t;case 0:return ud(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,c=ar(r,t.pendingProps),Cg(e,t,r,c,n);case 3:e:{if(ie(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var d=t.memoizedState;c=d.element,Uu(e,t),Yo(t,r,null,n);var y=t.memoizedState;if(r=y.cache,cl(t,St,r),r!==d.cache&&_u(t,[St],n,!0),Io(),r=y.element,d.isDehydrated)if(d={element:r,isDehydrated:!1,cache:y.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Eg(e,t,r,n);break e}else if(r!==c){c=Mn(Error(i(424)),t),Uo(c),t=Eg(e,t,r,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ct=kn(e.firstChild),zt=t,Be=!0,sl=null,Dn=!0,n=bp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ql(),r===c){t=Da(e,t,n);break e}Lt(e,t,r,n)}t=t.child}return t;case 26:return bi(e,t),e===null?(n=Pv(t.type,null,t.pendingProps,null))?t.memoizedState=n:Be||(n=t.type,e=t.pendingProps,r=Ui(J.current).createElement(n),r[Dt]=t,r[Ft]=e,Ut(r,n,e),Nt(r),t.stateNode=r):t.memoizedState=Pv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return De(t),e===null&&Be&&(r=t.stateNode=Uv(t.type,t.pendingProps,J.current),zt=t,Dn=!0,c=ct,wl(t.type)?(Fd=c,ct=kn(r.firstChild)):ct=c),Lt(e,t,t.pendingProps.children,n),bi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Be&&((c=r=ct)&&(r=ow(r,t.type,t.pendingProps,Dn),r!==null?(t.stateNode=r,zt=t,ct=kn(r.firstChild),Dn=!1,c=!0):c=!1),c||il(t)),De(t),c=t.type,d=t.pendingProps,y=e!==null?e.memoizedProps:null,r=d.children,Gd(c,d)?r=null:y!==null&&Gd(c,y)&&(t.flags|=32),t.memoizedState!==null&&(c=Yu(e,t,SS,null,null,n),us._currentValue=c),bi(e,t),Lt(e,t,r,n),t.child;case 6:return e===null&&Be&&((e=n=ct)&&(n=sw(n,t.pendingProps,Dn),n!==null?(t.stateNode=n,zt=t,ct=null,e=!0):e=!1),e||il(t)),null;case 13:return Rg(e,t,n);case 4:return ie(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=tr(t,null,r,n):Lt(e,t,r,n),t.child;case 11:return vg(e,t,t.type,t.pendingProps,n);case 7:return Lt(e,t,t.pendingProps,n),t.child;case 8:return Lt(e,t,t.pendingProps.children,n),t.child;case 12:return Lt(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,cl(t,t.type,r.value),Lt(e,t,r.children,n),t.child;case 9:return c=t.type._context,r=t.pendingProps.children,Zl(t),c=kt(c),r=r(c),t.flags|=1,Lt(e,t,r,n),t.child;case 14:return yg(e,t,t.type,t.pendingProps,n);case 15:return xg(e,t,t.type,t.pendingProps,n);case 19:return Ng(e,t,n);case 31:return AS(e,t,n);case 22:return bg(e,t,n,t.pendingProps);case 24:return Zl(t),r=kt(St),e===null?(c=zu(),c===null&&(c=st,d=Ou(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=n),c=d),t.memoizedState={parent:r,cache:c},Lu(t),cl(t,St,c)):((e.lanes&n)!==0&&(Uu(e,t),Yo(t,null,null,n),Io()),c=e.memoizedState,d=t.memoizedState,c.parent!==r?(c={parent:r,cache:r},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),cl(t,St,r)):(r=d.cache,cl(t,St,r),r!==c.cache&&_u(t,[St],n,!0))),Lt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function za(e){e.flags|=4}function yd(e,t,n,r,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(nv())e.flags|=8192;else throw er=ri,ku}else e.flags&=-16777217}function Mg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Gv(t))if(nv())e.flags|=8192;else throw er=ri,ku}function wi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?ot():536870912,e.lanes|=t,Qr|=t)}function Fo(e,t){if(!Be)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ut(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var c=e.child;c!==null;)n|=c.lanes|c.childLanes,r|=c.subtreeFlags&65011712,r|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)n|=c.lanes|c.childLanes,r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function _S(e,t,n){var r=t.pendingProps;switch(Ru(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(t),null;case 1:return ut(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ma(St),me(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Lr(t)?za(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Nu())),ut(t),null;case 26:var c=t.type,d=t.memoizedState;return e===null?(za(t),d!==null?(ut(t),Mg(t,d)):(ut(t),yd(t,c,null,r,n))):d?d!==e.memoizedState?(za(t),ut(t),Mg(t,d)):(ut(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&za(t),ut(t),yd(t,c,e,r,n)),null;case 27:if(_e(t),n=J.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&za(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ut(t),null}e=ae.current,Lr(t)?cp(t):(e=Uv(c,r,n),t.stateNode=e,za(t))}return ut(t),null;case 5:if(_e(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&za(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ut(t),null}if(d=ae.current,Lr(t))cp(t);else{var y=Ui(J.current);switch(d){case 1:d=y.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:d=y.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":d=y.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":d=y.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":d=y.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof r.is=="string"?y.createElement("select",{is:r.is}):y.createElement("select"),r.multiple?d.multiple=!0:r.size&&(d.size=r.size);break;default:d=typeof r.is=="string"?y.createElement(c,{is:r.is}):y.createElement(c)}}d[Dt]=t,d[Ft]=r;e:for(y=t.child;y!==null;){if(y.tag===5||y.tag===6)d.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===t)break e;for(;y.sibling===null;){if(y.return===null||y.return===t)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}t.stateNode=d;e:switch(Ut(d,c,r),c){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&za(t)}}return ut(t),yd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&za(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(i(166));if(e=J.current,Lr(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,c=zt,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}e[Dt]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||Rv(e.nodeValue,n)),e||il(t,!0)}else e=Ui(e).createTextNode(r),e[Dt]=t,t.stateNode=e}return ut(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Lr(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[Dt]=t}else Ql(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ut(t),e=!1}else n=Nu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(mn(t),t):(mn(t),null);if((t.flags&128)!==0)throw Error(i(558))}return ut(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Lr(t),r!==null&&r.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[Dt]=t}else Ql(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ut(t),c=!1}else c=Nu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(mn(t),t):(mn(t),null)}return mn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,c=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(c=r.alternate.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==c&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),wi(t,t.updateQueue),ut(t),null);case 4:return me(),e===null&&Pd(t.stateNode.containerInfo),ut(t),null;case 10:return Ma(t.type),ut(t),null;case 19:if(B(gt),r=t.memoizedState,r===null)return ut(t),null;if(c=(t.flags&128)!==0,d=r.rendering,d===null)if(c)Fo(r,!1);else{if(pt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=ci(e),d!==null){for(t.flags|=128,Fo(r,!1),e=d.updateQueue,t.updateQueue=e,wi(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)lp(n,e),n=n.sibling;return F(gt,gt.current&1|2),Be&&Na(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&It()>Ti&&(t.flags|=128,c=!0,Fo(r,!1),t.lanes=4194304)}else{if(!c)if(e=ci(d),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,wi(t,e),Fo(r,!0),r.tail===null&&r.tailMode==="hidden"&&!d.alternate&&!Be)return ut(t),null}else 2*It()-r.renderingStartTime>Ti&&n!==536870912&&(t.flags|=128,c=!0,Fo(r,!1),t.lanes=4194304);r.isBackwards?(d.sibling=t.child,t.child=d):(e=r.last,e!==null?e.sibling=d:t.child=d,r.last=d)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=It(),e.sibling=null,n=gt.current,F(gt,c?n&1|2:n&1),Be&&Na(t,r.treeForkCount),e):(ut(t),null);case 22:case 23:return mn(t),qu(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(n&536870912)!==0&&(t.flags&128)===0&&(ut(t),t.subtreeFlags&6&&(t.flags|=8192)):ut(t),n=t.updateQueue,n!==null&&wi(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&B(Jl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ma(St),ut(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function OS(e,t){switch(Ru(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ma(St),me(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(mn(t),t.alternate===null)throw Error(i(340));Ql()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(mn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ql()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(gt),null;case 4:return me(),null;case 10:return Ma(t.type),null;case 22:case 23:return mn(t),qu(),e!==null&&B(Jl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ma(St),null;case 25:return null;default:return null}}function _g(e,t){switch(Ru(t),t.tag){case 3:Ma(St),me();break;case 26:case 27:case 5:_e(t);break;case 4:me();break;case 31:t.memoizedState!==null&&mn(t);break;case 13:mn(t);break;case 19:B(gt);break;case 10:Ma(t.type);break;case 22:case 23:mn(t),qu(),e!==null&&B(Jl);break;case 24:Ma(St)}}function Zo(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var c=r.next;n=c;do{if((n.tag&e)===e){r=void 0;var d=n.create,y=n.inst;r=d(),y.destroy=r}n=n.next}while(n!==c)}}catch(E){We(t,t.return,E)}}function pl(e,t,n){try{var r=t.updateQueue,c=r!==null?r.lastEffect:null;if(c!==null){var d=c.next;r=d;do{if((r.tag&e)===e){var y=r.inst,E=y.destroy;if(E!==void 0){y.destroy=void 0,c=t;var O=n,V=E;try{V()}catch(Z){We(c,O,Z)}}}r=r.next}while(r!==d)}}catch(Z){We(t,t.return,Z)}}function Og(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{wp(t,n)}catch(r){We(e,e.return,r)}}}function Dg(e,t,n){n.props=ar(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){We(e,t,r)}}function Jo(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(c){We(e,t,c)}}function ca(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(c){We(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(c){We(e,t,c)}else n.current=null}function zg(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(c){We(e,e.return,c)}}function xd(e,t,n){try{var r=e.stateNode;ew(r,e.type,n,t),r[Ft]=t}catch(c){We(e,e.return,c)}}function kg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&wl(e.type)||e.tag===4}function bd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||kg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&wl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Sd(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ea));else if(r!==4&&(r===27&&wl(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Sd(e,t,n),e=e.sibling;e!==null;)Sd(e,t,n),e=e.sibling}function ji(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&wl(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ji(e,t,n),e=e.sibling;e!==null;)ji(e,t,n),e=e.sibling}function Lg(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);Ut(t,r,n),t[Dt]=e,t[Ft]=n}catch(d){We(e,e.return,d)}}var ka=!1,Ct=!1,wd=!1,Ug=typeof WeakSet=="function"?WeakSet:Set,At=null;function DS(e,t){if(e=e.containerInfo,Id=Yi,e=Qm(e),pu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var c=r.anchorOffset,d=r.focusNode;r=r.focusOffset;try{n.nodeType,d.nodeType}catch{n=null;break e}var y=0,E=-1,O=-1,V=0,Z=0,ee=e,Y=null;t:for(;;){for(var K;ee!==n||c!==0&&ee.nodeType!==3||(E=y+c),ee!==d||r!==0&&ee.nodeType!==3||(O=y+r),ee.nodeType===3&&(y+=ee.nodeValue.length),(K=ee.firstChild)!==null;)Y=ee,ee=K;for(;;){if(ee===e)break t;if(Y===n&&++V===c&&(E=y),Y===d&&++Z===r&&(O=y),(K=ee.nextSibling)!==null)break;ee=Y,Y=ee.parentNode}ee=K}n=E===-1||O===-1?null:{start:E,end:O}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yd={focusedElem:e,selectionRange:n},Yi=!1,At=t;At!==null;)if(t=At,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,At=e;else for(;At!==null;){switch(t=At,d=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)c=e[n],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,n=t,c=d.memoizedProps,d=d.memoizedState,r=n.stateNode;try{var pe=ar(n.type,c);e=r.getSnapshotBeforeUpdate(pe,d),r.__reactInternalSnapshotBeforeUpdate=e}catch(je){We(n,n.return,je)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Kd(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Kd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,At=e;break}At=t.return}}function Hg(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ua(e,n),r&4&&Zo(5,n);break;case 1:if(Ua(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(y){We(n,n.return,y)}else{var c=ar(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(y){We(n,n.return,y)}}r&64&&Og(n),r&512&&Jo(n,n.return);break;case 3:if(Ua(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{wp(e,t)}catch(y){We(n,n.return,y)}}break;case 27:t===null&&r&4&&Lg(n);case 26:case 5:Ua(e,n),t===null&&r&4&&zg(n),r&512&&Jo(n,n.return);break;case 12:Ua(e,n);break;case 31:Ua(e,n),r&4&&qg(e,n);break;case 13:Ua(e,n),r&4&&Vg(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=VS.bind(null,n),iw(e,n))));break;case 22:if(r=n.memoizedState!==null||ka,!r){t=t!==null&&t.memoizedState!==null||Ct,c=ka;var d=Ct;ka=r,(Ct=t)&&!d?Ha(e,n,(n.subtreeFlags&8772)!==0):Ua(e,n),ka=c,Ct=d}break;case 30:break;default:Ua(e,n)}}function Bg(e){var t=e.alternate;t!==null&&(e.alternate=null,Bg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Jc(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ft=null,Jt=!1;function La(e,t,n){for(n=n.child;n!==null;)Pg(e,t,n),n=n.sibling}function Pg(e,t,n){if(xt&&typeof xt.onCommitFiberUnmount=="function")try{xt.onCommitFiberUnmount(ja,n)}catch{}switch(n.tag){case 26:Ct||ca(n,t),La(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ct||ca(n,t);var r=ft,c=Jt;wl(n.type)&&(ft=n.stateNode,Jt=!1),La(e,t,n),ss(n.stateNode),ft=r,Jt=c;break;case 5:Ct||ca(n,t);case 6:if(r=ft,c=Jt,ft=null,La(e,t,n),ft=r,Jt=c,ft!==null)if(Jt)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(n.stateNode)}catch(d){We(n,t,d)}else try{ft.removeChild(n.stateNode)}catch(d){We(n,t,d)}break;case 18:ft!==null&&(Jt?(e=ft,Ov(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ao(e)):Ov(ft,n.stateNode));break;case 4:r=ft,c=Jt,ft=n.stateNode.containerInfo,Jt=!0,La(e,t,n),ft=r,Jt=c;break;case 0:case 11:case 14:case 15:pl(2,n,t),Ct||pl(4,n,t),La(e,t,n);break;case 1:Ct||(ca(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&Dg(n,t,r)),La(e,t,n);break;case 21:La(e,t,n);break;case 22:Ct=(r=Ct)||n.memoizedState!==null,La(e,t,n),Ct=r;break;default:La(e,t,n)}}function qg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ao(e)}catch(n){We(t,t.return,n)}}}function Vg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ao(e)}catch(n){We(t,t.return,n)}}function zS(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ug),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ug),t;default:throw Error(i(435,e.tag))}}function Ci(e,t){var n=zS(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var c=IS.bind(null,e,r);r.then(c,c)}})}function Wt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var c=n[r],d=e,y=t,E=y;e:for(;E!==null;){switch(E.tag){case 27:if(wl(E.type)){ft=E.stateNode,Jt=!1;break e}break;case 5:ft=E.stateNode,Jt=!1;break e;case 3:case 4:ft=E.stateNode.containerInfo,Jt=!0;break e}E=E.return}if(ft===null)throw Error(i(160));Pg(d,y,c),ft=null,Jt=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ig(t,e),t=t.sibling}var Xn=null;function Ig(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Wt(t,e),en(e),r&4&&(pl(3,e,e.return),Zo(3,e),pl(5,e,e.return));break;case 1:Wt(t,e),en(e),r&512&&(Ct||n===null||ca(n,n.return)),r&64&&ka&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var c=Xn;if(Wt(t,e),en(e),r&512&&(Ct||n===null||ca(n,n.return)),r&4){var d=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,c=c.ownerDocument||c;t:switch(r){case"title":d=c.getElementsByTagName("title")[0],(!d||d[Eo]||d[Dt]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(r),c.head.insertBefore(d,c.querySelector("head > title"))),Ut(d,r,n),d[Dt]=e,Nt(d),r=d;break e;case"link":var y=Iv("link","href",c).get(r+(n.href||""));if(y){for(var E=0;E<y.length;E++)if(d=y[E],d.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&d.getAttribute("rel")===(n.rel==null?null:n.rel)&&d.getAttribute("title")===(n.title==null?null:n.title)&&d.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){y.splice(E,1);break t}}d=c.createElement(r),Ut(d,r,n),c.head.appendChild(d);break;case"meta":if(y=Iv("meta","content",c).get(r+(n.content||""))){for(E=0;E<y.length;E++)if(d=y[E],d.getAttribute("content")===(n.content==null?null:""+n.content)&&d.getAttribute("name")===(n.name==null?null:n.name)&&d.getAttribute("property")===(n.property==null?null:n.property)&&d.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&d.getAttribute("charset")===(n.charSet==null?null:n.charSet)){y.splice(E,1);break t}}d=c.createElement(r),Ut(d,r,n),c.head.appendChild(d);break;default:throw Error(i(468,r))}d[Dt]=e,Nt(d),r=d}e.stateNode=r}else Yv(c,e.type,e.stateNode);else e.stateNode=Vv(c,r,e.memoizedProps);else d!==r?(d===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):d.count--,r===null?Yv(c,e.type,e.stateNode):Vv(c,r,e.memoizedProps)):r===null&&e.stateNode!==null&&xd(e,e.memoizedProps,n.memoizedProps)}break;case 27:Wt(t,e),en(e),r&512&&(Ct||n===null||ca(n,n.return)),n!==null&&r&4&&xd(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Wt(t,e),en(e),r&512&&(Ct||n===null||ca(n,n.return)),e.flags&32){c=e.stateNode;try{Rr(c,"")}catch(pe){We(e,e.return,pe)}}r&4&&e.stateNode!=null&&(c=e.memoizedProps,xd(e,c,n!==null?n.memoizedProps:c)),r&1024&&(wd=!0);break;case 6:if(Wt(t,e),en(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(pe){We(e,e.return,pe)}}break;case 3:if(Pi=null,c=Xn,Xn=Hi(t.containerInfo),Wt(t,e),Xn=c,en(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ao(t.containerInfo)}catch(pe){We(e,e.return,pe)}wd&&(wd=!1,Yg(e));break;case 4:r=Xn,Xn=Hi(e.stateNode.containerInfo),Wt(t,e),en(e),Xn=r;break;case 12:Wt(t,e),en(e);break;case 31:Wt(t,e),en(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ci(e,r)));break;case 13:Wt(t,e),en(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ri=It()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ci(e,r)));break;case 22:c=e.memoizedState!==null;var O=n!==null&&n.memoizedState!==null,V=ka,Z=Ct;if(ka=V||c,Ct=Z||O,Wt(t,e),Ct=Z,ka=V,en(e),r&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(n===null||O||ka||Ct||lr(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){O=n=t;try{if(d=O.stateNode,c)y=d.style,typeof y.setProperty=="function"?y.setProperty("display","none","important"):y.display="none";else{E=O.stateNode;var ee=O.memoizedProps.style,Y=ee!=null&&ee.hasOwnProperty("display")?ee.display:null;E.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(pe){We(O,O.return,pe)}}}else if(t.tag===6){if(n===null){O=t;try{O.stateNode.nodeValue=c?"":O.memoizedProps}catch(pe){We(O,O.return,pe)}}}else if(t.tag===18){if(n===null){O=t;try{var K=O.stateNode;c?Dv(K,!0):Dv(O.stateNode,!1)}catch(pe){We(O,O.return,pe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Ci(e,n))));break;case 19:Wt(t,e),en(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ci(e,r)));break;case 30:break;case 21:break;default:Wt(t,e),en(e)}}function en(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(kg(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode,d=bd(e);ji(e,d,c);break;case 5:var y=n.stateNode;n.flags&32&&(Rr(y,""),n.flags&=-33);var E=bd(e);ji(e,E,y);break;case 3:case 4:var O=n.stateNode.containerInfo,V=bd(e);Sd(e,V,O);break;default:throw Error(i(161))}}catch(Z){We(e,e.return,Z)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Yg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Yg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ua(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Hg(e,t.alternate,t),t=t.sibling}function lr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:pl(4,t,t.return),lr(t);break;case 1:ca(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Dg(t,t.return,n),lr(t);break;case 27:ss(t.stateNode);case 26:case 5:ca(t,t.return),lr(t);break;case 22:t.memoizedState===null&&lr(t);break;case 30:lr(t);break;default:lr(t)}e=e.sibling}}function Ha(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,c=e,d=t,y=d.flags;switch(d.tag){case 0:case 11:case 15:Ha(c,d,n),Zo(4,d);break;case 1:if(Ha(c,d,n),r=d,c=r.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(V){We(r,r.return,V)}if(r=d,c=r.updateQueue,c!==null){var E=r.stateNode;try{var O=c.shared.hiddenCallbacks;if(O!==null)for(c.shared.hiddenCallbacks=null,c=0;c<O.length;c++)Sp(O[c],E)}catch(V){We(r,r.return,V)}}n&&y&64&&Og(d),Jo(d,d.return);break;case 27:Lg(d);case 26:case 5:Ha(c,d,n),n&&r===null&&y&4&&zg(d),Jo(d,d.return);break;case 12:Ha(c,d,n);break;case 31:Ha(c,d,n),n&&y&4&&qg(c,d);break;case 13:Ha(c,d,n),n&&y&4&&Vg(c,d);break;case 22:d.memoizedState===null&&Ha(c,d,n),Jo(d,d.return);break;case 30:break;default:Ha(c,d,n)}t=t.sibling}}function jd(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ho(n))}function Cd(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ho(e))}function Qn(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Gg(e,t,n,r),t=t.sibling}function Gg(e,t,n,r){var c=t.flags;switch(t.tag){case 0:case 11:case 15:Qn(e,t,n,r),c&2048&&Zo(9,t);break;case 1:Qn(e,t,n,r);break;case 3:Qn(e,t,n,r),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ho(e)));break;case 12:if(c&2048){Qn(e,t,n,r),e=t.stateNode;try{var d=t.memoizedProps,y=d.id,E=d.onPostCommit;typeof E=="function"&&E(y,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(O){We(t,t.return,O)}}else Qn(e,t,n,r);break;case 31:Qn(e,t,n,r);break;case 13:Qn(e,t,n,r);break;case 23:break;case 22:d=t.stateNode,y=t.alternate,t.memoizedState!==null?d._visibility&2?Qn(e,t,n,r):Wo(e,t):d._visibility&2?Qn(e,t,n,r):(d._visibility|=2,$r(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),c&2048&&jd(y,t);break;case 24:Qn(e,t,n,r),c&2048&&Cd(t.alternate,t);break;default:Qn(e,t,n,r)}}function $r(e,t,n,r,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,y=t,E=n,O=r,V=y.flags;switch(y.tag){case 0:case 11:case 15:$r(d,y,E,O,c),Zo(8,y);break;case 23:break;case 22:var Z=y.stateNode;y.memoizedState!==null?Z._visibility&2?$r(d,y,E,O,c):Wo(d,y):(Z._visibility|=2,$r(d,y,E,O,c)),c&&V&2048&&jd(y.alternate,y);break;case 24:$r(d,y,E,O,c),c&&V&2048&&Cd(y.alternate,y);break;default:$r(d,y,E,O,c)}t=t.sibling}}function Wo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,c=r.flags;switch(r.tag){case 22:Wo(n,r),c&2048&&jd(r.alternate,r);break;case 24:Wo(n,r),c&2048&&Cd(r.alternate,r);break;default:Wo(n,r)}t=t.sibling}}var es=8192;function Kr(e,t,n){if(e.subtreeFlags&es)for(e=e.child;e!==null;)$g(e,t,n),e=e.sibling}function $g(e,t,n){switch(e.tag){case 26:Kr(e,t,n),e.flags&es&&e.memoizedState!==null&&bw(n,Xn,e.memoizedState,e.memoizedProps);break;case 5:Kr(e,t,n);break;case 3:case 4:var r=Xn;Xn=Hi(e.stateNode.containerInfo),Kr(e,t,n),Xn=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=es,es=16777216,Kr(e,t,n),es=r):Kr(e,t,n));break;default:Kr(e,t,n)}}function Kg(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ts(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];At=r,Qg(r,e)}Kg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Xg(e),e=e.sibling}function Xg(e){switch(e.tag){case 0:case 11:case 15:ts(e),e.flags&2048&&pl(9,e,e.return);break;case 3:ts(e);break;case 12:ts(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ei(e)):ts(e);break;default:ts(e)}}function Ei(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];At=r,Qg(r,e)}Kg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:pl(8,t,t.return),Ei(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ei(t));break;default:Ei(t)}e=e.sibling}}function Qg(e,t){for(;At!==null;){var n=At;switch(n.tag){case 0:case 11:case 15:pl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ho(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,At=r;else e:for(n=e;At!==null;){r=At;var c=r.sibling,d=r.return;if(Bg(r),r===n){At=null;break e}if(c!==null){c.return=d,At=c;break e}At=d}}}var kS={getCacheForType:function(e){var t=kt(St),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return kt(St).controller.signal}},LS=typeof WeakMap=="function"?WeakMap:Map,Qe=0,st=null,ze=null,Ue=0,Je=0,pn=null,gl=!1,Xr=!1,Ed=!1,Ba=0,pt=0,vl=0,rr=0,Rd=0,gn=0,Qr=0,ns=null,tn=null,Td=!1,Ri=0,Fg=0,Ti=1/0,Ni=null,yl=null,Rt=0,xl=null,Fr=null,Pa=0,Nd=0,Ad=null,Zg=null,as=0,Md=null;function vn(){return(Qe&2)!==0&&Ue!==0?Ue&-Ue:z.T!==null?Ld():hm()}function Jg(){if(gn===0)if((Ue&536870912)===0||Be){var e=yr;yr<<=1,(yr&3932160)===0&&(yr=262144),gn=e}else gn=536870912;return e=hn.current,e!==null&&(e.flags|=32),gn}function nn(e,t,n){(e===st&&(Je===2||Je===9)||e.cancelPendingCommit!==null)&&(Zr(e,0),bl(e,Ue,gn,!1)),Ot(e,n),((Qe&2)===0||e!==st)&&(e===st&&((Qe&2)===0&&(rr|=n),pt===4&&bl(e,Ue,gn,!1)),ua(e))}function Wg(e,t,n){if((Qe&6)!==0)throw Error(i(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Ee(e,t),c=r?BS(e,t):Od(e,t,!0),d=r;do{if(c===0){Xr&&!r&&bl(e,t,0,!1);break}else{if(n=e.current.alternate,d&&!US(n)){c=Od(e,t,!1),d=!1;continue}if(c===2){if(d=t,e.errorRecoveryDisabledLanes&d)var y=0;else y=e.pendingLanes&-536870913,y=y!==0?y:y&536870912?536870912:0;if(y!==0){t=y;e:{var E=e;c=ns;var O=E.current.memoizedState.isDehydrated;if(O&&(Zr(E,y).flags|=256),y=Od(E,y,!1),y!==2){if(Ed&&!O){E.errorRecoveryDisabledLanes|=d,rr|=d,c=4;break e}d=tn,tn=c,d!==null&&(tn===null?tn=d:tn.push.apply(tn,d))}c=y}if(d=!1,c!==2)continue}}if(c===1){Zr(e,0),bl(e,t,0,!0);break}e:{switch(r=e,d=c,d){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:bl(r,t,gn,!gl);break e;case 2:tn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=Ri+300-It(),10<c)){if(bl(r,t,gn,!gl),xr(r,0,!0)!==0)break e;Pa=t,r.timeoutHandle=Mv(ev.bind(null,r,n,tn,Ni,Td,t,gn,rr,Qr,gl,d,"Throttled",-0,0),c);break e}ev(r,n,tn,Ni,Td,t,gn,rr,Qr,gl,d,null,-0,0)}}break}while(!0);ua(e)}function ev(e,t,n,r,c,d,y,E,O,V,Z,ee,Y,K){if(e.timeoutHandle=-1,ee=t.subtreeFlags,ee&8192||(ee&16785408)===16785408){ee={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ea},$g(t,d,ee);var pe=(d&62914560)===d?Ri-It():(d&4194048)===d?Fg-It():0;if(pe=Sw(ee,pe),pe!==null){Pa=d,e.cancelPendingCommit=pe(iv.bind(null,e,t,d,n,r,c,y,E,O,Z,ee,null,Y,K)),bl(e,d,y,!V);return}}iv(e,t,d,n,r,c,y,E,O)}function US(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var c=n[r],d=c.getSnapshot;c=c.value;try{if(!dn(d(),c))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function bl(e,t,n,r){t&=~Rd,t&=~rr,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var c=t;0<c;){var d=31-bt(c),y=1<<d;r[d]=-1,c&=~y}n!==0&&oa(e,n,t)}function Ai(){return(Qe&6)===0?(ls(0),!1):!0}function _d(){if(ze!==null){if(Je===0)var e=ze.return;else e=ze,Aa=Fl=null,Ku(e),qr=null,Po=0,e=ze;for(;e!==null;)_g(e.alternate,e),e=e.return;ze=null}}function Zr(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,aw(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Pa=0,_d(),st=e,ze=n=Ta(e.current,null),Ue=t,Je=0,pn=null,gl=!1,Xr=Ee(e,t),Ed=!1,Qr=gn=Rd=rr=vl=pt=0,tn=ns=null,Td=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var c=31-bt(r),d=1<<c;t|=e[c],r&=~d}return Ba=t,Fs(),n}function tv(e,t){Ne=null,z.H=Xo,t===Pr||t===li?(t=vp(),Je=3):t===ku?(t=vp(),Je=4):Je=t===cd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,pn=t,ze===null&&(pt=1,yi(e,Mn(t,e.current)))}function nv(){var e=hn.current;return e===null?!0:(Ue&4194048)===Ue?zn===null:(Ue&62914560)===Ue||(Ue&536870912)!==0?e===zn:!1}function av(){var e=z.H;return z.H=Xo,e===null?Xo:e}function lv(){var e=z.A;return z.A=kS,e}function Mi(){pt=4,gl||(Ue&4194048)!==Ue&&hn.current!==null||(Xr=!0),(vl&134217727)===0&&(rr&134217727)===0||st===null||bl(st,Ue,gn,!1)}function Od(e,t,n){var r=Qe;Qe|=2;var c=av(),d=lv();(st!==e||Ue!==t)&&(Ni=null,Zr(e,t)),t=!1;var y=pt;e:do try{if(Je!==0&&ze!==null){var E=ze,O=pn;switch(Je){case 8:_d(),y=6;break e;case 3:case 2:case 9:case 6:hn.current===null&&(t=!0);var V=Je;if(Je=0,pn=null,Jr(e,E,O,V),n&&Xr){y=0;break e}break;default:V=Je,Je=0,pn=null,Jr(e,E,O,V)}}HS(),y=pt;break}catch(Z){tv(e,Z)}while(!0);return t&&e.shellSuspendCounter++,Aa=Fl=null,Qe=r,z.H=c,z.A=d,ze===null&&(st=null,Ue=0,Fs()),y}function HS(){for(;ze!==null;)rv(ze)}function BS(e,t){var n=Qe;Qe|=2;var r=av(),c=lv();st!==e||Ue!==t?(Ni=null,Ti=It()+500,Zr(e,t)):Xr=Ee(e,t);e:do try{if(Je!==0&&ze!==null){t=ze;var d=pn;t:switch(Je){case 1:Je=0,pn=null,Jr(e,t,d,1);break;case 2:case 9:if(pp(d)){Je=0,pn=null,ov(t);break}t=function(){Je!==2&&Je!==9||st!==e||(Je=7),ua(e)},d.then(t,t);break e;case 3:Je=7;break e;case 4:Je=5;break e;case 7:pp(d)?(Je=0,pn=null,ov(t)):(Je=0,pn=null,Jr(e,t,d,7));break;case 5:var y=null;switch(ze.tag){case 26:y=ze.memoizedState;case 5:case 27:var E=ze;if(y?Gv(y):E.stateNode.complete){Je=0,pn=null;var O=E.sibling;if(O!==null)ze=O;else{var V=E.return;V!==null?(ze=V,_i(V)):ze=null}break t}}Je=0,pn=null,Jr(e,t,d,5);break;case 6:Je=0,pn=null,Jr(e,t,d,6);break;case 8:_d(),pt=6;break e;default:throw Error(i(462))}}PS();break}catch(Z){tv(e,Z)}while(!0);return Aa=Fl=null,z.H=r,z.A=c,Qe=n,ze!==null?0:(st=null,Ue=0,Fs(),pt)}function PS(){for(;ze!==null&&!ba();)rv(ze)}function rv(e){var t=Ag(e.alternate,e,Ba);e.memoizedProps=e.pendingProps,t===null?_i(e):ze=t}function ov(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=jg(n,t,t.pendingProps,t.type,void 0,Ue);break;case 11:t=jg(n,t,t.pendingProps,t.type.render,t.ref,Ue);break;case 5:Ku(t);default:_g(n,t),t=ze=lp(t,Ba),t=Ag(n,t,Ba)}e.memoizedProps=e.pendingProps,t===null?_i(e):ze=t}function Jr(e,t,n,r){Aa=Fl=null,Ku(t),qr=null,Po=0;var c=t.return;try{if(NS(e,c,t,n,Ue)){pt=1,yi(e,Mn(n,e.current)),ze=null;return}}catch(d){if(c!==null)throw ze=c,d;pt=1,yi(e,Mn(n,e.current)),ze=null;return}t.flags&32768?(Be||r===1?e=!0:Xr||(Ue&536870912)!==0?e=!1:(gl=e=!0,(r===2||r===9||r===3||r===6)&&(r=hn.current,r!==null&&r.tag===13&&(r.flags|=16384))),sv(t,e)):_i(t)}function _i(e){var t=e;do{if((t.flags&32768)!==0){sv(t,gl);return}e=t.return;var n=_S(t.alternate,t,Ba);if(n!==null){ze=n;return}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);pt===0&&(pt=5)}function sv(e,t){do{var n=OS(e.alternate,e);if(n!==null){n.flags&=32767,ze=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ze=e;return}ze=e=n}while(e!==null);pt=6,ze=null}function iv(e,t,n,r,c,d,y,E,O){e.cancelPendingCommit=null;do Oi();while(Rt!==0);if((Qe&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(d=t.lanes|t.childLanes,d|=bu,ra(e,n,d,y,E,O),e===st&&(ze=st=null,Ue=0),Fr=t,xl=e,Pa=n,Nd=d,Ad=c,Zg=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,YS(vr,function(){return hv(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=z.T,z.T=null,c=$.p,$.p=2,y=Qe,Qe|=4;try{DS(e,t,n)}finally{Qe=y,$.p=c,z.T=r}}Rt=1,cv(),uv(),dv()}}function cv(){if(Rt===1){Rt=0;var e=xl,t=Fr,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=z.T,z.T=null;var r=$.p;$.p=2;var c=Qe;Qe|=4;try{Ig(t,e);var d=Yd,y=Qm(e.containerInfo),E=d.focusedElem,O=d.selectionRange;if(y!==E&&E&&E.ownerDocument&&Xm(E.ownerDocument.documentElement,E)){if(O!==null&&pu(E)){var V=O.start,Z=O.end;if(Z===void 0&&(Z=V),"selectionStart"in E)E.selectionStart=V,E.selectionEnd=Math.min(Z,E.value.length);else{var ee=E.ownerDocument||document,Y=ee&&ee.defaultView||window;if(Y.getSelection){var K=Y.getSelection(),pe=E.textContent.length,je=Math.min(O.start,pe),at=O.end===void 0?je:Math.min(O.end,pe);!K.extend&&je>at&&(y=at,at=je,je=y);var U=Km(E,je),D=Km(E,at);if(U&&D&&(K.rangeCount!==1||K.anchorNode!==U.node||K.anchorOffset!==U.offset||K.focusNode!==D.node||K.focusOffset!==D.offset)){var q=ee.createRange();q.setStart(U.node,U.offset),K.removeAllRanges(),je>at?(K.addRange(q),K.extend(D.node,D.offset)):(q.setEnd(D.node,D.offset),K.addRange(q))}}}}for(ee=[],K=E;K=K.parentNode;)K.nodeType===1&&ee.push({element:K,left:K.scrollLeft,top:K.scrollTop});for(typeof E.focus=="function"&&E.focus(),E=0;E<ee.length;E++){var W=ee[E];W.element.scrollLeft=W.left,W.element.scrollTop=W.top}}Yi=!!Id,Yd=Id=null}finally{Qe=c,$.p=r,z.T=n}}e.current=t,Rt=2}}function uv(){if(Rt===2){Rt=0;var e=xl,t=Fr,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=z.T,z.T=null;var r=$.p;$.p=2;var c=Qe;Qe|=4;try{Hg(e,t.alternate,t)}finally{Qe=c,$.p=r,z.T=n}}Rt=3}}function dv(){if(Rt===4||Rt===3){Rt=0,Sa();var e=xl,t=Fr,n=Pa,r=Zg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Rt=5:(Rt=0,Fr=xl=null,fv(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(yl=null),Fc(n),t=t.stateNode,xt&&typeof xt.onCommitFiberRoot=="function")try{xt.onCommitFiberRoot(ja,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=z.T,c=$.p,$.p=2,z.T=null;try{for(var d=e.onRecoverableError,y=0;y<r.length;y++){var E=r[y];d(E.value,{componentStack:E.stack})}}finally{z.T=t,$.p=c}}(Pa&3)!==0&&Oi(),ua(e),c=e.pendingLanes,(n&261930)!==0&&(c&42)!==0?e===Md?as++:(as=0,Md=e):as=0,ls(0)}}function fv(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ho(t)))}function Oi(){return cv(),uv(),dv(),hv()}function hv(){if(Rt!==5)return!1;var e=xl,t=Nd;Nd=0;var n=Fc(Pa),r=z.T,c=$.p;try{$.p=32>n?32:n,z.T=null,n=Ad,Ad=null;var d=xl,y=Pa;if(Rt=0,Fr=xl=null,Pa=0,(Qe&6)!==0)throw Error(i(331));var E=Qe;if(Qe|=4,Xg(d.current),Gg(d,d.current,y,n),Qe=E,ls(0,!1),xt&&typeof xt.onPostCommitFiberRoot=="function")try{xt.onPostCommitFiberRoot(ja,d)}catch{}return!0}finally{$.p=c,z.T=r,fv(e,t)}}function mv(e,t,n){t=Mn(n,t),t=id(e.stateNode,t,2),e=fl(e,t,2),e!==null&&(Ot(e,2),ua(e))}function We(e,t,n){if(e.tag===3)mv(e,e,n);else for(;t!==null;){if(t.tag===3){mv(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(yl===null||!yl.has(r))){e=Mn(n,e),n=pg(2),r=fl(t,n,2),r!==null&&(gg(n,r,t,e),Ot(r,2),ua(r));break}}t=t.return}}function Dd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new LS;var c=new Set;r.set(t,c)}else c=r.get(t),c===void 0&&(c=new Set,r.set(t,c));c.has(n)||(Ed=!0,c.add(n),e=qS.bind(null,e,t,n),t.then(e,e))}function qS(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,st===e&&(Ue&n)===n&&(pt===4||pt===3&&(Ue&62914560)===Ue&&300>It()-Ri?(Qe&2)===0&&Zr(e,0):Rd|=n,Qr===Ue&&(Qr=0)),ua(e)}function pv(e,t){t===0&&(t=ot()),e=Kl(e,t),e!==null&&(Ot(e,t),ua(e))}function VS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),pv(e,n)}function IS(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,c=e.memoizedState;c!==null&&(n=c.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),pv(e,n)}function YS(e,t){return nl(e,t)}var Di=null,Wr=null,zd=!1,zi=!1,kd=!1,Sl=0;function ua(e){e!==Wr&&e.next===null&&(Wr===null?Di=Wr=e:Wr=Wr.next=e),zi=!0,zd||(zd=!0,$S())}function ls(e,t){if(!kd&&zi){kd=!0;do for(var n=!1,r=Di;r!==null;){if(e!==0){var c=r.pendingLanes;if(c===0)var d=0;else{var y=r.suspendedLanes,E=r.pingedLanes;d=(1<<31-bt(42|e)+1)-1,d&=c&~(y&~E),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(n=!0,xv(r,d))}else d=Ue,d=xr(r,r===st?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(d&3)===0||Ee(r,d)||(n=!0,xv(r,d));r=r.next}while(n);kd=!1}}function GS(){gv()}function gv(){zi=zd=!1;var e=0;Sl!==0&&nw()&&(e=Sl);for(var t=It(),n=null,r=Di;r!==null;){var c=r.next,d=vv(r,t);d===0?(r.next=null,n===null?Di=c:n.next=c,c===null&&(Wr=n)):(n=r,(e!==0||(d&3)!==0)&&(zi=!0)),r=c}Rt!==0&&Rt!==5||ls(e),Sl!==0&&(Sl=0)}function vv(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var y=31-bt(d),E=1<<y,O=c[y];O===-1?((E&n)===0||(E&r)!==0)&&(c[y]=Fe(E,t)):O<=t&&(e.expiredLanes|=E),d&=~E}if(t=st,n=Ue,n=xr(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Je===2||Je===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Yn(r),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Ee(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Yn(r),Fc(n)){case 2:case 8:n=wa;break;case 32:n=vr;break;case 268435456:n=ql;break;default:n=vr}return r=yv.bind(null,e),n=nl(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Yn(r),e.callbackPriority=2,e.callbackNode=null,2}function yv(e,t){if(Rt!==0&&Rt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Oi()&&e.callbackNode!==n)return null;var r=Ue;return r=xr(e,e===st?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Wg(e,r,t),vv(e,It()),e.callbackNode!=null&&e.callbackNode===n?yv.bind(null,e):null)}function xv(e,t){if(Oi())return null;Wg(e,t,!0)}function $S(){lw(function(){(Qe&6)!==0?nl(Yt,GS):gv()})}function Ld(){if(Sl===0){var e=Hr;e===0&&(e=Vl,Vl<<=1,(Vl&261888)===0&&(Vl=256)),Sl=e}return Sl}function bv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Vs(""+e)}function Sv(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function KS(e,t,n,r,c){if(t==="submit"&&n&&n.stateNode===c){var d=bv((c[Ft]||null).action),y=r.submitter;y&&(t=(t=y[Ft]||null)?bv(t.formAction):y.getAttribute("formAction"),t!==null&&(d=t,y=null));var E=new $s("action","action",null,r,c);e.push({event:E,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Sl!==0){var O=y?Sv(c,y):new FormData(c);nd(n,{pending:!0,data:O,method:c.method,action:d},null,O)}}else typeof d=="function"&&(E.preventDefault(),O=y?Sv(c,y):new FormData(c),nd(n,{pending:!0,data:O,method:c.method,action:d},d,O))},currentTarget:c}]})}}for(var Ud=0;Ud<xu.length;Ud++){var Hd=xu[Ud],XS=Hd.toLowerCase(),QS=Hd[0].toUpperCase()+Hd.slice(1);Kn(XS,"on"+QS)}Kn(Jm,"onAnimationEnd"),Kn(Wm,"onAnimationIteration"),Kn(ep,"onAnimationStart"),Kn("dblclick","onDoubleClick"),Kn("focusin","onFocus"),Kn("focusout","onBlur"),Kn(dS,"onTransitionRun"),Kn(fS,"onTransitionStart"),Kn(hS,"onTransitionCancel"),Kn(tp,"onTransitionEnd"),Cr("onMouseEnter",["mouseout","mouseover"]),Cr("onMouseLeave",["mouseout","mouseover"]),Cr("onPointerEnter",["pointerout","pointerover"]),Cr("onPointerLeave",["pointerout","pointerover"]),Il("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Il("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Il("onBeforeInput",["compositionend","keypress","textInput","paste"]),Il("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Il("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Il("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rs="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(" "),FS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(rs));function wv(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],c=r.event;r=r.listeners;e:{var d=void 0;if(t)for(var y=r.length-1;0<=y;y--){var E=r[y],O=E.instance,V=E.currentTarget;if(E=E.listener,O!==d&&c.isPropagationStopped())break e;d=E,c.currentTarget=V;try{d(c)}catch(Z){Qs(Z)}c.currentTarget=null,d=O}else for(y=0;y<r.length;y++){if(E=r[y],O=E.instance,V=E.currentTarget,E=E.listener,O!==d&&c.isPropagationStopped())break e;d=E,c.currentTarget=V;try{d(c)}catch(Z){Qs(Z)}c.currentTarget=null,d=O}}}}function ke(e,t){var n=t[Zc];n===void 0&&(n=t[Zc]=new Set);var r=e+"__bubble";n.has(r)||(jv(t,e,2,!1),n.add(r))}function Bd(e,t,n){var r=0;t&&(r|=4),jv(n,e,r,t)}var ki="_reactListening"+Math.random().toString(36).slice(2);function Pd(e){if(!e[ki]){e[ki]=!0,gm.forEach(function(n){n!=="selectionchange"&&(FS.has(n)||Bd(n,!1,e),Bd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ki]||(t[ki]=!0,Bd("selectionchange",!1,t))}}function jv(e,t,n,r){switch(Jv(t)){case 2:var c=Cw;break;case 8:c=Ew;break;default:c=tf}n=c.bind(null,t,n,e),c=void 0,!ou||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),r?c!==void 0?e.addEventListener(t,n,{capture:!0,passive:c}):e.addEventListener(t,n,!0):c!==void 0?e.addEventListener(t,n,{passive:c}):e.addEventListener(t,n,!1)}function qd(e,t,n,r,c){var d=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var y=r.tag;if(y===3||y===4){var E=r.stateNode.containerInfo;if(E===c)break;if(y===4)for(y=r.return;y!==null;){var O=y.tag;if((O===3||O===4)&&y.stateNode.containerInfo===c)return;y=y.return}for(;E!==null;){if(y=Sr(E),y===null)return;if(O=y.tag,O===5||O===6||O===26||O===27){r=d=y;continue e}E=E.parentNode}}r=r.return}Nm(function(){var V=d,Z=lu(n),ee=[];e:{var Y=np.get(e);if(Y!==void 0){var K=$s,pe=e;switch(e){case"keypress":if(Ys(n)===0)break e;case"keydown":case"keyup":K=I1;break;case"focusin":pe="focus",K=uu;break;case"focusout":pe="blur",K=uu;break;case"beforeblur":case"afterblur":K=uu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":K=_m;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":K=_1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":K=$1;break;case Jm:case Wm:case ep:K=z1;break;case tp:K=X1;break;case"scroll":case"scrollend":K=A1;break;case"wheel":K=F1;break;case"copy":case"cut":case"paste":K=L1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":K=Dm;break;case"toggle":case"beforetoggle":K=J1}var je=(t&4)!==0,at=!je&&(e==="scroll"||e==="scrollend"),U=je?Y!==null?Y+"Capture":null:Y;je=[];for(var D=V,q;D!==null;){var W=D;if(q=W.stateNode,W=W.tag,W!==5&&W!==26&&W!==27||q===null||U===null||(W=To(D,U),W!=null&&je.push(os(D,W,q))),at)break;D=D.return}0<je.length&&(Y=new K(Y,pe,null,n,Z),ee.push({event:Y,listeners:je}))}}if((t&7)===0){e:{if(Y=e==="mouseover"||e==="pointerover",K=e==="mouseout"||e==="pointerout",Y&&n!==au&&(pe=n.relatedTarget||n.fromElement)&&(Sr(pe)||pe[br]))break e;if((K||Y)&&(Y=Z.window===Z?Z:(Y=Z.ownerDocument)?Y.defaultView||Y.parentWindow:window,K?(pe=n.relatedTarget||n.toElement,K=V,pe=pe?Sr(pe):null,pe!==null&&(at=f(pe),je=pe.tag,pe!==at||je!==5&&je!==27&&je!==6)&&(pe=null)):(K=null,pe=V),K!==pe)){if(je=_m,W="onMouseLeave",U="onMouseEnter",D="mouse",(e==="pointerout"||e==="pointerover")&&(je=Dm,W="onPointerLeave",U="onPointerEnter",D="pointer"),at=K==null?Y:Ro(K),q=pe==null?Y:Ro(pe),Y=new je(W,D+"leave",K,n,Z),Y.target=at,Y.relatedTarget=q,W=null,Sr(Z)===V&&(je=new je(U,D+"enter",pe,n,Z),je.target=q,je.relatedTarget=at,W=je),at=W,K&&pe)t:{for(je=ZS,U=K,D=pe,q=0,W=U;W;W=je(W))q++;W=0;for(var be=D;be;be=je(be))W++;for(;0<q-W;)U=je(U),q--;for(;0<W-q;)D=je(D),W--;for(;q--;){if(U===D||D!==null&&U===D.alternate){je=U;break t}U=je(U),D=je(D)}je=null}else je=null;K!==null&&Cv(ee,Y,K,je,!1),pe!==null&&at!==null&&Cv(ee,at,pe,je,!0)}}e:{if(Y=V?Ro(V):window,K=Y.nodeName&&Y.nodeName.toLowerCase(),K==="select"||K==="input"&&Y.type==="file")var Ie=qm;else if(Bm(Y))if(Vm)Ie=iS;else{Ie=oS;var ge=rS}else K=Y.nodeName,!K||K.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?V&&nu(V.elementType)&&(Ie=qm):Ie=sS;if(Ie&&(Ie=Ie(e,V))){Pm(ee,Ie,n,Z);break e}ge&&ge(e,Y,V),e==="focusout"&&V&&Y.type==="number"&&V.memoizedProps.value!=null&&tu(Y,"number",Y.value)}switch(ge=V?Ro(V):window,e){case"focusin":(Bm(ge)||ge.contentEditable==="true")&&(Mr=ge,gu=V,ko=null);break;case"focusout":ko=gu=Mr=null;break;case"mousedown":vu=!0;break;case"contextmenu":case"mouseup":case"dragend":vu=!1,Fm(ee,n,Z);break;case"selectionchange":if(uS)break;case"keydown":case"keyup":Fm(ee,n,Z)}var Ae;if(fu)e:{switch(e){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else Ar?Um(e,n)&&(He="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(He="onCompositionStart");He&&(zm&&n.locale!=="ko"&&(Ar||He!=="onCompositionStart"?He==="onCompositionEnd"&&Ar&&(Ae=Am()):(rl=Z,su="value"in rl?rl.value:rl.textContent,Ar=!0)),ge=Li(V,He),0<ge.length&&(He=new Om(He,e,null,n,Z),ee.push({event:He,listeners:ge}),Ae?He.data=Ae:(Ae=Hm(n),Ae!==null&&(He.data=Ae)))),(Ae=eS?tS(e,n):nS(e,n))&&(He=Li(V,"onBeforeInput"),0<He.length&&(ge=new Om("onBeforeInput","beforeinput",null,n,Z),ee.push({event:ge,listeners:He}),ge.data=Ae)),KS(ee,e,V,n,Z)}wv(ee,t)})}function os(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Li(e,t){for(var n=t+"Capture",r=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=To(e,n),c!=null&&r.unshift(os(e,c,d)),c=To(e,t),c!=null&&r.push(os(e,c,d))),e.tag===3)return r;e=e.return}return[]}function ZS(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Cv(e,t,n,r,c){for(var d=t._reactName,y=[];n!==null&&n!==r;){var E=n,O=E.alternate,V=E.stateNode;if(E=E.tag,O!==null&&O===r)break;E!==5&&E!==26&&E!==27||V===null||(O=V,c?(V=To(n,d),V!=null&&y.unshift(os(n,V,O))):c||(V=To(n,d),V!=null&&y.push(os(n,V,O)))),n=n.return}y.length!==0&&e.push({event:t,listeners:y})}var JS=/\r\n?/g,WS=/\u0000|\uFFFD/g;function Ev(e){return(typeof e=="string"?e:""+e).replace(JS,`
49
+ `).replace(WS,"")}function Rv(e,t){return t=Ev(t),Ev(e)===t}function nt(e,t,n,r,c,d){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Rr(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Rr(e,""+r);break;case"className":Ps(e,"class",r);break;case"tabIndex":Ps(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Ps(e,n,r);break;case"style":Rm(e,r,d);break;case"data":if(t!=="object"){Ps(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Vs(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"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 d=="function"&&(n==="formAction"?(t!=="input"&&nt(e,t,"name",c.name,c,null),nt(e,t,"formEncType",c.formEncType,c,null),nt(e,t,"formMethod",c.formMethod,c,null),nt(e,t,"formTarget",c.formTarget,c,null)):(nt(e,t,"encType",c.encType,c,null),nt(e,t,"method",c.method,c,null),nt(e,t,"target",c.target,c,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Vs(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=Ea);break;case"onScroll":r!=null&&ke("scroll",e);break;case"onScrollEnd":r!=null&&ke("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(n=r.__html,n!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=Vs(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":ke("beforetoggle",e),ke("toggle",e),Bs(e,"popover",r);break;case"xlinkActuate":Ca(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Ca(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Ca(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Ca(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Ca(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Ca(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Ca(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Ca(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Ca(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Bs(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=T1.get(n)||n,Bs(e,n,r))}}function Vd(e,t,n,r,c,d){switch(n){case"style":Rm(e,r,d);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(n=r.__html,n!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=n}}break;case"children":typeof r=="string"?Rr(e,r):(typeof r=="number"||typeof r=="bigint")&&Rr(e,""+r);break;case"onScroll":r!=null&&ke("scroll",e);break;case"onScrollEnd":r!=null&&ke("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Ea);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!vm.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(c=n.endsWith("Capture"),t=n.slice(2,c?n.length-7:void 0),d=e[Ft]||null,d=d!=null?d[n]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof r=="function")){typeof d!="function"&&d!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,c);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):Bs(e,n,r)}}}function Ut(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ke("error",e),ke("load",e);var r=!1,c=!1,d;for(d in n)if(n.hasOwnProperty(d)){var y=n[d];if(y!=null)switch(d){case"src":r=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:nt(e,t,d,y,n,null)}}c&&nt(e,t,"srcSet",n.srcSet,n,null),r&&nt(e,t,"src",n.src,n,null);return;case"input":ke("invalid",e);var E=d=y=c=null,O=null,V=null;for(r in n)if(n.hasOwnProperty(r)){var Z=n[r];if(Z!=null)switch(r){case"name":c=Z;break;case"type":y=Z;break;case"checked":O=Z;break;case"defaultChecked":V=Z;break;case"value":d=Z;break;case"defaultValue":E=Z;break;case"children":case"dangerouslySetInnerHTML":if(Z!=null)throw Error(i(137,t));break;default:nt(e,t,r,Z,n,null)}}wm(e,d,E,O,V,y,c,!1);return;case"select":ke("invalid",e),r=y=d=null;for(c in n)if(n.hasOwnProperty(c)&&(E=n[c],E!=null))switch(c){case"value":d=E;break;case"defaultValue":y=E;break;case"multiple":r=E;default:nt(e,t,c,E,n,null)}t=d,n=y,e.multiple=!!r,t!=null?Er(e,!!r,t,!1):n!=null&&Er(e,!!r,n,!0);return;case"textarea":ke("invalid",e),d=c=r=null;for(y in n)if(n.hasOwnProperty(y)&&(E=n[y],E!=null))switch(y){case"value":r=E;break;case"defaultValue":c=E;break;case"children":d=E;break;case"dangerouslySetInnerHTML":if(E!=null)throw Error(i(91));break;default:nt(e,t,y,E,n,null)}Cm(e,r,c,d);return;case"option":for(O in n)if(n.hasOwnProperty(O)&&(r=n[O],r!=null))switch(O){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:nt(e,t,O,r,n,null)}return;case"dialog":ke("beforetoggle",e),ke("toggle",e),ke("cancel",e),ke("close",e);break;case"iframe":case"object":ke("load",e);break;case"video":case"audio":for(r=0;r<rs.length;r++)ke(rs[r],e);break;case"image":ke("error",e),ke("load",e);break;case"details":ke("toggle",e);break;case"embed":case"source":case"link":ke("error",e),ke("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(V in n)if(n.hasOwnProperty(V)&&(r=n[V],r!=null))switch(V){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:nt(e,t,V,r,n,null)}return;default:if(nu(t)){for(Z in n)n.hasOwnProperty(Z)&&(r=n[Z],r!==void 0&&Vd(e,t,Z,r,n,void 0));return}}for(E in n)n.hasOwnProperty(E)&&(r=n[E],r!=null&&nt(e,t,E,r,n,null))}function ew(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,d=null,y=null,E=null,O=null,V=null,Z=null;for(K in n){var ee=n[K];if(n.hasOwnProperty(K)&&ee!=null)switch(K){case"checked":break;case"value":break;case"defaultValue":O=ee;default:r.hasOwnProperty(K)||nt(e,t,K,null,r,ee)}}for(var Y in r){var K=r[Y];if(ee=n[Y],r.hasOwnProperty(Y)&&(K!=null||ee!=null))switch(Y){case"type":d=K;break;case"name":c=K;break;case"checked":V=K;break;case"defaultChecked":Z=K;break;case"value":y=K;break;case"defaultValue":E=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(i(137,t));break;default:K!==ee&&nt(e,t,Y,K,r,ee)}}eu(e,y,E,O,V,Z,d,c);return;case"select":K=y=E=Y=null;for(d in n)if(O=n[d],n.hasOwnProperty(d)&&O!=null)switch(d){case"value":break;case"multiple":K=O;default:r.hasOwnProperty(d)||nt(e,t,d,null,r,O)}for(c in r)if(d=r[c],O=n[c],r.hasOwnProperty(c)&&(d!=null||O!=null))switch(c){case"value":Y=d;break;case"defaultValue":E=d;break;case"multiple":y=d;default:d!==O&&nt(e,t,c,d,r,O)}t=E,n=y,r=K,Y!=null?Er(e,!!n,Y,!1):!!r!=!!n&&(t!=null?Er(e,!!n,t,!0):Er(e,!!n,n?[]:"",!1));return;case"textarea":K=Y=null;for(E in n)if(c=n[E],n.hasOwnProperty(E)&&c!=null&&!r.hasOwnProperty(E))switch(E){case"value":break;case"children":break;default:nt(e,t,E,null,r,c)}for(y in r)if(c=r[y],d=n[y],r.hasOwnProperty(y)&&(c!=null||d!=null))switch(y){case"value":Y=c;break;case"defaultValue":K=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==d&&nt(e,t,y,c,r,d)}jm(e,Y,K);return;case"option":for(var pe in n)if(Y=n[pe],n.hasOwnProperty(pe)&&Y!=null&&!r.hasOwnProperty(pe))switch(pe){case"selected":e.selected=!1;break;default:nt(e,t,pe,null,r,Y)}for(O in r)if(Y=r[O],K=n[O],r.hasOwnProperty(O)&&Y!==K&&(Y!=null||K!=null))switch(O){case"selected":e.selected=Y&&typeof Y!="function"&&typeof Y!="symbol";break;default:nt(e,t,O,Y,r,K)}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 je in n)Y=n[je],n.hasOwnProperty(je)&&Y!=null&&!r.hasOwnProperty(je)&&nt(e,t,je,null,r,Y);for(V in r)if(Y=r[V],K=n[V],r.hasOwnProperty(V)&&Y!==K&&(Y!=null||K!=null))switch(V){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(i(137,t));break;default:nt(e,t,V,Y,r,K)}return;default:if(nu(t)){for(var at in n)Y=n[at],n.hasOwnProperty(at)&&Y!==void 0&&!r.hasOwnProperty(at)&&Vd(e,t,at,void 0,r,Y);for(Z in r)Y=r[Z],K=n[Z],!r.hasOwnProperty(Z)||Y===K||Y===void 0&&K===void 0||Vd(e,t,Z,Y,r,K);return}}for(var U in n)Y=n[U],n.hasOwnProperty(U)&&Y!=null&&!r.hasOwnProperty(U)&&nt(e,t,U,null,r,Y);for(ee in r)Y=r[ee],K=n[ee],!r.hasOwnProperty(ee)||Y===K||Y==null&&K==null||nt(e,t,ee,Y,r,K)}function Tv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tw(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var c=n[r],d=c.transferSize,y=c.initiatorType,E=c.duration;if(d&&E&&Tv(y)){for(y=0,E=c.responseEnd,r+=1;r<n.length;r++){var O=n[r],V=O.startTime;if(V>E)break;var Z=O.transferSize,ee=O.initiatorType;Z&&Tv(ee)&&(O=O.responseEnd,y+=Z*(O<E?1:(E-V)/(O-V)))}if(--r,t+=8*(d+y)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Id=null,Yd=null;function Ui(e){return e.nodeType===9?e:e.ownerDocument}function Nv(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Av(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Gd(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var $d=null;function nw(){var e=window.event;return e&&e.type==="popstate"?e===$d?!1:($d=e,!0):($d=null,!1)}var Mv=typeof setTimeout=="function"?setTimeout:void 0,aw=typeof clearTimeout=="function"?clearTimeout:void 0,_v=typeof Promise=="function"?Promise:void 0,lw=typeof queueMicrotask=="function"?queueMicrotask:typeof _v<"u"?function(e){return _v.resolve(null).then(e).catch(rw)}:Mv;function rw(e){setTimeout(function(){throw e})}function wl(e){return e==="head"}function Ov(e,t){var n=t,r=0;do{var c=n.nextSibling;if(e.removeChild(n),c&&c.nodeType===8)if(n=c.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(c),ao(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")ss(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,ss(n);for(var d=n.firstChild;d;){var y=d.nextSibling,E=d.nodeName;d[Eo]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&d.rel.toLowerCase()==="stylesheet"||n.removeChild(d),d=y}}else n==="body"&&ss(e.ownerDocument.body);n=c}while(n);ao(t)}function Dv(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=r}while(n)}function Kd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Kd(n),Jc(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function ow(e,t,n,r){for(;e.nodeType===1;){var c=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Eo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=kn(e.nextSibling),e===null)break}return null}function sw(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=kn(e.nextSibling),e===null))return null;return e}function zv(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=kn(e.nextSibling),e===null))return null;return e}function Xd(e){return e.data==="$?"||e.data==="$~"}function Qd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function iw(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function kn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Fd=null;function kv(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return kn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Lv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Uv(e,t,n){switch(t=Ui(n),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function ss(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Jc(e)}var Ln=new Map,Hv=new Set;function Hi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var qa=$.d;$.d={f:cw,r:uw,D:dw,C:fw,L:hw,m:mw,X:gw,S:pw,M:vw};function cw(){var e=qa.f(),t=Ai();return e||t}function uw(e){var t=wr(e);t!==null&&t.tag===5&&t.type==="form"?tg(t):qa.r(e)}var eo=typeof document>"u"?null:document;function Bv(e,t,n){var r=eo;if(r&&typeof t=="string"&&t){var c=Nn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof n=="string"&&(c+='[crossorigin="'+n+'"]'),Hv.has(c)||(Hv.add(c),e={rel:e,crossOrigin:n,href:t},r.querySelector(c)===null&&(t=r.createElement("link"),Ut(t,"link",e),Nt(t),r.head.appendChild(t)))}}function dw(e){qa.D(e),Bv("dns-prefetch",e,null)}function fw(e,t){qa.C(e,t),Bv("preconnect",e,t)}function hw(e,t,n){qa.L(e,t,n);var r=eo;if(r&&e&&t){var c='link[rel="preload"][as="'+Nn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(c+='[imagesrcset="'+Nn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(c+='[imagesizes="'+Nn(n.imageSizes)+'"]')):c+='[href="'+Nn(e)+'"]';var d=c;switch(t){case"style":d=to(e);break;case"script":d=no(e)}Ln.has(d)||(e=b({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ln.set(d,e),r.querySelector(c)!==null||t==="style"&&r.querySelector(is(d))||t==="script"&&r.querySelector(cs(d))||(t=r.createElement("link"),Ut(t,"link",e),Nt(t),r.head.appendChild(t)))}}function mw(e,t){qa.m(e,t);var n=eo;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Nn(r)+'"][href="'+Nn(e)+'"]',d=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=no(e)}if(!Ln.has(d)&&(e=b({rel:"modulepreload",href:e},t),Ln.set(d,e),n.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(cs(d)))return}r=n.createElement("link"),Ut(r,"link",e),Nt(r),n.head.appendChild(r)}}}function pw(e,t,n){qa.S(e,t,n);var r=eo;if(r&&e){var c=jr(r).hoistableStyles,d=to(e);t=t||"default";var y=c.get(d);if(!y){var E={loading:0,preload:null};if(y=r.querySelector(is(d)))E.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ln.get(d))&&Zd(e,n);var O=y=r.createElement("link");Nt(O),Ut(O,"link",e),O._p=new Promise(function(V,Z){O.onload=V,O.onerror=Z}),O.addEventListener("load",function(){E.loading|=1}),O.addEventListener("error",function(){E.loading|=2}),E.loading|=4,Bi(y,t,r)}y={type:"stylesheet",instance:y,count:1,state:E},c.set(d,y)}}}function gw(e,t){qa.X(e,t);var n=eo;if(n&&e){var r=jr(n).hoistableScripts,c=no(e),d=r.get(c);d||(d=n.querySelector(cs(c)),d||(e=b({src:e,async:!0},t),(t=Ln.get(c))&&Jd(e,t),d=n.createElement("script"),Nt(d),Ut(d,"link",e),n.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function vw(e,t){qa.M(e,t);var n=eo;if(n&&e){var r=jr(n).hoistableScripts,c=no(e),d=r.get(c);d||(d=n.querySelector(cs(c)),d||(e=b({src:e,async:!0,type:"module"},t),(t=Ln.get(c))&&Jd(e,t),d=n.createElement("script"),Nt(d),Ut(d,"link",e),n.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(c,d))}}function Pv(e,t,n,r){var c=(c=J.current)?Hi(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=to(n.href),n=jr(c).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=to(n.href);var d=jr(c).hoistableStyles,y=d.get(e);if(y||(c=c.ownerDocument||c,y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,y),(d=c.querySelector(is(e)))&&!d._p&&(y.instance=d,y.state.loading=5),Ln.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ln.set(e,n),d||yw(c,e,n,y.state))),t&&r===null)throw Error(i(528,""));return y}if(t&&r!==null)throw Error(i(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=no(n),n=jr(c).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function to(e){return'href="'+Nn(e)+'"'}function is(e){return'link[rel="stylesheet"]['+e+"]"}function qv(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function yw(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Ut(t,"link",n),Nt(t),e.head.appendChild(t))}function no(e){return'[src="'+Nn(e)+'"]'}function cs(e){return"script[async]"+e}function Vv(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Nn(n.href)+'"]');if(r)return t.instance=r,Nt(r),r;var c=b({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Nt(r),Ut(r,"style",c),Bi(r,n.precedence,e),t.instance=r;case"stylesheet":c=to(n.href);var d=e.querySelector(is(c));if(d)return t.state.loading|=4,t.instance=d,Nt(d),d;r=qv(n),(c=Ln.get(c))&&Zd(r,c),d=(e.ownerDocument||e).createElement("link"),Nt(d);var y=d;return y._p=new Promise(function(E,O){y.onload=E,y.onerror=O}),Ut(d,"link",r),t.state.loading|=4,Bi(d,n.precedence,e),t.instance=d;case"script":return d=no(n.src),(c=e.querySelector(cs(d)))?(t.instance=c,Nt(c),c):(r=n,(c=Ln.get(d))&&(r=b({},n),Jd(r,c)),e=e.ownerDocument||e,c=e.createElement("script"),Nt(c),Ut(c,"link",r),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Bi(r,n.precedence,e));return t.instance}function Bi(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=r.length?r[r.length-1]:null,d=c,y=0;y<r.length;y++){var E=r[y];if(E.dataset.precedence===t)d=E;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Zd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Jd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Pi=null;function Iv(e,t,n){if(Pi===null){var r=new Map,c=Pi=new Map;c.set(n,r)}else c=Pi,r=c.get(n),r||(r=new Map,c.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),c=0;c<n.length;c++){var d=n[c];if(!(d[Eo]||d[Dt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var y=d.getAttribute(t)||"";y=e+y;var E=r.get(y);E?E.push(d):r.set(y,[d])}}return r}function Yv(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function xw(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Gv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function bw(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var c=to(r.href),d=t.querySelector(is(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=qi.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=d,Nt(d);return}d=t.ownerDocument||t,r=qv(r),(c=Ln.get(c))&&Zd(r,c),d=d.createElement("link"),Nt(d);var y=d;y._p=new Promise(function(E,O){y.onload=E,y.onerror=O}),Ut(d,"link",r),n.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=qi.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Wd=0;function Sw(e,t){return e.stylesheets&&e.count===0&&Ii(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Ii(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&Wd===0&&(Wd=62500*tw());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ii(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Wd?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function qi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ii(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Vi=null;function Ii(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Vi=new Map,t.forEach(ww,e),Vi=null,qi.call(e))}function ww(e,t){if(!(t.state.loading&4)){var n=Vi.get(e);if(n)var r=n.get(null);else{n=new Map,Vi.set(e,n);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<c.length;d++){var y=c[d];(y.nodeName==="LINK"||y.getAttribute("media")!=="not all")&&(n.set(y.dataset.precedence,y),r=y)}r&&n.set(null,r)}c=t.instance,y=c.getAttribute("data-precedence"),d=n.get(y)||r,d===r&&n.set(null,c),n.set(y,c),this.count++,r=qi.bind(this),c.addEventListener("load",r),c.addEventListener("error",r),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var us={$$typeof:A,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function jw(e,t,n,r,c,d,y,E,O){this.tag=1,this.containerInfo=e,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=Gt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Gt(0),this.hiddenUpdates=Gt(null),this.identifierPrefix=r,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function $v(e,t,n,r,c,d,y,E,O,V,Z,ee){return e=new jw(e,t,n,y,O,V,Z,ee,E),t=1,d===!0&&(t|=24),d=fn(3,null,null,t),e.current=d,d.stateNode=e,t=Ou(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:r,isDehydrated:n,cache:t},Lu(d),e}function Kv(e){return e?(e=Dr,e):Dr}function Xv(e,t,n,r,c,d){c=Kv(c),r.context===null?r.context=c:r.pendingContext=c,r=dl(t),r.payload={element:n},d=d===void 0?null:d,d!==null&&(r.callback=d),n=fl(e,r,t),n!==null&&(nn(n,e,t),Vo(n,e,t))}function Qv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ef(e,t){Qv(e,t),(e=e.alternate)&&Qv(e,t)}function Fv(e){if(e.tag===13||e.tag===31){var t=Kl(e,67108864);t!==null&&nn(t,e,67108864),ef(e,67108864)}}function Zv(e){if(e.tag===13||e.tag===31){var t=vn();t=Qc(t);var n=Kl(e,t);n!==null&&nn(n,e,t),ef(e,t)}}var Yi=!0;function Cw(e,t,n,r){var c=z.T;z.T=null;var d=$.p;try{$.p=2,tf(e,t,n,r)}finally{$.p=d,z.T=c}}function Ew(e,t,n,r){var c=z.T;z.T=null;var d=$.p;try{$.p=8,tf(e,t,n,r)}finally{$.p=d,z.T=c}}function tf(e,t,n,r){if(Yi){var c=nf(r);if(c===null)qd(e,t,r,Gi,n),Wv(e,r);else if(Tw(c,e,t,n,r))r.stopPropagation();else if(Wv(e,r),t&4&&-1<Rw.indexOf(e)){for(;c!==null;){var d=wr(c);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var y=Pt(d.pendingLanes);if(y!==0){var E=d;for(E.pendingLanes|=2,E.entangledLanes|=2;y;){var O=1<<31-bt(y);E.entanglements[1]|=O,y&=~O}ua(d),(Qe&6)===0&&(Ti=It()+500,ls(0))}}break;case 31:case 13:E=Kl(d,2),E!==null&&nn(E,d,2),Ai(),ef(d,2)}if(d=nf(r),d===null&&qd(e,t,r,Gi,n),d===c)break;c=d}c!==null&&r.stopPropagation()}else qd(e,t,r,null,n)}}function nf(e){return e=lu(e),af(e)}var Gi=null;function af(e){if(Gi=null,e=Sr(e),e!==null){var t=f(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=m(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Gi=e,null}function Jv(e){switch(e){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(Yc()){case Yt:return 2;case wa:return 8;case vr:case Gc:return 32;case ql:return 268435456;default:return 32}default:return 32}}var lf=!1,jl=null,Cl=null,El=null,ds=new Map,fs=new Map,Rl=[],Rw="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 Wv(e,t){switch(e){case"focusin":case"focusout":jl=null;break;case"dragenter":case"dragleave":Cl=null;break;case"mouseover":case"mouseout":El=null;break;case"pointerover":case"pointerout":ds.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":fs.delete(t.pointerId)}}function hs(e,t,n,r,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:d,targetContainers:[c]},t!==null&&(t=wr(t),t!==null&&Fv(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Tw(e,t,n,r,c){switch(t){case"focusin":return jl=hs(jl,e,t,n,r,c),!0;case"dragenter":return Cl=hs(Cl,e,t,n,r,c),!0;case"mouseover":return El=hs(El,e,t,n,r,c),!0;case"pointerover":var d=c.pointerId;return ds.set(d,hs(ds.get(d)||null,e,t,n,r,c)),!0;case"gotpointercapture":return d=c.pointerId,fs.set(d,hs(fs.get(d)||null,e,t,n,r,c)),!0}return!1}function ey(e){var t=Sr(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,mm(e.priority,function(){Zv(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,mm(e.priority,function(){Zv(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function $i(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=nf(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);au=r,n.target.dispatchEvent(r),au=null}else return t=wr(n),t!==null&&Fv(t),e.blockedOn=n,!1;t.shift()}return!0}function ty(e,t,n){$i(e)&&n.delete(t)}function Nw(){lf=!1,jl!==null&&$i(jl)&&(jl=null),Cl!==null&&$i(Cl)&&(Cl=null),El!==null&&$i(El)&&(El=null),ds.forEach(ty),fs.forEach(ty)}function Ki(e,t){e.blockedOn===t&&(e.blockedOn=null,lf||(lf=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Nw)))}var Xi=null;function ny(e){Xi!==e&&(Xi=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Xi===e&&(Xi=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],c=e[t+2];if(typeof r!="function"){if(af(r||n)===null)continue;break}var d=wr(n);d!==null&&(e.splice(t,3),t-=3,nd(d,{pending:!0,data:c,method:n.method,action:r},r,c))}}))}function ao(e){function t(O){return Ki(O,e)}jl!==null&&Ki(jl,e),Cl!==null&&Ki(Cl,e),El!==null&&Ki(El,e),ds.forEach(t),fs.forEach(t);for(var n=0;n<Rl.length;n++){var r=Rl[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Rl.length&&(n=Rl[0],n.blockedOn===null);)ey(n),n.blockedOn===null&&Rl.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var c=n[r],d=n[r+1],y=c[Ft]||null;if(typeof d=="function")y||ny(n);else if(y){var E=null;if(d&&d.hasAttribute("formAction")){if(c=d,y=d[Ft]||null)E=y.formAction;else if(af(c)!==null)continue}else E=y.action;typeof E=="function"?n[r+1]=E:(n.splice(r,3),r-=3),ny(n)}}}function ay(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(y){return c=y})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function rf(e){this._internalRoot=e}Qi.prototype.render=rf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current,r=vn();Xv(n,r,e,t,null,null)},Qi.prototype.unmount=rf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Xv(e.current,2,null,e,null,null),Ai(),t[br]=null}};function Qi(e){this._internalRoot=e}Qi.prototype.unstable_scheduleHydration=function(e){if(e){var t=hm();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Rl.length&&t!==0&&t<Rl[n].priority;n++);Rl.splice(n,0,e),n===0&&ey(e)}};var ly=l.version;if(ly!=="19.2.8")throw Error(i(527,ly,"19.2.8"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=v(t),e=e!==null?S(e):null,e=e===null?null:e.stateNode,e};var Aw={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fi.isDisabled&&Fi.supportsFiber)try{ja=Fi.inject(Aw),xt=Fi}catch{}}return ps.createRoot=function(e,t){if(!u(e))throw Error(i(299));var n=!1,r="",c=dg,d=fg,y=hg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(y=t.onRecoverableError)),t=$v(e,1,!1,null,null,n,r,null,c,d,y,ay),e[br]=t.current,Pd(e),new rf(t)},ps.hydrateRoot=function(e,t,n){if(!u(e))throw Error(i(299));var r=!1,c="",d=dg,y=fg,E=hg,O=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(d=n.onUncaughtError),n.onCaughtError!==void 0&&(y=n.onCaughtError),n.onRecoverableError!==void 0&&(E=n.onRecoverableError),n.formState!==void 0&&(O=n.formState)),t=$v(e,1,!0,t,n??null,r,c,O,d,y,E,ay),t.context=Kv(null),n=t.current,r=vn(),r=Qc(r),c=dl(r),c.callback=null,fl(n,c,r),n=r,t.current.lanes=n,Ot(t,n),ua(t),e[br]=t.current,Pd(e),new Qi(t)},ps.version="19.2.8",ps}var vy;function Bw(){if(vy)return uf.exports;vy=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),uf.exports=Hw(),uf.exports}var Pw=Bw();const qw=ah(Pw);/**
50
+ * react-router v7.18.2
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var rh=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,rx=/^[\\/]{2}/;function Vw(a,l){return l+a.replace(/\\/g,"/")}var yy="popstate";function xy(a){return typeof a=="object"&&a!=null&&"pathname"in a&&"search"in a&&"hash"in a&&"state"in a&&"key"in a}function Iw(a={}){function l(i,u){var v;let f=(v=u.state)==null?void 0:v.masked,{pathname:h,search:m,hash:g}=f||i.location;return _f("",{pathname:h,search:m,hash:g},u.state&&u.state.usr||null,u.state&&u.state.key||"default",f?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function o(i,u){return typeof u=="string"?u:js(u)}return Gw(l,o,null,a)}function ht(a,l){if(a===!1||a===null||typeof a>"u")throw new Error(l)}function Vn(a,l){if(!a){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function Yw(){return Math.random().toString(36).substring(2,10)}function by(a,l){return{usr:a.state,key:a.key,idx:l,masked:a.mask?{pathname:a.pathname,search:a.search,hash:a.hash}:void 0}}function _f(a,l,o=null,i,u){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof l=="string"?mo(l):l,state:o,key:l&&l.key||i||Yw(),mask:u}}function js({pathname:a="/",search:l="",hash:o=""}){return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function mo(a){let l={};if(a){let o=a.indexOf("#");o>=0&&(l.hash=a.substring(o),a=a.substring(0,o));let i=a.indexOf("?");i>=0&&(l.search=a.substring(i),a=a.substring(0,i)),a&&(l.pathname=a)}return l}function Gw(a,l,o,i={}){let{window:u=document.defaultView,v5Compat:f=!1}=i,h=u.history,m="POP",g=null,v=S();v==null&&(v=0,h.replaceState({...h.state,idx:v},""));function S(){return(h.state||{idx:null}).idx}function b(){m="POP";let C=S(),N=C==null?null:C-v;v=C,g&&g({action:m,location:j.location,delta:N})}function x(C,N){m="PUSH";let T=xy(C)?C:_f(j.location,C,N);v=S()+1;let A=by(T,v),_=j.createHref(T.mask||T);try{h.pushState(A,"",_)}catch(H){if(H instanceof DOMException&&H.name==="DataCloneError")throw H;u.location.assign(_)}f&&g&&g({action:m,location:j.location,delta:1})}function w(C,N){m="REPLACE";let T=xy(C)?C:_f(j.location,C,N);v=S();let A=by(T,v),_=j.createHref(T.mask||T);h.replaceState(A,"",_),f&&g&&g({action:m,location:j.location,delta:0})}function R(C){return $w(u,C)}let j={get action(){return m},get location(){return a(u,h)},listen(C){if(g)throw new Error("A history only accepts one active listener");return u.addEventListener(yy,b),g=C,()=>{u.removeEventListener(yy,b),g=null}},createHref(C){return l(u,C)},createURL:R,encodeLocation(C){let N=R(C);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:x,replace:w,go(C){return h.go(C)}};return j}function $w(a,l,o=!1){let i="http://localhost";a&&(i=a.location.origin!=="null"?a.location.origin:a.location.href),ht(i,"No window.location.(origin|href) available to create URL");let u=typeof l=="string"?l:js(l);return u=u.replace(/ $/,"%20"),!o&&rx.test(u)&&(u=i+u),new URL(u,i)}function ox(a,l,o="/"){return Kw(a,l,o,!1)}function Kw(a,l,o,i,u){let f=typeof l=="string"?mo(l):l,h=Ka(f.pathname||"/",o);if(h==null)return null;let m=Xw(a),g=null,v=rj(h);for(let S=0;g==null&&S<m.length;++S)g=lj(m[S],v,i);return g}function Xw(a){let l=sx(a);return Qw(l),l}function sx(a,l=[],o=[],i="",u=!1){let f=(h,m,g=u,v)=>{let S={relativePath:v===void 0?h.path||"":v,caseSensitive:h.caseSensitive===!0,childrenIndex:m,route:h};if(S.relativePath.startsWith("/")){if(!S.relativePath.startsWith(i)&&g)return;ht(S.relativePath.startsWith(i),`Absolute route path "${S.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),S.relativePath=S.relativePath.slice(i.length)}let b=Jn([i,S.relativePath]),x=o.concat(S);h.children&&h.children.length>0&&(ht(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),sx(h.children,l,x,b,g)),!(h.path==null&&!h.index)&&l.push({path:b,score:nj(b,h.index),routesMeta:x.map((w,R)=>{let[j,C]=ux(w.relativePath,w.caseSensitive,R===x.length-1);return{...w,matcher:j,compiledParams:C}})})};return a.forEach((h,m)=>{var g;if(h.path===""||!((g=h.path)!=null&&g.includes("?")))f(h,m);else for(let v of ix(h.path))f(h,m,!0,v)}),l}function ix(a){let l=a.split("/");if(l.length===0)return[];let[o,...i]=l,u=o.endsWith("?"),f=o.replace(/\?$/,"");if(i.length===0)return u?[f,""]:[f];let h=ix(i.join("/")),m=[];return m.push(...h.map(g=>g===""?f:[f,g].join("/"))),u&&m.push(...h),m.map(g=>a.startsWith("/")&&g===""?"/":g)}function Qw(a){a.sort((l,o)=>l.score!==o.score?o.score-l.score:aj(l.routesMeta.map(i=>i.childrenIndex),o.routesMeta.map(i=>i.childrenIndex)))}var Fw=/^:[\w-]+$/,Zw=3,Jw=2,Ww=1,ej=10,tj=-2,Sy=a=>a==="*";function nj(a,l){let o=a.split("/"),i=o.length;return o.some(Sy)&&(i+=tj),l&&(i+=Jw),o.filter(u=>!Sy(u)).reduce((u,f)=>u+(Fw.test(f)?Zw:f===""?Ww:ej),i)}function aj(a,l){return a.length===l.length&&a.slice(0,-1).every((i,u)=>i===l[u])?a[a.length-1]-l[l.length-1]:0}function lj(a,l,o=!1){let{routesMeta:i}=a,u={},f="/",h=[];for(let m=0;m<i.length;++m){let g=i[m],v=m===i.length-1,S=f==="/"?l:l.slice(f.length)||"/",b={path:g.relativePath,caseSensitive:g.caseSensitive,end:v},x=g.matcher&&g.compiledParams?cx(b,S,g.matcher,g.compiledParams):mc(b,S),w=g.route;if(!x&&v&&o&&!i[i.length-1].route.index&&(x=mc({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},S)),!x)return null;Object.assign(u,x.params),h.push({params:u,pathname:Jn([f,x.pathname]),pathnameBase:ij(Jn([f,x.pathnameBase])),route:w}),x.pathnameBase!=="/"&&(f=Jn([f,x.pathnameBase]))}return h}function mc(a,l){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[o,i]=ux(a.path,a.caseSensitive,a.end);return cx(a,l,o,i)}function cx(a,l,o,i){let u=l.match(o);if(!u)return null;let f=u[0],h=f.replace(/(.)\/+$/,"$1"),m=u.slice(1);return{params:i.reduce((v,{paramName:S,isOptional:b},x)=>{if(S==="*"){let R=m[x]||"";h=f.slice(0,f.length-R.length).replace(/(.)\/+$/,"$1")}const w=m[x];return b&&!w?v[S]=void 0:v[S]=(w||"").replace(/%2F/g,"/"),v},{}),pathname:f,pathnameBase:h,pattern:a}}function ux(a,l=!1,o=!0){Vn(a==="*"||!a.endsWith("*")||a.endsWith("/*"),`Route path "${a}" will be treated as if it were "${a.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${a.replace(/\*$/,"/*")}".`);let i=[],u="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,m,g,v,S)=>{if(i.push({paramName:m,isOptional:g!=null}),g){let b=S.charAt(v+h.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(i.push({paramName:"*"}),u+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?u+="\\/*$":a!==""&&a!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,l?void 0:"i"),i]}function rj(a){try{return a.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return Vn(!1,`The URL path "${a}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),a}}function Ka(a,l){if(l==="/")return a;if(!a.toLowerCase().startsWith(l.toLowerCase()))return null;let o=l.endsWith("/")?l.length-1:l.length,i=a.charAt(o);return i&&i!=="/"?null:a.slice(o)||"/"}function oj(a,l="/"){let{pathname:o,search:i="",hash:u=""}=typeof a=="string"?mo(a):a,f;return o?(o=dx(o),o.startsWith("/")?f=wy(o.substring(1),"/"):f=wy(o,l)):f=l,{pathname:f,search:cj(i),hash:uj(u)}}function wy(a,l){let o=pc(l).split("/");return a.split("/").forEach(u=>{u===".."?o.length>1&&o.pop():u!=="."&&o.push(u)}),o.length>1?o.join("/"):"/"}function mf(a,l,o,i){return`Cannot include a '${a}' character in a manually specified \`to.${l}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function sj(a){return a.filter((l,o)=>o===0||l.route.path&&l.route.path.length>0)}function oh(a){let l=sj(a);return l.map((o,i)=>i===l.length-1?o.pathname:o.pathnameBase)}function Sc(a,l,o,i=!1){let u;typeof a=="string"?u=mo(a):(u={...a},ht(!u.pathname||!u.pathname.includes("?"),mf("?","pathname","search",u)),ht(!u.pathname||!u.pathname.includes("#"),mf("#","pathname","hash",u)),ht(!u.search||!u.search.includes("#"),mf("#","search","hash",u)));let f=a===""||u.pathname==="",h=f?"/":u.pathname,m;if(h==null)m=o;else{let b=l.length-1;if(!i&&h.startsWith("..")){let x=h.split("/");for(;x[0]==="..";)x.shift(),b-=1;u.pathname=x.join("/")}m=b>=0?l[b]:"/"}let g=oj(u,m),v=h&&h!=="/"&&h.endsWith("/"),S=(f||h===".")&&o.endsWith("/");return!g.pathname.endsWith("/")&&(v||S)&&(g.pathname+="/"),g}var dx=a=>a.replace(/[\\/]{2,}/g,"/"),Jn=a=>dx(a.join("/")),pc=a=>a.replace(/\/+$/,""),ij=a=>pc(a).replace(/^\/*/,"/"),cj=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,uj=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,dj=class{constructor(a,l,o,i=!1){this.status=a,this.statusText=l||"",this.internal=i,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function fj(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function hj(a){let l=a.map(o=>o.route.path).filter(Boolean);return Jn(l)||"/"}var fx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function hx(a,l){let o=a;if(typeof o!="string"||!rh.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let i=o,u=!1;if(fx)try{let f=new URL(window.location.href),h=rx.test(o)?new URL(Vw(o,f.protocol)):new URL(o),m=Ka(h.pathname,l);h.origin===f.origin&&m!=null?o=m+h.search+h.hash:u=!0}catch{Vn(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:u,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var mx=["POST","PUT","PATCH","DELETE"];new Set(mx);var mj=["GET",...mx];new Set(mj);var pj=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function gj(a){try{return pj.includes(new URL(a).protocol)}catch{return!1}}var po=p.createContext(null);po.displayName="DataRouter";var wc=p.createContext(null);wc.displayName="DataRouterState";var px=p.createContext(!1);function vj(){return p.useContext(px)}var gx=p.createContext({isTransitioning:!1});gx.displayName="ViewTransition";var yj=p.createContext(new Map);yj.displayName="Fetchers";var xj=p.createContext(null);xj.displayName="Await";var Cn=p.createContext(null);Cn.displayName="Navigation";var Ns=p.createContext(null);Ns.displayName="Location";var ya=p.createContext({outlet:null,matches:[],isDataRoute:!1});ya.displayName="Route";var sh=p.createContext(null);sh.displayName="RouteError";var vx="REACT_ROUTER_ERROR",bj="REDIRECT",Sj="ROUTE_ERROR_RESPONSE";function wj(a){if(a.startsWith(`${vx}:${bj}:{`))try{let l=JSON.parse(a.slice(28));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.location=="string"&&typeof l.reloadDocument=="boolean"&&typeof l.replace=="boolean")return l}catch{}}function jj(a){if(a.startsWith(`${vx}:${Sj}:{`))try{let l=JSON.parse(a.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new dj(l.status,l.statusText,l.data)}catch{}}function Cj(a,{relative:l}={}){ht(go(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:i}=p.useContext(Cn),{hash:u,pathname:f,search:h}=As(a,{relative:l}),m=f;return o!=="/"&&(m=f==="/"?o:Jn([o,f])),i.createHref({pathname:m,search:h,hash:u})}function go(){return p.useContext(Ns)!=null}function cn(){return ht(go(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(Ns).location}var yx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function xx(a){p.useContext(Cn).static||p.useLayoutEffect(a)}function vo(){let{isDataRoute:a}=p.useContext(ya);return a?Uj():Ej()}function Ej(){ht(go(),"useNavigate() may be used only in the context of a <Router> component.");let a=p.useContext(po),{basename:l,navigator:o}=p.useContext(Cn),{matches:i}=p.useContext(ya),{pathname:u}=cn(),f=JSON.stringify(oh(i)),h=p.useRef(!1);return xx(()=>{h.current=!0}),p.useCallback((g,v={})=>{if(Vn(h.current,yx),!h.current)return;if(typeof g=="number"){o.go(g);return}let S=Sc(g,JSON.parse(f),u,v.relative==="path");a==null&&l!=="/"&&(S.pathname=S.pathname==="/"?l:Jn([l,S.pathname])),(v.replace?o.replace:o.push)(S,v.state,v)},[l,o,f,u,a])}p.createContext(null);function As(a,{relative:l}={}){let{matches:o}=p.useContext(ya),{pathname:i}=cn(),u=JSON.stringify(oh(o));return p.useMemo(()=>Sc(a,JSON.parse(u),i,l==="path"),[a,u,i,l])}function Rj(a,l){return bx(a,l)}function bx(a,l,o){var C;ht(go(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=p.useContext(Cn),{matches:u}=p.useContext(ya),f=u[u.length-1],h=f?f.params:{},m=f?f.pathname:"/",g=f?f.pathnameBase:"/",v=f&&f.route;{let N=v&&v.path||"";wx(m,!v||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${N}">) 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.
59
+
60
+ Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let S=cn(),b;if(l){let N=typeof l=="string"?mo(l):l;ht(g==="/"||((C=N.pathname)==null?void 0:C.startsWith(g)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${N.pathname}" was given in the \`location\` prop.`),b=N}else b=S;let x=b.pathname||"/",w=x;if(g!=="/"){let N=g.replace(/^\//,"").split("/");w="/"+x.replace(/^\//,"").split("/").slice(N.length).join("/")}let R=o&&o.state.matches.length?o.state.matches.map(N=>Object.assign(N,{route:o.manifest[N.route.id]||N.route})):ox(a,{pathname:w});Vn(v||R!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Vn(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.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.`);let j=_j(R&&R.map(N=>Object.assign({},N,{params:Object.assign({},h,N.params),pathname:Jn([g,i.encodeLocation?i.encodeLocation(N.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?g:Jn([g,i.encodeLocation?i.encodeLocation(N.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),u,o);return l&&j?p.createElement(Ns.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...b},navigationType:"POP"}},j):j}function Tj(){let a=Lj(),l=fj(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),o=a instanceof Error?a.stack:null,i="rgba(200,200,200, 0.5)",u={padding:"0.5rem",backgroundColor:i},f={padding:"2px 4px",backgroundColor:i},h=null;return console.error("Error handled by React Router default ErrorBoundary:",a),h=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:f},"ErrorBoundary")," or"," ",p.createElement("code",{style:f},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},l),o?p.createElement("pre",{style:u},o):null,h)}var Nj=p.createElement(Tj,null),Sx=class extends p.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,l){return l.location!==a.location||l.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:l.error,location:l.location,revalidation:a.revalidation||l.revalidation}}componentDidCatch(a,l){this.props.onError?this.props.onError(a,l):console.error("React Router caught the following error during render",a)}render(){let a=this.state.error;if(this.context&&typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){const o=jj(a.digest);o&&(a=o)}let l=a!==void 0?p.createElement(ya.Provider,{value:this.props.routeContext},p.createElement(sh.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?p.createElement(Aj,{error:a},l):l}};Sx.contextType=px;var pf=new WeakMap;function Aj({children:a,error:l}){let{basename:o}=p.useContext(Cn);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let i=wj(l.digest);if(i){let u=pf.get(l);if(u)throw u;let f=hx(i.location,o),h=f.absoluteURL||f.to;if(gj(h))throw new Error("Invalid redirect location");if(fx&&!pf.get(l))if(f.isExternal||i.reloadDocument)window.location.href=h;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:i.replace}));throw pf.set(l,m),m}return p.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h}`})}}return a}function Mj({routeContext:a,match:l,children:o}){let i=p.useContext(po);return i&&i.static&&i.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=l.route.id),p.createElement(ya.Provider,{value:a},o)}function _j(a,l=[],o){let i=o==null?void 0:o.state;if(a==null){if(!i)return null;if(i.errors)a=i.matches;else if(l.length===0&&!i.initialized&&i.matches.length>0)a=i.matches;else return null}let u=a,f=i==null?void 0:i.errors;if(f!=null){let S=u.findIndex(b=>b.route.id&&(f==null?void 0:f[b.route.id])!==void 0);ht(S>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),u=u.slice(0,Math.min(u.length,S+1))}let h=!1,m=-1;if(o&&i){h=i.renderFallback;for(let S=0;S<u.length;S++){let b=u[S];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(m=S),b.route.id){let{loaderData:x,errors:w}=i,R=b.route.loader&&!x.hasOwnProperty(b.route.id)&&(!w||w[b.route.id]===void 0);if(b.route.lazy||R){o.isStatic&&(h=!0),m>=0?u=u.slice(0,m+1):u=[u[0]];break}}}}let g=o==null?void 0:o.onError,v=i&&g?(S,b)=>{var x,w;g(S,{location:i.location,params:((w=(x=i.matches)==null?void 0:x[0])==null?void 0:w.params)??{},pattern:hj(i.matches),errorInfo:b})}:void 0;return u.reduceRight((S,b,x)=>{let w,R=!1,j=null,C=null;i&&(w=f&&b.route.id?f[b.route.id]:void 0,j=b.route.errorElement||Nj,h&&(m<0&&x===0?(wx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,C=null):m===x&&(R=!0,C=b.route.hydrateFallbackElement||null)));let N=l.concat(u.slice(0,x+1)),T=()=>{let A;return w?A=j:R?A=C:b.route.Component?A=p.createElement(b.route.Component,null):b.route.element?A=b.route.element:A=S,p.createElement(Mj,{match:b,routeContext:{outlet:S,matches:N,isDataRoute:i!=null},children:A})};return i&&(b.route.ErrorBoundary||b.route.errorElement||x===0)?p.createElement(Sx,{location:i.location,revalidation:i.revalidation,component:j,error:w,children:T(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:v}):T()},null)}function ih(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Oj(a){let l=p.useContext(po);return ht(l,ih(a)),l}function Dj(a){let l=p.useContext(wc);return ht(l,ih(a)),l}function zj(a){let l=p.useContext(ya);return ht(l,ih(a)),l}function ch(a){let l=zj(a),o=l.matches[l.matches.length-1];return ht(o.route.id,`${a} can only be used on routes that contain a unique "id"`),o.route.id}function kj(){return ch("useRouteId")}function Lj(){var i;let a=p.useContext(sh),l=Dj("useRouteError"),o=ch("useRouteError");return a!==void 0?a:(i=l.errors)==null?void 0:i[o]}function Uj(){let{router:a}=Oj("useNavigate"),l=ch("useNavigate"),o=p.useRef(!1);return xx(()=>{o.current=!0}),p.useCallback(async(u,f={})=>{Vn(o.current,yx),o.current&&(typeof u=="number"?await a.navigate(u):await a.navigate(u,{fromRouteId:l,...f}))},[a,l])}var jy={};function wx(a,l,o){!l&&!jy[a]&&(jy[a]=!0,Vn(!1,o))}p.memo(Hj);function Hj({routes:a,manifest:l,future:o,state:i,isStatic:u,onError:f}){return bx(a,void 0,{manifest:l,state:i,isStatic:u,onError:f})}function Of({to:a,replace:l,state:o,relative:i}){ht(go(),"<Navigate> may be used only in the context of a <Router> component.");let{static:u}=p.useContext(Cn);Vn(!u,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=p.useContext(ya),{pathname:h}=cn(),m=vo(),g=Sc(a,oh(f),h,i==="path"),v=JSON.stringify(g);return p.useEffect(()=>{m(JSON.parse(v),{replace:l,state:o,relative:i})},[m,v,i,l,o]),null}function an(a){ht(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Bj({basename:a="/",children:l=null,location:o,navigationType:i="POP",navigator:u,static:f=!1,useTransitions:h}){ht(!go(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=a.replace(/^\/*/,"/"),g=p.useMemo(()=>({basename:m,navigator:u,static:f,useTransitions:h,future:{}}),[m,u,f,h]);typeof o=="string"&&(o=mo(o));let{pathname:v="/",search:S="",hash:b="",state:x=null,key:w="default",mask:R}=o,j=p.useMemo(()=>{let C=Ka(v,m);return C==null?null:{location:{pathname:C,search:S,hash:b,state:x,key:w,mask:R},navigationType:i}},[m,v,S,b,x,w,i,R]);return Vn(j!=null,`<Router basename="${m}"> is not able to match the URL "${v}${S}${b}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:p.createElement(Cn.Provider,{value:g},p.createElement(Ns.Provider,{children:l,value:j}))}function jx({children:a,location:l}){return Rj(Df(a),l)}function Df(a,l=[]){let o=[];return p.Children.forEach(a,(i,u)=>{if(!p.isValidElement(i))return;let f=[...l,u];if(i.type===p.Fragment){o.push.apply(o,Df(i.props.children,f));return}ht(i.type===an,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ht(!i.props.index||!i.props.children,"An index route cannot have child routes.");let h={id:i.props.id||f.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(h.children=Df(i.props.children,f)),o.push(h)}),o}var ic="get",cc="application/x-www-form-urlencoded";function jc(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function Pj(a){return jc(a)&&a.tagName.toLowerCase()==="button"}function qj(a){return jc(a)&&a.tagName.toLowerCase()==="form"}function Vj(a){return jc(a)&&a.tagName.toLowerCase()==="input"}function Ij(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function Yj(a,l){return a.button===0&&(!l||l==="_self")&&!Ij(a)}function zf(a=""){return new URLSearchParams(typeof a=="string"||Array.isArray(a)||a instanceof URLSearchParams?a:Object.keys(a).reduce((l,o)=>{let i=a[o];return l.concat(Array.isArray(i)?i.map(u=>[o,u]):[[o,i]])},[]))}function Gj(a,l){let o=zf(a);return l&&l.forEach((i,u)=>{o.has(u)||l.getAll(u).forEach(f=>{o.append(u,f)})}),o}var Zi=null;function $j(){if(Zi===null)try{new FormData(document.createElement("form"),0),Zi=!1}catch{Zi=!0}return Zi}var Kj=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function gf(a){return a!=null&&!Kj.has(a)?(Vn(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${cc}"`),null):a}function Xj(a,l){let o,i,u,f,h;if(qj(a)){let m=a.getAttribute("action");i=m?Ka(m,l):null,o=a.getAttribute("method")||ic,u=gf(a.getAttribute("enctype"))||cc,f=new FormData(a)}else if(Pj(a)||Vj(a)&&(a.type==="submit"||a.type==="image")){let m=a.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=a.getAttribute("formaction")||m.getAttribute("action");if(i=g?Ka(g,l):null,o=a.getAttribute("formmethod")||m.getAttribute("method")||ic,u=gf(a.getAttribute("formenctype"))||gf(m.getAttribute("enctype"))||cc,f=new FormData(m,a),!$j()){let{name:v,type:S,value:b}=a;if(S==="image"){let x=v?`${v}.`:"";f.append(`${x}x`,"0"),f.append(`${x}y`,"0")}else v&&f.append(v,b)}}else{if(jc(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=ic,i=null,u=cc,h=a}return f&&u==="text/plain"&&(h=f,f=void 0),{action:i,method:o.toLowerCase(),encType:u,formData:f,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function uh(a,l){if(a===!1||a===null||typeof a>"u")throw new Error(l)}function Cx(a,l,o,i){let u=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return o?u.pathname.endsWith("/")?u.pathname=`${u.pathname}_.${i}`:u.pathname=`${u.pathname}.${i}`:u.pathname==="/"?u.pathname=`_root.${i}`:l&&Ka(u.pathname,l)==="/"?u.pathname=`${pc(l)}/_root.${i}`:u.pathname=`${pc(u.pathname)}.${i}`,u}async function Qj(a,l){if(a.id in l)return l[a.id];try{let o=await import(a.module);return l[a.id]=o,o}catch(o){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Fj(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function Zj(a,l,o){let i=await Promise.all(a.map(async u=>{let f=l.routes[u.route.id];if(f){let h=await Qj(f,o);return h.links?h.links():[]}return[]}));return tC(i.flat(1).filter(Fj).filter(u=>u.rel==="stylesheet"||u.rel==="preload").map(u=>u.rel==="stylesheet"?{...u,rel:"prefetch",as:"style"}:{...u,rel:"prefetch"}))}function Cy(a,l,o,i,u,f){let h=(g,v)=>o[v]?g.route.id!==o[v].route.id:!0,m=(g,v)=>{var S;return o[v].pathname!==g.pathname||((S=o[v].route.path)==null?void 0:S.endsWith("*"))&&o[v].params["*"]!==g.params["*"]};return f==="assets"?l.filter((g,v)=>h(g,v)||m(g,v)):f==="data"?l.filter((g,v)=>{var b;let S=i.routes[g.route.id];if(!S||!S.hasLoader)return!1;if(h(g,v)||m(g,v))return!0;if(g.route.shouldRevalidate){let x=g.route.shouldRevalidate({currentUrl:new URL(u.pathname+u.search+u.hash,window.origin),currentParams:((b=o[0])==null?void 0:b.params)||{},nextUrl:new URL(a,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function Jj(a,l,{includeHydrateFallback:o}={}){return Wj(a.map(i=>{let u=l.routes[i.route.id];if(!u)return[];let f=[u.module];return u.clientActionModule&&(f=f.concat(u.clientActionModule)),u.clientLoaderModule&&(f=f.concat(u.clientLoaderModule)),o&&u.hydrateFallbackModule&&(f=f.concat(u.hydrateFallbackModule)),u.imports&&(f=f.concat(u.imports)),f}).flat(1))}function Wj(a){return[...new Set(a)]}function eC(a){let l={},o=Object.keys(a).sort();for(let i of o)l[i]=a[i];return l}function tC(a,l){let o=new Set;return new Set(l),a.reduce((i,u)=>{let f=JSON.stringify(eC(u));return o.has(f)||(o.add(f),i.push({key:f,link:u})),i},[])}function dh(){let a=p.useContext(po);return uh(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function nC(){let a=p.useContext(wc);return uh(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var fh=p.createContext(void 0);fh.displayName="FrameworkContext";function Cc(){let a=p.useContext(fh);return uh(a,"You must render this element inside a <HydratedRouter> element"),a}function aC(a,l){let o=p.useContext(fh),[i,u]=p.useState(!1),[f,h]=p.useState(!1),{onFocus:m,onBlur:g,onMouseEnter:v,onMouseLeave:S,onTouchStart:b}=l,x=p.useRef(null);p.useEffect(()=>{if(a==="render"&&h(!0),a==="viewport"){let j=N=>{N.forEach(T=>{h(T.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return x.current&&C.observe(x.current),()=>{C.disconnect()}}},[a]),p.useEffect(()=>{if(i){let j=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(j)}}},[i]);let w=()=>{u(!0)},R=()=>{u(!1),h(!1)};return o?a!=="intent"?[f,x,{}]:[f,x,{onFocus:gs(m,w),onBlur:gs(g,R),onMouseEnter:gs(v,w),onMouseLeave:gs(S,R),onTouchStart:gs(b,w)}]:[!1,x,{}]}function gs(a,l){return o=>{a&&a(o),o.defaultPrevented||l(o)}}function lC({page:a,...l}){let o=vj(),{nonce:i}=Cc(),{router:u}=dh(),f=p.useMemo(()=>ox(u.routes,a,u.basename),[u.routes,a,u.basename]);return f?(l.nonce==null&&i&&(l={...l,nonce:i}),o?p.createElement(oC,{page:a,matches:f,...l}):p.createElement(sC,{page:a,matches:f,...l})):null}function rC(a){let{manifest:l,routeModules:o}=Cc(),[i,u]=p.useState([]);return p.useEffect(()=>{let f=!1;return Zj(a,l,o).then(h=>{f||u(h)}),()=>{f=!0}},[a,l,o]),i}function oC({page:a,matches:l,...o}){let i=cn(),{future:u}=Cc(),{basename:f}=dh(),h=p.useMemo(()=>{if(a===i.pathname+i.search+i.hash)return[];let m=Cx(a,f,u.v8_trailingSlashAwareDataRequests,"rsc"),g=!1,v=[];for(let S of l)typeof S.route.shouldRevalidate=="function"?g=!0:v.push(S.route.id);return g&&v.length>0&&m.searchParams.set("_routes",v.join(",")),[m.pathname+m.search]},[f,u.v8_trailingSlashAwareDataRequests,a,i,l]);return p.createElement(p.Fragment,null,h.map(m=>p.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...o})))}function sC({page:a,matches:l,...o}){let i=cn(),{future:u,manifest:f,routeModules:h}=Cc(),{basename:m}=dh(),{loaderData:g,matches:v}=nC(),S=p.useMemo(()=>Cy(a,l,v,f,i,"data"),[a,l,v,f,i]),b=p.useMemo(()=>Cy(a,l,v,f,i,"assets"),[a,l,v,f,i]),x=p.useMemo(()=>{if(a===i.pathname+i.search+i.hash)return[];let j=new Set,C=!1;if(l.forEach(T=>{var _;let A=f.routes[T.route.id];!A||!A.hasLoader||(!S.some(H=>H.route.id===T.route.id)&&T.route.id in g&&((_=h[T.route.id])!=null&&_.shouldRevalidate)||A.hasClientLoader?C=!0:j.add(T.route.id))}),j.size===0)return[];let N=Cx(a,m,u.v8_trailingSlashAwareDataRequests,"data");return C&&j.size>0&&N.searchParams.set("_routes",l.filter(T=>j.has(T.route.id)).map(T=>T.route.id).join(",")),[N.pathname+N.search]},[m,u.v8_trailingSlashAwareDataRequests,g,i,f,S,l,a,h]),w=p.useMemo(()=>Jj(b,f),[b,f]),R=rC(b);return p.createElement(p.Fragment,null,x.map(j=>p.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...o})),w.map(j=>p.createElement("link",{key:j,rel:"modulepreload",href:j,...o})),R.map(({key:j,link:C})=>p.createElement("link",{key:j,nonce:o.nonce,...C,crossOrigin:C.crossOrigin??o.crossOrigin})))}function iC(...a){return l=>{a.forEach(o=>{typeof o=="function"?o(l):o!=null&&(o.current=l)})}}var cC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{cC&&(window.__reactRouterVersion="7.18.2")}catch{}function uC({basename:a,children:l,useTransitions:o,window:i}){let u=p.useRef();u.current==null&&(u.current=Iw({window:i,v5Compat:!0}));let f=u.current,[h,m]=p.useState({action:f.action,location:f.location}),g=p.useCallback(v=>{o===!1?m(v):p.startTransition(()=>m(v))},[o]);return p.useLayoutEffect(()=>f.listen(g),[f,g]),p.createElement(Bj,{basename:a,children:l,location:h.location,navigationType:h.action,navigator:f,useTransitions:o})}var ir=p.forwardRef(function({onClick:l,discover:o="render",prefetch:i="none",relative:u,reloadDocument:f,replace:h,mask:m,state:g,target:v,to:S,preventScrollReset:b,viewTransition:x,defaultShouldRevalidate:w,...R},j){let{basename:C,navigator:N,useTransitions:T}=p.useContext(Cn),A=typeof S=="string"&&rh.test(S),_=hx(S,C);S=_.to;let H=Cj(S,{relative:u}),P=cn(),I=null;if(m){let fe=Sc(m,[],P.mask?P.mask.pathname:"/",!0);C!=="/"&&(fe.pathname=fe.pathname==="/"?C:Jn([C,fe.pathname])),I=N.createHref(fe)}let[k,ne,se]=aC(i,R),Q=hC(S,{replace:h,mask:m,state:g,target:v,preventScrollReset:b,relative:u,viewTransition:x,defaultShouldRevalidate:w,useTransitions:T});function G(fe){l&&l(fe),fe.defaultPrevented||Q(fe)}let re=!(_.isExternal||f),le=p.createElement("a",{...R,...se,href:(re?I:void 0)||_.absoluteURL||H,onClick:re?G:l,ref:iC(j,ne),target:v,"data-discover":!A&&o==="render"?"true":void 0});return k&&!A?p.createElement(p.Fragment,null,le,p.createElement(lC,{page:H})):le});ir.displayName="Link";var Ex=p.forwardRef(function({"aria-current":l="page",caseSensitive:o=!1,className:i="",end:u=!1,style:f,to:h,viewTransition:m,children:g,...v},S){let b=As(h,{relative:v.relative}),x=cn(),w=p.useContext(wc),{navigator:R,basename:j}=p.useContext(Cn),C=w!=null&&xC(b)&&m===!0,N=R.encodeLocation?R.encodeLocation(b).pathname:b.pathname,T=x.pathname,A=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;o||(T=T.toLowerCase(),A=A?A.toLowerCase():null,N=N.toLowerCase()),A&&j&&(A=Ka(A,j)||A);const _=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let H=T===N||!u&&T.startsWith(N)&&T.charAt(_)==="/",P=A!=null&&(A===N||!u&&A.startsWith(N)&&A.charAt(N.length)==="/"),I={isActive:H,isPending:P,isTransitioning:C},k=H?l:void 0,ne;typeof i=="function"?ne=i(I):ne=[i,H?"active":null,P?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let se=typeof f=="function"?f(I):f;return p.createElement(ir,{...v,"aria-current":k,className:ne,ref:S,style:se,to:h,viewTransition:m},typeof g=="function"?g(I):g)});Ex.displayName="NavLink";var dC=p.forwardRef(({discover:a="render",fetcherKey:l,navigate:o,reloadDocument:i,replace:u,state:f,method:h=ic,action:m,onSubmit:g,relative:v,preventScrollReset:S,viewTransition:b,defaultShouldRevalidate:x,...w},R)=>{let{useTransitions:j}=p.useContext(Cn),C=vC(),N=yC(m,{relative:v}),T=h.toLowerCase()==="get"?"get":"post",A=typeof m=="string"&&rh.test(m),_=H=>{if(g&&g(H),H.defaultPrevented)return;H.preventDefault();let P=H.nativeEvent.submitter,I=(P==null?void 0:P.getAttribute("formmethod"))||h,k=()=>C(P||H.currentTarget,{fetcherKey:l,method:I,navigate:o,replace:u,state:f,relative:v,preventScrollReset:S,viewTransition:b,defaultShouldRevalidate:x});j&&o!==!1?p.startTransition(()=>k()):k()};return p.createElement("form",{ref:R,method:T,action:N,onSubmit:i?g:_,...w,"data-discover":!A&&a==="render"?"true":void 0})});dC.displayName="Form";function fC(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Rx(a){let l=p.useContext(po);return ht(l,fC(a)),l}function hC(a,{target:l,replace:o,mask:i,state:u,preventScrollReset:f,relative:h,viewTransition:m,defaultShouldRevalidate:g,useTransitions:v}={}){let S=vo(),b=cn(),x=As(a,{relative:h});return p.useCallback(w=>{if(Yj(w,l)){w.preventDefault();let R=o!==void 0?o:js(b)===js(x),j=()=>S(a,{replace:R,mask:i,state:u,preventScrollReset:f,relative:h,viewTransition:m,defaultShouldRevalidate:g});v?p.startTransition(()=>j()):j()}},[b,S,x,o,i,u,l,a,f,h,m,g,v])}function mC(a){Vn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let l=p.useRef(zf(a)),o=p.useRef(!1),i=cn(),u=p.useMemo(()=>Gj(i.search,o.current?null:l.current),[i.search]),f=vo(),h=p.useCallback((m,g)=>{const v=zf(typeof m=="function"?m(new URLSearchParams(u)):m);o.current=!0,f("?"+v,g)},[f,u]);return[u,h]}var pC=0,gC=()=>`__${String(++pC)}__`;function vC(){let{router:a}=Rx("useSubmit"),{basename:l}=p.useContext(Cn),o=kj(),i=a.fetch,u=a.navigate;return p.useCallback(async(f,h={})=>{let{action:m,method:g,encType:v,formData:S,body:b}=Xj(f,l);if(h.navigate===!1){let x=h.fetcherKey||gC();await i(x,o,h.action||m,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:S,body:b,formMethod:h.method||g,formEncType:h.encType||v,flushSync:h.flushSync})}else await u(h.action||m,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:S,body:b,formMethod:h.method||g,formEncType:h.encType||v,replace:h.replace,state:h.state,fromRouteId:o,flushSync:h.flushSync,viewTransition:h.viewTransition})},[i,u,l,o])}function yC(a,{relative:l}={}){let{basename:o}=p.useContext(Cn),i=p.useContext(ya);ht(i,"useFormAction must be used inside a RouteContext");let[u]=i.matches.slice(-1),f={...As(a||".",{relative:l})},h=cn();if(a==null){f.search=h.search;let m=new URLSearchParams(f.search),g=m.getAll("index");if(g.some(S=>S==="")){m.delete("index"),g.filter(b=>b).forEach(b=>m.append("index",b));let S=m.toString();f.search=S?`?${S}`:""}}return(!a||a===".")&&u.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(f.pathname=f.pathname==="/"?o:Jn([o,f.pathname])),js(f)}function xC(a,{relative:l}={}){let o=p.useContext(gx);ht(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Rx("useViewTransitionState"),u=As(a,{relative:l});if(!o.isTransitioning)return!1;let f=Ka(o.currentLocation.pathname,i)||o.currentLocation.pathname,h=Ka(o.nextLocation.pathname,i)||o.nextLocation.pathname;return mc(u.pathname,h)!=null||mc(u.pathname,f)!=null}var yo=lx();const bC=ah(yo),SC="";class wC extends Error{constructor(l,o,i){var u;super(typeof i=="object"&&i&&"error"in i?String(((u=i.error)==null?void 0:u.message)??i):"Request failed"),this.status=l,this.type=o,this.body=i}}async function vs(a,l,o,i){var g;const u=o!==void 0,f=await fetch(`${SC}${l}`,{method:a,headers:{...u?{"content-type":"application/json"}:{},...(i==null?void 0:i.headers)??{}},body:u?JSON.stringify(o):void 0,credentials:"include",...i}),h=await f.text();let m;try{m=h?JSON.parse(h):void 0}catch{m=h}if(!f.ok)throw new wC(f.status,typeof m=="object"&&m&&"error"in m?String(((g=m.error)==null?void 0:g.type)??"error"):"error",m);return m}const we={get:(a,l)=>vs("GET",a,void 0,l),post:(a,l,o)=>vs("POST",a,l,o),patch:(a,l,o)=>vs("PATCH",a,l,o),put:(a,l,o)=>vs("PUT",a,l,o),del:a=>vs("DELETE",a)},Tx=p.createContext(void 0);function jC({children:a}){const[l,o]=p.useState(null),[i,u]=p.useState(!0),f=p.useCallback(async()=>{try{const g=await we.get("/api/admin/me");o(g)}catch{o(null)}finally{u(!1)}},[]);p.useEffect(()=>{f()},[f]);const h=p.useCallback(async(g,v,S,b)=>{const x={username:g,password:v};S&&(x.totp=S),b&&(x.recoveryCode=b);try{const w=await we.post("/api/admin/login",x);return o({id:"admin",username:w.username,totpEnabled:w.totpEnabled}),{totpRequired:!1}}catch(w){const R=w.status,j=w.type;if(R===401&&j==="totp_required")return{totpRequired:!0};throw w}},[]),m=p.useCallback(async()=>{await we.post("/api/admin/logout"),o(null)},[]);return s.jsx(Tx.Provider,{value:{user:l,loading:i,login:h,logout:m,refresh:f},children:a})}function hh(){const a=p.useContext(Tx);if(!a)throw new Error("useAuth must be inside AuthProvider");return a}/**
61
+ * @license lucide-react v0.469.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const CC=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Nx=(...a)=>a.filter((l,o,i)=>!!l&&l.trim()!==""&&i.indexOf(l)===o).join(" ").trim();/**
66
+ * @license lucide-react v0.469.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */var EC={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"};/**
71
+ * @license lucide-react v0.469.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const RC=p.forwardRef(({color:a="currentColor",size:l=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:u="",children:f,iconNode:h,...m},g)=>p.createElement("svg",{ref:g,...EC,width:l,height:l,stroke:a,strokeWidth:i?Number(o)*24/Number(l):o,className:Nx("lucide",u),...m},[...h.map(([v,S])=>p.createElement(v,S)),...Array.isArray(f)?f:[f]]));/**
76
+ * @license lucide-react v0.469.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const Ve=(a,l)=>{const o=p.forwardRef(({className:i,...u},f)=>p.createElement(RC,{ref:f,iconNode:l,className:Nx(`lucide-${CC(a)}`,i),...u}));return o.displayName=`${a}`,o};/**
81
+ * @license lucide-react v0.469.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const TC=Ve("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
86
+ * @license lucide-react v0.469.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const NC=Ve("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/**
91
+ * @license lucide-react v0.469.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const AC=Ve("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/**
96
+ * @license lucide-react v0.469.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const Ax=Ve("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
101
+ * @license lucide-react v0.469.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const MC=Ve("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
106
+ * @license lucide-react v0.469.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const _C=Ve("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
111
+ * @license lucide-react v0.469.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const mh=Ve("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
116
+ * @license lucide-react v0.469.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const OC=Ve("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
121
+ * @license lucide-react v0.469.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const DC=Ve("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
126
+ * @license lucide-react v0.469.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const zC=Ve("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]]);/**
131
+ * @license lucide-react v0.469.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const vf=Ve("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"}]]);/**
136
+ * @license lucide-react v0.469.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const Mx=Ve("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
141
+ * @license lucide-react v0.469.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const kC=Ve("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
146
+ * @license lucide-react v0.469.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const LC=Ve("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
151
+ * @license lucide-react v0.469.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const UC=Ve("FlaskConical",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);/**
156
+ * @license lucide-react v0.469.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const HC=Ve("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
161
+ * @license lucide-react v0.469.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const _x=Ve("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
166
+ * @license lucide-react v0.469.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const Ox=Ve("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:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);/**
171
+ * @license lucide-react v0.469.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const ws=Ve("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
176
+ * @license lucide-react v0.469.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const BC=Ve("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
181
+ * @license lucide-react v0.469.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const PC=Ve("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
186
+ * @license lucide-react v0.469.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const qC=Ve("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
191
+ * @license lucide-react v0.469.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const Dx=Ve("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
196
+ * @license lucide-react v0.469.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const VC=Ve("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
201
+ * @license lucide-react v0.469.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const Ms=Ve("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
206
+ * @license lucide-react v0.469.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const IC=Ve("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
211
+ * @license lucide-react v0.469.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const zx=Ve("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
216
+ * @license lucide-react v0.469.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const YC=Ve("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
221
+ * @license lucide-react v0.469.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const GC=Ve("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
226
+ * @license lucide-react v0.469.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const $C=Ve("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"}]]);/**
231
+ * @license lucide-react v0.469.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const Ec=Ve("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
236
+ * @license lucide-react v0.469.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const Rc=Ve("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
241
+ * @license lucide-react v0.469.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const KC=Ve("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 kx(a){var l,o,i="";if(typeof a=="string"||typeof a=="number")i+=a;else if(typeof a=="object")if(Array.isArray(a)){var u=a.length;for(l=0;l<u;l++)a[l]&&(o=kx(a[l]))&&(i&&(i+=" "),i+=o)}else for(o in a)a[o]&&(i&&(i+=" "),i+=o);return i}function Lx(){for(var a,l,o=0,i="",u=arguments.length;o<u;o++)(a=arguments[o])&&(l=kx(a))&&(i&&(i+=" "),i+=l);return i}const ph="-",XC=a=>{const l=FC(a),{conflictingClassGroups:o,conflictingClassGroupModifiers:i}=a;return{getClassGroupId:h=>{const m=h.split(ph);return m[0]===""&&m.length!==1&&m.shift(),Ux(m,l)||QC(h)},getConflictingClassGroupIds:(h,m)=>{const g=o[h]||[];return m&&i[h]?[...g,...i[h]]:g}}},Ux=(a,l)=>{var h;if(a.length===0)return l.classGroupId;const o=a[0],i=l.nextPart.get(o),u=i?Ux(a.slice(1),i):void 0;if(u)return u;if(l.validators.length===0)return;const f=a.join(ph);return(h=l.validators.find(({validator:m})=>m(f)))==null?void 0:h.classGroupId},Ey=/^\[(.+)\]$/,QC=a=>{if(Ey.test(a)){const l=Ey.exec(a)[1],o=l==null?void 0:l.substring(0,l.indexOf(":"));if(o)return"arbitrary.."+o}},FC=a=>{const{theme:l,prefix:o}=a,i={nextPart:new Map,validators:[]};return JC(Object.entries(a.classGroups),o).forEach(([f,h])=>{kf(h,i,f,l)}),i},kf=(a,l,o,i)=>{a.forEach(u=>{if(typeof u=="string"){const f=u===""?l:Ry(l,u);f.classGroupId=o;return}if(typeof u=="function"){if(ZC(u)){kf(u(i),l,o,i);return}l.validators.push({validator:u,classGroupId:o});return}Object.entries(u).forEach(([f,h])=>{kf(h,Ry(l,f),o,i)})})},Ry=(a,l)=>{let o=a;return l.split(ph).forEach(i=>{o.nextPart.has(i)||o.nextPart.set(i,{nextPart:new Map,validators:[]}),o=o.nextPart.get(i)}),o},ZC=a=>a.isThemeGetter,JC=(a,l)=>l?a.map(([o,i])=>{const u=i.map(f=>typeof f=="string"?l+f:typeof f=="object"?Object.fromEntries(Object.entries(f).map(([h,m])=>[l+h,m])):f);return[o,u]}):a,WC=a=>{if(a<1)return{get:()=>{},set:()=>{}};let l=0,o=new Map,i=new Map;const u=(f,h)=>{o.set(f,h),l++,l>a&&(l=0,i=o,o=new Map)};return{get(f){let h=o.get(f);if(h!==void 0)return h;if((h=i.get(f))!==void 0)return u(f,h),h},set(f,h){o.has(f)?o.set(f,h):u(f,h)}}},Hx="!",e2=a=>{const{separator:l,experimentalParseClassName:o}=a,i=l.length===1,u=l[0],f=l.length,h=m=>{const g=[];let v=0,S=0,b;for(let C=0;C<m.length;C++){let N=m[C];if(v===0){if(N===u&&(i||m.slice(C,C+f)===l)){g.push(m.slice(S,C)),S=C+f;continue}if(N==="/"){b=C;continue}}N==="["?v++:N==="]"&&v--}const x=g.length===0?m:m.substring(S),w=x.startsWith(Hx),R=w?x.substring(1):x,j=b&&b>S?b-S:void 0;return{modifiers:g,hasImportantModifier:w,baseClassName:R,maybePostfixModifierPosition:j}};return o?m=>o({className:m,parseClassName:h}):h},t2=a=>{if(a.length<=1)return a;const l=[];let o=[];return a.forEach(i=>{i[0]==="["?(l.push(...o.sort(),i),o=[]):o.push(i)}),l.push(...o.sort()),l},n2=a=>({cache:WC(a.cacheSize),parseClassName:e2(a),...XC(a)}),a2=/\s+/,l2=(a,l)=>{const{parseClassName:o,getClassGroupId:i,getConflictingClassGroupIds:u}=l,f=[],h=a.trim().split(a2);let m="";for(let g=h.length-1;g>=0;g-=1){const v=h[g],{modifiers:S,hasImportantModifier:b,baseClassName:x,maybePostfixModifierPosition:w}=o(v);let R=!!w,j=i(R?x.substring(0,w):x);if(!j){if(!R){m=v+(m.length>0?" "+m:m);continue}if(j=i(x),!j){m=v+(m.length>0?" "+m:m);continue}R=!1}const C=t2(S).join(":"),N=b?C+Hx:C,T=N+j;if(f.includes(T))continue;f.push(T);const A=u(j,R);for(let _=0;_<A.length;++_){const H=A[_];f.push(N+H)}m=v+(m.length>0?" "+m:m)}return m};function r2(){let a=0,l,o,i="";for(;a<arguments.length;)(l=arguments[a++])&&(o=Bx(l))&&(i&&(i+=" "),i+=o);return i}const Bx=a=>{if(typeof a=="string")return a;let l,o="";for(let i=0;i<a.length;i++)a[i]&&(l=Bx(a[i]))&&(o&&(o+=" "),o+=l);return o};function o2(a,...l){let o,i,u,f=h;function h(g){const v=l.reduce((S,b)=>b(S),a());return o=n2(v),i=o.cache.get,u=o.cache.set,f=m,m(g)}function m(g){const v=i(g);if(v)return v;const S=l2(g,o);return u(g,S),S}return function(){return f(r2.apply(null,arguments))}}const dt=a=>{const l=o=>o[a]||[];return l.isThemeGetter=!0,l},Px=/^\[(?:([a-z-]+):)?(.+)\]$/i,s2=/^\d+\/\d+$/,i2=new Set(["px","full","screen"]),c2=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,u2=/\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$/,d2=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,f2=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,h2=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Va=a=>io(a)||i2.has(a)||s2.test(a),Nl=a=>xo(a,"length",S2),io=a=>!!a&&!Number.isNaN(Number(a)),yf=a=>xo(a,"number",io),ys=a=>!!a&&Number.isInteger(Number(a)),m2=a=>a.endsWith("%")&&io(a.slice(0,-1)),Me=a=>Px.test(a),Al=a=>c2.test(a),p2=new Set(["length","size","percentage"]),g2=a=>xo(a,p2,qx),v2=a=>xo(a,"position",qx),y2=new Set(["image","url"]),x2=a=>xo(a,y2,j2),b2=a=>xo(a,"",w2),xs=()=>!0,xo=(a,l,o)=>{const i=Px.exec(a);return i?i[1]?typeof l=="string"?i[1]===l:l.has(i[1]):o(i[2]):!1},S2=a=>u2.test(a)&&!d2.test(a),qx=()=>!1,w2=a=>f2.test(a),j2=a=>h2.test(a),C2=()=>{const a=dt("colors"),l=dt("spacing"),o=dt("blur"),i=dt("brightness"),u=dt("borderColor"),f=dt("borderRadius"),h=dt("borderSpacing"),m=dt("borderWidth"),g=dt("contrast"),v=dt("grayscale"),S=dt("hueRotate"),b=dt("invert"),x=dt("gap"),w=dt("gradientColorStops"),R=dt("gradientColorStopPositions"),j=dt("inset"),C=dt("margin"),N=dt("opacity"),T=dt("padding"),A=dt("saturate"),_=dt("scale"),H=dt("sepia"),P=dt("skew"),I=dt("space"),k=dt("translate"),ne=()=>["auto","contain","none"],se=()=>["auto","hidden","clip","visible","scroll"],Q=()=>["auto",Me,l],G=()=>[Me,l],re=()=>["",Va,Nl],le=()=>["auto",io,Me],fe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],te=()=>["start","end","center","between","around","evenly","stretch"],L=()=>["","0",Me],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>[io,Me];return{cacheSize:500,separator:":",theme:{colors:[xs],spacing:[Va,Nl],blur:["none","",Al,Me],brightness:M(),borderColor:[a],borderRadius:["none","","full",Al,Me],borderSpacing:G(),borderWidth:re(),contrast:M(),grayscale:L(),hueRotate:M(),invert:L(),gap:G(),gradientColorStops:[a],gradientColorStopPositions:[m2,Nl],inset:Q(),margin:Q(),opacity:M(),padding:G(),saturate:M(),scale:M(),sepia:L(),skew:M(),space:G(),translate:G()},classGroups:{aspect:[{aspect:["auto","square","video",Me]}],container:["container"],columns:[{columns:[Al]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"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:[...fe(),Me]}],overflow:[{overflow:se()}],"overflow-x":[{"overflow-x":se()}],"overflow-y":[{"overflow-y":se()}],overscroll:[{overscroll:ne()}],"overscroll-x":[{"overscroll-x":ne()}],"overscroll-y":[{"overscroll-y":ne()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[j]}],"inset-x":[{"inset-x":[j]}],"inset-y":[{"inset-y":[j]}],start:[{start:[j]}],end:[{end:[j]}],top:[{top:[j]}],right:[{right:[j]}],bottom:[{bottom:[j]}],left:[{left:[j]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ys,Me]}],basis:[{basis:Q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Me]}],grow:[{grow:L()}],shrink:[{shrink:L()}],order:[{order:["first","last","none",ys,Me]}],"grid-cols":[{"grid-cols":[xs]}],"col-start-end":[{col:["auto",{span:["full",ys,Me]},Me]}],"col-start":[{"col-start":le()}],"col-end":[{"col-end":le()}],"grid-rows":[{"grid-rows":[xs]}],"row-start-end":[{row:["auto",{span:[ys,Me]},Me]}],"row-start":[{"row-start":le()}],"row-end":[{"row-end":le()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Me]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...te()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...te(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...te(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],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":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Me,l]}],"min-w":[{"min-w":[Me,l,"min","max","fit"]}],"max-w":[{"max-w":[Me,l,"none","full","min","max","fit","prose",{screen:[Al]},Al]}],h:[{h:[Me,l,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Me,l,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Me,l,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Me,l,"auto","min","max","fit"]}],"font-size":[{text:["base",Al,Nl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",yf]}],"font-family":[{font:[xs]}],"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",Me]}],"line-clamp":[{"line-clamp":["none",io,yf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Va,Me]}],"list-image":[{"list-image":["none",Me]}],"list-style-type":[{list:["none","disc","decimal",Me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[a]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[a]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Va,Nl]}],"underline-offset":[{"underline-offset":["auto",Va,Me]}],"text-decoration-color":[{decoration:[a]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:G()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me]}],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",Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...fe(),v2]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",g2]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},x2]}],"bg-color":[{bg:[a]}],"gradient-from-pos":[{from:[R]}],"gradient-via-pos":[{via:[R]}],"gradient-to-pos":[{to:[R]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[f]}],"rounded-s":[{"rounded-s":[f]}],"rounded-e":[{"rounded-e":[f]}],"rounded-t":[{"rounded-t":[f]}],"rounded-r":[{"rounded-r":[f]}],"rounded-b":[{"rounded-b":[f]}],"rounded-l":[{"rounded-l":[f]}],"rounded-ss":[{"rounded-ss":[f]}],"rounded-se":[{"rounded-se":[f]}],"rounded-ee":[{"rounded-ee":[f]}],"rounded-es":[{"rounded-es":[f]}],"rounded-tl":[{"rounded-tl":[f]}],"rounded-tr":[{"rounded-tr":[f]}],"rounded-br":[{"rounded-br":[f]}],"rounded-bl":[{"rounded-bl":[f]}],"border-w":[{border:[m]}],"border-w-x":[{"border-x":[m]}],"border-w-y":[{"border-y":[m]}],"border-w-s":[{"border-s":[m]}],"border-w-e":[{"border-e":[m]}],"border-w-t":[{"border-t":[m]}],"border-w-r":[{"border-r":[m]}],"border-w-b":[{"border-b":[m]}],"border-w-l":[{"border-l":[m]}],"border-opacity":[{"border-opacity":[N]}],"border-style":[{border:[...z(),"hidden"]}],"divide-x":[{"divide-x":[m]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[m]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[N]}],"divide-style":[{divide:z()}],"border-color":[{border:[u]}],"border-color-x":[{"border-x":[u]}],"border-color-y":[{"border-y":[u]}],"border-color-s":[{"border-s":[u]}],"border-color-e":[{"border-e":[u]}],"border-color-t":[{"border-t":[u]}],"border-color-r":[{"border-r":[u]}],"border-color-b":[{"border-b":[u]}],"border-color-l":[{"border-l":[u]}],"divide-color":[{divide:[u]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[Va,Me]}],"outline-w":[{outline:[Va,Nl]}],"outline-color":[{outline:[a]}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[a]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[Va,Nl]}],"ring-offset-color":[{"ring-offset":[a]}],shadow:[{shadow:["","inner","none",Al,b2]}],"shadow-color":[{shadow:[xs]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[i]}],contrast:[{contrast:[g]}],"drop-shadow":[{"drop-shadow":["","none",Al,Me]}],grayscale:[{grayscale:[v]}],"hue-rotate":[{"hue-rotate":[S]}],invert:[{invert:[b]}],saturate:[{saturate:[A]}],sepia:[{sepia:[H]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[g]}],"backdrop-grayscale":[{"backdrop-grayscale":[v]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[S]}],"backdrop-invert":[{"backdrop-invert":[b]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[A]}],"backdrop-sepia":[{"backdrop-sepia":[H]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[h]}],"border-spacing-x":[{"border-spacing-x":[h]}],"border-spacing-y":[{"border-spacing-y":[h]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Me]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",Me]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",Me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[ys,Me]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Me]}],accent:[{accent:["auto",a]}],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",Me]}],"caret-color":[{caret:[a]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"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",Me]}],fill:[{fill:[a,"none"]}],"stroke-w":[{stroke:[Va,Nl,yf]}],stroke:[{stroke:[a,"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"]}}},E2=o2(C2);function Ce(...a){return E2(Lx(a))}function Ht(a,l="—"){return a==null||Number.isNaN(a)?l:a.toLocaleString()}function bs(a,l=1,o="—"){return a==null||Number.isNaN(a)?o:`${(a*100).toFixed(l)}%`}function _l(a){return a?a<1e3?`${Math.round(a)} ms`:`${(a/1e3).toFixed(2)} s`:"—"}function gh(a){if(!a)return"—";try{return new Date(a).toLocaleString()}catch{return a}}function R2(a,l=8){return a?a.length>l?`${a.slice(0,l)}…`:a:"—"}const T2=[{to:"/",label:"Dashboard",icon:HC,end:!0},{to:"/providers",label:"Providers",icon:Dx},{to:"/models",label:"Models",icon:AC},{to:"/combos",label:"Combos",icon:Ox},{to:"/aliases",label:"Aliases",icon:DC},{to:"/api-keys",label:"API Keys",icon:_x},{to:"/requests",label:"Requests",icon:TC},{to:"/statistics",label:"Statistics",icon:LC},{to:"/audit",label:"Audit Logs",icon:IC},{to:"/settings",label:"Settings",icon:zC}];function N2(){const[a,l]=p.useState(null);return p.useEffect(()=>{let o=!1;return fetch("/api/admin/settings/system",{credentials:"include"}).then(i=>i.ok?i.json():null).then(i=>{!o&&(i!=null&&i.appVersion)&&l(i.appVersion)}).catch(()=>{}),()=>{o=!0}},[]),s.jsxs("aside",{className:"hidden w-60 shrink-0 border-r bg-sidebar text-sidebar-foreground md:flex md:flex-col",children:[s.jsxs("div",{className:"flex h-14 items-center gap-2 border-b px-4",children:[s.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-7 w-7 object-contain"}),s.jsx("div",{className:"font-semibold tracking-tight",children:"LateDev Router"})]}),s.jsx("nav",{className:"flex-1 space-y-0.5 p-2",children:T2.map(o=>s.jsxs(Ex,{to:o.to,end:o.end,className:({isActive:i})=>Ce("flex items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors",i?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[s.jsx(o.icon,{className:"h-4 w-4"}),o.label]},o.to))}),s.jsxs("div",{className:"border-t p-3 text-xs text-muted-foreground flex items-center gap-2",children:[s.jsx(YC,{className:"h-3.5 w-3.5 text-primary"})," ",a?`v${a}`:"v…"]})]})}var A2=Object.defineProperty,vh=(a,l)=>A2(a,"name",{value:l,configurable:!0});function Lf(a,l){if(typeof a=="function")return a(l);a!=null&&(a.current=l)}vh(Lf,"setRef");function Vx(...a){return l=>{let o=!1;const i=a.map(u=>{const f=Lf(u,l);return!o&&typeof f=="function"&&(o=!0),f});if(o)return()=>{for(let u=0;u<i.length;u++){const f=i[u];typeof f=="function"?f():Lf(a[u],null)}}}}vh(Vx,"composeRefs");function Pe(...a){return p.useCallback(Vx(...a),a)}vh(Pe,"useComposedRefs");var M2=Object.defineProperty,na=(a,l)=>M2(a,"name",{value:l,configurable:!0});function pa(a){const l=p.forwardRef((o,i)=>{let{children:u,...f}=o,h=null,m=!1;const g=[];Uf(u)&&typeof Ji=="function"&&(u=Ji(u._payload)),p.Children.forEach(u,x=>{var w;if(Kx(x)){m=!0;const R=x;let j="child"in R.props?R.props.child:R.props.children;Uf(j)&&typeof Ji=="function"&&(j=Ji(j._payload)),h=O2(R,j),g.push((w=h==null?void 0:h.props)==null?void 0:w.children)}else g.push(x)}),h?h=p.cloneElement(h,void 0,g):!m&&p.Children.count(u)===1&&p.isValidElement(u)&&(h=u);const v=h?$x(h):void 0,S=Pe(i,v);if(!h){if(u||u===0)throw new Error(m?k2(a):z2(a));return u}const b=Gx(f,h.props??{});return h.type!==p.Fragment&&(b.ref=i?S:v),p.cloneElement(h,b)});return l.displayName=`${a}.Slot`,l}na(pa,"createSlot");var _2=pa("Slot"),Ix=Symbol.for("radix.slottable");function Yx(a){const l=na(o=>"child"in o?o.children(o.child):o.children,"Slottable");return l.displayName=`${a}.Slottable`,l.__radixId=Ix,l}na(Yx,"createSlottable");var O2=na((a,l)=>{if("child"in a.props){const o=a.props.child;return p.isValidElement(o)?p.cloneElement(o,void 0,a.props.children(o.props.children)):null}return p.isValidElement(l)?l:null},"getSlottableElementFromSlottable");function Gx(a,l){const o={...l};for(const i in l){const u=a[i],f=l[i];/^on[A-Z]/.test(i)?u&&f?o[i]=(...m)=>{const g=f(...m);return u(...m),g}:u&&(o[i]=u):i==="style"?o[i]={...u,...f}:i==="className"&&(o[i]=[u,f].filter(Boolean).join(" "))}return{...a,...o}}na(Gx,"mergeProps");function $x(a){var i,u;let l=(i=Object.getOwnPropertyDescriptor(a.props,"ref"))==null?void 0:i.get,o=l&&"isReactWarning"in l&&l.isReactWarning;return o?a.ref:(l=(u=Object.getOwnPropertyDescriptor(a,"ref"))==null?void 0:u.get,o=l&&"isReactWarning"in l&&l.isReactWarning,o?a.props.ref:a.props.ref||a.ref)}na($x,"getElementRef");function Kx(a){return p.isValidElement(a)&&typeof a.type=="function"&&"__radixId"in a.type&&a.type.__radixId===Ix}na(Kx,"isSlottable");var D2=Symbol.for("react.lazy");function Uf(a){return a!=null&&typeof a=="object"&&"$$typeof"in a&&a.$$typeof===D2&&"_payload"in a&&Xx(a._payload)}na(Uf,"isLazyComponent");function Xx(a){return typeof a=="object"&&a!==null&&"then"in a}na(Xx,"isPromiseLike");var z2=na(a=>`${a} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),k2=na(a=>`${a} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Ji=ho[" use ".trim().toString()];const Ty=a=>typeof a=="boolean"?`${a}`:a===0?"0":a,Ny=Lx,Qx=(a,l)=>o=>{var i;if((l==null?void 0:l.variants)==null)return Ny(a,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:u,defaultVariants:f}=l,h=Object.keys(u).map(v=>{const S=o==null?void 0:o[v],b=f==null?void 0:f[v];if(S===null)return null;const x=Ty(S)||Ty(b);return u[v][x]}),m=o&&Object.entries(o).reduce((v,S)=>{let[b,x]=S;return x===void 0||(v[b]=x),v},{}),g=l==null||(i=l.compoundVariants)===null||i===void 0?void 0:i.reduce((v,S)=>{let{class:b,className:x,...w}=S;return Object.entries(w).every(R=>{let[j,C]=R;return Array.isArray(C)?C.includes({...f,...m}[j]):{...f,...m}[j]===C})?[...v,b,x]:v},[]);return Ny(a,h,g,o==null?void 0:o.class,o==null?void 0:o.className)},L2=Qx("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",{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-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-6",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),he=p.forwardRef(({className:a,variant:l,size:o,asChild:i=!1,...u},f)=>{const h=i?_2:"button";return s.jsx(h,{className:Ce(L2({variant:l,size:o,className:a})),ref:f,...u})});he.displayName="Button";const Fx=p.createContext(void 0);function U2({children:a,defaultTheme:l="system",storageKey:o="latedev-theme"}){const[i,u]=p.useState(()=>localStorage.getItem(o)||l);p.useEffect(()=>{const h=window.document.documentElement;if(h.classList.remove("light","dark"),i==="system"){const m=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";h.classList.add(m);return}h.classList.add(i)},[i]);const f={theme:i,setTheme:h=>{localStorage.setItem(o,h),u(h)}};return s.jsx(Fx.Provider,{value:f,children:a})}function H2(){const a=p.useContext(Fx);if(!a)throw new Error("useTheme must be used within ThemeProvider");return a}var B2=Object.defineProperty,bo=(a,l)=>B2(a,"name",{value:l,configurable:!0}),Zx=!!(typeof window<"u"&&window.document&&window.document.createElement);function Se(a,l,{checkForDefaultPrevented:o=!0}={}){return bo(function(u){if(a==null||a(u),o===!1||!u||!u.defaultPrevented)return l==null?void 0:l(u)},"handleEvent")}bo(Se,"composeEventHandlers");function P2(a){var l;if(!Zx)throw new Error("Cannot access window outside of the DOM");return((l=a==null?void 0:a.ownerDocument)==null?void 0:l.defaultView)??window}bo(P2,"getOwnerWindow");function Hf(a){if(!Zx)throw new Error("Cannot access document outside of the DOM");return(a==null?void 0:a.ownerDocument)??document}bo(Hf,"getOwnerDocument");function Jx(a,l=!1){const{activeElement:o}=Hf(a);if(!(o!=null&&o.nodeName))return null;if(Wx(o)&&o.contentDocument)return Jx(o.contentDocument.body,l);if(l){const i=o.getAttribute("aria-activedescendant");if(i){const u=Hf(o).getElementById(i);if(u)return u}}return o}bo(Jx,"getActiveElement");function Wx(a){return a.tagName==="IFRAME"}bo(Wx,"isFrame");var q2=Object.defineProperty,Un=(a,l)=>q2(a,"name",{value:l,configurable:!0});function V2(a,l){const o=p.createContext(l);o.displayName=a+"Context";const i=Un(f=>{const{children:h,...m}=f,g=p.useMemo(()=>m,Object.values(m));return s.jsx(o.Provider,{value:g,children:h})},"Provider");i.displayName=a+"Provider";function u(f,h={}){const{optional:m=!1}=h,g=p.useContext(o);if(g)return g;if(l!==void 0)return l;if(!m)throw new Error(`\`${f}\` must be used within \`${a}\``)}return Un(u,"useContext"),[i,u]}Un(V2,"createContext");function un(a,l=[]){let o=[];function i(f,h){const m=p.createContext(h);m.displayName=f+"Context";const g=o.length;o=[...o,h];const v=Un(b=>{var N;const{scope:x,children:w,...R}=b,j=((N=x==null?void 0:x[a])==null?void 0:N[g])||m,C=p.useMemo(()=>R,Object.values(R));return s.jsx(j.Provider,{value:C,children:w})},"Provider");v.displayName=f+"Provider";function S(b,x,w={}){var N;const{optional:R=!1}=w,j=((N=x==null?void 0:x[a])==null?void 0:N[g])||m,C=p.useContext(j);if(C)return C;if(h!==void 0)return h;if(!R)throw new Error(`\`${b}\` must be used within \`${f}\``)}return Un(S,"useContext"),[v,S]}Un(i,"createContext");const u=Un(()=>{const f=o.map(h=>p.createContext(h));return Un(function(m){const g=(m==null?void 0:m[a])||f;return p.useMemo(()=>({[`__scope${a}`]:{...m,[a]:g}}),[m,g])},"useScope")},"createScope");return u.scopeName=a,[i,eb(u,...l)]}Un(un,"createContextScope");function eb(...a){const l=a[0];if(a.length===1)return l;const o=Un(()=>{const i=a.map(u=>({useScope:u(),scopeName:u.scopeName}));return Un(function(f){const h=i.reduce((m,{useScope:g,scopeName:v})=>{const b=g(f)[`__scope${v}`];return{...m,...b}},{});return p.useMemo(()=>({[`__scope${l.scopeName}`]:h}),[h])},"useComposedScopes")},"createScope");return o.scopeName=l.scopeName,o}Un(eb,"composeContextScopes");var Tt=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},I2=Object.defineProperty,Y2=(a,l)=>I2(a,"name",{value:l,configurable:!0}),Ay=ho[" useEffectEvent ".trim().toString()],My=ho[" useInsertionEffect ".trim().toString()];function tb(a){if(typeof Ay=="function")return Ay(a);const l=p.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof My=="function"?My(()=>{l.current=a}):Tt(()=>{l.current=a}),p.useMemo(()=>((...o)=>{var i;return(i=l.current)==null?void 0:i.call(l,...o)}),[])}Y2(tb,"useEffectEvent");var G2=Object.defineProperty,_s=(a,l)=>G2(a,"name",{value:l,configurable:!0}),$2=ho[" useInsertionEffect ".trim().toString()]||Tt;function Xa({prop:a,defaultProp:l,onChange:o=_s(()=>{},"onChange"),caller:i}){const[u,f,h]=nb({defaultProp:l,onChange:o}),m=a!==void 0,g=m?a:u,v=p.useCallback(S=>{var b;if(m){const x=ab(S)?S(a):S;x!==a&&((b=h.current)==null||b.call(h,x))}else f(S)},[m,a,f,h]);return[g,v]}_s(Xa,"useControllableState");function nb({defaultProp:a,onChange:l}){const[o,i]=p.useState(a),u=p.useRef(o),f=p.useRef(l);return $2(()=>{f.current=l},[l]),p.useEffect(()=>{var h;u.current!==o&&((h=f.current)==null||h.call(f,o),u.current=o)},[o,u]),[o,i,f]}_s(nb,"useUncontrolledState");function ab(a){return typeof a=="function"}_s(ab,"isFunction");var _y=Symbol("RADIX:SYNC_STATE");function K2(a,l,o,i){const{prop:u,defaultProp:f,onChange:h,caller:m}=l,g=u!==void 0,v=tb(h),S=[{...o,state:f}];i&&S.push(i);const[b,x]=p.useReducer((C,N)=>{if(N.type===_y)return{...C,state:N.state};const T=a(C,N);return g&&!Object.is(T.state,C.state)&&v(T.state),T},...S),w=b.state,R=p.useRef(w);p.useEffect(()=>{R.current!==w&&(R.current=w,g||v(w))},[w,R,g]);const j=p.useMemo(()=>u!==void 0?{...b,state:u}:b,[b,u]);return p.useEffect(()=>{g&&!Object.is(u,b.state)&&x({type:_y,state:u})},[u,b.state,g]),[j,x]}_s(K2,"useControllableStateReducer");var X2=Object.defineProperty,Q2=(a,l)=>X2(a,"name",{value:l,configurable:!0}),F2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Le=F2.reduce((a,l)=>{const o=pa(`Primitive.${l}`),i=p.forwardRef((u,f)=>{const{asChild:h,...m}=u,g=h?o:l;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(g,{...m,ref:f})});return i.displayName=`Primitive.${l}`,{...a,[l]:i}},{});function yh(a,l){a&&yo.flushSync(()=>a.dispatchEvent(l))}Q2(yh,"dispatchDiscreteCustomEvent");var Z2=Object.defineProperty,_t=(a,l)=>Z2(a,"name",{value:l,configurable:!0});function Tc(a){const l=a+"CollectionProvider",[o,i]=un(l),[u,f]=o(l,{collectionRef:{current:null},itemMap:new Map}),h=_t(j=>{const{scope:C,children:N}=j,T=p.useRef(null),A=p.useRef(new Map).current;return s.jsx(u,{scope:C,itemMap:A,collectionRef:T,children:N})},"CollectionProvider");h.displayName=l;const m=a+"CollectionSlot",g=pa(m),v=p.forwardRef((j,C)=>{const{scope:N,children:T}=j,A=f(m,N),_=Pe(C,A.collectionRef);return s.jsx(g,{ref:_,children:T})});v.displayName=m;const S=a+"CollectionItemSlot",b="data-radix-collection-item",x=pa(S),w=p.forwardRef((j,C)=>{const{scope:N,children:T,...A}=j,_=p.useRef(null),H=Pe(C,_),P=f(S,N);return p.useEffect(()=>(P.itemMap.set(_,{ref:_,...A}),()=>void P.itemMap.delete(_))),s.jsx(x,{[b]:"",ref:H,children:T})});w.displayName=S;function R(j){const C=f(a+"CollectionConsumer",j);return p.useCallback(()=>{const T=C.collectionRef.current;if(!T)return[];const A=Array.from(T.querySelectorAll(`[${b}]`));return Array.from(C.itemMap.values()).sort((P,I)=>A.indexOf(P.ref.current)-A.indexOf(I.ref.current))},[C.collectionRef,C.itemMap])}return _t(R,"useCollection"),[{Provider:h,Slot:v,ItemSlot:w},R,i]}_t(Tc,"createCollection");var Oy=new WeakMap,Et,yn,xf=(yn=class extends Map{constructor(o){super(o);sy(this,Et);of(this,Et,[...super.keys()]),Oy.set(this,!0)}set(o,i){return Oy.get(this)&&(this.has(o)?qt(this,Et)[qt(this,Et).indexOf(o)]=o:qt(this,Et).push(o)),super.set(o,i),this}insert(o,i,u){const f=this.has(i),h=qt(this,Et).length,m=xh(o);let g=m>=0?m:h+m;const v=g<0||g>=h?-1:g;if(v===this.size||f&&v===this.size-1||v===-1)return this.set(i,u),this;const S=this.size+(f?0:1);m<0&&g++;const b=[...qt(this,Et)];let x,w=!1;for(let R=g;R<S;R++)if(g===R){let j=b[R];b[R]===i&&(j=b[R+1]),f&&this.delete(i),x=this.get(j),this.set(i,u)}else{!w&&b[R-1]===i&&(w=!0);const j=b[w?R:R-1],C=x;x=this.get(j),this.delete(j),this.set(j,C)}return this}with(o,i,u){const f=new yn(this);return f.insert(o,i,u),f}before(o){const i=qt(this,Et).indexOf(o)-1;if(!(i<0))return this.entryAt(i)}setBefore(o,i,u){const f=qt(this,Et).indexOf(o);return f===-1?this:this.insert(f,i,u)}after(o){let i=qt(this,Et).indexOf(o);if(i=i===-1||i===this.size-1?-1:i+1,i!==-1)return this.entryAt(i)}setAfter(o,i,u){const f=qt(this,Et).indexOf(o);return f===-1?this:this.insert(f+1,i,u)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return of(this,Et,[]),super.clear()}delete(o){const i=super.delete(o);return i&&qt(this,Et).splice(qt(this,Et).indexOf(o),1),i}deleteAt(o){const i=this.keyAt(o);return i!==void 0?this.delete(i):!1}at(o){const i=uc(qt(this,Et),o);if(i!==void 0)return this.get(i)}entryAt(o){const i=uc(qt(this,Et),o);if(i!==void 0)return[i,this.get(i)]}indexOf(o){return qt(this,Et).indexOf(o)}keyAt(o){return uc(qt(this,Et),o)}from(o,i){const u=this.indexOf(o);if(u===-1)return;let f=u+i;return f<0&&(f=0),f>=this.size&&(f=this.size-1),this.at(f)}keyFrom(o,i){const u=this.indexOf(o);if(u===-1)return;let f=u+i;return f<0&&(f=0),f>=this.size&&(f=this.size-1),this.keyAt(f)}find(o,i){let u=0;for(const f of this){if(Reflect.apply(o,i,[f,u,this]))return f;u++}}findIndex(o,i){let u=0;for(const f of this){if(Reflect.apply(o,i,[f,u,this]))return u;u++}return-1}filter(o,i){const u=[];let f=0;for(const h of this)Reflect.apply(o,i,[h,f,this])&&u.push(h),f++;return new yn(u)}map(o,i){const u=[];let f=0;for(const h of this)u.push([h[0],Reflect.apply(o,i,[h,f,this])]),f++;return new yn(u)}reduce(...o){const[i,u]=o;let f=0,h=u??this.at(0);for(const m of this)f===0&&o.length===1?h=m:h=Reflect.apply(i,this,[h,m,f,this]),f++;return h}reduceRight(...o){const[i,u]=o;let f=u??this.at(-1);for(let h=this.size-1;h>=0;h--){const m=this.at(h);h===this.size-1&&o.length===1?f=m:f=Reflect.apply(i,this,[f,m,h,this])}return f}toSorted(o){const i=[...this.entries()].sort(o);return new yn(i)}toReversed(){const o=new yn;for(let i=this.size-1;i>=0;i--){const u=this.keyAt(i),f=this.get(u);o.set(u,f)}return o}toSpliced(...o){const i=[...this.entries()];return i.splice(...o),new yn(i)}slice(o,i){const u=new yn;let f=this.size-1;if(o===void 0)return u;o<0&&(o=o+this.size),i!==void 0&&i>0&&(f=i-1);for(let h=o;h<=f;h++){const m=this.keyAt(h),g=this.get(m);u.set(m,g)}return u}every(o,i){let u=0;for(const f of this){if(!Reflect.apply(o,i,[f,u,this]))return!1;u++}return!0}some(o,i){let u=0;for(const f of this){if(Reflect.apply(o,i,[f,u,this]))return!0;u++}return!1}},Et=new WeakMap,_t(yn,"OrderedDict"),yn);function uc(a,l){if("at"in Array.prototype)return Array.prototype.at.call(a,l);const o=lb(a,l);return o===-1?void 0:a[o]}_t(uc,"at");function lb(a,l){const o=a.length,i=xh(l),u=i>=0?i:o+i;return u<0||u>=o?-1:u}_t(lb,"toSafeIndex");function xh(a){return a!==a||a===0?0:Math.trunc(a)}_t(xh,"toSafeInteger");function J2(a){const l=a+"CollectionProvider",[o,i]=un(l),[u,f]=o(l,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new xf,setItemMap:_t(()=>{},"setItemMap")}),h=_t(({state:A,..._})=>A?s.jsx(g,{..._,state:A}):s.jsx(m,{..._}),"CollectionProvider");h.displayName=l;const m=_t(A=>{const _=C();return s.jsx(g,{...A,state:_})},"CollectionInit");m.displayName=l+"Init";const g=_t(A=>{const{scope:_,children:H,state:P}=A,I=p.useRef(null),[k,ne]=p.useState(null),se=Pe(I,ne),[Q,G]=P;return p.useEffect(()=>{if(!k)return;const re=sb(()=>{});return re.observe(k,{childList:!0,subtree:!0}),()=>{re.disconnect()}},[k]),s.jsx(u,{scope:_,itemMap:Q,setItemMap:G,collectionRef:se,collectionRefObject:I,collectionElement:k,children:H})},"CollectionProviderImpl");g.displayName=l+"Impl";const v=a+"CollectionSlot",S=pa(v),b=p.forwardRef((A,_)=>{const{scope:H,children:P}=A,I=f(v,H),k=Pe(_,I.collectionRef);return s.jsx(S,{ref:k,children:P})});b.displayName=v;const x=a+"CollectionItemSlot",w="data-radix-collection-item",R=pa(x),j=p.forwardRef((A,_)=>{const{scope:H,children:P,...I}=A,k=p.useRef(null),[ne,se]=p.useState(null),Q=Pe(_,k,se),G=f(x,H),{setItemMap:re}=G,le=p.useRef(I);rb(le.current,I)||(le.current=I);const fe=le.current;return p.useEffect(()=>{const z=fe;return re($=>ne?$.has(ne)?$.set(ne,{...z,element:ne}).toSorted(Bf):($.set(ne,{...z,element:ne}),$.toSorted(Bf)):$),()=>{re($=>!ne||!$.has(ne)?$:($.delete(ne),new xf($)))}},[ne,fe,re]),s.jsx(R,{[w]:"",ref:Q,children:P})});j.displayName=x;function C(){return p.useState(new xf)}_t(C,"useInitCollection");function N(A){const{itemMap:_}=f(a+"CollectionConsumer",A);return _}return _t(N,"useCollection"),[{Provider:h,Slot:b,ItemSlot:j},{createCollectionScope:i,useCollection:N,useInitCollection:C}]}_t(J2,"createCollection");function rb(a,l){if(a===l)return!0;if(typeof a!="object"||typeof l!="object"||a==null||l==null)return!1;const o=Object.keys(a),i=Object.keys(l);if(o.length!==i.length)return!1;for(const u of o)if(!Object.prototype.hasOwnProperty.call(l,u)||a[u]!==l[u])return!1;return!0}_t(rb,"shallowEqual");function ob(a,l){return!!(l.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_PRECEDING)}_t(ob,"isElementPreceding");function Bf(a,l){return!a[1].element||!l[1].element?0:ob(a[1].element,l[1].element)?-1:1}_t(Bf,"sortByDocumentPosition");function sb(a){return new MutationObserver(o=>{for(const i of o)if(i.type==="childList"){a();return}})}_t(sb,"getChildListObserver");var W2=Object.defineProperty,eE=(a,l)=>W2(a,"name",{value:l,configurable:!0}),tE=p.createContext(void 0);function Os(a){const l=p.useContext(tE);return a||l||"ltr"}eE(Os,"useDirection");var nE=Object.defineProperty,aE=(a,l)=>nE(a,"name",{value:l,configurable:!0});function In(a){const l=p.useRef(a);return p.useEffect(()=>{l.current=a}),p.useMemo(()=>((...o)=>{var i;return(i=l.current)==null?void 0:i.call(l,...o)}),[])}aE(In,"useCallbackRef");var lE=Object.defineProperty,Mt=(a,l)=>lE(a,"name",{value:l,configurable:!0}),Pf="dismissableLayer.update",rE="dismissableLayer.pointerDownOutside",oE="dismissableLayer.focusOutside",Dy,ib=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Nc=p.forwardRef(Mt(function(l,o){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:u=!1,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:m,onInteractOutside:g,onDismiss:v,...S}=l,b=p.useContext(ib),[x,w]=p.useState(null),R=(x==null?void 0:x.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,j]=p.useState({}),C=Pe(o,w),N=Array.from(b.layers),[T]=[...b.layersWithOutsidePointerEventsDisabled].slice(-1),A=T?N.indexOf(T):-1,_=x?N.indexOf(x):-1,H=b.layersWithOutsidePointerEventsDisabled.size>0,P=_>=A,I=p.useRef(!1),k=ub(G=>{h==null||h(G),g==null||g(G),G.defaultPrevented||v==null||v()},{ownerDocument:R,deferPointerDownOutside:u,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:b.dismissableSurfaces,shouldHandlePointerDownOutside:p.useCallback(G=>{if(!(G instanceof Node))return!1;const re=[...b.branches].some(le=>le.contains(G));return P&&!re},[b.branches,P])}),ne=db(G=>{if(u&&I.current)return;const re=G.target;[...b.branches].some(fe=>fe.contains(re))||(m==null||m(G),g==null||g(G),G.defaultPrevented||v==null||v())},R),se=x?_===N.length-1:!1,Q=In(G=>{G.key==="Escape"&&(f==null||f(G),!G.defaultPrevented&&v&&(G.preventDefault(),v()))});return p.useEffect(()=>{if(se)return R.addEventListener("keydown",Q,{capture:!0}),()=>R.removeEventListener("keydown",Q,{capture:!0})},[R,se,Q]),p.useEffect(()=>{if(x)return i&&(b.layersWithOutsidePointerEventsDisabled.size===0&&(Dy=R.body.style.pointerEvents,R.body.style.pointerEvents="none"),b.layersWithOutsidePointerEventsDisabled.add(x)),b.layers.add(x),qf(),()=>{i&&(b.layersWithOutsidePointerEventsDisabled.delete(x),b.layersWithOutsidePointerEventsDisabled.size===0&&(R.body.style.pointerEvents=Dy))}},[x,R,i,b]),p.useEffect(()=>()=>{x&&(b.layers.delete(x),b.layersWithOutsidePointerEventsDisabled.delete(x),qf())},[x,b]),p.useEffect(()=>{const G=Mt(()=>j({}),"handleUpdate");return document.addEventListener(Pf,G),()=>document.removeEventListener(Pf,G)},[]),s.jsx(Le.div,{...S,ref:C,style:{pointerEvents:H?P?"auto":"none":void 0,...l.style},onFocusCapture:Se(l.onFocusCapture,ne.onFocusCapture),onBlurCapture:Se(l.onBlurCapture,ne.onBlurCapture),onPointerDownCapture:Se(l.onPointerDownCapture,k.onPointerDownCapture)})},"DismissableLayer"));function cb(){const a=p.useContext(ib),[l,o]=p.useState(null);return p.useEffect(()=>{if(l)return a.dismissableSurfaces.add(l),()=>{a.dismissableSurfaces.delete(l)}},[l,a.dismissableSurfaces]),o}Mt(cb,"useDismissableLayerSurface");var sE=Mt(()=>!0,"IS_TRUE");function ub(a,l){const{ownerDocument:o=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:u,dismissableSurfaces:f,shouldHandlePointerDownOutside:h=sE}=l,m=In(a),g=p.useRef(!1),v=p.useRef(!1),S=p.useRef(new Map),b=p.useRef(()=>{});return p.useEffect(()=>{function x(){v.current=!1,u.current=!1,S.current.clear()}Mt(x,"resetOutsideInteraction");function w(){return Array.from(S.current.values()).some(Boolean)}Mt(w,"isOutsideInteractionIntercepted");function R(A){if(!v.current)return;const _=A.target;_ instanceof Node&&[...f].some(P=>P.contains(_))||S.current.set(A.type,!0),A.type==="click"&&window.setTimeout(()=>{v.current&&b.current()},0)}Mt(R,"handleInteractionCapture");function j(A){v.current&&S.current.set(A.type,!1)}Mt(j,"handleInteractionBubble");const C=Mt(A=>{if(A.target&&!g.current){let _=function(){o.removeEventListener("click",b.current);const P=w();x(),P||bh(rE,m,H,{discrete:!0})};if(Mt(_,"handleAndDispatchPointerDownOutsideEvent"),!h(A.target)){o.removeEventListener("click",b.current),x(),g.current=!1;return}const H={originalEvent:A};v.current=!0,u.current=i&&A.button===0,S.current.clear(),!i||A.button!==0?_():(o.removeEventListener("click",b.current),b.current=_,o.addEventListener("click",b.current,{once:!0}))}else o.removeEventListener("click",b.current),x();g.current=!1},"handlePointerDown"),N=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const A of N)o.addEventListener(A,R,!0),o.addEventListener(A,j);const T=window.setTimeout(()=>{o.addEventListener("pointerdown",C)},0);return()=>{window.clearTimeout(T),o.removeEventListener("pointerdown",C),o.removeEventListener("click",b.current);for(const A of N)o.removeEventListener(A,R,!0),o.removeEventListener(A,j)}},[o,m,i,u,f,h]),{onPointerDownCapture:Mt(()=>g.current=!0,"onPointerDownCapture")}}Mt(ub,"usePointerDownOutside");function db(a,l=globalThis==null?void 0:globalThis.document){const o=In(a),i=p.useRef(!1);return p.useEffect(()=>{const u=Mt(f=>{f.target&&!i.current&&bh(oE,o,{originalEvent:f},{discrete:!1})},"handleFocus");return l.addEventListener("focusin",u),()=>l.removeEventListener("focusin",u)},[l,o]),{onFocusCapture:Mt(()=>i.current=!0,"onFocusCapture"),onBlurCapture:Mt(()=>i.current=!1,"onBlurCapture")}}Mt(db,"useFocusOutside");function qf(){const a=new CustomEvent(Pf);document.dispatchEvent(a)}Mt(qf,"dispatchUpdate");function bh(a,l,o,{discrete:i}){const u=o.originalEvent.target,f=new CustomEvent(a,{bubbles:!1,cancelable:!0,detail:o});l&&u.addEventListener(a,l,{once:!0}),i?yh(u,f):u.dispatchEvent(f)}Mt(bh,"handleAndDispatchCustomEvent");var iE=Object.defineProperty,Sh=(a,l)=>iE(a,"name",{value:l,configurable:!0}),Wi=0,da=null;function cE(a){return Ds(),a.children}Sh(cE,"FocusGuards");function Ds(){p.useEffect(()=>{da||(da={start:Vf(),end:Vf()});const{start:a,end:l}=da;return document.body.firstElementChild!==a&&document.body.insertAdjacentElement("afterbegin",a),document.body.lastElementChild!==l&&document.body.insertAdjacentElement("beforeend",l),Wi++,()=>{Wi===1&&(da==null||da.start.remove(),da==null||da.end.remove(),da=null),Wi=Math.max(0,Wi-1)}},[])}Sh(Ds,"useFocusGuards");function Vf(){const a=document.createElement("span");return a.setAttribute("data-radix-focus-guard",""),a.tabIndex=0,a.style.outline="none",a.style.opacity="0",a.style.position="fixed",a.style.pointerEvents="none",a}Sh(Vf,"createFocusGuard");var uE=Object.defineProperty,Kt=(a,l)=>uE(a,"name",{value:l,configurable:!0}),bf="focusScope.autoFocusOnMount",Sf="focusScope.autoFocusOnUnmount",zy={bubbles:!1,cancelable:!0},wh=p.forwardRef(Kt(function(l,o){const{loop:i=!1,trapped:u=!1,onMountAutoFocus:f,onUnmountAutoFocus:h,...m}=l,[g,v]=p.useState(null),S=In(f),b=In(h),x=p.useRef(null),w=Pe(o,v),R=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(u){let C=function(_){if(R.paused||!g)return;const H=_.target;g.contains(H)?x.current=H:Ia(x.current,{select:!0})},N=function(_){if(R.paused||!g)return;const H=_.relatedTarget;H!==null&&(g.contains(H)||Ia(x.current,{select:!0}))},T=function(_){if(document.activeElement===document.body)for(const P of _)P.removedNodes.length>0&&Ia(g)};Kt(C,"handleFocusIn"),Kt(N,"handleFocusOut"),Kt(T,"handleMutations"),document.addEventListener("focusin",C),document.addEventListener("focusout",N);const A=new MutationObserver(T);return g&&A.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",N),A.disconnect()}}},[u,g,R.paused]),p.useEffect(()=>{if(g){ky.add(R);const C=document.activeElement;if(!g.contains(C)){const T=new CustomEvent(bf,zy);g.addEventListener(bf,S),g.dispatchEvent(T),T.defaultPrevented||(fb(vb(jh(g)),{select:!0}),document.activeElement===C&&Ia(g))}return()=>{g.removeEventListener(bf,S),setTimeout(()=>{const T=new CustomEvent(Sf,zy);g.addEventListener(Sf,b),g.dispatchEvent(T),T.defaultPrevented||Ia(C??document.body,{select:!0}),g.removeEventListener(Sf,b),ky.remove(R)},0)}}},[g,S,b,R]);const j=p.useCallback(C=>{if(!i&&!u||R.paused)return;const N=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,T=document.activeElement;if(N&&T){const A=C.currentTarget,[_,H]=hb(A);_&&H?!C.shiftKey&&T===H?(C.preventDefault(),i&&Ia(_,{select:!0})):C.shiftKey&&T===_&&(C.preventDefault(),i&&Ia(H,{select:!0})):T===A&&C.preventDefault()}},[i,u,R.paused]);return s.jsx(Le.div,{tabIndex:-1,...m,ref:w,onKeyDown:j})},"FocusScope"));function fb(a,{select:l=!1}={}){const o=document.activeElement;for(const i of a)if(Ia(i,{select:l}),document.activeElement!==o)return}Kt(fb,"focusFirst");function hb(a){const l=jh(a),o=If(l,a),i=If(l.reverse(),a);return[o,i]}Kt(hb,"getTabbableEdges");function jh(a){const l=[],o=document.createTreeWalker(a,NodeFilter.SHOW_ELEMENT,{acceptNode:Kt(i=>{const u=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||u?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;o.nextNode();)l.push(o.currentNode);return l}Kt(jh,"getTabbableCandidates");function If(a,l){const o=typeof l.checkVisibility=="function"&&l.checkVisibility({checkVisibilityCSS:!0});for(const i of a)if(!(o?!i.checkVisibility({checkVisibilityCSS:!0}):mb(i,{upTo:l})))return i}Kt(If,"findVisible");function mb(a,{upTo:l}){if(getComputedStyle(a).visibility==="hidden")return!0;for(;a;){if(l!==void 0&&a===l)return!1;if(getComputedStyle(a).display==="none")return!0;a=a.parentElement}return!1}Kt(mb,"isHidden");function pb(a){return a instanceof HTMLInputElement&&"select"in a}Kt(pb,"isSelectableInput");function Ia(a,{select:l=!1}={}){if(a&&a.focus){const o=document.activeElement;a.focus({preventScroll:!0}),a!==o&&pb(a)&&l&&a.select()}}Kt(Ia,"focus");var ky=gb();function gb(){let a=[];return{add(l){const o=a[0];l!==o&&(o==null||o.pause()),a=Yf(a,l),a.unshift(l)},remove(l){var o;a=Yf(a,l),(o=a[0])==null||o.resume()}}}Kt(gb,"createFocusScopesStack");function Yf(a,l){const o=[...a],i=o.indexOf(l);return i!==-1&&o.splice(i,1),o}Kt(Yf,"arrayRemove");function vb(a){return a.filter(l=>l.tagName!=="A")}Kt(vb,"removeLinks");var dE=Object.defineProperty,fE=(a,l)=>dE(a,"name",{value:l,configurable:!0}),hE=ho[" useId ".trim().toString()]||(()=>{}),mE=0;function ma(a){const[l,o]=p.useState(hE());return Tt(()=>{a||o(i=>i??String(mE++))},[a]),a||(l?`radix-${l}`:"")}fE(ma,"useId");const pE=["top","right","bottom","left"],zl=Math.min,Ya=Math.max,gc=Math.round,ec=Math.floor,Ga=a=>({x:a,y:a}),gE={left:"right",right:"left",bottom:"top",top:"bottom"};function yb(a,l,o){return Ya(a,zl(l,o))}function Qa(a,l){return typeof a=="function"?a(l):a}function kl(a){return a.split("-")[0]}function So(a){return a.split("-")[1]}function Ch(a){return a==="x"?"y":"x"}function Eh(a){return a==="y"?"height":"width"}function ha(a){const l=a[0];return l==="t"||l==="b"?"y":"x"}function Rh(a){return Ch(ha(a))}function vE(a,l,o){o===void 0&&(o=!1);const i=So(a),u=Rh(a),f=Eh(u);let h=u==="x"?i===(o?"end":"start")?"right":"left":i==="start"?"bottom":"top";return l.reference[f]>l.floating[f]&&(h=vc(h)),[h,vc(h)]}function yE(a){const l=vc(a);return[Gf(a),l,Gf(l)]}function Gf(a){return a.includes("start")?a.replace("start","end"):a.replace("end","start")}const Ly=["left","right"],Uy=["right","left"],xE=["top","bottom"],bE=["bottom","top"];function SE(a,l,o){switch(a){case"top":case"bottom":return o?l?Uy:Ly:l?Ly:Uy;case"left":case"right":return l?xE:bE;default:return[]}}function wE(a,l,o,i){const u=So(a);let f=SE(kl(a),o==="start",i);return u&&(f=f.map(h=>h+"-"+u),l&&(f=f.concat(f.map(Gf)))),f}function vc(a){const l=kl(a);return gE[l]+a.slice(l.length)}function jE(a){var l,o,i,u;return{top:(l=a.top)!=null?l:0,right:(o=a.right)!=null?o:0,bottom:(i=a.bottom)!=null?i:0,left:(u=a.left)!=null?u:0}}function xb(a){return typeof a!="number"?jE(a):{top:a,right:a,bottom:a,left:a}}function yc(a){const{x:l,y:o,width:i,height:u}=a;return{width:i,height:u,top:o,left:l,right:l+i,bottom:o+u,x:l,y:o}}function Hy(a,l,o){let{reference:i,floating:u}=a;const f=ha(l),h=Rh(l),m=Eh(h),g=kl(l),v=f==="y",S=i.x+i.width/2-u.width/2,b=i.y+i.height/2-u.height/2,x=i[m]/2-u[m]/2;let w;switch(g){case"top":w={x:S,y:i.y-u.height};break;case"bottom":w={x:S,y:i.y+i.height};break;case"right":w={x:i.x+i.width,y:b};break;case"left":w={x:i.x-u.width,y:b};break;default:w={x:i.x,y:i.y}}const R=So(l);return R&&(w[h]+=x*(R==="end"?1:-1)*(o&&v?-1:1)),w}async function CE(a,l){var o;l===void 0&&(l={});const{x:i,y:u,platform:f,rects:h,elements:m,strategy:g}=a,{boundary:v="clippingAncestors",rootBoundary:S="viewport",elementContext:b="floating",altBoundary:x=!1,padding:w=0}=Qa(l,a),R=xb(w),C=m[x?b==="floating"?"reference":"floating":b],N=yc(await f.getClippingRect({element:(o=await(f.isElement==null?void 0:f.isElement(C)))==null||o?C:C.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(m.floating)),boundary:v,rootBoundary:S,strategy:g})),T=b==="floating"?{x:i,y:u,width:h.floating.width,height:h.floating.height}:h.reference,A=await(f.getOffsetParent==null?void 0:f.getOffsetParent(m.floating)),_=await(f.isElement==null?void 0:f.isElement(A))&&await(f.getScale==null?void 0:f.getScale(A))||{x:1,y:1},H=yc(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:m,rect:T,offsetParent:A,strategy:g}):T);return{top:(N.top-H.top+R.top)/_.y,bottom:(H.bottom-N.bottom+R.bottom)/_.y,left:(N.left-H.left+R.left)/_.x,right:(H.right-N.right+R.right)/_.x}}const EE=50,RE=async(a,l,o)=>{const{placement:i="bottom",strategy:u="absolute",middleware:f=[],platform:h}=o,m=h.detectOverflow?h:{...h,detectOverflow:CE},g=await(h.isRTL==null?void 0:h.isRTL(l));let v=await h.getElementRects({reference:a,floating:l,strategy:u}),{x:S,y:b}=Hy(v,i,g),x=i,w=0;const R={};for(let j=0;j<f.length;j++){const C=f[j];if(!C)continue;const{name:N,fn:T}=C,{x:A,y:_,data:H,reset:P}=await T({x:S,y:b,initialPlacement:i,placement:x,strategy:u,middlewareData:R,rects:v,platform:m,elements:{reference:a,floating:l}});S=A??S,b=_??b,R[N]={...R[N],...H},P&&w<EE&&(w++,typeof P=="object"&&(P.placement&&(x=P.placement),P.rects&&(v=P.rects===!0?await h.getElementRects({reference:a,floating:l,strategy:u}):P.rects),{x:S,y:b}=Hy(v,x,g)),j=-1)}return{x:S,y:b,placement:x,strategy:u,middlewareData:R}},TE=a=>({name:"arrow",options:a,async fn(l){const{x:o,y:i,placement:u,rects:f,platform:h,elements:m,middlewareData:g}=l,{element:v,padding:S=0}=Qa(a,l)||{};if(v==null)return{};const b=xb(S),x={x:o,y:i},w=Rh(u),R=Eh(w),j=await h.getDimensions(v),C=w==="y",N=C?"top":"left",T=C?"bottom":"right",A=C?"clientHeight":"clientWidth",_=f.reference[R]+f.reference[w]-x[w]-f.floating[R],H=x[w]-f.reference[w],P=await(h.getOffsetParent==null?void 0:h.getOffsetParent(v));let I=P?P[A]:0;(!I||!await(h.isElement==null?void 0:h.isElement(P)))&&(I=m.floating[A]||f.floating[R]);const k=_/2-H/2,ne=I/2-j[R]/2-1,se=zl(b[N],ne),Q=zl(b[T],ne),G=I-j[R]-Q,re=I/2-j[R]/2+k,le=yb(se,re,G),fe=!g.arrow&&So(u)!=null&&re!==le&&f.reference[R]/2-(re<se?se:Q)-j[R]/2<0,z=fe?re<se?re-se:re-G:0;return{[w]:x[w]+z,data:{[w]:le,centerOffset:re-le-z,...fe&&{alignmentOffset:z}},reset:fe}}}),NE=function(a){return a===void 0&&(a={}),{name:"flip",options:a,async fn(l){var o,i;const{placement:u,middlewareData:f,rects:h,initialPlacement:m,platform:g,elements:v}=l,{mainAxis:S=!0,crossAxis:b=!0,fallbackPlacements:x,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:R="none",flipAlignment:j=!0,...C}=Qa(a,l);if((o=f.arrow)!=null&&o.alignmentOffset)return{};const N=kl(u),T=ha(m),A=kl(m)===m,_=await(g.isRTL==null?void 0:g.isRTL(v.floating)),H=x||(A||!j?[vc(m)]:yE(m)),P=R!=="none";!x&&P&&H.push(...wE(m,j,R,_));const I=[m,...H],k=await g.detectOverflow(l,C),ne=[];let se=((i=f.flip)==null?void 0:i.overflows)||[];if(S&&ne.push(k[N]),b){const le=vE(u,h,_);ne.push(k[le[0]],k[le[1]])}if(se=[...se,{placement:u,overflows:ne}],!ne.every(le=>le<=0)){var Q,G;const le=(((Q=f.flip)==null?void 0:Q.index)||0)+1,fe=I[le];if(fe&&(!(b==="alignment"?T!==ha(fe):!1)||se.every(te=>ha(te.placement)===T?te.overflows[0]>0:!0)))return{data:{index:le,overflows:se},reset:{placement:fe}};let z=(G=se.filter($=>$.overflows[0]<=0).sort(($,te)=>$.overflows[1]-te.overflows[1])[0])==null?void 0:G.placement;if(!z)switch(w){case"bestFit":{var re;const $=(re=se.filter(te=>{if(P){const L=ha(te.placement);return L===T||L==="y"}return!0}).map(te=>[te.placement,te.overflows.filter(L=>L>0).reduce((L,X)=>L+X,0)]).sort((te,L)=>te[1]-L[1])[0])==null?void 0:re[0];$&&(z=$);break}case"initialPlacement":z=m;break}if(u!==z)return{reset:{placement:z}}}return{}}}};function By(a,l){return{top:a.top-l.height,right:a.right-l.width,bottom:a.bottom-l.height,left:a.left-l.width}}function Py(a){return pE.some(l=>a[l]>=0)}const AE=function(a){return a===void 0&&(a={}),{name:"hide",options:a,async fn(l){const{rects:o,platform:i}=l,{strategy:u="referenceHidden",...f}=Qa(a,l);switch(u){case"referenceHidden":{const h=await i.detectOverflow(l,{...f,elementContext:"reference"}),m=By(h,o.reference);return{data:{referenceHiddenOffsets:m,referenceHidden:Py(m)}}}case"escaped":{const h=await i.detectOverflow(l,{...f,altBoundary:!0}),m=By(h,o.floating);return{data:{escapedOffsets:m,escaped:Py(m)}}}default:return{}}}}},bb=new Set(["left","top"]);async function ME(a,l){const{placement:o,platform:i,elements:u}=a,f=await(i.isRTL==null?void 0:i.isRTL(u.floating)),h=kl(o),m=So(o),g=ha(o)==="y",v=bb.has(h)?-1:1,S=f&&g?-1:1,b=Qa(l,a);let{mainAxis:x,crossAxis:w,alignmentAxis:R}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:b.mainAxis||0,crossAxis:b.crossAxis||0,alignmentAxis:b.alignmentAxis};return m&&typeof R=="number"&&(w=m==="end"?R*-1:R),g?{x:w*S,y:x*v}:{x:x*v,y:w*S}}const _E=function(a){return a===void 0&&(a=0),{name:"offset",options:a,async fn(l){var o,i;const{x:u,y:f,placement:h,middlewareData:m}=l,g=await ME(l,a);return h===((o=m.offset)==null?void 0:o.placement)&&(i=m.arrow)!=null&&i.alignmentOffset?{}:{x:u+g.x,y:f+g.y,data:{...g,placement:h}}}}},OE=function(a){return a===void 0&&(a={}),{name:"shift",options:a,async fn(l){const{x:o,y:i,placement:u,platform:f}=l,{mainAxis:h=!0,crossAxis:m=!1,limiter:g={fn:T=>{let{x:A,y:_}=T;return{x:A,y:_}}},...v}=Qa(a,l),S={x:o,y:i},b=await f.detectOverflow(l,v),x=ha(u),w=Ch(x);let R=S[w],j=S[x];const C=(T,A)=>yb(A+b[T==="y"?"top":"left"],A,A-b[T==="y"?"bottom":"right"]);h&&(R=C(w,R)),m&&(j=C(x,j));const N=g.fn({...l,[w]:R,[x]:j});return{...N,data:{x:N.x-o,y:N.y-i,enabled:{[w]:h,[x]:m}}}}}},DE=function(a){return a===void 0&&(a={}),{options:a,fn(l){var o,i;const{x:u,y:f,placement:h,rects:m,middlewareData:g}=l,{offset:v=0,mainAxis:S=!0,crossAxis:b=!0}=Qa(a,l),x={x:u,y:f},w=ha(h),R=Ch(w);let j=x[R],C=x[w];const N=Qa(v,l),T=typeof N=="number"?{mainAxis:N,crossAxis:0}:{mainAxis:(o=N.mainAxis)!=null?o:0,crossAxis:(i=N.crossAxis)!=null?i:0};if(S){const H=R==="y"?"height":"width",P=m.reference[R]-m.floating[H]+T.mainAxis,I=m.reference[R]+m.reference[H]-T.mainAxis;j<P?j=P:j>I&&(j=I)}if(b){var A,_;const H=R==="y"?"width":"height",P=bb.has(kl(h)),I=m.reference[w]-m.floating[H]+(P&&((A=g.offset)==null?void 0:A[w])||0)+(P?0:T.crossAxis),k=m.reference[w]+m.reference[H]+(P?0:((_=g.offset)==null?void 0:_[w])||0)-(P?T.crossAxis:0);C<I?C=I:C>k&&(C=k)}return{[R]:j,[w]:C}}}},zE=function(a){return a===void 0&&(a={}),{name:"size",options:a,async fn(l){const{placement:o,rects:i,platform:u,elements:f}=l,{apply:h=()=>{},...m}=Qa(a,l),g=await u.detectOverflow(l,m),v=kl(o),S=So(o),b=ha(o)==="y",{width:x,height:w}=i.floating;let R,j;v==="top"||v==="bottom"?(R=v,j=S===(await(u.isRTL==null?void 0:u.isRTL(f.floating))?"start":"end")?"left":"right"):(j=v,R=S==="end"?"top":"bottom");const C=w-g.top-g.bottom,N=x-g.left-g.right,T=zl(w-g[R],C),A=zl(x-g[j],N),_=l.middlewareData.shift,H=!_;let P=T,I=A;_!=null&&_.enabled.x&&(I=N),_!=null&&_.enabled.y&&(P=C),H&&!S&&(b?I=x-2*Ya(g.left,g.right):P=w-2*Ya(g.top,g.bottom)),await h({...l,availableWidth:I,availableHeight:P});const k=await u.getDimensions(f.floating);return x!==k.width||w!==k.height?{reset:{rects:!0}}:{}}}};function Ac(){return typeof window<"u"}function wo(a){return Sb(a)?(a.nodeName||"").toLowerCase():"#document"}function on(a){var l;return(a==null||(l=a.ownerDocument)==null?void 0:l.defaultView)||window}function Ja(a){var l;return(l=(Sb(a)?a.ownerDocument:a.document)||window.document)==null?void 0:l.documentElement}function Sb(a){return Ac()?a instanceof Node||a instanceof on(a).Node:!1}function ga(a){return Ac()?a instanceof Element||a instanceof on(a).Element:!1}function Hl(a){return Ac()?a instanceof HTMLElement||a instanceof on(a).HTMLElement:!1}function qy(a){return!Ac()||typeof ShadowRoot>"u"?!1:a instanceof ShadowRoot||a instanceof on(a).ShadowRoot}function Mc(a){const{overflow:l,overflowX:o,overflowY:i,display:u}=va(a);return/auto|scroll|overlay|hidden|clip/.test(l+i+o)&&u!=="inline"&&u!=="contents"}function kE(a){return/^(table|td|th)$/.test(wo(a))}function _c(a){try{if(a.matches(":popover-open"))return!0}catch{}try{return a.matches(":modal")}catch{return!1}}const LE=/transform|translate|scale|rotate|perspective|filter/,UE=/paint|layout|strict|content/,or=a=>!!a&&a!=="none";let wf;function Th(a){const l=ga(a)?va(a):a;return or(l.transform)||or(l.translate)||or(l.scale)||or(l.rotate)||or(l.perspective)||!Nh()&&(or(l.backdropFilter)||or(l.filter))||LE.test(l.willChange||"")||UE.test(l.contain||"")}function HE(a){let l=cr(a);for(;Hl(l)&&!Cs(l);){if(Th(l))return l;if(_c(l))return null;l=cr(l)}return null}function Nh(){return wf==null&&(wf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),wf}function Cs(a){return/^(html|body|#document)$/.test(wo(a))}function va(a){return on(a).getComputedStyle(a)}function Oc(a){return ga(a)?{scrollLeft:a.scrollLeft,scrollTop:a.scrollTop}:{scrollLeft:a.scrollX,scrollTop:a.scrollY}}function cr(a){if(wo(a)==="html")return a;const l=a.assignedSlot||a.parentNode||qy(a)&&a.host||Ja(a);return qy(l)?l.host:l}function wb(a){const l=cr(a);return Cs(l)?(a.ownerDocument||a).body:Hl(l)&&Mc(l)?l:wb(l)}function Es(a,l,o){var i;l===void 0&&(l=[]),o===void 0&&(o=!0);const u=wb(a),f=u===((i=a.ownerDocument)==null?void 0:i.body),h=on(u);if(f){const m=$f(h);return l.concat(h,h.visualViewport||[],Mc(u)?u:[],m&&o?Es(m):[])}else return l.concat(u,Es(u,[],o))}function $f(a){return a.parent&&Object.getPrototypeOf(a.parent)?a.frameElement:null}function jb(a){const l=va(a);let o=parseFloat(l.width)||0,i=parseFloat(l.height)||0;const u=Hl(a),f=u?a.offsetWidth:o,h=u?a.offsetHeight:i,m=gc(o)!==f||gc(i)!==h;return m&&(o=f,i=h),{width:o,height:i,$:m}}function Ah(a){return ga(a)?a:a.contextElement}function co(a){const l=Ah(a);if(!Hl(l))return Ga(1);const o=l.getBoundingClientRect(),{width:i,height:u,$:f}=jb(l);let h=(f?gc(o.width):o.width)/i,m=(f?gc(o.height):o.height)/u;return(!h||!Number.isFinite(h))&&(h=1),(!m||!Number.isFinite(m))&&(m=1),{x:h,y:m}}const BE=Ga(0);function Cb(a){const l=on(a);return!Nh()||!l.visualViewport?BE:{x:l.visualViewport.offsetLeft,y:l.visualViewport.offsetTop}}function PE(a,l,o){return l===void 0&&(l=!1),!!o&&l&&o===on(a)}function ur(a,l,o,i){l===void 0&&(l=!1),o===void 0&&(o=!1);const u=a.getBoundingClientRect(),f=Ah(a);let h=Ga(1);l&&(i?ga(i)&&(h=co(i)):h=co(a));const m=PE(f,o,i)?Cb(f):Ga(0);let g=(u.left+m.x)/h.x,v=(u.top+m.y)/h.y,S=u.width/h.x,b=u.height/h.y;if(f&&i){const x=on(f),w=ga(i)?on(i):i;let R=x,j=$f(R);for(;j&&w!==R;){const C=co(j),N=j.getBoundingClientRect(),T=va(j),A=N.left+(j.clientLeft+parseFloat(T.paddingLeft))*C.x,_=N.top+(j.clientTop+parseFloat(T.paddingTop))*C.y;g*=C.x,v*=C.y,S*=C.x,b*=C.y,g+=A,v+=_,R=on(j),j=$f(R)}}return yc({width:S,height:b,x:g,y:v})}function Dc(a,l){const o=Oc(a).scrollLeft;return l?l.left+o:ur(Ja(a)).left+o}function Eb(a,l){const o=a.getBoundingClientRect(),i=o.left+l.scrollLeft-Dc(a,o),u=o.top+l.scrollTop;return{x:i,y:u}}function qE(a){let{elements:l,rect:o,offsetParent:i,strategy:u}=a;const f=u==="fixed",h=Ja(i),m=l?_c(l.floating):!1;if(i===h||m&&f)return o;let g={scrollLeft:0,scrollTop:0},v=Ga(1);const S=Ga(0),b=Hl(i);if((b||!f)&&((wo(i)!=="body"||Mc(h))&&(g=Oc(i)),b)){const w=ur(i);v=co(i),S.x=w.x+i.clientLeft,S.y=w.y+i.clientTop}const x=h&&!b&&!f?Eb(h,g):Ga(0);return{width:o.width*v.x,height:o.height*v.y,x:o.x*v.x-g.scrollLeft*v.x+S.x+x.x,y:o.y*v.y-g.scrollTop*v.y+S.y+x.y}}function VE(a){return a.getClientRects?Array.from(a.getClientRects()):[]}function IE(a){const l=Oc(a),o=a.ownerDocument.body,i=Ya(a.scrollWidth,a.clientWidth,o.scrollWidth,o.clientWidth),u=Ya(a.scrollHeight,a.clientHeight,o.scrollHeight,o.clientHeight);let f=-l.scrollLeft+Dc(a);const h=-l.scrollTop;return va(o).direction==="rtl"&&(f+=Ya(a.clientWidth,o.clientWidth)-i),{width:i,height:u,x:f,y:h}}const YE=25;function GE(a,l,o){o===void 0&&(o="viewport");const i=o==="layoutViewport",u=on(a),f=Ja(a),h=u.visualViewport;let m=f.clientWidth,g=f.clientHeight,v=0,S=0;if(h){const x=!Nh()||l==="fixed";i?x||(v=-h.offsetLeft,S=-h.offsetTop):(m=h.width,g=h.height,x&&(v=h.offsetLeft,S=h.offsetTop))}if(Dc(f)<=0){const x=f.ownerDocument,w=x.body,R=getComputedStyle(w),j=x.compatMode==="CSS1Compat"&&parseFloat(R.marginLeft)+parseFloat(R.marginRight)||0,C=Math.abs(f.clientWidth-w.clientWidth-j),N=getComputedStyle(f).scrollbarGutter==="stable both-edges"?C/2:C;N<=YE&&(m-=N)}return{width:m,height:g,x:v,y:S}}function $E(a,l){const o=ur(a,!0,l==="fixed"),i=o.top+a.clientTop,u=o.left+a.clientLeft,f=co(a),h=a.clientWidth*f.x,m=a.clientHeight*f.y,g=u*f.x,v=i*f.y;return{width:h,height:m,x:g,y:v}}function Vy(a,l,o){let i;if(l==="viewport"||l==="layoutViewport")i=GE(a,o,l);else if(l==="document")i=IE(Ja(a));else if(ga(l))i=$E(l,o);else{const u=Cb(a);i={x:l.x-u.x,y:l.y-u.y,width:l.width,height:l.height}}return yc(i)}function KE(a,l){const o=l.get(a);if(o)return o;let i=Es(a,[],!1).filter(m=>ga(m)&&wo(m)!=="body"),u=null;const f=va(a).position==="fixed";let h=f?cr(a):a;for(;ga(h)&&!Cs(h);){const m=va(h),g=Th(h),v=u?u.position:f?"fixed":"";!g&&(v==="fixed"||v==="absolute"&&m.position==="static")?i=i.filter(b=>b!==h):u=m,h=cr(h)}return l.set(a,i),i}function XE(a){let{element:l,boundary:o,rootBoundary:i,strategy:u}=a;const h=[...o==="clippingAncestors"?_c(l)?[]:KE(l,this._c):[].concat(o),i],m=Vy(l,h[0],u);let g=m.top,v=m.right,S=m.bottom,b=m.left;for(let x=1;x<h.length;x++){const w=Vy(l,h[x],u);g=Ya(w.top,g),v=zl(w.right,v),S=zl(w.bottom,S),b=Ya(w.left,b)}return{width:v-b,height:S-g,x:b,y:g}}function QE(a){const{width:l,height:o}=jb(a);return{width:l,height:o}}function FE(a,l,o){const i=Hl(l),u=Ja(l),f=o==="fixed",h=ur(a,!0,f,l);let m={scrollLeft:0,scrollTop:0};const g=Ga(0);if((i||!f)&&((wo(l)!=="body"||Mc(u))&&(m=Oc(l)),i)){const x=ur(l,!0,f,l);g.x=x.x+l.clientLeft,g.y=x.y+l.clientTop}!i&&u&&(g.x=Dc(u));const v=u&&!i&&!f?Eb(u,m):Ga(0),S=h.left+m.scrollLeft-g.x-v.x,b=h.top+m.scrollTop-g.y-v.y;return{x:S,y:b,width:h.width,height:h.height}}function jf(a){return va(a).position==="static"}function Iy(a,l){if(!Hl(a)||va(a).position==="fixed")return null;if(l)return l(a);let o=a.offsetParent;return Ja(a)===o&&(o=o.ownerDocument.body),o}function Rb(a,l){const o=on(a);if(_c(a))return o;if(!Hl(a)){let u=cr(a);for(;u&&!Cs(u);){if(ga(u)&&!jf(u))return u;u=cr(u)}return o}let i=Iy(a,l);for(;i&&kE(i)&&jf(i);)i=Iy(i,l);return i&&Cs(i)&&jf(i)&&!Th(i)?o:i||HE(a)||o}const ZE=async function(a){const l=this.getOffsetParent||Rb,o=this.getDimensions,i=await o(a.floating);return{reference:FE(a.reference,await l(a.floating),a.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function JE(a){return va(a).direction==="rtl"}const WE={convertOffsetParentRelativeRectToViewportRelativeRect:qE,getDocumentElement:Ja,getClippingRect:XE,getOffsetParent:Rb,getElementRects:ZE,getClientRects:VE,getDimensions:QE,getScale:co,isElement:ga,isRTL:JE};function Tb(a,l){return a.x===l.x&&a.y===l.y&&a.width===l.width&&a.height===l.height}function eR(a,l,o){let i=null,u;const f=Ja(a);function h(){var S;clearTimeout(u),(S=i)==null||S.disconnect(),i=null}function m(S,b){S===void 0&&(S=!1),b===void 0&&(b=1),h();const x=a.getBoundingClientRect(),{left:w,top:R,width:j,height:C}=x;if(S||l(),!j||!C)return;const N=ec(R),T=ec(f.clientWidth-(w+j)),A=ec(f.clientHeight-(R+C)),_=ec(w),P={rootMargin:-N+"px "+-T+"px "+-A+"px "+-_+"px",threshold:Ya(0,zl(1,b))||1};let I=!0;function k(ne){const se=ne[0].intersectionRatio;if(!Tb(x,a.getBoundingClientRect()))return m();if(se!==b){if(!I)return m();se?m(!1,se):u=setTimeout(()=>{m(!1,1e-7)},1e3)}I=!1}try{i=new IntersectionObserver(k,{...P,root:f.ownerDocument})}catch{i=new IntersectionObserver(k,P)}i.observe(a)}const g=on(a),v=()=>m(o);return g.addEventListener("resize",v),m(!0),()=>{g.removeEventListener("resize",v),h()}}function tR(a,l,o,i){i===void 0&&(i={});const{ancestorScroll:u=!0,ancestorResize:f=!0,elementResize:h=typeof ResizeObserver=="function",layoutShift:m=typeof IntersectionObserver=="function",animationFrame:g=!1}=i,v=Ah(a),S=u||f?[...v?Es(v):[],...l?Es(l):[]]:[];S.forEach(N=>{u&&N.addEventListener("scroll",o),f&&N.addEventListener("resize",o)});const b=v&&m?eR(v,o,f):null;let x=-1,w=null;h&&(w=new ResizeObserver(N=>{let[T]=N;T&&T.target===v&&w&&l&&(w.unobserve(l),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var A;(A=w)==null||A.observe(l)})),o()}),v&&!g&&w.observe(v),l&&w.observe(l));let R,j=g?ur(a):null;g&&C();function C(){const N=ur(a);j&&!Tb(j,N)&&o(),j=N,R=requestAnimationFrame(C)}return o(),()=>{var N;S.forEach(T=>{u&&T.removeEventListener("scroll",o),f&&T.removeEventListener("resize",o)}),b==null||b(),(N=w)==null||N.disconnect(),w=null,g&&cancelAnimationFrame(R)}}const nR=_E,aR=OE,lR=NE,rR=zE,oR=AE,Yy=TE,sR=DE,iR=(a,l,o)=>{const i=new Map,u=o??{},f={...WE,...u.platform,_c:i};return RE(a,l,{...u,platform:f})};var cR=typeof document<"u",uR=function(){},dc=cR?p.useLayoutEffect:uR;function xc(a,l){if(a===l)return!0;if(typeof a!=typeof l)return!1;if(typeof a=="function"&&a.toString()===l.toString())return!0;let o,i,u;if(a&&l&&typeof a=="object"){if(Array.isArray(a)){if(o=a.length,o!==l.length)return!1;for(i=o;i--!==0;)if(!xc(a[i],l[i]))return!1;return!0}if(u=Object.keys(a),o=u.length,o!==Object.keys(l).length)return!1;for(i=o;i--!==0;)if(!{}.hasOwnProperty.call(l,u[i]))return!1;for(i=o;i--!==0;){const f=u[i];if(!(f==="_owner"&&a.$$typeof)&&!xc(a[f],l[f]))return!1}return!0}return a!==a&&l!==l}function Nb(a){return typeof window>"u"?1:(a.ownerDocument.defaultView||window).devicePixelRatio||1}function Gy(a,l){const o=Nb(a);return Math.round(l*o)/o}function Cf(a){const l=p.useRef(a);return dc(()=>{l.current=a}),l}function dR(a){a===void 0&&(a={});const{placement:l="bottom",strategy:o="absolute",middleware:i=[],platform:u,elements:{reference:f,floating:h}={},transform:m=!0,whileElementsMounted:g,open:v}=a,[S,b]=p.useState({x:0,y:0,strategy:o,placement:l,middlewareData:{},isPositioned:!1}),[x,w]=p.useState(i);xc(x,i)||w(i);const[R,j]=p.useState(null),[C,N]=p.useState(null),T=p.useCallback(te=>{te!==P.current&&(P.current=te,j(te))},[]),A=p.useCallback(te=>{te!==I.current&&(I.current=te,N(te))},[]),_=f||R,H=h||C,P=p.useRef(null),I=p.useRef(null),k=p.useRef(S),ne=g!=null,se=Cf(g),Q=Cf(u),G=Cf(v),re=p.useCallback(()=>{if(!P.current||!I.current)return;const te={placement:l,strategy:o,middleware:x};Q.current&&(te.platform=Q.current),iR(P.current,I.current,te).then(L=>{const X={...L,isPositioned:G.current!==!1};le.current&&!xc(k.current,X)&&(k.current=X,yo.flushSync(()=>{b(X)}))})},[x,l,o,Q,G]);dc(()=>{v===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,b(te=>({...te,isPositioned:!1})))},[v]);const le=p.useRef(!1);dc(()=>(le.current=!0,()=>{le.current=!1}),[]),dc(()=>{if(_&&(P.current=_),H&&(I.current=H),_&&H){if(se.current)return se.current(_,H,re);re()}},[_,H,re,se,ne]);const fe=p.useMemo(()=>({reference:P,floating:I,setReference:T,setFloating:A}),[T,A]),z=p.useMemo(()=>({reference:_,floating:H}),[_,H]),$=p.useMemo(()=>{const te={position:o,left:0,top:0};if(!z.floating)return te;const L=Gy(z.floating,S.x),X=Gy(z.floating,S.y);return m?{...te,transform:"translate("+L+"px, "+X+"px)",...Nb(z.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:L,top:X}},[o,m,z.floating,S.x,S.y]);return p.useMemo(()=>({...S,update:re,refs:fe,elements:z,floatingStyles:$}),[S,re,fe,z,$])}const fR=a=>{function l(o){return{}.hasOwnProperty.call(o,"current")}return{name:"arrow",options:a,fn(o){const{element:i,padding:u}=typeof a=="function"?a(o):a;return i&&l(i)?i.current!=null?Yy({element:i.current,padding:u}).fn(o):{}:i?Yy({element:i,padding:u}).fn(o):{}}}},hR=(a,l)=>{const o=nR(a);return{name:o.name,fn:o.fn,options:[a,l]}},mR=(a,l)=>{const o=aR(a);return{name:o.name,fn:o.fn,options:[a,l]}},pR=(a,l)=>({fn:sR(a).fn,options:[a,l]}),gR=(a,l)=>{const o=lR(a);return{name:o.name,fn:o.fn,options:[a,l]}},vR=(a,l)=>{const o=rR(a);return{name:o.name,fn:o.fn,options:[a,l]}},yR=(a,l)=>{const o=oR(a);return{name:o.name,fn:o.fn,options:[a,l]}},xR=(a,l)=>{const o=fR(a);return{name:o.name,fn:o.fn,options:[a,l]}};var bR=Object.defineProperty,SR=(a,l)=>bR(a,"name",{value:l,configurable:!0});function zc(a){const[l,o]=p.useState(void 0);return Tt(()=>{if(a){o({width:a.offsetWidth,height:a.offsetHeight});const i=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const f=u[0];let h,m;if("borderBoxSize"in f){const g=f.borderBoxSize,v=Array.isArray(g)?g[0]:g;h=v.inlineSize,m=v.blockSize}else h=a.offsetWidth,m=a.offsetHeight;o({width:h,height:m})});return i.observe(a,{box:"border-box"}),()=>i.unobserve(a)}else o(void 0)},[a]),l}SR(zc,"useSize");var wR=Object.defineProperty,Ol=(a,l)=>wR(a,"name",{value:l,configurable:!0}),Ab="Popper",[Mb,jo]=un(Ab),[jR,_b]=Mb(Ab),CR=Ol(a=>{const{__scopePopper:l,children:o}=a,[i,u]=p.useState(null),[f,h]=p.useState(void 0);return s.jsx(jR,{scope:l,anchor:i,onAnchorChange:u,placementState:f,setPlacementState:h,children:o})},"Popper"),ER="PopperAnchor",RR=p.forwardRef(Ol(function(l,o){const{__scopePopper:i,virtualRef:u,...f}=l,h=_b(ER,i),m=p.useRef(null),g=h.onAnchorChange,v=p.useCallback(j=>{m.current=j,j&&g(j)},[g]),S=Pe(o,v),b=p.useRef(null);p.useEffect(()=>{if(!u)return;const j=b.current;b.current=u.current,j!==b.current&&g(b.current)});const x=h.placementState&&kc(h.placementState),w=x==null?void 0:x[0],R=x==null?void 0:x[1];return u?null:s.jsx(Le.div,{"data-radix-popper-side":w,"data-radix-popper-align":R,...f,ref:S})},"PopperAnchor")),Ob="PopperContent",[TR,B_]=Mb(Ob),NR=p.forwardRef(Ol(function(l,o){var me,De,_e,Oe,qe,yt,Bt;const{__scopePopper:i,side:u="bottom",sideOffset:f=0,align:h="center",alignOffset:m=0,arrowPadding:g=0,avoidCollisions:v=!0,collisionBoundary:S=[],collisionPadding:b=0,sticky:x="partial",hideWhenDetached:w=!1,updatePositionStrategy:R="optimized",onPlaced:j,...C}=l,N=_b(Ob,i),[T,A]=p.useState(null),_=Pe(o,A),[H,P]=p.useState(null),I=zc(H),k=(I==null?void 0:I.width)??0,ne=(I==null?void 0:I.height)??0,se=u+(h!=="center"?"-"+h:""),Q=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},G=Array.isArray(S)?S:[S],re=G.length>0,le={padding:Q,boundary:G.filter(Db),altBoundary:re},{refs:fe,floatingStyles:z,placement:$,isPositioned:te,middlewareData:L}=dR({strategy:"fixed",placement:se,whileElementsMounted:Ol((...Xt)=>tR(...Xt,{animationFrame:R==="always"}),"whileElementsMounted"),elements:{reference:N.anchor},middleware:[hR({mainAxis:f+ne,alignmentAxis:m}),v&&mR({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?pR():void 0,...le}),v&&gR({...le}),vR({...le,apply:Ol(({elements:Xt,rects:la,availableWidth:Rn,availableHeight:Pl})=>{const{width:nl,height:Yn}=la.reference,ba=Xt.floating.style;ba.setProperty("--radix-popper-available-width",`${Rn}px`),ba.setProperty("--radix-popper-available-height",`${Pl}px`),ba.setProperty("--radix-popper-anchor-width",`${nl}px`),ba.setProperty("--radix-popper-anchor-height",`${Yn}px`)},"apply")}),H&&xR({element:H,padding:g}),AR({arrowWidth:k,arrowHeight:ne}),w&&yR({strategy:"referenceHidden",...le,boundary:re?le.boundary:void 0})]}),X=N.setPlacementState;Tt(()=>(X($),()=>{X(void 0)}),[$,X]);const[M,B]=kc($),F=In(j);Tt(()=>{te&&(F==null||F())},[te,F]);const ae=(me=L.arrow)==null?void 0:me.x,ue=(De=L.arrow)==null?void 0:De.y,J=((_e=L.arrow)==null?void 0:_e.centerOffset)!==0,[oe,ie]=p.useState();return Tt(()=>{T&&ie(window.getComputedStyle(T).zIndex)},[T]),s.jsx("div",{ref:fe.setFloating,"data-radix-popper-content-wrapper":"",style:{...z,transform:te?z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oe,"--radix-popper-transform-origin":[(Oe=L.transformOrigin)==null?void 0:Oe.x,(qe=L.transformOrigin)==null?void 0:qe.y].join(" "),...((yt=L.hide)==null?void 0:yt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:l.dir,children:s.jsx(TR,{scope:i,placedSide:M,placedAlign:B,onArrowChange:P,arrowX:ae,arrowY:ue,shouldHideArrow:J,children:s.jsx(Le.div,{"data-side":M,"data-align":B,...C,ref:_,style:{...C.style,animation:te?(Bt=C.style)==null?void 0:Bt.animation:"none"}})})})},"PopperContent"));function Db(a){return a!==null}Ol(Db,"isNotNull");var AR=Ol(a=>({name:"transformOrigin",options:a,fn(l){var C,N,T;const{placement:o,rects:i,middlewareData:u}=l,h=((C=u.arrow)==null?void 0:C.centerOffset)!==0,m=h?0:a.arrowWidth,g=h?0:a.arrowHeight,[v,S]=kc(o),b={start:"0%",center:"50%",end:"100%"}[S],x=(((N=u.arrow)==null?void 0:N.x)??0)+m/2,w=(((T=u.arrow)==null?void 0:T.y)??0)+g/2;let R="",j="";return v==="bottom"?(R=h?b:`${x}px`,j=`${-g}px`):v==="top"?(R=h?b:`${x}px`,j=`${i.floating.height+g}px`):v==="right"?(R=`${-g}px`,j=h?b:`${w}px`):v==="left"&&(R=`${i.floating.width+g}px`,j=h?b:`${w}px`),{data:{x:R,y:j}}}}),"transformOrigin");function kc(a){const[l,o="center"]=a.split("-");return[l,o]}Ol(kc,"getSideAndAlignFromPlacement");var zb=CR,kb=RR,Mh=NR,MR=Object.defineProperty,_R=(a,l)=>MR(a,"name",{value:l,configurable:!0}),_h=p.forwardRef(_R(function(l,o){var g;const{container:i,...u}=l,[f,h]=p.useState(!1);Tt(()=>h(!0),[]);const m=i||f&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return m?yo.createPortal(s.jsx(Le.div,{...u,ref:o}),m):null},"Portal")),OR=Object.defineProperty,Fa=(a,l)=>OR(a,"name",{value:l,configurable:!0});function Lb(a,l){return p.useReducer((o,i)=>l[o][i]??o,a)}Fa(Lb,"useStateMachine");var Wa=Fa(a=>{const{present:l,children:o}=a,i=Ub(l),u=typeof o=="function"?o({present:i.isPresent}):p.Children.only(o),f=Hb(i.ref,Bb(u));return typeof o=="function"||i.isPresent?p.cloneElement(u,{ref:f}):null},"Presence");function Ub(a){const[l,o]=p.useState(),i=p.useRef(null),u=p.useRef(a),f=p.useRef("none"),h=p.useRef(void 0),m=a?"mounted":"unmounted",[g,v]=Lb(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{g==="mounted"?(f.current=h.current??so(i.current),h.current=void 0):f.current="none"},[g]),Tt(()=>{const S=i.current,b=u.current;if(b!==a){const w=f.current,R=so(S);a?(h.current=R,v("MOUNT")):R==="none"||(S==null?void 0:S.display)==="none"?v("UNMOUNT"):v(b&&w!==R?"ANIMATION_OUT":"UNMOUNT"),u.current=a}},[a,v]),Tt(()=>{if(l){let S;const b=l.ownerDocument.defaultView??window,x=Fa(R=>{const C=so(i.current).includes(CSS.escape(R.animationName));if(R.target===l&&C&&(v("ANIMATION_END"),!u.current)){const N=l.style.animationFillMode;l.style.animationFillMode="forwards",S=b.setTimeout(()=>{l.style.animationFillMode==="forwards"&&(l.style.animationFillMode=N)})}},"handleAnimationEnd"),w=Fa(R=>{R.target===l&&(f.current=so(i.current))},"handleAnimationStart");return l.addEventListener("animationstart",w),l.addEventListener("animationcancel",x),l.addEventListener("animationend",x),()=>{b.clearTimeout(S),l.removeEventListener("animationstart",w),l.removeEventListener("animationcancel",x),l.removeEventListener("animationend",x)}}else v("ANIMATION_END")},[l,v]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:p.useCallback(S=>{if(S){const b=getComputedStyle(S);i.current=b,h.current=so(b)}else i.current=null;o(S)},[])}}Fa(Ub,"usePresence");function Kf(a,l){if(typeof a=="function")return a(l);a!=null&&(a.current=l)}Fa(Kf,"setRef");function Hb(...a){const l=p.useRef(a);return l.current=a,p.useCallback(o=>{const i=l.current;let u=!1;const f=i.map(h=>{const m=Kf(h,o);return!u&&typeof m=="function"&&(u=!0),m});if(u)return()=>{for(let h=0;h<f.length;h++){const m=f[h];typeof m=="function"?m():Kf(i[h],null)}}},[])}Fa(Hb,"useStableComposedRefs");function so(a){return(a==null?void 0:a.animationName)||"none"}Fa(so,"getAnimationName");function Bb(a){var i,u;let l=(i=Object.getOwnPropertyDescriptor(a.props,"ref"))==null?void 0:i.get,o=l&&"isReactWarning"in l&&l.isReactWarning;return o?a.ref:(l=(u=Object.getOwnPropertyDescriptor(a,"ref"))==null?void 0:u.get,o=l&&"isReactWarning"in l&&l.isReactWarning,o?a.props.ref:a.props.ref||a.ref)}Fa(Bb,"getElementRef");var DR=Object.defineProperty,Oh=(a,l)=>DR(a,"name",{value:l,configurable:!0}),Ef=!1;function Pb(){const[a,l]=p.useState(Ef);return p.useEffect(()=>{Ef||(Ef=!0,l(!0))},[]),a}Oh(Pb,"useIsHydrated");var qb=ho[" useSyncExternalStore ".trim().toString()];function Vb(){return()=>{}}Oh(Vb,"subscribe");function Ib(){return qb(Vb,()=>!0,()=>!1)}Oh(Ib,"useIsHydratedModern");var zR=typeof qb=="function"?Ib:Pb,kR=Object.defineProperty,fr=(a,l)=>kR(a,"name",{value:l,configurable:!0}),Rf="rovingFocusGroup.onEntryFocus",LR={bubbles:!1,cancelable:!0},Lc="RovingFocusGroup",[Xf,Yb,UR]=Tc(Lc),[HR,Uc]=un(Lc,[UR]),[BR,PR]=HR(Lc),qR=p.forwardRef(fr(function(l,o){return s.jsx(Xf.Provider,{scope:l.__scopeRovingFocusGroup,children:s.jsx(Xf.Slot,{scope:l.__scopeRovingFocusGroup,children:s.jsx(VR,{...l,ref:o})})})},"RovingFocusGroup")),VR=p.forwardRef(fr(function(l,o){const{__scopeRovingFocusGroup:i,orientation:u,loop:f=!1,dir:h,currentTabStopId:m,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:v,onEntryFocus:S,preventScrollOnEntryFocus:b=!1,...x}=l,w=p.useRef(null),R=Pe(o,w),j=Os(h),[C,N]=Xa({prop:m,defaultProp:g??null,onChange:v,caller:Lc}),[T,A]=p.useState(!1),_=In(S),H=Yb(i),P=p.useRef(!1),[I,k]=p.useState(0);return p.useEffect(()=>{const ne=w.current;if(ne)return ne.addEventListener(Rf,_),()=>ne.removeEventListener(Rf,_)},[_]),s.jsx(BR,{scope:i,orientation:u,dir:j,loop:f,currentTabStopId:C,onItemFocus:p.useCallback(ne=>N(ne),[N]),onItemShiftTab:p.useCallback(()=>A(!0),[]),onFocusableItemAdd:p.useCallback(()=>k(ne=>ne+1),[]),onFocusableItemRemove:p.useCallback(()=>k(ne=>ne-1),[]),children:s.jsx(Le.div,{tabIndex:T||I===0?-1:0,"data-orientation":u,...x,ref:R,style:{outline:"none",...l.style},onMouseDown:Se(l.onMouseDown,()=>{P.current=!0}),onFocus:Se(l.onFocus,ne=>{const se=!P.current;if(ne.target===ne.currentTarget&&se&&!T){const Q=new CustomEvent(Rf,LR);if(ne.currentTarget.dispatchEvent(Q),!Q.defaultPrevented){const G=H().filter($=>$.focusable),re=G.find($=>$.active),le=G.find($=>$.id===C),z=[re,le,...G].filter(Boolean).map($=>$.ref.current);Dh(z,b)}}P.current=!1}),onBlur:Se(l.onBlur,()=>A(!1))})})},"RovingFocusGroupImpl")),IR="RovingFocusGroupItem",YR=p.forwardRef(fr(function(l,o){const{__scopeRovingFocusGroup:i,focusable:u=!0,active:f=!1,tabStopId:h,children:m,...g}=l,v=ma(),S=h||v,b=PR(IR,i),x=b.currentTabStopId===S,w=Yb(i),{onFocusableItemAdd:R,onFocusableItemRemove:j,currentTabStopId:C}=b,N=zR();return Tt(()=>{if(!(!N||!u))return R(),()=>j()},[N,u,R,j]),p.useEffect(()=>{if(!(N||!u))return R(),()=>j()},[N,u,R,j]),s.jsx(Xf.ItemSlot,{scope:i,id:S,focusable:u,active:f,children:s.jsx(Le.span,{tabIndex:x?0:-1,"data-orientation":b.orientation,...g,ref:o,onMouseDown:Se(l.onMouseDown,T=>{u?b.onItemFocus(S):T.preventDefault()}),onFocus:Se(l.onFocus,()=>b.onItemFocus(S)),onKeyDown:Se(l.onKeyDown,T=>{if(T.key==="Tab"&&T.shiftKey){b.onItemShiftTab();return}if(T.target!==T.currentTarget)return;const A=$b(T,b.orientation,b.dir);if(A!==void 0){if(T.metaKey||T.ctrlKey||T.altKey||T.shiftKey)return;T.preventDefault();let H=w().filter(P=>P.focusable).map(P=>P.ref.current);if(A==="last")H.reverse();else if(A==="prev"||A==="next"){A==="prev"&&H.reverse();const P=H.indexOf(T.currentTarget);H=b.loop?Kb(H,P+1):H.slice(P+1)}setTimeout(()=>Dh(H))}}),children:typeof m=="function"?m({isCurrentTabStop:x,hasTabStop:C!=null}):m})})},"RovingFocusGroupItem")),GR={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Gb(a,l){return l!=="rtl"?a:a==="ArrowLeft"?"ArrowRight":a==="ArrowRight"?"ArrowLeft":a}fr(Gb,"getDirectionAwareKey");function $b(a,l,o){const i=Gb(a.key,o);if(!(l==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(l==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return GR[i]}fr($b,"getFocusIntent");function Dh(a,l=!1){const o=document.activeElement;for(const i of a)if(i===o||(i.focus({preventScroll:l}),document.activeElement!==o))return}fr(Dh,"focusFirst");function Kb(a,l){return a.map((o,i)=>a[(l+i)%a.length])}fr(Kb,"wrapArray");var Xb=qR,Qb=YR,$R=function(a){if(typeof document>"u")return null;var l=Array.isArray(a)?a[0]:a;return l.ownerDocument.body},lo=new WeakMap,tc=new WeakMap,nc={},Tf=0,Fb=function(a){return a&&(a.host||Fb(a.parentNode))},KR=function(a,l){return l.map(function(o){if(a.contains(o))return o;var i=Fb(o);return i&&a.contains(i)?i:(console.error("aria-hidden",o,"in not contained inside",a,". Doing nothing"),null)}).filter(function(o){return!!o})},XR=function(a,l,o,i){var u=KR(l,Array.isArray(a)?a:[a]);nc[o]||(nc[o]=new WeakMap);var f=nc[o],h=[],m=new Set,g=new Set(u),v=function(b){!b||m.has(b)||(m.add(b),v(b.parentNode))};u.forEach(v);var S=function(b){!b||g.has(b)||Array.prototype.forEach.call(b.children,function(x){if(m.has(x))S(x);else try{var w=x.getAttribute(i),R=w!==null&&w!=="false",j=(lo.get(x)||0)+1,C=(f.get(x)||0)+1;lo.set(x,j),f.set(x,C),h.push(x),j===1&&R&&tc.set(x,!0),C===1&&x.setAttribute(o,"true"),R||x.setAttribute(i,"true")}catch(N){console.error("aria-hidden: cannot operate on ",x,N)}})};return S(l),m.clear(),Tf++,function(){h.forEach(function(b){var x=lo.get(b)-1,w=f.get(b)-1;lo.set(b,x),f.set(b,w),x||(tc.has(b)||b.removeAttribute(i),tc.delete(b)),w||b.removeAttribute(o)}),Tf--,Tf||(lo=new WeakMap,lo=new WeakMap,tc=new WeakMap,nc={})}},zh=function(a,l,o){o===void 0&&(o="data-aria-hidden");var i=Array.from(Array.isArray(a)?a:[a]),u=$R(a);return u?(i.push.apply(i,Array.from(u.querySelectorAll("[aria-live], script"))),XR(i,u,o,"aria-hidden")):function(){return null}},fa=function(){return fa=Object.assign||function(l){for(var o,i=1,u=arguments.length;i<u;i++){o=arguments[i];for(var f in o)Object.prototype.hasOwnProperty.call(o,f)&&(l[f]=o[f])}return l},fa.apply(this,arguments)};function Zb(a,l){var o={};for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&l.indexOf(i)<0&&(o[i]=a[i]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,i=Object.getOwnPropertySymbols(a);u<i.length;u++)l.indexOf(i[u])<0&&Object.prototype.propertyIsEnumerable.call(a,i[u])&&(o[i[u]]=a[i[u]]);return o}function QR(a,l,o){if(o||arguments.length===2)for(var i=0,u=l.length,f;i<u;i++)(f||!(i in l))&&(f||(f=Array.prototype.slice.call(l,0,i)),f[i]=l[i]);return a.concat(f||Array.prototype.slice.call(l))}var fc="right-scroll-bar-position",hc="width-before-scroll-bar",FR="with-scroll-bars-hidden",ZR="--removed-body-scroll-bar-size";function Nf(a,l){return typeof a=="function"?a(l):a&&(a.current=l),a}function JR(a,l){var o=p.useState(function(){return{value:a,callback:l,facade:{get current(){return o.value},set current(i){var u=o.value;u!==i&&(o.value=i,o.callback(i,u))}}}})[0];return o.callback=l,o.facade}var WR=typeof window<"u"?p.useLayoutEffect:p.useEffect,$y=new WeakMap;function eT(a,l){var o=JR(null,function(i){return a.forEach(function(u){return Nf(u,i)})});return WR(function(){var i=$y.get(o);if(i){var u=new Set(i),f=new Set(a),h=o.current;u.forEach(function(m){f.has(m)||Nf(m,null)}),f.forEach(function(m){u.has(m)||Nf(m,h)})}$y.set(o,a)},[a]),o}function tT(a){return a}function nT(a,l){l===void 0&&(l=tT);var o=[],i=!1,u={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return o.length?o[o.length-1]:a},useMedium:function(f){var h=l(f,i);return o.push(h),function(){o=o.filter(function(m){return m!==h})}},assignSyncMedium:function(f){for(i=!0;o.length;){var h=o;o=[],h.forEach(f)}o={push:function(m){return f(m)},filter:function(){return o}}},assignMedium:function(f){i=!0;var h=[];if(o.length){var m=o;o=[],m.forEach(f),h=o}var g=function(){var S=h;h=[],S.forEach(f)},v=function(){return Promise.resolve().then(g)};v(),o={push:function(S){h.push(S),v()},filter:function(S){return h=h.filter(S),o}}}};return u}function aT(a){a===void 0&&(a={});var l=nT(null);return l.options=fa({async:!0,ssr:!1},a),l}var Jb=function(a){var l=a.sideCar,o=Zb(a,["sideCar"]);if(!l)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=l.read();if(!i)throw new Error("Sidecar medium not found");return p.createElement(i,fa({},o))};Jb.isSideCarExport=!0;function lT(a,l){return a.useMedium(l),Jb}var Wb=aT(),Af=function(){},Hc=p.forwardRef(function(a,l){var o=p.useRef(null),i=p.useState({onScrollCapture:Af,onWheelCapture:Af,onTouchMoveCapture:Af}),u=i[0],f=i[1],h=a.forwardProps,m=a.children,g=a.className,v=a.removeScrollBar,S=a.enabled,b=a.shards,x=a.sideCar,w=a.noRelative,R=a.noIsolation,j=a.inert,C=a.allowPinchZoom,N=a.as,T=N===void 0?"div":N,A=a.gapMode,_=Zb(a,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),H=x,P=eT([o,l]),I=fa(fa({},_),u);return p.createElement(p.Fragment,null,S&&p.createElement(H,{sideCar:Wb,removeScrollBar:v,shards:b,noRelative:w,noIsolation:R,inert:j,setCallbacks:f,allowPinchZoom:!!C,lockRef:o,gapMode:A}),h?p.cloneElement(p.Children.only(m),fa(fa({},I),{ref:P})):p.createElement(T,fa({},I,{className:g,ref:P}),m))});Hc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Hc.classNames={fullWidth:hc,zeroRight:fc};var rT=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function oT(){if(!document)return null;var a=document.createElement("style");a.type="text/css";var l=rT();return l&&a.setAttribute("nonce",l),a}function sT(a,l){a.styleSheet?a.styleSheet.cssText=l:a.appendChild(document.createTextNode(l))}function iT(a){var l=document.head||document.getElementsByTagName("head")[0];l.appendChild(a)}var cT=function(){var a=0,l=null;return{add:function(o){a==0&&(l=oT())&&(sT(l,o),iT(l)),a++},remove:function(){a--,!a&&l&&(l.parentNode&&l.parentNode.removeChild(l),l=null)}}},uT=function(){var a=cT();return function(l,o){p.useEffect(function(){return a.add(l),function(){a.remove()}},[l&&o])}},e0=function(){var a=uT(),l=function(o){var i=o.styles,u=o.dynamic;return a(i,u),null};return l},dT={left:0,top:0,right:0,gap:0},Mf=function(a){return parseInt(a||"",10)||0},fT=function(a){var l=window.getComputedStyle(document.body),o=l[a==="padding"?"paddingLeft":"marginLeft"],i=l[a==="padding"?"paddingTop":"marginTop"],u=l[a==="padding"?"paddingRight":"marginRight"];return[Mf(o),Mf(i),Mf(u)]},hT=function(a){if(a===void 0&&(a="margin"),typeof window>"u")return dT;var l=fT(a),o=document.documentElement.clientWidth,i=window.innerWidth;return{left:l[0],top:l[1],right:l[2],gap:Math.max(0,i-o+l[2]-l[0])}},mT=e0(),uo="data-scroll-locked",pT=function(a,l,o,i){var u=a.left,f=a.top,h=a.right,m=a.gap;return o===void 0&&(o="margin"),`
246
+ .`.concat(FR,` {
247
+ overflow: hidden `).concat(i,`;
248
+ padding-right: `).concat(m,"px ").concat(i,`;
249
+ }
250
+ body[`).concat(uo,`] {
251
+ overflow: hidden `).concat(i,`;
252
+ overscroll-behavior: contain;
253
+ `).concat([l&&"position: relative ".concat(i,";"),o==="margin"&&`
254
+ padding-left: `.concat(u,`px;
255
+ padding-top: `).concat(f,`px;
256
+ padding-right: `).concat(h,`px;
257
+ margin-left:0;
258
+ margin-top:0;
259
+ margin-right: `).concat(m,"px ").concat(i,`;
260
+ `),o==="padding"&&"padding-right: ".concat(m,"px ").concat(i,";")].filter(Boolean).join(""),`
261
+ }
262
+
263
+ .`).concat(fc,` {
264
+ right: `).concat(m,"px ").concat(i,`;
265
+ }
266
+
267
+ .`).concat(hc,` {
268
+ margin-right: `).concat(m,"px ").concat(i,`;
269
+ }
270
+
271
+ .`).concat(fc," .").concat(fc,` {
272
+ right: 0 `).concat(i,`;
273
+ }
274
+
275
+ .`).concat(hc," .").concat(hc,` {
276
+ margin-right: 0 `).concat(i,`;
277
+ }
278
+
279
+ body[`).concat(uo,`] {
280
+ `).concat(ZR,": ").concat(m,`px;
281
+ }
282
+ `)},Ky=function(){var a=parseInt(document.body.getAttribute(uo)||"0",10);return isFinite(a)?a:0},gT=function(){p.useEffect(function(){return document.body.setAttribute(uo,(Ky()+1).toString()),function(){var a=Ky()-1;a<=0?document.body.removeAttribute(uo):document.body.setAttribute(uo,a.toString())}},[])},vT=function(a){var l=a.noRelative,o=a.noImportant,i=a.gapMode,u=i===void 0?"margin":i;gT();var f=p.useMemo(function(){return hT(u)},[u]);return p.createElement(mT,{styles:pT(f,!l,u,o?"":"!important")})},Qf=!1;if(typeof window<"u")try{var ac=Object.defineProperty({},"passive",{get:function(){return Qf=!0,!0}});window.addEventListener("test",ac,ac),window.removeEventListener("test",ac,ac)}catch{Qf=!1}var ro=Qf?{passive:!1}:!1,yT=function(a){return a.tagName==="TEXTAREA"},t0=function(a,l){if(!(a instanceof Element))return!1;var o=window.getComputedStyle(a);return o[l]!=="hidden"&&!(o.overflowY===o.overflowX&&!yT(a)&&o[l]==="visible")},xT=function(a){return t0(a,"overflowY")},bT=function(a){return t0(a,"overflowX")},Xy=function(a,l){var o=l.ownerDocument,i=l;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var u=n0(a,i);if(u){var f=a0(a,i),h=f[1],m=f[2];if(h>m)return!0}i=i.parentNode}while(i&&i!==o.body);return!1},ST=function(a){var l=a.scrollTop,o=a.scrollHeight,i=a.clientHeight;return[l,o,i]},wT=function(a){var l=a.scrollLeft,o=a.scrollWidth,i=a.clientWidth;return[l,o,i]},n0=function(a,l){return a==="v"?xT(l):bT(l)},a0=function(a,l){return a==="v"?ST(l):wT(l)},jT=function(a,l){return a==="h"&&l==="rtl"?-1:1},CT=function(a,l,o,i,u){var f=jT(a,window.getComputedStyle(l).direction),h=f*i,m=o.target,g=l.contains(m),v=!1,S=h>0,b=0,x=0;do{if(!m)break;var w=a0(a,m),R=w[0],j=w[1],C=w[2],N=j-C-f*R;(R||N)&&n0(a,m)&&(b+=N,x+=R);var T=m.parentNode;m=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!g&&m!==document.body||g&&(l.contains(m)||l===m));return(S&&Math.abs(b)<1||!S&&Math.abs(x)<1)&&(v=!0),v},lc=function(a){return"changedTouches"in a?[a.changedTouches[0].clientX,a.changedTouches[0].clientY]:[0,0]},Qy=function(a){return[a.deltaX,a.deltaY]},Fy=function(a){return a&&"current"in a?a.current:a},ET=function(a,l){return a[0]===l[0]&&a[1]===l[1]},RT=function(a){return`
283
+ .block-interactivity-`.concat(a,` {pointer-events: none;}
284
+ .allow-interactivity-`).concat(a,` {pointer-events: all;}
285
+ `)},TT=0,oo=[];function NT(a){var l=p.useRef([]),o=p.useRef([0,0]),i=p.useRef(),u=p.useState(TT++)[0],f=p.useState(e0)[0],h=p.useRef(a);p.useEffect(function(){h.current=a},[a]),p.useEffect(function(){if(a.inert){document.body.classList.add("block-interactivity-".concat(u));var j=QR([a.lockRef.current],(a.shards||[]).map(Fy),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(u))})}}},[a.inert,a.lockRef.current,a.shards]);var m=p.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!h.current.allowPinchZoom;var N=lc(j),T=o.current,A="deltaX"in j?j.deltaX:T[0]-N[0],_="deltaY"in j?j.deltaY:T[1]-N[1],H,P=j.target,I=Math.abs(A)>Math.abs(_)?"h":"v";if("touches"in j&&I==="h"&&P.type==="range")return!1;var k=window.getSelection(),ne=k&&k.anchorNode,se=ne?ne===P||ne.contains(P):!1;if(se)return!1;var Q=Xy(I,P);if(!Q)return!0;if(Q?H=I:(H=I==="v"?"h":"v",Q=Xy(I,P)),!Q)return!1;if(!i.current&&"changedTouches"in j&&(A||_)&&(i.current=H),!H)return!0;var G=i.current||H;return CT(G,C,j,G==="h"?A:_)},[]),g=p.useCallback(function(j){var C=j;if(!(!oo.length||oo[oo.length-1]!==f)){var N="deltaY"in C?Qy(C):lc(C),T=l.current.filter(function(H){return H.name===C.type&&(H.target===C.target||C.target===H.shadowParent)&&ET(H.delta,N)})[0];if(T&&T.should){C.cancelable&&C.preventDefault();return}if(!T){var A=(h.current.shards||[]).map(Fy).filter(Boolean).filter(function(H){return H.contains(C.target)}),_=A.length>0?m(C,A[0]):!h.current.noIsolation;_&&C.cancelable&&C.preventDefault()}}},[]),v=p.useCallback(function(j,C,N,T){var A={name:j,delta:C,target:N,should:T,shadowParent:AT(N)};l.current.push(A),setTimeout(function(){l.current=l.current.filter(function(_){return _!==A})},1)},[]),S=p.useCallback(function(j){o.current=lc(j),i.current=void 0},[]),b=p.useCallback(function(j){v(j.type,Qy(j),j.target,m(j,a.lockRef.current))},[]),x=p.useCallback(function(j){v(j.type,lc(j),j.target,m(j,a.lockRef.current))},[]);p.useEffect(function(){return oo.push(f),a.setCallbacks({onScrollCapture:b,onWheelCapture:b,onTouchMoveCapture:x}),document.addEventListener("wheel",g,ro),document.addEventListener("touchmove",g,ro),document.addEventListener("touchstart",S,ro),function(){oo=oo.filter(function(j){return j!==f}),document.removeEventListener("wheel",g,ro),document.removeEventListener("touchmove",g,ro),document.removeEventListener("touchstart",S,ro)}},[]);var w=a.removeScrollBar,R=a.inert;return p.createElement(p.Fragment,null,R?p.createElement(f,{styles:RT(u)}):null,w?p.createElement(vT,{noRelative:a.noRelative,gapMode:a.gapMode}):null)}function AT(a){for(var l=null;a!==null;)a instanceof ShadowRoot&&(l=a.host,a=a.host),a=a.parentNode;return l}const MT=lT(Wb,NT);var Bc=p.forwardRef(function(a,l){return p.createElement(Hc,fa({},a,{ref:l,sideCar:MT}))});Bc.classNames=Hc.classNames;var _T=Object.defineProperty,it=(a,l)=>_T(a,"name",{value:l,configurable:!0}),OT=["Enter"," "],DT=["ArrowDown","PageUp","Home"],l0=["ArrowUp","PageDown","End"],zT=[...DT,...l0],Pc="Menu",[Ff,kT,LT]=Tc(Pc),[hr,r0]=un(Pc,[LT,jo,Uc]),kh=jo(),o0=Uc(),[UT,zs]=hr(Pc),[HT,Lh]=hr(Pc),BT=it(a=>{const{__scopeMenu:l,open:o=!1,children:i,dir:u,onOpenChange:f,modal:h=!0}=a,m=kh(l),[g,v]=p.useState(null),S=p.useRef(!1),b=In(f),x=Os(u);return p.useEffect(()=>{const w=it(()=>{S.current=!0,document.addEventListener("pointerdown",R,{capture:!0,once:!0}),document.addEventListener("pointermove",R,{capture:!0,once:!0})},"handleKeyDown"),R=it(()=>S.current=!1,"handlePointer");return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",R,{capture:!0}),document.removeEventListener("pointermove",R,{capture:!0})}},[]),p.useEffect(()=>{if(!o)return;const w=it(()=>b(!1),"handleBlur");return window.addEventListener("blur",w),()=>window.removeEventListener("blur",w)},[o,b]),s.jsx(zb,{...m,children:s.jsx(UT,{scope:l,open:o,onOpenChange:b,content:g,onContentChange:v,children:s.jsx(HT,{scope:l,onClose:p.useCallback(()=>b(!1),[b]),isUsingKeyboardRef:S,dir:x,modal:h,children:i})})})},"Menu"),PT=p.forwardRef(it(function(l,o){const{__scopeMenu:i,...u}=l,f=kh(i);return s.jsx(kb,{...f,...u,ref:o})},"MenuAnchor")),s0="MenuPortal",[qT,VT]=hr(s0,{forceMount:void 0}),IT=it(a=>{const{__scopeMenu:l,forceMount:o,children:i,container:u}=a,f=zs(s0,l);return s.jsx(qT,{scope:l,forceMount:o,children:s.jsx(Wa,{present:o||f.open,children:s.jsx(_h,{asChild:!0,container:u,children:i})})})},"MenuPortal"),Dl="MenuContent",[YT,i0]=hr(Dl),GT=p.forwardRef(it(function(l,o){const i=VT(Dl,l.__scopeMenu),{forceMount:u=i.forceMount,...f}=l,h=zs(Dl,l.__scopeMenu),m=Lh(Dl,l.__scopeMenu);return s.jsx(Ff.Provider,{scope:l.__scopeMenu,children:s.jsx(Wa,{present:u||h.open,children:s.jsx(Ff.Slot,{scope:l.__scopeMenu,children:m.modal?s.jsx($T,{...f,ref:o}):s.jsx(KT,{...f,ref:o})})})})},"MenuContent")),$T=p.forwardRef(it(function(l,o){const i=zs(Dl,l.__scopeMenu),u=p.useRef(null),f=Pe(o,u);return p.useEffect(()=>{const h=u.current;if(h)return zh(h)},[]),s.jsx(c0,{...l,ref:f,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:Se(l.onFocusOutside,h=>h.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentModal")),KT=p.forwardRef(it(function(l,o){const i=zs(Dl,l.__scopeMenu);return s.jsx(c0,{...l,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentNonModal")),XT=pa("MenuContent.ScrollLock"),c0=p.forwardRef(it(function(l,o){const{__scopeMenu:i,loop:u=!1,trapFocus:f,onOpenAutoFocus:h,onCloseAutoFocus:m,disableOutsidePointerEvents:g,onEntryFocus:v,onEscapeKeyDown:S,onPointerDownOutside:b,onFocusOutside:x,onInteractOutside:w,onDismiss:R,disableOutsideScroll:j,...C}=l,N=zs(Dl,i),T=Lh(Dl,i),A=kh(i),_=o0(i),H=kT(i),[P,I]=p.useState(null),k=p.useRef(null),ne=Pe(o,k,N.onContentChange),se=p.useRef(0),Q=p.useRef(""),G=p.useRef(0),re=p.useRef(null),le=p.useRef("right"),fe=p.useRef(0),z=j?Bc:p.Fragment,$=j?{as:XT,allowPinchZoom:!0}:void 0,te=it(X=>{var ie,me;const M=Q.current+X,B=H().filter(De=>!De.disabled),F=document.activeElement,ae=(ie=B.find(De=>De.ref.current===F))==null?void 0:ie.textValue,ue=B.map(De=>De.textValue),J=m0(ue,M,ae),oe=(me=B.find(De=>De.textValue===J))==null?void 0:me.ref.current;it((function De(_e){Q.current=_e,window.clearTimeout(se.current),_e!==""&&(se.current=window.setTimeout(()=>De(""),1e3))}),"updateSearch")(M),oe&&setTimeout(()=>oe.focus())},"handleTypeaheadSearch");p.useEffect(()=>()=>window.clearTimeout(se.current),[]),Ds();const L=p.useCallback(X=>{var B,F;return le.current===((B=re.current)==null?void 0:B.side)&&g0(X,(F=re.current)==null?void 0:F.area)},[]);return s.jsx(YT,{scope:i,searchRef:Q,onItemEnter:p.useCallback(X=>{L(X)&&X.preventDefault()},[L]),onItemLeave:p.useCallback(X=>{var M;L(X)||((M=k.current)==null||M.focus(),I(null))},[L]),onTriggerLeave:p.useCallback(X=>{L(X)&&X.preventDefault()},[L]),pointerGraceTimerRef:G,onPointerGraceIntentChange:p.useCallback(X=>{re.current=X},[]),children:s.jsx(z,{...$,children:s.jsx(wh,{asChild:!0,trapped:f,onMountAutoFocus:Se(h,X=>{var M;X.preventDefault(),(M=k.current)==null||M.focus({preventScroll:!0})}),onUnmountAutoFocus:m,children:s.jsx(Nc,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:S,onPointerDownOutside:b,onFocusOutside:x,onInteractOutside:w,onDismiss:R,children:s.jsx(Xb,{asChild:!0,..._,dir:T.dir,orientation:"vertical",loop:u,currentTabStopId:P,onCurrentTabStopIdChange:I,onEntryFocus:Se(v,X=>{T.isUsingKeyboardRef.current||X.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Mh,{role:"menu","aria-orientation":"vertical","data-state":u0(N.open),"data-radix-menu-content":"",dir:T.dir,...A,...C,ref:ne,style:{outline:"none",...C.style},onKeyDown:Se(C.onKeyDown,X=>{const B=X.target.closest("[data-radix-menu-content]")===X.currentTarget,F=X.ctrlKey||X.altKey||X.metaKey,ae=X.key.length===1;B&&(X.key==="Tab"&&X.preventDefault(),!F&&ae&&te(X.key));const ue=k.current;if(X.target!==ue||!zT.includes(X.key))return;X.preventDefault();const oe=H().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);l0.includes(X.key)&&oe.reverse(),f0(oe)}),onBlur:Se(l.onBlur,X=>{X.currentTarget.contains(X.target)||(window.clearTimeout(se.current),Q.current="")}),onPointerMove:Se(l.onPointerMove,bc(X=>{const M=X.target,B=fe.current!==X.clientX;if(X.currentTarget.contains(M)&&B){const F=X.clientX>fe.current?"right":"left";le.current=F,fe.current=X.clientX}}))})})})})})})},"MenuContentImpl")),QT=p.forwardRef(it(function(l,o){const{__scopeMenu:i,...u}=l;return s.jsx(Le.div,{...u,ref:o})},"MenuLabel")),Zf="MenuItem",Zy="menu.itemSelect",FT=p.forwardRef(it(function(l,o){const{disabled:i=!1,onSelect:u,...f}=l,h=p.useRef(null),m=Lh(Zf,l.__scopeMenu),g=i0(Zf,l.__scopeMenu),v=Pe(o,h),S=p.useRef(!1),b=it(()=>{const x=h.current;if(!i&&x){const w=new CustomEvent(Zy,{bubbles:!0,cancelable:!0});x.addEventListener(Zy,R=>u==null?void 0:u(R),{once:!0}),yh(x,w),w.defaultPrevented?S.current=!1:m.onClose()}},"handleSelect");return s.jsx(ZT,{...f,ref:v,disabled:i,onClick:Se(l.onClick,b),onPointerDown:x=>{var w;(w=l.onPointerDown)==null||w.call(l,x),S.current=!0},onPointerUp:Se(l.onPointerUp,x=>{var w;S.current||(w=x.currentTarget)==null||w.click()}),onKeyDown:Se(l.onKeyDown,x=>{i||x.target!==x.currentTarget||g.searchRef.current!==""&&x.key===" "||OT.includes(x.key)&&(x.currentTarget.click(),x.preventDefault())})})},"MenuItem")),ZT=p.forwardRef(it(function(l,o){const{__scopeMenu:i,disabled:u=!1,textValue:f,...h}=l,m=i0(Zf,i),g=o0(i),v=p.useRef(null),S=Pe(o,v),[b,x]=p.useState(!1),[w,R]=p.useState("");return p.useEffect(()=>{const j=v.current;j&&R((j.textContent??"").trim())},[h.children]),s.jsx(Ff.ItemSlot,{scope:i,disabled:u,textValue:f??w,children:s.jsx(Qb,{asChild:!0,...g,focusable:!u,children:s.jsx(Le.div,{role:"menuitem","data-highlighted":b?"":void 0,"aria-disabled":u||void 0,"data-disabled":u?"":void 0,...h,ref:S,onPointerMove:Se(l.onPointerMove,bc(j=>{u?m.onItemLeave(j):(m.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Se(l.onPointerLeave,bc(j=>m.onItemLeave(j))),onFocus:Se(l.onFocus,()=>x(!0)),onBlur:Se(l.onBlur,()=>x(!1))})})})},"MenuItemImpl")),JT="MenuRadioGroup",[P_,q_]=hr(JT,{value:void 0,onValueChange:it(()=>{},"onValueChange")}),WT="MenuItemIndicator",[V_,I_]=hr(WT,{checked:!1}),eN=p.forwardRef(it(function(l,o){const{__scopeMenu:i,...u}=l;return s.jsx(Le.div,{role:"separator","aria-orientation":"horizontal",...u,ref:o})},"MenuSeparator")),tN="MenuSub",[Y_,G_]=hr(tN);function u0(a){return a?"open":"closed"}it(u0,"getOpenState");function d0(a){return a==="indeterminate"}it(d0,"isIndeterminate");function nN(a){return d0(a)?"indeterminate":a?"checked":"unchecked"}it(nN,"getCheckedState");function f0(a){const l=document.activeElement;for(const o of a)if(o===l||(o.focus(),document.activeElement!==l))return}it(f0,"focusFirst");function h0(a,l){return a.map((o,i)=>a[(l+i)%a.length])}it(h0,"wrapArray");function m0(a,l,o){const u=l.length>1&&Array.from(l).every(v=>v===l[0])?l[0]:l,f=o?a.indexOf(o):-1;let h=h0(a,Math.max(f,0));u.length===1&&(h=h.filter(v=>v!==o));const g=h.find(v=>v.toLowerCase().startsWith(u.toLowerCase()));return g!==o?g:void 0}it(m0,"getNextMatch");function p0(a,l){const{x:o,y:i}=a;let u=!1;for(let f=0,h=l.length-1;f<l.length;h=f++){const m=l[f],g=l[h],v=m.x,S=m.y,b=g.x,x=g.y;S>i!=x>i&&o<(b-v)*(i-S)/(x-S)+v&&(u=!u)}return u}it(p0,"isPointInPolygon");function g0(a,l){if(!l)return!1;const o={x:a.clientX,y:a.clientY};return p0(o,l)}it(g0,"isPointerInGraceArea");function bc(a){return l=>l.pointerType==="mouse"?a(l):void 0}it(bc,"whenMouse");var aN=BT,lN=PT,rN=IT,oN=GT,sN=QT,iN=FT,cN=eN,uN=Object.defineProperty,mr=(a,l)=>uN(a,"name",{value:l,configurable:!0}),Uh="DropdownMenu",[dN,$_]=un(Uh,[r0]),pr=r0(),[fN,v0]=dN(Uh),hN=mr(a=>{const{__scopeDropdownMenu:l,children:o,dir:i,open:u,defaultOpen:f,onOpenChange:h,modal:m=!0}=a,g=pr(l),v=p.useRef(null),[S,b]=Xa({prop:u,defaultProp:f??!1,onChange:h,caller:Uh});return s.jsx(fN,{scope:l,triggerId:ma(),triggerRef:v,contentId:ma(),open:S,onOpenChange:b,onOpenToggle:p.useCallback(()=>b(x=>!x),[b]),modal:m,children:s.jsx(aN,{...g,open:S,onOpenChange:b,dir:i,modal:m,children:o})})},"DropdownMenu"),mN="DropdownMenuTrigger",pN=p.forwardRef(mr(function(l,o){const{__scopeDropdownMenu:i,disabled:u=!1,...f}=l,h=v0(mN,i),m=pr(i),g=Pe(o,h.triggerRef);return s.jsx(lN,{asChild:!0,...m,children:s.jsx(Le.button,{type:"button",id:h.triggerId,"aria-haspopup":"menu","aria-expanded":h.open,"aria-controls":h.open?h.contentId:void 0,"data-state":h.open?"open":"closed","data-disabled":u?"":void 0,disabled:u,...f,ref:g,onPointerDown:Se(l.onPointerDown,v=>{!u&&v.button===0&&v.ctrlKey===!1&&(h.onOpenToggle(),h.open||v.preventDefault())}),onKeyDown:Se(l.onKeyDown,v=>{u||(["Enter"," "].includes(v.key)&&h.onOpenToggle(),v.key==="ArrowDown"&&h.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(v.key)&&v.preventDefault())})})})},"DropdownMenuTrigger")),gN=mr(a=>{const{__scopeDropdownMenu:l,...o}=a,i=pr(l);return s.jsx(rN,{...i,...o})},"DropdownMenuPortal"),vN="DropdownMenuContent",yN=p.forwardRef(mr(function(l,o){const{__scopeDropdownMenu:i,...u}=l,f=v0(vN,i),h=pr(i),m=p.useRef(!1);return s.jsx(oN,{id:f.contentId,"aria-labelledby":f.triggerId,...h,...u,ref:o,onCloseAutoFocus:Se(l.onCloseAutoFocus,g=>{var v;m.current||(v=f.triggerRef.current)==null||v.focus(),m.current=!1,g.preventDefault()}),onInteractOutside:Se(l.onInteractOutside,g=>{const v=g.detail.originalEvent,S=v.button===0&&v.ctrlKey===!0,b=v.button===2||S;(!f.modal||b)&&(m.current=!0)}),style:{...l.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)"}})},"DropdownMenuContent")),xN=p.forwardRef(mr(function(l,o){const{__scopeDropdownMenu:i,...u}=l,f=pr(i);return s.jsx(sN,{...f,...u,ref:o})},"DropdownMenuLabel")),bN=p.forwardRef(mr(function(l,o){const{__scopeDropdownMenu:i,...u}=l,f=pr(i);return s.jsx(iN,{...f,...u,ref:o})},"DropdownMenuItem")),SN=p.forwardRef(mr(function(l,o){const{__scopeDropdownMenu:i,...u}=l,f=pr(i);return s.jsx(cN,{...f,...u,ref:o})},"DropdownMenuSeparator")),wN=hN,jN=pN,CN=gN,y0=yN,x0=xN,b0=bN,S0=SN;const EN=wN,RN=jN,w0=p.forwardRef(({className:a,sideOffset:l=4,...o},i)=>s.jsx(CN,{children:s.jsx(y0,{ref:i,sideOffset:l,className:Ce("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",a),...o})}));w0.displayName=y0.displayName;const j0=p.forwardRef(({className:a,inset:l,...o},i)=>s.jsx(b0,{ref:i,className:Ce("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",l&&"pl-8",a),...o}));j0.displayName=b0.displayName;const TN=p.forwardRef(({className:a,...l},o)=>s.jsx(x0,{ref:o,className:Ce("px-2 py-1.5 text-sm font-semibold",a),...l}));TN.displayName=x0.displayName;const NN=p.forwardRef(({className:a,...l},o)=>s.jsx(S0,{ref:o,className:Ce("-mx-1 my-1 h-px bg-muted",a),...l}));NN.displayName=S0.displayName;function AN(){const{theme:a,setTheme:l}=H2(),{user:o,logout:i}=hh(),[u,f]=p.useState(!1),[h,m]=p.useState(null),g=vo(),v=a==="light"?$C:a==="dark"?qC:PC;return p.useEffect(()=>{we.get("/api/admin/update/check").then(S=>m(S)).catch(()=>{})},[]),s.jsxs("header",{className:"flex h-14 items-center justify-between border-b bg-background px-4",children:[s.jsx("div",{className:"text-sm text-muted-foreground",children:"Admin"}),s.jsxs("div",{className:"flex items-center gap-2",children:[(h==null?void 0:h.hasUpdate)&&s.jsxs(he,{variant:"ghost",size:"sm",title:`New version available: v${h.latestVersion} — go to Settings → System to update`,onClick:()=>g("/settings?tab=system"),children:[s.jsx(_C,{className:"mr-1 h-4 w-4 text-blue-500"}),"Update v",h.latestVersion]}),s.jsx(he,{variant:"ghost",size:"icon",onClick:()=>l(a==="dark"?"light":"dark"),children:s.jsx(v,{className:"h-4 w-4"})}),s.jsxs(EN,{open:u,onOpenChange:f,children:[s.jsx(RN,{asChild:!0,children:s.jsx(he,{variant:"ghost",children:(o==null?void 0:o.username)??"admin"})}),s.jsx(w0,{align:"end",children:s.jsxs(j0,{onClick:()=>void i(),children:[s.jsx(BC,{className:"mr-2 h-4 w-4"})," Sign out"]})})]})]})]})}const Re=p.forwardRef(({className:a,type:l,...o},i)=>s.jsx("input",{type:l,className:Ce("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",a),ref:i,...o}));Re.displayName="Input";var MN=Object.defineProperty,_N=(a,l)=>MN(a,"name",{value:l,configurable:!0}),ON=p.forwardRef(_N(function(l,o){return s.jsx(Le.label,{...l,ref:o,onMouseDown:i=>{var f;i.target.closest("button, input, select, textarea")||((f=l.onMouseDown)==null||f.call(l,i),!i.defaultPrevented&&i.detail>1&&i.preventDefault())}})},"Label")),C0=ON;const xe=p.forwardRef(({className:a,...l},o)=>s.jsx(C0,{ref:o,className:Ce("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",a),...l}));xe.displayName=C0.displayName;const Ge=p.forwardRef(({className:a,...l},o)=>s.jsx("div",{ref:o,className:Ce("rounded-lg border bg-card text-card-foreground shadow-sm",a),...l}));Ge.displayName="Card";const $e=p.forwardRef(({className:a,...l},o)=>s.jsx("div",{ref:o,className:Ce("flex flex-col space-y-1.5 p-6",a),...l}));$e.displayName="CardHeader";const Ke=p.forwardRef(({className:a,...l},o)=>s.jsx("h3",{ref:o,className:Ce("text-lg font-semibold leading-none tracking-tight",a),...l}));Ke.displayName="CardTitle";const sn=p.forwardRef(({className:a,...l},o)=>s.jsx("p",{ref:o,className:Ce("text-sm text-muted-foreground",a),...l}));sn.displayName="CardDescription";const Xe=p.forwardRef(({className:a,...l},o)=>s.jsx("div",{ref:o,className:Ce("p-6 pt-0",a),...l}));Xe.displayName="CardContent";const E0=p.forwardRef(({className:a,...l},o)=>s.jsx("div",{ref:o,className:Ce("flex items-center p-6 pt-0",a),...l}));E0.displayName="CardFooter";var DN=a=>{switch(a){case"success":return LN;case"info":return HN;case"warning":return UN;case"error":return BN;default:return null}},zN=Array(12).fill(0),kN=({visible:a,className:l})=>ce.createElement("div",{className:["sonner-loading-wrapper",l].filter(Boolean).join(" "),"data-visible":a},ce.createElement("div",{className:"sonner-spinner"},zN.map((o,i)=>ce.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),LN=ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ce.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),UN=ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ce.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),HN=ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ce.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),BN=ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ce.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),PN=ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ce.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ce.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),qN=()=>{let[a,l]=ce.useState(document.hidden);return ce.useEffect(()=>{let o=()=>{l(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),a},Jf=1,VN=class{constructor(){this.subscribe=a=>(this.subscribers.push(a),()=>{let l=this.subscribers.indexOf(a);this.subscribers.splice(l,1)}),this.publish=a=>{this.subscribers.forEach(l=>l(a))},this.addToast=a=>{this.publish(a),this.toasts=[...this.toasts,a]},this.create=a=>{var l;let{message:o,...i}=a,u=typeof(a==null?void 0:a.id)=="number"||((l=a.id)==null?void 0:l.length)>0?a.id:Jf++,f=this.toasts.find(m=>m.id===u),h=a.dismissible===void 0?!0:a.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),f?this.toasts=this.toasts.map(m=>m.id===u?(this.publish({...m,...a,id:u,title:o}),{...m,...a,id:u,dismissible:h,title:o}):m):this.addToast({title:o,...i,dismissible:h,id:u}),u},this.dismiss=a=>(this.dismissedToasts.add(a),a||this.toasts.forEach(l=>{this.subscribers.forEach(o=>o({id:l.id,dismiss:!0}))}),this.subscribers.forEach(l=>l({id:a,dismiss:!0})),a),this.message=(a,l)=>this.create({...l,message:a}),this.error=(a,l)=>this.create({...l,message:a,type:"error"}),this.success=(a,l)=>this.create({...l,type:"success",message:a}),this.info=(a,l)=>this.create({...l,type:"info",message:a}),this.warning=(a,l)=>this.create({...l,type:"warning",message:a}),this.loading=(a,l)=>this.create({...l,type:"loading",message:a}),this.promise=(a,l)=>{if(!l)return;let o;l.loading!==void 0&&(o=this.create({...l,promise:a,type:"loading",message:l.loading,description:typeof l.description!="function"?l.description:void 0}));let i=a instanceof Promise?a:a(),u=o!==void 0,f,h=i.then(async g=>{if(f=["resolve",g],ce.isValidElement(g))u=!1,this.create({id:o,type:"default",message:g});else if(YN(g)&&!g.ok){u=!1;let v=typeof l.error=="function"?await l.error(`HTTP error! status: ${g.status}`):l.error,S=typeof l.description=="function"?await l.description(`HTTP error! status: ${g.status}`):l.description;this.create({id:o,type:"error",message:v,description:S})}else if(l.success!==void 0){u=!1;let v=typeof l.success=="function"?await l.success(g):l.success,S=typeof l.description=="function"?await l.description(g):l.description;this.create({id:o,type:"success",message:v,description:S})}}).catch(async g=>{if(f=["reject",g],l.error!==void 0){u=!1;let v=typeof l.error=="function"?await l.error(g):l.error,S=typeof l.description=="function"?await l.description(g):l.description;this.create({id:o,type:"error",message:v,description:S})}}).finally(()=>{var g;u&&(this.dismiss(o),o=void 0),(g=l.finally)==null||g.call(l)}),m=()=>new Promise((g,v)=>h.then(()=>f[0]==="reject"?v(f[1]):g(f[1])).catch(v));return typeof o!="string"&&typeof o!="number"?{unwrap:m}:Object.assign(o,{unwrap:m})},this.custom=(a,l)=>{let o=(l==null?void 0:l.id)||Jf++;return this.create({jsx:a(o),id:o,...l}),o},this.getActiveToasts=()=>this.toasts.filter(a=>!this.dismissedToasts.has(a.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ln=new VN,IN=(a,l)=>{let o=(l==null?void 0:l.id)||Jf++;return ln.addToast({title:a,...l,id:o}),o},YN=a=>a&&typeof a=="object"&&"ok"in a&&typeof a.ok=="boolean"&&"status"in a&&typeof a.status=="number",GN=IN,$N=()=>ln.toasts,KN=()=>ln.getActiveToasts(),ye=Object.assign(GN,{success:ln.success,info:ln.info,warning:ln.warning,error:ln.error,custom:ln.custom,message:ln.message,promise:ln.promise,dismiss:ln.dismiss,loading:ln.loading},{getHistory:$N,getToasts:KN});function XN(a,{insertAt:l}={}){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",l==="top"&&o.firstChild?o.insertBefore(i,o.firstChild):o.appendChild(i),i.styleSheet?i.styleSheet.cssText=a:i.appendChild(document.createTextNode(a))}XN(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
286
+ `);function rc(a){return a.label!==void 0}var QN=3,FN="32px",ZN="16px",Jy=4e3,JN=356,WN=14,eA=20,tA=200;function Fn(...a){return a.filter(Boolean).join(" ")}function nA(a){let[l,o]=a.split("-"),i=[];return l&&i.push(l),o&&i.push(o),i}var aA=a=>{var l,o,i,u,f,h,m,g,v,S,b;let{invert:x,toast:w,unstyled:R,interacting:j,setHeights:C,visibleToasts:N,heights:T,index:A,toasts:_,expanded:H,removeToast:P,defaultRichColors:I,closeButton:k,style:ne,cancelButtonStyle:se,actionButtonStyle:Q,className:G="",descriptionClassName:re="",duration:le,position:fe,gap:z,loadingIcon:$,expandByDefault:te,classNames:L,icons:X,closeButtonAriaLabel:M="Close toast",pauseWhenPageIsHidden:B}=a,[F,ae]=ce.useState(null),[ue,J]=ce.useState(null),[oe,ie]=ce.useState(!1),[me,De]=ce.useState(!1),[_e,Oe]=ce.useState(!1),[qe,yt]=ce.useState(!1),[Bt,Xt]=ce.useState(!1),[la,Rn]=ce.useState(0),[Pl,nl]=ce.useState(0),Yn=ce.useRef(w.duration||le||Jy),ba=ce.useRef(null),Sa=ce.useRef(null),It=A===0,Yc=A+1<=N,Yt=w.type,wa=w.dismissible!==!1,vr=w.className||"",Gc=w.descriptionClassName||"",ql=ce.useMemo(()=>T.findIndex(Ee=>Ee.toastId===w.id)||0,[T,w.id]),$c=ce.useMemo(()=>{var Ee;return(Ee=w.closeButton)!=null?Ee:k},[w.closeButton,k]),Us=ce.useMemo(()=>w.duration||le||Jy,[w.duration,le]),ja=ce.useRef(0),xt=ce.useRef(0),Gn=ce.useRef(0),bt=ce.useRef(null),[Kc,Xc]=fe.split("-"),Hs=ce.useMemo(()=>T.reduce((Ee,Fe,ot)=>ot>=ql?Ee:Ee+Fe.height,0),[T,ql]),Vl=qN(),yr=w.invert||x,al=Yt==="loading";xt.current=ce.useMemo(()=>ql*z+Hs,[ql,Hs]),ce.useEffect(()=>{Yn.current=Us},[Us]),ce.useEffect(()=>{ie(!0)},[]),ce.useEffect(()=>{let Ee=Sa.current;if(Ee){let Fe=Ee.getBoundingClientRect().height;return nl(Fe),C(ot=>[{toastId:w.id,height:Fe,position:w.position},...ot]),()=>C(ot=>ot.filter(Gt=>Gt.toastId!==w.id))}},[C,w.id]),ce.useLayoutEffect(()=>{if(!oe)return;let Ee=Sa.current,Fe=Ee.style.height;Ee.style.height="auto";let ot=Ee.getBoundingClientRect().height;Ee.style.height=Fe,nl(ot),C(Gt=>Gt.find(Ot=>Ot.toastId===w.id)?Gt.map(Ot=>Ot.toastId===w.id?{...Ot,height:ot}:Ot):[{toastId:w.id,height:ot,position:w.position},...Gt])},[oe,w.title,w.description,C,w.id]);let Pt=ce.useCallback(()=>{De(!0),Rn(xt.current),C(Ee=>Ee.filter(Fe=>Fe.toastId!==w.id)),setTimeout(()=>{P(w)},tA)},[w,P,C,xt]);ce.useEffect(()=>{if(w.promise&&Yt==="loading"||w.duration===1/0||w.type==="loading")return;let Ee;return H||j||B&&Vl?(()=>{if(Gn.current<ja.current){let Fe=new Date().getTime()-ja.current;Yn.current=Yn.current-Fe}Gn.current=new Date().getTime()})():Yn.current!==1/0&&(ja.current=new Date().getTime(),Ee=setTimeout(()=>{var Fe;(Fe=w.onAutoClose)==null||Fe.call(w,w),Pt()},Yn.current)),()=>clearTimeout(Ee)},[H,j,w,Yt,B,Vl,Pt]),ce.useEffect(()=>{w.delete&&Pt()},[Pt,w.delete]);function xr(){var Ee,Fe,ot;return X!=null&&X.loading?ce.createElement("div",{className:Fn(L==null?void 0:L.loader,(Ee=w==null?void 0:w.classNames)==null?void 0:Ee.loader,"sonner-loader"),"data-visible":Yt==="loading"},X.loading):$?ce.createElement("div",{className:Fn(L==null?void 0:L.loader,(Fe=w==null?void 0:w.classNames)==null?void 0:Fe.loader,"sonner-loader"),"data-visible":Yt==="loading"},$):ce.createElement(kN,{className:Fn(L==null?void 0:L.loader,(ot=w==null?void 0:w.classNames)==null?void 0:ot.loader),visible:Yt==="loading"})}return ce.createElement("li",{tabIndex:0,ref:Sa,className:Fn(G,vr,L==null?void 0:L.toast,(l=w==null?void 0:w.classNames)==null?void 0:l.toast,L==null?void 0:L.default,L==null?void 0:L[Yt],(o=w==null?void 0:w.classNames)==null?void 0:o[Yt]),"data-sonner-toast":"","data-rich-colors":(i=w.richColors)!=null?i:I,"data-styled":!(w.jsx||w.unstyled||R),"data-mounted":oe,"data-promise":!!w.promise,"data-swiped":Bt,"data-removed":me,"data-visible":Yc,"data-y-position":Kc,"data-x-position":Xc,"data-index":A,"data-front":It,"data-swiping":_e,"data-dismissible":wa,"data-type":Yt,"data-invert":yr,"data-swipe-out":qe,"data-swipe-direction":ue,"data-expanded":!!(H||te&&oe),style:{"--index":A,"--toasts-before":A,"--z-index":_.length-A,"--offset":`${me?la:xt.current}px`,"--initial-height":te?"auto":`${Pl}px`,...ne,...w.style},onDragEnd:()=>{Oe(!1),ae(null),bt.current=null},onPointerDown:Ee=>{al||!wa||(ba.current=new Date,Rn(xt.current),Ee.target.setPointerCapture(Ee.pointerId),Ee.target.tagName!=="BUTTON"&&(Oe(!0),bt.current={x:Ee.clientX,y:Ee.clientY}))},onPointerUp:()=>{var Ee,Fe,ot,Gt;if(qe||!wa)return;bt.current=null;let Ot=Number(((Ee=Sa.current)==null?void 0:Ee.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ra=Number(((Fe=Sa.current)==null?void 0:Fe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),oa=new Date().getTime()-((ot=ba.current)==null?void 0:ot.getTime()),Qt=F==="x"?Ot:ra,$n=Math.abs(Qt)/oa;if(Math.abs(Qt)>=eA||$n>.11){Rn(xt.current),(Gt=w.onDismiss)==null||Gt.call(w,w),J(F==="x"?Ot>0?"right":"left":ra>0?"down":"up"),Pt(),yt(!0),Xt(!1);return}Oe(!1),ae(null)},onPointerMove:Ee=>{var Fe,ot,Gt,Ot;if(!bt.current||!wa||((Fe=window.getSelection())==null?void 0:Fe.toString().length)>0)return;let ra=Ee.clientY-bt.current.y,oa=Ee.clientX-bt.current.x,Qt=(ot=a.swipeDirections)!=null?ot:nA(fe);!F&&(Math.abs(oa)>1||Math.abs(ra)>1)&&ae(Math.abs(oa)>Math.abs(ra)?"x":"y");let $n={x:0,y:0};F==="y"?(Qt.includes("top")||Qt.includes("bottom"))&&(Qt.includes("top")&&ra<0||Qt.includes("bottom")&&ra>0)&&($n.y=ra):F==="x"&&(Qt.includes("left")||Qt.includes("right"))&&(Qt.includes("left")&&oa<0||Qt.includes("right")&&oa>0)&&($n.x=oa),(Math.abs($n.x)>0||Math.abs($n.y)>0)&&Xt(!0),(Gt=Sa.current)==null||Gt.style.setProperty("--swipe-amount-x",`${$n.x}px`),(Ot=Sa.current)==null||Ot.style.setProperty("--swipe-amount-y",`${$n.y}px`)}},$c&&!w.jsx?ce.createElement("button",{"aria-label":M,"data-disabled":al,"data-close-button":!0,onClick:al||!wa?()=>{}:()=>{var Ee;Pt(),(Ee=w.onDismiss)==null||Ee.call(w,w)},className:Fn(L==null?void 0:L.closeButton,(u=w==null?void 0:w.classNames)==null?void 0:u.closeButton)},(f=X==null?void 0:X.close)!=null?f:PN):null,w.jsx||p.isValidElement(w.title)?w.jsx?w.jsx:typeof w.title=="function"?w.title():w.title:ce.createElement(ce.Fragment,null,Yt||w.icon||w.promise?ce.createElement("div",{"data-icon":"",className:Fn(L==null?void 0:L.icon,(h=w==null?void 0:w.classNames)==null?void 0:h.icon)},w.promise||w.type==="loading"&&!w.icon?w.icon||xr():null,w.type!=="loading"?w.icon||(X==null?void 0:X[Yt])||DN(Yt):null):null,ce.createElement("div",{"data-content":"",className:Fn(L==null?void 0:L.content,(m=w==null?void 0:w.classNames)==null?void 0:m.content)},ce.createElement("div",{"data-title":"",className:Fn(L==null?void 0:L.title,(g=w==null?void 0:w.classNames)==null?void 0:g.title)},typeof w.title=="function"?w.title():w.title),w.description?ce.createElement("div",{"data-description":"",className:Fn(re,Gc,L==null?void 0:L.description,(v=w==null?void 0:w.classNames)==null?void 0:v.description)},typeof w.description=="function"?w.description():w.description):null),p.isValidElement(w.cancel)?w.cancel:w.cancel&&rc(w.cancel)?ce.createElement("button",{"data-button":!0,"data-cancel":!0,style:w.cancelButtonStyle||se,onClick:Ee=>{var Fe,ot;rc(w.cancel)&&wa&&((ot=(Fe=w.cancel).onClick)==null||ot.call(Fe,Ee),Pt())},className:Fn(L==null?void 0:L.cancelButton,(S=w==null?void 0:w.classNames)==null?void 0:S.cancelButton)},w.cancel.label):null,p.isValidElement(w.action)?w.action:w.action&&rc(w.action)?ce.createElement("button",{"data-button":!0,"data-action":!0,style:w.actionButtonStyle||Q,onClick:Ee=>{var Fe,ot;rc(w.action)&&((ot=(Fe=w.action).onClick)==null||ot.call(Fe,Ee),!Ee.defaultPrevented&&Pt())},className:Fn(L==null?void 0:L.actionButton,(b=w==null?void 0:w.classNames)==null?void 0:b.actionButton)},w.action.label):null))};function Wy(){if(typeof window>"u"||typeof document>"u")return"ltr";let a=document.documentElement.getAttribute("dir");return a==="auto"||!a?window.getComputedStyle(document.documentElement).direction:a}function lA(a,l){let o={};return[a,l].forEach((i,u)=>{let f=u===1,h=f?"--mobile-offset":"--offset",m=f?ZN:FN;function g(v){["top","right","bottom","left"].forEach(S=>{o[`${h}-${S}`]=typeof v=="number"?`${v}px`:v})}typeof i=="number"||typeof i=="string"?g(i):typeof i=="object"?["top","right","bottom","left"].forEach(v=>{i[v]===void 0?o[`${h}-${v}`]=m:o[`${h}-${v}`]=typeof i[v]=="number"?`${i[v]}px`:i[v]}):g(m)}),o}var rA=p.forwardRef(function(a,l){let{invert:o,position:i="bottom-right",hotkey:u=["altKey","KeyT"],expand:f,closeButton:h,className:m,offset:g,mobileOffset:v,theme:S="light",richColors:b,duration:x,style:w,visibleToasts:R=QN,toastOptions:j,dir:C=Wy(),gap:N=WN,loadingIcon:T,icons:A,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:H}=a,[P,I]=ce.useState([]),k=ce.useMemo(()=>Array.from(new Set([i].concat(P.filter(B=>B.position).map(B=>B.position)))),[P,i]),[ne,se]=ce.useState([]),[Q,G]=ce.useState(!1),[re,le]=ce.useState(!1),[fe,z]=ce.useState(S!=="system"?S:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=ce.useRef(null),te=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),L=ce.useRef(null),X=ce.useRef(!1),M=ce.useCallback(B=>{I(F=>{var ae;return(ae=F.find(ue=>ue.id===B.id))!=null&&ae.delete||ln.dismiss(B.id),F.filter(({id:ue})=>ue!==B.id)})},[]);return ce.useEffect(()=>ln.subscribe(B=>{if(B.dismiss){I(F=>F.map(ae=>ae.id===B.id?{...ae,delete:!0}:ae));return}setTimeout(()=>{bC.flushSync(()=>{I(F=>{let ae=F.findIndex(ue=>ue.id===B.id);return ae!==-1?[...F.slice(0,ae),{...F[ae],...B},...F.slice(ae+1)]:[B,...F]})})})}),[]),ce.useEffect(()=>{if(S!=="system"){z(S);return}if(S==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;let B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:F})=>{z(F?"dark":"light")})}catch{B.addListener(({matches:ae})=>{try{z(ae?"dark":"light")}catch(ue){console.error(ue)}})}},[S]),ce.useEffect(()=>{P.length<=1&&G(!1)},[P]),ce.useEffect(()=>{let B=F=>{var ae,ue;u.every(J=>F[J]||F.code===J)&&(G(!0),(ae=$.current)==null||ae.focus()),F.code==="Escape"&&(document.activeElement===$.current||(ue=$.current)!=null&&ue.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[u]),ce.useEffect(()=>{if($.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,X.current=!1)}},[$.current]),ce.createElement("section",{ref:l,"aria-label":`${_} ${te}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},k.map((B,F)=>{var ae;let[ue,J]=B.split("-");return P.length?ce.createElement("ol",{key:B,dir:C==="auto"?Wy():C,tabIndex:-1,ref:$,className:m,"data-sonner-toaster":!0,"data-theme":fe,"data-y-position":ue,"data-lifted":Q&&P.length>1&&!f,"data-x-position":J,style:{"--front-toast-height":`${((ae=ne[0])==null?void 0:ae.height)||0}px`,"--width":`${JN}px`,"--gap":`${N}px`,...w,...lA(g,v)},onBlur:oe=>{X.current&&!oe.currentTarget.contains(oe.relatedTarget)&&(X.current=!1,L.current&&(L.current.focus({preventScroll:!0}),L.current=null))},onFocus:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||X.current||(X.current=!0,L.current=oe.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{re||G(!1)},onDragEnd:()=>G(!1),onPointerDown:oe=>{oe.target instanceof HTMLElement&&oe.target.dataset.dismissible==="false"||le(!0)},onPointerUp:()=>le(!1)},P.filter(oe=>!oe.position&&F===0||oe.position===B).map((oe,ie)=>{var me,De;return ce.createElement(aA,{key:oe.id,icons:A,index:ie,toast:oe,defaultRichColors:b,duration:(me=j==null?void 0:j.duration)!=null?me:x,className:j==null?void 0:j.className,descriptionClassName:j==null?void 0:j.descriptionClassName,invert:o,visibleToasts:R,closeButton:(De=j==null?void 0:j.closeButton)!=null?De:h,interacting:re,position:B,style:j==null?void 0:j.style,unstyled:j==null?void 0:j.unstyled,classNames:j==null?void 0:j.classNames,cancelButtonStyle:j==null?void 0:j.cancelButtonStyle,actionButtonStyle:j==null?void 0:j.actionButtonStyle,removeToast:M,toasts:P.filter(_e=>_e.position==oe.position),heights:ne.filter(_e=>_e.position==oe.position),setHeights:se,expandByDefault:f,gap:N,loadingIcon:T,expanded:Q,pauseWhenPageIsHidden:H,swipeDirections:a.swipeDirections})})):null}))});function oA(){const{login:a}=hh(),[l,o]=p.useState("admin"),[i,u]=p.useState(""),[f,h]=p.useState(""),[m,g]=p.useState(""),[v,S]=p.useState(!1),[b,x]=p.useState(!1),w=vo(),R=cn();return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs(Ge,{className:"w-full max-w-sm",children:[s.jsxs($e,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-8 w-8 object-contain"}),s.jsx(Ke,{children:"Sign in"})]}),s.jsx(sn,{children:"Enter your admin credentials."})]}),s.jsxs(Xe,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Username"}),s.jsx(Re,{value:l,onChange:j=>o(j.target.value),autoFocus:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Password"}),s.jsx(Re,{type:"password",value:i,onChange:j=>u(j.target.value)})]}),v&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"2FA code (or recovery code)"}),s.jsx(Re,{value:f,onChange:j=>h(j.target.value),placeholder:"123456",maxLength:6})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Recovery code (alternative)"}),s.jsx(Re,{value:m,onChange:j=>g(j.target.value),placeholder:"ABCD12-EF3456"})]})]})]}),s.jsx("div",{className:"px-6 pb-6",children:s.jsx(he,{className:"w-full",disabled:b,onClick:async()=>{var j,C;x(!0);try{if((await a(l,i,f||void 0,m||void 0)).totpRequired){S(!0);return}const T=((C=(j=R.state)==null?void 0:j.from)==null?void 0:C.pathname)??"/";w(T,{replace:!0})}catch(N){ye.error(N.message)}finally{x(!1)}},children:"Sign in"})})]})})}function sA(){const[a,l]=p.useState("admin"),[o,i]=p.useState(""),[u,f]=p.useState(""),[h,m]=p.useState(!1),[g,v]=p.useState(!0),S=vo();p.useEffect(()=>{we.get("/api/admin/setup/status").then(w=>v(!w.masterKeyConfigured)).catch(()=>v(!0))},[]);const b=!g||u.trim().length>=32,x=!h&&o.length>=12&&b;return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs(Ge,{className:"w-full max-w-md",children:[s.jsxs($e,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-8 w-8 object-contain rounded"}),s.jsx(Ke,{children:"Welcome to LateDev Router"})]}),s.jsx(sn,{children:"Set up the administrator account to get started."})]}),s.jsxs(Xe,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Username"}),s.jsx(Re,{value:a,onChange:w=>l(w.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Password (12+ chars)"}),s.jsx(Re,{type:"password",value:o,onChange:w=>i(w.target.value)})]}),g&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Master encryption key (required, 32+ chars)"}),s.jsx(Re,{type:"password",value:u,onChange:w=>f(w.target.value),placeholder:"Paste or generate a 32+ character key"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Provider API keys are encrypted with this key (AES-256-GCM). Store it somewhere safe — if it is lost, stored provider credentials cannot be recovered. Generate one with:"," ",s.jsx("code",{className:"break-all",children:`node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"`})]})]})]}),s.jsx(E0,{children:s.jsx(he,{disabled:!x,onClick:async()=>{m(!0);try{await we.post("/api/admin/setup",{username:a,password:o,setupMasterKey:g?u.trim():void 0}),ye.success("Admin account created"),S("/login",{replace:!0})}catch(w){ye.error(w.message)}finally{m(!1)}},children:"Create admin"})})]})})}function xa({title:a,description:l,actions:o,className:i}){return s.jsxs("div",{className:Ce("mb-6 flex items-start justify-between gap-4",i),children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:a}),l&&s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:l})]}),o&&s.jsx("div",{className:"flex items-center gap-2",children:o})]})}const iA=Qx("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",success:"border-transparent bg-emerald-600 text-white",warning:"border-transparent bg-amber-500 text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function et({className:a,variant:l,...o}){return s.jsx("div",{className:Ce(iA({variant:l}),a),...o})}function cA(){const[a,l]=p.useState(null);return p.useEffect(()=>{we.get("/api/admin/dashboard").then(l).catch(()=>l(null))},[]),a?s.jsxs("div",{children:[s.jsx(xa,{title:"Dashboard",description:"Operational summary for today",actions:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(he,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(ir,{to:"/providers",children:[s.jsx(Ms,{className:"mr-1 h-4 w-4"})," Provider"]})}),s.jsx(he,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(ir,{to:"/combos",children:[s.jsx(Ox,{className:"mr-1 h-4 w-4"})," Combo"]})}),s.jsx(he,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(ir,{to:"/api-keys",children:[s.jsx(_x,{className:"mr-1 h-4 w-4"})," API Key"]})})]})}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs(Ge,{children:[s.jsx($e,{className:"pb-1",children:s.jsx(Ke,{className:"text-sm text-muted-foreground",children:"Requests today"})}),s.jsx(Xe,{className:"text-2xl font-semibold",children:Ht(a.today.total)})]}),s.jsxs(Ge,{children:[s.jsx($e,{className:"pb-1",children:s.jsx(Ke,{className:"text-sm text-muted-foreground",children:"Success rate"})}),s.jsx(Xe,{className:"text-2xl font-semibold",children:a.today.total?bs(a.today.success/a.today.total):"—"})]}),s.jsxs(Ge,{children:[s.jsx($e,{className:"pb-1",children:s.jsx(Ke,{className:"text-sm text-muted-foreground",children:"Failed"})}),s.jsx(Xe,{className:"text-2xl font-semibold",children:Ht(a.today.failed)})]}),s.jsxs(Ge,{children:[s.jsx($e,{className:"pb-1",children:s.jsx(Ke,{className:"text-sm text-muted-foreground",children:"Tokens today"})}),s.jsx(Xe,{className:"text-2xl font-semibold",children:Ht(a.today.totalTokens)})]})]}),s.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-2",children:[s.jsxs(Ge,{children:[s.jsxs($e,{children:[s.jsx(Ke,{className:"text-base",children:"Provider health"}),s.jsxs(sn,{children:[a.providers.length," configured"]})]}),s.jsxs(Xe,{className:"space-y-2",children:[a.providers.length===0&&s.jsxs("p",{className:"text-sm text-muted-foreground",children:["No providers yet. ",s.jsx(ir,{to:"/providers",className:"text-primary",children:"Add one"}),"."]}),a.providers.map(o=>s.jsxs("div",{className:"flex items-center justify-between rounded border p-2 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Dx,{className:"h-4 w-4 text-muted-foreground"}),s.jsx("span",{className:"font-medium",children:o.name}),s.jsx("span",{className:"text-xs text-muted-foreground",children:o.slug}),s.jsx(et,{variant:"outline",className:"ml-2",children:o.type})]}),s.jsx(et,{variant:o.health==="healthy"?"success":o.health==="down"?"destructive":"secondary",children:o.health})]},o.id))]})]}),s.jsxs(Ge,{children:[s.jsxs($e,{children:[s.jsx(Ke,{className:"text-base",children:"Recent failures"}),s.jsx(sn,{children:"Today"})]}),s.jsxs(Xe,{className:"space-y-1 text-sm",children:[a.recentFailures.length===0&&s.jsx("p",{className:"text-muted-foreground",children:"No failures today."}),a.recentFailures.map(o=>{var i;return s.jsxs("div",{className:"flex items-center justify-between border-b py-1 last:border-0",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-mono text-xs",children:o.requestedModel}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[o.errorType??`HTTP ${o.httpStatus}`," — ",(i=o.errorMessage)==null?void 0:i.slice(0,60)]})]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:gh(o.createdAt)})]},o.id)})]})]})]})]}):s.jsx("div",{className:"text-muted-foreground",children:"Loading…"})}const Wn=p.forwardRef(({className:a,...l},o)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:o,className:Ce("w-full caption-bottom text-sm",a),...l})}));Wn.displayName="Table";const ea=p.forwardRef(({className:a,...l},o)=>s.jsx("thead",{ref:o,className:Ce("[&_tr]:border-b",a),...l}));ea.displayName="TableHeader";const ta=p.forwardRef(({className:a,...l},o)=>s.jsx("tbody",{ref:o,className:Ce("[&_tr:last-child]:border-0",a),...l}));ta.displayName="TableBody";const Ze=p.forwardRef(({className:a,...l},o)=>s.jsx("tr",{ref:o,className:Ce("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",a),...l}));Ze.displayName="TableRow";const ve=p.forwardRef(({className:a,...l},o)=>s.jsx("th",{ref:o,className:Ce("h-10 px-2 text-left align-middle font-medium text-muted-foreground",a),...l}));ve.displayName="TableHead";const de=p.forwardRef(({className:a,...l},o)=>s.jsx("td",{ref:o,className:Ce("p-2 align-middle",a),...l}));de.displayName="TableCell";var uA=Object.defineProperty,En=(a,l)=>uA(a,"name",{value:l,configurable:!0}),Hh="Dialog",[R0,T0]=un(Hh),[dA,aa]=R0(Hh),N0=En(a=>{const{__scopeDialog:l,children:o,open:i,defaultOpen:u,onOpenChange:f,modal:h=!0}=a,m=p.useRef(null),g=p.useRef(null),[v,S]=Xa({prop:i,defaultProp:u??!1,onChange:f,caller:Hh}),[b,x]=p.useState(0),[w,R]=p.useState(0);return s.jsx(dA,{scope:l,triggerRef:m,contentRef:g,contentId:ma(),titleId:ma(),descriptionId:ma(),titlePresent:b>0,descriptionPresent:w>0,setTitleCount:x,setDescriptionCount:R,open:v,onOpenChange:S,onOpenToggle:p.useCallback(()=>S(j=>!j),[S]),modal:h,children:o})},"Dialog"),fA="DialogTrigger",A0=p.forwardRef(En(function(l,o){const{__scopeDialog:i,...u}=l,f=aa(fA,i),h=Pe(o,f.triggerRef);return s.jsx(Le.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":qc(f.open),...u,ref:h,onClick:Se(l.onClick,f.onOpenToggle)})},"DialogTrigger")),M0="DialogPortal",[hA,_0]=R0(M0,{forceMount:void 0}),O0=En(a=>{const{__scopeDialog:l,forceMount:o,children:i,container:u}=a,f=aa(M0,l);return s.jsx(hA,{scope:l,forceMount:o,children:p.Children.map(i,h=>s.jsx(Wa,{present:o||f.open,children:s.jsx(_h,{asChild:!0,container:u,children:h})}))})},"DialogPortal"),Wf="DialogOverlay",Bh=p.forwardRef(En(function(l,o){const i=_0(Wf,l.__scopeDialog),{forceMount:u=i.forceMount,...f}=l,h=aa(Wf,l.__scopeDialog);return h.modal?s.jsx(Wa,{present:u||h.open,children:s.jsx(pA,{...f,ref:o})}):null},"DialogOverlay")),mA=pa("DialogOverlay.RemoveScroll"),pA=p.forwardRef(En(function(l,o){const{__scopeDialog:i,...u}=l,f=aa(Wf,i),h=cb(),m=Pe(o,h);return s.jsx(Bc,{as:mA,allowPinchZoom:!0,shards:[f.contentRef],children:s.jsx(Le.div,{"data-state":qc(f.open),...u,ref:m,style:{pointerEvents:"auto",...u.style}})})},"DialogOverlayImpl")),Rs="DialogContent",Ph=p.forwardRef(En(function(l,o){const i=_0(Rs,l.__scopeDialog),{forceMount:u=i.forceMount,...f}=l,h=aa(Rs,l.__scopeDialog);return s.jsx(Wa,{present:u||h.open,children:h.modal?s.jsx(gA,{...f,ref:o}):s.jsx(vA,{...f,ref:o})})},"DialogContent")),gA=p.forwardRef(En(function(l,o){const i=aa(Rs,l.__scopeDialog),u=p.useRef(null),f=Pe(o,i.contentRef,u);return p.useEffect(()=>{const h=u.current;if(h)return zh(h)},[]),s.jsx(D0,{...l,ref:f,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:Se(l.onCloseAutoFocus,h=>{var m;h.preventDefault(),(m=i.triggerRef.current)==null||m.focus()}),onPointerDownOutside:Se(l.onPointerDownOutside,h=>{const m=h.detail.originalEvent,g=m.button===0&&m.ctrlKey===!0;(m.button===2||g)&&h.preventDefault()}),onFocusOutside:Se(l.onFocusOutside,h=>h.preventDefault())})},"DialogContentModal")),vA=p.forwardRef(En(function(l,o){const i=aa(Rs,l.__scopeDialog),u=p.useRef(!1),f=p.useRef(!1);return s.jsx(D0,{...l,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:h=>{var m,g;(m=l.onCloseAutoFocus)==null||m.call(l,h),h.defaultPrevented||(u.current||(g=i.triggerRef.current)==null||g.focus(),h.preventDefault()),u.current=!1,f.current=!1},onInteractOutside:h=>{var v,S;(v=l.onInteractOutside)==null||v.call(l,h),h.defaultPrevented||(u.current=!0,h.detail.originalEvent.type==="pointerdown"&&(f.current=!0));const m=h.target;((S=i.triggerRef.current)==null?void 0:S.contains(m))&&h.preventDefault(),h.detail.originalEvent.type==="focusin"&&f.current&&h.preventDefault()}})},"DialogContentNonModal")),D0=p.forwardRef(En(function(l,o){const{__scopeDialog:i,trapFocus:u,onOpenAutoFocus:f,onCloseAutoFocus:h,...m}=l,g=aa(Rs,i);return Ds(),s.jsx(s.Fragment,{children:s.jsx(wh,{asChild:!0,loop:!0,trapped:u,onMountAutoFocus:f,onUnmountAutoFocus:h,children:s.jsx(Nc,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionPresent?g.descriptionId:void 0,"aria-labelledby":g.titlePresent?g.titleId:void 0,"data-state":qc(g.open),...m,ref:o,deferPointerDownOutside:!0,onDismiss:()=>g.onOpenChange(!1)})})})},"DialogContentImpl")),yA="DialogTitle",qh=p.forwardRef(En(function(l,o){const{__scopeDialog:i,...u}=l,f=aa(yA,i),{setTitleCount:h}=f;return Tt(()=>(h(m=>m+1),()=>h(m=>m-1)),[h]),s.jsx(Le.h2,{id:f.titleId,...u,ref:o})},"DialogTitle")),xA="DialogDescription",Vh=p.forwardRef(En(function(l,o){const{__scopeDialog:i,...u}=l,f=aa(xA,i),{setDescriptionCount:h}=f;return Tt(()=>(h(m=>m+1),()=>h(m=>m-1)),[h]),s.jsx(Le.p,{id:f.descriptionId,...u,ref:o})},"DialogDescription")),bA="DialogClose",Ih=p.forwardRef(En(function(l,o){const{__scopeDialog:i,...u}=l,f=aa(bA,i);return s.jsx(Le.button,{type:"button",...u,ref:o,onClick:Se(l.onClick,()=>f.onOpenChange(!1))})},"DialogClose"));function qc(a){return a?"open":"closed"}En(qc,"getState");const Hn=N0,ks=A0,SA=O0,z0=p.forwardRef(({className:a,...l},o)=>s.jsx(Bh,{ref:o,className:Ce("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",a),...l}));z0.displayName=Bh.displayName;const xn=p.forwardRef(({className:a,children:l,...o},i)=>s.jsxs(SA,{children:[s.jsx(z0,{}),s.jsxs(Ph,{ref:i,className:Ce("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 sm:rounded-lg",a),...o,children:[l,s.jsxs(Ih,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",children:[s.jsx(Rc,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));xn.displayName=Ph.displayName;const bn=({className:a,...l})=>s.jsx("div",{className:Ce("flex flex-col space-y-1.5 text-center sm:text-left",a),...l});bn.displayName="DialogHeader";const Bn=({className:a,...l})=>s.jsx("div",{className:Ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...l});Bn.displayName="DialogFooter";const Sn=p.forwardRef(({className:a,...l},o)=>s.jsx(qh,{ref:o,className:Ce("text-lg font-semibold leading-none tracking-tight",a),...l}));Sn.displayName=qh.displayName;const eh=p.forwardRef(({className:a,...l},o)=>s.jsx(Vh,{ref:o,className:Ce("text-sm text-muted-foreground",a),...l}));eh.displayName=Vh.displayName;var wA=Object.defineProperty,el=(a,l)=>wA(a,"name",{value:l,configurable:!0}),jA="AlertDialog",[CA,K_]=un(jA,[T0]),tl=T0(),EA=el(a=>{const{__scopeAlertDialog:l,...o}=a,i=tl(l);return s.jsx(N0,{...i,...o,modal:!0})},"AlertDialog"),RA=p.forwardRef(el(function(l,o){const{__scopeAlertDialog:i,...u}=l,f=tl(i);return s.jsx(A0,{...f,...u,ref:o})},"AlertDialogTrigger")),TA=el(a=>{const{__scopeAlertDialog:l,...o}=a,i=tl(l);return s.jsx(O0,{...i,...o})},"AlertDialogPortal"),NA=p.forwardRef(el(function(l,o){const{__scopeAlertDialog:i,...u}=l,f=tl(i);return s.jsx(Bh,{...f,...u,ref:o})},"AlertDialogOverlay")),AA="AlertDialogContent",[MA,_A]=CA(AA),OA=p.forwardRef(el(function(l,o){const{__scopeAlertDialog:i,children:u,...f}=l,h=tl(i),m=p.useRef(null),g=Pe(o,m),v=p.useRef(null);return s.jsx(MA,{scope:i,cancelRef:v,children:s.jsx(Ph,{role:"alertdialog",...h,...f,ref:g,onOpenAutoFocus:Se(f.onOpenAutoFocus,S=>{var b;S.preventDefault(),(b=v.current)==null||b.focus({preventScroll:!0})}),onPointerDownOutside:S=>S.preventDefault(),onInteractOutside:S=>S.preventDefault(),children:u})})},"AlertDialogContent")),DA=p.forwardRef(el(function(l,o){const{__scopeAlertDialog:i,...u}=l,f=tl(i);return s.jsx(qh,{...f,...u,ref:o})},"AlertDialogTitle")),zA=p.forwardRef(el(function(l,o){const{__scopeAlertDialog:i,...u}=l,f=tl(i);return s.jsx(Vh,{...f,...u,ref:o})},"AlertDialogDescription")),kA=p.forwardRef(el(function(l,o){const{__scopeAlertDialog:i,...u}=l,f=tl(i);return s.jsx(Ih,{...f,...u,ref:o})},"AlertDialogAction")),LA="AlertDialogCancel",UA=p.forwardRef(el(function(l,o){const{__scopeAlertDialog:i,...u}=l,{cancelRef:f}=_A(LA,i),h=tl(i),m=Pe(o,f);return s.jsx(Ih,{...h,...u,ref:m})},"AlertDialogCancel")),HA=EA,BA=RA,PA=TA,k0=NA,L0=OA,U0=kA,H0=UA,B0=DA,P0=zA;const q0=HA,qA=BA,VA=PA,V0=p.forwardRef(({className:a,...l},o)=>s.jsx(k0,{ref:o,className:Ce("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",a),...l}));V0.displayName=k0.displayName;const Yh=p.forwardRef(({className:a,...l},o)=>s.jsxs(VA,{children:[s.jsx(V0,{}),s.jsx(L0,{ref:o,className:Ce("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg sm:max-w-[425px]",a),...l})]}));Yh.displayName=L0.displayName;const I0=({className:a,...l})=>s.jsx("div",{className:Ce("flex flex-col space-y-2 text-center sm:text-left",a),...l}),Y0=({className:a,...l})=>s.jsx("div",{className:Ce("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...l}),Gh=p.forwardRef(({className:a,...l},o)=>s.jsx(B0,{ref:o,className:Ce("text-lg font-semibold",a),...l}));Gh.displayName=B0.displayName;const $h=p.forwardRef(({className:a,...l},o)=>s.jsx(P0,{ref:o,className:Ce("text-sm text-muted-foreground",a),...l}));$h.displayName=P0.displayName;const Kh=p.forwardRef(({className:a,...l},o)=>s.jsx(U0,{ref:o,className:Ce("inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",a),...l}));Kh.displayName=U0.displayName;const Xh=p.forwardRef(({className:a,...l},o)=>s.jsx(H0,{ref:o,className:Ce("inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium hover:bg-accent",a),...l}));Xh.displayName=H0.displayName;var IA=Object.defineProperty,YA=(a,l)=>IA(a,"name",{value:l,configurable:!0});function th(a,[l,o]){return Math.min(o,Math.max(l,a))}YA(th,"clamp");var GA=Object.defineProperty,$A=(a,l)=>GA(a,"name",{value:l,configurable:!0});function G0(a){const l=p.useRef({value:a,previous:a});return p.useMemo(()=>(l.current.value!==a&&(l.current.previous=l.current.value,l.current.value=a),l.current.previous),[a])}$A(G0,"usePrevious");var KA=Object.defineProperty,XA=(a,l)=>KA(a,"name",{value:l,configurable:!0}),$0=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"}),QA=p.forwardRef(XA(function(l,o){return s.jsx(Le.span,{...l,ref:o,style:{...$0,...l.style}})},"VisuallyHidden")),FA=QA,ZA=Object.defineProperty,rt=(a,l)=>ZA(a,"name",{value:l,configurable:!0}),JA=[" ","Enter","ArrowUp","ArrowDown"],WA=[" ","Enter"],fo="Select",[Vc,Qh,eM]=Tc(fo),[gr,X_]=un(fo,[eM,jo]),Fh=jo(),[tM,Bl]=gr(fo),[nM,aM]=gr(fo);function K0(a){const{__scopeSelect:l,children:o,open:i,defaultOpen:u,onOpenChange:f,value:h,defaultValue:m,onValueChange:g,dir:v,name:S,autoComplete:b,disabled:x,required:w,form:R,internal_do_not_use_render:j}=a,C=Fh(l),[N,T]=p.useState(null),[A,_]=p.useState(null),[H,P]=p.useState(!1),I=Os(v),[k,ne]=Xa({prop:i,defaultProp:u??!1,onChange:f,caller:fo}),[se,Q]=Xa({prop:h,defaultProp:m,onChange:g,caller:fo}),G=p.useRef(null),re=p.useRef(se);p.useEffect(()=>{const B=R?N==null?void 0:N.ownerDocument.getElementById(R):N==null?void 0:N.form;if(B instanceof HTMLFormElement){const F=rt(()=>Q(re.current),"reset");return B.addEventListener("reset",F),()=>B.removeEventListener("reset",F)}},[R,N,Q]);const le=N?!!R||!!N.closest("form"):!0,[fe,z]=p.useState(new Set),$=ma(),te=Array.from(fe).map(B=>B.props.value).join(";"),L=p.useCallback(B=>{z(F=>new Set(F).add(B))},[]),X=p.useCallback(B=>{z(F=>{const ae=new Set(F);return ae.delete(B),ae})},[]),M={required:w,trigger:N,onTriggerChange:T,valueNode:A,onValueNodeChange:_,valueNodeHasChildren:H,onValueNodeHasChildrenChange:P,contentId:$,value:se,onValueChange:Q,open:k,onOpenChange:ne,dir:I,triggerPointerDownPosRef:G,disabled:x,name:S,autoComplete:b,form:R,nativeOptions:fe,nativeSelectKey:te,isFormControl:le};return s.jsx(zb,{...C,children:s.jsx(tM,{scope:l,...M,children:s.jsx(Vc.Provider,{scope:l,children:s.jsx(nM,{scope:l,onNativeOptionAdd:L,onNativeOptionRemove:X,children:W0(j)?j(M):o})})})})}rt(K0,"SelectProvider");var lM=rt(a=>{const{__scopeSelect:l,children:o,...i}=a;return s.jsx(K0,{__scopeSelect:l,...i,internal_do_not_use_render:({isFormControl:u})=>s.jsxs(s.Fragment,{children:[o,u?s.jsx(RM,{__scopeSelect:l}):null]})})},"Select"),rM="SelectTrigger",X0=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,disabled:u=!1,...f}=l,h=Fh(i),m=Bl(rM,i),g=m.disabled||u,v=Pe(o,m.onTriggerChange),S=Qh(i),b=p.useRef("touch"),[x,w,R]=Zh(C=>{const N=S().filter(_=>!_.disabled),T=N.find(_=>_.value===m.value),A=Jh(N,C,T);A!==void 0&&m.onValueChange(A.value)}),j=rt(C=>{g||(m.onOpenChange(!0),R()),C&&(m.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})},"handleOpen");return s.jsx(kb,{asChild:!0,...h,children:s.jsx(Le.button,{type:"button",role:"combobox","aria-controls":m.open?m.contentId:void 0,"aria-expanded":m.open,"aria-required":m.required,"aria-autocomplete":"none",dir:m.dir,"data-state":m.open?"open":"closed",disabled:g,"data-disabled":g?"":void 0,"data-placeholder":Ls(m.value)?"":void 0,...f,ref:v,onClick:Se(f.onClick,C=>{C.currentTarget.focus(),b.current!=="mouse"&&j(C)}),onPointerDown:Se(f.onPointerDown,C=>{b.current=C.pointerType;const N=C.target;N.hasPointerCapture(C.pointerId)&&N.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(j(C),C.preventDefault())}),onKeyDown:Se(f.onKeyDown,C=>{const N=x.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&w(C.key),!(N&&C.key===" ")&&JA.includes(C.key)&&(j(),C.preventDefault())})})})},"SelectTrigger")),oM="SelectValue",sM=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,className:u,style:f,children:h,placeholder:m="",...g}=l,v=Bl(oM,i),{onValueNodeHasChildrenChange:S}=v,b=h!==void 0,x=Pe(o,v.onValueNodeChange);Tt(()=>{S(b)},[S,b]);const w=Ls(v.value);return s.jsx(Le.span,{...g,asChild:w?!1:g.asChild,ref:x,style:{pointerEvents:"none"},children:s.jsx(p.Fragment,{children:w?m:h},w?"placeholder":"value")})},"SelectValue")),iM=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,children:u,...f}=l;return s.jsx(Le.span,{"aria-hidden":!0,...f,ref:o,children:u||"▼"})},"SelectIcon")),cM="SelectPortal",[uM,dM]=gr(cM,{forceMount:void 0}),fM=rt(a=>{const{__scopeSelect:l,forceMount:o,...i}=a;return s.jsx(uM,{scope:a.__scopeSelect,forceMount:o,children:s.jsx(_h,{asChild:!0,...i})})},"SelectPortal"),dr="SelectContent",Q0=p.forwardRef(rt(function(l,o){const i=dM(dr,l.__scopeSelect),{forceMount:u=i.forceMount,...f}=l,h=Bl(dr,l.__scopeSelect),[m,g]=p.useState();return Tt(()=>{g(new DocumentFragment)},[]),s.jsx(Wa,{present:u||h.open,children:({present:v})=>v?s.jsx(pM,{...f,ref:o}):s.jsx(hM,{...f,fragment:m})})},"SelectContent")),hM=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,children:u,fragment:f}=l;return f?yo.createPortal(s.jsx(F0,{scope:i,children:s.jsx(Vc.Slot,{scope:i,children:s.jsx("div",{ref:o,children:u})})}),f):null},"SelectContentFragment")),Zn=10,[F0,Ic]=gr(dr),mM=pa("SelectContent.RemoveScroll"),pM=p.forwardRef(rt(function(l,o){const{__scopeSelect:i}=l,{position:u="item-aligned",onCloseAutoFocus:f,onEscapeKeyDown:h,onPointerDownOutside:m,side:g,sideOffset:v,align:S,alignOffset:b,arrowPadding:x,collisionBoundary:w,collisionPadding:R,sticky:j,hideWhenDetached:C,avoidCollisions:N,...T}=l,A=Bl(dr,i),[_,H]=p.useState(null),[P,I]=p.useState(null),k=Pe(o,H),[ne,se]=p.useState(null),[Q,G]=p.useState(null),re=Qh(i),[le,fe]=p.useState(!1),z=p.useRef(!1);p.useEffect(()=>{if(_)return zh(_)},[_]),Ds();const $=p.useCallback(ie=>{const[me,...De]=re().map(qe=>qe.ref.current),[_e]=De.slice(-1),Oe=document.activeElement;for(const qe of ie)if(qe===Oe||(qe==null||qe.scrollIntoView({block:"nearest"}),qe===me&&P&&(P.scrollTop=0),qe===_e&&P&&(P.scrollTop=P.scrollHeight),qe==null||qe.focus(),document.activeElement!==Oe))return},[re,P]),te=p.useCallback(()=>$([ne,_]),[$,ne,_]);p.useEffect(()=>{le&&te()},[le,te]);const{onOpenChange:L,triggerPointerDownPosRef:X}=A;p.useEffect(()=>{if(_){let ie={x:0,y:0};const me=rt(_e=>{var Oe,qe;ie={x:Math.abs(Math.round(_e.pageX)-(((Oe=X.current)==null?void 0:Oe.x)??0)),y:Math.abs(Math.round(_e.pageY)-(((qe=X.current)==null?void 0:qe.y)??0))}},"handlePointerMove"),De=rt(_e=>{ie.x<=10&&ie.y<=10?_e.preventDefault():_e.composedPath().includes(_)||L(!1),document.removeEventListener("pointermove",me),X.current=null},"handlePointerUp");return X.current!==null&&(document.addEventListener("pointermove",me),document.addEventListener("pointerup",De,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",me),document.removeEventListener("pointerup",De,{capture:!0})}}},[_,L,X]),p.useEffect(()=>{const ie=rt(()=>L(!1),"close");return window.addEventListener("blur",ie),window.addEventListener("resize",ie),()=>{window.removeEventListener("blur",ie),window.removeEventListener("resize",ie)}},[L]);const[M,B]=Zh(ie=>{const me=re().filter(Oe=>!Oe.disabled),De=me.find(Oe=>Oe.ref.current===document.activeElement),_e=Jh(me,ie,De);_e&&setTimeout(()=>{var Oe;return(Oe=_e.ref.current)==null?void 0:Oe.focus()})}),F=p.useCallback((ie,me,De)=>{const _e=!z.current&&!De;(A.value!==void 0&&A.value===me||_e)&&(se(ie),_e&&(z.current=!0))},[A.value]),ae=p.useCallback(()=>_==null?void 0:_.focus(),[_]),ue=p.useCallback((ie,me,De)=>{const _e=!z.current&&!De;(A.value!==void 0&&A.value===me||_e)&&G(ie)},[A.value]),J=u==="popper"?ex:gM,oe=J===ex?{side:g,sideOffset:v,align:S,alignOffset:b,arrowPadding:x,collisionBoundary:w,collisionPadding:R,sticky:j,hideWhenDetached:C,avoidCollisions:N}:{};return s.jsx(F0,{scope:i,content:_,viewport:P,onViewportChange:I,itemRefCallback:F,selectedItem:ne,onItemLeave:ae,itemTextRefCallback:ue,focusSelectedItem:te,selectedItemText:Q,position:u,isPositioned:le,searchRef:M,children:s.jsx(Bc,{as:mM,allowPinchZoom:!0,children:s.jsx(wh,{asChild:!0,trapped:A.open,onMountAutoFocus:ie=>{ie.preventDefault()},onUnmountAutoFocus:Se(f,ie=>{var me;(me=A.trigger)==null||me.focus({preventScroll:!0}),ie.preventDefault()}),children:s.jsx(Nc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:h,onPointerDownOutside:m,onFocusOutside:ie=>ie.preventDefault(),onDismiss:()=>A.onOpenChange(!1),children:s.jsx(J,{role:"listbox",id:A.contentId,"data-state":A.open?"open":"closed",dir:A.dir,onContextMenu:ie=>ie.preventDefault(),...T,...oe,onPlaced:()=>fe(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...T.style},onKeyDown:Se(T.onKeyDown,ie=>{const me=ie.ctrlKey||ie.altKey||ie.metaKey;if(ie.key==="Tab"&&ie.preventDefault(),!me&&ie.key.length===1&&B(ie.key),["ArrowUp","ArrowDown","Home","End"].includes(ie.key)){let _e=re().filter(Oe=>!Oe.disabled).map(Oe=>Oe.ref.current);if(["ArrowUp","End"].includes(ie.key)&&(_e=_e.slice().reverse()),["ArrowUp","ArrowDown"].includes(ie.key)){const Oe=ie.target,qe=_e.indexOf(Oe);_e=_e.slice(qe+1)}setTimeout(()=>$(_e)),ie.preventDefault()}})})})})})})},"SelectContentImpl")),gM=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,onPlaced:u,...f}=l,h=Bl(dr,i),m=Ic(dr,i),[g,v]=p.useState(null),[S,b]=p.useState(null),x=Pe(o,b),w=Qh(i),R=p.useRef(!1),j=p.useRef(!0),{viewport:C,selectedItem:N,selectedItemText:T,focusSelectedItem:A}=m,_=p.useCallback(()=>{if(h.trigger&&h.valueNode&&g&&S&&C&&N&&T){const k=h.trigger.getBoundingClientRect(),ne=S.getBoundingClientRect(),se=h.valueNode.getBoundingClientRect(),Q=T.getBoundingClientRect();if(h.dir!=="rtl"){const Oe=Q.left-ne.left,qe=se.left-Oe,yt=k.left-qe,Bt=k.width+yt,Xt=Math.max(Bt,ne.width),la=window.innerWidth-Zn,Rn=th(qe,[Zn,Math.max(Zn,la-Xt)]);g.style.minWidth=Bt+"px",g.style.left=Rn+"px"}else{const Oe=ne.right-Q.right,qe=window.innerWidth-se.right-Oe,yt=window.innerWidth-k.right-qe,Bt=k.width+yt,Xt=Math.max(Bt,ne.width),la=window.innerWidth-Zn,Rn=th(qe,[Zn,Math.max(Zn,la-Xt)]);g.style.minWidth=Bt+"px",g.style.right=Rn+"px"}const G=w(),re=window.innerHeight-Zn*2,le=C.scrollHeight,fe=window.getComputedStyle(S),z=parseInt(fe.borderTopWidth,10),$=parseInt(fe.paddingTop,10),te=parseInt(fe.borderBottomWidth,10),L=parseInt(fe.paddingBottom,10),X=z+$+le+L+te,M=Math.min(N.offsetHeight*5,X),B=window.getComputedStyle(C),F=parseInt(B.paddingTop,10),ae=parseInt(B.paddingBottom,10),ue=k.top+k.height/2-Zn,J=re-ue,oe=N.offsetHeight/2,ie=N.offsetTop+oe,me=z+$+ie,De=X-me;if(me<=ue){const Oe=G.length>0&&N===G[G.length-1].ref.current;g.style.bottom="0px";const qe=S.clientHeight-C.offsetTop-C.offsetHeight,yt=Math.max(J,oe+(Oe?ae:0)+qe+te),Bt=me+yt;g.style.height=Bt+"px"}else{const Oe=G.length>0&&N===G[0].ref.current;g.style.top="0px";const yt=Math.max(ue,z+C.offsetTop+(Oe?F:0)+oe)+De;g.style.height=yt+"px",C.scrollTop=me-ue+C.offsetTop}g.style.margin=`${Zn}px 0`,g.style.minHeight=M+"px",g.style.maxHeight=re+"px",u==null||u(),requestAnimationFrame(()=>R.current=!0)}},[w,h.trigger,h.valueNode,g,S,C,N,T,h.dir,u]);Tt(()=>_(),[_]);const[H,P]=p.useState();Tt(()=>{S&&P(window.getComputedStyle(S).zIndex)},[S]);const I=p.useCallback(k=>{k&&j.current===!0&&(_(),A==null||A(),j.current=!1)},[_,A]);return s.jsx(vM,{scope:i,contentWrapper:g,shouldExpandOnScrollRef:R,onScrollButtonChange:I,children:s.jsx("div",{ref:v,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:H},children:s.jsx(Le.div,{...f,ref:x,style:{boxSizing:"border-box",maxHeight:"100%",...f.style}})})})},"SelectItemAlignedPosition")),ex=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,align:u="start",collisionPadding:f=Zn,...h}=l,m=Fh(i);return s.jsx(Mh,{...m,...h,ref:o,align:u,collisionPadding:f,style:{boxSizing:"border-box",...h.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)"}})},"SelectPopperPosition")),[vM,yM]=gr(dr,{}),tx="SelectViewport",xM=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,nonce:u,...f}=l,h=Ic(tx,i),m=yM(tx,i),g=Pe(o,h.onViewportChange),v=p.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:u}),s.jsx(Vc.Slot,{scope:i,children:s.jsx(Le.div,{"data-radix-select-viewport":"",role:"presentation",...f,ref:g,style:{position:"relative",flex:1,overflow:"hidden auto",...f.style},onScroll:Se(f.onScroll,S=>{const b=S.currentTarget,{contentWrapper:x,shouldExpandOnScrollRef:w}=m;if(w!=null&&w.current&&x){const R=Math.abs(v.current-b.scrollTop);if(R>0){const j=window.innerHeight-Zn*2,C=parseFloat(x.style.minHeight),N=parseFloat(x.style.height),T=Math.max(C,N);if(T<j){const A=T+R,_=Math.min(j,A),H=A-_;x.style.height=_+"px",x.style.bottom==="0px"&&(b.scrollTop=H>0?H:0,x.style.justifyContent="flex-end")}}}v.current=b.scrollTop})})})]})},"SelectViewport")),bM="SelectGroup",[Q_,F_]=gr(bM),nh="SelectItem",[SM,Z0]=gr(nh),J0=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,value:u,disabled:f=!1,textValue:h,...m}=l,g=Bl(nh,i),v=Ic(nh,i),S=g.value===u,[b,x]=p.useState(h??""),[w,R]=p.useState(!1),j=In(_=>{var H;return(H=v.itemRefCallback)==null?void 0:H.call(v,_,u,f)}),C=Pe(o,j),N=ma(),T=p.useRef("touch"),A=rt(()=>{f||(g.onValueChange(u),g.onOpenChange(!1))},"handleSelect");return s.jsx(SM,{scope:i,value:u,disabled:f,textId:N,isSelected:S,onItemTextChange:p.useCallback(_=>{x(H=>H||((_==null?void 0:_.textContent)??"").trim())},[]),children:s.jsx(Vc.ItemSlot,{scope:i,value:u,disabled:f,textValue:b,children:s.jsx(Le.div,{role:"option","aria-labelledby":N,"data-highlighted":w?"":void 0,"aria-selected":S&&w,"data-state":S?"checked":"unchecked","aria-disabled":f||void 0,"data-disabled":f?"":void 0,tabIndex:f?void 0:-1,...m,ref:C,onFocus:Se(m.onFocus,()=>R(!0)),onBlur:Se(m.onBlur,()=>R(!1)),onClick:Se(m.onClick,()=>{T.current!=="mouse"&&A()}),onPointerUp:Se(m.onPointerUp,()=>{T.current==="mouse"&&A()}),onPointerDown:Se(m.onPointerDown,_=>{T.current=_.pointerType}),onPointerMove:Se(m.onPointerMove,_=>{var H;T.current=_.pointerType,f?(H=v.onItemLeave)==null||H.call(v):T.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(m.onPointerLeave,_=>{var H;_.currentTarget===document.activeElement&&((H=v.onItemLeave)==null||H.call(v))}),onKeyDown:Se(m.onKeyDown,_=>{var P;f||_.target!==_.currentTarget||((P=v.searchRef)==null?void 0:P.current)!==""&&_.key===" "||(WA.includes(_.key)&&A(),_.key===" "&&_.preventDefault())})})})})},"SelectItem")),oc="SelectItemText",wM=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,className:u,style:f,...h}=l,m=Bl(oc,i),g=Ic(oc,i),v=Z0(oc,i),S=aM(oc,i),[b,x]=p.useState(null),w=In(A=>{var _;return(_=g.itemTextRefCallback)==null?void 0:_.call(g,A,v.value,v.disabled)}),R=Pe(o,x,v.onItemTextChange,w),j=b==null?void 0:b.textContent,C=p.useMemo(()=>s.jsx("option",{value:v.value,disabled:v.disabled,children:j},v.value),[v.disabled,v.value,j]),{onNativeOptionAdd:N,onNativeOptionRemove:T}=S;return Tt(()=>(N(C),()=>T(C)),[N,T,C]),s.jsxs(s.Fragment,{children:[s.jsx(Le.span,{id:v.textId,...h,ref:R}),v.isSelected&&m.valueNode&&!m.valueNodeHasChildren&&!Ls(m.value)?yo.createPortal(h.children,m.valueNode):null]})},"SelectItemText")),jM="SelectItemIndicator",CM=p.forwardRef(rt(function(l,o){const{__scopeSelect:i,...u}=l;return Z0(jM,i).isSelected?s.jsx(Le.span,{"aria-hidden":!0,...u,ref:o}):null},"SelectItemIndicator")),EM="SelectBubbleInput",RM=p.forwardRef(rt(function({__scopeSelect:l,...o},i){const u=Bl(EM,l),{value:f,onValueChange:h,required:m,disabled:g,name:v,autoComplete:S,form:b}=u,{nativeOptions:x,nativeSelectKey:w}=u,R=p.useRef(null),j=Pe(i,R),C=f??"",N=G0(C),T=Array.from(x).some(A=>(A.props.value??"")==="");return p.useEffect(()=>{const A=R.current;if(!A)return;const _=window.HTMLSelectElement.prototype,P=Object.getOwnPropertyDescriptor(_,"value").set;if(N!==C&&P){const I=new Event("change",{bubbles:!0});P.call(A,C),A.dispatchEvent(I)}},[N,C]),s.jsxs(Le.select,{"aria-hidden":!0,required:m,tabIndex:-1,name:v,autoComplete:S,disabled:g,form:b,onChange:A=>h(A.target.value),...o,style:{...$0,...o.style},ref:j,defaultValue:C,children:[Ls(f)&&!T?s.jsx("option",{value:""}):null,Array.from(x)]},w)},"SelectBubbleInput"));function W0(a){return typeof a=="function"}rt(W0,"isFunction");function Ls(a){return a===""||a===void 0}rt(Ls,"shouldShowPlaceholder");function Zh(a){const l=In(a),o=p.useRef(""),i=p.useRef(0),u=p.useCallback(h=>{const m=o.current+h;l(m),rt((function g(v){o.current=v,window.clearTimeout(i.current),v!==""&&(i.current=window.setTimeout(()=>g(""),1e3))}),"updateSearch")(m)},[l]),f=p.useCallback(()=>{o.current="",window.clearTimeout(i.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(i.current),[]),[o,u,f]}rt(Zh,"useTypeaheadSearch");function Jh(a,l,o){const u=l.length>1&&Array.from(l).every(v=>v===l[0])?l[0]:l,f=o?a.indexOf(o):-1;let h=e1(a,Math.max(f,0));u.length===1&&(h=h.filter(v=>v!==o));const g=h.find(v=>v.textValue.toLowerCase().startsWith(u.toLowerCase()));return g!==o?g:void 0}rt(Jh,"findNextItem");function e1(a,l){return a.map((o,i)=>a[(l+i)%a.length])}rt(e1,"wrapArray");const Pn=lM,qn=sM,wn=p.forwardRef(({className:a,children:l,...o},i)=>s.jsxs(X0,{ref:i,className:Ce("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",a),...o,children:[l,s.jsx(iM,{asChild:!0,children:s.jsx(MC,{className:"h-4 w-4 opacity-50"})})]}));wn.displayName=X0.displayName;const jn=p.forwardRef(({className:a,children:l,position:o="popper",...i},u)=>s.jsx(fM,{children:s.jsx(Q0,{ref:u,className:Ce("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",a),position:o,...i,children:s.jsx(xM,{className:Ce("p-1",o==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:l})})}));jn.displayName=Q0.displayName;const lt=p.forwardRef(({className:a,children:l,...o},i)=>s.jsxs(J0,{ref:i,className:Ce("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",a),...o,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(CM,{children:s.jsx(Ax,{className:"h-4 w-4"})})}),s.jsx(wM,{children:l})]}));lt.displayName=J0.displayName;var TM=Object.defineProperty,Ll=(a,l)=>TM(a,"name",{value:l,configurable:!0}),Wh="Switch",[NM,Z_]=un(Wh),[AM,em]=NM(Wh);function t1(a){const{__scopeSwitch:l,checked:o,children:i,defaultChecked:u,disabled:f,form:h,name:m,onCheckedChange:g,required:v,value:S="on",internal_do_not_use_render:b}=a,[x,w]=Xa({prop:o,defaultProp:u??!1,onChange:g,caller:Wh}),[R,j]=p.useState(null),[C,N]=p.useState(null),T=p.useRef(!1),[A,_]=p.useReducer(I=>I+1,0),H=R?!!h||!!R.closest("form"):!0,P={checked:x,setChecked:w,disabled:f,control:R,setControl:j,name:m,form:h,value:S,hasConsumerStoppedPropagationRef:T,userInteractionCount:A,onUserInteraction:_,required:v,defaultChecked:u,isFormControl:H,bubbleInput:C,setBubbleInput:N};return s.jsx(AM,{scope:l,...P,children:a1(b)?b(P):i})}Ll(t1,"SwitchProvider");var MM="SwitchTrigger",_M=p.forwardRef(Ll(function({__scopeSwitch:l,onClick:o,...i},u){const{control:f,form:h,value:m,disabled:g,checked:v,required:S,setControl:b,setChecked:x,hasConsumerStoppedPropagationRef:w,onUserInteraction:R,isFormControl:j,bubbleInput:C}=em(MM,l),N=Pe(u,b),T=p.useRef(v);return p.useEffect(()=>{const A=h?f==null?void 0:f.ownerDocument.getElementById(h):f==null?void 0:f.form;if(A instanceof HTMLFormElement){const _=Ll(()=>x(T.current),"reset");return A.addEventListener("reset",_),()=>A.removeEventListener("reset",_)}},[f,h,x]),s.jsx(Le.button,{type:"button",role:"switch","aria-checked":v,"aria-required":S,"data-state":tm(v),"data-disabled":g?"":void 0,disabled:g,value:m,...i,ref:N,onClick:Se(o,A=>{R(),x(_=>!_),C&&j&&(w.current=A.isPropagationStopped(),w.current||A.stopPropagation())})})},"SwitchTrigger")),n1=p.forwardRef(Ll(function(l,o){const{__scopeSwitch:i,name:u,checked:f,defaultChecked:h,required:m,disabled:g,value:v,onCheckedChange:S,form:b,...x}=l;return s.jsx(t1,{__scopeSwitch:i,checked:f,defaultChecked:h,disabled:g,required:m,onCheckedChange:S,name:u,form:b,value:v,internal_do_not_use_render:({isFormControl:w})=>s.jsxs(s.Fragment,{children:[s.jsx(_M,{...x,ref:o,__scopeSwitch:i}),w&&s.jsx(kM,{__scopeSwitch:i})]})})},"Switch")),OM="SwitchThumb",DM=p.forwardRef(Ll(function(l,o){const{__scopeSwitch:i,...u}=l,f=em(OM,i);return s.jsx(Le.span,{"data-state":tm(f.checked),"data-disabled":f.disabled?"":void 0,...u,ref:o})},"SwitchThumb")),zM="SwitchBubbleInput",kM=p.forwardRef(Ll(function({__scopeSwitch:l,onClick:o,...i},u){const{control:f,hasConsumerStoppedPropagationRef:h,userInteractionCount:m,checked:g,defaultChecked:v,required:S,disabled:b,name:x,value:w,form:R,bubbleInput:j,setBubbleInput:C}=em(zM,l),N=Pe(u,C),T=zc(f),A=p.useRef(!1),_=p.useRef(g),H=p.useRef(m);p.useEffect(()=>{const I=j;if(!I)return;const k=window.HTMLInputElement.prototype,se=Object.getOwnPropertyDescriptor(k,"checked").set,Q=m!==H.current;H.current=m;const G=_.current!==g;_.current=g;const re=!(Q&&h.current);if(G&&se){A.current=!Q;const le=new Event("click",{bubbles:re});se.call(I,g),I.dispatchEvent(le),A.current=!1}},[j,g,h,m]);const P=p.useRef(g);return s.jsx(Le.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??P.current,required:S,disabled:b,name:x,value:w,form:R,...i,tabIndex:-1,ref:N,onClick:Se(o,I=>{A.current&&I.stopPropagation()}),style:{...i.style,...T,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function a1(a){return typeof a=="function"}Ll(a1,"isFunction");function tm(a){return a?"checked":"unchecked"}Ll(tm,"getState");const Ul=p.forwardRef(({className:a,...l},o)=>s.jsx(n1,{className:Ce("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm 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",a),...l,ref:o,children:s.jsx(DM,{className:Ce("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));Ul.displayName=n1.displayName;const sr={name:"",slug:"",type:"openai",baseUrl:"https://api.openai.com",apiKey:"",customHeaders:"",enabled:!0};function LM(){const[a,l]=p.useState([]),[o,i]=p.useState(!1),[u,f]=p.useState(sr),[h,m]=p.useState(!1),[g,v]=p.useState(null),[S,b]=p.useState(null),[x,w]=p.useState(sr),[R,j]=p.useState(null),[C,N]=p.useState(!1),T=()=>we.get("/api/admin/providers").then(k=>l(k.providers));p.useEffect(()=>{T()},[]);const A=async()=>{m(!0);try{let k;if(u.customHeaders.trim())try{k=JSON.parse(u.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await we.post("/api/admin/providers",{name:u.name,slug:u.slug||void 0,type:u.type,baseUrl:u.baseUrl,apiKey:u.apiKey,customHeaders:k,enabled:u.enabled}),ye.success("Provider created"),i(!1),f(sr),T()}catch(k){ye.error(k.message)}finally{m(!1)}},_=async k=>{v(k);try{const ne=await we.post(`/api/admin/providers/${k}/test`);ye.success(ne.ok?`Connection OK: ${ne.detail}`:`Failed: ${ne.detail}`),T()}catch(ne){ye.error(ne.message)}finally{v(null)}},H=k=>{b(k.id),w({...sr,name:k.name,slug:k.slug||"",type:k.type,baseUrl:k.baseUrl,apiKey:"",customHeaders:"",enabled:k.enabled})},P=async()=>{if(S){m(!0);try{let k;if(x.customHeaders.trim())try{k=JSON.parse(x.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await we.patch("/api/admin/providers",{id:S,name:x.name,slug:x.slug||void 0,type:x.type,baseUrl:x.baseUrl,apiKey:x.apiKey||void 0,customHeaders:k,enabled:x.enabled}),ye.success("Provider updated"),b(null),w(sr),T()}catch(k){ye.error(k.message)}finally{m(!1)}}},I=async k=>{N(!0);try{await we.del(`/api/admin/providers/${k}`),ye.success("Provider removed"),T()}catch(ne){ye.error(ne.message)}finally{N(!1),j(null)}};return s.jsxs("div",{children:[s.jsx(xa,{title:"Providers",description:"Upstream LLM providers and their credentials",actions:s.jsxs(Hn,{open:o,onOpenChange:i,children:[s.jsx(ks,{asChild:!0,children:s.jsxs(he,{children:[s.jsx(Ms,{className:"mr-1 h-4 w-4"})," Add provider"]})}),s.jsxs(xn,{children:[s.jsx(bn,{children:s.jsx(Sn,{children:"New provider"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Name"}),s.jsx(Re,{value:u.name,onChange:k=>f({...u,name:k.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Slug (optional)"}),s.jsx(Re,{value:u.slug,onChange:k=>f({...u,slug:k.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Type"}),s.jsxs(Pn,{value:u.type,onValueChange:k=>f({...u,type:k}),children:[s.jsx(wn,{children:s.jsx(qn,{})}),s.jsxs(jn,{children:[s.jsx(lt,{value:"openai",children:"OpenAI-compatible"}),s.jsx(lt,{value:"anthropic",children:"Anthropic-compatible"})]})]})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Base URL"}),s.jsx(Re,{value:u.baseUrl,onChange:k=>f({...u,baseUrl:k.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"API key"}),s.jsx(Re,{type:"password",value:u.apiKey,onChange:k=>f({...u,apiKey:k.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Custom headers (JSON)"}),s.jsx(Re,{value:u.customHeaders,onChange:k=>f({...u,customHeaders:k.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ul,{checked:u.enabled,onCheckedChange:k=>f({...u,enabled:k})}),s.jsx(xe,{children:"Enabled"})]})]}),s.jsxs(Bn,{children:[s.jsx(he,{variant:"outline",onClick:()=>i(!1),children:"Cancel"}),s.jsx(he,{disabled:h||!u.name||!u.apiKey,onClick:A,children:"Create"})]})]})]})}),s.jsxs(Ge,{children:[s.jsxs($e,{children:[s.jsx(Ke,{className:"text-base",children:"All providers"}),s.jsxs(sn,{children:[a.length," total"]})]}),s.jsx(Xe,{children:s.jsxs(Wn,{children:[s.jsx(ea,{children:s.jsxs(Ze,{children:[s.jsx(ve,{children:"Name"}),s.jsx(ve,{children:"Type"}),s.jsx(ve,{children:"Base URL"}),s.jsx(ve,{children:"Models"}),s.jsx(ve,{children:"Health"}),s.jsx(ve,{children:"Enabled"}),s.jsx(ve,{className:"text-right",children:"Actions"})]})}),s.jsxs(ta,{children:[a.length===0&&s.jsx(Ze,{children:s.jsx(de,{colSpan:7,className:"text-center text-muted-foreground",children:"No providers yet."})}),a.map(k=>s.jsxs(Ze,{children:[s.jsxs(de,{className:"font-medium",children:[k.name," ",s.jsx("span",{className:"text-xs text-muted-foreground",children:k.slug})]}),s.jsx(de,{children:s.jsx(et,{variant:"outline",children:k.type})}),s.jsx(de,{className:"text-xs text-muted-foreground",children:k.baseUrl}),s.jsx(de,{children:k.modelCount}),s.jsx(de,{children:s.jsx(et,{variant:k.health==="healthy"?"success":k.health==="down"?"destructive":"secondary",children:k.health})}),s.jsx(de,{children:k.enabled?"Yes":"No"}),s.jsx(de,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[s.jsx(he,{size:"sm",variant:"outline",disabled:g===k.id,onClick:()=>_(k.id),children:s.jsx(VC,{className:"h-3 w-3"})}),s.jsx(he,{size:"sm",variant:"outline",onClick:()=>H(k),children:"✎"}),s.jsx(he,{size:"sm",variant:"outline",onClick:()=>j(k.id),children:s.jsx(Ec,{className:"h-3 w-3"})})]})})]},k.id))]})]})})]}),s.jsx(Hn,{open:!!S,onOpenChange:k=>{k||(b(null),w(sr))},children:s.jsxs(xn,{children:[s.jsx(bn,{children:s.jsx(Sn,{children:"Edit provider"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Name"}),s.jsx(Re,{value:x.name,onChange:k=>w({...x,name:k.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Slug (optional)"}),s.jsx(Re,{value:x.slug,onChange:k=>w({...x,slug:k.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Type"}),s.jsxs(Pn,{value:x.type,onValueChange:k=>w({...x,type:k}),children:[s.jsx(wn,{children:s.jsx(qn,{})}),s.jsxs(jn,{children:[s.jsx(lt,{value:"openai",children:"OpenAI-compatible"}),s.jsx(lt,{value:"anthropic",children:"Anthropic-compatible"})]})]})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Base URL"}),s.jsx(Re,{value:x.baseUrl,onChange:k=>w({...x,baseUrl:k.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"API key (leave empty to keep current)"}),s.jsx(Re,{type:"password",value:x.apiKey,onChange:k=>w({...x,apiKey:k.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Custom headers (JSON)"}),s.jsx(Re,{value:x.customHeaders,onChange:k=>w({...x,customHeaders:k.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ul,{checked:x.enabled,onCheckedChange:k=>w({...x,enabled:k})}),s.jsx(xe,{children:"Enabled"})]})]}),s.jsxs(Bn,{children:[s.jsx(he,{variant:"outline",onClick:()=>{b(null),w(sr)},children:"Cancel"}),s.jsx(he,{disabled:h||!x.name,onClick:P,children:"Save changes"})]})]})}),s.jsx(q0,{open:!!R,onOpenChange:k=>{k||j(null)},children:s.jsxs(Yh,{children:[s.jsxs(I0,{children:[s.jsx(Gh,{children:"Delete provider?"}),s.jsx($h,{children:"This will soft-disable the provider if models depend on it."})]}),s.jsxs(Y0,{children:[s.jsx(Xh,{children:"Cancel"}),s.jsx(Kh,{disabled:C,onClick:k=>{R&&(k.preventDefault(),I(R))},children:C?"Deleting…":"Delete"})]})]})})]})}var UM=Object.defineProperty,Za=(a,l)=>UM(a,"name",{value:l,configurable:!0}),nm="Checkbox",[HM,J_]=un(nm),[BM,am]=HM(nm);function l1(a){const{__scopeCheckbox:l,checked:o,children:i,defaultChecked:u,disabled:f,form:h,name:m,onCheckedChange:g,required:v,value:S="on",internal_do_not_use_render:b}=a,[x,w]=Xa({prop:o,defaultProp:u??!1,onChange:g,caller:nm}),[R,j]=p.useState(null),[C,N]=p.useState(null),T=p.useRef(!1),[A,_]=p.useReducer(I=>I+1,0),H=R?!!h||!!R.closest("form"):!0,P={checked:x,disabled:f,setChecked:w,control:R,setControl:j,name:m,form:h,value:S,hasConsumerStoppedPropagationRef:T,userInteractionCount:A,onUserInteraction:_,required:v,defaultChecked:$a(u)?!1:u,isFormControl:H,bubbleInput:C,setBubbleInput:N};return s.jsx(BM,{scope:l,...P,children:o1(b)?b(P):i})}Za(l1,"CheckboxProvider");var PM="CheckboxTrigger",qM=p.forwardRef(Za(function({__scopeCheckbox:l,onKeyDown:o,onClick:i,...u},f){const{control:h,value:m,disabled:g,checked:v,required:S,setControl:b,setChecked:x,hasConsumerStoppedPropagationRef:w,onUserInteraction:R,isFormControl:j,bubbleInput:C}=am(PM,l),N=Pe(f,b),T=p.useRef(v);return p.useEffect(()=>{const A=h==null?void 0:h.form;if(A){const _=Za(()=>x(T.current),"reset");return A.addEventListener("reset",_),()=>A.removeEventListener("reset",_)}},[h,x]),s.jsx(Le.button,{type:"button",role:"checkbox","aria-checked":$a(v)?"mixed":v,"aria-required":S,"data-state":lm(v),"data-disabled":g?"":void 0,disabled:g,value:m,...u,ref:N,onKeyDown:Se(o,A=>{A.key==="Enter"&&A.preventDefault()}),onClick:Se(i,A=>{R(),x(_=>$a(_)?!0:!_),C&&j&&(w.current=A.isPropagationStopped(),w.current||A.stopPropagation())})})},"CheckboxTrigger")),r1=p.forwardRef(Za(function(l,o){const{__scopeCheckbox:i,name:u,checked:f,defaultChecked:h,required:m,disabled:g,value:v,onCheckedChange:S,form:b,...x}=l;return s.jsx(l1,{__scopeCheckbox:i,checked:f,defaultChecked:h,disabled:g,required:m,onCheckedChange:S,name:u,form:b,value:v,internal_do_not_use_render:({isFormControl:w})=>s.jsxs(s.Fragment,{children:[s.jsx(qM,{...x,ref:o,__scopeCheckbox:i}),w&&s.jsx(GM,{__scopeCheckbox:i})]})})},"Checkbox")),VM="CheckboxIndicator",IM=p.forwardRef(Za(function(l,o){const{__scopeCheckbox:i,forceMount:u,...f}=l,h=am(VM,i);return s.jsx(Wa,{present:u||$a(h.checked)||h.checked===!0,children:s.jsx(Le.span,{"data-state":lm(h.checked),"data-disabled":h.disabled?"":void 0,...f,ref:o,style:{pointerEvents:"none",...l.style}})})},"CheckboxIndicator")),YM="CheckboxBubbleInput",GM=p.forwardRef(Za(function({__scopeCheckbox:l,onClick:o,...i},u){const{control:f,hasConsumerStoppedPropagationRef:h,userInteractionCount:m,checked:g,defaultChecked:v,required:S,disabled:b,name:x,value:w,form:R,bubbleInput:j,setBubbleInput:C}=am(YM,l),N=Pe(u,C),T=zc(f),A=p.useRef(!1),_=p.useRef(g),H=p.useRef(m);p.useEffect(()=>{const I=j;if(!I)return;const k=window.HTMLInputElement.prototype,se=Object.getOwnPropertyDescriptor(k,"checked").set,Q=m!==H.current;H.current=m;const G=_.current!==g;_.current=g;const re=!(Q&&h.current);if(G&&se){A.current=!Q;const le=new Event("click",{bubbles:re});I.indeterminate=$a(g),se.call(I,$a(g)?!1:g),I.dispatchEvent(le),A.current=!1}},[j,g,h,m]);const P=p.useRef($a(g)?!1:g);return s.jsx(Le.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??P.current,required:S,disabled:b,name:x,value:w,form:R,...i,tabIndex:-1,ref:N,onClick:Se(o,I=>{A.current&&I.stopPropagation()}),style:{...i.style,...T,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function o1(a){return typeof a=="function"}Za(o1,"isFunction");function $a(a){return a==="indeterminate"}Za($a,"isIndeterminate");function lm(a){return $a(a)?"indeterminate":a?"checked":"unchecked"}Za(lm,"getState");const rm=p.forwardRef(({className:a,...l},o)=>s.jsx(r1,{ref:o,className:Ce("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",a),...l,children:s.jsx(IM,{className:Ce("flex items-center justify-center text-current"),children:s.jsx(Ax,{className:"h-3.5 w-3.5"})})}));rm.displayName=r1.displayName;function $M(){const[a,l]=p.useState([]),[o,i]=p.useState([]),[u,f]=p.useState("all"),[h,m]=p.useState(!1),[g,v]=p.useState(""),[S,b]=p.useState([]),[x,w]=p.useState(new Set),[R,j]=p.useState(!1),[C,N]=p.useState(""),[T,A]=p.useState(""),[_,H]=p.useState(null),[P,I]=p.useState(!1),[k,ne]=p.useState(null),[se,Q]=p.useState(null),G=async()=>{const[L,X]=await Promise.all([we.get("/api/admin/models"),we.get("/api/admin/providers")]);l(L.models),i(X.providers)};p.useEffect(()=>{G()},[]);const re=a.filter(L=>!(u!=="all"&&L.providerId!==u||C&&!L.publicModelId.toLowerCase().includes(C.toLowerCase()))),le=S.filter(L=>{if(!T)return!0;const X=T.toLowerCase();return L.upstreamId.toLowerCase().includes(X)||L.displayName.toLowerCase().includes(X)}),fe=async()=>{if(g){j(!0);try{const L=await we.post(`/api/admin/providers/${g}/discover`);b(L.models),w(new Set)}catch(L){ye.error(L.message)}finally{j(!1)}}},z=async()=>{if(x.size!==0)try{const L=await we.post("/api/admin/models/import",{providerId:g,modelIds:Array.from(x)});ye.success(`Imported ${L.imported} of ${L.requested}`),m(!1),b([]),w(new Set),G()}catch(L){ye.error(L.message)}},$=async()=>{if(se)try{await we.del(`/api/admin/models/${se.id}`),ye.success("Model deleted"),Q(null),G()}catch(L){ye.error(L.message)}},te=async L=>{H(L),I(!0),ne({model:L,result:null,error:null});try{const X=await we.post(`/api/admin/models/${L}/test`);ne({model:L,result:X,error:null})}catch(X){ne({model:L,result:null,error:X.message})}finally{H(null)}};return s.jsxs("div",{children:[s.jsx(xa,{title:"Models",description:"Physical models imported from providers",actions:s.jsxs(Hn,{open:h,onOpenChange:m,children:[s.jsx(ks,{asChild:!0,children:s.jsxs(he,{variant:"outline",children:[s.jsx(Mx,{className:"mr-1 h-4 w-4"})," Fetch models"]})}),s.jsxs(xn,{className:"max-w-2xl",children:[s.jsx(bn,{children:s.jsx(Sn,{children:"Discover models"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsx("div",{className:"flex-1",children:s.jsxs(Pn,{value:g,onValueChange:v,children:[s.jsx(wn,{children:s.jsx(qn,{placeholder:"Choose provider"})}),s.jsx(jn,{children:o.map(L=>s.jsx(lt,{value:L.id,children:L.name},L.id))})]})}),s.jsx(he,{onClick:fe,disabled:!g||R,children:R?"Fetching…":"Fetch"})]}),S.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("div",{className:"flex items-center gap-2 flex-1",children:s.jsxs("div",{className:"relative flex-1",children:[s.jsx(zx,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Re,{className:"pl-8",placeholder:"Search models…",value:T,onChange:L=>A(L.target.value)}),T&&s.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>A(""),children:s.jsx(Rc,{className:"h-4 w-4"})})]})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-sm text-muted-foreground",children:[le.length," / ",S.length," · ",x.size," selected"]}),s.jsx(he,{variant:"outline",size:"sm",onClick:()=>w(new Set(le.filter(L=>!L.alreadyImported).map(L=>L.upstreamId))),children:"Select All (new)"}),s.jsx(he,{variant:"outline",size:"sm",onClick:()=>w(new Set),children:"Clear"})]})]}),s.jsx("div",{className:"max-h-80 space-y-1 overflow-auto rounded border p-2",children:le.length===0&&S.length>0?s.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:"No models match your search."}):le.map(L=>s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(rm,{checked:x.has(L.upstreamId),onCheckedChange:X=>{const M=new Set(x);X?M.add(L.upstreamId):M.delete(L.upstreamId),w(M)}}),s.jsx("span",{className:"font-mono text-xs",children:L.upstreamId}),L.alreadyImported&&s.jsx(et,{variant:"secondary",children:"imported"})]},L.upstreamId))})]})]}),s.jsxs(Bn,{children:[s.jsx(he,{variant:"outline",onClick:()=>m(!1),children:"Cancel"}),s.jsxs(he,{disabled:x.size===0,onClick:z,children:["Import ",x.size||""]})]})]})]})}),s.jsxs(Ge,{children:[s.jsxs($e,{children:[s.jsx(Ke,{className:"text-base",children:"All models"}),s.jsxs(sn,{children:[a.length," total"]})]}),s.jsxs(Xe,{children:[s.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[s.jsxs(Pn,{value:u,onValueChange:f,children:[s.jsx(wn,{className:"w-56",children:s.jsx(qn,{})}),s.jsxs(jn,{children:[s.jsx(lt,{value:"all",children:"All providers"}),o.map(L=>s.jsx(lt,{value:L.id,children:L.name},L.id))]})]}),s.jsx(Re,{className:"max-w-xs",placeholder:"Search public ID",value:C,onChange:L=>N(L.target.value)})]}),s.jsxs(Wn,{children:[s.jsx(ea,{children:s.jsxs(Ze,{children:[s.jsx(ve,{children:"Public ID"}),s.jsx(ve,{children:"Provider"}),s.jsx(ve,{children:"Upstream ID"}),s.jsx(ve,{children:"Capabilities"}),s.jsx(ve,{children:"Available"}),s.jsx(ve,{children:"Enabled"}),s.jsx(ve,{})]})}),s.jsxs(ta,{children:[re.length===0&&s.jsx(Ze,{children:s.jsx(de,{colSpan:7,className:"text-center text-muted-foreground",children:"No models"})}),re.map(L=>s.jsxs(Ze,{children:[s.jsx(de,{className:"font-mono text-xs",children:L.publicModelId}),s.jsx(de,{children:L.providerSlug}),s.jsx(de,{className:"text-xs text-muted-foreground",children:L.upstreamModelId}),s.jsx(de,{className:"space-x-1",children:Object.entries(L.capabilities).filter(([,X])=>X===!0).slice(0,4).map(([X])=>s.jsx(et,{variant:"outline",className:"mr-1",children:X},X))}),s.jsx(de,{children:L.upstreamAvailable?s.jsx(et,{variant:"success",children:"up"}):s.jsx(et,{variant:"destructive",children:"down"})}),s.jsx(de,{children:L.enabled?"Yes":"No"}),s.jsx(de,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(he,{size:"sm",variant:"outline",onClick:()=>void te(L.id),disabled:_!==null,children:[_===L.id?s.jsx(ws,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(UC,{className:"h-3.5 w-3.5"})," Test"]}),s.jsxs(he,{size:"sm",variant:"destructive",onClick:()=>Q(L),disabled:_!==null,children:[s.jsx(Ec,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},L.id))]})]})]})]}),s.jsx(Hn,{open:!!se,onOpenChange:L=>{L||Q(null)},children:s.jsxs(xn,{className:"max-w-md",children:[s.jsx(bn,{children:s.jsx(Sn,{children:"Xoá model"})}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("p",{children:["Bạn có chắc muốn xoá model ",s.jsx("span",{className:"font-mono",children:se==null?void 0:se.publicModelId}),"?"]}),s.jsx("p",{className:"text-muted-foreground",children:"Model đang được dùng trong combo sẽ bị soft-disable (vô hiệu hoá) thay vì xoá hẳn, để giữ lịch sử và tham chiếu combo."})]}),s.jsxs(Bn,{children:[s.jsx(he,{variant:"outline",onClick:()=>Q(null),children:"Huỷ"}),s.jsx(he,{variant:"destructive",onClick:$,children:"Xoá"})]})]})}),s.jsx(Hn,{open:P,onOpenChange:I,children:s.jsxs(xn,{className:"max-w-2xl",children:[s.jsx(bn,{children:s.jsx(Sn,{children:"Kết quả test model"})}),k?k.error?s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsx(et,{variant:"destructive",children:"Thất bại"}),s.jsx("p",{className:"text-destructive",children:k.error})]}):k.result&&s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx(et,{variant:k.result.success?"success":"destructive",children:k.result.success?"Thành công":"Thất bại"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Thời gian phản hồi"}),s.jsxs("div",{className:"font-mono",children:[k.result.latencyMs," ms"]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"TTFT"}),s.jsx("div",{className:"font-mono",children:k.result.ttftMs!=null?`${k.result.ttftMs} ms`:"—"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Tokens (in / out)"}),s.jsxs("div",{className:"font-mono",children:[k.result.usage.input," / ",k.result.usage.output]})]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Phản hồi của model"}),s.jsx("div",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded border bg-muted p-3 text-xs",children:k.result.text||"(trống)"})]}),k.result.attempts.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Attempts"}),s.jsx("div",{className:"space-y-1",children:k.result.attempts.map((L,X)=>s.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-xs",children:[s.jsx(et,{variant:L.success?"success":"destructive",children:L.success?"OK":"FAIL"}),s.jsxs("span",{className:"font-mono",children:[L.providerName," / ",L.modelId]}),s.jsxs("span",{className:"text-muted-foreground",children:[L.latencyMs," ms"]}),L.failureReason&&s.jsx("span",{className:"text-destructive",children:L.failureReason})]},X))})]})]}):s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(ws,{className:"h-4 w-4 animate-spin"})," Đang test…"]}),s.jsx(Bn,{children:s.jsx(he,{variant:"outline",onClick:()=>I(!1),children:"Đóng"})})]})})]})}function KM(){const[a,l]=p.useState([]),[o,i]=p.useState([]),[u,f]=p.useState(!1),[h,m]=p.useState(!1),[g,v]=p.useState(null),[S,b]=p.useState(!1),[x,w]=p.useState(!1),[R,j]=p.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),[C,N]=p.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),T=async()=>{const[Q,G]=await Promise.all([we.get("/api/admin/combos"),we.get("/api/admin/models")]);l(Q.combos),i(G.models)};p.useEffect(()=>{T()},[]);const A=Q=>{j(G=>({...G,members:[...G.members,{modelId:Q,weight:1,position:G.members.length,enabled:!0}]}))},_=Q=>{j(G=>({...G,members:G.members.filter((re,le)=>le!==Q).map((re,le)=>({...re,position:le}))}))},H=async()=>{if(R.members.length===0){ye.error("Add at least one member");return}b(!0);try{await we.post("/api/admin/combos",{name:R.name,slug:R.slug||void 0,mode:R.mode,enabled:R.enabled,members:R.members}),ye.success("Combo created"),f(!1),j({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),T()}catch(Q){ye.error(Q.message)}finally{b(!1)}},P=async Q=>{try{const re=(await we.get(`/api/admin/combos/${Q.id}`)).combo;v(re.id),N({name:re.name,slug:re.slug??"",mode:re.mode,enabled:re.enabled,members:re.members.map(le=>({modelId:le.modelId,weight:le.weight,position:le.position,enabled:le.enabled}))}),m(!0)}catch(G){ye.error(G.message)}},I=async()=>{if(g){if(C.members.length===0){ye.error("Add at least one member");return}w(!0);try{await we.patch("/api/admin/combos",{id:g,name:C.name,slug:C.slug||void 0,mode:C.mode,enabled:C.enabled,members:C.members}),ye.success("Combo updated"),m(!1),v(null),T()}catch(Q){ye.error(Q.message)}finally{w(!1)}}},k=Q=>{N(G=>({...G,members:[...G.members,{modelId:Q,weight:1,position:G.members.length,enabled:!0}]}))},ne=Q=>{N(G=>({...G,members:G.members.filter((re,le)=>le!==Q).map((re,le)=>({...re,position:le}))}))},se=async Q=>{if(confirm("Delete this combo?"))try{await we.del(`/api/admin/combos/${Q}`),ye.success("Combo removed"),T()}catch(G){ye.error(G.message)}};return s.jsxs("div",{children:[s.jsx(xa,{title:"Combos",description:"Virtual models combining physical models",actions:s.jsxs(Hn,{open:u,onOpenChange:f,children:[s.jsx(ks,{asChild:!0,children:s.jsxs(he,{children:[s.jsx(Ms,{className:"mr-1 h-4 w-4"})," New combo"]})}),s.jsxs(xn,{className:"max-w-2xl",children:[s.jsx(bn,{children:s.jsx(Sn,{children:"New combo"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Name"}),s.jsx(Re,{value:R.name,onChange:Q=>j({...R,name:Q.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Slug (optional — leave empty to use the name as the model ID)"}),s.jsx(Re,{value:R.slug,onChange:Q=>j({...R,slug:Q.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Mode"}),s.jsxs(Pn,{value:R.mode,onValueChange:Q=>j({...R,mode:Q}),children:[s.jsx(wn,{children:s.jsx(qn,{})}),s.jsxs(jn,{children:[s.jsx(lt,{value:"fallback",children:"Fallback (ordered)"}),s.jsx(lt,{value:"weighted_round_robin",children:"Weighted round-robin"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ul,{checked:R.enabled,onCheckedChange:Q=>j({...R,enabled:Q})}),s.jsx(xe,{children:"Enabled"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Members"}),s.jsx(nx,{models:o,addedIds:R.members.map(Q=>Q.modelId),onAdd:A}),s.jsx("div",{className:"mt-2 space-y-1",children:R.members.map((Q,G)=>{var re;return s.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-sm",children:[s.jsx("span",{className:"font-mono text-xs",children:(re=o.find(le=>le.id===Q.modelId))==null?void 0:re.publicModelId}),s.jsx(Re,{type:"number",min:1,value:Q.weight,onChange:le=>{const fe=Number(le.target.value);j(z=>({...z,members:z.members.map(($,te)=>te===G?{...$,weight:fe}:$)}))},className:"w-20"}),s.jsx(he,{size:"sm",variant:"outline",onClick:()=>_(G),children:"Remove"})]},G)})})]})]}),s.jsxs(Bn,{children:[s.jsx(he,{variant:"outline",onClick:()=>f(!1),children:"Cancel"}),s.jsx(he,{disabled:!R.name||S,onClick:H,children:S?"Creating…":"Create"})]})]})]})}),s.jsxs(Ge,{children:[s.jsxs($e,{children:[s.jsx(Ke,{className:"text-base",children:"All combos"}),s.jsxs(sn,{children:[a.length," total"]})]}),s.jsx(Xe,{children:s.jsxs(Wn,{children:[s.jsx(ea,{children:s.jsxs(Ze,{children:[s.jsx(ve,{children:"Public ID"}),s.jsx(ve,{children:"Mode"}),s.jsx(ve,{children:"Members"}),s.jsx(ve,{children:"Healthy"}),s.jsx(ve,{children:"Enabled"}),s.jsx(ve,{})]})}),s.jsxs(ta,{children:[a.length===0&&s.jsx(Ze,{children:s.jsx(de,{colSpan:6,className:"text-center text-muted-foreground",children:"No combos yet."})}),a.map(Q=>s.jsxs(Ze,{children:[s.jsx(de,{className:"font-mono text-xs",children:Q.publicModelId}),s.jsx(de,{children:s.jsx(et,{variant:"outline",children:Q.mode})}),s.jsx(de,{children:Q.memberCount}),s.jsx(de,{children:Q.healthyMemberCount}),s.jsx(de,{children:Q.enabled?"Yes":"No"}),s.jsx(de,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(he,{size:"sm",variant:"outline",onClick:()=>void P(Q),children:[s.jsx(GC,{className:"h-3.5 w-3.5"})," Sửa"]}),s.jsxs(he,{size:"sm",variant:"destructive",onClick:()=>se(Q.id),children:[s.jsx(Ec,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},Q.id))]})]})})]}),s.jsx(Hn,{open:h,onOpenChange:m,children:s.jsxs(xn,{className:"max-w-2xl",children:[s.jsx(bn,{children:s.jsx(Sn,{children:"Edit combo"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Name"}),s.jsx(Re,{value:C.name,onChange:Q=>N({...C,name:Q.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Slug (optional — leave empty to use the name as the model ID)"}),s.jsx(Re,{value:C.slug,onChange:Q=>N({...C,slug:Q.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Mode"}),s.jsxs(Pn,{value:C.mode,onValueChange:Q=>N({...C,mode:Q}),children:[s.jsx(wn,{children:s.jsx(qn,{})}),s.jsxs(jn,{children:[s.jsx(lt,{value:"fallback",children:"Fallback (ordered)"}),s.jsx(lt,{value:"weighted_round_robin",children:"Weighted round-robin"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ul,{checked:C.enabled,onCheckedChange:Q=>N({...C,enabled:Q})}),s.jsx(xe,{children:"Enabled"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Members"}),s.jsx(nx,{models:o,addedIds:C.members.map(Q=>Q.modelId),onAdd:k}),s.jsx("div",{className:"mt-2 space-y-1",children:C.members.map((Q,G)=>{var re;return s.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-sm",children:[s.jsx("span",{className:"font-mono text-xs",children:(re=o.find(le=>le.id===Q.modelId))==null?void 0:re.publicModelId}),s.jsx(Re,{type:"number",min:1,value:Q.weight,onChange:le=>{const fe=Number(le.target.value);N(z=>({...z,members:z.members.map(($,te)=>te===G?{...$,weight:fe}:$)}))},className:"w-20"}),s.jsx(he,{size:"sm",variant:"outline",onClick:()=>ne(G),children:"Remove"})]},G)})})]})]}),s.jsxs(Bn,{children:[s.jsx(he,{variant:"outline",onClick:()=>m(!1),children:"Cancel"}),s.jsx(he,{disabled:!C.name||x,onClick:I,children:x?"Saving…":"Save"})]})]})})]})}function nx({models:a,addedIds:l,onAdd:o}){const[i,u]=p.useState(""),h=(i?a.filter(m=>{const g=i.toLowerCase();return m.publicModelId.toLowerCase().includes(g)||m.displayName.toLowerCase().includes(g)}):a).filter(m=>!l.includes(m.id));return s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"relative",children:[s.jsx(zx,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Re,{className:"pl-8",placeholder:"Search models…",value:i,onChange:m=>u(m.target.value)}),i&&s.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>u(""),children:s.jsx(Rc,{className:"h-4 w-4"})})]}),h.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No models match."}):s.jsx("div",{className:"max-h-40 space-y-1 overflow-auto rounded border p-1",children:h.map(m=>s.jsxs("div",{className:"flex items-center justify-between rounded p-1 text-sm hover:bg-accent",children:[s.jsx("span",{className:"font-mono text-xs",children:m.publicModelId}),s.jsx(he,{size:"sm",variant:"ghost",onClick:()=>o(m.id),children:"+ Add"})]},m.id))})]})}function XM(){const[a,l]=p.useState([]),[o,i]=p.useState([]),[u,f]=p.useState([]),[h,m]=p.useState(!1),[g,v]=p.useState({alias:"",targetKind:"model",targetId:"",enabled:!0}),S=async()=>{const[x,w,R]=await Promise.all([we.get("/api/admin/aliases"),we.get("/api/admin/models"),we.get("/api/admin/combos")]);l(x.aliases),i(w.models),f(R.combos)};p.useEffect(()=>{S()},[]);const b=async()=>{try{await we.post("/api/admin/aliases",g),ye.success("Alias created"),m(!1),v({alias:"",targetKind:"model",targetId:"",enabled:!0}),S()}catch(x){ye.error(x.message)}};return s.jsxs("div",{children:[s.jsx(xa,{title:"Aliases",description:"Stable client-visible names for models or combos",actions:s.jsxs(Hn,{open:h,onOpenChange:m,children:[s.jsx(ks,{asChild:!0,children:s.jsxs(he,{children:[s.jsx(Ms,{className:"mr-1 h-4 w-4"})," New alias"]})}),s.jsxs(xn,{children:[s.jsx(bn,{children:s.jsx(Sn,{children:"New alias"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Alias"}),s.jsx(Re,{value:g.alias,onChange:x=>v({...g,alias:x.target.value}),placeholder:"coding"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Target type"}),s.jsxs(Pn,{value:g.targetKind,onValueChange:x=>v({...g,targetKind:x}),children:[s.jsx(wn,{children:s.jsx(qn,{})}),s.jsxs(jn,{children:[s.jsx(lt,{value:"model",children:"Model"}),s.jsx(lt,{value:"combo",children:"Combo"})]})]})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Target"}),s.jsxs(Pn,{value:g.targetId,onValueChange:x=>v({...g,targetId:x}),children:[s.jsx(wn,{children:s.jsx(qn,{placeholder:"Choose target"})}),s.jsx(jn,{children:(g.targetKind==="model"?o:u).map(x=>s.jsx(lt,{value:x.id,children:x.publicModelId},x.id))})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ul,{checked:g.enabled,onCheckedChange:x=>v({...g,enabled:x})}),s.jsx(xe,{children:"Enabled"})]})]}),s.jsxs(Bn,{children:[s.jsx(he,{variant:"outline",onClick:()=>m(!1),children:"Cancel"}),s.jsx(he,{disabled:!g.alias||!g.targetId,onClick:b,children:"Create"})]})]})]})}),s.jsxs(Ge,{children:[s.jsxs($e,{children:[s.jsx(Ke,{className:"text-base",children:"All aliases"}),s.jsxs(sn,{children:[a.length," total"]})]}),s.jsx(Xe,{children:s.jsxs(Wn,{children:[s.jsx(ea,{children:s.jsxs(Ze,{children:[s.jsx(ve,{children:"Alias"}),s.jsx(ve,{children:"Target"}),s.jsx(ve,{children:"Type"}),s.jsx(ve,{children:"Enabled"}),s.jsx(ve,{})]})}),s.jsxs(ta,{children:[a.length===0&&s.jsx(Ze,{children:s.jsx(de,{colSpan:5,className:"text-center text-muted-foreground",children:"No aliases yet."})}),a.map(x=>s.jsxs(Ze,{children:[s.jsx(de,{className:"font-mono text-xs",children:x.alias}),s.jsx(de,{className:"font-mono text-xs",children:x.targetName??x.targetId}),s.jsx(de,{children:s.jsx(et,{variant:"outline",children:x.targetKind})}),s.jsx(de,{children:x.enabled?"Yes":"No"}),s.jsx(de,{className:"text-right",children:s.jsx(he,{size:"sm",variant:"outline",onClick:async()=>{await we.del(`/api/admin/aliases/${x.id}`),ye.success("Removed"),S()},children:"Delete"})})]},x.id))]})]})})]})]})}function QM(){const[a,l]=p.useState([]),[o,i]=p.useState([]),[u,f]=p.useState([]),[h,m]=p.useState(!1),[g,v]=p.useState(null),[S,b]=p.useState(null),[x,w]=p.useState({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),R=async()=>{const[T,A,_]=await Promise.all([we.get("/api/admin/api-keys"),we.get("/api/admin/models"),we.get("/api/admin/combos")]);l(T.apiKeys),i(A.models),f(_.combos)};p.useEffect(()=>{R()},[]);const j=async()=>{try{const T=await we.post("/api/admin/api-keys",{name:x.name,expiresAt:x.expiresAt||null,allowAllModels:x.allowAll,permissions:x.allowAll?void 0:x.permissions,rpmLimit:x.rpmLimit?Number(x.rpmLimit):null,tpmLimit:x.tpmLimit?Number(x.tpmLimit):null,maxConcurrent:x.concurrency?Number(x.concurrency):null,...x.customSecret.trim()?{secret:x.customSecret.trim()}:{}});m(!1),v({secret:T.secret,name:T.name}),w({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),R()}catch(T){ye.error(T.message)}},C=async(T,A)=>{try{await we.patch("/api/admin/api-keys",{id:T,enabled:!A}),ye.success(A?"Key disabled":"Key enabled"),R()}catch(_){ye.error(_.message)}},N=async T=>{if(window.confirm("Delete this API key? This cannot be undone."))try{await we.del(`/api/admin/api-keys/${T}`),ye.success("Key deleted"),R()}catch(A){ye.error(A.message)}};return s.jsxs("div",{children:[s.jsx(xa,{title:"API Keys",description:"Gateway bearer keys for client applications",actions:s.jsxs(Hn,{open:h,onOpenChange:m,children:[s.jsx(ks,{asChild:!0,children:s.jsxs(he,{children:[s.jsx(Ms,{className:"mr-1 h-4 w-4"})," New key"]})}),s.jsxs(xn,{className:"max-w-2xl",children:[s.jsx(bn,{children:s.jsx(Sn,{children:"New API key"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Name"}),s.jsx(Re,{value:x.name,onChange:T=>w({...x,name:T.target.value})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Expires (optional)"}),s.jsx(Re,{type:"datetime-local",value:x.expiresAt,onChange:T=>w({...x,expiresAt:T.target.value})})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"RPM limit"}),s.jsx(Re,{value:x.rpmLimit,onChange:T=>w({...x,rpmLimit:T.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"TPM limit"}),s.jsx(Re,{value:x.tpmLimit,onChange:T=>w({...x,tpmLimit:T.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Concurrency"}),s.jsx(Re,{value:x.concurrency,onChange:T=>w({...x,concurrency:T.target.value}),type:"number"})]})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Key value (optional)"}),s.jsx(Re,{value:x.customSecret,onChange:T=>w({...x,customSecret:T.target.value}),placeholder:"Leave empty to auto-generate ld-…"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"If provided, this exact value is stored as the key. Otherwise a random ld-… key is generated."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ul,{checked:x.allowAll,onCheckedChange:T=>w({...x,allowAll:T})}),s.jsx(xe,{children:"Allow all current and future models"})]}),!x.allowAll&&s.jsxs("div",{children:[s.jsx(xe,{children:"Scope"}),s.jsx("div",{className:"max-h-48 space-y-1 overflow-auto rounded border p-2",children:[...o.map(T=>({targetKind:"model",targetId:T.id,label:T.publicModelId})),...u.map(T=>({targetKind:"combo",targetId:T.id,label:T.publicModelId}))].map(T=>{const A=x.permissions.some(_=>_.targetKind===T.targetKind&&_.targetId===T.targetId);return s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(rm,{checked:A,onCheckedChange:_=>{w(H=>({...H,permissions:_?[...H.permissions,{targetKind:T.targetKind,targetId:T.targetId}]:H.permissions.filter(P=>!(P.targetKind===T.targetKind&&P.targetId===T.targetId))}))}}),s.jsx("span",{className:"font-mono text-xs",children:T.label}),s.jsx(et,{variant:"outline",className:"ml-1",children:T.targetKind})]},`${T.targetKind}:${T.targetId}`)})})]})]}),s.jsxs(Bn,{children:[s.jsx(he,{variant:"outline",onClick:()=>m(!1),children:"Cancel"}),s.jsx(he,{disabled:!x.name,onClick:j,children:"Create"})]})]})]})}),s.jsxs(Ge,{children:[s.jsxs($e,{children:[s.jsx(Ke,{className:"text-base",children:"All keys"}),s.jsxs(sn,{children:[a.length," total"]})]}),s.jsx(Xe,{children:s.jsxs(Wn,{children:[s.jsx(ea,{children:s.jsxs(Ze,{children:[s.jsx(ve,{children:"Name"}),s.jsx(ve,{children:"Prefix"}),s.jsx(ve,{children:"Status"}),s.jsx(ve,{children:"Scope"}),s.jsx(ve,{children:"RPM/TPM/Conc"}),s.jsx(ve,{})]})}),s.jsxs(ta,{children:[a.length===0&&s.jsx(Ze,{children:s.jsx(de,{colSpan:6,className:"text-center text-muted-foreground",children:"No API keys yet."})}),a.map(T=>s.jsxs(Ze,{children:[s.jsx(de,{className:"font-medium",children:T.name}),s.jsxs(de,{className:"font-mono text-xs",children:[T.keyPrefix,"…"]}),s.jsx(de,{children:T.enabled?s.jsx(et,{variant:"success",children:"enabled"}):s.jsx(et,{variant:"destructive",children:"disabled"})}),s.jsx(de,{children:T.allowAllModels?"all":`${T.modelScopeCount} scoped`}),s.jsx(de,{className:"text-xs",children:[T.rpmLimit,T.tpmLimit,T.concurrencyLimit].map((A,_)=>A?["","RPM","TPM","Conc"][_+1]:null).filter(Boolean).join(" / ")||"—"}),s.jsx(de,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[T.secret&&s.jsxs(s.Fragment,{children:[s.jsx(he,{size:"sm",variant:"ghost",title:"Copy secret",onClick:()=>{navigator.clipboard.writeText(T.secret),ye.success("Copied")},children:s.jsx(vf,{className:"h-3.5 w-3.5"})}),s.jsx(he,{size:"sm",variant:"ghost",title:"Show secret",onClick:()=>b({secret:T.secret,name:T.name}),children:s.jsx(kC,{className:"h-3.5 w-3.5"})})]}),s.jsxs(he,{size:"sm",variant:"outline",onClick:()=>C(T.id,T.enabled),children:[T.enabled?s.jsx(NC,{className:"mr-1 h-3.5 w-3.5"}):s.jsx(mh,{className:"mr-1 h-3.5 w-3.5"}),T.enabled?"Disable":"Enable"]}),s.jsx(he,{size:"sm",variant:"destructive",onClick:()=>N(T.id),children:s.jsx(Ec,{className:"h-3.5 w-3.5"})})]})})]},T.id))]})]})})]}),s.jsx(Hn,{open:!!g,onOpenChange:T=>{T||v(null)},children:s.jsxs(xn,{children:[s.jsxs(bn,{children:[s.jsx(Sn,{children:"API key created"}),s.jsx(eh,{children:"Copy now — this secret will not be shown again."})]}),s.jsx("div",{className:"rounded border bg-muted p-3 font-mono text-xs break-all",children:g==null?void 0:g.secret}),s.jsxs(Bn,{children:[s.jsxs(he,{onClick:()=>{g&&(navigator.clipboard.writeText(g.secret),ye.success("Copied"))},children:[s.jsx(vf,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(he,{variant:"outline",onClick:()=>v(null),children:"I have saved it"})]})]})}),s.jsx(Hn,{open:!!S,onOpenChange:T=>{T||b(null)},children:s.jsxs(xn,{children:[s.jsxs(bn,{children:[s.jsxs(Sn,{children:["API key: ",S==null?void 0:S.name]}),s.jsx(eh,{children:"Full secret for this key, readable any time."})]}),s.jsx("div",{className:"rounded border bg-muted p-3 font-mono text-xs break-all",children:S==null?void 0:S.secret}),s.jsxs(Bn,{children:[s.jsxs(he,{onClick:()=>{S&&(navigator.clipboard.writeText(S.secret),ye.success("Copied"))},children:[s.jsx(vf,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(he,{variant:"outline",onClick:()=>b(null),children:"Close"})]})]})})]})}function FM(){const[a,l]=p.useState([]),[o,i]=p.useState(0),[u,f]=p.useState(0),[h,m]=p.useState({success:"all",protocol:"all",streaming:"all",model:""}),[g,v]=p.useState(null),[S,b]=p.useState(null),x=50,w=p.useCallback(async()=>{const j=new URLSearchParams;j.set("limit",String(x)),j.set("offset",String(u)),h.success!=="all"&&j.set("success",h.success),h.protocol!=="all"&&j.set("protocol",h.protocol),h.streaming!=="all"&&j.set("streaming",h.streaming),h.model&&j.set("requestedModel",h.model);const C=await we.get(`/api/admin/requests?${j.toString()}`);l(C.requests),i(C.total)},[u,h]);p.useEffect(()=>{w()},[w]);const R=async j=>{v(j);const C=await we.get(`/api/admin/requests/${j}`);b(C)};return s.jsxs("div",{children:[s.jsx(xa,{title:"Requests",description:`${o} matching · server-side paginated`}),s.jsxs(Ge,{children:[s.jsxs($e,{children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(Pn,{value:h.success,onValueChange:j=>{f(0),m({...h,success:j})},children:[s.jsx(wn,{className:"w-36",children:s.jsx(qn,{})}),s.jsxs(jn,{children:[s.jsx(lt,{value:"all",children:"All"}),s.jsx(lt,{value:"true",children:"Success"}),s.jsx(lt,{value:"false",children:"Failed"})]})]}),s.jsxs(Pn,{value:h.protocol,onValueChange:j=>{f(0),m({...h,protocol:j})},children:[s.jsx(wn,{className:"w-32",children:s.jsx(qn,{})}),s.jsxs(jn,{children:[s.jsx(lt,{value:"all",children:"Any protocol"}),s.jsx(lt,{value:"openai",children:"OpenAI"}),s.jsx(lt,{value:"anthropic",children:"Anthropic"})]})]}),s.jsxs(Pn,{value:h.streaming,onValueChange:j=>{f(0),m({...h,streaming:j})},children:[s.jsx(wn,{className:"w-32",children:s.jsx(qn,{})}),s.jsxs(jn,{children:[s.jsx(lt,{value:"all",children:"Any"}),s.jsx(lt,{value:"true",children:"Streaming"}),s.jsx(lt,{value:"false",children:"Non-stream"})]})]}),s.jsx(Re,{className:"max-w-xs",placeholder:"Model contains…",value:h.model,onChange:j=>{f(0),m({...h,model:j.target.value})}})]}),s.jsx(Ke,{className:"mt-3 text-base",children:"Results"})]}),s.jsxs(Xe,{children:[s.jsxs(Wn,{children:[s.jsx(ea,{children:s.jsxs(Ze,{children:[s.jsx(ve,{children:"Time"}),s.jsx(ve,{children:"Status"}),s.jsx(ve,{children:"Requested"}),s.jsx(ve,{children:"Final"}),s.jsx(ve,{children:"Tokens"}),s.jsx(ve,{children:"Latency"}),s.jsx(ve,{children:"Attempts"}),s.jsx(ve,{children:"Key"}),s.jsx(ve,{children:"IP"}),s.jsx(ve,{})]})}),s.jsxs(ta,{children:[a.length===0&&s.jsx(Ze,{children:s.jsx(de,{colSpan:10,className:"text-center text-muted-foreground",children:"No requests yet."})}),a.map(j=>s.jsxs(Ze,{className:"cursor-pointer",onClick:()=>R(j.id),children:[s.jsx(de,{className:"text-xs",children:gh(j.createdAt)}),s.jsx(de,{children:j.success?s.jsx(et,{variant:"success",children:j.httpStatus}):s.jsx(et,{variant:"destructive",children:j.httpStatus})}),s.jsx(de,{className:"font-mono text-xs",children:j.requestedModel}),s.jsx(de,{className:"font-mono text-xs text-muted-foreground",children:j.finalModelPublicId??"—"}),s.jsxs(de,{className:"text-xs",children:[Ht(j.inputTokens+j.outputTokens)," ",j.cacheReadTokens?s.jsxs("span",{className:"text-amber-600",children:["(+",j.cacheReadTokens," cache)"]}):null]}),s.jsxs(de,{className:"text-xs",children:[_l(j.totalLatencyMs),j.ttftMs?s.jsxs("span",{className:"text-muted-foreground",children:[" · ttft ",j.ttftMs,"ms"]}):null]}),s.jsxs(de,{className:"text-xs",children:[j.attemptsCount,j.gatewayCacheHit?s.jsx(et,{variant:"secondary",className:"ml-1",children:"cache"}):null]}),s.jsx(de,{className:"text-xs",children:j.apiKeyName??"—"}),s.jsx(de,{className:"text-xs",children:j.clientIp}),s.jsx(de,{className:"text-right",children:s.jsx(he,{size:"sm",variant:"ghost",children:"View"})})]},j.id))]})]}),s.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:["Showing ",u+1,"–",Math.min(u+x,o)," of ",o]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(he,{size:"sm",variant:"outline",disabled:u===0,onClick:()=>f(Math.max(0,u-x)),children:"Prev"}),s.jsx(he,{size:"sm",variant:"outline",disabled:u+x>=o,onClick:()=>f(u+x),children:"Next"})]})]})]})]}),s.jsx(Hn,{open:!!g,onOpenChange:j=>{j||(v(null),b(null))},children:s.jsxs(xn,{className:"max-w-3xl",children:[s.jsx(bn,{children:s.jsxs(Sn,{children:["Request ",R2(g,16)]})}),S?s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Status"}),S.request.success?s.jsx(et,{variant:"success",children:S.request.httpStatus}):s.jsx(et,{variant:"destructive",children:S.request.httpStatus})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Latency"}),_l(S.request.totalLatencyMs)]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Tokens"}),"in ",Ht(S.request.inputTokens)," · out ",Ht(S.request.outputTokens)," · cache ",Ht(S.request.cacheReadTokens)]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Attempts"}),S.request.attemptsCount]})]}),S.request.errorType&&s.jsxs("div",{className:"rounded border border-destructive/40 bg-destructive/10 p-2",children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Error"}),s.jsxs("div",{className:"font-mono text-xs",children:[S.request.errorType,": ",S.request.errorMessage]})]}),S.attempts.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Attempts"}),s.jsxs(Wn,{children:[s.jsx(ea,{children:s.jsxs(Ze,{children:[s.jsx(ve,{children:"#"}),s.jsx(ve,{children:"Provider"}),s.jsx(ve,{children:"Model"}),s.jsx(ve,{children:"Status"}),s.jsx(ve,{children:"Latency"}),s.jsx(ve,{children:"Reason"})]})}),s.jsx(ta,{children:S.attempts.map(j=>s.jsxs(Ze,{children:[s.jsx(de,{children:j.attemptNumber}),s.jsx(de,{children:j.providerName}),s.jsx(de,{className:"font-mono text-xs",children:j.modelPublicId}),s.jsx(de,{children:j.success?s.jsx(et,{variant:"success",children:String(j.statusCode??"OK")}):s.jsx(et,{variant:"destructive",children:String(j.statusCode??"err")})}),s.jsx(de,{className:"text-xs",children:_l(j.latencyMs)}),s.jsx(de,{className:"text-xs",children:j.failureReason??j.selectionReason})]},j.id))})]})]})]}):s.jsx("div",{className:"text-muted-foreground",children:"Loading…"})]})})]})}var ZM=Object.defineProperty,Co=(a,l)=>ZM(a,"name",{value:l,configurable:!0}),om="Tabs",[JM,W_]=un(om,[Uc]),s1=Uc(),[WM,sm]=JM(om),e_=p.forwardRef(Co(function(l,o){const{__scopeTabs:i,value:u,onValueChange:f,defaultValue:h,orientation:m="horizontal",dir:g,activationMode:v="automatic",...S}=l,b=Os(g),[x,w]=Xa({prop:u,onChange:f,defaultProp:h??"",caller:om});return s.jsx(WM,{scope:i,baseId:ma(),value:x,onValueChange:w,orientation:m,dir:b,activationMode:v,children:s.jsx(Le.div,{dir:b,"data-orientation":m,...S,ref:o})})},"Tabs")),t_="TabsList",n_=p.forwardRef(Co(function(l,o){const{__scopeTabs:i,loop:u=!0,...f}=l,h=sm(t_,i),m=s1(i);return s.jsx(Xb,{asChild:!0,...m,orientation:h.orientation,dir:h.dir,loop:u,children:s.jsx(Le.div,{role:"tablist","aria-orientation":h.orientation,...f,ref:o})})},"TabsList")),a_="TabsTrigger",l_=p.forwardRef(Co(function(l,o){const{__scopeTabs:i,value:u,disabled:f=!1,...h}=l,m=sm(a_,i),g=s1(i),v=im(m.baseId,u),S=cm(m.baseId,u),b=u===m.value;return s.jsx(Qb,{asChild:!0,...g,focusable:!f,active:b,children:s.jsx(Le.button,{type:"button",role:"tab","aria-selected":b,"aria-controls":S,"data-state":b?"active":"inactive","data-disabled":f?"":void 0,disabled:f,id:v,...h,ref:o,onMouseDown:Se(l.onMouseDown,x=>{!f&&x.button===0&&x.ctrlKey===!1?m.onValueChange(u):x.preventDefault()}),onKeyDown:Se(l.onKeyDown,x=>{f||x.target!==x.currentTarget||[" ","Enter"].includes(x.key)&&m.onValueChange(u)}),onFocus:Se(l.onFocus,()=>{const x=m.activationMode!=="manual";!b&&!f&&x&&m.onValueChange(u)})})})},"TabsTrigger")),r_="TabsContent",o_=p.forwardRef(Co(function(l,o){const{__scopeTabs:i,value:u,forceMount:f,children:h,...m}=l,g=sm(r_,i),v=im(g.baseId,u),S=cm(g.baseId,u),b=u===g.value,x=p.useRef(b);return p.useEffect(()=>{const w=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(w)},[]),s.jsx(Wa,{present:f||b,children:({present:w})=>s.jsx(Le.div,{"data-state":b?"active":"inactive","data-orientation":g.orientation,role:"tabpanel","aria-labelledby":v,hidden:!w,id:S,tabIndex:0,...m,ref:o,style:{...l.style,animationDuration:x.current?"0s":void 0},children:w&&h})})},"TabsContent"));function im(a,l){return`${a}-trigger-${l}`}Co(im,"makeTriggerId");function cm(a,l){return`${a}-content-${l}`}Co(cm,"makeContentId");var s_=e_,i1=n_,c1=l_,u1=o_;const d1=s_,um=p.forwardRef(({className:a,...l},o)=>s.jsx(i1,{ref:o,className:Ce("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",a),...l}));um.displayName=i1.displayName;const Ml=p.forwardRef(({className:a,...l},o)=>s.jsx(c1,{ref:o,className:Ce("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",a),...l}));Ml.displayName=c1.displayName;const Ss=p.forwardRef(({className:a,...l},o)=>s.jsx(u1,{ref:o,className:Ce("mt-2 ring-offset-background focus-visible:outline-none",a),...l}));Ss.displayName=u1.displayName;function i_(){const[a,l]=p.useState("7d"),[o,i]=p.useState(null),[u,f]=p.useState(!0),[h,m]=p.useState(null);if(p.useEffect(()=>{f(!0),m(null),we.get(`/api/admin/stats?preset=${a}`).then(v=>{i(v)}).catch(v=>{m(v.message)}).finally(()=>f(!1))},[a]),u)return s.jsx("div",{className:"text-muted-foreground",children:"Loading…"});if(h||!o)return s.jsxs("div",{className:"text-destructive",children:["Failed to load statistics: ",h??"unknown error"]});const g=o.summary;return s.jsxs("div",{children:[s.jsx(xa,{title:"Statistics",description:"Aggregated metrics for the selected range",actions:s.jsx(d1,{value:a,onValueChange:v=>l(v),children:s.jsxs(um,{children:[s.jsx(Ml,{value:"today",children:"Today"}),s.jsx(Ml,{value:"7d",children:"7 days"}),s.jsx(Ml,{value:"30d",children:"30 days"})]})})}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsxs(Ge,{children:[s.jsx($e,{className:"pb-1",children:s.jsx(Ke,{className:"text-sm text-muted-foreground",children:"Requests"})}),s.jsx(Xe,{className:"text-2xl font-semibold",children:Ht(g.totalRequests)})]}),s.jsxs(Ge,{children:[s.jsx($e,{className:"pb-1",children:s.jsx(Ke,{className:"text-sm text-muted-foreground",children:"Success rate"})}),s.jsx(Xe,{className:"text-2xl font-semibold",children:bs(g.successRate)})]}),s.jsxs(Ge,{children:[s.jsx($e,{className:"pb-1",children:s.jsx(Ke,{className:"text-sm text-muted-foreground",children:"Total tokens"})}),s.jsx(Xe,{className:"text-2xl font-semibold",children:Ht(g.totalTokens)})]}),s.jsxs(Ge,{children:[s.jsx($e,{className:"pb-1",children:s.jsx(Ke,{className:"text-sm text-muted-foreground",children:"Cache hit rate"})}),s.jsx(Xe,{className:"text-2xl font-semibold",children:bs(g.cacheHitRate)})]}),s.jsxs(Ge,{children:[s.jsx($e,{className:"pb-1",children:s.jsx(Ke,{className:"text-sm text-muted-foreground",children:"Avg latency"})}),s.jsx(Xe,{children:_l(g.averageLatencyMs)})]}),s.jsxs(Ge,{children:[s.jsx($e,{className:"pb-1",children:s.jsx(Ke,{className:"text-sm text-muted-foreground",children:"p95 latency"})}),s.jsx(Xe,{children:_l(g.p95LatencyMs)})]}),s.jsxs(Ge,{children:[s.jsx($e,{className:"pb-1",children:s.jsx(Ke,{className:"text-sm text-muted-foreground",children:"Avg TTFT"})}),s.jsx(Xe,{children:g.averageTtftMs?_l(g.averageTtftMs):"—"})]}),s.jsxs(Ge,{children:[s.jsx($e,{className:"pb-1",children:s.jsx(Ke,{className:"text-sm text-muted-foreground",children:"Fallback rate"})}),s.jsx(Xe,{children:bs(g.fallbackRate)})]})]}),s.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-2",children:[s.jsxs(Ge,{children:[s.jsx($e,{children:s.jsx(Ke,{className:"text-base",children:"Top models"})}),s.jsx(Xe,{children:s.jsxs(Wn,{children:[s.jsx(ea,{children:s.jsxs(Ze,{children:[s.jsx(ve,{children:"Model"}),s.jsx(ve,{children:"Requests"}),s.jsx(ve,{children:"Errors"}),s.jsx(ve,{children:"Tokens"})]})}),s.jsxs(ta,{children:[o.topModels.length===0&&s.jsx(Ze,{children:s.jsx(de,{colSpan:4,className:"text-muted-foreground text-center",children:"No data"})}),o.topModels.map(v=>s.jsxs(Ze,{children:[s.jsx(de,{className:"font-mono text-xs",children:v.publicId}),s.jsx(de,{children:Ht(v.requests)}),s.jsx(de,{children:bs(v.errorRate)}),s.jsx(de,{children:Ht(v.totalTokens)})]},v.publicId))]})]})})]}),s.jsxs(Ge,{children:[s.jsx($e,{children:s.jsx(Ke,{className:"text-base",children:"Top API keys"})}),s.jsx(Xe,{children:s.jsxs(Wn,{children:[s.jsx(ea,{children:s.jsxs(Ze,{children:[s.jsx(ve,{children:"Key"}),s.jsx(ve,{children:"Requests"}),s.jsx(ve,{children:"Tokens"})]})}),s.jsxs(ta,{children:[o.topApiKeys.length===0&&s.jsx(Ze,{children:s.jsx(de,{colSpan:3,className:"text-muted-foreground text-center",children:"No data"})}),o.topApiKeys.map((v,S)=>s.jsxs(Ze,{children:[s.jsx(de,{children:v.name}),s.jsx(de,{children:Ht(v.requests)}),s.jsx(de,{children:Ht(v.totalTokens)})]},S))]})]})})]})]}),s.jsxs(Ge,{className:"mt-6",children:[s.jsxs($e,{children:[s.jsx(Ke,{className:"text-base",children:"Series (requests / errors over time)"}),s.jsxs(sn,{children:["Buckets: ",o.range.bucket]})]}),s.jsx(Xe,{children:s.jsx("div",{className:"grid grid-cols-12 gap-1 text-xs",children:o.series.map(v=>s.jsxs("div",{className:"flex flex-col items-center",title:`${v.t}: ${v.requests} req, ${v.errors} err`,children:[s.jsx("div",{className:"w-full bg-primary/80",style:{height:`${Math.min(80,v.requests*4)}px`}}),s.jsx("div",{className:"text-[10px] text-muted-foreground",children:v.t.slice(5,10)})]},v.t))})})]})]})}function c_(){const[a,l]=p.useState([]),[o,i]=p.useState(0);return p.useEffect(()=>{we.get("/api/admin/audit?limit=200").then(u=>{l(u.rows),i(u.total)})},[]),s.jsxs("div",{children:[s.jsx(xa,{title:"Audit Logs",description:`${o} entries · immutable`}),s.jsxs(Ge,{children:[s.jsx($e,{children:s.jsx(Ke,{className:"text-base",children:"All entries"})}),s.jsx(Xe,{children:s.jsxs(Wn,{children:[s.jsx(ea,{children:s.jsxs(Ze,{children:[s.jsx(ve,{children:"Time"}),s.jsx(ve,{children:"Action"}),s.jsx(ve,{children:"Status"}),s.jsx(ve,{children:"Target"}),s.jsx(ve,{children:"IP"}),s.jsx(ve,{children:"Actor"})]})}),s.jsxs(ta,{children:[a.length===0&&s.jsx(Ze,{children:s.jsx(de,{colSpan:6,className:"text-center text-muted-foreground",children:"No audit events yet."})}),a.map(u=>s.jsxs(Ze,{children:[s.jsx(de,{className:"text-xs",children:gh(u.createdAt)}),s.jsx(de,{className:"font-mono text-xs",children:u.action}),s.jsx(de,{children:u.success?s.jsx(et,{variant:"success",children:"ok"}):s.jsx(et,{variant:"destructive",children:"fail"})}),s.jsx(de,{className:"text-xs",children:u.targetName??u.targetId??"—"}),s.jsx(de,{className:"text-xs",children:u.ip}),s.jsx(de,{className:"text-xs",children:u.actor})]},u.id))]})]})})]})]})}function u_(){const[a]=mC(),[l,o]=p.useState(null),[i,u]=p.useState(null),[f,h]=p.useState({current:"",next:""}),[m,g]=p.useState(null),[v,S]=p.useState(!1),[b,x]=p.useState("idle"),[w,R]=p.useState(null),j=async(J=!1)=>{x("checking"),R(null);try{const oe=await we.get(`/api/admin/update/check${J?"?force=1":""}`);g(oe),x("idle")}catch(oe){R(oe.message),x("error")}},C=async()=>{S(!0),x("installing"),R(null);try{const J=await we.post("/api/admin/update/run");x("restarting"),ye.success(J.message||"Update started — the gateway will restart shortly.");const oe=setInterval(()=>{fetch("/health").then(ie=>{ie.ok&&(clearInterval(oe),window.location.reload())}).catch(()=>{})},3e3);setTimeout(()=>clearInterval(oe),12e4)}catch(J){ye.error(J.message),R(J.message),x("error")}finally{S(!1)}},[N,T]=p.useState("disabled"),[A,_]=p.useState(""),[H,P]=p.useState(""),[I,k]=p.useState(""),[ne,se]=p.useState([]),[Q,G]=p.useState(""),[re,le]=p.useState(""),[fe,z]=p.useState(!1),[$,te]=p.useState(null),L=async()=>{const J=await we.get("/api/admin/settings");o(J.settings);const oe=await we.get("/api/admin/settings/system");u(oe);try{const ie=await we.get("/api/admin/me");T(ie.totpEnabled?"enabled":"disabled")}catch{}};if(p.useEffect(()=>{L(),j()},[]),!l)return s.jsx("div",{className:"text-muted-foreground",children:"Loading…"});const X=async J=>{try{await we.patch("/api/admin/settings",J),ye.success("Saved"),L()}catch(oe){ye.error(oe.message)}},M=async()=>{try{const J=await we.post("/api/admin/account/totp/begin");_(J.secret),P(J.qr),T("setup"),ye.info("Scan the QR code with your authenticator app")}catch(J){ye.error(J.message)}},B=async()=>{if(!I||I.length!==6){ye.error("Enter a 6-digit code");return}try{const J=await we.post("/api/admin/account/totp/verify",{code:I});se(J.recoveryCodes),T("showingRecovery"),ye.success("TOTP enabled successfully")}catch(J){ye.error(J.message)}},F=async()=>{if(!Q){ye.error("Enter your password");return}if(!re){ye.error("Enter a TOTP code or recovery code");return}try{await we.post("/api/admin/account/totp/disable",{password:Q,totp:re}),T("disabled"),G(""),le(""),ye.success("TOTP disabled"),L()}catch(J){ye.error(J.message)}},ae=async()=>{z(!0);try{const J=await we.post("/api/admin/account/totp/recovery/regenerate",{password:Q,totp:re});se(J.recoveryCodes),T("showingRecovery"),ye.success("Recovery codes regenerated")}catch(J){ye.error(J.message)}z(!1)},ue=a.get("tab")||"logging";return s.jsxs("div",{children:[s.jsx(xa,{title:"Settings",description:"Logging, security, backup, and system info"}),s.jsxs(d1,{defaultValue:ue,children:[s.jsxs(um,{children:[s.jsx(Ml,{value:"logging",children:"Logging"}),s.jsx(Ml,{value:"security",children:"Security"}),s.jsx(Ml,{value:"backup",children:"Backup"}),s.jsx(Ml,{value:"system",children:"System"})]}),s.jsx(Ss,{value:"logging",children:s.jsxs(Ge,{children:[s.jsx($e,{children:s.jsx(Ke,{className:"text-base",children:"Logging policy"})}),s.jsxs(Xe,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Request-content logging"}),s.jsxs(Pn,{value:l.contentLogMode,onValueChange:J=>X({contentLogMode:J}),children:[s.jsx(wn,{children:s.jsx(qn,{})}),s.jsxs(jn,{children:[s.jsx(lt,{value:"off",children:"Off"}),s.jsx(lt,{value:"metadata",children:"Metadata only (default)"}),s.jsx(lt,{value:"prompt",children:"Prompt (sanitized)"}),s.jsx(lt,{value:"prompt_and_response",children:"Prompt + response (sanitized)"})]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Retention (days)"}),s.jsx(Re,{type:"number",min:1,max:3650,value:l.retentionDays,onChange:J=>X({retentionDays:Number(J.target.value)})})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(xe,{children:"Database size limit (MB)"}),s.jsx(Re,{type:"number",min:64,value:l.dbSizeLimitMb,onChange:J=>X({dbSizeLimitMb:Number(J.target.value)})})]}),s.jsx("div",{className:"flex items-center gap-2 pt-2",children:s.jsx(he,{onClick:async()=>{const J=await we.post("/api/admin/settings/cleanup");ye.success(`Deleted ${J.deletedRequests} old requests`)},children:"Run cleanup now"})})]})]})}),s.jsx(Ss,{value:"security",children:s.jsxs(Ge,{children:[s.jsxs($e,{children:[s.jsx(Ke,{className:"text-base",children:"Security"}),s.jsx(sn,{children:"Change password, 2FA, and trusted proxy configuration"})]}),s.jsxs(Xe,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(xe,{children:"Trusted proxy hops"}),s.jsx(Re,{type:"number",min:0,max:8,value:l.trustProxyHops,onChange:J=>X({trustProxyHops:Number(J.target.value)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"0 = never trust X-Forwarded-For (direct exposure). 1+ only when behind a single trusted reverse proxy."})]}),s.jsxs("div",{className:"space-y-2 border-t pt-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(xe,{className:"text-base",children:"TOTP 2FA"}),N==="enabled"?s.jsx("span",{className:"rounded bg-green-100 px-2 py-0.5 text-xs font-medium text-green-800 dark:bg-green-900 dark:text-green-200",children:"Enabled"}):null,N==="disabled"?s.jsx("span",{className:"rounded bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:"Disabled"}):null]}),N==="disabled"&&s.jsx(he,{variant:"outline",onClick:M,children:"Enable TOTP"}),N==="setup"&&s.jsxs("div",{className:"space-y-3 rounded border p-3",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Scan this QR code with your authenticator app, or enter the secret manually."}),H&&s.jsx("img",{src:H,alt:"TOTP QR code",className:"h-40 w-40"}),s.jsxs("div",{className:"text-xs font-mono text-muted-foreground",children:["Secret: ",A]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(xe,{children:"Verify code"}),s.jsx(Re,{value:I,onChange:J=>k(J.target.value),placeholder:"123456",maxLength:6})]}),s.jsx(he,{disabled:I.length<6,onClick:B,children:"Verify & enable"})]})]}),N==="showingRecovery"&&s.jsxs("div",{className:"space-y-3 rounded border border-amber-500/40 bg-amber-50 p-3 dark:bg-amber-950/20",children:[s.jsx("p",{className:"text-sm font-medium",children:"Recovery codes — save these now!"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Each code can be used once to log in without your TOTP device. They will not be shown again."}),s.jsx("div",{className:"space-y-1",children:ne.map((J,oe)=>s.jsx("div",{className:"font-mono text-xs",children:J},oe))}),s.jsx(he,{onClick:()=>{T("enabled"),ye.success("Recovery codes saved")},children:"I have saved them"})]}),N==="enabled"&&s.jsxs("div",{className:"space-y-3 rounded border p-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Password"}),s.jsx(Re,{type:"password",value:Q,onChange:J=>G(J.target.value),placeholder:"Current password"})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"TOTP code"}),s.jsx(Re,{value:re,onChange:J=>le(J.target.value),placeholder:"123456",maxLength:6})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(he,{variant:"outline",size:"sm",disabled:fe||!Q||re.length<6,onClick:ae,children:"Regenerate recovery codes"}),s.jsx(he,{variant:"destructive",size:"sm",disabled:!Q||re.length<6,onClick:F,children:"Disable TOTP"})]})]})]}),s.jsxs("div",{className:"space-y-2 border-t pt-4",children:[s.jsx(xe,{children:"Change password"}),s.jsx(Re,{type:"password",placeholder:"Current password",value:f.current,onChange:J=>h({...f,current:J.target.value})}),s.jsx(Re,{type:"password",placeholder:"New password (12+ chars)",value:f.next,onChange:J=>h({...f,next:J.target.value})}),s.jsx(he,{disabled:!f.current||f.next.length<12,onClick:async()=>{try{await we.post("/api/admin/account/password",{currentPassword:f.current,newPassword:f.next}),ye.success("Password changed"),h({current:"",next:""})}catch(J){ye.error(J.message)}},children:"Change password"})]})]})]})}),s.jsx(Ss,{value:"backup",children:s.jsxs(Ge,{children:[s.jsxs($e,{children:[s.jsx(Ke,{className:"text-base",children:"Backup & restore"}),s.jsx(sn,{children:"Download a snapshot or restore from a previous backup"})]}),s.jsxs(Xe,{className:"space-y-3",children:[s.jsx(he,{onClick:async()=>{try{const J=await fetch("/api/admin/backup/create",{method:"POST",credentials:"include"});if(!J.ok)throw new Error("Backup failed");const oe=await J.blob(),ie=URL.createObjectURL(oe),me=document.createElement("a");me.href=ie,me.download="latedev-backup.json",me.click(),URL.revokeObjectURL(ie),ye.success("Backup downloaded")}catch(J){ye.error(J.message)}},children:"Download backup"}),s.jsxs(q0,{open:$!==null,onOpenChange:J=>{J||te(null)},children:[s.jsx(qA,{asChild:!0,children:s.jsxs("div",{children:[s.jsx(xe,{children:"Restore from backup file"}),s.jsx(Re,{type:"file",accept:".json,application/json","data-testid":"restore-file",onChange:J=>{var ie;const oe=(ie=J.target.files)==null?void 0:ie[0];te(oe??null)}})]})}),s.jsxs(Yh,{children:[s.jsxs(I0,{children:[s.jsx(Gh,{children:"Restore backup?"}),s.jsxs($h,{children:["Restoring will replace the entire current database with the selected backup (",($==null?void 0:$.name)??"file","). This cannot be undone. A snapshot of the current database is kept for rollback only if validation fails."]})]}),s.jsxs(Y0,{children:[s.jsx(Xh,{children:"Cancel"}),s.jsx(Kh,{onClick:async()=>{var oe,ie;const J=$;if(J)try{const me=await fetch("/api/admin/backup/restore",{method:"POST",body:J,credentials:"include",headers:{"content-type":"application/json"}});if(!me.ok)throw new Error(((ie=(oe=await me.json())==null?void 0:oe.error)==null?void 0:ie.message)??"Restore failed");ye.success("Restored. Please restart the gateway."),te(null)}catch(me){ye.error(me.message)}},children:"Restore"})]})]})]})]})]})}),s.jsxs(Ss,{value:"system",children:[s.jsxs(Ge,{children:[s.jsx($e,{children:s.jsx(Ke,{className:"text-base",children:"System"})}),s.jsxs(Xe,{className:"space-y-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"App version:"})," ",i==null?void 0:i.appVersion]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Data directory:"})," ",s.jsx("span",{className:"font-mono",children:i==null?void 0:i.dataDir})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Encryption:"})," ",i!=null&&i.masterKeyConfigured?"Configured":"Not configured"," (v",i==null?void 0:i.masterKeyVersion,")"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Environment:"})," ",i==null?void 0:i.environment]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(Ul,{checked:l.gatewayCacheEnabled,onCheckedChange:J=>X({gatewayCacheEnabled:J})}),s.jsx(xe,{children:"Gateway response cache (disabled by default)"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx(xe,{children:"Cache TTL (s)"}),s.jsx(Re,{type:"number",min:1,value:l.gatewayCacheDefaultTtlSeconds,onChange:J=>X({gatewayCacheDefaultTtlSeconds:Number(J.target.value)})})]}),s.jsxs("div",{children:[s.jsx(xe,{children:"Cache max size (MB)"}),s.jsx(Re,{type:"number",min:1,value:l.gatewayCacheMaxSizeMb,onChange:J=>X({gatewayCacheMaxSizeMb:Number(J.target.value)})})]})]}),s.jsx(he,{variant:"outline",onClick:async()=>{const J=await we.post("/api/admin/settings/cache/clear");ye.success(`Cleared ${J.deleted} entries`)},children:"Clear gateway cache"})]})]}),s.jsxs(Ge,{className:"mt-4",children:[s.jsxs($e,{children:[s.jsx(Ke,{className:"text-base",children:"Updates"}),s.jsx(sn,{children:"Automatic updates from the npm registry"})]}),s.jsxs(Xe,{className:"space-y-3 text-sm",children:[b==="checking"&&!m&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(ws,{className:"h-4 w-4 animate-spin"})," Checking for updates…"]}),m&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Current version"}),s.jsxs("div",{className:"font-mono",children:["v",m.currentVersion]})]}),s.jsx("span",{className:"text-muted-foreground",children:"→"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Latest version"}),s.jsx("div",{className:"font-mono",children:m.latestVersion?`v${m.latestVersion}`:"—"})]}),m.status.docker?s.jsx(et,{variant:"secondary",children:m.status.watchtower?"Docker + Watchtower":"Docker"}):m.latestVersion===null?s.jsx(et,{variant:"secondary",children:"Registry unreachable"}):m.hasUpdate?s.jsx(et,{variant:"success",children:"Update available"}):s.jsxs(et,{variant:"outline",children:[s.jsx(mh,{className:"mr-1 h-3 w-3"})," Up to date"]})]}),m.status.docker&&m.status.watchtower&&m.watchtowerReachable&&s.jsx("p",{className:"text-muted-foreground",children:"Watchtower pulls new images automatically every hour — or use Update now for an instant update."}),m.status.docker&&m.status.watchtower&&m.watchtowerReachable===!1&&s.jsxs("p",{className:"text-muted-foreground",children:["The Watchtower sidecar is configured but not running — start it with ",s.jsx("code",{className:"rounded bg-muted px-1 text-xs",children:"docker compose --profile updater up -d"}),"."]}),m.status.docker&&!m.status.watchtower&&s.jsx("p",{className:"text-muted-foreground",children:m.status.reason??"This instance runs in Docker — update by pulling the new image tag."}),!m.status.docker&&m.latestVersion===null&&s.jsxs("p",{className:"text-muted-foreground",children:["Could not reach the npm registry (offline or blocked). ",w&&s.jsx("span",{className:"text-destructive",children:w})]}),b==="installing"&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(ws,{className:"h-4 w-4 animate-spin"})," Applying the update… this can take a minute."]}),b==="restarting"&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(ws,{className:"h-4 w-4 animate-spin"})," Update applied — the gateway is restarting on the new version. This page reloads automatically."]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[m.hasUpdate&&b==="idle"&&(!m.status.docker||m.status.watchtower&&m.watchtowerReachable!==!1)&&s.jsxs(he,{disabled:v||m.status.docker&&m.watchtowerReachable===!1,onClick:C,children:[s.jsx(Mx,{className:"mr-1 h-4 w-4"})," Update now"]}),m.hasUpdate&&m.changelogUrl&&s.jsx(he,{variant:"outline",asChild:!0,children:s.jsx("a",{href:m.changelogUrl,target:"_blank",rel:"noreferrer",children:"View changes"})}),b==="idle"&&s.jsx(he,{variant:"ghost",disabled:v,onClick:()=>j(!0),children:"Check again"})]})]})]})]})]})]})]})}function d_({items:a,onDismiss:l}){return a.length?s.jsx("div",{className:"fixed top-16 right-4 z-50 flex max-h-[calc(100vh-8rem)] w-80 flex-col gap-2 overflow-y-auto",children:a.map(o=>{const i=!o.success,u=o.success&&o.totalLatencyMs>15e3,f=Ce("rounded-md border shadow-lg transition-all",i&&"bg-destructive text-destructive-foreground border-destructive",u&&"bg-amber-500/90 text-amber-950 border-amber-600/50",!i&&!u&&"bg-card text-card-foreground border-border");return s.jsxs(ir,{to:"/requests",className:Ce("block shrink-0 p-3 hover:opacity-95",f),children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[i?s.jsx(OC,{className:"h-4 w-4 shrink-0"}):o.success?s.jsx(mh,{className:"h-4 w-4 shrink-0"}):s.jsx(KC,{className:"h-4 w-4 shrink-0 opacity-70"}),s.jsx("div",{className:"min-w-0 truncate text-sm font-medium",title:o.requestedModel,children:o.requestedModel})]}),s.jsx("button",{className:"shrink-0 opacity-60 hover:opacity-100",onClick:h=>{h.preventDefault(),h.stopPropagation(),l(o.id)},"aria-label":"Dismiss",type:"button",children:s.jsx(Rc,{className:"h-3.5 w-3.5"})})]}),s.jsxs("div",{className:"mt-1 text-xs",children:[o.success?"Thành công":"Thất bại",!o.success&&o.errorType&&s.jsx("span",{className:"ml-1 inline-block rounded bg-black/15 px-1 py-0.5 align-text-bottom text-[10px]",children:o.errorType})]}),s.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:["in ",Ht(o.inputTokens)," · out ",Ht(o.outputTokens),(o.cacheReadTokens>0||o.cacheWriteTokens>0)&&s.jsxs(s.Fragment,{children:[" · cache ",o.cacheReadTokens>0&&s.jsxs("span",{children:["r",Ht(o.cacheReadTokens)]}),o.cacheReadTokens>0&&o.cacheWriteTokens>0&&"/",o.cacheWriteTokens>0&&s.jsxs("span",{children:["w",Ht(o.cacheWriteTokens)]})]})]}),s.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:[_l(o.totalLatencyMs),o.ttftMs!=null&&o.ttftMs>=0&&s.jsxs("span",{children:[" · TTFT ",_l(o.ttftMs)]})]})]},o.id)})}):null}const f_=5e3,h_=8,m_=3e3;let sc=null;function p_(){try{sc||(sc=new Audio("/notification.mp3")),sc.currentTime=0,sc.play().catch(()=>{})}catch{}}function g_(){const[a,l]=p.useState([]),o=p.useRef(null),i=p.useRef(new Map),u=p.useRef(Date.now());return p.useEffect(()=>{let h=!1;const m=i.current,g=()=>{if(h)return;const v=new EventSource(`/api/admin/requests/stream?since=${u.current}`);o.current=v,v.addEventListener("request",S=>{if(!h)try{const b=JSON.parse(S.data),x=new Date(b.createdAt).getTime();Number.isFinite(x)&&(u.current=Math.max(u.current,x)),l(R=>R.some(j=>j.id===b.id)?R:[b,...R].slice(0,h_));const w=setTimeout(()=>{l(R=>R.filter(j=>j.id!==b.id)),m.delete(b.id)},f_);m.set(b.id,w),p_()}catch{}}),v.onerror=()=>{v.close(),o.current=null,h||setTimeout(g,m_)}};return g(),()=>{var v;h=!0,(v=o.current)==null||v.close(),o.current=null;for(const S of m.values())clearTimeout(S);m.clear()}},[]),{items:a,dismiss:h=>{const m=i.current.get(h);m&&(clearTimeout(m),i.current.delete(h)),l(g=>g.filter(v=>v.id!==h))}}}function v_({children:a}){const{user:l,loading:o}=hh(),i=cn();return o?s.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):l?s.jsx(s.Fragment,{children:a}):s.jsx(Of,{to:"/login",state:{from:i},replace:!0})}function y_(){const{items:a,dismiss:l}=g_();return s.jsxs("div",{className:"flex h-screen bg-background text-foreground",children:[s.jsx(N2,{}),s.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[s.jsx(AN,{}),s.jsx("main",{className:"flex-1 overflow-auto p-6",children:s.jsxs(jx,{children:[s.jsx(an,{index:!0,element:s.jsx(cA,{})}),s.jsx(an,{path:"/providers",element:s.jsx(LM,{})}),s.jsx(an,{path:"/models",element:s.jsx($M,{})}),s.jsx(an,{path:"/combos",element:s.jsx(KM,{})}),s.jsx(an,{path:"/aliases",element:s.jsx(XM,{})}),s.jsx(an,{path:"/api-keys",element:s.jsx(QM,{})}),s.jsx(an,{path:"/requests",element:s.jsx(FM,{})}),s.jsx(an,{path:"/statistics",element:s.jsx(i_,{})}),s.jsx(an,{path:"/audit",element:s.jsx(c_,{})}),s.jsx(an,{path:"/settings/*",element:s.jsx(u_,{})})]})})]}),s.jsx(d_,{items:a,onDismiss:l})]})}function x_({children:a}){const[l,o]=p.useState(null),i=cn();return p.useEffect(()=>{we.get("/api/admin/setup/status").then(u=>o(u.setupComplete)).catch(()=>o(!0))},[]),l===null?s.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):!l&&i.pathname!=="/setup"?s.jsx(Of,{to:"/setup",replace:!0}):l&&i.pathname==="/setup"?s.jsx(Of,{to:"/",replace:!0}):s.jsx(s.Fragment,{children:a})}function b_(){return s.jsx(jC,{children:s.jsx(x_,{children:s.jsxs(jx,{children:[s.jsx(an,{path:"/setup",element:s.jsx(sA,{})}),s.jsx(an,{path:"/login",element:s.jsx(oA,{})}),s.jsx(an,{path:"/*",element:s.jsx(v_,{children:s.jsx(y_,{})})})]})})})}const S_=rA;var w_=Object.defineProperty,rn=(a,l)=>w_(a,"name",{value:l,configurable:!0}),[dm,eO]=un("Tooltip",[jo]),j_=jo(),C_="TooltipProvider",E_=700,ax="tooltip.open",[R_,T_]=dm(C_),N_=rn(a=>{const{__scopeTooltip:l,delayDuration:o=E_,skipDelayDuration:i=300,disableHoverableContent:u=!1,children:f}=a,h=p.useRef(!0),m=p.useRef(!1),g=p.useRef(0);return p.useEffect(()=>{const v=g.current;return()=>window.clearTimeout(v)},[]),s.jsx(R_,{scope:l,isOpenDelayedRef:h,delayDuration:o,onOpen:p.useCallback(()=>{i<=0||(window.clearTimeout(g.current),h.current=!1)},[i]),onClose:p.useCallback(()=>{i<=0||(window.clearTimeout(g.current),g.current=window.setTimeout(()=>h.current=!0,i))},[i]),isPointerInTransitRef:m,onPointerInTransitChange:p.useCallback(v=>{m.current=v},[]),disableHoverableContent:u,children:f})},"TooltipProvider"),A_="Tooltip",[tO,fm]=dm(A_),M_="TooltipPortal",[nO,__]=dm(M_,{forceMount:void 0}),Ts="TooltipContent",O_=p.forwardRef(rn(function(l,o){const i=__(Ts,l.__scopeTooltip),{forceMount:u=i.forceMount,side:f="top",...h}=l,m=fm(Ts,l.__scopeTooltip);return s.jsx(Wa,{present:u||m.open,children:m.disableHoverableContent?s.jsx(f1,{side:f,...h,ref:o}):s.jsx(D_,{side:f,...h,ref:o})})},"TooltipContent")),D_=p.forwardRef(rn(function(l,o){const i=fm(Ts,l.__scopeTooltip),u=T_(Ts,l.__scopeTooltip),f=p.useRef(null),h=Pe(o,f),[m,g]=p.useState(null),{trigger:v,onClose:S}=i,b=f.current,{onPointerInTransitChange:x}=u,w=p.useCallback(()=>{g(null),x(!1)},[x]),R=p.useCallback((j,C)=>{const N=j.currentTarget,T={x:j.clientX,y:j.clientY},A=h1(T,N.getBoundingClientRect()),_=m1(T,A),H=p1(C.getBoundingClientRect()),P=v1([..._,...H]);g(P),x(!0)},[x]);return p.useEffect(()=>()=>w(),[w]),p.useEffect(()=>{if(v&&b){const j=rn(N=>R(N,b),"handleTriggerLeave"),C=rn(N=>R(N,v),"handleContentLeave");return v.addEventListener("pointerleave",j),b.addEventListener("pointerleave",C),()=>{v.removeEventListener("pointerleave",j),b.removeEventListener("pointerleave",C)}}},[v,b,R,w]),p.useEffect(()=>{if(m){const j=rn(C=>{const N=C.target,T={x:C.clientX,y:C.clientY},A=(v==null?void 0:v.contains(N))||(b==null?void 0:b.contains(N)),_=!g1(T,m);A?w():_&&(w(),S())},"handleTrackPointerGrace");return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[v,b,m,S,w]),s.jsx(f1,{...l,ref:h})},"TooltipContentHoverable")),z_=Yx("TooltipContent"),f1=p.forwardRef(rn(function(l,o){const{__scopeTooltip:i,children:u,"aria-label":f,id:h,onEscapeKeyDown:m,onPointerDownOutside:g,...v}=l,S=fm(Ts,i),b=j_(i),{onClose:x}=S;p.useEffect(()=>(document.addEventListener(ax,x),()=>document.removeEventListener(ax,x)),[x]),p.useEffect(()=>{if(S.trigger){const R=rn(j=>{j.target instanceof Node&&j.target.contains(S.trigger)&&x()},"handleScroll");return window.addEventListener("scroll",R,{capture:!0}),()=>window.removeEventListener("scroll",R,{capture:!0})}},[S.trigger,x]);const{setContentId:w}=S;return Tt(()=>(w(h),()=>{w(void 0)}),[h,w]),s.jsx(Nc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:m,onPointerDownOutside:g,onFocusOutside:R=>R.preventDefault(),onDismiss:x,children:s.jsxs(Mh,{"data-state":S.stateAttribute,role:f?void 0:"tooltip",id:f?void 0:S.contentId,...b,...v,ref:o,style:{...v.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(z_,{children:u}),f?s.jsx(FA,{id:S.contentId,role:"tooltip",children:f}):null]})})},"TooltipContentImpl"));function h1(a,l){const o=Math.abs(l.top-a.y),i=Math.abs(l.bottom-a.y),u=Math.abs(l.right-a.x),f=Math.abs(l.left-a.x);switch(Math.min(o,i,u,f)){case f:return"left";case u:return"right";case o:return"top";case i:return"bottom";default:throw new Error("unreachable")}}rn(h1,"getExitSideFromRect");function m1(a,l,o=5){const i=[];switch(l){case"top":i.push({x:a.x-o,y:a.y+o},{x:a.x+o,y:a.y+o});break;case"bottom":i.push({x:a.x-o,y:a.y-o},{x:a.x+o,y:a.y-o});break;case"left":i.push({x:a.x+o,y:a.y-o},{x:a.x+o,y:a.y+o});break;case"right":i.push({x:a.x-o,y:a.y-o},{x:a.x-o,y:a.y+o});break}return i}rn(m1,"getPaddedExitPoints");function p1(a){const{top:l,right:o,bottom:i,left:u}=a;return[{x:u,y:l},{x:o,y:l},{x:o,y:i},{x:u,y:i}]}rn(p1,"getPointsFromRect");function g1(a,l){const{x:o,y:i}=a;let u=!1;for(let f=0,h=l.length-1;f<l.length;h=f++){const m=l[f],g=l[h],v=m.x,S=m.y,b=g.x,x=g.y;S>i!=x>i&&o<(b-v)*(i-S)/(x-S)+v&&(u=!u)}return u}rn(g1,"isPointInPolygon");function v1(a){const l=a.slice();return l.sort((o,i)=>o.x<i.x?-1:o.x>i.x?1:o.y<i.y?-1:o.y>i.y?1:0),y1(l)}rn(v1,"getHull");function y1(a){if(a.length<=1)return a.slice();const l=[];for(let i=0;i<a.length;i++){const u=a[i];for(;l.length>=2;){const f=l[l.length-1],h=l[l.length-2];if((f.x-h.x)*(u.y-h.y)>=(f.y-h.y)*(u.x-h.x))l.pop();else break}l.push(u)}l.pop();const o=[];for(let i=a.length-1;i>=0;i--){const u=a[i];for(;o.length>=2;){const f=o[o.length-1],h=o[o.length-2];if((f.x-h.x)*(u.y-h.y)>=(f.y-h.y)*(u.x-h.x))o.pop();else break}o.push(u)}return o.pop(),l.length===1&&o.length===1&&l[0].x===o[0].x&&l[0].y===o[0].y?l:l.concat(o)}rn(y1,"getHullPresorted");var k_=N_,x1=O_;const L_=k_,U_=p.forwardRef(({className:a,sideOffset:l=4,...o},i)=>s.jsx(x1,{ref:i,sideOffset:l,className:Ce("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95",a),...o}));U_.displayName=x1.displayName;qw.createRoot(document.getElementById("root")).render(s.jsx(ce.StrictMode,{children:s.jsx(U2,{defaultTheme:"dark",storageKey:"latedev-theme",children:s.jsxs(L_,{children:[s.jsx(uC,{children:s.jsx(b_,{})}),s.jsx(S_,{position:"top-right"})]})})}));