ldrouter 1.16.2 → 1.16.3
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.
- package/CHANGELOG.md +9 -38
- package/README.md +1 -23
- package/dist/server/app.js +1 -10
- package/dist/server/auth/middleware.js +1 -37
- package/dist/server/db/index.js +0 -5
- package/dist/server/db/migrate.js +5 -38
- package/dist/server/db/schema.js +3 -44
- package/dist/server/errors.js +11 -0
- package/dist/server/gateway/runner.js +64 -126
- package/dist/server/protocols/anthropic.js +5 -3
- package/dist/server/protocols/canonical.js +29 -8
- package/dist/server/providers/index.js +25 -8
- package/dist/server/routes/admin/auth.js +1 -4
- package/dist/server/routes/admin/combos.js +98 -48
- package/dist/server/routes/admin/models.js +34 -24
- package/dist/server/routes/admin/providers.js +20 -63
- package/dist/server/routes/admin/requests.js +0 -1
- package/dist/server/routes/admin.js +0 -12
- package/dist/server/routes/gateway/anthropic.js +3 -3
- package/dist/server/routes/gateway/openai.js +5 -5
- package/dist/server/routing/capabilities.js +73 -14
- package/dist/server/routing/combo.js +20 -39
- package/dist/server/routing/resolver.js +16 -11
- package/dist/server/upstream/client.js +55 -61
- package/dist/web/assets/index-C5h2WXK5.css +1 -0
- package/dist/web/assets/index-CRnoua24.js +335 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -5
- package/dist/server/db/repositories/codex-accounts.js +0 -187
- package/dist/server/providers/codex-autostart.js +0 -98
- package/dist/server/providers/codex-import.js +0 -156
- package/dist/server/providers/codex-oauth.js +0 -77
- package/dist/server/providers/codex-refresh.js +0 -165
- package/dist/server/providers/codex-usage.js +0 -192
- package/dist/server/providers/codex.js +0 -186
- package/dist/server/routes/admin/codex.js +0 -331
- package/dist/web/assets/index-Coy-u6h8.css +0 -1
- package/dist/web/assets/index-qDG5c6aL.js +0 -386
- package/migrations/0005_codex_accounts.sql +0 -105
- package/migrations/0006_codex_usage.sql +0 -9
|
@@ -1,386 +0,0 @@
|
|
|
1
|
-
var Oy=n=>{throw TypeError(n)};var _y=(n,a,l)=>a.has(n)||Oy("Cannot "+l);var on=(n,a,l)=>(_y(n,a,"read from private field"),l?l.call(n):a.get(n)),ky=(n,a,l)=>a.has(n)?Oy("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(n):a.set(n,l),lh=(n,a,l,o)=>(_y(n,a,"write to private field"),o?o.call(n,l):a.set(n,l),l);function t2(n,a){for(var l=0;l<a.length;l++){const o=a[l];if(typeof o!="string"&&!Array.isArray(o)){for(const c in o)if(c!=="default"&&!(c in n)){const u=Object.getOwnPropertyDescriptor(o,c);u&&Object.defineProperty(n,c,u.get?u:{enumerable:!0,get:()=>o[c]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const f of u.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&o(f)}).observe(document,{childList:!0,subtree:!0});function l(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function o(c){if(c.ep)return;c.ep=!0;const u=l(c);fetch(c.href,u)}})();function vm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var sh={exports:{}},Xo={};/**
|
|
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 zy;function n2(){if(zy)return Xo;zy=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function l(o,c,u){var f=null;if(u!==void 0&&(f=""+u),c.key!==void 0&&(f=""+c.key),"key"in c){u={};for(var p in c)p!=="key"&&(u[p]=c[p])}else u=c;return c=u.ref,{$$typeof:n,type:o,key:f,ref:c!==void 0?c:null,props:u}}return Xo.Fragment=a,Xo.jsx=l,Xo.jsxs=l,Xo}var Ly;function a2(){return Ly||(Ly=1,sh.exports=n2()),sh.exports}var s=a2(),oh={exports:{}},ke={};/**
|
|
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 r2(){if(Uy)return ke;Uy=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),b=Symbol.iterator;function w(z){return z===null||typeof z!="object"?null:(z=b&&z[b]||z["@@iterator"],typeof z=="function"?z:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function R(z,H,Z){this.props=z,this.context=H,this.refs=C,this.updater=Z||E}R.prototype.isReactComponent={},R.prototype.setState=function(z,H){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,H,"setState")},R.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function D(){}D.prototype=R.prototype;function A(z,H,Z){this.props=z,this.context=H,this.refs=C,this.updater=Z||E}var M=A.prototype=new D;M.constructor=A,j(M,R.prototype),M.isPureReactComponent=!0;var O=Array.isArray;function N(){}var _={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function V(z,H,Z){var re=Z.ref;return{$$typeof:n,type:z,key:H,ref:re!==void 0?re:null,props:Z}}function te(z,H){return V(z.type,H,z.props)}function q(z){return typeof z=="object"&&z!==null&&z.$$typeof===n}function G(z){var H={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(Z){return H[Z]})}var B=/\/+/g;function F(z,H){return typeof z=="object"&&z!==null&&z.key!=null?G(""+z.key):H.toString(36)}function ce(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(N,N):(z.status="pending",z.then(function(H){z.status==="pending"&&(z.status="fulfilled",z.value=H)},function(H){z.status==="pending"&&(z.status="rejected",z.reason=H)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function k(z,H,Z,re,he){var ye=typeof z;(ye==="undefined"||ye==="boolean")&&(z=null);var pe=!1;if(z===null)pe=!0;else switch(ye){case"bigint":case"string":case"number":pe=!0;break;case"object":switch(z.$$typeof){case n:case a:pe=!0;break;case x:return pe=z._init,k(pe(z._payload),H,Z,re,he)}}if(pe)return he=he(z),pe=re===""?"."+F(z,0):re,O(he)?(Z="",pe!=null&&(Z=pe.replace(B,"$&/")+"/"),k(he,H,Z,"",function(fe){return fe})):he!=null&&(q(he)&&(he=te(he,Z+(he.key==null||z&&z.key===he.key?"":(""+he.key).replace(B,"$&/")+"/")+pe)),H.push(he)),1;pe=0;var de=re===""?".":re+":";if(O(z))for(var ve=0;ve<z.length;ve++)re=z[ve],ye=de+F(re,ve),pe+=k(re,H,Z,ye,he);else if(ve=w(z),typeof ve=="function")for(z=ve.call(z),ve=0;!(re=z.next()).done;)re=re.value,ye=de+F(re,ve++),pe+=k(re,H,Z,ye,he);else if(ye==="object"){if(typeof z.then=="function")return k(ce(z),H,Z,re,he);throw H=String(z),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return pe}function $(z,H,Z){if(z==null)return z;var re=[],he=0;return k(z,re,"","",function(ye){return H.call(Z,ye,he++)}),re}function ee(z){if(z._status===-1){var H=z._result;H=H(),H.then(function(Z){(z._status===0||z._status===-1)&&(z._status=1,z._result=Z)},function(Z){(z._status===0||z._status===-1)&&(z._status=2,z._result=Z)}),z._status===-1&&(z._status=0,z._result=H)}if(z._status===1)return z._result.default;throw z._result}var I=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},W={map:$,forEach:function(z,H,Z){$(z,function(){H.apply(this,arguments)},Z)},count:function(z){var H=0;return $(z,function(){H++}),H},toArray:function(z){return $(z,function(H){return H})||[]},only:function(z){if(!q(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return ke.Activity=y,ke.Children=W,ke.Component=R,ke.Fragment=l,ke.Profiler=c,ke.PureComponent=A,ke.StrictMode=o,ke.Suspense=g,ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,ke.__COMPILER_RUNTIME={__proto__:null,c:function(z){return _.H.useMemoCache(z)}},ke.cache=function(z){return function(){return z.apply(null,arguments)}},ke.cacheSignal=function(){return null},ke.cloneElement=function(z,H,Z){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var re=j({},z.props),he=z.key;if(H!=null)for(ye in H.key!==void 0&&(he=""+H.key),H)!U.call(H,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&H.ref===void 0||(re[ye]=H[ye]);var ye=arguments.length-2;if(ye===1)re.children=Z;else if(1<ye){for(var pe=Array(ye),de=0;de<ye;de++)pe[de]=arguments[de+2];re.children=pe}return V(z.type,he,re)},ke.createContext=function(z){return z={$$typeof:f,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:u,_context:z},z},ke.createElement=function(z,H,Z){var re,he={},ye=null;if(H!=null)for(re in H.key!==void 0&&(ye=""+H.key),H)U.call(H,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(he[re]=H[re]);var pe=arguments.length-2;if(pe===1)he.children=Z;else if(1<pe){for(var de=Array(pe),ve=0;ve<pe;ve++)de[ve]=arguments[ve+2];he.children=de}if(z&&z.defaultProps)for(re in pe=z.defaultProps,pe)he[re]===void 0&&(he[re]=pe[re]);return V(z,ye,he)},ke.createRef=function(){return{current:null}},ke.forwardRef=function(z){return{$$typeof:p,render:z}},ke.isValidElement=q,ke.lazy=function(z){return{$$typeof:x,_payload:{_status:-1,_result:z},_init:ee}},ke.memo=function(z,H){return{$$typeof:v,type:z,compare:H===void 0?null:H}},ke.startTransition=function(z){var H=_.T,Z={};_.T=Z;try{var re=z(),he=_.S;he!==null&&he(Z,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(N,I)}catch(ye){I(ye)}finally{H!==null&&Z.types!==null&&(H.types=Z.types),_.T=H}},ke.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},ke.use=function(z){return _.H.use(z)},ke.useActionState=function(z,H,Z){return _.H.useActionState(z,H,Z)},ke.useCallback=function(z,H){return _.H.useCallback(z,H)},ke.useContext=function(z){return _.H.useContext(z)},ke.useDebugValue=function(){},ke.useDeferredValue=function(z,H){return _.H.useDeferredValue(z,H)},ke.useEffect=function(z,H){return _.H.useEffect(z,H)},ke.useEffectEvent=function(z){return _.H.useEffectEvent(z)},ke.useId=function(){return _.H.useId()},ke.useImperativeHandle=function(z,H,Z){return _.H.useImperativeHandle(z,H,Z)},ke.useInsertionEffect=function(z,H){return _.H.useInsertionEffect(z,H)},ke.useLayoutEffect=function(z,H){return _.H.useLayoutEffect(z,H)},ke.useMemo=function(z,H){return _.H.useMemo(z,H)},ke.useOptimistic=function(z,H){return _.H.useOptimistic(z,H)},ke.useReducer=function(z,H,Z){return _.H.useReducer(z,H,Z)},ke.useRef=function(z){return _.H.useRef(z)},ke.useState=function(z){return _.H.useState(z)},ke.useSyncExternalStore=function(z,H,Z){return _.H.useSyncExternalStore(z,H,Z)},ke.useTransition=function(){return _.H.useTransition()},ke.version="19.2.8",ke}var Iy;function xm(){return Iy||(Iy=1,oh.exports=r2()),oh.exports}var h=xm();const ie=vm(h),$s=t2({__proto__:null,default:ie},[h]);var ih={exports:{}},Fo={},ch={exports:{}},uh={};/**
|
|
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 By;function l2(){return By||(By=1,(function(n){function a(k,$){var ee=k.length;k.push($);e:for(;0<ee;){var I=ee-1>>>1,W=k[I];if(0<c(W,$))k[I]=$,k[ee]=W,ee=I;else break e}}function l(k){return k.length===0?null:k[0]}function o(k){if(k.length===0)return null;var $=k[0],ee=k.pop();if(ee!==$){k[0]=ee;e:for(var I=0,W=k.length,z=W>>>1;I<z;){var H=2*(I+1)-1,Z=k[H],re=H+1,he=k[re];if(0>c(Z,ee))re<W&&0>c(he,Z)?(k[I]=he,k[re]=ee,I=re):(k[I]=Z,k[H]=ee,I=H);else if(re<W&&0>c(he,ee))k[I]=he,k[re]=ee,I=re;else break e}}return $}function c(k,$){var ee=k.sortIndex-$.sortIndex;return ee!==0?ee:k.id-$.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var g=[],v=[],x=1,y=null,b=3,w=!1,E=!1,j=!1,C=!1,R=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function M(k){for(var $=l(v);$!==null;){if($.callback===null)o(v);else if($.startTime<=k)o(v),$.sortIndex=$.expirationTime,a(g,$);else break;$=l(v)}}function O(k){if(j=!1,M(k),!E)if(l(g)!==null)E=!0,N||(N=!0,G());else{var $=l(v);$!==null&&ce(O,$.startTime-k)}}var N=!1,_=-1,U=5,V=-1;function te(){return C?!0:!(n.unstable_now()-V<U)}function q(){if(C=!1,N){var k=n.unstable_now();V=k;var $=!0;try{e:{E=!1,j&&(j=!1,D(_),_=-1),w=!0;var ee=b;try{t:{for(M(k),y=l(g);y!==null&&!(y.expirationTime>k&&te());){var I=y.callback;if(typeof I=="function"){y.callback=null,b=y.priorityLevel;var W=I(y.expirationTime<=k);if(k=n.unstable_now(),typeof W=="function"){y.callback=W,M(k),$=!0;break t}y===l(g)&&o(g),M(k)}else o(g);y=l(g)}if(y!==null)$=!0;else{var z=l(v);z!==null&&ce(O,z.startTime-k),$=!1}}break e}finally{y=null,b=ee,w=!1}$=void 0}}finally{$?G():N=!1}}}var G;if(typeof A=="function")G=function(){A(q)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,F=B.port2;B.port1.onmessage=q,G=function(){F.postMessage(null)}}else G=function(){R(q,0)};function ce(k,$){_=R(function(){k(n.unstable_now())},$)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(k){k.callback=null},n.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<k?Math.floor(1e3/k):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(k){switch(b){case 1:case 2:case 3:var $=3;break;default:$=b}var ee=b;b=$;try{return k()}finally{b=ee}},n.unstable_requestPaint=function(){C=!0},n.unstable_runWithPriority=function(k,$){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var ee=b;b=k;try{return $()}finally{b=ee}},n.unstable_scheduleCallback=function(k,$,ee){var I=n.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?I+ee:I):ee=I,k){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=ee+W,k={id:x++,callback:$,priorityLevel:k,startTime:ee,expirationTime:W,sortIndex:-1},ee>I?(k.sortIndex=ee,a(v,k),l(g)===null&&k===l(v)&&(j?(D(_),_=-1):j=!0,ce(O,ee-I))):(k.sortIndex=W,a(g,k),E||w||(E=!0,N||(N=!0,G()))),k},n.unstable_shouldYield=te,n.unstable_wrapCallback=function(k){var $=b;return function(){var ee=b;b=$;try{return k.apply(this,arguments)}finally{b=ee}}}})(uh)),uh}var Py;function s2(){return Py||(Py=1,ch.exports=l2()),ch.exports}var dh={exports:{}},cn={};/**
|
|
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 Hy;function o2(){if(Hy)return cn;Hy=1;var n=xm();function a(g){var v="https://react.dev/errors/"+g;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)v+="&args[]="+encodeURIComponent(arguments[x])}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 l(){}var o={d:{f:l,r:function(){throw Error(a(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},c=Symbol.for("react.portal");function u(g,v,x){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:y==null?null:""+y,children:g,containerInfo:v,implementation:x}}var f=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,v){if(g==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return cn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,cn.createPortal=function(g,v){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(a(299));return u(g,v,null,x)},cn.flushSync=function(g){var v=f.T,x=o.p;try{if(f.T=null,o.p=2,g)return g()}finally{f.T=v,o.p=x,o.d.f()}},cn.preconnect=function(g,v){typeof g=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,o.d.C(g,v))},cn.prefetchDNS=function(g){typeof g=="string"&&o.d.D(g)},cn.preinit=function(g,v){if(typeof g=="string"&&v&&typeof v.as=="string"){var x=v.as,y=p(x,v.crossOrigin),b=typeof v.integrity=="string"?v.integrity:void 0,w=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;x==="style"?o.d.S(g,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:w}):x==="script"&&o.d.X(g,{crossOrigin:y,integrity:b,fetchPriority:w,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},cn.preinitModule=function(g,v){if(typeof g=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var x=p(v.as,v.crossOrigin);o.d.M(g,{crossOrigin:x,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&o.d.M(g)},cn.preload=function(g,v){if(typeof g=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var x=v.as,y=p(x,v.crossOrigin);o.d.L(g,x,{crossOrigin:y,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})}},cn.preloadModule=function(g,v){if(typeof g=="string")if(v){var x=p(v.as,v.crossOrigin);o.d.m(g,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:x,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else o.d.m(g)},cn.requestFormReset=function(g){o.d.r(g)},cn.unstable_batchedUpdates=function(g,v){return g(v)},cn.useFormState=function(g,v,x){return f.H.useFormState(g,v,x)},cn.useFormStatus=function(){return f.H.useHostTransitionStatus()},cn.version="19.2.8",cn}var qy;function Qb(){if(qy)return dh.exports;qy=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),dh.exports=o2(),dh.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 $y;function i2(){if($y)return Fo;$y=1;var n=s2(),a=xm(),l=Qb();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function u(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function f(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 p(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(u(e)!==e)throw Error(o(188))}function v(e){var t=e.alternate;if(!t){if(t=u(e),t===null)throw Error(o(188));return t!==e?null:e}for(var r=e,i=t;;){var d=r.return;if(d===null)break;var m=d.alternate;if(m===null){if(i=d.return,i!==null){r=i;continue}break}if(d.child===m.child){for(m=d.child;m;){if(m===r)return g(d),e;if(m===i)return g(d),t;m=m.sibling}throw Error(o(188))}if(r.return!==i.return)r=d,i=m;else{for(var S=!1,T=d.child;T;){if(T===r){S=!0,r=d,i=m;break}if(T===i){S=!0,i=d,r=m;break}T=T.sibling}if(!S){for(T=m.child;T;){if(T===r){S=!0,r=m,i=d;break}if(T===i){S=!0,i=m,r=d;break}T=T.sibling}if(!S)throw Error(o(189))}}if(r.alternate!==i)throw Error(o(190))}if(r.tag!==3)throw Error(o(188));return r.stateNode.current===r?e:t}function x(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=x(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),A=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),te=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 B=Symbol.for("react.client.reference");function F(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===B?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case R:return"Profiler";case C:return"StrictMode";case O:return"Suspense";case N:return"SuspenseList";case V:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case A:return e.displayName||"Context";case D:return(e._context.displayName||"Context")+".Consumer";case M:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _:return t=e.displayName||null,t!==null?t:F(e.type)||"Memo";case U:t=e._payload,e=e._init;try{return F(e(t))}catch{}}return null}var ce=Array.isArray,k=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},I=[],W=-1;function z(e){return{current:e}}function H(e){0>W||(e.current=I[W],I[W]=null,W--)}function Z(e,t){W++,I[W]=e.current,e.current=t}var re=z(null),he=z(null),ye=z(null),pe=z(null);function de(e,t){switch(Z(ye,t),Z(he,e),Z(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ty(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ty(t),e=ny(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(re),Z(re,e)}function ve(){H(re),H(he),H(ye)}function fe(e){e.memoizedState!==null&&Z(pe,e);var t=re.current,r=ny(t,e.type);t!==r&&(Z(he,e),Z(re,r))}function De(e){he.current===e&&(H(re),H(he)),pe.current===e&&(H(pe),Vo._currentValue=ee)}var Ne,_e;function Fe(e){if(Ne===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Ne=t&&t[1]||"",_e=-1<r.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Ne+e+_e}var We=!1;function se(e,t){if(!e||We)return"";We=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(J){var Q=J}Reflect.construct(e,[],le)}else{try{le.call()}catch(J){Q=J}e.call(le.prototype)}}else{try{throw Error()}catch(J){Q=J}(le=e())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(J){if(J&&Q&&typeof J.stack=="string")return[J.stack,Q.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=i.DetermineComponentFrameRoot(),S=m[0],T=m[1];if(S&&T){var L=S.split(`
|
|
44
|
-
`),X=T.split(`
|
|
45
|
-
`);for(d=i=0;i<L.length&&!L[i].includes("DetermineComponentFrameRoot");)i++;for(;d<X.length&&!X[d].includes("DetermineComponentFrameRoot");)d++;if(i===L.length||d===X.length)for(i=L.length-1,d=X.length-1;1<=i&&0<=d&&L[i]!==X[d];)d--;for(;1<=i&&0<=d;i--,d--)if(L[i]!==X[d]){if(i!==1||d!==1)do if(i--,d--,0>d||L[i]!==X[d]){var ne=`
|
|
46
|
-
`+L[i].replace(" at new "," at ");return e.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",e.displayName)),ne}while(1<=i&&0<=d);break}}}finally{We=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?Fe(r):""}function Oe(e,t){switch(e.tag){case 26:case 27:case 5:return Fe(e.type);case 16:return Fe("Lazy");case 13:return e.child!==t&&t!==null?Fe("Suspense Fallback"):Fe("Suspense");case 19:return Fe("SuspenseList");case 0:case 15:return se(e.type,!1);case 11:return se(e.type.render,!1);case 1:return se(e.type,!0);case 31:return Fe("Activity");default:return""}}function Qe(e){try{var t="",r=null;do t+=Oe(e,r),r=e,e=e.return;while(e);return t}catch(i){return`
|
|
47
|
-
Error generating stack: `+i.message+`
|
|
48
|
-
`+i.stack}}var xt=Object.prototype.hasOwnProperty,Rt=n.unstable_scheduleCallback,Gt=n.unstable_cancelCallback,xn=n.unstable_shouldYield,Zn=n.unstable_requestPaint,Kt=n.unstable_now,no=n.unstable_getCurrentPriorityLevel,Wt=n.unstable_ImmediatePriority,sn=n.unstable_UserBlockingPriority,zn=n.unstable_NormalPriority,$a=n.unstable_LowPriority,Ra=n.unstable_IdlePriority,Jn=n.log,ul=n.unstable_setDisableYieldValue,ma=null,At=null;function mn(e){if(typeof Jn=="function"&&ul(e),At&&typeof At.setStrictMode=="function")try{At.setStrictMode(ma,e)}catch{}}var Tt=Math.clz32?Math.clz32:Vl,ao=Math.log,$l=Math.LN2;function Vl(e){return e>>>=0,e===0?32:31-(ao(e)/$l|0)|0}var Va=256,Nr=262144,yt=4194304;function at(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 zt(e,t,r){var i=e.pendingLanes;if(i===0)return 0;var d=0,m=e.suspendedLanes,S=e.pingedLanes;e=e.warmLanes;var T=i&134217727;return T!==0?(i=T&~m,i!==0?d=at(i):(S&=T,S!==0?d=at(S):r||(r=T&~e,r!==0&&(d=at(r))))):(T=i&~m,T!==0?d=at(T):S!==0?d=at(S):r||(r=i&~e,r!==0&&(d=at(r)))),d===0?0:t!==0&&t!==d&&(t&m)===0&&(m=d&-d,r=t&-t,m>=r||m===32&&(r&4194048)!==0)?t:d}function Ce(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ze(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 Ue(){var e=yt;return yt<<=1,(yt&62914560)===0&&(yt=4194304),e}function vt(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ct(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ut(e,t,r,i,d,m){var S=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var T=e.entanglements,L=e.expirationTimes,X=e.hiddenUpdates;for(r=S&~r;0<r;){var ne=31-Tt(r),le=1<<ne;T[ne]=0,L[ne]=-1;var Q=X[ne];if(Q!==null)for(X[ne]=null,ne=0;ne<Q.length;ne++){var J=Q[ne];J!==null&&(J.lane&=-536870913)}r&=~le}i!==0&&Ht(e,i,0),m!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=m&~(S&~t))}function Ht(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-Tt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|r&261930}function bt(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-Tt(r),d=1<<i;d&t|e[i]&t&&(e[i]|=t),r&=~d}}function Ot(e,t){var r=t&-t;return r=(r&42)!==0?1:Ya(r),(r&(e.suspendedLanes|t))!==0?0:r}function Ya(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 Ga(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function pa(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:Ey(e.type))}function Rr(e,t){var r=$.p;try{return $.p=e,t()}finally{$.p=r}}var Wn=Math.random().toString(36).slice(2),en="__reactFiber$"+Wn,yn="__reactProps$"+Wn,Yl="__reactContainer$"+Wn,Fu="__reactEvents$"+Wn,VS="__reactListeners$"+Wn,YS="__reactHandles$"+Wn,qp="__reactResources$"+Wn,ro="__reactMarker$"+Wn;function Qu(e){delete e[en],delete e[yn],delete e[Fu],delete e[VS],delete e[YS]}function Gl(e){var t=e[en];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Yl]||r[en]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=cy(e);e!==null;){if(r=e[en])return r;e=cy(e)}return t}e=r,r=e.parentNode}return null}function Kl(e){if(e=e[en]||e[Yl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function lo(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function Xl(e){var t=e[qp];return t||(t=e[qp]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Xt(e){e[ro]=!0}var $p=new Set,Vp={};function dl(e,t){Fl(e,t),Fl(e+"Capture",t)}function Fl(e,t){for(Vp[e]=t,e=0;e<t.length;e++)$p.add(t[e])}var GS=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]*$"),Yp={},Gp={};function KS(e){return xt.call(Gp,e)?!0:xt.call(Yp,e)?!1:GS.test(e)?Gp[e]=!0:(Yp[e]=!0,!1)}function Ei(e,t,r){if(KS(t))if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+r)}}function Ni(e,t,r){if(r===null)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+r)}}function Ka(e,t,r,i){if(i===null)e.removeAttribute(r);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(t,r,""+i)}}function ea(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Kp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function XS(e,t,r){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var d=i.get,m=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return d.call(this)},set:function(S){r=""+S,m.call(this,S)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return r},setValue:function(S){r=""+S},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Zu(e){if(!e._valueTracker){var t=Kp(e)?"checked":"value";e._valueTracker=XS(e,t,""+e[t])}}function Xp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=Kp(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function Ri(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 FS=/[\n"\\]/g;function ta(e){return e.replace(FS,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ju(e,t,r,i,d,m,S,T){e.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.type=S:e.removeAttribute("type"),t!=null?S==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ea(t)):e.value!==""+ea(t)&&(e.value=""+ea(t)):S!=="submit"&&S!=="reset"||e.removeAttribute("value"),t!=null?Wu(e,S,ea(t)):r!=null?Wu(e,S,ea(r)):i!=null&&e.removeAttribute("value"),d==null&&m!=null&&(e.defaultChecked=!!m),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?e.name=""+ea(T):e.removeAttribute("name")}function Fp(e,t,r,i,d,m,S,T){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.type=m),t!=null||r!=null){if(!(m!=="submit"&&m!=="reset"||t!=null)){Zu(e);return}r=r!=null?""+ea(r):"",t=t!=null?""+ea(t):r,T||t===e.value||(e.value=t),e.defaultValue=t}i=i??d,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=T?e.checked:!!i,e.defaultChecked=!!i,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(e.name=S),Zu(e)}function Wu(e,t,r){t==="number"&&Ri(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function Ql(e,t,r,i){if(e=e.options,t){t={};for(var d=0;d<r.length;d++)t["$"+r[d]]=!0;for(r=0;r<e.length;r++)d=t.hasOwnProperty("$"+e[r].value),e[r].selected!==d&&(e[r].selected=d),d&&i&&(e[r].defaultSelected=!0)}else{for(r=""+ea(r),t=null,d=0;d<e.length;d++){if(e[d].value===r){e[d].selected=!0,i&&(e[d].defaultSelected=!0);return}t!==null||e[d].disabled||(t=e[d])}t!==null&&(t.selected=!0)}}function Qp(e,t,r){if(t!=null&&(t=""+ea(t),t!==e.value&&(e.value=t),r==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=r!=null?""+ea(r):""}function Zp(e,t,r,i){if(t==null){if(i!=null){if(r!=null)throw Error(o(92));if(ce(i)){if(1<i.length)throw Error(o(93));i=i[0]}r=i}r==null&&(r=""),t=r}r=ea(t),e.defaultValue=r,i=e.textContent,i===r&&i!==""&&i!==null&&(e.value=i),Zu(e)}function Zl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var QS=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 Jp(e,t,r){var i=t.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,r):typeof r!="number"||r===0||QS.has(t)?t==="float"?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}function Wp(e,t,r){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,r!=null){for(var i in r)!r.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var d in t)i=t[d],t.hasOwnProperty(d)&&r[d]!==i&&Jp(e,d,i)}else for(var m in t)t.hasOwnProperty(m)&&Jp(e,m,t[m])}function ed(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 ZS=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"]]),JS=/^[\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 Ti(e){return JS.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Xa(){}var td=null;function nd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Jl=null,Wl=null;function eg(e){var t=Kl(e);if(t&&(e=t.stateNode)){var r=e[yn]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ju(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+ta(""+t)+'"][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var d=i[yn]||null;if(!d)throw Error(o(90));Ju(i,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(t=0;t<r.length;t++)i=r[t],i.form===e.form&&Xp(i)}break e;case"textarea":Qp(e,r.value,r.defaultValue);break e;case"select":t=r.value,t!=null&&Ql(e,!!r.multiple,t,!1)}}}var ad=!1;function tg(e,t,r){if(ad)return e(t,r);ad=!0;try{var i=e(t);return i}finally{if(ad=!1,(Jl!==null||Wl!==null)&&(pc(),Jl&&(t=Jl,e=Wl,Wl=Jl=null,eg(t),e)))for(t=0;t<e.length;t++)eg(e[t])}}function so(e,t){var r=e.stateNode;if(r===null)return null;var i=r[yn]||null;if(i===null)return null;r=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(o(231,t,typeof r));return r}var Fa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rd=!1;if(Fa)try{var oo={};Object.defineProperty(oo,"passive",{get:function(){rd=!0}}),window.addEventListener("test",oo,oo),window.removeEventListener("test",oo,oo)}catch{rd=!1}var Tr=null,ld=null,Ai=null;function ng(){if(Ai)return Ai;var e,t=ld,r=t.length,i,d="value"in Tr?Tr.value:Tr.textContent,m=d.length;for(e=0;e<r&&t[e]===d[e];e++);var S=r-e;for(i=1;i<=S&&t[r-i]===d[m-i];i++);return Ai=d.slice(e,1<i?1-i:void 0)}function Mi(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 Di(){return!0}function ag(){return!1}function bn(e){function t(r,i,d,m,S){this._reactName=r,this._targetInst=d,this.type=i,this.nativeEvent=m,this.target=S,this.currentTarget=null;for(var T in e)e.hasOwnProperty(T)&&(r=e[T],this[T]=r?r(m):m[T]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Di:ag,this.isPropagationStopped=ag,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Di)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Di)},persist:function(){},isPersistent:Di}),t}var fl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Oi=bn(fl),io=y({},fl,{view:0,detail:0}),WS=bn(io),sd,od,co,_i=y({},io,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cd,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!==co&&(co&&e.type==="mousemove"?(sd=e.screenX-co.screenX,od=e.screenY-co.screenY):od=sd=0,co=e),sd)},movementY:function(e){return"movementY"in e?e.movementY:od}}),rg=bn(_i),ej=y({},_i,{dataTransfer:0}),tj=bn(ej),nj=y({},io,{relatedTarget:0}),id=bn(nj),aj=y({},fl,{animationName:0,elapsedTime:0,pseudoElement:0}),rj=bn(aj),lj=y({},fl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),sj=bn(lj),oj=y({},fl,{data:0}),lg=bn(oj),ij={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cj={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"},uj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dj(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=uj[e])?!!t[e]:!1}function cd(){return dj}var fj=y({},io,{key:function(e){if(e.key){var t=ij[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Mi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cj[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cd,charCode:function(e){return e.type==="keypress"?Mi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Mi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),hj=bn(fj),mj=y({},_i,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sg=bn(mj),pj=y({},io,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cd}),gj=bn(pj),vj=y({},fl,{propertyName:0,elapsedTime:0,pseudoElement:0}),xj=bn(vj),yj=y({},_i,{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}),bj=bn(yj),wj=y({},fl,{newState:0,oldState:0}),Sj=bn(wj),jj=[9,13,27,32],ud=Fa&&"CompositionEvent"in window,uo=null;Fa&&"documentMode"in document&&(uo=document.documentMode);var Cj=Fa&&"TextEvent"in window&&!uo,og=Fa&&(!ud||uo&&8<uo&&11>=uo),ig=" ",cg=!1;function ug(e,t){switch(e){case"keyup":return jj.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var es=!1;function Ej(e,t){switch(e){case"compositionend":return dg(t);case"keypress":return t.which!==32?null:(cg=!0,ig);case"textInput":return e=t.data,e===ig&&cg?null:e;default:return null}}function Nj(e,t){if(es)return e==="compositionend"||!ud&&ug(e,t)?(e=ng(),Ai=ld=Tr=null,es=!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 og&&t.locale!=="ko"?null:t.data;default:return null}}var Rj={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 fg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Rj[e.type]:t==="textarea"}function hg(e,t,r,i){Jl?Wl?Wl.push(i):Wl=[i]:Jl=i,t=Sc(t,"onChange"),0<t.length&&(r=new Oi("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var fo=null,ho=null;function Tj(e){Fx(e,0)}function ki(e){var t=lo(e);if(Xp(t))return e}function mg(e,t){if(e==="change")return t}var pg=!1;if(Fa){var dd;if(Fa){var fd="oninput"in document;if(!fd){var gg=document.createElement("div");gg.setAttribute("oninput","return;"),fd=typeof gg.oninput=="function"}dd=fd}else dd=!1;pg=dd&&(!document.documentMode||9<document.documentMode)}function vg(){fo&&(fo.detachEvent("onpropertychange",xg),ho=fo=null)}function xg(e){if(e.propertyName==="value"&&ki(ho)){var t=[];hg(t,ho,e,nd(e)),tg(Tj,t)}}function Aj(e,t,r){e==="focusin"?(vg(),fo=t,ho=r,fo.attachEvent("onpropertychange",xg)):e==="focusout"&&vg()}function Mj(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ki(ho)}function Dj(e,t){if(e==="click")return ki(t)}function Oj(e,t){if(e==="input"||e==="change")return ki(t)}function _j(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ln=typeof Object.is=="function"?Object.is:_j;function mo(e,t){if(Ln(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var d=r[i];if(!xt.call(t,d)||!Ln(e[d],t[d]))return!1}return!0}function yg(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function bg(e,t){var r=yg(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=yg(r)}}function wg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sg(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ri(e.document);t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Ri(e.document)}return t}function hd(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 kj=Fa&&"documentMode"in document&&11>=document.documentMode,ts=null,md=null,po=null,pd=!1;function jg(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;pd||ts==null||ts!==Ri(i)||(i=ts,"selectionStart"in i&&hd(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),po&&mo(po,i)||(po=i,i=Sc(md,"onSelect"),0<i.length&&(t=new Oi("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=ts)))}function hl(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var ns={animationend:hl("Animation","AnimationEnd"),animationiteration:hl("Animation","AnimationIteration"),animationstart:hl("Animation","AnimationStart"),transitionrun:hl("Transition","TransitionRun"),transitionstart:hl("Transition","TransitionStart"),transitioncancel:hl("Transition","TransitionCancel"),transitionend:hl("Transition","TransitionEnd")},gd={},Cg={};Fa&&(Cg=document.createElement("div").style,"AnimationEvent"in window||(delete ns.animationend.animation,delete ns.animationiteration.animation,delete ns.animationstart.animation),"TransitionEvent"in window||delete ns.transitionend.transition);function ml(e){if(gd[e])return gd[e];if(!ns[e])return e;var t=ns[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Cg)return gd[e]=t[r];return e}var Eg=ml("animationend"),Ng=ml("animationiteration"),Rg=ml("animationstart"),zj=ml("transitionrun"),Lj=ml("transitionstart"),Uj=ml("transitioncancel"),Tg=ml("transitionend"),Ag=new Map,vd="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(" ");vd.push("scrollEnd");function ga(e,t){Ag.set(e,t),dl(t,[e])}var zi=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)},na=[],as=0,xd=0;function Li(){for(var e=as,t=xd=as=0;t<e;){var r=na[t];na[t++]=null;var i=na[t];na[t++]=null;var d=na[t];na[t++]=null;var m=na[t];if(na[t++]=null,i!==null&&d!==null){var S=i.pending;S===null?d.next=d:(d.next=S.next,S.next=d),i.pending=d}m!==0&&Mg(r,d,m)}}function Ui(e,t,r,i){na[as++]=e,na[as++]=t,na[as++]=r,na[as++]=i,xd|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function yd(e,t,r,i){return Ui(e,t,r,i),Ii(e)}function pl(e,t){return Ui(e,null,null,t),Ii(e)}function Mg(e,t,r){e.lanes|=r;var i=e.alternate;i!==null&&(i.lanes|=r);for(var d=!1,m=e.return;m!==null;)m.childLanes|=r,i=m.alternate,i!==null&&(i.childLanes|=r),m.tag===22&&(e=m.stateNode,e===null||e._visibility&1||(d=!0)),e=m,m=m.return;return e.tag===3?(m=e.stateNode,d&&t!==null&&(d=31-Tt(r),e=m.hiddenUpdates,i=e[d],i===null?e[d]=[t]:i.push(t),t.lane=r|536870912),m):null}function Ii(e){if(50<Uo)throw Uo=0,Af=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var rs={};function Ij(e,t,r,i){this.tag=e,this.key=r,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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Un(e,t,r,i){return new Ij(e,t,r,i)}function bd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Qa(e,t){var r=e.alternate;return r===null?(r=Un(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function Dg(e,t){e.flags&=65011714;var r=e.alternate;return r===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=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,t=r.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Bi(e,t,r,i,d,m){var S=0;if(i=e,typeof e=="function")bd(e)&&(S=1);else if(typeof e=="string")S=$C(e,r,re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case V:return e=Un(31,r,t,d),e.elementType=V,e.lanes=m,e;case j:return gl(r.children,d,m,t);case C:S=8,d|=24;break;case R:return e=Un(12,r,t,d|2),e.elementType=R,e.lanes=m,e;case O:return e=Un(13,r,t,d),e.elementType=O,e.lanes=m,e;case N:return e=Un(19,r,t,d),e.elementType=N,e.lanes=m,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case A:S=10;break e;case D:S=9;break e;case M:S=11;break e;case _:S=14;break e;case U:S=16,i=null;break e}S=29,r=Error(o(130,e===null?"null":typeof e,"")),i=null}return t=Un(S,r,t,d),t.elementType=e,t.type=i,t.lanes=m,t}function gl(e,t,r,i){return e=Un(7,e,i,t),e.lanes=r,e}function wd(e,t,r){return e=Un(6,e,null,t),e.lanes=r,e}function Og(e){var t=Un(18,null,null,0);return t.stateNode=e,t}function Sd(e,t,r){return t=Un(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var _g=new WeakMap;function aa(e,t){if(typeof e=="object"&&e!==null){var r=_g.get(e);return r!==void 0?r:(t={value:e,source:t,stack:Qe(t)},_g.set(e,t),t)}return{value:e,source:t,stack:Qe(t)}}var ls=[],ss=0,Pi=null,go=0,ra=[],la=0,Ar=null,Ta=1,Aa="";function Za(e,t){ls[ss++]=go,ls[ss++]=Pi,Pi=e,go=t}function kg(e,t,r){ra[la++]=Ta,ra[la++]=Aa,ra[la++]=Ar,Ar=e;var i=Ta;e=Aa;var d=32-Tt(i)-1;i&=~(1<<d),r+=1;var m=32-Tt(t)+d;if(30<m){var S=d-d%5;m=(i&(1<<S)-1).toString(32),i>>=S,d-=S,Ta=1<<32-Tt(t)+d|r<<d|i,Aa=m+e}else Ta=1<<m|r<<d|i,Aa=e}function jd(e){e.return!==null&&(Za(e,1),kg(e,1,0))}function Cd(e){for(;e===Pi;)Pi=ls[--ss],ls[ss]=null,go=ls[--ss],ls[ss]=null;for(;e===Ar;)Ar=ra[--la],ra[la]=null,Aa=ra[--la],ra[la]=null,Ta=ra[--la],ra[la]=null}function zg(e,t){ra[la++]=Ta,ra[la++]=Aa,ra[la++]=Ar,Ta=t.id,Aa=t.overflow,Ar=e}var tn=null,wt=null,Ge=!1,Mr=null,sa=!1,Ed=Error(o(519));function Dr(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw vo(aa(t,e)),Ed}function Lg(e){var t=e.stateNode,r=e.type,i=e.memoizedProps;switch(t[en]=e,t[yn]=i,r){case"dialog":qe("cancel",t),qe("close",t);break;case"iframe":case"object":case"embed":qe("load",t);break;case"video":case"audio":for(r=0;r<Bo.length;r++)qe(Bo[r],t);break;case"source":qe("error",t);break;case"img":case"image":case"link":qe("error",t),qe("load",t);break;case"details":qe("toggle",t);break;case"input":qe("invalid",t),Fp(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":qe("invalid",t);break;case"textarea":qe("invalid",t),Zp(t,i.value,i.defaultValue,i.children)}r=i.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||t.textContent===""+r||i.suppressHydrationWarning===!0||Wx(t.textContent,r)?(i.popover!=null&&(qe("beforetoggle",t),qe("toggle",t)),i.onScroll!=null&&qe("scroll",t),i.onScrollEnd!=null&&qe("scrollend",t),i.onClick!=null&&(t.onclick=Xa),t=!0):t=!1,t||Dr(e,!0)}function Ug(e){for(tn=e.return;tn;)switch(tn.tag){case 5:case 31:case 13:sa=!1;return;case 27:case 3:sa=!0;return;default:tn=tn.return}}function os(e){if(e!==tn)return!1;if(!Ge)return Ug(e),Ge=!0,!1;var t=e.tag,r;if((r=t!==3&&t!==27)&&((r=t===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Vf(e.type,e.memoizedProps)),r=!r),r&&wt&&Dr(e),Ug(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));wt=iy(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));wt=iy(e)}else t===27?(t=wt,Yr(e.type)?(e=Ff,Ff=null,wt=e):wt=t):wt=tn?ia(e.stateNode.nextSibling):null;return!0}function vl(){wt=tn=null,Ge=!1}function Nd(){var e=Mr;return e!==null&&(Cn===null?Cn=e:Cn.push.apply(Cn,e),Mr=null),e}function vo(e){Mr===null?Mr=[e]:Mr.push(e)}var Rd=z(null),xl=null,Ja=null;function Or(e,t,r){Z(Rd,t._currentValue),t._currentValue=r}function Wa(e){e._currentValue=Rd.current,H(Rd)}function Td(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function Ad(e,t,r,i){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var m=d.dependencies;if(m!==null){var S=d.child;m=m.firstContext;e:for(;m!==null;){var T=m;m=d;for(var L=0;L<t.length;L++)if(T.context===t[L]){m.lanes|=r,T=m.alternate,T!==null&&(T.lanes|=r),Td(m.return,r,e),i||(S=null);break e}m=T.next}}else if(d.tag===18){if(S=d.return,S===null)throw Error(o(341));S.lanes|=r,m=S.alternate,m!==null&&(m.lanes|=r),Td(S,r,e),S=null}else S=d.child;if(S!==null)S.return=d;else for(S=d;S!==null;){if(S===e){S=null;break}if(d=S.sibling,d!==null){d.return=S.return,S=d;break}S=S.return}d=S}}function is(e,t,r,i){e=null;for(var d=t,m=!1;d!==null;){if(!m){if((d.flags&524288)!==0)m=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var S=d.alternate;if(S===null)throw Error(o(387));if(S=S.memoizedProps,S!==null){var T=d.type;Ln(d.pendingProps.value,S.value)||(e!==null?e.push(T):e=[T])}}else if(d===pe.current){if(S=d.alternate,S===null)throw Error(o(387));S.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Vo):e=[Vo])}d=d.return}e!==null&&Ad(t,e,r,i),t.flags|=262144}function Hi(e){for(e=e.firstContext;e!==null;){if(!Ln(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function yl(e){xl=e,Ja=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function nn(e){return Ig(xl,e)}function qi(e,t){return xl===null&&yl(e),Ig(e,t)}function Ig(e,t){var r=t._currentValue;if(t={context:t,memoizedValue:r,next:null},Ja===null){if(e===null)throw Error(o(308));Ja=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ja=Ja.next=t;return r}var Bj=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(r,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(r){return r()})}},Pj=n.unstable_scheduleCallback,Hj=n.unstable_NormalPriority,Lt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Md(){return{controller:new Bj,data:new Map,refCount:0}}function xo(e){e.refCount--,e.refCount===0&&Pj(Hj,function(){e.controller.abort()})}var yo=null,Dd=0,cs=0,us=null;function qj(e,t){if(yo===null){var r=yo=[];Dd=0,cs=zf(),us={status:"pending",value:void 0,then:function(i){r.push(i)}}}return Dd++,t.then(Bg,Bg),t}function Bg(){if(--Dd===0&&yo!==null){us!==null&&(us.status="fulfilled");var e=yo;yo=null,cs=0,us=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function $j(e,t){var r=[],i={status:"pending",value:null,reason:null,then:function(d){r.push(d)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var d=0;d<r.length;d++)(0,r[d])(t)},function(d){for(i.status="rejected",i.reason=d,d=0;d<r.length;d++)(0,r[d])(void 0)}),i}var Pg=k.S;k.S=function(e,t){jx=Kt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&qj(e,t),Pg!==null&&Pg(e,t)};var bl=z(null);function Od(){var e=bl.current;return e!==null?e:pt.pooledCache}function $i(e,t){t===null?Z(bl,bl.current):Z(bl,t.pool)}function Hg(){var e=Od();return e===null?null:{parent:Lt._currentValue,pool:e}}var ds=Error(o(460)),_d=Error(o(474)),Vi=Error(o(542)),Yi={then:function(){}};function qg(e){return e=e.status,e==="fulfilled"||e==="rejected"}function $g(e,t,r){switch(r=e[r],r===void 0?e.push(t):r!==t&&(t.then(Xa,Xa),t=r),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Yg(e),e;default:if(typeof t.status=="string")t.then(Xa,Xa);else{if(e=pt,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var d=t;d.status="fulfilled",d.value=i}},function(i){if(t.status==="pending"){var d=t;d.status="rejected",d.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Yg(e),e}throw Sl=t,ds}}function wl(e){try{var t=e._init;return t(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(Sl=r,ds):r}}var Sl=null;function Vg(){if(Sl===null)throw Error(o(459));var e=Sl;return Sl=null,e}function Yg(e){if(e===ds||e===Vi)throw Error(o(483))}var fs=null,bo=0;function Gi(e){var t=bo;return bo+=1,fs===null&&(fs=[]),$g(fs,e,t)}function wo(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ki(e,t){throw t.$$typeof===b?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Gg(e){function t(Y,P){if(e){var K=Y.deletions;K===null?(Y.deletions=[P],Y.flags|=16):K.push(P)}}function r(Y,P){if(!e)return null;for(;P!==null;)t(Y,P),P=P.sibling;return null}function i(Y){for(var P=new Map;Y!==null;)Y.key!==null?P.set(Y.key,Y):P.set(Y.index,Y),Y=Y.sibling;return P}function d(Y,P){return Y=Qa(Y,P),Y.index=0,Y.sibling=null,Y}function m(Y,P,K){return Y.index=K,e?(K=Y.alternate,K!==null?(K=K.index,K<P?(Y.flags|=67108866,P):K):(Y.flags|=67108866,P)):(Y.flags|=1048576,P)}function S(Y){return e&&Y.alternate===null&&(Y.flags|=67108866),Y}function T(Y,P,K,ae){return P===null||P.tag!==6?(P=wd(K,Y.mode,ae),P.return=Y,P):(P=d(P,K),P.return=Y,P)}function L(Y,P,K,ae){var Te=K.type;return Te===j?ne(Y,P,K.props.children,ae,K.key):P!==null&&(P.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===U&&wl(Te)===P.type)?(P=d(P,K.props),wo(P,K),P.return=Y,P):(P=Bi(K.type,K.key,K.props,null,Y.mode,ae),wo(P,K),P.return=Y,P)}function X(Y,P,K,ae){return P===null||P.tag!==4||P.stateNode.containerInfo!==K.containerInfo||P.stateNode.implementation!==K.implementation?(P=Sd(K,Y.mode,ae),P.return=Y,P):(P=d(P,K.children||[]),P.return=Y,P)}function ne(Y,P,K,ae,Te){return P===null||P.tag!==7?(P=gl(K,Y.mode,ae,Te),P.return=Y,P):(P=d(P,K),P.return=Y,P)}function le(Y,P,K){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return P=wd(""+P,Y.mode,K),P.return=Y,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case w:return K=Bi(P.type,P.key,P.props,null,Y.mode,K),wo(K,P),K.return=Y,K;case E:return P=Sd(P,Y.mode,K),P.return=Y,P;case U:return P=wl(P),le(Y,P,K)}if(ce(P)||G(P))return P=gl(P,Y.mode,K,null),P.return=Y,P;if(typeof P.then=="function")return le(Y,Gi(P),K);if(P.$$typeof===A)return le(Y,qi(Y,P),K);Ki(Y,P)}return null}function Q(Y,P,K,ae){var Te=P!==null?P.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return Te!==null?null:T(Y,P,""+K,ae);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case w:return K.key===Te?L(Y,P,K,ae):null;case E:return K.key===Te?X(Y,P,K,ae):null;case U:return K=wl(K),Q(Y,P,K,ae)}if(ce(K)||G(K))return Te!==null?null:ne(Y,P,K,ae,null);if(typeof K.then=="function")return Q(Y,P,Gi(K),ae);if(K.$$typeof===A)return Q(Y,P,qi(Y,K),ae);Ki(Y,K)}return null}function J(Y,P,K,ae,Te){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return Y=Y.get(K)||null,T(P,Y,""+ae,Te);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case w:return Y=Y.get(ae.key===null?K:ae.key)||null,L(P,Y,ae,Te);case E:return Y=Y.get(ae.key===null?K:ae.key)||null,X(P,Y,ae,Te);case U:return ae=wl(ae),J(Y,P,K,ae,Te)}if(ce(ae)||G(ae))return Y=Y.get(K)||null,ne(P,Y,ae,Te,null);if(typeof ae.then=="function")return J(Y,P,K,Gi(ae),Te);if(ae.$$typeof===A)return J(Y,P,K,qi(P,ae),Te);Ki(P,ae)}return null}function we(Y,P,K,ae){for(var Te=null,Ze=null,Se=P,Ie=P=0,Ve=null;Se!==null&&Ie<K.length;Ie++){Se.index>Ie?(Ve=Se,Se=null):Ve=Se.sibling;var Je=Q(Y,Se,K[Ie],ae);if(Je===null){Se===null&&(Se=Ve);break}e&&Se&&Je.alternate===null&&t(Y,Se),P=m(Je,P,Ie),Ze===null?Te=Je:Ze.sibling=Je,Ze=Je,Se=Ve}if(Ie===K.length)return r(Y,Se),Ge&&Za(Y,Ie),Te;if(Se===null){for(;Ie<K.length;Ie++)Se=le(Y,K[Ie],ae),Se!==null&&(P=m(Se,P,Ie),Ze===null?Te=Se:Ze.sibling=Se,Ze=Se);return Ge&&Za(Y,Ie),Te}for(Se=i(Se);Ie<K.length;Ie++)Ve=J(Se,Y,Ie,K[Ie],ae),Ve!==null&&(e&&Ve.alternate!==null&&Se.delete(Ve.key===null?Ie:Ve.key),P=m(Ve,P,Ie),Ze===null?Te=Ve:Ze.sibling=Ve,Ze=Ve);return e&&Se.forEach(function(Qr){return t(Y,Qr)}),Ge&&Za(Y,Ie),Te}function Ae(Y,P,K,ae){if(K==null)throw Error(o(151));for(var Te=null,Ze=null,Se=P,Ie=P=0,Ve=null,Je=K.next();Se!==null&&!Je.done;Ie++,Je=K.next()){Se.index>Ie?(Ve=Se,Se=null):Ve=Se.sibling;var Qr=Q(Y,Se,Je.value,ae);if(Qr===null){Se===null&&(Se=Ve);break}e&&Se&&Qr.alternate===null&&t(Y,Se),P=m(Qr,P,Ie),Ze===null?Te=Qr:Ze.sibling=Qr,Ze=Qr,Se=Ve}if(Je.done)return r(Y,Se),Ge&&Za(Y,Ie),Te;if(Se===null){for(;!Je.done;Ie++,Je=K.next())Je=le(Y,Je.value,ae),Je!==null&&(P=m(Je,P,Ie),Ze===null?Te=Je:Ze.sibling=Je,Ze=Je);return Ge&&Za(Y,Ie),Te}for(Se=i(Se);!Je.done;Ie++,Je=K.next())Je=J(Se,Y,Ie,Je.value,ae),Je!==null&&(e&&Je.alternate!==null&&Se.delete(Je.key===null?Ie:Je.key),P=m(Je,P,Ie),Ze===null?Te=Je:Ze.sibling=Je,Ze=Je);return e&&Se.forEach(function(e2){return t(Y,e2)}),Ge&&Za(Y,Ie),Te}function ht(Y,P,K,ae){if(typeof K=="object"&&K!==null&&K.type===j&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case w:e:{for(var Te=K.key;P!==null;){if(P.key===Te){if(Te=K.type,Te===j){if(P.tag===7){r(Y,P.sibling),ae=d(P,K.props.children),ae.return=Y,Y=ae;break e}}else if(P.elementType===Te||typeof Te=="object"&&Te!==null&&Te.$$typeof===U&&wl(Te)===P.type){r(Y,P.sibling),ae=d(P,K.props),wo(ae,K),ae.return=Y,Y=ae;break e}r(Y,P);break}else t(Y,P);P=P.sibling}K.type===j?(ae=gl(K.props.children,Y.mode,ae,K.key),ae.return=Y,Y=ae):(ae=Bi(K.type,K.key,K.props,null,Y.mode,ae),wo(ae,K),ae.return=Y,Y=ae)}return S(Y);case E:e:{for(Te=K.key;P!==null;){if(P.key===Te)if(P.tag===4&&P.stateNode.containerInfo===K.containerInfo&&P.stateNode.implementation===K.implementation){r(Y,P.sibling),ae=d(P,K.children||[]),ae.return=Y,Y=ae;break e}else{r(Y,P);break}else t(Y,P);P=P.sibling}ae=Sd(K,Y.mode,ae),ae.return=Y,Y=ae}return S(Y);case U:return K=wl(K),ht(Y,P,K,ae)}if(ce(K))return we(Y,P,K,ae);if(G(K)){if(Te=G(K),typeof Te!="function")throw Error(o(150));return K=Te.call(K),Ae(Y,P,K,ae)}if(typeof K.then=="function")return ht(Y,P,Gi(K),ae);if(K.$$typeof===A)return ht(Y,P,qi(Y,K),ae);Ki(Y,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,P!==null&&P.tag===6?(r(Y,P.sibling),ae=d(P,K),ae.return=Y,Y=ae):(r(Y,P),ae=wd(K,Y.mode,ae),ae.return=Y,Y=ae),S(Y)):r(Y,P)}return function(Y,P,K,ae){try{bo=0;var Te=ht(Y,P,K,ae);return fs=null,Te}catch(Se){if(Se===ds||Se===Vi)throw Se;var Ze=Un(29,Se,null,Y.mode);return Ze.lanes=ae,Ze.return=Y,Ze}finally{}}}var jl=Gg(!0),Kg=Gg(!1),_r=!1;function kd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zd(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 kr(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function zr(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(et&2)!==0){var d=i.pending;return d===null?t.next=t:(t.next=d.next,d.next=t),i.pending=t,t=Ii(e),Mg(e,null,r),t}return Ui(e,i,t,r),Ii(e)}function So(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,bt(e,r)}}function Ld(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var d=null,m=null;if(r=r.firstBaseUpdate,r!==null){do{var S={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};m===null?d=m=S:m=m.next=S,r=r.next}while(r!==null);m===null?d=m=t:m=m.next=t}else d=m=t;r={baseState:i.baseState,firstBaseUpdate:d,lastBaseUpdate:m,shared:i.shared,callbacks:i.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}var Ud=!1;function jo(){if(Ud){var e=us;if(e!==null)throw e}}function Co(e,t,r,i){Ud=!1;var d=e.updateQueue;_r=!1;var m=d.firstBaseUpdate,S=d.lastBaseUpdate,T=d.shared.pending;if(T!==null){d.shared.pending=null;var L=T,X=L.next;L.next=null,S===null?m=X:S.next=X,S=L;var ne=e.alternate;ne!==null&&(ne=ne.updateQueue,T=ne.lastBaseUpdate,T!==S&&(T===null?ne.firstBaseUpdate=X:T.next=X,ne.lastBaseUpdate=L))}if(m!==null){var le=d.baseState;S=0,ne=X=L=null,T=m;do{var Q=T.lane&-536870913,J=Q!==T.lane;if(J?($e&Q)===Q:(i&Q)===Q){Q!==0&&Q===cs&&(Ud=!0),ne!==null&&(ne=ne.next={lane:0,tag:T.tag,payload:T.payload,callback:null,next:null});e:{var we=e,Ae=T;Q=t;var ht=r;switch(Ae.tag){case 1:if(we=Ae.payload,typeof we=="function"){le=we.call(ht,le,Q);break e}le=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Ae.payload,Q=typeof we=="function"?we.call(ht,le,Q):we,Q==null)break e;le=y({},le,Q);break e;case 2:_r=!0}}Q=T.callback,Q!==null&&(e.flags|=64,J&&(e.flags|=8192),J=d.callbacks,J===null?d.callbacks=[Q]:J.push(Q))}else J={lane:Q,tag:T.tag,payload:T.payload,callback:T.callback,next:null},ne===null?(X=ne=J,L=le):ne=ne.next=J,S|=Q;if(T=T.next,T===null){if(T=d.shared.pending,T===null)break;J=T,T=J.next,J.next=null,d.lastBaseUpdate=J,d.shared.pending=null}}while(!0);ne===null&&(L=le),d.baseState=L,d.firstBaseUpdate=X,d.lastBaseUpdate=ne,m===null&&(d.shared.lanes=0),Pr|=S,e.lanes=S,e.memoizedState=le}}function Xg(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Fg(e,t){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)Xg(r[e],t)}var hs=z(null),Xi=z(0);function Qg(e,t){e=ir,Z(Xi,e),Z(hs,t),ir=e|t.baseLanes}function Id(){Z(Xi,ir),Z(hs,hs.current)}function Bd(){ir=Xi.current,H(hs),H(Xi)}var In=z(null),oa=null;function Lr(e){var t=e.alternate;Z(_t,_t.current&1),Z(In,e),oa===null&&(t===null||hs.current!==null||t.memoizedState!==null)&&(oa=e)}function Pd(e){Z(_t,_t.current),Z(In,e),oa===null&&(oa=e)}function Zg(e){e.tag===22?(Z(_t,_t.current),Z(In,e),oa===null&&(oa=e)):Ur()}function Ur(){Z(_t,_t.current),Z(In,In.current)}function Bn(e){H(In),oa===e&&(oa=null),H(_t)}var _t=z(0);function Fi(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Kf(r)||Xf(r)))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 er=0,Le=null,dt=null,Ut=null,Qi=!1,ms=!1,Cl=!1,Zi=0,Eo=0,ps=null,Vj=0;function Mt(){throw Error(o(321))}function Hd(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Ln(e[r],t[r]))return!1;return!0}function qd(e,t,r,i,d,m){return er=m,Le=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?kv:af,Cl=!1,m=r(i,d),Cl=!1,ms&&(m=Wg(t,r,i,d)),Jg(e),m}function Jg(e){k.H=To;var t=dt!==null&&dt.next!==null;if(er=0,Ut=dt=Le=null,Qi=!1,Eo=0,ps=null,t)throw Error(o(300));e===null||It||(e=e.dependencies,e!==null&&Hi(e)&&(It=!0))}function Wg(e,t,r,i){Le=e;var d=0;do{if(ms&&(ps=null),Eo=0,ms=!1,25<=d)throw Error(o(301));if(d+=1,Ut=dt=null,e.updateQueue!=null){var m=e.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}k.H=zv,m=t(r,i)}while(ms);return m}function Yj(){var e=k.H,t=e.useState()[0];return t=typeof t.then=="function"?No(t):t,e=e.useState()[0],(dt!==null?dt.memoizedState:null)!==e&&(Le.flags|=1024),t}function $d(){var e=Zi!==0;return Zi=0,e}function Vd(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function Yd(e){if(Qi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Qi=!1}er=0,Ut=dt=Le=null,ms=!1,Eo=Zi=0,ps=null}function pn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ut===null?Le.memoizedState=Ut=e:Ut=Ut.next=e,Ut}function kt(){if(dt===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var t=Ut===null?Le.memoizedState:Ut.next;if(t!==null)Ut=t,dt=e;else{if(e===null)throw Le.alternate===null?Error(o(467)):Error(o(310));dt=e,e={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},Ut===null?Le.memoizedState=Ut=e:Ut=Ut.next=e}return Ut}function Ji(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function No(e){var t=Eo;return Eo+=1,ps===null&&(ps=[]),e=$g(ps,e,t),t=Le,(Ut===null?t.memoizedState:Ut.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?kv:af),e}function Wi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return No(e);if(e.$$typeof===A)return nn(e)}throw Error(o(438,String(e)))}function Gd(e){var t=null,r=Le.updateQueue;if(r!==null&&(t=r.memoCache),t==null){var i=Le.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(d){return d.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),r===null&&(r=Ji(),Le.updateQueue=r),r.memoCache=t,r=t.data[t.index],r===void 0)for(r=t.data[t.index]=Array(e),i=0;i<e;i++)r[i]=te;return t.index++,r}function tr(e,t){return typeof t=="function"?t(e):t}function ec(e){var t=kt();return Kd(t,dt,e)}function Kd(e,t,r){var i=e.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=r;var d=e.baseQueue,m=i.pending;if(m!==null){if(d!==null){var S=d.next;d.next=m.next,m.next=S}t.baseQueue=d=m,i.pending=null}if(m=e.baseState,d===null)e.memoizedState=m;else{t=d.next;var T=S=null,L=null,X=t,ne=!1;do{var le=X.lane&-536870913;if(le!==X.lane?($e&le)===le:(er&le)===le){var Q=X.revertLane;if(Q===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),le===cs&&(ne=!0);else if((er&Q)===Q){X=X.next,Q===cs&&(ne=!0);continue}else le={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},L===null?(T=L=le,S=m):L=L.next=le,Le.lanes|=Q,Pr|=Q;le=X.action,Cl&&r(m,le),m=X.hasEagerState?X.eagerState:r(m,le)}else Q={lane:le,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},L===null?(T=L=Q,S=m):L=L.next=Q,Le.lanes|=le,Pr|=le;X=X.next}while(X!==null&&X!==t);if(L===null?S=m:L.next=T,!Ln(m,e.memoizedState)&&(It=!0,ne&&(r=us,r!==null)))throw r;e.memoizedState=m,e.baseState=S,e.baseQueue=L,i.lastRenderedState=m}return d===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Xd(e){var t=kt(),r=t.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=e;var i=r.dispatch,d=r.pending,m=t.memoizedState;if(d!==null){r.pending=null;var S=d=d.next;do m=e(m,S.action),S=S.next;while(S!==d);Ln(m,t.memoizedState)||(It=!0),t.memoizedState=m,t.baseQueue===null&&(t.baseState=m),r.lastRenderedState=m}return[m,i]}function ev(e,t,r){var i=Le,d=kt(),m=Ge;if(m){if(r===void 0)throw Error(o(407));r=r()}else r=t();var S=!Ln((dt||d).memoizedState,r);if(S&&(d.memoizedState=r,It=!0),d=d.queue,Zd(av.bind(null,i,d,e),[e]),d.getSnapshot!==t||S||Ut!==null&&Ut.memoizedState.tag&1){if(i.flags|=2048,gs(9,{destroy:void 0},nv.bind(null,i,d,r,t),null),pt===null)throw Error(o(349));m||(er&127)!==0||tv(i,t,r)}return r}function tv(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Le.updateQueue,t===null?(t=Ji(),Le.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function nv(e,t,r,i){t.value=r,t.getSnapshot=i,rv(t)&&lv(e)}function av(e,t,r){return r(function(){rv(t)&&lv(e)})}function rv(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Ln(e,r)}catch{return!0}}function lv(e){var t=pl(e,2);t!==null&&En(t,e,2)}function Fd(e){var t=pn();if(typeof e=="function"){var r=e;if(e=r(),Cl){mn(!0);try{r()}finally{mn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:e},t}function sv(e,t,r,i){return e.baseState=r,Kd(e,dt,typeof i=="function"?i:tr)}function Gj(e,t,r,i,d){if(ac(e))throw Error(o(485));if(e=t.action,e!==null){var m={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){m.listeners.push(S)}};k.T!==null?r(!0):m.isTransition=!1,i(m),r=t.pending,r===null?(m.next=t.pending=m,ov(t,m)):(m.next=r.next,t.pending=r.next=m)}}function ov(e,t){var r=t.action,i=t.payload,d=e.state;if(t.isTransition){var m=k.T,S={};k.T=S;try{var T=r(d,i),L=k.S;L!==null&&L(S,T),iv(e,t,T)}catch(X){Qd(e,t,X)}finally{m!==null&&S.types!==null&&(m.types=S.types),k.T=m}}else try{m=r(d,i),iv(e,t,m)}catch(X){Qd(e,t,X)}}function iv(e,t,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(i){cv(e,t,i)},function(i){return Qd(e,t,i)}):cv(e,t,r)}function cv(e,t,r){t.status="fulfilled",t.value=r,uv(t),e.state=r,t=e.pending,t!==null&&(r=t.next,r===t?e.pending=null:(r=r.next,t.next=r,ov(e,r)))}function Qd(e,t,r){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=r,uv(t),t=t.next;while(t!==i)}e.action=null}function uv(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function dv(e,t){return t}function fv(e,t){if(Ge){var r=pt.formState;if(r!==null){e:{var i=Le;if(Ge){if(wt){t:{for(var d=wt,m=sa;d.nodeType!==8;){if(!m){d=null;break t}if(d=ia(d.nextSibling),d===null){d=null;break t}}m=d.data,d=m==="F!"||m==="F"?d:null}if(d){wt=ia(d.nextSibling),i=d.data==="F!";break e}}Dr(i)}i=!1}i&&(t=r[0])}}return r=pn(),r.memoizedState=r.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dv,lastRenderedState:t},r.queue=i,r=Dv.bind(null,Le,i),i.dispatch=r,i=Fd(!1),m=nf.bind(null,Le,!1,i.queue),i=pn(),d={state:t,dispatch:null,action:e,pending:null},i.queue=d,r=Gj.bind(null,Le,d,m,r),d.dispatch=r,i.memoizedState=e,[t,r,!1]}function hv(e){var t=kt();return mv(t,dt,e)}function mv(e,t,r){if(t=Kd(e,t,dv)[0],e=ec(tr)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=No(t)}catch(S){throw S===ds?Vi:S}else i=t;t=kt();var d=t.queue,m=d.dispatch;return r!==t.memoizedState&&(Le.flags|=2048,gs(9,{destroy:void 0},Kj.bind(null,d,r),null)),[i,m,e]}function Kj(e,t){e.action=t}function pv(e){var t=kt(),r=dt;if(r!==null)return mv(t,r,e);kt(),t=t.memoizedState,r=kt();var i=r.queue.dispatch;return r.memoizedState=e,[t,i,!1]}function gs(e,t,r,i){return e={tag:e,create:r,deps:i,inst:t,next:null},t=Le.updateQueue,t===null&&(t=Ji(),Le.updateQueue=t),r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e),e}function gv(){return kt().memoizedState}function tc(e,t,r,i){var d=pn();Le.flags|=e,d.memoizedState=gs(1|t,{destroy:void 0},r,i===void 0?null:i)}function nc(e,t,r,i){var d=kt();i=i===void 0?null:i;var m=d.memoizedState.inst;dt!==null&&i!==null&&Hd(i,dt.memoizedState.deps)?d.memoizedState=gs(t,m,r,i):(Le.flags|=e,d.memoizedState=gs(1|t,m,r,i))}function vv(e,t){tc(8390656,8,e,t)}function Zd(e,t){nc(2048,8,e,t)}function Xj(e){Le.flags|=4;var t=Le.updateQueue;if(t===null)t=Ji(),Le.updateQueue=t,t.events=[e];else{var r=t.events;r===null?t.events=[e]:r.push(e)}}function xv(e){var t=kt().memoizedState;return Xj({ref:t,nextImpl:e}),function(){if((et&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function yv(e,t){return nc(4,2,e,t)}function bv(e,t){return nc(4,4,e,t)}function wv(e,t){if(typeof t=="function"){e=e();var r=t(e);return function(){typeof r=="function"?r():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Sv(e,t,r){r=r!=null?r.concat([e]):null,nc(4,4,wv.bind(null,t,e),r)}function Jd(){}function jv(e,t){var r=kt();t=t===void 0?null:t;var i=r.memoizedState;return t!==null&&Hd(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function Cv(e,t){var r=kt();t=t===void 0?null:t;var i=r.memoizedState;if(t!==null&&Hd(t,i[1]))return i[0];if(i=e(),Cl){mn(!0);try{e()}finally{mn(!1)}}return r.memoizedState=[i,t],i}function Wd(e,t,r){return r===void 0||(er&1073741824)!==0&&($e&261930)===0?e.memoizedState=t:(e.memoizedState=r,e=Ex(),Le.lanes|=e,Pr|=e,r)}function Ev(e,t,r,i){return Ln(r,t)?r:hs.current!==null?(e=Wd(e,r,i),Ln(e,t)||(It=!0),e):(er&42)===0||(er&1073741824)!==0&&($e&261930)===0?(It=!0,e.memoizedState=r):(e=Ex(),Le.lanes|=e,Pr|=e,t)}function Nv(e,t,r,i,d){var m=$.p;$.p=m!==0&&8>m?m:8;var S=k.T,T={};k.T=T,nf(e,!1,t,r);try{var L=d(),X=k.S;if(X!==null&&X(T,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var ne=$j(L,i);Ro(e,t,ne,qn(e))}else Ro(e,t,i,qn(e))}catch(le){Ro(e,t,{then:function(){},status:"rejected",reason:le},qn())}finally{$.p=m,S!==null&&T.types!==null&&(S.types=T.types),k.T=S}}function Fj(){}function ef(e,t,r,i){if(e.tag!==5)throw Error(o(476));var d=Rv(e).queue;Nv(e,d,t,ee,r===null?Fj:function(){return Tv(e),r(i)})}function Rv(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:ee},next:null};var r={};return t.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:tr,lastRenderedState:r},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Tv(e){var t=Rv(e);t.next===null&&(t=e.alternate.memoizedState),Ro(e,t.next.queue,{},qn())}function tf(){return nn(Vo)}function Av(){return kt().memoizedState}function Mv(){return kt().memoizedState}function Qj(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var r=qn();e=kr(r);var i=zr(t,e,r);i!==null&&(En(i,t,r),So(i,t,r)),t={cache:Md()},e.payload=t;return}t=t.return}}function Zj(e,t,r){var i=qn();r={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ac(e)?Ov(t,r):(r=yd(e,t,r,i),r!==null&&(En(r,e,i),_v(r,t,i)))}function Dv(e,t,r){var i=qn();Ro(e,t,r,i)}function Ro(e,t,r,i){var d={lane:i,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(ac(e))Ov(t,d);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=t.lastRenderedReducer,m!==null))try{var S=t.lastRenderedState,T=m(S,r);if(d.hasEagerState=!0,d.eagerState=T,Ln(T,S))return Ui(e,t,d,0),pt===null&&Li(),!1}catch{}finally{}if(r=yd(e,t,d,i),r!==null)return En(r,e,i),_v(r,t,i),!0}return!1}function nf(e,t,r,i){if(i={lane:2,revertLane:zf(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},ac(e)){if(t)throw Error(o(479))}else t=yd(e,r,i,2),t!==null&&En(t,e,2)}function ac(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function Ov(e,t){ms=Qi=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function _v(e,t,r){if((r&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,bt(e,r)}}var To={readContext:nn,use:Wi,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};To.useEffectEvent=Mt;var kv={readContext:nn,use:Wi,useCallback:function(e,t){return pn().memoizedState=[e,t===void 0?null:t],e},useContext:nn,useEffect:vv,useImperativeHandle:function(e,t,r){r=r!=null?r.concat([e]):null,tc(4194308,4,wv.bind(null,t,e),r)},useLayoutEffect:function(e,t){return tc(4194308,4,e,t)},useInsertionEffect:function(e,t){tc(4,2,e,t)},useMemo:function(e,t){var r=pn();t=t===void 0?null:t;var i=e();if(Cl){mn(!0);try{e()}finally{mn(!1)}}return r.memoizedState=[i,t],i},useReducer:function(e,t,r){var i=pn();if(r!==void 0){var d=r(t);if(Cl){mn(!0);try{r(t)}finally{mn(!1)}}}else d=t;return i.memoizedState=i.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},i.queue=e,e=e.dispatch=Zj.bind(null,Le,e),[i.memoizedState,e]},useRef:function(e){var t=pn();return e={current:e},t.memoizedState=e},useState:function(e){e=Fd(e);var t=e.queue,r=Dv.bind(null,Le,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:Jd,useDeferredValue:function(e,t){var r=pn();return Wd(r,e,t)},useTransition:function(){var e=Fd(!1);return e=Nv.bind(null,Le,e.queue,!0,!1),pn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var i=Le,d=pn();if(Ge){if(r===void 0)throw Error(o(407));r=r()}else{if(r=t(),pt===null)throw Error(o(349));($e&127)!==0||tv(i,t,r)}d.memoizedState=r;var m={value:r,getSnapshot:t};return d.queue=m,vv(av.bind(null,i,m,e),[e]),i.flags|=2048,gs(9,{destroy:void 0},nv.bind(null,i,m,r,t),null),r},useId:function(){var e=pn(),t=pt.identifierPrefix;if(Ge){var r=Aa,i=Ta;r=(i&~(1<<32-Tt(i)-1)).toString(32)+r,t="_"+t+"R_"+r,r=Zi++,0<r&&(t+="H"+r.toString(32)),t+="_"}else r=Vj++,t="_"+t+"r_"+r.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:tf,useFormState:fv,useActionState:fv,useOptimistic:function(e){var t=pn();t.memoizedState=t.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=r,t=nf.bind(null,Le,!0,r),r.dispatch=t,[e,t]},useMemoCache:Gd,useCacheRefresh:function(){return pn().memoizedState=Qj.bind(null,Le)},useEffectEvent:function(e){var t=pn(),r={impl:e};return t.memoizedState=r,function(){if((et&2)!==0)throw Error(o(440));return r.impl.apply(void 0,arguments)}}},af={readContext:nn,use:Wi,useCallback:jv,useContext:nn,useEffect:Zd,useImperativeHandle:Sv,useInsertionEffect:yv,useLayoutEffect:bv,useMemo:Cv,useReducer:ec,useRef:gv,useState:function(){return ec(tr)},useDebugValue:Jd,useDeferredValue:function(e,t){var r=kt();return Ev(r,dt.memoizedState,e,t)},useTransition:function(){var e=ec(tr)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:No(e),t]},useSyncExternalStore:ev,useId:Av,useHostTransitionStatus:tf,useFormState:hv,useActionState:hv,useOptimistic:function(e,t){var r=kt();return sv(r,dt,e,t)},useMemoCache:Gd,useCacheRefresh:Mv};af.useEffectEvent=xv;var zv={readContext:nn,use:Wi,useCallback:jv,useContext:nn,useEffect:Zd,useImperativeHandle:Sv,useInsertionEffect:yv,useLayoutEffect:bv,useMemo:Cv,useReducer:Xd,useRef:gv,useState:function(){return Xd(tr)},useDebugValue:Jd,useDeferredValue:function(e,t){var r=kt();return dt===null?Wd(r,e,t):Ev(r,dt.memoizedState,e,t)},useTransition:function(){var e=Xd(tr)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:No(e),t]},useSyncExternalStore:ev,useId:Av,useHostTransitionStatus:tf,useFormState:pv,useActionState:pv,useOptimistic:function(e,t){var r=kt();return dt!==null?sv(r,dt,e,t):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Gd,useCacheRefresh:Mv};zv.useEffectEvent=xv;function rf(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:y({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var lf={enqueueSetState:function(e,t,r){e=e._reactInternals;var i=qn(),d=kr(i);d.payload=t,r!=null&&(d.callback=r),t=zr(e,d,i),t!==null&&(En(t,e,i),So(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=qn(),d=kr(i);d.tag=1,d.payload=t,r!=null&&(d.callback=r),t=zr(e,d,i),t!==null&&(En(t,e,i),So(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=qn(),i=kr(r);i.tag=2,t!=null&&(i.callback=t),t=zr(e,i,r),t!==null&&(En(t,e,r),So(t,e,r))}};function Lv(e,t,r,i,d,m,S){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,m,S):t.prototype&&t.prototype.isPureReactComponent?!mo(r,i)||!mo(d,m):!0}function Uv(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&lf.enqueueReplaceState(t,t.state,null)}function El(e,t){var r=t;if("ref"in t){r={};for(var i in t)i!=="ref"&&(r[i]=t[i])}if(e=e.defaultProps){r===t&&(r=y({},r));for(var d in e)r[d]===void 0&&(r[d]=e[d])}return r}function Iv(e){zi(e)}function Bv(e){console.error(e)}function Pv(e){zi(e)}function rc(e,t){try{var r=e.onUncaughtError;r(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Hv(e,t,r){try{var i=e.onCaughtError;i(r.value,{componentStack:r.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function sf(e,t,r){return r=kr(r),r.tag=3,r.payload={element:null},r.callback=function(){rc(e,t)},r}function qv(e){return e=kr(e),e.tag=3,e}function $v(e,t,r,i){var d=r.type.getDerivedStateFromError;if(typeof d=="function"){var m=i.value;e.payload=function(){return d(m)},e.callback=function(){Hv(t,r,i)}}var S=r.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(e.callback=function(){Hv(t,r,i),typeof d!="function"&&(Hr===null?Hr=new Set([this]):Hr.add(this));var T=i.stack;this.componentDidCatch(i.value,{componentStack:T!==null?T:""})})}function Jj(e,t,r,i,d){if(r.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=r.alternate,t!==null&&is(t,r,d,!0),r=In.current,r!==null){switch(r.tag){case 31:case 13:return oa===null?gc():r.alternate===null&&Dt===0&&(Dt=3),r.flags&=-257,r.flags|=65536,r.lanes=d,i===Yi?r.flags|=16384:(t=r.updateQueue,t===null?r.updateQueue=new Set([i]):t.add(i),Of(e,i,d)),!1;case 22:return r.flags|=65536,i===Yi?r.flags|=16384:(t=r.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},r.updateQueue=t):(r=t.retryQueue,r===null?t.retryQueue=new Set([i]):r.add(i)),Of(e,i,d)),!1}throw Error(o(435,r.tag))}return Of(e,i,d),gc(),!1}if(Ge)return t=In.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=d,i!==Ed&&(e=Error(o(422),{cause:i}),vo(aa(e,r)))):(i!==Ed&&(t=Error(o(423),{cause:i}),vo(aa(t,r))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,i=aa(i,r),d=sf(e.stateNode,i,d),Ld(e,d),Dt!==4&&(Dt=2)),!1;var m=Error(o(520),{cause:i});if(m=aa(m,r),Lo===null?Lo=[m]:Lo.push(m),Dt!==4&&(Dt=2),t===null)return!0;i=aa(i,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=d&-d,r.lanes|=e,e=sf(r.stateNode,i,e),Ld(r,e),!1;case 1:if(t=r.type,m=r.stateNode,(r.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Hr===null||!Hr.has(m))))return r.flags|=65536,d&=-d,r.lanes|=d,d=qv(d),$v(d,e,r,i),Ld(r,d),!1}r=r.return}while(r!==null);return!1}var of=Error(o(461)),It=!1;function an(e,t,r,i){t.child=e===null?Kg(t,null,r,i):jl(t,e.child,r,i)}function Vv(e,t,r,i,d){r=r.render;var m=t.ref;if("ref"in i){var S={};for(var T in i)T!=="ref"&&(S[T]=i[T])}else S=i;return yl(t),i=qd(e,t,r,S,m,d),T=$d(),e!==null&&!It?(Vd(e,t,d),nr(e,t,d)):(Ge&&T&&jd(t),t.flags|=1,an(e,t,i,d),t.child)}function Yv(e,t,r,i,d){if(e===null){var m=r.type;return typeof m=="function"&&!bd(m)&&m.defaultProps===void 0&&r.compare===null?(t.tag=15,t.type=m,Gv(e,t,m,i,d)):(e=Bi(r.type,null,i,t,t.mode,d),e.ref=t.ref,e.return=t,t.child=e)}if(m=e.child,!gf(e,d)){var S=m.memoizedProps;if(r=r.compare,r=r!==null?r:mo,r(S,i)&&e.ref===t.ref)return nr(e,t,d)}return t.flags|=1,e=Qa(m,i),e.ref=t.ref,e.return=t,t.child=e}function Gv(e,t,r,i,d){if(e!==null){var m=e.memoizedProps;if(mo(m,i)&&e.ref===t.ref)if(It=!1,t.pendingProps=i=m,gf(e,d))(e.flags&131072)!==0&&(It=!0);else return t.lanes=e.lanes,nr(e,t,d)}return cf(e,t,r,i,d)}function Kv(e,t,r,i){var d=i.children,m=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(m=m!==null?m.baseLanes|r:r,e!==null){for(i=t.child=e.child,d=0;i!==null;)d=d|i.lanes|i.childLanes,i=i.sibling;i=d&~m}else i=0,t.child=null;return Xv(e,t,m,r,i)}if((r&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&$i(t,m!==null?m.cachePool:null),m!==null?Qg(t,m):Id(),Zg(t);else return i=t.lanes=536870912,Xv(e,t,m!==null?m.baseLanes|r:r,r,i)}else m!==null?($i(t,m.cachePool),Qg(t,m),Ur(),t.memoizedState=null):(e!==null&&$i(t,null),Id(),Ur());return an(e,t,d,r),t.child}function Ao(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Xv(e,t,r,i,d){var m=Od();return m=m===null?null:{parent:Lt._currentValue,pool:m},t.memoizedState={baseLanes:r,cachePool:m},e!==null&&$i(t,null),Id(),Zg(t),e!==null&&is(e,t,i,!0),t.childLanes=d,null}function lc(e,t){return t=oc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Fv(e,t,r){return jl(t,e.child,null,r),e=lc(t,t.pendingProps),e.flags|=2,Bn(t),t.memoizedState=null,e}function Wj(e,t,r){var i=t.pendingProps,d=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ge){if(i.mode==="hidden")return e=lc(t,i),t.lanes=536870912,Ao(null,e);if(Pd(t),(e=wt)?(e=oy(e,sa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ar!==null?{id:Ta,overflow:Aa}:null,retryLane:536870912,hydrationErrors:null},r=Og(e),r.return=t,t.child=r,tn=t,wt=null)):e=null,e===null)throw Dr(t);return t.lanes=536870912,null}return lc(t,i)}var m=e.memoizedState;if(m!==null){var S=m.dehydrated;if(Pd(t),d)if(t.flags&256)t.flags&=-257,t=Fv(e,t,r);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(It||is(e,t,r,!1),d=(r&e.childLanes)!==0,It||d){if(i=pt,i!==null&&(S=Ot(i,r),S!==0&&S!==m.retryLane))throw m.retryLane=S,pl(e,S),En(i,e,S),of;gc(),t=Fv(e,t,r)}else e=m.treeContext,wt=ia(S.nextSibling),tn=t,Ge=!0,Mr=null,sa=!1,e!==null&&zg(t,e),t=lc(t,i),t.flags|=4096;return t}return e=Qa(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function sc(e,t){var r=t.ref;if(r===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(o(284));(e===null||e.ref!==r)&&(t.flags|=4194816)}}function cf(e,t,r,i,d){return yl(t),r=qd(e,t,r,i,void 0,d),i=$d(),e!==null&&!It?(Vd(e,t,d),nr(e,t,d)):(Ge&&i&&jd(t),t.flags|=1,an(e,t,r,d),t.child)}function Qv(e,t,r,i,d,m){return yl(t),t.updateQueue=null,r=Wg(t,i,r,d),Jg(e),i=$d(),e!==null&&!It?(Vd(e,t,m),nr(e,t,m)):(Ge&&i&&jd(t),t.flags|=1,an(e,t,r,m),t.child)}function Zv(e,t,r,i,d){if(yl(t),t.stateNode===null){var m=rs,S=r.contextType;typeof S=="object"&&S!==null&&(m=nn(S)),m=new r(i,m),t.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=lf,t.stateNode=m,m._reactInternals=t,m=t.stateNode,m.props=i,m.state=t.memoizedState,m.refs={},kd(t),S=r.contextType,m.context=typeof S=="object"&&S!==null?nn(S):rs,m.state=t.memoizedState,S=r.getDerivedStateFromProps,typeof S=="function"&&(rf(t,r,S,i),m.state=t.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(S=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),S!==m.state&&lf.enqueueReplaceState(m,m.state,null),Co(t,i,m,d),jo(),m.state=t.memoizedState),typeof m.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){m=t.stateNode;var T=t.memoizedProps,L=El(r,T);m.props=L;var X=m.context,ne=r.contextType;S=rs,typeof ne=="object"&&ne!==null&&(S=nn(ne));var le=r.getDerivedStateFromProps;ne=typeof le=="function"||typeof m.getSnapshotBeforeUpdate=="function",T=t.pendingProps!==T,ne||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(T||X!==S)&&Uv(t,m,i,S),_r=!1;var Q=t.memoizedState;m.state=Q,Co(t,i,m,d),jo(),X=t.memoizedState,T||Q!==X||_r?(typeof le=="function"&&(rf(t,r,le,i),X=t.memoizedState),(L=_r||Lv(t,r,L,i,Q,X,S))?(ne||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(t.flags|=4194308)):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=X),m.props=i,m.state=X,m.context=S,i=L):(typeof m.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{m=t.stateNode,zd(e,t),S=t.memoizedProps,ne=El(r,S),m.props=ne,le=t.pendingProps,Q=m.context,X=r.contextType,L=rs,typeof X=="object"&&X!==null&&(L=nn(X)),T=r.getDerivedStateFromProps,(X=typeof T=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(S!==le||Q!==L)&&Uv(t,m,i,L),_r=!1,Q=t.memoizedState,m.state=Q,Co(t,i,m,d),jo();var J=t.memoizedState;S!==le||Q!==J||_r||e!==null&&e.dependencies!==null&&Hi(e.dependencies)?(typeof T=="function"&&(rf(t,r,T,i),J=t.memoizedState),(ne=_r||Lv(t,r,ne,i,Q,J,L)||e!==null&&e.dependencies!==null&&Hi(e.dependencies))?(X||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(i,J,L),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(i,J,L)),typeof m.componentDidUpdate=="function"&&(t.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof m.componentDidUpdate!="function"||S===e.memoizedProps&&Q===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&Q===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=J),m.props=i,m.state=J,m.context=L,i=ne):(typeof m.componentDidUpdate!="function"||S===e.memoizedProps&&Q===e.memoizedState||(t.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&Q===e.memoizedState||(t.flags|=1024),i=!1)}return m=i,sc(e,t),i=(t.flags&128)!==0,m||i?(m=t.stateNode,r=i&&typeof r.getDerivedStateFromError!="function"?null:m.render(),t.flags|=1,e!==null&&i?(t.child=jl(t,e.child,null,d),t.child=jl(t,null,r,d)):an(e,t,r,d),t.memoizedState=m.state,e=t.child):e=nr(e,t,d),e}function Jv(e,t,r,i){return vl(),t.flags|=256,an(e,t,r,i),t.child}var uf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function df(e){return{baseLanes:e,cachePool:Hg()}}function ff(e,t,r){return e=e!==null?e.childLanes&~r:0,t&&(e|=Hn),e}function Wv(e,t,r){var i=t.pendingProps,d=!1,m=(t.flags&128)!==0,S;if((S=m)||(S=e!==null&&e.memoizedState===null?!1:(_t.current&2)!==0),S&&(d=!0,t.flags&=-129),S=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ge){if(d?Lr(t):Ur(),(e=wt)?(e=oy(e,sa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ar!==null?{id:Ta,overflow:Aa}:null,retryLane:536870912,hydrationErrors:null},r=Og(e),r.return=t,t.child=r,tn=t,wt=null)):e=null,e===null)throw Dr(t);return Xf(e)?t.lanes=32:t.lanes=536870912,null}var T=i.children;return i=i.fallback,d?(Ur(),d=t.mode,T=oc({mode:"hidden",children:T},d),i=gl(i,d,r,null),T.return=t,i.return=t,T.sibling=i,t.child=T,i=t.child,i.memoizedState=df(r),i.childLanes=ff(e,S,r),t.memoizedState=uf,Ao(null,i)):(Lr(t),hf(t,T))}var L=e.memoizedState;if(L!==null&&(T=L.dehydrated,T!==null)){if(m)t.flags&256?(Lr(t),t.flags&=-257,t=mf(e,t,r)):t.memoizedState!==null?(Ur(),t.child=e.child,t.flags|=128,t=null):(Ur(),T=i.fallback,d=t.mode,i=oc({mode:"visible",children:i.children},d),T=gl(T,d,r,null),T.flags|=2,i.return=t,T.return=t,i.sibling=T,t.child=i,jl(t,e.child,null,r),i=t.child,i.memoizedState=df(r),i.childLanes=ff(e,S,r),t.memoizedState=uf,t=Ao(null,i));else if(Lr(t),Xf(T)){if(S=T.nextSibling&&T.nextSibling.dataset,S)var X=S.dgst;S=X,i=Error(o(419)),i.stack="",i.digest=S,vo({value:i,source:null,stack:null}),t=mf(e,t,r)}else if(It||is(e,t,r,!1),S=(r&e.childLanes)!==0,It||S){if(S=pt,S!==null&&(i=Ot(S,r),i!==0&&i!==L.retryLane))throw L.retryLane=i,pl(e,i),En(S,e,i),of;Kf(T)||gc(),t=mf(e,t,r)}else Kf(T)?(t.flags|=192,t.child=e.child,t=null):(e=L.treeContext,wt=ia(T.nextSibling),tn=t,Ge=!0,Mr=null,sa=!1,e!==null&&zg(t,e),t=hf(t,i.children),t.flags|=4096);return t}return d?(Ur(),T=i.fallback,d=t.mode,L=e.child,X=L.sibling,i=Qa(L,{mode:"hidden",children:i.children}),i.subtreeFlags=L.subtreeFlags&65011712,X!==null?T=Qa(X,T):(T=gl(T,d,r,null),T.flags|=2),T.return=t,i.return=t,i.sibling=T,t.child=i,Ao(null,i),i=t.child,T=e.child.memoizedState,T===null?T=df(r):(d=T.cachePool,d!==null?(L=Lt._currentValue,d=d.parent!==L?{parent:L,pool:L}:d):d=Hg(),T={baseLanes:T.baseLanes|r,cachePool:d}),i.memoizedState=T,i.childLanes=ff(e,S,r),t.memoizedState=uf,Ao(e.child,i)):(Lr(t),r=e.child,e=r.sibling,r=Qa(r,{mode:"visible",children:i.children}),r.return=t,r.sibling=null,e!==null&&(S=t.deletions,S===null?(t.deletions=[e],t.flags|=16):S.push(e)),t.child=r,t.memoizedState=null,r)}function hf(e,t){return t=oc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function oc(e,t){return e=Un(22,e,null,t),e.lanes=0,e}function mf(e,t,r){return jl(t,e.child,null,r),e=hf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ex(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Td(e.return,t,r)}function pf(e,t,r,i,d,m){var S=e.memoizedState;S===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:d,treeForkCount:m}:(S.isBackwards=t,S.rendering=null,S.renderingStartTime=0,S.last=i,S.tail=r,S.tailMode=d,S.treeForkCount=m)}function tx(e,t,r){var i=t.pendingProps,d=i.revealOrder,m=i.tail;i=i.children;var S=_t.current,T=(S&2)!==0;if(T?(S=S&1|2,t.flags|=128):S&=1,Z(_t,S),an(e,t,i,r),i=Ge?go:0,!T&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ex(e,r,t);else if(e.tag===19)ex(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(r=t.child,d=null;r!==null;)e=r.alternate,e!==null&&Fi(e)===null&&(d=r),r=r.sibling;r=d,r===null?(d=t.child,t.child=null):(d=r.sibling,r.sibling=null),pf(t,!1,d,r,m,i);break;case"backwards":case"unstable_legacy-backwards":for(r=null,d=t.child,t.child=null;d!==null;){if(e=d.alternate,e!==null&&Fi(e)===null){t.child=d;break}e=d.sibling,d.sibling=r,r=d,d=e}pf(t,!0,r,null,m,i);break;case"together":pf(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function nr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Pr|=t.lanes,(r&t.childLanes)===0)if(e!==null){if(is(e,t,r,!1),(r&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,r=Qa(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Qa(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function gf(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Hi(e)))}function eC(e,t,r){switch(t.tag){case 3:de(t,t.stateNode.containerInfo),Or(t,Lt,e.memoizedState.cache),vl();break;case 27:case 5:fe(t);break;case 4:de(t,t.stateNode.containerInfo);break;case 10:Or(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Pd(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Lr(t),t.flags|=128,null):(r&t.child.childLanes)!==0?Wv(e,t,r):(Lr(t),e=nr(e,t,r),e!==null?e.sibling:null);Lr(t);break;case 19:var d=(e.flags&128)!==0;if(i=(r&t.childLanes)!==0,i||(is(e,t,r,!1),i=(r&t.childLanes)!==0),d){if(i)return tx(e,t,r);t.flags|=128}if(d=t.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),Z(_t,_t.current),i)break;return null;case 22:return t.lanes=0,Kv(e,t,r,t.pendingProps);case 24:Or(t,Lt,e.memoizedState.cache)}return nr(e,t,r)}function nx(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps)It=!0;else{if(!gf(e,r)&&(t.flags&128)===0)return It=!1,eC(e,t,r);It=(e.flags&131072)!==0}else It=!1,Ge&&(t.flags&1048576)!==0&&kg(t,go,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=wl(t.elementType),t.type=e,typeof e=="function")bd(e)?(i=El(e,i),t.tag=1,t=Zv(null,t,e,i,r)):(t.tag=0,t=cf(null,t,e,i,r));else{if(e!=null){var d=e.$$typeof;if(d===M){t.tag=11,t=Vv(null,t,e,i,r);break e}else if(d===_){t.tag=14,t=Yv(null,t,e,i,r);break e}}throw t=F(e)||e,Error(o(306,t,""))}}return t;case 0:return cf(e,t,t.type,t.pendingProps,r);case 1:return i=t.type,d=El(i,t.pendingProps),Zv(e,t,i,d,r);case 3:e:{if(de(t,t.stateNode.containerInfo),e===null)throw Error(o(387));i=t.pendingProps;var m=t.memoizedState;d=m.element,zd(e,t),Co(t,i,null,r);var S=t.memoizedState;if(i=S.cache,Or(t,Lt,i),i!==m.cache&&Ad(t,[Lt],r,!0),jo(),i=S.element,m.isDehydrated)if(m={element:i,isDehydrated:!1,cache:S.cache},t.updateQueue.baseState=m,t.memoizedState=m,t.flags&256){t=Jv(e,t,i,r);break e}else if(i!==d){d=aa(Error(o(424)),t),vo(d),t=Jv(e,t,i,r);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(wt=ia(e.firstChild),tn=t,Ge=!0,Mr=null,sa=!0,r=Kg(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(vl(),i===d){t=nr(e,t,r);break e}an(e,t,i,r)}t=t.child}return t;case 26:return sc(e,t),e===null?(r=hy(t.type,null,t.pendingProps,null))?t.memoizedState=r:Ge||(r=t.type,e=t.pendingProps,i=jc(ye.current).createElement(r),i[en]=t,i[yn]=e,rn(i,r,e),Xt(i),t.stateNode=i):t.memoizedState=hy(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return fe(t),e===null&&Ge&&(i=t.stateNode=uy(t.type,t.pendingProps,ye.current),tn=t,sa=!0,d=wt,Yr(t.type)?(Ff=d,wt=ia(i.firstChild)):wt=d),an(e,t,t.pendingProps.children,r),sc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ge&&((d=i=wt)&&(i=MC(i,t.type,t.pendingProps,sa),i!==null?(t.stateNode=i,tn=t,wt=ia(i.firstChild),sa=!1,d=!0):d=!1),d||Dr(t)),fe(t),d=t.type,m=t.pendingProps,S=e!==null?e.memoizedProps:null,i=m.children,Vf(d,m)?i=null:S!==null&&Vf(d,S)&&(t.flags|=32),t.memoizedState!==null&&(d=qd(e,t,Yj,null,null,r),Vo._currentValue=d),sc(e,t),an(e,t,i,r),t.child;case 6:return e===null&&Ge&&((e=r=wt)&&(r=DC(r,t.pendingProps,sa),r!==null?(t.stateNode=r,tn=t,wt=null,e=!0):e=!1),e||Dr(t)),null;case 13:return Wv(e,t,r);case 4:return de(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=jl(t,null,i,r):an(e,t,i,r),t.child;case 11:return Vv(e,t,t.type,t.pendingProps,r);case 7:return an(e,t,t.pendingProps,r),t.child;case 8:return an(e,t,t.pendingProps.children,r),t.child;case 12:return an(e,t,t.pendingProps.children,r),t.child;case 10:return i=t.pendingProps,Or(t,t.type,i.value),an(e,t,i.children,r),t.child;case 9:return d=t.type._context,i=t.pendingProps.children,yl(t),d=nn(d),i=i(d),t.flags|=1,an(e,t,i,r),t.child;case 14:return Yv(e,t,t.type,t.pendingProps,r);case 15:return Gv(e,t,t.type,t.pendingProps,r);case 19:return tx(e,t,r);case 31:return Wj(e,t,r);case 22:return Kv(e,t,r,t.pendingProps);case 24:return yl(t),i=nn(Lt),e===null?(d=Od(),d===null&&(d=pt,m=Md(),d.pooledCache=m,m.refCount++,m!==null&&(d.pooledCacheLanes|=r),d=m),t.memoizedState={parent:i,cache:d},kd(t),Or(t,Lt,d)):((e.lanes&r)!==0&&(zd(e,t),Co(t,null,null,r),jo()),d=e.memoizedState,m=t.memoizedState,d.parent!==i?(d={parent:i,cache:i},t.memoizedState=d,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=d),Or(t,Lt,i)):(i=m.cache,Or(t,Lt,i),i!==d.cache&&Ad(t,[Lt],r,!0))),an(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function ar(e){e.flags|=4}function vf(e,t,r,i,d){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(Ax())e.flags|=8192;else throw Sl=Yi,_d}else e.flags&=-16777217}function ax(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!xy(t))if(Ax())e.flags|=8192;else throw Sl=Yi,_d}function ic(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ue():536870912,e.lanes|=t,bs|=t)}function Mo(e,t){if(!Ge)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function St(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var d=e.child;d!==null;)r|=d.lanes|d.childLanes,i|=d.subtreeFlags&65011712,i|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)r|=d.lanes|d.childLanes,i|=d.subtreeFlags,i|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function tC(e,t,r){var i=t.pendingProps;switch(Cd(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(t),null;case 1:return St(t),null;case 3:return r=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Wa(Lt),ve(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(os(t)?ar(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Nd())),St(t),null;case 26:var d=t.type,m=t.memoizedState;return e===null?(ar(t),m!==null?(St(t),ax(t,m)):(St(t),vf(t,d,null,i,r))):m?m!==e.memoizedState?(ar(t),St(t),ax(t,m)):(St(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&ar(t),St(t),vf(t,d,e,i,r)),null;case 27:if(De(t),r=ye.current,d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&ar(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return St(t),null}e=re.current,os(t)?Lg(t):(e=uy(d,i,r),t.stateNode=e,ar(t))}return St(t),null;case 5:if(De(t),d=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&ar(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return St(t),null}if(m=re.current,os(t))Lg(t);else{var S=jc(ye.current);switch(m){case 1:m=S.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:m=S.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":m=S.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":m=S.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":m=S.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof i.is=="string"?S.createElement("select",{is:i.is}):S.createElement("select"),i.multiple?m.multiple=!0:i.size&&(m.size=i.size);break;default:m=typeof i.is=="string"?S.createElement(d,{is:i.is}):S.createElement(d)}}m[en]=t,m[yn]=i;e:for(S=t.child;S!==null;){if(S.tag===5||S.tag===6)m.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===t)break e;for(;S.sibling===null;){if(S.return===null||S.return===t)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}t.stateNode=m;e:switch(rn(m,d,i),d){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&ar(t)}}return St(t),vf(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,r),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&ar(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(o(166));if(e=ye.current,os(t)){if(e=t.stateNode,r=t.memoizedProps,i=null,d=tn,d!==null)switch(d.tag){case 27:case 5:i=d.memoizedProps}e[en]=t,e=!!(e.nodeValue===r||i!==null&&i.suppressHydrationWarning===!0||Wx(e.nodeValue,r)),e||Dr(t,!0)}else e=jc(e).createTextNode(i),e[en]=t,t.stateNode=e}return St(t),null;case 31:if(r=t.memoizedState,e===null||e.memoizedState!==null){if(i=os(t),r!==null){if(e===null){if(!i)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[en]=t}else vl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;St(t),e=!1}else r=Nd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return t.flags&256?(Bn(t),t):(Bn(t),null);if((t.flags&128)!==0)throw Error(o(558))}return St(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=os(t),i!==null&&i.dehydrated!==null){if(e===null){if(!d)throw Error(o(318));if(d=t.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(o(317));d[en]=t}else vl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;St(t),d=!1}else d=Nd(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return t.flags&256?(Bn(t),t):(Bn(t),null)}return Bn(t),(t.flags&128)!==0?(t.lanes=r,t):(r=i!==null,e=e!==null&&e.memoizedState!==null,r&&(i=t.child,d=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(d=i.alternate.memoizedState.cachePool.pool),m=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(m=i.memoizedState.cachePool.pool),m!==d&&(i.flags|=2048)),r!==e&&r&&(t.child.flags|=8192),ic(t,t.updateQueue),St(t),null);case 4:return ve(),e===null&&Bf(t.stateNode.containerInfo),St(t),null;case 10:return Wa(t.type),St(t),null;case 19:if(H(_t),i=t.memoizedState,i===null)return St(t),null;if(d=(t.flags&128)!==0,m=i.rendering,m===null)if(d)Mo(i,!1);else{if(Dt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(m=Fi(e),m!==null){for(t.flags|=128,Mo(i,!1),e=m.updateQueue,t.updateQueue=e,ic(t,e),t.subtreeFlags=0,e=r,r=t.child;r!==null;)Dg(r,e),r=r.sibling;return Z(_t,_t.current&1|2),Ge&&Za(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&Kt()>hc&&(t.flags|=128,d=!0,Mo(i,!1),t.lanes=4194304)}else{if(!d)if(e=Fi(m),e!==null){if(t.flags|=128,d=!0,e=e.updateQueue,t.updateQueue=e,ic(t,e),Mo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!m.alternate&&!Ge)return St(t),null}else 2*Kt()-i.renderingStartTime>hc&&r!==536870912&&(t.flags|=128,d=!0,Mo(i,!1),t.lanes=4194304);i.isBackwards?(m.sibling=t.child,t.child=m):(e=i.last,e!==null?e.sibling=m:t.child=m,i.last=m)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Kt(),e.sibling=null,r=_t.current,Z(_t,d?r&1|2:r&1),Ge&&Za(t,i.treeForkCount),e):(St(t),null);case 22:case 23:return Bn(t),Bd(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(r&536870912)!==0&&(t.flags&128)===0&&(St(t),t.subtreeFlags&6&&(t.flags|=8192)):St(t),r=t.updateQueue,r!==null&&ic(t,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==r&&(t.flags|=2048),e!==null&&H(bl),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Wa(Lt),St(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function nC(e,t){switch(Cd(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wa(Lt),ve(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return De(t),null;case 31:if(t.memoizedState!==null){if(Bn(t),t.alternate===null)throw Error(o(340));vl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Bn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));vl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(_t),null;case 4:return ve(),null;case 10:return Wa(t.type),null;case 22:case 23:return Bn(t),Bd(),e!==null&&H(bl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Wa(Lt),null;case 25:return null;default:return null}}function rx(e,t){switch(Cd(t),t.tag){case 3:Wa(Lt),ve();break;case 26:case 27:case 5:De(t);break;case 4:ve();break;case 31:t.memoizedState!==null&&Bn(t);break;case 13:Bn(t);break;case 19:H(_t);break;case 10:Wa(t.type);break;case 22:case 23:Bn(t),Bd(),e!==null&&H(bl);break;case 24:Wa(Lt)}}function Do(e,t){try{var r=t.updateQueue,i=r!==null?r.lastEffect:null;if(i!==null){var d=i.next;r=d;do{if((r.tag&e)===e){i=void 0;var m=r.create,S=r.inst;i=m(),S.destroy=i}r=r.next}while(r!==d)}}catch(T){ct(t,t.return,T)}}function Ir(e,t,r){try{var i=t.updateQueue,d=i!==null?i.lastEffect:null;if(d!==null){var m=d.next;i=m;do{if((i.tag&e)===e){var S=i.inst,T=S.destroy;if(T!==void 0){S.destroy=void 0,d=t;var L=r,X=T;try{X()}catch(ne){ct(d,L,ne)}}}i=i.next}while(i!==m)}}catch(ne){ct(t,t.return,ne)}}function lx(e){var t=e.updateQueue;if(t!==null){var r=e.stateNode;try{Fg(t,r)}catch(i){ct(e,e.return,i)}}}function sx(e,t,r){r.props=El(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(i){ct(e,t,i)}}function Oo(e,t){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof r=="function"?e.refCleanup=r(i):r.current=i}}catch(d){ct(e,t,d)}}function Ma(e,t){var r=e.ref,i=e.refCleanup;if(r!==null)if(typeof i=="function")try{i()}catch(d){ct(e,t,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(d){ct(e,t,d)}else r.current=null}function ox(e){var t=e.type,r=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":r.autoFocus&&i.focus();break e;case"img":r.src?i.src=r.src:r.srcSet&&(i.srcset=r.srcSet)}}catch(d){ct(e,e.return,d)}}function xf(e,t,r){try{var i=e.stateNode;CC(i,e.type,r,t),i[yn]=t}catch(d){ct(e,e.return,d)}}function ix(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Yr(e.type)||e.tag===4}function yf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ix(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&&Yr(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 bf(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,t):(t=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,t.appendChild(e),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Xa));else if(i!==4&&(i===27&&Yr(e.type)&&(r=e.stateNode,t=null),e=e.child,e!==null))for(bf(e,t,r),e=e.sibling;e!==null;)bf(e,t,r),e=e.sibling}function cc(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(i===27&&Yr(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(cc(e,t,r),e=e.sibling;e!==null;)cc(e,t,r),e=e.sibling}function cx(e){var t=e.stateNode,r=e.memoizedProps;try{for(var i=e.type,d=t.attributes;d.length;)t.removeAttributeNode(d[0]);rn(t,i,r),t[en]=e,t[yn]=r}catch(m){ct(e,e.return,m)}}var rr=!1,Bt=!1,wf=!1,ux=typeof WeakSet=="function"?WeakSet:Set,Ft=null;function aC(e,t){if(e=e.containerInfo,qf=Mc,e=Sg(e),hd(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var d=i.anchorOffset,m=i.focusNode;i=i.focusOffset;try{r.nodeType,m.nodeType}catch{r=null;break e}var S=0,T=-1,L=-1,X=0,ne=0,le=e,Q=null;t:for(;;){for(var J;le!==r||d!==0&&le.nodeType!==3||(T=S+d),le!==m||i!==0&&le.nodeType!==3||(L=S+i),le.nodeType===3&&(S+=le.nodeValue.length),(J=le.firstChild)!==null;)Q=le,le=J;for(;;){if(le===e)break t;if(Q===r&&++X===d&&(T=S),Q===m&&++ne===i&&(L=S),(J=le.nextSibling)!==null)break;le=Q,Q=le.parentNode}le=J}r=T===-1||L===-1?null:{start:T,end:L}}else r=null}r=r||{start:0,end:0}}else r=null;for($f={focusedElem:e,selectionRange:r},Mc=!1,Ft=t;Ft!==null;)if(t=Ft,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ft=e;else for(;Ft!==null;){switch(t=Ft,m=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(r=0;r<e.length;r++)d=e[r],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&m!==null){e=void 0,r=t,d=m.memoizedProps,m=m.memoizedState,i=r.stateNode;try{var we=El(r.type,d);e=i.getSnapshotBeforeUpdate(we,m),i.__reactInternalSnapshotBeforeUpdate=e}catch(Ae){ct(r,r.return,Ae)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,r=e.nodeType,r===9)Gf(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Gf(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(o(163))}if(e=t.sibling,e!==null){e.return=t.return,Ft=e;break}Ft=t.return}}function dx(e,t,r){var i=r.flags;switch(r.tag){case 0:case 11:case 15:sr(e,r),i&4&&Do(5,r);break;case 1:if(sr(e,r),i&4)if(e=r.stateNode,t===null)try{e.componentDidMount()}catch(S){ct(r,r.return,S)}else{var d=El(r.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(d,t,e.__reactInternalSnapshotBeforeUpdate)}catch(S){ct(r,r.return,S)}}i&64&&lx(r),i&512&&Oo(r,r.return);break;case 3:if(sr(e,r),i&64&&(e=r.updateQueue,e!==null)){if(t=null,r.child!==null)switch(r.child.tag){case 27:case 5:t=r.child.stateNode;break;case 1:t=r.child.stateNode}try{Fg(e,t)}catch(S){ct(r,r.return,S)}}break;case 27:t===null&&i&4&&cx(r);case 26:case 5:sr(e,r),t===null&&i&4&&ox(r),i&512&&Oo(r,r.return);break;case 12:sr(e,r);break;case 31:sr(e,r),i&4&&mx(e,r);break;case 13:sr(e,r),i&4&&px(e,r),i&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=fC.bind(null,r),OC(e,r))));break;case 22:if(i=r.memoizedState!==null||rr,!i){t=t!==null&&t.memoizedState!==null||Bt,d=rr;var m=Bt;rr=i,(Bt=t)&&!m?or(e,r,(r.subtreeFlags&8772)!==0):sr(e,r),rr=d,Bt=m}break;case 30:break;default:sr(e,r)}}function fx(e){var t=e.alternate;t!==null&&(e.alternate=null,fx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Qu(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 Et=null,wn=!1;function lr(e,t,r){for(r=r.child;r!==null;)hx(e,t,r),r=r.sibling}function hx(e,t,r){if(At&&typeof At.onCommitFiberUnmount=="function")try{At.onCommitFiberUnmount(ma,r)}catch{}switch(r.tag){case 26:Bt||Ma(r,t),lr(e,t,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:Bt||Ma(r,t);var i=Et,d=wn;Yr(r.type)&&(Et=r.stateNode,wn=!1),lr(e,t,r),Ho(r.stateNode),Et=i,wn=d;break;case 5:Bt||Ma(r,t);case 6:if(i=Et,d=wn,Et=null,lr(e,t,r),Et=i,wn=d,Et!==null)if(wn)try{(Et.nodeType===9?Et.body:Et.nodeName==="HTML"?Et.ownerDocument.body:Et).removeChild(r.stateNode)}catch(m){ct(r,t,m)}else try{Et.removeChild(r.stateNode)}catch(m){ct(r,t,m)}break;case 18:Et!==null&&(wn?(e=Et,ly(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),Ts(e)):ly(Et,r.stateNode));break;case 4:i=Et,d=wn,Et=r.stateNode.containerInfo,wn=!0,lr(e,t,r),Et=i,wn=d;break;case 0:case 11:case 14:case 15:Ir(2,r,t),Bt||Ir(4,r,t),lr(e,t,r);break;case 1:Bt||(Ma(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"&&sx(r,t,i)),lr(e,t,r);break;case 21:lr(e,t,r);break;case 22:Bt=(i=Bt)||r.memoizedState!==null,lr(e,t,r),Bt=i;break;default:lr(e,t,r)}}function mx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ts(e)}catch(r){ct(t,t.return,r)}}}function px(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ts(e)}catch(r){ct(t,t.return,r)}}function rC(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ux),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ux),t;default:throw Error(o(435,e.tag))}}function uc(e,t){var r=rC(e);t.forEach(function(i){if(!r.has(i)){r.add(i);var d=hC.bind(null,e,i);i.then(d,d)}})}function Sn(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var d=r[i],m=e,S=t,T=S;e:for(;T!==null;){switch(T.tag){case 27:if(Yr(T.type)){Et=T.stateNode,wn=!1;break e}break;case 5:Et=T.stateNode,wn=!1;break e;case 3:case 4:Et=T.stateNode.containerInfo,wn=!0;break e}T=T.return}if(Et===null)throw Error(o(160));hx(m,S,d),Et=null,wn=!1,m=d.alternate,m!==null&&(m.return=null),d.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gx(t,e),t=t.sibling}var va=null;function gx(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Sn(t,e),jn(e),i&4&&(Ir(3,e,e.return),Do(3,e),Ir(5,e,e.return));break;case 1:Sn(t,e),jn(e),i&512&&(Bt||r===null||Ma(r,r.return)),i&64&&rr&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?i:r.concat(i))));break;case 26:var d=va;if(Sn(t,e),jn(e),i&512&&(Bt||r===null||Ma(r,r.return)),i&4){var m=r!==null?r.memoizedState:null;if(i=e.memoizedState,r===null)if(i===null)if(e.stateNode===null){e:{i=e.type,r=e.memoizedProps,d=d.ownerDocument||d;t:switch(i){case"title":m=d.getElementsByTagName("title")[0],(!m||m[ro]||m[en]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=d.createElement(i),d.head.insertBefore(m,d.querySelector("head > title"))),rn(m,i,r),m[en]=e,Xt(m),i=m;break e;case"link":var S=gy("link","href",d).get(i+(r.href||""));if(S){for(var T=0;T<S.length;T++)if(m=S[T],m.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&m.getAttribute("rel")===(r.rel==null?null:r.rel)&&m.getAttribute("title")===(r.title==null?null:r.title)&&m.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){S.splice(T,1);break t}}m=d.createElement(i),rn(m,i,r),d.head.appendChild(m);break;case"meta":if(S=gy("meta","content",d).get(i+(r.content||""))){for(T=0;T<S.length;T++)if(m=S[T],m.getAttribute("content")===(r.content==null?null:""+r.content)&&m.getAttribute("name")===(r.name==null?null:r.name)&&m.getAttribute("property")===(r.property==null?null:r.property)&&m.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&m.getAttribute("charset")===(r.charSet==null?null:r.charSet)){S.splice(T,1);break t}}m=d.createElement(i),rn(m,i,r),d.head.appendChild(m);break;default:throw Error(o(468,i))}m[en]=e,Xt(m),i=m}e.stateNode=i}else vy(d,e.type,e.stateNode);else e.stateNode=py(d,i,e.memoizedProps);else m!==i?(m===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):m.count--,i===null?vy(d,e.type,e.stateNode):py(d,i,e.memoizedProps)):i===null&&e.stateNode!==null&&xf(e,e.memoizedProps,r.memoizedProps)}break;case 27:Sn(t,e),jn(e),i&512&&(Bt||r===null||Ma(r,r.return)),r!==null&&i&4&&xf(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Sn(t,e),jn(e),i&512&&(Bt||r===null||Ma(r,r.return)),e.flags&32){d=e.stateNode;try{Zl(d,"")}catch(we){ct(e,e.return,we)}}i&4&&e.stateNode!=null&&(d=e.memoizedProps,xf(e,d,r!==null?r.memoizedProps:d)),i&1024&&(wf=!0);break;case 6:if(Sn(t,e),jn(e),i&4){if(e.stateNode===null)throw Error(o(162));i=e.memoizedProps,r=e.stateNode;try{r.nodeValue=i}catch(we){ct(e,e.return,we)}}break;case 3:if(Nc=null,d=va,va=Cc(t.containerInfo),Sn(t,e),va=d,jn(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Ts(t.containerInfo)}catch(we){ct(e,e.return,we)}wf&&(wf=!1,vx(e));break;case 4:i=va,va=Cc(e.stateNode.containerInfo),Sn(t,e),jn(e),va=i;break;case 12:Sn(t,e),jn(e);break;case 31:Sn(t,e),jn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,uc(e,i)));break;case 13:Sn(t,e),jn(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(fc=Kt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,uc(e,i)));break;case 22:d=e.memoizedState!==null;var L=r!==null&&r.memoizedState!==null,X=rr,ne=Bt;if(rr=X||d,Bt=ne||L,Sn(t,e),Bt=ne,rr=X,jn(e),i&8192)e:for(t=e.stateNode,t._visibility=d?t._visibility&-2:t._visibility|1,d&&(r===null||L||rr||Bt||Nl(e)),r=null,t=e;;){if(t.tag===5||t.tag===26){if(r===null){L=r=t;try{if(m=L.stateNode,d)S=m.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{T=L.stateNode;var le=L.memoizedProps.style,Q=le!=null&&le.hasOwnProperty("display")?le.display:null;T.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(we){ct(L,L.return,we)}}}else if(t.tag===6){if(r===null){L=t;try{L.stateNode.nodeValue=d?"":L.memoizedProps}catch(we){ct(L,L.return,we)}}}else if(t.tag===18){if(r===null){L=t;try{var J=L.stateNode;d?sy(J,!0):sy(L.stateNode,!1)}catch(we){ct(L,L.return,we)}}}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;r===t&&(r=null),t=t.return}r===t&&(r=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(r=i.retryQueue,r!==null&&(i.retryQueue=null,uc(e,r))));break;case 19:Sn(t,e),jn(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,uc(e,i)));break;case 30:break;case 21:break;default:Sn(t,e),jn(e)}}function jn(e){var t=e.flags;if(t&2){try{for(var r,i=e.return;i!==null;){if(ix(i)){r=i;break}i=i.return}if(r==null)throw Error(o(160));switch(r.tag){case 27:var d=r.stateNode,m=yf(e);cc(e,m,d);break;case 5:var S=r.stateNode;r.flags&32&&(Zl(S,""),r.flags&=-33);var T=yf(e);cc(e,T,S);break;case 3:case 4:var L=r.stateNode.containerInfo,X=yf(e);bf(e,X,L);break;default:throw Error(o(161))}}catch(ne){ct(e,e.return,ne)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function vx(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;vx(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function sr(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)dx(e,t.alternate,t),t=t.sibling}function Nl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ir(4,t,t.return),Nl(t);break;case 1:Ma(t,t.return);var r=t.stateNode;typeof r.componentWillUnmount=="function"&&sx(t,t.return,r),Nl(t);break;case 27:Ho(t.stateNode);case 26:case 5:Ma(t,t.return),Nl(t);break;case 22:t.memoizedState===null&&Nl(t);break;case 30:Nl(t);break;default:Nl(t)}e=e.sibling}}function or(e,t,r){for(r=r&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,d=e,m=t,S=m.flags;switch(m.tag){case 0:case 11:case 15:or(d,m,r),Do(4,m);break;case 1:if(or(d,m,r),i=m,d=i.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(X){ct(i,i.return,X)}if(i=m,d=i.updateQueue,d!==null){var T=i.stateNode;try{var L=d.shared.hiddenCallbacks;if(L!==null)for(d.shared.hiddenCallbacks=null,d=0;d<L.length;d++)Xg(L[d],T)}catch(X){ct(i,i.return,X)}}r&&S&64&&lx(m),Oo(m,m.return);break;case 27:cx(m);case 26:case 5:or(d,m,r),r&&i===null&&S&4&&ox(m),Oo(m,m.return);break;case 12:or(d,m,r);break;case 31:or(d,m,r),r&&S&4&&mx(d,m);break;case 13:or(d,m,r),r&&S&4&&px(d,m);break;case 22:m.memoizedState===null&&or(d,m,r),Oo(m,m.return);break;case 30:break;default:or(d,m,r)}t=t.sibling}}function Sf(e,t){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&xo(r))}function jf(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&xo(e))}function xa(e,t,r,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)xx(e,t,r,i),t=t.sibling}function xx(e,t,r,i){var d=t.flags;switch(t.tag){case 0:case 11:case 15:xa(e,t,r,i),d&2048&&Do(9,t);break;case 1:xa(e,t,r,i);break;case 3:xa(e,t,r,i),d&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&xo(e)));break;case 12:if(d&2048){xa(e,t,r,i),e=t.stateNode;try{var m=t.memoizedProps,S=m.id,T=m.onPostCommit;typeof T=="function"&&T(S,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(L){ct(t,t.return,L)}}else xa(e,t,r,i);break;case 31:xa(e,t,r,i);break;case 13:xa(e,t,r,i);break;case 23:break;case 22:m=t.stateNode,S=t.alternate,t.memoizedState!==null?m._visibility&2?xa(e,t,r,i):_o(e,t):m._visibility&2?xa(e,t,r,i):(m._visibility|=2,vs(e,t,r,i,(t.subtreeFlags&10256)!==0||!1)),d&2048&&Sf(S,t);break;case 24:xa(e,t,r,i),d&2048&&jf(t.alternate,t);break;default:xa(e,t,r,i)}}function vs(e,t,r,i,d){for(d=d&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var m=e,S=t,T=r,L=i,X=S.flags;switch(S.tag){case 0:case 11:case 15:vs(m,S,T,L,d),Do(8,S);break;case 23:break;case 22:var ne=S.stateNode;S.memoizedState!==null?ne._visibility&2?vs(m,S,T,L,d):_o(m,S):(ne._visibility|=2,vs(m,S,T,L,d)),d&&X&2048&&Sf(S.alternate,S);break;case 24:vs(m,S,T,L,d),d&&X&2048&&jf(S.alternate,S);break;default:vs(m,S,T,L,d)}t=t.sibling}}function _o(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var r=e,i=t,d=i.flags;switch(i.tag){case 22:_o(r,i),d&2048&&Sf(i.alternate,i);break;case 24:_o(r,i),d&2048&&jf(i.alternate,i);break;default:_o(r,i)}t=t.sibling}}var ko=8192;function xs(e,t,r){if(e.subtreeFlags&ko)for(e=e.child;e!==null;)yx(e,t,r),e=e.sibling}function yx(e,t,r){switch(e.tag){case 26:xs(e,t,r),e.flags&ko&&e.memoizedState!==null&&VC(r,va,e.memoizedState,e.memoizedProps);break;case 5:xs(e,t,r);break;case 3:case 4:var i=va;va=Cc(e.stateNode.containerInfo),xs(e,t,r),va=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=ko,ko=16777216,xs(e,t,r),ko=i):xs(e,t,r));break;default:xs(e,t,r)}}function bx(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 zo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var i=t[r];Ft=i,Sx(i,e)}bx(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)wx(e),e=e.sibling}function wx(e){switch(e.tag){case 0:case 11:case 15:zo(e),e.flags&2048&&Ir(9,e,e.return);break;case 3:zo(e);break;case 12:zo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,dc(e)):zo(e);break;default:zo(e)}}function dc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var r=0;r<t.length;r++){var i=t[r];Ft=i,Sx(i,e)}bx(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ir(8,t,t.return),dc(t);break;case 22:r=t.stateNode,r._visibility&2&&(r._visibility&=-3,dc(t));break;default:dc(t)}e=e.sibling}}function Sx(e,t){for(;Ft!==null;){var r=Ft;switch(r.tag){case 0:case 11:case 15:Ir(8,r,t);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var i=r.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:xo(r.memoizedState.cache)}if(i=r.child,i!==null)i.return=r,Ft=i;else e:for(r=e;Ft!==null;){i=Ft;var d=i.sibling,m=i.return;if(fx(i),i===r){Ft=null;break e}if(d!==null){d.return=m,Ft=d;break e}Ft=m}}}var lC={getCacheForType:function(e){var t=nn(Lt),r=t.data.get(e);return r===void 0&&(r=e(),t.data.set(e,r)),r},cacheSignal:function(){return nn(Lt).controller.signal}},sC=typeof WeakMap=="function"?WeakMap:Map,et=0,pt=null,He=null,$e=0,it=0,Pn=null,Br=!1,ys=!1,Cf=!1,ir=0,Dt=0,Pr=0,Rl=0,Ef=0,Hn=0,bs=0,Lo=null,Cn=null,Nf=!1,fc=0,jx=0,hc=1/0,mc=null,Hr=null,qt=0,qr=null,ws=null,cr=0,Rf=0,Tf=null,Cx=null,Uo=0,Af=null;function qn(){return(et&2)!==0&&$e!==0?$e&-$e:k.T!==null?zf():pa()}function Ex(){if(Hn===0)if(($e&536870912)===0||Ge){var e=Nr;Nr<<=1,(Nr&3932160)===0&&(Nr=262144),Hn=e}else Hn=536870912;return e=In.current,e!==null&&(e.flags|=32),Hn}function En(e,t,r){(e===pt&&(it===2||it===9)||e.cancelPendingCommit!==null)&&(Ss(e,0),$r(e,$e,Hn,!1)),Ct(e,r),((et&2)===0||e!==pt)&&(e===pt&&((et&2)===0&&(Rl|=r),Dt===4&&$r(e,$e,Hn,!1)),Da(e))}function Nx(e,t,r){if((et&6)!==0)throw Error(o(327));var i=!r&&(t&127)===0&&(t&e.expiredLanes)===0||Ce(e,t),d=i?cC(e,t):Df(e,t,!0),m=i;do{if(d===0){ys&&!i&&$r(e,t,0,!1);break}else{if(r=e.current.alternate,m&&!oC(r)){d=Df(e,t,!1),m=!1;continue}if(d===2){if(m=t,e.errorRecoveryDisabledLanes&m)var S=0;else S=e.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){t=S;e:{var T=e;d=Lo;var L=T.current.memoizedState.isDehydrated;if(L&&(Ss(T,S).flags|=256),S=Df(T,S,!1),S!==2){if(Cf&&!L){T.errorRecoveryDisabledLanes|=m,Rl|=m,d=4;break e}m=Cn,Cn=d,m!==null&&(Cn===null?Cn=m:Cn.push.apply(Cn,m))}d=S}if(m=!1,d!==2)continue}}if(d===1){Ss(e,0),$r(e,t,0,!0);break}e:{switch(i=e,m=d,m){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:$r(i,t,Hn,!Br);break e;case 2:Cn=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(d=fc+300-Kt(),10<d)){if($r(i,t,Hn,!Br),zt(i,0,!0)!==0)break e;cr=t,i.timeoutHandle=ay(Rx.bind(null,i,r,Cn,mc,Nf,t,Hn,Rl,bs,Br,m,"Throttled",-0,0),d);break e}Rx(i,r,Cn,mc,Nf,t,Hn,Rl,bs,Br,m,null,-0,0)}}break}while(!0);Da(e)}function Rx(e,t,r,i,d,m,S,T,L,X,ne,le,Q,J){if(e.timeoutHandle=-1,le=t.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xa},yx(t,m,le);var we=(m&62914560)===m?fc-Kt():(m&4194048)===m?jx-Kt():0;if(we=YC(le,we),we!==null){cr=m,e.cancelPendingCommit=we(zx.bind(null,e,t,m,r,i,d,S,T,L,ne,le,null,Q,J)),$r(e,m,S,!X);return}}zx(e,t,m,r,i,d,S,T,L)}function oC(e){for(var t=e;;){var r=t.tag;if((r===0||r===11||r===15)&&t.flags&16384&&(r=t.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var i=0;i<r.length;i++){var d=r[i],m=d.getSnapshot;d=d.value;try{if(!Ln(m(),d))return!1}catch{return!1}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function $r(e,t,r,i){t&=~Ef,t&=~Rl,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var d=t;0<d;){var m=31-Tt(d),S=1<<m;i[m]=-1,d&=~S}r!==0&&Ht(e,r,t)}function pc(){return(et&6)===0?(Io(0),!1):!0}function Mf(){if(He!==null){if(it===0)var e=He.return;else e=He,Ja=xl=null,Yd(e),fs=null,bo=0,e=He;for(;e!==null;)rx(e.alternate,e),e=e.return;He=null}}function Ss(e,t){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,RC(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),cr=0,Mf(),pt=e,He=r=Qa(e.current,null),$e=t,it=0,Pn=null,Br=!1,ys=Ce(e,t),Cf=!1,bs=Hn=Ef=Rl=Pr=Dt=0,Cn=Lo=null,Nf=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var d=31-Tt(i),m=1<<d;t|=e[d],i&=~m}return ir=t,Li(),r}function Tx(e,t){Le=null,k.H=To,t===ds||t===Vi?(t=Vg(),it=3):t===_d?(t=Vg(),it=4):it=t===of?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Pn=t,He===null&&(Dt=1,rc(e,aa(t,e.current)))}function Ax(){var e=In.current;return e===null?!0:($e&4194048)===$e?oa===null:($e&62914560)===$e||($e&536870912)!==0?e===oa:!1}function Mx(){var e=k.H;return k.H=To,e===null?To:e}function Dx(){var e=k.A;return k.A=lC,e}function gc(){Dt=4,Br||($e&4194048)!==$e&&In.current!==null||(ys=!0),(Pr&134217727)===0&&(Rl&134217727)===0||pt===null||$r(pt,$e,Hn,!1)}function Df(e,t,r){var i=et;et|=2;var d=Mx(),m=Dx();(pt!==e||$e!==t)&&(mc=null,Ss(e,t)),t=!1;var S=Dt;e:do try{if(it!==0&&He!==null){var T=He,L=Pn;switch(it){case 8:Mf(),S=6;break e;case 3:case 2:case 9:case 6:In.current===null&&(t=!0);var X=it;if(it=0,Pn=null,js(e,T,L,X),r&&ys){S=0;break e}break;default:X=it,it=0,Pn=null,js(e,T,L,X)}}iC(),S=Dt;break}catch(ne){Tx(e,ne)}while(!0);return t&&e.shellSuspendCounter++,Ja=xl=null,et=i,k.H=d,k.A=m,He===null&&(pt=null,$e=0,Li()),S}function iC(){for(;He!==null;)Ox(He)}function cC(e,t){var r=et;et|=2;var i=Mx(),d=Dx();pt!==e||$e!==t?(mc=null,hc=Kt()+500,Ss(e,t)):ys=Ce(e,t);e:do try{if(it!==0&&He!==null){t=He;var m=Pn;t:switch(it){case 1:it=0,Pn=null,js(e,t,m,1);break;case 2:case 9:if(qg(m)){it=0,Pn=null,_x(t);break}t=function(){it!==2&&it!==9||pt!==e||(it=7),Da(e)},m.then(t,t);break e;case 3:it=7;break e;case 4:it=5;break e;case 7:qg(m)?(it=0,Pn=null,_x(t)):(it=0,Pn=null,js(e,t,m,7));break;case 5:var S=null;switch(He.tag){case 26:S=He.memoizedState;case 5:case 27:var T=He;if(S?xy(S):T.stateNode.complete){it=0,Pn=null;var L=T.sibling;if(L!==null)He=L;else{var X=T.return;X!==null?(He=X,vc(X)):He=null}break t}}it=0,Pn=null,js(e,t,m,5);break;case 6:it=0,Pn=null,js(e,t,m,6);break;case 8:Mf(),Dt=6;break e;default:throw Error(o(462))}}uC();break}catch(ne){Tx(e,ne)}while(!0);return Ja=xl=null,k.H=i,k.A=d,et=r,He!==null?0:(pt=null,$e=0,Li(),Dt)}function uC(){for(;He!==null&&!xn();)Ox(He)}function Ox(e){var t=nx(e.alternate,e,ir);e.memoizedProps=e.pendingProps,t===null?vc(e):He=t}function _x(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=Qv(r,t,t.pendingProps,t.type,void 0,$e);break;case 11:t=Qv(r,t,t.pendingProps,t.type.render,t.ref,$e);break;case 5:Yd(t);default:rx(r,t),t=He=Dg(t,ir),t=nx(r,t,ir)}e.memoizedProps=e.pendingProps,t===null?vc(e):He=t}function js(e,t,r,i){Ja=xl=null,Yd(t),fs=null,bo=0;var d=t.return;try{if(Jj(e,d,t,r,$e)){Dt=1,rc(e,aa(r,e.current)),He=null;return}}catch(m){if(d!==null)throw He=d,m;Dt=1,rc(e,aa(r,e.current)),He=null;return}t.flags&32768?(Ge||i===1?e=!0:ys||($e&536870912)!==0?e=!1:(Br=e=!0,(i===2||i===9||i===3||i===6)&&(i=In.current,i!==null&&i.tag===13&&(i.flags|=16384))),kx(t,e)):vc(t)}function vc(e){var t=e;do{if((t.flags&32768)!==0){kx(t,Br);return}e=t.return;var r=tC(t.alternate,t,ir);if(r!==null){He=r;return}if(t=t.sibling,t!==null){He=t;return}He=t=e}while(t!==null);Dt===0&&(Dt=5)}function kx(e,t){do{var r=nC(e.alternate,e);if(r!==null){r.flags&=32767,He=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&(e=e.sibling,e!==null)){He=e;return}He=e=r}while(e!==null);Dt=6,He=null}function zx(e,t,r,i,d,m,S,T,L){e.cancelPendingCommit=null;do xc();while(qt!==0);if((et&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(m=t.lanes|t.childLanes,m|=xd,ut(e,r,m,S,T,L),e===pt&&(He=pt=null,$e=0),ws=t,qr=e,cr=r,Rf=m,Tf=d,Cx=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,mC(zn,function(){return Px(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=k.T,k.T=null,d=$.p,$.p=2,S=et,et|=4;try{aC(e,t,r)}finally{et=S,$.p=d,k.T=i}}qt=1,Lx(),Ux(),Ix()}}function Lx(){if(qt===1){qt=0;var e=qr,t=ws,r=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||r){r=k.T,k.T=null;var i=$.p;$.p=2;var d=et;et|=4;try{gx(t,e);var m=$f,S=Sg(e.containerInfo),T=m.focusedElem,L=m.selectionRange;if(S!==T&&T&&T.ownerDocument&&wg(T.ownerDocument.documentElement,T)){if(L!==null&&hd(T)){var X=L.start,ne=L.end;if(ne===void 0&&(ne=X),"selectionStart"in T)T.selectionStart=X,T.selectionEnd=Math.min(ne,T.value.length);else{var le=T.ownerDocument||document,Q=le&&le.defaultView||window;if(Q.getSelection){var J=Q.getSelection(),we=T.textContent.length,Ae=Math.min(L.start,we),ht=L.end===void 0?Ae:Math.min(L.end,we);!J.extend&&Ae>ht&&(S=ht,ht=Ae,Ae=S);var Y=bg(T,Ae),P=bg(T,ht);if(Y&&P&&(J.rangeCount!==1||J.anchorNode!==Y.node||J.anchorOffset!==Y.offset||J.focusNode!==P.node||J.focusOffset!==P.offset)){var K=le.createRange();K.setStart(Y.node,Y.offset),J.removeAllRanges(),Ae>ht?(J.addRange(K),J.extend(P.node,P.offset)):(K.setEnd(P.node,P.offset),J.addRange(K))}}}}for(le=[],J=T;J=J.parentNode;)J.nodeType===1&&le.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof T.focus=="function"&&T.focus(),T=0;T<le.length;T++){var ae=le[T];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}Mc=!!qf,$f=qf=null}finally{et=d,$.p=i,k.T=r}}e.current=t,qt=2}}function Ux(){if(qt===2){qt=0;var e=qr,t=ws,r=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||r){r=k.T,k.T=null;var i=$.p;$.p=2;var d=et;et|=4;try{dx(e,t.alternate,t)}finally{et=d,$.p=i,k.T=r}}qt=3}}function Ix(){if(qt===4||qt===3){qt=0,Zn();var e=qr,t=ws,r=cr,i=Cx;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?qt=5:(qt=0,ws=qr=null,Bx(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Hr=null),Ga(r),t=t.stateNode,At&&typeof At.onCommitFiberRoot=="function")try{At.onCommitFiberRoot(ma,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=k.T,d=$.p,$.p=2,k.T=null;try{for(var m=e.onRecoverableError,S=0;S<i.length;S++){var T=i[S];m(T.value,{componentStack:T.stack})}}finally{k.T=t,$.p=d}}(cr&3)!==0&&xc(),Da(e),d=e.pendingLanes,(r&261930)!==0&&(d&42)!==0?e===Af?Uo++:(Uo=0,Af=e):Uo=0,Io(0)}}function Bx(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,xo(t)))}function xc(){return Lx(),Ux(),Ix(),Px()}function Px(){if(qt!==5)return!1;var e=qr,t=Rf;Rf=0;var r=Ga(cr),i=k.T,d=$.p;try{$.p=32>r?32:r,k.T=null,r=Tf,Tf=null;var m=qr,S=cr;if(qt=0,ws=qr=null,cr=0,(et&6)!==0)throw Error(o(331));var T=et;if(et|=4,wx(m.current),xx(m,m.current,S,r),et=T,Io(0,!1),At&&typeof At.onPostCommitFiberRoot=="function")try{At.onPostCommitFiberRoot(ma,m)}catch{}return!0}finally{$.p=d,k.T=i,Bx(e,t)}}function Hx(e,t,r){t=aa(r,t),t=sf(e.stateNode,t,2),e=zr(e,t,2),e!==null&&(Ct(e,2),Da(e))}function ct(e,t,r){if(e.tag===3)Hx(e,e,r);else for(;t!==null;){if(t.tag===3){Hx(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Hr===null||!Hr.has(i))){e=aa(r,e),r=qv(2),i=zr(t,r,2),i!==null&&($v(r,i,t,e),Ct(i,2),Da(i));break}}t=t.return}}function Of(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new sC;var d=new Set;i.set(t,d)}else d=i.get(t),d===void 0&&(d=new Set,i.set(t,d));d.has(r)||(Cf=!0,d.add(r),e=dC.bind(null,e,t,r),t.then(e,e))}function dC(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,pt===e&&($e&r)===r&&(Dt===4||Dt===3&&($e&62914560)===$e&&300>Kt()-fc?(et&2)===0&&Ss(e,0):Ef|=r,bs===$e&&(bs=0)),Da(e)}function qx(e,t){t===0&&(t=Ue()),e=pl(e,t),e!==null&&(Ct(e,t),Da(e))}function fC(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),qx(e,r)}function hC(e,t){var r=0;switch(e.tag){case 31:case 13:var i=e.stateNode,d=e.memoizedState;d!==null&&(r=d.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(o(314))}i!==null&&i.delete(t),qx(e,r)}function mC(e,t){return Rt(e,t)}var yc=null,Cs=null,_f=!1,bc=!1,kf=!1,Vr=0;function Da(e){e!==Cs&&e.next===null&&(Cs===null?yc=Cs=e:Cs=Cs.next=e),bc=!0,_f||(_f=!0,gC())}function Io(e,t){if(!kf&&bc){kf=!0;do for(var r=!1,i=yc;i!==null;){if(e!==0){var d=i.pendingLanes;if(d===0)var m=0;else{var S=i.suspendedLanes,T=i.pingedLanes;m=(1<<31-Tt(42|e)+1)-1,m&=d&~(S&~T),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(r=!0,Gx(i,m))}else m=$e,m=zt(i,i===pt?m:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(m&3)===0||Ce(i,m)||(r=!0,Gx(i,m));i=i.next}while(r);kf=!1}}function pC(){$x()}function $x(){bc=_f=!1;var e=0;Vr!==0&&NC()&&(e=Vr);for(var t=Kt(),r=null,i=yc;i!==null;){var d=i.next,m=Vx(i,t);m===0?(i.next=null,r===null?yc=d:r.next=d,d===null&&(Cs=r)):(r=i,(e!==0||(m&3)!==0)&&(bc=!0)),i=d}qt!==0&&qt!==5||Io(e),Vr!==0&&(Vr=0)}function Vx(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,d=e.expirationTimes,m=e.pendingLanes&-62914561;0<m;){var S=31-Tt(m),T=1<<S,L=d[S];L===-1?((T&r)===0||(T&i)!==0)&&(d[S]=ze(T,t)):L<=t&&(e.expiredLanes|=T),m&=~T}if(t=pt,r=$e,r=zt(e,e===t?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,r===0||e===t&&(it===2||it===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Gt(i),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||Ce(e,r)){if(t=r&-r,t===e.callbackPriority)return t;switch(i!==null&&Gt(i),Ga(r)){case 2:case 8:r=sn;break;case 32:r=zn;break;case 268435456:r=Ra;break;default:r=zn}return i=Yx.bind(null,e),r=Rt(r,i),e.callbackPriority=t,e.callbackNode=r,t}return i!==null&&i!==null&&Gt(i),e.callbackPriority=2,e.callbackNode=null,2}function Yx(e,t){if(qt!==0&&qt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(xc()&&e.callbackNode!==r)return null;var i=$e;return i=zt(e,e===pt?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Nx(e,i,t),Vx(e,Kt()),e.callbackNode!=null&&e.callbackNode===r?Yx.bind(null,e):null)}function Gx(e,t){if(xc())return null;Nx(e,t,!0)}function gC(){TC(function(){(et&6)!==0?Rt(Wt,pC):$x()})}function zf(){if(Vr===0){var e=cs;e===0&&(e=Va,Va<<=1,(Va&261888)===0&&(Va=256)),Vr=e}return Vr}function Kx(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ti(""+e)}function Xx(e,t){var r=t.ownerDocument.createElement("input");return r.name=t.name,r.value=t.value,e.id&&r.setAttribute("form",e.id),t.parentNode.insertBefore(r,t),e=new FormData(e),r.parentNode.removeChild(r),e}function vC(e,t,r,i,d){if(t==="submit"&&r&&r.stateNode===d){var m=Kx((d[yn]||null).action),S=i.submitter;S&&(t=(t=S[yn]||null)?Kx(t.formAction):S.getAttribute("formAction"),t!==null&&(m=t,S=null));var T=new Oi("action","action",null,i,d);e.push({event:T,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Vr!==0){var L=S?Xx(d,S):new FormData(d);ef(r,{pending:!0,data:L,method:d.method,action:m},null,L)}}else typeof m=="function"&&(T.preventDefault(),L=S?Xx(d,S):new FormData(d),ef(r,{pending:!0,data:L,method:d.method,action:m},m,L))},currentTarget:d}]})}}for(var Lf=0;Lf<vd.length;Lf++){var Uf=vd[Lf],xC=Uf.toLowerCase(),yC=Uf[0].toUpperCase()+Uf.slice(1);ga(xC,"on"+yC)}ga(Eg,"onAnimationEnd"),ga(Ng,"onAnimationIteration"),ga(Rg,"onAnimationStart"),ga("dblclick","onDoubleClick"),ga("focusin","onFocus"),ga("focusout","onBlur"),ga(zj,"onTransitionRun"),ga(Lj,"onTransitionStart"),ga(Uj,"onTransitionCancel"),ga(Tg,"onTransitionEnd"),Fl("onMouseEnter",["mouseout","mouseover"]),Fl("onMouseLeave",["mouseout","mouseover"]),Fl("onPointerEnter",["pointerout","pointerover"]),Fl("onPointerLeave",["pointerout","pointerover"]),dl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),dl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),dl("onBeforeInput",["compositionend","keypress","textInput","paste"]),dl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),dl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),dl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Bo="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(" "),bC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Bo));function Fx(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],d=i.event;i=i.listeners;e:{var m=void 0;if(t)for(var S=i.length-1;0<=S;S--){var T=i[S],L=T.instance,X=T.currentTarget;if(T=T.listener,L!==m&&d.isPropagationStopped())break e;m=T,d.currentTarget=X;try{m(d)}catch(ne){zi(ne)}d.currentTarget=null,m=L}else for(S=0;S<i.length;S++){if(T=i[S],L=T.instance,X=T.currentTarget,T=T.listener,L!==m&&d.isPropagationStopped())break e;m=T,d.currentTarget=X;try{m(d)}catch(ne){zi(ne)}d.currentTarget=null,m=L}}}}function qe(e,t){var r=t[Fu];r===void 0&&(r=t[Fu]=new Set);var i=e+"__bubble";r.has(i)||(Qx(t,e,2,!1),r.add(i))}function If(e,t,r){var i=0;t&&(i|=4),Qx(r,e,i,t)}var wc="_reactListening"+Math.random().toString(36).slice(2);function Bf(e){if(!e[wc]){e[wc]=!0,$p.forEach(function(r){r!=="selectionchange"&&(bC.has(r)||If(r,!1,e),If(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wc]||(t[wc]=!0,If("selectionchange",!1,t))}}function Qx(e,t,r,i){switch(Ey(t)){case 2:var d=XC;break;case 8:d=FC;break;default:d=eh}r=d.bind(null,t,r,e),d=void 0,!rd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(d=!0),i?d!==void 0?e.addEventListener(t,r,{capture:!0,passive:d}):e.addEventListener(t,r,!0):d!==void 0?e.addEventListener(t,r,{passive:d}):e.addEventListener(t,r,!1)}function Pf(e,t,r,i,d){var m=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var S=i.tag;if(S===3||S===4){var T=i.stateNode.containerInfo;if(T===d)break;if(S===4)for(S=i.return;S!==null;){var L=S.tag;if((L===3||L===4)&&S.stateNode.containerInfo===d)return;S=S.return}for(;T!==null;){if(S=Gl(T),S===null)return;if(L=S.tag,L===5||L===6||L===26||L===27){i=m=S;continue e}T=T.parentNode}}i=i.return}tg(function(){var X=m,ne=nd(r),le=[];e:{var Q=Ag.get(e);if(Q!==void 0){var J=Oi,we=e;switch(e){case"keypress":if(Mi(r)===0)break e;case"keydown":case"keyup":J=hj;break;case"focusin":we="focus",J=id;break;case"focusout":we="blur",J=id;break;case"beforeblur":case"afterblur":J=id;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":J=rg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=tj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=gj;break;case Eg:case Ng:case Rg:J=rj;break;case Tg:J=xj;break;case"scroll":case"scrollend":J=WS;break;case"wheel":J=bj;break;case"copy":case"cut":case"paste":J=sj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=sg;break;case"toggle":case"beforetoggle":J=Sj}var Ae=(t&4)!==0,ht=!Ae&&(e==="scroll"||e==="scrollend"),Y=Ae?Q!==null?Q+"Capture":null:Q;Ae=[];for(var P=X,K;P!==null;){var ae=P;if(K=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||K===null||Y===null||(ae=so(P,Y),ae!=null&&Ae.push(Po(P,ae,K))),ht)break;P=P.return}0<Ae.length&&(Q=new J(Q,we,null,r,ne),le.push({event:Q,listeners:Ae}))}}if((t&7)===0){e:{if(Q=e==="mouseover"||e==="pointerover",J=e==="mouseout"||e==="pointerout",Q&&r!==td&&(we=r.relatedTarget||r.fromElement)&&(Gl(we)||we[Yl]))break e;if((J||Q)&&(Q=ne.window===ne?ne:(Q=ne.ownerDocument)?Q.defaultView||Q.parentWindow:window,J?(we=r.relatedTarget||r.toElement,J=X,we=we?Gl(we):null,we!==null&&(ht=u(we),Ae=we.tag,we!==ht||Ae!==5&&Ae!==27&&Ae!==6)&&(we=null)):(J=null,we=X),J!==we)){if(Ae=rg,ae="onMouseLeave",Y="onMouseEnter",P="mouse",(e==="pointerout"||e==="pointerover")&&(Ae=sg,ae="onPointerLeave",Y="onPointerEnter",P="pointer"),ht=J==null?Q:lo(J),K=we==null?Q:lo(we),Q=new Ae(ae,P+"leave",J,r,ne),Q.target=ht,Q.relatedTarget=K,ae=null,Gl(ne)===X&&(Ae=new Ae(Y,P+"enter",we,r,ne),Ae.target=K,Ae.relatedTarget=ht,ae=Ae),ht=ae,J&&we)t:{for(Ae=wC,Y=J,P=we,K=0,ae=Y;ae;ae=Ae(ae))K++;ae=0;for(var Te=P;Te;Te=Ae(Te))ae++;for(;0<K-ae;)Y=Ae(Y),K--;for(;0<ae-K;)P=Ae(P),ae--;for(;K--;){if(Y===P||P!==null&&Y===P.alternate){Ae=Y;break t}Y=Ae(Y),P=Ae(P)}Ae=null}else Ae=null;J!==null&&Zx(le,Q,J,Ae,!1),we!==null&&ht!==null&&Zx(le,ht,we,Ae,!0)}}e:{if(Q=X?lo(X):window,J=Q.nodeName&&Q.nodeName.toLowerCase(),J==="select"||J==="input"&&Q.type==="file")var Ze=mg;else if(fg(Q))if(pg)Ze=Oj;else{Ze=Mj;var Se=Aj}else J=Q.nodeName,!J||J.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?X&&ed(X.elementType)&&(Ze=mg):Ze=Dj;if(Ze&&(Ze=Ze(e,X))){hg(le,Ze,r,ne);break e}Se&&Se(e,Q,X),e==="focusout"&&X&&Q.type==="number"&&X.memoizedProps.value!=null&&Wu(Q,"number",Q.value)}switch(Se=X?lo(X):window,e){case"focusin":(fg(Se)||Se.contentEditable==="true")&&(ts=Se,md=X,po=null);break;case"focusout":po=md=ts=null;break;case"mousedown":pd=!0;break;case"contextmenu":case"mouseup":case"dragend":pd=!1,jg(le,r,ne);break;case"selectionchange":if(kj)break;case"keydown":case"keyup":jg(le,r,ne)}var Ie;if(ud)e:{switch(e){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else es?ug(e,r)&&(Ve="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Ve="onCompositionStart");Ve&&(og&&r.locale!=="ko"&&(es||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&es&&(Ie=ng()):(Tr=ne,ld="value"in Tr?Tr.value:Tr.textContent,es=!0)),Se=Sc(X,Ve),0<Se.length&&(Ve=new lg(Ve,e,null,r,ne),le.push({event:Ve,listeners:Se}),Ie?Ve.data=Ie:(Ie=dg(r),Ie!==null&&(Ve.data=Ie)))),(Ie=Cj?Ej(e,r):Nj(e,r))&&(Ve=Sc(X,"onBeforeInput"),0<Ve.length&&(Se=new lg("onBeforeInput","beforeinput",null,r,ne),le.push({event:Se,listeners:Ve}),Se.data=Ie)),vC(le,e,X,r,ne)}Fx(le,t)})}function Po(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Sc(e,t){for(var r=t+"Capture",i=[];e!==null;){var d=e,m=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||m===null||(d=so(e,r),d!=null&&i.unshift(Po(e,d,m)),d=so(e,t),d!=null&&i.push(Po(e,d,m))),e.tag===3)return i;e=e.return}return[]}function wC(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zx(e,t,r,i,d){for(var m=t._reactName,S=[];r!==null&&r!==i;){var T=r,L=T.alternate,X=T.stateNode;if(T=T.tag,L!==null&&L===i)break;T!==5&&T!==26&&T!==27||X===null||(L=X,d?(X=so(r,m),X!=null&&S.unshift(Po(r,X,L))):d||(X=so(r,m),X!=null&&S.push(Po(r,X,L)))),r=r.return}S.length!==0&&e.push({event:t,listeners:S})}var SC=/\r\n?/g,jC=/\u0000|\uFFFD/g;function Jx(e){return(typeof e=="string"?e:""+e).replace(SC,`
|
|
49
|
-
`).replace(jC,"")}function Wx(e,t){return t=Jx(t),Jx(e)===t}function ft(e,t,r,i,d,m){switch(r){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Zl(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Zl(e,""+i);break;case"className":Ni(e,"class",i);break;case"tabIndex":Ni(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Ni(e,r,i);break;case"style":Wp(e,i,m);break;case"data":if(t!=="object"){Ni(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||r!=="href")){e.removeAttribute(r);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(r);break}i=Ti(""+i),e.setAttribute(r,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(r,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(r==="formAction"?(t!=="input"&&ft(e,t,"name",d.name,d,null),ft(e,t,"formEncType",d.formEncType,d,null),ft(e,t,"formMethod",d.formMethod,d,null),ft(e,t,"formTarget",d.formTarget,d,null)):(ft(e,t,"encType",d.encType,d,null),ft(e,t,"method",d.method,d,null),ft(e,t,"target",d.target,d,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(r);break}i=Ti(""+i),e.setAttribute(r,i);break;case"onClick":i!=null&&(e.onclick=Xa);break;case"onScroll":i!=null&&qe("scroll",e);break;case"onScrollEnd":i!=null&&qe("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(r=i.__html,r!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=r}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}r=Ti(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,""+i):e.removeAttribute(r);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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":i===!0?e.setAttribute(r,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(r,i):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(r,i):e.removeAttribute(r);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(r):e.setAttribute(r,i);break;case"popover":qe("beforetoggle",e),qe("toggle",e),Ei(e,"popover",i);break;case"xlinkActuate":Ka(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Ka(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Ka(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Ka(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Ka(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Ka(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Ka(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Ka(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Ka(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Ei(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=ZS.get(r)||r,Ei(e,r,i))}}function Hf(e,t,r,i,d,m){switch(r){case"style":Wp(e,i,m);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(r=i.__html,r!=null){if(d.children!=null)throw Error(o(60));e.innerHTML=r}}break;case"children":typeof i=="string"?Zl(e,i):(typeof i=="number"||typeof i=="bigint")&&Zl(e,""+i);break;case"onScroll":i!=null&&qe("scroll",e);break;case"onScrollEnd":i!=null&&qe("scrollend",e);break;case"onClick":i!=null&&(e.onclick=Xa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vp.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(d=r.endsWith("Capture"),t=r.slice(2,d?r.length-7:void 0),m=e[yn]||null,m=m!=null?m[r]:null,typeof m=="function"&&e.removeEventListener(t,m,d),typeof i=="function")){typeof m!="function"&&m!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(t,i,d);break e}r in e?e[r]=i:i===!0?e.setAttribute(r,""):Ei(e,r,i)}}}function rn(e,t,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":qe("error",e),qe("load",e);var i=!1,d=!1,m;for(m in r)if(r.hasOwnProperty(m)){var S=r[m];if(S!=null)switch(m){case"src":i=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ft(e,t,m,S,r,null)}}d&&ft(e,t,"srcSet",r.srcSet,r,null),i&&ft(e,t,"src",r.src,r,null);return;case"input":qe("invalid",e);var T=m=S=d=null,L=null,X=null;for(i in r)if(r.hasOwnProperty(i)){var ne=r[i];if(ne!=null)switch(i){case"name":d=ne;break;case"type":S=ne;break;case"checked":L=ne;break;case"defaultChecked":X=ne;break;case"value":m=ne;break;case"defaultValue":T=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(o(137,t));break;default:ft(e,t,i,ne,r,null)}}Fp(e,m,T,L,X,S,d,!1);return;case"select":qe("invalid",e),i=S=m=null;for(d in r)if(r.hasOwnProperty(d)&&(T=r[d],T!=null))switch(d){case"value":m=T;break;case"defaultValue":S=T;break;case"multiple":i=T;default:ft(e,t,d,T,r,null)}t=m,r=S,e.multiple=!!i,t!=null?Ql(e,!!i,t,!1):r!=null&&Ql(e,!!i,r,!0);return;case"textarea":qe("invalid",e),m=d=i=null;for(S in r)if(r.hasOwnProperty(S)&&(T=r[S],T!=null))switch(S){case"value":i=T;break;case"defaultValue":d=T;break;case"children":m=T;break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(o(91));break;default:ft(e,t,S,T,r,null)}Zp(e,i,d,m);return;case"option":for(L in r)if(r.hasOwnProperty(L)&&(i=r[L],i!=null))switch(L){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:ft(e,t,L,i,r,null)}return;case"dialog":qe("beforetoggle",e),qe("toggle",e),qe("cancel",e),qe("close",e);break;case"iframe":case"object":qe("load",e);break;case"video":case"audio":for(i=0;i<Bo.length;i++)qe(Bo[i],e);break;case"image":qe("error",e),qe("load",e);break;case"details":qe("toggle",e);break;case"embed":case"source":case"link":qe("error",e),qe("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(X in r)if(r.hasOwnProperty(X)&&(i=r[X],i!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:ft(e,t,X,i,r,null)}return;default:if(ed(t)){for(ne in r)r.hasOwnProperty(ne)&&(i=r[ne],i!==void 0&&Hf(e,t,ne,i,r,void 0));return}}for(T in r)r.hasOwnProperty(T)&&(i=r[T],i!=null&&ft(e,t,T,i,r,null))}function CC(e,t,r,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,m=null,S=null,T=null,L=null,X=null,ne=null;for(J in r){var le=r[J];if(r.hasOwnProperty(J)&&le!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":L=le;default:i.hasOwnProperty(J)||ft(e,t,J,null,i,le)}}for(var Q in i){var J=i[Q];if(le=r[Q],i.hasOwnProperty(Q)&&(J!=null||le!=null))switch(Q){case"type":m=J;break;case"name":d=J;break;case"checked":X=J;break;case"defaultChecked":ne=J;break;case"value":S=J;break;case"defaultValue":T=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(o(137,t));break;default:J!==le&&ft(e,t,Q,J,i,le)}}Ju(e,S,T,L,X,ne,m,d);return;case"select":J=S=T=Q=null;for(m in r)if(L=r[m],r.hasOwnProperty(m)&&L!=null)switch(m){case"value":break;case"multiple":J=L;default:i.hasOwnProperty(m)||ft(e,t,m,null,i,L)}for(d in i)if(m=i[d],L=r[d],i.hasOwnProperty(d)&&(m!=null||L!=null))switch(d){case"value":Q=m;break;case"defaultValue":T=m;break;case"multiple":S=m;default:m!==L&&ft(e,t,d,m,i,L)}t=T,r=S,i=J,Q!=null?Ql(e,!!r,Q,!1):!!i!=!!r&&(t!=null?Ql(e,!!r,t,!0):Ql(e,!!r,r?[]:"",!1));return;case"textarea":J=Q=null;for(T in r)if(d=r[T],r.hasOwnProperty(T)&&d!=null&&!i.hasOwnProperty(T))switch(T){case"value":break;case"children":break;default:ft(e,t,T,null,i,d)}for(S in i)if(d=i[S],m=r[S],i.hasOwnProperty(S)&&(d!=null||m!=null))switch(S){case"value":Q=d;break;case"defaultValue":J=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(o(91));break;default:d!==m&&ft(e,t,S,d,i,m)}Qp(e,Q,J);return;case"option":for(var we in r)if(Q=r[we],r.hasOwnProperty(we)&&Q!=null&&!i.hasOwnProperty(we))switch(we){case"selected":e.selected=!1;break;default:ft(e,t,we,null,i,Q)}for(L in i)if(Q=i[L],J=r[L],i.hasOwnProperty(L)&&Q!==J&&(Q!=null||J!=null))switch(L){case"selected":e.selected=Q&&typeof Q!="function"&&typeof Q!="symbol";break;default:ft(e,t,L,Q,i,J)}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 Ae in r)Q=r[Ae],r.hasOwnProperty(Ae)&&Q!=null&&!i.hasOwnProperty(Ae)&&ft(e,t,Ae,null,i,Q);for(X in i)if(Q=i[X],J=r[X],i.hasOwnProperty(X)&&Q!==J&&(Q!=null||J!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(o(137,t));break;default:ft(e,t,X,Q,i,J)}return;default:if(ed(t)){for(var ht in r)Q=r[ht],r.hasOwnProperty(ht)&&Q!==void 0&&!i.hasOwnProperty(ht)&&Hf(e,t,ht,void 0,i,Q);for(ne in i)Q=i[ne],J=r[ne],!i.hasOwnProperty(ne)||Q===J||Q===void 0&&J===void 0||Hf(e,t,ne,Q,i,J);return}}for(var Y in r)Q=r[Y],r.hasOwnProperty(Y)&&Q!=null&&!i.hasOwnProperty(Y)&&ft(e,t,Y,null,i,Q);for(le in i)Q=i[le],J=r[le],!i.hasOwnProperty(le)||Q===J||Q==null&&J==null||ft(e,t,le,Q,i,J)}function ey(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function EC(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,r=performance.getEntriesByType("resource"),i=0;i<r.length;i++){var d=r[i],m=d.transferSize,S=d.initiatorType,T=d.duration;if(m&&T&&ey(S)){for(S=0,T=d.responseEnd,i+=1;i<r.length;i++){var L=r[i],X=L.startTime;if(X>T)break;var ne=L.transferSize,le=L.initiatorType;ne&&ey(le)&&(L=L.responseEnd,S+=ne*(L<T?1:(T-X)/(L-X)))}if(--i,t+=8*(m+S)/(d.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 qf=null,$f=null;function jc(e){return e.nodeType===9?e:e.ownerDocument}function ty(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 ny(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 Vf(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 Yf=null;function NC(){var e=window.event;return e&&e.type==="popstate"?e===Yf?!1:(Yf=e,!0):(Yf=null,!1)}var ay=typeof setTimeout=="function"?setTimeout:void 0,RC=typeof clearTimeout=="function"?clearTimeout:void 0,ry=typeof Promise=="function"?Promise:void 0,TC=typeof queueMicrotask=="function"?queueMicrotask:typeof ry<"u"?function(e){return ry.resolve(null).then(e).catch(AC)}:ay;function AC(e){setTimeout(function(){throw e})}function Yr(e){return e==="head"}function ly(e,t){var r=t,i=0;do{var d=r.nextSibling;if(e.removeChild(r),d&&d.nodeType===8)if(r=d.data,r==="/$"||r==="/&"){if(i===0){e.removeChild(d),Ts(t);return}i--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")i++;else if(r==="html")Ho(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,Ho(r);for(var m=r.firstChild;m;){var S=m.nextSibling,T=m.nodeName;m[ro]||T==="SCRIPT"||T==="STYLE"||T==="LINK"&&m.rel.toLowerCase()==="stylesheet"||r.removeChild(m),m=S}}else r==="body"&&Ho(e.ownerDocument.body);r=d}while(r);Ts(t)}function sy(e,t){var r=e;e=0;do{var i=r.nextSibling;if(r.nodeType===1?t?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(t?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),i&&i.nodeType===8)if(r=i.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=i}while(r)}function Gf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var r=t;switch(t=t.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":Gf(r),Qu(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function MC(e,t,r,i){for(;e.nodeType===1;){var d=r;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[ro])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(m=e.getAttribute("rel"),m==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(m!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(m=e.getAttribute("src"),(m!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&m&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var m=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===m)return e}else return e;if(e=ia(e.nextSibling),e===null)break}return null}function DC(e,t,r){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=ia(e.nextSibling),e===null))return null;return e}function oy(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ia(e.nextSibling),e===null))return null;return e}function Kf(e){return e.data==="$?"||e.data==="$~"}function Xf(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function OC(e,t){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||r.readyState!=="loading")t();else{var i=function(){t(),r.removeEventListener("DOMContentLoaded",i)};r.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function ia(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 Ff=null;function iy(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(t===0)return ia(e.nextSibling);t--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||t++}e=e.nextSibling}return null}function cy(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(t===0)return e;t--}else r!=="/$"&&r!=="/&"||t++}e=e.previousSibling}return null}function uy(e,t,r){switch(t=jc(r),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function Ho(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Qu(e)}var ca=new Map,dy=new Set;function Cc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ur=$.d;$.d={f:_C,r:kC,D:zC,C:LC,L:UC,m:IC,X:PC,S:BC,M:HC};function _C(){var e=ur.f(),t=pc();return e||t}function kC(e){var t=Kl(e);t!==null&&t.tag===5&&t.type==="form"?Tv(t):ur.r(e)}var Es=typeof document>"u"?null:document;function fy(e,t,r){var i=Es;if(i&&typeof t=="string"&&t){var d=ta(t);d='link[rel="'+e+'"][href="'+d+'"]',typeof r=="string"&&(d+='[crossorigin="'+r+'"]'),dy.has(d)||(dy.add(d),e={rel:e,crossOrigin:r,href:t},i.querySelector(d)===null&&(t=i.createElement("link"),rn(t,"link",e),Xt(t),i.head.appendChild(t)))}}function zC(e){ur.D(e),fy("dns-prefetch",e,null)}function LC(e,t){ur.C(e,t),fy("preconnect",e,t)}function UC(e,t,r){ur.L(e,t,r);var i=Es;if(i&&e&&t){var d='link[rel="preload"][as="'+ta(t)+'"]';t==="image"&&r&&r.imageSrcSet?(d+='[imagesrcset="'+ta(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(d+='[imagesizes="'+ta(r.imageSizes)+'"]')):d+='[href="'+ta(e)+'"]';var m=d;switch(t){case"style":m=Ns(e);break;case"script":m=Rs(e)}ca.has(m)||(e=y({rel:"preload",href:t==="image"&&r&&r.imageSrcSet?void 0:e,as:t},r),ca.set(m,e),i.querySelector(d)!==null||t==="style"&&i.querySelector(qo(m))||t==="script"&&i.querySelector($o(m))||(t=i.createElement("link"),rn(t,"link",e),Xt(t),i.head.appendChild(t)))}}function IC(e,t){ur.m(e,t);var r=Es;if(r&&e){var i=t&&typeof t.as=="string"?t.as:"script",d='link[rel="modulepreload"][as="'+ta(i)+'"][href="'+ta(e)+'"]',m=d;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Rs(e)}if(!ca.has(m)&&(e=y({rel:"modulepreload",href:e},t),ca.set(m,e),r.querySelector(d)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector($o(m)))return}i=r.createElement("link"),rn(i,"link",e),Xt(i),r.head.appendChild(i)}}}function BC(e,t,r){ur.S(e,t,r);var i=Es;if(i&&e){var d=Xl(i).hoistableStyles,m=Ns(e);t=t||"default";var S=d.get(m);if(!S){var T={loading:0,preload:null};if(S=i.querySelector(qo(m)))T.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},r),(r=ca.get(m))&&Qf(e,r);var L=S=i.createElement("link");Xt(L),rn(L,"link",e),L._p=new Promise(function(X,ne){L.onload=X,L.onerror=ne}),L.addEventListener("load",function(){T.loading|=1}),L.addEventListener("error",function(){T.loading|=2}),T.loading|=4,Ec(S,t,i)}S={type:"stylesheet",instance:S,count:1,state:T},d.set(m,S)}}}function PC(e,t){ur.X(e,t);var r=Es;if(r&&e){var i=Xl(r).hoistableScripts,d=Rs(e),m=i.get(d);m||(m=r.querySelector($o(d)),m||(e=y({src:e,async:!0},t),(t=ca.get(d))&&Zf(e,t),m=r.createElement("script"),Xt(m),rn(m,"link",e),r.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(d,m))}}function HC(e,t){ur.M(e,t);var r=Es;if(r&&e){var i=Xl(r).hoistableScripts,d=Rs(e),m=i.get(d);m||(m=r.querySelector($o(d)),m||(e=y({src:e,async:!0,type:"module"},t),(t=ca.get(d))&&Zf(e,t),m=r.createElement("script"),Xt(m),rn(m,"link",e),r.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},i.set(d,m))}}function hy(e,t,r,i){var d=(d=ye.current)?Cc(d):null;if(!d)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(t=Ns(r.href),r=Xl(d).hoistableStyles,i=r.get(t),i||(i={type:"style",instance:null,count:0,state:null},r.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=Ns(r.href);var m=Xl(d).hoistableStyles,S=m.get(e);if(S||(d=d.ownerDocument||d,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(e,S),(m=d.querySelector(qo(e)))&&!m._p&&(S.instance=m,S.state.loading=5),ca.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},ca.set(e,r),m||qC(d,e,r,S.state))),t&&i===null)throw Error(o(528,""));return S}if(t&&i!==null)throw Error(o(529,""));return null;case"script":return t=r.async,r=r.src,typeof r=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Rs(r),r=Xl(d).hoistableScripts,i=r.get(t),i||(i={type:"script",instance:null,count:0,state:null},r.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Ns(e){return'href="'+ta(e)+'"'}function qo(e){return'link[rel="stylesheet"]['+e+"]"}function my(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function qC(e,t,r,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),rn(t,"link",r),Xt(t),e.head.appendChild(t))}function Rs(e){return'[src="'+ta(e)+'"]'}function $o(e){return"script[async]"+e}function py(e,t,r){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+ta(r.href)+'"]');if(i)return t.instance=i,Xt(i),i;var d=y({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Xt(i),rn(i,"style",d),Ec(i,r.precedence,e),t.instance=i;case"stylesheet":d=Ns(r.href);var m=e.querySelector(qo(d));if(m)return t.state.loading|=4,t.instance=m,Xt(m),m;i=my(r),(d=ca.get(d))&&Qf(i,d),m=(e.ownerDocument||e).createElement("link"),Xt(m);var S=m;return S._p=new Promise(function(T,L){S.onload=T,S.onerror=L}),rn(m,"link",i),t.state.loading|=4,Ec(m,r.precedence,e),t.instance=m;case"script":return m=Rs(r.src),(d=e.querySelector($o(m)))?(t.instance=d,Xt(d),d):(i=r,(d=ca.get(m))&&(i=y({},r),Zf(i,d)),e=e.ownerDocument||e,d=e.createElement("script"),Xt(d),rn(d,"link",i),e.head.appendChild(d),t.instance=d);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Ec(i,r.precedence,e));return t.instance}function Ec(e,t,r){for(var i=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=i.length?i[i.length-1]:null,m=d,S=0;S<i.length;S++){var T=i[S];if(T.dataset.precedence===t)m=T;else if(m!==d)break}m?m.parentNode.insertBefore(e,m.nextSibling):(t=r.nodeType===9?r.head:r,t.insertBefore(e,t.firstChild))}function Qf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Zf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Nc=null;function gy(e,t,r){if(Nc===null){var i=new Map,d=Nc=new Map;d.set(r,i)}else d=Nc,i=d.get(r),i||(i=new Map,d.set(r,i));if(i.has(e))return i;for(i.set(e,null),r=r.getElementsByTagName(e),d=0;d<r.length;d++){var m=r[d];if(!(m[ro]||m[en]||e==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var S=m.getAttribute(t)||"";S=e+S;var T=i.get(S);T?T.push(m):i.set(S,[m])}}return i}function vy(e,t,r){e=e.ownerDocument||e,e.head.insertBefore(r,t==="title"?e.querySelector("head > title"):null)}function $C(e,t,r){if(r===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 xy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function VC(e,t,r,i){if(r.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var d=Ns(i.href),m=t.querySelector(qo(d));if(m){t=m._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Rc.bind(e),t.then(e,e)),r.state.loading|=4,r.instance=m,Xt(m);return}m=t.ownerDocument||t,i=my(i),(d=ca.get(d))&&Qf(i,d),m=m.createElement("link"),Xt(m);var S=m;S._p=new Promise(function(T,L){S.onload=T,S.onerror=L}),rn(m,"link",i),r.instance=m}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,t),(t=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=Rc.bind(e),t.addEventListener("load",r),t.addEventListener("error",r))}}var Jf=0;function YC(e,t){return e.stylesheets&&e.count===0&&Ac(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var i=setTimeout(function(){if(e.stylesheets&&Ac(e,e.stylesheets),e.unsuspend){var m=e.unsuspend;e.unsuspend=null,m()}},6e4+t);0<e.imgBytes&&Jf===0&&(Jf=62500*EC());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ac(e,e.stylesheets),e.unsuspend)){var m=e.unsuspend;e.unsuspend=null,m()}},(e.imgBytes>Jf?50:800)+t);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(d)}}:null}function Rc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ac(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Tc=null;function Ac(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Tc=new Map,t.forEach(GC,e),Tc=null,Rc.call(e))}function GC(e,t){if(!(t.state.loading&4)){var r=Tc.get(e);if(r)var i=r.get(null);else{r=new Map,Tc.set(e,r);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<d.length;m++){var S=d[m];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(r.set(S.dataset.precedence,S),i=S)}i&&r.set(null,i)}d=t.instance,S=d.getAttribute("data-precedence"),m=r.get(S)||i,m===i&&r.set(null,d),r.set(S,d),this.count++,i=Rc.bind(this),d.addEventListener("load",i),d.addEventListener("error",i),m?m.parentNode.insertBefore(d,m.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),t.state.loading|=4}}var Vo={$$typeof:A,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function KC(e,t,r,i,d,m,S,T,L){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=vt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vt(0),this.hiddenUpdates=vt(null),this.identifierPrefix=i,this.onUncaughtError=d,this.onCaughtError=m,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.incompleteTransitions=new Map}function yy(e,t,r,i,d,m,S,T,L,X,ne,le){return e=new KC(e,t,r,S,L,X,ne,le,T),t=1,m===!0&&(t|=24),m=Un(3,null,null,t),e.current=m,m.stateNode=e,t=Md(),t.refCount++,e.pooledCache=t,t.refCount++,m.memoizedState={element:i,isDehydrated:r,cache:t},kd(m),e}function by(e){return e?(e=rs,e):rs}function wy(e,t,r,i,d,m){d=by(d),i.context===null?i.context=d:i.pendingContext=d,i=kr(t),i.payload={element:r},m=m===void 0?null:m,m!==null&&(i.callback=m),r=zr(e,i,t),r!==null&&(En(r,e,t),So(r,e,t))}function Sy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Wf(e,t){Sy(e,t),(e=e.alternate)&&Sy(e,t)}function jy(e){if(e.tag===13||e.tag===31){var t=pl(e,67108864);t!==null&&En(t,e,67108864),Wf(e,67108864)}}function Cy(e){if(e.tag===13||e.tag===31){var t=qn();t=Ya(t);var r=pl(e,t);r!==null&&En(r,e,t),Wf(e,t)}}var Mc=!0;function XC(e,t,r,i){var d=k.T;k.T=null;var m=$.p;try{$.p=2,eh(e,t,r,i)}finally{$.p=m,k.T=d}}function FC(e,t,r,i){var d=k.T;k.T=null;var m=$.p;try{$.p=8,eh(e,t,r,i)}finally{$.p=m,k.T=d}}function eh(e,t,r,i){if(Mc){var d=th(i);if(d===null)Pf(e,t,i,Dc,r),Ny(e,i);else if(ZC(d,e,t,r,i))i.stopPropagation();else if(Ny(e,i),t&4&&-1<QC.indexOf(e)){for(;d!==null;){var m=Kl(d);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var S=at(m.pendingLanes);if(S!==0){var T=m;for(T.pendingLanes|=2,T.entangledLanes|=2;S;){var L=1<<31-Tt(S);T.entanglements[1]|=L,S&=~L}Da(m),(et&6)===0&&(hc=Kt()+500,Io(0))}}break;case 31:case 13:T=pl(m,2),T!==null&&En(T,m,2),pc(),Wf(m,2)}if(m=th(i),m===null&&Pf(e,t,i,Dc,r),m===d)break;d=m}d!==null&&i.stopPropagation()}else Pf(e,t,i,null,r)}}function th(e){return e=nd(e),nh(e)}var Dc=null;function nh(e){if(Dc=null,e=Gl(e),e!==null){var t=u(e);if(t===null)e=null;else{var r=t.tag;if(r===13){if(e=f(t),e!==null)return e;e=null}else if(r===31){if(e=p(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Dc=e,null}function Ey(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(no()){case Wt:return 2;case sn:return 8;case zn:case $a:return 32;case Ra:return 268435456;default:return 32}default:return 32}}var ah=!1,Gr=null,Kr=null,Xr=null,Yo=new Map,Go=new Map,Fr=[],QC="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 Ny(e,t){switch(e){case"focusin":case"focusout":Gr=null;break;case"dragenter":case"dragleave":Kr=null;break;case"mouseover":case"mouseout":Xr=null;break;case"pointerover":case"pointerout":Yo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Go.delete(t.pointerId)}}function Ko(e,t,r,i,d,m){return e===null||e.nativeEvent!==m?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:m,targetContainers:[d]},t!==null&&(t=Kl(t),t!==null&&jy(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,d!==null&&t.indexOf(d)===-1&&t.push(d),e)}function ZC(e,t,r,i,d){switch(t){case"focusin":return Gr=Ko(Gr,e,t,r,i,d),!0;case"dragenter":return Kr=Ko(Kr,e,t,r,i,d),!0;case"mouseover":return Xr=Ko(Xr,e,t,r,i,d),!0;case"pointerover":var m=d.pointerId;return Yo.set(m,Ko(Yo.get(m)||null,e,t,r,i,d)),!0;case"gotpointercapture":return m=d.pointerId,Go.set(m,Ko(Go.get(m)||null,e,t,r,i,d)),!0}return!1}function Ry(e){var t=Gl(e.target);if(t!==null){var r=u(t);if(r!==null){if(t=r.tag,t===13){if(t=f(r),t!==null){e.blockedOn=t,Rr(e.priority,function(){Cy(r)});return}}else if(t===31){if(t=p(r),t!==null){e.blockedOn=t,Rr(e.priority,function(){Cy(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Oc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=th(e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);td=i,r.target.dispatchEvent(i),td=null}else return t=Kl(r),t!==null&&jy(t),e.blockedOn=r,!1;t.shift()}return!0}function Ty(e,t,r){Oc(e)&&r.delete(t)}function JC(){ah=!1,Gr!==null&&Oc(Gr)&&(Gr=null),Kr!==null&&Oc(Kr)&&(Kr=null),Xr!==null&&Oc(Xr)&&(Xr=null),Yo.forEach(Ty),Go.forEach(Ty)}function _c(e,t){e.blockedOn===t&&(e.blockedOn=null,ah||(ah=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,JC)))}var kc=null;function Ay(e){kc!==e&&(kc=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){kc===e&&(kc=null);for(var t=0;t<e.length;t+=3){var r=e[t],i=e[t+1],d=e[t+2];if(typeof i!="function"){if(nh(i||r)===null)continue;break}var m=Kl(r);m!==null&&(e.splice(t,3),t-=3,ef(m,{pending:!0,data:d,method:r.method,action:i},i,d))}}))}function Ts(e){function t(L){return _c(L,e)}Gr!==null&&_c(Gr,e),Kr!==null&&_c(Kr,e),Xr!==null&&_c(Xr,e),Yo.forEach(t),Go.forEach(t);for(var r=0;r<Fr.length;r++){var i=Fr[r];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Fr.length&&(r=Fr[0],r.blockedOn===null);)Ry(r),r.blockedOn===null&&Fr.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(i=0;i<r.length;i+=3){var d=r[i],m=r[i+1],S=d[yn]||null;if(typeof m=="function")S||Ay(r);else if(S){var T=null;if(m&&m.hasAttribute("formAction")){if(d=m,S=m[yn]||null)T=S.formAction;else if(nh(d)!==null)continue}else T=S.action;typeof T=="function"?r[i+1]=T:(r.splice(i,3),i-=3),Ay(r)}}}function My(){function e(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(S){return d=S})},focusReset:"manual",scroll:"manual"})}function t(){d!==null&&(d(),d=null),i||setTimeout(r,20)}function r(){if(!i&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(r,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),d!==null&&(d(),d=null)}}}function rh(e){this._internalRoot=e}zc.prototype.render=rh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var r=t.current,i=qn();wy(r,i,e,t,null,null)},zc.prototype.unmount=rh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;wy(e.current,2,null,e,null,null),pc(),t[Yl]=null}};function zc(e){this._internalRoot=e}zc.prototype.unstable_scheduleHydration=function(e){if(e){var t=pa();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Fr.length&&t!==0&&t<Fr[r].priority;r++);Fr.splice(r,0,e),r===0&&Ry(e)}};var Dy=a.version;if(Dy!=="19.2.8")throw Error(o(527,Dy,"19.2.8"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=v(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var WC={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Lc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lc.isDisabled&&Lc.supportsFiber)try{ma=Lc.inject(WC),At=Lc}catch{}}return Fo.createRoot=function(e,t){if(!c(e))throw Error(o(299));var r=!1,i="",d=Iv,m=Bv,S=Pv;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(d=t.onUncaughtError),t.onCaughtError!==void 0&&(m=t.onCaughtError),t.onRecoverableError!==void 0&&(S=t.onRecoverableError)),t=yy(e,1,!1,null,null,r,i,null,d,m,S,My),e[Yl]=t.current,Bf(e),new rh(t)},Fo.hydrateRoot=function(e,t,r){if(!c(e))throw Error(o(299));var i=!1,d="",m=Iv,S=Bv,T=Pv,L=null;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(d=r.identifierPrefix),r.onUncaughtError!==void 0&&(m=r.onUncaughtError),r.onCaughtError!==void 0&&(S=r.onCaughtError),r.onRecoverableError!==void 0&&(T=r.onRecoverableError),r.formState!==void 0&&(L=r.formState)),t=yy(e,1,!0,t,r??null,i,d,L,m,S,T,My),t.context=by(null),r=t.current,i=qn(),i=Ya(i),d=kr(i),d.callback=null,zr(r,d,i),r=i,t.current.lanes=r,Ct(t,r),Da(t),e[Yl]=t.current,Bf(e),new zc(t)},Fo.version="19.2.8",Fo}var Vy;function c2(){if(Vy)return ih.exports;Vy=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),ih.exports=i2(),ih.exports}var u2=c2();const d2=vm(u2);/**
|
|
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 ym=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Zb=/^[\\/]{2}/;function f2(n,a){return a+n.replace(/\\/g,"/")}var Yy="popstate";function Gy(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function h2(n={}){function a(o,c){var v;let u=(v=c.state)==null?void 0:v.masked,{pathname:f,search:p,hash:g}=u||o.location;return kh("",{pathname:f,search:p,hash:g},c.state&&c.state.usr||null,c.state&&c.state.key||"default",u?{pathname:o.location.pathname,search:o.location.search,hash:o.location.hash}:void 0)}function l(o,c){return typeof c=="string"?c:ni(c)}return p2(a,l,null,n)}function Nt(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function fa(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function m2(){return Math.random().toString(36).substring(2,10)}function Ky(n,a){return{usr:n.state,key:n.key,idx:a,masked:n.mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function kh(n,a,l=null,o,c){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?Vs(a):a,state:l,key:a&&a.key||o||m2(),mask:c}}function ni({pathname:n="/",search:a="",hash:l=""}){return a&&a!=="?"&&(n+=a.charAt(0)==="?"?a:"?"+a),l&&l!=="#"&&(n+=l.charAt(0)==="#"?l:"#"+l),n}function Vs(n){let a={};if(n){let l=n.indexOf("#");l>=0&&(a.hash=n.substring(l),n=n.substring(0,l));let o=n.indexOf("?");o>=0&&(a.search=n.substring(o),n=n.substring(0,o)),n&&(a.pathname=n)}return a}function p2(n,a,l,o={}){let{window:c=document.defaultView,v5Compat:u=!1}=o,f=c.history,p="POP",g=null,v=x();v==null&&(v=0,f.replaceState({...f.state,idx:v},""));function x(){return(f.state||{idx:null}).idx}function y(){p="POP";let C=x(),R=C==null?null:C-v;v=C,g&&g({action:p,location:j.location,delta:R})}function b(C,R){p="PUSH";let D=Gy(C)?C:kh(j.location,C,R);v=x()+1;let A=Ky(D,v),M=j.createHref(D.mask||D);try{f.pushState(A,"",M)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;c.location.assign(M)}u&&g&&g({action:p,location:j.location,delta:1})}function w(C,R){p="REPLACE";let D=Gy(C)?C:kh(j.location,C,R);v=x();let A=Ky(D,v),M=j.createHref(D.mask||D);f.replaceState(A,"",M),u&&g&&g({action:p,location:j.location,delta:0})}function E(C){return g2(c,C)}let j={get action(){return p},get location(){return n(c,f)},listen(C){if(g)throw new Error("A history only accepts one active listener");return c.addEventListener(Yy,y),g=C,()=>{c.removeEventListener(Yy,y),g=null}},createHref(C){return a(c,C)},createURL:E,encodeLocation(C){let R=E(C);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:b,replace:w,go(C){return f.go(C)}};return j}function g2(n,a,l=!1){let o="http://localhost";n&&(o=n.location.origin!=="null"?n.location.origin:n.location.href),Nt(o,"No window.location.(origin|href) available to create URL");let c=typeof a=="string"?a:ni(a);return c=c.replace(/ $/,"%20"),!l&&Zb.test(c)&&(c=o+c),new URL(c,o)}function Jb(n,a,l="/"){return v2(n,a,l,!1)}function v2(n,a,l,o,c){let u=typeof a=="string"?Vs(a):a,f=xr(u.pathname||"/",l);if(f==null)return null;let p=x2(n),g=null,v=A2(f);for(let x=0;g==null&&x<p.length;++x)g=T2(p[x],v,o);return g}function x2(n){let a=Wb(n);return y2(a),a}function Wb(n,a=[],l=[],o="",c=!1){let u=(f,p,g=c,v)=>{let x={relativePath:v===void 0?f.path||"":v,caseSensitive:f.caseSensitive===!0,childrenIndex:p,route:f};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(o)&&g)return;Nt(x.relativePath.startsWith(o),`Absolute route path "${x.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(o.length)}let y=Sa([o,x.relativePath]),b=l.concat(x);f.children&&f.children.length>0&&(Nt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),Wb(f.children,a,b,y,g)),!(f.path==null&&!f.index)&&a.push({path:y,score:N2(y,f.index),routesMeta:b.map((w,E)=>{let[j,C]=n0(w.relativePath,w.caseSensitive,E===b.length-1);return{...w,matcher:j,compiledParams:C}})})};return n.forEach((f,p)=>{var g;if(f.path===""||!((g=f.path)!=null&&g.includes("?")))u(f,p);else for(let v of e0(f.path))u(f,p,!0,v)}),a}function e0(n){let a=n.split("/");if(a.length===0)return[];let[l,...o]=a,c=l.endsWith("?"),u=l.replace(/\?$/,"");if(o.length===0)return c?[u,""]:[u];let f=e0(o.join("/")),p=[];return p.push(...f.map(g=>g===""?u:[u,g].join("/"))),c&&p.push(...f),p.map(g=>n.startsWith("/")&&g===""?"/":g)}function y2(n){n.sort((a,l)=>a.score!==l.score?l.score-a.score:R2(a.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}var b2=/^:[\w-]+$/,w2=3,S2=2,j2=1,C2=10,E2=-2,Xy=n=>n==="*";function N2(n,a){let l=n.split("/"),o=l.length;return l.some(Xy)&&(o+=E2),a&&(o+=S2),l.filter(c=>!Xy(c)).reduce((c,u)=>c+(b2.test(u)?w2:u===""?j2:C2),o)}function R2(n,a){return n.length===a.length&&n.slice(0,-1).every((o,c)=>o===a[c])?n[n.length-1]-a[a.length-1]:0}function T2(n,a,l=!1){let{routesMeta:o}=n,c={},u="/",f=[];for(let p=0;p<o.length;++p){let g=o[p],v=p===o.length-1,x=u==="/"?a:a.slice(u.length)||"/",y={path:g.relativePath,caseSensitive:g.caseSensitive,end:v},b=g.matcher&&g.compiledParams?t0(y,x,g.matcher,g.compiledParams):ou(y,x),w=g.route;if(!b&&v&&l&&!o[o.length-1].route.index&&(b=ou({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},x)),!b)return null;Object.assign(c,b.params),f.push({params:c,pathname:Sa([u,b.pathname]),pathnameBase:O2(Sa([u,b.pathnameBase])),route:w}),b.pathnameBase!=="/"&&(u=Sa([u,b.pathnameBase]))}return f}function ou(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[l,o]=n0(n.path,n.caseSensitive,n.end);return t0(n,a,l,o)}function t0(n,a,l,o){let c=a.match(l);if(!c)return null;let u=c[0],f=u.replace(/(.)\/+$/,"$1"),p=c.slice(1);return{params:o.reduce((v,{paramName:x,isOptional:y},b)=>{if(x==="*"){let E=p[b]||"";f=u.slice(0,u.length-E.length).replace(/(.)\/+$/,"$1")}const w=p[b];return y&&!w?v[x]=void 0:v[x]=(w||"").replace(/%2F/g,"/"),v},{}),pathname:u,pathnameBase:f,pattern:n}}function n0(n,a=!1,l=!0){fa(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let o=[],c="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,g,v,x)=>{if(o.push({paramName:p,isOptional:g!=null}),g){let y=x.charAt(v+f.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(o.push({paramName:"*"}),c+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":n!==""&&n!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,a?void 0:"i"),o]}function A2(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return fa(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),n}}function xr(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let l=a.endsWith("/")?a.length-1:a.length,o=n.charAt(l);return o&&o!=="/"?null:n.slice(l)||"/"}function M2(n,a="/"){let{pathname:l,search:o="",hash:c=""}=typeof n=="string"?Vs(n):n,u;return l?(l=a0(l),l.startsWith("/")?u=Fy(l.substring(1),"/"):u=Fy(l,a)):u=a,{pathname:u,search:_2(o),hash:k2(c)}}function Fy(n,a){let l=iu(a).split("/");return n.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function fh(n,a,l,o){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${l}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function D2(n){return n.filter((a,l)=>l===0||a.route.path&&a.route.path.length>0)}function bm(n){let a=D2(n);return a.map((l,o)=>o===a.length-1?l.pathname:l.pathnameBase)}function bu(n,a,l,o=!1){let c;typeof n=="string"?c=Vs(n):(c={...n},Nt(!c.pathname||!c.pathname.includes("?"),fh("?","pathname","search",c)),Nt(!c.pathname||!c.pathname.includes("#"),fh("#","pathname","hash",c)),Nt(!c.search||!c.search.includes("#"),fh("#","search","hash",c)));let u=n===""||c.pathname==="",f=u?"/":c.pathname,p;if(f==null)p=l;else{let y=a.length-1;if(!o&&f.startsWith("..")){let b=f.split("/");for(;b[0]==="..";)b.shift(),y-=1;c.pathname=b.join("/")}p=y>=0?a[y]:"/"}let g=M2(c,p),v=f&&f!=="/"&&f.endsWith("/"),x=(u||f===".")&&l.endsWith("/");return!g.pathname.endsWith("/")&&(v||x)&&(g.pathname+="/"),g}var a0=n=>n.replace(/[\\/]{2,}/g,"/"),Sa=n=>a0(n.join("/")),iu=n=>n.replace(/\/+$/,""),O2=n=>iu(n).replace(/^\/*/,"/"),_2=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,k2=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,z2=class{constructor(n,a,l,o=!1){this.status=n,this.statusText=a||"",this.internal=o,l instanceof Error?(this.data=l.toString(),this.error=l):this.data=l}};function L2(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function U2(n){let a=n.map(l=>l.route.path).filter(Boolean);return Sa(a)||"/"}var r0=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function l0(n,a){let l=n;if(typeof l!="string"||!ym.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let o=l,c=!1;if(r0)try{let u=new URL(window.location.href),f=Zb.test(l)?new URL(f2(l,u.protocol)):new URL(l),p=xr(f.pathname,a);f.origin===u.origin&&p!=null?l=p+f.search+f.hash:c=!0}catch{fa(!1,`<Link to="${l}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:c,to:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var s0=["POST","PUT","PATCH","DELETE"];new Set(s0);var I2=["GET",...s0];new Set(I2);var B2=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function P2(n){try{return B2.includes(new URL(n).protocol)}catch{return!1}}var Ys=h.createContext(null);Ys.displayName="DataRouter";var wu=h.createContext(null);wu.displayName="DataRouterState";var o0=h.createContext(!1);function H2(){return h.useContext(o0)}var i0=h.createContext({isTransitioning:!1});i0.displayName="ViewTransition";var q2=h.createContext(new Map);q2.displayName="Fetchers";var $2=h.createContext(null);$2.displayName="Await";var Fn=h.createContext(null);Fn.displayName="Navigation";var di=h.createContext(null);di.displayName="Location";var Ha=h.createContext({outlet:null,matches:[],isDataRoute:!1});Ha.displayName="Route";var wm=h.createContext(null);wm.displayName="RouteError";var c0="REACT_ROUTER_ERROR",V2="REDIRECT",Y2="ROUTE_ERROR_RESPONSE";function G2(n){if(n.startsWith(`${c0}:${V2}:{`))try{let a=JSON.parse(n.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function K2(n){if(n.startsWith(`${c0}:${Y2}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new z2(a.status,a.statusText,a.data)}catch{}}function X2(n,{relative:a}={}){Nt(Gs(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:o}=h.useContext(Fn),{hash:c,pathname:u,search:f}=hi(n,{relative:a}),p=u;return l!=="/"&&(p=u==="/"?l:Sa([l,u])),o.createHref({pathname:p,search:f,hash:c})}function Gs(){return h.useContext(di)!=null}function On(){return Nt(Gs(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(di).location}var u0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function d0(n){h.useContext(Fn).static||h.useLayoutEffect(n)}function fi(){let{isDataRoute:n}=h.useContext(Ha);return n?oE():F2()}function F2(){Nt(Gs(),"useNavigate() may be used only in the context of a <Router> component.");let n=h.useContext(Ys),{basename:a,navigator:l}=h.useContext(Fn),{matches:o}=h.useContext(Ha),{pathname:c}=On(),u=JSON.stringify(bm(o)),f=h.useRef(!1);return d0(()=>{f.current=!0}),h.useCallback((g,v={})=>{if(fa(f.current,u0),!f.current)return;if(typeof g=="number"){l.go(g);return}let x=bu(g,JSON.parse(u),c,v.relative==="path");n==null&&a!=="/"&&(x.pathname=x.pathname==="/"?a:Sa([a,x.pathname])),(v.replace?l.replace:l.push)(x,v.state,v)},[a,l,u,c,n])}h.createContext(null);function hi(n,{relative:a}={}){let{matches:l}=h.useContext(Ha),{pathname:o}=On(),c=JSON.stringify(bm(l));return h.useMemo(()=>bu(n,JSON.parse(c),o,a==="path"),[n,c,o,a])}function Q2(n,a){return f0(n,a)}function f0(n,a,l){var C;Nt(Gs(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=h.useContext(Fn),{matches:c}=h.useContext(Ha),u=c[c.length-1],f=u?u.params:{},p=u?u.pathname:"/",g=u?u.pathnameBase:"/",v=u&&u.route;{let R=v&&v.path||"";m0(p,!v||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${R}">) 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="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let x=On(),y;if(a){let R=typeof a=="string"?Vs(a):a;Nt(g==="/"||((C=R.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 "${R.pathname}" was given in the \`location\` prop.`),y=R}else y=x;let b=y.pathname||"/",w=b;if(g!=="/"){let R=g.replace(/^\//,"").split("/");w="/"+b.replace(/^\//,"").split("/").slice(R.length).join("/")}let E=l&&l.state.matches.length?l.state.matches.map(R=>Object.assign(R,{route:l.manifest[R.route.id]||R.route})):Jb(n,{pathname:w});fa(v||E!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),fa(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.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=tE(E&&E.map(R=>Object.assign({},R,{params:Object.assign({},f,R.params),pathname:Sa([g,o.encodeLocation?o.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?g:Sa([g,o.encodeLocation?o.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),c,l);return a&&j?h.createElement(di.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...y},navigationType:"POP"}},j):j}function Z2(){let n=sE(),a=L2(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),l=n instanceof Error?n.stack:null,o="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:o},u={padding:"2px 4px",backgroundColor:o},f=null;return console.error("Error handled by React Router default ErrorBoundary:",n),f=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:u},"ErrorBoundary")," or"," ",h.createElement("code",{style:u},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},a),l?h.createElement("pre",{style:c},l):null,f)}var J2=h.createElement(Z2,null),h0=class extends h.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,a){return a.location!==n.location||a.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:a.error,location:a.location,revalidation:n.revalidation||a.revalidation}}componentDidCatch(n,a){this.props.onError?this.props.onError(n,a):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const l=K2(n.digest);l&&(n=l)}let a=n!==void 0?h.createElement(Ha.Provider,{value:this.props.routeContext},h.createElement(wm.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?h.createElement(W2,{error:n},a):a}};h0.contextType=o0;var hh=new WeakMap;function W2({children:n,error:a}){let{basename:l}=h.useContext(Fn);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let o=G2(a.digest);if(o){let c=hh.get(a);if(c)throw c;let u=l0(o.location,l),f=u.absoluteURL||u.to;if(P2(f))throw new Error("Invalid redirect location");if(r0&&!hh.get(a))if(u.isExternal||o.reloadDocument)window.location.href=f;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(u.to,{replace:o.replace}));throw hh.set(a,p),p}return h.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f}`})}}return n}function eE({routeContext:n,match:a,children:l}){let o=h.useContext(Ys);return o&&o.static&&o.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=a.route.id),h.createElement(Ha.Provider,{value:n},l)}function tE(n,a=[],l){let o=l==null?void 0:l.state;if(n==null){if(!o)return null;if(o.errors)n=o.matches;else if(a.length===0&&!o.initialized&&o.matches.length>0)n=o.matches;else return null}let c=n,u=o==null?void 0:o.errors;if(u!=null){let x=c.findIndex(y=>y.route.id&&(u==null?void 0:u[y.route.id])!==void 0);Nt(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(u).join(",")}`),c=c.slice(0,Math.min(c.length,x+1))}let f=!1,p=-1;if(l&&o){f=o.renderFallback;for(let x=0;x<c.length;x++){let y=c[x];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(p=x),y.route.id){let{loaderData:b,errors:w}=o,E=y.route.loader&&!b.hasOwnProperty(y.route.id)&&(!w||w[y.route.id]===void 0);if(y.route.lazy||E){l.isStatic&&(f=!0),p>=0?c=c.slice(0,p+1):c=[c[0]];break}}}}let g=l==null?void 0:l.onError,v=o&&g?(x,y)=>{var b,w;g(x,{location:o.location,params:((w=(b=o.matches)==null?void 0:b[0])==null?void 0:w.params)??{},pattern:U2(o.matches),errorInfo:y})}:void 0;return c.reduceRight((x,y,b)=>{let w,E=!1,j=null,C=null;o&&(w=u&&y.route.id?u[y.route.id]:void 0,j=y.route.errorElement||J2,f&&(p<0&&b===0?(m0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),E=!0,C=null):p===b&&(E=!0,C=y.route.hydrateFallbackElement||null)));let R=a.concat(c.slice(0,b+1)),D=()=>{let A;return w?A=j:E?A=C:y.route.Component?A=h.createElement(y.route.Component,null):y.route.element?A=y.route.element:A=x,h.createElement(eE,{match:y,routeContext:{outlet:x,matches:R,isDataRoute:o!=null},children:A})};return o&&(y.route.ErrorBoundary||y.route.errorElement||b===0)?h.createElement(h0,{location:o.location,revalidation:o.revalidation,component:j,error:w,children:D(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:v}):D()},null)}function Sm(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nE(n){let a=h.useContext(Ys);return Nt(a,Sm(n)),a}function aE(n){let a=h.useContext(wu);return Nt(a,Sm(n)),a}function rE(n){let a=h.useContext(Ha);return Nt(a,Sm(n)),a}function jm(n){let a=rE(n),l=a.matches[a.matches.length-1];return Nt(l.route.id,`${n} can only be used on routes that contain a unique "id"`),l.route.id}function lE(){return jm("useRouteId")}function sE(){var o;let n=h.useContext(wm),a=aE("useRouteError"),l=jm("useRouteError");return n!==void 0?n:(o=a.errors)==null?void 0:o[l]}function oE(){let{router:n}=nE("useNavigate"),a=jm("useNavigate"),l=h.useRef(!1);return d0(()=>{l.current=!0}),h.useCallback(async(c,u={})=>{fa(l.current,u0),l.current&&(typeof c=="number"?await n.navigate(c):await n.navigate(c,{fromRouteId:a,...u}))},[n,a])}var Qy={};function m0(n,a,l){!a&&!Qy[n]&&(Qy[n]=!0,fa(!1,l))}h.memo(iE);function iE({routes:n,manifest:a,future:l,state:o,isStatic:c,onError:u}){return f0(n,void 0,{manifest:a,state:o,isStatic:c,onError:u})}function zh({to:n,replace:a,state:l,relative:o}){Nt(Gs(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=h.useContext(Fn);fa(!c,"<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:u}=h.useContext(Ha),{pathname:f}=On(),p=fi(),g=bu(n,bm(u),f,o==="path"),v=JSON.stringify(g);return h.useEffect(()=>{p(JSON.parse(v),{replace:a,state:l,relative:o})},[p,v,o,a,l]),null}function Nn(n){Nt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function cE({basename:n="/",children:a=null,location:l,navigationType:o="POP",navigator:c,static:u=!1,useTransitions:f}){Nt(!Gs(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=n.replace(/^\/*/,"/"),g=h.useMemo(()=>({basename:p,navigator:c,static:u,useTransitions:f,future:{}}),[p,c,u,f]);typeof l=="string"&&(l=Vs(l));let{pathname:v="/",search:x="",hash:y="",state:b=null,key:w="default",mask:E}=l,j=h.useMemo(()=>{let C=xr(v,p);return C==null?null:{location:{pathname:C,search:x,hash:y,state:b,key:w,mask:E},navigationType:o}},[p,v,x,y,b,w,o,E]);return fa(j!=null,`<Router basename="${p}"> is not able to match the URL "${v}${x}${y}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:h.createElement(Fn.Provider,{value:g},h.createElement(di.Provider,{children:a,value:j}))}function p0({children:n,location:a}){return Q2(Lh(n),a)}function Lh(n,a=[]){let l=[];return h.Children.forEach(n,(o,c)=>{if(!h.isValidElement(o))return;let u=[...a,c];if(o.type===h.Fragment){l.push.apply(l,Lh(o.props.children,u));return}Nt(o.type===Nn,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Nt(!o.props.index||!o.props.children,"An index route cannot have child routes.");let f={id:o.props.id||u.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(f.children=Lh(o.props.children,u)),l.push(f)}),l}var Wc="get",eu="application/x-www-form-urlencoded";function Su(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function uE(n){return Su(n)&&n.tagName.toLowerCase()==="button"}function dE(n){return Su(n)&&n.tagName.toLowerCase()==="form"}function fE(n){return Su(n)&&n.tagName.toLowerCase()==="input"}function hE(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function mE(n,a){return n.button===0&&(!a||a==="_self")&&!hE(n)}function Uh(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,l)=>{let o=n[l];return a.concat(Array.isArray(o)?o.map(c=>[l,c]):[[l,o]])},[]))}function pE(n,a){let l=Uh(n);return a&&a.forEach((o,c)=>{l.has(c)||a.getAll(c).forEach(u=>{l.append(c,u)})}),l}var Uc=null;function gE(){if(Uc===null)try{new FormData(document.createElement("form"),0),Uc=!1}catch{Uc=!0}return Uc}var vE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function mh(n){return n!=null&&!vE.has(n)?(fa(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${eu}"`),null):n}function xE(n,a){let l,o,c,u,f;if(dE(n)){let p=n.getAttribute("action");o=p?xr(p,a):null,l=n.getAttribute("method")||Wc,c=mh(n.getAttribute("enctype"))||eu,u=new FormData(n)}else if(uE(n)||fE(n)&&(n.type==="submit"||n.type==="image")){let p=n.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=n.getAttribute("formaction")||p.getAttribute("action");if(o=g?xr(g,a):null,l=n.getAttribute("formmethod")||p.getAttribute("method")||Wc,c=mh(n.getAttribute("formenctype"))||mh(p.getAttribute("enctype"))||eu,u=new FormData(p,n),!gE()){let{name:v,type:x,value:y}=n;if(x==="image"){let b=v?`${v}.`:"";u.append(`${b}x`,"0"),u.append(`${b}y`,"0")}else v&&u.append(v,y)}}else{if(Su(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=Wc,o=null,c=eu,f=n}return u&&c==="text/plain"&&(f=u,u=void 0),{action:o,method:l.toLowerCase(),encType:c,formData:u,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Cm(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function g0(n,a,l,o){let c=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return l?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${o}`:c.pathname=`${c.pathname}.${o}`:c.pathname==="/"?c.pathname=`_root.${o}`:a&&xr(c.pathname,a)==="/"?c.pathname=`${iu(a)}/_root.${o}`:c.pathname=`${iu(c.pathname)}.${o}`,c}async function yE(n,a){if(n.id in a)return a[n.id];try{let l=await import(n.module);return a[n.id]=l,l}catch(l){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(l),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function bE(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function wE(n,a,l){let o=await Promise.all(n.map(async c=>{let u=a.routes[c.route.id];if(u){let f=await yE(u,l);return f.links?f.links():[]}return[]}));return EE(o.flat(1).filter(bE).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function Zy(n,a,l,o,c,u){let f=(g,v)=>l[v]?g.route.id!==l[v].route.id:!0,p=(g,v)=>{var x;return l[v].pathname!==g.pathname||((x=l[v].route.path)==null?void 0:x.endsWith("*"))&&l[v].params["*"]!==g.params["*"]};return u==="assets"?a.filter((g,v)=>f(g,v)||p(g,v)):u==="data"?a.filter((g,v)=>{var y;let x=o.routes[g.route.id];if(!x||!x.hasLoader)return!1;if(f(g,v)||p(g,v))return!0;if(g.route.shouldRevalidate){let b=g.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((y=l[0])==null?void 0:y.params)||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function SE(n,a,{includeHydrateFallback:l}={}){return jE(n.map(o=>{let c=a.routes[o.route.id];if(!c)return[];let u=[c.module];return c.clientActionModule&&(u=u.concat(c.clientActionModule)),c.clientLoaderModule&&(u=u.concat(c.clientLoaderModule)),l&&c.hydrateFallbackModule&&(u=u.concat(c.hydrateFallbackModule)),c.imports&&(u=u.concat(c.imports)),u}).flat(1))}function jE(n){return[...new Set(n)]}function CE(n){let a={},l=Object.keys(n).sort();for(let o of l)a[o]=n[o];return a}function EE(n,a){let l=new Set;return new Set(a),n.reduce((o,c)=>{let u=JSON.stringify(CE(c));return l.has(u)||(l.add(u),o.push({key:u,link:c})),o},[])}function Em(){let n=h.useContext(Ys);return Cm(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function NE(){let n=h.useContext(wu);return Cm(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Nm=h.createContext(void 0);Nm.displayName="FrameworkContext";function ju(){let n=h.useContext(Nm);return Cm(n,"You must render this element inside a <HydratedRouter> element"),n}function RE(n,a){let l=h.useContext(Nm),[o,c]=h.useState(!1),[u,f]=h.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:v,onMouseLeave:x,onTouchStart:y}=a,b=h.useRef(null);h.useEffect(()=>{if(n==="render"&&f(!0),n==="viewport"){let j=R=>{R.forEach(D=>{f(D.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return b.current&&C.observe(b.current),()=>{C.disconnect()}}},[n]),h.useEffect(()=>{if(o){let j=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(j)}}},[o]);let w=()=>{c(!0)},E=()=>{c(!1),f(!1)};return l?n!=="intent"?[u,b,{}]:[u,b,{onFocus:Qo(p,w),onBlur:Qo(g,E),onMouseEnter:Qo(v,w),onMouseLeave:Qo(x,E),onTouchStart:Qo(y,w)}]:[!1,b,{}]}function Qo(n,a){return l=>{n&&n(l),l.defaultPrevented||a(l)}}function TE({page:n,...a}){let l=H2(),{nonce:o}=ju(),{router:c}=Em(),u=h.useMemo(()=>Jb(c.routes,n,c.basename),[c.routes,n,c.basename]);return u?(a.nonce==null&&o&&(a={...a,nonce:o}),l?h.createElement(ME,{page:n,matches:u,...a}):h.createElement(DE,{page:n,matches:u,...a})):null}function AE(n){let{manifest:a,routeModules:l}=ju(),[o,c]=h.useState([]);return h.useEffect(()=>{let u=!1;return wE(n,a,l).then(f=>{u||c(f)}),()=>{u=!0}},[n,a,l]),o}function ME({page:n,matches:a,...l}){let o=On(),{future:c}=ju(),{basename:u}=Em(),f=h.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let p=g0(n,u,c.v8_trailingSlashAwareDataRequests,"rsc"),g=!1,v=[];for(let x of a)typeof x.route.shouldRevalidate=="function"?g=!0:v.push(x.route.id);return g&&v.length>0&&p.searchParams.set("_routes",v.join(",")),[p.pathname+p.search]},[u,c.v8_trailingSlashAwareDataRequests,n,o,a]);return h.createElement(h.Fragment,null,f.map(p=>h.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...l})))}function DE({page:n,matches:a,...l}){let o=On(),{future:c,manifest:u,routeModules:f}=ju(),{basename:p}=Em(),{loaderData:g,matches:v}=NE(),x=h.useMemo(()=>Zy(n,a,v,u,o,"data"),[n,a,v,u,o]),y=h.useMemo(()=>Zy(n,a,v,u,o,"assets"),[n,a,v,u,o]),b=h.useMemo(()=>{if(n===o.pathname+o.search+o.hash)return[];let j=new Set,C=!1;if(a.forEach(D=>{var M;let A=u.routes[D.route.id];!A||!A.hasLoader||(!x.some(O=>O.route.id===D.route.id)&&D.route.id in g&&((M=f[D.route.id])!=null&&M.shouldRevalidate)||A.hasClientLoader?C=!0:j.add(D.route.id))}),j.size===0)return[];let R=g0(n,p,c.v8_trailingSlashAwareDataRequests,"data");return C&&j.size>0&&R.searchParams.set("_routes",a.filter(D=>j.has(D.route.id)).map(D=>D.route.id).join(",")),[R.pathname+R.search]},[p,c.v8_trailingSlashAwareDataRequests,g,o,u,x,a,n,f]),w=h.useMemo(()=>SE(y,u),[y,u]),E=AE(y);return h.createElement(h.Fragment,null,b.map(j=>h.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...l})),w.map(j=>h.createElement("link",{key:j,rel:"modulepreload",href:j,...l})),E.map(({key:j,link:C})=>h.createElement("link",{key:j,nonce:l.nonce,...C,crossOrigin:C.crossOrigin??l.crossOrigin})))}function OE(...n){return a=>{n.forEach(l=>{typeof l=="function"?l(a):l!=null&&(l.current=a)})}}var _E=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{_E&&(window.__reactRouterVersion="7.18.2")}catch{}function kE({basename:n,children:a,useTransitions:l,window:o}){let c=h.useRef();c.current==null&&(c.current=h2({window:o,v5Compat:!0}));let u=c.current,[f,p]=h.useState({action:u.action,location:u.location}),g=h.useCallback(v=>{l===!1?p(v):h.startTransition(()=>p(v))},[l]);return h.useLayoutEffect(()=>u.listen(g),[u,g]),h.createElement(cE,{basename:n,children:a,location:f.location,navigationType:f.action,navigator:u,useTransitions:l})}var Dl=h.forwardRef(function({onClick:a,discover:l="render",prefetch:o="none",relative:c,reloadDocument:u,replace:f,mask:p,state:g,target:v,to:x,preventScrollReset:y,viewTransition:b,defaultShouldRevalidate:w,...E},j){let{basename:C,navigator:R,useTransitions:D}=h.useContext(Fn),A=typeof x=="string"&&ym.test(x),M=l0(x,C);x=M.to;let O=X2(x,{relative:c}),N=On(),_=null;if(p){let ce=bu(p,[],N.mask?N.mask.pathname:"/",!0);C!=="/"&&(ce.pathname=ce.pathname==="/"?C:Sa([C,ce.pathname])),_=R.createHref(ce)}let[U,V,te]=RE(o,E),q=UE(x,{replace:f,mask:p,state:g,target:v,preventScrollReset:y,relative:c,viewTransition:b,defaultShouldRevalidate:w,useTransitions:D});function G(ce){a&&a(ce),ce.defaultPrevented||q(ce)}let B=!(M.isExternal||u),F=h.createElement("a",{...E,...te,href:(B?_:void 0)||M.absoluteURL||O,onClick:B?G:a,ref:OE(j,V),target:v,"data-discover":!A&&l==="render"?"true":void 0});return U&&!A?h.createElement(h.Fragment,null,F,h.createElement(TE,{page:O})):F});Dl.displayName="Link";var v0=h.forwardRef(function({"aria-current":a="page",caseSensitive:l=!1,className:o="",end:c=!1,style:u,to:f,viewTransition:p,children:g,...v},x){let y=hi(f,{relative:v.relative}),b=On(),w=h.useContext(wu),{navigator:E,basename:j}=h.useContext(Fn),C=w!=null&&$E(y)&&p===!0,R=E.encodeLocation?E.encodeLocation(y).pathname:y.pathname,D=b.pathname,A=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;l||(D=D.toLowerCase(),A=A?A.toLowerCase():null,R=R.toLowerCase()),A&&j&&(A=xr(A,j)||A);const M=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let O=D===R||!c&&D.startsWith(R)&&D.charAt(M)==="/",N=A!=null&&(A===R||!c&&A.startsWith(R)&&A.charAt(R.length)==="/"),_={isActive:O,isPending:N,isTransitioning:C},U=O?a:void 0,V;typeof o=="function"?V=o(_):V=[o,O?"active":null,N?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let te=typeof u=="function"?u(_):u;return h.createElement(Dl,{...v,"aria-current":U,className:V,ref:x,style:te,to:f,viewTransition:p},typeof g=="function"?g(_):g)});v0.displayName="NavLink";var zE=h.forwardRef(({discover:n="render",fetcherKey:a,navigate:l,reloadDocument:o,replace:c,state:u,method:f=Wc,action:p,onSubmit:g,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:b,...w},E)=>{let{useTransitions:j}=h.useContext(Fn),C=HE(),R=qE(p,{relative:v}),D=f.toLowerCase()==="get"?"get":"post",A=typeof p=="string"&&ym.test(p),M=O=>{if(g&&g(O),O.defaultPrevented)return;O.preventDefault();let N=O.nativeEvent.submitter,_=(N==null?void 0:N.getAttribute("formmethod"))||f,U=()=>C(N||O.currentTarget,{fetcherKey:a,method:_,navigate:l,replace:c,state:u,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:b});j&&l!==!1?h.startTransition(()=>U()):U()};return h.createElement("form",{ref:E,method:D,action:R,onSubmit:o?g:M,...w,"data-discover":!A&&n==="render"?"true":void 0})});zE.displayName="Form";function LE(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function x0(n){let a=h.useContext(Ys);return Nt(a,LE(n)),a}function UE(n,{target:a,replace:l,mask:o,state:c,preventScrollReset:u,relative:f,viewTransition:p,defaultShouldRevalidate:g,useTransitions:v}={}){let x=fi(),y=On(),b=hi(n,{relative:f});return h.useCallback(w=>{if(mE(w,a)){w.preventDefault();let E=l!==void 0?l:ni(y)===ni(b),j=()=>x(n,{replace:E,mask:o,state:c,preventScrollReset:u,relative:f,viewTransition:p,defaultShouldRevalidate:g});v?h.startTransition(()=>j()):j()}},[y,x,b,l,o,c,a,n,u,f,p,g,v])}function IE(n){fa(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 a=h.useRef(Uh(n)),l=h.useRef(!1),o=On(),c=h.useMemo(()=>pE(o.search,l.current?null:a.current),[o.search]),u=fi(),f=h.useCallback((p,g)=>{const v=Uh(typeof p=="function"?p(new URLSearchParams(c)):p);l.current=!0,u("?"+v,g)},[u,c]);return[c,f]}var BE=0,PE=()=>`__${String(++BE)}__`;function HE(){let{router:n}=x0("useSubmit"),{basename:a}=h.useContext(Fn),l=lE(),o=n.fetch,c=n.navigate;return h.useCallback(async(u,f={})=>{let{action:p,method:g,encType:v,formData:x,body:y}=xE(u,a);if(f.navigate===!1){let b=f.fetcherKey||PE();await o(b,l,f.action||p,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:y,formMethod:f.method||g,formEncType:f.encType||v,flushSync:f.flushSync})}else await c(f.action||p,{defaultShouldRevalidate:f.defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:y,formMethod:f.method||g,formEncType:f.encType||v,replace:f.replace,state:f.state,fromRouteId:l,flushSync:f.flushSync,viewTransition:f.viewTransition})},[o,c,a,l])}function qE(n,{relative:a}={}){let{basename:l}=h.useContext(Fn),o=h.useContext(Ha);Nt(o,"useFormAction must be used inside a RouteContext");let[c]=o.matches.slice(-1),u={...hi(n||".",{relative:a})},f=On();if(n==null){u.search=f.search;let p=new URLSearchParams(u.search),g=p.getAll("index");if(g.some(x=>x==="")){p.delete("index"),g.filter(y=>y).forEach(y=>p.append("index",y));let x=p.toString();u.search=x?`?${x}`:""}}return(!n||n===".")&&c.route.index&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(u.pathname=u.pathname==="/"?l:Sa([l,u.pathname])),ni(u)}function $E(n,{relative:a}={}){let l=h.useContext(i0);Nt(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=x0("useViewTransitionState"),c=hi(n,{relative:a});if(!l.isTransitioning)return!1;let u=xr(l.currentLocation.pathname,o)||l.currentLocation.pathname,f=xr(l.nextLocation.pathname,o)||l.nextLocation.pathname;return ou(c.pathname,f)!=null||ou(c.pathname,u)!=null}var wa=Qb();const VE=vm(wa),Rm="",Ih="x-csrf-token";let Us=null,ph=null;async function y0(){return Us||(ph??(ph=fetch(`${Rm}/api/admin/csrf`,{credentials:"include"}).then(async n=>{if(!n.ok)throw new Error("Unable to acquire CSRF token");return Us=(await n.json()).csrfToken,Us}).finally(()=>{ph=null})),ph)}class Tm extends Error{constructor(a,l,o){var c;super(typeof o=="object"&&o&&"error"in o?String(((c=o.error)==null?void 0:c.message)??o):"Request failed"),this.status=a,this.type=l,this.body=o}}async function b0(n){var o;const a=await n.text();let l;try{l=a?JSON.parse(a):void 0}catch{l=a}if(!n.ok)throw new Tm(n.status,typeof l=="object"&&l&&"error"in l?String(((o=l.error)==null?void 0:o.type)??"error"):"error",l);return l}async function ks(n,a,l,o,c=!0){const u=l!==void 0,f={...o==null?void 0:o.headers};u&&!f["content-type"]&&(f["content-type"]="application/json"),n!=="GET"&&n!=="HEAD"&&a!=="/api/admin/login"&&!f[Ih]&&(f[Ih]=await y0());const p=await fetch(`${Rm}${a}`,{...o,method:n,headers:f,body:u?JSON.stringify(l):void 0,credentials:"include"});try{return await b0(p)}catch(g){const v=g instanceof Tm&&(g.status===401||g.status===403)&&(g.type==="authentication_error"||g.type==="csrf_error");if(c&&v&&n!=="GET"&&n!=="HEAD"&&a!=="/api/admin/login")return Us=null,ks(n,a,l,o,!1);throw g}}async function w0(n,a,l=!0){const o=await fetch(`${Rm}${n}`,{method:"POST",headers:{[Ih]:await y0()},body:a,credentials:"include"});try{return await b0(o)}catch(c){const u=c instanceof Tm&&(c.status===401||c.status===403)&&(c.type==="authentication_error"||c.type==="csrf_error");if(l&&u)return Us=null,w0(n,a,!1);throw c}}const xe={get:(n,a)=>ks("GET",n,void 0,a),post:(n,a,l)=>ks("POST",n,a,l),upload:w0,patch:(n,a,l)=>ks("PATCH",n,a,l),put:(n,a,l)=>ks("PUT",n,a,l),del:(n,a)=>ks("DELETE",n,void 0,a)},S0=h.createContext(void 0);function YE({children:n}){const[a,l]=h.useState(null),[o,c]=h.useState(!0),u=h.useCallback(async()=>{try{const g=await xe.get("/api/admin/me");l(g)}catch{l(null)}finally{c(!1)}},[]);h.useEffect(()=>{u()},[u]);const f=h.useCallback(async(g,v,x,y)=>{const b={username:g,password:v};x&&(b.totp=x),y&&(b.recoveryCode=y);try{const w=await xe.post("/api/admin/login",b);return l({id:"admin",username:w.username,totpEnabled:w.totpEnabled}),{totpRequired:!1}}catch(w){const E=w.status,j=w.type;if(E===401&&j==="totp_required")return{totpRequired:!0};throw w}},[]),p=h.useCallback(async()=>{await xe.post("/api/admin/logout"),l(null)},[]);return s.jsx(S0.Provider,{value:{user:a,loading:o,login:f,logout:p,refresh:u},children:n})}function Am(){const n=h.useContext(S0);if(!n)throw new Error("useAuth must be inside AuthProvider");return n}/**
|
|
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 GE=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),j0=(...n)=>n.filter((a,l,o)=>!!a&&a.trim()!==""&&o.indexOf(a)===l).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 KE={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 XE=h.forwardRef(({color:n="currentColor",size:a=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:u,iconNode:f,...p},g)=>h.createElement("svg",{ref:g,...KE,width:a,height:a,stroke:n,strokeWidth:o?Number(l)*24/Number(a):l,className:j0("lucide",c),...p},[...f.map(([v,x])=>h.createElement(v,x)),...Array.isArray(u)?u:[u]]));/**
|
|
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 Me=(n,a)=>{const l=h.forwardRef(({className:o,...c},u)=>h.createElement(XE,{ref:u,iconNode:a,className:j0(`lucide-${GE(n)}`,o),...c}));return l.displayName=`${n}`,l};/**
|
|
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 C0=Me("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 FE=Me("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 QE=Me("Bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/**
|
|
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 ZE=Me("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"}]]);/**
|
|
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 Mm=Me("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
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 E0=Me("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
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 JE=Me("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
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 N0=Me("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
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 WE=Me("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"}]]);/**
|
|
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 Cu=Me("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
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 eN=Me("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"}]]);/**
|
|
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 tN=Me("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
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 nN=Me("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"}]]);/**
|
|
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 aN=Me("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"}]]);/**
|
|
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 tu=Me("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"}]]);/**
|
|
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 rN=Me("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
|
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 lN=Me("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
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 Dm=Me("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"}]]);/**
|
|
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 sN=Me("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
|
|
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 oN=Me("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"}]]);/**
|
|
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 iN=Me("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"}]]);/**
|
|
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 cN=Me("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"}]]);/**
|
|
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 R0=Me("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
|
|
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 uN=Me("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
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 T0=Me("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"}]]);/**
|
|
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 A0=Me("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"}]]);/**
|
|
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 dN=Me("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
|
|
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 mr=Me("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 fN=Me("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"}]]);/**
|
|
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 hN=Me("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"}]]);/**
|
|
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 mN=Me("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
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 M0=Me("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"}]]);/**
|
|
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 pN=Me("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
246
|
-
* @license lucide-react v0.469.0 - ISC
|
|
247
|
-
*
|
|
248
|
-
* This source code is licensed under the ISC license.
|
|
249
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
-
*/const gN=Me("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
251
|
-
* @license lucide-react v0.469.0 - ISC
|
|
252
|
-
*
|
|
253
|
-
* This source code is licensed under the ISC license.
|
|
254
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
-
*/const mi=Me("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
256
|
-
* @license lucide-react v0.469.0 - ISC
|
|
257
|
-
*
|
|
258
|
-
* This source code is licensed under the ISC license.
|
|
259
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
-
*/const D0=Me("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
261
|
-
* @license lucide-react v0.469.0 - ISC
|
|
262
|
-
*
|
|
263
|
-
* This source code is licensed under the ISC license.
|
|
264
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
-
*/const vN=Me("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
266
|
-
* @license lucide-react v0.469.0 - ISC
|
|
267
|
-
*
|
|
268
|
-
* This source code is licensed under the ISC license.
|
|
269
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
-
*/const xN=Me("Route",[["circle",{cx:"6",cy:"19",r:"3",key:"1kj8tv"}],["path",{d:"M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15",key:"1d8sl"}],["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}]]);/**
|
|
271
|
-
* @license lucide-react v0.469.0 - ISC
|
|
272
|
-
*
|
|
273
|
-
* This source code is licensed under the ISC license.
|
|
274
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
-
*/const yN=Me("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"}]]);/**
|
|
276
|
-
* @license lucide-react v0.469.0 - ISC
|
|
277
|
-
*
|
|
278
|
-
* This source code is licensed under the ISC license.
|
|
279
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
-
*/const Om=Me("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
281
|
-
* @license lucide-react v0.469.0 - ISC
|
|
282
|
-
*
|
|
283
|
-
* This source code is licensed under the ISC license.
|
|
284
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
-
*/const bN=Me("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
|
|
286
|
-
* @license lucide-react v0.469.0 - ISC
|
|
287
|
-
*
|
|
288
|
-
* This source code is licensed under the ISC license.
|
|
289
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
-
*/const wN=Me("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"}]]);/**
|
|
291
|
-
* @license lucide-react v0.469.0 - ISC
|
|
292
|
-
*
|
|
293
|
-
* This source code is licensed under the ISC license.
|
|
294
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
-
*/const SN=Me("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"}]]);/**
|
|
296
|
-
* @license lucide-react v0.469.0 - ISC
|
|
297
|
-
*
|
|
298
|
-
* This source code is licensed under the ISC license.
|
|
299
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
-
*/const jN=Me("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"}]]);/**
|
|
301
|
-
* @license lucide-react v0.469.0 - ISC
|
|
302
|
-
*
|
|
303
|
-
* This source code is licensed under the ISC license.
|
|
304
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
-
*/const pi=Me("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"}]]);/**
|
|
306
|
-
* @license lucide-react v0.469.0 - ISC
|
|
307
|
-
*
|
|
308
|
-
* This source code is licensed under the ISC license.
|
|
309
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
-
*/const CN=Me("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
|
311
|
-
* @license lucide-react v0.469.0 - ISC
|
|
312
|
-
*
|
|
313
|
-
* This source code is licensed under the ISC license.
|
|
314
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
-
*/const EN=Me("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
316
|
-
* @license lucide-react v0.469.0 - ISC
|
|
317
|
-
*
|
|
318
|
-
* This source code is licensed under the ISC license.
|
|
319
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
-
*/const NN=Me("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
|
|
321
|
-
* @license lucide-react v0.469.0 - ISC
|
|
322
|
-
*
|
|
323
|
-
* This source code is licensed under the ISC license.
|
|
324
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
-
*/const RN=Me("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
|
|
326
|
-
* @license lucide-react v0.469.0 - ISC
|
|
327
|
-
*
|
|
328
|
-
* This source code is licensed under the ISC license.
|
|
329
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
-
*/const Eu=Me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
331
|
-
* @license lucide-react v0.469.0 - ISC
|
|
332
|
-
*
|
|
333
|
-
* This source code is licensed under the ISC license.
|
|
334
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
-
*/const TN=Me("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 O0(n){var a,l,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var c=n.length;for(a=0;a<c;a++)n[a]&&(l=O0(n[a]))&&(o&&(o+=" "),o+=l)}else for(l in n)n[l]&&(o&&(o+=" "),o+=l);return o}function _0(){for(var n,a,l=0,o="",c=arguments.length;l<c;l++)(n=arguments[l])&&(a=O0(n))&&(o&&(o+=" "),o+=a);return o}const _m="-",AN=n=>{const a=DN(n),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=n;return{getClassGroupId:f=>{const p=f.split(_m);return p[0]===""&&p.length!==1&&p.shift(),k0(p,a)||MN(f)},getConflictingClassGroupIds:(f,p)=>{const g=l[f]||[];return p&&o[f]?[...g,...o[f]]:g}}},k0=(n,a)=>{var f;if(n.length===0)return a.classGroupId;const l=n[0],o=a.nextPart.get(l),c=o?k0(n.slice(1),o):void 0;if(c)return c;if(a.validators.length===0)return;const u=n.join(_m);return(f=a.validators.find(({validator:p})=>p(u)))==null?void 0:f.classGroupId},Jy=/^\[(.+)\]$/,MN=n=>{if(Jy.test(n)){const a=Jy.exec(n)[1],l=a==null?void 0:a.substring(0,a.indexOf(":"));if(l)return"arbitrary.."+l}},DN=n=>{const{theme:a,prefix:l}=n,o={nextPart:new Map,validators:[]};return _N(Object.entries(n.classGroups),l).forEach(([u,f])=>{Bh(f,o,u,a)}),o},Bh=(n,a,l,o)=>{n.forEach(c=>{if(typeof c=="string"){const u=c===""?a:Wy(a,c);u.classGroupId=l;return}if(typeof c=="function"){if(ON(c)){Bh(c(o),a,l,o);return}a.validators.push({validator:c,classGroupId:l});return}Object.entries(c).forEach(([u,f])=>{Bh(f,Wy(a,u),l,o)})})},Wy=(n,a)=>{let l=n;return a.split(_m).forEach(o=>{l.nextPart.has(o)||l.nextPart.set(o,{nextPart:new Map,validators:[]}),l=l.nextPart.get(o)}),l},ON=n=>n.isThemeGetter,_N=(n,a)=>a?n.map(([l,o])=>{const c=o.map(u=>typeof u=="string"?a+u:typeof u=="object"?Object.fromEntries(Object.entries(u).map(([f,p])=>[a+f,p])):u);return[l,c]}):n,kN=n=>{if(n<1)return{get:()=>{},set:()=>{}};let a=0,l=new Map,o=new Map;const c=(u,f)=>{l.set(u,f),a++,a>n&&(a=0,o=l,l=new Map)};return{get(u){let f=l.get(u);if(f!==void 0)return f;if((f=o.get(u))!==void 0)return c(u,f),f},set(u,f){l.has(u)?l.set(u,f):c(u,f)}}},z0="!",zN=n=>{const{separator:a,experimentalParseClassName:l}=n,o=a.length===1,c=a[0],u=a.length,f=p=>{const g=[];let v=0,x=0,y;for(let C=0;C<p.length;C++){let R=p[C];if(v===0){if(R===c&&(o||p.slice(C,C+u)===a)){g.push(p.slice(x,C)),x=C+u;continue}if(R==="/"){y=C;continue}}R==="["?v++:R==="]"&&v--}const b=g.length===0?p:p.substring(x),w=b.startsWith(z0),E=w?b.substring(1):b,j=y&&y>x?y-x:void 0;return{modifiers:g,hasImportantModifier:w,baseClassName:E,maybePostfixModifierPosition:j}};return l?p=>l({className:p,parseClassName:f}):f},LN=n=>{if(n.length<=1)return n;const a=[];let l=[];return n.forEach(o=>{o[0]==="["?(a.push(...l.sort(),o),l=[]):l.push(o)}),a.push(...l.sort()),a},UN=n=>({cache:kN(n.cacheSize),parseClassName:zN(n),...AN(n)}),IN=/\s+/,BN=(n,a)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c}=a,u=[],f=n.trim().split(IN);let p="";for(let g=f.length-1;g>=0;g-=1){const v=f[g],{modifiers:x,hasImportantModifier:y,baseClassName:b,maybePostfixModifierPosition:w}=l(v);let E=!!w,j=o(E?b.substring(0,w):b);if(!j){if(!E){p=v+(p.length>0?" "+p:p);continue}if(j=o(b),!j){p=v+(p.length>0?" "+p:p);continue}E=!1}const C=LN(x).join(":"),R=y?C+z0:C,D=R+j;if(u.includes(D))continue;u.push(D);const A=c(j,E);for(let M=0;M<A.length;++M){const O=A[M];u.push(R+O)}p=v+(p.length>0?" "+p:p)}return p};function PN(){let n=0,a,l,o="";for(;n<arguments.length;)(a=arguments[n++])&&(l=L0(a))&&(o&&(o+=" "),o+=l);return o}const L0=n=>{if(typeof n=="string")return n;let a,l="";for(let o=0;o<n.length;o++)n[o]&&(a=L0(n[o]))&&(l&&(l+=" "),l+=a);return l};function HN(n,...a){let l,o,c,u=f;function f(g){const v=a.reduce((x,y)=>y(x),n());return l=UN(v),o=l.cache.get,c=l.cache.set,u=p,p(g)}function p(g){const v=o(g);if(v)return v;const x=BN(g,l);return c(g,x),x}return function(){return u(PN.apply(null,arguments))}}const jt=n=>{const a=l=>l[n]||[];return a.isThemeGetter=!0,a},U0=/^\[(?:([a-z-]+):)?(.+)\]$/i,qN=/^\d+\/\d+$/,$N=new Set(["px","full","screen"]),VN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,YN=/\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$/,GN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,KN=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,XN=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,dr=n=>Is(n)||$N.has(n)||qN.test(n),Zr=n=>Ks(n,"length",nR),Is=n=>!!n&&!Number.isNaN(Number(n)),gh=n=>Ks(n,"number",Is),Zo=n=>!!n&&Number.isInteger(Number(n)),FN=n=>n.endsWith("%")&&Is(n.slice(0,-1)),Be=n=>U0.test(n),Jr=n=>VN.test(n),QN=new Set(["length","size","percentage"]),ZN=n=>Ks(n,QN,I0),JN=n=>Ks(n,"position",I0),WN=new Set(["image","url"]),eR=n=>Ks(n,WN,rR),tR=n=>Ks(n,"",aR),Jo=()=>!0,Ks=(n,a,l)=>{const o=U0.exec(n);return o?o[1]?typeof a=="string"?o[1]===a:a.has(o[1]):l(o[2]):!1},nR=n=>YN.test(n)&&!GN.test(n),I0=()=>!1,aR=n=>KN.test(n),rR=n=>XN.test(n),lR=()=>{const n=jt("colors"),a=jt("spacing"),l=jt("blur"),o=jt("brightness"),c=jt("borderColor"),u=jt("borderRadius"),f=jt("borderSpacing"),p=jt("borderWidth"),g=jt("contrast"),v=jt("grayscale"),x=jt("hueRotate"),y=jt("invert"),b=jt("gap"),w=jt("gradientColorStops"),E=jt("gradientColorStopPositions"),j=jt("inset"),C=jt("margin"),R=jt("opacity"),D=jt("padding"),A=jt("saturate"),M=jt("scale"),O=jt("sepia"),N=jt("skew"),_=jt("space"),U=jt("translate"),V=()=>["auto","contain","none"],te=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",Be,a],G=()=>[Be,a],B=()=>["",dr,Zr],F=()=>["auto",Is,Be],ce=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],k=()=>["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"],ee=()=>["start","end","center","between","around","evenly","stretch"],I=()=>["","0",Be],W=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[Is,Be];return{cacheSize:500,separator:":",theme:{colors:[Jo],spacing:[dr,Zr],blur:["none","",Jr,Be],brightness:z(),borderColor:[n],borderRadius:["none","","full",Jr,Be],borderSpacing:G(),borderWidth:B(),contrast:z(),grayscale:I(),hueRotate:z(),invert:I(),gap:G(),gradientColorStops:[n],gradientColorStopPositions:[FN,Zr],inset:q(),margin:q(),opacity:z(),padding:G(),saturate:z(),scale:z(),sepia:I(),skew:z(),space:G(),translate:G()},classGroups:{aspect:[{aspect:["auto","square","video",Be]}],container:["container"],columns:[{columns:[Jr]}],"break-after":[{"break-after":W()}],"break-before":[{"break-before":W()}],"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:[...ce(),Be]}],overflow:[{overflow:te()}],"overflow-x":[{"overflow-x":te()}],"overflow-y":[{"overflow-y":te()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],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",Zo,Be]}],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",Be]}],grow:[{grow:I()}],shrink:[{shrink:I()}],order:[{order:["first","last","none",Zo,Be]}],"grid-cols":[{"grid-cols":[Jo]}],"col-start-end":[{col:["auto",{span:["full",Zo,Be]},Be]}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":[Jo]}],"row-start-end":[{row:["auto",{span:[Zo,Be]},Be]}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Be]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Be]}],gap:[{gap:[b]}],"gap-x":[{"gap-x":[b]}],"gap-y":[{"gap-y":[b]}],"justify-content":[{justify:["normal",...ee()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ee(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ee(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[D]}],px:[{px:[D]}],py:[{py:[D]}],ps:[{ps:[D]}],pe:[{pe:[D]}],pt:[{pt:[D]}],pr:[{pr:[D]}],pb:[{pb:[D]}],pl:[{pl:[D]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Be,a]}],"min-w":[{"min-w":[Be,a,"min","max","fit"]}],"max-w":[{"max-w":[Be,a,"none","full","min","max","fit","prose",{screen:[Jr]},Jr]}],h:[{h:[Be,a,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Be,a,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Be,a,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Be,a,"auto","min","max","fit"]}],"font-size":[{text:["base",Jr,Zr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",gh]}],"font-family":[{font:[Jo]}],"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",Be]}],"line-clamp":[{"line-clamp":["none",Is,gh]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",dr,Be]}],"list-image":[{"list-image":["none",Be]}],"list-style-type":[{list:["none","disc","decimal",Be]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[R]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[R]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...k(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",dr,Zr]}],"underline-offset":[{"underline-offset":["auto",dr,Be]}],"text-decoration-color":[{decoration:[n]}],"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",Be]}],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",Be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[R]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ce(),JN]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ZN]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},eR]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[E]}],"gradient-via-pos":[{via:[E]}],"gradient-to-pos":[{to:[E]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[u]}],"rounded-s":[{"rounded-s":[u]}],"rounded-e":[{"rounded-e":[u]}],"rounded-t":[{"rounded-t":[u]}],"rounded-r":[{"rounded-r":[u]}],"rounded-b":[{"rounded-b":[u]}],"rounded-l":[{"rounded-l":[u]}],"rounded-ss":[{"rounded-ss":[u]}],"rounded-se":[{"rounded-se":[u]}],"rounded-ee":[{"rounded-ee":[u]}],"rounded-es":[{"rounded-es":[u]}],"rounded-tl":[{"rounded-tl":[u]}],"rounded-tr":[{"rounded-tr":[u]}],"rounded-br":[{"rounded-br":[u]}],"rounded-bl":[{"rounded-bl":[u]}],"border-w":[{border:[p]}],"border-w-x":[{"border-x":[p]}],"border-w-y":[{"border-y":[p]}],"border-w-s":[{"border-s":[p]}],"border-w-e":[{"border-e":[p]}],"border-w-t":[{"border-t":[p]}],"border-w-r":[{"border-r":[p]}],"border-w-b":[{"border-b":[p]}],"border-w-l":[{"border-l":[p]}],"border-opacity":[{"border-opacity":[R]}],"border-style":[{border:[...k(),"hidden"]}],"divide-x":[{"divide-x":[p]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[p]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[R]}],"divide-style":[{divide:k()}],"border-color":[{border:[c]}],"border-color-x":[{"border-x":[c]}],"border-color-y":[{"border-y":[c]}],"border-color-s":[{"border-s":[c]}],"border-color-e":[{"border-e":[c]}],"border-color-t":[{"border-t":[c]}],"border-color-r":[{"border-r":[c]}],"border-color-b":[{"border-b":[c]}],"border-color-l":[{"border-l":[c]}],"divide-color":[{divide:[c]}],"outline-style":[{outline:["",...k()]}],"outline-offset":[{"outline-offset":[dr,Be]}],"outline-w":[{outline:[dr,Zr]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[R]}],"ring-offset-w":[{"ring-offset":[dr,Zr]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",Jr,tR]}],"shadow-color":[{shadow:[Jo]}],opacity:[{opacity:[R]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[l]}],brightness:[{brightness:[o]}],contrast:[{contrast:[g]}],"drop-shadow":[{"drop-shadow":["","none",Jr,Be]}],grayscale:[{grayscale:[v]}],"hue-rotate":[{"hue-rotate":[x]}],invert:[{invert:[y]}],saturate:[{saturate:[A]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[l]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[g]}],"backdrop-grayscale":[{"backdrop-grayscale":[v]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[x]}],"backdrop-invert":[{"backdrop-invert":[y]}],"backdrop-opacity":[{"backdrop-opacity":[R]}],"backdrop-saturate":[{"backdrop-saturate":[A]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[f]}],"border-spacing-x":[{"border-spacing-x":[f]}],"border-spacing-y":[{"border-spacing-y":[f]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Be]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",Be]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",Be]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[M]}],"scale-x":[{"scale-x":[M]}],"scale-y":[{"scale-y":[M]}],rotate:[{rotate:[Zo,Be]}],"translate-x":[{"translate-x":[U]}],"translate-y":[{"translate-y":[U]}],"skew-x":[{"skew-x":[N]}],"skew-y":[{"skew-y":[N]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Be]}],accent:[{accent:["auto",n]}],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",Be]}],"caret-color":[{caret:[n]}],"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",Be]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[dr,Zr,gh]}],stroke:[{stroke:[n,"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"]}}},sR=HN(lR);function Ee(...n){return sR(_0(n))}function Vt(n,a="—"){return n==null||Number.isNaN(n)?a:n.toLocaleString()}function Nu(n,a=1,l="—"){return n==null||Number.isNaN(n)?l:`${(n*100).toFixed(a)}%`}function Ol(n){return n?n<1e3?`${Math.round(n)} ms`:`${(n/1e3).toFixed(2)} s`:"—"}function km(n){if(!n)return"—";try{return new Date(n).toLocaleString()}catch{return n}}function oR(n,a=8){return n?n.length>a?`${n.slice(0,a)}…`:n:"—"}function iR(n){if(!n)return"—";const a=Date.now()-new Date(n).getTime();if(!Number.isFinite(a)||a<0)return"—";const l=Math.floor(a/1e3);if(l<60)return`${l}s ago`;const o=Math.floor(l/60);if(o<60)return`${o}m ago`;const c=Math.floor(o/60);return c<24?`${c}h ago`:`${Math.floor(c/24)}d ago`}const cR=[{to:"/",label:"Dashboard",icon:R0,end:!0},{to:"/providers",label:"Providers",icon:M0},{to:"/models",label:"Models",icon:ZE},{to:"/combos",label:"Combos",icon:A0},{to:"/aliases",label:"Aliases",icon:nN},{to:"/api-keys",label:"API Keys",icon:T0},{to:"/requests",label:"Requests",icon:C0},{to:"/statistics",label:"Statistics",icon:iN},{to:"/audit",label:"Audit Logs",icon:yN},{to:"/settings",label:"Settings",icon:aN}];function uR(){const[n,a]=h.useState(null);return h.useEffect(()=>{let l=!1;return fetch("/api/admin/settings/system",{credentials:"include"}).then(o=>o.ok?o.json():null).then(o=>{!l&&(o!=null&&o.appVersion)&&a(o.appVersion)}).catch(()=>{}),()=>{l=!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:cR.map(l=>s.jsxs(v0,{to:l.to,end:l.end,className:({isActive:o})=>Ee("flex items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors",o?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[s.jsx(l.icon,{className:"h-4 w-4"}),l.label]},l.to))}),s.jsxs("div",{className:"border-t p-3 text-xs text-muted-foreground flex items-center gap-2",children:[s.jsx(wN,{className:"h-3.5 w-3.5 text-primary"})," ",n?`v${n}`:"v…"]})]})}var dR=Object.defineProperty,zm=(n,a)=>dR(n,"name",{value:a,configurable:!0});function Ph(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}zm(Ph,"setRef");function B0(...n){return a=>{let l=!1;const o=n.map(c=>{const u=Ph(c,a);return!l&&typeof u=="function"&&(l=!0),u});if(l)return()=>{for(let c=0;c<o.length;c++){const u=o[c];typeof u=="function"?u():Ph(n[c],null)}}}}zm(B0,"composeRefs");function Ye(...n){return h.useCallback(B0(...n),n)}zm(Ye,"useComposedRefs");var fR=Object.defineProperty,Ea=(n,a)=>fR(n,"name",{value:a,configurable:!0});function za(n){const a=h.forwardRef((l,o)=>{let{children:c,...u}=l,f=null,p=!1;const g=[];Hh(c)&&typeof Ic=="function"&&(c=Ic(c._payload)),h.Children.forEach(c,b=>{var w;if(V0(b)){p=!0;const E=b;let j="child"in E.props?E.props.child:E.props.children;Hh(j)&&typeof Ic=="function"&&(j=Ic(j._payload)),f=mR(E,j),g.push((w=f==null?void 0:f.props)==null?void 0:w.children)}else g.push(b)}),f?f=h.cloneElement(f,void 0,g):!p&&h.Children.count(c)===1&&h.isValidElement(c)&&(f=c);const v=f?$0(f):void 0,x=Ye(o,v);if(!f){if(c||c===0)throw new Error(p?vR(n):gR(n));return c}const y=q0(u,f.props??{});return f.type!==h.Fragment&&(y.ref=o?x:v),h.cloneElement(f,y)});return a.displayName=`${n}.Slot`,a}Ea(za,"createSlot");var hR=za("Slot"),P0=Symbol.for("radix.slottable");function H0(n){const a=Ea(l=>"child"in l?l.children(l.child):l.children,"Slottable");return a.displayName=`${n}.Slottable`,a.__radixId=P0,a}Ea(H0,"createSlottable");var mR=Ea((n,a)=>{if("child"in n.props){const l=n.props.child;return h.isValidElement(l)?h.cloneElement(l,void 0,n.props.children(l.props.children)):null}return h.isValidElement(a)?a:null},"getSlottableElementFromSlottable");function q0(n,a){const l={...a};for(const o in a){const c=n[o],u=a[o];/^on[A-Z]/.test(o)?c&&u?l[o]=(...p)=>{const g=u(...p);return c(...p),g}:c&&(l[o]=c):o==="style"?l[o]={...c,...u}:o==="className"&&(l[o]=[c,u].filter(Boolean).join(" "))}return{...n,...l}}Ea(q0,"mergeProps");function $0(n){var o,c;let a=(o=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?n.ref:(a=(c=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?n.props.ref:n.props.ref||n.ref)}Ea($0,"getElementRef");function V0(n){return h.isValidElement(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===P0}Ea(V0,"isSlottable");var pR=Symbol.for("react.lazy");function Hh(n){return n!=null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===pR&&"_payload"in n&&Y0(n._payload)}Ea(Hh,"isLazyComponent");function Y0(n){return typeof n=="object"&&n!==null&&"then"in n}Ea(Y0,"isPromiseLike");var gR=Ea(n=>`${n} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),vR=Ea(n=>`${n} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Ic=$s[" use ".trim().toString()];const eb=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,tb=_0,G0=(n,a)=>l=>{var o;if((a==null?void 0:a.variants)==null)return tb(n,l==null?void 0:l.class,l==null?void 0:l.className);const{variants:c,defaultVariants:u}=a,f=Object.keys(c).map(v=>{const x=l==null?void 0:l[v],y=u==null?void 0:u[v];if(x===null)return null;const b=eb(x)||eb(y);return c[v][b]}),p=l&&Object.entries(l).reduce((v,x)=>{let[y,b]=x;return b===void 0||(v[y]=b),v},{}),g=a==null||(o=a.compoundVariants)===null||o===void 0?void 0:o.reduce((v,x)=>{let{class:y,className:b,...w}=x;return Object.entries(w).every(E=>{let[j,C]=E;return Array.isArray(C)?C.includes({...u,...p}[j]):{...u,...p}[j]===C})?[...v,y,b]:v},[]);return tb(n,f,g,l==null?void 0:l.class,l==null?void 0:l.className)},xR=G0("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"}}),oe=h.forwardRef(({className:n,variant:a,size:l,asChild:o=!1,...c},u)=>{const f=o?hR:"button";return s.jsx(f,{className:Ee(xR({variant:a,size:l,className:n})),ref:u,...c})});oe.displayName="Button";const K0=h.createContext(void 0);function yR({children:n,defaultTheme:a="system",storageKey:l="latedev-theme"}){const[o,c]=h.useState(()=>localStorage.getItem(l)||a);h.useEffect(()=>{const f=window.document.documentElement;if(f.classList.remove("light","dark"),o==="system"){const p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";f.classList.add(p);return}f.classList.add(o)},[o]);const u={theme:o,setTheme:f=>{localStorage.setItem(l,f),c(f)}};return s.jsx(K0.Provider,{value:u,children:n})}function bR(){const n=h.useContext(K0);if(!n)throw new Error("useTheme must be used within ThemeProvider");return n}var wR=Object.defineProperty,Xs=(n,a)=>wR(n,"name",{value:a,configurable:!0}),X0=!!(typeof window<"u"&&window.document&&window.document.createElement);function je(n,a,{checkForDefaultPrevented:l=!0}={}){return Xs(function(c){if(n==null||n(c),l===!1||!c||!c.defaultPrevented)return a==null?void 0:a(c)},"handleEvent")}Xs(je,"composeEventHandlers");function SR(n){var a;if(!X0)throw new Error("Cannot access window outside of the DOM");return((a=n==null?void 0:n.ownerDocument)==null?void 0:a.defaultView)??window}Xs(SR,"getOwnerWindow");function qh(n){if(!X0)throw new Error("Cannot access document outside of the DOM");return(n==null?void 0:n.ownerDocument)??document}Xs(qh,"getOwnerDocument");function F0(n,a=!1){const{activeElement:l}=qh(n);if(!(l!=null&&l.nodeName))return null;if(Q0(l)&&l.contentDocument)return F0(l.contentDocument.body,a);if(a){const o=l.getAttribute("aria-activedescendant");if(o){const c=qh(l).getElementById(o);if(c)return c}}return l}Xs(F0,"getActiveElement");function Q0(n){return n.tagName==="IFRAME"}Xs(Q0,"isFrame");var jR=Object.defineProperty,da=(n,a)=>jR(n,"name",{value:a,configurable:!0});function CR(n,a){const l=h.createContext(a);l.displayName=n+"Context";const o=da(u=>{const{children:f,...p}=u,g=h.useMemo(()=>p,Object.values(p));return s.jsx(l.Provider,{value:g,children:f})},"Provider");o.displayName=n+"Provider";function c(u,f={}){const{optional:p=!1}=f,g=h.useContext(l);if(g)return g;if(a!==void 0)return a;if(!p)throw new Error(`\`${u}\` must be used within \`${n}\``)}return da(c,"useContext"),[o,c]}da(CR,"createContext");function _n(n,a=[]){let l=[];function o(u,f){const p=h.createContext(f);p.displayName=u+"Context";const g=l.length;l=[...l,f];const v=da(y=>{var R;const{scope:b,children:w,...E}=y,j=((R=b==null?void 0:b[n])==null?void 0:R[g])||p,C=h.useMemo(()=>E,Object.values(E));return s.jsx(j.Provider,{value:C,children:w})},"Provider");v.displayName=u+"Provider";function x(y,b,w={}){var R;const{optional:E=!1}=w,j=((R=b==null?void 0:b[n])==null?void 0:R[g])||p,C=h.useContext(j);if(C)return C;if(f!==void 0)return f;if(!E)throw new Error(`\`${y}\` must be used within \`${u}\``)}return da(x,"useContext"),[v,x]}da(o,"createContext");const c=da(()=>{const u=l.map(f=>h.createContext(f));return da(function(p){const g=(p==null?void 0:p[n])||u;return h.useMemo(()=>({[`__scope${n}`]:{...p,[n]:g}}),[p,g])},"useScope")},"createScope");return c.scopeName=n,[o,Z0(c,...a)]}da(_n,"createContextScope");function Z0(...n){const a=n[0];if(n.length===1)return a;const l=da(()=>{const o=n.map(c=>({useScope:c(),scopeName:c.scopeName}));return da(function(u){const f=o.reduce((p,{useScope:g,scopeName:v})=>{const y=g(u)[`__scope${v}`];return{...p,...y}},{});return h.useMemo(()=>({[`__scope${a.scopeName}`]:f}),[f])},"useComposedScopes")},"createScope");return l.scopeName=a.scopeName,l}da(Z0,"composeContextScopes");var Yt=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},ER=Object.defineProperty,NR=(n,a)=>ER(n,"name",{value:a,configurable:!0}),nb=$s[" useEffectEvent ".trim().toString()],ab=$s[" useInsertionEffect ".trim().toString()];function J0(n){if(typeof nb=="function")return nb(n);const a=h.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof ab=="function"?ab(()=>{a.current=n}):Yt(()=>{a.current=n}),h.useMemo(()=>((...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)}),[])}NR(J0,"useEffectEvent");var RR=Object.defineProperty,gi=(n,a)=>RR(n,"name",{value:a,configurable:!0}),TR=$s[" useInsertionEffect ".trim().toString()]||Yt;function La({prop:n,defaultProp:a,onChange:l=gi(()=>{},"onChange"),caller:o}){const[c,u,f]=W0({defaultProp:a,onChange:l}),p=n!==void 0,g=p?n:c,v=h.useCallback(x=>{var y;if(p){const b=e1(x)?x(n):x;b!==n&&((y=f.current)==null||y.call(f,b))}else u(x)},[p,n,u,f]);return[g,v]}gi(La,"useControllableState");function W0({defaultProp:n,onChange:a}){const[l,o]=h.useState(n),c=h.useRef(l),u=h.useRef(a);return TR(()=>{u.current=a},[a]),h.useEffect(()=>{var f;c.current!==l&&((f=u.current)==null||f.call(u,l),c.current=l)},[l,c]),[l,o,u]}gi(W0,"useUncontrolledState");function e1(n){return typeof n=="function"}gi(e1,"isFunction");var rb=Symbol("RADIX:SYNC_STATE");function AR(n,a,l,o){const{prop:c,defaultProp:u,onChange:f,caller:p}=a,g=c!==void 0,v=J0(f),x=[{...l,state:u}];o&&x.push(o);const[y,b]=h.useReducer((C,R)=>{if(R.type===rb)return{...C,state:R.state};const D=n(C,R);return g&&!Object.is(D.state,C.state)&&v(D.state),D},...x),w=y.state,E=h.useRef(w);h.useEffect(()=>{E.current!==w&&(E.current=w,g||v(w))},[w,E,g]);const j=h.useMemo(()=>c!==void 0?{...y,state:c}:y,[y,c]);return h.useEffect(()=>{g&&!Object.is(c,y.state)&&b({type:rb,state:c})},[c,y.state,g]),[j,b]}gi(AR,"useControllableStateReducer");var MR=Object.defineProperty,DR=(n,a)=>MR(n,"name",{value:a,configurable:!0}),OR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=OR.reduce((n,a)=>{const l=za(`Primitive.${a}`),o=h.forwardRef((c,u)=>{const{asChild:f,...p}=c,g=f?l:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(g,{...p,ref:u})});return o.displayName=`Primitive.${a}`,{...n,[a]:o}},{});function Lm(n,a){n&&wa.flushSync(()=>n.dispatchEvent(a))}DR(Lm,"dispatchDiscreteCustomEvent");var _R=Object.defineProperty,Jt=(n,a)=>_R(n,"name",{value:a,configurable:!0});function Ru(n){const a=n+"CollectionProvider",[l,o]=_n(a),[c,u]=l(a,{collectionRef:{current:null},itemMap:new Map}),f=Jt(j=>{const{scope:C,children:R}=j,D=h.useRef(null),A=h.useRef(new Map).current;return s.jsx(c,{scope:C,itemMap:A,collectionRef:D,children:R})},"CollectionProvider");f.displayName=a;const p=n+"CollectionSlot",g=za(p),v=h.forwardRef((j,C)=>{const{scope:R,children:D}=j,A=u(p,R),M=Ye(C,A.collectionRef);return s.jsx(g,{ref:M,children:D})});v.displayName=p;const x=n+"CollectionItemSlot",y="data-radix-collection-item",b=za(x),w=h.forwardRef((j,C)=>{const{scope:R,children:D,...A}=j,M=h.useRef(null),O=Ye(C,M),N=u(x,R);return h.useEffect(()=>(N.itemMap.set(M,{ref:M,...A}),()=>void N.itemMap.delete(M))),s.jsx(b,{[y]:"",ref:O,children:D})});w.displayName=x;function E(j){const C=u(n+"CollectionConsumer",j);return h.useCallback(()=>{const D=C.collectionRef.current;if(!D)return[];const A=Array.from(D.querySelectorAll(`[${y}]`));return Array.from(C.itemMap.values()).sort((N,_)=>A.indexOf(N.ref.current)-A.indexOf(_.ref.current))},[C.collectionRef,C.itemMap])}return Jt(E,"useCollection"),[{Provider:f,Slot:v,ItemSlot:w},E,o]}Jt(Ru,"createCollection");var lb=new WeakMap,Pt,$n,vh=($n=class extends Map{constructor(l){super(l);ky(this,Pt);lh(this,Pt,[...super.keys()]),lb.set(this,!0)}set(l,o){return lb.get(this)&&(this.has(l)?on(this,Pt)[on(this,Pt).indexOf(l)]=l:on(this,Pt).push(l)),super.set(l,o),this}insert(l,o,c){const u=this.has(o),f=on(this,Pt).length,p=Um(l);let g=p>=0?p:f+p;const v=g<0||g>=f?-1:g;if(v===this.size||u&&v===this.size-1||v===-1)return this.set(o,c),this;const x=this.size+(u?0:1);p<0&&g++;const y=[...on(this,Pt)];let b,w=!1;for(let E=g;E<x;E++)if(g===E){let j=y[E];y[E]===o&&(j=y[E+1]),u&&this.delete(o),b=this.get(j),this.set(o,c)}else{!w&&y[E-1]===o&&(w=!0);const j=y[w?E:E-1],C=b;b=this.get(j),this.delete(j),this.set(j,C)}return this}with(l,o,c){const u=new $n(this);return u.insert(l,o,c),u}before(l){const o=on(this,Pt).indexOf(l)-1;if(!(o<0))return this.entryAt(o)}setBefore(l,o,c){const u=on(this,Pt).indexOf(l);return u===-1?this:this.insert(u,o,c)}after(l){let o=on(this,Pt).indexOf(l);if(o=o===-1||o===this.size-1?-1:o+1,o!==-1)return this.entryAt(o)}setAfter(l,o,c){const u=on(this,Pt).indexOf(l);return u===-1?this:this.insert(u+1,o,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return lh(this,Pt,[]),super.clear()}delete(l){const o=super.delete(l);return o&&on(this,Pt).splice(on(this,Pt).indexOf(l),1),o}deleteAt(l){const o=this.keyAt(l);return o!==void 0?this.delete(o):!1}at(l){const o=nu(on(this,Pt),l);if(o!==void 0)return this.get(o)}entryAt(l){const o=nu(on(this,Pt),l);if(o!==void 0)return[o,this.get(o)]}indexOf(l){return on(this,Pt).indexOf(l)}keyAt(l){return nu(on(this,Pt),l)}from(l,o){const c=this.indexOf(l);if(c===-1)return;let u=c+o;return u<0&&(u=0),u>=this.size&&(u=this.size-1),this.at(u)}keyFrom(l,o){const c=this.indexOf(l);if(c===-1)return;let u=c+o;return u<0&&(u=0),u>=this.size&&(u=this.size-1),this.keyAt(u)}find(l,o){let c=0;for(const u of this){if(Reflect.apply(l,o,[u,c,this]))return u;c++}}findIndex(l,o){let c=0;for(const u of this){if(Reflect.apply(l,o,[u,c,this]))return c;c++}return-1}filter(l,o){const c=[];let u=0;for(const f of this)Reflect.apply(l,o,[f,u,this])&&c.push(f),u++;return new $n(c)}map(l,o){const c=[];let u=0;for(const f of this)c.push([f[0],Reflect.apply(l,o,[f,u,this])]),u++;return new $n(c)}reduce(...l){const[o,c]=l;let u=0,f=c??this.at(0);for(const p of this)u===0&&l.length===1?f=p:f=Reflect.apply(o,this,[f,p,u,this]),u++;return f}reduceRight(...l){const[o,c]=l;let u=c??this.at(-1);for(let f=this.size-1;f>=0;f--){const p=this.at(f);f===this.size-1&&l.length===1?u=p:u=Reflect.apply(o,this,[u,p,f,this])}return u}toSorted(l){const o=[...this.entries()].sort(l);return new $n(o)}toReversed(){const l=new $n;for(let o=this.size-1;o>=0;o--){const c=this.keyAt(o),u=this.get(c);l.set(c,u)}return l}toSpliced(...l){const o=[...this.entries()];return o.splice(...l),new $n(o)}slice(l,o){const c=new $n;let u=this.size-1;if(l===void 0)return c;l<0&&(l=l+this.size),o!==void 0&&o>0&&(u=o-1);for(let f=l;f<=u;f++){const p=this.keyAt(f),g=this.get(p);c.set(p,g)}return c}every(l,o){let c=0;for(const u of this){if(!Reflect.apply(l,o,[u,c,this]))return!1;c++}return!0}some(l,o){let c=0;for(const u of this){if(Reflect.apply(l,o,[u,c,this]))return!0;c++}return!1}},Pt=new WeakMap,Jt($n,"OrderedDict"),$n);function nu(n,a){if("at"in Array.prototype)return Array.prototype.at.call(n,a);const l=t1(n,a);return l===-1?void 0:n[l]}Jt(nu,"at");function t1(n,a){const l=n.length,o=Um(a),c=o>=0?o:l+o;return c<0||c>=l?-1:c}Jt(t1,"toSafeIndex");function Um(n){return n!==n||n===0?0:Math.trunc(n)}Jt(Um,"toSafeInteger");function kR(n){const a=n+"CollectionProvider",[l,o]=_n(a),[c,u]=l(a,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new vh,setItemMap:Jt(()=>{},"setItemMap")}),f=Jt(({state:A,...M})=>A?s.jsx(g,{...M,state:A}):s.jsx(p,{...M}),"CollectionProvider");f.displayName=a;const p=Jt(A=>{const M=C();return s.jsx(g,{...A,state:M})},"CollectionInit");p.displayName=a+"Init";const g=Jt(A=>{const{scope:M,children:O,state:N}=A,_=h.useRef(null),[U,V]=h.useState(null),te=Ye(_,V),[q,G]=N;return h.useEffect(()=>{if(!U)return;const B=r1(()=>{});return B.observe(U,{childList:!0,subtree:!0}),()=>{B.disconnect()}},[U]),s.jsx(c,{scope:M,itemMap:q,setItemMap:G,collectionRef:te,collectionRefObject:_,collectionElement:U,children:O})},"CollectionProviderImpl");g.displayName=a+"Impl";const v=n+"CollectionSlot",x=za(v),y=h.forwardRef((A,M)=>{const{scope:O,children:N}=A,_=u(v,O),U=Ye(M,_.collectionRef);return s.jsx(x,{ref:U,children:N})});y.displayName=v;const b=n+"CollectionItemSlot",w="data-radix-collection-item",E=za(b),j=h.forwardRef((A,M)=>{const{scope:O,children:N,..._}=A,U=h.useRef(null),[V,te]=h.useState(null),q=Ye(M,U,te),G=u(b,O),{setItemMap:B}=G,F=h.useRef(_);n1(F.current,_)||(F.current=_);const ce=F.current;return h.useEffect(()=>{const k=ce;return B($=>V?$.has(V)?$.set(V,{...k,element:V}).toSorted($h):($.set(V,{...k,element:V}),$.toSorted($h)):$),()=>{B($=>!V||!$.has(V)?$:($.delete(V),new vh($)))}},[V,ce,B]),s.jsx(E,{[w]:"",ref:q,children:N})});j.displayName=b;function C(){return h.useState(new vh)}Jt(C,"useInitCollection");function R(A){const{itemMap:M}=u(n+"CollectionConsumer",A);return M}return Jt(R,"useCollection"),[{Provider:f,Slot:y,ItemSlot:j},{createCollectionScope:o,useCollection:R,useInitCollection:C}]}Jt(kR,"createCollection");function n1(n,a){if(n===a)return!0;if(typeof n!="object"||typeof a!="object"||n==null||a==null)return!1;const l=Object.keys(n),o=Object.keys(a);if(l.length!==o.length)return!1;for(const c of l)if(!Object.prototype.hasOwnProperty.call(a,c)||n[c]!==a[c])return!1;return!0}Jt(n1,"shallowEqual");function a1(n,a){return!!(a.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING)}Jt(a1,"isElementPreceding");function $h(n,a){return!n[1].element||!a[1].element?0:a1(n[1].element,a[1].element)?-1:1}Jt($h,"sortByDocumentPosition");function r1(n){return new MutationObserver(l=>{for(const o of l)if(o.type==="childList"){n();return}})}Jt(r1,"getChildListObserver");var zR=Object.defineProperty,LR=(n,a)=>zR(n,"name",{value:a,configurable:!0}),UR=h.createContext(void 0);function vi(n){const a=h.useContext(UR);return n||a||"ltr"}LR(vi,"useDirection");var IR=Object.defineProperty,BR=(n,a)=>IR(n,"name",{value:a,configurable:!0});function ha(n){const a=h.useRef(n);return h.useEffect(()=>{a.current=n}),h.useMemo(()=>((...l)=>{var o;return(o=a.current)==null?void 0:o.call(a,...l)}),[])}BR(ha,"useCallbackRef");var PR=Object.defineProperty,Zt=(n,a)=>PR(n,"name",{value:a,configurable:!0}),Vh="dismissableLayer.update",HR="dismissableLayer.pointerDownOutside",qR="dismissableLayer.focusOutside",sb,l1=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Tu=h.forwardRef(Zt(function(a,l){const{disableOutsidePointerEvents:o=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:g,onDismiss:v,...x}=a,y=h.useContext(l1),[b,w]=h.useState(null),E=(b==null?void 0:b.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,j]=h.useState({}),C=Ye(l,w),R=Array.from(y.layers),[D]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),A=D?R.indexOf(D):-1,M=b?R.indexOf(b):-1,O=y.layersWithOutsidePointerEventsDisabled.size>0,N=M>=A,_=h.useRef(!1),U=o1(G=>{f==null||f(G),g==null||g(G),G.defaultPrevented||v==null||v()},{ownerDocument:E,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:_,dismissableSurfaces:y.dismissableSurfaces,shouldHandlePointerDownOutside:h.useCallback(G=>{if(!(G instanceof Node))return!1;const B=[...y.branches].some(F=>F.contains(G));return N&&!B},[y.branches,N])}),V=i1(G=>{if(c&&_.current)return;const B=G.target;[...y.branches].some(ce=>ce.contains(B))||(p==null||p(G),g==null||g(G),G.defaultPrevented||v==null||v())},E),te=b?M===R.length-1:!1,q=ha(G=>{G.key==="Escape"&&(u==null||u(G),!G.defaultPrevented&&v&&(G.preventDefault(),v()))});return h.useEffect(()=>{if(te)return E.addEventListener("keydown",q,{capture:!0}),()=>E.removeEventListener("keydown",q,{capture:!0})},[E,te,q]),h.useEffect(()=>{if(b)return o&&(y.layersWithOutsidePointerEventsDisabled.size===0&&(sb=E.body.style.pointerEvents,E.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(b)),y.layers.add(b),Yh(),()=>{o&&(y.layersWithOutsidePointerEventsDisabled.delete(b),y.layersWithOutsidePointerEventsDisabled.size===0&&(E.body.style.pointerEvents=sb))}},[b,E,o,y]),h.useEffect(()=>()=>{b&&(y.layers.delete(b),y.layersWithOutsidePointerEventsDisabled.delete(b),Yh())},[b,y]),h.useEffect(()=>{const G=Zt(()=>j({}),"handleUpdate");return document.addEventListener(Vh,G),()=>document.removeEventListener(Vh,G)},[]),s.jsx(Pe.div,{...x,ref:C,style:{pointerEvents:O?N?"auto":"none":void 0,...a.style},onFocusCapture:je(a.onFocusCapture,V.onFocusCapture),onBlurCapture:je(a.onBlurCapture,V.onBlurCapture),onPointerDownCapture:je(a.onPointerDownCapture,U.onPointerDownCapture)})},"DismissableLayer"));function s1(){const n=h.useContext(l1),[a,l]=h.useState(null);return h.useEffect(()=>{if(a)return n.dismissableSurfaces.add(a),()=>{n.dismissableSurfaces.delete(a)}},[a,n.dismissableSurfaces]),l}Zt(s1,"useDismissableLayerSurface");var $R=Zt(()=>!0,"IS_TRUE");function o1(n,a){const{ownerDocument:l=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:o=!1,isDeferredPointerDownOutsideRef:c,dismissableSurfaces:u,shouldHandlePointerDownOutside:f=$R}=a,p=ha(n),g=h.useRef(!1),v=h.useRef(!1),x=h.useRef(new Map),y=h.useRef(()=>{});return h.useEffect(()=>{function b(){v.current=!1,c.current=!1,x.current.clear()}Zt(b,"resetOutsideInteraction");function w(){return Array.from(x.current.values()).some(Boolean)}Zt(w,"isOutsideInteractionIntercepted");function E(A){if(!v.current)return;const M=A.target;M instanceof Node&&[...u].some(N=>N.contains(M))||x.current.set(A.type,!0),A.type==="click"&&window.setTimeout(()=>{v.current&&y.current()},0)}Zt(E,"handleInteractionCapture");function j(A){v.current&&x.current.set(A.type,!1)}Zt(j,"handleInteractionBubble");const C=Zt(A=>{if(A.target&&!g.current){let M=function(){l.removeEventListener("click",y.current);const N=w();b(),N||Im(HR,p,O,{discrete:!0})};if(Zt(M,"handleAndDispatchPointerDownOutsideEvent"),!f(A.target)){l.removeEventListener("click",y.current),b(),g.current=!1;return}const O={originalEvent:A};v.current=!0,c.current=o&&A.button===0,x.current.clear(),!o||A.button!==0?M():(l.removeEventListener("click",y.current),y.current=M,l.addEventListener("click",y.current,{once:!0}))}else l.removeEventListener("click",y.current),b();g.current=!1},"handlePointerDown"),R=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const A of R)l.addEventListener(A,E,!0),l.addEventListener(A,j);const D=window.setTimeout(()=>{l.addEventListener("pointerdown",C)},0);return()=>{window.clearTimeout(D),l.removeEventListener("pointerdown",C),l.removeEventListener("click",y.current);for(const A of R)l.removeEventListener(A,E,!0),l.removeEventListener(A,j)}},[l,p,o,c,u,f]),{onPointerDownCapture:Zt(()=>g.current=!0,"onPointerDownCapture")}}Zt(o1,"usePointerDownOutside");function i1(n,a=globalThis==null?void 0:globalThis.document){const l=ha(n),o=h.useRef(!1);return h.useEffect(()=>{const c=Zt(u=>{u.target&&!o.current&&Im(qR,l,{originalEvent:u},{discrete:!1})},"handleFocus");return a.addEventListener("focusin",c),()=>a.removeEventListener("focusin",c)},[a,l]),{onFocusCapture:Zt(()=>o.current=!0,"onFocusCapture"),onBlurCapture:Zt(()=>o.current=!1,"onBlurCapture")}}Zt(i1,"useFocusOutside");function Yh(){const n=new CustomEvent(Vh);document.dispatchEvent(n)}Zt(Yh,"dispatchUpdate");function Im(n,a,l,{discrete:o}){const c=l.originalEvent.target,u=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:l});a&&c.addEventListener(n,a,{once:!0}),o?Lm(c,u):c.dispatchEvent(u)}Zt(Im,"handleAndDispatchCustomEvent");var VR=Object.defineProperty,Bm=(n,a)=>VR(n,"name",{value:a,configurable:!0}),Bc=0,Oa=null;function YR(n){return xi(),n.children}Bm(YR,"FocusGuards");function xi(){h.useEffect(()=>{Oa||(Oa={start:Gh(),end:Gh()});const{start:n,end:a}=Oa;return document.body.firstElementChild!==n&&document.body.insertAdjacentElement("afterbegin",n),document.body.lastElementChild!==a&&document.body.insertAdjacentElement("beforeend",a),Bc++,()=>{Bc===1&&(Oa==null||Oa.start.remove(),Oa==null||Oa.end.remove(),Oa=null),Bc=Math.max(0,Bc-1)}},[])}Bm(xi,"useFocusGuards");function Gh(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}Bm(Gh,"createFocusGuard");var GR=Object.defineProperty,gn=(n,a)=>GR(n,"name",{value:a,configurable:!0}),xh="focusScope.autoFocusOnMount",yh="focusScope.autoFocusOnUnmount",ob={bubbles:!1,cancelable:!0},Pm=h.forwardRef(gn(function(a,l){const{loop:o=!1,trapped:c=!1,onMountAutoFocus:u,onUnmountAutoFocus:f,...p}=a,[g,v]=h.useState(null),x=ha(u),y=ha(f),b=h.useRef(null),w=Ye(l,v),E=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(c){let C=function(M){if(E.paused||!g)return;const O=M.target;g.contains(O)?b.current=O:fr(b.current,{select:!0})},R=function(M){if(E.paused||!g)return;const O=M.relatedTarget;O!==null&&(g.contains(O)||fr(b.current,{select:!0}))},D=function(M){if(document.activeElement===document.body)for(const N of M)N.removedNodes.length>0&&fr(g)};gn(C,"handleFocusIn"),gn(R,"handleFocusOut"),gn(D,"handleMutations"),document.addEventListener("focusin",C),document.addEventListener("focusout",R);const A=new MutationObserver(D);return g&&A.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",R),A.disconnect()}}},[c,g,E.paused]),h.useEffect(()=>{if(g){ib.add(E);const C=document.activeElement;if(!g.contains(C)){const D=new CustomEvent(xh,ob);g.addEventListener(xh,x),g.dispatchEvent(D),D.defaultPrevented||(c1(m1(Hm(g)),{select:!0}),document.activeElement===C&&fr(g))}return()=>{g.removeEventListener(xh,x),setTimeout(()=>{const D=new CustomEvent(yh,ob);g.addEventListener(yh,y),g.dispatchEvent(D),D.defaultPrevented||fr(C??document.body,{select:!0}),g.removeEventListener(yh,y),ib.remove(E)},0)}}},[g,x,y,E]);const j=h.useCallback(C=>{if(!o&&!c||E.paused)return;const R=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,D=document.activeElement;if(R&&D){const A=C.currentTarget,[M,O]=u1(A);M&&O?!C.shiftKey&&D===O?(C.preventDefault(),o&&fr(M,{select:!0})):C.shiftKey&&D===M&&(C.preventDefault(),o&&fr(O,{select:!0})):D===A&&C.preventDefault()}},[o,c,E.paused]);return s.jsx(Pe.div,{tabIndex:-1,...p,ref:w,onKeyDown:j})},"FocusScope"));function c1(n,{select:a=!1}={}){const l=document.activeElement;for(const o of n)if(fr(o,{select:a}),document.activeElement!==l)return}gn(c1,"focusFirst");function u1(n){const a=Hm(n),l=Kh(a,n),o=Kh(a.reverse(),n);return[l,o]}gn(u1,"getTabbableEdges");function Hm(n){const a=[],l=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:gn(o=>{const c=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||c?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;l.nextNode();)a.push(l.currentNode);return a}gn(Hm,"getTabbableCandidates");function Kh(n,a){const l=typeof a.checkVisibility=="function"&&a.checkVisibility({checkVisibilityCSS:!0});for(const o of n)if(!(l?!o.checkVisibility({checkVisibilityCSS:!0}):d1(o,{upTo:a})))return o}gn(Kh,"findVisible");function d1(n,{upTo:a}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(a!==void 0&&n===a)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}gn(d1,"isHidden");function f1(n){return n instanceof HTMLInputElement&&"select"in n}gn(f1,"isSelectableInput");function fr(n,{select:a=!1}={}){if(n&&n.focus){const l=document.activeElement;n.focus({preventScroll:!0}),n!==l&&f1(n)&&a&&n.select()}}gn(fr,"focus");var ib=h1();function h1(){let n=[];return{add(a){const l=n[0];a!==l&&(l==null||l.pause()),n=Xh(n,a),n.unshift(a)},remove(a){var l;n=Xh(n,a),(l=n[0])==null||l.resume()}}}gn(h1,"createFocusScopesStack");function Xh(n,a){const l=[...n],o=l.indexOf(a);return o!==-1&&l.splice(o,1),l}gn(Xh,"arrayRemove");function m1(n){return n.filter(a=>a.tagName!=="A")}gn(m1,"removeLinks");var KR=Object.defineProperty,XR=(n,a)=>KR(n,"name",{value:a,configurable:!0}),FR=$s[" useId ".trim().toString()]||(()=>{}),QR=0;function ja(n){const[a,l]=h.useState(FR());return Yt(()=>{n||l(o=>o??String(QR++))},[n]),n||(a?`radix-${a}`:"")}XR(ja,"useId");const ZR=["top","right","bottom","left"],ll=Math.min,pr=Math.max,cu=Math.round,Pc=Math.floor,gr=n=>({x:n,y:n}),JR={left:"right",right:"left",bottom:"top",top:"bottom"};function p1(n,a,l){return pr(n,ll(a,l))}function yr(n,a){return typeof n=="function"?n(a):n}function sl(n){return n.split("-")[0]}function Fs(n){return n.split("-")[1]}function qm(n){return n==="x"?"y":"x"}function $m(n){return n==="y"?"height":"width"}function ka(n){const a=n[0];return a==="t"||a==="b"?"y":"x"}function Vm(n){return qm(ka(n))}function WR(n,a,l){l===void 0&&(l=!1);const o=Fs(n),c=Vm(n),u=$m(c);let f=c==="x"?o===(l?"end":"start")?"right":"left":o==="start"?"bottom":"top";return a.reference[u]>a.floating[u]&&(f=uu(f)),[f,uu(f)]}function eT(n){const a=uu(n);return[Fh(n),a,Fh(a)]}function Fh(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const cb=["left","right"],ub=["right","left"],tT=["top","bottom"],nT=["bottom","top"];function aT(n,a,l){switch(n){case"top":case"bottom":return l?a?ub:cb:a?cb:ub;case"left":case"right":return a?tT:nT;default:return[]}}function rT(n,a,l,o){const c=Fs(n);let u=aT(sl(n),l==="start",o);return c&&(u=u.map(f=>f+"-"+c),a&&(u=u.concat(u.map(Fh)))),u}function uu(n){const a=sl(n);return JR[a]+n.slice(a.length)}function lT(n){var a,l,o,c;return{top:(a=n.top)!=null?a:0,right:(l=n.right)!=null?l:0,bottom:(o=n.bottom)!=null?o:0,left:(c=n.left)!=null?c:0}}function g1(n){return typeof n!="number"?lT(n):{top:n,right:n,bottom:n,left:n}}function du(n){const{x:a,y:l,width:o,height:c}=n;return{width:o,height:c,top:l,left:a,right:a+o,bottom:l+c,x:a,y:l}}function db(n,a,l){let{reference:o,floating:c}=n;const u=ka(a),f=Vm(a),p=$m(f),g=sl(a),v=u==="y",x=o.x+o.width/2-c.width/2,y=o.y+o.height/2-c.height/2,b=o[p]/2-c[p]/2;let w;switch(g){case"top":w={x,y:o.y-c.height};break;case"bottom":w={x,y:o.y+o.height};break;case"right":w={x:o.x+o.width,y};break;case"left":w={x:o.x-c.width,y};break;default:w={x:o.x,y:o.y}}const E=Fs(a);return E&&(w[f]+=b*(E==="end"?1:-1)*(l&&v?-1:1)),w}async function sT(n,a){var l;a===void 0&&(a={});const{x:o,y:c,platform:u,rects:f,elements:p,strategy:g}=n,{boundary:v="clippingAncestors",rootBoundary:x="viewport",elementContext:y="floating",altBoundary:b=!1,padding:w=0}=yr(a,n),E=g1(w),C=p[b?y==="floating"?"reference":"floating":y],R=du(await u.getClippingRect({element:(l=await(u.isElement==null?void 0:u.isElement(C)))==null||l?C:C.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(p.floating)),boundary:v,rootBoundary:x,strategy:g})),D=y==="floating"?{x:o,y:c,width:f.floating.width,height:f.floating.height}:f.reference,A=await(u.getOffsetParent==null?void 0:u.getOffsetParent(p.floating)),M=await(u.isElement==null?void 0:u.isElement(A))&&await(u.getScale==null?void 0:u.getScale(A))||{x:1,y:1},O=du(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:D,offsetParent:A,strategy:g}):D);return{top:(R.top-O.top+E.top)/M.y,bottom:(O.bottom-R.bottom+E.bottom)/M.y,left:(R.left-O.left+E.left)/M.x,right:(O.right-R.right+E.right)/M.x}}const oT=50,iT=async(n,a,l)=>{const{placement:o="bottom",strategy:c="absolute",middleware:u=[],platform:f}=l,p=f.detectOverflow?f:{...f,detectOverflow:sT},g=await(f.isRTL==null?void 0:f.isRTL(a));let v=await f.getElementRects({reference:n,floating:a,strategy:c}),{x,y}=db(v,o,g),b=o,w=0;const E={};for(let j=0;j<u.length;j++){const C=u[j];if(!C)continue;const{name:R,fn:D}=C,{x:A,y:M,data:O,reset:N}=await D({x,y,initialPlacement:o,placement:b,strategy:c,middlewareData:E,rects:v,platform:p,elements:{reference:n,floating:a}});x=A??x,y=M??y,E[R]={...E[R],...O},N&&w<oT&&(w++,typeof N=="object"&&(N.placement&&(b=N.placement),N.rects&&(v=N.rects===!0?await f.getElementRects({reference:n,floating:a,strategy:c}):N.rects),{x,y}=db(v,b,g)),j=-1)}return{x,y,placement:b,strategy:c,middlewareData:E}},cT=n=>({name:"arrow",options:n,async fn(a){const{x:l,y:o,placement:c,rects:u,platform:f,elements:p,middlewareData:g}=a,{element:v,padding:x=0}=yr(n,a)||{};if(v==null)return{};const y=g1(x),b={x:l,y:o},w=Vm(c),E=$m(w),j=await f.getDimensions(v),C=w==="y",R=C?"top":"left",D=C?"bottom":"right",A=C?"clientHeight":"clientWidth",M=u.reference[E]+u.reference[w]-b[w]-u.floating[E],O=b[w]-u.reference[w],N=await(f.getOffsetParent==null?void 0:f.getOffsetParent(v));let _=N?N[A]:0;(!_||!await(f.isElement==null?void 0:f.isElement(N)))&&(_=p.floating[A]||u.floating[E]);const U=M/2-O/2,V=_/2-j[E]/2-1,te=ll(y[R],V),q=ll(y[D],V),G=_-j[E]-q,B=_/2-j[E]/2+U,F=p1(te,B,G),ce=!g.arrow&&Fs(c)!=null&&B!==F&&u.reference[E]/2-(B<te?te:q)-j[E]/2<0,k=ce?B<te?B-te:B-G:0;return{[w]:b[w]+k,data:{[w]:F,centerOffset:B-F-k,...ce&&{alignmentOffset:k}},reset:ce}}}),uT=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(a){var l,o;const{placement:c,middlewareData:u,rects:f,initialPlacement:p,platform:g,elements:v}=a,{mainAxis:x=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:j=!0,...C}=yr(n,a);if((l=u.arrow)!=null&&l.alignmentOffset)return{};const R=sl(c),D=ka(p),A=sl(p)===p,M=await(g.isRTL==null?void 0:g.isRTL(v.floating)),O=b||(A||!j?[uu(p)]:eT(p)),N=E!=="none";!b&&N&&O.push(...rT(p,j,E,M));const _=[p,...O],U=await g.detectOverflow(a,C),V=[];let te=((o=u.flip)==null?void 0:o.overflows)||[];if(x&&V.push(U[R]),y){const F=WR(c,f,M);V.push(U[F[0]],U[F[1]])}if(te=[...te,{placement:c,overflows:V}],!V.every(F=>F<=0)){var q,G;const F=(((q=u.flip)==null?void 0:q.index)||0)+1,ce=_[F];if(ce&&(!(y==="alignment"?D!==ka(ce):!1)||te.every(ee=>ka(ee.placement)===D?ee.overflows[0]>0:!0)))return{data:{index:F,overflows:te},reset:{placement:ce}};let k=(G=te.filter($=>$.overflows[0]<=0).sort(($,ee)=>$.overflows[1]-ee.overflows[1])[0])==null?void 0:G.placement;if(!k)switch(w){case"bestFit":{var B;const $=(B=te.filter(ee=>{if(N){const I=ka(ee.placement);return I===D||I==="y"}return!0}).map(ee=>[ee.placement,ee.overflows.filter(I=>I>0).reduce((I,W)=>I+W,0)]).sort((ee,I)=>ee[1]-I[1])[0])==null?void 0:B[0];$&&(k=$);break}case"initialPlacement":k=p;break}if(c!==k)return{reset:{placement:k}}}return{}}}};function fb(n,a){return{top:n.top-a.height,right:n.right-a.width,bottom:n.bottom-a.height,left:n.left-a.width}}function hb(n){return ZR.some(a=>n[a]>=0)}const dT=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(a){const{rects:l,platform:o}=a,{strategy:c="referenceHidden",...u}=yr(n,a);switch(c){case"referenceHidden":{const f=await o.detectOverflow(a,{...u,elementContext:"reference"}),p=fb(f,l.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:hb(p)}}}case"escaped":{const f=await o.detectOverflow(a,{...u,altBoundary:!0}),p=fb(f,l.floating);return{data:{escapedOffsets:p,escaped:hb(p)}}}default:return{}}}}},v1=new Set(["left","top"]);async function fT(n,a){const{placement:l,platform:o,elements:c}=n,u=await(o.isRTL==null?void 0:o.isRTL(c.floating)),f=sl(l),p=Fs(l),g=ka(l)==="y",v=v1.has(f)?-1:1,x=u&&g?-1:1,y=yr(a,n);let{mainAxis:b,crossAxis:w,alignmentAxis:E}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return p&&typeof E=="number"&&(w=p==="end"?E*-1:E),g?{x:w*x,y:b*v}:{x:b*v,y:w*x}}const hT=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(a){var l,o;const{x:c,y:u,placement:f,middlewareData:p}=a,g=await fT(a,n);return f===((l=p.offset)==null?void 0:l.placement)&&(o=p.arrow)!=null&&o.alignmentOffset?{}:{x:c+g.x,y:u+g.y,data:{...g,placement:f}}}}},mT=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(a){const{x:l,y:o,placement:c,platform:u}=a,{mainAxis:f=!0,crossAxis:p=!1,limiter:g={fn:D=>{let{x:A,y:M}=D;return{x:A,y:M}}},...v}=yr(n,a),x={x:l,y:o},y=await u.detectOverflow(a,v),b=ka(c),w=qm(b);let E=x[w],j=x[b];const C=(D,A)=>p1(A+y[D==="y"?"top":"left"],A,A-y[D==="y"?"bottom":"right"]);f&&(E=C(w,E)),p&&(j=C(b,j));const R=g.fn({...a,[w]:E,[b]:j});return{...R,data:{x:R.x-l,y:R.y-o,enabled:{[w]:f,[b]:p}}}}}},pT=function(n){return n===void 0&&(n={}),{options:n,fn(a){var l,o;const{x:c,y:u,placement:f,rects:p,middlewareData:g}=a,{offset:v=0,mainAxis:x=!0,crossAxis:y=!0}=yr(n,a),b={x:c,y:u},w=ka(f),E=qm(w);let j=b[E],C=b[w];const R=yr(v,a),D=typeof R=="number"?{mainAxis:R,crossAxis:0}:{mainAxis:(l=R.mainAxis)!=null?l:0,crossAxis:(o=R.crossAxis)!=null?o:0};if(x){const O=E==="y"?"height":"width",N=p.reference[E]-p.floating[O]+D.mainAxis,_=p.reference[E]+p.reference[O]-D.mainAxis;j<N?j=N:j>_&&(j=_)}if(y){var A,M;const O=E==="y"?"width":"height",N=v1.has(sl(f)),_=p.reference[w]-p.floating[O]+(N&&((A=g.offset)==null?void 0:A[w])||0)+(N?0:D.crossAxis),U=p.reference[w]+p.reference[O]+(N?0:((M=g.offset)==null?void 0:M[w])||0)-(N?D.crossAxis:0);C<_?C=_:C>U&&(C=U)}return{[E]:j,[w]:C}}}},gT=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(a){const{placement:l,rects:o,platform:c,elements:u}=a,{apply:f=()=>{},...p}=yr(n,a),g=await c.detectOverflow(a,p),v=sl(l),x=Fs(l),y=ka(l)==="y",{width:b,height:w}=o.floating;let E,j;v==="top"||v==="bottom"?(E=v,j=x===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(j=v,E=x==="end"?"top":"bottom");const C=w-g.top-g.bottom,R=b-g.left-g.right,D=ll(w-g[E],C),A=ll(b-g[j],R),M=a.middlewareData.shift,O=!M;let N=D,_=A;M!=null&&M.enabled.x&&(_=R),M!=null&&M.enabled.y&&(N=C),O&&!x&&(y?_=b-2*pr(g.left,g.right):N=w-2*pr(g.top,g.bottom)),await f({...a,availableWidth:_,availableHeight:N});const U=await c.getDimensions(u.floating);return b!==U.width||w!==U.height?{reset:{rects:!0}}:{}}}};function Au(){return typeof window<"u"}function Qs(n){return x1(n)?(n.nodeName||"").toLowerCase():"#document"}function An(n){var a;return(n==null||(a=n.ownerDocument)==null?void 0:a.defaultView)||window}function Sr(n){var a;return(a=(x1(n)?n.ownerDocument:n.document)||window.document)==null?void 0:a.documentElement}function x1(n){return Au()?n instanceof Node||n instanceof An(n).Node:!1}function Ua(n){return Au()?n instanceof Element||n instanceof An(n).Element:!1}function il(n){return Au()?n instanceof HTMLElement||n instanceof An(n).HTMLElement:!1}function mb(n){return!Au()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof An(n).ShadowRoot}function Mu(n){const{overflow:a,overflowX:l,overflowY:o,display:c}=Ia(n);return/auto|scroll|overlay|hidden|clip/.test(a+o+l)&&c!=="inline"&&c!=="contents"}function vT(n){return/^(table|td|th)$/.test(Qs(n))}function Du(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const xT=/transform|translate|scale|rotate|perspective|filter/,yT=/paint|layout|strict|content/,Tl=n=>!!n&&n!=="none";let bh;function Ym(n){const a=Ua(n)?Ia(n):n;return Tl(a.transform)||Tl(a.translate)||Tl(a.scale)||Tl(a.rotate)||Tl(a.perspective)||!Gm()&&(Tl(a.backdropFilter)||Tl(a.filter))||xT.test(a.willChange||"")||yT.test(a.contain||"")}function bT(n){let a=_l(n);for(;il(a)&&!ai(a);){if(Ym(a))return a;if(Du(a))return null;a=_l(a)}return null}function Gm(){return bh==null&&(bh=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),bh}function ai(n){return/^(html|body|#document)$/.test(Qs(n))}function Ia(n){return An(n).getComputedStyle(n)}function Ou(n){return Ua(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function _l(n){if(Qs(n)==="html")return n;const a=n.assignedSlot||n.parentNode||mb(n)&&n.host||Sr(n);return mb(a)?a.host:a}function y1(n){const a=_l(n);return ai(a)?(n.ownerDocument||n).body:il(a)&&Mu(a)?a:y1(a)}function ri(n,a,l){var o;a===void 0&&(a=[]),l===void 0&&(l=!0);const c=y1(n),u=c===((o=n.ownerDocument)==null?void 0:o.body),f=An(c);if(u){const p=Qh(f);return a.concat(f,f.visualViewport||[],Mu(c)?c:[],p&&l?ri(p):[])}else return a.concat(c,ri(c,[],l))}function Qh(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function b1(n){const a=Ia(n);let l=parseFloat(a.width)||0,o=parseFloat(a.height)||0;const c=il(n),u=c?n.offsetWidth:l,f=c?n.offsetHeight:o,p=cu(l)!==u||cu(o)!==f;return p&&(l=u,o=f),{width:l,height:o,$:p}}function Km(n){return Ua(n)?n:n.contextElement}function Bs(n){const a=Km(n);if(!il(a))return gr(1);const l=a.getBoundingClientRect(),{width:o,height:c,$:u}=b1(a);let f=(u?cu(l.width):l.width)/o,p=(u?cu(l.height):l.height)/c;return(!f||!Number.isFinite(f))&&(f=1),(!p||!Number.isFinite(p))&&(p=1),{x:f,y:p}}const wT=gr(0);function w1(n){const a=An(n);return!Gm()||!a.visualViewport?wT:{x:a.visualViewport.offsetLeft,y:a.visualViewport.offsetTop}}function ST(n,a,l){return a===void 0&&(a=!1),!!l&&a&&l===An(n)}function kl(n,a,l,o){a===void 0&&(a=!1),l===void 0&&(l=!1);const c=n.getBoundingClientRect(),u=Km(n);let f=gr(1);a&&(o?Ua(o)&&(f=Bs(o)):f=Bs(n));const p=ST(u,l,o)?w1(u):gr(0);let g=(c.left+p.x)/f.x,v=(c.top+p.y)/f.y,x=c.width/f.x,y=c.height/f.y;if(u&&o){const b=An(u),w=Ua(o)?An(o):o;let E=b,j=Qh(E);for(;j&&w!==E;){const C=Bs(j),R=j.getBoundingClientRect(),D=Ia(j),A=R.left+(j.clientLeft+parseFloat(D.paddingLeft))*C.x,M=R.top+(j.clientTop+parseFloat(D.paddingTop))*C.y;g*=C.x,v*=C.y,x*=C.x,y*=C.y,g+=A,v+=M,E=An(j),j=Qh(E)}}return du({width:x,height:y,x:g,y:v})}function _u(n,a){const l=Ou(n).scrollLeft;return a?a.left+l:kl(Sr(n)).left+l}function S1(n,a){const l=n.getBoundingClientRect(),o=l.left+a.scrollLeft-_u(n,l),c=l.top+a.scrollTop;return{x:o,y:c}}function jT(n){let{elements:a,rect:l,offsetParent:o,strategy:c}=n;const u=c==="fixed",f=Sr(o),p=a?Du(a.floating):!1;if(o===f||p&&u)return l;let g={scrollLeft:0,scrollTop:0},v=gr(1);const x=gr(0),y=il(o);if((y||!u)&&((Qs(o)!=="body"||Mu(f))&&(g=Ou(o)),y)){const w=kl(o);v=Bs(o),x.x=w.x+o.clientLeft,x.y=w.y+o.clientTop}const b=f&&!y&&!u?S1(f,g):gr(0);return{width:l.width*v.x,height:l.height*v.y,x:l.x*v.x-g.scrollLeft*v.x+x.x+b.x,y:l.y*v.y-g.scrollTop*v.y+x.y+b.y}}function CT(n){return n.getClientRects?Array.from(n.getClientRects()):[]}function ET(n){const a=Ou(n),l=n.ownerDocument.body,o=pr(n.scrollWidth,n.clientWidth,l.scrollWidth,l.clientWidth),c=pr(n.scrollHeight,n.clientHeight,l.scrollHeight,l.clientHeight);let u=-a.scrollLeft+_u(n);const f=-a.scrollTop;return Ia(l).direction==="rtl"&&(u+=pr(n.clientWidth,l.clientWidth)-o),{width:o,height:c,x:u,y:f}}const NT=25;function RT(n,a,l){l===void 0&&(l="viewport");const o=l==="layoutViewport",c=An(n),u=Sr(n),f=c.visualViewport;let p=u.clientWidth,g=u.clientHeight,v=0,x=0;if(f){const b=!Gm()||a==="fixed";o?b||(v=-f.offsetLeft,x=-f.offsetTop):(p=f.width,g=f.height,b&&(v=f.offsetLeft,x=f.offsetTop))}if(_u(u)<=0){const b=u.ownerDocument,w=b.body,E=getComputedStyle(w),j=b.compatMode==="CSS1Compat"&&parseFloat(E.marginLeft)+parseFloat(E.marginRight)||0,C=Math.abs(u.clientWidth-w.clientWidth-j),R=getComputedStyle(u).scrollbarGutter==="stable both-edges"?C/2:C;R<=NT&&(p-=R)}return{width:p,height:g,x:v,y:x}}function TT(n,a){const l=kl(n,!0,a==="fixed"),o=l.top+n.clientTop,c=l.left+n.clientLeft,u=Bs(n),f=n.clientWidth*u.x,p=n.clientHeight*u.y,g=c*u.x,v=o*u.y;return{width:f,height:p,x:g,y:v}}function pb(n,a,l){let o;if(a==="viewport"||a==="layoutViewport")o=RT(n,l,a);else if(a==="document")o=ET(Sr(n));else if(Ua(a))o=TT(a,l);else{const c=w1(n);o={x:a.x-c.x,y:a.y-c.y,width:a.width,height:a.height}}return du(o)}function AT(n,a){const l=a.get(n);if(l)return l;let o=ri(n,[],!1).filter(p=>Ua(p)&&Qs(p)!=="body"),c=null;const u=Ia(n).position==="fixed";let f=u?_l(n):n;for(;Ua(f)&&!ai(f);){const p=Ia(f),g=Ym(f),v=c?c.position:u?"fixed":"";!g&&(v==="fixed"||v==="absolute"&&p.position==="static")?o=o.filter(y=>y!==f):c=p,f=_l(f)}return a.set(n,o),o}function MT(n){let{element:a,boundary:l,rootBoundary:o,strategy:c}=n;const f=[...l==="clippingAncestors"?Du(a)?[]:AT(a,this._c):[].concat(l),o],p=pb(a,f[0],c);let g=p.top,v=p.right,x=p.bottom,y=p.left;for(let b=1;b<f.length;b++){const w=pb(a,f[b],c);g=pr(w.top,g),v=ll(w.right,v),x=ll(w.bottom,x),y=pr(w.left,y)}return{width:v-y,height:x-g,x:y,y:g}}function DT(n){const{width:a,height:l}=b1(n);return{width:a,height:l}}function OT(n,a,l){const o=il(a),c=Sr(a),u=l==="fixed",f=kl(n,!0,u,a);let p={scrollLeft:0,scrollTop:0};const g=gr(0);if((o||!u)&&((Qs(a)!=="body"||Mu(c))&&(p=Ou(a)),o)){const b=kl(a,!0,u,a);g.x=b.x+a.clientLeft,g.y=b.y+a.clientTop}!o&&c&&(g.x=_u(c));const v=c&&!o&&!u?S1(c,p):gr(0),x=f.left+p.scrollLeft-g.x-v.x,y=f.top+p.scrollTop-g.y-v.y;return{x,y,width:f.width,height:f.height}}function wh(n){return Ia(n).position==="static"}function gb(n,a){if(!il(n)||Ia(n).position==="fixed")return null;if(a)return a(n);let l=n.offsetParent;return Sr(n)===l&&(l=l.ownerDocument.body),l}function j1(n,a){const l=An(n);if(Du(n))return l;if(!il(n)){let c=_l(n);for(;c&&!ai(c);){if(Ua(c)&&!wh(c))return c;c=_l(c)}return l}let o=gb(n,a);for(;o&&vT(o)&&wh(o);)o=gb(o,a);return o&&ai(o)&&wh(o)&&!Ym(o)?l:o||bT(n)||l}const _T=async function(n){const a=this.getOffsetParent||j1,l=this.getDimensions,o=await l(n.floating);return{reference:OT(n.reference,await a(n.floating),n.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function kT(n){return Ia(n).direction==="rtl"}const zT={convertOffsetParentRelativeRectToViewportRelativeRect:jT,getDocumentElement:Sr,getClippingRect:MT,getOffsetParent:j1,getElementRects:_T,getClientRects:CT,getDimensions:DT,getScale:Bs,isElement:Ua,isRTL:kT};function C1(n,a){return n.x===a.x&&n.y===a.y&&n.width===a.width&&n.height===a.height}function LT(n,a,l){let o=null,c;const u=Sr(n);function f(){var x;clearTimeout(c),(x=o)==null||x.disconnect(),o=null}function p(x,y){x===void 0&&(x=!1),y===void 0&&(y=1),f();const b=n.getBoundingClientRect(),{left:w,top:E,width:j,height:C}=b;if(x||a(),!j||!C)return;const R=Pc(E),D=Pc(u.clientWidth-(w+j)),A=Pc(u.clientHeight-(E+C)),M=Pc(w),N={rootMargin:-R+"px "+-D+"px "+-A+"px "+-M+"px",threshold:pr(0,ll(1,y))||1};let _=!0;function U(V){const te=V[0].intersectionRatio;if(!C1(b,n.getBoundingClientRect()))return p();if(te!==y){if(!_)return p();te?p(!1,te):c=setTimeout(()=>{p(!1,1e-7)},1e3)}_=!1}try{o=new IntersectionObserver(U,{...N,root:u.ownerDocument})}catch{o=new IntersectionObserver(U,N)}o.observe(n)}const g=An(n),v=()=>p(l);return g.addEventListener("resize",v),p(!0),()=>{g.removeEventListener("resize",v),f()}}function UT(n,a,l,o){o===void 0&&(o={});const{ancestorScroll:c=!0,ancestorResize:u=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:g=!1}=o,v=Km(n),x=c||u?[...v?ri(v):[],...a?ri(a):[]]:[];x.forEach(R=>{c&&R.addEventListener("scroll",l),u&&R.addEventListener("resize",l)});const y=v&&p?LT(v,l,u):null;let b=-1,w=null;f&&(w=new ResizeObserver(R=>{let[D]=R;D&&D.target===v&&w&&a&&(w.unobserve(a),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var A;(A=w)==null||A.observe(a)})),l()}),v&&!g&&w.observe(v),a&&w.observe(a));let E,j=g?kl(n):null;g&&C();function C(){const R=kl(n);j&&!C1(j,R)&&l(),j=R,E=requestAnimationFrame(C)}return l(),()=>{var R;x.forEach(D=>{c&&D.removeEventListener("scroll",l),u&&D.removeEventListener("resize",l)}),y==null||y(),(R=w)==null||R.disconnect(),w=null,g&&cancelAnimationFrame(E)}}const IT=hT,BT=mT,PT=uT,HT=gT,qT=dT,vb=cT,$T=pT,VT=(n,a,l)=>{const o=new Map,c=l??{},u={...zT,...c.platform,_c:o};return iT(n,a,{...c,platform:u})};var YT=typeof document<"u",GT=function(){},au=YT?h.useLayoutEffect:GT;function fu(n,a){if(n===a)return!0;if(typeof n!=typeof a)return!1;if(typeof n=="function"&&n.toString()===a.toString())return!0;let l,o,c;if(n&&a&&typeof n=="object"){if(Array.isArray(n)){if(l=n.length,l!==a.length)return!1;for(o=l;o--!==0;)if(!fu(n[o],a[o]))return!1;return!0}if(c=Object.keys(n),l=c.length,l!==Object.keys(a).length)return!1;for(o=l;o--!==0;)if(!{}.hasOwnProperty.call(a,c[o]))return!1;for(o=l;o--!==0;){const u=c[o];if(!(u==="_owner"&&n.$$typeof)&&!fu(n[u],a[u]))return!1}return!0}return n!==n&&a!==a}function E1(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function xb(n,a){const l=E1(n);return Math.round(a*l)/l}function Sh(n){const a=h.useRef(n);return au(()=>{a.current=n}),a}function KT(n){n===void 0&&(n={});const{placement:a="bottom",strategy:l="absolute",middleware:o=[],platform:c,elements:{reference:u,floating:f}={},transform:p=!0,whileElementsMounted:g,open:v}=n,[x,y]=h.useState({x:0,y:0,strategy:l,placement:a,middlewareData:{},isPositioned:!1}),[b,w]=h.useState(o);fu(b,o)||w(o);const[E,j]=h.useState(null),[C,R]=h.useState(null),D=h.useCallback(ee=>{ee!==N.current&&(N.current=ee,j(ee))},[]),A=h.useCallback(ee=>{ee!==_.current&&(_.current=ee,R(ee))},[]),M=u||E,O=f||C,N=h.useRef(null),_=h.useRef(null),U=h.useRef(x),V=g!=null,te=Sh(g),q=Sh(c),G=Sh(v),B=h.useCallback(()=>{if(!N.current||!_.current)return;const ee={placement:a,strategy:l,middleware:b};q.current&&(ee.platform=q.current),VT(N.current,_.current,ee).then(I=>{const W={...I,isPositioned:G.current!==!1};F.current&&!fu(U.current,W)&&(U.current=W,wa.flushSync(()=>{y(W)}))})},[b,a,l,q,G]);au(()=>{v===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,y(ee=>({...ee,isPositioned:!1})))},[v]);const F=h.useRef(!1);au(()=>(F.current=!0,()=>{F.current=!1}),[]),au(()=>{if(M&&(N.current=M),O&&(_.current=O),M&&O){if(te.current)return te.current(M,O,B);B()}},[M,O,B,te,V]);const ce=h.useMemo(()=>({reference:N,floating:_,setReference:D,setFloating:A}),[D,A]),k=h.useMemo(()=>({reference:M,floating:O}),[M,O]),$=h.useMemo(()=>{const ee={position:l,left:0,top:0};if(!k.floating)return ee;const I=xb(k.floating,x.x),W=xb(k.floating,x.y);return p?{...ee,transform:"translate("+I+"px, "+W+"px)",...E1(k.floating)>=1.5&&{willChange:"transform"}}:{position:l,left:I,top:W}},[l,p,k.floating,x.x,x.y]);return h.useMemo(()=>({...x,update:B,refs:ce,elements:k,floatingStyles:$}),[x,B,ce,k,$])}const XT=n=>{function a(l){return{}.hasOwnProperty.call(l,"current")}return{name:"arrow",options:n,fn(l){const{element:o,padding:c}=typeof n=="function"?n(l):n;return o&&a(o)?o.current!=null?vb({element:o.current,padding:c}).fn(l):{}:o?vb({element:o,padding:c}).fn(l):{}}}},FT=(n,a)=>{const l=IT(n);return{name:l.name,fn:l.fn,options:[n,a]}},QT=(n,a)=>{const l=BT(n);return{name:l.name,fn:l.fn,options:[n,a]}},ZT=(n,a)=>({fn:$T(n).fn,options:[n,a]}),JT=(n,a)=>{const l=PT(n);return{name:l.name,fn:l.fn,options:[n,a]}},WT=(n,a)=>{const l=HT(n);return{name:l.name,fn:l.fn,options:[n,a]}},eA=(n,a)=>{const l=qT(n);return{name:l.name,fn:l.fn,options:[n,a]}},tA=(n,a)=>{const l=XT(n);return{name:l.name,fn:l.fn,options:[n,a]}};var nA=Object.defineProperty,aA=(n,a)=>nA(n,"name",{value:a,configurable:!0});function ku(n){const[a,l]=h.useState(void 0);return Yt(()=>{if(n){l({width:n.offsetWidth,height:n.offsetHeight});const o=new ResizeObserver(c=>{if(!Array.isArray(c)||!c.length)return;const u=c[0];let f,p;if("borderBoxSize"in u){const g=u.borderBoxSize,v=Array.isArray(g)?g[0]:g;f=v.inlineSize,p=v.blockSize}else f=n.offsetWidth,p=n.offsetHeight;l({width:f,height:p})});return o.observe(n,{box:"border-box"}),()=>o.unobserve(n)}else l(void 0)},[n]),a}aA(ku,"useSize");var rA=Object.defineProperty,al=(n,a)=>rA(n,"name",{value:a,configurable:!0}),N1="Popper",[R1,Zs]=_n(N1),[lA,T1]=R1(N1),sA=al(n=>{const{__scopePopper:a,children:l}=n,[o,c]=h.useState(null),[u,f]=h.useState(void 0);return s.jsx(lA,{scope:a,anchor:o,onAnchorChange:c,placementState:u,setPlacementState:f,children:l})},"Popper"),oA="PopperAnchor",iA=h.forwardRef(al(function(a,l){const{__scopePopper:o,virtualRef:c,...u}=a,f=T1(oA,o),p=h.useRef(null),g=f.onAnchorChange,v=h.useCallback(j=>{p.current=j,j&&g(j)},[g]),x=Ye(l,v),y=h.useRef(null);h.useEffect(()=>{if(!c)return;const j=y.current;y.current=c.current,j!==y.current&&g(y.current)});const b=f.placementState&&zu(f.placementState),w=b==null?void 0:b[0],E=b==null?void 0:b[1];return c?null:s.jsx(Pe.div,{"data-radix-popper-side":w,"data-radix-popper-align":E,...u,ref:x})},"PopperAnchor")),A1="PopperContent",[cA,K4]=R1(A1),uA=h.forwardRef(al(function(a,l){var ve,fe,De,Ne,_e,Fe,We;const{__scopePopper:o,side:c="bottom",sideOffset:u=0,align:f="center",alignOffset:p=0,arrowPadding:g=0,avoidCollisions:v=!0,collisionBoundary:x=[],collisionPadding:y=0,sticky:b="partial",hideWhenDetached:w=!1,updatePositionStrategy:E="optimized",onPlaced:j,...C}=a,R=T1(A1,o),[D,A]=h.useState(null),M=Ye(l,A),[O,N]=h.useState(null),_=ku(O),U=(_==null?void 0:_.width)??0,V=(_==null?void 0:_.height)??0,te=c+(f!=="center"?"-"+f:""),q=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},G=Array.isArray(x)?x:[x],B=G.length>0,F={padding:q,boundary:G.filter(M1),altBoundary:B},{refs:ce,floatingStyles:k,placement:$,isPositioned:ee,middlewareData:I}=KT({strategy:"fixed",placement:te,whileElementsMounted:al((...se)=>UT(...se,{animationFrame:E==="always"}),"whileElementsMounted"),elements:{reference:R.anchor},middleware:[FT({mainAxis:u+V,alignmentAxis:p}),v&&QT({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?ZT():void 0,...F}),v&&JT({...F}),WT({...F,apply:al(({elements:se,rects:Oe,availableWidth:Qe,availableHeight:xt})=>{const{width:Rt,height:Gt}=Oe.reference,xn=se.floating.style;xn.setProperty("--radix-popper-available-width",`${Qe}px`),xn.setProperty("--radix-popper-available-height",`${xt}px`),xn.setProperty("--radix-popper-anchor-width",`${Rt}px`),xn.setProperty("--radix-popper-anchor-height",`${Gt}px`)},"apply")}),O&&tA({element:O,padding:g}),dA({arrowWidth:U,arrowHeight:V}),w&&eA({strategy:"referenceHidden",...F,boundary:B?F.boundary:void 0})]}),W=R.setPlacementState;Yt(()=>(W($),()=>{W(void 0)}),[$,W]);const[z,H]=zu($),Z=ha(j);Yt(()=>{ee&&(Z==null||Z())},[ee,Z]);const re=(ve=I.arrow)==null?void 0:ve.x,he=(fe=I.arrow)==null?void 0:fe.y,ye=((De=I.arrow)==null?void 0:De.centerOffset)!==0,[pe,de]=h.useState();return Yt(()=>{D&&de(window.getComputedStyle(D).zIndex)},[D]),s.jsx("div",{ref:ce.setFloating,"data-radix-popper-content-wrapper":"",style:{...k,transform:ee?k.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:pe,"--radix-popper-transform-origin":[(Ne=I.transformOrigin)==null?void 0:Ne.x,(_e=I.transformOrigin)==null?void 0:_e.y].join(" "),...((Fe=I.hide)==null?void 0:Fe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:s.jsx(cA,{scope:o,placedSide:z,placedAlign:H,onArrowChange:N,arrowX:re,arrowY:he,shouldHideArrow:ye,children:s.jsx(Pe.div,{"data-side":z,"data-align":H,...C,ref:M,style:{...C.style,animation:ee?(We=C.style)==null?void 0:We.animation:"none"}})})})},"PopperContent"));function M1(n){return n!==null}al(M1,"isNotNull");var dA=al(n=>({name:"transformOrigin",options:n,fn(a){var C,R,D;const{placement:l,rects:o,middlewareData:c}=a,f=((C=c.arrow)==null?void 0:C.centerOffset)!==0,p=f?0:n.arrowWidth,g=f?0:n.arrowHeight,[v,x]=zu(l),y={start:"0%",center:"50%",end:"100%"}[x],b=(((R=c.arrow)==null?void 0:R.x)??0)+p/2,w=(((D=c.arrow)==null?void 0:D.y)??0)+g/2;let E="",j="";return v==="bottom"?(E=f?y:`${b}px`,j=`${-g}px`):v==="top"?(E=f?y:`${b}px`,j=`${o.floating.height+g}px`):v==="right"?(E=`${-g}px`,j=f?y:`${w}px`):v==="left"&&(E=`${o.floating.width+g}px`,j=f?y:`${w}px`),{data:{x:E,y:j}}}}),"transformOrigin");function zu(n){const[a,l="center"]=n.split("-");return[a,l]}al(zu,"getSideAndAlignFromPlacement");var Xm=sA,Fm=iA,Qm=uA,fA=Object.defineProperty,hA=(n,a)=>fA(n,"name",{value:a,configurable:!0}),Zm=h.forwardRef(hA(function(a,l){var g;const{container:o,...c}=a,[u,f]=h.useState(!1);Yt(()=>f(!0),[]);const p=o||u&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return p?wa.createPortal(s.jsx(Pe.div,{...c,ref:l}),p):null},"Portal")),mA=Object.defineProperty,br=(n,a)=>mA(n,"name",{value:a,configurable:!0});function D1(n,a){return h.useReducer((l,o)=>a[l][o]??l,n)}br(D1,"useStateMachine");var jr=br(n=>{const{present:a,children:l}=n,o=O1(a),c=typeof l=="function"?l({present:o.isPresent}):h.Children.only(l),u=_1(o.ref,k1(c));return typeof l=="function"||o.isPresent?h.cloneElement(c,{ref:u}):null},"Presence");function O1(n){const[a,l]=h.useState(),o=h.useRef(null),c=h.useRef(n),u=h.useRef("none"),f=h.useRef(void 0),p=n?"mounted":"unmounted",[g,v]=D1(p,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{g==="mounted"?(u.current=f.current??zs(o.current),f.current=void 0):u.current="none"},[g]),Yt(()=>{const x=o.current,y=c.current;if(y!==n){const w=u.current,E=zs(x);n?(f.current=E,v("MOUNT")):E==="none"||(x==null?void 0:x.display)==="none"?v("UNMOUNT"):v(y&&w!==E?"ANIMATION_OUT":"UNMOUNT"),c.current=n}},[n,v]),Yt(()=>{if(a){let x;const y=a.ownerDocument.defaultView??window,b=br(E=>{const C=zs(o.current).includes(CSS.escape(E.animationName));if(E.target===a&&C&&(v("ANIMATION_END"),!c.current)){const R=a.style.animationFillMode;a.style.animationFillMode="forwards",x=y.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=R)})}},"handleAnimationEnd"),w=br(E=>{E.target===a&&(u.current=zs(o.current))},"handleAnimationStart");return a.addEventListener("animationstart",w),a.addEventListener("animationcancel",b),a.addEventListener("animationend",b),()=>{y.clearTimeout(x),a.removeEventListener("animationstart",w),a.removeEventListener("animationcancel",b),a.removeEventListener("animationend",b)}}else v("ANIMATION_END")},[a,v]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:h.useCallback(x=>{if(x){const y=getComputedStyle(x);o.current=y,f.current=zs(y)}else o.current=null;l(x)},[])}}br(O1,"usePresence");function Zh(n,a){if(typeof n=="function")return n(a);n!=null&&(n.current=a)}br(Zh,"setRef");function _1(...n){const a=h.useRef(n);return a.current=n,h.useCallback(l=>{const o=a.current;let c=!1;const u=o.map(f=>{const p=Zh(f,l);return!c&&typeof p=="function"&&(c=!0),p});if(c)return()=>{for(let f=0;f<u.length;f++){const p=u[f];typeof p=="function"?p():Zh(o[f],null)}}},[])}br(_1,"useStableComposedRefs");function zs(n){return(n==null?void 0:n.animationName)||"none"}br(zs,"getAnimationName");function k1(n){var o,c;let a=(o=Object.getOwnPropertyDescriptor(n.props,"ref"))==null?void 0:o.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?n.ref:(a=(c=Object.getOwnPropertyDescriptor(n,"ref"))==null?void 0:c.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?n.props.ref:n.props.ref||n.ref)}br(k1,"getElementRef");var pA=Object.defineProperty,Jm=(n,a)=>pA(n,"name",{value:a,configurable:!0}),jh=!1;function z1(){const[n,a]=h.useState(jh);return h.useEffect(()=>{jh||(jh=!0,a(!0))},[]),n}Jm(z1,"useIsHydrated");var L1=$s[" useSyncExternalStore ".trim().toString()];function U1(){return()=>{}}Jm(U1,"subscribe");function I1(){return L1(U1,()=>!0,()=>!1)}Jm(I1,"useIsHydratedModern");var gA=typeof L1=="function"?I1:z1,vA=Object.defineProperty,Il=(n,a)=>vA(n,"name",{value:a,configurable:!0}),Ch="rovingFocusGroup.onEntryFocus",xA={bubbles:!1,cancelable:!0},Lu="RovingFocusGroup",[Jh,B1,yA]=Ru(Lu),[bA,Uu]=_n(Lu,[yA]),[wA,SA]=bA(Lu),jA=h.forwardRef(Il(function(a,l){return s.jsx(Jh.Provider,{scope:a.__scopeRovingFocusGroup,children:s.jsx(Jh.Slot,{scope:a.__scopeRovingFocusGroup,children:s.jsx(CA,{...a,ref:l})})})},"RovingFocusGroup")),CA=h.forwardRef(Il(function(a,l){const{__scopeRovingFocusGroup:o,orientation:c,loop:u=!1,dir:f,currentTabStopId:p,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:v,onEntryFocus:x,preventScrollOnEntryFocus:y=!1,...b}=a,w=h.useRef(null),E=Ye(l,w),j=vi(f),[C,R]=La({prop:p,defaultProp:g??null,onChange:v,caller:Lu}),[D,A]=h.useState(!1),M=ha(x),O=B1(o),N=h.useRef(!1),[_,U]=h.useState(0);return h.useEffect(()=>{const V=w.current;if(V)return V.addEventListener(Ch,M),()=>V.removeEventListener(Ch,M)},[M]),s.jsx(wA,{scope:o,orientation:c,dir:j,loop:u,currentTabStopId:C,onItemFocus:h.useCallback(V=>R(V),[R]),onItemShiftTab:h.useCallback(()=>A(!0),[]),onFocusableItemAdd:h.useCallback(()=>U(V=>V+1),[]),onFocusableItemRemove:h.useCallback(()=>U(V=>V-1),[]),children:s.jsx(Pe.div,{tabIndex:D||_===0?-1:0,"data-orientation":c,...b,ref:E,style:{outline:"none",...a.style},onMouseDown:je(a.onMouseDown,()=>{N.current=!0}),onFocus:je(a.onFocus,V=>{const te=!N.current;if(V.target===V.currentTarget&&te&&!D){const q=new CustomEvent(Ch,xA);if(V.currentTarget.dispatchEvent(q),!q.defaultPrevented){const G=O().filter($=>$.focusable),B=G.find($=>$.active),F=G.find($=>$.id===C),k=[B,F,...G].filter(Boolean).map($=>$.ref.current);Wm(k,y)}}N.current=!1}),onBlur:je(a.onBlur,()=>A(!1))})})},"RovingFocusGroupImpl")),EA="RovingFocusGroupItem",NA=h.forwardRef(Il(function(a,l){const{__scopeRovingFocusGroup:o,focusable:c=!0,active:u=!1,tabStopId:f,children:p,...g}=a,v=ja(),x=f||v,y=SA(EA,o),b=y.currentTabStopId===x,w=B1(o),{onFocusableItemAdd:E,onFocusableItemRemove:j,currentTabStopId:C}=y,R=gA();return Yt(()=>{if(!(!R||!c))return E(),()=>j()},[R,c,E,j]),h.useEffect(()=>{if(!(R||!c))return E(),()=>j()},[R,c,E,j]),s.jsx(Jh.ItemSlot,{scope:o,id:x,focusable:c,active:u,children:s.jsx(Pe.span,{tabIndex:b?0:-1,"data-orientation":y.orientation,...g,ref:l,onMouseDown:je(a.onMouseDown,D=>{c?y.onItemFocus(x):D.preventDefault()}),onFocus:je(a.onFocus,()=>y.onItemFocus(x)),onKeyDown:je(a.onKeyDown,D=>{if(D.key==="Tab"&&D.shiftKey){y.onItemShiftTab();return}if(D.target!==D.currentTarget)return;const A=H1(D,y.orientation,y.dir);if(A!==void 0){if(D.metaKey||D.ctrlKey||D.altKey||D.shiftKey)return;D.preventDefault();let O=w().filter(N=>N.focusable).map(N=>N.ref.current);if(A==="last")O.reverse();else if(A==="prev"||A==="next"){A==="prev"&&O.reverse();const N=O.indexOf(D.currentTarget);O=y.loop?q1(O,N+1):O.slice(N+1)}setTimeout(()=>Wm(O))}}),children:typeof p=="function"?p({isCurrentTabStop:b,hasTabStop:C!=null}):p})})},"RovingFocusGroupItem")),RA={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function P1(n,a){return a!=="rtl"?n:n==="ArrowLeft"?"ArrowRight":n==="ArrowRight"?"ArrowLeft":n}Il(P1,"getDirectionAwareKey");function H1(n,a,l){const o=P1(n.key,l);if(!(a==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(a==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return RA[o]}Il(H1,"getFocusIntent");function Wm(n,a=!1){const l=document.activeElement;for(const o of n)if(o===l||(o.focus({preventScroll:a}),document.activeElement!==l))return}Il(Wm,"focusFirst");function q1(n,a){return n.map((l,o)=>n[(a+o)%n.length])}Il(q1,"wrapArray");var $1=jA,V1=NA,TA=function(n){if(typeof document>"u")return null;var a=Array.isArray(n)?n[0]:n;return a.ownerDocument.body},As=new WeakMap,Hc=new WeakMap,qc={},Eh=0,Y1=function(n){return n&&(n.host||Y1(n.parentNode))},AA=function(n,a){return a.map(function(l){if(n.contains(l))return l;var o=Y1(l);return o&&n.contains(o)?o:(console.error("aria-hidden",l,"in not contained inside",n,". Doing nothing"),null)}).filter(function(l){return!!l})},MA=function(n,a,l,o){var c=AA(a,Array.isArray(n)?n:[n]);qc[l]||(qc[l]=new WeakMap);var u=qc[l],f=[],p=new Set,g=new Set(c),v=function(y){!y||p.has(y)||(p.add(y),v(y.parentNode))};c.forEach(v);var x=function(y){!y||g.has(y)||Array.prototype.forEach.call(y.children,function(b){if(p.has(b))x(b);else try{var w=b.getAttribute(o),E=w!==null&&w!=="false",j=(As.get(b)||0)+1,C=(u.get(b)||0)+1;As.set(b,j),u.set(b,C),f.push(b),j===1&&E&&Hc.set(b,!0),C===1&&b.setAttribute(l,"true"),E||b.setAttribute(o,"true")}catch(R){console.error("aria-hidden: cannot operate on ",b,R)}})};return x(a),p.clear(),Eh++,function(){f.forEach(function(y){var b=As.get(y)-1,w=u.get(y)-1;As.set(y,b),u.set(y,w),b||(Hc.has(y)||y.removeAttribute(o),Hc.delete(y)),w||y.removeAttribute(l)}),Eh--,Eh||(As=new WeakMap,As=new WeakMap,Hc=new WeakMap,qc={})}},ep=function(n,a,l){l===void 0&&(l="data-aria-hidden");var o=Array.from(Array.isArray(n)?n:[n]),c=TA(n);return c?(o.push.apply(o,Array.from(c.querySelectorAll("[aria-live], script"))),MA(o,c,l,"aria-hidden")):function(){return null}},_a=function(){return _a=Object.assign||function(a){for(var l,o=1,c=arguments.length;o<c;o++){l=arguments[o];for(var u in l)Object.prototype.hasOwnProperty.call(l,u)&&(a[u]=l[u])}return a},_a.apply(this,arguments)};function G1(n,a){var l={};for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&a.indexOf(o)<0&&(l[o]=n[o]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,o=Object.getOwnPropertySymbols(n);c<o.length;c++)a.indexOf(o[c])<0&&Object.prototype.propertyIsEnumerable.call(n,o[c])&&(l[o[c]]=n[o[c]]);return l}function DA(n,a,l){if(l||arguments.length===2)for(var o=0,c=a.length,u;o<c;o++)(u||!(o in a))&&(u||(u=Array.prototype.slice.call(a,0,o)),u[o]=a[o]);return n.concat(u||Array.prototype.slice.call(a))}var ru="right-scroll-bar-position",lu="width-before-scroll-bar",OA="with-scroll-bars-hidden",_A="--removed-body-scroll-bar-size";function Nh(n,a){return typeof n=="function"?n(a):n&&(n.current=a),n}function kA(n,a){var l=h.useState(function(){return{value:n,callback:a,facade:{get current(){return l.value},set current(o){var c=l.value;c!==o&&(l.value=o,l.callback(o,c))}}}})[0];return l.callback=a,l.facade}var zA=typeof window<"u"?h.useLayoutEffect:h.useEffect,yb=new WeakMap;function LA(n,a){var l=kA(null,function(o){return n.forEach(function(c){return Nh(c,o)})});return zA(function(){var o=yb.get(l);if(o){var c=new Set(o),u=new Set(n),f=l.current;c.forEach(function(p){u.has(p)||Nh(p,null)}),u.forEach(function(p){c.has(p)||Nh(p,f)})}yb.set(l,n)},[n]),l}function UA(n){return n}function IA(n,a){a===void 0&&(a=UA);var l=[],o=!1,c={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return l.length?l[l.length-1]:n},useMedium:function(u){var f=a(u,o);return l.push(f),function(){l=l.filter(function(p){return p!==f})}},assignSyncMedium:function(u){for(o=!0;l.length;){var f=l;l=[],f.forEach(u)}l={push:function(p){return u(p)},filter:function(){return l}}},assignMedium:function(u){o=!0;var f=[];if(l.length){var p=l;l=[],p.forEach(u),f=l}var g=function(){var x=f;f=[],x.forEach(u)},v=function(){return Promise.resolve().then(g)};v(),l={push:function(x){f.push(x),v()},filter:function(x){return f=f.filter(x),l}}}};return c}function BA(n){n===void 0&&(n={});var a=IA(null);return a.options=_a({async:!0,ssr:!1},n),a}var K1=function(n){var a=n.sideCar,l=G1(n,["sideCar"]);if(!a)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=a.read();if(!o)throw new Error("Sidecar medium not found");return h.createElement(o,_a({},l))};K1.isSideCarExport=!0;function PA(n,a){return n.useMedium(a),K1}var X1=BA(),Rh=function(){},Iu=h.forwardRef(function(n,a){var l=h.useRef(null),o=h.useState({onScrollCapture:Rh,onWheelCapture:Rh,onTouchMoveCapture:Rh}),c=o[0],u=o[1],f=n.forwardProps,p=n.children,g=n.className,v=n.removeScrollBar,x=n.enabled,y=n.shards,b=n.sideCar,w=n.noRelative,E=n.noIsolation,j=n.inert,C=n.allowPinchZoom,R=n.as,D=R===void 0?"div":R,A=n.gapMode,M=G1(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=b,N=LA([l,a]),_=_a(_a({},M),c);return h.createElement(h.Fragment,null,x&&h.createElement(O,{sideCar:X1,removeScrollBar:v,shards:y,noRelative:w,noIsolation:E,inert:j,setCallbacks:u,allowPinchZoom:!!C,lockRef:l,gapMode:A}),f?h.cloneElement(h.Children.only(p),_a(_a({},_),{ref:N})):h.createElement(D,_a({},_,{className:g,ref:N}),p))});Iu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Iu.classNames={fullWidth:lu,zeroRight:ru};var HA=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function qA(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var a=HA();return a&&n.setAttribute("nonce",a),n}function $A(n,a){n.styleSheet?n.styleSheet.cssText=a:n.appendChild(document.createTextNode(a))}function VA(n){var a=document.head||document.getElementsByTagName("head")[0];a.appendChild(n)}var YA=function(){var n=0,a=null;return{add:function(l){n==0&&(a=qA())&&($A(a,l),VA(a)),n++},remove:function(){n--,!n&&a&&(a.parentNode&&a.parentNode.removeChild(a),a=null)}}},GA=function(){var n=YA();return function(a,l){h.useEffect(function(){return n.add(a),function(){n.remove()}},[a&&l])}},F1=function(){var n=GA(),a=function(l){var o=l.styles,c=l.dynamic;return n(o,c),null};return a},KA={left:0,top:0,right:0,gap:0},Th=function(n){return parseInt(n||"",10)||0},XA=function(n){var a=window.getComputedStyle(document.body),l=a[n==="padding"?"paddingLeft":"marginLeft"],o=a[n==="padding"?"paddingTop":"marginTop"],c=a[n==="padding"?"paddingRight":"marginRight"];return[Th(l),Th(o),Th(c)]},FA=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return KA;var a=XA(n),l=document.documentElement.clientWidth,o=window.innerWidth;return{left:a[0],top:a[1],right:a[2],gap:Math.max(0,o-l+a[2]-a[0])}},QA=F1(),Ps="data-scroll-locked",ZA=function(n,a,l,o){var c=n.left,u=n.top,f=n.right,p=n.gap;return l===void 0&&(l="margin"),`
|
|
336
|
-
.`.concat(OA,` {
|
|
337
|
-
overflow: hidden `).concat(o,`;
|
|
338
|
-
padding-right: `).concat(p,"px ").concat(o,`;
|
|
339
|
-
}
|
|
340
|
-
body[`).concat(Ps,`] {
|
|
341
|
-
overflow: hidden `).concat(o,`;
|
|
342
|
-
overscroll-behavior: contain;
|
|
343
|
-
`).concat([a&&"position: relative ".concat(o,";"),l==="margin"&&`
|
|
344
|
-
padding-left: `.concat(c,`px;
|
|
345
|
-
padding-top: `).concat(u,`px;
|
|
346
|
-
padding-right: `).concat(f,`px;
|
|
347
|
-
margin-left:0;
|
|
348
|
-
margin-top:0;
|
|
349
|
-
margin-right: `).concat(p,"px ").concat(o,`;
|
|
350
|
-
`),l==="padding"&&"padding-right: ".concat(p,"px ").concat(o,";")].filter(Boolean).join(""),`
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
.`).concat(ru,` {
|
|
354
|
-
right: `).concat(p,"px ").concat(o,`;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
.`).concat(lu,` {
|
|
358
|
-
margin-right: `).concat(p,"px ").concat(o,`;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
.`).concat(ru," .").concat(ru,` {
|
|
362
|
-
right: 0 `).concat(o,`;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
.`).concat(lu," .").concat(lu,` {
|
|
366
|
-
margin-right: 0 `).concat(o,`;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
body[`).concat(Ps,`] {
|
|
370
|
-
`).concat(_A,": ").concat(p,`px;
|
|
371
|
-
}
|
|
372
|
-
`)},bb=function(){var n=parseInt(document.body.getAttribute(Ps)||"0",10);return isFinite(n)?n:0},JA=function(){h.useEffect(function(){return document.body.setAttribute(Ps,(bb()+1).toString()),function(){var n=bb()-1;n<=0?document.body.removeAttribute(Ps):document.body.setAttribute(Ps,n.toString())}},[])},WA=function(n){var a=n.noRelative,l=n.noImportant,o=n.gapMode,c=o===void 0?"margin":o;JA();var u=h.useMemo(function(){return FA(c)},[c]);return h.createElement(QA,{styles:ZA(u,!a,c,l?"":"!important")})},Wh=!1;if(typeof window<"u")try{var $c=Object.defineProperty({},"passive",{get:function(){return Wh=!0,!0}});window.addEventListener("test",$c,$c),window.removeEventListener("test",$c,$c)}catch{Wh=!1}var Ms=Wh?{passive:!1}:!1,eM=function(n){return n.tagName==="TEXTAREA"},Q1=function(n,a){if(!(n instanceof Element))return!1;var l=window.getComputedStyle(n);return l[a]!=="hidden"&&!(l.overflowY===l.overflowX&&!eM(n)&&l[a]==="visible")},tM=function(n){return Q1(n,"overflowY")},nM=function(n){return Q1(n,"overflowX")},wb=function(n,a){var l=a.ownerDocument,o=a;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var c=Z1(n,o);if(c){var u=J1(n,o),f=u[1],p=u[2];if(f>p)return!0}o=o.parentNode}while(o&&o!==l.body);return!1},aM=function(n){var a=n.scrollTop,l=n.scrollHeight,o=n.clientHeight;return[a,l,o]},rM=function(n){var a=n.scrollLeft,l=n.scrollWidth,o=n.clientWidth;return[a,l,o]},Z1=function(n,a){return n==="v"?tM(a):nM(a)},J1=function(n,a){return n==="v"?aM(a):rM(a)},lM=function(n,a){return n==="h"&&a==="rtl"?-1:1},sM=function(n,a,l,o,c){var u=lM(n,window.getComputedStyle(a).direction),f=u*o,p=l.target,g=a.contains(p),v=!1,x=f>0,y=0,b=0;do{if(!p)break;var w=J1(n,p),E=w[0],j=w[1],C=w[2],R=j-C-u*E;(E||R)&&Z1(n,p)&&(y+=R,b+=E);var D=p.parentNode;p=D&&D.nodeType===Node.DOCUMENT_FRAGMENT_NODE?D.host:D}while(!g&&p!==document.body||g&&(a.contains(p)||a===p));return(x&&Math.abs(y)<1||!x&&Math.abs(b)<1)&&(v=!0),v},Vc=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},Sb=function(n){return[n.deltaX,n.deltaY]},jb=function(n){return n&&"current"in n?n.current:n},oM=function(n,a){return n[0]===a[0]&&n[1]===a[1]},iM=function(n){return`
|
|
373
|
-
.block-interactivity-`.concat(n,` {pointer-events: none;}
|
|
374
|
-
.allow-interactivity-`).concat(n,` {pointer-events: all;}
|
|
375
|
-
`)},cM=0,Ds=[];function uM(n){var a=h.useRef([]),l=h.useRef([0,0]),o=h.useRef(),c=h.useState(cM++)[0],u=h.useState(F1)[0],f=h.useRef(n);h.useEffect(function(){f.current=n},[n]),h.useEffect(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(c));var j=DA([n.lockRef.current],(n.shards||[]).map(jb),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(c))})}}},[n.inert,n.lockRef.current,n.shards]);var p=h.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!f.current.allowPinchZoom;var R=Vc(j),D=l.current,A="deltaX"in j?j.deltaX:D[0]-R[0],M="deltaY"in j?j.deltaY:D[1]-R[1],O,N=j.target,_=Math.abs(A)>Math.abs(M)?"h":"v";if("touches"in j&&_==="h"&&N.type==="range")return!1;var U=window.getSelection(),V=U&&U.anchorNode,te=V?V===N||V.contains(N):!1;if(te)return!1;var q=wb(_,N);if(!q)return!0;if(q?O=_:(O=_==="v"?"h":"v",q=wb(_,N)),!q)return!1;if(!o.current&&"changedTouches"in j&&(A||M)&&(o.current=O),!O)return!0;var G=o.current||O;return sM(G,C,j,G==="h"?A:M)},[]),g=h.useCallback(function(j){var C=j;if(!(!Ds.length||Ds[Ds.length-1]!==u)){var R="deltaY"in C?Sb(C):Vc(C),D=a.current.filter(function(O){return O.name===C.type&&(O.target===C.target||C.target===O.shadowParent)&&oM(O.delta,R)})[0];if(D&&D.should){C.cancelable&&C.preventDefault();return}if(!D){var A=(f.current.shards||[]).map(jb).filter(Boolean).filter(function(O){return O.contains(C.target)}),M=A.length>0?p(C,A[0]):!f.current.noIsolation;M&&C.cancelable&&C.preventDefault()}}},[]),v=h.useCallback(function(j,C,R,D){var A={name:j,delta:C,target:R,should:D,shadowParent:dM(R)};a.current.push(A),setTimeout(function(){a.current=a.current.filter(function(M){return M!==A})},1)},[]),x=h.useCallback(function(j){l.current=Vc(j),o.current=void 0},[]),y=h.useCallback(function(j){v(j.type,Sb(j),j.target,p(j,n.lockRef.current))},[]),b=h.useCallback(function(j){v(j.type,Vc(j),j.target,p(j,n.lockRef.current))},[]);h.useEffect(function(){return Ds.push(u),n.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:b}),document.addEventListener("wheel",g,Ms),document.addEventListener("touchmove",g,Ms),document.addEventListener("touchstart",x,Ms),function(){Ds=Ds.filter(function(j){return j!==u}),document.removeEventListener("wheel",g,Ms),document.removeEventListener("touchmove",g,Ms),document.removeEventListener("touchstart",x,Ms)}},[]);var w=n.removeScrollBar,E=n.inert;return h.createElement(h.Fragment,null,E?h.createElement(u,{styles:iM(c)}):null,w?h.createElement(WA,{noRelative:n.noRelative,gapMode:n.gapMode}):null)}function dM(n){for(var a=null;n!==null;)n instanceof ShadowRoot&&(a=n.host,n=n.host),n=n.parentNode;return a}const fM=PA(X1,uM);var Bu=h.forwardRef(function(n,a){return h.createElement(Iu,_a({},n,{ref:a,sideCar:fM}))});Bu.classNames=Iu.classNames;var hM=Object.defineProperty,gt=(n,a)=>hM(n,"name",{value:a,configurable:!0}),mM=["Enter"," "],pM=["ArrowDown","PageUp","Home"],W1=["ArrowUp","PageDown","End"],gM=[...pM,...W1],Pu="Menu",[em,vM,xM]=Ru(Pu),[Bl,ew]=_n(Pu,[xM,Zs,Uu]),tp=Zs(),tw=Uu(),[yM,yi]=Bl(Pu),[bM,np]=Bl(Pu),wM=gt(n=>{const{__scopeMenu:a,open:l=!1,children:o,dir:c,onOpenChange:u,modal:f=!0}=n,p=tp(a),[g,v]=h.useState(null),x=h.useRef(!1),y=ha(u),b=vi(c);return h.useEffect(()=>{const w=gt(()=>{x.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},"handleKeyDown"),E=gt(()=>x.current=!1,"handlePointer");return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),h.useEffect(()=>{if(!l)return;const w=gt(()=>y(!1),"handleBlur");return window.addEventListener("blur",w),()=>window.removeEventListener("blur",w)},[l,y]),s.jsx(Xm,{...p,children:s.jsx(yM,{scope:a,open:l,onOpenChange:y,content:g,onContentChange:v,children:s.jsx(bM,{scope:a,onClose:h.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:x,dir:b,modal:f,children:o})})})},"Menu"),SM=h.forwardRef(gt(function(a,l){const{__scopeMenu:o,...c}=a,u=tp(o);return s.jsx(Fm,{...u,...c,ref:l})},"MenuAnchor")),nw="MenuPortal",[jM,CM]=Bl(nw,{forceMount:void 0}),EM=gt(n=>{const{__scopeMenu:a,forceMount:l,children:o,container:c}=n,u=yi(nw,a);return s.jsx(jM,{scope:a,forceMount:l,children:s.jsx(jr,{present:l||u.open,children:s.jsx(Zm,{asChild:!0,container:c,children:o})})})},"MenuPortal"),rl="MenuContent",[NM,aw]=Bl(rl),RM=h.forwardRef(gt(function(a,l){const o=CM(rl,a.__scopeMenu),{forceMount:c=o.forceMount,...u}=a,f=yi(rl,a.__scopeMenu),p=np(rl,a.__scopeMenu);return s.jsx(em.Provider,{scope:a.__scopeMenu,children:s.jsx(jr,{present:c||f.open,children:s.jsx(em.Slot,{scope:a.__scopeMenu,children:p.modal?s.jsx(TM,{...u,ref:l}):s.jsx(AM,{...u,ref:l})})})})},"MenuContent")),TM=h.forwardRef(gt(function(a,l){const o=yi(rl,a.__scopeMenu),c=h.useRef(null),u=Ye(l,c);return h.useEffect(()=>{const f=c.current;if(f)return ep(f)},[]),s.jsx(rw,{...a,ref:u,trapFocus:o.open,disableOutsidePointerEvents:o.open,disableOutsideScroll:!0,onFocusOutside:je(a.onFocusOutside,f=>f.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentModal")),AM=h.forwardRef(gt(function(a,l){const o=yi(rl,a.__scopeMenu);return s.jsx(rw,{...a,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>o.onOpenChange(!1)})},"MenuRootContentNonModal")),MM=za("MenuContent.ScrollLock"),rw=h.forwardRef(gt(function(a,l){const{__scopeMenu:o,loop:c=!1,trapFocus:u,onOpenAutoFocus:f,onCloseAutoFocus:p,disableOutsidePointerEvents:g,onEntryFocus:v,onEscapeKeyDown:x,onPointerDownOutside:y,onFocusOutside:b,onInteractOutside:w,onDismiss:E,disableOutsideScroll:j,...C}=a,R=yi(rl,o),D=np(rl,o),A=tp(o),M=tw(o),O=vM(o),[N,_]=h.useState(null),U=h.useRef(null),V=Ye(l,U,R.onContentChange),te=h.useRef(0),q=h.useRef(""),G=h.useRef(0),B=h.useRef(null),F=h.useRef("right"),ce=h.useRef(0),k=j?Bu:h.Fragment,$=j?{as:MM,allowPinchZoom:!0}:void 0,ee=gt(W=>{var de,ve;const z=q.current+W,H=O().filter(fe=>!fe.disabled),Z=document.activeElement,re=(de=H.find(fe=>fe.ref.current===Z))==null?void 0:de.textValue,he=H.map(fe=>fe.textValue),ye=cw(he,z,re),pe=(ve=H.find(fe=>fe.textValue===ye))==null?void 0:ve.ref.current;gt((function fe(De){q.current=De,window.clearTimeout(te.current),De!==""&&(te.current=window.setTimeout(()=>fe(""),1e3))}),"updateSearch")(z),pe&&setTimeout(()=>pe.focus())},"handleTypeaheadSearch");h.useEffect(()=>()=>window.clearTimeout(te.current),[]),xi();const I=h.useCallback(W=>{var H,Z;return F.current===((H=B.current)==null?void 0:H.side)&&dw(W,(Z=B.current)==null?void 0:Z.area)},[]);return s.jsx(NM,{scope:o,searchRef:q,onItemEnter:h.useCallback(W=>{I(W)&&W.preventDefault()},[I]),onItemLeave:h.useCallback(W=>{var z;I(W)||((z=U.current)==null||z.focus(),_(null))},[I]),onTriggerLeave:h.useCallback(W=>{I(W)&&W.preventDefault()},[I]),pointerGraceTimerRef:G,onPointerGraceIntentChange:h.useCallback(W=>{B.current=W},[]),children:s.jsx(k,{...$,children:s.jsx(Pm,{asChild:!0,trapped:u,onMountAutoFocus:je(f,W=>{var z;W.preventDefault(),(z=U.current)==null||z.focus({preventScroll:!0})}),onUnmountAutoFocus:p,children:s.jsx(Tu,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:x,onPointerDownOutside:y,onFocusOutside:b,onInteractOutside:w,onDismiss:E,children:s.jsx($1,{asChild:!0,...M,dir:D.dir,orientation:"vertical",loop:c,currentTabStopId:N,onCurrentTabStopIdChange:_,onEntryFocus:je(v,W=>{D.isUsingKeyboardRef.current||W.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Qm,{role:"menu","aria-orientation":"vertical","data-state":lw(R.open),"data-radix-menu-content":"",dir:D.dir,...A,...C,ref:V,style:{outline:"none",...C.style},onKeyDown:je(C.onKeyDown,W=>{const H=W.target.closest("[data-radix-menu-content]")===W.currentTarget,Z=W.ctrlKey||W.altKey||W.metaKey,re=W.key.length===1;H&&(W.key==="Tab"&&W.preventDefault(),!Z&&re&&ee(W.key));const he=U.current;if(W.target!==he||!gM.includes(W.key))return;W.preventDefault();const pe=O().filter(de=>!de.disabled).map(de=>de.ref.current);W1.includes(W.key)&&pe.reverse(),ow(pe)}),onBlur:je(a.onBlur,W=>{W.currentTarget.contains(W.target)||(window.clearTimeout(te.current),q.current="")}),onPointerMove:je(a.onPointerMove,hu(W=>{const z=W.target,H=ce.current!==W.clientX;if(W.currentTarget.contains(z)&&H){const Z=W.clientX>ce.current?"right":"left";F.current=Z,ce.current=W.clientX}}))})})})})})})},"MenuContentImpl")),DM=h.forwardRef(gt(function(a,l){const{__scopeMenu:o,...c}=a;return s.jsx(Pe.div,{...c,ref:l})},"MenuLabel")),tm="MenuItem",Cb="menu.itemSelect",OM=h.forwardRef(gt(function(a,l){const{disabled:o=!1,onSelect:c,...u}=a,f=h.useRef(null),p=np(tm,a.__scopeMenu),g=aw(tm,a.__scopeMenu),v=Ye(l,f),x=h.useRef(!1),y=gt(()=>{const b=f.current;if(!o&&b){const w=new CustomEvent(Cb,{bubbles:!0,cancelable:!0});b.addEventListener(Cb,E=>c==null?void 0:c(E),{once:!0}),Lm(b,w),w.defaultPrevented?x.current=!1:p.onClose()}},"handleSelect");return s.jsx(_M,{...u,ref:v,disabled:o,onClick:je(a.onClick,y),onPointerDown:b=>{var w;(w=a.onPointerDown)==null||w.call(a,b),x.current=!0},onPointerUp:je(a.onPointerUp,b=>{var w;x.current||(w=b.currentTarget)==null||w.click()}),onKeyDown:je(a.onKeyDown,b=>{o||b.target!==b.currentTarget||g.searchRef.current!==""&&b.key===" "||mM.includes(b.key)&&(b.currentTarget.click(),b.preventDefault())})})},"MenuItem")),_M=h.forwardRef(gt(function(a,l){const{__scopeMenu:o,disabled:c=!1,textValue:u,...f}=a,p=aw(tm,o),g=tw(o),v=h.useRef(null),x=Ye(l,v),[y,b]=h.useState(!1),[w,E]=h.useState("");return h.useEffect(()=>{const j=v.current;j&&E((j.textContent??"").trim())},[f.children]),s.jsx(em.ItemSlot,{scope:o,disabled:c,textValue:u??w,children:s.jsx(V1,{asChild:!0,...g,focusable:!c,children:s.jsx(Pe.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":c||void 0,"data-disabled":c?"":void 0,...f,ref:x,onPointerMove:je(a.onPointerMove,hu(j=>{c?p.onItemLeave(j):(p.onItemEnter(j),j.defaultPrevented||j.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:je(a.onPointerLeave,hu(j=>p.onItemLeave(j))),onFocus:je(a.onFocus,()=>b(!0)),onBlur:je(a.onBlur,()=>b(!1))})})})},"MenuItemImpl")),kM="MenuRadioGroup",[X4,F4]=Bl(kM,{value:void 0,onValueChange:gt(()=>{},"onValueChange")}),zM="MenuItemIndicator",[Q4,Z4]=Bl(zM,{checked:!1}),LM=h.forwardRef(gt(function(a,l){const{__scopeMenu:o,...c}=a;return s.jsx(Pe.div,{role:"separator","aria-orientation":"horizontal",...c,ref:l})},"MenuSeparator")),UM="MenuSub",[J4,W4]=Bl(UM);function lw(n){return n?"open":"closed"}gt(lw,"getOpenState");function sw(n){return n==="indeterminate"}gt(sw,"isIndeterminate");function IM(n){return sw(n)?"indeterminate":n?"checked":"unchecked"}gt(IM,"getCheckedState");function ow(n){const a=document.activeElement;for(const l of n)if(l===a||(l.focus(),document.activeElement!==a))return}gt(ow,"focusFirst");function iw(n,a){return n.map((l,o)=>n[(a+o)%n.length])}gt(iw,"wrapArray");function cw(n,a,l){const c=a.length>1&&Array.from(a).every(v=>v===a[0])?a[0]:a,u=l?n.indexOf(l):-1;let f=iw(n,Math.max(u,0));c.length===1&&(f=f.filter(v=>v!==l));const g=f.find(v=>v.toLowerCase().startsWith(c.toLowerCase()));return g!==l?g:void 0}gt(cw,"getNextMatch");function uw(n,a){const{x:l,y:o}=n;let c=!1;for(let u=0,f=a.length-1;u<a.length;f=u++){const p=a[u],g=a[f],v=p.x,x=p.y,y=g.x,b=g.y;x>o!=b>o&&l<(y-v)*(o-x)/(b-x)+v&&(c=!c)}return c}gt(uw,"isPointInPolygon");function dw(n,a){if(!a)return!1;const l={x:n.clientX,y:n.clientY};return uw(l,a)}gt(dw,"isPointerInGraceArea");function hu(n){return a=>a.pointerType==="mouse"?n(a):void 0}gt(hu,"whenMouse");var BM=wM,PM=SM,HM=EM,qM=RM,$M=DM,VM=OM,YM=LM,GM=Object.defineProperty,Pl=(n,a)=>GM(n,"name",{value:a,configurable:!0}),ap="DropdownMenu",[KM,e5]=_n(ap,[ew]),Hl=ew(),[XM,fw]=KM(ap),FM=Pl(n=>{const{__scopeDropdownMenu:a,children:l,dir:o,open:c,defaultOpen:u,onOpenChange:f,modal:p=!0}=n,g=Hl(a),v=h.useRef(null),[x,y]=La({prop:c,defaultProp:u??!1,onChange:f,caller:ap});return s.jsx(XM,{scope:a,triggerId:ja(),triggerRef:v,contentId:ja(),open:x,onOpenChange:y,onOpenToggle:h.useCallback(()=>y(b=>!b),[y]),modal:p,children:s.jsx(BM,{...g,open:x,onOpenChange:y,dir:o,modal:p,children:l})})},"DropdownMenu"),QM="DropdownMenuTrigger",ZM=h.forwardRef(Pl(function(a,l){const{__scopeDropdownMenu:o,disabled:c=!1,...u}=a,f=fw(QM,o),p=Hl(o),g=Ye(l,f.triggerRef);return s.jsx(PM,{asChild:!0,...p,children:s.jsx(Pe.button,{type:"button",id:f.triggerId,"aria-haspopup":"menu","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":f.open?"open":"closed","data-disabled":c?"":void 0,disabled:c,...u,ref:g,onPointerDown:je(a.onPointerDown,v=>{!c&&v.button===0&&v.ctrlKey===!1&&(f.onOpenToggle(),f.open||v.preventDefault())}),onKeyDown:je(a.onKeyDown,v=>{c||(["Enter"," "].includes(v.key)&&f.onOpenToggle(),v.key==="ArrowDown"&&f.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(v.key)&&v.preventDefault())})})})},"DropdownMenuTrigger")),JM=Pl(n=>{const{__scopeDropdownMenu:a,...l}=n,o=Hl(a);return s.jsx(HM,{...o,...l})},"DropdownMenuPortal"),WM="DropdownMenuContent",eD=h.forwardRef(Pl(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=fw(WM,o),f=Hl(o),p=h.useRef(!1);return s.jsx(qM,{id:u.contentId,"aria-labelledby":u.triggerId,...f,...c,ref:l,onCloseAutoFocus:je(a.onCloseAutoFocus,g=>{var v;p.current||(v=u.triggerRef.current)==null||v.focus(),p.current=!1,g.preventDefault()}),onInteractOutside:je(a.onInteractOutside,g=>{const v=g.detail.originalEvent,x=v.button===0&&v.ctrlKey===!0,y=v.button===2||x;(!u.modal||y)&&(p.current=!0)}),style:{...a.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")),tD=h.forwardRef(Pl(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=Hl(o);return s.jsx($M,{...u,...c,ref:l})},"DropdownMenuLabel")),nD=h.forwardRef(Pl(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=Hl(o);return s.jsx(VM,{...u,...c,ref:l})},"DropdownMenuItem")),aD=h.forwardRef(Pl(function(a,l){const{__scopeDropdownMenu:o,...c}=a,u=Hl(o);return s.jsx(YM,{...u,...c,ref:l})},"DropdownMenuSeparator")),rD=FM,lD=ZM,sD=JM,hw=eD,mw=tD,pw=nD,gw=aD;const oD=rD,iD=lD,vw=h.forwardRef(({className:n,sideOffset:a=4,...l},o)=>s.jsx(sD,{children:s.jsx(hw,{ref:o,sideOffset:a,className:Ee("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",n),...l})}));vw.displayName=hw.displayName;const xw=h.forwardRef(({className:n,inset:a,...l},o)=>s.jsx(pw,{ref:o,className:Ee("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",a&&"pl-8",n),...l}));xw.displayName=pw.displayName;const cD=h.forwardRef(({className:n,...a},l)=>s.jsx(mw,{ref:l,className:Ee("px-2 py-1.5 text-sm font-semibold",n),...a}));cD.displayName=mw.displayName;const uD=h.forwardRef(({className:n,...a},l)=>s.jsx(gw,{ref:l,className:Ee("-mx-1 my-1 h-px bg-muted",n),...a}));uD.displayName=gw.displayName;function dD(){const{theme:n,setTheme:a}=bR(),{user:l,logout:o}=Am(),[c,u]=h.useState(!1),[f,p]=h.useState(null),g=fi(),v=n==="light"?jN:n==="dark"?mN:hN;return h.useEffect(()=>{xe.get("/api/admin/update/check?force=1").then(x=>p(x)).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:[(f==null?void 0:f.hasUpdate)&&s.jsxs(oe,{variant:"ghost",size:"sm",title:`New version available: v${f.latestVersion} — go to Settings → System to update`,onClick:()=>g("/settings?tab=system"),children:[s.jsx(WE,{className:"mr-1 h-4 w-4 text-blue-500"}),"Update v",f.latestVersion]}),s.jsx(oe,{variant:"ghost",size:"icon",onClick:()=>a(n==="dark"?"light":"dark"),children:s.jsx(v,{className:"h-4 w-4"})}),s.jsxs(oD,{open:c,onOpenChange:u,children:[s.jsx(iD,{asChild:!0,children:s.jsx(oe,{variant:"ghost",children:(l==null?void 0:l.username)??"admin"})}),s.jsx(vw,{align:"end",children:s.jsxs(xw,{onClick:()=>void o(),children:[s.jsx(fN,{className:"mr-2 h-4 w-4"})," Sign out"]})})]})]})]})}const Re=h.forwardRef(({className:n,type:a,...l},o)=>s.jsx("input",{type:a,className:Ee("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",n),ref:o,...l}));Re.displayName="Input";var fD=Object.defineProperty,hD=(n,a)=>fD(n,"name",{value:a,configurable:!0}),mD=h.forwardRef(hD(function(a,l){return s.jsx(Pe.label,{...a,ref:l,onMouseDown:o=>{var u;o.target.closest("button, input, select, textarea")||((u=a.onMouseDown)==null||u.call(a,o),!o.defaultPrevented&&o.detail>1&&o.preventDefault())}})},"Label")),yw=mD;const be=h.forwardRef(({className:n,...a},l)=>s.jsx(yw,{ref:l,className:Ee("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n),...a}));be.displayName=yw.displayName;const rt=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Ee("rounded-lg border bg-card text-card-foreground shadow-sm",n),...a}));rt.displayName="Card";const lt=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Ee("flex flex-col space-y-1.5 p-6",n),...a}));lt.displayName="CardHeader";const st=h.forwardRef(({className:n,...a},l)=>s.jsx("h3",{ref:l,className:Ee("text-lg font-semibold leading-none tracking-tight",n),...a}));st.displayName="CardTitle";const Tn=h.forwardRef(({className:n,...a},l)=>s.jsx("p",{ref:l,className:Ee("text-sm text-muted-foreground",n),...a}));Tn.displayName="CardDescription";const ot=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Ee("p-6 pt-0",n),...a}));ot.displayName="CardContent";const bw=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{ref:l,className:Ee("flex items-center p-6 pt-0",n),...a}));bw.displayName="CardFooter";var pD=n=>{switch(n){case"success":return xD;case"info":return bD;case"warning":return yD;case"error":return wD;default:return null}},gD=Array(12).fill(0),vD=({visible:n,className:a})=>ie.createElement("div",{className:["sonner-loading-wrapper",a].filter(Boolean).join(" "),"data-visible":n},ie.createElement("div",{className:"sonner-spinner"},gD.map((l,o)=>ie.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),xD=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.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"})),yD=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ie.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"})),bD=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.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"})),wD=ie.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ie.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"})),SD=ie.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"},ie.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ie.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),jD=()=>{let[n,a]=ie.useState(document.hidden);return ie.useEffect(()=>{let l=()=>{a(document.hidden)};return document.addEventListener("visibilitychange",l),()=>window.removeEventListener("visibilitychange",l)},[]),n},nm=1,CD=class{constructor(){this.subscribe=n=>(this.subscribers.push(n),()=>{let a=this.subscribers.indexOf(n);this.subscribers.splice(a,1)}),this.publish=n=>{this.subscribers.forEach(a=>a(n))},this.addToast=n=>{this.publish(n),this.toasts=[...this.toasts,n]},this.create=n=>{var a;let{message:l,...o}=n,c=typeof(n==null?void 0:n.id)=="number"||((a=n.id)==null?void 0:a.length)>0?n.id:nm++,u=this.toasts.find(p=>p.id===c),f=n.dismissible===void 0?!0:n.dismissible;return this.dismissedToasts.has(c)&&this.dismissedToasts.delete(c),u?this.toasts=this.toasts.map(p=>p.id===c?(this.publish({...p,...n,id:c,title:l}),{...p,...n,id:c,dismissible:f,title:l}):p):this.addToast({title:l,...o,dismissible:f,id:c}),c},this.dismiss=n=>(this.dismissedToasts.add(n),n||this.toasts.forEach(a=>{this.subscribers.forEach(l=>l({id:a.id,dismiss:!0}))}),this.subscribers.forEach(a=>a({id:n,dismiss:!0})),n),this.message=(n,a)=>this.create({...a,message:n}),this.error=(n,a)=>this.create({...a,message:n,type:"error"}),this.success=(n,a)=>this.create({...a,type:"success",message:n}),this.info=(n,a)=>this.create({...a,type:"info",message:n}),this.warning=(n,a)=>this.create({...a,type:"warning",message:n}),this.loading=(n,a)=>this.create({...a,type:"loading",message:n}),this.promise=(n,a)=>{if(!a)return;let l;a.loading!==void 0&&(l=this.create({...a,promise:n,type:"loading",message:a.loading,description:typeof a.description!="function"?a.description:void 0}));let o=n instanceof Promise?n:n(),c=l!==void 0,u,f=o.then(async g=>{if(u=["resolve",g],ie.isValidElement(g))c=!1,this.create({id:l,type:"default",message:g});else if(ND(g)&&!g.ok){c=!1;let v=typeof a.error=="function"?await a.error(`HTTP error! status: ${g.status}`):a.error,x=typeof a.description=="function"?await a.description(`HTTP error! status: ${g.status}`):a.description;this.create({id:l,type:"error",message:v,description:x})}else if(a.success!==void 0){c=!1;let v=typeof a.success=="function"?await a.success(g):a.success,x=typeof a.description=="function"?await a.description(g):a.description;this.create({id:l,type:"success",message:v,description:x})}}).catch(async g=>{if(u=["reject",g],a.error!==void 0){c=!1;let v=typeof a.error=="function"?await a.error(g):a.error,x=typeof a.description=="function"?await a.description(g):a.description;this.create({id:l,type:"error",message:v,description:x})}}).finally(()=>{var g;c&&(this.dismiss(l),l=void 0),(g=a.finally)==null||g.call(a)}),p=()=>new Promise((g,v)=>f.then(()=>u[0]==="reject"?v(u[1]):g(u[1])).catch(v));return typeof l!="string"&&typeof l!="number"?{unwrap:p}:Object.assign(l,{unwrap:p})},this.custom=(n,a)=>{let l=(a==null?void 0:a.id)||nm++;return this.create({jsx:n(l),id:l,...a}),l},this.getActiveToasts=()=>this.toasts.filter(n=>!this.dismissedToasts.has(n.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Rn=new CD,ED=(n,a)=>{let l=(a==null?void 0:a.id)||nm++;return Rn.addToast({title:n,...a,id:l}),l},ND=n=>n&&typeof n=="object"&&"ok"in n&&typeof n.ok=="boolean"&&"status"in n&&typeof n.status=="number",RD=ED,TD=()=>Rn.toasts,AD=()=>Rn.getActiveToasts(),me=Object.assign(RD,{success:Rn.success,info:Rn.info,warning:Rn.warning,error:Rn.error,custom:Rn.custom,message:Rn.message,promise:Rn.promise,dismiss:Rn.dismiss,loading:Rn.loading},{getHistory:TD,getToasts:AD});function MD(n,{insertAt:a}={}){if(typeof document>"u")return;let l=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",a==="top"&&l.firstChild?l.insertBefore(o,l.firstChild):l.appendChild(o),o.styleSheet?o.styleSheet.cssText=n:o.appendChild(document.createTextNode(n))}MD(`: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%)}
|
|
376
|
-
`);function Yc(n){return n.label!==void 0}var DD=3,OD="32px",_D="16px",Eb=4e3,kD=356,zD=14,LD=20,UD=200;function ya(...n){return n.filter(Boolean).join(" ")}function ID(n){let[a,l]=n.split("-"),o=[];return a&&o.push(a),l&&o.push(l),o}var BD=n=>{var a,l,o,c,u,f,p,g,v,x,y;let{invert:b,toast:w,unstyled:E,interacting:j,setHeights:C,visibleToasts:R,heights:D,index:A,toasts:M,expanded:O,removeToast:N,defaultRichColors:_,closeButton:U,style:V,cancelButtonStyle:te,actionButtonStyle:q,className:G="",descriptionClassName:B="",duration:F,position:ce,gap:k,loadingIcon:$,expandByDefault:ee,classNames:I,icons:W,closeButtonAriaLabel:z="Close toast",pauseWhenPageIsHidden:H}=n,[Z,re]=ie.useState(null),[he,ye]=ie.useState(null),[pe,de]=ie.useState(!1),[ve,fe]=ie.useState(!1),[De,Ne]=ie.useState(!1),[_e,Fe]=ie.useState(!1),[We,se]=ie.useState(!1),[Oe,Qe]=ie.useState(0),[xt,Rt]=ie.useState(0),Gt=ie.useRef(w.duration||F||Eb),xn=ie.useRef(null),Zn=ie.useRef(null),Kt=A===0,no=A+1<=R,Wt=w.type,sn=w.dismissible!==!1,zn=w.className||"",$a=w.descriptionClassName||"",Ra=ie.useMemo(()=>D.findIndex(Ce=>Ce.toastId===w.id)||0,[D,w.id]),Jn=ie.useMemo(()=>{var Ce;return(Ce=w.closeButton)!=null?Ce:U},[w.closeButton,U]),ul=ie.useMemo(()=>w.duration||F||Eb,[w.duration,F]),ma=ie.useRef(0),At=ie.useRef(0),mn=ie.useRef(0),Tt=ie.useRef(null),[ao,$l]=ce.split("-"),Vl=ie.useMemo(()=>D.reduce((Ce,ze,Ue)=>Ue>=Ra?Ce:Ce+ze.height,0),[D,Ra]),Va=jD(),Nr=w.invert||b,yt=Wt==="loading";At.current=ie.useMemo(()=>Ra*k+Vl,[Ra,Vl]),ie.useEffect(()=>{Gt.current=ul},[ul]),ie.useEffect(()=>{de(!0)},[]),ie.useEffect(()=>{let Ce=Zn.current;if(Ce){let ze=Ce.getBoundingClientRect().height;return Rt(ze),C(Ue=>[{toastId:w.id,height:ze,position:w.position},...Ue]),()=>C(Ue=>Ue.filter(vt=>vt.toastId!==w.id))}},[C,w.id]),ie.useLayoutEffect(()=>{if(!pe)return;let Ce=Zn.current,ze=Ce.style.height;Ce.style.height="auto";let Ue=Ce.getBoundingClientRect().height;Ce.style.height=ze,Rt(Ue),C(vt=>vt.find(Ct=>Ct.toastId===w.id)?vt.map(Ct=>Ct.toastId===w.id?{...Ct,height:Ue}:Ct):[{toastId:w.id,height:Ue,position:w.position},...vt])},[pe,w.title,w.description,C,w.id]);let at=ie.useCallback(()=>{fe(!0),Qe(At.current),C(Ce=>Ce.filter(ze=>ze.toastId!==w.id)),setTimeout(()=>{N(w)},UD)},[w,N,C,At]);ie.useEffect(()=>{if(w.promise&&Wt==="loading"||w.duration===1/0||w.type==="loading")return;let Ce;return O||j||H&&Va?(()=>{if(mn.current<ma.current){let ze=new Date().getTime()-ma.current;Gt.current=Gt.current-ze}mn.current=new Date().getTime()})():Gt.current!==1/0&&(ma.current=new Date().getTime(),Ce=setTimeout(()=>{var ze;(ze=w.onAutoClose)==null||ze.call(w,w),at()},Gt.current)),()=>clearTimeout(Ce)},[O,j,w,Wt,H,Va,at]),ie.useEffect(()=>{w.delete&&at()},[at,w.delete]);function zt(){var Ce,ze,Ue;return W!=null&&W.loading?ie.createElement("div",{className:ya(I==null?void 0:I.loader,(Ce=w==null?void 0:w.classNames)==null?void 0:Ce.loader,"sonner-loader"),"data-visible":Wt==="loading"},W.loading):$?ie.createElement("div",{className:ya(I==null?void 0:I.loader,(ze=w==null?void 0:w.classNames)==null?void 0:ze.loader,"sonner-loader"),"data-visible":Wt==="loading"},$):ie.createElement(vD,{className:ya(I==null?void 0:I.loader,(Ue=w==null?void 0:w.classNames)==null?void 0:Ue.loader),visible:Wt==="loading"})}return ie.createElement("li",{tabIndex:0,ref:Zn,className:ya(G,zn,I==null?void 0:I.toast,(a=w==null?void 0:w.classNames)==null?void 0:a.toast,I==null?void 0:I.default,I==null?void 0:I[Wt],(l=w==null?void 0:w.classNames)==null?void 0:l[Wt]),"data-sonner-toast":"","data-rich-colors":(o=w.richColors)!=null?o:_,"data-styled":!(w.jsx||w.unstyled||E),"data-mounted":pe,"data-promise":!!w.promise,"data-swiped":We,"data-removed":ve,"data-visible":no,"data-y-position":ao,"data-x-position":$l,"data-index":A,"data-front":Kt,"data-swiping":De,"data-dismissible":sn,"data-type":Wt,"data-invert":Nr,"data-swipe-out":_e,"data-swipe-direction":he,"data-expanded":!!(O||ee&&pe),style:{"--index":A,"--toasts-before":A,"--z-index":M.length-A,"--offset":`${ve?Oe:At.current}px`,"--initial-height":ee?"auto":`${xt}px`,...V,...w.style},onDragEnd:()=>{Ne(!1),re(null),Tt.current=null},onPointerDown:Ce=>{yt||!sn||(xn.current=new Date,Qe(At.current),Ce.target.setPointerCapture(Ce.pointerId),Ce.target.tagName!=="BUTTON"&&(Ne(!0),Tt.current={x:Ce.clientX,y:Ce.clientY}))},onPointerUp:()=>{var Ce,ze,Ue,vt;if(_e||!sn)return;Tt.current=null;let Ct=Number(((Ce=Zn.current)==null?void 0:Ce.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ut=Number(((ze=Zn.current)==null?void 0:ze.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ht=new Date().getTime()-((Ue=xn.current)==null?void 0:Ue.getTime()),bt=Z==="x"?Ct:ut,Ot=Math.abs(bt)/Ht;if(Math.abs(bt)>=LD||Ot>.11){Qe(At.current),(vt=w.onDismiss)==null||vt.call(w,w),ye(Z==="x"?Ct>0?"right":"left":ut>0?"down":"up"),at(),Fe(!0),se(!1);return}Ne(!1),re(null)},onPointerMove:Ce=>{var ze,Ue,vt,Ct;if(!Tt.current||!sn||((ze=window.getSelection())==null?void 0:ze.toString().length)>0)return;let ut=Ce.clientY-Tt.current.y,Ht=Ce.clientX-Tt.current.x,bt=(Ue=n.swipeDirections)!=null?Ue:ID(ce);!Z&&(Math.abs(Ht)>1||Math.abs(ut)>1)&&re(Math.abs(Ht)>Math.abs(ut)?"x":"y");let Ot={x:0,y:0};Z==="y"?(bt.includes("top")||bt.includes("bottom"))&&(bt.includes("top")&&ut<0||bt.includes("bottom")&&ut>0)&&(Ot.y=ut):Z==="x"&&(bt.includes("left")||bt.includes("right"))&&(bt.includes("left")&&Ht<0||bt.includes("right")&&Ht>0)&&(Ot.x=Ht),(Math.abs(Ot.x)>0||Math.abs(Ot.y)>0)&&se(!0),(vt=Zn.current)==null||vt.style.setProperty("--swipe-amount-x",`${Ot.x}px`),(Ct=Zn.current)==null||Ct.style.setProperty("--swipe-amount-y",`${Ot.y}px`)}},Jn&&!w.jsx?ie.createElement("button",{"aria-label":z,"data-disabled":yt,"data-close-button":!0,onClick:yt||!sn?()=>{}:()=>{var Ce;at(),(Ce=w.onDismiss)==null||Ce.call(w,w)},className:ya(I==null?void 0:I.closeButton,(c=w==null?void 0:w.classNames)==null?void 0:c.closeButton)},(u=W==null?void 0:W.close)!=null?u:SD):null,w.jsx||h.isValidElement(w.title)?w.jsx?w.jsx:typeof w.title=="function"?w.title():w.title:ie.createElement(ie.Fragment,null,Wt||w.icon||w.promise?ie.createElement("div",{"data-icon":"",className:ya(I==null?void 0:I.icon,(f=w==null?void 0:w.classNames)==null?void 0:f.icon)},w.promise||w.type==="loading"&&!w.icon?w.icon||zt():null,w.type!=="loading"?w.icon||(W==null?void 0:W[Wt])||pD(Wt):null):null,ie.createElement("div",{"data-content":"",className:ya(I==null?void 0:I.content,(p=w==null?void 0:w.classNames)==null?void 0:p.content)},ie.createElement("div",{"data-title":"",className:ya(I==null?void 0:I.title,(g=w==null?void 0:w.classNames)==null?void 0:g.title)},typeof w.title=="function"?w.title():w.title),w.description?ie.createElement("div",{"data-description":"",className:ya(B,$a,I==null?void 0:I.description,(v=w==null?void 0:w.classNames)==null?void 0:v.description)},typeof w.description=="function"?w.description():w.description):null),h.isValidElement(w.cancel)?w.cancel:w.cancel&&Yc(w.cancel)?ie.createElement("button",{"data-button":!0,"data-cancel":!0,style:w.cancelButtonStyle||te,onClick:Ce=>{var ze,Ue;Yc(w.cancel)&&sn&&((Ue=(ze=w.cancel).onClick)==null||Ue.call(ze,Ce),at())},className:ya(I==null?void 0:I.cancelButton,(x=w==null?void 0:w.classNames)==null?void 0:x.cancelButton)},w.cancel.label):null,h.isValidElement(w.action)?w.action:w.action&&Yc(w.action)?ie.createElement("button",{"data-button":!0,"data-action":!0,style:w.actionButtonStyle||q,onClick:Ce=>{var ze,Ue;Yc(w.action)&&((Ue=(ze=w.action).onClick)==null||Ue.call(ze,Ce),!Ce.defaultPrevented&&at())},className:ya(I==null?void 0:I.actionButton,(y=w==null?void 0:w.classNames)==null?void 0:y.actionButton)},w.action.label):null))};function Nb(){if(typeof window>"u"||typeof document>"u")return"ltr";let n=document.documentElement.getAttribute("dir");return n==="auto"||!n?window.getComputedStyle(document.documentElement).direction:n}function PD(n,a){let l={};return[n,a].forEach((o,c)=>{let u=c===1,f=u?"--mobile-offset":"--offset",p=u?_D:OD;function g(v){["top","right","bottom","left"].forEach(x=>{l[`${f}-${x}`]=typeof v=="number"?`${v}px`:v})}typeof o=="number"||typeof o=="string"?g(o):typeof o=="object"?["top","right","bottom","left"].forEach(v=>{o[v]===void 0?l[`${f}-${v}`]=p:l[`${f}-${v}`]=typeof o[v]=="number"?`${o[v]}px`:o[v]}):g(p)}),l}var HD=h.forwardRef(function(n,a){let{invert:l,position:o="bottom-right",hotkey:c=["altKey","KeyT"],expand:u,closeButton:f,className:p,offset:g,mobileOffset:v,theme:x="light",richColors:y,duration:b,style:w,visibleToasts:E=DD,toastOptions:j,dir:C=Nb(),gap:R=zD,loadingIcon:D,icons:A,containerAriaLabel:M="Notifications",pauseWhenPageIsHidden:O}=n,[N,_]=ie.useState([]),U=ie.useMemo(()=>Array.from(new Set([o].concat(N.filter(H=>H.position).map(H=>H.position)))),[N,o]),[V,te]=ie.useState([]),[q,G]=ie.useState(!1),[B,F]=ie.useState(!1),[ce,k]=ie.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=ie.useRef(null),ee=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),I=ie.useRef(null),W=ie.useRef(!1),z=ie.useCallback(H=>{_(Z=>{var re;return(re=Z.find(he=>he.id===H.id))!=null&&re.delete||Rn.dismiss(H.id),Z.filter(({id:he})=>he!==H.id)})},[]);return ie.useEffect(()=>Rn.subscribe(H=>{if(H.dismiss){_(Z=>Z.map(re=>re.id===H.id?{...re,delete:!0}:re));return}setTimeout(()=>{VE.flushSync(()=>{_(Z=>{let re=Z.findIndex(he=>he.id===H.id);return re!==-1?[...Z.slice(0,re),{...Z[re],...H},...Z.slice(re+1)]:[H,...Z]})})})}),[]),ie.useEffect(()=>{if(x!=="system"){k(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?k("dark"):k("light")),typeof window>"u")return;let H=window.matchMedia("(prefers-color-scheme: dark)");try{H.addEventListener("change",({matches:Z})=>{k(Z?"dark":"light")})}catch{H.addListener(({matches:re})=>{try{k(re?"dark":"light")}catch(he){console.error(he)}})}},[x]),ie.useEffect(()=>{N.length<=1&&G(!1)},[N]),ie.useEffect(()=>{let H=Z=>{var re,he;c.every(ye=>Z[ye]||Z.code===ye)&&(G(!0),(re=$.current)==null||re.focus()),Z.code==="Escape"&&(document.activeElement===$.current||(he=$.current)!=null&&he.contains(document.activeElement))&&G(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[c]),ie.useEffect(()=>{if($.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,W.current=!1)}},[$.current]),ie.createElement("section",{ref:a,"aria-label":`${M} ${ee}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},U.map((H,Z)=>{var re;let[he,ye]=H.split("-");return N.length?ie.createElement("ol",{key:H,dir:C==="auto"?Nb():C,tabIndex:-1,ref:$,className:p,"data-sonner-toaster":!0,"data-theme":ce,"data-y-position":he,"data-lifted":q&&N.length>1&&!u,"data-x-position":ye,style:{"--front-toast-height":`${((re=V[0])==null?void 0:re.height)||0}px`,"--width":`${kD}px`,"--gap":`${R}px`,...w,...PD(g,v)},onBlur:pe=>{W.current&&!pe.currentTarget.contains(pe.relatedTarget)&&(W.current=!1,I.current&&(I.current.focus({preventScroll:!0}),I.current=null))},onFocus:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||W.current||(W.current=!0,I.current=pe.relatedTarget)},onMouseEnter:()=>G(!0),onMouseMove:()=>G(!0),onMouseLeave:()=>{B||G(!1)},onDragEnd:()=>G(!1),onPointerDown:pe=>{pe.target instanceof HTMLElement&&pe.target.dataset.dismissible==="false"||F(!0)},onPointerUp:()=>F(!1)},N.filter(pe=>!pe.position&&Z===0||pe.position===H).map((pe,de)=>{var ve,fe;return ie.createElement(BD,{key:pe.id,icons:A,index:de,toast:pe,defaultRichColors:y,duration:(ve=j==null?void 0:j.duration)!=null?ve:b,className:j==null?void 0:j.className,descriptionClassName:j==null?void 0:j.descriptionClassName,invert:l,visibleToasts:E,closeButton:(fe=j==null?void 0:j.closeButton)!=null?fe:f,interacting:B,position:H,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:z,toasts:N.filter(De=>De.position==pe.position),heights:V.filter(De=>De.position==pe.position),setHeights:te,expandByDefault:u,gap:R,loadingIcon:D,expanded:q,pauseWhenPageIsHidden:O,swipeDirections:n.swipeDirections})})):null}))});function qD(){const{login:n}=Am(),[a,l]=h.useState("admin"),[o,c]=h.useState(""),[u,f]=h.useState(""),[p,g]=h.useState(""),[v,x]=h.useState(!1),[y,b]=h.useState(!1),w=fi(),E=On();return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs(rt,{className:"w-full max-w-sm",children:[s.jsxs(lt,{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(st,{children:"Sign in"})]}),s.jsx(Tn,{children:"Enter your admin credentials."})]}),s.jsxs(ot,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Username"}),s.jsx(Re,{value:a,onChange:j=>l(j.target.value),autoFocus:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Password"}),s.jsx(Re,{type:"password",value:o,onChange:j=>c(j.target.value)})]}),v&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"2FA code (or recovery code)"}),s.jsx(Re,{value:u,onChange:j=>f(j.target.value),placeholder:"123456",maxLength:6})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Recovery code (alternative)"}),s.jsx(Re,{value:p,onChange:j=>g(j.target.value),placeholder:"ABCD12-EF3456"})]})]})]}),s.jsx("div",{className:"px-6 pb-6",children:s.jsx(oe,{className:"w-full",disabled:y,onClick:async()=>{var j,C;b(!0);try{if((await n(a,o,u||void 0,p||void 0)).totpRequired){x(!0);return}const D=((C=(j=E.state)==null?void 0:j.from)==null?void 0:C.pathname)??"/";w(D,{replace:!0})}catch(R){me.error(R.message)}finally{b(!1)}},children:"Sign in"})})]})})}function $D(){const[n,a]=h.useState("admin"),[l,o]=h.useState(""),[c,u]=h.useState(""),[f,p]=h.useState(!1),[g,v]=h.useState(!0),[x,y]=h.useState(null),[b,w]=h.useState(""),[E,j]=h.useState(!1);h.useEffect(()=>{xe.get("/api/admin/setup/status").then(D=>v(!D.masterKeyConfigured)).catch(()=>v(!0))},[]);const C=!g||c.trim().length>=32,R=!f&&l.length>=12&&C;return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs(rt,{className:"w-full max-w-md",children:[s.jsxs(lt,{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(st,{children:"Welcome to LateDev Router"})]}),s.jsx(Tn,{children:"Set up the administrator account to get started."})]}),s.jsxs(ot,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Username"}),s.jsx(Re,{value:n,onChange:D=>a(D.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Password (12+ chars)"}),s.jsx(Re,{type:"password",value:l,onChange:D=>o(D.target.value)})]}),g&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Master encryption key (required, 32+ chars)"}),s.jsx(Re,{type:"password",value:c,onChange:D=>u(D.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.jsxs(bw,{className:"flex-col items-stretch gap-4",children:[s.jsx(oe,{disabled:!R,onClick:async()=>{p(!0);try{await xe.post("/api/admin/setup",{username:n,password:l,setupMasterKey:g?c.trim():void 0}),me.success("Admin account created"),window.location.assign("/login")}catch(D){me.error(D.message)}finally{p(!1)}},children:"Create admin"}),s.jsxs("div",{className:"border-t pt-4 space-y-2",children:[s.jsx(be,{children:"Import existing database"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Use this to restore the administrator account, password, TOTP settings, providers, models, and master key from a backup without setting up again. Enter the same 6-digit backup passphrase used when the file was created."}),s.jsx(Re,{type:"file",accept:".json,application/json",onChange:D=>{var A;return y(((A=D.target.files)==null?void 0:A[0])??null)}}),s.jsx(Re,{inputMode:"numeric",maxLength:6,value:b,onChange:D=>w(D.target.value.replace(/\D/g,"")),placeholder:"Backup passphrase (6 digits)"}),s.jsx(oe,{variant:"outline",disabled:!x||b.length!==6||E,onClick:async()=>{var D,A;if(x){j(!0);try{const M=JSON.parse(await x.text()),O=await fetch("/api/admin/backup/restore",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({backup:M,passphrase:b})});if(!O.ok)throw new Error(((A=(D=await O.json())==null?void 0:D.error)==null?void 0:A.message)??"Import failed");me.success("Database imported"),window.location.assign("/login")}catch(M){me.error(M.message)}finally{j(!1)}}},children:"Import database"})]})]})]})})}function qa({title:n,description:a,actions:l,className:o}){return s.jsxs("div",{className:Ee("mb-6 flex items-start justify-between gap-4",o),children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:n}),a&&s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:a})]}),l&&s.jsx("div",{className:"flex items-center gap-2",children:l})]})}const VD=G0("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 nt({className:n,variant:a,...l}){return s.jsx("div",{className:Ee(VD({variant:a}),n),...l})}function YD(){const[n,a]=h.useState(null);return h.useEffect(()=>{xe.get("/api/admin/dashboard").then(a).catch(()=>a(null))},[]),n?s.jsxs("div",{children:[s.jsx(qa,{title:"Dashboard",description:"Operational summary for today",actions:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(oe,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(Dl,{to:"/providers",children:[s.jsx(mi,{className:"mr-1 h-4 w-4"})," Provider"]})}),s.jsx(oe,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(Dl,{to:"/combos",children:[s.jsx(A0,{className:"mr-1 h-4 w-4"})," Combo"]})}),s.jsx(oe,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(Dl,{to:"/api-keys",children:[s.jsx(T0,{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(rt,{children:[s.jsx(lt,{className:"pb-1",children:s.jsx(st,{className:"text-sm text-muted-foreground",children:"Requests today"})}),s.jsx(ot,{className:"text-2xl font-semibold",children:Vt(n.today.total)})]}),s.jsxs(rt,{children:[s.jsx(lt,{className:"pb-1",children:s.jsx(st,{className:"text-sm text-muted-foreground",children:"Success rate"})}),s.jsx(ot,{className:"text-2xl font-semibold",children:n.today.total?Nu(n.today.success/n.today.total):"—"})]}),s.jsxs(rt,{children:[s.jsx(lt,{className:"pb-1",children:s.jsx(st,{className:"text-sm text-muted-foreground",children:"Failed"})}),s.jsx(ot,{className:"text-2xl font-semibold",children:Vt(n.today.failed)})]}),s.jsxs(rt,{children:[s.jsx(lt,{className:"pb-1",children:s.jsx(st,{className:"text-sm text-muted-foreground",children:"Tokens today"})}),s.jsx(ot,{className:"text-2xl font-semibold",children:Vt(n.today.totalTokens)})]})]}),s.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-2",children:[s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"Provider health"}),s.jsxs(Tn,{children:[n.providers.length," configured"]})]}),s.jsxs(ot,{className:"space-y-2",children:[n.providers.length===0&&s.jsxs("p",{className:"text-sm text-muted-foreground",children:["No providers yet. ",s.jsx(Dl,{to:"/providers",className:"text-primary",children:"Add one"}),"."]}),n.providers.map(l=>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(M0,{className:"h-4 w-4 text-muted-foreground"}),s.jsx("span",{className:"font-medium",children:l.name}),s.jsx("span",{className:"text-xs text-muted-foreground",children:l.slug}),s.jsx(nt,{variant:"outline",className:"ml-2",children:l.type})]}),s.jsx(nt,{variant:l.health==="healthy"?"success":l.health==="down"?"destructive":"secondary",children:l.health})]},l.id))]})]}),s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"Recent failures"}),s.jsx(Tn,{children:"Today"})]}),s.jsxs(ot,{className:"space-y-1 text-sm",children:[n.recentFailures.length===0&&s.jsx("p",{className:"text-muted-foreground",children:"No failures today."}),n.recentFailures.map(l=>{var o;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:l.requestedModel}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[l.errorType??`HTTP ${l.httpStatus}`," — ",(o=l.errorMessage)==null?void 0:o.slice(0,60)]})]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:km(l.createdAt)})]},l.id)})]})]})]})]}):s.jsx("div",{className:"text-muted-foreground",children:"Loading…"})}const Gn=h.forwardRef(({className:n,...a},l)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:l,className:Ee("w-full caption-bottom text-sm",n),...a})}));Gn.displayName="Table";const Kn=h.forwardRef(({className:n,...a},l)=>s.jsx("thead",{ref:l,className:Ee("[&_tr]:border-b",n),...a}));Kn.displayName="TableHeader";const Xn=h.forwardRef(({className:n,...a},l)=>s.jsx("tbody",{ref:l,className:Ee("[&_tr:last-child]:border-0",n),...a}));Xn.displayName="TableBody";const Xe=h.forwardRef(({className:n,...a},l)=>s.jsx("tr",{ref:l,className:Ee("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",n),...a}));Xe.displayName="TableRow";const ge=h.forwardRef(({className:n,...a},l)=>s.jsx("th",{ref:l,className:Ee("h-10 px-2 text-left align-middle font-medium text-muted-foreground",n),...a}));ge.displayName="TableHead";const ue=h.forwardRef(({className:n,...a},l)=>s.jsx("td",{ref:l,className:Ee("p-2 align-middle",n),...a}));ue.displayName="TableCell";var GD=Object.defineProperty,Qn=(n,a)=>GD(n,"name",{value:a,configurable:!0}),rp="Dialog",[ww,Sw]=_n(rp),[KD,Na]=ww(rp),jw=Qn(n=>{const{__scopeDialog:a,children:l,open:o,defaultOpen:c,onOpenChange:u,modal:f=!0}=n,p=h.useRef(null),g=h.useRef(null),[v,x]=La({prop:o,defaultProp:c??!1,onChange:u,caller:rp}),[y,b]=h.useState(0),[w,E]=h.useState(0);return s.jsx(KD,{scope:a,triggerRef:p,contentRef:g,contentId:ja(),titleId:ja(),descriptionId:ja(),titlePresent:y>0,descriptionPresent:w>0,setTitleCount:b,setDescriptionCount:E,open:v,onOpenChange:x,onOpenToggle:h.useCallback(()=>x(j=>!j),[x]),modal:f,children:l})},"Dialog"),XD="DialogTrigger",Cw=h.forwardRef(Qn(function(a,l){const{__scopeDialog:o,...c}=a,u=Na(XD,o),f=Ye(l,u.triggerRef);return s.jsx(Pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":u.open,"aria-controls":u.open?u.contentId:void 0,"data-state":Hu(u.open),...c,ref:f,onClick:je(a.onClick,u.onOpenToggle)})},"DialogTrigger")),Ew="DialogPortal",[FD,Nw]=ww(Ew,{forceMount:void 0}),Rw=Qn(n=>{const{__scopeDialog:a,forceMount:l,children:o,container:c}=n,u=Na(Ew,a);return s.jsx(FD,{scope:a,forceMount:l,children:h.Children.map(o,f=>s.jsx(jr,{present:l||u.open,children:s.jsx(Zm,{asChild:!0,container:c,children:f})}))})},"DialogPortal"),am="DialogOverlay",lp=h.forwardRef(Qn(function(a,l){const o=Nw(am,a.__scopeDialog),{forceMount:c=o.forceMount,...u}=a,f=Na(am,a.__scopeDialog);return f.modal?s.jsx(jr,{present:c||f.open,children:s.jsx(ZD,{...u,ref:l})}):null},"DialogOverlay")),QD=za("DialogOverlay.RemoveScroll"),ZD=h.forwardRef(Qn(function(a,l){const{__scopeDialog:o,...c}=a,u=Na(am,o),f=s1(),p=Ye(l,f);return s.jsx(Bu,{as:QD,allowPinchZoom:!0,shards:[u.contentRef],children:s.jsx(Pe.div,{"data-state":Hu(u.open),...c,ref:p,style:{pointerEvents:"auto",...c.style}})})},"DialogOverlayImpl")),li="DialogContent",sp=h.forwardRef(Qn(function(a,l){const o=Nw(li,a.__scopeDialog),{forceMount:c=o.forceMount,...u}=a,f=Na(li,a.__scopeDialog);return s.jsx(jr,{present:c||f.open,children:f.modal?s.jsx(JD,{...u,ref:l}):s.jsx(WD,{...u,ref:l})})},"DialogContent")),JD=h.forwardRef(Qn(function(a,l){const o=Na(li,a.__scopeDialog),c=h.useRef(null),u=Ye(l,o.contentRef,c);return h.useEffect(()=>{const f=c.current;if(f)return ep(f)},[]),s.jsx(Tw,{...a,ref:u,trapFocus:o.open,disableOutsidePointerEvents:o.open,onCloseAutoFocus:je(a.onCloseAutoFocus,f=>{var p;f.preventDefault(),(p=o.triggerRef.current)==null||p.focus()}),onPointerDownOutside:je(a.onPointerDownOutside,f=>{const p=f.detail.originalEvent,g=p.button===0&&p.ctrlKey===!0;(p.button===2||g)&&f.preventDefault()}),onFocusOutside:je(a.onFocusOutside,f=>f.preventDefault())})},"DialogContentModal")),WD=h.forwardRef(Qn(function(a,l){const o=Na(li,a.__scopeDialog),c=h.useRef(!1),u=h.useRef(!1);return s.jsx(Tw,{...a,ref:l,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:f=>{var p,g;(p=a.onCloseAutoFocus)==null||p.call(a,f),f.defaultPrevented||(c.current||(g=o.triggerRef.current)==null||g.focus(),f.preventDefault()),c.current=!1,u.current=!1},onInteractOutside:f=>{var v,x;(v=a.onInteractOutside)==null||v.call(a,f),f.defaultPrevented||(c.current=!0,f.detail.originalEvent.type==="pointerdown"&&(u.current=!0));const p=f.target;((x=o.triggerRef.current)==null?void 0:x.contains(p))&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&u.current&&f.preventDefault()}})},"DialogContentNonModal")),Tw=h.forwardRef(Qn(function(a,l){const{__scopeDialog:o,trapFocus:c,onOpenAutoFocus:u,onCloseAutoFocus:f,...p}=a,g=Na(li,o);return xi(),s.jsx(s.Fragment,{children:s.jsx(Pm,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:u,onUnmountAutoFocus:f,children:s.jsx(Tu,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionPresent?g.descriptionId:void 0,"aria-labelledby":g.titlePresent?g.titleId:void 0,"data-state":Hu(g.open),...p,ref:l,deferPointerDownOutside:!0,onDismiss:()=>g.onOpenChange(!1)})})})},"DialogContentImpl")),eO="DialogTitle",op=h.forwardRef(Qn(function(a,l){const{__scopeDialog:o,...c}=a,u=Na(eO,o),{setTitleCount:f}=u;return Yt(()=>(f(p=>p+1),()=>f(p=>p-1)),[f]),s.jsx(Pe.h2,{id:u.titleId,...c,ref:l})},"DialogTitle")),tO="DialogDescription",ip=h.forwardRef(Qn(function(a,l){const{__scopeDialog:o,...c}=a,u=Na(tO,o),{setDescriptionCount:f}=u;return Yt(()=>(f(p=>p+1),()=>f(p=>p-1)),[f]),s.jsx(Pe.p,{id:u.descriptionId,...c,ref:l})},"DialogDescription")),nO="DialogClose",cp=h.forwardRef(Qn(function(a,l){const{__scopeDialog:o,...c}=a,u=Na(nO,o);return s.jsx(Pe.button,{type:"button",...c,ref:l,onClick:je(a.onClick,()=>u.onOpenChange(!1))})},"DialogClose"));function Hu(n){return n?"open":"closed"}Qn(Hu,"getState");const vn=jw,bi=Cw,aO=Rw,Aw=h.forwardRef(({className:n,...a},l)=>s.jsx(lp,{ref:l,className:Ee("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",n),...a}));Aw.displayName=lp.displayName;const un=h.forwardRef(({className:n,children:a,...l},o)=>s.jsxs(aO,{children:[s.jsx(Aw,{}),s.jsxs(sp,{ref:o,className:Ee("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",n),...l,children:[a,s.jsxs(cp,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",children:[s.jsx(Eu,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));un.displayName=sp.displayName;const dn=({className:n,...a})=>s.jsx("div",{className:Ee("flex flex-col space-y-1.5 text-center sm:text-left",n),...a});dn.displayName="DialogHeader";const fn=({className:n,...a})=>s.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...a});fn.displayName="DialogFooter";const hn=h.forwardRef(({className:n,...a},l)=>s.jsx(op,{ref:l,className:Ee("text-lg font-semibold leading-none tracking-tight",n),...a}));hn.displayName=op.displayName;const zl=h.forwardRef(({className:n,...a},l)=>s.jsx(ip,{ref:l,className:Ee("text-sm text-muted-foreground",n),...a}));zl.displayName=ip.displayName;var rO=Object.defineProperty,Cr=(n,a)=>rO(n,"name",{value:a,configurable:!0}),lO="AlertDialog",[sO,t5]=_n(lO,[Sw]),Er=Sw(),oO=Cr(n=>{const{__scopeAlertDialog:a,...l}=n,o=Er(a);return s.jsx(jw,{...o,...l,modal:!0})},"AlertDialog"),iO=h.forwardRef(Cr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Er(o);return s.jsx(Cw,{...u,...c,ref:l})},"AlertDialogTrigger")),cO=Cr(n=>{const{__scopeAlertDialog:a,...l}=n,o=Er(a);return s.jsx(Rw,{...o,...l})},"AlertDialogPortal"),uO=h.forwardRef(Cr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Er(o);return s.jsx(lp,{...u,...c,ref:l})},"AlertDialogOverlay")),dO="AlertDialogContent",[fO,hO]=sO(dO),mO=h.forwardRef(Cr(function(a,l){const{__scopeAlertDialog:o,children:c,...u}=a,f=Er(o),p=h.useRef(null),g=Ye(l,p),v=h.useRef(null);return s.jsx(fO,{scope:o,cancelRef:v,children:s.jsx(sp,{role:"alertdialog",...f,...u,ref:g,onOpenAutoFocus:je(u.onOpenAutoFocus,x=>{var y;x.preventDefault(),(y=v.current)==null||y.focus({preventScroll:!0})}),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault(),children:c})})},"AlertDialogContent")),pO=h.forwardRef(Cr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Er(o);return s.jsx(op,{...u,...c,ref:l})},"AlertDialogTitle")),gO=h.forwardRef(Cr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Er(o);return s.jsx(ip,{...u,...c,ref:l})},"AlertDialogDescription")),vO=h.forwardRef(Cr(function(a,l){const{__scopeAlertDialog:o,...c}=a,u=Er(o);return s.jsx(cp,{...u,...c,ref:l})},"AlertDialogAction")),xO="AlertDialogCancel",yO=h.forwardRef(Cr(function(a,l){const{__scopeAlertDialog:o,...c}=a,{cancelRef:u}=hO(xO,o),f=Er(o),p=Ye(l,u);return s.jsx(cp,{...f,...c,ref:p})},"AlertDialogCancel")),bO=oO,wO=iO,SO=cO,Mw=uO,Dw=mO,Ow=vO,_w=yO,kw=pO,zw=gO;const Lw=bO,jO=wO,CO=SO,Uw=h.forwardRef(({className:n,...a},l)=>s.jsx(Mw,{ref:l,className:Ee("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",n),...a}));Uw.displayName=Mw.displayName;const up=h.forwardRef(({className:n,...a},l)=>s.jsxs(CO,{children:[s.jsx(Uw,{}),s.jsx(Dw,{ref:l,className:Ee("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]",n),...a})]}));up.displayName=Dw.displayName;const Iw=({className:n,...a})=>s.jsx("div",{className:Ee("flex flex-col space-y-2 text-center sm:text-left",n),...a}),Bw=({className:n,...a})=>s.jsx("div",{className:Ee("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",n),...a}),dp=h.forwardRef(({className:n,...a},l)=>s.jsx(kw,{ref:l,className:Ee("text-lg font-semibold",n),...a}));dp.displayName=kw.displayName;const fp=h.forwardRef(({className:n,...a},l)=>s.jsx(zw,{ref:l,className:Ee("text-sm text-muted-foreground",n),...a}));fp.displayName=zw.displayName;const hp=h.forwardRef(({className:n,...a},l)=>s.jsx(Ow,{ref:l,className:Ee("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",n),...a}));hp.displayName=Ow.displayName;const mp=h.forwardRef(({className:n,...a},l)=>s.jsx(_w,{ref:l,className:Ee("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",n),...a}));mp.displayName=_w.displayName;var EO=Object.defineProperty,NO=(n,a)=>EO(n,"name",{value:a,configurable:!0});function rm(n,[a,l]){return Math.min(l,Math.max(a,n))}NO(rm,"clamp");var RO=Object.defineProperty,TO=(n,a)=>RO(n,"name",{value:a,configurable:!0});function Pw(n){const a=h.useRef({value:n,previous:n});return h.useMemo(()=>(a.current.value!==n&&(a.current.previous=a.current.value,a.current.value=n),a.current.previous),[n])}TO(Pw,"usePrevious");var AO=Object.defineProperty,MO=(n,a)=>AO(n,"name",{value:a,configurable:!0}),Hw=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"}),DO=h.forwardRef(MO(function(a,l){return s.jsx(Pe.span,{...a,ref:l,style:{...Hw,...a.style}})},"VisuallyHidden")),OO=DO,_O=Object.defineProperty,mt=(n,a)=>_O(n,"name",{value:a,configurable:!0}),kO=[" ","Enter","ArrowUp","ArrowDown"],zO=[" ","Enter"],qs="Select",[qu,pp,LO]=Ru(qs),[ql,n5]=_n(qs,[LO,Zs]),gp=Zs(),[UO,cl]=ql(qs),[IO,BO]=ql(qs);function qw(n){const{__scopeSelect:a,children:l,open:o,defaultOpen:c,onOpenChange:u,value:f,defaultValue:p,onValueChange:g,dir:v,name:x,autoComplete:y,disabled:b,required:w,form:E,internal_do_not_use_render:j}=n,C=gp(a),[R,D]=h.useState(null),[A,M]=h.useState(null),[O,N]=h.useState(!1),_=vi(v),[U,V]=La({prop:o,defaultProp:c??!1,onChange:u,caller:qs}),[te,q]=La({prop:f,defaultProp:p,onChange:g,caller:qs}),G=h.useRef(null),B=h.useRef(te);h.useEffect(()=>{const H=E?R==null?void 0:R.ownerDocument.getElementById(E):R==null?void 0:R.form;if(H instanceof HTMLFormElement){const Z=mt(()=>q(B.current),"reset");return H.addEventListener("reset",Z),()=>H.removeEventListener("reset",Z)}},[E,R,q]);const F=R?!!E||!!R.closest("form"):!0,[ce,k]=h.useState(new Set),$=ja(),ee=Array.from(ce).map(H=>H.props.value).join(";"),I=h.useCallback(H=>{k(Z=>new Set(Z).add(H))},[]),W=h.useCallback(H=>{k(Z=>{const re=new Set(Z);return re.delete(H),re})},[]),z={required:w,trigger:R,onTriggerChange:D,valueNode:A,onValueNodeChange:M,valueNodeHasChildren:O,onValueNodeHasChildrenChange:N,contentId:$,value:te,onValueChange:q,open:U,onOpenChange:V,dir:_,triggerPointerDownPosRef:G,disabled:b,name:x,autoComplete:y,form:E,nativeOptions:ce,nativeSelectKey:ee,isFormControl:F};return s.jsx(Xm,{...C,children:s.jsx(UO,{scope:a,...z,children:s.jsx(qu.Provider,{scope:a,children:s.jsx(IO,{scope:a,onNativeOptionAdd:I,onNativeOptionRemove:W,children:Xw(j)?j(z):l})})})})}mt(qw,"SelectProvider");var PO=mt(n=>{const{__scopeSelect:a,children:l,...o}=n;return s.jsx(qw,{__scopeSelect:a,...o,internal_do_not_use_render:({isFormControl:c})=>s.jsxs(s.Fragment,{children:[l,c?s.jsx(i3,{__scopeSelect:a}):null]})})},"Select"),HO="SelectTrigger",$w=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,disabled:c=!1,...u}=a,f=gp(o),p=cl(HO,o),g=p.disabled||c,v=Ye(l,p.onTriggerChange),x=pp(o),y=h.useRef("touch"),[b,w,E]=vp(C=>{const R=x().filter(M=>!M.disabled),D=R.find(M=>M.value===p.value),A=xp(R,C,D);A!==void 0&&p.onValueChange(A.value)}),j=mt(C=>{g||(p.onOpenChange(!0),E()),C&&(p.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})},"handleOpen");return s.jsx(Fm,{asChild:!0,...f,children:s.jsx(Pe.button,{type:"button",role:"combobox","aria-controls":p.open?p.contentId:void 0,"aria-expanded":p.open,"aria-required":p.required,"aria-autocomplete":"none",dir:p.dir,"data-state":p.open?"open":"closed",disabled:g,"data-disabled":g?"":void 0,"data-placeholder":wi(p.value)?"":void 0,...u,ref:v,onClick:je(u.onClick,C=>{C.currentTarget.focus(),y.current!=="mouse"&&j(C)}),onPointerDown:je(u.onPointerDown,C=>{y.current=C.pointerType;const R=C.target;R.hasPointerCapture(C.pointerId)&&R.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(j(C),C.preventDefault())}),onKeyDown:je(u.onKeyDown,C=>{const R=b.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&w(C.key),!(R&&C.key===" ")&&kO.includes(C.key)&&(j(),C.preventDefault())})})})},"SelectTrigger")),qO="SelectValue",$O=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,className:c,style:u,children:f,placeholder:p="",...g}=a,v=cl(qO,o),{onValueNodeHasChildrenChange:x}=v,y=f!==void 0,b=Ye(l,v.onValueNodeChange);Yt(()=>{x(y)},[x,y]);const w=wi(v.value);return s.jsx(Pe.span,{...g,asChild:w?!1:g.asChild,ref:b,style:{pointerEvents:"none"},children:s.jsx(h.Fragment,{children:w?p:f},w?"placeholder":"value")})},"SelectValue")),VO=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,children:c,...u}=a;return s.jsx(Pe.span,{"aria-hidden":!0,...u,ref:l,children:c||"▼"})},"SelectIcon")),YO="SelectPortal",[GO,KO]=ql(YO,{forceMount:void 0}),XO=mt(n=>{const{__scopeSelect:a,forceMount:l,...o}=n;return s.jsx(GO,{scope:n.__scopeSelect,forceMount:l,children:s.jsx(Zm,{asChild:!0,...o})})},"SelectPortal"),Ll="SelectContent",Vw=h.forwardRef(mt(function(a,l){const o=KO(Ll,a.__scopeSelect),{forceMount:c=o.forceMount,...u}=a,f=cl(Ll,a.__scopeSelect),[p,g]=h.useState();return Yt(()=>{g(new DocumentFragment)},[]),s.jsx(jr,{present:c||f.open,children:({present:v})=>v?s.jsx(ZO,{...u,ref:l}):s.jsx(FO,{...u,fragment:p})})},"SelectContent")),FO=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,children:c,fragment:u}=a;return u?wa.createPortal(s.jsx(Yw,{scope:o,children:s.jsx(qu.Slot,{scope:o,children:s.jsx("div",{ref:l,children:c})})}),u):null},"SelectContentFragment")),ba=10,[Yw,$u]=ql(Ll),QO=za("SelectContent.RemoveScroll"),ZO=h.forwardRef(mt(function(a,l){const{__scopeSelect:o}=a,{position:c="item-aligned",onCloseAutoFocus:u,onEscapeKeyDown:f,onPointerDownOutside:p,side:g,sideOffset:v,align:x,alignOffset:y,arrowPadding:b,collisionBoundary:w,collisionPadding:E,sticky:j,hideWhenDetached:C,avoidCollisions:R,...D}=a,A=cl(Ll,o),[M,O]=h.useState(null),[N,_]=h.useState(null),U=Ye(l,O),[V,te]=h.useState(null),[q,G]=h.useState(null),B=pp(o),[F,ce]=h.useState(!1),k=h.useRef(!1);h.useEffect(()=>{if(M)return ep(M)},[M]),xi();const $=h.useCallback(de=>{const[ve,...fe]=B().map(_e=>_e.ref.current),[De]=fe.slice(-1),Ne=document.activeElement;for(const _e of de)if(_e===Ne||(_e==null||_e.scrollIntoView({block:"nearest"}),_e===ve&&N&&(N.scrollTop=0),_e===De&&N&&(N.scrollTop=N.scrollHeight),_e==null||_e.focus(),document.activeElement!==Ne))return},[B,N]),ee=h.useCallback(()=>$([V,M]),[$,V,M]);h.useEffect(()=>{F&&ee()},[F,ee]);const{onOpenChange:I,triggerPointerDownPosRef:W}=A;h.useEffect(()=>{if(M){let de={x:0,y:0};const ve=mt(De=>{var Ne,_e;de={x:Math.abs(Math.round(De.pageX)-(((Ne=W.current)==null?void 0:Ne.x)??0)),y:Math.abs(Math.round(De.pageY)-(((_e=W.current)==null?void 0:_e.y)??0))}},"handlePointerMove"),fe=mt(De=>{de.x<=10&&de.y<=10?De.preventDefault():De.composedPath().includes(M)||I(!1),document.removeEventListener("pointermove",ve),W.current=null},"handlePointerUp");return W.current!==null&&(document.addEventListener("pointermove",ve),document.addEventListener("pointerup",fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ve),document.removeEventListener("pointerup",fe,{capture:!0})}}},[M,I,W]),h.useEffect(()=>{const de=mt(()=>I(!1),"close");return window.addEventListener("blur",de),window.addEventListener("resize",de),()=>{window.removeEventListener("blur",de),window.removeEventListener("resize",de)}},[I]);const[z,H]=vp(de=>{const ve=B().filter(Ne=>!Ne.disabled),fe=ve.find(Ne=>Ne.ref.current===document.activeElement),De=xp(ve,de,fe);De&&setTimeout(()=>{var Ne;return(Ne=De.ref.current)==null?void 0:Ne.focus()})}),Z=h.useCallback((de,ve,fe)=>{const De=!k.current&&!fe;(A.value!==void 0&&A.value===ve||De)&&(te(de),De&&(k.current=!0))},[A.value]),re=h.useCallback(()=>M==null?void 0:M.focus(),[M]),he=h.useCallback((de,ve,fe)=>{const De=!k.current&&!fe;(A.value!==void 0&&A.value===ve||De)&&G(de)},[A.value]),ye=c==="popper"?Rb:JO,pe=ye===Rb?{side:g,sideOffset:v,align:x,alignOffset:y,arrowPadding:b,collisionBoundary:w,collisionPadding:E,sticky:j,hideWhenDetached:C,avoidCollisions:R}:{};return s.jsx(Yw,{scope:o,content:M,viewport:N,onViewportChange:_,itemRefCallback:Z,selectedItem:V,onItemLeave:re,itemTextRefCallback:he,focusSelectedItem:ee,selectedItemText:q,position:c,isPositioned:F,searchRef:z,children:s.jsx(Bu,{as:QO,allowPinchZoom:!0,children:s.jsx(Pm,{asChild:!0,trapped:A.open,onMountAutoFocus:de=>{de.preventDefault()},onUnmountAutoFocus:je(u,de=>{var ve;(ve=A.trigger)==null||ve.focus({preventScroll:!0}),de.preventDefault()}),children:s.jsx(Tu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:de=>de.preventDefault(),onDismiss:()=>A.onOpenChange(!1),children:s.jsx(ye,{role:"listbox",id:A.contentId,"data-state":A.open?"open":"closed",dir:A.dir,onContextMenu:de=>de.preventDefault(),...D,...pe,onPlaced:()=>ce(!0),ref:U,style:{display:"flex",flexDirection:"column",outline:"none",...D.style},onKeyDown:je(D.onKeyDown,de=>{const ve=de.ctrlKey||de.altKey||de.metaKey;if(de.key==="Tab"&&de.preventDefault(),!ve&&de.key.length===1&&H(de.key),["ArrowUp","ArrowDown","Home","End"].includes(de.key)){let De=B().filter(Ne=>!Ne.disabled).map(Ne=>Ne.ref.current);if(["ArrowUp","End"].includes(de.key)&&(De=De.slice().reverse()),["ArrowUp","ArrowDown"].includes(de.key)){const Ne=de.target,_e=De.indexOf(Ne);De=De.slice(_e+1)}setTimeout(()=>$(De)),de.preventDefault()}})})})})})})},"SelectContentImpl")),JO=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,onPlaced:c,...u}=a,f=cl(Ll,o),p=$u(Ll,o),[g,v]=h.useState(null),[x,y]=h.useState(null),b=Ye(l,y),w=pp(o),E=h.useRef(!1),j=h.useRef(!0),{viewport:C,selectedItem:R,selectedItemText:D,focusSelectedItem:A}=p,M=h.useCallback(()=>{if(f.trigger&&f.valueNode&&g&&x&&C&&R&&D){const U=f.trigger.getBoundingClientRect(),V=x.getBoundingClientRect(),te=f.valueNode.getBoundingClientRect(),q=D.getBoundingClientRect();if(f.dir!=="rtl"){const Ne=q.left-V.left,_e=te.left-Ne,Fe=U.left-_e,We=U.width+Fe,se=Math.max(We,V.width),Oe=window.innerWidth-ba,Qe=rm(_e,[ba,Math.max(ba,Oe-se)]);g.style.minWidth=We+"px",g.style.left=Qe+"px"}else{const Ne=V.right-q.right,_e=window.innerWidth-te.right-Ne,Fe=window.innerWidth-U.right-_e,We=U.width+Fe,se=Math.max(We,V.width),Oe=window.innerWidth-ba,Qe=rm(_e,[ba,Math.max(ba,Oe-se)]);g.style.minWidth=We+"px",g.style.right=Qe+"px"}const G=w(),B=window.innerHeight-ba*2,F=C.scrollHeight,ce=window.getComputedStyle(x),k=parseInt(ce.borderTopWidth,10),$=parseInt(ce.paddingTop,10),ee=parseInt(ce.borderBottomWidth,10),I=parseInt(ce.paddingBottom,10),W=k+$+F+I+ee,z=Math.min(R.offsetHeight*5,W),H=window.getComputedStyle(C),Z=parseInt(H.paddingTop,10),re=parseInt(H.paddingBottom,10),he=U.top+U.height/2-ba,ye=B-he,pe=R.offsetHeight/2,de=R.offsetTop+pe,ve=k+$+de,fe=W-ve;if(ve<=he){const Ne=G.length>0&&R===G[G.length-1].ref.current;g.style.bottom="0px";const _e=x.clientHeight-C.offsetTop-C.offsetHeight,Fe=Math.max(ye,pe+(Ne?re:0)+_e+ee),We=ve+Fe;g.style.height=We+"px"}else{const Ne=G.length>0&&R===G[0].ref.current;g.style.top="0px";const Fe=Math.max(he,k+C.offsetTop+(Ne?Z:0)+pe)+fe;g.style.height=Fe+"px",C.scrollTop=ve-he+C.offsetTop}g.style.margin=`${ba}px 0`,g.style.minHeight=z+"px",g.style.maxHeight=B+"px",c==null||c(),requestAnimationFrame(()=>E.current=!0)}},[w,f.trigger,f.valueNode,g,x,C,R,D,f.dir,c]);Yt(()=>M(),[M]);const[O,N]=h.useState();Yt(()=>{x&&N(window.getComputedStyle(x).zIndex)},[x]);const _=h.useCallback(U=>{U&&j.current===!0&&(M(),A==null||A(),j.current=!1)},[M,A]);return s.jsx(WO,{scope:o,contentWrapper:g,shouldExpandOnScrollRef:E,onScrollButtonChange:_,children:s.jsx("div",{ref:v,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:s.jsx(Pe.div,{...u,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...u.style}})})})},"SelectItemAlignedPosition")),Rb=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,align:c="start",collisionPadding:u=ba,...f}=a,p=gp(o);return s.jsx(Qm,{...p,...f,ref:l,align:c,collisionPadding:u,style:{boxSizing:"border-box",...f.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")),[WO,e3]=ql(Ll,{}),Tb="SelectViewport",t3=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,nonce:c,...u}=a,f=$u(Tb,o),p=e3(Tb,o),g=Ye(l,f.onViewportChange),v=h.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:c}),s.jsx(qu.Slot,{scope:o,children:s.jsx(Pe.div,{"data-radix-select-viewport":"",role:"presentation",...u,ref:g,style:{position:"relative",flex:1,overflow:"hidden auto",...u.style},onScroll:je(u.onScroll,x=>{const y=x.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:w}=p;if(w!=null&&w.current&&b){const E=Math.abs(v.current-y.scrollTop);if(E>0){const j=window.innerHeight-ba*2,C=parseFloat(b.style.minHeight),R=parseFloat(b.style.height),D=Math.max(C,R);if(D<j){const A=D+E,M=Math.min(j,A),O=A-M;b.style.height=M+"px",b.style.bottom==="0px"&&(y.scrollTop=O>0?O:0,b.style.justifyContent="flex-end")}}}v.current=y.scrollTop})})})]})},"SelectViewport")),n3="SelectGroup",[a5,r5]=ql(n3),lm="SelectItem",[a3,Gw]=ql(lm),Kw=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,value:c,disabled:u=!1,textValue:f,...p}=a,g=cl(lm,o),v=$u(lm,o),x=g.value===c,[y,b]=h.useState(f??""),[w,E]=h.useState(!1),j=ha(M=>{var O;return(O=v.itemRefCallback)==null?void 0:O.call(v,M,c,u)}),C=Ye(l,j),R=ja(),D=h.useRef("touch"),A=mt(()=>{u||(g.onValueChange(c),g.onOpenChange(!1))},"handleSelect");return s.jsx(a3,{scope:o,value:c,disabled:u,textId:R,isSelected:x,onItemTextChange:h.useCallback(M=>{b(O=>O||((M==null?void 0:M.textContent)??"").trim())},[]),children:s.jsx(qu.ItemSlot,{scope:o,value:c,disabled:u,textValue:y,children:s.jsx(Pe.div,{role:"option","aria-labelledby":R,"data-highlighted":w?"":void 0,"aria-selected":x&&w,"data-state":x?"checked":"unchecked","aria-disabled":u||void 0,"data-disabled":u?"":void 0,tabIndex:u?void 0:-1,...p,ref:C,onFocus:je(p.onFocus,()=>E(!0)),onBlur:je(p.onBlur,()=>E(!1)),onClick:je(p.onClick,()=>{D.current!=="mouse"&&A()}),onPointerUp:je(p.onPointerUp,()=>{D.current==="mouse"&&A()}),onPointerDown:je(p.onPointerDown,M=>{D.current=M.pointerType}),onPointerMove:je(p.onPointerMove,M=>{var O;D.current=M.pointerType,u?(O=v.onItemLeave)==null||O.call(v):D.current==="mouse"&&M.currentTarget.focus({preventScroll:!0})}),onPointerLeave:je(p.onPointerLeave,M=>{var O;M.currentTarget===document.activeElement&&((O=v.onItemLeave)==null||O.call(v))}),onKeyDown:je(p.onKeyDown,M=>{var N;u||M.target!==M.currentTarget||((N=v.searchRef)==null?void 0:N.current)!==""&&M.key===" "||(zO.includes(M.key)&&A(),M.key===" "&&M.preventDefault())})})})})},"SelectItem")),Gc="SelectItemText",r3=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,className:c,style:u,...f}=a,p=cl(Gc,o),g=$u(Gc,o),v=Gw(Gc,o),x=BO(Gc,o),[y,b]=h.useState(null),w=ha(A=>{var M;return(M=g.itemTextRefCallback)==null?void 0:M.call(g,A,v.value,v.disabled)}),E=Ye(l,b,v.onItemTextChange,w),j=y==null?void 0:y.textContent,C=h.useMemo(()=>s.jsx("option",{value:v.value,disabled:v.disabled,children:j},v.value),[v.disabled,v.value,j]),{onNativeOptionAdd:R,onNativeOptionRemove:D}=x;return Yt(()=>(R(C),()=>D(C)),[R,D,C]),s.jsxs(s.Fragment,{children:[s.jsx(Pe.span,{id:v.textId,...f,ref:E}),v.isSelected&&p.valueNode&&!p.valueNodeHasChildren&&!wi(p.value)?wa.createPortal(f.children,p.valueNode):null]})},"SelectItemText")),l3="SelectItemIndicator",s3=h.forwardRef(mt(function(a,l){const{__scopeSelect:o,...c}=a;return Gw(l3,o).isSelected?s.jsx(Pe.span,{"aria-hidden":!0,...c,ref:l}):null},"SelectItemIndicator")),o3="SelectBubbleInput",i3=h.forwardRef(mt(function({__scopeSelect:a,...l},o){const c=cl(o3,a),{value:u,onValueChange:f,required:p,disabled:g,name:v,autoComplete:x,form:y}=c,{nativeOptions:b,nativeSelectKey:w}=c,E=h.useRef(null),j=Ye(o,E),C=u??"",R=Pw(C),D=Array.from(b).some(A=>(A.props.value??"")==="");return h.useEffect(()=>{const A=E.current;if(!A)return;const M=window.HTMLSelectElement.prototype,N=Object.getOwnPropertyDescriptor(M,"value").set;if(R!==C&&N){const _=new Event("change",{bubbles:!0});N.call(A,C),A.dispatchEvent(_)}},[R,C]),s.jsxs(Pe.select,{"aria-hidden":!0,required:p,tabIndex:-1,name:v,autoComplete:x,disabled:g,form:y,onChange:A=>f(A.target.value),...l,style:{...Hw,...l.style},ref:j,defaultValue:C,children:[wi(u)&&!D?s.jsx("option",{value:""}):null,Array.from(b)]},w)},"SelectBubbleInput"));function Xw(n){return typeof n=="function"}mt(Xw,"isFunction");function wi(n){return n===""||n===void 0}mt(wi,"shouldShowPlaceholder");function vp(n){const a=ha(n),l=h.useRef(""),o=h.useRef(0),c=h.useCallback(f=>{const p=l.current+f;a(p),mt((function g(v){l.current=v,window.clearTimeout(o.current),v!==""&&(o.current=window.setTimeout(()=>g(""),1e3))}),"updateSearch")(p)},[a]),u=h.useCallback(()=>{l.current="",window.clearTimeout(o.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(o.current),[]),[l,c,u]}mt(vp,"useTypeaheadSearch");function xp(n,a,l){const c=a.length>1&&Array.from(a).every(v=>v===a[0])?a[0]:a,u=l?n.indexOf(l):-1;let f=Fw(n,Math.max(u,0));c.length===1&&(f=f.filter(v=>v!==l));const g=f.find(v=>v.textValue.toLowerCase().startsWith(c.toLowerCase()));return g!==l?g:void 0}mt(xp,"findNextItem");function Fw(n,a){return n.map((l,o)=>n[(a+o)%n.length])}mt(Fw,"wrapArray");const Vn=PO,Yn=$O,Mn=h.forwardRef(({className:n,children:a,...l},o)=>s.jsxs($w,{ref:o,className:Ee("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",n),...l,children:[a,s.jsx(VO,{asChild:!0,children:s.jsx(E0,{className:"h-4 w-4 opacity-50"})})]}));Mn.displayName=$w.displayName;const Dn=h.forwardRef(({className:n,children:a,position:l="popper",...o},c)=>s.jsx(XO,{children:s.jsx(Vw,{ref:c,className:Ee("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",n),position:l,...o,children:s.jsx(t3,{className:Ee("p-1",l==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:a})})}));Dn.displayName=Vw.displayName;const tt=h.forwardRef(({className:n,children:a,...l},o)=>s.jsxs(Kw,{ref:o,className:Ee("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",n),...l,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(s3,{children:s.jsx(Mm,{className:"h-4 w-4"})})}),s.jsx(r3,{children:a})]}));tt.displayName=Kw.displayName;var c3=Object.defineProperty,ol=(n,a)=>c3(n,"name",{value:a,configurable:!0}),yp="Switch",[u3,l5]=_n(yp),[d3,bp]=u3(yp);function Qw(n){const{__scopeSwitch:a,checked:l,children:o,defaultChecked:c,disabled:u,form:f,name:p,onCheckedChange:g,required:v,value:x="on",internal_do_not_use_render:y}=n,[b,w]=La({prop:l,defaultProp:c??!1,onChange:g,caller:yp}),[E,j]=h.useState(null),[C,R]=h.useState(null),D=h.useRef(!1),[A,M]=h.useReducer(_=>_+1,0),O=E?!!f||!!E.closest("form"):!0,N={checked:b,setChecked:w,disabled:u,control:E,setControl:j,name:p,form:f,value:x,hasConsumerStoppedPropagationRef:D,userInteractionCount:A,onUserInteraction:M,required:v,defaultChecked:c,isFormControl:O,bubbleInput:C,setBubbleInput:R};return s.jsx(d3,{scope:a,...N,children:Jw(y)?y(N):o})}ol(Qw,"SwitchProvider");var f3="SwitchTrigger",h3=h.forwardRef(ol(function({__scopeSwitch:a,onClick:l,...o},c){const{control:u,form:f,value:p,disabled:g,checked:v,required:x,setControl:y,setChecked:b,hasConsumerStoppedPropagationRef:w,onUserInteraction:E,isFormControl:j,bubbleInput:C}=bp(f3,a),R=Ye(c,y),D=h.useRef(v);return h.useEffect(()=>{const A=f?u==null?void 0:u.ownerDocument.getElementById(f):u==null?void 0:u.form;if(A instanceof HTMLFormElement){const M=ol(()=>b(D.current),"reset");return A.addEventListener("reset",M),()=>A.removeEventListener("reset",M)}},[u,f,b]),s.jsx(Pe.button,{type:"button",role:"switch","aria-checked":v,"aria-required":x,"data-state":wp(v),"data-disabled":g?"":void 0,disabled:g,value:p,...o,ref:R,onClick:je(l,A=>{E(),b(M=>!M),C&&j&&(w.current=A.isPropagationStopped(),w.current||A.stopPropagation())})})},"SwitchTrigger")),Zw=h.forwardRef(ol(function(a,l){const{__scopeSwitch:o,name:c,checked:u,defaultChecked:f,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...b}=a;return s.jsx(Qw,{__scopeSwitch:o,checked:u,defaultChecked:f,disabled:g,required:p,onCheckedChange:x,name:c,form:y,value:v,internal_do_not_use_render:({isFormControl:w})=>s.jsxs(s.Fragment,{children:[s.jsx(h3,{...b,ref:l,__scopeSwitch:o}),w&&s.jsx(v3,{__scopeSwitch:o})]})})},"Switch")),m3="SwitchThumb",p3=h.forwardRef(ol(function(a,l){const{__scopeSwitch:o,...c}=a,u=bp(m3,o);return s.jsx(Pe.span,{"data-state":wp(u.checked),"data-disabled":u.disabled?"":void 0,...c,ref:l})},"SwitchThumb")),g3="SwitchBubbleInput",v3=h.forwardRef(ol(function({__scopeSwitch:a,onClick:l,...o},c){const{control:u,hasConsumerStoppedPropagationRef:f,userInteractionCount:p,checked:g,defaultChecked:v,required:x,disabled:y,name:b,value:w,form:E,bubbleInput:j,setBubbleInput:C}=bp(g3,a),R=Ye(c,C),D=ku(u),A=h.useRef(!1),M=h.useRef(g),O=h.useRef(p);h.useEffect(()=>{const _=j;if(!_)return;const U=window.HTMLInputElement.prototype,te=Object.getOwnPropertyDescriptor(U,"checked").set,q=p!==O.current;O.current=p;const G=M.current!==g;M.current=g;const B=!(q&&f.current);if(G&&te){A.current=!q;const F=new Event("click",{bubbles:B});te.call(_,g),_.dispatchEvent(F),A.current=!1}},[j,g,f,p]);const N=h.useRef(g);return s.jsx(Pe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??N.current,required:x,disabled:y,name:b,value:w,form:E,...o,tabIndex:-1,ref:R,onClick:je(l,_=>{A.current&&_.stopPropagation()}),style:{...o.style,...D,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function Jw(n){return typeof n=="function"}ol(Jw,"isFunction");function wp(n){return n?"checked":"unchecked"}ol(wp,"getState");const Ba=h.forwardRef(({className:n,...a},l)=>s.jsx(Zw,{className:Ee("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",n),...a,ref:l,children:s.jsx(p3,{className:Ee("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")})}));Ba.displayName=Zw.displayName;function x3(){for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return h.useMemo(()=>o=>{a.forEach(c=>c(o))},a)}const Vu=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Js(n){const a=Object.prototype.toString.call(n);return a==="[object Window]"||a==="[object global]"}function Sp(n){return"nodeType"in n}function kn(n){var a,l;return n?Js(n)?n:Sp(n)&&(a=(l=n.ownerDocument)==null?void 0:l.defaultView)!=null?a:window:window}function jp(n){const{Document:a}=kn(n);return n instanceof a}function Si(n){return Js(n)?!1:n instanceof kn(n).HTMLElement}function Ww(n){return n instanceof kn(n).SVGElement}function Ws(n){return n?Js(n)?n.document:Sp(n)?jp(n)?n:Si(n)||Ww(n)?n.ownerDocument:document:document:document}const Pa=Vu?h.useLayoutEffect:h.useEffect;function Cp(n){const a=h.useRef(n);return Pa(()=>{a.current=n}),h.useCallback(function(){for(var l=arguments.length,o=new Array(l),c=0;c<l;c++)o[c]=arguments[c];return a.current==null?void 0:a.current(...o)},[])}function y3(){const n=h.useRef(null),a=h.useCallback((o,c)=>{n.current=setInterval(o,c)},[]),l=h.useCallback(()=>{n.current!==null&&(clearInterval(n.current),n.current=null)},[]);return[a,l]}function si(n,a){a===void 0&&(a=[n]);const l=h.useRef(n);return Pa(()=>{l.current!==n&&(l.current=n)},a),l}function ji(n,a){const l=h.useRef();return h.useMemo(()=>{const o=n(l.current);return l.current=o,o},[...a])}function mu(n){const a=Cp(n),l=h.useRef(null),o=h.useCallback(c=>{c!==l.current&&(a==null||a(c,l.current)),l.current=c},[]);return[l,o]}function sm(n){const a=h.useRef();return h.useEffect(()=>{a.current=n},[n]),a.current}let Ah={};function Ci(n,a){return h.useMemo(()=>{if(a)return a;const l=Ah[n]==null?0:Ah[n]+1;return Ah[n]=l,n+"-"+l},[n,a])}function eS(n){return function(a){for(var l=arguments.length,o=new Array(l>1?l-1:0),c=1;c<l;c++)o[c-1]=arguments[c];return o.reduce((u,f)=>{const p=Object.entries(f);for(const[g,v]of p){const x=u[g];x!=null&&(u[g]=x+n*v)}return u},{...a})}}const Hs=eS(1),oi=eS(-1);function b3(n){return"clientX"in n&&"clientY"in n}function Ep(n){if(!n)return!1;const{KeyboardEvent:a}=kn(n.target);return a&&n instanceof a}function w3(n){if(!n)return!1;const{TouchEvent:a}=kn(n.target);return a&&n instanceof a}function om(n){if(w3(n)){if(n.touches&&n.touches.length){const{clientX:a,clientY:l}=n.touches[0];return{x:a,y:l}}else if(n.changedTouches&&n.changedTouches.length){const{clientX:a,clientY:l}=n.changedTouches[0];return{x:a,y:l}}}return b3(n)?{x:n.clientX,y:n.clientY}:null}const pu=Object.freeze({Translate:{toString(n){if(!n)return;const{x:a,y:l}=n;return"translate3d("+(a?Math.round(a):0)+"px, "+(l?Math.round(l):0)+"px, 0)"}},Scale:{toString(n){if(!n)return;const{scaleX:a,scaleY:l}=n;return"scaleX("+a+") scaleY("+l+")"}},Transform:{toString(n){if(n)return[pu.Translate.toString(n),pu.Scale.toString(n)].join(" ")}},Transition:{toString(n){let{property:a,duration:l,easing:o}=n;return a+" "+l+"ms "+o}}}),Ab="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function S3(n){return n.matches(Ab)?n:n.querySelector(Ab)}const j3={display:"none"};function C3(n){let{id:a,value:l}=n;return ie.createElement("div",{id:a,style:j3},l)}function E3(n){let{id:a,announcement:l,ariaLiveType:o="assertive"}=n;const c={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return ie.createElement("div",{id:a,style:c,role:"status","aria-live":o,"aria-atomic":!0},l)}function N3(){const[n,a]=h.useState("");return{announce:h.useCallback(o=>{o!=null&&a(o)},[]),announcement:n}}const tS=h.createContext(null);function R3(n){const a=h.useContext(tS);h.useEffect(()=>{if(!a)throw new Error("useDndMonitor must be used within a children of <DndContext>");return a(n)},[n,a])}function T3(){const[n]=h.useState(()=>new Set),a=h.useCallback(o=>(n.add(o),()=>n.delete(o)),[n]);return[h.useCallback(o=>{let{type:c,event:u}=o;n.forEach(f=>{var p;return(p=f[c])==null?void 0:p.call(f,u)})},[n]),a]}const A3={draggable:`
|
|
377
|
-
To pick up a draggable item, press the space bar.
|
|
378
|
-
While dragging, use the arrow keys to move the item.
|
|
379
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
380
|
-
`},M3={onDragStart(n){let{active:a}=n;return"Picked up draggable item "+a.id+"."},onDragOver(n){let{active:a,over:l}=n;return l?"Draggable item "+a.id+" was moved over droppable area "+l.id+".":"Draggable item "+a.id+" is no longer over a droppable area."},onDragEnd(n){let{active:a,over:l}=n;return l?"Draggable item "+a.id+" was dropped over droppable area "+l.id:"Draggable item "+a.id+" was dropped."},onDragCancel(n){let{active:a}=n;return"Dragging was cancelled. Draggable item "+a.id+" was dropped."}};function D3(n){let{announcements:a=M3,container:l,hiddenTextDescribedById:o,screenReaderInstructions:c=A3}=n;const{announce:u,announcement:f}=N3(),p=Ci("DndLiveRegion"),[g,v]=h.useState(!1);if(h.useEffect(()=>{v(!0)},[]),R3(h.useMemo(()=>({onDragStart(y){let{active:b}=y;u(a.onDragStart({active:b}))},onDragMove(y){let{active:b,over:w}=y;a.onDragMove&&u(a.onDragMove({active:b,over:w}))},onDragOver(y){let{active:b,over:w}=y;u(a.onDragOver({active:b,over:w}))},onDragEnd(y){let{active:b,over:w}=y;u(a.onDragEnd({active:b,over:w}))},onDragCancel(y){let{active:b,over:w}=y;u(a.onDragCancel({active:b,over:w}))}}),[u,a])),!g)return null;const x=ie.createElement(ie.Fragment,null,ie.createElement(C3,{id:o,value:c.draggable}),ie.createElement(E3,{id:p,announcement:f}));return l?wa.createPortal(x,l):x}var $t;(function(n){n.DragStart="dragStart",n.DragMove="dragMove",n.DragEnd="dragEnd",n.DragCancel="dragCancel",n.DragOver="dragOver",n.RegisterDroppable="registerDroppable",n.SetDroppableDisabled="setDroppableDisabled",n.UnregisterDroppable="unregisterDroppable"})($t||($t={}));function gu(){}function Mb(n,a){return h.useMemo(()=>({sensor:n,options:a??{}}),[n,a])}function O3(){for(var n=arguments.length,a=new Array(n),l=0;l<n;l++)a[l]=arguments[l];return h.useMemo(()=>[...a].filter(o=>o!=null),[...a])}const Ca=Object.freeze({x:0,y:0});function nS(n,a){return Math.sqrt(Math.pow(n.x-a.x,2)+Math.pow(n.y-a.y,2))}function aS(n,a){let{data:{value:l}}=n,{data:{value:o}}=a;return l-o}function _3(n,a){let{data:{value:l}}=n,{data:{value:o}}=a;return o-l}function Db(n){let{left:a,top:l,height:o,width:c}=n;return[{x:a,y:l},{x:a+c,y:l},{x:a,y:l+o},{x:a+c,y:l+o}]}function rS(n,a){if(!n||n.length===0)return null;const[l]=n;return l[a]}function Ob(n,a,l){return a===void 0&&(a=n.left),l===void 0&&(l=n.top),{x:a+n.width*.5,y:l+n.height*.5}}const k3=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:o}=n;const c=Ob(a,a.left,a.top),u=[];for(const f of o){const{id:p}=f,g=l.get(p);if(g){const v=nS(Ob(g),c);u.push({id:p,data:{droppableContainer:f,value:v}})}}return u.sort(aS)},z3=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:o}=n;const c=Db(a),u=[];for(const f of o){const{id:p}=f,g=l.get(p);if(g){const v=Db(g),x=c.reduce((b,w,E)=>b+nS(v[E],w),0),y=Number((x/4).toFixed(4));u.push({id:p,data:{droppableContainer:f,value:y}})}}return u.sort(aS)};function L3(n,a){const l=Math.max(a.top,n.top),o=Math.max(a.left,n.left),c=Math.min(a.left+a.width,n.left+n.width),u=Math.min(a.top+a.height,n.top+n.height),f=c-o,p=u-l;if(o<c&&l<u){const g=a.width*a.height,v=n.width*n.height,x=f*p,y=x/(g+v-x);return Number(y.toFixed(4))}return 0}const U3=n=>{let{collisionRect:a,droppableRects:l,droppableContainers:o}=n;const c=[];for(const u of o){const{id:f}=u,p=l.get(f);if(p){const g=L3(p,a);g>0&&c.push({id:f,data:{droppableContainer:u,value:g}})}}return c.sort(_3)};function I3(n,a,l){return{...n,scaleX:a&&l?a.width/l.width:1,scaleY:a&&l?a.height/l.height:1}}function lS(n,a){return n&&a?{x:n.left-a.left,y:n.top-a.top}:Ca}function B3(n){return function(l){for(var o=arguments.length,c=new Array(o>1?o-1:0),u=1;u<o;u++)c[u-1]=arguments[u];return c.reduce((f,p)=>({...f,top:f.top+n*p.y,bottom:f.bottom+n*p.y,left:f.left+n*p.x,right:f.right+n*p.x}),{...l})}}const P3=B3(1);function H3(n){if(n.startsWith("matrix3d(")){const a=n.slice(9,-1).split(/, /);return{x:+a[12],y:+a[13],scaleX:+a[0],scaleY:+a[5]}}else if(n.startsWith("matrix(")){const a=n.slice(7,-1).split(/, /);return{x:+a[4],y:+a[5],scaleX:+a[0],scaleY:+a[3]}}return null}function q3(n,a,l){const o=H3(a);if(!o)return n;const{scaleX:c,scaleY:u,x:f,y:p}=o,g=n.left-f-(1-c)*parseFloat(l),v=n.top-p-(1-u)*parseFloat(l.slice(l.indexOf(" ")+1)),x=c?n.width/c:n.width,y=u?n.height/u:n.height;return{width:x,height:y,top:v,right:g+x,bottom:v+y,left:g}}const $3={ignoreTransform:!1};function eo(n,a){a===void 0&&(a=$3);let l=n.getBoundingClientRect();if(a.ignoreTransform){const{transform:v,transformOrigin:x}=kn(n).getComputedStyle(n);v&&(l=q3(l,v,x))}const{top:o,left:c,width:u,height:f,bottom:p,right:g}=l;return{top:o,left:c,width:u,height:f,bottom:p,right:g}}function _b(n){return eo(n,{ignoreTransform:!0})}function V3(n){const a=n.innerWidth,l=n.innerHeight;return{top:0,left:0,right:a,bottom:l,width:a,height:l}}function Y3(n,a){return a===void 0&&(a=kn(n).getComputedStyle(n)),a.position==="fixed"}function G3(n,a){a===void 0&&(a=kn(n).getComputedStyle(n));const l=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(c=>{const u=a[c];return typeof u=="string"?l.test(u):!1})}function Yu(n,a){const l=[];function o(c){if(a!=null&&l.length>=a||!c)return l;if(jp(c)&&c.scrollingElement!=null&&!l.includes(c.scrollingElement))return l.push(c.scrollingElement),l;if(!Si(c)||Ww(c)||l.includes(c))return l;const u=kn(n).getComputedStyle(c);return c!==n&&G3(c,u)&&l.push(c),Y3(c,u)?l:o(c.parentNode)}return n?o(n):l}function sS(n){const[a]=Yu(n,1);return a??null}function Mh(n){return!Vu||!n?null:Js(n)?n:Sp(n)?jp(n)||n===Ws(n).scrollingElement?window:Si(n)?n:null:null}function oS(n){return Js(n)?n.scrollX:n.scrollLeft}function iS(n){return Js(n)?n.scrollY:n.scrollTop}function im(n){return{x:oS(n),y:iS(n)}}var Qt;(function(n){n[n.Forward=1]="Forward",n[n.Backward=-1]="Backward"})(Qt||(Qt={}));function cS(n){return!Vu||!n?!1:n===document.scrollingElement}function uS(n){const a={x:0,y:0},l=cS(n)?{height:window.innerHeight,width:window.innerWidth}:{height:n.clientHeight,width:n.clientWidth},o={x:n.scrollWidth-l.width,y:n.scrollHeight-l.height},c=n.scrollTop<=a.y,u=n.scrollLeft<=a.x,f=n.scrollTop>=o.y,p=n.scrollLeft>=o.x;return{isTop:c,isLeft:u,isBottom:f,isRight:p,maxScroll:o,minScroll:a}}const K3={x:.2,y:.2};function X3(n,a,l,o,c){let{top:u,left:f,right:p,bottom:g}=l;o===void 0&&(o=10),c===void 0&&(c=K3);const{isTop:v,isBottom:x,isLeft:y,isRight:b}=uS(n),w={x:0,y:0},E={x:0,y:0},j={height:a.height*c.y,width:a.width*c.x};return!v&&u<=a.top+j.height?(w.y=Qt.Backward,E.y=o*Math.abs((a.top+j.height-u)/j.height)):!x&&g>=a.bottom-j.height&&(w.y=Qt.Forward,E.y=o*Math.abs((a.bottom-j.height-g)/j.height)),!b&&p>=a.right-j.width?(w.x=Qt.Forward,E.x=o*Math.abs((a.right-j.width-p)/j.width)):!y&&f<=a.left+j.width&&(w.x=Qt.Backward,E.x=o*Math.abs((a.left+j.width-f)/j.width)),{direction:w,speed:E}}function F3(n){if(n===document.scrollingElement){const{innerWidth:u,innerHeight:f}=window;return{top:0,left:0,right:u,bottom:f,width:u,height:f}}const{top:a,left:l,right:o,bottom:c}=n.getBoundingClientRect();return{top:a,left:l,right:o,bottom:c,width:n.clientWidth,height:n.clientHeight}}function dS(n){return n.reduce((a,l)=>Hs(a,im(l)),Ca)}function Q3(n){return n.reduce((a,l)=>a+oS(l),0)}function Z3(n){return n.reduce((a,l)=>a+iS(l),0)}function J3(n,a){if(a===void 0&&(a=eo),!n)return;const{top:l,left:o,bottom:c,right:u}=a(n);sS(n)&&(c<=0||u<=0||l>=window.innerHeight||o>=window.innerWidth)&&n.scrollIntoView({block:"center",inline:"center"})}const W3=[["x",["left","right"],Q3],["y",["top","bottom"],Z3]];class Np{constructor(a,l){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const o=Yu(l),c=dS(o);this.rect={...a},this.width=a.width,this.height=a.height;for(const[u,f,p]of W3)for(const g of f)Object.defineProperty(this,g,{get:()=>{const v=p(o),x=c[u]-v;return this.rect[g]+x},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Wo{constructor(a){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(l=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...l)})},this.target=a}add(a,l,o){var c;(c=this.target)==null||c.addEventListener(a,l,o),this.listeners.push([a,l,o])}}function e_(n){const{EventTarget:a}=kn(n);return n instanceof a?n:Ws(n)}function Dh(n,a){const l=Math.abs(n.x),o=Math.abs(n.y);return typeof a=="number"?Math.sqrt(l**2+o**2)>a:"x"in a&&"y"in a?l>a.x&&o>a.y:"x"in a?l>a.x:"y"in a?o>a.y:!1}var ua;(function(n){n.Click="click",n.DragStart="dragstart",n.Keydown="keydown",n.ContextMenu="contextmenu",n.Resize="resize",n.SelectionChange="selectionchange",n.VisibilityChange="visibilitychange"})(ua||(ua={}));function kb(n){n.preventDefault()}function t_(n){n.stopPropagation()}var Ke;(function(n){n.Space="Space",n.Down="ArrowDown",n.Right="ArrowRight",n.Left="ArrowLeft",n.Up="ArrowUp",n.Esc="Escape",n.Enter="Enter",n.Tab="Tab"})(Ke||(Ke={}));const fS={start:[Ke.Space,Ke.Enter],cancel:[Ke.Esc],end:[Ke.Space,Ke.Enter,Ke.Tab]},n_=(n,a)=>{let{currentCoordinates:l}=a;switch(n.code){case Ke.Right:return{...l,x:l.x+25};case Ke.Left:return{...l,x:l.x-25};case Ke.Down:return{...l,y:l.y+25};case Ke.Up:return{...l,y:l.y-25}}};class Rp{constructor(a){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=a;const{event:{target:l}}=a;this.props=a,this.listeners=new Wo(Ws(l)),this.windowListeners=new Wo(kn(l)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ua.Resize,this.handleCancel),this.windowListeners.add(ua.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ua.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:a,onStart:l}=this.props,o=a.node.current;o&&J3(o),l(Ca)}handleKeyDown(a){if(Ep(a)){const{active:l,context:o,options:c}=this.props,{keyboardCodes:u=fS,coordinateGetter:f=n_,scrollBehavior:p="smooth"}=c,{code:g}=a;if(u.end.includes(g)){this.handleEnd(a);return}if(u.cancel.includes(g)){this.handleCancel(a);return}const{collisionRect:v}=o.current,x=v?{x:v.left,y:v.top}:Ca;this.referenceCoordinates||(this.referenceCoordinates=x);const y=f(a,{active:l,context:o.current,currentCoordinates:x});if(y){const b=oi(y,x),w={x:0,y:0},{scrollableAncestors:E}=o.current;for(const j of E){const C=a.code,{isTop:R,isRight:D,isLeft:A,isBottom:M,maxScroll:O,minScroll:N}=uS(j),_=F3(j),U={x:Math.min(C===Ke.Right?_.right-_.width/2:_.right,Math.max(C===Ke.Right?_.left:_.left+_.width/2,y.x)),y:Math.min(C===Ke.Down?_.bottom-_.height/2:_.bottom,Math.max(C===Ke.Down?_.top:_.top+_.height/2,y.y))},V=C===Ke.Right&&!D||C===Ke.Left&&!A,te=C===Ke.Down&&!M||C===Ke.Up&&!R;if(V&&U.x!==y.x){const q=j.scrollLeft+b.x,G=C===Ke.Right&&q<=O.x||C===Ke.Left&&q>=N.x;if(G&&!b.y){j.scrollTo({left:q,behavior:p});return}G?w.x=j.scrollLeft-q:w.x=C===Ke.Right?j.scrollLeft-O.x:j.scrollLeft-N.x,w.x&&j.scrollBy({left:-w.x,behavior:p});break}else if(te&&U.y!==y.y){const q=j.scrollTop+b.y,G=C===Ke.Down&&q<=O.y||C===Ke.Up&&q>=N.y;if(G&&!b.x){j.scrollTo({top:q,behavior:p});return}G?w.y=j.scrollTop-q:w.y=C===Ke.Down?j.scrollTop-O.y:j.scrollTop-N.y,w.y&&j.scrollBy({top:-w.y,behavior:p});break}}this.handleMove(a,Hs(oi(y,this.referenceCoordinates),w))}}}handleMove(a,l){const{onMove:o}=this.props;a.preventDefault(),o(l)}handleEnd(a){const{onEnd:l}=this.props;a.preventDefault(),this.detach(),l()}handleCancel(a){const{onCancel:l}=this.props;a.preventDefault(),this.detach(),l()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Rp.activators=[{eventName:"onKeyDown",handler:(n,a,l)=>{let{keyboardCodes:o=fS,onActivation:c}=a,{active:u}=l;const{code:f}=n.nativeEvent;if(o.start.includes(f)){const p=u.activatorNode.current;return p&&n.target!==p?!1:(n.preventDefault(),c==null||c({event:n.nativeEvent}),!0)}return!1}}];function zb(n){return!!(n&&"distance"in n)}function Lb(n){return!!(n&&"delay"in n)}class Tp{constructor(a,l,o){var c;o===void 0&&(o=e_(a.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=a,this.events=l;const{event:u}=a,{target:f}=u;this.props=a,this.events=l,this.document=Ws(f),this.documentListeners=new Wo(this.document),this.listeners=new Wo(o),this.windowListeners=new Wo(kn(f)),this.initialCoordinates=(c=om(u))!=null?c:Ca,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:a,props:{options:{activationConstraint:l,bypassActivationConstraint:o}}}=this;if(this.listeners.add(a.move.name,this.handleMove,{passive:!1}),this.listeners.add(a.end.name,this.handleEnd),a.cancel&&this.listeners.add(a.cancel.name,this.handleCancel),this.windowListeners.add(ua.Resize,this.handleCancel),this.windowListeners.add(ua.DragStart,kb),this.windowListeners.add(ua.VisibilityChange,this.handleCancel),this.windowListeners.add(ua.ContextMenu,kb),this.documentListeners.add(ua.Keydown,this.handleKeydown),l){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Lb(l)){this.timeoutId=setTimeout(this.handleStart,l.delay),this.handlePending(l);return}if(zb(l)){this.handlePending(l);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(a,l){const{active:o,onPending:c}=this.props;c(o,a,this.initialCoordinates,l)}handleStart(){const{initialCoordinates:a}=this,{onStart:l}=this.props;a&&(this.activated=!0,this.documentListeners.add(ua.Click,t_,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ua.SelectionChange,this.removeTextSelection),l(a))}handleMove(a){var l;const{activated:o,initialCoordinates:c,props:u}=this,{onMove:f,options:{activationConstraint:p}}=u;if(!c)return;const g=(l=om(a))!=null?l:Ca,v=oi(c,g);if(!o&&p){if(zb(p)){if(p.tolerance!=null&&Dh(v,p.tolerance))return this.handleCancel();if(Dh(v,p.distance))return this.handleStart()}if(Lb(p)&&Dh(v,p.tolerance))return this.handleCancel();this.handlePending(p,v);return}a.cancelable&&a.preventDefault(),f(g)}handleEnd(){const{onAbort:a,onEnd:l}=this.props;this.detach(),this.activated||a(this.props.active),l()}handleCancel(){const{onAbort:a,onCancel:l}=this.props;this.detach(),this.activated||a(this.props.active),l()}handleKeydown(a){a.code===Ke.Esc&&this.handleCancel()}removeTextSelection(){var a;(a=this.document.getSelection())==null||a.removeAllRanges()}}const a_={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ap extends Tp{constructor(a){const{event:l}=a,o=Ws(l.target);super(a,a_,o)}}Ap.activators=[{eventName:"onPointerDown",handler:(n,a)=>{let{nativeEvent:l}=n,{onActivation:o}=a;return!l.isPrimary||l.button!==0?!1:(o==null||o({event:l}),!0)}}];const r_={move:{name:"mousemove"},end:{name:"mouseup"}};var cm;(function(n){n[n.RightClick=2]="RightClick"})(cm||(cm={}));class l_ extends Tp{constructor(a){super(a,r_,Ws(a.event.target))}}l_.activators=[{eventName:"onMouseDown",handler:(n,a)=>{let{nativeEvent:l}=n,{onActivation:o}=a;return l.button===cm.RightClick?!1:(o==null||o({event:l}),!0)}}];const Oh={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class s_ extends Tp{constructor(a){super(a,Oh)}static setup(){return window.addEventListener(Oh.move.name,a,{capture:!1,passive:!1}),function(){window.removeEventListener(Oh.move.name,a)};function a(){}}}s_.activators=[{eventName:"onTouchStart",handler:(n,a)=>{let{nativeEvent:l}=n,{onActivation:o}=a;const{touches:c}=l;return c.length>1?!1:(o==null||o({event:l}),!0)}}];var ei;(function(n){n[n.Pointer=0]="Pointer",n[n.DraggableRect=1]="DraggableRect"})(ei||(ei={}));var vu;(function(n){n[n.TreeOrder=0]="TreeOrder",n[n.ReversedTreeOrder=1]="ReversedTreeOrder"})(vu||(vu={}));function o_(n){let{acceleration:a,activator:l=ei.Pointer,canScroll:o,draggingRect:c,enabled:u,interval:f=5,order:p=vu.TreeOrder,pointerCoordinates:g,scrollableAncestors:v,scrollableAncestorRects:x,delta:y,threshold:b}=n;const w=c_({delta:y,disabled:!u}),[E,j]=y3(),C=h.useRef({x:0,y:0}),R=h.useRef({x:0,y:0}),D=h.useMemo(()=>{switch(l){case ei.Pointer:return g?{top:g.y,bottom:g.y,left:g.x,right:g.x}:null;case ei.DraggableRect:return c}},[l,c,g]),A=h.useRef(null),M=h.useCallback(()=>{const N=A.current;if(!N)return;const _=C.current.x*R.current.x,U=C.current.y*R.current.y;N.scrollBy(_,U)},[]),O=h.useMemo(()=>p===vu.TreeOrder?[...v].reverse():v,[p,v]);h.useEffect(()=>{if(!u||!v.length||!D){j();return}for(const N of O){if((o==null?void 0:o(N))===!1)continue;const _=v.indexOf(N),U=x[_];if(!U)continue;const{direction:V,speed:te}=X3(N,U,D,a,b);for(const q of["x","y"])w[q][V[q]]||(te[q]=0,V[q]=0);if(te.x>0||te.y>0){j(),A.current=N,E(M,f),C.current=te,R.current=V;return}}C.current={x:0,y:0},R.current={x:0,y:0},j()},[a,M,o,j,u,f,JSON.stringify(D),JSON.stringify(w),E,v,O,x,JSON.stringify(b)])}const i_={x:{[Qt.Backward]:!1,[Qt.Forward]:!1},y:{[Qt.Backward]:!1,[Qt.Forward]:!1}};function c_(n){let{delta:a,disabled:l}=n;const o=sm(a);return ji(c=>{if(l||!o||!c)return i_;const u={x:Math.sign(a.x-o.x),y:Math.sign(a.y-o.y)};return{x:{[Qt.Backward]:c.x[Qt.Backward]||u.x===-1,[Qt.Forward]:c.x[Qt.Forward]||u.x===1},y:{[Qt.Backward]:c.y[Qt.Backward]||u.y===-1,[Qt.Forward]:c.y[Qt.Forward]||u.y===1}}},[l,a,o])}function u_(n,a){const l=a!=null?n.get(a):void 0,o=l?l.node.current:null;return ji(c=>{var u;return a==null?null:(u=o??c)!=null?u:null},[o,a])}function d_(n,a){return h.useMemo(()=>n.reduce((l,o)=>{const{sensor:c}=o,u=c.activators.map(f=>({eventName:f.eventName,handler:a(f.handler,o)}));return[...l,...u]},[]),[n,a])}var ii;(function(n){n[n.Always=0]="Always",n[n.BeforeDragging=1]="BeforeDragging",n[n.WhileDragging=2]="WhileDragging"})(ii||(ii={}));var um;(function(n){n.Optimized="optimized"})(um||(um={}));const Ub=new Map;function f_(n,a){let{dragging:l,dependencies:o,config:c}=a;const[u,f]=h.useState(null),{frequency:p,measure:g,strategy:v}=c,x=h.useRef(n),y=C(),b=si(y),w=h.useCallback(function(R){R===void 0&&(R=[]),!b.current&&f(D=>D===null?R:D.concat(R.filter(A=>!D.includes(A))))},[b]),E=h.useRef(null),j=ji(R=>{if(y&&!l)return Ub;if(!R||R===Ub||x.current!==n||u!=null){const D=new Map;for(let A of n){if(!A)continue;if(u&&u.length>0&&!u.includes(A.id)&&A.rect.current){D.set(A.id,A.rect.current);continue}const M=A.node.current,O=M?new Np(g(M),M):null;A.rect.current=O,O&&D.set(A.id,O)}return D}return R},[n,u,l,y,g]);return h.useEffect(()=>{x.current=n},[n]),h.useEffect(()=>{y||w()},[l,y]),h.useEffect(()=>{u&&u.length>0&&f(null)},[JSON.stringify(u)]),h.useEffect(()=>{y||typeof p!="number"||E.current!==null||(E.current=setTimeout(()=>{w(),E.current=null},p))},[p,y,w,...o]),{droppableRects:j,measureDroppableContainers:w,measuringScheduled:u!=null};function C(){switch(v){case ii.Always:return!1;case ii.BeforeDragging:return l;default:return!l}}}function hS(n,a){return ji(l=>n?l||(typeof a=="function"?a(n):n):null,[a,n])}function h_(n,a){return hS(n,a)}function m_(n){let{callback:a,disabled:l}=n;const o=Cp(a),c=h.useMemo(()=>{if(l||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:u}=window;return new u(o)},[o,l]);return h.useEffect(()=>()=>c==null?void 0:c.disconnect(),[c]),c}function Gu(n){let{callback:a,disabled:l}=n;const o=Cp(a),c=h.useMemo(()=>{if(l||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:u}=window;return new u(o)},[l]);return h.useEffect(()=>()=>c==null?void 0:c.disconnect(),[c]),c}function p_(n){return new Np(eo(n),n)}function Ib(n,a,l){a===void 0&&(a=p_);const[o,c]=h.useState(null);function u(){c(g=>{if(!n)return null;if(n.isConnected===!1){var v;return(v=g??l)!=null?v:null}const x=a(n);return JSON.stringify(g)===JSON.stringify(x)?g:x})}const f=m_({callback(g){if(n)for(const v of g){const{type:x,target:y}=v;if(x==="childList"&&y instanceof HTMLElement&&y.contains(n)){u();break}}}}),p=Gu({callback:u});return Pa(()=>{u(),n?(p==null||p.observe(n),f==null||f.observe(document.body,{childList:!0,subtree:!0})):(p==null||p.disconnect(),f==null||f.disconnect())},[n]),o}function g_(n){const a=hS(n);return lS(n,a)}const Bb=[];function v_(n){const a=h.useRef(n),l=ji(o=>n?o&&o!==Bb&&n&&a.current&&n.parentNode===a.current.parentNode?o:Yu(n):Bb,[n]);return h.useEffect(()=>{a.current=n},[n]),l}function x_(n){const[a,l]=h.useState(null),o=h.useRef(n),c=h.useCallback(u=>{const f=Mh(u.target);f&&l(p=>p?(p.set(f,im(f)),new Map(p)):null)},[]);return h.useEffect(()=>{const u=o.current;if(n!==u){f(u);const p=n.map(g=>{const v=Mh(g);return v?(v.addEventListener("scroll",c,{passive:!0}),[v,im(v)]):null}).filter(g=>g!=null);l(p.length?new Map(p):null),o.current=n}return()=>{f(n),f(u)};function f(p){p.forEach(g=>{const v=Mh(g);v==null||v.removeEventListener("scroll",c)})}},[c,n]),h.useMemo(()=>n.length?a?Array.from(a.values()).reduce((u,f)=>Hs(u,f),Ca):dS(n):Ca,[n,a])}function Pb(n,a){a===void 0&&(a=[]);const l=h.useRef(null);return h.useEffect(()=>{l.current=null},a),h.useEffect(()=>{const o=n!==Ca;o&&!l.current&&(l.current=n),!o&&l.current&&(l.current=null)},[n]),l.current?oi(n,l.current):Ca}function y_(n){h.useEffect(()=>{if(!Vu)return;const a=n.map(l=>{let{sensor:o}=l;return o.setup==null?void 0:o.setup()});return()=>{for(const l of a)l==null||l()}},n.map(a=>{let{sensor:l}=a;return l}))}function b_(n,a){return h.useMemo(()=>n.reduce((l,o)=>{let{eventName:c,handler:u}=o;return l[c]=f=>{u(f,a)},l},{}),[n,a])}function mS(n){return h.useMemo(()=>n?V3(n):null,[n])}const Hb=[];function w_(n,a){a===void 0&&(a=eo);const[l]=n,o=mS(l?kn(l):null),[c,u]=h.useState(Hb);function f(){u(()=>n.length?n.map(g=>cS(g)?o:new Np(a(g),g)):Hb)}const p=Gu({callback:f});return Pa(()=>{p==null||p.disconnect(),f(),n.forEach(g=>p==null?void 0:p.observe(g))},[n]),c}function S_(n){if(!n)return null;if(n.children.length>1)return n;const a=n.children[0];return Si(a)?a:n}function j_(n){let{measure:a}=n;const[l,o]=h.useState(null),c=h.useCallback(v=>{for(const{target:x}of v)if(Si(x)){o(y=>{const b=a(x);return y?{...y,width:b.width,height:b.height}:b});break}},[a]),u=Gu({callback:c}),f=h.useCallback(v=>{const x=S_(v);u==null||u.disconnect(),x&&(u==null||u.observe(x)),o(x?a(x):null)},[a,u]),[p,g]=mu(f);return h.useMemo(()=>({nodeRef:p,rect:l,setRef:g}),[l,p,g])}const C_=[{sensor:Ap,options:{}},{sensor:Rp,options:{}}],E_={current:{}},su={draggable:{measure:_b},droppable:{measure:_b,strategy:ii.WhileDragging,frequency:um.Optimized},dragOverlay:{measure:eo}};class ti extends Map{get(a){var l;return a!=null&&(l=super.get(a))!=null?l:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(a=>{let{disabled:l}=a;return!l})}getNodeFor(a){var l,o;return(l=(o=this.get(a))==null?void 0:o.node.current)!=null?l:void 0}}const N_={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ti,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:gu},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:su,measureDroppableContainers:gu,windowRect:null,measuringScheduled:!1},R_={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:gu,draggableNodes:new Map,over:null,measureDroppableContainers:gu},Ku=h.createContext(R_),pS=h.createContext(N_);function T_(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ti}}}function A_(n,a){switch(a.type){case $t.DragStart:return{...n,draggable:{...n.draggable,initialCoordinates:a.initialCoordinates,active:a.active}};case $t.DragMove:return n.draggable.active==null?n:{...n,draggable:{...n.draggable,translate:{x:a.coordinates.x-n.draggable.initialCoordinates.x,y:a.coordinates.y-n.draggable.initialCoordinates.y}}};case $t.DragEnd:case $t.DragCancel:return{...n,draggable:{...n.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case $t.RegisterDroppable:{const{element:l}=a,{id:o}=l,c=new ti(n.droppable.containers);return c.set(o,l),{...n,droppable:{...n.droppable,containers:c}}}case $t.SetDroppableDisabled:{const{id:l,key:o,disabled:c}=a,u=n.droppable.containers.get(l);if(!u||o!==u.key)return n;const f=new ti(n.droppable.containers);return f.set(l,{...u,disabled:c}),{...n,droppable:{...n.droppable,containers:f}}}case $t.UnregisterDroppable:{const{id:l,key:o}=a,c=n.droppable.containers.get(l);if(!c||o!==c.key)return n;const u=new ti(n.droppable.containers);return u.delete(l),{...n,droppable:{...n.droppable,containers:u}}}default:return n}}function M_(n){let{disabled:a}=n;const{active:l,activatorEvent:o,draggableNodes:c}=h.useContext(Ku),u=sm(o),f=sm(l==null?void 0:l.id);return h.useEffect(()=>{if(!a&&!o&&u&&f!=null){if(!Ep(u)||document.activeElement===u.target)return;const p=c.get(f);if(!p)return;const{activatorNode:g,node:v}=p;if(!g.current&&!v.current)return;requestAnimationFrame(()=>{for(const x of[g.current,v.current]){if(!x)continue;const y=S3(x);if(y){y.focus();break}}})}},[o,a,c,f,u]),null}function D_(n,a){let{transform:l,...o}=a;return n!=null&&n.length?n.reduce((c,u)=>u({transform:c,...o}),l):l}function O_(n){return h.useMemo(()=>({draggable:{...su.draggable,...n==null?void 0:n.draggable},droppable:{...su.droppable,...n==null?void 0:n.droppable},dragOverlay:{...su.dragOverlay,...n==null?void 0:n.dragOverlay}}),[n==null?void 0:n.draggable,n==null?void 0:n.droppable,n==null?void 0:n.dragOverlay])}function __(n){let{activeNode:a,measure:l,initialRect:o,config:c=!0}=n;const u=h.useRef(!1),{x:f,y:p}=typeof c=="boolean"?{x:c,y:c}:c;Pa(()=>{if(!f&&!p||!a){u.current=!1;return}if(u.current||!o)return;const v=a==null?void 0:a.node.current;if(!v||v.isConnected===!1)return;const x=l(v),y=lS(x,o);if(f||(y.x=0),p||(y.y=0),u.current=!0,Math.abs(y.x)>0||Math.abs(y.y)>0){const b=sS(v);b&&b.scrollBy({top:y.y,left:y.x})}},[a,f,p,o,l])}const gS=h.createContext({...Ca,scaleX:1,scaleY:1});var nl;(function(n){n[n.Uninitialized=0]="Uninitialized",n[n.Initializing=1]="Initializing",n[n.Initialized=2]="Initialized"})(nl||(nl={}));const k_=h.memo(function(a){var l,o,c,u;let{id:f,accessibility:p,autoScroll:g=!0,children:v,sensors:x=C_,collisionDetection:y=U3,measuring:b,modifiers:w,...E}=a;const j=h.useReducer(A_,void 0,T_),[C,R]=j,[D,A]=T3(),[M,O]=h.useState(nl.Uninitialized),N=M===nl.Initialized,{draggable:{active:_,nodes:U,translate:V},droppable:{containers:te}}=C,q=_!=null?U.get(_):null,G=h.useRef({initial:null,translated:null}),B=h.useMemo(()=>{var yt;return _!=null?{id:_,data:(yt=q==null?void 0:q.data)!=null?yt:E_,rect:G}:null},[_,q]),F=h.useRef(null),[ce,k]=h.useState(null),[$,ee]=h.useState(null),I=si(E,Object.values(E)),W=Ci("DndDescribedBy",f),z=h.useMemo(()=>te.getEnabled(),[te]),H=O_(b),{droppableRects:Z,measureDroppableContainers:re,measuringScheduled:he}=f_(z,{dragging:N,dependencies:[V.x,V.y],config:H.droppable}),ye=u_(U,_),pe=h.useMemo(()=>$?om($):null,[$]),de=Nr(),ve=h_(ye,H.draggable.measure);__({activeNode:_!=null?U.get(_):null,config:de.layoutShiftCompensation,initialRect:ve,measure:H.draggable.measure});const fe=Ib(ye,H.draggable.measure,ve),De=Ib(ye?ye.parentElement:null),Ne=h.useRef({activatorEvent:null,active:null,activeNode:ye,collisionRect:null,collisions:null,droppableRects:Z,draggableNodes:U,draggingNode:null,draggingNodeRect:null,droppableContainers:te,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),_e=te.getNodeFor((l=Ne.current.over)==null?void 0:l.id),Fe=j_({measure:H.dragOverlay.measure}),We=(o=Fe.nodeRef.current)!=null?o:ye,se=N?(c=Fe.rect)!=null?c:fe:null,Oe=!!(Fe.nodeRef.current&&Fe.rect),Qe=g_(Oe?null:fe),xt=mS(We?kn(We):null),Rt=v_(N?_e??ye:null),Gt=w_(Rt),xn=D_(w,{transform:{x:V.x-Qe.x,y:V.y-Qe.y,scaleX:1,scaleY:1},activatorEvent:$,active:B,activeNodeRect:fe,containerNodeRect:De,draggingNodeRect:se,over:Ne.current.over,overlayNodeRect:Fe.rect,scrollableAncestors:Rt,scrollableAncestorRects:Gt,windowRect:xt}),Zn=pe?Hs(pe,V):null,Kt=x_(Rt),no=Pb(Kt),Wt=Pb(Kt,[fe]),sn=Hs(xn,no),zn=se?P3(se,xn):null,$a=B&&zn?y({active:B,collisionRect:zn,droppableRects:Z,droppableContainers:z,pointerCoordinates:Zn}):null,Ra=rS($a,"id"),[Jn,ul]=h.useState(null),ma=Oe?xn:Hs(xn,Wt),At=I3(ma,(u=Jn==null?void 0:Jn.rect)!=null?u:null,fe),mn=h.useRef(null),Tt=h.useCallback((yt,at)=>{let{sensor:zt,options:Ce}=at;if(F.current==null)return;const ze=U.get(F.current);if(!ze)return;const Ue=yt.nativeEvent,vt=new zt({active:F.current,activeNode:ze,event:Ue,options:Ce,context:Ne,onAbort(ut){if(!U.get(ut))return;const{onDragAbort:bt}=I.current,Ot={id:ut};bt==null||bt(Ot),D({type:"onDragAbort",event:Ot})},onPending(ut,Ht,bt,Ot){if(!U.get(ut))return;const{onDragPending:Ga}=I.current,pa={id:ut,constraint:Ht,initialCoordinates:bt,offset:Ot};Ga==null||Ga(pa),D({type:"onDragPending",event:pa})},onStart(ut){const Ht=F.current;if(Ht==null)return;const bt=U.get(Ht);if(!bt)return;const{onDragStart:Ot}=I.current,Ya={activatorEvent:Ue,active:{id:Ht,data:bt.data,rect:G}};wa.unstable_batchedUpdates(()=>{Ot==null||Ot(Ya),O(nl.Initializing),R({type:$t.DragStart,initialCoordinates:ut,active:Ht}),D({type:"onDragStart",event:Ya}),k(mn.current),ee(Ue)})},onMove(ut){R({type:$t.DragMove,coordinates:ut})},onEnd:Ct($t.DragEnd),onCancel:Ct($t.DragCancel)});mn.current=vt;function Ct(ut){return async function(){const{active:bt,collisions:Ot,over:Ya,scrollAdjustedTranslate:Ga}=Ne.current;let pa=null;if(bt&&Ga){const{cancelDrop:Rr}=I.current;pa={activatorEvent:Ue,active:bt,collisions:Ot,delta:Ga,over:Ya},ut===$t.DragEnd&&typeof Rr=="function"&&await Promise.resolve(Rr(pa))&&(ut=$t.DragCancel)}F.current=null,wa.unstable_batchedUpdates(()=>{R({type:ut}),O(nl.Uninitialized),ul(null),k(null),ee(null),mn.current=null;const Rr=ut===$t.DragEnd?"onDragEnd":"onDragCancel";if(pa){const Wn=I.current[Rr];Wn==null||Wn(pa),D({type:Rr,event:pa})}})}}},[U]),ao=h.useCallback((yt,at)=>(zt,Ce)=>{const ze=zt.nativeEvent,Ue=U.get(Ce);if(F.current!==null||!Ue||ze.dndKit||ze.defaultPrevented)return;const vt={active:Ue};yt(zt,at.options,vt)===!0&&(ze.dndKit={capturedBy:at.sensor},F.current=Ce,Tt(zt,at))},[U,Tt]),$l=d_(x,ao);y_(x),Pa(()=>{fe&&M===nl.Initializing&&O(nl.Initialized)},[fe,M]),h.useEffect(()=>{const{onDragMove:yt}=I.current,{active:at,activatorEvent:zt,collisions:Ce,over:ze}=Ne.current;if(!at||!zt)return;const Ue={active:at,activatorEvent:zt,collisions:Ce,delta:{x:sn.x,y:sn.y},over:ze};wa.unstable_batchedUpdates(()=>{yt==null||yt(Ue),D({type:"onDragMove",event:Ue})})},[sn.x,sn.y]),h.useEffect(()=>{const{active:yt,activatorEvent:at,collisions:zt,droppableContainers:Ce,scrollAdjustedTranslate:ze}=Ne.current;if(!yt||F.current==null||!at||!ze)return;const{onDragOver:Ue}=I.current,vt=Ce.get(Ra),Ct=vt&&vt.rect.current?{id:vt.id,rect:vt.rect.current,data:vt.data,disabled:vt.disabled}:null,ut={active:yt,activatorEvent:at,collisions:zt,delta:{x:ze.x,y:ze.y},over:Ct};wa.unstable_batchedUpdates(()=>{ul(Ct),Ue==null||Ue(ut),D({type:"onDragOver",event:ut})})},[Ra]),Pa(()=>{Ne.current={activatorEvent:$,active:B,activeNode:ye,collisionRect:zn,collisions:$a,droppableRects:Z,draggableNodes:U,draggingNode:We,draggingNodeRect:se,droppableContainers:te,over:Jn,scrollableAncestors:Rt,scrollAdjustedTranslate:sn},G.current={initial:se,translated:zn}},[B,ye,$a,zn,U,We,se,Z,te,Jn,Rt,sn]),o_({...de,delta:V,draggingRect:zn,pointerCoordinates:Zn,scrollableAncestors:Rt,scrollableAncestorRects:Gt});const Vl=h.useMemo(()=>({active:B,activeNode:ye,activeNodeRect:fe,activatorEvent:$,collisions:$a,containerNodeRect:De,dragOverlay:Fe,draggableNodes:U,droppableContainers:te,droppableRects:Z,over:Jn,measureDroppableContainers:re,scrollableAncestors:Rt,scrollableAncestorRects:Gt,measuringConfiguration:H,measuringScheduled:he,windowRect:xt}),[B,ye,fe,$,$a,De,Fe,U,te,Z,Jn,re,Rt,Gt,H,he,xt]),Va=h.useMemo(()=>({activatorEvent:$,activators:$l,active:B,activeNodeRect:fe,ariaDescribedById:{draggable:W},dispatch:R,draggableNodes:U,over:Jn,measureDroppableContainers:re}),[$,$l,B,fe,R,W,U,Jn,re]);return ie.createElement(tS.Provider,{value:A},ie.createElement(Ku.Provider,{value:Va},ie.createElement(pS.Provider,{value:Vl},ie.createElement(gS.Provider,{value:At},v)),ie.createElement(M_,{disabled:(p==null?void 0:p.restoreFocus)===!1})),ie.createElement(D3,{...p,hiddenTextDescribedById:W}));function Nr(){const yt=(ce==null?void 0:ce.autoScrollEnabled)===!1,at=typeof g=="object"?g.enabled===!1:g===!1,zt=N&&!yt&&!at;return typeof g=="object"?{...g,enabled:zt}:{enabled:zt}}}),z_=h.createContext(null),qb="button",L_="Draggable";function U_(n){let{id:a,data:l,disabled:o=!1,attributes:c}=n;const u=Ci(L_),{activators:f,activatorEvent:p,active:g,activeNodeRect:v,ariaDescribedById:x,draggableNodes:y,over:b}=h.useContext(Ku),{role:w=qb,roleDescription:E="draggable",tabIndex:j=0}=c??{},C=(g==null?void 0:g.id)===a,R=h.useContext(C?gS:z_),[D,A]=mu(),[M,O]=mu(),N=b_(f,a),_=si(l);Pa(()=>(y.set(a,{id:a,key:u,node:D,activatorNode:M,data:_}),()=>{const V=y.get(a);V&&V.key===u&&y.delete(a)}),[y,a]);const U=h.useMemo(()=>({role:w,tabIndex:j,"aria-disabled":o,"aria-pressed":C&&w===qb?!0:void 0,"aria-roledescription":E,"aria-describedby":x.draggable}),[o,w,j,C,E,x.draggable]);return{active:g,activatorEvent:p,activeNodeRect:v,attributes:U,isDragging:C,listeners:o?void 0:N,node:D,over:b,setNodeRef:A,setActivatorNodeRef:O,transform:R}}function I_(){return h.useContext(pS)}const B_="Droppable",P_={timeout:25};function H_(n){let{data:a,disabled:l=!1,id:o,resizeObserverConfig:c}=n;const u=Ci(B_),{active:f,dispatch:p,over:g,measureDroppableContainers:v}=h.useContext(Ku),x=h.useRef({disabled:l}),y=h.useRef(!1),b=h.useRef(null),w=h.useRef(null),{disabled:E,updateMeasurementsFor:j,timeout:C}={...P_,...c},R=si(j??o),D=h.useCallback(()=>{if(!y.current){y.current=!0;return}w.current!=null&&clearTimeout(w.current),w.current=setTimeout(()=>{v(Array.isArray(R.current)?R.current:[R.current]),w.current=null},C)},[C]),A=Gu({callback:D,disabled:E||!f}),M=h.useCallback((U,V)=>{A&&(V&&(A.unobserve(V),y.current=!1),U&&A.observe(U))},[A]),[O,N]=mu(M),_=si(a);return h.useEffect(()=>{!A||!O.current||(A.disconnect(),y.current=!1,A.observe(O.current))},[O,A]),h.useEffect(()=>(p({type:$t.RegisterDroppable,element:{id:o,key:u,disabled:l,node:O,rect:b,data:_}}),()=>p({type:$t.UnregisterDroppable,key:u,id:o})),[o]),h.useEffect(()=>{l!==x.current.disabled&&(p({type:$t.SetDroppableDisabled,id:o,key:u,disabled:l}),x.current.disabled=l)},[o,u,l,p]),{active:f,rect:b,isOver:(g==null?void 0:g.id)===o,node:O,over:g,setNodeRef:N}}function q_(n,a,l){const o={...n};return a.top+n.y<=l.top?o.y=l.top-a.top:a.bottom+n.y>=l.top+l.height&&(o.y=l.top+l.height-a.bottom),a.left+n.x<=l.left?o.x=l.left-a.left:a.right+n.x>=l.left+l.width&&(o.x=l.left+l.width-a.right),o}const $_=n=>{let{containerNodeRect:a,draggingNodeRect:l,transform:o}=n;return!l||!a?o:q_(o,l,a)},V_=n=>{let{transform:a}=n;return{...a,x:0}};function Mp(n,a,l){const o=n.slice();return o.splice(l<0?o.length+l:l,0,o.splice(a,1)[0]),o}function Y_(n,a){return n.reduce((l,o,c)=>{const u=a.get(o);return u&&(l[c]=u),l},Array(n.length))}function Kc(n){return n!==null&&n>=0}function G_(n,a){if(n===a)return!0;if(n.length!==a.length)return!1;for(let l=0;l<n.length;l++)if(n[l]!==a[l])return!1;return!0}function K_(n){return typeof n=="boolean"?{draggable:n,droppable:n}:n}const vS=n=>{let{rects:a,activeIndex:l,overIndex:o,index:c}=n;const u=Mp(a,o,l),f=a[c],p=u[c];return!p||!f?null:{x:p.left-f.left,y:p.top-f.top,scaleX:p.width/f.width,scaleY:p.height/f.height}},Xc={scaleX:1,scaleY:1},X_=n=>{var a;let{activeIndex:l,activeNodeRect:o,index:c,rects:u,overIndex:f}=n;const p=(a=u[l])!=null?a:o;if(!p)return null;if(c===l){const v=u[f];return v?{x:0,y:l<f?v.top+v.height-(p.top+p.height):v.top-p.top,...Xc}:null}const g=F_(u,c,l);return c>l&&c<=f?{x:0,y:-p.height-g,...Xc}:c<l&&c>=f?{x:0,y:p.height+g,...Xc}:{x:0,y:0,...Xc}};function F_(n,a,l){const o=n[a],c=n[a-1],u=n[a+1];return o?l<a?c?o.top-(c.top+c.height):u?u.top-(o.top+o.height):0:u?u.top-(o.top+o.height):c?o.top-(c.top+c.height):0:0}const xS="Sortable",yS=ie.createContext({activeIndex:-1,containerId:xS,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:vS,disabled:{draggable:!1,droppable:!1}});function Q_(n){let{children:a,id:l,items:o,strategy:c=vS,disabled:u=!1}=n;const{active:f,dragOverlay:p,droppableRects:g,over:v,measureDroppableContainers:x}=I_(),y=Ci(xS,l),b=p.rect!==null,w=h.useMemo(()=>o.map(N=>typeof N=="object"&&"id"in N?N.id:N),[o]),E=f!=null,j=f?w.indexOf(f.id):-1,C=v?w.indexOf(v.id):-1,R=h.useRef(w),D=!G_(w,R.current),A=C!==-1&&j===-1||D,M=K_(u);Pa(()=>{D&&E&&x(w)},[D,w,E,x]),h.useEffect(()=>{R.current=w},[w]);const O=h.useMemo(()=>({activeIndex:j,containerId:y,disabled:M,disableTransforms:A,items:w,overIndex:C,useDragOverlay:b,sortedRects:Y_(w,g),strategy:c}),[j,y,M.draggable,M.droppable,A,w,C,g,b,c]);return ie.createElement(yS.Provider,{value:O},a)}const Z_=n=>{let{id:a,items:l,activeIndex:o,overIndex:c}=n;return Mp(l,o,c).indexOf(a)},J_=n=>{let{containerId:a,isSorting:l,wasDragging:o,index:c,items:u,newIndex:f,previousItems:p,previousContainerId:g,transition:v}=n;return!v||!o||p!==u&&c===f?!1:l?!0:f!==c&&a===g},W_={duration:200,easing:"ease"},bS="transform",ek=pu.Transition.toString({property:bS,duration:0,easing:"linear"}),tk={roleDescription:"sortable"};function nk(n){let{disabled:a,index:l,node:o,rect:c}=n;const[u,f]=h.useState(null),p=h.useRef(l);return Pa(()=>{if(!a&&l!==p.current&&o.current){const g=c.current;if(g){const v=eo(o.current,{ignoreTransform:!0}),x={x:g.left-v.left,y:g.top-v.top,scaleX:g.width/v.width,scaleY:g.height/v.height};(x.x||x.y)&&f(x)}}l!==p.current&&(p.current=l)},[a,l,o,c]),h.useEffect(()=>{u&&f(null)},[u]),u}function ak(n){let{animateLayoutChanges:a=J_,attributes:l,disabled:o,data:c,getNewIndex:u=Z_,id:f,strategy:p,resizeObserverConfig:g,transition:v=W_}=n;const{items:x,containerId:y,activeIndex:b,disabled:w,disableTransforms:E,sortedRects:j,overIndex:C,useDragOverlay:R,strategy:D}=h.useContext(yS),A=rk(o,w),M=x.indexOf(f),O=h.useMemo(()=>({sortable:{containerId:y,index:M,items:x},...c}),[y,c,M,x]),N=h.useMemo(()=>x.slice(x.indexOf(f)),[x,f]),{rect:_,node:U,isOver:V,setNodeRef:te}=H_({id:f,data:O,disabled:A.droppable,resizeObserverConfig:{updateMeasurementsFor:N,...g}}),{active:q,activatorEvent:G,activeNodeRect:B,attributes:F,setNodeRef:ce,listeners:k,isDragging:$,over:ee,setActivatorNodeRef:I,transform:W}=U_({id:f,data:O,attributes:{...tk,...l},disabled:A.draggable}),z=x3(te,ce),H=!!q,Z=H&&!E&&Kc(b)&&Kc(C),re=!R&&$,he=re&&Z?W:null,pe=Z?he??(p??D)({rects:j,activeNodeRect:B,activeIndex:b,overIndex:C,index:M}):null,de=Kc(b)&&Kc(C)?u({id:f,items:x,activeIndex:b,overIndex:C}):M,ve=q==null?void 0:q.id,fe=h.useRef({activeId:ve,items:x,newIndex:de,containerId:y}),De=x!==fe.current.items,Ne=a({active:q,containerId:y,isDragging:$,isSorting:H,id:f,index:M,items:x,newIndex:fe.current.newIndex,previousItems:fe.current.items,previousContainerId:fe.current.containerId,transition:v,wasDragging:fe.current.activeId!=null}),_e=nk({disabled:!Ne,index:M,node:U,rect:_});return h.useEffect(()=>{H&&fe.current.newIndex!==de&&(fe.current.newIndex=de),y!==fe.current.containerId&&(fe.current.containerId=y),x!==fe.current.items&&(fe.current.items=x)},[H,de,y,x]),h.useEffect(()=>{if(ve===fe.current.activeId)return;if(ve!=null&&fe.current.activeId==null){fe.current.activeId=ve;return}const We=setTimeout(()=>{fe.current.activeId=ve},50);return()=>clearTimeout(We)},[ve]),{active:q,activeIndex:b,attributes:F,data:O,rect:_,index:M,newIndex:de,items:x,isOver:V,isSorting:H,isDragging:$,listeners:k,node:U,overIndex:C,over:ee,setNodeRef:z,setActivatorNodeRef:I,setDroppableNodeRef:te,setDraggableNodeRef:ce,transform:_e??pe,transition:Fe()};function Fe(){if(_e||De&&fe.current.newIndex===M)return ek;if(!(re&&!Ep(G)||!v)&&(H||Ne))return pu.Transition.toString({...v,property:bS})}}function rk(n,a){var l,o;return typeof n=="boolean"?{draggable:n,droppable:!1}:{draggable:(l=n==null?void 0:n.draggable)!=null?l:a.draggable,droppable:(o=n==null?void 0:n.droppable)!=null?o:a.droppable}}function xu(n){if(!n)return!1;const a=n.data.current;return!!(a&&"sortable"in a&&typeof a.sortable=="object"&&"containerId"in a.sortable&&"items"in a.sortable&&"index"in a.sortable)}const lk=[Ke.Down,Ke.Right,Ke.Up,Ke.Left],sk=(n,a)=>{let{context:{active:l,collisionRect:o,droppableRects:c,droppableContainers:u,over:f,scrollableAncestors:p}}=a;if(lk.includes(n.code)){if(n.preventDefault(),!l||!o)return;const g=[];u.getEnabled().forEach(y=>{if(!y||y!=null&&y.disabled)return;const b=c.get(y.id);if(b)switch(n.code){case Ke.Down:o.top<b.top&&g.push(y);break;case Ke.Up:o.top>b.top&&g.push(y);break;case Ke.Left:o.left>b.left&&g.push(y);break;case Ke.Right:o.left<b.left&&g.push(y);break}});const v=z3({collisionRect:o,droppableRects:c,droppableContainers:g});let x=rS(v,"id");if(x===(f==null?void 0:f.id)&&v.length>1&&(x=v[1].id),x!=null){const y=u.get(l.id),b=u.get(x),w=b?c.get(b.id):null,E=b==null?void 0:b.node.current;if(E&&w&&y&&b){const C=Yu(E).some((N,_)=>p[_]!==N),R=wS(y,b),D=ok(y,b),A=C||!R?{x:0,y:0}:{x:D?o.width-w.width:0,y:D?o.height-w.height:0},M={x:w.left,y:w.top};return A.x&&A.y?M:oi(M,A)}}}};function wS(n,a){return!xu(n)||!xu(a)?!1:n.data.current.sortable.containerId===a.data.current.sortable.containerId}function ok(n,a){return!xu(n)||!xu(a)||!wS(n,a)?!1:n.data.current.sortable.index<a.data.current.sortable.index}var ik=Object.defineProperty,wr=(n,a)=>ik(n,"name",{value:a,configurable:!0}),Dp="Checkbox",[ck,s5]=_n(Dp),[uk,Op]=ck(Dp);function SS(n){const{__scopeCheckbox:a,checked:l,children:o,defaultChecked:c,disabled:u,form:f,name:p,onCheckedChange:g,required:v,value:x="on",internal_do_not_use_render:y}=n,[b,w]=La({prop:l,defaultProp:c??!1,onChange:g,caller:Dp}),[E,j]=h.useState(null),[C,R]=h.useState(null),D=h.useRef(!1),[A,M]=h.useReducer(_=>_+1,0),O=E?!!f||!!E.closest("form"):!0,N={checked:b,disabled:u,setChecked:w,control:E,setControl:j,name:p,form:f,value:x,hasConsumerStoppedPropagationRef:D,userInteractionCount:A,onUserInteraction:M,required:v,defaultChecked:vr(c)?!1:c,isFormControl:O,bubbleInput:C,setBubbleInput:R};return s.jsx(uk,{scope:a,...N,children:CS(y)?y(N):o})}wr(SS,"CheckboxProvider");var dk="CheckboxTrigger",fk=h.forwardRef(wr(function({__scopeCheckbox:a,onKeyDown:l,onClick:o,...c},u){const{control:f,value:p,disabled:g,checked:v,required:x,setControl:y,setChecked:b,hasConsumerStoppedPropagationRef:w,onUserInteraction:E,isFormControl:j,bubbleInput:C}=Op(dk,a),R=Ye(u,y),D=h.useRef(v);return h.useEffect(()=>{const A=f==null?void 0:f.form;if(A){const M=wr(()=>b(D.current),"reset");return A.addEventListener("reset",M),()=>A.removeEventListener("reset",M)}},[f,b]),s.jsx(Pe.button,{type:"button",role:"checkbox","aria-checked":vr(v)?"mixed":v,"aria-required":x,"data-state":_p(v),"data-disabled":g?"":void 0,disabled:g,value:p,...c,ref:R,onKeyDown:je(l,A=>{A.key==="Enter"&&A.preventDefault()}),onClick:je(o,A=>{E(),b(M=>vr(M)?!0:!M),C&&j&&(w.current=A.isPropagationStopped(),w.current||A.stopPropagation())})})},"CheckboxTrigger")),jS=h.forwardRef(wr(function(a,l){const{__scopeCheckbox:o,name:c,checked:u,defaultChecked:f,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...b}=a;return s.jsx(SS,{__scopeCheckbox:o,checked:u,defaultChecked:f,disabled:g,required:p,onCheckedChange:x,name:c,form:y,value:v,internal_do_not_use_render:({isFormControl:w})=>s.jsxs(s.Fragment,{children:[s.jsx(fk,{...b,ref:l,__scopeCheckbox:o}),w&&s.jsx(gk,{__scopeCheckbox:o})]})})},"Checkbox")),hk="CheckboxIndicator",mk=h.forwardRef(wr(function(a,l){const{__scopeCheckbox:o,forceMount:c,...u}=a,f=Op(hk,o);return s.jsx(jr,{present:c||vr(f.checked)||f.checked===!0,children:s.jsx(Pe.span,{"data-state":_p(f.checked),"data-disabled":f.disabled?"":void 0,...u,ref:l,style:{pointerEvents:"none",...a.style}})})},"CheckboxIndicator")),pk="CheckboxBubbleInput",gk=h.forwardRef(wr(function({__scopeCheckbox:a,onClick:l,...o},c){const{control:u,hasConsumerStoppedPropagationRef:f,userInteractionCount:p,checked:g,defaultChecked:v,required:x,disabled:y,name:b,value:w,form:E,bubbleInput:j,setBubbleInput:C}=Op(pk,a),R=Ye(c,C),D=ku(u),A=h.useRef(!1),M=h.useRef(g),O=h.useRef(p);h.useEffect(()=>{const _=j;if(!_)return;const U=window.HTMLInputElement.prototype,te=Object.getOwnPropertyDescriptor(U,"checked").set,q=p!==O.current;O.current=p;const G=M.current!==g;M.current=g;const B=!(q&&f.current);if(G&&te){A.current=!q;const F=new Event("click",{bubbles:B});_.indeterminate=vr(g),te.call(_,vr(g)?!1:g),_.dispatchEvent(F),A.current=!1}},[j,g,f,p]);const N=h.useRef(vr(g)?!1:g);return s.jsx(Pe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??N.current,required:x,disabled:y,name:b,value:w,form:E,...o,tabIndex:-1,ref:R,onClick:je(l,_=>{A.current&&_.stopPropagation()}),style:{...o.style,...D,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function CS(n){return typeof n=="function"}wr(CS,"isFunction");function vr(n){return n==="indeterminate"}wr(vr,"isIndeterminate");function _p(n){return vr(n)?"indeterminate":n?"checked":"unchecked"}wr(_p,"getState");const Ul=h.forwardRef(({className:n,...a},l)=>s.jsx(jS,{ref:l,className:Ee("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",n),...a,children:s.jsx(mk,{className:Ee("flex items-center justify-center text-current"),children:s.jsx(Mm,{className:"h-3.5 w-3.5"})})}));Ul.displayName=jS.displayName;function vk({value:n,className:a,indicatorClassName:l}){const o=Math.max(0,Math.min(100,Number.isFinite(n)?n:0));return s.jsx("div",{role:"progressbar","aria-valuenow":Math.round(o),"aria-valuemin":0,"aria-valuemax":100,className:Ee("h-2 w-full overflow-hidden rounded-full bg-secondary",a),children:s.jsx("div",{className:Ee("h-full w-full flex-1 bg-primary transition-all",l),style:{transform:`translateX(-${100-o}%)`}})})}var xk=Object.defineProperty,ln=(n,a)=>xk(n,"name",{value:a,configurable:!0}),[kp,o5]=_n("Tooltip",[Zs]),zp=Zs(),yk="TooltipProvider",bk=700,dm="tooltip.open",[wk,Lp]=kp(yk),Sk=ln(n=>{const{__scopeTooltip:a,delayDuration:l=bk,skipDelayDuration:o=300,disableHoverableContent:c=!1,children:u}=n,f=h.useRef(!0),p=h.useRef(!1),g=h.useRef(0);return h.useEffect(()=>{const v=g.current;return()=>window.clearTimeout(v)},[]),s.jsx(wk,{scope:a,isOpenDelayedRef:f,delayDuration:l,onOpen:h.useCallback(()=>{o<=0||(window.clearTimeout(g.current),f.current=!1)},[o]),onClose:h.useCallback(()=>{o<=0||(window.clearTimeout(g.current),g.current=window.setTimeout(()=>f.current=!0,o))},[o]),isPointerInTransitRef:p,onPointerInTransitChange:h.useCallback(v=>{p.current=v},[]),disableHoverableContent:c,children:u})},"TooltipProvider"),fm="Tooltip",[jk,Xu]=kp(fm),Ck=ln(n=>{const{__scopeTooltip:a,children:l,open:o,defaultOpen:c,onOpenChange:u,disableHoverableContent:f,delayDuration:p}=n,g=Lp(fm,n.__scopeTooltip),v=zp(a),[x,y]=h.useState(null),[b,w]=h.useState(void 0),E=ja(),j=h.useRef(0),C=f??g.disableHoverableContent,R=p??g.delayDuration,D=h.useRef(!1),[A,M]=La({prop:o,defaultProp:c??!1,onChange:ln(te=>{te?(g.onOpen(),document.dispatchEvent(new CustomEvent(dm))):g.onClose(),u==null||u(te)},"onChange"),caller:fm}),O=h.useMemo(()=>A?D.current?"delayed-open":"instant-open":"closed",[A]),N=h.useCallback(()=>{window.clearTimeout(j.current),j.current=0,D.current=!1,M(!0)},[M]),_=h.useCallback(()=>{window.clearTimeout(j.current),j.current=0,M(!1)},[M]),U=h.useCallback(()=>{window.clearTimeout(j.current),j.current=window.setTimeout(()=>{D.current=!0,M(!0),j.current=0},R)},[R,M]);h.useEffect(()=>()=>{j.current&&(window.clearTimeout(j.current),j.current=0)},[]);const V=b??E;return s.jsx(Xm,{...v,children:s.jsx(jk,{scope:a,contentId:V,setContentId:w,open:A,stateAttribute:O,trigger:x,onTriggerChange:y,onTriggerEnter:h.useCallback(()=>{g.isOpenDelayedRef.current?U():N()},[g.isOpenDelayedRef,U,N]),onTriggerLeave:h.useCallback(()=>{C?_():(window.clearTimeout(j.current),j.current=0)},[_,C]),onOpen:N,onClose:_,disableHoverableContent:C,children:l})})},"Tooltip"),$b="TooltipTrigger",Ek=h.forwardRef(ln(function(a,l){const{__scopeTooltip:o,...c}=a,u=Xu($b,o),f=Lp($b,o),p=zp(o),g=h.useRef(null),v=Ye(l,g,u.onTriggerChange),x=h.useRef(!1),y=h.useRef(!1),b=h.useCallback(()=>x.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",b),[b]),s.jsx(Fm,{asChild:!0,...p,children:s.jsx(Pe.button,{"aria-describedby":u.open?u.contentId:void 0,"data-state":u.stateAttribute,...c,ref:v,onPointerMove:je(a.onPointerMove,w=>{w.pointerType!=="touch"&&!y.current&&!f.isPointerInTransitRef.current&&(u.onTriggerEnter(),y.current=!0)}),onPointerLeave:je(a.onPointerLeave,()=>{u.onTriggerLeave(),y.current=!1}),onPointerDown:je(a.onPointerDown,()=>{u.open&&u.onClose(),x.current=!0,document.addEventListener("pointerup",b,{once:!0})}),onFocus:je(a.onFocus,()=>{x.current||u.onOpen()}),onBlur:je(a.onBlur,u.onClose),onClick:je(a.onClick,u.onClose)})})},"TooltipTrigger")),Nk="TooltipPortal",[i5,Rk]=kp(Nk,{forceMount:void 0}),ci="TooltipContent",Tk=h.forwardRef(ln(function(a,l){const o=Rk(ci,a.__scopeTooltip),{forceMount:c=o.forceMount,side:u="top",...f}=a,p=Xu(ci,a.__scopeTooltip);return s.jsx(jr,{present:c||p.open,children:p.disableHoverableContent?s.jsx(ES,{side:u,...f,ref:l}):s.jsx(Ak,{side:u,...f,ref:l})})},"TooltipContent")),Ak=h.forwardRef(ln(function(a,l){const o=Xu(ci,a.__scopeTooltip),c=Lp(ci,a.__scopeTooltip),u=h.useRef(null),f=Ye(l,u),[p,g]=h.useState(null),{trigger:v,onClose:x}=o,y=u.current,{onPointerInTransitChange:b}=c,w=h.useCallback(()=>{g(null),b(!1)},[b]),E=h.useCallback((j,C)=>{const R=j.currentTarget,D={x:j.clientX,y:j.clientY},A=NS(D,R.getBoundingClientRect()),M=RS(D,A),O=TS(C.getBoundingClientRect()),N=MS([...M,...O]);g(N),b(!0)},[b]);return h.useEffect(()=>()=>w(),[w]),h.useEffect(()=>{if(v&&y){const j=ln(R=>E(R,y),"handleTriggerLeave"),C=ln(R=>E(R,v),"handleContentLeave");return v.addEventListener("pointerleave",j),y.addEventListener("pointerleave",C),()=>{v.removeEventListener("pointerleave",j),y.removeEventListener("pointerleave",C)}}},[v,y,E,w]),h.useEffect(()=>{if(p){const j=ln(C=>{const R=C.target,D={x:C.clientX,y:C.clientY},A=(v==null?void 0:v.contains(R))||(y==null?void 0:y.contains(R)),M=!AS(D,p);A?w():M&&(w(),x())},"handleTrackPointerGrace");return document.addEventListener("pointermove",j),()=>document.removeEventListener("pointermove",j)}},[v,y,p,x,w]),s.jsx(ES,{...a,ref:f})},"TooltipContentHoverable")),Mk=H0("TooltipContent"),ES=h.forwardRef(ln(function(a,l){const{__scopeTooltip:o,children:c,"aria-label":u,id:f,onEscapeKeyDown:p,onPointerDownOutside:g,...v}=a,x=Xu(ci,o),y=zp(o),{onClose:b}=x;h.useEffect(()=>(document.addEventListener(dm,b),()=>document.removeEventListener(dm,b)),[b]),h.useEffect(()=>{if(x.trigger){const E=ln(j=>{j.target instanceof Node&&j.target.contains(x.trigger)&&b()},"handleScroll");return window.addEventListener("scroll",E,{capture:!0}),()=>window.removeEventListener("scroll",E,{capture:!0})}},[x.trigger,b]);const{setContentId:w}=x;return Yt(()=>(w(f),()=>{w(void 0)}),[f,w]),s.jsx(Tu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:E=>E.preventDefault(),onDismiss:b,children:s.jsxs(Qm,{"data-state":x.stateAttribute,role:u?void 0:"tooltip",id:u?void 0:x.contentId,...y,...v,ref:l,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(Mk,{children:c}),u?s.jsx(OO,{id:x.contentId,role:"tooltip",children:u}):null]})})},"TooltipContentImpl"));function NS(n,a){const l=Math.abs(a.top-n.y),o=Math.abs(a.bottom-n.y),c=Math.abs(a.right-n.x),u=Math.abs(a.left-n.x);switch(Math.min(l,o,c,u)){case u:return"left";case c:return"right";case l:return"top";case o:return"bottom";default:throw new Error("unreachable")}}ln(NS,"getExitSideFromRect");function RS(n,a,l=5){const o=[];switch(a){case"top":o.push({x:n.x-l,y:n.y+l},{x:n.x+l,y:n.y+l});break;case"bottom":o.push({x:n.x-l,y:n.y-l},{x:n.x+l,y:n.y-l});break;case"left":o.push({x:n.x+l,y:n.y-l},{x:n.x+l,y:n.y+l});break;case"right":o.push({x:n.x-l,y:n.y-l},{x:n.x-l,y:n.y+l});break}return o}ln(RS,"getPaddedExitPoints");function TS(n){const{top:a,right:l,bottom:o,left:c}=n;return[{x:c,y:a},{x:l,y:a},{x:l,y:o},{x:c,y:o}]}ln(TS,"getPointsFromRect");function AS(n,a){const{x:l,y:o}=n;let c=!1;for(let u=0,f=a.length-1;u<a.length;f=u++){const p=a[u],g=a[f],v=p.x,x=p.y,y=g.x,b=g.y;x>o!=b>o&&l<(y-v)*(o-x)/(b-x)+v&&(c=!c)}return c}ln(AS,"isPointInPolygon");function MS(n){const a=n.slice();return a.sort((l,o)=>l.x<o.x?-1:l.x>o.x?1:l.y<o.y?-1:l.y>o.y?1:0),DS(a)}ln(MS,"getHull");function DS(n){if(n.length<=1)return n.slice();const a=[];for(let o=0;o<n.length;o++){const c=n[o];for(;a.length>=2;){const u=a[a.length-1],f=a[a.length-2];if((u.x-f.x)*(c.y-f.y)>=(u.y-f.y)*(c.x-f.x))a.pop();else break}a.push(c)}a.pop();const l=[];for(let o=n.length-1;o>=0;o--){const c=n[o];for(;l.length>=2;){const u=l[l.length-1],f=l[l.length-2];if((u.x-f.x)*(c.y-f.y)>=(u.y-f.y)*(c.x-f.x))l.pop();else break}l.push(c)}return l.pop(),a.length===1&&l.length===1&&a[0].x===l[0].x&&a[0].y===l[0].y?a:a.concat(l)}ln(DS,"getHullPresorted");var Dk=Sk,Ok=Ck,_k=Ek,OS=Tk;const _S=Dk,Os=Ok,_s=_k,Ml=h.forwardRef(({className:n,sideOffset:a=4,...l},o)=>s.jsx(OS,{ref:o,sideOffset:a,className:Ee("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",n),...l}));Ml.displayName=OS.displayName;const yu=h.forwardRef(({className:n,...a},l)=>s.jsx("textarea",{ref:l,className:Ee("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",n),...a}));yu.displayName="Textarea";function kk({providerId:n,open:a,onOpenChange:l,onImported:o}){const[c,u]=h.useState([]),[f,p]=h.useState(""),[g,v]=h.useState(null),[x,y]=h.useState([]),[b,w]=h.useState(!1),[E,j]=h.useState(""),C=N=>{const _=new FormData;return _.append("providerId",n),N&&_.append("selectedIndexes",JSON.stringify(N)),c.forEach(U=>_.append("file",U)),f.trim()&&_.append("text",f),_},R=async()=>{w(!0),j("");try{const N=await xe.upload("/api/admin/codex/accounts/preview",C());v(N),y(N.records.filter(_=>_.valid&&!_.duplicateOf).map(_=>_.index))}catch(N){j(N.message||"Unable to preview import")}finally{w(!1)}},D=async()=>{w(!0),j("");try{const N=await xe.upload("/api/admin/codex/accounts/import",C(x));l(!1),o(),u([]),p(""),v(null),y([]),me.success(`${N.added} added, ${N.updated} updated, ${N.failed} failed`)}catch(N){j(N.message||"Unable to import accounts")}finally{w(!1)}},A=(N,_)=>y(U=>_===!0?[...new Set([...U,N])]:U.filter(V=>V!==N)),M=(g==null?void 0:g.records.filter(N=>N.valid&&!N.duplicateOf).map(N=>N.index))??[],O=M.length>0&&M.every(N=>x.includes(N));return s.jsx(vn,{open:a,onOpenChange:l,children:s.jsxs(un,{className:"max-w-3xl",children:[s.jsxs(dn,{children:[s.jsx(hn,{children:"Import Codex accounts"}),s.jsx(zl,{children:"Select JSON or JSONL files, or paste records. Secrets are submitted without being displayed in the preview."})]}),g?s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between rounded-md border p-3 text-sm",children:[s.jsxs("span",{children:[g.validCount," valid, ",g.invalidCount," invalid"]}),s.jsxs("label",{className:"flex items-center gap-2",children:[s.jsx(Ul,{checked:O,onCheckedChange:N=>y(N===!0?M:[]),"aria-label":"Select all valid accounts"})," Select all valid"]})]}),s.jsx("div",{className:"max-h-80 overflow-auto rounded-md border",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b text-left",children:[s.jsx("th",{className:"p-2",children:"Select"}),s.jsx("th",{className:"p-2",children:"Account"}),s.jsx("th",{className:"p-2",children:"Plan"}),s.jsx("th",{className:"p-2",children:"Expiry"}),s.jsx("th",{className:"p-2",children:"Result"})]})}),s.jsx("tbody",{children:g.records.map(N=>s.jsxs("tr",{className:"border-b last:border-0",children:[s.jsx("td",{className:"p-2",children:s.jsx(Ul,{checked:x.includes(N.index),disabled:!N.valid||!!N.duplicateOf,onCheckedChange:_=>A(N.index,_),"aria-label":`Select record ${N.index+1}`})}),s.jsxs("td",{className:"p-2",children:[s.jsx("div",{children:N.email||"Unknown email"}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[N.accountIdMasked||"No account ID",N.workspaceIdMasked?` · ${N.workspaceIdMasked}`:""]})]}),s.jsx("td",{className:"p-2",children:N.planType||"—"}),s.jsx("td",{className:"p-2",children:N.expiresAt?new Date(N.expiresAt).toLocaleDateString():"—"}),s.jsx("td",{className:"p-2",children:N.valid?N.duplicateOf?s.jsx("span",{className:"text-amber-600",children:"Duplicate"}):s.jsx("span",{className:"text-emerald-600",children:"Ready"}):s.jsx("span",{className:"text-destructive",children:N.error||"Invalid record"})})]},`${N.index}-${N.source??""}`))})]})}),E&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:E}),s.jsxs(fn,{children:[s.jsx(oe,{variant:"outline",onClick:()=>v(null),children:"Back"}),s.jsx(oe,{disabled:b||x.length===0,onClick:()=>void D(),children:b?"Importing…":`Import ${x.length} account${x.length===1?"":"s"}`})]})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(be,{htmlFor:"codex-files",children:"JSON / JSONL files"}),s.jsx(Re,{id:"codex-files",type:"file",accept:".json,.jsonl,application/json",multiple:!0,onChange:N=>u(Array.from(N.target.files??[]))})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"codex-paste",children:"Paste JSON / JSONL (optional)"}),s.jsx(yu,{id:"codex-paste",value:f,onChange:N=>p(N.target.value),placeholder:"Paste Codex export records here",className:"min-h-32 font-mono text-xs"})]}),E&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:E}),s.jsxs(fn,{children:[s.jsx(oe,{variant:"outline",onClick:()=>l(!1),children:"Cancel"}),s.jsx(oe,{disabled:b||c.length===0&&!f.trim(),onClick:()=>void R(),children:b?"Reading…":"Preview import"})]})]})]})})}const zk="http://localhost:1455/auth/callback",Lk="1455",Uk="http://localhost:8791/oauth/codex/callback";function Ik({providerId:n,providerName:a,open:l,onOpenChange:o,onConnected:c}){const[u,f]=h.useState(""),[p,g]=h.useState(""),[v,x]=h.useState(""),[y,b]=h.useState(!0),[w,E]=h.useState(!1),[j,C]=h.useState(""),[R,D]=h.useState(!1),[A,M]=h.useState(!1),O=h.useCallback(async()=>{b(!0),C(""),x("");try{const U=await xe.post("/api/admin/codex/oauth/start",{providerId:n});f(U.state),g(U.authorizeUrl)}catch(U){C(U.message||"Unable to start the Codex authorization flow")}finally{b(!1)}},[n]);h.useEffect(()=>{O()},[O]),h.useEffect(()=>{if(!u)return;const U=setInterval(()=>{xe.get(`/api/admin/codex/oauth/${u}`).then(V=>M(!(V!=null&&V.callbackReceived))).catch(()=>M(!0))},5e3);return()=>clearInterval(U)},[u]);const N=async()=>{E(!0),C("");try{const U=await xe.post("/api/admin/codex/oauth/complete",{providerId:n,state:u,callbackUrl:v});me.success(`Codex account ${U.status==="added"?"connected":"updated"}`),o(!1),c()}catch(U){C(U.message||"Unable to complete the Codex authorization")}finally{E(!1)}},_=async()=>{try{await navigator.clipboard.writeText(p),D(!0),setTimeout(()=>D(!1),2e3)}catch{C("Clipboard is unavailable — select the URL and copy it manually.")}};return s.jsx(vn,{open:l,onOpenChange:o,children:s.jsxs(un,{className:"max-w-2xl",children:[s.jsxs(dn,{children:[s.jsx(hn,{children:"Connect OpenAI Codex"}),s.jsxs(zl,{children:["Authorize a ChatGPT account for ",a,". The callback is captured on localhost:",Lk," — nothing is sent anywhere else."]})]}),y?s.jsxs("p",{className:"flex items-center gap-2 py-6 text-sm text-muted-foreground",children:[s.jsx(mr,{className:"h-4 w-4 animate-spin"})," Starting authorization…"]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(mr,{className:"h-3.5 w-3.5 animate-spin"})," Waiting for popup authorization…"]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["The browser will try to hand the callback to ",s.jsx("code",{className:"font-mono",children:Uk}),". Most browsers block that from a public origin — if the page fails to load, copy the address bar and paste it in step 2."]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(be,{children:"Step 1: Open this URL in your browser"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Re,{readOnly:!0,className:"font-mono text-xs",value:p,onFocus:U=>U.currentTarget.select()}),s.jsx(oe,{type:"button",variant:"outline","aria-label":"Copy authorization URL",onClick:()=>void _(),children:R?s.jsx(Mm,{className:"h-4 w-4"}):s.jsx(tu,{className:"h-4 w-4"})}),s.jsx(oe,{type:"button",variant:"outline","aria-label":"Open authorization URL",asChild:!0,children:s.jsx("a",{href:p,target:"_blank",rel:"noreferrer",children:s.jsx(sN,{className:"h-4 w-4"})})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(be,{htmlFor:"codex-callback",children:"Step 2: Paste the callback URL here"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"After authorization, copy the full URL from your browser — or just the authorization code."}),s.jsx(Re,{id:"codex-callback",value:v,onChange:U=>x(U.target.value),placeholder:`${zk}?code=…`}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Or paste callback URL manually"})]}),j&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:j})]}),s.jsxs(fn,{children:[s.jsx(oe,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),s.jsx(oe,{disabled:w||y||A&&!v.trim(),onClick:()=>void N(),children:w?s.jsxs(s.Fragment,{children:[s.jsx(mr,{className:"mr-1 h-4 w-4 animate-spin"})," Connecting…"]}):"Connect"})]})]})})}const Bk=["10","25","50"];function Pk(n,a){if(!n)return"—";const l=Date.parse(n)-a;if(!Number.isFinite(l))return"—";if(l<=0)return"reset ready";const o=Math.floor(l/6e4);if(o<60)return`${o}m`;const c=Math.floor(o/60),u=o%60;return c<24?`${c}h ${u}m`:`${Math.floor(c/24)}d ${c%24}h`}function Vb(n,a,l){if(!n)return s.jsx("span",{className:"text-xs text-muted-foreground",children:"—"});const o=n.remaining<=0;return s.jsxs("div",{className:"min-w-[9rem] space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[s.jsxs("span",{className:o?"font-medium text-destructive":"text-muted-foreground",children:[l," ",Math.round(n.remaining),"% left"]}),s.jsx("span",{className:"tabular-nums text-muted-foreground",children:Pk(n.resetAt,a)})]}),s.jsx(vk,{value:n.used,indicatorClassName:o?"bg-destructive":n.remaining<30?"bg-amber-500":"bg-emerald-500"})]})}function Hk({providerId:n,providerName:a}){const[l,o]=h.useState([]),[c,u]=h.useState(null),[f,p]=h.useState(!0),[g,v]=h.useState(!1),[x,y]=h.useState(!1),[b,w]=h.useState(1),[E,j]=h.useState("10"),[C,R]=h.useState(""),[D,A]=h.useState(()=>Date.now());h.useEffect(()=>{const k=setInterval(()=>A(Date.now()),3e4);return()=>clearInterval(k)},[]);const M=h.useCallback(async()=>{try{const k=await xe.get(`/api/admin/codex/accounts?providerId=${encodeURIComponent(n)}`);o(k.accounts)}catch(k){me.error(k.message||"Unable to load Codex accounts")}finally{p(!1)}},[n]);h.useEffect(()=>{M()},[M]);const O=async(k,$,ee)=>{u(k.id);try{await ee(),me.success(`${$}: ${k.email||k.accountIdMasked||k.id}`)}catch(I){me.error(I.message||`${$} failed`)}finally{u(null)}},N=(k,$)=>o(ee=>ee.map(I=>I.id===k?$:I)),_=(k,$)=>O(l.find(ee=>ee.id===k),"Updated",async()=>{N(k,(await xe.patch(`/api/admin/codex/accounts/${k}`,$)).account)}),U=l.filter(k=>{if(!C)return!0;const $=C.toLowerCase();return[k.email,k.accountIdMasked,k.workspaceIdMasked,k.planType].some(ee=>ee==null?void 0:ee.toLowerCase().includes($))}),V=Number(E),te=Math.max(1,Math.ceil(U.length/V)),q=Math.min(b,te),G=U.slice((q-1)*V,q*V),B=async()=>{u("all");try{await Promise.allSettled(l.map(k=>xe.post(`/api/admin/codex/accounts/${k.id}/usage`))),await M(),me.success("Usage refreshed for all accounts")}finally{u(null)}},F=O3(Mb(Ap,{activationConstraint:{distance:4}}),Mb(Rp,{coordinateGetter:sk})),ce=async k=>{const{active:$,over:ee}=k;if(!ee||$.id===ee.id)return;const I=l.findIndex(Z=>Z.id===$.id),W=l.findIndex(Z=>Z.id===ee.id);if(I<0||W<0)return;const z=l,H=Mp(l,I,W);o(H);try{await xe.post("/api/admin/codex/accounts/reorder",{providerId:n,ids:H.map(Z=>Z.id)}),me.success("Routing order updated")}catch(Z){o(z),me.error(Z.message||"Unable to save the routing order")}};return s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-medium",children:"Codex accounts"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[l.length," account",l.length===1?"":"s"," · drag a row to set routing order · quotas come from the ChatGPT usage API"]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Re,{className:"h-8 w-40",placeholder:"Filter accounts…",value:C,onChange:k=>{R(k.target.value),w(1)}}),s.jsxs(oe,{size:"sm",variant:"outline",disabled:c!==null||l.length===0,onClick:()=>void B(),children:[s.jsx(D0,{className:"mr-1 h-3 w-3"})," Refresh all"]}),s.jsxs(oe,{size:"sm",variant:"outline",onClick:()=>y(!0),children:[s.jsx(dN,{className:"mr-1 h-4 w-4"})," Connect Codex"]}),s.jsxs(oe,{size:"sm",onClick:()=>v(!0),children:[s.jsx(EN,{className:"mr-1 h-4 w-4"})," Import accounts"]})]})]}),f?s.jsx("p",{className:"py-3 text-sm text-muted-foreground",children:"Loading Codex accounts…"}):l.length===0?s.jsx("p",{className:"py-3 text-sm text-muted-foreground",children:"No Codex accounts yet. Use Connect Codex to authorize one, or import existing account JSON."}):U.length===0?s.jsxs("p",{className:"py-3 text-sm text-muted-foreground",children:["No account matches “",C,"”."]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"overflow-x-auto rounded-md border",children:s.jsx(_S,{delayDuration:200,children:s.jsx(k_,{sensors:F,collisionDetection:k3,onDragEnd:k=>void ce(k),modifiers:[V_,$_],children:s.jsxs(Gn,{children:[s.jsx(Kn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{className:"w-8"}),s.jsx(ge,{className:"text-xs",children:"Account"}),s.jsx(ge,{className:"text-xs",children:"Plan"}),s.jsx(ge,{className:"text-xs",children:"5h window"}),s.jsx(ge,{className:"text-xs",children:"Weekly"}),s.jsx(ge,{className:"text-xs",children:"Reset credits"}),s.jsx(ge,{className:"text-xs",children:"Auto-start 5h"}),s.jsx(ge,{className:"text-xs",children:"Token expiry"}),s.jsx(ge,{className:"text-xs",children:"Health"}),s.jsx(ge,{className:"text-right text-xs",children:"Actions"})]})}),s.jsx(Q_,{items:G.map(k=>k.id),strategy:X_,children:s.jsx(Xn,{children:G.map(k=>s.jsx(qk,{account:k,now:D,busy:c===k.id,onPatch:$=>void _(k.id,$),onUsage:$=>N(k.id,$),onDelete:()=>void O(k,"Deleted",()=>xe.del(`/api/admin/codex/accounts/${k.id}`)).then(()=>M())},k.id))})})]})})})}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{children:"Rows per page"}),s.jsxs(Vn,{value:E,onValueChange:k=>{j(k),w(1)},children:[s.jsx(Mn,{className:"h-7 w-16",children:s.jsx(Yn,{})}),s.jsx(Dn,{children:Bk.map(k=>s.jsx(tt,{value:k,children:k},k))})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{children:["Page ",q," of ",te]}),s.jsx(oe,{size:"sm",variant:"outline","aria-label":"Previous page",disabled:q<=1,onClick:()=>w(q-1),children:s.jsx(JE,{className:"h-3 w-3"})}),s.jsx(oe,{size:"sm",variant:"outline","aria-label":"Next page",disabled:q>=te,onClick:()=>w(q+1),children:s.jsx(N0,{className:"h-3 w-3"})})]})]})]}),g&&s.jsx(kk,{providerId:n,open:!0,onOpenChange:k=>{k||v(!1)},onImported:()=>void M()}),x&&s.jsx(Ik,{providerId:n,providerName:a||"this Codex provider",open:!0,onOpenChange:k=>{k||y(!1)},onConnected:()=>void M()})]})}function qk({account:n,now:a,busy:l,onPatch:o,onUsage:c,onDelete:u}){var A,M,O,N,_,U;const{attributes:f,listeners:p,setNodeRef:g,transform:v,transition:x,isDragging:y}=ak({id:n.id,disabled:l}),b=(M=(A=n.usage)==null?void 0:A.quotas)==null?void 0:M.session,w=(N=(O=n.usage)==null?void 0:O.quotas)==null?void 0:N.blocking,E=((_=n.usage)==null?void 0:_.resetCredits)??0,j=n.email||n.accountIdMasked||n.id,C=()=>void(async()=>{try{c((await xe.post(`/api/admin/codex/accounts/${n.id}/usage`)).account),me.success(`Usage refreshed: ${j}`)}catch(V){me.error(V.message||"Usage refresh failed")}})(),R=()=>{window.confirm(`Spend 1 weekly reset credit to restart the 5h window for ${j}?`)&&(async()=>{try{c((await xe.post(`/api/admin/codex/accounts/${n.id}/reset-quota`)).account),me.success(`Quota reset: ${j}`)}catch(V){me.error(V.message||"Quota reset failed")}})()},D=()=>void $k(`Test passed: ${j}`,()=>xe.post(`/api/admin/codex/accounts/${n.id}/test`));return s.jsxs(Xe,{ref:g,style:{transform:v?`translate3d(${v.x}px, ${v.y}px, 0)`:void 0,transition:x},className:Ee(n.enabled?void 0:"opacity-60",y&&"relative z-10 bg-muted/60 shadow-sm"),children:[s.jsx(ue,{className:"w-8 pr-0",children:s.jsx("button",{type:"button",...f,...p,"aria-label":`Reorder ${j}`,title:"Drag to change routing order",disabled:l,className:"cursor-grab touch-none rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40 active:cursor-grabbing",children:s.jsx(uN,{className:"h-4 w-4"})})}),s.jsxs(ue,{children:[s.jsx("div",{className:"text-sm",children:n.email||"Unknown email"}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[n.accountIdMasked||"—",n.workspaceIdMasked?` · ${n.workspaceIdMasked}`:"",n.usageError?` · usage: ${n.usageError}`:""]})]}),s.jsx(ue,{className:"text-sm",children:((U=n.usage)==null?void 0:U.plan)||n.planType||"—"}),s.jsx(ue,{children:Vb(b,a,"5h")}),s.jsx(ue,{children:Vb(w,a,"Week")}),s.jsx(ue,{children:s.jsx("span",{className:`text-sm tabular-nums ${E>0?"font-medium":"text-muted-foreground"}`,children:E})}),s.jsx(ue,{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Vk,{checked:n.autostart,disabled:l,onCheckedChange:V=>o({autostart:V}),label:`Auto-start 5h window for ${j}`}),s.jsxs(Os,{children:[s.jsx(_s,{asChild:!0,children:s.jsx("span",{className:"text-xs text-muted-foreground",children:n.lastPingAt?`pinged ${new Date(n.lastPingAt).toLocaleTimeString()}`:"never pinged"})}),s.jsx(Ml,{className:"max-w-64",children:"Sends a tiny gpt-5.5 request right after the 5h window resets so the next window starts immediately. Consumes a small amount of quota."})]})]})}),s.jsx(ue,{className:"text-xs",children:new Date(n.tokenExpiresAt).toLocaleString()}),s.jsx(ue,{children:s.jsx(nt,{variant:n.healthState==="healthy"?"success":n.healthState==="down"?"destructive":"secondary",children:n.healthState})}),s.jsx(ue,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[s.jsxs(Os,{children:[s.jsx(_s,{asChild:!0,children:s.jsx(oe,{size:"sm",variant:"outline","aria-label":`Refresh usage for ${j}`,disabled:l,onClick:C,children:s.jsx(D0,{className:"h-3 w-3"})})}),s.jsx(Ml,{children:"Refresh usage"})]}),s.jsxs(Os,{children:[s.jsx(_s,{asChild:!0,children:s.jsx(oe,{size:"sm",variant:"outline","aria-label":`Reset quota for ${j}`,disabled:l||E===0,onClick:R,children:s.jsx(vN,{className:"h-3 w-3"})})}),s.jsx(Ml,{children:E===0?"No weekly reset credits available":"Reset quota (uses 1 credit)"})]}),s.jsxs(Os,{children:[s.jsx(_s,{asChild:!0,children:s.jsx(oe,{size:"sm",variant:"outline","aria-label":`Test Codex account ${j}`,disabled:l,onClick:D,children:s.jsx(bN,{className:"h-3 w-3"})})}),s.jsx(Ml,{children:"Test connection"})]}),s.jsxs(Os,{children:[s.jsx(_s,{asChild:!0,children:s.jsx(oe,{size:"sm",variant:"outline","aria-pressed":!n.enabled,disabled:l,onClick:()=>o({enabled:!n.enabled}),children:n.enabled?"Disable":"Enable"})}),s.jsx(Ml,{children:n.enabled?"Exclude from routing (keeps the account)":"Include in routing"})]}),s.jsxs(Os,{children:[s.jsx(_s,{asChild:!0,children:s.jsx(oe,{size:"sm",variant:"destructive","aria-label":`Delete Codex account ${j}`,disabled:l,onClick:()=>{window.confirm(`Permanently delete ${j}?
|
|
381
|
-
|
|
382
|
-
Stored Codex credentials are erased. Past request logs are kept, but lose the account reference.`)&&u()},children:s.jsx(pi,{className:"h-3 w-3"})})}),s.jsx(Ml,{children:"Delete account (permanent)"})]})]})})]})}async function $k(n,a){try{await a(),me.success(n)}catch(l){me.error(l.message||"Action failed")}}function Vk({checked:n,disabled:a,onCheckedChange:l,label:o}){return s.jsx(Ul,{role:"switch","aria-label":o,"aria-checked":n,checked:n,disabled:a,onCheckedChange:c=>l(c===!0)})}function Yk({providerId:n,providerName:a,open:l,onOpenChange:o,onImported:c}){const[u,f]=h.useState([]),[p,g]=h.useState(new Set),[v,x]=h.useState(""),[y,b]=h.useState(!0),[w,E]=h.useState(!1),[j,C]=h.useState(""),R=h.useCallback(async()=>{b(!0),C("");try{const M=await xe.post(`/api/admin/providers/${n}/discover`);f(M.models),g(new Set(M.models.filter(O=>!O.alreadyImported).map(O=>O.upstreamId)))}catch(M){C(M.message||"Unable to fetch Codex models")}finally{b(!1)}},[n]);h.useEffect(()=>{R()},[R]);const D=u.filter(M=>!v||M.upstreamId.toLowerCase().includes(v.toLowerCase())||M.displayName.toLowerCase().includes(v.toLowerCase())),A=async()=>{E(!0),C("");try{const M=await xe.post("/api/admin/models/import",{providerId:n,modelIds:Array.from(p)});me.success(`Imported ${M.imported} of ${M.requested} Codex models`),o(!1),c()}catch(M){C(M.message||"Unable to import models")}finally{E(!1)}};return s.jsx(vn,{open:l,onOpenChange:o,children:s.jsxs(un,{className:"max-w-2xl",children:[s.jsxs(dn,{children:[s.jsxs(hn,{children:["Import models from ",a]}),s.jsx(zl,{children:"Models are read from the Codex account pool. Nothing is added until you confirm."})]}),y?s.jsxs("p",{className:"flex items-center gap-2 py-6 text-sm text-muted-foreground",children:[s.jsx(mr,{className:"h-4 w-4 animate-spin"})," Fetching models…"]}):s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(Om,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Re,{className:"pl-8",placeholder:"Search models…",value:v,onChange:M=>x(M.target.value)})]}),s.jsxs("span",{className:"shrink-0 text-sm text-muted-foreground",children:[D.length," / ",u.length," · ",p.size," selected"]}),s.jsx(oe,{variant:"outline",size:"sm",onClick:()=>g(new Set(D.filter(M=>!M.alreadyImported).map(M=>M.upstreamId))),children:"Select All (new)"})]}),s.jsx("div",{className:"max-h-80 overflow-auto rounded-md border",children:D.length===0?s.jsx("p",{className:"p-4 text-sm text-muted-foreground",children:u.length===0?"The Codex account returned no models.":"No model matches your search."}):D.map(M=>s.jsxs("label",{className:"flex cursor-pointer items-center gap-3 border-b px-3 py-2 last:border-0 hover:bg-accent",children:[s.jsx(Ul,{checked:p.has(M.upstreamId),disabled:M.alreadyImported,onCheckedChange:O=>g(N=>{const _=new Set(N);return O===!0?_.add(M.upstreamId):_.delete(M.upstreamId),_})}),s.jsx("span",{className:"flex-1 text-sm",children:M.displayName}),s.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:M.upstreamId}),M.alreadyImported&&s.jsx(nt,{variant:"secondary",children:"imported"})]},M.upstreamId))}),j&&s.jsx("p",{role:"alert",className:"text-sm text-destructive",children:j})]}),s.jsxs(fn,{children:[s.jsx(oe,{variant:"outline",onClick:()=>void R(),disabled:y,children:"Refetch"}),s.jsxs(oe,{disabled:w||p.size===0,onClick:()=>void A(),children:["Import ",p.size||""]})]})]})})}const Al={name:"",slug:"",type:"openai",baseUrl:"https://api.openai.com",apiKey:"",customHeaders:"",enabled:!0},Gk="https://chatgpt.com",Kk={openai:"https://api.openai.com",anthropic:"https://api.anthropic.com",codex:Gk};function Xk(){const[n,a]=h.useState([]),[l,o]=h.useState(!1),[c,u]=h.useState(Al),[f,p]=h.useState(!1),[g,v]=h.useState(null),[x,y]=h.useState(null),[b,w]=h.useState(Al),[E,j]=h.useState(null),[C,R]=h.useState(!1),[D,A]=h.useState(null),[M,O]=h.useState({}),N=c.type!=="codex",_=async()=>{try{const B=await xe.get("/api/admin/providers");a(B.providers)}catch(B){me.error(B.message||"Unable to load providers")}};h.useEffect(()=>{_()},[]);const U=async()=>{p(!0);try{let B;if(c.customHeaders.trim())try{B=JSON.parse(c.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await xe.post("/api/admin/providers",{name:c.name,slug:c.slug||void 0,type:c.type,baseUrl:c.baseUrl,apiKey:c.type==="codex"?void 0:c.apiKey,customHeaders:B,enabled:c.enabled}),me.success(c.type==="codex"?"Codex provider created — add accounts next":"Provider created"),o(!1),u(Al);const F=await xe.get("/api/admin/providers");a(F.providers)}catch(B){me.error(B.message)}finally{p(!1)}},V=async B=>{v(B);try{const F=await xe.post(`/api/admin/providers/${B}/test`);me.success(F.ok?`Connection OK: ${F.detail}`:`Failed: ${F.detail}`),_()}catch(F){me.error(F.message)}finally{v(null)}},te=B=>{y(B.id),w({...Al,name:B.name,slug:B.slug||"",type:B.type,baseUrl:B.baseUrl,apiKey:"",customHeaders:"",enabled:B.enabled})},q=async()=>{if(x){p(!0);try{let B;if(b.customHeaders.trim())try{B=JSON.parse(b.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await xe.patch("/api/admin/providers",{id:x,name:b.name,slug:b.slug||void 0,type:b.type,baseUrl:b.baseUrl,apiKey:b.apiKey||void 0,customHeaders:B,enabled:b.enabled}),me.success("Provider updated"),y(null),w(Al),_()}catch(B){me.error(B.message)}finally{p(!1)}}},G=async B=>{R(!0);try{await xe.del(`/api/admin/providers/${B}`),me.success("Provider removed"),_()}catch(F){me.error(F.message)}finally{R(!1),j(null)}};return s.jsxs("div",{children:[s.jsx(qa,{title:"Providers",description:"Upstream LLM providers and their credentials",actions:s.jsxs(vn,{open:l,onOpenChange:o,children:[s.jsx(bi,{asChild:!0,children:s.jsxs(oe,{children:[s.jsx(mi,{className:"mr-1 h-4 w-4"})," Add provider"]})}),s.jsxs(un,{children:[s.jsxs(dn,{children:[s.jsx(hn,{children:"New provider"}),s.jsx(zl,{children:N?"API-key or compatible endpoint.":"Codex providers authenticate through imported ChatGPT accounts — no API key is stored."})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-name",children:"Name"}),s.jsx(Re,{id:"provider-name",value:c.name,onChange:B=>u({...c,name:B.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-slug",children:"Slug (optional)"}),s.jsx(Re,{id:"provider-slug",value:c.slug,onChange:B=>u({...c,slug:B.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Type"}),s.jsxs(Vn,{value:c.type,onValueChange:B=>u(F=>({...F,type:B,baseUrl:Kk[B],apiKey:B==="codex"?"":F.apiKey})),children:[s.jsx(Mn,{children:s.jsx(Yn,{})}),s.jsxs(Dn,{children:[s.jsx(tt,{value:"openai",children:"OpenAI-compatible"}),s.jsx(tt,{value:"anthropic",children:"Anthropic-compatible"}),s.jsx(tt,{value:"codex",children:"Codex OAuth"})]})]})]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-base-url",children:"Base URL"}),s.jsx(Re,{id:"provider-base-url",value:c.baseUrl,onChange:B=>u({...c,baseUrl:B.target.value})})]}),N?s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-api-key",children:"API key"}),s.jsx(Re,{id:"provider-api-key",type:"password",value:c.apiKey,onChange:B=>u({...c,apiKey:B.target.value})})]}):s.jsxs("p",{className:"rounded-md border border-dashed p-3 text-xs text-muted-foreground",children:["After creating this provider, use ",s.jsx("span",{className:"font-medium",children:"Import accounts"})," on its row to add Codex OAuth credentials."]}),s.jsxs("div",{children:[s.jsx(be,{htmlFor:"provider-headers",children:"Custom headers (JSON)"}),s.jsx(Re,{id:"provider-headers",value:c.customHeaders,onChange:B=>u({...c,customHeaders:B.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ba,{checked:c.enabled,onCheckedChange:B=>u({...c,enabled:B})}),s.jsx(be,{children:"Enabled"})]})]}),s.jsxs(fn,{children:[s.jsx(oe,{variant:"outline",onClick:()=>o(!1),children:"Cancel"}),s.jsx(oe,{disabled:f||!c.name||N&&!c.apiKey,onClick:U,children:f?"Creating…":N?"Create":"Create and add accounts"})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"All providers"}),s.jsxs(Tn,{children:[n.length," total"]})]}),s.jsx(ot,{children:s.jsxs(Gn,{children:[s.jsx(Kn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Name"}),s.jsx(ge,{children:"Type"}),s.jsx(ge,{children:"Base URL"}),s.jsx(ge,{children:"Models"}),s.jsx(ge,{children:"Health"}),s.jsx(ge,{children:"Enabled"}),s.jsx(ge,{className:"text-right",children:"Actions"})]})}),s.jsxs(Xn,{children:[n.length===0&&s.jsx(Xe,{children:s.jsx(ue,{colSpan:7,className:"text-center text-muted-foreground",children:"No providers yet."})}),n.map(B=>s.jsxs(h.Fragment,{children:[s.jsxs(Xe,{children:[s.jsxs(ue,{className:"font-medium",children:[B.name," ",s.jsx("span",{className:"text-xs text-muted-foreground",children:B.slug})]}),s.jsx(ue,{children:s.jsx(nt,{variant:"outline",children:B.type})}),s.jsx(ue,{className:"text-xs text-muted-foreground",children:B.baseUrl}),s.jsx(ue,{children:B.modelCount}),s.jsx(ue,{children:s.jsx(nt,{variant:B.health==="healthy"?"success":B.health==="down"?"destructive":"secondary",children:B.health})}),s.jsx(ue,{children:B.enabled?"Yes":"No"}),s.jsx(ue,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[B.type==="codex"&&s.jsxs(s.Fragment,{children:[s.jsxs(oe,{size:"sm",variant:M[B.id]?"secondary":"outline","aria-expanded":!!M[B.id],onClick:()=>O(F=>({...F,[B.id]:!F[B.id]})),children:[M[B.id]?s.jsx(E0,{className:"h-3 w-3"}):s.jsx(N0,{className:"h-3 w-3"}),s.jsx("span",{className:"ml-1",children:"Accounts"})]}),s.jsxs(oe,{size:"sm",variant:"outline",onClick:()=>A(B),children:[s.jsx(Dm,{className:"mr-1 h-3 w-3"})," Import models"]})]}),s.jsx(oe,{size:"sm",variant:"outline",disabled:g===B.id,onClick:()=>V(B.id),children:s.jsx(gN,{className:"h-3 w-3"})}),s.jsx(oe,{size:"sm",variant:"outline",onClick:()=>te(B),children:"✎"}),s.jsx(oe,{size:"sm",variant:"outline",onClick:()=>j(B.id),children:s.jsx(pi,{className:"h-3 w-3"})})]})})]}),B.type==="codex"&&M[B.id]&&s.jsx(Xe,{children:s.jsx(ue,{colSpan:7,className:"bg-muted/30",children:s.jsx(Hk,{providerId:B.id,providerName:B.name})})})]},B.id))]})]})})]}),D&&s.jsx(Yk,{providerId:D.id,providerName:D.name,open:!0,onOpenChange:B=>{B||A(null)},onImported:()=>void _()}),s.jsx(vn,{open:!!x,onOpenChange:B=>{B||(y(null),w(Al))},children:s.jsxs(un,{children:[s.jsx(dn,{children:s.jsx(hn,{children:"Edit provider"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Re,{value:b.name,onChange:B=>w({...b,name:B.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Slug (optional)"}),s.jsx(Re,{value:b.slug,onChange:B=>w({...b,slug:B.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Type"}),s.jsxs(Vn,{value:b.type,onValueChange:B=>w({...b,type:B}),children:[s.jsx(Mn,{children:s.jsx(Yn,{})}),s.jsxs(Dn,{children:[s.jsx(tt,{value:"openai",children:"OpenAI-compatible"}),s.jsx(tt,{value:"anthropic",children:"Anthropic-compatible"}),s.jsx(tt,{value:"codex",children:"Codex OAuth"})]})]})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Base URL"}),s.jsx(Re,{value:b.baseUrl,onChange:B=>w({...b,baseUrl:B.target.value})})]}),b.type==="codex"?s.jsxs("p",{className:"rounded-md border border-dashed p-3 text-xs text-muted-foreground",children:[s.jsx(NN,{className:"mr-1 inline h-3 w-3"})," Codex credentials live in the account pool — manage them from the Accounts panel."]}):s.jsxs("div",{children:[s.jsx(be,{children:"API key (leave empty to keep current)"}),s.jsx(Re,{type:"password",value:b.apiKey,onChange:B=>w({...b,apiKey:B.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Custom headers (JSON)"}),s.jsx(Re,{value:b.customHeaders,onChange:B=>w({...b,customHeaders:B.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ba,{checked:b.enabled,onCheckedChange:B=>w({...b,enabled:B})}),s.jsx(be,{children:"Enabled"})]})]}),s.jsxs(fn,{children:[s.jsx(oe,{variant:"outline",onClick:()=>{y(null),w(Al)},children:"Cancel"}),s.jsx(oe,{disabled:f||!b.name,onClick:q,children:"Save changes"})]})]})}),s.jsx(Lw,{open:!!E,onOpenChange:B=>{B||j(null)},children:s.jsxs(up,{children:[s.jsxs(Iw,{children:[s.jsx(dp,{children:"Delete provider?"}),s.jsx(fp,{children:"This will soft-disable the provider if models depend on it."})]}),s.jsxs(Bw,{children:[s.jsx(mp,{children:"Cancel"}),s.jsx(hp,{disabled:C,onClick:B=>{E&&(B.preventDefault(),G(E))},children:C?"Deleting…":"Delete"})]})]})})]})}function Fk(){const[n,a]=h.useState([]),[l,o]=h.useState([]),[c,u]=h.useState("all"),[f,p]=h.useState(!1),[g,v]=h.useState(""),[x,y]=h.useState([]),[b,w]=h.useState(new Set),[E,j]=h.useState(!1),[C,R]=h.useState(""),[D,A]=h.useState(""),[M,O]=h.useState(null),[N,_]=h.useState(!1),[U,V]=h.useState(null),[te,q]=h.useState(null),G=async()=>{const[I,W]=await Promise.all([xe.get("/api/admin/models"),xe.get("/api/admin/providers")]);a(I.models),o(W.providers)};h.useEffect(()=>{G()},[]);const B=n.filter(I=>!(c!=="all"&&I.providerId!==c||C&&!I.publicModelId.toLowerCase().includes(C.toLowerCase()))),F=x.filter(I=>{if(!D)return!0;const W=D.toLowerCase();return I.upstreamId.toLowerCase().includes(W)||I.displayName.toLowerCase().includes(W)}),ce=async()=>{if(g){j(!0);try{const I=await xe.post(`/api/admin/providers/${g}/discover`);y(I.models),w(new Set)}catch(I){me.error(I.message)}finally{j(!1)}}},k=async()=>{if(b.size!==0)try{const I=await xe.post("/api/admin/models/import",{providerId:g,modelIds:Array.from(b)});me.success(`Imported ${I.imported} of ${I.requested}`),p(!1),y([]),w(new Set),G()}catch(I){me.error(I.message)}},$=async()=>{if(te)try{await xe.del(`/api/admin/models/${te.id}`),me.success("Model deleted"),q(null),G()}catch(I){me.error(I.message)}},ee=async I=>{var z,H,Z;O(I),_(!0);const W=Date.now();V({phase:"streaming",startedAt:W,text:"",progress:{}});try{const re=await globalThis.fetch(`/api/admin/models/${I}/test-stream`,{method:"POST",headers:{"content-type":"application/json"},credentials:"include",body:"{}"});if(!re.ok){const fe=await re.text().catch(()=>"");V({phase:"error",model:I,error:`HTTP ${re.status}: ${fe}`});return}const he=(z=re.body)==null?void 0:z.getReader();if(!he){V({phase:"error",model:I,error:"No response body"});return}const ye=new TextDecoder;let pe="",de="",ve=!1;for(;!ve;){const{value:fe,done:De}=await he.read();ve=De,fe&&(pe+=ye.decode(fe,{stream:!0}));let Ne;for(;(Ne=pe.indexOf(`
|
|
383
|
-
|
|
384
|
-
`))>=0;){const _e=pe.slice(0,Ne);pe=pe.slice(Ne+2);const Fe=_e.split(`
|
|
385
|
-
`);let We="",se="";for(const Oe of Fe)Oe.startsWith("event: ")?We=Oe.slice(7):Oe.startsWith("data: ")&&(se=Oe.slice(6));if(se){if(We===""||We==="message")try{const Qe=(H=JSON.parse(se).choices)==null?void 0:H[0];(Z=Qe==null?void 0:Qe.delta)!=null&&Z.content&&(de+=Qe.delta.content),V(xt=>{if(!xt||xt.phase!=="streaming")return xt;const Rt=Date.now()-W,Gt=xt.progress.ttftMs??Rt;return{...xt,text:de,progress:{ttftMs:Gt,elapsedMs:Rt}}})}catch{}if(We==="test_meta")try{const Oe=JSON.parse(se);V({phase:"done",model:I,result:Oe,text:de})}catch{}if(We==="test_error")try{const Oe=JSON.parse(se);V({phase:"error",model:I,error:Oe.message})}catch{}}}}V(fe=>!fe||fe.phase==="streaming"?{phase:"error",model:I,error:"Stream ended unexpectedly"}:fe)}catch(re){V({phase:"error",model:I,error:re.message})}finally{O(null)}};return s.jsxs("div",{children:[s.jsx(qa,{title:"Models",description:"Physical models imported from providers",actions:s.jsxs(vn,{open:f,onOpenChange:p,children:[s.jsx(bi,{asChild:!0,children:s.jsxs(oe,{variant:"outline",children:[s.jsx(Dm,{className:"mr-1 h-4 w-4"})," Fetch models"]})}),s.jsxs(un,{className:"max-w-2xl",children:[s.jsx(dn,{children:s.jsx(hn,{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(Vn,{value:g,onValueChange:v,children:[s.jsx(Mn,{children:s.jsx(Yn,{placeholder:"Choose provider"})}),s.jsx(Dn,{children:l.map(I=>s.jsx(tt,{value:I.id,children:I.name},I.id))})]})}),s.jsx(oe,{onClick:ce,disabled:!g||E,children:E?"Fetching…":"Fetch"})]}),x.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(Om,{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:D,onChange:I=>A(I.target.value)}),D&&s.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>A(""),children:s.jsx(Eu,{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:[F.length," / ",x.length," · ",b.size," selected"]}),s.jsx(oe,{variant:"outline",size:"sm",onClick:()=>w(new Set(F.filter(I=>!I.alreadyImported).map(I=>I.upstreamId))),children:"Select All (new)"}),s.jsx(oe,{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:F.length===0&&x.length>0?s.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:"No models match your search."}):F.map(I=>s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(Ul,{checked:b.has(I.upstreamId),onCheckedChange:W=>{const z=new Set(b);W?z.add(I.upstreamId):z.delete(I.upstreamId),w(z)}}),s.jsx("span",{className:"font-mono text-xs",children:I.upstreamId}),I.alreadyImported&&s.jsx(nt,{variant:"secondary",children:"imported"})]},I.upstreamId))})]})]}),s.jsxs(fn,{children:[s.jsx(oe,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsxs(oe,{disabled:b.size===0,onClick:k,children:["Import ",b.size||""]})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"All models"}),s.jsxs(Tn,{children:[n.length," total"]})]}),s.jsxs(ot,{children:[s.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[s.jsxs(Vn,{value:c,onValueChange:u,children:[s.jsx(Mn,{className:"w-56",children:s.jsx(Yn,{})}),s.jsxs(Dn,{children:[s.jsx(tt,{value:"all",children:"All providers"}),l.map(I=>s.jsx(tt,{value:I.id,children:I.name},I.id))]})]}),s.jsx(Re,{className:"max-w-xs",placeholder:"Search public ID",value:C,onChange:I=>R(I.target.value)})]}),s.jsxs(Gn,{children:[s.jsx(Kn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Public ID"}),s.jsx(ge,{children:"Provider"}),s.jsx(ge,{children:"Upstream ID"}),s.jsx(ge,{children:"Capabilities"}),s.jsx(ge,{children:"Available"}),s.jsx(ge,{children:"Enabled"}),s.jsx(ge,{})]})}),s.jsxs(Xn,{children:[B.length===0&&s.jsx(Xe,{children:s.jsx(ue,{colSpan:7,className:"text-center text-muted-foreground",children:"No models"})}),B.map(I=>s.jsxs(Xe,{children:[s.jsx(ue,{className:"font-mono text-xs",children:I.publicModelId}),s.jsx(ue,{children:I.providerSlug}),s.jsx(ue,{className:"text-xs text-muted-foreground",children:I.upstreamModelId}),s.jsx(ue,{className:"space-x-1",children:Object.entries(I.capabilities).filter(([,W])=>W===!0).slice(0,4).map(([W])=>s.jsx(nt,{variant:"outline",className:"mr-1",children:W},W))}),s.jsx(ue,{children:I.upstreamAvailable?s.jsx(nt,{variant:"success",children:"up"}):s.jsx(nt,{variant:"destructive",children:"down"})}),s.jsx(ue,{children:I.enabled?"Yes":"No"}),s.jsx(ue,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(oe,{size:"sm",variant:"outline",onClick:()=>void ee(I.id),disabled:M!==null,children:[M===I.id?s.jsx(mr,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(cN,{className:"h-3.5 w-3.5"})," Test"]}),s.jsxs(oe,{size:"sm",variant:"destructive",onClick:()=>q(I),disabled:M!==null,children:[s.jsx(pi,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},I.id))]})]})]})]}),s.jsx(vn,{open:!!te,onOpenChange:I=>{I||q(null)},children:s.jsxs(un,{className:"max-w-md",children:[s.jsx(dn,{children:s.jsx(hn,{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:te==null?void 0:te.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(fn,{children:[s.jsx(oe,{variant:"outline",onClick:()=>q(null),children:"Huỷ"}),s.jsx(oe,{variant:"destructive",onClick:$,children:"Xoá"})]})]})}),s.jsx(vn,{open:N,onOpenChange:_,children:s.jsxs(un,{className:"max-w-2xl",children:[s.jsx(dn,{children:s.jsx(hn,{children:"Kết quả test model"})}),U&&U.phase==="streaming"&&s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(mr,{className:"h-4 w-4 animate-spin"})," Đang stream…",s.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["TTFT ",U.progress.ttftMs!=null?`${U.progress.ttftMs} ms`:"…"]}),s.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["· ",U.progress.elapsedMs!=null?`${U.progress.elapsedMs} ms`:"…"]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground mb-1",children:"Phản hồi (streaming)"}),s.jsxs("div",{className:"max-h-60 overflow-auto whitespace-pre-wrap rounded border bg-muted p-3 font-mono text-xs",children:[U.text||s.jsx("span",{className:"text-muted-foreground/60 animate-pulse",children:"waiting for first token…"}),U.phase==="streaming"&&s.jsx("span",{className:"ml-0.5 inline-block h-3.5 w-1.5 animate-pulse bg-primary/70"})]})]})]}),U&&U.phase==="done"&&s.jsxs("div",{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[s.jsx(nt,{variant:U.result.success?"success":"destructive",children:U.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:[U.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:U.result.ttftMs!=null?`${U.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:[U.result.usage.input," / ",U.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 font-mono text-xs",children:U.text||U.result.text||"(trống)"})]}),U.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:U.result.attempts.map((I,W)=>s.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-xs",children:[s.jsx(nt,{variant:I.success?"success":"destructive",children:I.success?"OK":"FAIL"}),s.jsxs("span",{className:"font-mono",children:[I.providerName," / ",I.modelId]}),s.jsxs("span",{className:"text-muted-foreground",children:[I.latencyMs," ms"]}),I.failureReason&&s.jsx("span",{className:"text-destructive",children:I.failureReason})]},W))})]})]}),U&&U.phase==="error"&&s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsx(nt,{variant:"destructive",children:"Thất bại"}),s.jsx("p",{className:"text-destructive",children:U.error})]}),s.jsx(fn,{children:s.jsx(oe,{variant:"outline",onClick:()=>_(!1),children:"Đóng"})})]})})]})}function Qk(){const[n,a]=h.useState([]),[l,o]=h.useState([]),[c,u]=h.useState(!1),[f,p]=h.useState(!1),[g,v]=h.useState(null),[x,y]=h.useState(!1),[b,w]=h.useState(!1),[E,j]=h.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),[C,R]=h.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),D=async()=>{const[q,G]=await Promise.all([xe.get("/api/admin/combos"),xe.get("/api/admin/models")]);a(q.combos),o(G.models)};h.useEffect(()=>{D()},[]);const A=q=>{j(G=>({...G,members:[...G.members,{modelId:q,weight:1,position:G.members.length,enabled:!0}]}))},M=q=>{j(G=>({...G,members:G.members.filter((B,F)=>F!==q).map((B,F)=>({...B,position:F}))}))},O=async()=>{if(E.members.length===0){me.error("Add at least one member");return}y(!0);try{await xe.post("/api/admin/combos",{name:E.name,slug:E.slug||void 0,mode:E.mode,enabled:E.enabled,members:E.members}),me.success("Combo created"),u(!1),j({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),D()}catch(q){me.error(q.message)}finally{y(!1)}},N=async q=>{try{const B=(await xe.get(`/api/admin/combos/${q.id}`)).combo;v(B.id),R({name:B.name,slug:B.slug??"",mode:B.mode,enabled:B.enabled,members:B.members.map(F=>({modelId:F.modelId,weight:F.weight,position:F.position,enabled:F.enabled}))}),p(!0)}catch(G){me.error(G.message)}},_=async()=>{if(g){if(C.members.length===0){me.error("Add at least one member");return}w(!0);try{await xe.patch("/api/admin/combos",{id:g,name:C.name,slug:C.slug||void 0,mode:C.mode,enabled:C.enabled,members:C.members}),me.success("Combo updated"),p(!1),v(null),D()}catch(q){me.error(q.message)}finally{w(!1)}}},U=q=>{R(G=>({...G,members:[...G.members,{modelId:q,weight:1,position:G.members.length,enabled:!0}]}))},V=q=>{R(G=>({...G,members:G.members.filter((B,F)=>F!==q).map((B,F)=>({...B,position:F}))}))},te=async q=>{if(confirm("Delete this combo?"))try{await xe.del(`/api/admin/combos/${q}`),me.success("Combo removed"),D()}catch(G){me.error(G.message)}};return s.jsxs("div",{children:[s.jsx(qa,{title:"Combos",description:"Virtual models combining physical models",actions:s.jsxs(vn,{open:c,onOpenChange:u,children:[s.jsx(bi,{asChild:!0,children:s.jsxs(oe,{children:[s.jsx(mi,{className:"mr-1 h-4 w-4"})," New combo"]})}),s.jsxs(un,{className:"max-w-2xl",children:[s.jsx(dn,{children:s.jsx(hn,{children:"New combo"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Re,{value:E.name,onChange:q=>j({...E,name:q.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Slug (optional — leave empty to use the name as the model ID)"}),s.jsx(Re,{value:E.slug,onChange:q=>j({...E,slug:q.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Mode"}),s.jsxs(Vn,{value:E.mode,onValueChange:q=>j({...E,mode:q}),children:[s.jsx(Mn,{children:s.jsx(Yn,{})}),s.jsxs(Dn,{children:[s.jsx(tt,{value:"fallback",children:"Fallback (ordered)"}),s.jsx(tt,{value:"weighted_round_robin",children:"Weighted round-robin"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ba,{checked:E.enabled,onCheckedChange:q=>j({...E,enabled:q})}),s.jsx(be,{children:"Enabled"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Members"}),s.jsx(Yb,{models:l,addedIds:E.members.map(q=>q.modelId),onAdd:A}),s.jsx("div",{className:"mt-2 space-y-1",children:E.members.map((q,G)=>{var B;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:(B=l.find(F=>F.id===q.modelId))==null?void 0:B.publicModelId}),s.jsx(Re,{type:"number",min:1,value:q.weight,onChange:F=>{const ce=Number(F.target.value);j(k=>({...k,members:k.members.map(($,ee)=>ee===G?{...$,weight:ce}:$)}))},className:"w-20"}),s.jsx(oe,{size:"sm",variant:"outline",onClick:()=>M(G),children:"Remove"})]},G)})})]})]}),s.jsxs(fn,{children:[s.jsx(oe,{variant:"outline",onClick:()=>u(!1),children:"Cancel"}),s.jsx(oe,{disabled:!E.name||x,onClick:O,children:x?"Creating…":"Create"})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"All combos"}),s.jsxs(Tn,{children:[n.length," total"]})]}),s.jsx(ot,{children:s.jsxs(Gn,{children:[s.jsx(Kn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Public ID"}),s.jsx(ge,{children:"Mode"}),s.jsx(ge,{children:"Members"}),s.jsx(ge,{children:"Healthy"}),s.jsx(ge,{children:"Enabled"}),s.jsx(ge,{})]})}),s.jsxs(Xn,{children:[n.length===0&&s.jsx(Xe,{children:s.jsx(ue,{colSpan:6,className:"text-center text-muted-foreground",children:"No combos yet."})}),n.map(q=>s.jsxs(Xe,{children:[s.jsx(ue,{className:"font-mono text-xs",children:q.publicModelId}),s.jsx(ue,{children:s.jsx(nt,{variant:"outline",children:q.mode})}),s.jsx(ue,{children:q.memberCount}),s.jsx(ue,{children:q.healthyMemberCount}),s.jsx(ue,{children:q.enabled?"Yes":"No"}),s.jsx(ue,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(oe,{size:"sm",variant:"outline",onClick:()=>void N(q),children:[s.jsx(SN,{className:"h-3.5 w-3.5"})," Sửa"]}),s.jsxs(oe,{size:"sm",variant:"destructive",onClick:()=>te(q.id),children:[s.jsx(pi,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},q.id))]})]})})]}),s.jsx(vn,{open:f,onOpenChange:p,children:s.jsxs(un,{className:"max-w-2xl",children:[s.jsx(dn,{children:s.jsx(hn,{children:"Edit combo"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Re,{value:C.name,onChange:q=>R({...C,name:q.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Slug (optional — leave empty to use the name as the model ID)"}),s.jsx(Re,{value:C.slug,onChange:q=>R({...C,slug:q.target.value}),placeholder:"empty → gpt-5.5 · set → combo/gpt-5.5"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Mode"}),s.jsxs(Vn,{value:C.mode,onValueChange:q=>R({...C,mode:q}),children:[s.jsx(Mn,{children:s.jsx(Yn,{})}),s.jsxs(Dn,{children:[s.jsx(tt,{value:"fallback",children:"Fallback (ordered)"}),s.jsx(tt,{value:"weighted_round_robin",children:"Weighted round-robin"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ba,{checked:C.enabled,onCheckedChange:q=>R({...C,enabled:q})}),s.jsx(be,{children:"Enabled"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Members"}),s.jsx(Yb,{models:l,addedIds:C.members.map(q=>q.modelId),onAdd:U}),s.jsx("div",{className:"mt-2 space-y-1",children:C.members.map((q,G)=>{var B;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:(B=l.find(F=>F.id===q.modelId))==null?void 0:B.publicModelId}),s.jsx(Re,{type:"number",min:1,value:q.weight,onChange:F=>{const ce=Number(F.target.value);R(k=>({...k,members:k.members.map(($,ee)=>ee===G?{...$,weight:ce}:$)}))},className:"w-20"}),s.jsx(oe,{size:"sm",variant:"outline",onClick:()=>V(G),children:"Remove"})]},G)})})]})]}),s.jsxs(fn,{children:[s.jsx(oe,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsx(oe,{disabled:!C.name||b,onClick:_,children:b?"Saving…":"Save"})]})]})})]})}function Yb({models:n,addedIds:a,onAdd:l}){const[o,c]=h.useState(""),f=(o?n.filter(p=>{const g=o.toLowerCase();return p.publicModelId.toLowerCase().includes(g)||p.displayName.toLowerCase().includes(g)}):n).filter(p=>!a.includes(p.id));return s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Om,{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:o,onChange:p=>c(p.target.value)}),o&&s.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>c(""),children:s.jsx(Eu,{className:"h-4 w-4"})})]}),f.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:f.map(p=>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:p.publicModelId}),s.jsx(oe,{size:"sm",variant:"ghost",onClick:()=>l(p.id),children:"+ Add"})]},p.id))})]})}function Zk(){const[n,a]=h.useState([]),[l,o]=h.useState([]),[c,u]=h.useState([]),[f,p]=h.useState(!1),[g,v]=h.useState({alias:"",targetKind:"model",targetId:"",enabled:!0}),x=async()=>{const[b,w,E]=await Promise.all([xe.get("/api/admin/aliases"),xe.get("/api/admin/models"),xe.get("/api/admin/combos")]);a(b.aliases),o(w.models),u(E.combos)};h.useEffect(()=>{x()},[]);const y=async()=>{try{await xe.post("/api/admin/aliases",g),me.success("Alias created"),p(!1),v({alias:"",targetKind:"model",targetId:"",enabled:!0}),x()}catch(b){me.error(b.message)}};return s.jsxs("div",{children:[s.jsx(qa,{title:"Aliases",description:"Stable client-visible names for models or combos",actions:s.jsxs(vn,{open:f,onOpenChange:p,children:[s.jsx(bi,{asChild:!0,children:s.jsxs(oe,{children:[s.jsx(mi,{className:"mr-1 h-4 w-4"})," New alias"]})}),s.jsxs(un,{children:[s.jsx(dn,{children:s.jsx(hn,{children:"New alias"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Alias"}),s.jsx(Re,{value:g.alias,onChange:b=>v({...g,alias:b.target.value}),placeholder:"coding"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Target type"}),s.jsxs(Vn,{value:g.targetKind,onValueChange:b=>v({...g,targetKind:b}),children:[s.jsx(Mn,{children:s.jsx(Yn,{})}),s.jsxs(Dn,{children:[s.jsx(tt,{value:"model",children:"Model"}),s.jsx(tt,{value:"combo",children:"Combo"})]})]})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Target"}),s.jsxs(Vn,{value:g.targetId,onValueChange:b=>v({...g,targetId:b}),children:[s.jsx(Mn,{children:s.jsx(Yn,{placeholder:"Choose target"})}),s.jsx(Dn,{children:(g.targetKind==="model"?l:c).map(b=>s.jsx(tt,{value:b.id,children:b.publicModelId},b.id))})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ba,{checked:g.enabled,onCheckedChange:b=>v({...g,enabled:b})}),s.jsx(be,{children:"Enabled"})]})]}),s.jsxs(fn,{children:[s.jsx(oe,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsx(oe,{disabled:!g.alias||!g.targetId,onClick:y,children:"Create"})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"All aliases"}),s.jsxs(Tn,{children:[n.length," total"]})]}),s.jsx(ot,{children:s.jsxs(Gn,{children:[s.jsx(Kn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Alias"}),s.jsx(ge,{children:"Target"}),s.jsx(ge,{children:"Type"}),s.jsx(ge,{children:"Enabled"}),s.jsx(ge,{})]})}),s.jsxs(Xn,{children:[n.length===0&&s.jsx(Xe,{children:s.jsx(ue,{colSpan:5,className:"text-center text-muted-foreground",children:"No aliases yet."})}),n.map(b=>s.jsxs(Xe,{children:[s.jsx(ue,{className:"font-mono text-xs",children:b.alias}),s.jsx(ue,{className:"font-mono text-xs",children:b.targetName??b.targetId}),s.jsx(ue,{children:s.jsx(nt,{variant:"outline",children:b.targetKind})}),s.jsx(ue,{children:b.enabled?"Yes":"No"}),s.jsx(ue,{className:"text-right",children:s.jsx(oe,{size:"sm",variant:"outline",onClick:async()=>{await xe.del(`/api/admin/aliases/${b.id}`),me.success("Removed"),x()},children:"Delete"})})]},b.id))]})]})})]})]})}function Jk(){const[n,a]=h.useState([]),[l,o]=h.useState([]),[c,u]=h.useState([]),[f,p]=h.useState(!1),[g,v]=h.useState(null),[x,y]=h.useState(null),[b,w]=h.useState(null),[E,j]=h.useState({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),C=async()=>{const[N,_,U]=await Promise.all([xe.get("/api/admin/api-keys"),xe.get("/api/admin/models"),xe.get("/api/admin/combos")]);a(N.apiKeys),o(_.models),u(U.combos)};h.useEffect(()=>{C()},[]);const R=async()=>{try{if(g){await xe.patch("/api/admin/api-keys",{id:g,name:E.name,expiresAt:E.expiresAt||null,allowAllModels:E.allowAll,permissions:E.allowAll?[]:E.permissions,rpmLimit:E.rpmLimit?Number(E.rpmLimit):null,tpmLimit:E.tpmLimit?Number(E.tpmLimit):null,maxConcurrent:E.concurrency?Number(E.concurrency):null}),p(!1),v(null),j({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),me.success("Key updated"),C();return}const N=await xe.post("/api/admin/api-keys",{name:E.name,expiresAt:E.expiresAt||null,allowAllModels:E.allowAll,permissions:E.allowAll?void 0:E.permissions,rpmLimit:E.rpmLimit?Number(E.rpmLimit):null,tpmLimit:E.tpmLimit?Number(E.tpmLimit):null,maxConcurrent:E.concurrency?Number(E.concurrency):null,...E.customSecret.trim()?{secret:E.customSecret.trim()}:{}});p(!1),y({secret:N.secret,name:N.name}),j({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),C()}catch(N){me.error(N.message)}},D=async N=>{try{const U=((await xe.get(`/api/admin/api-keys/${N.id}`)).apiKey.permissions??[]).filter(V=>V.targetKind==="model"||V.targetKind==="combo");v(N.id),j({name:N.name,expiresAt:N.expiresAt?N.expiresAt.slice(0,16):"",allowAll:N.allowAllModels,permissions:U,rpmLimit:N.rpmLimit!=null?String(N.rpmLimit):"",tpmLimit:N.tpmLimit!=null?String(N.tpmLimit):"",concurrency:N.concurrencyLimit!=null?String(N.concurrencyLimit):"",customSecret:""}),p(!0)}catch(_){me.error(_.message)}},A=()=>{p(!1),v(null),j({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""})},M=async(N,_)=>{try{await xe.patch("/api/admin/api-keys",{id:N,enabled:!_}),me.success(_?"Key disabled":"Key enabled"),C()}catch(U){me.error(U.message)}},O=async N=>{if(window.confirm("Delete this API key? This cannot be undone."))try{await xe.del(`/api/admin/api-keys/${N}`),me.success("Key deleted"),C()}catch(_){me.error(_.message)}};return s.jsxs("div",{children:[s.jsx(qa,{title:"API Keys",description:"Gateway bearer keys for client applications",actions:s.jsxs(vn,{open:f,onOpenChange:N=>{N?p(!0):A()},children:[s.jsx(bi,{asChild:!0,children:s.jsxs(oe,{children:[s.jsx(mi,{className:"mr-1 h-4 w-4"})," New key"]})}),s.jsxs(un,{className:"max-w-2xl",children:[s.jsx(dn,{children:s.jsx(hn,{children:g?"Edit API key":"New API key"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Re,{value:E.name,onChange:N=>j({...E,name:N.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Expires (optional)"}),s.jsx(Re,{type:"datetime-local",value:E.expiresAt,onChange:N=>j({...E,expiresAt:N.target.value})})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[s.jsxs("div",{children:[s.jsx(be,{children:"RPM limit"}),s.jsx(Re,{value:E.rpmLimit,onChange:N=>j({...E,rpmLimit:N.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"TPM limit"}),s.jsx(Re,{value:E.tpmLimit,onChange:N=>j({...E,tpmLimit:N.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Concurrency"}),s.jsx(Re,{value:E.concurrency,onChange:N=>j({...E,concurrency:N.target.value}),type:"number"})]})]}),!g&&s.jsxs("div",{children:[s.jsx(be,{children:"Key value (optional)"}),s.jsx(Re,{value:E.customSecret,onChange:N=>j({...E,customSecret:N.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(Ba,{checked:E.allowAll,onCheckedChange:N=>j({...E,allowAll:N})}),s.jsx(be,{children:"Allow all current and future models"})]}),!E.allowAll&&s.jsxs("div",{children:[s.jsx(be,{children:"Scope"}),s.jsx("div",{className:"max-h-48 space-y-1 overflow-auto rounded border p-2",children:[...l.map(N=>({targetKind:"model",targetId:N.id,label:N.publicModelId})),...c.map(N=>({targetKind:"combo",targetId:N.id,label:N.publicModelId}))].map(N=>{const _=E.permissions.some(U=>U.targetKind===N.targetKind&&U.targetId===N.targetId);return s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(Ul,{checked:_,onCheckedChange:U=>{j(V=>({...V,permissions:U?[...V.permissions,{targetKind:N.targetKind,targetId:N.targetId}]:V.permissions.filter(te=>!(te.targetKind===N.targetKind&&te.targetId===N.targetId))}))}}),s.jsx("span",{className:"font-mono text-xs",children:N.label}),s.jsx(nt,{variant:"outline",className:"ml-1",children:N.targetKind})]},`${N.targetKind}:${N.targetId}`)})})]})]}),s.jsxs(fn,{children:[s.jsx(oe,{variant:"outline",onClick:A,children:"Cancel"}),s.jsx(oe,{disabled:!E.name,onClick:R,children:g?"Save changes":"Create"})]})]})]})}),s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"All keys"}),s.jsxs(Tn,{children:[n.length," total"]})]}),s.jsx(ot,{children:s.jsxs(Gn,{children:[s.jsx(Kn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Name"}),s.jsx(ge,{children:"Prefix"}),s.jsx(ge,{children:"Status"}),s.jsx(ge,{children:"Scope"}),s.jsx(ge,{children:"RPM/TPM/Conc"}),s.jsx(ge,{})]})}),s.jsxs(Xn,{children:[n.length===0&&s.jsx(Xe,{children:s.jsx(ue,{colSpan:6,className:"text-center text-muted-foreground",children:"No API keys yet."})}),n.map(N=>s.jsxs(Xe,{children:[s.jsx(ue,{className:"font-medium",children:N.name}),s.jsxs(ue,{className:"font-mono text-xs",children:[N.keyPrefix,"…"]}),s.jsx(ue,{children:N.enabled?s.jsx(nt,{variant:"success",children:"enabled"}):s.jsx(nt,{variant:"destructive",children:"disabled"})}),s.jsx(ue,{children:N.allowAllModels?"all":`${N.modelScopeCount} scoped`}),s.jsx(ue,{className:"text-xs",children:[N.rpmLimit,N.tpmLimit,N.concurrencyLimit].map((_,U)=>_?["","RPM","TPM","Conc"][U+1]:null).filter(Boolean).join(" / ")||"—"}),s.jsx(ue,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[N.secret&&s.jsxs(s.Fragment,{children:[s.jsx(oe,{size:"sm",variant:"ghost",title:"Copy secret",onClick:()=>{navigator.clipboard.writeText(N.secret),me.success("Copied")},children:s.jsx(tu,{className:"h-3.5 w-3.5"})}),s.jsx(oe,{size:"sm",variant:"ghost",title:"Show secret",onClick:()=>w({secret:N.secret,name:N.name}),children:s.jsx(oN,{className:"h-3.5 w-3.5"})})]}),s.jsx(oe,{size:"sm",variant:"ghost",title:"Edit",onClick:()=>void D(N),children:s.jsx(pN,{className:"h-3.5 w-3.5"})}),s.jsxs(oe,{size:"sm",variant:"outline",onClick:()=>M(N.id,N.enabled),children:[N.enabled?s.jsx(FE,{className:"mr-1 h-3.5 w-3.5"}):s.jsx(Cu,{className:"mr-1 h-3.5 w-3.5"}),N.enabled?"Disable":"Enable"]}),s.jsx(oe,{size:"sm",variant:"destructive",onClick:()=>O(N.id),children:s.jsx(pi,{className:"h-3.5 w-3.5"})})]})})]},N.id))]})]})})]}),s.jsx(vn,{open:!!x,onOpenChange:N=>{N||y(null)},children:s.jsxs(un,{children:[s.jsxs(dn,{children:[s.jsx(hn,{children:"API key created"}),s.jsx(zl,{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:x==null?void 0:x.secret}),s.jsxs(fn,{children:[s.jsxs(oe,{onClick:()=>{x&&(navigator.clipboard.writeText(x.secret),me.success("Copied"))},children:[s.jsx(tu,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(oe,{variant:"outline",onClick:()=>y(null),children:"I have saved it"})]})]})}),s.jsx(vn,{open:!!b,onOpenChange:N=>{N||w(null)},children:s.jsxs(un,{children:[s.jsxs(dn,{children:[s.jsxs(hn,{children:["API key: ",b==null?void 0:b.name]}),s.jsx(zl,{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:b==null?void 0:b.secret}),s.jsxs(fn,{children:[s.jsxs(oe,{onClick:()=>{b&&(navigator.clipboard.writeText(b.secret),me.success("Copied"))},children:[s.jsx(tu,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(oe,{variant:"outline",onClick:()=>w(null),children:"Close"})]})]})})]})}const Wk=3e3;function e4(n,a){return!(a.success!=="all"&&n.success!==(a.success==="true")||a.protocol!=="all"&&n.protocol!==a.protocol||a.streaming!=="all"&&n.streaming!==(a.streaming==="true")||a.model&&!n.requestedModel.toLowerCase().includes(a.model.toLowerCase()))}function t4(){const[n,a]=h.useState([]),[l,o]=h.useState(0),[c,u]=h.useState(0),[f,p]=h.useState({success:"all",protocol:"all",streaming:"all",model:""}),[g,v]=h.useState(null),[x,y]=h.useState(null),[b,w]=h.useState(0),E=50,j=h.useRef(Date.now()),C=h.useRef(new Set),R=h.useRef(f);R.current=f;const D=h.useRef(c);D.current=c;const A=h.useCallback(async()=>{const O=new URLSearchParams;O.set("limit",String(E)),O.set("offset",String(c)),f.success!=="all"&&O.set("success",f.success),f.protocol!=="all"&&O.set("protocol",f.protocol),f.streaming!=="all"&&O.set("streaming",f.streaming),f.model&&O.set("requestedModel",f.model);const N=await xe.get(`/api/admin/requests?${O.toString()}`);a(N.requests),o(N.total);for(const _ of N.requests)C.current.add(_.id)},[c,f]);h.useEffect(()=>{A()},[A]),h.useEffect(()=>{w(0)},[c,f]),h.useEffect(()=>{let O=!1,N=null;const _=new Set,U=()=>{O||(N=new EventSource(`/api/admin/requests/stream?since=${j.current}`),N.addEventListener("request",V=>{if(!O)try{const te=JSON.parse(V.data),q=new Date(te.createdAt).getTime();if(Number.isFinite(q)&&(j.current=Math.max(j.current,q)),C.current.has(te.id))return;C.current.add(te.id),w(G=>G+1),D.current===0&&e4(te,R.current)&&(a(G=>G.some(B=>B.id===te.id)?G:[te,...G].slice(0,E)),o(G=>G+1))}catch{}}),N.onerror=()=>{N==null||N.close(),N=null,O||_.add(setTimeout(U,Wk))})};return U(),()=>{O=!0,N==null||N.close();for(const V of _)clearTimeout(V);_.clear()}},[]);const M=async O=>{v(O);const N=await xe.get(`/api/admin/requests/${O}`);y(N)};return s.jsxs("div",{children:[s.jsx(qa,{title:"Requests",description:`${l} matching · live updates`}),s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(Vn,{value:f.success,onValueChange:O=>{u(0),p({...f,success:O})},children:[s.jsx(Mn,{className:"w-36",children:s.jsx(Yn,{})}),s.jsxs(Dn,{children:[s.jsx(tt,{value:"all",children:"All"}),s.jsx(tt,{value:"true",children:"Success"}),s.jsx(tt,{value:"false",children:"Failed"})]})]}),s.jsxs(Vn,{value:f.protocol,onValueChange:O=>{u(0),p({...f,protocol:O})},children:[s.jsx(Mn,{className:"w-32",children:s.jsx(Yn,{})}),s.jsxs(Dn,{children:[s.jsx(tt,{value:"all",children:"Any protocol"}),s.jsx(tt,{value:"openai",children:"OpenAI"}),s.jsx(tt,{value:"anthropic",children:"Anthropic"})]})]}),s.jsxs(Vn,{value:f.streaming,onValueChange:O=>{u(0),p({...f,streaming:O})},children:[s.jsx(Mn,{className:"w-32",children:s.jsx(Yn,{})}),s.jsxs(Dn,{children:[s.jsx(tt,{value:"all",children:"Any"}),s.jsx(tt,{value:"true",children:"Streaming"}),s.jsx(tt,{value:"false",children:"Non-stream"})]})]}),s.jsx(Re,{className:"max-w-xs",placeholder:"Model contains…",value:f.model,onChange:O=>{u(0),p({...f,model:O.target.value})}}),b>0&&s.jsxs(oe,{size:"sm",variant:"secondary",onClick:()=>{w(0),A()},children:[b," new request",b>1?"s":""," — refresh"]})]}),s.jsx(st,{className:"mt-3 text-base",children:"Results"})]}),s.jsxs(ot,{children:[s.jsxs(Gn,{children:[s.jsx(Kn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Time"}),s.jsx(ge,{children:"Status"}),s.jsx(ge,{children:"Requested"}),s.jsx(ge,{children:"Final"}),s.jsx(ge,{children:"Tokens"}),s.jsx(ge,{children:"Latency"}),s.jsx(ge,{children:"Attempts"}),s.jsx(ge,{children:"Key"}),s.jsx(ge,{children:"IP"}),s.jsx(ge,{})]})}),s.jsxs(Xn,{children:[n.length===0&&s.jsx(Xe,{children:s.jsx(ue,{colSpan:10,className:"text-center text-muted-foreground",children:"No requests yet."})}),n.map(O=>s.jsxs(Xe,{className:"cursor-pointer",onClick:()=>M(O.id),children:[s.jsx(ue,{className:"text-xs",children:km(O.createdAt)}),s.jsx(ue,{children:O.success?s.jsx(nt,{variant:"success",children:O.httpStatus}):s.jsx(nt,{variant:"destructive",children:O.httpStatus})}),s.jsx(ue,{className:"font-mono text-xs",children:O.requestedModel}),s.jsx(ue,{className:"font-mono text-xs text-muted-foreground",children:O.finalModelPublicId??"—"}),s.jsxs(ue,{className:"text-xs",children:[Vt(O.inputTokens+O.outputTokens)," ",O.cacheReadTokens?s.jsxs("span",{className:"text-amber-600",children:["(+",O.cacheReadTokens," cache)"]}):null]}),s.jsxs(ue,{className:"text-xs",children:[Ol(O.totalLatencyMs),O.ttftMs?s.jsxs("span",{className:"text-muted-foreground",children:[" · ttft ",O.ttftMs,"ms"]}):null]}),s.jsxs(ue,{className:"text-xs",children:[O.attemptsCount,O.gatewayCacheHit?s.jsx(nt,{variant:"secondary",className:"ml-1",children:"cache"}):null]}),s.jsx(ue,{className:"text-xs",children:O.apiKeyName??"—"}),s.jsx(ue,{className:"text-xs",children:O.clientIp}),s.jsx(ue,{className:"text-right",children:s.jsx(oe,{size:"sm",variant:"ghost",children:"View"})})]},O.id))]})]}),s.jsxs("div",{className:"mt-3 flex items-center justify-between",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:["Showing ",c+1,"–",Math.min(c+E,l)," of ",l]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(oe,{size:"sm",variant:"outline",disabled:c===0,onClick:()=>u(Math.max(0,c-E)),children:"Prev"}),s.jsx(oe,{size:"sm",variant:"outline",disabled:c+E>=l,onClick:()=>u(c+E),children:"Next"})]})]})]})]}),s.jsx(vn,{open:!!g,onOpenChange:O=>{O||(v(null),y(null))},children:s.jsxs(un,{className:"max-w-3xl",children:[s.jsx(dn,{children:s.jsxs(hn,{children:["Request ",oR(g,16)]})}),x?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"}),x.request.success?s.jsx(nt,{variant:"success",children:x.request.httpStatus}):s.jsx(nt,{variant:"destructive",children:x.request.httpStatus})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Latency"}),Ol(x.request.totalLatencyMs)]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Tokens"}),"in ",Vt(x.request.inputTokens)," · out ",Vt(x.request.outputTokens)," · cache ",Vt(x.request.cacheReadTokens)]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Attempts"}),x.request.attemptsCount]})]}),x.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:[x.request.errorType,": ",x.request.errorMessage]})]}),x.request.requestPayload&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Request content"}),s.jsx("pre",{className:"max-h-60 overflow-auto rounded bg-muted p-2 font-mono text-xs whitespace-pre-wrap",children:x.request.requestPayload})]}),x.request.responsePayload&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Response content"}),s.jsx("pre",{className:"max-h-60 overflow-auto rounded bg-muted p-2 font-mono text-xs whitespace-pre-wrap",children:x.request.responsePayload})]}),x.attempts.length>0&&s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-muted-foreground",children:"Attempts"}),s.jsxs(Gn,{children:[s.jsx(Kn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"#"}),s.jsx(ge,{children:"Provider"}),s.jsx(ge,{children:"Model"}),s.jsx(ge,{children:"Status"}),s.jsx(ge,{children:"Latency"}),s.jsx(ge,{children:"Reason"})]})}),s.jsx(Xn,{children:x.attempts.map(O=>s.jsxs(Xe,{children:[s.jsx(ue,{children:O.attemptNumber}),s.jsx(ue,{children:O.providerName}),s.jsx(ue,{className:"font-mono text-xs",children:O.modelPublicId}),s.jsx(ue,{children:O.success?s.jsx(nt,{variant:"success",children:String(O.statusCode??"OK")}):s.jsx(nt,{variant:"destructive",children:String(O.statusCode??"err")})}),s.jsx(ue,{className:"text-xs",children:Ol(O.latencyMs)}),s.jsx(ue,{className:"text-xs",children:O.failureReason??O.selectionReason})]},O.id))})]})]})]}):s.jsx("div",{className:"text-muted-foreground",children:"Loading…"})]})})]})}var n4=Object.defineProperty,to=(n,a)=>n4(n,"name",{value:a,configurable:!0}),Up="Tabs",[a4,c5]=_n(Up,[Uu]),kS=Uu(),[r4,Ip]=a4(Up),l4=h.forwardRef(to(function(a,l){const{__scopeTabs:o,value:c,onValueChange:u,defaultValue:f,orientation:p="horizontal",dir:g,activationMode:v="automatic",...x}=a,y=vi(g),[b,w]=La({prop:c,onChange:u,defaultProp:f??"",caller:Up});return s.jsx(r4,{scope:o,baseId:ja(),value:b,onValueChange:w,orientation:p,dir:y,activationMode:v,children:s.jsx(Pe.div,{dir:y,"data-orientation":p,...x,ref:l})})},"Tabs")),s4="TabsList",o4=h.forwardRef(to(function(a,l){const{__scopeTabs:o,loop:c=!0,...u}=a,f=Ip(s4,o),p=kS(o);return s.jsx($1,{asChild:!0,...p,orientation:f.orientation,dir:f.dir,loop:c,children:s.jsx(Pe.div,{role:"tablist","aria-orientation":f.orientation,...u,ref:l})})},"TabsList")),i4="TabsTrigger",c4=h.forwardRef(to(function(a,l){const{__scopeTabs:o,value:c,disabled:u=!1,...f}=a,p=Ip(i4,o),g=kS(o),v=Bp(p.baseId,c),x=Pp(p.baseId,c),y=c===p.value;return s.jsx(V1,{asChild:!0,...g,focusable:!u,active:y,children:s.jsx(Pe.button,{type:"button",role:"tab","aria-selected":y,"aria-controls":x,"data-state":y?"active":"inactive","data-disabled":u?"":void 0,disabled:u,id:v,...f,ref:l,onMouseDown:je(a.onMouseDown,b=>{!u&&b.button===0&&b.ctrlKey===!1?p.onValueChange(c):b.preventDefault()}),onKeyDown:je(a.onKeyDown,b=>{u||b.target!==b.currentTarget||[" ","Enter"].includes(b.key)&&p.onValueChange(c)}),onFocus:je(a.onFocus,()=>{const b=p.activationMode!=="manual";!y&&!u&&b&&p.onValueChange(c)})})})},"TabsTrigger")),u4="TabsContent",d4=h.forwardRef(to(function(a,l){const{__scopeTabs:o,value:c,forceMount:u,children:f,...p}=a,g=Ip(u4,o),v=Bp(g.baseId,c),x=Pp(g.baseId,c),y=c===g.value,b=h.useRef(y);return h.useEffect(()=>{const w=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(w)},[]),s.jsx(jr,{present:u||y,children:({present:w})=>s.jsx(Pe.div,{"data-state":y?"active":"inactive","data-orientation":g.orientation,role:"tabpanel","aria-labelledby":v,hidden:!w,id:x,tabIndex:0,...p,ref:l,style:{...a.style,animationDuration:b.current?"0s":void 0},children:w&&f})})},"TabsContent"));function Bp(n,a){return`${n}-trigger-${a}`}to(Bp,"makeTriggerId");function Pp(n,a){return`${n}-content-${a}`}to(Pp,"makeContentId");var f4=l4,zS=o4,LS=c4,US=d4;const IS=f4,Hp=h.forwardRef(({className:n,...a},l)=>s.jsx(zS,{ref:l,className:Ee("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",n),...a}));Hp.displayName=zS.displayName;const hr=h.forwardRef(({className:n,...a},l)=>s.jsx(LS,{ref:l,className:Ee("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",n),...a}));hr.displayName=LS.displayName;const Ls=h.forwardRef(({className:n,...a},l)=>s.jsx(US,{ref:l,className:Ee("mt-2 ring-offset-background focus-visible:outline-none",n),...a}));Ls.displayName=US.displayName;const h4=3e3,m4=1600,p4=10,g4=3,v4=12,x4=10*6e4;function y4(n,a){return{...n,totalRequests:n.totalRequests+1,successfulRequests:n.successfulRequests+(a.success?1:0),failedRequests:n.failedRequests+(a.success?0:1),successRate:n.totalRequests+1?(n.successfulRequests+(a.success?1:0))/(n.totalRequests+1):0,inputTokens:n.inputTokens+a.inputTokens,outputTokens:n.outputTokens+a.outputTokens,totalTokens:n.totalTokens+a.inputTokens+a.outputTokens,cacheReadTokens:n.cacheReadTokens+a.cacheReadTokens,averageLatencyMs:(n.averageLatencyMs*n.totalRequests+a.totalLatencyMs)/(n.totalRequests+1)}}function b4(n){const[a,l]=h.useState(null),[o,c]=h.useState(null),[u,f]=h.useState([]),[p,g]=h.useState([]),[v,x]=h.useState([]),[y,b]=h.useState([]),[w,E]=h.useState(!0),[j,C]=h.useState(null),R=h.useRef([]),D=h.useRef(null),A=h.useRef(new Set),M=h.useRef(Date.now()),O=h.useRef(0),N=h.useRef([]),_=h.useRef([]);return h.useEffect(()=>{let U=!1;return E(!0),C(null),A.current=new Set,M.current=Date.now(),xe.get(`/api/admin/stats?preset=${n}`).then(V=>{if(!U){l(V),c(V.summary),D.current=V.summary,f(V.recent),g(V.providers),R.current=V.providers;for(const te of V.recent)A.current.add(te.id);E(!1)}}).catch(V=>{U||(C(V.message),E(!1))}),()=>{U=!0}},[n]),h.useEffect(()=>{let U=!1,V=null;const te=new Set,q=()=>{U||(V=new EventSource(`/api/admin/requests/stream?since=${M.current}`),V.addEventListener("request",B=>{if(!U)try{const F=JSON.parse(B.data),ce=new Date(F.createdAt).getTime();if(Number.isFinite(ce)&&(M.current=Math.max(M.current,ce)),A.current.has(F.id))return;if(A.current.add(F.id),D.current&&c(y4(D.current,F)),f(k=>k.some($=>$.id===F.id)?k:[F,...k].slice(0,p4)),F.providerId){R.current=R.current.map(I=>I.id===F.providerId?{...I,requests:I.requests+1,errorRate:I.requests+1?(I.errorRate*I.requests+(F.success?0:1))/(I.requests+1):0}:I),g(R.current);const k=`p${++O.current}`,$={id:k,providerId:F.providerId,success:F.success};N.current=[...N.current.slice(-(g4*4)),$],x(N.current);const ee=setTimeout(()=>{N.current=N.current.filter(I=>I.id!==k),x(N.current)},m4);te.add(ee)}_.current.some(k=>k.id===F.id)&&(_.current=_.current.filter(k=>k.id!==F.id),b(_.current))}catch{}}),V.addEventListener("request_started",B=>{if(!U)try{const F=JSON.parse(B.data);if(!F.providerId||F.providerId==="")return;_.current=[..._.current.filter(ce=>ce.id!==F.requestId).slice(-(v4-1)),{id:F.requestId,providerId:F.providerId,startedAt:Date.now(),ttftMs:F.ttftMs??0}],b(_.current)}catch{}}),V.onerror=()=>{V==null||V.close(),V=null,U||te.add(setTimeout(q,h4))})};q();const G=setInterval(()=>{const B=Date.now()-x4;_.current.some(F=>F.startedAt<B)&&(_.current=_.current.filter(F=>F.startedAt>=B),b(_.current))},3e4);return()=>{U=!0,V==null||V.close();for(const B of te)clearTimeout(B);te.clear(),clearInterval(G)}},[]),h.useEffect(()=>{const U=setInterval(()=>{xe.get("/api/admin/providers").then(V=>{const te=new Map(V.providers.map(q=>[q.id,q]));R.current=R.current.map(q=>{const G=te.get(q.id);return G?{...q,health:G.health,enabled:G.enabled}:q}),g(R.current)}).catch(()=>{})},3e4);return()=>clearInterval(U)},[]),{snapshot:a,live:o??(a==null?void 0:a.summary)??w4,recent:u,providers:p,pulses:v,activeRoutes:y,loading:w,error:j}}const w4={totalRequests:0,successfulRequests:0,failedRequests:0,successRate:0,inputTokens:0,outputTokens:0,totalTokens:0,cacheReadTokens:0,cacheWriteTokens:0,reasoningTokens:0,averageLatencyMs:0,p95LatencyMs:0,averageTtftMs:null,p95TtftMs:null,cacheHitRate:0,gatewayCacheHitRate:0,fallbackRate:0};function BS({data:n,className:a,strokeClass:l="stroke-primary",fillClass:o}){if(n.length===0)return s.jsx("svg",{className:Ee("h-6 w-20",a),viewBox:"0 0 80 24"});const f=Math.max(...n),p=Math.min(...n),g=f-p||1,x=n.map((y,b)=>{const w=b/(n.length-1)*78+1,E=22-(y-p)/g*20;return`${w.toFixed(1)},${E.toFixed(1)}`}).join(" ");return s.jsxs("svg",{className:Ee("h-6 w-20",a),viewBox:"0 0 80 24",preserveAspectRatio:"none",children:[o&&s.jsx("polygon",{points:`1,23 ${x} 79,23`,className:o}),s.jsx("polyline",{points:x,fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:l})]})}function S4(n,a,l){const o=performance.now();let c=0;const u=f=>{const p=Math.min((f-o)/a,1),g=Math.round(n*p);g!==c&&(c=g,l(g)),p<1&&requestAnimationFrame(u)};requestAnimationFrame(u)}function j4({delta:n,inverse:a}){if(Math.abs(n)<.005)return null;const l=n>0,o=a?!l:l,c=`${(Math.abs(n)*100).toFixed(1)}%`;return s.jsxs("span",{className:Ee("ml-1.5 inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-semibold leading-none",o?"bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300":"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"),children:[s.jsx("span",{className:"mr-0.5",children:l?"▲":"▼"}),c]})}function Wr({icon:n,label:a,value:l,format:o="number",delta:c,deltaInverse:u,sparkData:f,sparkStroke:p}){const[g,v]=h.useState(0),x=h.useRef(0);h.useEffect(()=>{const b=x.current,w=l;x.current=l,b!==w&&S4(Math.abs(w-b),600,E=>v(b+(w>b?E:-E)))},[l]);const y=o==="percent"?Nu(g):o==="latency"?Ol(g):Vt(Math.round(g));return s.jsxs(rt,{children:[s.jsxs(lt,{className:"flex flex-row items-center justify-between pb-1",children:[s.jsxs(st,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[s.jsx(n,{className:"h-4 w-4"}),a]}),c!==void 0&&s.jsx(j4,{delta:c,inverse:u})]}),s.jsxs(ot,{className:"flex items-end justify-between",children:[s.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:y}),f&&f.length>1&&s.jsx(BS,{data:f,strokeClass:p??"stroke-primary",fillClass:"fill-primary/10"})]})]})}const PS=1e3,Gb=380,Fc=60,el=PS/2,tl=720,_h=62,C4=260;function E4(n){return n==="healthy"?"fill-emerald-400":n==="degraded"?"fill-amber-400":"fill-red-400"}function Qc(n,a,l,o){const c=n+(l-n)*.45,u=n+(l-n)*.55;return`M${n},${a} C${c},${a} ${u},${o} ${l},${o}`}function N4({liveRequests:n,successRate:a,providers:l,pulses:o,activeRoutes:c}){const u=Gb/2,f=u,p=Math.max(1,l.reduce((x,y)=>x+y.requests,0)),g=new Set(c.map(x=>x.providerId)),v=g.size>0;return s.jsxs(rt,{children:[s.jsx(lt,{className:"pb-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(st,{className:"text-base",children:"Real-time Request Routing"}),s.jsxs("div",{className:"flex items-center gap-3 text-xs text-muted-foreground",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-emerald-400"})," healthy"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-amber-400"})," degraded"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"inline-block h-2 w-2 rounded-full bg-red-400"})," down"]})]})]})}),s.jsx(ot,{className:"pt-0",children:s.jsx("div",{className:"relative w-full",children:s.jsxs("svg",{viewBox:`0 0 ${PS} ${Gb}`,className:"w-full h-auto",preserveAspectRatio:"xMidYMid meet",children:[s.jsx("defs",{children:s.jsxs("filter",{id:"glow",x:"-50%",y:"-50%",width:"200%",height:"200%",children:[s.jsx("feGaussianBlur",{stdDeviation:"3",result:"blur"}),s.jsxs("feMerge",{children:[s.jsx("feMergeNode",{in:"blur"}),s.jsx("feMergeNode",{in:"SourceGraphic"})]})]})}),l.map(x=>{const b=60+l.indexOf(x)*_h,w=x.requests/p,E=Math.max(1.5,Math.min(6,2+w*8)),j=g.has(x.id);return s.jsxs("g",{children:[j&&s.jsx("path",{d:Qc(el,u,tl-20,b),fill:"none",stroke:"hsl(var(--primary) / 0.25)",strokeWidth:E+6,strokeLinecap:"round"}),s.jsx("path",{d:Qc(el,u,tl-20,b),fill:"none",stroke:j?"hsl(var(--primary))":"hsl(var(--border))",strokeWidth:j?E+1:E,strokeLinecap:"round",opacity:j?.95:.6,className:j?"route-active":void 0})]},x.id)}),s.jsx("path",{d:Qc(Fc+30,f,el-30,u),fill:"none",stroke:v?"hsl(var(--primary))":"hsl(var(--border))",strokeWidth:3,strokeLinecap:"round",strokeDasharray:"6 3",opacity:v?.9:.5,className:v?"route-active":void 0}),o.map(x=>{const y=l.findIndex(j=>j.id===x.providerId);if(y===-1)return null;const b=60+y*_h,w=Qc(el,u,tl-20,b),E=x.success?"var(--primary)":"#f87171";return s.jsxs("g",{filter:"url(#glow)",children:[s.jsx("circle",{r:5,fill:E,opacity:.9,children:s.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})}),s.jsx("circle",{r:9,fill:E,opacity:.25,children:s.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})})]},x.id)}),s.jsx("circle",{cx:Fc,cy:f,r:28,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1.5}),s.jsx("text",{x:Fc,y:f-4,textAnchor:"middle",className:"fill-foreground",fontSize:12,fontWeight:600,children:Kb(n)}),s.jsx("text",{x:Fc,y:f+10,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"requests"}),s.jsx("circle",{cx:el,cy:u,r:36,fill:"hsl(var(--card))",stroke:"var(--primary)",strokeWidth:2}),s.jsx("image",{x:el-12,y:u-16,width:24,height:24,href:"/logo.png"}),s.jsx("text",{x:el,y:u+28,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"AI Gateway"}),s.jsxs("text",{x:el,y:u+38,textAnchor:"middle",className:"fill-emerald-500",fontSize:10,fontWeight:600,children:[(a*100).toFixed(1),"%"]}),l.map((x,y)=>{const b=60+y*_h,w=x.requests/p,E=!x.enabled||x.requests===0;return s.jsxs("g",{opacity:E?.4:1,children:[s.jsx("rect",{x:tl-20,y:b-14,width:C4,height:50,rx:8,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1}),s.jsx("circle",{cx:tl-6,cy:b+10,r:4,className:E4(x.health)}),s.jsx("text",{x:tl+6,y:b-2,className:"fill-foreground",fontSize:12,fontWeight:500,children:x.name}),s.jsxs("text",{x:tl+6,y:b+12,className:"fill-muted-foreground",fontSize:10,children:[x.modelCount," model",x.modelCount!==1?"s":""," · ",Kb(x.requests)," req"]}),s.jsxs("text",{x:tl+6,y:b+25,className:"fill-muted-foreground",fontSize:10,children:[(w*100).toFixed(1),"% traffic · ",x.avgLatencyMs<1e3?`${Math.round(x.avgLatencyMs)}ms`:`${(x.avgLatencyMs/1e3).toFixed(1)}s`," avg",x.errorRate>0&&s.jsxs("tspan",{className:"fill-red-500",children:[" · ",(x.errorRate*100).toFixed(0),"% err"]})]})]},x.id)})]})})})]})}function Kb(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}K`:String(n)}function R4({rows:n}){return s.jsxs(rt,{children:[s.jsx(lt,{className:"pb-2",children:s.jsx(st,{className:"text-base",children:"Recent Requests"})}),s.jsx(ot,{children:n.length===0?s.jsx("div",{className:"py-6 text-center text-sm text-muted-foreground",children:"No requests yet — traffic will appear here live."}):s.jsxs(Gn,{children:[s.jsx(Kn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Model"}),s.jsx(ge,{children:"Provider"}),s.jsx(ge,{children:"Tokens"}),s.jsx(ge,{children:"Status"}),s.jsx(ge,{children:"Time"})]})}),s.jsx(Xn,{children:n.map(a=>s.jsxs(Xe,{children:[s.jsx(ue,{className:"font-mono text-xs",children:a.requestedModel}),s.jsx(ue,{className:"text-xs text-muted-foreground",children:a.providerName??"—"}),s.jsxs(ue,{className:"text-xs",children:[s.jsxs("span",{className:"font-mono",children:["in ",Vt(a.inputTokens)," · out ",Vt(a.outputTokens)]}),a.cacheReadTokens>0&&s.jsxs("span",{className:"ml-1 text-amber-600",children:["(+",Vt(a.cacheReadTokens)," cache)"]})]}),s.jsx(ue,{children:s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx("span",{className:a.success?"h-2 w-2 rounded-full bg-emerald-400":"h-2 w-2 rounded-full bg-red-400"}),s.jsx("span",{className:"text-xs",children:a.success?a.httpStatus:`${a.httpStatus} err`})]})}),s.jsx(ue,{className:"text-xs text-muted-foreground",children:iR(a.createdAt)})]},a.id))})]})})]})}const hm=34,Xb=2*Math.PI*hm;function T4(n){return n>=.95?{stroke:"#4ade80",text:"text-emerald-500"}:n>=.8?{stroke:"#fbbf24",text:"text-amber-500"}:{stroke:"#f87171",text:"text-red-500"}}function A4({successRate:n,averageLatencyMs:a,latencySpark:l}){const{stroke:o,text:c}=T4(n),u=Math.min(1,Math.max(0,n)),f=Xb*(1-u);return s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs(rt,{children:[s.jsx(lt,{className:"pb-2",children:s.jsx(st,{className:"text-base",children:"Success Rate"})}),s.jsxs(ot,{className:"flex items-center gap-4",children:[s.jsxs("div",{className:"relative h-20 w-20",children:[s.jsxs("svg",{viewBox:"0 0 80 80",className:"h-20 w-20 -rotate-90",children:[s.jsx("circle",{cx:"40",cy:"40",r:hm,fill:"none",stroke:"hsl(var(--border))",strokeWidth:7}),s.jsx("circle",{cx:"40",cy:"40",r:hm,fill:"none",stroke:o,strokeWidth:7,strokeLinecap:"round",strokeDasharray:Xb,strokeDashoffset:f,style:{transition:"stroke-dashoffset 0.6s ease, stroke 0.4s ease"}})]}),s.jsx("span",{className:`absolute inset-0 flex items-center justify-center text-sm font-semibold tabular-nums ${c}`,children:Nu(n)})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Share of requests that completed successfully over the selected window. Updated in real time."})]})]}),s.jsxs(rt,{children:[s.jsx(lt,{className:"pb-2",children:s.jsx(st,{className:"text-base",children:"Average Latency"})}),s.jsxs(ot,{className:"flex items-end justify-between",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-2xl font-semibold tabular-nums",children:Ol(a)}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Live average across the selected window"})]}),s.jsx(BS,{data:l,strokeClass:"stroke-amber-500",fillClass:"fill-amber-500/10",className:"h-10 w-28"})]})]})]})}function M4(){const[n,a]=h.useState("7d"),{snapshot:l,live:o,recent:c,providers:u,pulses:f,activeRoutes:p,loading:g,error:v}=b4(n);if(g)return s.jsx("div",{className:"text-muted-foreground",children:"Loading…"});if(v||!l)return s.jsxs("div",{className:"text-destructive",children:["Failed to load statistics: ",v??"unknown error"]});const x=o,y=l.previous,b=l.series;function w(C,R){return R>0?(C-R)/R:void 0}const E=b.map(C=>C.requests),j=b.map(C=>C.avgLatency);return s.jsxs("div",{children:[s.jsx(qa,{title:"Statistics",description:"Real-time monitoring dashboard",actions:s.jsx(IS,{value:n,onValueChange:C=>void a(C),children:s.jsxs(Hp,{children:[s.jsx(hr,{value:"today",children:"Today"}),s.jsx(hr,{value:"7d",children:"7 days"}),s.jsx(hr,{value:"30d",children:"30 days"})]})})}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsx(Wr,{icon:C0,label:"Requests",value:x.totalRequests,delta:w(x.totalRequests,y.totalRequests),sparkData:E}),s.jsx(Wr,{icon:Cu,label:"Success rate",format:"percent",value:x.successRate,delta:w(x.successRate,y.successRate),sparkData:E,sparkStroke:"stroke-emerald-500"}),s.jsx(Wr,{icon:rN,label:"Total tokens",value:x.totalTokens,delta:w(x.totalTokens,y.totalTokens),sparkData:b.map(C=>C.inputTokens+C.outputTokens)}),s.jsx(Wr,{icon:lN,label:"Cache hit rate",format:"percent",value:x.cacheHitRate,delta:w(x.cacheHitRate,y.cacheHitRate),sparkData:b.map(C=>C.cacheRead)}),s.jsx(Wr,{icon:tN,label:"Avg latency",format:"latency",value:x.averageLatencyMs,delta:w(x.averageLatencyMs,y.averageLatencyMs),deltaInverse:!0,sparkData:j,sparkStroke:"stroke-amber-500"}),s.jsx(Wr,{icon:R0,label:"p95 latency",format:"latency",value:x.p95LatencyMs}),s.jsx(Wr,{icon:CN,label:"Avg TTFT",format:"latency",value:x.averageTtftMs??0}),s.jsx(Wr,{icon:xN,label:"Fallback rate",format:"percent",value:x.fallbackRate,delta:w(x.fallbackRate,y.fallbackRate),deltaInverse:!0})]}),s.jsx("div",{className:"mt-6",children:s.jsx(N4,{liveRequests:x.totalRequests,successRate:x.successRate,providers:u,pulses:f,activeRoutes:p})}),s.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-3",children:[s.jsx("div",{className:"lg:col-span-2",children:s.jsx(R4,{rows:c})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs(rt,{children:[s.jsx(lt,{className:"pb-2",children:s.jsx(st,{className:"text-base",children:"Top Models"})}),s.jsx(ot,{children:s.jsxs(Gn,{children:[s.jsx(Kn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Model"}),s.jsx(ge,{children:"Req"}),s.jsx(ge,{children:"Errors"}),s.jsx(ge,{children:"Tokens"})]})}),s.jsxs(Xn,{children:[l.topModels.length===0&&s.jsx(Xe,{children:s.jsx(ue,{colSpan:4,className:"text-muted-foreground text-center",children:"No data"})}),l.topModels.map(C=>s.jsxs(Xe,{children:[s.jsx(ue,{className:"font-mono text-xs",children:C.publicId}),s.jsx(ue,{className:"text-xs",children:Vt(C.requests)}),s.jsx(ue,{className:"text-xs",children:s.jsx("span",{className:C.errorRate>.1?"text-destructive":"text-muted-foreground",children:Nu(C.errorRate)})}),s.jsx(ue,{className:"text-xs",children:Vt(C.totalTokens)})]},C.publicId))]})]})})]}),s.jsxs(rt,{children:[s.jsx(lt,{className:"pb-2",children:s.jsx(st,{className:"text-base",children:"Top API Keys"})}),s.jsx(ot,{children:s.jsxs(Gn,{children:[s.jsx(Kn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Key"}),s.jsx(ge,{children:"Requests"}),s.jsx(ge,{children:"Tokens"})]})}),s.jsxs(Xn,{children:[l.topApiKeys.length===0&&s.jsx(Xe,{children:s.jsx(ue,{colSpan:3,className:"text-muted-foreground text-center",children:"No data"})}),l.topApiKeys.map((C,R)=>s.jsxs(Xe,{children:[s.jsx(ue,{className:"text-xs",children:C.name}),s.jsx(ue,{className:"text-xs",children:Vt(C.requests)}),s.jsx(ue,{className:"text-xs",children:Vt(C.totalTokens)})]},R))]})]})})]})]})]}),s.jsx("div",{className:"mt-6",children:s.jsx(A4,{successRate:x.successRate,averageLatencyMs:x.averageLatencyMs,latencySpark:j})})]})}function D4(){const[n,a]=h.useState([]),[l,o]=h.useState(0);return h.useEffect(()=>{xe.get("/api/admin/audit?limit=200").then(c=>{a(c.rows),o(c.total)})},[]),s.jsxs("div",{children:[s.jsx(qa,{title:"Audit Logs",description:`${l} entries · immutable`}),s.jsxs(rt,{children:[s.jsx(lt,{children:s.jsx(st,{className:"text-base",children:"All entries"})}),s.jsx(ot,{children:s.jsxs(Gn,{children:[s.jsx(Kn,{children:s.jsxs(Xe,{children:[s.jsx(ge,{children:"Time"}),s.jsx(ge,{children:"Action"}),s.jsx(ge,{children:"Status"}),s.jsx(ge,{children:"Target"}),s.jsx(ge,{children:"IP"}),s.jsx(ge,{children:"Actor"})]})}),s.jsxs(Xn,{children:[n.length===0&&s.jsx(Xe,{children:s.jsx(ue,{colSpan:6,className:"text-center text-muted-foreground",children:"No audit events yet."})}),n.map(c=>s.jsxs(Xe,{children:[s.jsx(ue,{className:"text-xs",children:km(c.createdAt)}),s.jsx(ue,{className:"font-mono text-xs",children:c.action}),s.jsx(ue,{children:c.success?s.jsx(nt,{variant:"success",children:"ok"}):s.jsx(nt,{variant:"destructive",children:"fail"})}),s.jsx(ue,{className:"text-xs",children:c.targetName??c.targetId??"—"}),s.jsx(ue,{className:"text-xs",children:c.ip}),s.jsx(ue,{className:"text-xs",children:c.actor})]},c.id))]})]})})]})]})}const mm={enabled:!0,sound:!0};let ui=mm,pm=!1,Zc=null;const gm=new Set;function HS(){for(const n of gm)n()}function qS(n=!1){return pm&&!n?Promise.resolve():(!n&&Zc||(Zc=(async()=>{try{const a=await xe.get("/api/admin/settings");ui={enabled:a.settings.notificationsEnabled??mm.enabled,sound:a.settings.notificationSoundEnabled??mm.sound},pm=!0,HS()}catch{}})()),Zc)}async function Fb(n){const a={};n.enabled!==void 0&&(a.notificationsEnabled=n.enabled),n.sound!==void 0&&(a.notificationSoundEnabled=n.sound),await xe.patch("/api/admin/settings",a),ui={...ui,...n},pm=!0,HS()}function O4(n){return gm.add(n),()=>gm.delete(n)}function $S(){return h.useSyncExternalStore(O4,()=>ui,()=>ui)}function _4(){const[n]=IE(),[a,l]=h.useState(null),[o,c]=h.useState(null),[u,f]=h.useState({current:"",next:""}),[p,g]=h.useState(""),[v,x]=h.useState(""),[y,b]=h.useState(null),[w,E]=h.useState(!1),[j,C]=h.useState("idle"),[R,D]=h.useState(null),A=async(se=!1)=>{C("checking"),D(null);try{const Oe=await xe.get(`/api/admin/update/check${se?"?force=1":""}`);b(Oe),C("idle")}catch(Oe){D(Oe.message),C("error")}},M=async()=>{E(!0),C("installing"),D(null);try{const se=await xe.post("/api/admin/update/run");C("restarting"),me.success(se.message||"Update started — the gateway will restart shortly.");const Oe=setInterval(()=>{fetch("/health").then(Qe=>{Qe.ok&&(clearInterval(Oe),window.location.reload())}).catch(()=>{})},3e3);setTimeout(()=>clearInterval(Oe),12e4)}catch(se){me.error(se.message),D(se.message),C("error")}finally{E(!1)}},[O,N]=h.useState("disabled"),[_,U]=h.useState(""),[V,te]=h.useState(""),[q,G]=h.useState(""),[B,F]=h.useState([]),[ce,k]=h.useState(""),[$,ee]=h.useState(""),[I,W]=h.useState(!1),[z,H]=h.useState(null),[Z,re]=h.useState(""),[he,ye]=h.useState(""),[pe,de]=h.useState(""),ve=async()=>{const se=await xe.get("/api/admin/settings");l(se.settings),g(se.settings.adminIpAllow??""),x(se.settings.adminIpBlock??"");const Oe=await xe.get("/api/admin/settings/system");c(Oe);try{const Qe=await xe.get("/api/admin/me");N(Qe.totpEnabled?"enabled":"disabled")}catch{}};if(h.useEffect(()=>{qS(!0)},[]),h.useEffect(()=>{ve(),A(!0)},[]),!a)return s.jsx("div",{className:"text-muted-foreground",children:"Loading…"});const fe=async se=>{try{await xe.patch("/api/admin/settings",se),me.success("Saved"),ve()}catch(Oe){me.error(Oe.message)}},De=async()=>{try{const se=await xe.post("/api/admin/account/totp/begin");U(se.secret),te(se.qr),N("setup"),me.info("Scan the QR code with your authenticator app")}catch(se){me.error(se.message)}},Ne=async()=>{if(!q||q.length!==6){me.error("Enter a 6-digit code");return}try{const se=await xe.post("/api/admin/account/totp/verify",{code:q});F(se.recoveryCodes),N("showingRecovery"),me.success("TOTP enabled successfully")}catch(se){me.error(se.message)}},_e=async()=>{if(!ce){me.error("Enter your password");return}if(!$){me.error("Enter a TOTP code or recovery code");return}try{await xe.post("/api/admin/account/totp/disable",{password:ce,totp:$}),N("disabled"),k(""),ee(""),me.success("TOTP disabled"),ve()}catch(se){me.error(se.message)}},Fe=async()=>{W(!0);try{const se=await xe.post("/api/admin/account/totp/recovery/regenerate",{password:ce,totp:$});F(se.recoveryCodes),N("showingRecovery"),me.success("Recovery codes regenerated")}catch(se){me.error(se.message)}W(!1)},We=n.get("tab")||"logging";return s.jsxs("div",{children:[s.jsx(qa,{title:"Settings",description:"Logging, security, backup, and system info"}),s.jsxs(IS,{defaultValue:We,children:[s.jsxs(Hp,{children:[s.jsx(hr,{value:"logging",children:"Logging"}),s.jsx(hr,{value:"access",children:"Access Control"}),s.jsx(hr,{value:"security",children:"Security"}),s.jsx(hr,{value:"backup",children:"Backup"}),s.jsx(hr,{value:"system",children:"System"})]}),s.jsx(Ls,{value:"logging",children:s.jsxs(rt,{children:[s.jsx(lt,{children:s.jsx(st,{className:"text-base",children:"Logging policy"})}),s.jsxs(ot,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Request-content logging"}),s.jsxs(Vn,{value:a.contentLogMode,onValueChange:se=>fe({contentLogMode:se}),children:[s.jsx(Mn,{children:s.jsx(Yn,{})}),s.jsxs(Dn,{children:[s.jsx(tt,{value:"off",children:"Off"}),s.jsx(tt,{value:"metadata",children:"Metadata only (default)"}),s.jsx(tt,{value:"prompt",children:"Prompt (sanitized)"}),s.jsx(tt,{value:"prompt_and_response",children:"Prompt + response (sanitized)"})]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Retention (days)"}),s.jsx(Re,{type:"number",min:1,max:3650,value:a.retentionDays,onChange:se=>fe({retentionDays:Number(se.target.value)})})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Database size limit (MB)"}),s.jsx(Re,{type:"number",min:64,value:a.dbSizeLimitMb,onChange:se=>fe({dbSizeLimitMb:Number(se.target.value)})})]}),s.jsx("div",{className:"flex items-center gap-2 pt-2",children:s.jsx(oe,{onClick:async()=>{const se=await xe.post("/api/admin/settings/cleanup");me.success(`Deleted ${se.deletedRequests} old requests`)},children:"Run cleanup now"})})]})]})}),s.jsx(Ls,{value:"access",children:s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"IP access control"}),s.jsx(Tn,{children:"Allowlist / Blocklist for this admin website (not model traffic)"})]}),s.jsxs(ot,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(be,{children:"Allow only these IPs"}),s.jsx(yu,{placeholder:`192.168.1.0/24
|
|
386
|
-
10.0.0.1`,value:p,onChange:se=>g(se.target.value)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Newlines-delimited CIDR ranges (IPv4 only). Leave empty = no allow restrictions. When you save a non-empty list, your current IP is auto-added to prevent lockout."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(be,{children:"Block these IPs"}),s.jsx(yu,{placeholder:"192.168.1.100",value:v,onChange:se=>x(se.target.value)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:'Newlines-delimited CIDR ranges (IPv4 only). Blocked IPs are rejected with "Không có quyền truy cập" before any login page.'})]}),s.jsx(oe,{onClick:()=>{const se={};p!==((a==null?void 0:a.adminIpAllow)??"")&&(se.adminIpAllow=p||null),v!==((a==null?void 0:a.adminIpBlock)??"")&&(se.adminIpBlock=v||null),xe.patch("/api/admin/settings",se).then(Oe=>{me.success("Saved"+(Oe.addedIp?` — added your IP: ${Oe.addedIp}`:"")),ve(),g(""),x("")}).catch(Oe=>me.error(Oe.message))},children:"Save access control"}),s.jsxs("div",{className:"rounded bg-amber-50 border border-amber-200 p-3 dark:bg-amber-950/20 dark:border-amber-800",children:[s.jsx("p",{className:"text-sm font-medium text-amber-900 dark:text-amber-200",children:"⚠️ If you enable an allow list, you cannot access the gateway unless your IP matches."}),s.jsx("p",{className:"text-xs text-amber-800 dark:text-amber-300",children:"The server automatically adds your current IP when you save — but if you configure it from a different machine, that machine will be locked out immediately."})]})]})]})}),s.jsx(Ls,{value:"security",children:s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"Security"}),s.jsx(Tn,{children:"Change password, 2FA, and trusted proxy configuration"})]}),s.jsxs(ot,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(be,{children:"Trusted proxy hops"}),s.jsx(Re,{type:"number",min:0,max:8,value:a.trustProxyHops,onChange:se=>fe({trustProxyHops:Number(se.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(be,{className:"text-base",children:"TOTP 2FA"}),O==="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,O==="disabled"?s.jsx("span",{className:"rounded bg-muted px-2 py-0.5 text-xs font-medium text-muted-foreground",children:"Disabled"}):null]}),O==="disabled"&&s.jsx(oe,{variant:"outline",onClick:De,children:"Enable TOTP"}),O==="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."}),V&&s.jsx("img",{src:V,alt:"TOTP QR code",className:"h-40 w-40"}),s.jsxs("div",{className:"text-xs font-mono text-muted-foreground",children:["Secret: ",_]}),s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(be,{children:"Verify code"}),s.jsx(Re,{value:q,onChange:se=>G(se.target.value),placeholder:"123456",maxLength:6})]}),s.jsx(oe,{disabled:q.length<6,onClick:Ne,children:"Verify & enable"})]})]}),O==="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:B.map((se,Oe)=>s.jsx("div",{className:"font-mono text-xs",children:se},Oe))}),s.jsx(oe,{onClick:()=>{N("enabled"),me.success("Recovery codes saved")},children:"I have saved them"})]}),O==="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(be,{children:"Password"}),s.jsx(Re,{type:"password",value:ce,onChange:se=>k(se.target.value),placeholder:"Current password"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"TOTP code"}),s.jsx(Re,{value:$,onChange:se=>ee(se.target.value),placeholder:"123456",maxLength:6})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(oe,{variant:"outline",size:"sm",disabled:I||!ce||$.length<6,onClick:Fe,children:"Regenerate recovery codes"}),s.jsx(oe,{variant:"destructive",size:"sm",disabled:!ce||$.length<6,onClick:_e,children:"Disable TOTP"})]})]})]}),s.jsxs("div",{className:"space-y-2 border-t pt-4",children:[s.jsx(be,{children:"Change password"}),s.jsx(Re,{type:"password",placeholder:"Current password",value:u.current,onChange:se=>f({...u,current:se.target.value})}),s.jsx(Re,{type:"password",placeholder:"New password (12+ chars)",value:u.next,onChange:se=>f({...u,next:se.target.value})}),s.jsx(oe,{disabled:!u.current||u.next.length<12,onClick:async()=>{try{await xe.post("/api/admin/account/password",{currentPassword:u.current,newPassword:u.next}),me.success("Password changed"),f({current:"",next:""})}catch(se){me.error(se.message)}},children:"Change password"})]})]})]})}),s.jsx(Ls,{value:"backup",children:s.jsxs(rt,{children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"Backup & restore"}),s.jsx(Tn,{children:"Download a snapshot or restore from a previous backup"})]}),s.jsxs(ot,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-2 rounded border p-3",children:[s.jsx(be,{children:"Backup passphrase (6 digits)"}),s.jsx(Re,{inputMode:"numeric",maxLength:6,value:Z,onChange:se=>re(se.target.value.replace(/\D/g,"")),placeholder:"123456"}),s.jsx(Re,{inputMode:"numeric",maxLength:6,value:he,onChange:se=>ye(se.target.value.replace(/\D/g,"")),placeholder:"Repeat passphrase"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"This passphrase encrypts the master key inside the backup. You must enter the same 6 digits when importing on a new instance. Without it, encrypted provider credentials cannot be recovered."})]}),s.jsx(oe,{disabled:Z.length!==6||Z!==he,onClick:async()=>{try{const se=await fetch("/api/admin/backup/create",{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify({passphrase:Z})});if(!se.ok)throw new Error("Backup failed");const Oe=await se.blob(),Qe=URL.createObjectURL(Oe),xt=document.createElement("a");xt.href=Qe,xt.download="latedev-backup.json",xt.click(),URL.revokeObjectURL(Qe),me.success("Backup downloaded"),re(""),ye("")}catch(se){me.error(se.message)}},children:"Download backup"}),s.jsxs("div",{className:"space-y-2 rounded border p-3",children:[s.jsx(be,{children:"Backup passphrase for restore"}),s.jsx(Re,{inputMode:"numeric",maxLength:6,value:pe,onChange:se=>de(se.target.value.replace(/\D/g,"")),placeholder:"123456"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Use the 6-digit passphrase entered when the backup was created. It is required to restore the master key and administrator access."})]}),s.jsxs(Lw,{open:z!==null,onOpenChange:se=>{se||H(null)},children:[s.jsx(jO,{asChild:!0,children:s.jsxs("div",{children:[s.jsx(be,{children:"Restore from backup file"}),s.jsx(Re,{type:"file",accept:".json,application/json","data-testid":"restore-file",onChange:se=>{var Qe;const Oe=(Qe=se.target.files)==null?void 0:Qe[0];H(Oe??null)}})]})}),s.jsxs(up,{children:[s.jsxs(Iw,{children:[s.jsx(dp,{children:"Restore backup?"}),s.jsxs(fp,{children:["Restoring will replace the entire current database with the selected backup (",(z==null?void 0:z.name)??"file","). This cannot be undone. A snapshot of the current database is kept for rollback only if validation fails."]})]}),s.jsxs(Bw,{children:[s.jsx(mp,{children:"Cancel"}),s.jsx(hp,{onClick:async()=>{var Oe,Qe;const se=z;if(se)try{const xt=JSON.parse(await se.text()),Rt=await fetch("/api/admin/backup/restore",{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify({backup:xt,passphrase:pe})});if(!Rt.ok)throw new Error(((Qe=(Oe=await Rt.json())==null?void 0:Oe.error)==null?void 0:Qe.message)??"Restore failed");me.success("Restored. Reloading…"),H(null),setTimeout(()=>location.reload(),600)}catch(xt){me.error(xt.message)}},children:"Restore"})]})]})]})]})]})}),s.jsxs(Ls,{value:"system",children:[s.jsxs(rt,{children:[s.jsx(lt,{children:s.jsx(st,{className:"text-base",children:"System"})}),s.jsxs(ot,{className:"space-y-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"App version:"})," ",o==null?void 0:o.appVersion]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Data directory:"})," ",s.jsx("span",{className:"font-mono",children:o==null?void 0:o.dataDir})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Encryption:"})," ",o!=null&&o.masterKeyConfigured?"Configured":"Not configured"," (v",o==null?void 0:o.masterKeyVersion,")"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Environment:"})," ",o==null?void 0:o.environment]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(Ba,{checked:a.gatewayCacheEnabled,onCheckedChange:se=>fe({gatewayCacheEnabled:se})}),s.jsx(be,{children:"Gateway response cache (disabled by default)"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Cache TTL (s)"}),s.jsx(Re,{type:"number",min:1,value:a.gatewayCacheDefaultTtlSeconds,onChange:se=>fe({gatewayCacheDefaultTtlSeconds:Number(se.target.value)})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Cache max size (MB)"}),s.jsx(Re,{type:"number",min:1,value:a.gatewayCacheMaxSizeMb,onChange:se=>fe({gatewayCacheMaxSizeMb:Number(se.target.value)})})]})]}),s.jsx(oe,{variant:"outline",onClick:async()=>{const se=await xe.post("/api/admin/settings/cache/clear");me.success(`Cleared ${se.deleted} entries`)},children:"Clear gateway cache"})]})]}),s.jsx(k4,{}),s.jsxs(rt,{className:"mt-4",children:[s.jsxs(lt,{children:[s.jsx(st,{className:"text-base",children:"Updates"}),s.jsx(Tn,{children:"Automatic updates from the npm registry"})]}),s.jsxs(ot,{className:"space-y-3 text-sm",children:[j==="checking"&&!y&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(mr,{className:"h-4 w-4 animate-spin"})," Checking for updates…"]}),y&&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",y.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:y.latestVersion?`v${y.latestVersion}`:"—"})]}),y.status.docker?s.jsx(nt,{variant:"secondary",children:y.status.watchtower?"Docker + Watchtower":"Docker"}):y.latestVersion===null?s.jsx(nt,{variant:"secondary",children:"Registry unreachable"}):y.hasUpdate?s.jsx(nt,{variant:"success",children:"Update available"}):s.jsxs(nt,{variant:"outline",children:[s.jsx(Cu,{className:"mr-1 h-3 w-3"})," Up to date"]})]}),y.status.docker&&y.status.watchtower&&y.watchtowerReachable&&s.jsx("p",{className:"text-muted-foreground",children:"Watchtower pulls new images automatically every hour — or use Update now for an instant update."}),y.status.docker&&y.status.watchtower&&y.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"}),"."]}),y.status.docker&&!y.status.watchtower&&s.jsx("p",{className:"text-muted-foreground",children:y.status.reason??"This instance runs in Docker — update by pulling the new image tag."}),!y.status.docker&&y.latestVersion===null&&s.jsxs("p",{className:"text-muted-foreground",children:["Could not reach the npm registry (offline or blocked). ",R&&s.jsx("span",{className:"text-destructive",children:R})]}),j==="installing"&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(mr,{className:"h-4 w-4 animate-spin"})," Applying the update… this can take a minute."]}),j==="restarting"&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(mr,{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:[y.hasUpdate&&j==="idle"&&(!y.status.docker||y.status.watchtower&&y.watchtowerReachable!==!1)&&s.jsxs(oe,{disabled:w||y.status.docker&&y.watchtowerReachable===!1,onClick:M,children:[s.jsx(Dm,{className:"mr-1 h-4 w-4"})," Update now"]}),y.hasUpdate&&y.changelogUrl&&s.jsx(oe,{variant:"outline",asChild:!0,children:s.jsx("a",{href:y.changelogUrl,target:"_blank",rel:"noreferrer",children:"View changes"})}),j==="idle"&&s.jsx(oe,{variant:"ghost",disabled:w,onClick:()=>A(!0),children:"Check again"})]})]})]})]})]})]})]})}function k4(){const n=$S();return s.jsxs(rt,{className:"mt-4",children:[s.jsx(lt,{children:s.jsxs(st,{className:"text-base flex items-center gap-2",children:[s.jsx(QE,{className:"h-4 w-4"})," Notifications"]})}),s.jsxs(ot,{className:"space-y-3 text-sm",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{children:"Show request notifications"}),s.jsx(Ba,{checked:n.enabled,onCheckedChange:a=>void Fb({enabled:a})})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(RN,{className:"h-3 w-3"})," Play notification sound"]}),s.jsx(Ba,{checked:n.sound,onCheckedChange:a=>void Fb({sound:a})})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Notifications are disabled while muted. Changes apply immediately."})]})]})}function z4({items:n,onDismiss:a}){return n.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:n.map(l=>{const o=!l.success,c=l.success&&l.totalLatencyMs>15e3,u=Ee("rounded-md border shadow-lg transition-all",o&&"bg-destructive text-destructive-foreground border-destructive",c&&"bg-amber-500/90 text-amber-950 border-amber-600/50",!o&&!c&&"bg-card text-card-foreground border-border");return s.jsxs(Dl,{to:"/requests",className:Ee("block shrink-0 p-3 hover:opacity-95",u),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:[o?s.jsx(eN,{className:"h-4 w-4 shrink-0"}):l.success?s.jsx(Cu,{className:"h-4 w-4 shrink-0"}):s.jsx(TN,{className:"h-4 w-4 shrink-0 opacity-70"}),s.jsx("div",{className:"min-w-0 truncate text-sm font-medium",title:l.requestedModel,children:l.requestedModel})]}),s.jsx("button",{className:"shrink-0 opacity-60 hover:opacity-100",onClick:f=>{f.preventDefault(),f.stopPropagation(),a(l.id)},"aria-label":"Dismiss",type:"button",children:s.jsx(Eu,{className:"h-3.5 w-3.5"})})]}),s.jsxs("div",{className:"mt-1 text-xs",children:[l.success?"Thành công":"Thất bại",!l.success&&l.errorType&&s.jsx("span",{className:"ml-1 inline-block rounded bg-black/15 px-1 py-0.5 align-text-bottom text-[10px]",children:l.errorType})]}),s.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:["in ",Vt(l.inputTokens)," · out ",Vt(l.outputTokens),(l.cacheReadTokens>0||l.cacheWriteTokens>0)&&s.jsxs(s.Fragment,{children:[" · cache ",l.cacheReadTokens>0&&s.jsxs("span",{children:["r",Vt(l.cacheReadTokens)]}),l.cacheReadTokens>0&&l.cacheWriteTokens>0&&"/",l.cacheWriteTokens>0&&s.jsxs("span",{children:["w",Vt(l.cacheWriteTokens)]})]})]}),s.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:[Ol(l.totalLatencyMs),l.ttftMs!=null&&l.ttftMs>=0&&s.jsxs("span",{children:[" · TTFT ",Ol(l.ttftMs)]})]})]},l.id)})}):null}const L4=5e3,U4=8,I4=3e3;let Jc=null;function B4(){try{Jc||(Jc=new Audio("/notification.mp3")),Jc.currentTime=0,Jc.play().catch(()=>{})}catch{}}function P4(){const[n,a]=h.useState([]),l=h.useRef(null),o=h.useRef(new Map),c=h.useRef(Date.now()),u=h.useRef(new Set),f=$S(),p=h.useRef(f.sound);p.current=f.sound,h.useEffect(()=>{qS()},[]);const g=f.enabled;return h.useEffect(()=>{var w;if(!g){(w=l.current)==null||w.close(),l.current=null;const E=o.current;for(const j of E.values())clearTimeout(j);E.clear(),a([]);return}let x=!1;const y=o.current,b=()=>{if(x)return;const E=new EventSource(`/api/admin/requests/stream?since=${c.current}`);l.current=E,E.addEventListener("request",j=>{if(!x)try{const C=JSON.parse(j.data),R=new Date(C.createdAt).getTime();if(Number.isFinite(R)&&(c.current=Math.max(c.current,R)),u.current.has(C.id))return;u.current.add(C.id),a(A=>A.some(M=>M.id===C.id)?A:[C,...A].slice(0,U4));const D=setTimeout(()=>{a(A=>A.filter(M=>M.id!==C.id)),y.delete(C.id)},L4);y.set(C.id,D),p.current&&B4()}catch{}}),E.onerror=()=>{E.close(),l.current=null,x||setTimeout(b,I4)}};return b(),()=>{var E;x=!0,(E=l.current)==null||E.close(),l.current=null;for(const j of y.values())clearTimeout(j);y.clear()}},[g]),{items:n,dismiss:x=>{const y=o.current.get(x);y&&(clearTimeout(y),o.current.delete(x)),a(b=>b.filter(w=>w.id!==x))}}}function H4({children:n}){const{user:a,loading:l}=Am(),o=On();return l?s.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):a?s.jsx(s.Fragment,{children:n}):s.jsx(zh,{to:"/login",state:{from:o},replace:!0})}function q4(){const{items:n,dismiss:a}=P4();return s.jsxs("div",{className:"flex h-screen bg-background text-foreground",children:[s.jsx(uR,{}),s.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[s.jsx(dD,{}),s.jsx("main",{className:"flex-1 overflow-auto p-6",children:s.jsxs(p0,{children:[s.jsx(Nn,{index:!0,element:s.jsx(YD,{})}),s.jsx(Nn,{path:"/providers",element:s.jsx(Xk,{})}),s.jsx(Nn,{path:"/models",element:s.jsx(Fk,{})}),s.jsx(Nn,{path:"/combos",element:s.jsx(Qk,{})}),s.jsx(Nn,{path:"/aliases",element:s.jsx(Zk,{})}),s.jsx(Nn,{path:"/api-keys",element:s.jsx(Jk,{})}),s.jsx(Nn,{path:"/requests",element:s.jsx(t4,{})}),s.jsx(Nn,{path:"/statistics",element:s.jsx(M4,{})}),s.jsx(Nn,{path:"/audit",element:s.jsx(D4,{})}),s.jsx(Nn,{path:"/settings/*",element:s.jsx(_4,{})})]})})]}),s.jsx(z4,{items:n,onDismiss:a})]})}function $4({children:n}){const[a,l]=h.useState(null),o=On();return h.useEffect(()=>{xe.get("/api/admin/setup/status").then(c=>l(c.setupComplete)).catch(()=>l(!0))},[]),a===null?s.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):!a&&o.pathname!=="/setup"?s.jsx(zh,{to:"/setup",replace:!0}):a&&o.pathname==="/setup"?s.jsx(zh,{to:"/",replace:!0}):s.jsx(s.Fragment,{children:n})}function V4(){return s.jsx(YE,{children:s.jsx($4,{children:s.jsxs(p0,{children:[s.jsx(Nn,{path:"/setup",element:s.jsx($D,{})}),s.jsx(Nn,{path:"/login",element:s.jsx(qD,{})}),s.jsx(Nn,{path:"/*",element:s.jsx(H4,{children:s.jsx(q4,{})})})]})})})}const Y4=HD;d2.createRoot(document.getElementById("root")).render(s.jsx(ie.StrictMode,{children:s.jsx(yR,{defaultTheme:"dark",storageKey:"latedev-theme",children:s.jsxs(_S,{children:[s.jsx(kE,{children:s.jsx(V4,{})}),s.jsx(Y4,{position:"top-right"})]})})}));
|