ldrouter 1.10.2 → 1.11.2
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 +19 -0
- package/dist/server/app.js +4 -0
- package/dist/server/auth/api-key.js +2 -3
- package/dist/server/db/migrate.js +2 -0
- package/dist/server/db/repositories/settings.js +6 -0
- package/dist/server/db/schema.js +6 -1
- package/dist/server/gateway/events.js +15 -0
- package/dist/server/gateway/runner.js +11 -4
- package/dist/server/routes/admin/models.js +11 -1
- package/dist/server/routes/admin/requests.js +12 -1
- package/dist/server/routes/admin/settings.js +40 -2
- package/dist/server/security/admin-ip-gate.js +42 -0
- package/dist/server/security/redact.js +1 -1
- package/dist/server/upstream/client.js +22 -4
- package/dist/web/assets/index-CqVMNQ5F.css +1 -0
- package/dist/web/assets/index-DPH5tP2x.js +330 -0
- package/dist/web/index.html +2 -2
- package/migrations/0004_admin_ip_access.sql +2 -0
- package/package.json +1 -1
- package/dist/web/assets/index-BprlMazL.css +0 -1
- package/dist/web/assets/index-CHg2RW0K.js +0 -324
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
var xx=a=>{throw TypeError(a)};var yx=(a,l,o)=>l.has(a)||xx("Cannot "+o);var Gt=(a,l,o)=>(yx(a,l,"read from private field"),o?o.call(a):l.get(a)),bx=(a,l,o)=>l.has(a)?xx("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(a):l.set(a,o),pf=(a,l,o,i)=>(yx(a,l,"write to private field"),i?i.call(a,o):l.set(a,o),o);function tj(a,l){for(var o=0;o<l.length;o++){const i=l[o];if(typeof i!="string"&&!Array.isArray(i)){for(const u in i)if(u!=="default"&&!(u in a)){const d=Object.getOwnPropertyDescriptor(i,u);d&&Object.defineProperty(a,u,d.get?d:{enumerable:!0,get:()=>i[u]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}(function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&i(h)}).observe(document,{childList:!0,subtree:!0});function o(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(u){if(u.ep)return;u.ep=!0;const d=o(u);fetch(u.href,d)}})();function vh(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var gf={exports:{}},vo={};/**
|
|
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 Sx;function nj(){if(Sx)return vo;Sx=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function o(i,u,d){var h=null;if(d!==void 0&&(h=""+d),u.key!==void 0&&(h=""+u.key),"key"in u){d={};for(var p in u)p!=="key"&&(d[p]=u[p])}else d=u;return u=d.ref,{$$typeof:a,type:i,key:h,ref:u!==void 0?u:null,props:d}}return vo.Fragment=l,vo.jsx=o,vo.jsxs=o,vo}var wx;function aj(){return wx||(wx=1,gf.exports=nj()),gf.exports}var s=aj(),vf={exports:{}},De={};/**
|
|
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 jx;function lj(){if(jx)return De;jx=1;var a=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=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"),S=Symbol.iterator;function w(D){return D===null||typeof D!="object"?null:(D=S&&D[S]||D["@@iterator"],typeof D=="function"?D:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,j={};function N(D,q,Q){this.props=D,this.context=q,this.refs=j,this.updater=Q||C}N.prototype.isReactComponent={},N.prototype.setState=function(D,q){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,q,"setState")},N.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};function M(){}M.prototype=N.prototype;function T(D,q,Q){this.props=D,this.context=q,this.refs=j,this.updater=Q||C}var _=T.prototype=new M;_.constructor=T,E(_,N.prototype),_.isPureReactComponent=!0;var O=Array.isArray;function A(){}var H={H:null,A:null,T:null,S:null},z=Object.prototype.hasOwnProperty;function K(D,q,Q){var ae=Q.ref;return{$$typeof:a,type:D,key:q,ref:ae!==void 0?ae:null,props:Q}}function se(D,q){return K(D.type,q,D.props)}function X(D){return typeof D=="object"&&D!==null&&D.$$typeof===a}function I(D){var q={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(Q){return q[Q]})}var re=/\/+/g;function ee(D,q){return typeof D=="object"&&D!==null&&D.key!=null?I(""+D.key):q.toString(36)}function oe(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(A,A):(D.status="pending",D.then(function(q){D.status==="pending"&&(D.status="fulfilled",D.value=q)},function(q){D.status==="pending"&&(D.status="rejected",D.reason=q)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function U(D,q,Q,ae,ce){var Se=typeof D;(Se==="undefined"||Se==="boolean")&&(D=null);var ue=!1;if(D===null)ue=!0;else switch(Se){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(D.$$typeof){case a:case l:ue=!0;break;case x:return ue=D._init,U(ue(D._payload),q,Q,ae,ce)}}if(ue)return ce=ce(D),ue=ae===""?"."+ee(D,0):ae,O(ce)?(Q="",ue!=null&&(Q=ue.replace(re,"$&/")+"/"),U(ce,q,Q,"",function(J){return J})):ce!=null&&(X(ce)&&(ce=se(ce,Q+(ce.key==null||D&&D.key===ce.key?"":(""+ce.key).replace(re,"$&/")+"/")+ue)),q.push(ce)),1;ue=0;var fe=ae===""?".":ae+":";if(O(D))for(var xe=0;xe<D.length;xe++)ae=D[xe],Se=fe+ee(ae,xe),ue+=U(ae,q,Q,Se,ce);else if(xe=w(D),typeof xe=="function")for(D=xe.call(D),xe=0;!(ae=D.next()).done;)ae=ae.value,Se=fe+ee(ae,xe++),ue+=U(ae,q,Q,Se,ce);else if(Se==="object"){if(typeof D.then=="function")return U(oe(D),q,Q,ae,ce);throw q=String(D),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return ue}function $(D,q,Q){if(D==null)return D;var ae=[],ce=0;return U(D,ae,"","",function(Se){return q.call(Q,Se,ce++)}),ae}function le(D){if(D._status===-1){var q=D._result;q=q(),q.then(function(Q){(D._status===0||D._status===-1)&&(D._status=1,D._result=Q)},function(Q){(D._status===0||D._status===-1)&&(D._status=2,D._result=Q)}),D._status===-1&&(D._status=0,D._result=q)}if(D._status===1)return D._result.default;throw D._result}var B=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},Z={map:$,forEach:function(D,q,Q){$(D,function(){q.apply(this,arguments)},Q)},count:function(D){var q=0;return $(D,function(){q++}),q},toArray:function(D){return $(D,function(q){return q})||[]},only:function(D){if(!X(D))throw Error("React.Children.only expected to receive a single React element child.");return D}};return De.Activity=y,De.Children=Z,De.Component=N,De.Fragment=o,De.Profiler=u,De.PureComponent=T,De.StrictMode=i,De.Suspense=g,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,De.__COMPILER_RUNTIME={__proto__:null,c:function(D){return H.H.useMemoCache(D)}},De.cache=function(D){return function(){return D.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(D,q,Q){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var ae=E({},D.props),ce=D.key;if(q!=null)for(Se in q.key!==void 0&&(ce=""+q.key),q)!z.call(q,Se)||Se==="key"||Se==="__self"||Se==="__source"||Se==="ref"&&q.ref===void 0||(ae[Se]=q[Se]);var Se=arguments.length-2;if(Se===1)ae.children=Q;else if(1<Se){for(var ue=Array(Se),fe=0;fe<Se;fe++)ue[fe]=arguments[fe+2];ae.children=ue}return K(D.type,ce,ae)},De.createContext=function(D){return D={$$typeof:h,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:d,_context:D},D},De.createElement=function(D,q,Q){var ae,ce={},Se=null;if(q!=null)for(ae in q.key!==void 0&&(Se=""+q.key),q)z.call(q,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ce[ae]=q[ae]);var ue=arguments.length-2;if(ue===1)ce.children=Q;else if(1<ue){for(var fe=Array(ue),xe=0;xe<ue;xe++)fe[xe]=arguments[xe+2];ce.children=fe}if(D&&D.defaultProps)for(ae in ue=D.defaultProps,ue)ce[ae]===void 0&&(ce[ae]=ue[ae]);return K(D,Se,ce)},De.createRef=function(){return{current:null}},De.forwardRef=function(D){return{$$typeof:p,render:D}},De.isValidElement=X,De.lazy=function(D){return{$$typeof:x,_payload:{_status:-1,_result:D},_init:le}},De.memo=function(D,q){return{$$typeof:v,type:D,compare:q===void 0?null:q}},De.startTransition=function(D){var q=H.T,Q={};H.T=Q;try{var ae=D(),ce=H.S;ce!==null&&ce(Q,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(A,B)}catch(Se){B(Se)}finally{q!==null&&Q.types!==null&&(q.types=Q.types),H.T=q}},De.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},De.use=function(D){return H.H.use(D)},De.useActionState=function(D,q,Q){return H.H.useActionState(D,q,Q)},De.useCallback=function(D,q){return H.H.useCallback(D,q)},De.useContext=function(D){return H.H.useContext(D)},De.useDebugValue=function(){},De.useDeferredValue=function(D,q){return H.H.useDeferredValue(D,q)},De.useEffect=function(D,q){return H.H.useEffect(D,q)},De.useEffectEvent=function(D){return H.H.useEffectEvent(D)},De.useId=function(){return H.H.useId()},De.useImperativeHandle=function(D,q,Q){return H.H.useImperativeHandle(D,q,Q)},De.useInsertionEffect=function(D,q){return H.H.useInsertionEffect(D,q)},De.useLayoutEffect=function(D,q){return H.H.useLayoutEffect(D,q)},De.useMemo=function(D,q){return H.H.useMemo(D,q)},De.useOptimistic=function(D,q){return H.H.useOptimistic(D,q)},De.useReducer=function(D,q,Q){return H.H.useReducer(D,q,Q)},De.useRef=function(D){return H.H.useRef(D)},De.useState=function(D){return H.H.useState(D)},De.useSyncExternalStore=function(D,q,Q){return H.H.useSyncExternalStore(D,q,Q)},De.useTransition=function(){return H.H.useTransition()},De.version="19.2.8",De}var Cx;function xh(){return Cx||(Cx=1,vf.exports=lj()),vf.exports}var m=xh();const ie=vh(m),gs=tj({__proto__:null,default:ie},[m]);var xf={exports:{}},xo={},yf={exports:{}},bf={};/**
|
|
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 Ex;function rj(){return Ex||(Ex=1,(function(a){function l(U,$){var le=U.length;U.push($);e:for(;0<le;){var B=le-1>>>1,Z=U[B];if(0<u(Z,$))U[B]=$,U[le]=Z,le=B;else break e}}function o(U){return U.length===0?null:U[0]}function i(U){if(U.length===0)return null;var $=U[0],le=U.pop();if(le!==$){U[0]=le;e:for(var B=0,Z=U.length,D=Z>>>1;B<D;){var q=2*(B+1)-1,Q=U[q],ae=q+1,ce=U[ae];if(0>u(Q,le))ae<Z&&0>u(ce,Q)?(U[B]=ce,U[ae]=le,B=ae):(U[B]=Q,U[q]=le,B=q);else if(ae<Z&&0>u(ce,le))U[B]=ce,U[ae]=le,B=ae;else break e}}return $}function u(U,$){var le=U.sortIndex-$.sortIndex;return le!==0?le:U.id-$.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;a.unstable_now=function(){return d.now()}}else{var h=Date,p=h.now();a.unstable_now=function(){return h.now()-p}}var g=[],v=[],x=1,y=null,S=3,w=!1,C=!1,E=!1,j=!1,N=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function _(U){for(var $=o(v);$!==null;){if($.callback===null)i(v);else if($.startTime<=U)i(v),$.sortIndex=$.expirationTime,l(g,$);else break;$=o(v)}}function O(U){if(E=!1,_(U),!C)if(o(g)!==null)C=!0,A||(A=!0,I());else{var $=o(v);$!==null&&oe(O,$.startTime-U)}}var A=!1,H=-1,z=5,K=-1;function se(){return j?!0:!(a.unstable_now()-K<z)}function X(){if(j=!1,A){var U=a.unstable_now();K=U;var $=!0;try{e:{C=!1,E&&(E=!1,M(H),H=-1),w=!0;var le=S;try{t:{for(_(U),y=o(g);y!==null&&!(y.expirationTime>U&&se());){var B=y.callback;if(typeof B=="function"){y.callback=null,S=y.priorityLevel;var Z=B(y.expirationTime<=U);if(U=a.unstable_now(),typeof Z=="function"){y.callback=Z,_(U),$=!0;break t}y===o(g)&&i(g),_(U)}else i(g);y=o(g)}if(y!==null)$=!0;else{var D=o(v);D!==null&&oe(O,D.startTime-U),$=!1}}break e}finally{y=null,S=le,w=!1}$=void 0}}finally{$?I():A=!1}}}var I;if(typeof T=="function")I=function(){T(X)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,ee=re.port2;re.port1.onmessage=X,I=function(){ee.postMessage(null)}}else I=function(){N(X,0)};function oe(U,$){H=N(function(){U(a.unstable_now())},$)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(U){U.callback=null},a.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):z=0<U?Math.floor(1e3/U):5},a.unstable_getCurrentPriorityLevel=function(){return S},a.unstable_next=function(U){switch(S){case 1:case 2:case 3:var $=3;break;default:$=S}var le=S;S=$;try{return U()}finally{S=le}},a.unstable_requestPaint=function(){j=!0},a.unstable_runWithPriority=function(U,$){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var le=S;S=U;try{return $()}finally{S=le}},a.unstable_scheduleCallback=function(U,$,le){var B=a.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0<le?B+le:B):le=B,U){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=le+Z,U={id:x++,callback:$,priorityLevel:U,startTime:le,expirationTime:Z,sortIndex:-1},le>B?(U.sortIndex=le,l(v,U),o(g)===null&&U===o(v)&&(E?(M(H),H=-1):E=!0,oe(O,le-B))):(U.sortIndex=Z,l(g,U),C||w||(C=!0,A||(A=!0,I()))),U},a.unstable_shouldYield=se,a.unstable_wrapCallback=function(U){var $=S;return function(){var le=S;S=$;try{return U.apply(this,arguments)}finally{S=le}}}})(bf)),bf}var Rx;function sj(){return Rx||(Rx=1,yf.exports=rj()),yf.exports}var Sf={exports:{}},Yt={};/**
|
|
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 Nx;function oj(){if(Nx)return Yt;Nx=1;var a=xh();function l(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 o(){}var i={d:{f:o,r:function(){throw Error(l(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},u=Symbol.for("react.portal");function d(g,v,x){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:y==null?null:""+y,children:g,containerInfo:v,implementation:x}}var h=a.__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 Yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Yt.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(l(299));return d(g,v,null,x)},Yt.flushSync=function(g){var v=h.T,x=i.p;try{if(h.T=null,i.p=2,g)return g()}finally{h.T=v,i.p=x,i.d.f()}},Yt.preconnect=function(g,v){typeof g=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,i.d.C(g,v))},Yt.prefetchDNS=function(g){typeof g=="string"&&i.d.D(g)},Yt.preinit=function(g,v){if(typeof g=="string"&&v&&typeof v.as=="string"){var x=v.as,y=p(x,v.crossOrigin),S=typeof v.integrity=="string"?v.integrity:void 0,w=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;x==="style"?i.d.S(g,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:y,integrity:S,fetchPriority:w}):x==="script"&&i.d.X(g,{crossOrigin:y,integrity:S,fetchPriority:w,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},Yt.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);i.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&&i.d.M(g)},Yt.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);i.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})}},Yt.preloadModule=function(g,v){if(typeof g=="string")if(v){var x=p(v.as,v.crossOrigin);i.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 i.d.m(g)},Yt.requestFormReset=function(g){i.d.r(g)},Yt.unstable_batchedUpdates=function(g,v){return g(v)},Yt.useFormState=function(g,v,x){return h.H.useFormState(g,v,x)},Yt.useFormStatus=function(){return h.H.useHostTransitionStatus()},Yt.version="19.2.8",Yt}var Tx;function Sy(){if(Tx)return Sf.exports;Tx=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),Sf.exports=oj(),Sf.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 Ax;function ij(){if(Ax)return xo;Ax=1;var a=sj(),l=xh(),o=Sy();function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function 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(d(e)!==e)throw Error(i(188))}function v(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var c=n.return;if(c===null)break;var f=c.alternate;if(f===null){if(r=c.return,r!==null){n=r;continue}break}if(c.child===f.child){for(f=c.child;f;){if(f===n)return g(c),e;if(f===r)return g(c),t;f=f.sibling}throw Error(i(188))}if(n.return!==r.return)n=c,r=f;else{for(var b=!1,R=c.child;R;){if(R===n){b=!0,n=c,r=f;break}if(R===r){b=!0,r=c,n=f;break}R=R.sibling}if(!b){for(R=f.child;R;){if(R===n){b=!0,n=f,r=c;break}if(R===r){b=!0,r=f,n=c;break}R=R.sibling}if(!b)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function 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,S=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),T=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),K=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),X=Symbol.iterator;function I(e){return e===null||typeof e!="object"?null:(e=X&&e[X]||e["@@iterator"],typeof e=="function"?e:null)}var re=Symbol.for("react.client.reference");function ee(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case N:return"Profiler";case j:return"StrictMode";case O:return"Suspense";case A:return"SuspenseList";case K:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case T:return e.displayName||"Context";case M:return(e._context.displayName||"Context")+".Consumer";case _:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case H:return t=e.displayName||null,t!==null?t:ee(e.type)||"Memo";case z:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var oe=Array.isArray,U=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},B=[],Z=-1;function D(e){return{current:e}}function q(e){0>Z||(e.current=B[Z],B[Z]=null,Z--)}function Q(e,t){Z++,B[Z]=e.current,e.current=t}var ae=D(null),ce=D(null),Se=D(null),ue=D(null);function fe(e,t){switch(Q(Se,t),Q(ce,e),Q(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?qv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qv(t),e=Iv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}q(ae),Q(ae,e)}function xe(){q(ae),q(ce),q(Se)}function J(e){e.memoizedState!==null&&Q(ue,e);var t=ae.current,n=Iv(t,e.type);t!==n&&(Q(ce,e),Q(ae,n))}function me(e){ce.current===e&&(q(ae),q(ce)),ue.current===e&&(q(ue),ho._currentValue=le)}var je,Me;function mt(e){if(je===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);je=t&&t[1]||"",Me=-1<n.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+je+e+Me}var pt=!1;function bt(e,t){if(!e||pt)return"";pt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(F){var Y=F}Reflect.construct(e,[],ne)}else{try{ne.call()}catch(F){Y=F}e.call(ne.prototype)}}else{try{throw Error()}catch(F){Y=F}(ne=e())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(F){if(F&&Y&&typeof F.stack=="string")return[F.stack,Y.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=r.DetermineComponentFrameRoot(),b=f[0],R=f[1];if(b&&R){var k=b.split(`
|
|
44
|
+
`),G=R.split(`
|
|
45
|
+
`);for(c=r=0;r<k.length&&!k[r].includes("DetermineComponentFrameRoot");)r++;for(;c<G.length&&!G[c].includes("DetermineComponentFrameRoot");)c++;if(r===k.length||c===G.length)for(r=k.length-1,c=G.length-1;1<=r&&0<=c&&k[r]!==G[c];)c--;for(;1<=r&&0<=c;r--,c--)if(k[r]!==G[c]){if(r!==1||c!==1)do if(r--,c--,0>c||k[r]!==G[c]){var W=`
|
|
46
|
+
`+k[r].replace(" at new "," at ");return e.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",e.displayName)),W}while(1<=r&&0<=c);break}}}finally{pt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?mt(n):""}function St(e,t){switch(e.tag){case 26:case 27:case 5:return mt(e.type);case 16:return mt("Lazy");case 13:return e.child!==t&&t!==null?mt("Suspense Fallback"):mt("Suspense");case 19:return mt("SuspenseList");case 0:case 15:return bt(e.type,!1);case 11:return bt(e.type.render,!1);case 1:return bt(e.type,!0);case 31:return mt("Activity");default:return""}}function Lt(e){try{var t="",n=null;do t+=St(e,n),n=e,e=e.return;while(e);return t}catch(r){return`
|
|
47
|
+
Error generating stack: `+r.message+`
|
|
48
|
+
`+r.stack}}var hn=Object.prototype.hasOwnProperty,Qn=a.unstable_scheduleCallback,mn=a.unstable_cancelCallback,ja=a.unstable_shouldYield,Ca=a.unstable_requestPaint,$t=a.unstable_now,Jc=a.unstable_getCurrentPriorityLevel,Kt=a.unstable_ImmediatePriority,Ea=a.unstable_UserBlockingPriority,br=a.unstable_NormalPriority,Wc=a.unstable_LowPriority,Vl=a.unstable_IdlePriority,eu=a.log,Po=a.unstable_setDisableYieldValue,Ra=null,wt=null;function Zn(e){if(typeof eu=="function"&&Po(e),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(Ra,e)}catch{}}var jt=Math.clz32?Math.clz32:qo,tu=Math.log,nu=Math.LN2;function qo(e){return e>>>=0,e===0?32:31-(tu(e)/nu|0)|0}var Gl=256,Sr=262144,sl=4194304;function Vt(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 wr(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var c=0,f=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var R=r&134217727;return R!==0?(r=R&~f,r!==0?c=Vt(r):(b&=R,b!==0?c=Vt(b):n||(n=R&~e,n!==0&&(c=Vt(n))))):(R=r&~f,R!==0?c=Vt(R):b!==0?c=Vt(b):n||(n=r&~e,n!==0&&(c=Vt(n)))),c===0?0:t!==0&&t!==c&&(t&f)===0&&(f=c&-c,n=t&-t,f>=n||f===32&&(n&4194048)!==0)?t:c}function Te(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ke(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 st(){var e=sl;return sl<<=1,(sl&62914560)===0&&(sl=4194304),e}function Xt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ut(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function oa(e,t,n,r,c,f){var b=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var R=e.entanglements,k=e.expirationTimes,G=e.hiddenUpdates;for(n=b&~n;0<n;){var W=31-jt(n),ne=1<<W;R[W]=0,k[W]=-1;var Y=G[W];if(Y!==null)for(G[W]=null,W=0;W<Y.length;W++){var F=Y[W];F!==null&&(F.lane&=-536870913)}n&=~ne}r!==0&&ia(e,r,0),f!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=f&~(b&~t))}function ia(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-jt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Zt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-jt(n),c=1<<r;c&t|e[r]&t&&(e[r]|=t),n&=~c}}function Jn(e,t){var n=t&-t;return n=(n&42)!==0?1:au(n),(n&(e.suspendedLanes|t))!==0?0:n}function au(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 lu(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Rm(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:dx(e.type))}function Nm(e,t){var n=$.p;try{return $.p=e,t()}finally{$.p=n}}var ol=Math.random().toString(36).slice(2),Bt="__reactFiber$"+ol,Jt="__reactProps$"+ol,jr="__reactContainer$"+ol,ru="__reactEvents$"+ol,G1="__reactListeners$"+ol,Y1="__reactHandles$"+ol,Tm="__reactResources$"+ol,Ns="__reactMarker$"+ol;function su(e){delete e[Bt],delete e[Jt],delete e[ru],delete e[G1],delete e[Y1]}function Cr(e){var t=e[Bt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[jr]||n[Bt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Fv(e);e!==null;){if(n=e[Bt])return n;e=Fv(e)}return t}e=n,n=e.parentNode}return null}function Er(e){if(e=e[Bt]||e[jr]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ts(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Rr(e){var t=e[Tm];return t||(t=e[Tm]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function _t(e){e[Ns]=!0}var Am=new Set,Mm={};function Yl(e,t){Nr(e,t),Nr(e+"Capture",t)}function Nr(e,t){for(Mm[e]=t,e=0;e<t.length;e++)Am.add(t[e])}var $1=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]*$"),Dm={},_m={};function K1(e){return hn.call(_m,e)?!0:hn.call(Dm,e)?!1:$1.test(e)?_m[e]=!0:(Dm[e]=!0,!1)}function Io(e,t,n){if(K1(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Vo(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Na(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+r)}}function Mn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Om(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function X1(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var c=r.get,f=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(b){n=""+b,f.call(this,b)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(b){n=""+b},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ou(e){if(!e._valueTracker){var t=Om(e)?"checked":"value";e._valueTracker=X1(e,t,""+e[t])}}function km(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Om(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Go(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 F1=/[\n"\\]/g;function Dn(e){return e.replace(F1,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function iu(e,t,n,r,c,f,b,R){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),t!=null?b==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Mn(t)):e.value!==""+Mn(t)&&(e.value=""+Mn(t)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),t!=null?cu(e,b,Mn(t)):n!=null?cu(e,b,Mn(n)):r!=null&&e.removeAttribute("value"),c==null&&f!=null&&(e.defaultChecked=!!f),c!=null&&(e.checked=c&&typeof c!="function"&&typeof c!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?e.name=""+Mn(R):e.removeAttribute("name")}function zm(e,t,n,r,c,f,b,R){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||n!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){ou(e);return}n=n!=null?""+Mn(n):"",t=t!=null?""+Mn(t):n,R||t===e.value||(e.value=t),e.defaultValue=t}r=r??c,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=R?e.checked:!!r,e.defaultChecked=!!r,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),ou(e)}function cu(e,t,n){t==="number"&&Go(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Tr(e,t,n,r){if(e=e.options,t){t={};for(var c=0;c<n.length;c++)t["$"+n[c]]=!0;for(n=0;n<e.length;n++)c=t.hasOwnProperty("$"+e[n].value),e[n].selected!==c&&(e[n].selected=c),c&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Mn(n),t=null,c=0;c<e.length;c++){if(e[c].value===n){e[c].selected=!0,r&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Lm(e,t,n){if(t!=null&&(t=""+Mn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Mn(n):""}function Um(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(oe(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n==null&&(n=""),t=n}n=Mn(t),e.defaultValue=n,r=e.textContent,r===n&&r!==""&&r!==null&&(e.value=r),ou(e)}function Ar(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Q1=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 Bm(e,t,n){var r=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,n):typeof n!="number"||n===0||Q1.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Hm(e,t,n){if(t!=null&&typeof t!="object")throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var c in t)r=t[c],t.hasOwnProperty(c)&&n[c]!==r&&Bm(e,c,r)}else for(var f in t)t.hasOwnProperty(f)&&Bm(e,f,t[f])}function uu(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 Z1=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"]]),J1=/^[\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 Yo(e){return J1.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ta(){}var du=null;function fu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mr=null,Dr=null;function Pm(e){var t=Er(e);if(t&&(e=t.stateNode)){var n=e[Jt]||null;e:switch(e=t.stateNode,t.type){case"input":if(iu(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+Dn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var c=r[Jt]||null;if(!c)throw Error(i(90));iu(r,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&km(r)}break e;case"textarea":Lm(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Tr(e,!!n.multiple,t,!1)}}}var hu=!1;function qm(e,t,n){if(hu)return e(t,n);hu=!0;try{var r=e(t);return r}finally{if(hu=!1,(Mr!==null||Dr!==null)&&(_i(),Mr&&(t=Mr,e=Dr,Dr=Mr=null,Pm(t),e)))for(t=0;t<e.length;t++)Pm(e[t])}}function As(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Jt]||null;if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(i(231,t,typeof n));return n}var Aa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mu=!1;if(Aa)try{var Ms={};Object.defineProperty(Ms,"passive",{get:function(){mu=!0}}),window.addEventListener("test",Ms,Ms),window.removeEventListener("test",Ms,Ms)}catch{mu=!1}var il=null,pu=null,$o=null;function Im(){if($o)return $o;var e,t=pu,n=t.length,r,c="value"in il?il.value:il.textContent,f=c.length;for(e=0;e<n&&t[e]===c[e];e++);var b=n-e;for(r=1;r<=b&&t[n-r]===c[f-r];r++);return $o=c.slice(e,1<r?1-r:void 0)}function Ko(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 Xo(){return!0}function Vm(){return!1}function Wt(e){function t(n,r,c,f,b){this._reactName=n,this._targetInst=c,this.type=r,this.nativeEvent=f,this.target=b,this.currentTarget=null;for(var R in e)e.hasOwnProperty(R)&&(n=e[R],this[R]=n?n(f):f[R]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Xo:Vm,this.isPropagationStopped=Vm,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Xo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Xo)},persist:function(){},isPersistent:Xo}),t}var $l={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fo=Wt($l),Ds=y({},$l,{view:0,detail:0}),W1=Wt(Ds),gu,vu,_s,Qo=y({},Ds,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yu,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!==_s&&(_s&&e.type==="mousemove"?(gu=e.screenX-_s.screenX,vu=e.screenY-_s.screenY):vu=gu=0,_s=e),gu)},movementY:function(e){return"movementY"in e?e.movementY:vu}}),Gm=Wt(Qo),eS=y({},Qo,{dataTransfer:0}),tS=Wt(eS),nS=y({},Ds,{relatedTarget:0}),xu=Wt(nS),aS=y({},$l,{animationName:0,elapsedTime:0,pseudoElement:0}),lS=Wt(aS),rS=y({},$l,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),sS=Wt(rS),oS=y({},$l,{data:0}),Ym=Wt(oS),iS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cS={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"},uS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=uS[e])?!!t[e]:!1}function yu(){return dS}var fS=y({},Ds,{key:function(e){if(e.key){var t=iS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ko(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yu,charCode:function(e){return e.type==="keypress"?Ko(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ko(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),hS=Wt(fS),mS=y({},Qo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$m=Wt(mS),pS=y({},Ds,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yu}),gS=Wt(pS),vS=y({},$l,{propertyName:0,elapsedTime:0,pseudoElement:0}),xS=Wt(vS),yS=y({},Qo,{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}),bS=Wt(yS),SS=y({},$l,{newState:0,oldState:0}),wS=Wt(SS),jS=[9,13,27,32],bu=Aa&&"CompositionEvent"in window,Os=null;Aa&&"documentMode"in document&&(Os=document.documentMode);var CS=Aa&&"TextEvent"in window&&!Os,Km=Aa&&(!bu||Os&&8<Os&&11>=Os),Xm=" ",Fm=!1;function Qm(e,t){switch(e){case"keyup":return jS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _r=!1;function ES(e,t){switch(e){case"compositionend":return Zm(t);case"keypress":return t.which!==32?null:(Fm=!0,Xm);case"textInput":return e=t.data,e===Xm&&Fm?null:e;default:return null}}function RS(e,t){if(_r)return e==="compositionend"||!bu&&Qm(e,t)?(e=Im(),$o=pu=il=null,_r=!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 Km&&t.locale!=="ko"?null:t.data;default:return null}}var NS={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 Jm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!NS[e.type]:t==="textarea"}function Wm(e,t,n,r){Mr?Dr?Dr.push(r):Dr=[r]:Mr=r,t=Hi(t,"onChange"),0<t.length&&(n=new Fo("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ks=null,zs=null;function TS(e){zv(e,0)}function Zo(e){var t=Ts(e);if(km(t))return e}function ep(e,t){if(e==="change")return t}var tp=!1;if(Aa){var Su;if(Aa){var wu="oninput"in document;if(!wu){var np=document.createElement("div");np.setAttribute("oninput","return;"),wu=typeof np.oninput=="function"}Su=wu}else Su=!1;tp=Su&&(!document.documentMode||9<document.documentMode)}function ap(){ks&&(ks.detachEvent("onpropertychange",lp),zs=ks=null)}function lp(e){if(e.propertyName==="value"&&Zo(zs)){var t=[];Wm(t,zs,e,fu(e)),qm(TS,t)}}function AS(e,t,n){e==="focusin"?(ap(),ks=t,zs=n,ks.attachEvent("onpropertychange",lp)):e==="focusout"&&ap()}function MS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zo(zs)}function DS(e,t){if(e==="click")return Zo(t)}function _S(e,t){if(e==="input"||e==="change")return Zo(t)}function OS(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pn=typeof Object.is=="function"?Object.is:OS;function Ls(e,t){if(pn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var c=n[r];if(!hn.call(t,c)||!pn(e[c],t[c]))return!1}return!0}function rp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function sp(e,t){var n=rp(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=rp(n)}}function op(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?op(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ip(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Go(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Go(e.document)}return t}function ju(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 kS=Aa&&"documentMode"in document&&11>=document.documentMode,Or=null,Cu=null,Us=null,Eu=!1;function cp(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Eu||Or==null||Or!==Go(r)||(r=Or,"selectionStart"in r&&ju(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Us&&Ls(Us,r)||(Us=r,r=Hi(Cu,"onSelect"),0<r.length&&(t=new Fo("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Or)))}function Kl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var kr={animationend:Kl("Animation","AnimationEnd"),animationiteration:Kl("Animation","AnimationIteration"),animationstart:Kl("Animation","AnimationStart"),transitionrun:Kl("Transition","TransitionRun"),transitionstart:Kl("Transition","TransitionStart"),transitioncancel:Kl("Transition","TransitionCancel"),transitionend:Kl("Transition","TransitionEnd")},Ru={},up={};Aa&&(up=document.createElement("div").style,"AnimationEvent"in window||(delete kr.animationend.animation,delete kr.animationiteration.animation,delete kr.animationstart.animation),"TransitionEvent"in window||delete kr.transitionend.transition);function Xl(e){if(Ru[e])return Ru[e];if(!kr[e])return e;var t=kr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in up)return Ru[e]=t[n];return e}var dp=Xl("animationend"),fp=Xl("animationiteration"),hp=Xl("animationstart"),zS=Xl("transitionrun"),LS=Xl("transitionstart"),US=Xl("transitioncancel"),mp=Xl("transitionend"),pp=new Map,Nu="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(" ");Nu.push("scrollEnd");function Wn(e,t){pp.set(e,t),Yl(t,[e])}var Jo=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)},_n=[],zr=0,Tu=0;function Wo(){for(var e=zr,t=Tu=zr=0;t<e;){var n=_n[t];_n[t++]=null;var r=_n[t];_n[t++]=null;var c=_n[t];_n[t++]=null;var f=_n[t];if(_n[t++]=null,r!==null&&c!==null){var b=r.pending;b===null?c.next=c:(c.next=b.next,b.next=c),r.pending=c}f!==0&&gp(n,c,f)}}function ei(e,t,n,r){_n[zr++]=e,_n[zr++]=t,_n[zr++]=n,_n[zr++]=r,Tu|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Au(e,t,n,r){return ei(e,t,n,r),ti(e)}function Fl(e,t){return ei(e,null,null,t),ti(e)}function gp(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var c=!1,f=e.return;f!==null;)f.childLanes|=n,r=f.alternate,r!==null&&(r.childLanes|=n),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(c=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,c&&t!==null&&(c=31-jt(n),e=f.hiddenUpdates,r=e[c],r===null?e[c]=[t]:r.push(t),t.lane=n|536870912),f):null}function ti(e){if(50<ro)throw ro=0,Bd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Lr={};function BS(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gn(e,t,n,r){return new BS(e,t,n,r)}function Mu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ma(e,t){var n=e.alternate;return n===null?(n=gn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function vp(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ni(e,t,n,r,c,f){var b=0;if(r=e,typeof e=="function")Mu(e)&&(b=1);else if(typeof e=="string")b=Vw(e,n,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case K:return e=gn(31,n,t,c),e.elementType=K,e.lanes=f,e;case E:return Ql(n.children,c,f,t);case j:b=8,c|=24;break;case N:return e=gn(12,n,t,c|2),e.elementType=N,e.lanes=f,e;case O:return e=gn(13,n,t,c),e.elementType=O,e.lanes=f,e;case A:return e=gn(19,n,t,c),e.elementType=A,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case T:b=10;break e;case M:b=9;break e;case _:b=11;break e;case H:b=14;break e;case z:b=16,r=null;break e}b=29,n=Error(i(130,e===null?"null":typeof e,"")),r=null}return t=gn(b,n,t,c),t.elementType=e,t.type=r,t.lanes=f,t}function Ql(e,t,n,r){return e=gn(7,e,r,t),e.lanes=n,e}function Du(e,t,n){return e=gn(6,e,null,t),e.lanes=n,e}function xp(e){var t=gn(18,null,null,0);return t.stateNode=e,t}function _u(e,t,n){return t=gn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var yp=new WeakMap;function On(e,t){if(typeof e=="object"&&e!==null){var n=yp.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Lt(t)},yp.set(e,t),t)}return{value:e,source:t,stack:Lt(t)}}var Ur=[],Br=0,ai=null,Bs=0,kn=[],zn=0,cl=null,ca=1,ua="";function Da(e,t){Ur[Br++]=Bs,Ur[Br++]=ai,ai=e,Bs=t}function bp(e,t,n){kn[zn++]=ca,kn[zn++]=ua,kn[zn++]=cl,cl=e;var r=ca;e=ua;var c=32-jt(r)-1;r&=~(1<<c),n+=1;var f=32-jt(t)+c;if(30<f){var b=c-c%5;f=(r&(1<<b)-1).toString(32),r>>=b,c-=b,ca=1<<32-jt(t)+c|n<<c|r,ua=f+e}else ca=1<<f|n<<c|r,ua=e}function Ou(e){e.return!==null&&(Da(e,1),bp(e,1,0))}function ku(e){for(;e===ai;)ai=Ur[--Br],Ur[Br]=null,Bs=Ur[--Br],Ur[Br]=null;for(;e===cl;)cl=kn[--zn],kn[zn]=null,ua=kn[--zn],kn[zn]=null,ca=kn[--zn],kn[zn]=null}function Sp(e,t){kn[zn++]=ca,kn[zn++]=ua,kn[zn++]=cl,ca=t.id,ua=t.overflow,cl=e}var Ht=null,ct=null,qe=!1,ul=null,Ln=!1,zu=Error(i(519));function dl(e){var t=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hs(On(t,e)),zu}function wp(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Bt]=e,t[Jt]=r,n){case"dialog":Ue("cancel",t),Ue("close",t);break;case"iframe":case"object":case"embed":Ue("load",t);break;case"video":case"audio":for(n=0;n<oo.length;n++)Ue(oo[n],t);break;case"source":Ue("error",t);break;case"img":case"image":case"link":Ue("error",t),Ue("load",t);break;case"details":Ue("toggle",t);break;case"input":Ue("invalid",t),zm(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":Ue("invalid",t);break;case"textarea":Ue("invalid",t),Um(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||r.suppressHydrationWarning===!0||Hv(t.textContent,n)?(r.popover!=null&&(Ue("beforetoggle",t),Ue("toggle",t)),r.onScroll!=null&&Ue("scroll",t),r.onScrollEnd!=null&&Ue("scrollend",t),r.onClick!=null&&(t.onclick=Ta),t=!0):t=!1,t||dl(e,!0)}function jp(e){for(Ht=e.return;Ht;)switch(Ht.tag){case 5:case 31:case 13:Ln=!1;return;case 27:case 3:Ln=!0;return;default:Ht=Ht.return}}function Hr(e){if(e!==Ht)return!1;if(!qe)return jp(e),qe=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Wd(e.type,e.memoizedProps)),n=!n),n&&ct&&dl(e),jp(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));ct=Xv(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));ct=Xv(e)}else t===27?(t=ct,El(e.type)?(e=lf,lf=null,ct=e):ct=t):ct=Ht?Bn(e.stateNode.nextSibling):null;return!0}function Zl(){ct=Ht=null,qe=!1}function Lu(){var e=ul;return e!==null&&(an===null?an=e:an.push.apply(an,e),ul=null),e}function Hs(e){ul===null?ul=[e]:ul.push(e)}var Uu=D(null),Jl=null,_a=null;function fl(e,t,n){Q(Uu,t._currentValue),t._currentValue=n}function Oa(e){e._currentValue=Uu.current,q(Uu)}function Bu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Hu(e,t,n,r){var c=e.child;for(c!==null&&(c.return=e);c!==null;){var f=c.dependencies;if(f!==null){var b=c.child;f=f.firstContext;e:for(;f!==null;){var R=f;f=c;for(var k=0;k<t.length;k++)if(R.context===t[k]){f.lanes|=n,R=f.alternate,R!==null&&(R.lanes|=n),Bu(f.return,n,e),r||(b=null);break e}f=R.next}}else if(c.tag===18){if(b=c.return,b===null)throw Error(i(341));b.lanes|=n,f=b.alternate,f!==null&&(f.lanes|=n),Bu(b,n,e),b=null}else b=c.child;if(b!==null)b.return=c;else for(b=c;b!==null;){if(b===e){b=null;break}if(c=b.sibling,c!==null){c.return=b.return,b=c;break}b=b.return}c=b}}function Pr(e,t,n,r){e=null;for(var c=t,f=!1;c!==null;){if(!f){if((c.flags&524288)!==0)f=!0;else if((c.flags&262144)!==0)break}if(c.tag===10){var b=c.alternate;if(b===null)throw Error(i(387));if(b=b.memoizedProps,b!==null){var R=c.type;pn(c.pendingProps.value,b.value)||(e!==null?e.push(R):e=[R])}}else if(c===ue.current){if(b=c.alternate,b===null)throw Error(i(387));b.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(ho):e=[ho])}c=c.return}e!==null&&Hu(t,e,n,r),t.flags|=262144}function li(e){for(e=e.firstContext;e!==null;){if(!pn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Wl(e){Jl=e,_a=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pt(e){return Cp(Jl,e)}function ri(e,t){return Jl===null&&Wl(e),Cp(e,t)}function Cp(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},_a===null){if(e===null)throw Error(i(308));_a=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else _a=_a.next=t;return n}var HS=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},PS=a.unstable_scheduleCallback,qS=a.unstable_NormalPriority,Ct={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pu(){return{controller:new HS,data:new Map,refCount:0}}function Ps(e){e.refCount--,e.refCount===0&&PS(qS,function(){e.controller.abort()})}var qs=null,qu=0,qr=0,Ir=null;function IS(e,t){if(qs===null){var n=qs=[];qu=0,qr=Gd(),Ir={status:"pending",value:void 0,then:function(r){n.push(r)}}}return qu++,t.then(Ep,Ep),t}function Ep(){if(--qu===0&&qs!==null){Ir!==null&&(Ir.status="fulfilled");var e=qs;qs=null,qr=0,Ir=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function VS(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(c){n.push(c)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var c=0;c<n.length;c++)(0,n[c])(t)},function(c){for(r.status="rejected",r.reason=c,c=0;c<n.length;c++)(0,n[c])(void 0)}),r}var Rp=U.S;U.S=function(e,t){cv=$t(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&IS(e,t),Rp!==null&&Rp(e,t)};var er=D(null);function Iu(){var e=er.current;return e!==null?e:ot.pooledCache}function si(e,t){t===null?Q(er,er.current):Q(er,t.pool)}function Np(){var e=Iu();return e===null?null:{parent:Ct._currentValue,pool:e}}var Vr=Error(i(460)),Vu=Error(i(474)),oi=Error(i(542)),ii={then:function(){}};function Tp(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ap(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Ta,Ta),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Dp(e),e;default:if(typeof t.status=="string")t.then(Ta,Ta);else{if(e=ot,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=r}},function(r){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Dp(e),e}throw nr=t,Vr}}function tr(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(nr=n,Vr):n}}var nr=null;function Mp(){if(nr===null)throw Error(i(459));var e=nr;return nr=null,e}function Dp(e){if(e===Vr||e===oi)throw Error(i(483))}var Gr=null,Is=0;function ci(e){var t=Is;return Is+=1,Gr===null&&(Gr=[]),Ap(Gr,e,t)}function Vs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ui(e,t){throw t.$$typeof===S?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function _p(e){function t(P,L){if(e){var V=P.deletions;V===null?(P.deletions=[L],P.flags|=16):V.push(L)}}function n(P,L){if(!e)return null;for(;L!==null;)t(P,L),L=L.sibling;return null}function r(P){for(var L=new Map;P!==null;)P.key!==null?L.set(P.key,P):L.set(P.index,P),P=P.sibling;return L}function c(P,L){return P=Ma(P,L),P.index=0,P.sibling=null,P}function f(P,L,V){return P.index=V,e?(V=P.alternate,V!==null?(V=V.index,V<L?(P.flags|=67108866,L):V):(P.flags|=67108866,L)):(P.flags|=1048576,L)}function b(P){return e&&P.alternate===null&&(P.flags|=67108866),P}function R(P,L,V,te){return L===null||L.tag!==6?(L=Du(V,P.mode,te),L.return=P,L):(L=c(L,V),L.return=P,L)}function k(P,L,V,te){var Ce=V.type;return Ce===E?W(P,L,V.props.children,te,V.key):L!==null&&(L.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===z&&tr(Ce)===L.type)?(L=c(L,V.props),Vs(L,V),L.return=P,L):(L=ni(V.type,V.key,V.props,null,P.mode,te),Vs(L,V),L.return=P,L)}function G(P,L,V,te){return L===null||L.tag!==4||L.stateNode.containerInfo!==V.containerInfo||L.stateNode.implementation!==V.implementation?(L=_u(V,P.mode,te),L.return=P,L):(L=c(L,V.children||[]),L.return=P,L)}function W(P,L,V,te,Ce){return L===null||L.tag!==7?(L=Ql(V,P.mode,te,Ce),L.return=P,L):(L=c(L,V),L.return=P,L)}function ne(P,L,V){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=Du(""+L,P.mode,V),L.return=P,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case w:return V=ni(L.type,L.key,L.props,null,P.mode,V),Vs(V,L),V.return=P,V;case C:return L=_u(L,P.mode,V),L.return=P,L;case z:return L=tr(L),ne(P,L,V)}if(oe(L)||I(L))return L=Ql(L,P.mode,V,null),L.return=P,L;if(typeof L.then=="function")return ne(P,ci(L),V);if(L.$$typeof===T)return ne(P,ri(P,L),V);ui(P,L)}return null}function Y(P,L,V,te){var Ce=L!==null?L.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return Ce!==null?null:R(P,L,""+V,te);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case w:return V.key===Ce?k(P,L,V,te):null;case C:return V.key===Ce?G(P,L,V,te):null;case z:return V=tr(V),Y(P,L,V,te)}if(oe(V)||I(V))return Ce!==null?null:W(P,L,V,te,null);if(typeof V.then=="function")return Y(P,L,ci(V),te);if(V.$$typeof===T)return Y(P,L,ri(P,V),te);ui(P,V)}return null}function F(P,L,V,te,Ce){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return P=P.get(V)||null,R(L,P,""+te,Ce);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case w:return P=P.get(te.key===null?V:te.key)||null,k(L,P,te,Ce);case C:return P=P.get(te.key===null?V:te.key)||null,G(L,P,te,Ce);case z:return te=tr(te),F(P,L,V,te,Ce)}if(oe(te)||I(te))return P=P.get(V)||null,W(L,P,te,Ce,null);if(typeof te.then=="function")return F(P,L,V,ci(te),Ce);if(te.$$typeof===T)return F(P,L,V,ri(L,te),Ce);ui(L,te)}return null}function ge(P,L,V,te){for(var Ce=null,Ve=null,ye=L,Oe=L=0,Pe=null;ye!==null&&Oe<V.length;Oe++){ye.index>Oe?(Pe=ye,ye=null):Pe=ye.sibling;var Ge=Y(P,ye,V[Oe],te);if(Ge===null){ye===null&&(ye=Pe);break}e&&ye&&Ge.alternate===null&&t(P,ye),L=f(Ge,L,Oe),Ve===null?Ce=Ge:Ve.sibling=Ge,Ve=Ge,ye=Pe}if(Oe===V.length)return n(P,ye),qe&&Da(P,Oe),Ce;if(ye===null){for(;Oe<V.length;Oe++)ye=ne(P,V[Oe],te),ye!==null&&(L=f(ye,L,Oe),Ve===null?Ce=ye:Ve.sibling=ye,Ve=ye);return qe&&Da(P,Oe),Ce}for(ye=r(ye);Oe<V.length;Oe++)Pe=F(ye,P,Oe,V[Oe],te),Pe!==null&&(e&&Pe.alternate!==null&&ye.delete(Pe.key===null?Oe:Pe.key),L=f(Pe,L,Oe),Ve===null?Ce=Pe:Ve.sibling=Pe,Ve=Pe);return e&&ye.forEach(function(Ml){return t(P,Ml)}),qe&&Da(P,Oe),Ce}function Ne(P,L,V,te){if(V==null)throw Error(i(151));for(var Ce=null,Ve=null,ye=L,Oe=L=0,Pe=null,Ge=V.next();ye!==null&&!Ge.done;Oe++,Ge=V.next()){ye.index>Oe?(Pe=ye,ye=null):Pe=ye.sibling;var Ml=Y(P,ye,Ge.value,te);if(Ml===null){ye===null&&(ye=Pe);break}e&&ye&&Ml.alternate===null&&t(P,ye),L=f(Ml,L,Oe),Ve===null?Ce=Ml:Ve.sibling=Ml,Ve=Ml,ye=Pe}if(Ge.done)return n(P,ye),qe&&Da(P,Oe),Ce;if(ye===null){for(;!Ge.done;Oe++,Ge=V.next())Ge=ne(P,Ge.value,te),Ge!==null&&(L=f(Ge,L,Oe),Ve===null?Ce=Ge:Ve.sibling=Ge,Ve=Ge);return qe&&Da(P,Oe),Ce}for(ye=r(ye);!Ge.done;Oe++,Ge=V.next())Ge=F(ye,P,Oe,Ge.value,te),Ge!==null&&(e&&Ge.alternate!==null&&ye.delete(Ge.key===null?Oe:Ge.key),L=f(Ge,L,Oe),Ve===null?Ce=Ge:Ve.sibling=Ge,Ve=Ge);return e&&ye.forEach(function(ej){return t(P,ej)}),qe&&Da(P,Oe),Ce}function at(P,L,V,te){if(typeof V=="object"&&V!==null&&V.type===E&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case w:e:{for(var Ce=V.key;L!==null;){if(L.key===Ce){if(Ce=V.type,Ce===E){if(L.tag===7){n(P,L.sibling),te=c(L,V.props.children),te.return=P,P=te;break e}}else if(L.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===z&&tr(Ce)===L.type){n(P,L.sibling),te=c(L,V.props),Vs(te,V),te.return=P,P=te;break e}n(P,L);break}else t(P,L);L=L.sibling}V.type===E?(te=Ql(V.props.children,P.mode,te,V.key),te.return=P,P=te):(te=ni(V.type,V.key,V.props,null,P.mode,te),Vs(te,V),te.return=P,P=te)}return b(P);case C:e:{for(Ce=V.key;L!==null;){if(L.key===Ce)if(L.tag===4&&L.stateNode.containerInfo===V.containerInfo&&L.stateNode.implementation===V.implementation){n(P,L.sibling),te=c(L,V.children||[]),te.return=P,P=te;break e}else{n(P,L);break}else t(P,L);L=L.sibling}te=_u(V,P.mode,te),te.return=P,P=te}return b(P);case z:return V=tr(V),at(P,L,V,te)}if(oe(V))return ge(P,L,V,te);if(I(V)){if(Ce=I(V),typeof Ce!="function")throw Error(i(150));return V=Ce.call(V),Ne(P,L,V,te)}if(typeof V.then=="function")return at(P,L,ci(V),te);if(V.$$typeof===T)return at(P,L,ri(P,V),te);ui(P,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,L!==null&&L.tag===6?(n(P,L.sibling),te=c(L,V),te.return=P,P=te):(n(P,L),te=Du(V,P.mode,te),te.return=P,P=te),b(P)):n(P,L)}return function(P,L,V,te){try{Is=0;var Ce=at(P,L,V,te);return Gr=null,Ce}catch(ye){if(ye===Vr||ye===oi)throw ye;var Ve=gn(29,ye,null,P.mode);return Ve.lanes=te,Ve.return=P,Ve}finally{}}}var ar=_p(!0),Op=_p(!1),hl=!1;function Gu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Yu(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 ml(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function pl(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,($e&2)!==0){var c=r.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),r.pending=t,t=ti(e),gp(e,null,n),t}return ei(e,r,t,n),ti(e)}function Gs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Zt(e,n)}}function $u(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var c=null,f=null;if(n=n.firstBaseUpdate,n!==null){do{var b={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};f===null?c=f=b:f=f.next=b,n=n.next}while(n!==null);f===null?c=f=t:f=f.next=t}else c=f=t;n={baseState:r.baseState,firstBaseUpdate:c,lastBaseUpdate:f,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ku=!1;function Ys(){if(Ku){var e=Ir;if(e!==null)throw e}}function $s(e,t,n,r){Ku=!1;var c=e.updateQueue;hl=!1;var f=c.firstBaseUpdate,b=c.lastBaseUpdate,R=c.shared.pending;if(R!==null){c.shared.pending=null;var k=R,G=k.next;k.next=null,b===null?f=G:b.next=G,b=k;var W=e.alternate;W!==null&&(W=W.updateQueue,R=W.lastBaseUpdate,R!==b&&(R===null?W.firstBaseUpdate=G:R.next=G,W.lastBaseUpdate=k))}if(f!==null){var ne=c.baseState;b=0,W=G=k=null,R=f;do{var Y=R.lane&-536870913,F=Y!==R.lane;if(F?(He&Y)===Y:(r&Y)===Y){Y!==0&&Y===qr&&(Ku=!0),W!==null&&(W=W.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var ge=e,Ne=R;Y=t;var at=n;switch(Ne.tag){case 1:if(ge=Ne.payload,typeof ge=="function"){ne=ge.call(at,ne,Y);break e}ne=ge;break e;case 3:ge.flags=ge.flags&-65537|128;case 0:if(ge=Ne.payload,Y=typeof ge=="function"?ge.call(at,ne,Y):ge,Y==null)break e;ne=y({},ne,Y);break e;case 2:hl=!0}}Y=R.callback,Y!==null&&(e.flags|=64,F&&(e.flags|=8192),F=c.callbacks,F===null?c.callbacks=[Y]:F.push(Y))}else F={lane:Y,tag:R.tag,payload:R.payload,callback:R.callback,next:null},W===null?(G=W=F,k=ne):W=W.next=F,b|=Y;if(R=R.next,R===null){if(R=c.shared.pending,R===null)break;F=R,R=F.next,F.next=null,c.lastBaseUpdate=F,c.shared.pending=null}}while(!0);W===null&&(k=ne),c.baseState=k,c.firstBaseUpdate=G,c.lastBaseUpdate=W,f===null&&(c.shared.lanes=0),bl|=b,e.lanes=b,e.memoizedState=ne}}function kp(e,t){if(typeof e!="function")throw Error(i(191,e));e.call(t)}function zp(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)kp(n[e],t)}var Yr=D(null),di=D(0);function Lp(e,t){e=Ia,Q(di,e),Q(Yr,t),Ia=e|t.baseLanes}function Xu(){Q(di,Ia),Q(Yr,Yr.current)}function Fu(){Ia=di.current,q(Yr),q(di)}var vn=D(null),Un=null;function gl(e){var t=e.alternate;Q(xt,xt.current&1),Q(vn,e),Un===null&&(t===null||Yr.current!==null||t.memoizedState!==null)&&(Un=e)}function Qu(e){Q(xt,xt.current),Q(vn,e),Un===null&&(Un=e)}function Up(e){e.tag===22?(Q(xt,xt.current),Q(vn,e),Un===null&&(Un=e)):vl()}function vl(){Q(xt,xt.current),Q(vn,vn.current)}function xn(e){q(vn),Un===e&&(Un=null),q(xt)}var xt=D(0);function fi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||nf(n)||af(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ka=0,_e=null,tt=null,Et=null,hi=!1,$r=!1,lr=!1,mi=0,Ks=0,Kr=null,GS=0;function gt(){throw Error(i(321))}function Zu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!pn(e[n],t[n]))return!1;return!0}function Ju(e,t,n,r,c,f){return ka=f,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?bg:hd,lr=!1,f=n(r,c),lr=!1,$r&&(f=Hp(t,n,r,c)),Bp(e),f}function Bp(e){U.H=Qs;var t=tt!==null&&tt.next!==null;if(ka=0,Et=tt=_e=null,hi=!1,Ks=0,Kr=null,t)throw Error(i(300));e===null||Rt||(e=e.dependencies,e!==null&&li(e)&&(Rt=!0))}function Hp(e,t,n,r){_e=e;var c=0;do{if($r&&(Kr=null),Ks=0,$r=!1,25<=c)throw Error(i(301));if(c+=1,Et=tt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}U.H=Sg,f=t(n,r)}while($r);return f}function YS(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?Xs(t):t,e=e.useState()[0],(tt!==null?tt.memoizedState:null)!==e&&(_e.flags|=1024),t}function Wu(){var e=mi!==0;return mi=0,e}function ed(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function td(e){if(hi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}hi=!1}ka=0,Et=tt=_e=null,$r=!1,Ks=mi=0,Kr=null}function Ft(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Et===null?_e.memoizedState=Et=e:Et=Et.next=e,Et}function yt(){if(tt===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=tt.next;var t=Et===null?_e.memoizedState:Et.next;if(t!==null)Et=t,tt=e;else{if(e===null)throw _e.alternate===null?Error(i(467)):Error(i(310));tt=e,e={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},Et===null?_e.memoizedState=Et=e:Et=Et.next=e}return Et}function pi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xs(e){var t=Ks;return Ks+=1,Kr===null&&(Kr=[]),e=Ap(Kr,e,t),t=_e,(Et===null?t.memoizedState:Et.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?bg:hd),e}function gi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Xs(e);if(e.$$typeof===T)return Pt(e)}throw Error(i(438,String(e)))}function nd(e){var t=null,n=_e.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=_e.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=pi(),_e.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=se;return t.index++,n}function za(e,t){return typeof t=="function"?t(e):t}function vi(e){var t=yt();return ad(t,tt,e)}function ad(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var c=e.baseQueue,f=r.pending;if(f!==null){if(c!==null){var b=c.next;c.next=f.next,f.next=b}t.baseQueue=c=f,r.pending=null}if(f=e.baseState,c===null)e.memoizedState=f;else{t=c.next;var R=b=null,k=null,G=t,W=!1;do{var ne=G.lane&-536870913;if(ne!==G.lane?(He&ne)===ne:(ka&ne)===ne){var Y=G.revertLane;if(Y===0)k!==null&&(k=k.next={lane:0,revertLane:0,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),ne===qr&&(W=!0);else if((ka&Y)===Y){G=G.next,Y===qr&&(W=!0);continue}else ne={lane:0,revertLane:G.revertLane,gesture:null,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},k===null?(R=k=ne,b=f):k=k.next=ne,_e.lanes|=Y,bl|=Y;ne=G.action,lr&&n(f,ne),f=G.hasEagerState?G.eagerState:n(f,ne)}else Y={lane:ne,revertLane:G.revertLane,gesture:G.gesture,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null},k===null?(R=k=Y,b=f):k=k.next=Y,_e.lanes|=ne,bl|=ne;G=G.next}while(G!==null&&G!==t);if(k===null?b=f:k.next=R,!pn(f,e.memoizedState)&&(Rt=!0,W&&(n=Ir,n!==null)))throw n;e.memoizedState=f,e.baseState=b,e.baseQueue=k,r.lastRenderedState=f}return c===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function ld(e){var t=yt(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,c=n.pending,f=t.memoizedState;if(c!==null){n.pending=null;var b=c=c.next;do f=e(f,b.action),b=b.next;while(b!==c);pn(f,t.memoizedState)||(Rt=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),n.lastRenderedState=f}return[f,r]}function Pp(e,t,n){var r=_e,c=yt(),f=qe;if(f){if(n===void 0)throw Error(i(407));n=n()}else n=t();var b=!pn((tt||c).memoizedState,n);if(b&&(c.memoizedState=n,Rt=!0),c=c.queue,od(Vp.bind(null,r,c,e),[e]),c.getSnapshot!==t||b||Et!==null&&Et.memoizedState.tag&1){if(r.flags|=2048,Xr(9,{destroy:void 0},Ip.bind(null,r,c,n,t),null),ot===null)throw Error(i(349));f||(ka&127)!==0||qp(r,t,n)}return n}function qp(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=_e.updateQueue,t===null?(t=pi(),_e.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ip(e,t,n,r){t.value=n,t.getSnapshot=r,Gp(t)&&Yp(e)}function Vp(e,t,n){return n(function(){Gp(t)&&Yp(e)})}function Gp(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!pn(e,n)}catch{return!0}}function Yp(e){var t=Fl(e,2);t!==null&&ln(t,e,2)}function rd(e){var t=Ft();if(typeof e=="function"){var n=e;if(e=n(),lr){Zn(!0);try{n()}finally{Zn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:za,lastRenderedState:e},t}function $p(e,t,n,r){return e.baseState=n,ad(e,tt,typeof r=="function"?r:za)}function $S(e,t,n,r,c){if(bi(e))throw Error(i(485));if(e=t.action,e!==null){var f={payload:c,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){f.listeners.push(b)}};U.T!==null?n(!0):f.isTransition=!1,r(f),n=t.pending,n===null?(f.next=t.pending=f,Kp(t,f)):(f.next=n.next,t.pending=n.next=f)}}function Kp(e,t){var n=t.action,r=t.payload,c=e.state;if(t.isTransition){var f=U.T,b={};U.T=b;try{var R=n(c,r),k=U.S;k!==null&&k(b,R),Xp(e,t,R)}catch(G){sd(e,t,G)}finally{f!==null&&b.types!==null&&(f.types=b.types),U.T=f}}else try{f=n(c,r),Xp(e,t,f)}catch(G){sd(e,t,G)}}function Xp(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(r){Fp(e,t,r)},function(r){return sd(e,t,r)}):Fp(e,t,n)}function Fp(e,t,n){t.status="fulfilled",t.value=n,Qp(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Kp(e,n)))}function sd(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=n,Qp(t),t=t.next;while(t!==r)}e.action=null}function Qp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Zp(e,t){return t}function Jp(e,t){if(qe){var n=ot.formState;if(n!==null){e:{var r=_e;if(qe){if(ct){t:{for(var c=ct,f=Ln;c.nodeType!==8;){if(!f){c=null;break t}if(c=Bn(c.nextSibling),c===null){c=null;break t}}f=c.data,c=f==="F!"||f==="F"?c:null}if(c){ct=Bn(c.nextSibling),r=c.data==="F!";break e}}dl(r)}r=!1}r&&(t=n[0])}}return n=Ft(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zp,lastRenderedState:t},n.queue=r,n=vg.bind(null,_e,r),r.dispatch=n,r=rd(!1),f=fd.bind(null,_e,!1,r.queue),r=Ft(),c={state:t,dispatch:null,action:e,pending:null},r.queue=c,n=$S.bind(null,_e,c,f,n),c.dispatch=n,r.memoizedState=e,[t,n,!1]}function Wp(e){var t=yt();return eg(t,tt,e)}function eg(e,t,n){if(t=ad(e,t,Zp)[0],e=vi(za)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Xs(t)}catch(b){throw b===Vr?oi:b}else r=t;t=yt();var c=t.queue,f=c.dispatch;return n!==t.memoizedState&&(_e.flags|=2048,Xr(9,{destroy:void 0},KS.bind(null,c,n),null)),[r,f,e]}function KS(e,t){e.action=t}function tg(e){var t=yt(),n=tt;if(n!==null)return eg(t,n,e);yt(),t=t.memoizedState,n=yt();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Xr(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=_e.updateQueue,t===null&&(t=pi(),_e.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ng(){return yt().memoizedState}function xi(e,t,n,r){var c=Ft();_e.flags|=e,c.memoizedState=Xr(1|t,{destroy:void 0},n,r===void 0?null:r)}function yi(e,t,n,r){var c=yt();r=r===void 0?null:r;var f=c.memoizedState.inst;tt!==null&&r!==null&&Zu(r,tt.memoizedState.deps)?c.memoizedState=Xr(t,f,n,r):(_e.flags|=e,c.memoizedState=Xr(1|t,f,n,r))}function ag(e,t){xi(8390656,8,e,t)}function od(e,t){yi(2048,8,e,t)}function XS(e){_e.flags|=4;var t=_e.updateQueue;if(t===null)t=pi(),_e.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function lg(e){var t=yt().memoizedState;return XS({ref:t,nextImpl:e}),function(){if(($e&2)!==0)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function rg(e,t){return yi(4,2,e,t)}function sg(e,t){return yi(4,4,e,t)}function og(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ig(e,t,n){n=n!=null?n.concat([e]):null,yi(4,4,og.bind(null,t,e),n)}function id(){}function cg(e,t){var n=yt();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Zu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ug(e,t){var n=yt();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Zu(t,r[1]))return r[0];if(r=e(),lr){Zn(!0);try{e()}finally{Zn(!1)}}return n.memoizedState=[r,t],r}function cd(e,t,n){return n===void 0||(ka&1073741824)!==0&&(He&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=dv(),_e.lanes|=e,bl|=e,n)}function dg(e,t,n,r){return pn(n,t)?n:Yr.current!==null?(e=cd(e,n,r),pn(e,t)||(Rt=!0),e):(ka&42)===0||(ka&1073741824)!==0&&(He&261930)===0?(Rt=!0,e.memoizedState=n):(e=dv(),_e.lanes|=e,bl|=e,t)}function fg(e,t,n,r,c){var f=$.p;$.p=f!==0&&8>f?f:8;var b=U.T,R={};U.T=R,fd(e,!1,t,n);try{var k=c(),G=U.S;if(G!==null&&G(R,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var W=VS(k,r);Fs(e,t,W,Sn(e))}else Fs(e,t,r,Sn(e))}catch(ne){Fs(e,t,{then:function(){},status:"rejected",reason:ne},Sn())}finally{$.p=f,b!==null&&R.types!==null&&(b.types=R.types),U.T=b}}function FS(){}function ud(e,t,n,r){if(e.tag!==5)throw Error(i(476));var c=hg(e).queue;fg(e,c,t,le,n===null?FS:function(){return mg(e),n(r)})}function hg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:za,lastRenderedState:le},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:za,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function mg(e){var t=hg(e);t.next===null&&(t=e.alternate.memoizedState),Fs(e,t.next.queue,{},Sn())}function dd(){return Pt(ho)}function pg(){return yt().memoizedState}function gg(){return yt().memoizedState}function QS(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Sn();e=ml(n);var r=pl(t,e,n);r!==null&&(ln(r,t,n),Gs(r,t,n)),t={cache:Pu()},e.payload=t;return}t=t.return}}function ZS(e,t,n){var r=Sn();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},bi(e)?xg(t,n):(n=Au(e,t,n,r),n!==null&&(ln(n,e,r),yg(n,t,r)))}function vg(e,t,n){var r=Sn();Fs(e,t,n,r)}function Fs(e,t,n,r){var c={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(bi(e))xg(t,c);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var b=t.lastRenderedState,R=f(b,n);if(c.hasEagerState=!0,c.eagerState=R,pn(R,b))return ei(e,t,c,0),ot===null&&Wo(),!1}catch{}finally{}if(n=Au(e,t,c,r),n!==null)return ln(n,e,r),yg(n,t,r),!0}return!1}function fd(e,t,n,r){if(r={lane:2,revertLane:Gd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},bi(e)){if(t)throw Error(i(479))}else t=Au(e,n,r,2),t!==null&&ln(t,e,2)}function bi(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function xg(e,t){$r=hi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function yg(e,t,n){if((n&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Zt(e,n)}}var Qs={readContext:Pt,use:gi,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};Qs.useEffectEvent=gt;var bg={readContext:Pt,use:gi,useCallback:function(e,t){return Ft().memoizedState=[e,t===void 0?null:t],e},useContext:Pt,useEffect:ag,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,xi(4194308,4,og.bind(null,t,e),n)},useLayoutEffect:function(e,t){return xi(4194308,4,e,t)},useInsertionEffect:function(e,t){xi(4,2,e,t)},useMemo:function(e,t){var n=Ft();t=t===void 0?null:t;var r=e();if(lr){Zn(!0);try{e()}finally{Zn(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Ft();if(n!==void 0){var c=n(t);if(lr){Zn(!0);try{n(t)}finally{Zn(!1)}}}else c=t;return r.memoizedState=r.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},r.queue=e,e=e.dispatch=ZS.bind(null,_e,e),[r.memoizedState,e]},useRef:function(e){var t=Ft();return e={current:e},t.memoizedState=e},useState:function(e){e=rd(e);var t=e.queue,n=vg.bind(null,_e,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:id,useDeferredValue:function(e,t){var n=Ft();return cd(n,e,t)},useTransition:function(){var e=rd(!1);return e=fg.bind(null,_e,e.queue,!0,!1),Ft().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=_e,c=Ft();if(qe){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),ot===null)throw Error(i(349));(He&127)!==0||qp(r,t,n)}c.memoizedState=n;var f={value:n,getSnapshot:t};return c.queue=f,ag(Vp.bind(null,r,f,e),[e]),r.flags|=2048,Xr(9,{destroy:void 0},Ip.bind(null,r,f,n,t),null),n},useId:function(){var e=Ft(),t=ot.identifierPrefix;if(qe){var n=ua,r=ca;n=(r&~(1<<32-jt(r)-1)).toString(32)+n,t="_"+t+"R_"+n,n=mi++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=GS++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:dd,useFormState:Jp,useActionState:Jp,useOptimistic:function(e){var t=Ft();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=fd.bind(null,_e,!0,n),n.dispatch=t,[e,t]},useMemoCache:nd,useCacheRefresh:function(){return Ft().memoizedState=QS.bind(null,_e)},useEffectEvent:function(e){var t=Ft(),n={impl:e};return t.memoizedState=n,function(){if(($e&2)!==0)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},hd={readContext:Pt,use:gi,useCallback:cg,useContext:Pt,useEffect:od,useImperativeHandle:ig,useInsertionEffect:rg,useLayoutEffect:sg,useMemo:ug,useReducer:vi,useRef:ng,useState:function(){return vi(za)},useDebugValue:id,useDeferredValue:function(e,t){var n=yt();return dg(n,tt.memoizedState,e,t)},useTransition:function(){var e=vi(za)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:Xs(e),t]},useSyncExternalStore:Pp,useId:pg,useHostTransitionStatus:dd,useFormState:Wp,useActionState:Wp,useOptimistic:function(e,t){var n=yt();return $p(n,tt,e,t)},useMemoCache:nd,useCacheRefresh:gg};hd.useEffectEvent=lg;var Sg={readContext:Pt,use:gi,useCallback:cg,useContext:Pt,useEffect:od,useImperativeHandle:ig,useInsertionEffect:rg,useLayoutEffect:sg,useMemo:ug,useReducer:ld,useRef:ng,useState:function(){return ld(za)},useDebugValue:id,useDeferredValue:function(e,t){var n=yt();return tt===null?cd(n,e,t):dg(n,tt.memoizedState,e,t)},useTransition:function(){var e=ld(za)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:Xs(e),t]},useSyncExternalStore:Pp,useId:pg,useHostTransitionStatus:dd,useFormState:tg,useActionState:tg,useOptimistic:function(e,t){var n=yt();return tt!==null?$p(n,tt,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:nd,useCacheRefresh:gg};Sg.useEffectEvent=lg;function md(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:y({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var pd={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Sn(),c=ml(r);c.payload=t,n!=null&&(c.callback=n),t=pl(e,c,r),t!==null&&(ln(t,e,r),Gs(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Sn(),c=ml(r);c.tag=1,c.payload=t,n!=null&&(c.callback=n),t=pl(e,c,r),t!==null&&(ln(t,e,r),Gs(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Sn(),r=ml(n);r.tag=2,t!=null&&(r.callback=t),t=pl(e,r,n),t!==null&&(ln(t,e,n),Gs(t,e,n))}};function wg(e,t,n,r,c,f,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,f,b):t.prototype&&t.prototype.isPureReactComponent?!Ls(n,r)||!Ls(c,f):!0}function jg(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&pd.enqueueReplaceState(t,t.state,null)}function rr(e,t){var n=t;if("ref"in t){n={};for(var r in t)r!=="ref"&&(n[r]=t[r])}if(e=e.defaultProps){n===t&&(n=y({},n));for(var c in e)n[c]===void 0&&(n[c]=e[c])}return n}function Cg(e){Jo(e)}function Eg(e){console.error(e)}function Rg(e){Jo(e)}function Si(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Ng(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function gd(e,t,n){return n=ml(n),n.tag=3,n.payload={element:null},n.callback=function(){Si(e,t)},n}function Tg(e){return e=ml(e),e.tag=3,e}function Ag(e,t,n,r){var c=n.type.getDerivedStateFromError;if(typeof c=="function"){var f=r.value;e.payload=function(){return c(f)},e.callback=function(){Ng(t,n,r)}}var b=n.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Ng(t,n,r),typeof c!="function"&&(Sl===null?Sl=new Set([this]):Sl.add(this));var R=r.stack;this.componentDidCatch(r.value,{componentStack:R!==null?R:""})})}function JS(e,t,n,r,c){if(n.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=n.alternate,t!==null&&Pr(t,n,c,!0),n=vn.current,n!==null){switch(n.tag){case 31:case 13:return Un===null?Oi():n.alternate===null&&vt===0&&(vt=3),n.flags&=-257,n.flags|=65536,n.lanes=c,r===ii?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),qd(e,r,c)),!1;case 22:return n.flags|=65536,r===ii?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),qd(e,r,c)),!1}throw Error(i(435,n.tag))}return qd(e,r,c),Oi(),!1}if(qe)return t=vn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,r!==zu&&(e=Error(i(422),{cause:r}),Hs(On(e,n)))):(r!==zu&&(t=Error(i(423),{cause:r}),Hs(On(t,n))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,r=On(r,n),c=gd(e.stateNode,r,c),$u(e,c),vt!==4&&(vt=2)),!1;var f=Error(i(520),{cause:r});if(f=On(f,n),lo===null?lo=[f]:lo.push(f),vt!==4&&(vt=2),t===null)return!0;r=On(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=c&-c,n.lanes|=e,e=gd(n.stateNode,r,e),$u(n,e),!1;case 1:if(t=n.type,f=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Sl===null||!Sl.has(f))))return n.flags|=65536,c&=-c,n.lanes|=c,c=Tg(c),Ag(c,e,n,r),$u(n,c),!1}n=n.return}while(n!==null);return!1}var vd=Error(i(461)),Rt=!1;function qt(e,t,n,r){t.child=e===null?Op(t,null,n,r):ar(t,e.child,n,r)}function Mg(e,t,n,r,c){n=n.render;var f=t.ref;if("ref"in r){var b={};for(var R in r)R!=="ref"&&(b[R]=r[R])}else b=r;return Wl(t),r=Ju(e,t,n,b,f,c),R=Wu(),e!==null&&!Rt?(ed(e,t,c),La(e,t,c)):(qe&&R&&Ou(t),t.flags|=1,qt(e,t,r,c),t.child)}function Dg(e,t,n,r,c){if(e===null){var f=n.type;return typeof f=="function"&&!Mu(f)&&f.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=f,_g(e,t,f,r,c)):(e=ni(n.type,null,r,t,t.mode,c),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Ed(e,c)){var b=f.memoizedProps;if(n=n.compare,n=n!==null?n:Ls,n(b,r)&&e.ref===t.ref)return La(e,t,c)}return t.flags|=1,e=Ma(f,r),e.ref=t.ref,e.return=t,t.child=e}function _g(e,t,n,r,c){if(e!==null){var f=e.memoizedProps;if(Ls(f,r)&&e.ref===t.ref)if(Rt=!1,t.pendingProps=r=f,Ed(e,c))(e.flags&131072)!==0&&(Rt=!0);else return t.lanes=e.lanes,La(e,t,c)}return xd(e,t,n,r,c)}function Og(e,t,n,r){var c=r.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|n:n,e!==null){for(r=t.child=e.child,c=0;r!==null;)c=c|r.lanes|r.childLanes,r=r.sibling;r=c&~f}else r=0,t.child=null;return kg(e,t,f,n,r)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&si(t,f!==null?f.cachePool:null),f!==null?Lp(t,f):Xu(),Up(t);else return r=t.lanes=536870912,kg(e,t,f!==null?f.baseLanes|n:n,n,r)}else f!==null?(si(t,f.cachePool),Lp(t,f),vl(),t.memoizedState=null):(e!==null&&si(t,null),Xu(),vl());return qt(e,t,c,n),t.child}function Zs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function kg(e,t,n,r,c){var f=Iu();return f=f===null?null:{parent:Ct._currentValue,pool:f},t.memoizedState={baseLanes:n,cachePool:f},e!==null&&si(t,null),Xu(),Up(t),e!==null&&Pr(e,t,r,!0),t.childLanes=c,null}function wi(e,t){return t=Ci({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function zg(e,t,n){return ar(t,e.child,null,n),e=wi(t,t.pendingProps),e.flags|=2,xn(t),t.memoizedState=null,e}function WS(e,t,n){var r=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(qe){if(r.mode==="hidden")return e=wi(t,r),t.lanes=536870912,Zs(null,e);if(Qu(t),(e=ct)?(e=Kv(e,Ln),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:cl!==null?{id:ca,overflow:ua}:null,retryLane:536870912,hydrationErrors:null},n=xp(e),n.return=t,t.child=n,Ht=t,ct=null)):e=null,e===null)throw dl(t);return t.lanes=536870912,null}return wi(t,r)}var f=e.memoizedState;if(f!==null){var b=f.dehydrated;if(Qu(t),c)if(t.flags&256)t.flags&=-257,t=zg(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(Rt||Pr(e,t,n,!1),c=(n&e.childLanes)!==0,Rt||c){if(r=ot,r!==null&&(b=Jn(r,n),b!==0&&b!==f.retryLane))throw f.retryLane=b,Fl(e,b),ln(r,e,b),vd;Oi(),t=zg(e,t,n)}else e=f.treeContext,ct=Bn(b.nextSibling),Ht=t,qe=!0,ul=null,Ln=!1,e!==null&&Sp(t,e),t=wi(t,r),t.flags|=4096;return t}return e=Ma(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ji(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function xd(e,t,n,r,c){return Wl(t),n=Ju(e,t,n,r,void 0,c),r=Wu(),e!==null&&!Rt?(ed(e,t,c),La(e,t,c)):(qe&&r&&Ou(t),t.flags|=1,qt(e,t,n,c),t.child)}function Lg(e,t,n,r,c,f){return Wl(t),t.updateQueue=null,n=Hp(t,r,n,c),Bp(e),r=Wu(),e!==null&&!Rt?(ed(e,t,f),La(e,t,f)):(qe&&r&&Ou(t),t.flags|=1,qt(e,t,n,f),t.child)}function Ug(e,t,n,r,c){if(Wl(t),t.stateNode===null){var f=Lr,b=n.contextType;typeof b=="object"&&b!==null&&(f=Pt(b)),f=new n(r,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=pd,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=r,f.state=t.memoizedState,f.refs={},Gu(t),b=n.contextType,f.context=typeof b=="object"&&b!==null?Pt(b):Lr,f.state=t.memoizedState,b=n.getDerivedStateFromProps,typeof b=="function"&&(md(t,n,b,r),f.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(b=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),b!==f.state&&pd.enqueueReplaceState(f,f.state,null),$s(t,r,f,c),Ys(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){f=t.stateNode;var R=t.memoizedProps,k=rr(n,R);f.props=k;var G=f.context,W=n.contextType;b=Lr,typeof W=="object"&&W!==null&&(b=Pt(W));var ne=n.getDerivedStateFromProps;W=typeof ne=="function"||typeof f.getSnapshotBeforeUpdate=="function",R=t.pendingProps!==R,W||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(R||G!==b)&&jg(t,f,r,b),hl=!1;var Y=t.memoizedState;f.state=Y,$s(t,r,f,c),Ys(),G=t.memoizedState,R||Y!==G||hl?(typeof ne=="function"&&(md(t,n,ne,r),G=t.memoizedState),(k=hl||wg(t,n,k,r,Y,G,b))?(W||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=G),f.props=r,f.state=G,f.context=b,r=k):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{f=t.stateNode,Yu(e,t),b=t.memoizedProps,W=rr(n,b),f.props=W,ne=t.pendingProps,Y=f.context,G=n.contextType,k=Lr,typeof G=="object"&&G!==null&&(k=Pt(G)),R=n.getDerivedStateFromProps,(G=typeof R=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(b!==ne||Y!==k)&&jg(t,f,r,k),hl=!1,Y=t.memoizedState,f.state=Y,$s(t,r,f,c),Ys();var F=t.memoizedState;b!==ne||Y!==F||hl||e!==null&&e.dependencies!==null&&li(e.dependencies)?(typeof R=="function"&&(md(t,n,R,r),F=t.memoizedState),(W=hl||wg(t,n,W,r,Y,F,k)||e!==null&&e.dependencies!==null&&li(e.dependencies))?(G||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(r,F,k),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(r,F,k)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=F),f.props=r,f.state=F,f.context=k,r=W):(typeof f.componentDidUpdate!="function"||b===e.memoizedProps&&Y===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&Y===e.memoizedState||(t.flags|=1024),r=!1)}return f=r,ji(e,t),r=(t.flags&128)!==0,f||r?(f=t.stateNode,n=r&&typeof n.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&r?(t.child=ar(t,e.child,null,c),t.child=ar(t,null,n,c)):qt(e,t,n,c),t.memoizedState=f.state,e=t.child):e=La(e,t,c),e}function Bg(e,t,n,r){return Zl(),t.flags|=256,qt(e,t,n,r),t.child}var yd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function bd(e){return{baseLanes:e,cachePool:Np()}}function Sd(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=bn),e}function Hg(e,t,n){var r=t.pendingProps,c=!1,f=(t.flags&128)!==0,b;if((b=f)||(b=e!==null&&e.memoizedState===null?!1:(xt.current&2)!==0),b&&(c=!0,t.flags&=-129),b=(t.flags&32)!==0,t.flags&=-33,e===null){if(qe){if(c?gl(t):vl(),(e=ct)?(e=Kv(e,Ln),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:cl!==null?{id:ca,overflow:ua}:null,retryLane:536870912,hydrationErrors:null},n=xp(e),n.return=t,t.child=n,Ht=t,ct=null)):e=null,e===null)throw dl(t);return af(e)?t.lanes=32:t.lanes=536870912,null}var R=r.children;return r=r.fallback,c?(vl(),c=t.mode,R=Ci({mode:"hidden",children:R},c),r=Ql(r,c,n,null),R.return=t,r.return=t,R.sibling=r,t.child=R,r=t.child,r.memoizedState=bd(n),r.childLanes=Sd(e,b,n),t.memoizedState=yd,Zs(null,r)):(gl(t),wd(t,R))}var k=e.memoizedState;if(k!==null&&(R=k.dehydrated,R!==null)){if(f)t.flags&256?(gl(t),t.flags&=-257,t=jd(e,t,n)):t.memoizedState!==null?(vl(),t.child=e.child,t.flags|=128,t=null):(vl(),R=r.fallback,c=t.mode,r=Ci({mode:"visible",children:r.children},c),R=Ql(R,c,n,null),R.flags|=2,r.return=t,R.return=t,r.sibling=R,t.child=r,ar(t,e.child,null,n),r=t.child,r.memoizedState=bd(n),r.childLanes=Sd(e,b,n),t.memoizedState=yd,t=Zs(null,r));else if(gl(t),af(R)){if(b=R.nextSibling&&R.nextSibling.dataset,b)var G=b.dgst;b=G,r=Error(i(419)),r.stack="",r.digest=b,Hs({value:r,source:null,stack:null}),t=jd(e,t,n)}else if(Rt||Pr(e,t,n,!1),b=(n&e.childLanes)!==0,Rt||b){if(b=ot,b!==null&&(r=Jn(b,n),r!==0&&r!==k.retryLane))throw k.retryLane=r,Fl(e,r),ln(b,e,r),vd;nf(R)||Oi(),t=jd(e,t,n)}else nf(R)?(t.flags|=192,t.child=e.child,t=null):(e=k.treeContext,ct=Bn(R.nextSibling),Ht=t,qe=!0,ul=null,Ln=!1,e!==null&&Sp(t,e),t=wd(t,r.children),t.flags|=4096);return t}return c?(vl(),R=r.fallback,c=t.mode,k=e.child,G=k.sibling,r=Ma(k,{mode:"hidden",children:r.children}),r.subtreeFlags=k.subtreeFlags&65011712,G!==null?R=Ma(G,R):(R=Ql(R,c,n,null),R.flags|=2),R.return=t,r.return=t,r.sibling=R,t.child=r,Zs(null,r),r=t.child,R=e.child.memoizedState,R===null?R=bd(n):(c=R.cachePool,c!==null?(k=Ct._currentValue,c=c.parent!==k?{parent:k,pool:k}:c):c=Np(),R={baseLanes:R.baseLanes|n,cachePool:c}),r.memoizedState=R,r.childLanes=Sd(e,b,n),t.memoizedState=yd,Zs(e.child,r)):(gl(t),n=e.child,e=n.sibling,n=Ma(n,{mode:"visible",children:r.children}),n.return=t,n.sibling=null,e!==null&&(b=t.deletions,b===null?(t.deletions=[e],t.flags|=16):b.push(e)),t.child=n,t.memoizedState=null,n)}function wd(e,t){return t=Ci({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ci(e,t){return e=gn(22,e,null,t),e.lanes=0,e}function jd(e,t,n){return ar(t,e.child,null,n),e=wd(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Pg(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Bu(e.return,t,n)}function Cd(e,t,n,r,c,f){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:c,treeForkCount:f}:(b.isBackwards=t,b.rendering=null,b.renderingStartTime=0,b.last=r,b.tail=n,b.tailMode=c,b.treeForkCount=f)}function qg(e,t,n){var r=t.pendingProps,c=r.revealOrder,f=r.tail;r=r.children;var b=xt.current,R=(b&2)!==0;if(R?(b=b&1|2,t.flags|=128):b&=1,Q(xt,b),qt(e,t,r,n),r=qe?Bs:0,!R&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Pg(e,n,t);else if(e.tag===19)Pg(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(c){case"forwards":for(n=t.child,c=null;n!==null;)e=n.alternate,e!==null&&fi(e)===null&&(c=n),n=n.sibling;n=c,n===null?(c=t.child,t.child=null):(c=n.sibling,n.sibling=null),Cd(t,!1,c,n,f,r);break;case"backwards":case"unstable_legacy-backwards":for(n=null,c=t.child,t.child=null;c!==null;){if(e=c.alternate,e!==null&&fi(e)===null){t.child=c;break}e=c.sibling,c.sibling=n,n=c,c=e}Cd(t,!0,n,null,f,r);break;case"together":Cd(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function La(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),bl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Pr(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Ma(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ma(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ed(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&li(e)))}function ew(e,t,n){switch(t.tag){case 3:fe(t,t.stateNode.containerInfo),fl(t,Ct,e.memoizedState.cache),Zl();break;case 27:case 5:J(t);break;case 4:fe(t,t.stateNode.containerInfo);break;case 10:fl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Qu(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(gl(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Hg(e,t,n):(gl(t),e=La(e,t,n),e!==null?e.sibling:null);gl(t);break;case 19:var c=(e.flags&128)!==0;if(r=(n&t.childLanes)!==0,r||(Pr(e,t,n,!1),r=(n&t.childLanes)!==0),c){if(r)return qg(e,t,n);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),Q(xt,xt.current),r)break;return null;case 22:return t.lanes=0,Og(e,t,n,t.pendingProps);case 24:fl(t,Ct,e.memoizedState.cache)}return La(e,t,n)}function Ig(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Rt=!0;else{if(!Ed(e,n)&&(t.flags&128)===0)return Rt=!1,ew(e,t,n);Rt=(e.flags&131072)!==0}else Rt=!1,qe&&(t.flags&1048576)!==0&&bp(t,Bs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=tr(t.elementType),t.type=e,typeof e=="function")Mu(e)?(r=rr(e,r),t.tag=1,t=Ug(null,t,e,r,n)):(t.tag=0,t=xd(null,t,e,r,n));else{if(e!=null){var c=e.$$typeof;if(c===_){t.tag=11,t=Mg(null,t,e,r,n);break e}else if(c===H){t.tag=14,t=Dg(null,t,e,r,n);break e}}throw t=ee(e)||e,Error(i(306,t,""))}}return t;case 0:return xd(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,c=rr(r,t.pendingProps),Ug(e,t,r,c,n);case 3:e:{if(fe(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var f=t.memoizedState;c=f.element,Yu(e,t),$s(t,r,null,n);var b=t.memoizedState;if(r=b.cache,fl(t,Ct,r),r!==f.cache&&Hu(t,[Ct],n,!0),Ys(),r=b.element,f.isDehydrated)if(f={element:r,isDehydrated:!1,cache:b.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=Bg(e,t,r,n);break e}else if(r!==c){c=On(Error(i(424)),t),Hs(c),t=Bg(e,t,r,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(ct=Bn(e.firstChild),Ht=t,qe=!0,ul=null,Ln=!0,n=Op(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Zl(),r===c){t=La(e,t,n);break e}qt(e,t,r,n)}t=t.child}return t;case 26:return ji(e,t),e===null?(n=Wv(t.type,null,t.pendingProps,null))?t.memoizedState=n:qe||(n=t.type,e=t.pendingProps,r=Pi(Se.current).createElement(n),r[Bt]=t,r[Jt]=e,It(r,n,e),_t(r),t.stateNode=r):t.memoizedState=Wv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return J(t),e===null&&qe&&(r=t.stateNode=Qv(t.type,t.pendingProps,Se.current),Ht=t,Ln=!0,c=ct,El(t.type)?(lf=c,ct=Bn(r.firstChild)):ct=c),qt(e,t,t.pendingProps.children,n),ji(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&qe&&((c=r=ct)&&(r=Mw(r,t.type,t.pendingProps,Ln),r!==null?(t.stateNode=r,Ht=t,ct=Bn(r.firstChild),Ln=!1,c=!0):c=!1),c||dl(t)),J(t),c=t.type,f=t.pendingProps,b=e!==null?e.memoizedProps:null,r=f.children,Wd(c,f)?r=null:b!==null&&Wd(c,b)&&(t.flags|=32),t.memoizedState!==null&&(c=Ju(e,t,YS,null,null,n),ho._currentValue=c),ji(e,t),qt(e,t,r,n),t.child;case 6:return e===null&&qe&&((e=n=ct)&&(n=Dw(n,t.pendingProps,Ln),n!==null?(t.stateNode=n,Ht=t,ct=null,e=!0):e=!1),e||dl(t)),null;case 13:return Hg(e,t,n);case 4:return fe(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ar(t,null,r,n):qt(e,t,r,n),t.child;case 11:return Mg(e,t,t.type,t.pendingProps,n);case 7:return qt(e,t,t.pendingProps,n),t.child;case 8:return qt(e,t,t.pendingProps.children,n),t.child;case 12:return qt(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,fl(t,t.type,r.value),qt(e,t,r.children,n),t.child;case 9:return c=t.type._context,r=t.pendingProps.children,Wl(t),c=Pt(c),r=r(c),t.flags|=1,qt(e,t,r,n),t.child;case 14:return Dg(e,t,t.type,t.pendingProps,n);case 15:return _g(e,t,t.type,t.pendingProps,n);case 19:return qg(e,t,n);case 31:return WS(e,t,n);case 22:return Og(e,t,n,t.pendingProps);case 24:return Wl(t),r=Pt(Ct),e===null?(c=Iu(),c===null&&(c=ot,f=Pu(),c.pooledCache=f,f.refCount++,f!==null&&(c.pooledCacheLanes|=n),c=f),t.memoizedState={parent:r,cache:c},Gu(t),fl(t,Ct,c)):((e.lanes&n)!==0&&(Yu(e,t),$s(t,null,null,n),Ys()),c=e.memoizedState,f=t.memoizedState,c.parent!==r?(c={parent:r,cache:r},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),fl(t,Ct,r)):(r=f.cache,fl(t,Ct,r),r!==c.cache&&Hu(t,[Ct],n,!0))),qt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ua(e){e.flags|=4}function Rd(e,t,n,r,c){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(c&335544128)===c)if(e.stateNode.complete)e.flags|=8192;else if(pv())e.flags|=8192;else throw nr=ii,Vu}else e.flags&=-16777217}function Vg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!lx(t))if(pv())e.flags|=8192;else throw nr=ii,Vu}function Ei(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?st():536870912,e.lanes|=t,Jr|=t)}function Js(e,t){if(!qe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ut(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var c=e.child;c!==null;)n|=c.lanes|c.childLanes,r|=c.subtreeFlags&65011712,r|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)n|=c.lanes|c.childLanes,r|=c.subtreeFlags,r|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function tw(e,t,n){var r=t.pendingProps;switch(ku(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ut(t),null;case 1:return ut(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Oa(Ct),xe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Hr(t)?Ua(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Lu())),ut(t),null;case 26:var c=t.type,f=t.memoizedState;return e===null?(Ua(t),f!==null?(ut(t),Vg(t,f)):(ut(t),Rd(t,c,null,r,n))):f?f!==e.memoizedState?(Ua(t),ut(t),Vg(t,f)):(ut(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&Ua(t),ut(t),Rd(t,c,e,r,n)),null;case 27:if(me(t),n=Se.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ua(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ut(t),null}e=ae.current,Hr(t)?wp(t):(e=Qv(c,r,n),t.stateNode=e,Ua(t))}return ut(t),null;case 5:if(me(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ua(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return ut(t),null}if(f=ae.current,Hr(t))wp(t);else{var b=Pi(Se.current);switch(f){case 1:f=b.createElementNS("http://www.w3.org/2000/svg",c);break;case 2:f=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;default:switch(c){case"svg":f=b.createElementNS("http://www.w3.org/2000/svg",c);break;case"math":f=b.createElementNS("http://www.w3.org/1998/Math/MathML",c);break;case"script":f=b.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof r.is=="string"?b.createElement("select",{is:r.is}):b.createElement("select"),r.multiple?f.multiple=!0:r.size&&(f.size=r.size);break;default:f=typeof r.is=="string"?b.createElement(c,{is:r.is}):b.createElement(c)}}f[Bt]=t,f[Jt]=r;e:for(b=t.child;b!==null;){if(b.tag===5||b.tag===6)f.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===t)break e;for(;b.sibling===null;){if(b.return===null||b.return===t)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}t.stateNode=f;e:switch(It(f,c,r),c){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&Ua(t)}}return ut(t),Rd(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ua(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(i(166));if(e=Se.current,Hr(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,c=Ht,c!==null)switch(c.tag){case 27:case 5:r=c.memoizedProps}e[Bt]=t,e=!!(e.nodeValue===n||r!==null&&r.suppressHydrationWarning===!0||Hv(e.nodeValue,n)),e||dl(t,!0)}else e=Pi(e).createTextNode(r),e[Bt]=t,t.stateNode=e}return ut(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Hr(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(557));e[Bt]=t}else Zl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ut(t),e=!1}else n=Lu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(xn(t),t):(xn(t),null);if((t.flags&128)!==0)throw Error(i(558))}return ut(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Hr(t),r!==null&&r.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[Bt]=t}else Zl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ut(t),c=!1}else c=Lu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=c),c=!0;if(!c)return t.flags&256?(xn(t),t):(xn(t),null)}return xn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,c=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(c=r.alternate.memoizedState.cachePool.pool),f=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(f=r.memoizedState.cachePool.pool),f!==c&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ei(t,t.updateQueue),ut(t),null);case 4:return xe(),e===null&&Xd(t.stateNode.containerInfo),ut(t),null;case 10:return Oa(t.type),ut(t),null;case 19:if(q(xt),r=t.memoizedState,r===null)return ut(t),null;if(c=(t.flags&128)!==0,f=r.rendering,f===null)if(c)Js(r,!1);else{if(vt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=fi(e),f!==null){for(t.flags|=128,Js(r,!1),e=f.updateQueue,t.updateQueue=e,Ei(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)vp(n,e),n=n.sibling;return Q(xt,xt.current&1|2),qe&&Da(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&$t()>Mi&&(t.flags|=128,c=!0,Js(r,!1),t.lanes=4194304)}else{if(!c)if(e=fi(f),e!==null){if(t.flags|=128,c=!0,e=e.updateQueue,t.updateQueue=e,Ei(t,e),Js(r,!0),r.tail===null&&r.tailMode==="hidden"&&!f.alternate&&!qe)return ut(t),null}else 2*$t()-r.renderingStartTime>Mi&&n!==536870912&&(t.flags|=128,c=!0,Js(r,!1),t.lanes=4194304);r.isBackwards?(f.sibling=t.child,t.child=f):(e=r.last,e!==null?e.sibling=f:t.child=f,r.last=f)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=$t(),e.sibling=null,n=xt.current,Q(xt,c?n&1|2:n&1),qe&&Da(t,r.treeForkCount),e):(ut(t),null);case 22:case 23:return xn(t),Fu(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(n&536870912)!==0&&(t.flags&128)===0&&(ut(t),t.subtreeFlags&6&&(t.flags|=8192)):ut(t),n=t.updateQueue,n!==null&&Ei(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&q(er),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Oa(Ct),ut(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function nw(e,t){switch(ku(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Oa(Ct),xe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(xn(t),t.alternate===null)throw Error(i(340));Zl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(xn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Zl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return q(xt),null;case 4:return xe(),null;case 10:return Oa(t.type),null;case 22:case 23:return xn(t),Fu(),e!==null&&q(er),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Oa(Ct),null;case 25:return null;default:return null}}function Gg(e,t){switch(ku(t),t.tag){case 3:Oa(Ct),xe();break;case 26:case 27:case 5:me(t);break;case 4:xe();break;case 31:t.memoizedState!==null&&xn(t);break;case 13:xn(t);break;case 19:q(xt);break;case 10:Oa(t.type);break;case 22:case 23:xn(t),Fu(),e!==null&&q(er);break;case 24:Oa(Ct)}}function Ws(e,t){try{var n=t.updateQueue,r=n!==null?n.lastEffect:null;if(r!==null){var c=r.next;n=c;do{if((n.tag&e)===e){r=void 0;var f=n.create,b=n.inst;r=f(),b.destroy=r}n=n.next}while(n!==c)}}catch(R){We(t,t.return,R)}}function xl(e,t,n){try{var r=t.updateQueue,c=r!==null?r.lastEffect:null;if(c!==null){var f=c.next;r=f;do{if((r.tag&e)===e){var b=r.inst,R=b.destroy;if(R!==void 0){b.destroy=void 0,c=t;var k=n,G=R;try{G()}catch(W){We(c,k,W)}}}r=r.next}while(r!==f)}}catch(W){We(t,t.return,W)}}function Yg(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{zp(t,n)}catch(r){We(e,e.return,r)}}}function $g(e,t,n){n.props=rr(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){We(e,t,r)}}function eo(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n=="function"?e.refCleanup=n(r):n.current=r}}catch(c){We(e,t,c)}}function da(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r=="function")try{r()}catch(c){We(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(c){We(e,t,c)}else n.current=null}function Kg(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(c){We(e,e.return,c)}}function Nd(e,t,n){try{var r=e.stateNode;Cw(r,e.type,n,t),r[Jt]=t}catch(c){We(e,e.return,c)}}function Xg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&El(e.type)||e.tag===4}function Td(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xg(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&&El(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 Ad(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ta));else if(r!==4&&(r===27&&El(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Ad(e,t,n),e=e.sibling;e!==null;)Ad(e,t,n),e=e.sibling}function Ri(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&El(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Ri(e,t,n),e=e.sibling;e!==null;)Ri(e,t,n),e=e.sibling}function Fg(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);It(t,r,n),t[Bt]=e,t[Jt]=n}catch(f){We(e,e.return,f)}}var Ba=!1,Nt=!1,Md=!1,Qg=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function aw(e,t){if(e=e.containerInfo,Zd=Ki,e=ip(e),ju(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var c=r.anchorOffset,f=r.focusNode;r=r.focusOffset;try{n.nodeType,f.nodeType}catch{n=null;break e}var b=0,R=-1,k=-1,G=0,W=0,ne=e,Y=null;t:for(;;){for(var F;ne!==n||c!==0&&ne.nodeType!==3||(R=b+c),ne!==f||r!==0&&ne.nodeType!==3||(k=b+r),ne.nodeType===3&&(b+=ne.nodeValue.length),(F=ne.firstChild)!==null;)Y=ne,ne=F;for(;;){if(ne===e)break t;if(Y===n&&++G===c&&(R=b),Y===f&&++W===r&&(k=b),(F=ne.nextSibling)!==null)break;ne=Y,Y=ne.parentNode}ne=F}n=R===-1||k===-1?null:{start:R,end:k}}else n=null}n=n||{start:0,end:0}}else n=null;for(Jd={focusedElem:e,selectionRange:n},Ki=!1,Ot=t;Ot!==null;)if(t=Ot,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ot=e;else for(;Ot!==null;){switch(t=Ot,f=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)c=e[n],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,n=t,c=f.memoizedProps,f=f.memoizedState,r=n.stateNode;try{var ge=rr(n.type,c);e=r.getSnapshotBeforeUpdate(ge,f),r.__reactInternalSnapshotBeforeUpdate=e}catch(Ne){We(n,n.return,Ne)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)tf(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":tf(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,Ot=e;break}Ot=t.return}}function Zg(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Pa(e,n),r&4&&Ws(5,n);break;case 1:if(Pa(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(b){We(n,n.return,b)}else{var c=rr(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(b){We(n,n.return,b)}}r&64&&Yg(n),r&512&&eo(n,n.return);break;case 3:if(Pa(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{zp(e,t)}catch(b){We(n,n.return,b)}}break;case 27:t===null&&r&4&&Fg(n);case 26:case 5:Pa(e,n),t===null&&r&4&&Kg(n),r&512&&eo(n,n.return);break;case 12:Pa(e,n);break;case 31:Pa(e,n),r&4&&ev(e,n);break;case 13:Pa(e,n),r&4&&tv(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=fw.bind(null,n),_w(e,n))));break;case 22:if(r=n.memoizedState!==null||Ba,!r){t=t!==null&&t.memoizedState!==null||Nt,c=Ba;var f=Nt;Ba=r,(Nt=t)&&!f?qa(e,n,(n.subtreeFlags&8772)!==0):Pa(e,n),Ba=c,Nt=f}break;case 30:break;default:Pa(e,n)}}function Jg(e){var t=e.alternate;t!==null&&(e.alternate=null,Jg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&su(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ft=null,en=!1;function Ha(e,t,n){for(n=n.child;n!==null;)Wg(e,t,n),n=n.sibling}function Wg(e,t,n){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(Ra,n)}catch{}switch(n.tag){case 26:Nt||da(n,t),Ha(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Nt||da(n,t);var r=ft,c=en;El(n.type)&&(ft=n.stateNode,en=!1),Ha(e,t,n),co(n.stateNode),ft=r,en=c;break;case 5:Nt||da(n,t);case 6:if(r=ft,c=en,ft=null,Ha(e,t,n),ft=r,en=c,ft!==null)if(en)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(n.stateNode)}catch(f){We(n,t,f)}else try{ft.removeChild(n.stateNode)}catch(f){We(n,t,f)}break;case 18:ft!==null&&(en?(e=ft,Yv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),ss(e)):Yv(ft,n.stateNode));break;case 4:r=ft,c=en,ft=n.stateNode.containerInfo,en=!0,Ha(e,t,n),ft=r,en=c;break;case 0:case 11:case 14:case 15:xl(2,n,t),Nt||xl(4,n,t),Ha(e,t,n);break;case 1:Nt||(da(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"&&$g(n,t,r)),Ha(e,t,n);break;case 21:Ha(e,t,n);break;case 22:Nt=(r=Nt)||n.memoizedState!==null,Ha(e,t,n),Nt=r;break;default:Ha(e,t,n)}}function ev(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ss(e)}catch(n){We(t,t.return,n)}}}function tv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ss(e)}catch(n){We(t,t.return,n)}}function lw(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Qg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Qg),t;default:throw Error(i(435,e.tag))}}function Ni(e,t){var n=lw(e);t.forEach(function(r){if(!n.has(r)){n.add(r);var c=hw.bind(null,e,r);r.then(c,c)}})}function tn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var c=n[r],f=e,b=t,R=b;e:for(;R!==null;){switch(R.tag){case 27:if(El(R.type)){ft=R.stateNode,en=!1;break e}break;case 5:ft=R.stateNode,en=!1;break e;case 3:case 4:ft=R.stateNode.containerInfo,en=!0;break e}R=R.return}if(ft===null)throw Error(i(160));Wg(f,b,c),ft=null,en=!1,f=c.alternate,f!==null&&(f.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)nv(t,e),t=t.sibling}var ea=null;function nv(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:tn(t,e),nn(e),r&4&&(xl(3,e,e.return),Ws(3,e),xl(5,e,e.return));break;case 1:tn(t,e),nn(e),r&512&&(Nt||n===null||da(n,n.return)),r&64&&Ba&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var c=ea;if(tn(t,e),nn(e),r&512&&(Nt||n===null||da(n,n.return)),r&4){var f=n!==null?n.memoizedState:null;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){e:{r=e.type,n=e.memoizedProps,c=c.ownerDocument||c;t:switch(r){case"title":f=c.getElementsByTagName("title")[0],(!f||f[Ns]||f[Bt]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=c.createElement(r),c.head.insertBefore(f,c.querySelector("head > title"))),It(f,r,n),f[Bt]=e,_t(f),r=f;break e;case"link":var b=nx("link","href",c).get(r+(n.href||""));if(b){for(var R=0;R<b.length;R++)if(f=b[R],f.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&f.getAttribute("rel")===(n.rel==null?null:n.rel)&&f.getAttribute("title")===(n.title==null?null:n.title)&&f.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){b.splice(R,1);break t}}f=c.createElement(r),It(f,r,n),c.head.appendChild(f);break;case"meta":if(b=nx("meta","content",c).get(r+(n.content||""))){for(R=0;R<b.length;R++)if(f=b[R],f.getAttribute("content")===(n.content==null?null:""+n.content)&&f.getAttribute("name")===(n.name==null?null:n.name)&&f.getAttribute("property")===(n.property==null?null:n.property)&&f.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&f.getAttribute("charset")===(n.charSet==null?null:n.charSet)){b.splice(R,1);break t}}f=c.createElement(r),It(f,r,n),c.head.appendChild(f);break;default:throw Error(i(468,r))}f[Bt]=e,_t(f),r=f}e.stateNode=r}else ax(c,e.type,e.stateNode);else e.stateNode=tx(c,r,e.memoizedProps);else f!==r?(f===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):f.count--,r===null?ax(c,e.type,e.stateNode):tx(c,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Nd(e,e.memoizedProps,n.memoizedProps)}break;case 27:tn(t,e),nn(e),r&512&&(Nt||n===null||da(n,n.return)),n!==null&&r&4&&Nd(e,e.memoizedProps,n.memoizedProps);break;case 5:if(tn(t,e),nn(e),r&512&&(Nt||n===null||da(n,n.return)),e.flags&32){c=e.stateNode;try{Ar(c,"")}catch(ge){We(e,e.return,ge)}}r&4&&e.stateNode!=null&&(c=e.memoizedProps,Nd(e,c,n!==null?n.memoizedProps:c)),r&1024&&(Md=!0);break;case 6:if(tn(t,e),nn(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(ge){We(e,e.return,ge)}}break;case 3:if(Vi=null,c=ea,ea=qi(t.containerInfo),tn(t,e),ea=c,nn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ss(t.containerInfo)}catch(ge){We(e,e.return,ge)}Md&&(Md=!1,av(e));break;case 4:r=ea,ea=qi(e.stateNode.containerInfo),tn(t,e),nn(e),ea=r;break;case 12:tn(t,e),nn(e);break;case 31:tn(t,e),nn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ni(e,r)));break;case 13:tn(t,e),nn(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ai=$t()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ni(e,r)));break;case 22:c=e.memoizedState!==null;var k=n!==null&&n.memoizedState!==null,G=Ba,W=Nt;if(Ba=G||c,Nt=W||k,tn(t,e),Nt=W,Ba=G,nn(e),r&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(n===null||k||Ba||Nt||sr(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){k=n=t;try{if(f=k.stateNode,c)b=f.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{R=k.stateNode;var ne=k.memoizedProps.style,Y=ne!=null&&ne.hasOwnProperty("display")?ne.display:null;R.style.display=Y==null||typeof Y=="boolean"?"":(""+Y).trim()}}catch(ge){We(k,k.return,ge)}}}else if(t.tag===6){if(n===null){k=t;try{k.stateNode.nodeValue=c?"":k.memoizedProps}catch(ge){We(k,k.return,ge)}}}else if(t.tag===18){if(n===null){k=t;try{var F=k.stateNode;c?$v(F,!0):$v(k.stateNode,!1)}catch(ge){We(k,k.return,ge)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,Ni(e,n))));break;case 19:tn(t,e),nn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Ni(e,r)));break;case 30:break;case 21:break;default:tn(t,e),nn(e)}}function nn(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Xg(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode,f=Td(e);Ri(e,f,c);break;case 5:var b=n.stateNode;n.flags&32&&(Ar(b,""),n.flags&=-33);var R=Td(e);Ri(e,R,b);break;case 3:case 4:var k=n.stateNode.containerInfo,G=Td(e);Ad(e,G,k);break;default:throw Error(i(161))}}catch(W){We(e,e.return,W)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function av(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;av(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Pa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Zg(e,t.alternate,t),t=t.sibling}function sr(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:xl(4,t,t.return),sr(t);break;case 1:da(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&$g(t,t.return,n),sr(t);break;case 27:co(t.stateNode);case 26:case 5:da(t,t.return),sr(t);break;case 22:t.memoizedState===null&&sr(t);break;case 30:sr(t);break;default:sr(t)}e=e.sibling}}function qa(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,c=e,f=t,b=f.flags;switch(f.tag){case 0:case 11:case 15:qa(c,f,n),Ws(4,f);break;case 1:if(qa(c,f,n),r=f,c=r.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(G){We(r,r.return,G)}if(r=f,c=r.updateQueue,c!==null){var R=r.stateNode;try{var k=c.shared.hiddenCallbacks;if(k!==null)for(c.shared.hiddenCallbacks=null,c=0;c<k.length;c++)kp(k[c],R)}catch(G){We(r,r.return,G)}}n&&b&64&&Yg(f),eo(f,f.return);break;case 27:Fg(f);case 26:case 5:qa(c,f,n),n&&r===null&&b&4&&Kg(f),eo(f,f.return);break;case 12:qa(c,f,n);break;case 31:qa(c,f,n),n&&b&4&&ev(c,f);break;case 13:qa(c,f,n),n&&b&4&&tv(c,f);break;case 22:f.memoizedState===null&&qa(c,f,n),eo(f,f.return);break;case 30:break;default:qa(c,f,n)}t=t.sibling}}function Dd(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ps(n))}function _d(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ps(e))}function ta(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)lv(e,t,n,r),t=t.sibling}function lv(e,t,n,r){var c=t.flags;switch(t.tag){case 0:case 11:case 15:ta(e,t,n,r),c&2048&&Ws(9,t);break;case 1:ta(e,t,n,r);break;case 3:ta(e,t,n,r),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ps(e)));break;case 12:if(c&2048){ta(e,t,n,r),e=t.stateNode;try{var f=t.memoizedProps,b=f.id,R=f.onPostCommit;typeof R=="function"&&R(b,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(k){We(t,t.return,k)}}else ta(e,t,n,r);break;case 31:ta(e,t,n,r);break;case 13:ta(e,t,n,r);break;case 23:break;case 22:f=t.stateNode,b=t.alternate,t.memoizedState!==null?f._visibility&2?ta(e,t,n,r):to(e,t):f._visibility&2?ta(e,t,n,r):(f._visibility|=2,Fr(e,t,n,r,(t.subtreeFlags&10256)!==0||!1)),c&2048&&Dd(b,t);break;case 24:ta(e,t,n,r),c&2048&&_d(t.alternate,t);break;default:ta(e,t,n,r)}}function Fr(e,t,n,r,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,b=t,R=n,k=r,G=b.flags;switch(b.tag){case 0:case 11:case 15:Fr(f,b,R,k,c),Ws(8,b);break;case 23:break;case 22:var W=b.stateNode;b.memoizedState!==null?W._visibility&2?Fr(f,b,R,k,c):to(f,b):(W._visibility|=2,Fr(f,b,R,k,c)),c&&G&2048&&Dd(b.alternate,b);break;case 24:Fr(f,b,R,k,c),c&&G&2048&&_d(b.alternate,b);break;default:Fr(f,b,R,k,c)}t=t.sibling}}function to(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,c=r.flags;switch(r.tag){case 22:to(n,r),c&2048&&Dd(r.alternate,r);break;case 24:to(n,r),c&2048&&_d(r.alternate,r);break;default:to(n,r)}t=t.sibling}}var no=8192;function Qr(e,t,n){if(e.subtreeFlags&no)for(e=e.child;e!==null;)rv(e,t,n),e=e.sibling}function rv(e,t,n){switch(e.tag){case 26:Qr(e,t,n),e.flags&no&&e.memoizedState!==null&&Gw(n,ea,e.memoizedState,e.memoizedProps);break;case 5:Qr(e,t,n);break;case 3:case 4:var r=ea;ea=qi(e.stateNode.containerInfo),Qr(e,t,n),ea=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=no,no=16777216,Qr(e,t,n),no=r):Qr(e,t,n));break;default:Qr(e,t,n)}}function sv(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 ao(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Ot=r,iv(r,e)}sv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ov(e),e=e.sibling}function ov(e){switch(e.tag){case 0:case 11:case 15:ao(e),e.flags&2048&&xl(9,e,e.return);break;case 3:ao(e);break;case 12:ao(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ti(e)):ao(e);break;default:ao(e)}}function Ti(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Ot=r,iv(r,e)}sv(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:xl(8,t,t.return),Ti(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ti(t));break;default:Ti(t)}e=e.sibling}}function iv(e,t){for(;Ot!==null;){var n=Ot;switch(n.tag){case 0:case 11:case 15:xl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ps(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Ot=r;else e:for(n=e;Ot!==null;){r=Ot;var c=r.sibling,f=r.return;if(Jg(r),r===n){Ot=null;break e}if(c!==null){c.return=f,Ot=c;break e}Ot=f}}}var rw={getCacheForType:function(e){var t=Pt(Ct),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Pt(Ct).controller.signal}},sw=typeof WeakMap=="function"?WeakMap:Map,$e=0,ot=null,Le=null,He=0,Je=0,yn=null,yl=!1,Zr=!1,Od=!1,Ia=0,vt=0,bl=0,or=0,kd=0,bn=0,Jr=0,lo=null,an=null,zd=!1,Ai=0,cv=0,Mi=1/0,Di=null,Sl=null,At=0,wl=null,Wr=null,Va=0,Ld=0,Ud=null,uv=null,ro=0,Bd=null;function Sn(){return($e&2)!==0&&He!==0?He&-He:U.T!==null?Gd():Rm()}function dv(){if(bn===0)if((He&536870912)===0||qe){var e=Sr;Sr<<=1,(Sr&3932160)===0&&(Sr=262144),bn=e}else bn=536870912;return e=vn.current,e!==null&&(e.flags|=32),bn}function ln(e,t,n){(e===ot&&(Je===2||Je===9)||e.cancelPendingCommit!==null)&&(es(e,0),jl(e,He,bn,!1)),Ut(e,n),(($e&2)===0||e!==ot)&&(e===ot&&(($e&2)===0&&(or|=n),vt===4&&jl(e,He,bn,!1)),fa(e))}function fv(e,t,n){if(($e&6)!==0)throw Error(i(327));var r=!n&&(t&127)===0&&(t&e.expiredLanes)===0||Te(e,t),c=r?cw(e,t):Pd(e,t,!0),f=r;do{if(c===0){Zr&&!r&&jl(e,t,0,!1);break}else{if(n=e.current.alternate,f&&!ow(n)){c=Pd(e,t,!1),f=!1;continue}if(c===2){if(f=t,e.errorRecoveryDisabledLanes&f)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){t=b;e:{var R=e;c=lo;var k=R.current.memoizedState.isDehydrated;if(k&&(es(R,b).flags|=256),b=Pd(R,b,!1),b!==2){if(Od&&!k){R.errorRecoveryDisabledLanes|=f,or|=f,c=4;break e}f=an,an=c,f!==null&&(an===null?an=f:an.push.apply(an,f))}c=b}if(f=!1,c!==2)continue}}if(c===1){es(e,0),jl(e,t,0,!0);break}e:{switch(r=e,f=c,f){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:jl(r,t,bn,!yl);break e;case 2:an=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(c=Ai+300-$t(),10<c)){if(jl(r,t,bn,!yl),wr(r,0,!0)!==0)break e;Va=t,r.timeoutHandle=Vv(hv.bind(null,r,n,an,Di,zd,t,bn,or,Jr,yl,f,"Throttled",-0,0),c);break e}hv(r,n,an,Di,zd,t,bn,or,Jr,yl,f,null,-0,0)}}break}while(!0);fa(e)}function hv(e,t,n,r,c,f,b,R,k,G,W,ne,Y,F){if(e.timeoutHandle=-1,ne=t.subtreeFlags,ne&8192||(ne&16785408)===16785408){ne={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ta},rv(t,f,ne);var ge=(f&62914560)===f?Ai-$t():(f&4194048)===f?cv-$t():0;if(ge=Yw(ne,ge),ge!==null){Va=f,e.cancelPendingCommit=ge(Sv.bind(null,e,t,f,n,r,c,b,R,k,W,ne,null,Y,F)),jl(e,f,b,!G);return}}Sv(e,t,f,n,r,c,b,R,k)}function ow(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var c=n[r],f=c.getSnapshot;c=c.value;try{if(!pn(f(),c))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function jl(e,t,n,r){t&=~kd,t&=~or,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var c=t;0<c;){var f=31-jt(c),b=1<<f;r[f]=-1,c&=~b}n!==0&&ia(e,n,t)}function _i(){return($e&6)===0?(so(0),!1):!0}function Hd(){if(Le!==null){if(Je===0)var e=Le.return;else e=Le,_a=Jl=null,td(e),Gr=null,Is=0,e=Le;for(;e!==null;)Gg(e.alternate,e),e=e.return;Le=null}}function es(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Nw(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Va=0,Hd(),ot=e,Le=n=Ma(e.current,null),He=t,Je=0,yn=null,yl=!1,Zr=Te(e,t),Od=!1,Jr=bn=kd=or=bl=vt=0,an=lo=null,zd=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var c=31-jt(r),f=1<<c;t|=e[c],r&=~f}return Ia=t,Wo(),n}function mv(e,t){_e=null,U.H=Qs,t===Vr||t===oi?(t=Mp(),Je=3):t===Vu?(t=Mp(),Je=4):Je=t===vd?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,yn=t,Le===null&&(vt=1,Si(e,On(t,e.current)))}function pv(){var e=vn.current;return e===null?!0:(He&4194048)===He?Un===null:(He&62914560)===He||(He&536870912)!==0?e===Un:!1}function gv(){var e=U.H;return U.H=Qs,e===null?Qs:e}function vv(){var e=U.A;return U.A=rw,e}function Oi(){vt=4,yl||(He&4194048)!==He&&vn.current!==null||(Zr=!0),(bl&134217727)===0&&(or&134217727)===0||ot===null||jl(ot,He,bn,!1)}function Pd(e,t,n){var r=$e;$e|=2;var c=gv(),f=vv();(ot!==e||He!==t)&&(Di=null,es(e,t)),t=!1;var b=vt;e:do try{if(Je!==0&&Le!==null){var R=Le,k=yn;switch(Je){case 8:Hd(),b=6;break e;case 3:case 2:case 9:case 6:vn.current===null&&(t=!0);var G=Je;if(Je=0,yn=null,ts(e,R,k,G),n&&Zr){b=0;break e}break;default:G=Je,Je=0,yn=null,ts(e,R,k,G)}}iw(),b=vt;break}catch(W){mv(e,W)}while(!0);return t&&e.shellSuspendCounter++,_a=Jl=null,$e=r,U.H=c,U.A=f,Le===null&&(ot=null,He=0,Wo()),b}function iw(){for(;Le!==null;)xv(Le)}function cw(e,t){var n=$e;$e|=2;var r=gv(),c=vv();ot!==e||He!==t?(Di=null,Mi=$t()+500,es(e,t)):Zr=Te(e,t);e:do try{if(Je!==0&&Le!==null){t=Le;var f=yn;t:switch(Je){case 1:Je=0,yn=null,ts(e,t,f,1);break;case 2:case 9:if(Tp(f)){Je=0,yn=null,yv(t);break}t=function(){Je!==2&&Je!==9||ot!==e||(Je=7),fa(e)},f.then(t,t);break e;case 3:Je=7;break e;case 4:Je=5;break e;case 7:Tp(f)?(Je=0,yn=null,yv(t)):(Je=0,yn=null,ts(e,t,f,7));break;case 5:var b=null;switch(Le.tag){case 26:b=Le.memoizedState;case 5:case 27:var R=Le;if(b?lx(b):R.stateNode.complete){Je=0,yn=null;var k=R.sibling;if(k!==null)Le=k;else{var G=R.return;G!==null?(Le=G,ki(G)):Le=null}break t}}Je=0,yn=null,ts(e,t,f,5);break;case 6:Je=0,yn=null,ts(e,t,f,6);break;case 8:Hd(),vt=6;break e;default:throw Error(i(462))}}uw();break}catch(W){mv(e,W)}while(!0);return _a=Jl=null,U.H=r,U.A=c,$e=n,Le!==null?0:(ot=null,He=0,Wo(),vt)}function uw(){for(;Le!==null&&!ja();)xv(Le)}function xv(e){var t=Ig(e.alternate,e,Ia);e.memoizedProps=e.pendingProps,t===null?ki(e):Le=t}function yv(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Lg(n,t,t.pendingProps,t.type,void 0,He);break;case 11:t=Lg(n,t,t.pendingProps,t.type.render,t.ref,He);break;case 5:td(t);default:Gg(n,t),t=Le=vp(t,Ia),t=Ig(n,t,Ia)}e.memoizedProps=e.pendingProps,t===null?ki(e):Le=t}function ts(e,t,n,r){_a=Jl=null,td(t),Gr=null,Is=0;var c=t.return;try{if(JS(e,c,t,n,He)){vt=1,Si(e,On(n,e.current)),Le=null;return}}catch(f){if(c!==null)throw Le=c,f;vt=1,Si(e,On(n,e.current)),Le=null;return}t.flags&32768?(qe||r===1?e=!0:Zr||(He&536870912)!==0?e=!1:(yl=e=!0,(r===2||r===9||r===3||r===6)&&(r=vn.current,r!==null&&r.tag===13&&(r.flags|=16384))),bv(t,e)):ki(t)}function ki(e){var t=e;do{if((t.flags&32768)!==0){bv(t,yl);return}e=t.return;var n=tw(t.alternate,t,Ia);if(n!==null){Le=n;return}if(t=t.sibling,t!==null){Le=t;return}Le=t=e}while(t!==null);vt===0&&(vt=5)}function bv(e,t){do{var n=nw(e.alternate,e);if(n!==null){n.flags&=32767,Le=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Le=e;return}Le=e=n}while(e!==null);vt=6,Le=null}function Sv(e,t,n,r,c,f,b,R,k){e.cancelPendingCommit=null;do zi();while(At!==0);if(($e&6)!==0)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(f=t.lanes|t.childLanes,f|=Tu,oa(e,n,f,b,R,k),e===ot&&(Le=ot=null,He=0),Wr=t,wl=e,Va=n,Ld=f,Ud=c,uv=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,mw(br,function(){return Rv(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=U.T,U.T=null,c=$.p,$.p=2,b=$e,$e|=4;try{aw(e,t,n)}finally{$e=b,$.p=c,U.T=r}}At=1,wv(),jv(),Cv()}}function wv(){if(At===1){At=0;var e=wl,t=Wr,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=U.T,U.T=null;var r=$.p;$.p=2;var c=$e;$e|=4;try{nv(t,e);var f=Jd,b=ip(e.containerInfo),R=f.focusedElem,k=f.selectionRange;if(b!==R&&R&&R.ownerDocument&&op(R.ownerDocument.documentElement,R)){if(k!==null&&ju(R)){var G=k.start,W=k.end;if(W===void 0&&(W=G),"selectionStart"in R)R.selectionStart=G,R.selectionEnd=Math.min(W,R.value.length);else{var ne=R.ownerDocument||document,Y=ne&&ne.defaultView||window;if(Y.getSelection){var F=Y.getSelection(),ge=R.textContent.length,Ne=Math.min(k.start,ge),at=k.end===void 0?Ne:Math.min(k.end,ge);!F.extend&&Ne>at&&(b=at,at=Ne,Ne=b);var P=sp(R,Ne),L=sp(R,at);if(P&&L&&(F.rangeCount!==1||F.anchorNode!==P.node||F.anchorOffset!==P.offset||F.focusNode!==L.node||F.focusOffset!==L.offset)){var V=ne.createRange();V.setStart(P.node,P.offset),F.removeAllRanges(),Ne>at?(F.addRange(V),F.extend(L.node,L.offset)):(V.setEnd(L.node,L.offset),F.addRange(V))}}}}for(ne=[],F=R;F=F.parentNode;)F.nodeType===1&&ne.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<ne.length;R++){var te=ne[R];te.element.scrollLeft=te.left,te.element.scrollTop=te.top}}Ki=!!Zd,Jd=Zd=null}finally{$e=c,$.p=r,U.T=n}}e.current=t,At=2}}function jv(){if(At===2){At=0;var e=wl,t=Wr,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=U.T,U.T=null;var r=$.p;$.p=2;var c=$e;$e|=4;try{Zg(e,t.alternate,t)}finally{$e=c,$.p=r,U.T=n}}At=3}}function Cv(){if(At===4||At===3){At=0,Ca();var e=wl,t=Wr,n=Va,r=uv;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?At=5:(At=0,Wr=wl=null,Ev(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(Sl=null),lu(n),t=t.stateNode,wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(Ra,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=U.T,c=$.p,$.p=2,U.T=null;try{for(var f=e.onRecoverableError,b=0;b<r.length;b++){var R=r[b];f(R.value,{componentStack:R.stack})}}finally{U.T=t,$.p=c}}(Va&3)!==0&&zi(),fa(e),c=e.pendingLanes,(n&261930)!==0&&(c&42)!==0?e===Bd?ro++:(ro=0,Bd=e):ro=0,so(0)}}function Ev(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ps(t)))}function zi(){return wv(),jv(),Cv(),Rv()}function Rv(){if(At!==5)return!1;var e=wl,t=Ld;Ld=0;var n=lu(Va),r=U.T,c=$.p;try{$.p=32>n?32:n,U.T=null,n=Ud,Ud=null;var f=wl,b=Va;if(At=0,Wr=wl=null,Va=0,($e&6)!==0)throw Error(i(331));var R=$e;if($e|=4,ov(f.current),lv(f,f.current,b,n),$e=R,so(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(Ra,f)}catch{}return!0}finally{$.p=c,U.T=r,Ev(e,t)}}function Nv(e,t,n){t=On(n,t),t=gd(e.stateNode,t,2),e=pl(e,t,2),e!==null&&(Ut(e,2),fa(e))}function We(e,t,n){if(e.tag===3)Nv(e,e,n);else for(;t!==null;){if(t.tag===3){Nv(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Sl===null||!Sl.has(r))){e=On(n,e),n=Tg(2),r=pl(t,n,2),r!==null&&(Ag(n,r,t,e),Ut(r,2),fa(r));break}}t=t.return}}function qd(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new sw;var c=new Set;r.set(t,c)}else c=r.get(t),c===void 0&&(c=new Set,r.set(t,c));c.has(n)||(Od=!0,c.add(n),e=dw.bind(null,e,t,n),t.then(e,e))}function dw(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ot===e&&(He&n)===n&&(vt===4||vt===3&&(He&62914560)===He&&300>$t()-Ai?($e&2)===0&&es(e,0):kd|=n,Jr===He&&(Jr=0)),fa(e)}function Tv(e,t){t===0&&(t=st()),e=Fl(e,t),e!==null&&(Ut(e,t),fa(e))}function fw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Tv(e,n)}function hw(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,c=e.memoizedState;c!==null&&(n=c.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Tv(e,n)}function mw(e,t){return Qn(e,t)}var Li=null,ns=null,Id=!1,Ui=!1,Vd=!1,Cl=0;function fa(e){e!==ns&&e.next===null&&(ns===null?Li=ns=e:ns=ns.next=e),Ui=!0,Id||(Id=!0,gw())}function so(e,t){if(!Vd&&Ui){Vd=!0;do for(var n=!1,r=Li;r!==null;){if(e!==0){var c=r.pendingLanes;if(c===0)var f=0;else{var b=r.suspendedLanes,R=r.pingedLanes;f=(1<<31-jt(42|e)+1)-1,f&=c&~(b&~R),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(n=!0,_v(r,f))}else f=He,f=wr(r,r===ot?f:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(f&3)===0||Te(r,f)||(n=!0,_v(r,f));r=r.next}while(n);Vd=!1}}function pw(){Av()}function Av(){Ui=Id=!1;var e=0;Cl!==0&&Rw()&&(e=Cl);for(var t=$t(),n=null,r=Li;r!==null;){var c=r.next,f=Mv(r,t);f===0?(r.next=null,n===null?Li=c:n.next=c,c===null&&(ns=n)):(n=r,(e!==0||(f&3)!==0)&&(Ui=!0)),r=c}At!==0&&At!==5||so(e),Cl!==0&&(Cl=0)}function Mv(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,c=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var b=31-jt(f),R=1<<b,k=c[b];k===-1?((R&n)===0||(R&r)!==0)&&(c[b]=Ke(R,t)):k<=t&&(e.expiredLanes|=R),f&=~R}if(t=ot,n=He,n=wr(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Je===2||Je===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&mn(r),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||Te(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&mn(r),lu(n)){case 2:case 8:n=Ea;break;case 32:n=br;break;case 268435456:n=Vl;break;default:n=br}return r=Dv.bind(null,e),n=Qn(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&mn(r),e.callbackPriority=2,e.callbackNode=null,2}function Dv(e,t){if(At!==0&&At!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(zi()&&e.callbackNode!==n)return null;var r=He;return r=wr(e,e===ot?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(fv(e,r,t),Mv(e,$t()),e.callbackNode!=null&&e.callbackNode===n?Dv.bind(null,e):null)}function _v(e,t){if(zi())return null;fv(e,t,!0)}function gw(){Tw(function(){($e&6)!==0?Qn(Kt,pw):Av()})}function Gd(){if(Cl===0){var e=qr;e===0&&(e=Gl,Gl<<=1,(Gl&261888)===0&&(Gl=256)),Cl=e}return Cl}function Ov(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Yo(""+e)}function kv(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function vw(e,t,n,r,c){if(t==="submit"&&n&&n.stateNode===c){var f=Ov((c[Jt]||null).action),b=r.submitter;b&&(t=(t=b[Jt]||null)?Ov(t.formAction):b.getAttribute("formAction"),t!==null&&(f=t,b=null));var R=new Fo("action","action",null,r,c);e.push({event:R,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Cl!==0){var k=b?kv(c,b):new FormData(c);ud(n,{pending:!0,data:k,method:c.method,action:f},null,k)}}else typeof f=="function"&&(R.preventDefault(),k=b?kv(c,b):new FormData(c),ud(n,{pending:!0,data:k,method:c.method,action:f},f,k))},currentTarget:c}]})}}for(var Yd=0;Yd<Nu.length;Yd++){var $d=Nu[Yd],xw=$d.toLowerCase(),yw=$d[0].toUpperCase()+$d.slice(1);Wn(xw,"on"+yw)}Wn(dp,"onAnimationEnd"),Wn(fp,"onAnimationIteration"),Wn(hp,"onAnimationStart"),Wn("dblclick","onDoubleClick"),Wn("focusin","onFocus"),Wn("focusout","onBlur"),Wn(zS,"onTransitionRun"),Wn(LS,"onTransitionStart"),Wn(US,"onTransitionCancel"),Wn(mp,"onTransitionEnd"),Nr("onMouseEnter",["mouseout","mouseover"]),Nr("onMouseLeave",["mouseout","mouseover"]),Nr("onPointerEnter",["pointerout","pointerover"]),Nr("onPointerLeave",["pointerout","pointerover"]),Yl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Yl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Yl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Yl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Yl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Yl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var oo="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(" "),bw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(oo));function zv(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],c=r.event;r=r.listeners;e:{var f=void 0;if(t)for(var b=r.length-1;0<=b;b--){var R=r[b],k=R.instance,G=R.currentTarget;if(R=R.listener,k!==f&&c.isPropagationStopped())break e;f=R,c.currentTarget=G;try{f(c)}catch(W){Jo(W)}c.currentTarget=null,f=k}else for(b=0;b<r.length;b++){if(R=r[b],k=R.instance,G=R.currentTarget,R=R.listener,k!==f&&c.isPropagationStopped())break e;f=R,c.currentTarget=G;try{f(c)}catch(W){Jo(W)}c.currentTarget=null,f=k}}}}function Ue(e,t){var n=t[ru];n===void 0&&(n=t[ru]=new Set);var r=e+"__bubble";n.has(r)||(Lv(t,e,2,!1),n.add(r))}function Kd(e,t,n){var r=0;t&&(r|=4),Lv(n,e,r,t)}var Bi="_reactListening"+Math.random().toString(36).slice(2);function Xd(e){if(!e[Bi]){e[Bi]=!0,Am.forEach(function(n){n!=="selectionchange"&&(bw.has(n)||Kd(n,!1,e),Kd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Bi]||(t[Bi]=!0,Kd("selectionchange",!1,t))}}function Lv(e,t,n,r){switch(dx(t)){case 2:var c=Xw;break;case 8:c=Fw;break;default:c=uf}n=c.bind(null,t,n,e),c=void 0,!mu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),r?c!==void 0?e.addEventListener(t,n,{capture:!0,passive:c}):e.addEventListener(t,n,!0):c!==void 0?e.addEventListener(t,n,{passive:c}):e.addEventListener(t,n,!1)}function Fd(e,t,n,r,c){var f=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var b=r.tag;if(b===3||b===4){var R=r.stateNode.containerInfo;if(R===c)break;if(b===4)for(b=r.return;b!==null;){var k=b.tag;if((k===3||k===4)&&b.stateNode.containerInfo===c)return;b=b.return}for(;R!==null;){if(b=Cr(R),b===null)return;if(k=b.tag,k===5||k===6||k===26||k===27){r=f=b;continue e}R=R.parentNode}}r=r.return}qm(function(){var G=f,W=fu(n),ne=[];e:{var Y=pp.get(e);if(Y!==void 0){var F=Fo,ge=e;switch(e){case"keypress":if(Ko(n)===0)break e;case"keydown":case"keyup":F=hS;break;case"focusin":ge="focus",F=xu;break;case"focusout":ge="blur",F=xu;break;case"beforeblur":case"afterblur":F=xu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":F=Gm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":F=tS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":F=gS;break;case dp:case fp:case hp:F=lS;break;case mp:F=xS;break;case"scroll":case"scrollend":F=W1;break;case"wheel":F=bS;break;case"copy":case"cut":case"paste":F=sS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":F=$m;break;case"toggle":case"beforetoggle":F=wS}var Ne=(t&4)!==0,at=!Ne&&(e==="scroll"||e==="scrollend"),P=Ne?Y!==null?Y+"Capture":null:Y;Ne=[];for(var L=G,V;L!==null;){var te=L;if(V=te.stateNode,te=te.tag,te!==5&&te!==26&&te!==27||V===null||P===null||(te=As(L,P),te!=null&&Ne.push(io(L,te,V))),at)break;L=L.return}0<Ne.length&&(Y=new F(Y,ge,null,n,W),ne.push({event:Y,listeners:Ne}))}}if((t&7)===0){e:{if(Y=e==="mouseover"||e==="pointerover",F=e==="mouseout"||e==="pointerout",Y&&n!==du&&(ge=n.relatedTarget||n.fromElement)&&(Cr(ge)||ge[jr]))break e;if((F||Y)&&(Y=W.window===W?W:(Y=W.ownerDocument)?Y.defaultView||Y.parentWindow:window,F?(ge=n.relatedTarget||n.toElement,F=G,ge=ge?Cr(ge):null,ge!==null&&(at=d(ge),Ne=ge.tag,ge!==at||Ne!==5&&Ne!==27&&Ne!==6)&&(ge=null)):(F=null,ge=G),F!==ge)){if(Ne=Gm,te="onMouseLeave",P="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(Ne=$m,te="onPointerLeave",P="onPointerEnter",L="pointer"),at=F==null?Y:Ts(F),V=ge==null?Y:Ts(ge),Y=new Ne(te,L+"leave",F,n,W),Y.target=at,Y.relatedTarget=V,te=null,Cr(W)===G&&(Ne=new Ne(P,L+"enter",ge,n,W),Ne.target=V,Ne.relatedTarget=at,te=Ne),at=te,F&&ge)t:{for(Ne=Sw,P=F,L=ge,V=0,te=P;te;te=Ne(te))V++;te=0;for(var Ce=L;Ce;Ce=Ne(Ce))te++;for(;0<V-te;)P=Ne(P),V--;for(;0<te-V;)L=Ne(L),te--;for(;V--;){if(P===L||L!==null&&P===L.alternate){Ne=P;break t}P=Ne(P),L=Ne(L)}Ne=null}else Ne=null;F!==null&&Uv(ne,Y,F,Ne,!1),ge!==null&&at!==null&&Uv(ne,at,ge,Ne,!0)}}e:{if(Y=G?Ts(G):window,F=Y.nodeName&&Y.nodeName.toLowerCase(),F==="select"||F==="input"&&Y.type==="file")var Ve=ep;else if(Jm(Y))if(tp)Ve=_S;else{Ve=MS;var ye=AS}else F=Y.nodeName,!F||F.toLowerCase()!=="input"||Y.type!=="checkbox"&&Y.type!=="radio"?G&&uu(G.elementType)&&(Ve=ep):Ve=DS;if(Ve&&(Ve=Ve(e,G))){Wm(ne,Ve,n,W);break e}ye&&ye(e,Y,G),e==="focusout"&&G&&Y.type==="number"&&G.memoizedProps.value!=null&&cu(Y,"number",Y.value)}switch(ye=G?Ts(G):window,e){case"focusin":(Jm(ye)||ye.contentEditable==="true")&&(Or=ye,Cu=G,Us=null);break;case"focusout":Us=Cu=Or=null;break;case"mousedown":Eu=!0;break;case"contextmenu":case"mouseup":case"dragend":Eu=!1,cp(ne,n,W);break;case"selectionchange":if(kS)break;case"keydown":case"keyup":cp(ne,n,W)}var Oe;if(bu)e:{switch(e){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else _r?Qm(e,n)&&(Pe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Pe="onCompositionStart");Pe&&(Km&&n.locale!=="ko"&&(_r||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&_r&&(Oe=Im()):(il=W,pu="value"in il?il.value:il.textContent,_r=!0)),ye=Hi(G,Pe),0<ye.length&&(Pe=new Ym(Pe,e,null,n,W),ne.push({event:Pe,listeners:ye}),Oe?Pe.data=Oe:(Oe=Zm(n),Oe!==null&&(Pe.data=Oe)))),(Oe=CS?ES(e,n):RS(e,n))&&(Pe=Hi(G,"onBeforeInput"),0<Pe.length&&(ye=new Ym("onBeforeInput","beforeinput",null,n,W),ne.push({event:ye,listeners:Pe}),ye.data=Oe)),vw(ne,e,G,n,W)}zv(ne,t)})}function io(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Hi(e,t){for(var n=t+"Capture",r=[];e!==null;){var c=e,f=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||f===null||(c=As(e,n),c!=null&&r.unshift(io(e,c,f)),c=As(e,t),c!=null&&r.push(io(e,c,f))),e.tag===3)return r;e=e.return}return[]}function Sw(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Uv(e,t,n,r,c){for(var f=t._reactName,b=[];n!==null&&n!==r;){var R=n,k=R.alternate,G=R.stateNode;if(R=R.tag,k!==null&&k===r)break;R!==5&&R!==26&&R!==27||G===null||(k=G,c?(G=As(n,f),G!=null&&b.unshift(io(n,G,k))):c||(G=As(n,f),G!=null&&b.push(io(n,G,k)))),n=n.return}b.length!==0&&e.push({event:t,listeners:b})}var ww=/\r\n?/g,jw=/\u0000|\uFFFD/g;function Bv(e){return(typeof e=="string"?e:""+e).replace(ww,`
|
|
49
|
+
`).replace(jw,"")}function Hv(e,t){return t=Bv(t),Bv(e)===t}function nt(e,t,n,r,c,f){switch(n){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||Ar(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&Ar(e,""+r);break;case"className":Vo(e,"class",r);break;case"tabIndex":Vo(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Vo(e,n,r);break;case"style":Hm(e,r,f);break;case"data":if(t!=="object"){Vo(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Yo(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof f=="function"&&(n==="formAction"?(t!=="input"&&nt(e,t,"name",c.name,c,null),nt(e,t,"formEncType",c.formEncType,c,null),nt(e,t,"formMethod",c.formMethod,c,null),nt(e,t,"formTarget",c.formTarget,c,null)):(nt(e,t,"encType",c.encType,c,null),nt(e,t,"method",c.method,c,null),nt(e,t,"target",c.target,c,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(n);break}r=Yo(""+r),e.setAttribute(n,r);break;case"onClick":r!=null&&(e.onclick=Ta);break;case"onScroll":r!=null&&Ue("scroll",e);break;case"onScrollEnd":r!=null&&Ue("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(n=r.__html,n!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}n=Yo(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":r===!0?e.setAttribute(n,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":Ue("beforetoggle",e),Ue("toggle",e),Io(e,"popover",r);break;case"xlinkActuate":Na(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Na(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Na(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Na(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Na(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Na(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Na(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Na(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Na(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Io(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Z1.get(n)||n,Io(e,n,r))}}function Qd(e,t,n,r,c,f){switch(n){case"style":Hm(e,r,f);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(i(61));if(n=r.__html,n!=null){if(c.children!=null)throw Error(i(60));e.innerHTML=n}}break;case"children":typeof r=="string"?Ar(e,r):(typeof r=="number"||typeof r=="bigint")&&Ar(e,""+r);break;case"onScroll":r!=null&&Ue("scroll",e);break;case"onScrollEnd":r!=null&&Ue("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Ta);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Mm.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(c=n.endsWith("Capture"),t=n.slice(2,c?n.length-7:void 0),f=e[Jt]||null,f=f!=null?f[n]:null,typeof f=="function"&&e.removeEventListener(t,f,c),typeof r=="function")){typeof f!="function"&&f!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,c);break e}n in e?e[n]=r:r===!0?e.setAttribute(n,""):Io(e,n,r)}}}function It(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ue("error",e),Ue("load",e);var r=!1,c=!1,f;for(f in n)if(n.hasOwnProperty(f)){var b=n[f];if(b!=null)switch(f){case"src":r=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:nt(e,t,f,b,n,null)}}c&&nt(e,t,"srcSet",n.srcSet,n,null),r&&nt(e,t,"src",n.src,n,null);return;case"input":Ue("invalid",e);var R=f=b=c=null,k=null,G=null;for(r in n)if(n.hasOwnProperty(r)){var W=n[r];if(W!=null)switch(r){case"name":c=W;break;case"type":b=W;break;case"checked":k=W;break;case"defaultChecked":G=W;break;case"value":f=W;break;case"defaultValue":R=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(i(137,t));break;default:nt(e,t,r,W,n,null)}}zm(e,f,R,k,G,b,c,!1);return;case"select":Ue("invalid",e),r=b=f=null;for(c in n)if(n.hasOwnProperty(c)&&(R=n[c],R!=null))switch(c){case"value":f=R;break;case"defaultValue":b=R;break;case"multiple":r=R;default:nt(e,t,c,R,n,null)}t=f,n=b,e.multiple=!!r,t!=null?Tr(e,!!r,t,!1):n!=null&&Tr(e,!!r,n,!0);return;case"textarea":Ue("invalid",e),f=c=r=null;for(b in n)if(n.hasOwnProperty(b)&&(R=n[b],R!=null))switch(b){case"value":r=R;break;case"defaultValue":c=R;break;case"children":f=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(i(91));break;default:nt(e,t,b,R,n,null)}Um(e,r,c,f);return;case"option":for(k in n)if(n.hasOwnProperty(k)&&(r=n[k],r!=null))switch(k){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:nt(e,t,k,r,n,null)}return;case"dialog":Ue("beforetoggle",e),Ue("toggle",e),Ue("cancel",e),Ue("close",e);break;case"iframe":case"object":Ue("load",e);break;case"video":case"audio":for(r=0;r<oo.length;r++)Ue(oo[r],e);break;case"image":Ue("error",e),Ue("load",e);break;case"details":Ue("toggle",e);break;case"embed":case"source":case"link":Ue("error",e),Ue("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(G in n)if(n.hasOwnProperty(G)&&(r=n[G],r!=null))switch(G){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:nt(e,t,G,r,n,null)}return;default:if(uu(t)){for(W in n)n.hasOwnProperty(W)&&(r=n[W],r!==void 0&&Qd(e,t,W,r,n,void 0));return}}for(R in n)n.hasOwnProperty(R)&&(r=n[R],r!=null&&nt(e,t,R,r,n,null))}function Cw(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var c=null,f=null,b=null,R=null,k=null,G=null,W=null;for(F in n){var ne=n[F];if(n.hasOwnProperty(F)&&ne!=null)switch(F){case"checked":break;case"value":break;case"defaultValue":k=ne;default:r.hasOwnProperty(F)||nt(e,t,F,null,r,ne)}}for(var Y in r){var F=r[Y];if(ne=n[Y],r.hasOwnProperty(Y)&&(F!=null||ne!=null))switch(Y){case"type":f=F;break;case"name":c=F;break;case"checked":G=F;break;case"defaultChecked":W=F;break;case"value":b=F;break;case"defaultValue":R=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(i(137,t));break;default:F!==ne&&nt(e,t,Y,F,r,ne)}}iu(e,b,R,k,G,W,f,c);return;case"select":F=b=R=Y=null;for(f in n)if(k=n[f],n.hasOwnProperty(f)&&k!=null)switch(f){case"value":break;case"multiple":F=k;default:r.hasOwnProperty(f)||nt(e,t,f,null,r,k)}for(c in r)if(f=r[c],k=n[c],r.hasOwnProperty(c)&&(f!=null||k!=null))switch(c){case"value":Y=f;break;case"defaultValue":R=f;break;case"multiple":b=f;default:f!==k&&nt(e,t,c,f,r,k)}t=R,n=b,r=F,Y!=null?Tr(e,!!n,Y,!1):!!r!=!!n&&(t!=null?Tr(e,!!n,t,!0):Tr(e,!!n,n?[]:"",!1));return;case"textarea":F=Y=null;for(R in n)if(c=n[R],n.hasOwnProperty(R)&&c!=null&&!r.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:nt(e,t,R,null,r,c)}for(b in r)if(c=r[b],f=n[b],r.hasOwnProperty(b)&&(c!=null||f!=null))switch(b){case"value":Y=c;break;case"defaultValue":F=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(i(91));break;default:c!==f&&nt(e,t,b,c,r,f)}Lm(e,Y,F);return;case"option":for(var ge in n)if(Y=n[ge],n.hasOwnProperty(ge)&&Y!=null&&!r.hasOwnProperty(ge))switch(ge){case"selected":e.selected=!1;break;default:nt(e,t,ge,null,r,Y)}for(k in r)if(Y=r[k],F=n[k],r.hasOwnProperty(k)&&Y!==F&&(Y!=null||F!=null))switch(k){case"selected":e.selected=Y&&typeof Y!="function"&&typeof Y!="symbol";break;default:nt(e,t,k,Y,r,F)}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 Ne in n)Y=n[Ne],n.hasOwnProperty(Ne)&&Y!=null&&!r.hasOwnProperty(Ne)&&nt(e,t,Ne,null,r,Y);for(G in r)if(Y=r[G],F=n[G],r.hasOwnProperty(G)&&Y!==F&&(Y!=null||F!=null))switch(G){case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(i(137,t));break;default:nt(e,t,G,Y,r,F)}return;default:if(uu(t)){for(var at in n)Y=n[at],n.hasOwnProperty(at)&&Y!==void 0&&!r.hasOwnProperty(at)&&Qd(e,t,at,void 0,r,Y);for(W in r)Y=r[W],F=n[W],!r.hasOwnProperty(W)||Y===F||Y===void 0&&F===void 0||Qd(e,t,W,Y,r,F);return}}for(var P in n)Y=n[P],n.hasOwnProperty(P)&&Y!=null&&!r.hasOwnProperty(P)&&nt(e,t,P,null,r,Y);for(ne in r)Y=r[ne],F=n[ne],!r.hasOwnProperty(ne)||Y===F||Y==null&&F==null||nt(e,t,ne,Y,r,F)}function Pv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ew(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),r=0;r<n.length;r++){var c=n[r],f=c.transferSize,b=c.initiatorType,R=c.duration;if(f&&R&&Pv(b)){for(b=0,R=c.responseEnd,r+=1;r<n.length;r++){var k=n[r],G=k.startTime;if(G>R)break;var W=k.transferSize,ne=k.initiatorType;W&&Pv(ne)&&(k=k.responseEnd,b+=W*(k<R?1:(R-G)/(k-G)))}if(--r,t+=8*(f+b)/(c.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Zd=null,Jd=null;function Pi(e){return e.nodeType===9?e:e.ownerDocument}function qv(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 Iv(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 Wd(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 ef=null;function Rw(){var e=window.event;return e&&e.type==="popstate"?e===ef?!1:(ef=e,!0):(ef=null,!1)}var Vv=typeof setTimeout=="function"?setTimeout:void 0,Nw=typeof clearTimeout=="function"?clearTimeout:void 0,Gv=typeof Promise=="function"?Promise:void 0,Tw=typeof queueMicrotask=="function"?queueMicrotask:typeof Gv<"u"?function(e){return Gv.resolve(null).then(e).catch(Aw)}:Vv;function Aw(e){setTimeout(function(){throw e})}function El(e){return e==="head"}function Yv(e,t){var n=t,r=0;do{var c=n.nextSibling;if(e.removeChild(n),c&&c.nodeType===8)if(n=c.data,n==="/$"||n==="/&"){if(r===0){e.removeChild(c),ss(t);return}r--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")r++;else if(n==="html")co(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,co(n);for(var f=n.firstChild;f;){var b=f.nextSibling,R=f.nodeName;f[Ns]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&f.rel.toLowerCase()==="stylesheet"||n.removeChild(f),f=b}}else n==="body"&&co(e.ownerDocument.body);n=c}while(n);ss(t)}function $v(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=r}while(n)}function tf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":tf(n),su(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function Mw(e,t,n,r){for(;e.nodeType===1;){var c=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Ns])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==c.rel||e.getAttribute("href")!==(c.href==null||c.href===""?null:c.href)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin)||e.getAttribute("title")!==(c.title==null?null:c.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(c.src==null?null:c.src)||e.getAttribute("type")!==(c.type==null?null:c.type)||e.getAttribute("crossorigin")!==(c.crossOrigin==null?null:c.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=c.name==null?null:""+c.name;if(c.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=Bn(e.nextSibling),e===null)break}return null}function Dw(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Bn(e.nextSibling),e===null))return null;return e}function Kv(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Bn(e.nextSibling),e===null))return null;return e}function nf(e){return e.data==="$?"||e.data==="$~"}function af(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function _w(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function Bn(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 lf=null;function Xv(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Bn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function Fv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Qv(e,t,n){switch(t=Pi(n),e){case"html":if(e=t.documentElement,!e)throw Error(i(452));return e;case"head":if(e=t.head,!e)throw Error(i(453));return e;case"body":if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function co(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);su(e)}var Hn=new Map,Zv=new Set;function qi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ga=$.d;$.d={f:Ow,r:kw,D:zw,C:Lw,L:Uw,m:Bw,X:Pw,S:Hw,M:qw};function Ow(){var e=Ga.f(),t=_i();return e||t}function kw(e){var t=Er(e);t!==null&&t.tag===5&&t.type==="form"?mg(t):Ga.r(e)}var as=typeof document>"u"?null:document;function Jv(e,t,n){var r=as;if(r&&typeof t=="string"&&t){var c=Dn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof n=="string"&&(c+='[crossorigin="'+n+'"]'),Zv.has(c)||(Zv.add(c),e={rel:e,crossOrigin:n,href:t},r.querySelector(c)===null&&(t=r.createElement("link"),It(t,"link",e),_t(t),r.head.appendChild(t)))}}function zw(e){Ga.D(e),Jv("dns-prefetch",e,null)}function Lw(e,t){Ga.C(e,t),Jv("preconnect",e,t)}function Uw(e,t,n){Ga.L(e,t,n);var r=as;if(r&&e&&t){var c='link[rel="preload"][as="'+Dn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(c+='[imagesrcset="'+Dn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(c+='[imagesizes="'+Dn(n.imageSizes)+'"]')):c+='[href="'+Dn(e)+'"]';var f=c;switch(t){case"style":f=ls(e);break;case"script":f=rs(e)}Hn.has(f)||(e=y({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Hn.set(f,e),r.querySelector(c)!==null||t==="style"&&r.querySelector(uo(f))||t==="script"&&r.querySelector(fo(f))||(t=r.createElement("link"),It(t,"link",e),_t(t),r.head.appendChild(t)))}}function Bw(e,t){Ga.m(e,t);var n=as;if(n&&e){var r=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+Dn(r)+'"][href="'+Dn(e)+'"]',f=c;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=rs(e)}if(!Hn.has(f)&&(e=y({rel:"modulepreload",href:e},t),Hn.set(f,e),n.querySelector(c)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(fo(f)))return}r=n.createElement("link"),It(r,"link",e),_t(r),n.head.appendChild(r)}}}function Hw(e,t,n){Ga.S(e,t,n);var r=as;if(r&&e){var c=Rr(r).hoistableStyles,f=ls(e);t=t||"default";var b=c.get(f);if(!b){var R={loading:0,preload:null};if(b=r.querySelector(uo(f)))R.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Hn.get(f))&&rf(e,n);var k=b=r.createElement("link");_t(k),It(k,"link",e),k._p=new Promise(function(G,W){k.onload=G,k.onerror=W}),k.addEventListener("load",function(){R.loading|=1}),k.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Ii(b,t,r)}b={type:"stylesheet",instance:b,count:1,state:R},c.set(f,b)}}}function Pw(e,t){Ga.X(e,t);var n=as;if(n&&e){var r=Rr(n).hoistableScripts,c=rs(e),f=r.get(c);f||(f=n.querySelector(fo(c)),f||(e=y({src:e,async:!0},t),(t=Hn.get(c))&&sf(e,t),f=n.createElement("script"),_t(f),It(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},r.set(c,f))}}function qw(e,t){Ga.M(e,t);var n=as;if(n&&e){var r=Rr(n).hoistableScripts,c=rs(e),f=r.get(c);f||(f=n.querySelector(fo(c)),f||(e=y({src:e,async:!0,type:"module"},t),(t=Hn.get(c))&&sf(e,t),f=n.createElement("script"),_t(f),It(f,"link",e),n.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},r.set(c,f))}}function Wv(e,t,n,r){var c=(c=Se.current)?qi(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=ls(n.href),n=Rr(c).hoistableStyles,r=n.get(t),r||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=ls(n.href);var f=Rr(c).hoistableStyles,b=f.get(e);if(b||(c=c.ownerDocument||c,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,b),(f=c.querySelector(uo(e)))&&!f._p&&(b.instance=f,b.state.loading=5),Hn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Hn.set(e,n),f||Iw(c,e,n,b.state))),t&&r===null)throw Error(i(528,""));return b}if(t&&r!==null)throw Error(i(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=rs(n),n=Rr(c).hoistableScripts,r=n.get(t),r||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function ls(e){return'href="'+Dn(e)+'"'}function uo(e){return'link[rel="stylesheet"]['+e+"]"}function ex(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function Iw(e,t,n,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),It(t,"link",n),_t(t),e.head.appendChild(t))}function rs(e){return'[src="'+Dn(e)+'"]'}function fo(e){return"script[async]"+e}function tx(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+Dn(n.href)+'"]');if(r)return t.instance=r,_t(r),r;var c=y({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),_t(r),It(r,"style",c),Ii(r,n.precedence,e),t.instance=r;case"stylesheet":c=ls(n.href);var f=e.querySelector(uo(c));if(f)return t.state.loading|=4,t.instance=f,_t(f),f;r=ex(n),(c=Hn.get(c))&&rf(r,c),f=(e.ownerDocument||e).createElement("link"),_t(f);var b=f;return b._p=new Promise(function(R,k){b.onload=R,b.onerror=k}),It(f,"link",r),t.state.loading|=4,Ii(f,n.precedence,e),t.instance=f;case"script":return f=rs(n.src),(c=e.querySelector(fo(f)))?(t.instance=c,_t(c),c):(r=n,(c=Hn.get(f))&&(r=y({},n),sf(r,c)),e=e.ownerDocument||e,c=e.createElement("script"),_t(c),It(c,"link",r),e.head.appendChild(c),t.instance=c);case"void":return null;default:throw Error(i(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Ii(r,n.precedence,e));return t.instance}function Ii(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=r.length?r[r.length-1]:null,f=c,b=0;b<r.length;b++){var R=r[b];if(R.dataset.precedence===t)f=R;else if(f!==c)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function rf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function sf(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Vi=null;function nx(e,t,n){if(Vi===null){var r=new Map,c=Vi=new Map;c.set(n,r)}else c=Vi,r=c.get(n),r||(r=new Map,c.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),c=0;c<n.length;c++){var f=n[c];if(!(f[Ns]||f[Bt]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var b=f.getAttribute(t)||"";b=e+b;var R=r.get(b);R?R.push(f):r.set(b,[f])}}return r}function ax(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function Vw(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function lx(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Gw(e,t,n,r){if(n.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var c=ls(r.href),f=t.querySelector(uo(c));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Gi.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=f,_t(f);return}f=t.ownerDocument||t,r=ex(r),(c=Hn.get(c))&&rf(r,c),f=f.createElement("link"),_t(f);var b=f;b._p=new Promise(function(R,k){b.onload=R,b.onerror=k}),It(f,"link",r),n.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=Gi.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var of=0;function Yw(e,t){return e.stylesheets&&e.count===0&&$i(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&$i(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&of===0&&(of=62500*Ew());var c=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&$i(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>of?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(c)}}:null}function Gi(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$i(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yi=null;function $i(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yi=new Map,t.forEach($w,e),Yi=null,Gi.call(e))}function $w(e,t){if(!(t.state.loading&4)){var n=Yi.get(e);if(n)var r=n.get(null);else{n=new Map,Yi.set(e,n);for(var c=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<c.length;f++){var b=c[f];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(n.set(b.dataset.precedence,b),r=b)}r&&n.set(null,r)}c=t.instance,b=c.getAttribute("data-precedence"),f=n.get(b)||r,f===r&&n.set(null,c),n.set(b,c),this.count++,r=Gi.bind(this),c.addEventListener("load",r),c.addEventListener("error",r),f?f.parentNode.insertBefore(c,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var ho={$$typeof:T,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function Kw(e,t,n,r,c,f,b,R,k){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=Xt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xt(0),this.hiddenUpdates=Xt(null),this.identifierPrefix=r,this.onUncaughtError=c,this.onCaughtError=f,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function rx(e,t,n,r,c,f,b,R,k,G,W,ne){return e=new Kw(e,t,n,b,k,G,W,ne,R),t=1,f===!0&&(t|=24),f=gn(3,null,null,t),e.current=f,f.stateNode=e,t=Pu(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:r,isDehydrated:n,cache:t},Gu(f),e}function sx(e){return e?(e=Lr,e):Lr}function ox(e,t,n,r,c,f){c=sx(c),r.context===null?r.context=c:r.pendingContext=c,r=ml(t),r.payload={element:n},f=f===void 0?null:f,f!==null&&(r.callback=f),n=pl(e,r,t),n!==null&&(ln(n,e,t),Gs(n,e,t))}function ix(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function cf(e,t){ix(e,t),(e=e.alternate)&&ix(e,t)}function cx(e){if(e.tag===13||e.tag===31){var t=Fl(e,67108864);t!==null&&ln(t,e,67108864),cf(e,67108864)}}function ux(e){if(e.tag===13||e.tag===31){var t=Sn();t=au(t);var n=Fl(e,t);n!==null&&ln(n,e,t),cf(e,t)}}var Ki=!0;function Xw(e,t,n,r){var c=U.T;U.T=null;var f=$.p;try{$.p=2,uf(e,t,n,r)}finally{$.p=f,U.T=c}}function Fw(e,t,n,r){var c=U.T;U.T=null;var f=$.p;try{$.p=8,uf(e,t,n,r)}finally{$.p=f,U.T=c}}function uf(e,t,n,r){if(Ki){var c=df(r);if(c===null)Fd(e,t,r,Xi,n),fx(e,r);else if(Zw(c,e,t,n,r))r.stopPropagation();else if(fx(e,r),t&4&&-1<Qw.indexOf(e)){for(;c!==null;){var f=Er(c);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var b=Vt(f.pendingLanes);if(b!==0){var R=f;for(R.pendingLanes|=2,R.entangledLanes|=2;b;){var k=1<<31-jt(b);R.entanglements[1]|=k,b&=~k}fa(f),($e&6)===0&&(Mi=$t()+500,so(0))}}break;case 31:case 13:R=Fl(f,2),R!==null&&ln(R,f,2),_i(),cf(f,2)}if(f=df(r),f===null&&Fd(e,t,r,Xi,n),f===c)break;c=f}c!==null&&r.stopPropagation()}else Fd(e,t,r,null,n)}}function df(e){return e=fu(e),ff(e)}var Xi=null;function ff(e){if(Xi=null,e=Cr(e),e!==null){var t=d(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=p(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Xi=e,null}function dx(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(Jc()){case Kt:return 2;case Ea:return 8;case br:case Wc:return 32;case Vl:return 268435456;default:return 32}default:return 32}}var hf=!1,Rl=null,Nl=null,Tl=null,mo=new Map,po=new Map,Al=[],Qw="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 fx(e,t){switch(e){case"focusin":case"focusout":Rl=null;break;case"dragenter":case"dragleave":Nl=null;break;case"mouseover":case"mouseout":Tl=null;break;case"pointerover":case"pointerout":mo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":po.delete(t.pointerId)}}function go(e,t,n,r,c,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:f,targetContainers:[c]},t!==null&&(t=Er(t),t!==null&&cx(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function Zw(e,t,n,r,c){switch(t){case"focusin":return Rl=go(Rl,e,t,n,r,c),!0;case"dragenter":return Nl=go(Nl,e,t,n,r,c),!0;case"mouseover":return Tl=go(Tl,e,t,n,r,c),!0;case"pointerover":var f=c.pointerId;return mo.set(f,go(mo.get(f)||null,e,t,n,r,c)),!0;case"gotpointercapture":return f=c.pointerId,po.set(f,go(po.get(f)||null,e,t,n,r,c)),!0}return!1}function hx(e){var t=Cr(e.target);if(t!==null){var n=d(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,Nm(e.priority,function(){ux(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,Nm(e.priority,function(){ux(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=df(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);du=r,n.target.dispatchEvent(r),du=null}else return t=Er(n),t!==null&&cx(t),e.blockedOn=n,!1;t.shift()}return!0}function mx(e,t,n){Fi(e)&&n.delete(t)}function Jw(){hf=!1,Rl!==null&&Fi(Rl)&&(Rl=null),Nl!==null&&Fi(Nl)&&(Nl=null),Tl!==null&&Fi(Tl)&&(Tl=null),mo.forEach(mx),po.forEach(mx)}function Qi(e,t){e.blockedOn===t&&(e.blockedOn=null,hf||(hf=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Jw)))}var Zi=null;function px(e){Zi!==e&&(Zi=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Zi===e&&(Zi=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],c=e[t+2];if(typeof r!="function"){if(ff(r||n)===null)continue;break}var f=Er(n);f!==null&&(e.splice(t,3),t-=3,ud(f,{pending:!0,data:c,method:n.method,action:r},r,c))}}))}function ss(e){function t(k){return Qi(k,e)}Rl!==null&&Qi(Rl,e),Nl!==null&&Qi(Nl,e),Tl!==null&&Qi(Tl,e),mo.forEach(t),po.forEach(t);for(var n=0;n<Al.length;n++){var r=Al[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Al.length&&(n=Al[0],n.blockedOn===null);)hx(n),n.blockedOn===null&&Al.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var c=n[r],f=n[r+1],b=c[Jt]||null;if(typeof f=="function")b||px(n);else if(b){var R=null;if(f&&f.hasAttribute("formAction")){if(c=f,b=f[Jt]||null)R=b.formAction;else if(ff(c)!==null)continue}else R=b.action;typeof R=="function"?n[r+1]=R:(n.splice(r,3),r-=3),px(n)}}}function gx(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(b){return c=b})},focusReset:"manual",scroll:"manual"})}function t(){c!==null&&(c(),c=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),c!==null&&(c(),c=null)}}}function mf(e){this._internalRoot=e}Ji.prototype.render=mf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current,r=Sn();ox(n,r,e,t,null,null)},Ji.prototype.unmount=mf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ox(e.current,2,null,e,null,null),_i(),t[jr]=null}};function Ji(e){this._internalRoot=e}Ji.prototype.unstable_scheduleHydration=function(e){if(e){var t=Rm();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Al.length&&t!==0&&t<Al[n].priority;n++);Al.splice(n,0,e),n===0&&hx(e)}};var vx=l.version;if(vx!=="19.2.8")throw Error(i(527,vx,"19.2.8"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=v(t),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var Ww={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Wi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wi.isDisabled&&Wi.supportsFiber)try{Ra=Wi.inject(Ww),wt=Wi}catch{}}return xo.createRoot=function(e,t){if(!u(e))throw Error(i(299));var n=!1,r="",c=Cg,f=Eg,b=Rg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(c=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(b=t.onRecoverableError)),t=rx(e,1,!1,null,null,n,r,null,c,f,b,gx),e[jr]=t.current,Xd(e),new mf(t)},xo.hydrateRoot=function(e,t,n){if(!u(e))throw Error(i(299));var r=!1,c="",f=Cg,b=Eg,R=Rg,k=null;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(c=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(b=n.onCaughtError),n.onRecoverableError!==void 0&&(R=n.onRecoverableError),n.formState!==void 0&&(k=n.formState)),t=rx(e,1,!0,t,n??null,r,c,k,f,b,R,gx),t.context=sx(null),n=t.current,r=Sn(),r=au(r),c=ml(r),c.callback=null,pl(n,c,r),n=r,t.current.lanes=n,Ut(t,n),fa(t),e[jr]=t.current,Xd(e),new Ji(t)},xo.version="19.2.8",xo}var Mx;function cj(){if(Mx)return xf.exports;Mx=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(l){console.error(l)}}return a(),xf.exports=ij(),xf.exports}var uj=cj();const dj=vh(uj);/**
|
|
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 yh=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,wy=/^[\\/]{2}/;function fj(a,l){return l+a.replace(/\\/g,"/")}var Dx="popstate";function _x(a){return typeof a=="object"&&a!=null&&"pathname"in a&&"search"in a&&"hash"in a&&"state"in a&&"key"in a}function hj(a={}){function l(i,u){var v;let d=(v=u.state)==null?void 0:v.masked,{pathname:h,search:p,hash:g}=d||i.location;return Pf("",{pathname:h,search:p,hash:g},u.state&&u.state.usr||null,u.state&&u.state.key||"default",d?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function o(i,u){return typeof u=="string"?u:Co(u)}return pj(l,o,null,a)}function ht(a,l){if(a===!1||a===null||typeof a>"u")throw new Error(l)}function Yn(a,l){if(!a){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function mj(){return Math.random().toString(36).substring(2,10)}function Ox(a,l){return{usr:a.state,key:a.key,idx:l,masked:a.mask?{pathname:a.pathname,search:a.search,hash:a.hash}:void 0}}function Pf(a,l,o=null,i,u){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof l=="string"?vs(l):l,state:o,key:l&&l.key||i||mj(),mask:u}}function Co({pathname:a="/",search:l="",hash:o=""}){return l&&l!=="?"&&(a+=l.charAt(0)==="?"?l:"?"+l),o&&o!=="#"&&(a+=o.charAt(0)==="#"?o:"#"+o),a}function vs(a){let l={};if(a){let o=a.indexOf("#");o>=0&&(l.hash=a.substring(o),a=a.substring(0,o));let i=a.indexOf("?");i>=0&&(l.search=a.substring(i),a=a.substring(0,i)),a&&(l.pathname=a)}return l}function pj(a,l,o,i={}){let{window:u=document.defaultView,v5Compat:d=!1}=i,h=u.history,p="POP",g=null,v=x();v==null&&(v=0,h.replaceState({...h.state,idx:v},""));function x(){return(h.state||{idx:null}).idx}function y(){p="POP";let j=x(),N=j==null?null:j-v;v=j,g&&g({action:p,location:E.location,delta:N})}function S(j,N){p="PUSH";let M=_x(j)?j:Pf(E.location,j,N);v=x()+1;let T=Ox(M,v),_=E.createHref(M.mask||M);try{h.pushState(T,"",_)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;u.location.assign(_)}d&&g&&g({action:p,location:E.location,delta:1})}function w(j,N){p="REPLACE";let M=_x(j)?j:Pf(E.location,j,N);v=x();let T=Ox(M,v),_=E.createHref(M.mask||M);h.replaceState(T,"",_),d&&g&&g({action:p,location:E.location,delta:0})}function C(j){return gj(u,j)}let E={get action(){return p},get location(){return a(u,h)},listen(j){if(g)throw new Error("A history only accepts one active listener");return u.addEventListener(Dx,y),g=j,()=>{u.removeEventListener(Dx,y),g=null}},createHref(j){return l(u,j)},createURL:C,encodeLocation(j){let N=C(j);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:S,replace:w,go(j){return h.go(j)}};return E}function gj(a,l,o=!1){let i="http://localhost";a&&(i=a.location.origin!=="null"?a.location.origin:a.location.href),ht(i,"No window.location.(origin|href) available to create URL");let u=typeof l=="string"?l:Co(l);return u=u.replace(/ $/,"%20"),!o&&wy.test(u)&&(u=i+u),new URL(u,i)}function jy(a,l,o="/"){return vj(a,l,o,!1)}function vj(a,l,o,i,u){let d=typeof l=="string"?vs(l):l,h=Za(d.pathname||"/",o);if(h==null)return null;let p=xj(a),g=null,v=Aj(h);for(let x=0;g==null&&x<p.length;++x)g=Tj(p[x],v,i);return g}function xj(a){let l=Cy(a);return yj(l),l}function Cy(a,l=[],o=[],i="",u=!1){let d=(h,p,g=u,v)=>{let x={relativePath:v===void 0?h.path||"":v,caseSensitive:h.caseSensitive===!0,childrenIndex:p,route:h};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(i)&&g)return;ht(x.relativePath.startsWith(i),`Absolute route path "${x.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(i.length)}let y=la([i,x.relativePath]),S=o.concat(x);h.children&&h.children.length>0&&(ht(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),Cy(h.children,l,S,y,g)),!(h.path==null&&!h.index)&&l.push({path:y,score:Rj(y,h.index),routesMeta:S.map((w,C)=>{let[E,j]=Ny(w.relativePath,w.caseSensitive,C===S.length-1);return{...w,matcher:E,compiledParams:j}})})};return a.forEach((h,p)=>{var g;if(h.path===""||!((g=h.path)!=null&&g.includes("?")))d(h,p);else for(let v of Ey(h.path))d(h,p,!0,v)}),l}function Ey(a){let l=a.split("/");if(l.length===0)return[];let[o,...i]=l,u=o.endsWith("?"),d=o.replace(/\?$/,"");if(i.length===0)return u?[d,""]:[d];let h=Ey(i.join("/")),p=[];return p.push(...h.map(g=>g===""?d:[d,g].join("/"))),u&&p.push(...h),p.map(g=>a.startsWith("/")&&g===""?"/":g)}function yj(a){a.sort((l,o)=>l.score!==o.score?o.score-l.score:Nj(l.routesMeta.map(i=>i.childrenIndex),o.routesMeta.map(i=>i.childrenIndex)))}var bj=/^:[\w-]+$/,Sj=3,wj=2,jj=1,Cj=10,Ej=-2,kx=a=>a==="*";function Rj(a,l){let o=a.split("/"),i=o.length;return o.some(kx)&&(i+=Ej),l&&(i+=wj),o.filter(u=>!kx(u)).reduce((u,d)=>u+(bj.test(d)?Sj:d===""?jj:Cj),i)}function Nj(a,l){return a.length===l.length&&a.slice(0,-1).every((i,u)=>i===l[u])?a[a.length-1]-l[l.length-1]:0}function Tj(a,l,o=!1){let{routesMeta:i}=a,u={},d="/",h=[];for(let p=0;p<i.length;++p){let g=i[p],v=p===i.length-1,x=d==="/"?l:l.slice(d.length)||"/",y={path:g.relativePath,caseSensitive:g.caseSensitive,end:v},S=g.matcher&&g.compiledParams?Ry(y,x,g.matcher,g.compiledParams):bc(y,x),w=g.route;if(!S&&v&&o&&!i[i.length-1].route.index&&(S=bc({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},x)),!S)return null;Object.assign(u,S.params),h.push({params:u,pathname:la([d,S.pathname]),pathnameBase:_j(la([d,S.pathnameBase])),route:w}),S.pathnameBase!=="/"&&(d=la([d,S.pathnameBase]))}return h}function bc(a,l){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[o,i]=Ny(a.path,a.caseSensitive,a.end);return Ry(a,l,o,i)}function Ry(a,l,o,i){let u=l.match(o);if(!u)return null;let d=u[0],h=d.replace(/(.)\/+$/,"$1"),p=u.slice(1);return{params:i.reduce((v,{paramName:x,isOptional:y},S)=>{if(x==="*"){let C=p[S]||"";h=d.slice(0,d.length-C.length).replace(/(.)\/+$/,"$1")}const w=p[S];return y&&!w?v[x]=void 0:v[x]=(w||"").replace(/%2F/g,"/"),v},{}),pathname:d,pathnameBase:h,pattern:a}}function Ny(a,l=!1,o=!0){Yn(a==="*"||!a.endsWith("*")||a.endsWith("/*"),`Route path "${a}" will be treated as if it were "${a.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${a.replace(/\*$/,"/*")}".`);let i=[],u="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,p,g,v,x)=>{if(i.push({paramName:p,isOptional:g!=null}),g){let y=x.charAt(v+h.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(i.push({paramName:"*"}),u+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?u+="\\/*$":a!==""&&a!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,l?void 0:"i"),i]}function Aj(a){try{return a.split("/").map(l=>decodeURIComponent(l).replace(/\//g,"%2F")).join("/")}catch(l){return Yn(!1,`The URL path "${a}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${l}).`),a}}function Za(a,l){if(l==="/")return a;if(!a.toLowerCase().startsWith(l.toLowerCase()))return null;let o=l.endsWith("/")?l.length-1:l.length,i=a.charAt(o);return i&&i!=="/"?null:a.slice(o)||"/"}function Mj(a,l="/"){let{pathname:o,search:i="",hash:u=""}=typeof a=="string"?vs(a):a,d;return o?(o=Ty(o),o.startsWith("/")?d=zx(o.substring(1),"/"):d=zx(o,l)):d=l,{pathname:d,search:Oj(i),hash:kj(u)}}function zx(a,l){let o=Sc(l).split("/");return a.split("/").forEach(u=>{u===".."?o.length>1&&o.pop():u!=="."&&o.push(u)}),o.length>1?o.join("/"):"/"}function wf(a,l,o,i){return`Cannot include a '${a}' character in a manually specified \`to.${l}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Dj(a){return a.filter((l,o)=>o===0||l.route.path&&l.route.path.length>0)}function bh(a){let l=Dj(a);return l.map((o,i)=>i===l.length-1?o.pathname:o.pathnameBase)}function Nc(a,l,o,i=!1){let u;typeof a=="string"?u=vs(a):(u={...a},ht(!u.pathname||!u.pathname.includes("?"),wf("?","pathname","search",u)),ht(!u.pathname||!u.pathname.includes("#"),wf("#","pathname","hash",u)),ht(!u.search||!u.search.includes("#"),wf("#","search","hash",u)));let d=a===""||u.pathname==="",h=d?"/":u.pathname,p;if(h==null)p=o;else{let y=l.length-1;if(!i&&h.startsWith("..")){let S=h.split("/");for(;S[0]==="..";)S.shift(),y-=1;u.pathname=S.join("/")}p=y>=0?l[y]:"/"}let g=Mj(u,p),v=h&&h!=="/"&&h.endsWith("/"),x=(d||h===".")&&o.endsWith("/");return!g.pathname.endsWith("/")&&(v||x)&&(g.pathname+="/"),g}var Ty=a=>a.replace(/[\\/]{2,}/g,"/"),la=a=>Ty(a.join("/")),Sc=a=>a.replace(/\/+$/,""),_j=a=>Sc(a).replace(/^\/*/,"/"),Oj=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,kj=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,zj=class{constructor(a,l,o,i=!1){this.status=a,this.statusText=l||"",this.internal=i,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function Lj(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function Uj(a){let l=a.map(o=>o.route.path).filter(Boolean);return la(l)||"/"}var Ay=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function My(a,l){let o=a;if(typeof o!="string"||!yh.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let i=o,u=!1;if(Ay)try{let d=new URL(window.location.href),h=wy.test(o)?new URL(fj(o,d.protocol)):new URL(o),p=Za(h.pathname,l);h.origin===d.origin&&p!=null?o=p+h.search+h.hash:u=!0}catch{Yn(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:u,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Dy=["POST","PUT","PATCH","DELETE"];new Set(Dy);var Bj=["GET",...Dy];new Set(Bj);var Hj=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function Pj(a){try{return Hj.includes(new URL(a).protocol)}catch{return!1}}var xs=m.createContext(null);xs.displayName="DataRouter";var Tc=m.createContext(null);Tc.displayName="DataRouterState";var _y=m.createContext(!1);function qj(){return m.useContext(_y)}var Oy=m.createContext({isTransitioning:!1});Oy.displayName="ViewTransition";var Ij=m.createContext(new Map);Ij.displayName="Fetchers";var Vj=m.createContext(null);Vj.displayName="Await";var Tn=m.createContext(null);Tn.displayName="Navigation";var Mo=m.createContext(null);Mo.displayName="Location";var Sa=m.createContext({outlet:null,matches:[],isDataRoute:!1});Sa.displayName="Route";var Sh=m.createContext(null);Sh.displayName="RouteError";var ky="REACT_ROUTER_ERROR",Gj="REDIRECT",Yj="ROUTE_ERROR_RESPONSE";function $j(a){if(a.startsWith(`${ky}:${Gj}:{`))try{let l=JSON.parse(a.slice(28));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.location=="string"&&typeof l.reloadDocument=="boolean"&&typeof l.replace=="boolean")return l}catch{}}function Kj(a){if(a.startsWith(`${ky}:${Yj}:{`))try{let l=JSON.parse(a.slice(40));if(typeof l=="object"&&l&&typeof l.status=="number"&&typeof l.statusText=="string")return new zj(l.status,l.statusText,l.data)}catch{}}function Xj(a,{relative:l}={}){ht(ys(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:i}=m.useContext(Tn),{hash:u,pathname:d,search:h}=_o(a,{relative:l}),p=d;return o!=="/"&&(p=d==="/"?o:la([o,d])),i.createHref({pathname:p,search:h,hash:u})}function ys(){return m.useContext(Mo)!=null}function dn(){return ht(ys(),"useLocation() may be used only in the context of a <Router> component."),m.useContext(Mo).location}var zy="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ly(a){m.useContext(Tn).static||m.useLayoutEffect(a)}function Do(){let{isDataRoute:a}=m.useContext(Sa);return a?o2():Fj()}function Fj(){ht(ys(),"useNavigate() may be used only in the context of a <Router> component.");let a=m.useContext(xs),{basename:l,navigator:o}=m.useContext(Tn),{matches:i}=m.useContext(Sa),{pathname:u}=dn(),d=JSON.stringify(bh(i)),h=m.useRef(!1);return Ly(()=>{h.current=!0}),m.useCallback((g,v={})=>{if(Yn(h.current,zy),!h.current)return;if(typeof g=="number"){o.go(g);return}let x=Nc(g,JSON.parse(d),u,v.relative==="path");a==null&&l!=="/"&&(x.pathname=x.pathname==="/"?l:la([l,x.pathname])),(v.replace?o.replace:o.push)(x,v.state,v)},[l,o,d,u,a])}m.createContext(null);function _o(a,{relative:l}={}){let{matches:o}=m.useContext(Sa),{pathname:i}=dn(),u=JSON.stringify(bh(o));return m.useMemo(()=>Nc(a,JSON.parse(u),i,l==="path"),[a,u,i,l])}function Qj(a,l){return Uy(a,l)}function Uy(a,l,o){var j;ht(ys(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=m.useContext(Tn),{matches:u}=m.useContext(Sa),d=u[u.length-1],h=d?d.params:{},p=d?d.pathname:"/",g=d?d.pathnameBase:"/",v=d&&d.route;{let N=v&&v.path||"";Hy(p,!v||N.endsWith("*")||N.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${N}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
+
|
|
60
|
+
Please change the parent <Route path="${N}"> to <Route path="${N==="/"?"*":`${N}/*`}">.`)}let x=dn(),y;if(l){let N=typeof l=="string"?vs(l):l;ht(g==="/"||((j=N.pathname)==null?void 0:j.startsWith(g)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${N.pathname}" was given in the \`location\` prop.`),y=N}else y=x;let S=y.pathname||"/",w=S;if(g!=="/"){let N=g.replace(/^\//,"").split("/");w="/"+S.replace(/^\//,"").split("/").slice(N.length).join("/")}let C=o&&o.state.matches.length?o.state.matches.map(N=>Object.assign(N,{route:o.manifest[N.route.id]||N.route})):jy(a,{pathname:w});Yn(v||C!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),Yn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.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 E=t2(C&&C.map(N=>Object.assign({},N,{params:Object.assign({},h,N.params),pathname:la([g,i.encodeLocation?i.encodeLocation(N.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathname]),pathnameBase:N.pathnameBase==="/"?g:la([g,i.encodeLocation?i.encodeLocation(N.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:N.pathnameBase])})),u,o);return l&&E?m.createElement(Mo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...y},navigationType:"POP"}},E):E}function Zj(){let a=s2(),l=Lj(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),o=a instanceof Error?a.stack:null,i="rgba(200,200,200, 0.5)",u={padding:"0.5rem",backgroundColor:i},d={padding:"2px 4px",backgroundColor:i},h=null;return console.error("Error handled by React Router default ErrorBoundary:",a),h=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:d},"ErrorBoundary")," or"," ",m.createElement("code",{style:d},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},l),o?m.createElement("pre",{style:u},o):null,h)}var Jj=m.createElement(Zj,null),By=class extends m.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,l){return l.location!==a.location||l.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:l.error,location:l.location,revalidation:a.revalidation||l.revalidation}}componentDidCatch(a,l){this.props.onError?this.props.onError(a,l):console.error("React Router caught the following error during render",a)}render(){let a=this.state.error;if(this.context&&typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){const o=Kj(a.digest);o&&(a=o)}let l=a!==void 0?m.createElement(Sa.Provider,{value:this.props.routeContext},m.createElement(Sh.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?m.createElement(Wj,{error:a},l):l}};By.contextType=_y;var jf=new WeakMap;function Wj({children:a,error:l}){let{basename:o}=m.useContext(Tn);if(typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){let i=$j(l.digest);if(i){let u=jf.get(l);if(u)throw u;let d=My(i.location,o),h=d.absoluteURL||d.to;if(Pj(h))throw new Error("Invalid redirect location");if(Ay&&!jf.get(l))if(d.isExternal||i.reloadDocument)window.location.href=h;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:i.replace}));throw jf.set(l,p),p}return m.createElement("meta",{httpEquiv:"refresh",content:`0;url=${h}`})}}return a}function e2({routeContext:a,match:l,children:o}){let i=m.useContext(xs);return i&&i.static&&i.staticContext&&(l.route.errorElement||l.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=l.route.id),m.createElement(Sa.Provider,{value:a},o)}function t2(a,l=[],o){let i=o==null?void 0:o.state;if(a==null){if(!i)return null;if(i.errors)a=i.matches;else if(l.length===0&&!i.initialized&&i.matches.length>0)a=i.matches;else return null}let u=a,d=i==null?void 0:i.errors;if(d!=null){let x=u.findIndex(y=>y.route.id&&(d==null?void 0:d[y.route.id])!==void 0);ht(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(d).join(",")}`),u=u.slice(0,Math.min(u.length,x+1))}let h=!1,p=-1;if(o&&i){h=i.renderFallback;for(let x=0;x<u.length;x++){let y=u[x];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(p=x),y.route.id){let{loaderData:S,errors:w}=i,C=y.route.loader&&!S.hasOwnProperty(y.route.id)&&(!w||w[y.route.id]===void 0);if(y.route.lazy||C){o.isStatic&&(h=!0),p>=0?u=u.slice(0,p+1):u=[u[0]];break}}}}let g=o==null?void 0:o.onError,v=i&&g?(x,y)=>{var S,w;g(x,{location:i.location,params:((w=(S=i.matches)==null?void 0:S[0])==null?void 0:w.params)??{},pattern:Uj(i.matches),errorInfo:y})}:void 0;return u.reduceRight((x,y,S)=>{let w,C=!1,E=null,j=null;i&&(w=d&&y.route.id?d[y.route.id]:void 0,E=y.route.errorElement||Jj,h&&(p<0&&S===0?(Hy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,j=null):p===S&&(C=!0,j=y.route.hydrateFallbackElement||null)));let N=l.concat(u.slice(0,S+1)),M=()=>{let T;return w?T=E:C?T=j:y.route.Component?T=m.createElement(y.route.Component,null):y.route.element?T=y.route.element:T=x,m.createElement(e2,{match:y,routeContext:{outlet:x,matches:N,isDataRoute:i!=null},children:T})};return i&&(y.route.ErrorBoundary||y.route.errorElement||S===0)?m.createElement(By,{location:i.location,revalidation:i.revalidation,component:E,error:w,children:M(),routeContext:{outlet:null,matches:N,isDataRoute:!0},onError:v}):M()},null)}function wh(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function n2(a){let l=m.useContext(xs);return ht(l,wh(a)),l}function a2(a){let l=m.useContext(Tc);return ht(l,wh(a)),l}function l2(a){let l=m.useContext(Sa);return ht(l,wh(a)),l}function jh(a){let l=l2(a),o=l.matches[l.matches.length-1];return ht(o.route.id,`${a} can only be used on routes that contain a unique "id"`),o.route.id}function r2(){return jh("useRouteId")}function s2(){var i;let a=m.useContext(Sh),l=a2("useRouteError"),o=jh("useRouteError");return a!==void 0?a:(i=l.errors)==null?void 0:i[o]}function o2(){let{router:a}=n2("useNavigate"),l=jh("useNavigate"),o=m.useRef(!1);return Ly(()=>{o.current=!0}),m.useCallback(async(u,d={})=>{Yn(o.current,zy),o.current&&(typeof u=="number"?await a.navigate(u):await a.navigate(u,{fromRouteId:l,...d}))},[a,l])}var Lx={};function Hy(a,l,o){!l&&!Lx[a]&&(Lx[a]=!0,Yn(!1,o))}m.memo(i2);function i2({routes:a,manifest:l,future:o,state:i,isStatic:u,onError:d}){return Uy(a,void 0,{manifest:l,state:i,isStatic:u,onError:d})}function qf({to:a,replace:l,state:o,relative:i}){ht(ys(),"<Navigate> may be used only in the context of a <Router> component.");let{static:u}=m.useContext(Tn);Yn(!u,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:d}=m.useContext(Sa),{pathname:h}=dn(),p=Do(),g=Nc(a,bh(d),h,i==="path"),v=JSON.stringify(g);return m.useEffect(()=>{p(JSON.parse(v),{replace:l,state:o,relative:i})},[p,v,i,l,o]),null}function rn(a){ht(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function c2({basename:a="/",children:l=null,location:o,navigationType:i="POP",navigator:u,static:d=!1,useTransitions:h}){ht(!ys(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=a.replace(/^\/*/,"/"),g=m.useMemo(()=>({basename:p,navigator:u,static:d,useTransitions:h,future:{}}),[p,u,d,h]);typeof o=="string"&&(o=vs(o));let{pathname:v="/",search:x="",hash:y="",state:S=null,key:w="default",mask:C}=o,E=m.useMemo(()=>{let j=Za(v,p);return j==null?null:{location:{pathname:j,search:x,hash:y,state:S,key:w,mask:C},navigationType:i}},[p,v,x,y,S,w,i,C]);return Yn(E!=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.`),E==null?null:m.createElement(Tn.Provider,{value:g},m.createElement(Mo.Provider,{children:l,value:E}))}function Py({children:a,location:l}){return Qj(If(a),l)}function If(a,l=[]){let o=[];return m.Children.forEach(a,(i,u)=>{if(!m.isValidElement(i))return;let d=[...l,u];if(i.type===m.Fragment){o.push.apply(o,If(i.props.children,d));return}ht(i.type===rn,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ht(!i.props.index||!i.props.children,"An index route cannot have child routes.");let h={id:i.props.id||d.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(h.children=If(i.props.children,d)),o.push(h)}),o}var mc="get",pc="application/x-www-form-urlencoded";function Ac(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function u2(a){return Ac(a)&&a.tagName.toLowerCase()==="button"}function d2(a){return Ac(a)&&a.tagName.toLowerCase()==="form"}function f2(a){return Ac(a)&&a.tagName.toLowerCase()==="input"}function h2(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function m2(a,l){return a.button===0&&(!l||l==="_self")&&!h2(a)}function Vf(a=""){return new URLSearchParams(typeof a=="string"||Array.isArray(a)||a instanceof URLSearchParams?a:Object.keys(a).reduce((l,o)=>{let i=a[o];return l.concat(Array.isArray(i)?i.map(u=>[o,u]):[[o,i]])},[]))}function p2(a,l){let o=Vf(a);return l&&l.forEach((i,u)=>{o.has(u)||l.getAll(u).forEach(d=>{o.append(u,d)})}),o}var ec=null;function g2(){if(ec===null)try{new FormData(document.createElement("form"),0),ec=!1}catch{ec=!0}return ec}var v2=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Cf(a){return a!=null&&!v2.has(a)?(Yn(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${pc}"`),null):a}function x2(a,l){let o,i,u,d,h;if(d2(a)){let p=a.getAttribute("action");i=p?Za(p,l):null,o=a.getAttribute("method")||mc,u=Cf(a.getAttribute("enctype"))||pc,d=new FormData(a)}else if(u2(a)||f2(a)&&(a.type==="submit"||a.type==="image")){let p=a.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=a.getAttribute("formaction")||p.getAttribute("action");if(i=g?Za(g,l):null,o=a.getAttribute("formmethod")||p.getAttribute("method")||mc,u=Cf(a.getAttribute("formenctype"))||Cf(p.getAttribute("enctype"))||pc,d=new FormData(p,a),!g2()){let{name:v,type:x,value:y}=a;if(x==="image"){let S=v?`${v}.`:"";d.append(`${S}x`,"0"),d.append(`${S}y`,"0")}else v&&d.append(v,y)}}else{if(Ac(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=mc,i=null,u=pc,h=a}return d&&u==="text/plain"&&(h=d,d=void 0),{action:i,method:o.toLowerCase(),encType:u,formData:d,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Ch(a,l){if(a===!1||a===null||typeof a>"u")throw new Error(l)}function qy(a,l,o,i){let u=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return o?u.pathname.endsWith("/")?u.pathname=`${u.pathname}_.${i}`:u.pathname=`${u.pathname}.${i}`:u.pathname==="/"?u.pathname=`_root.${i}`:l&&Za(u.pathname,l)==="/"?u.pathname=`${Sc(l)}/_root.${i}`:u.pathname=`${Sc(u.pathname)}.${i}`,u}async function y2(a,l){if(a.id in l)return l[a.id];try{let o=await import(a.module);return l[a.id]=o,o}catch(o){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function b2(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function S2(a,l,o){let i=await Promise.all(a.map(async u=>{let d=l.routes[u.route.id];if(d){let h=await y2(d,o);return h.links?h.links():[]}return[]}));return E2(i.flat(1).filter(b2).filter(u=>u.rel==="stylesheet"||u.rel==="preload").map(u=>u.rel==="stylesheet"?{...u,rel:"prefetch",as:"style"}:{...u,rel:"prefetch"}))}function Ux(a,l,o,i,u,d){let h=(g,v)=>o[v]?g.route.id!==o[v].route.id:!0,p=(g,v)=>{var x;return o[v].pathname!==g.pathname||((x=o[v].route.path)==null?void 0:x.endsWith("*"))&&o[v].params["*"]!==g.params["*"]};return d==="assets"?l.filter((g,v)=>h(g,v)||p(g,v)):d==="data"?l.filter((g,v)=>{var y;let x=i.routes[g.route.id];if(!x||!x.hasLoader)return!1;if(h(g,v)||p(g,v))return!0;if(g.route.shouldRevalidate){let S=g.route.shouldRevalidate({currentUrl:new URL(u.pathname+u.search+u.hash,window.origin),currentParams:((y=o[0])==null?void 0:y.params)||{},nextUrl:new URL(a,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof S=="boolean")return S}return!0}):[]}function w2(a,l,{includeHydrateFallback:o}={}){return j2(a.map(i=>{let u=l.routes[i.route.id];if(!u)return[];let d=[u.module];return u.clientActionModule&&(d=d.concat(u.clientActionModule)),u.clientLoaderModule&&(d=d.concat(u.clientLoaderModule)),o&&u.hydrateFallbackModule&&(d=d.concat(u.hydrateFallbackModule)),u.imports&&(d=d.concat(u.imports)),d}).flat(1))}function j2(a){return[...new Set(a)]}function C2(a){let l={},o=Object.keys(a).sort();for(let i of o)l[i]=a[i];return l}function E2(a,l){let o=new Set;return new Set(l),a.reduce((i,u)=>{let d=JSON.stringify(C2(u));return o.has(d)||(o.add(d),i.push({key:d,link:u})),i},[])}function Eh(){let a=m.useContext(xs);return Ch(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function R2(){let a=m.useContext(Tc);return Ch(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var Rh=m.createContext(void 0);Rh.displayName="FrameworkContext";function Mc(){let a=m.useContext(Rh);return Ch(a,"You must render this element inside a <HydratedRouter> element"),a}function N2(a,l){let o=m.useContext(Rh),[i,u]=m.useState(!1),[d,h]=m.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:v,onMouseLeave:x,onTouchStart:y}=l,S=m.useRef(null);m.useEffect(()=>{if(a==="render"&&h(!0),a==="viewport"){let E=N=>{N.forEach(M=>{h(M.isIntersecting)})},j=new IntersectionObserver(E,{threshold:.5});return S.current&&j.observe(S.current),()=>{j.disconnect()}}},[a]),m.useEffect(()=>{if(i){let E=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(E)}}},[i]);let w=()=>{u(!0)},C=()=>{u(!1),h(!1)};return o?a!=="intent"?[d,S,{}]:[d,S,{onFocus:yo(p,w),onBlur:yo(g,C),onMouseEnter:yo(v,w),onMouseLeave:yo(x,C),onTouchStart:yo(y,w)}]:[!1,S,{}]}function yo(a,l){return o=>{a&&a(o),o.defaultPrevented||l(o)}}function T2({page:a,...l}){let o=qj(),{nonce:i}=Mc(),{router:u}=Eh(),d=m.useMemo(()=>jy(u.routes,a,u.basename),[u.routes,a,u.basename]);return d?(l.nonce==null&&i&&(l={...l,nonce:i}),o?m.createElement(M2,{page:a,matches:d,...l}):m.createElement(D2,{page:a,matches:d,...l})):null}function A2(a){let{manifest:l,routeModules:o}=Mc(),[i,u]=m.useState([]);return m.useEffect(()=>{let d=!1;return S2(a,l,o).then(h=>{d||u(h)}),()=>{d=!0}},[a,l,o]),i}function M2({page:a,matches:l,...o}){let i=dn(),{future:u}=Mc(),{basename:d}=Eh(),h=m.useMemo(()=>{if(a===i.pathname+i.search+i.hash)return[];let p=qy(a,d,u.v8_trailingSlashAwareDataRequests,"rsc"),g=!1,v=[];for(let x of l)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]},[d,u.v8_trailingSlashAwareDataRequests,a,i,l]);return m.createElement(m.Fragment,null,h.map(p=>m.createElement("link",{key:p,rel:"prefetch",as:"fetch",href:p,...o})))}function D2({page:a,matches:l,...o}){let i=dn(),{future:u,manifest:d,routeModules:h}=Mc(),{basename:p}=Eh(),{loaderData:g,matches:v}=R2(),x=m.useMemo(()=>Ux(a,l,v,d,i,"data"),[a,l,v,d,i]),y=m.useMemo(()=>Ux(a,l,v,d,i,"assets"),[a,l,v,d,i]),S=m.useMemo(()=>{if(a===i.pathname+i.search+i.hash)return[];let E=new Set,j=!1;if(l.forEach(M=>{var _;let T=d.routes[M.route.id];!T||!T.hasLoader||(!x.some(O=>O.route.id===M.route.id)&&M.route.id in g&&((_=h[M.route.id])!=null&&_.shouldRevalidate)||T.hasClientLoader?j=!0:E.add(M.route.id))}),E.size===0)return[];let N=qy(a,p,u.v8_trailingSlashAwareDataRequests,"data");return j&&E.size>0&&N.searchParams.set("_routes",l.filter(M=>E.has(M.route.id)).map(M=>M.route.id).join(",")),[N.pathname+N.search]},[p,u.v8_trailingSlashAwareDataRequests,g,i,d,x,l,a,h]),w=m.useMemo(()=>w2(y,d),[y,d]),C=A2(y);return m.createElement(m.Fragment,null,S.map(E=>m.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...o})),w.map(E=>m.createElement("link",{key:E,rel:"modulepreload",href:E,...o})),C.map(({key:E,link:j})=>m.createElement("link",{key:E,nonce:o.nonce,...j,crossOrigin:j.crossOrigin??o.crossOrigin})))}function _2(...a){return l=>{a.forEach(o=>{typeof o=="function"?o(l):o!=null&&(o.current=l)})}}var O2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{O2&&(window.__reactRouterVersion="7.18.2")}catch{}function k2({basename:a,children:l,useTransitions:o,window:i}){let u=m.useRef();u.current==null&&(u.current=hj({window:i,v5Compat:!0}));let d=u.current,[h,p]=m.useState({action:d.action,location:d.location}),g=m.useCallback(v=>{o===!1?p(v):m.startTransition(()=>p(v))},[o]);return m.useLayoutEffect(()=>d.listen(g),[d,g]),m.createElement(c2,{basename:a,children:l,location:h.location,navigationType:h.action,navigator:d,useTransitions:o})}var ur=m.forwardRef(function({onClick:l,discover:o="render",prefetch:i="none",relative:u,reloadDocument:d,replace:h,mask:p,state:g,target:v,to:x,preventScrollReset:y,viewTransition:S,defaultShouldRevalidate:w,...C},E){let{basename:j,navigator:N,useTransitions:M}=m.useContext(Tn),T=typeof x=="string"&&yh.test(x),_=My(x,j);x=_.to;let O=Xj(x,{relative:u}),A=dn(),H=null;if(p){let oe=Nc(p,[],A.mask?A.mask.pathname:"/",!0);j!=="/"&&(oe.pathname=oe.pathname==="/"?j:la([j,oe.pathname])),H=N.createHref(oe)}let[z,K,se]=N2(i,C),X=U2(x,{replace:h,mask:p,state:g,target:v,preventScrollReset:y,relative:u,viewTransition:S,defaultShouldRevalidate:w,useTransitions:M});function I(oe){l&&l(oe),oe.defaultPrevented||X(oe)}let re=!(_.isExternal||d),ee=m.createElement("a",{...C,...se,href:(re?H:void 0)||_.absoluteURL||O,onClick:re?I:l,ref:_2(E,K),target:v,"data-discover":!T&&o==="render"?"true":void 0});return z&&!T?m.createElement(m.Fragment,null,ee,m.createElement(T2,{page:O})):ee});ur.displayName="Link";var Iy=m.forwardRef(function({"aria-current":l="page",caseSensitive:o=!1,className:i="",end:u=!1,style:d,to:h,viewTransition:p,children:g,...v},x){let y=_o(h,{relative:v.relative}),S=dn(),w=m.useContext(Tc),{navigator:C,basename:E}=m.useContext(Tn),j=w!=null&&V2(y)&&p===!0,N=C.encodeLocation?C.encodeLocation(y).pathname:y.pathname,M=S.pathname,T=w&&w.navigation&&w.navigation.location?w.navigation.location.pathname:null;o||(M=M.toLowerCase(),T=T?T.toLowerCase():null,N=N.toLowerCase()),T&&E&&(T=Za(T,E)||T);const _=N!=="/"&&N.endsWith("/")?N.length-1:N.length;let O=M===N||!u&&M.startsWith(N)&&M.charAt(_)==="/",A=T!=null&&(T===N||!u&&T.startsWith(N)&&T.charAt(N.length)==="/"),H={isActive:O,isPending:A,isTransitioning:j},z=O?l:void 0,K;typeof i=="function"?K=i(H):K=[i,O?"active":null,A?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let se=typeof d=="function"?d(H):d;return m.createElement(ur,{...v,"aria-current":z,className:K,ref:x,style:se,to:h,viewTransition:p},typeof g=="function"?g(H):g)});Iy.displayName="NavLink";var z2=m.forwardRef(({discover:a="render",fetcherKey:l,navigate:o,reloadDocument:i,replace:u,state:d,method:h=mc,action:p,onSubmit:g,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:S,...w},C)=>{let{useTransitions:E}=m.useContext(Tn),j=q2(),N=I2(p,{relative:v}),M=h.toLowerCase()==="get"?"get":"post",T=typeof p=="string"&&yh.test(p),_=O=>{if(g&&g(O),O.defaultPrevented)return;O.preventDefault();let A=O.nativeEvent.submitter,H=(A==null?void 0:A.getAttribute("formmethod"))||h,z=()=>j(A||O.currentTarget,{fetcherKey:l,method:H,navigate:o,replace:u,state:d,relative:v,preventScrollReset:x,viewTransition:y,defaultShouldRevalidate:S});E&&o!==!1?m.startTransition(()=>z()):z()};return m.createElement("form",{ref:C,method:M,action:N,onSubmit:i?g:_,...w,"data-discover":!T&&a==="render"?"true":void 0})});z2.displayName="Form";function L2(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Vy(a){let l=m.useContext(xs);return ht(l,L2(a)),l}function U2(a,{target:l,replace:o,mask:i,state:u,preventScrollReset:d,relative:h,viewTransition:p,defaultShouldRevalidate:g,useTransitions:v}={}){let x=Do(),y=dn(),S=_o(a,{relative:h});return m.useCallback(w=>{if(m2(w,l)){w.preventDefault();let C=o!==void 0?o:Co(y)===Co(S),E=()=>x(a,{replace:C,mask:i,state:u,preventScrollReset:d,relative:h,viewTransition:p,defaultShouldRevalidate:g});v?m.startTransition(()=>E()):E()}},[y,x,S,o,i,u,l,a,d,h,p,g,v])}function B2(a){Yn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let l=m.useRef(Vf(a)),o=m.useRef(!1),i=dn(),u=m.useMemo(()=>p2(i.search,o.current?null:l.current),[i.search]),d=Do(),h=m.useCallback((p,g)=>{const v=Vf(typeof p=="function"?p(new URLSearchParams(u)):p);o.current=!0,d("?"+v,g)},[d,u]);return[u,h]}var H2=0,P2=()=>`__${String(++H2)}__`;function q2(){let{router:a}=Vy("useSubmit"),{basename:l}=m.useContext(Tn),o=r2(),i=a.fetch,u=a.navigate;return m.useCallback(async(d,h={})=>{let{action:p,method:g,encType:v,formData:x,body:y}=x2(d,l);if(h.navigate===!1){let S=h.fetcherKey||P2();await i(S,o,h.action||p,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:x,body:y,formMethod:h.method||g,formEncType:h.encType||v,flushSync:h.flushSync})}else await u(h.action||p,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:x,body:y,formMethod:h.method||g,formEncType:h.encType||v,replace:h.replace,state:h.state,fromRouteId:o,flushSync:h.flushSync,viewTransition:h.viewTransition})},[i,u,l,o])}function I2(a,{relative:l}={}){let{basename:o}=m.useContext(Tn),i=m.useContext(Sa);ht(i,"useFormAction must be used inside a RouteContext");let[u]=i.matches.slice(-1),d={..._o(a||".",{relative:l})},h=dn();if(a==null){d.search=h.search;let p=new URLSearchParams(d.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();d.search=x?`?${x}`:""}}return(!a||a===".")&&u.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(d.pathname=d.pathname==="/"?o:la([o,d.pathname])),Co(d)}function V2(a,{relative:l}={}){let o=m.useContext(Oy);ht(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=Vy("useViewTransitionState"),u=_o(a,{relative:l});if(!o.isTransitioning)return!1;let d=Za(o.currentLocation.pathname,i)||o.currentLocation.pathname,h=Za(o.nextLocation.pathname,i)||o.nextLocation.pathname;return bc(u.pathname,h)!=null||bc(u.pathname,d)!=null}var bs=Sy();const G2=vh(bs),Y2="";class $2 extends Error{constructor(l,o,i){var u;super(typeof i=="object"&&i&&"error"in i?String(((u=i.error)==null?void 0:u.message)??i):"Request failed"),this.status=l,this.type=o,this.body=i}}async function bo(a,l,o,i){var g;const u=o!==void 0,d=await fetch(`${Y2}${l}`,{method:a,headers:{...u?{"content-type":"application/json"}:{},...(i==null?void 0:i.headers)??{}},body:u?JSON.stringify(o):void 0,credentials:"include",...i}),h=await d.text();let p;try{p=h?JSON.parse(h):void 0}catch{p=h}if(!d.ok)throw new $2(d.status,typeof p=="object"&&p&&"error"in p?String(((g=p.error)==null?void 0:g.type)??"error"):"error",p);return p}const we={get:(a,l)=>bo("GET",a,void 0,l),post:(a,l,o)=>bo("POST",a,l,o),patch:(a,l,o)=>bo("PATCH",a,l,o),put:(a,l,o)=>bo("PUT",a,l,o),del:a=>bo("DELETE",a)},Gy=m.createContext(void 0);function K2({children:a}){const[l,o]=m.useState(null),[i,u]=m.useState(!0),d=m.useCallback(async()=>{try{const g=await we.get("/api/admin/me");o(g)}catch{o(null)}finally{u(!1)}},[]);m.useEffect(()=>{d()},[d]);const h=m.useCallback(async(g,v,x,y)=>{const S={username:g,password:v};x&&(S.totp=x),y&&(S.recoveryCode=y);try{const w=await we.post("/api/admin/login",S);return o({id:"admin",username:w.username,totpEnabled:w.totpEnabled}),{totpRequired:!1}}catch(w){const C=w.status,E=w.type;if(C===401&&E==="totp_required")return{totpRequired:!0};throw w}},[]),p=m.useCallback(async()=>{await we.post("/api/admin/logout"),o(null)},[]);return s.jsx(Gy.Provider,{value:{user:l,loading:i,login:h,logout:p,refresh:d},children:a})}function Nh(){const a=m.useContext(Gy);if(!a)throw new Error("useAuth must be inside AuthProvider");return a}/**
|
|
61
|
+
* @license lucide-react v0.469.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const X2=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yy=(...a)=>a.filter((l,o,i)=>!!l&&l.trim()!==""&&i.indexOf(l)===o).join(" ").trim();/**
|
|
66
|
+
* @license lucide-react v0.469.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/var F2={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 Q2=m.forwardRef(({color:a="currentColor",size:l=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:u="",children:d,iconNode:h,...p},g)=>m.createElement("svg",{ref:g,...F2,width:l,height:l,stroke:a,strokeWidth:i?Number(o)*24/Number(l):o,className:Yy("lucide",u),...p},[...h.map(([v,x])=>m.createElement(v,x)),...Array.isArray(d)?d:[d]]));/**
|
|
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 ze=(a,l)=>{const o=m.forwardRef(({className:i,...u},d)=>m.createElement(Q2,{ref:d,iconNode:l,className:Yy(`lucide-${X2(a)}`,i),...u}));return o.displayName=`${a}`,o};/**
|
|
81
|
+
* @license lucide-react v0.469.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const $y=ze("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 Z2=ze("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 J2=ze("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 W2=ze("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 Ky=ze("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 eC=ze("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 tC=ze("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"}]]);/**
|
|
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 Dc=ze("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
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 nC=ze("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"}]]);/**
|
|
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 aC=ze("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
|
|
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 lC=ze("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"}]]);/**
|
|
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 rC=ze("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"}]]);/**
|
|
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 Ef=ze("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"}]]);/**
|
|
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 sC=ze("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"}]]);/**
|
|
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 oC=ze("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"}]]);/**
|
|
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 Xy=ze("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"}]]);/**
|
|
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 iC=ze("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"}]]);/**
|
|
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 cC=ze("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"}]]);/**
|
|
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 uC=ze("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"}]]);/**
|
|
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 Fy=ze("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
|
|
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 Qy=ze("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"}]]);/**
|
|
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 Zy=ze("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"}]]);/**
|
|
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 jo=ze("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
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 dC=ze("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"}]]);/**
|
|
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 fC=ze("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"}]]);/**
|
|
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 hC=ze("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
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 Jy=ze("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"}]]);/**
|
|
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 mC=ze("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"}]]);/**
|
|
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 pC=ze("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
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 Oo=ze("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
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 gC=ze("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"}]]);/**
|
|
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 vC=ze("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"}]]);/**
|
|
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 Wy=ze("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
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 xC=ze("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"}]]);/**
|
|
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 yC=ze("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"}]]);/**
|
|
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 bC=ze("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"}]]);/**
|
|
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 _c=ze("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"}]]);/**
|
|
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 SC=ze("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"}]]);/**
|
|
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 wC=ze("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"}]]);/**
|
|
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 Oc=ze("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
|
|
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 jC=ze("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 e0(a){var l,o,i="";if(typeof a=="string"||typeof a=="number")i+=a;else if(typeof a=="object")if(Array.isArray(a)){var u=a.length;for(l=0;l<u;l++)a[l]&&(o=e0(a[l]))&&(i&&(i+=" "),i+=o)}else for(o in a)a[o]&&(i&&(i+=" "),i+=o);return i}function t0(){for(var a,l,o=0,i="",u=arguments.length;o<u;o++)(a=arguments[o])&&(l=e0(a))&&(i&&(i+=" "),i+=l);return i}const Th="-",CC=a=>{const l=RC(a),{conflictingClassGroups:o,conflictingClassGroupModifiers:i}=a;return{getClassGroupId:h=>{const p=h.split(Th);return p[0]===""&&p.length!==1&&p.shift(),n0(p,l)||EC(h)},getConflictingClassGroupIds:(h,p)=>{const g=o[h]||[];return p&&i[h]?[...g,...i[h]]:g}}},n0=(a,l)=>{var h;if(a.length===0)return l.classGroupId;const o=a[0],i=l.nextPart.get(o),u=i?n0(a.slice(1),i):void 0;if(u)return u;if(l.validators.length===0)return;const d=a.join(Th);return(h=l.validators.find(({validator:p})=>p(d)))==null?void 0:h.classGroupId},Bx=/^\[(.+)\]$/,EC=a=>{if(Bx.test(a)){const l=Bx.exec(a)[1],o=l==null?void 0:l.substring(0,l.indexOf(":"));if(o)return"arbitrary.."+o}},RC=a=>{const{theme:l,prefix:o}=a,i={nextPart:new Map,validators:[]};return TC(Object.entries(a.classGroups),o).forEach(([d,h])=>{Gf(h,i,d,l)}),i},Gf=(a,l,o,i)=>{a.forEach(u=>{if(typeof u=="string"){const d=u===""?l:Hx(l,u);d.classGroupId=o;return}if(typeof u=="function"){if(NC(u)){Gf(u(i),l,o,i);return}l.validators.push({validator:u,classGroupId:o});return}Object.entries(u).forEach(([d,h])=>{Gf(h,Hx(l,d),o,i)})})},Hx=(a,l)=>{let o=a;return l.split(Th).forEach(i=>{o.nextPart.has(i)||o.nextPart.set(i,{nextPart:new Map,validators:[]}),o=o.nextPart.get(i)}),o},NC=a=>a.isThemeGetter,TC=(a,l)=>l?a.map(([o,i])=>{const u=i.map(d=>typeof d=="string"?l+d:typeof d=="object"?Object.fromEntries(Object.entries(d).map(([h,p])=>[l+h,p])):d);return[o,u]}):a,AC=a=>{if(a<1)return{get:()=>{},set:()=>{}};let l=0,o=new Map,i=new Map;const u=(d,h)=>{o.set(d,h),l++,l>a&&(l=0,i=o,o=new Map)};return{get(d){let h=o.get(d);if(h!==void 0)return h;if((h=i.get(d))!==void 0)return u(d,h),h},set(d,h){o.has(d)?o.set(d,h):u(d,h)}}},a0="!",MC=a=>{const{separator:l,experimentalParseClassName:o}=a,i=l.length===1,u=l[0],d=l.length,h=p=>{const g=[];let v=0,x=0,y;for(let j=0;j<p.length;j++){let N=p[j];if(v===0){if(N===u&&(i||p.slice(j,j+d)===l)){g.push(p.slice(x,j)),x=j+d;continue}if(N==="/"){y=j;continue}}N==="["?v++:N==="]"&&v--}const S=g.length===0?p:p.substring(x),w=S.startsWith(a0),C=w?S.substring(1):S,E=y&&y>x?y-x:void 0;return{modifiers:g,hasImportantModifier:w,baseClassName:C,maybePostfixModifierPosition:E}};return o?p=>o({className:p,parseClassName:h}):h},DC=a=>{if(a.length<=1)return a;const l=[];let o=[];return a.forEach(i=>{i[0]==="["?(l.push(...o.sort(),i),o=[]):o.push(i)}),l.push(...o.sort()),l},_C=a=>({cache:AC(a.cacheSize),parseClassName:MC(a),...CC(a)}),OC=/\s+/,kC=(a,l)=>{const{parseClassName:o,getClassGroupId:i,getConflictingClassGroupIds:u}=l,d=[],h=a.trim().split(OC);let p="";for(let g=h.length-1;g>=0;g-=1){const v=h[g],{modifiers:x,hasImportantModifier:y,baseClassName:S,maybePostfixModifierPosition:w}=o(v);let C=!!w,E=i(C?S.substring(0,w):S);if(!E){if(!C){p=v+(p.length>0?" "+p:p);continue}if(E=i(S),!E){p=v+(p.length>0?" "+p:p);continue}C=!1}const j=DC(x).join(":"),N=y?j+a0:j,M=N+E;if(d.includes(M))continue;d.push(M);const T=u(E,C);for(let _=0;_<T.length;++_){const O=T[_];d.push(N+O)}p=v+(p.length>0?" "+p:p)}return p};function zC(){let a=0,l,o,i="";for(;a<arguments.length;)(l=arguments[a++])&&(o=l0(l))&&(i&&(i+=" "),i+=o);return i}const l0=a=>{if(typeof a=="string")return a;let l,o="";for(let i=0;i<a.length;i++)a[i]&&(l=l0(a[i]))&&(o&&(o+=" "),o+=l);return o};function LC(a,...l){let o,i,u,d=h;function h(g){const v=l.reduce((x,y)=>y(x),a());return o=_C(v),i=o.cache.get,u=o.cache.set,d=p,p(g)}function p(g){const v=i(g);if(v)return v;const x=kC(g,o);return u(g,x),x}return function(){return d(zC.apply(null,arguments))}}const dt=a=>{const l=o=>o[a]||[];return l.isThemeGetter=!0,l},r0=/^\[(?:([a-z-]+):)?(.+)\]$/i,UC=/^\d+\/\d+$/,BC=new Set(["px","full","screen"]),HC=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,PC=/\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$/,qC=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,IC=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,VC=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ya=a=>fs(a)||BC.has(a)||UC.test(a),Dl=a=>Ss(a,"length",ZC),fs=a=>!!a&&!Number.isNaN(Number(a)),Rf=a=>Ss(a,"number",fs),So=a=>!!a&&Number.isInteger(Number(a)),GC=a=>a.endsWith("%")&&fs(a.slice(0,-1)),ke=a=>r0.test(a),_l=a=>HC.test(a),YC=new Set(["length","size","percentage"]),$C=a=>Ss(a,YC,s0),KC=a=>Ss(a,"position",s0),XC=new Set(["image","url"]),FC=a=>Ss(a,XC,WC),QC=a=>Ss(a,"",JC),wo=()=>!0,Ss=(a,l,o)=>{const i=r0.exec(a);return i?i[1]?typeof l=="string"?i[1]===l:l.has(i[1]):o(i[2]):!1},ZC=a=>PC.test(a)&&!qC.test(a),s0=()=>!1,JC=a=>IC.test(a),WC=a=>VC.test(a),eE=()=>{const a=dt("colors"),l=dt("spacing"),o=dt("blur"),i=dt("brightness"),u=dt("borderColor"),d=dt("borderRadius"),h=dt("borderSpacing"),p=dt("borderWidth"),g=dt("contrast"),v=dt("grayscale"),x=dt("hueRotate"),y=dt("invert"),S=dt("gap"),w=dt("gradientColorStops"),C=dt("gradientColorStopPositions"),E=dt("inset"),j=dt("margin"),N=dt("opacity"),M=dt("padding"),T=dt("saturate"),_=dt("scale"),O=dt("sepia"),A=dt("skew"),H=dt("space"),z=dt("translate"),K=()=>["auto","contain","none"],se=()=>["auto","hidden","clip","visible","scroll"],X=()=>["auto",ke,l],I=()=>[ke,l],re=()=>["",Ya,Dl],ee=()=>["auto",fs,ke],oe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["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"],le=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",ke],Z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[fs,ke];return{cacheSize:500,separator:":",theme:{colors:[wo],spacing:[Ya,Dl],blur:["none","",_l,ke],brightness:D(),borderColor:[a],borderRadius:["none","","full",_l,ke],borderSpacing:I(),borderWidth:re(),contrast:D(),grayscale:B(),hueRotate:D(),invert:B(),gap:I(),gradientColorStops:[a],gradientColorStopPositions:[GC,Dl],inset:X(),margin:X(),opacity:D(),padding:I(),saturate:D(),scale:D(),sepia:B(),skew:D(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",ke]}],container:["container"],columns:[{columns:[_l]}],"break-after":[{"break-after":Z()}],"break-before":[{"break-before":Z()}],"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:[...oe(),ke]}],overflow:[{overflow:se()}],"overflow-x":[{"overflow-x":se()}],"overflow-y":[{"overflow-y":se()}],overscroll:[{overscroll:K()}],"overscroll-x":[{"overscroll-x":K()}],"overscroll-y":[{"overscroll-y":K()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[E]}],"inset-x":[{"inset-x":[E]}],"inset-y":[{"inset-y":[E]}],start:[{start:[E]}],end:[{end:[E]}],top:[{top:[E]}],right:[{right:[E]}],bottom:[{bottom:[E]}],left:[{left:[E]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",So,ke]}],basis:[{basis:X()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ke]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",So,ke]}],"grid-cols":[{"grid-cols":[wo]}],"col-start-end":[{col:["auto",{span:["full",So,ke]},ke]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[wo]}],"row-start-end":[{row:["auto",{span:[So,ke]},ke]}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ke]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ke]}],gap:[{gap:[S]}],"gap-x":[{"gap-x":[S]}],"gap-y":[{"gap-y":[S]}],"justify-content":[{justify:["normal",...le()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...le(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...le(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[M]}],px:[{px:[M]}],py:[{py:[M]}],ps:[{ps:[M]}],pe:[{pe:[M]}],pt:[{pt:[M]}],pr:[{pr:[M]}],pb:[{pb:[M]}],pl:[{pl:[M]}],m:[{m:[j]}],mx:[{mx:[j]}],my:[{my:[j]}],ms:[{ms:[j]}],me:[{me:[j]}],mt:[{mt:[j]}],mr:[{mr:[j]}],mb:[{mb:[j]}],ml:[{ml:[j]}],"space-x":[{"space-x":[H]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[H]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ke,l]}],"min-w":[{"min-w":[ke,l,"min","max","fit"]}],"max-w":[{"max-w":[ke,l,"none","full","min","max","fit","prose",{screen:[_l]},_l]}],h:[{h:[ke,l,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ke,l,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ke,l,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ke,l,"auto","min","max","fit"]}],"font-size":[{text:["base",_l,Dl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Rf]}],"font-family":[{font:[wo]}],"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",ke]}],"line-clamp":[{"line-clamp":["none",fs,Rf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ya,ke]}],"list-image":[{"list-image":["none",ke]}],"list-style-type":[{list:["none","disc","decimal",ke]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[a]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[a]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ya,Dl]}],"underline-offset":[{"underline-offset":["auto",Ya,ke]}],"text-decoration-color":[{decoration:[a]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ke]}],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",ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...oe(),KC]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",$C]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},FC]}],"bg-color":[{bg:[a]}],"gradient-from-pos":[{from:[C]}],"gradient-via-pos":[{via:[C]}],"gradient-to-pos":[{to:[C]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[d]}],"rounded-s":[{"rounded-s":[d]}],"rounded-e":[{"rounded-e":[d]}],"rounded-t":[{"rounded-t":[d]}],"rounded-r":[{"rounded-r":[d]}],"rounded-b":[{"rounded-b":[d]}],"rounded-l":[{"rounded-l":[d]}],"rounded-ss":[{"rounded-ss":[d]}],"rounded-se":[{"rounded-se":[d]}],"rounded-ee":[{"rounded-ee":[d]}],"rounded-es":[{"rounded-es":[d]}],"rounded-tl":[{"rounded-tl":[d]}],"rounded-tr":[{"rounded-tr":[d]}],"rounded-br":[{"rounded-br":[d]}],"rounded-bl":[{"rounded-bl":[d]}],"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":[N]}],"border-style":[{border:[...U(),"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":[N]}],"divide-style":[{divide:U()}],"border-color":[{border:[u]}],"border-color-x":[{"border-x":[u]}],"border-color-y":[{"border-y":[u]}],"border-color-s":[{"border-s":[u]}],"border-color-e":[{"border-e":[u]}],"border-color-t":[{"border-t":[u]}],"border-color-r":[{"border-r":[u]}],"border-color-b":[{"border-b":[u]}],"border-color-l":[{"border-l":[u]}],"divide-color":[{divide:[u]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[Ya,ke]}],"outline-w":[{outline:[Ya,Dl]}],"outline-color":[{outline:[a]}],"ring-w":[{ring:re()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[a]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[Ya,Dl]}],"ring-offset-color":[{"ring-offset":[a]}],shadow:[{shadow:["","inner","none",_l,QC]}],"shadow-color":[{shadow:[wo]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[o]}],brightness:[{brightness:[i]}],contrast:[{contrast:[g]}],"drop-shadow":[{"drop-shadow":["","none",_l,ke]}],grayscale:[{grayscale:[v]}],"hue-rotate":[{"hue-rotate":[x]}],invert:[{invert:[y]}],saturate:[{saturate:[T]}],sepia:[{sepia:[O]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[o]}],"backdrop-brightness":[{"backdrop-brightness":[i]}],"backdrop-contrast":[{"backdrop-contrast":[g]}],"backdrop-grayscale":[{"backdrop-grayscale":[v]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[x]}],"backdrop-invert":[{"backdrop-invert":[y]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[T]}],"backdrop-sepia":[{"backdrop-sepia":[O]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[h]}],"border-spacing-x":[{"border-spacing-x":[h]}],"border-spacing-y":[{"border-spacing-y":[h]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ke]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",ke]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",ke]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[So,ke]}],"translate-x":[{"translate-x":[z]}],"translate-y":[{"translate-y":[z]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ke]}],accent:[{accent:["auto",a]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ke]}],"caret-color":[{caret:[a]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ke]}],fill:[{fill:[a,"none"]}],"stroke-w":[{stroke:[Ya,Dl,Rf]}],stroke:[{stroke:[a,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},tE=LC(eE);function Re(...a){return tE(t0(a))}function Mt(a,l="—"){return a==null||Number.isNaN(a)?l:a.toLocaleString()}function kc(a,l=1,o="—"){return a==null||Number.isNaN(a)?o:`${(a*100).toFixed(l)}%`}function dr(a){return a?a<1e3?`${Math.round(a)} ms`:`${(a/1e3).toFixed(2)} s`:"—"}function Ah(a){if(!a)return"—";try{return new Date(a).toLocaleString()}catch{return a}}function nE(a,l=8){return a?a.length>l?`${a.slice(0,l)}…`:a:"—"}function aE(a){if(!a)return"—";const l=Date.now()-new Date(a).getTime();if(!Number.isFinite(l)||l<0)return"—";const o=Math.floor(l/1e3);if(o<60)return`${o}s ago`;const i=Math.floor(o/60);if(i<60)return`${i}m ago`;const u=Math.floor(i/60);return u<24?`${u}h ago`:`${Math.floor(u/24)}d ago`}const lE=[{to:"/",label:"Dashboard",icon:Fy,end:!0},{to:"/providers",label:"Providers",icon:Jy},{to:"/models",label:"Models",icon:W2},{to:"/combos",label:"Combos",icon:Zy},{to:"/aliases",label:"Aliases",icon:lC},{to:"/api-keys",label:"API Keys",icon:Qy},{to:"/requests",label:"Requests",icon:$y},{to:"/statistics",label:"Statistics",icon:cC},{to:"/audit",label:"Audit Logs",icon:vC},{to:"/settings",label:"Settings",icon:rC}];function rE(){const[a,l]=m.useState(null);return m.useEffect(()=>{let o=!1;return fetch("/api/admin/settings/system",{credentials:"include"}).then(i=>i.ok?i.json():null).then(i=>{!o&&(i!=null&&i.appVersion)&&l(i.appVersion)}).catch(()=>{}),()=>{o=!0}},[]),s.jsxs("aside",{className:"hidden w-60 shrink-0 border-r bg-sidebar text-sidebar-foreground md:flex md:flex-col",children:[s.jsxs("div",{className:"flex h-14 items-center gap-2 border-b px-4",children:[s.jsx("img",{src:"/logo.png",alt:"LateDev Router",className:"h-7 w-7 object-contain"}),s.jsx("div",{className:"font-semibold tracking-tight",children:"LateDev Router"})]}),s.jsx("nav",{className:"flex-1 space-y-0.5 p-2",children:lE.map(o=>s.jsxs(Iy,{to:o.to,end:o.end,className:({isActive:i})=>Re("flex items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors",i?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[s.jsx(o.icon,{className:"h-4 w-4"}),o.label]},o.to))}),s.jsxs("div",{className:"border-t p-3 text-xs text-muted-foreground flex items-center gap-2",children:[s.jsx(xC,{className:"h-3.5 w-3.5 text-primary"})," ",a?`v${a}`:"v…"]})]})}var sE=Object.defineProperty,Mh=(a,l)=>sE(a,"name",{value:l,configurable:!0});function Yf(a,l){if(typeof a=="function")return a(l);a!=null&&(a.current=l)}Mh(Yf,"setRef");function o0(...a){return l=>{let o=!1;const i=a.map(u=>{const d=Yf(u,l);return!o&&typeof d=="function"&&(o=!0),d});if(o)return()=>{for(let u=0;u<i.length;u++){const d=i[u];typeof d=="function"?d():Yf(a[u],null)}}}}Mh(o0,"composeRefs");function Ie(...a){return m.useCallback(o0(...a),a)}Mh(Ie,"useComposedRefs");var oE=Object.defineProperty,ra=(a,l)=>oE(a,"name",{value:l,configurable:!0});function va(a){const l=m.forwardRef((o,i)=>{let{children:u,...d}=o,h=null,p=!1;const g=[];$f(u)&&typeof tc=="function"&&(u=tc(u._payload)),m.Children.forEach(u,S=>{var w;if(f0(S)){p=!0;const C=S;let E="child"in C.props?C.props.child:C.props.children;$f(E)&&typeof tc=="function"&&(E=tc(E._payload)),h=cE(C,E),g.push((w=h==null?void 0:h.props)==null?void 0:w.children)}else g.push(S)}),h?h=m.cloneElement(h,void 0,g):!p&&m.Children.count(u)===1&&m.isValidElement(u)&&(h=u);const v=h?d0(h):void 0,x=Ie(i,v);if(!h){if(u||u===0)throw new Error(p?fE(a):dE(a));return u}const y=u0(d,h.props??{});return h.type!==m.Fragment&&(y.ref=i?x:v),m.cloneElement(h,y)});return l.displayName=`${a}.Slot`,l}ra(va,"createSlot");var iE=va("Slot"),i0=Symbol.for("radix.slottable");function c0(a){const l=ra(o=>"child"in o?o.children(o.child):o.children,"Slottable");return l.displayName=`${a}.Slottable`,l.__radixId=i0,l}ra(c0,"createSlottable");var cE=ra((a,l)=>{if("child"in a.props){const o=a.props.child;return m.isValidElement(o)?m.cloneElement(o,void 0,a.props.children(o.props.children)):null}return m.isValidElement(l)?l:null},"getSlottableElementFromSlottable");function u0(a,l){const o={...l};for(const i in l){const u=a[i],d=l[i];/^on[A-Z]/.test(i)?u&&d?o[i]=(...p)=>{const g=d(...p);return u(...p),g}:u&&(o[i]=u):i==="style"?o[i]={...u,...d}:i==="className"&&(o[i]=[u,d].filter(Boolean).join(" "))}return{...a,...o}}ra(u0,"mergeProps");function d0(a){var i,u;let l=(i=Object.getOwnPropertyDescriptor(a.props,"ref"))==null?void 0:i.get,o=l&&"isReactWarning"in l&&l.isReactWarning;return o?a.ref:(l=(u=Object.getOwnPropertyDescriptor(a,"ref"))==null?void 0:u.get,o=l&&"isReactWarning"in l&&l.isReactWarning,o?a.props.ref:a.props.ref||a.ref)}ra(d0,"getElementRef");function f0(a){return m.isValidElement(a)&&typeof a.type=="function"&&"__radixId"in a.type&&a.type.__radixId===i0}ra(f0,"isSlottable");var uE=Symbol.for("react.lazy");function $f(a){return a!=null&&typeof a=="object"&&"$$typeof"in a&&a.$$typeof===uE&&"_payload"in a&&h0(a._payload)}ra($f,"isLazyComponent");function h0(a){return typeof a=="object"&&a!==null&&"then"in a}ra(h0,"isPromiseLike");var dE=ra(a=>`${a} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),fE=ra(a=>`${a} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),tc=gs[" use ".trim().toString()];const Px=a=>typeof a=="boolean"?`${a}`:a===0?"0":a,qx=t0,m0=(a,l)=>o=>{var i;if((l==null?void 0:l.variants)==null)return qx(a,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:u,defaultVariants:d}=l,h=Object.keys(u).map(v=>{const x=o==null?void 0:o[v],y=d==null?void 0:d[v];if(x===null)return null;const S=Px(x)||Px(y);return u[v][S]}),p=o&&Object.entries(o).reduce((v,x)=>{let[y,S]=x;return S===void 0||(v[y]=S),v},{}),g=l==null||(i=l.compoundVariants)===null||i===void 0?void 0:i.reduce((v,x)=>{let{class:y,className:S,...w}=x;return Object.entries(w).every(C=>{let[E,j]=C;return Array.isArray(j)?j.includes({...d,...p}[E]):{...d,...p}[E]===j})?[...v,y,S]:v},[]);return qx(a,h,g,o==null?void 0:o.class,o==null?void 0:o.className)},hE=m0("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-6",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),he=m.forwardRef(({className:a,variant:l,size:o,asChild:i=!1,...u},d)=>{const h=i?iE:"button";return s.jsx(h,{className:Re(hE({variant:l,size:o,className:a})),ref:d,...u})});he.displayName="Button";const p0=m.createContext(void 0);function mE({children:a,defaultTheme:l="system",storageKey:o="latedev-theme"}){const[i,u]=m.useState(()=>localStorage.getItem(o)||l);m.useEffect(()=>{const h=window.document.documentElement;if(h.classList.remove("light","dark"),i==="system"){const p=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";h.classList.add(p);return}h.classList.add(i)},[i]);const d={theme:i,setTheme:h=>{localStorage.setItem(o,h),u(h)}};return s.jsx(p0.Provider,{value:d,children:a})}function pE(){const a=m.useContext(p0);if(!a)throw new Error("useTheme must be used within ThemeProvider");return a}var gE=Object.defineProperty,ws=(a,l)=>gE(a,"name",{value:l,configurable:!0}),g0=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ee(a,l,{checkForDefaultPrevented:o=!0}={}){return ws(function(u){if(a==null||a(u),o===!1||!u||!u.defaultPrevented)return l==null?void 0:l(u)},"handleEvent")}ws(Ee,"composeEventHandlers");function vE(a){var l;if(!g0)throw new Error("Cannot access window outside of the DOM");return((l=a==null?void 0:a.ownerDocument)==null?void 0:l.defaultView)??window}ws(vE,"getOwnerWindow");function Kf(a){if(!g0)throw new Error("Cannot access document outside of the DOM");return(a==null?void 0:a.ownerDocument)??document}ws(Kf,"getOwnerDocument");function v0(a,l=!1){const{activeElement:o}=Kf(a);if(!(o!=null&&o.nodeName))return null;if(x0(o)&&o.contentDocument)return v0(o.contentDocument.body,l);if(l){const i=o.getAttribute("aria-activedescendant");if(i){const u=Kf(o).getElementById(i);if(u)return u}}return o}ws(v0,"getActiveElement");function x0(a){return a.tagName==="IFRAME"}ws(x0,"isFrame");var xE=Object.defineProperty,Pn=(a,l)=>xE(a,"name",{value:l,configurable:!0});function yE(a,l){const o=m.createContext(l);o.displayName=a+"Context";const i=Pn(d=>{const{children:h,...p}=d,g=m.useMemo(()=>p,Object.values(p));return s.jsx(o.Provider,{value:g,children:h})},"Provider");i.displayName=a+"Provider";function u(d,h={}){const{optional:p=!1}=h,g=m.useContext(o);if(g)return g;if(l!==void 0)return l;if(!p)throw new Error(`\`${d}\` must be used within \`${a}\``)}return Pn(u,"useContext"),[i,u]}Pn(yE,"createContext");function fn(a,l=[]){let o=[];function i(d,h){const p=m.createContext(h);p.displayName=d+"Context";const g=o.length;o=[...o,h];const v=Pn(y=>{var N;const{scope:S,children:w,...C}=y,E=((N=S==null?void 0:S[a])==null?void 0:N[g])||p,j=m.useMemo(()=>C,Object.values(C));return s.jsx(E.Provider,{value:j,children:w})},"Provider");v.displayName=d+"Provider";function x(y,S,w={}){var N;const{optional:C=!1}=w,E=((N=S==null?void 0:S[a])==null?void 0:N[g])||p,j=m.useContext(E);if(j)return j;if(h!==void 0)return h;if(!C)throw new Error(`\`${y}\` must be used within \`${d}\``)}return Pn(x,"useContext"),[v,x]}Pn(i,"createContext");const u=Pn(()=>{const d=o.map(h=>m.createContext(h));return Pn(function(p){const g=(p==null?void 0:p[a])||d;return m.useMemo(()=>({[`__scope${a}`]:{...p,[a]:g}}),[p,g])},"useScope")},"createScope");return u.scopeName=a,[i,y0(u,...l)]}Pn(fn,"createContextScope");function y0(...a){const l=a[0];if(a.length===1)return l;const o=Pn(()=>{const i=a.map(u=>({useScope:u(),scopeName:u.scopeName}));return Pn(function(d){const h=i.reduce((p,{useScope:g,scopeName:v})=>{const y=g(d)[`__scope${v}`];return{...p,...y}},{});return m.useMemo(()=>({[`__scope${l.scopeName}`]:h}),[h])},"useComposedScopes")},"createScope");return o.scopeName=l.scopeName,o}Pn(y0,"composeContextScopes");var Dt=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},bE=Object.defineProperty,SE=(a,l)=>bE(a,"name",{value:l,configurable:!0}),Ix=gs[" useEffectEvent ".trim().toString()],Vx=gs[" useInsertionEffect ".trim().toString()];function b0(a){if(typeof Ix=="function")return Ix(a);const l=m.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Vx=="function"?Vx(()=>{l.current=a}):Dt(()=>{l.current=a}),m.useMemo(()=>((...o)=>{var i;return(i=l.current)==null?void 0:i.call(l,...o)}),[])}SE(b0,"useEffectEvent");var wE=Object.defineProperty,ko=(a,l)=>wE(a,"name",{value:l,configurable:!0}),jE=gs[" useInsertionEffect ".trim().toString()]||Dt;function Ja({prop:a,defaultProp:l,onChange:o=ko(()=>{},"onChange"),caller:i}){const[u,d,h]=S0({defaultProp:l,onChange:o}),p=a!==void 0,g=p?a:u,v=m.useCallback(x=>{var y;if(p){const S=w0(x)?x(a):x;S!==a&&((y=h.current)==null||y.call(h,S))}else d(x)},[p,a,d,h]);return[g,v]}ko(Ja,"useControllableState");function S0({defaultProp:a,onChange:l}){const[o,i]=m.useState(a),u=m.useRef(o),d=m.useRef(l);return jE(()=>{d.current=l},[l]),m.useEffect(()=>{var h;u.current!==o&&((h=d.current)==null||h.call(d,o),u.current=o)},[o,u]),[o,i,d]}ko(S0,"useUncontrolledState");function w0(a){return typeof a=="function"}ko(w0,"isFunction");var Gx=Symbol("RADIX:SYNC_STATE");function CE(a,l,o,i){const{prop:u,defaultProp:d,onChange:h,caller:p}=l,g=u!==void 0,v=b0(h),x=[{...o,state:d}];i&&x.push(i);const[y,S]=m.useReducer((j,N)=>{if(N.type===Gx)return{...j,state:N.state};const M=a(j,N);return g&&!Object.is(M.state,j.state)&&v(M.state),M},...x),w=y.state,C=m.useRef(w);m.useEffect(()=>{C.current!==w&&(C.current=w,g||v(w))},[w,C,g]);const E=m.useMemo(()=>u!==void 0?{...y,state:u}:y,[y,u]);return m.useEffect(()=>{g&&!Object.is(u,y.state)&&S({type:Gx,state:u})},[u,y.state,g]),[E,S]}ko(CE,"useControllableStateReducer");var EE=Object.defineProperty,RE=(a,l)=>EE(a,"name",{value:l,configurable:!0}),NE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Be=NE.reduce((a,l)=>{const o=va(`Primitive.${l}`),i=m.forwardRef((u,d)=>{const{asChild:h,...p}=u,g=h?o:l;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(g,{...p,ref:d})});return i.displayName=`Primitive.${l}`,{...a,[l]:i}},{});function Dh(a,l){a&&bs.flushSync(()=>a.dispatchEvent(l))}RE(Dh,"dispatchDiscreteCustomEvent");var TE=Object.defineProperty,zt=(a,l)=>TE(a,"name",{value:l,configurable:!0});function zc(a){const l=a+"CollectionProvider",[o,i]=fn(l),[u,d]=o(l,{collectionRef:{current:null},itemMap:new Map}),h=zt(E=>{const{scope:j,children:N}=E,M=m.useRef(null),T=m.useRef(new Map).current;return s.jsx(u,{scope:j,itemMap:T,collectionRef:M,children:N})},"CollectionProvider");h.displayName=l;const p=a+"CollectionSlot",g=va(p),v=m.forwardRef((E,j)=>{const{scope:N,children:M}=E,T=d(p,N),_=Ie(j,T.collectionRef);return s.jsx(g,{ref:_,children:M})});v.displayName=p;const x=a+"CollectionItemSlot",y="data-radix-collection-item",S=va(x),w=m.forwardRef((E,j)=>{const{scope:N,children:M,...T}=E,_=m.useRef(null),O=Ie(j,_),A=d(x,N);return m.useEffect(()=>(A.itemMap.set(_,{ref:_,...T}),()=>void A.itemMap.delete(_))),s.jsx(S,{[y]:"",ref:O,children:M})});w.displayName=x;function C(E){const j=d(a+"CollectionConsumer",E);return m.useCallback(()=>{const M=j.collectionRef.current;if(!M)return[];const T=Array.from(M.querySelectorAll(`[${y}]`));return Array.from(j.itemMap.values()).sort((A,H)=>T.indexOf(A.ref.current)-T.indexOf(H.ref.current))},[j.collectionRef,j.itemMap])}return zt(C,"useCollection"),[{Provider:h,Slot:v,ItemSlot:w},C,i]}zt(zc,"createCollection");var Yx=new WeakMap,Tt,wn,Nf=(wn=class extends Map{constructor(o){super(o);bx(this,Tt);pf(this,Tt,[...super.keys()]),Yx.set(this,!0)}set(o,i){return Yx.get(this)&&(this.has(o)?Gt(this,Tt)[Gt(this,Tt).indexOf(o)]=o:Gt(this,Tt).push(o)),super.set(o,i),this}insert(o,i,u){const d=this.has(i),h=Gt(this,Tt).length,p=_h(o);let g=p>=0?p:h+p;const v=g<0||g>=h?-1:g;if(v===this.size||d&&v===this.size-1||v===-1)return this.set(i,u),this;const x=this.size+(d?0:1);p<0&&g++;const y=[...Gt(this,Tt)];let S,w=!1;for(let C=g;C<x;C++)if(g===C){let E=y[C];y[C]===i&&(E=y[C+1]),d&&this.delete(i),S=this.get(E),this.set(i,u)}else{!w&&y[C-1]===i&&(w=!0);const E=y[w?C:C-1],j=S;S=this.get(E),this.delete(E),this.set(E,j)}return this}with(o,i,u){const d=new wn(this);return d.insert(o,i,u),d}before(o){const i=Gt(this,Tt).indexOf(o)-1;if(!(i<0))return this.entryAt(i)}setBefore(o,i,u){const d=Gt(this,Tt).indexOf(o);return d===-1?this:this.insert(d,i,u)}after(o){let i=Gt(this,Tt).indexOf(o);if(i=i===-1||i===this.size-1?-1:i+1,i!==-1)return this.entryAt(i)}setAfter(o,i,u){const d=Gt(this,Tt).indexOf(o);return d===-1?this:this.insert(d+1,i,u)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return pf(this,Tt,[]),super.clear()}delete(o){const i=super.delete(o);return i&&Gt(this,Tt).splice(Gt(this,Tt).indexOf(o),1),i}deleteAt(o){const i=this.keyAt(o);return i!==void 0?this.delete(i):!1}at(o){const i=gc(Gt(this,Tt),o);if(i!==void 0)return this.get(i)}entryAt(o){const i=gc(Gt(this,Tt),o);if(i!==void 0)return[i,this.get(i)]}indexOf(o){return Gt(this,Tt).indexOf(o)}keyAt(o){return gc(Gt(this,Tt),o)}from(o,i){const u=this.indexOf(o);if(u===-1)return;let d=u+i;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.at(d)}keyFrom(o,i){const u=this.indexOf(o);if(u===-1)return;let d=u+i;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.keyAt(d)}find(o,i){let u=0;for(const d of this){if(Reflect.apply(o,i,[d,u,this]))return d;u++}}findIndex(o,i){let u=0;for(const d of this){if(Reflect.apply(o,i,[d,u,this]))return u;u++}return-1}filter(o,i){const u=[];let d=0;for(const h of this)Reflect.apply(o,i,[h,d,this])&&u.push(h),d++;return new wn(u)}map(o,i){const u=[];let d=0;for(const h of this)u.push([h[0],Reflect.apply(o,i,[h,d,this])]),d++;return new wn(u)}reduce(...o){const[i,u]=o;let d=0,h=u??this.at(0);for(const p of this)d===0&&o.length===1?h=p:h=Reflect.apply(i,this,[h,p,d,this]),d++;return h}reduceRight(...o){const[i,u]=o;let d=u??this.at(-1);for(let h=this.size-1;h>=0;h--){const p=this.at(h);h===this.size-1&&o.length===1?d=p:d=Reflect.apply(i,this,[d,p,h,this])}return d}toSorted(o){const i=[...this.entries()].sort(o);return new wn(i)}toReversed(){const o=new wn;for(let i=this.size-1;i>=0;i--){const u=this.keyAt(i),d=this.get(u);o.set(u,d)}return o}toSpliced(...o){const i=[...this.entries()];return i.splice(...o),new wn(i)}slice(o,i){const u=new wn;let d=this.size-1;if(o===void 0)return u;o<0&&(o=o+this.size),i!==void 0&&i>0&&(d=i-1);for(let h=o;h<=d;h++){const p=this.keyAt(h),g=this.get(p);u.set(p,g)}return u}every(o,i){let u=0;for(const d of this){if(!Reflect.apply(o,i,[d,u,this]))return!1;u++}return!0}some(o,i){let u=0;for(const d of this){if(Reflect.apply(o,i,[d,u,this]))return!0;u++}return!1}},Tt=new WeakMap,zt(wn,"OrderedDict"),wn);function gc(a,l){if("at"in Array.prototype)return Array.prototype.at.call(a,l);const o=j0(a,l);return o===-1?void 0:a[o]}zt(gc,"at");function j0(a,l){const o=a.length,i=_h(l),u=i>=0?i:o+i;return u<0||u>=o?-1:u}zt(j0,"toSafeIndex");function _h(a){return a!==a||a===0?0:Math.trunc(a)}zt(_h,"toSafeInteger");function AE(a){const l=a+"CollectionProvider",[o,i]=fn(l),[u,d]=o(l,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Nf,setItemMap:zt(()=>{},"setItemMap")}),h=zt(({state:T,..._})=>T?s.jsx(g,{..._,state:T}):s.jsx(p,{..._}),"CollectionProvider");h.displayName=l;const p=zt(T=>{const _=j();return s.jsx(g,{...T,state:_})},"CollectionInit");p.displayName=l+"Init";const g=zt(T=>{const{scope:_,children:O,state:A}=T,H=m.useRef(null),[z,K]=m.useState(null),se=Ie(H,K),[X,I]=A;return m.useEffect(()=>{if(!z)return;const re=R0(()=>{});return re.observe(z,{childList:!0,subtree:!0}),()=>{re.disconnect()}},[z]),s.jsx(u,{scope:_,itemMap:X,setItemMap:I,collectionRef:se,collectionRefObject:H,collectionElement:z,children:O})},"CollectionProviderImpl");g.displayName=l+"Impl";const v=a+"CollectionSlot",x=va(v),y=m.forwardRef((T,_)=>{const{scope:O,children:A}=T,H=d(v,O),z=Ie(_,H.collectionRef);return s.jsx(x,{ref:z,children:A})});y.displayName=v;const S=a+"CollectionItemSlot",w="data-radix-collection-item",C=va(S),E=m.forwardRef((T,_)=>{const{scope:O,children:A,...H}=T,z=m.useRef(null),[K,se]=m.useState(null),X=Ie(_,z,se),I=d(S,O),{setItemMap:re}=I,ee=m.useRef(H);C0(ee.current,H)||(ee.current=H);const oe=ee.current;return m.useEffect(()=>{const U=oe;return re($=>K?$.has(K)?$.set(K,{...U,element:K}).toSorted(Xf):($.set(K,{...U,element:K}),$.toSorted(Xf)):$),()=>{re($=>!K||!$.has(K)?$:($.delete(K),new Nf($)))}},[K,oe,re]),s.jsx(C,{[w]:"",ref:X,children:A})});E.displayName=S;function j(){return m.useState(new Nf)}zt(j,"useInitCollection");function N(T){const{itemMap:_}=d(a+"CollectionConsumer",T);return _}return zt(N,"useCollection"),[{Provider:h,Slot:y,ItemSlot:E},{createCollectionScope:i,useCollection:N,useInitCollection:j}]}zt(AE,"createCollection");function C0(a,l){if(a===l)return!0;if(typeof a!="object"||typeof l!="object"||a==null||l==null)return!1;const o=Object.keys(a),i=Object.keys(l);if(o.length!==i.length)return!1;for(const u of o)if(!Object.prototype.hasOwnProperty.call(l,u)||a[u]!==l[u])return!1;return!0}zt(C0,"shallowEqual");function E0(a,l){return!!(l.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_PRECEDING)}zt(E0,"isElementPreceding");function Xf(a,l){return!a[1].element||!l[1].element?0:E0(a[1].element,l[1].element)?-1:1}zt(Xf,"sortByDocumentPosition");function R0(a){return new MutationObserver(o=>{for(const i of o)if(i.type==="childList"){a();return}})}zt(R0,"getChildListObserver");var ME=Object.defineProperty,DE=(a,l)=>ME(a,"name",{value:l,configurable:!0}),_E=m.createContext(void 0);function zo(a){const l=m.useContext(_E);return a||l||"ltr"}DE(zo,"useDirection");var OE=Object.defineProperty,kE=(a,l)=>OE(a,"name",{value:l,configurable:!0});function $n(a){const l=m.useRef(a);return m.useEffect(()=>{l.current=a}),m.useMemo(()=>((...o)=>{var i;return(i=l.current)==null?void 0:i.call(l,...o)}),[])}kE($n,"useCallbackRef");var zE=Object.defineProperty,kt=(a,l)=>zE(a,"name",{value:l,configurable:!0}),Ff="dismissableLayer.update",LE="dismissableLayer.pointerDownOutside",UE="dismissableLayer.focusOutside",$x,N0=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Lc=m.forwardRef(kt(function(l,o){const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:u=!1,onEscapeKeyDown:d,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:g,onDismiss:v,...x}=l,y=m.useContext(N0),[S,w]=m.useState(null),C=(S==null?void 0:S.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,E]=m.useState({}),j=Ie(o,w),N=Array.from(y.layers),[M]=[...y.layersWithOutsidePointerEventsDisabled].slice(-1),T=M?N.indexOf(M):-1,_=S?N.indexOf(S):-1,O=y.layersWithOutsidePointerEventsDisabled.size>0,A=_>=T,H=m.useRef(!1),z=A0(I=>{h==null||h(I),g==null||g(I),I.defaultPrevented||v==null||v()},{ownerDocument:C,deferPointerDownOutside:u,isDeferredPointerDownOutsideRef:H,dismissableSurfaces:y.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(I=>{if(!(I instanceof Node))return!1;const re=[...y.branches].some(ee=>ee.contains(I));return A&&!re},[y.branches,A])}),K=M0(I=>{if(u&&H.current)return;const re=I.target;[...y.branches].some(oe=>oe.contains(re))||(p==null||p(I),g==null||g(I),I.defaultPrevented||v==null||v())},C),se=S?_===N.length-1:!1,X=$n(I=>{I.key==="Escape"&&(d==null||d(I),!I.defaultPrevented&&v&&(I.preventDefault(),v()))});return m.useEffect(()=>{if(se)return C.addEventListener("keydown",X,{capture:!0}),()=>C.removeEventListener("keydown",X,{capture:!0})},[C,se,X]),m.useEffect(()=>{if(S)return i&&(y.layersWithOutsidePointerEventsDisabled.size===0&&($x=C.body.style.pointerEvents,C.body.style.pointerEvents="none"),y.layersWithOutsidePointerEventsDisabled.add(S)),y.layers.add(S),Qf(),()=>{i&&(y.layersWithOutsidePointerEventsDisabled.delete(S),y.layersWithOutsidePointerEventsDisabled.size===0&&(C.body.style.pointerEvents=$x))}},[S,C,i,y]),m.useEffect(()=>()=>{S&&(y.layers.delete(S),y.layersWithOutsidePointerEventsDisabled.delete(S),Qf())},[S,y]),m.useEffect(()=>{const I=kt(()=>E({}),"handleUpdate");return document.addEventListener(Ff,I),()=>document.removeEventListener(Ff,I)},[]),s.jsx(Be.div,{...x,ref:j,style:{pointerEvents:O?A?"auto":"none":void 0,...l.style},onFocusCapture:Ee(l.onFocusCapture,K.onFocusCapture),onBlurCapture:Ee(l.onBlurCapture,K.onBlurCapture),onPointerDownCapture:Ee(l.onPointerDownCapture,z.onPointerDownCapture)})},"DismissableLayer"));function T0(){const a=m.useContext(N0),[l,o]=m.useState(null);return m.useEffect(()=>{if(l)return a.dismissableSurfaces.add(l),()=>{a.dismissableSurfaces.delete(l)}},[l,a.dismissableSurfaces]),o}kt(T0,"useDismissableLayerSurface");var BE=kt(()=>!0,"IS_TRUE");function A0(a,l){const{ownerDocument:o=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:i=!1,isDeferredPointerDownOutsideRef:u,dismissableSurfaces:d,shouldHandlePointerDownOutside:h=BE}=l,p=$n(a),g=m.useRef(!1),v=m.useRef(!1),x=m.useRef(new Map),y=m.useRef(()=>{});return m.useEffect(()=>{function S(){v.current=!1,u.current=!1,x.current.clear()}kt(S,"resetOutsideInteraction");function w(){return Array.from(x.current.values()).some(Boolean)}kt(w,"isOutsideInteractionIntercepted");function C(T){if(!v.current)return;const _=T.target;_ instanceof Node&&[...d].some(A=>A.contains(_))||x.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{v.current&&y.current()},0)}kt(C,"handleInteractionCapture");function E(T){v.current&&x.current.set(T.type,!1)}kt(E,"handleInteractionBubble");const j=kt(T=>{if(T.target&&!g.current){let _=function(){o.removeEventListener("click",y.current);const A=w();S(),A||Oh(LE,p,O,{discrete:!0})};if(kt(_,"handleAndDispatchPointerDownOutsideEvent"),!h(T.target)){o.removeEventListener("click",y.current),S(),g.current=!1;return}const O={originalEvent:T};v.current=!0,u.current=i&&T.button===0,x.current.clear(),!i||T.button!==0?_():(o.removeEventListener("click",y.current),y.current=_,o.addEventListener("click",y.current,{once:!0}))}else o.removeEventListener("click",y.current),S();g.current=!1},"handlePointerDown"),N=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of N)o.addEventListener(T,C,!0),o.addEventListener(T,E);const M=window.setTimeout(()=>{o.addEventListener("pointerdown",j)},0);return()=>{window.clearTimeout(M),o.removeEventListener("pointerdown",j),o.removeEventListener("click",y.current);for(const T of N)o.removeEventListener(T,C,!0),o.removeEventListener(T,E)}},[o,p,i,u,d,h]),{onPointerDownCapture:kt(()=>g.current=!0,"onPointerDownCapture")}}kt(A0,"usePointerDownOutside");function M0(a,l=globalThis==null?void 0:globalThis.document){const o=$n(a),i=m.useRef(!1);return m.useEffect(()=>{const u=kt(d=>{d.target&&!i.current&&Oh(UE,o,{originalEvent:d},{discrete:!1})},"handleFocus");return l.addEventListener("focusin",u),()=>l.removeEventListener("focusin",u)},[l,o]),{onFocusCapture:kt(()=>i.current=!0,"onFocusCapture"),onBlurCapture:kt(()=>i.current=!1,"onBlurCapture")}}kt(M0,"useFocusOutside");function Qf(){const a=new CustomEvent(Ff);document.dispatchEvent(a)}kt(Qf,"dispatchUpdate");function Oh(a,l,o,{discrete:i}){const u=o.originalEvent.target,d=new CustomEvent(a,{bubbles:!1,cancelable:!0,detail:o});l&&u.addEventListener(a,l,{once:!0}),i?Dh(u,d):u.dispatchEvent(d)}kt(Oh,"handleAndDispatchCustomEvent");var HE=Object.defineProperty,kh=(a,l)=>HE(a,"name",{value:l,configurable:!0}),nc=0,ha=null;function PE(a){return Lo(),a.children}kh(PE,"FocusGuards");function Lo(){m.useEffect(()=>{ha||(ha={start:Zf(),end:Zf()});const{start:a,end:l}=ha;return document.body.firstElementChild!==a&&document.body.insertAdjacentElement("afterbegin",a),document.body.lastElementChild!==l&&document.body.insertAdjacentElement("beforeend",l),nc++,()=>{nc===1&&(ha==null||ha.start.remove(),ha==null||ha.end.remove(),ha=null),nc=Math.max(0,nc-1)}},[])}kh(Lo,"useFocusGuards");function Zf(){const a=document.createElement("span");return a.setAttribute("data-radix-focus-guard",""),a.tabIndex=0,a.style.outline="none",a.style.opacity="0",a.style.position="fixed",a.style.pointerEvents="none",a}kh(Zf,"createFocusGuard");var qE=Object.defineProperty,Qt=(a,l)=>qE(a,"name",{value:l,configurable:!0}),Tf="focusScope.autoFocusOnMount",Af="focusScope.autoFocusOnUnmount",Kx={bubbles:!1,cancelable:!0},zh=m.forwardRef(Qt(function(l,o){const{loop:i=!1,trapped:u=!1,onMountAutoFocus:d,onUnmountAutoFocus:h,...p}=l,[g,v]=m.useState(null),x=$n(d),y=$n(h),S=m.useRef(null),w=Ie(o,v),C=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(u){let j=function(_){if(C.paused||!g)return;const O=_.target;g.contains(O)?S.current=O:$a(S.current,{select:!0})},N=function(_){if(C.paused||!g)return;const O=_.relatedTarget;O!==null&&(g.contains(O)||$a(S.current,{select:!0}))},M=function(_){if(document.activeElement===document.body)for(const A of _)A.removedNodes.length>0&&$a(g)};Qt(j,"handleFocusIn"),Qt(N,"handleFocusOut"),Qt(M,"handleMutations"),document.addEventListener("focusin",j),document.addEventListener("focusout",N);const T=new MutationObserver(M);return g&&T.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",N),T.disconnect()}}},[u,g,C.paused]),m.useEffect(()=>{if(g){Xx.add(C);const j=document.activeElement;if(!g.contains(j)){const M=new CustomEvent(Tf,Kx);g.addEventListener(Tf,x),g.dispatchEvent(M),M.defaultPrevented||(D0(L0(Lh(g)),{select:!0}),document.activeElement===j&&$a(g))}return()=>{g.removeEventListener(Tf,x),setTimeout(()=>{const M=new CustomEvent(Af,Kx);g.addEventListener(Af,y),g.dispatchEvent(M),M.defaultPrevented||$a(j??document.body,{select:!0}),g.removeEventListener(Af,y),Xx.remove(C)},0)}}},[g,x,y,C]);const E=m.useCallback(j=>{if(!i&&!u||C.paused)return;const N=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,M=document.activeElement;if(N&&M){const T=j.currentTarget,[_,O]=_0(T);_&&O?!j.shiftKey&&M===O?(j.preventDefault(),i&&$a(_,{select:!0})):j.shiftKey&&M===_&&(j.preventDefault(),i&&$a(O,{select:!0})):M===T&&j.preventDefault()}},[i,u,C.paused]);return s.jsx(Be.div,{tabIndex:-1,...p,ref:w,onKeyDown:E})},"FocusScope"));function D0(a,{select:l=!1}={}){const o=document.activeElement;for(const i of a)if($a(i,{select:l}),document.activeElement!==o)return}Qt(D0,"focusFirst");function _0(a){const l=Lh(a),o=Jf(l,a),i=Jf(l.reverse(),a);return[o,i]}Qt(_0,"getTabbableEdges");function Lh(a){const l=[],o=document.createTreeWalker(a,NodeFilter.SHOW_ELEMENT,{acceptNode:Qt(i=>{const u=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||u?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;o.nextNode();)l.push(o.currentNode);return l}Qt(Lh,"getTabbableCandidates");function Jf(a,l){const o=typeof l.checkVisibility=="function"&&l.checkVisibility({checkVisibilityCSS:!0});for(const i of a)if(!(o?!i.checkVisibility({checkVisibilityCSS:!0}):O0(i,{upTo:l})))return i}Qt(Jf,"findVisible");function O0(a,{upTo:l}){if(getComputedStyle(a).visibility==="hidden")return!0;for(;a;){if(l!==void 0&&a===l)return!1;if(getComputedStyle(a).display==="none")return!0;a=a.parentElement}return!1}Qt(O0,"isHidden");function k0(a){return a instanceof HTMLInputElement&&"select"in a}Qt(k0,"isSelectableInput");function $a(a,{select:l=!1}={}){if(a&&a.focus){const o=document.activeElement;a.focus({preventScroll:!0}),a!==o&&k0(a)&&l&&a.select()}}Qt($a,"focus");var Xx=z0();function z0(){let a=[];return{add(l){const o=a[0];l!==o&&(o==null||o.pause()),a=Wf(a,l),a.unshift(l)},remove(l){var o;a=Wf(a,l),(o=a[0])==null||o.resume()}}}Qt(z0,"createFocusScopesStack");function Wf(a,l){const o=[...a],i=o.indexOf(l);return i!==-1&&o.splice(i,1),o}Qt(Wf,"arrayRemove");function L0(a){return a.filter(l=>l.tagName!=="A")}Qt(L0,"removeLinks");var IE=Object.defineProperty,VE=(a,l)=>IE(a,"name",{value:l,configurable:!0}),GE=gs[" useId ".trim().toString()]||(()=>{}),YE=0;function ga(a){const[l,o]=m.useState(GE());return Dt(()=>{a||o(i=>i??String(YE++))},[a]),a||(l?`radix-${l}`:"")}VE(ga,"useId");const $E=["top","right","bottom","left"],Bl=Math.min,Xa=Math.max,wc=Math.round,ac=Math.floor,Fa=a=>({x:a,y:a}),KE={left:"right",right:"left",bottom:"top",top:"bottom"};function U0(a,l,o){return Xa(a,Bl(l,o))}function Wa(a,l){return typeof a=="function"?a(l):a}function Hl(a){return a.split("-")[0]}function js(a){return a.split("-")[1]}function Uh(a){return a==="x"?"y":"x"}function Bh(a){return a==="y"?"height":"width"}function pa(a){const l=a[0];return l==="t"||l==="b"?"y":"x"}function Hh(a){return Uh(pa(a))}function XE(a,l,o){o===void 0&&(o=!1);const i=js(a),u=Hh(a),d=Bh(u);let h=u==="x"?i===(o?"end":"start")?"right":"left":i==="start"?"bottom":"top";return l.reference[d]>l.floating[d]&&(h=jc(h)),[h,jc(h)]}function FE(a){const l=jc(a);return[eh(a),l,eh(l)]}function eh(a){return a.includes("start")?a.replace("start","end"):a.replace("end","start")}const Fx=["left","right"],Qx=["right","left"],QE=["top","bottom"],ZE=["bottom","top"];function JE(a,l,o){switch(a){case"top":case"bottom":return o?l?Qx:Fx:l?Fx:Qx;case"left":case"right":return l?QE:ZE;default:return[]}}function WE(a,l,o,i){const u=js(a);let d=JE(Hl(a),o==="start",i);return u&&(d=d.map(h=>h+"-"+u),l&&(d=d.concat(d.map(eh)))),d}function jc(a){const l=Hl(a);return KE[l]+a.slice(l.length)}function eR(a){var l,o,i,u;return{top:(l=a.top)!=null?l:0,right:(o=a.right)!=null?o:0,bottom:(i=a.bottom)!=null?i:0,left:(u=a.left)!=null?u:0}}function B0(a){return typeof a!="number"?eR(a):{top:a,right:a,bottom:a,left:a}}function Cc(a){const{x:l,y:o,width:i,height:u}=a;return{width:i,height:u,top:o,left:l,right:l+i,bottom:o+u,x:l,y:o}}function Zx(a,l,o){let{reference:i,floating:u}=a;const d=pa(l),h=Hh(l),p=Bh(h),g=Hl(l),v=d==="y",x=i.x+i.width/2-u.width/2,y=i.y+i.height/2-u.height/2,S=i[p]/2-u[p]/2;let w;switch(g){case"top":w={x,y:i.y-u.height};break;case"bottom":w={x,y:i.y+i.height};break;case"right":w={x:i.x+i.width,y};break;case"left":w={x:i.x-u.width,y};break;default:w={x:i.x,y:i.y}}const C=js(l);return C&&(w[h]+=S*(C==="end"?1:-1)*(o&&v?-1:1)),w}async function tR(a,l){var o;l===void 0&&(l={});const{x:i,y:u,platform:d,rects:h,elements:p,strategy:g}=a,{boundary:v="clippingAncestors",rootBoundary:x="viewport",elementContext:y="floating",altBoundary:S=!1,padding:w=0}=Wa(l,a),C=B0(w),j=p[S?y==="floating"?"reference":"floating":y],N=Cc(await d.getClippingRect({element:(o=await(d.isElement==null?void 0:d.isElement(j)))==null||o?j:j.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(p.floating)),boundary:v,rootBoundary:x,strategy:g})),M=y==="floating"?{x:i,y:u,width:h.floating.width,height:h.floating.height}:h.reference,T=await(d.getOffsetParent==null?void 0:d.getOffsetParent(p.floating)),_=await(d.isElement==null?void 0:d.isElement(T))&&await(d.getScale==null?void 0:d.getScale(T))||{x:1,y:1},O=Cc(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:M,offsetParent:T,strategy:g}):M);return{top:(N.top-O.top+C.top)/_.y,bottom:(O.bottom-N.bottom+C.bottom)/_.y,left:(N.left-O.left+C.left)/_.x,right:(O.right-N.right+C.right)/_.x}}const nR=50,aR=async(a,l,o)=>{const{placement:i="bottom",strategy:u="absolute",middleware:d=[],platform:h}=o,p=h.detectOverflow?h:{...h,detectOverflow:tR},g=await(h.isRTL==null?void 0:h.isRTL(l));let v=await h.getElementRects({reference:a,floating:l,strategy:u}),{x,y}=Zx(v,i,g),S=i,w=0;const C={};for(let E=0;E<d.length;E++){const j=d[E];if(!j)continue;const{name:N,fn:M}=j,{x:T,y:_,data:O,reset:A}=await M({x,y,initialPlacement:i,placement:S,strategy:u,middlewareData:C,rects:v,platform:p,elements:{reference:a,floating:l}});x=T??x,y=_??y,C[N]={...C[N],...O},A&&w<nR&&(w++,typeof A=="object"&&(A.placement&&(S=A.placement),A.rects&&(v=A.rects===!0?await h.getElementRects({reference:a,floating:l,strategy:u}):A.rects),{x,y}=Zx(v,S,g)),E=-1)}return{x,y,placement:S,strategy:u,middlewareData:C}},lR=a=>({name:"arrow",options:a,async fn(l){const{x:o,y:i,placement:u,rects:d,platform:h,elements:p,middlewareData:g}=l,{element:v,padding:x=0}=Wa(a,l)||{};if(v==null)return{};const y=B0(x),S={x:o,y:i},w=Hh(u),C=Bh(w),E=await h.getDimensions(v),j=w==="y",N=j?"top":"left",M=j?"bottom":"right",T=j?"clientHeight":"clientWidth",_=d.reference[C]+d.reference[w]-S[w]-d.floating[C],O=S[w]-d.reference[w],A=await(h.getOffsetParent==null?void 0:h.getOffsetParent(v));let H=A?A[T]:0;(!H||!await(h.isElement==null?void 0:h.isElement(A)))&&(H=p.floating[T]||d.floating[C]);const z=_/2-O/2,K=H/2-E[C]/2-1,se=Bl(y[N],K),X=Bl(y[M],K),I=H-E[C]-X,re=H/2-E[C]/2+z,ee=U0(se,re,I),oe=!g.arrow&&js(u)!=null&&re!==ee&&d.reference[C]/2-(re<se?se:X)-E[C]/2<0,U=oe?re<se?re-se:re-I:0;return{[w]:S[w]+U,data:{[w]:ee,centerOffset:re-ee-U,...oe&&{alignmentOffset:U}},reset:oe}}}),rR=function(a){return a===void 0&&(a={}),{name:"flip",options:a,async fn(l){var o,i;const{placement:u,middlewareData:d,rects:h,initialPlacement:p,platform:g,elements:v}=l,{mainAxis:x=!0,crossAxis:y=!0,fallbackPlacements:S,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:C="none",flipAlignment:E=!0,...j}=Wa(a,l);if((o=d.arrow)!=null&&o.alignmentOffset)return{};const N=Hl(u),M=pa(p),T=Hl(p)===p,_=await(g.isRTL==null?void 0:g.isRTL(v.floating)),O=S||(T||!E?[jc(p)]:FE(p)),A=C!=="none";!S&&A&&O.push(...WE(p,E,C,_));const H=[p,...O],z=await g.detectOverflow(l,j),K=[];let se=((i=d.flip)==null?void 0:i.overflows)||[];if(x&&K.push(z[N]),y){const ee=XE(u,h,_);K.push(z[ee[0]],z[ee[1]])}if(se=[...se,{placement:u,overflows:K}],!K.every(ee=>ee<=0)){var X,I;const ee=(((X=d.flip)==null?void 0:X.index)||0)+1,oe=H[ee];if(oe&&(!(y==="alignment"?M!==pa(oe):!1)||se.every(le=>pa(le.placement)===M?le.overflows[0]>0:!0)))return{data:{index:ee,overflows:se},reset:{placement:oe}};let U=(I=se.filter($=>$.overflows[0]<=0).sort(($,le)=>$.overflows[1]-le.overflows[1])[0])==null?void 0:I.placement;if(!U)switch(w){case"bestFit":{var re;const $=(re=se.filter(le=>{if(A){const B=pa(le.placement);return B===M||B==="y"}return!0}).map(le=>[le.placement,le.overflows.filter(B=>B>0).reduce((B,Z)=>B+Z,0)]).sort((le,B)=>le[1]-B[1])[0])==null?void 0:re[0];$&&(U=$);break}case"initialPlacement":U=p;break}if(u!==U)return{reset:{placement:U}}}return{}}}};function Jx(a,l){return{top:a.top-l.height,right:a.right-l.width,bottom:a.bottom-l.height,left:a.left-l.width}}function Wx(a){return $E.some(l=>a[l]>=0)}const sR=function(a){return a===void 0&&(a={}),{name:"hide",options:a,async fn(l){const{rects:o,platform:i}=l,{strategy:u="referenceHidden",...d}=Wa(a,l);switch(u){case"referenceHidden":{const h=await i.detectOverflow(l,{...d,elementContext:"reference"}),p=Jx(h,o.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:Wx(p)}}}case"escaped":{const h=await i.detectOverflow(l,{...d,altBoundary:!0}),p=Jx(h,o.floating);return{data:{escapedOffsets:p,escaped:Wx(p)}}}default:return{}}}}},H0=new Set(["left","top"]);async function oR(a,l){const{placement:o,platform:i,elements:u}=a,d=await(i.isRTL==null?void 0:i.isRTL(u.floating)),h=Hl(o),p=js(o),g=pa(o)==="y",v=H0.has(h)?-1:1,x=d&&g?-1:1,y=Wa(l,a);let{mainAxis:S,crossAxis:w,alignmentAxis:C}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return p&&typeof C=="number"&&(w=p==="end"?C*-1:C),g?{x:w*x,y:S*v}:{x:S*v,y:w*x}}const iR=function(a){return a===void 0&&(a=0),{name:"offset",options:a,async fn(l){var o,i;const{x:u,y:d,placement:h,middlewareData:p}=l,g=await oR(l,a);return h===((o=p.offset)==null?void 0:o.placement)&&(i=p.arrow)!=null&&i.alignmentOffset?{}:{x:u+g.x,y:d+g.y,data:{...g,placement:h}}}}},cR=function(a){return a===void 0&&(a={}),{name:"shift",options:a,async fn(l){const{x:o,y:i,placement:u,platform:d}=l,{mainAxis:h=!0,crossAxis:p=!1,limiter:g={fn:M=>{let{x:T,y:_}=M;return{x:T,y:_}}},...v}=Wa(a,l),x={x:o,y:i},y=await d.detectOverflow(l,v),S=pa(u),w=Uh(S);let C=x[w],E=x[S];const j=(M,T)=>U0(T+y[M==="y"?"top":"left"],T,T-y[M==="y"?"bottom":"right"]);h&&(C=j(w,C)),p&&(E=j(S,E));const N=g.fn({...l,[w]:C,[S]:E});return{...N,data:{x:N.x-o,y:N.y-i,enabled:{[w]:h,[S]:p}}}}}},uR=function(a){return a===void 0&&(a={}),{options:a,fn(l){var o,i;const{x:u,y:d,placement:h,rects:p,middlewareData:g}=l,{offset:v=0,mainAxis:x=!0,crossAxis:y=!0}=Wa(a,l),S={x:u,y:d},w=pa(h),C=Uh(w);let E=S[C],j=S[w];const N=Wa(v,l),M=typeof N=="number"?{mainAxis:N,crossAxis:0}:{mainAxis:(o=N.mainAxis)!=null?o:0,crossAxis:(i=N.crossAxis)!=null?i:0};if(x){const O=C==="y"?"height":"width",A=p.reference[C]-p.floating[O]+M.mainAxis,H=p.reference[C]+p.reference[O]-M.mainAxis;E<A?E=A:E>H&&(E=H)}if(y){var T,_;const O=C==="y"?"width":"height",A=H0.has(Hl(h)),H=p.reference[w]-p.floating[O]+(A&&((T=g.offset)==null?void 0:T[w])||0)+(A?0:M.crossAxis),z=p.reference[w]+p.reference[O]+(A?0:((_=g.offset)==null?void 0:_[w])||0)-(A?M.crossAxis:0);j<H?j=H:j>z&&(j=z)}return{[C]:E,[w]:j}}}},dR=function(a){return a===void 0&&(a={}),{name:"size",options:a,async fn(l){const{placement:o,rects:i,platform:u,elements:d}=l,{apply:h=()=>{},...p}=Wa(a,l),g=await u.detectOverflow(l,p),v=Hl(o),x=js(o),y=pa(o)==="y",{width:S,height:w}=i.floating;let C,E;v==="top"||v==="bottom"?(C=v,E=x===(await(u.isRTL==null?void 0:u.isRTL(d.floating))?"start":"end")?"left":"right"):(E=v,C=x==="end"?"top":"bottom");const j=w-g.top-g.bottom,N=S-g.left-g.right,M=Bl(w-g[C],j),T=Bl(S-g[E],N),_=l.middlewareData.shift,O=!_;let A=M,H=T;_!=null&&_.enabled.x&&(H=N),_!=null&&_.enabled.y&&(A=j),O&&!x&&(y?H=S-2*Xa(g.left,g.right):A=w-2*Xa(g.top,g.bottom)),await h({...l,availableWidth:H,availableHeight:A});const z=await u.getDimensions(d.floating);return S!==z.width||w!==z.height?{reset:{rects:!0}}:{}}}};function Uc(){return typeof window<"u"}function Cs(a){return P0(a)?(a.nodeName||"").toLowerCase():"#document"}function un(a){var l;return(a==null||(l=a.ownerDocument)==null?void 0:l.defaultView)||window}function nl(a){var l;return(l=(P0(a)?a.ownerDocument:a.document)||window.document)==null?void 0:l.documentElement}function P0(a){return Uc()?a instanceof Node||a instanceof un(a).Node:!1}function xa(a){return Uc()?a instanceof Element||a instanceof un(a).Element:!1}function ql(a){return Uc()?a instanceof HTMLElement||a instanceof un(a).HTMLElement:!1}function ey(a){return!Uc()||typeof ShadowRoot>"u"?!1:a instanceof ShadowRoot||a instanceof un(a).ShadowRoot}function Bc(a){const{overflow:l,overflowX:o,overflowY:i,display:u}=ya(a);return/auto|scroll|overlay|hidden|clip/.test(l+i+o)&&u!=="inline"&&u!=="contents"}function fR(a){return/^(table|td|th)$/.test(Cs(a))}function Hc(a){try{if(a.matches(":popover-open"))return!0}catch{}try{return a.matches(":modal")}catch{return!1}}const hR=/transform|translate|scale|rotate|perspective|filter/,mR=/paint|layout|strict|content/,ir=a=>!!a&&a!=="none";let Mf;function Ph(a){const l=xa(a)?ya(a):a;return ir(l.transform)||ir(l.translate)||ir(l.scale)||ir(l.rotate)||ir(l.perspective)||!qh()&&(ir(l.backdropFilter)||ir(l.filter))||hR.test(l.willChange||"")||mR.test(l.contain||"")}function pR(a){let l=fr(a);for(;ql(l)&&!Eo(l);){if(Ph(l))return l;if(Hc(l))return null;l=fr(l)}return null}function qh(){return Mf==null&&(Mf=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Mf}function Eo(a){return/^(html|body|#document)$/.test(Cs(a))}function ya(a){return un(a).getComputedStyle(a)}function Pc(a){return xa(a)?{scrollLeft:a.scrollLeft,scrollTop:a.scrollTop}:{scrollLeft:a.scrollX,scrollTop:a.scrollY}}function fr(a){if(Cs(a)==="html")return a;const l=a.assignedSlot||a.parentNode||ey(a)&&a.host||nl(a);return ey(l)?l.host:l}function q0(a){const l=fr(a);return Eo(l)?(a.ownerDocument||a).body:ql(l)&&Bc(l)?l:q0(l)}function Ro(a,l,o){var i;l===void 0&&(l=[]),o===void 0&&(o=!0);const u=q0(a),d=u===((i=a.ownerDocument)==null?void 0:i.body),h=un(u);if(d){const p=th(h);return l.concat(h,h.visualViewport||[],Bc(u)?u:[],p&&o?Ro(p):[])}else return l.concat(u,Ro(u,[],o))}function th(a){return a.parent&&Object.getPrototypeOf(a.parent)?a.frameElement:null}function I0(a){const l=ya(a);let o=parseFloat(l.width)||0,i=parseFloat(l.height)||0;const u=ql(a),d=u?a.offsetWidth:o,h=u?a.offsetHeight:i,p=wc(o)!==d||wc(i)!==h;return p&&(o=d,i=h),{width:o,height:i,$:p}}function Ih(a){return xa(a)?a:a.contextElement}function hs(a){const l=Ih(a);if(!ql(l))return Fa(1);const o=l.getBoundingClientRect(),{width:i,height:u,$:d}=I0(l);let h=(d?wc(o.width):o.width)/i,p=(d?wc(o.height):o.height)/u;return(!h||!Number.isFinite(h))&&(h=1),(!p||!Number.isFinite(p))&&(p=1),{x:h,y:p}}const gR=Fa(0);function V0(a){const l=un(a);return!qh()||!l.visualViewport?gR:{x:l.visualViewport.offsetLeft,y:l.visualViewport.offsetTop}}function vR(a,l,o){return l===void 0&&(l=!1),!!o&&l&&o===un(a)}function hr(a,l,o,i){l===void 0&&(l=!1),o===void 0&&(o=!1);const u=a.getBoundingClientRect(),d=Ih(a);let h=Fa(1);l&&(i?xa(i)&&(h=hs(i)):h=hs(a));const p=vR(d,o,i)?V0(d):Fa(0);let g=(u.left+p.x)/h.x,v=(u.top+p.y)/h.y,x=u.width/h.x,y=u.height/h.y;if(d&&i){const S=un(d),w=xa(i)?un(i):i;let C=S,E=th(C);for(;E&&w!==C;){const j=hs(E),N=E.getBoundingClientRect(),M=ya(E),T=N.left+(E.clientLeft+parseFloat(M.paddingLeft))*j.x,_=N.top+(E.clientTop+parseFloat(M.paddingTop))*j.y;g*=j.x,v*=j.y,x*=j.x,y*=j.y,g+=T,v+=_,C=un(E),E=th(C)}}return Cc({width:x,height:y,x:g,y:v})}function qc(a,l){const o=Pc(a).scrollLeft;return l?l.left+o:hr(nl(a)).left+o}function G0(a,l){const o=a.getBoundingClientRect(),i=o.left+l.scrollLeft-qc(a,o),u=o.top+l.scrollTop;return{x:i,y:u}}function xR(a){let{elements:l,rect:o,offsetParent:i,strategy:u}=a;const d=u==="fixed",h=nl(i),p=l?Hc(l.floating):!1;if(i===h||p&&d)return o;let g={scrollLeft:0,scrollTop:0},v=Fa(1);const x=Fa(0),y=ql(i);if((y||!d)&&((Cs(i)!=="body"||Bc(h))&&(g=Pc(i)),y)){const w=hr(i);v=hs(i),x.x=w.x+i.clientLeft,x.y=w.y+i.clientTop}const S=h&&!y&&!d?G0(h,g):Fa(0);return{width:o.width*v.x,height:o.height*v.y,x:o.x*v.x-g.scrollLeft*v.x+x.x+S.x,y:o.y*v.y-g.scrollTop*v.y+x.y+S.y}}function yR(a){return a.getClientRects?Array.from(a.getClientRects()):[]}function bR(a){const l=Pc(a),o=a.ownerDocument.body,i=Xa(a.scrollWidth,a.clientWidth,o.scrollWidth,o.clientWidth),u=Xa(a.scrollHeight,a.clientHeight,o.scrollHeight,o.clientHeight);let d=-l.scrollLeft+qc(a);const h=-l.scrollTop;return ya(o).direction==="rtl"&&(d+=Xa(a.clientWidth,o.clientWidth)-i),{width:i,height:u,x:d,y:h}}const SR=25;function wR(a,l,o){o===void 0&&(o="viewport");const i=o==="layoutViewport",u=un(a),d=nl(a),h=u.visualViewport;let p=d.clientWidth,g=d.clientHeight,v=0,x=0;if(h){const S=!qh()||l==="fixed";i?S||(v=-h.offsetLeft,x=-h.offsetTop):(p=h.width,g=h.height,S&&(v=h.offsetLeft,x=h.offsetTop))}if(qc(d)<=0){const S=d.ownerDocument,w=S.body,C=getComputedStyle(w),E=S.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,j=Math.abs(d.clientWidth-w.clientWidth-E),N=getComputedStyle(d).scrollbarGutter==="stable both-edges"?j/2:j;N<=SR&&(p-=N)}return{width:p,height:g,x:v,y:x}}function jR(a,l){const o=hr(a,!0,l==="fixed"),i=o.top+a.clientTop,u=o.left+a.clientLeft,d=hs(a),h=a.clientWidth*d.x,p=a.clientHeight*d.y,g=u*d.x,v=i*d.y;return{width:h,height:p,x:g,y:v}}function ty(a,l,o){let i;if(l==="viewport"||l==="layoutViewport")i=wR(a,o,l);else if(l==="document")i=bR(nl(a));else if(xa(l))i=jR(l,o);else{const u=V0(a);i={x:l.x-u.x,y:l.y-u.y,width:l.width,height:l.height}}return Cc(i)}function CR(a,l){const o=l.get(a);if(o)return o;let i=Ro(a,[],!1).filter(p=>xa(p)&&Cs(p)!=="body"),u=null;const d=ya(a).position==="fixed";let h=d?fr(a):a;for(;xa(h)&&!Eo(h);){const p=ya(h),g=Ph(h),v=u?u.position:d?"fixed":"";!g&&(v==="fixed"||v==="absolute"&&p.position==="static")?i=i.filter(y=>y!==h):u=p,h=fr(h)}return l.set(a,i),i}function ER(a){let{element:l,boundary:o,rootBoundary:i,strategy:u}=a;const h=[...o==="clippingAncestors"?Hc(l)?[]:CR(l,this._c):[].concat(o),i],p=ty(l,h[0],u);let g=p.top,v=p.right,x=p.bottom,y=p.left;for(let S=1;S<h.length;S++){const w=ty(l,h[S],u);g=Xa(w.top,g),v=Bl(w.right,v),x=Bl(w.bottom,x),y=Xa(w.left,y)}return{width:v-y,height:x-g,x:y,y:g}}function RR(a){const{width:l,height:o}=I0(a);return{width:l,height:o}}function NR(a,l,o){const i=ql(l),u=nl(l),d=o==="fixed",h=hr(a,!0,d,l);let p={scrollLeft:0,scrollTop:0};const g=Fa(0);if((i||!d)&&((Cs(l)!=="body"||Bc(u))&&(p=Pc(l)),i)){const S=hr(l,!0,d,l);g.x=S.x+l.clientLeft,g.y=S.y+l.clientTop}!i&&u&&(g.x=qc(u));const v=u&&!i&&!d?G0(u,p):Fa(0),x=h.left+p.scrollLeft-g.x-v.x,y=h.top+p.scrollTop-g.y-v.y;return{x,y,width:h.width,height:h.height}}function Df(a){return ya(a).position==="static"}function ny(a,l){if(!ql(a)||ya(a).position==="fixed")return null;if(l)return l(a);let o=a.offsetParent;return nl(a)===o&&(o=o.ownerDocument.body),o}function Y0(a,l){const o=un(a);if(Hc(a))return o;if(!ql(a)){let u=fr(a);for(;u&&!Eo(u);){if(xa(u)&&!Df(u))return u;u=fr(u)}return o}let i=ny(a,l);for(;i&&fR(i)&&Df(i);)i=ny(i,l);return i&&Eo(i)&&Df(i)&&!Ph(i)?o:i||pR(a)||o}const TR=async function(a){const l=this.getOffsetParent||Y0,o=this.getDimensions,i=await o(a.floating);return{reference:NR(a.reference,await l(a.floating),a.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function AR(a){return ya(a).direction==="rtl"}const MR={convertOffsetParentRelativeRectToViewportRelativeRect:xR,getDocumentElement:nl,getClippingRect:ER,getOffsetParent:Y0,getElementRects:TR,getClientRects:yR,getDimensions:RR,getScale:hs,isElement:xa,isRTL:AR};function $0(a,l){return a.x===l.x&&a.y===l.y&&a.width===l.width&&a.height===l.height}function DR(a,l,o){let i=null,u;const d=nl(a);function h(){var x;clearTimeout(u),(x=i)==null||x.disconnect(),i=null}function p(x,y){x===void 0&&(x=!1),y===void 0&&(y=1),h();const S=a.getBoundingClientRect(),{left:w,top:C,width:E,height:j}=S;if(x||l(),!E||!j)return;const N=ac(C),M=ac(d.clientWidth-(w+E)),T=ac(d.clientHeight-(C+j)),_=ac(w),A={rootMargin:-N+"px "+-M+"px "+-T+"px "+-_+"px",threshold:Xa(0,Bl(1,y))||1};let H=!0;function z(K){const se=K[0].intersectionRatio;if(!$0(S,a.getBoundingClientRect()))return p();if(se!==y){if(!H)return p();se?p(!1,se):u=setTimeout(()=>{p(!1,1e-7)},1e3)}H=!1}try{i=new IntersectionObserver(z,{...A,root:d.ownerDocument})}catch{i=new IntersectionObserver(z,A)}i.observe(a)}const g=un(a),v=()=>p(o);return g.addEventListener("resize",v),p(!0),()=>{g.removeEventListener("resize",v),h()}}function _R(a,l,o,i){i===void 0&&(i={});const{ancestorScroll:u=!0,ancestorResize:d=!0,elementResize:h=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:g=!1}=i,v=Ih(a),x=u||d?[...v?Ro(v):[],...l?Ro(l):[]]:[];x.forEach(N=>{u&&N.addEventListener("scroll",o),d&&N.addEventListener("resize",o)});const y=v&&p?DR(v,o,d):null;let S=-1,w=null;h&&(w=new ResizeObserver(N=>{let[M]=N;M&&M.target===v&&w&&l&&(w.unobserve(l),cancelAnimationFrame(S),S=requestAnimationFrame(()=>{var T;(T=w)==null||T.observe(l)})),o()}),v&&!g&&w.observe(v),l&&w.observe(l));let C,E=g?hr(a):null;g&&j();function j(){const N=hr(a);E&&!$0(E,N)&&o(),E=N,C=requestAnimationFrame(j)}return o(),()=>{var N;x.forEach(M=>{u&&M.removeEventListener("scroll",o),d&&M.removeEventListener("resize",o)}),y==null||y(),(N=w)==null||N.disconnect(),w=null,g&&cancelAnimationFrame(C)}}const OR=iR,kR=cR,zR=rR,LR=dR,UR=sR,ay=lR,BR=uR,HR=(a,l,o)=>{const i=new Map,u=o??{},d={...MR,...u.platform,_c:i};return aR(a,l,{...u,platform:d})};var PR=typeof document<"u",qR=function(){},vc=PR?m.useLayoutEffect:qR;function Ec(a,l){if(a===l)return!0;if(typeof a!=typeof l)return!1;if(typeof a=="function"&&a.toString()===l.toString())return!0;let o,i,u;if(a&&l&&typeof a=="object"){if(Array.isArray(a)){if(o=a.length,o!==l.length)return!1;for(i=o;i--!==0;)if(!Ec(a[i],l[i]))return!1;return!0}if(u=Object.keys(a),o=u.length,o!==Object.keys(l).length)return!1;for(i=o;i--!==0;)if(!{}.hasOwnProperty.call(l,u[i]))return!1;for(i=o;i--!==0;){const d=u[i];if(!(d==="_owner"&&a.$$typeof)&&!Ec(a[d],l[d]))return!1}return!0}return a!==a&&l!==l}function K0(a){return typeof window>"u"?1:(a.ownerDocument.defaultView||window).devicePixelRatio||1}function ly(a,l){const o=K0(a);return Math.round(l*o)/o}function _f(a){const l=m.useRef(a);return vc(()=>{l.current=a}),l}function IR(a){a===void 0&&(a={});const{placement:l="bottom",strategy:o="absolute",middleware:i=[],platform:u,elements:{reference:d,floating:h}={},transform:p=!0,whileElementsMounted:g,open:v}=a,[x,y]=m.useState({x:0,y:0,strategy:o,placement:l,middlewareData:{},isPositioned:!1}),[S,w]=m.useState(i);Ec(S,i)||w(i);const[C,E]=m.useState(null),[j,N]=m.useState(null),M=m.useCallback(le=>{le!==A.current&&(A.current=le,E(le))},[]),T=m.useCallback(le=>{le!==H.current&&(H.current=le,N(le))},[]),_=d||C,O=h||j,A=m.useRef(null),H=m.useRef(null),z=m.useRef(x),K=g!=null,se=_f(g),X=_f(u),I=_f(v),re=m.useCallback(()=>{if(!A.current||!H.current)return;const le={placement:l,strategy:o,middleware:S};X.current&&(le.platform=X.current),HR(A.current,H.current,le).then(B=>{const Z={...B,isPositioned:I.current!==!1};ee.current&&!Ec(z.current,Z)&&(z.current=Z,bs.flushSync(()=>{y(Z)}))})},[S,l,o,X,I]);vc(()=>{v===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,y(le=>({...le,isPositioned:!1})))},[v]);const ee=m.useRef(!1);vc(()=>(ee.current=!0,()=>{ee.current=!1}),[]),vc(()=>{if(_&&(A.current=_),O&&(H.current=O),_&&O){if(se.current)return se.current(_,O,re);re()}},[_,O,re,se,K]);const oe=m.useMemo(()=>({reference:A,floating:H,setReference:M,setFloating:T}),[M,T]),U=m.useMemo(()=>({reference:_,floating:O}),[_,O]),$=m.useMemo(()=>{const le={position:o,left:0,top:0};if(!U.floating)return le;const B=ly(U.floating,x.x),Z=ly(U.floating,x.y);return p?{...le,transform:"translate("+B+"px, "+Z+"px)",...K0(U.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:B,top:Z}},[o,p,U.floating,x.x,x.y]);return m.useMemo(()=>({...x,update:re,refs:oe,elements:U,floatingStyles:$}),[x,re,oe,U,$])}const VR=a=>{function l(o){return{}.hasOwnProperty.call(o,"current")}return{name:"arrow",options:a,fn(o){const{element:i,padding:u}=typeof a=="function"?a(o):a;return i&&l(i)?i.current!=null?ay({element:i.current,padding:u}).fn(o):{}:i?ay({element:i,padding:u}).fn(o):{}}}},GR=(a,l)=>{const o=OR(a);return{name:o.name,fn:o.fn,options:[a,l]}},YR=(a,l)=>{const o=kR(a);return{name:o.name,fn:o.fn,options:[a,l]}},$R=(a,l)=>({fn:BR(a).fn,options:[a,l]}),KR=(a,l)=>{const o=zR(a);return{name:o.name,fn:o.fn,options:[a,l]}},XR=(a,l)=>{const o=LR(a);return{name:o.name,fn:o.fn,options:[a,l]}},FR=(a,l)=>{const o=UR(a);return{name:o.name,fn:o.fn,options:[a,l]}},QR=(a,l)=>{const o=VR(a);return{name:o.name,fn:o.fn,options:[a,l]}};var ZR=Object.defineProperty,JR=(a,l)=>ZR(a,"name",{value:l,configurable:!0});function Ic(a){const[l,o]=m.useState(void 0);return Dt(()=>{if(a){o({width:a.offsetWidth,height:a.offsetHeight});const i=new ResizeObserver(u=>{if(!Array.isArray(u)||!u.length)return;const d=u[0];let h,p;if("borderBoxSize"in d){const g=d.borderBoxSize,v=Array.isArray(g)?g[0]:g;h=v.inlineSize,p=v.blockSize}else h=a.offsetWidth,p=a.offsetHeight;o({width:h,height:p})});return i.observe(a,{box:"border-box"}),()=>i.unobserve(a)}else o(void 0)},[a]),l}JR(Ic,"useSize");var WR=Object.defineProperty,Ll=(a,l)=>WR(a,"name",{value:l,configurable:!0}),X0="Popper",[F0,Es]=fn(X0),[eN,Q0]=F0(X0),tN=Ll(a=>{const{__scopePopper:l,children:o}=a,[i,u]=m.useState(null),[d,h]=m.useState(void 0);return s.jsx(eN,{scope:l,anchor:i,onAnchorChange:u,placementState:d,setPlacementState:h,children:o})},"Popper"),nN="PopperAnchor",aN=m.forwardRef(Ll(function(l,o){const{__scopePopper:i,virtualRef:u,...d}=l,h=Q0(nN,i),p=m.useRef(null),g=h.onAnchorChange,v=m.useCallback(E=>{p.current=E,E&&g(E)},[g]),x=Ie(o,v),y=m.useRef(null);m.useEffect(()=>{if(!u)return;const E=y.current;y.current=u.current,E!==y.current&&g(y.current)});const S=h.placementState&&Vc(h.placementState),w=S==null?void 0:S[0],C=S==null?void 0:S[1];return u?null:s.jsx(Be.div,{"data-radix-popper-side":w,"data-radix-popper-align":C,...d,ref:x})},"PopperAnchor")),Z0="PopperContent",[lN,U_]=F0(Z0),rN=m.forwardRef(Ll(function(l,o){var xe,J,me,je,Me,mt,pt;const{__scopePopper:i,side:u="bottom",sideOffset:d=0,align:h="center",alignOffset:p=0,arrowPadding:g=0,avoidCollisions:v=!0,collisionBoundary:x=[],collisionPadding:y=0,sticky:S="partial",hideWhenDetached:w=!1,updatePositionStrategy:C="optimized",onPlaced:E,...j}=l,N=Q0(Z0,i),[M,T]=m.useState(null),_=Ie(o,T),[O,A]=m.useState(null),H=Ic(O),z=(H==null?void 0:H.width)??0,K=(H==null?void 0:H.height)??0,se=u+(h!=="center"?"-"+h:""),X=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},I=Array.isArray(x)?x:[x],re=I.length>0,ee={padding:X,boundary:I.filter(J0),altBoundary:re},{refs:oe,floatingStyles:U,placement:$,isPositioned:le,middlewareData:B}=IR({strategy:"fixed",placement:se,whileElementsMounted:Ll((...bt)=>_R(...bt,{animationFrame:C==="always"}),"whileElementsMounted"),elements:{reference:N.anchor},middleware:[GR({mainAxis:d+K,alignmentAxis:p}),v&&YR({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?$R():void 0,...ee}),v&&KR({...ee}),XR({...ee,apply:Ll(({elements:bt,rects:St,availableWidth:Lt,availableHeight:hn})=>{const{width:Qn,height:mn}=St.reference,ja=bt.floating.style;ja.setProperty("--radix-popper-available-width",`${Lt}px`),ja.setProperty("--radix-popper-available-height",`${hn}px`),ja.setProperty("--radix-popper-anchor-width",`${Qn}px`),ja.setProperty("--radix-popper-anchor-height",`${mn}px`)},"apply")}),O&&QR({element:O,padding:g}),sN({arrowWidth:z,arrowHeight:K}),w&&FR({strategy:"referenceHidden",...ee,boundary:re?ee.boundary:void 0})]}),Z=N.setPlacementState;Dt(()=>(Z($),()=>{Z(void 0)}),[$,Z]);const[D,q]=Vc($),Q=$n(E);Dt(()=>{le&&(Q==null||Q())},[le,Q]);const ae=(xe=B.arrow)==null?void 0:xe.x,ce=(J=B.arrow)==null?void 0:J.y,Se=((me=B.arrow)==null?void 0:me.centerOffset)!==0,[ue,fe]=m.useState();return Dt(()=>{M&&fe(window.getComputedStyle(M).zIndex)},[M]),s.jsx("div",{ref:oe.setFloating,"data-radix-popper-content-wrapper":"",style:{...U,transform:le?U.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(je=B.transformOrigin)==null?void 0:je.x,(Me=B.transformOrigin)==null?void 0:Me.y].join(" "),...((mt=B.hide)==null?void 0:mt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:l.dir,children:s.jsx(lN,{scope:i,placedSide:D,placedAlign:q,onArrowChange:A,arrowX:ae,arrowY:ce,shouldHideArrow:Se,children:s.jsx(Be.div,{"data-side":D,"data-align":q,...j,ref:_,style:{...j.style,animation:le?(pt=j.style)==null?void 0:pt.animation:"none"}})})})},"PopperContent"));function J0(a){return a!==null}Ll(J0,"isNotNull");var sN=Ll(a=>({name:"transformOrigin",options:a,fn(l){var j,N,M;const{placement:o,rects:i,middlewareData:u}=l,h=((j=u.arrow)==null?void 0:j.centerOffset)!==0,p=h?0:a.arrowWidth,g=h?0:a.arrowHeight,[v,x]=Vc(o),y={start:"0%",center:"50%",end:"100%"}[x],S=(((N=u.arrow)==null?void 0:N.x)??0)+p/2,w=(((M=u.arrow)==null?void 0:M.y)??0)+g/2;let C="",E="";return v==="bottom"?(C=h?y:`${S}px`,E=`${-g}px`):v==="top"?(C=h?y:`${S}px`,E=`${i.floating.height+g}px`):v==="right"?(C=`${-g}px`,E=h?y:`${w}px`):v==="left"&&(C=`${i.floating.width+g}px`,E=h?y:`${w}px`),{data:{x:C,y:E}}}}),"transformOrigin");function Vc(a){const[l,o="center"]=a.split("-");return[l,o]}Ll(Vc,"getSideAndAlignFromPlacement");var W0=tN,eb=aN,Vh=rN,oN=Object.defineProperty,iN=(a,l)=>oN(a,"name",{value:l,configurable:!0}),Gh=m.forwardRef(iN(function(l,o){var g;const{container:i,...u}=l,[d,h]=m.useState(!1);Dt(()=>h(!0),[]);const p=i||d&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return p?bs.createPortal(s.jsx(Be.div,{...u,ref:o}),p):null},"Portal")),cN=Object.defineProperty,el=(a,l)=>cN(a,"name",{value:l,configurable:!0});function tb(a,l){return m.useReducer((o,i)=>l[o][i]??o,a)}el(tb,"useStateMachine");var al=el(a=>{const{present:l,children:o}=a,i=nb(l),u=typeof o=="function"?o({present:i.isPresent}):m.Children.only(o),d=ab(i.ref,lb(u));return typeof o=="function"||i.isPresent?m.cloneElement(u,{ref:d}):null},"Presence");function nb(a){const[l,o]=m.useState(),i=m.useRef(null),u=m.useRef(a),d=m.useRef("none"),h=m.useRef(void 0),p=a?"mounted":"unmounted",[g,v]=tb(p,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{g==="mounted"?(d.current=h.current??us(i.current),h.current=void 0):d.current="none"},[g]),Dt(()=>{const x=i.current,y=u.current;if(y!==a){const w=d.current,C=us(x);a?(h.current=C,v("MOUNT")):C==="none"||(x==null?void 0:x.display)==="none"?v("UNMOUNT"):v(y&&w!==C?"ANIMATION_OUT":"UNMOUNT"),u.current=a}},[a,v]),Dt(()=>{if(l){let x;const y=l.ownerDocument.defaultView??window,S=el(C=>{const j=us(i.current).includes(CSS.escape(C.animationName));if(C.target===l&&j&&(v("ANIMATION_END"),!u.current)){const N=l.style.animationFillMode;l.style.animationFillMode="forwards",x=y.setTimeout(()=>{l.style.animationFillMode==="forwards"&&(l.style.animationFillMode=N)})}},"handleAnimationEnd"),w=el(C=>{C.target===l&&(d.current=us(i.current))},"handleAnimationStart");return l.addEventListener("animationstart",w),l.addEventListener("animationcancel",S),l.addEventListener("animationend",S),()=>{y.clearTimeout(x),l.removeEventListener("animationstart",w),l.removeEventListener("animationcancel",S),l.removeEventListener("animationend",S)}}else v("ANIMATION_END")},[l,v]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:m.useCallback(x=>{if(x){const y=getComputedStyle(x);i.current=y,h.current=us(y)}else i.current=null;o(x)},[])}}el(nb,"usePresence");function nh(a,l){if(typeof a=="function")return a(l);a!=null&&(a.current=l)}el(nh,"setRef");function ab(...a){const l=m.useRef(a);return l.current=a,m.useCallback(o=>{const i=l.current;let u=!1;const d=i.map(h=>{const p=nh(h,o);return!u&&typeof p=="function"&&(u=!0),p});if(u)return()=>{for(let h=0;h<d.length;h++){const p=d[h];typeof p=="function"?p():nh(i[h],null)}}},[])}el(ab,"useStableComposedRefs");function us(a){return(a==null?void 0:a.animationName)||"none"}el(us,"getAnimationName");function lb(a){var i,u;let l=(i=Object.getOwnPropertyDescriptor(a.props,"ref"))==null?void 0:i.get,o=l&&"isReactWarning"in l&&l.isReactWarning;return o?a.ref:(l=(u=Object.getOwnPropertyDescriptor(a,"ref"))==null?void 0:u.get,o=l&&"isReactWarning"in l&&l.isReactWarning,o?a.props.ref:a.props.ref||a.ref)}el(lb,"getElementRef");var uN=Object.defineProperty,Yh=(a,l)=>uN(a,"name",{value:l,configurable:!0}),Of=!1;function rb(){const[a,l]=m.useState(Of);return m.useEffect(()=>{Of||(Of=!0,l(!0))},[]),a}Yh(rb,"useIsHydrated");var sb=gs[" useSyncExternalStore ".trim().toString()];function ob(){return()=>{}}Yh(ob,"subscribe");function ib(){return sb(ob,()=>!0,()=>!1)}Yh(ib,"useIsHydratedModern");var dN=typeof sb=="function"?ib:rb,fN=Object.defineProperty,pr=(a,l)=>fN(a,"name",{value:l,configurable:!0}),kf="rovingFocusGroup.onEntryFocus",hN={bubbles:!1,cancelable:!0},Gc="RovingFocusGroup",[ah,cb,mN]=zc(Gc),[pN,Yc]=fn(Gc,[mN]),[gN,vN]=pN(Gc),xN=m.forwardRef(pr(function(l,o){return s.jsx(ah.Provider,{scope:l.__scopeRovingFocusGroup,children:s.jsx(ah.Slot,{scope:l.__scopeRovingFocusGroup,children:s.jsx(yN,{...l,ref:o})})})},"RovingFocusGroup")),yN=m.forwardRef(pr(function(l,o){const{__scopeRovingFocusGroup:i,orientation:u,loop:d=!1,dir:h,currentTabStopId:p,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:v,onEntryFocus:x,preventScrollOnEntryFocus:y=!1,...S}=l,w=m.useRef(null),C=Ie(o,w),E=zo(h),[j,N]=Ja({prop:p,defaultProp:g??null,onChange:v,caller:Gc}),[M,T]=m.useState(!1),_=$n(x),O=cb(i),A=m.useRef(!1),[H,z]=m.useState(0);return m.useEffect(()=>{const K=w.current;if(K)return K.addEventListener(kf,_),()=>K.removeEventListener(kf,_)},[_]),s.jsx(gN,{scope:i,orientation:u,dir:E,loop:d,currentTabStopId:j,onItemFocus:m.useCallback(K=>N(K),[N]),onItemShiftTab:m.useCallback(()=>T(!0),[]),onFocusableItemAdd:m.useCallback(()=>z(K=>K+1),[]),onFocusableItemRemove:m.useCallback(()=>z(K=>K-1),[]),children:s.jsx(Be.div,{tabIndex:M||H===0?-1:0,"data-orientation":u,...S,ref:C,style:{outline:"none",...l.style},onMouseDown:Ee(l.onMouseDown,()=>{A.current=!0}),onFocus:Ee(l.onFocus,K=>{const se=!A.current;if(K.target===K.currentTarget&&se&&!M){const X=new CustomEvent(kf,hN);if(K.currentTarget.dispatchEvent(X),!X.defaultPrevented){const I=O().filter($=>$.focusable),re=I.find($=>$.active),ee=I.find($=>$.id===j),U=[re,ee,...I].filter(Boolean).map($=>$.ref.current);$h(U,y)}}A.current=!1}),onBlur:Ee(l.onBlur,()=>T(!1))})})},"RovingFocusGroupImpl")),bN="RovingFocusGroupItem",SN=m.forwardRef(pr(function(l,o){const{__scopeRovingFocusGroup:i,focusable:u=!0,active:d=!1,tabStopId:h,children:p,...g}=l,v=ga(),x=h||v,y=vN(bN,i),S=y.currentTabStopId===x,w=cb(i),{onFocusableItemAdd:C,onFocusableItemRemove:E,currentTabStopId:j}=y,N=dN();return Dt(()=>{if(!(!N||!u))return C(),()=>E()},[N,u,C,E]),m.useEffect(()=>{if(!(N||!u))return C(),()=>E()},[N,u,C,E]),s.jsx(ah.ItemSlot,{scope:i,id:x,focusable:u,active:d,children:s.jsx(Be.span,{tabIndex:S?0:-1,"data-orientation":y.orientation,...g,ref:o,onMouseDown:Ee(l.onMouseDown,M=>{u?y.onItemFocus(x):M.preventDefault()}),onFocus:Ee(l.onFocus,()=>y.onItemFocus(x)),onKeyDown:Ee(l.onKeyDown,M=>{if(M.key==="Tab"&&M.shiftKey){y.onItemShiftTab();return}if(M.target!==M.currentTarget)return;const T=db(M,y.orientation,y.dir);if(T!==void 0){if(M.metaKey||M.ctrlKey||M.altKey||M.shiftKey)return;M.preventDefault();let O=w().filter(A=>A.focusable).map(A=>A.ref.current);if(T==="last")O.reverse();else if(T==="prev"||T==="next"){T==="prev"&&O.reverse();const A=O.indexOf(M.currentTarget);O=y.loop?fb(O,A+1):O.slice(A+1)}setTimeout(()=>$h(O))}}),children:typeof p=="function"?p({isCurrentTabStop:S,hasTabStop:j!=null}):p})})},"RovingFocusGroupItem")),wN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ub(a,l){return l!=="rtl"?a:a==="ArrowLeft"?"ArrowRight":a==="ArrowRight"?"ArrowLeft":a}pr(ub,"getDirectionAwareKey");function db(a,l,o){const i=ub(a.key,o);if(!(l==="vertical"&&["ArrowLeft","ArrowRight"].includes(i))&&!(l==="horizontal"&&["ArrowUp","ArrowDown"].includes(i)))return wN[i]}pr(db,"getFocusIntent");function $h(a,l=!1){const o=document.activeElement;for(const i of a)if(i===o||(i.focus({preventScroll:l}),document.activeElement!==o))return}pr($h,"focusFirst");function fb(a,l){return a.map((o,i)=>a[(l+i)%a.length])}pr(fb,"wrapArray");var hb=xN,mb=SN,jN=function(a){if(typeof document>"u")return null;var l=Array.isArray(a)?a[0]:a;return l.ownerDocument.body},os=new WeakMap,lc=new WeakMap,rc={},zf=0,pb=function(a){return a&&(a.host||pb(a.parentNode))},CN=function(a,l){return l.map(function(o){if(a.contains(o))return o;var i=pb(o);return i&&a.contains(i)?i:(console.error("aria-hidden",o,"in not contained inside",a,". Doing nothing"),null)}).filter(function(o){return!!o})},EN=function(a,l,o,i){var u=CN(l,Array.isArray(a)?a:[a]);rc[o]||(rc[o]=new WeakMap);var d=rc[o],h=[],p=new Set,g=new Set(u),v=function(y){!y||p.has(y)||(p.add(y),v(y.parentNode))};u.forEach(v);var x=function(y){!y||g.has(y)||Array.prototype.forEach.call(y.children,function(S){if(p.has(S))x(S);else try{var w=S.getAttribute(i),C=w!==null&&w!=="false",E=(os.get(S)||0)+1,j=(d.get(S)||0)+1;os.set(S,E),d.set(S,j),h.push(S),E===1&&C&&lc.set(S,!0),j===1&&S.setAttribute(o,"true"),C||S.setAttribute(i,"true")}catch(N){console.error("aria-hidden: cannot operate on ",S,N)}})};return x(l),p.clear(),zf++,function(){h.forEach(function(y){var S=os.get(y)-1,w=d.get(y)-1;os.set(y,S),d.set(y,w),S||(lc.has(y)||y.removeAttribute(i),lc.delete(y)),w||y.removeAttribute(o)}),zf--,zf||(os=new WeakMap,os=new WeakMap,lc=new WeakMap,rc={})}},Kh=function(a,l,o){o===void 0&&(o="data-aria-hidden");var i=Array.from(Array.isArray(a)?a:[a]),u=jN(a);return u?(i.push.apply(i,Array.from(u.querySelectorAll("[aria-live], script"))),EN(i,u,o,"aria-hidden")):function(){return null}},ma=function(){return ma=Object.assign||function(l){for(var o,i=1,u=arguments.length;i<u;i++){o=arguments[i];for(var d in o)Object.prototype.hasOwnProperty.call(o,d)&&(l[d]=o[d])}return l},ma.apply(this,arguments)};function gb(a,l){var o={};for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&l.indexOf(i)<0&&(o[i]=a[i]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,i=Object.getOwnPropertySymbols(a);u<i.length;u++)l.indexOf(i[u])<0&&Object.prototype.propertyIsEnumerable.call(a,i[u])&&(o[i[u]]=a[i[u]]);return o}function RN(a,l,o){if(o||arguments.length===2)for(var i=0,u=l.length,d;i<u;i++)(d||!(i in l))&&(d||(d=Array.prototype.slice.call(l,0,i)),d[i]=l[i]);return a.concat(d||Array.prototype.slice.call(l))}var xc="right-scroll-bar-position",yc="width-before-scroll-bar",NN="with-scroll-bars-hidden",TN="--removed-body-scroll-bar-size";function Lf(a,l){return typeof a=="function"?a(l):a&&(a.current=l),a}function AN(a,l){var o=m.useState(function(){return{value:a,callback:l,facade:{get current(){return o.value},set current(i){var u=o.value;u!==i&&(o.value=i,o.callback(i,u))}}}})[0];return o.callback=l,o.facade}var MN=typeof window<"u"?m.useLayoutEffect:m.useEffect,ry=new WeakMap;function DN(a,l){var o=AN(null,function(i){return a.forEach(function(u){return Lf(u,i)})});return MN(function(){var i=ry.get(o);if(i){var u=new Set(i),d=new Set(a),h=o.current;u.forEach(function(p){d.has(p)||Lf(p,null)}),d.forEach(function(p){u.has(p)||Lf(p,h)})}ry.set(o,a)},[a]),o}function _N(a){return a}function ON(a,l){l===void 0&&(l=_N);var o=[],i=!1,u={read:function(){if(i)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return o.length?o[o.length-1]:a},useMedium:function(d){var h=l(d,i);return o.push(h),function(){o=o.filter(function(p){return p!==h})}},assignSyncMedium:function(d){for(i=!0;o.length;){var h=o;o=[],h.forEach(d)}o={push:function(p){return d(p)},filter:function(){return o}}},assignMedium:function(d){i=!0;var h=[];if(o.length){var p=o;o=[],p.forEach(d),h=o}var g=function(){var x=h;h=[],x.forEach(d)},v=function(){return Promise.resolve().then(g)};v(),o={push:function(x){h.push(x),v()},filter:function(x){return h=h.filter(x),o}}}};return u}function kN(a){a===void 0&&(a={});var l=ON(null);return l.options=ma({async:!0,ssr:!1},a),l}var vb=function(a){var l=a.sideCar,o=gb(a,["sideCar"]);if(!l)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var i=l.read();if(!i)throw new Error("Sidecar medium not found");return m.createElement(i,ma({},o))};vb.isSideCarExport=!0;function zN(a,l){return a.useMedium(l),vb}var xb=kN(),Uf=function(){},$c=m.forwardRef(function(a,l){var o=m.useRef(null),i=m.useState({onScrollCapture:Uf,onWheelCapture:Uf,onTouchMoveCapture:Uf}),u=i[0],d=i[1],h=a.forwardProps,p=a.children,g=a.className,v=a.removeScrollBar,x=a.enabled,y=a.shards,S=a.sideCar,w=a.noRelative,C=a.noIsolation,E=a.inert,j=a.allowPinchZoom,N=a.as,M=N===void 0?"div":N,T=a.gapMode,_=gb(a,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=S,A=DN([o,l]),H=ma(ma({},_),u);return m.createElement(m.Fragment,null,x&&m.createElement(O,{sideCar:xb,removeScrollBar:v,shards:y,noRelative:w,noIsolation:C,inert:E,setCallbacks:d,allowPinchZoom:!!j,lockRef:o,gapMode:T}),h?m.cloneElement(m.Children.only(p),ma(ma({},H),{ref:A})):m.createElement(M,ma({},H,{className:g,ref:A}),p))});$c.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};$c.classNames={fullWidth:yc,zeroRight:xc};var LN=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function UN(){if(!document)return null;var a=document.createElement("style");a.type="text/css";var l=LN();return l&&a.setAttribute("nonce",l),a}function BN(a,l){a.styleSheet?a.styleSheet.cssText=l:a.appendChild(document.createTextNode(l))}function HN(a){var l=document.head||document.getElementsByTagName("head")[0];l.appendChild(a)}var PN=function(){var a=0,l=null;return{add:function(o){a==0&&(l=UN())&&(BN(l,o),HN(l)),a++},remove:function(){a--,!a&&l&&(l.parentNode&&l.parentNode.removeChild(l),l=null)}}},qN=function(){var a=PN();return function(l,o){m.useEffect(function(){return a.add(l),function(){a.remove()}},[l&&o])}},yb=function(){var a=qN(),l=function(o){var i=o.styles,u=o.dynamic;return a(i,u),null};return l},IN={left:0,top:0,right:0,gap:0},Bf=function(a){return parseInt(a||"",10)||0},VN=function(a){var l=window.getComputedStyle(document.body),o=l[a==="padding"?"paddingLeft":"marginLeft"],i=l[a==="padding"?"paddingTop":"marginTop"],u=l[a==="padding"?"paddingRight":"marginRight"];return[Bf(o),Bf(i),Bf(u)]},GN=function(a){if(a===void 0&&(a="margin"),typeof window>"u")return IN;var l=VN(a),o=document.documentElement.clientWidth,i=window.innerWidth;return{left:l[0],top:l[1],right:l[2],gap:Math.max(0,i-o+l[2]-l[0])}},YN=yb(),ms="data-scroll-locked",$N=function(a,l,o,i){var u=a.left,d=a.top,h=a.right,p=a.gap;return o===void 0&&(o="margin"),`
|
|
286
|
+
.`.concat(NN,` {
|
|
287
|
+
overflow: hidden `).concat(i,`;
|
|
288
|
+
padding-right: `).concat(p,"px ").concat(i,`;
|
|
289
|
+
}
|
|
290
|
+
body[`).concat(ms,`] {
|
|
291
|
+
overflow: hidden `).concat(i,`;
|
|
292
|
+
overscroll-behavior: contain;
|
|
293
|
+
`).concat([l&&"position: relative ".concat(i,";"),o==="margin"&&`
|
|
294
|
+
padding-left: `.concat(u,`px;
|
|
295
|
+
padding-top: `).concat(d,`px;
|
|
296
|
+
padding-right: `).concat(h,`px;
|
|
297
|
+
margin-left:0;
|
|
298
|
+
margin-top:0;
|
|
299
|
+
margin-right: `).concat(p,"px ").concat(i,`;
|
|
300
|
+
`),o==="padding"&&"padding-right: ".concat(p,"px ").concat(i,";")].filter(Boolean).join(""),`
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.`).concat(xc,` {
|
|
304
|
+
right: `).concat(p,"px ").concat(i,`;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.`).concat(yc,` {
|
|
308
|
+
margin-right: `).concat(p,"px ").concat(i,`;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.`).concat(xc," .").concat(xc,` {
|
|
312
|
+
right: 0 `).concat(i,`;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.`).concat(yc," .").concat(yc,` {
|
|
316
|
+
margin-right: 0 `).concat(i,`;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
body[`).concat(ms,`] {
|
|
320
|
+
`).concat(TN,": ").concat(p,`px;
|
|
321
|
+
}
|
|
322
|
+
`)},sy=function(){var a=parseInt(document.body.getAttribute(ms)||"0",10);return isFinite(a)?a:0},KN=function(){m.useEffect(function(){return document.body.setAttribute(ms,(sy()+1).toString()),function(){var a=sy()-1;a<=0?document.body.removeAttribute(ms):document.body.setAttribute(ms,a.toString())}},[])},XN=function(a){var l=a.noRelative,o=a.noImportant,i=a.gapMode,u=i===void 0?"margin":i;KN();var d=m.useMemo(function(){return GN(u)},[u]);return m.createElement(YN,{styles:$N(d,!l,u,o?"":"!important")})},lh=!1;if(typeof window<"u")try{var sc=Object.defineProperty({},"passive",{get:function(){return lh=!0,!0}});window.addEventListener("test",sc,sc),window.removeEventListener("test",sc,sc)}catch{lh=!1}var is=lh?{passive:!1}:!1,FN=function(a){return a.tagName==="TEXTAREA"},bb=function(a,l){if(!(a instanceof Element))return!1;var o=window.getComputedStyle(a);return o[l]!=="hidden"&&!(o.overflowY===o.overflowX&&!FN(a)&&o[l]==="visible")},QN=function(a){return bb(a,"overflowY")},ZN=function(a){return bb(a,"overflowX")},oy=function(a,l){var o=l.ownerDocument,i=l;do{typeof ShadowRoot<"u"&&i instanceof ShadowRoot&&(i=i.host);var u=Sb(a,i);if(u){var d=wb(a,i),h=d[1],p=d[2];if(h>p)return!0}i=i.parentNode}while(i&&i!==o.body);return!1},JN=function(a){var l=a.scrollTop,o=a.scrollHeight,i=a.clientHeight;return[l,o,i]},WN=function(a){var l=a.scrollLeft,o=a.scrollWidth,i=a.clientWidth;return[l,o,i]},Sb=function(a,l){return a==="v"?QN(l):ZN(l)},wb=function(a,l){return a==="v"?JN(l):WN(l)},eT=function(a,l){return a==="h"&&l==="rtl"?-1:1},tT=function(a,l,o,i,u){var d=eT(a,window.getComputedStyle(l).direction),h=d*i,p=o.target,g=l.contains(p),v=!1,x=h>0,y=0,S=0;do{if(!p)break;var w=wb(a,p),C=w[0],E=w[1],j=w[2],N=E-j-d*C;(C||N)&&Sb(a,p)&&(y+=N,S+=C);var M=p.parentNode;p=M&&M.nodeType===Node.DOCUMENT_FRAGMENT_NODE?M.host:M}while(!g&&p!==document.body||g&&(l.contains(p)||l===p));return(x&&Math.abs(y)<1||!x&&Math.abs(S)<1)&&(v=!0),v},oc=function(a){return"changedTouches"in a?[a.changedTouches[0].clientX,a.changedTouches[0].clientY]:[0,0]},iy=function(a){return[a.deltaX,a.deltaY]},cy=function(a){return a&&"current"in a?a.current:a},nT=function(a,l){return a[0]===l[0]&&a[1]===l[1]},aT=function(a){return`
|
|
323
|
+
.block-interactivity-`.concat(a,` {pointer-events: none;}
|
|
324
|
+
.allow-interactivity-`).concat(a,` {pointer-events: all;}
|
|
325
|
+
`)},lT=0,cs=[];function rT(a){var l=m.useRef([]),o=m.useRef([0,0]),i=m.useRef(),u=m.useState(lT++)[0],d=m.useState(yb)[0],h=m.useRef(a);m.useEffect(function(){h.current=a},[a]),m.useEffect(function(){if(a.inert){document.body.classList.add("block-interactivity-".concat(u));var E=RN([a.lockRef.current],(a.shards||[]).map(cy),!0).filter(Boolean);return E.forEach(function(j){return j.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),E.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(u))})}}},[a.inert,a.lockRef.current,a.shards]);var p=m.useCallback(function(E,j){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!h.current.allowPinchZoom;var N=oc(E),M=o.current,T="deltaX"in E?E.deltaX:M[0]-N[0],_="deltaY"in E?E.deltaY:M[1]-N[1],O,A=E.target,H=Math.abs(T)>Math.abs(_)?"h":"v";if("touches"in E&&H==="h"&&A.type==="range")return!1;var z=window.getSelection(),K=z&&z.anchorNode,se=K?K===A||K.contains(A):!1;if(se)return!1;var X=oy(H,A);if(!X)return!0;if(X?O=H:(O=H==="v"?"h":"v",X=oy(H,A)),!X)return!1;if(!i.current&&"changedTouches"in E&&(T||_)&&(i.current=O),!O)return!0;var I=i.current||O;return tT(I,j,E,I==="h"?T:_)},[]),g=m.useCallback(function(E){var j=E;if(!(!cs.length||cs[cs.length-1]!==d)){var N="deltaY"in j?iy(j):oc(j),M=l.current.filter(function(O){return O.name===j.type&&(O.target===j.target||j.target===O.shadowParent)&&nT(O.delta,N)})[0];if(M&&M.should){j.cancelable&&j.preventDefault();return}if(!M){var T=(h.current.shards||[]).map(cy).filter(Boolean).filter(function(O){return O.contains(j.target)}),_=T.length>0?p(j,T[0]):!h.current.noIsolation;_&&j.cancelable&&j.preventDefault()}}},[]),v=m.useCallback(function(E,j,N,M){var T={name:E,delta:j,target:N,should:M,shadowParent:sT(N)};l.current.push(T),setTimeout(function(){l.current=l.current.filter(function(_){return _!==T})},1)},[]),x=m.useCallback(function(E){o.current=oc(E),i.current=void 0},[]),y=m.useCallback(function(E){v(E.type,iy(E),E.target,p(E,a.lockRef.current))},[]),S=m.useCallback(function(E){v(E.type,oc(E),E.target,p(E,a.lockRef.current))},[]);m.useEffect(function(){return cs.push(d),a.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:S}),document.addEventListener("wheel",g,is),document.addEventListener("touchmove",g,is),document.addEventListener("touchstart",x,is),function(){cs=cs.filter(function(E){return E!==d}),document.removeEventListener("wheel",g,is),document.removeEventListener("touchmove",g,is),document.removeEventListener("touchstart",x,is)}},[]);var w=a.removeScrollBar,C=a.inert;return m.createElement(m.Fragment,null,C?m.createElement(d,{styles:aT(u)}):null,w?m.createElement(XN,{noRelative:a.noRelative,gapMode:a.gapMode}):null)}function sT(a){for(var l=null;a!==null;)a instanceof ShadowRoot&&(l=a.host,a=a.host),a=a.parentNode;return l}const oT=zN(xb,rT);var Kc=m.forwardRef(function(a,l){return m.createElement($c,ma({},a,{ref:l,sideCar:oT}))});Kc.classNames=$c.classNames;var iT=Object.defineProperty,it=(a,l)=>iT(a,"name",{value:l,configurable:!0}),cT=["Enter"," "],uT=["ArrowDown","PageUp","Home"],jb=["ArrowUp","PageDown","End"],dT=[...uT,...jb],Xc="Menu",[rh,fT,hT]=zc(Xc),[gr,Cb]=fn(Xc,[hT,Es,Yc]),Xh=Es(),Eb=Yc(),[mT,Uo]=gr(Xc),[pT,Fh]=gr(Xc),gT=it(a=>{const{__scopeMenu:l,open:o=!1,children:i,dir:u,onOpenChange:d,modal:h=!0}=a,p=Xh(l),[g,v]=m.useState(null),x=m.useRef(!1),y=$n(d),S=zo(u);return m.useEffect(()=>{const w=it(()=>{x.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},"handleKeyDown"),C=it(()=>x.current=!1,"handlePointer");return document.addEventListener("keydown",w,{capture:!0}),()=>{document.removeEventListener("keydown",w,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),m.useEffect(()=>{if(!o)return;const w=it(()=>y(!1),"handleBlur");return window.addEventListener("blur",w),()=>window.removeEventListener("blur",w)},[o,y]),s.jsx(W0,{...p,children:s.jsx(mT,{scope:l,open:o,onOpenChange:y,content:g,onContentChange:v,children:s.jsx(pT,{scope:l,onClose:m.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:x,dir:S,modal:h,children:i})})})},"Menu"),vT=m.forwardRef(it(function(l,o){const{__scopeMenu:i,...u}=l,d=Xh(i);return s.jsx(eb,{...d,...u,ref:o})},"MenuAnchor")),Rb="MenuPortal",[xT,yT]=gr(Rb,{forceMount:void 0}),bT=it(a=>{const{__scopeMenu:l,forceMount:o,children:i,container:u}=a,d=Uo(Rb,l);return s.jsx(xT,{scope:l,forceMount:o,children:s.jsx(al,{present:o||d.open,children:s.jsx(Gh,{asChild:!0,container:u,children:i})})})},"MenuPortal"),Ul="MenuContent",[ST,Nb]=gr(Ul),wT=m.forwardRef(it(function(l,o){const i=yT(Ul,l.__scopeMenu),{forceMount:u=i.forceMount,...d}=l,h=Uo(Ul,l.__scopeMenu),p=Fh(Ul,l.__scopeMenu);return s.jsx(rh.Provider,{scope:l.__scopeMenu,children:s.jsx(al,{present:u||h.open,children:s.jsx(rh.Slot,{scope:l.__scopeMenu,children:p.modal?s.jsx(jT,{...d,ref:o}):s.jsx(CT,{...d,ref:o})})})})},"MenuContent")),jT=m.forwardRef(it(function(l,o){const i=Uo(Ul,l.__scopeMenu),u=m.useRef(null),d=Ie(o,u);return m.useEffect(()=>{const h=u.current;if(h)return Kh(h)},[]),s.jsx(Tb,{...l,ref:d,trapFocus:i.open,disableOutsidePointerEvents:i.open,disableOutsideScroll:!0,onFocusOutside:Ee(l.onFocusOutside,h=>h.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentModal")),CT=m.forwardRef(it(function(l,o){const i=Uo(Ul,l.__scopeMenu);return s.jsx(Tb,{...l,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>i.onOpenChange(!1)})},"MenuRootContentNonModal")),ET=va("MenuContent.ScrollLock"),Tb=m.forwardRef(it(function(l,o){const{__scopeMenu:i,loop:u=!1,trapFocus:d,onOpenAutoFocus:h,onCloseAutoFocus:p,disableOutsidePointerEvents:g,onEntryFocus:v,onEscapeKeyDown:x,onPointerDownOutside:y,onFocusOutside:S,onInteractOutside:w,onDismiss:C,disableOutsideScroll:E,...j}=l,N=Uo(Ul,i),M=Fh(Ul,i),T=Xh(i),_=Eb(i),O=fT(i),[A,H]=m.useState(null),z=m.useRef(null),K=Ie(o,z,N.onContentChange),se=m.useRef(0),X=m.useRef(""),I=m.useRef(0),re=m.useRef(null),ee=m.useRef("right"),oe=m.useRef(0),U=E?Kc:m.Fragment,$=E?{as:ET,allowPinchZoom:!0}:void 0,le=it(Z=>{var fe,xe;const D=X.current+Z,q=O().filter(J=>!J.disabled),Q=document.activeElement,ae=(fe=q.find(J=>J.ref.current===Q))==null?void 0:fe.textValue,ce=q.map(J=>J.textValue),Se=Ob(ce,D,ae),ue=(xe=q.find(J=>J.textValue===Se))==null?void 0:xe.ref.current;it((function J(me){X.current=me,window.clearTimeout(se.current),me!==""&&(se.current=window.setTimeout(()=>J(""),1e3))}),"updateSearch")(D),ue&&setTimeout(()=>ue.focus())},"handleTypeaheadSearch");m.useEffect(()=>()=>window.clearTimeout(se.current),[]),Lo();const B=m.useCallback(Z=>{var q,Q;return ee.current===((q=re.current)==null?void 0:q.side)&&zb(Z,(Q=re.current)==null?void 0:Q.area)},[]);return s.jsx(ST,{scope:i,searchRef:X,onItemEnter:m.useCallback(Z=>{B(Z)&&Z.preventDefault()},[B]),onItemLeave:m.useCallback(Z=>{var D;B(Z)||((D=z.current)==null||D.focus(),H(null))},[B]),onTriggerLeave:m.useCallback(Z=>{B(Z)&&Z.preventDefault()},[B]),pointerGraceTimerRef:I,onPointerGraceIntentChange:m.useCallback(Z=>{re.current=Z},[]),children:s.jsx(U,{...$,children:s.jsx(zh,{asChild:!0,trapped:d,onMountAutoFocus:Ee(h,Z=>{var D;Z.preventDefault(),(D=z.current)==null||D.focus({preventScroll:!0})}),onUnmountAutoFocus:p,children:s.jsx(Lc,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:x,onPointerDownOutside:y,onFocusOutside:S,onInteractOutside:w,onDismiss:C,children:s.jsx(hb,{asChild:!0,..._,dir:M.dir,orientation:"vertical",loop:u,currentTabStopId:A,onCurrentTabStopIdChange:H,onEntryFocus:Ee(v,Z=>{M.isUsingKeyboardRef.current||Z.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(Vh,{role:"menu","aria-orientation":"vertical","data-state":Ab(N.open),"data-radix-menu-content":"",dir:M.dir,...T,...j,ref:K,style:{outline:"none",...j.style},onKeyDown:Ee(j.onKeyDown,Z=>{const q=Z.target.closest("[data-radix-menu-content]")===Z.currentTarget,Q=Z.ctrlKey||Z.altKey||Z.metaKey,ae=Z.key.length===1;q&&(Z.key==="Tab"&&Z.preventDefault(),!Q&&ae&&le(Z.key));const ce=z.current;if(Z.target!==ce||!dT.includes(Z.key))return;Z.preventDefault();const ue=O().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);jb.includes(Z.key)&&ue.reverse(),Db(ue)}),onBlur:Ee(l.onBlur,Z=>{Z.currentTarget.contains(Z.target)||(window.clearTimeout(se.current),X.current="")}),onPointerMove:Ee(l.onPointerMove,Rc(Z=>{const D=Z.target,q=oe.current!==Z.clientX;if(Z.currentTarget.contains(D)&&q){const Q=Z.clientX>oe.current?"right":"left";ee.current=Q,oe.current=Z.clientX}}))})})})})})})},"MenuContentImpl")),RT=m.forwardRef(it(function(l,o){const{__scopeMenu:i,...u}=l;return s.jsx(Be.div,{...u,ref:o})},"MenuLabel")),sh="MenuItem",uy="menu.itemSelect",NT=m.forwardRef(it(function(l,o){const{disabled:i=!1,onSelect:u,...d}=l,h=m.useRef(null),p=Fh(sh,l.__scopeMenu),g=Nb(sh,l.__scopeMenu),v=Ie(o,h),x=m.useRef(!1),y=it(()=>{const S=h.current;if(!i&&S){const w=new CustomEvent(uy,{bubbles:!0,cancelable:!0});S.addEventListener(uy,C=>u==null?void 0:u(C),{once:!0}),Dh(S,w),w.defaultPrevented?x.current=!1:p.onClose()}},"handleSelect");return s.jsx(TT,{...d,ref:v,disabled:i,onClick:Ee(l.onClick,y),onPointerDown:S=>{var w;(w=l.onPointerDown)==null||w.call(l,S),x.current=!0},onPointerUp:Ee(l.onPointerUp,S=>{var w;x.current||(w=S.currentTarget)==null||w.click()}),onKeyDown:Ee(l.onKeyDown,S=>{i||S.target!==S.currentTarget||g.searchRef.current!==""&&S.key===" "||cT.includes(S.key)&&(S.currentTarget.click(),S.preventDefault())})})},"MenuItem")),TT=m.forwardRef(it(function(l,o){const{__scopeMenu:i,disabled:u=!1,textValue:d,...h}=l,p=Nb(sh,i),g=Eb(i),v=m.useRef(null),x=Ie(o,v),[y,S]=m.useState(!1),[w,C]=m.useState("");return m.useEffect(()=>{const E=v.current;E&&C((E.textContent??"").trim())},[h.children]),s.jsx(rh.ItemSlot,{scope:i,disabled:u,textValue:d??w,children:s.jsx(mb,{asChild:!0,...g,focusable:!u,children:s.jsx(Be.div,{role:"menuitem","data-highlighted":y?"":void 0,"aria-disabled":u||void 0,"data-disabled":u?"":void 0,...h,ref:x,onPointerMove:Ee(l.onPointerMove,Rc(E=>{u?p.onItemLeave(E):(p.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Ee(l.onPointerLeave,Rc(E=>p.onItemLeave(E))),onFocus:Ee(l.onFocus,()=>S(!0)),onBlur:Ee(l.onBlur,()=>S(!1))})})})},"MenuItemImpl")),AT="MenuRadioGroup",[B_,H_]=gr(AT,{value:void 0,onValueChange:it(()=>{},"onValueChange")}),MT="MenuItemIndicator",[P_,q_]=gr(MT,{checked:!1}),DT=m.forwardRef(it(function(l,o){const{__scopeMenu:i,...u}=l;return s.jsx(Be.div,{role:"separator","aria-orientation":"horizontal",...u,ref:o})},"MenuSeparator")),_T="MenuSub",[I_,V_]=gr(_T);function Ab(a){return a?"open":"closed"}it(Ab,"getOpenState");function Mb(a){return a==="indeterminate"}it(Mb,"isIndeterminate");function OT(a){return Mb(a)?"indeterminate":a?"checked":"unchecked"}it(OT,"getCheckedState");function Db(a){const l=document.activeElement;for(const o of a)if(o===l||(o.focus(),document.activeElement!==l))return}it(Db,"focusFirst");function _b(a,l){return a.map((o,i)=>a[(l+i)%a.length])}it(_b,"wrapArray");function Ob(a,l,o){const u=l.length>1&&Array.from(l).every(v=>v===l[0])?l[0]:l,d=o?a.indexOf(o):-1;let h=_b(a,Math.max(d,0));u.length===1&&(h=h.filter(v=>v!==o));const g=h.find(v=>v.toLowerCase().startsWith(u.toLowerCase()));return g!==o?g:void 0}it(Ob,"getNextMatch");function kb(a,l){const{x:o,y:i}=a;let u=!1;for(let d=0,h=l.length-1;d<l.length;h=d++){const p=l[d],g=l[h],v=p.x,x=p.y,y=g.x,S=g.y;x>i!=S>i&&o<(y-v)*(i-x)/(S-x)+v&&(u=!u)}return u}it(kb,"isPointInPolygon");function zb(a,l){if(!l)return!1;const o={x:a.clientX,y:a.clientY};return kb(o,l)}it(zb,"isPointerInGraceArea");function Rc(a){return l=>l.pointerType==="mouse"?a(l):void 0}it(Rc,"whenMouse");var kT=gT,zT=vT,LT=bT,UT=wT,BT=RT,HT=NT,PT=DT,qT=Object.defineProperty,vr=(a,l)=>qT(a,"name",{value:l,configurable:!0}),Qh="DropdownMenu",[IT,G_]=fn(Qh,[Cb]),xr=Cb(),[VT,Lb]=IT(Qh),GT=vr(a=>{const{__scopeDropdownMenu:l,children:o,dir:i,open:u,defaultOpen:d,onOpenChange:h,modal:p=!0}=a,g=xr(l),v=m.useRef(null),[x,y]=Ja({prop:u,defaultProp:d??!1,onChange:h,caller:Qh});return s.jsx(VT,{scope:l,triggerId:ga(),triggerRef:v,contentId:ga(),open:x,onOpenChange:y,onOpenToggle:m.useCallback(()=>y(S=>!S),[y]),modal:p,children:s.jsx(kT,{...g,open:x,onOpenChange:y,dir:i,modal:p,children:o})})},"DropdownMenu"),YT="DropdownMenuTrigger",$T=m.forwardRef(vr(function(l,o){const{__scopeDropdownMenu:i,disabled:u=!1,...d}=l,h=Lb(YT,i),p=xr(i),g=Ie(o,h.triggerRef);return s.jsx(zT,{asChild:!0,...p,children:s.jsx(Be.button,{type:"button",id:h.triggerId,"aria-haspopup":"menu","aria-expanded":h.open,"aria-controls":h.open?h.contentId:void 0,"data-state":h.open?"open":"closed","data-disabled":u?"":void 0,disabled:u,...d,ref:g,onPointerDown:Ee(l.onPointerDown,v=>{!u&&v.button===0&&v.ctrlKey===!1&&(h.onOpenToggle(),h.open||v.preventDefault())}),onKeyDown:Ee(l.onKeyDown,v=>{u||(["Enter"," "].includes(v.key)&&h.onOpenToggle(),v.key==="ArrowDown"&&h.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(v.key)&&v.preventDefault())})})})},"DropdownMenuTrigger")),KT=vr(a=>{const{__scopeDropdownMenu:l,...o}=a,i=xr(l);return s.jsx(LT,{...i,...o})},"DropdownMenuPortal"),XT="DropdownMenuContent",FT=m.forwardRef(vr(function(l,o){const{__scopeDropdownMenu:i,...u}=l,d=Lb(XT,i),h=xr(i),p=m.useRef(!1);return s.jsx(UT,{id:d.contentId,"aria-labelledby":d.triggerId,...h,...u,ref:o,onCloseAutoFocus:Ee(l.onCloseAutoFocus,g=>{var v;p.current||(v=d.triggerRef.current)==null||v.focus(),p.current=!1,g.preventDefault()}),onInteractOutside:Ee(l.onInteractOutside,g=>{const v=g.detail.originalEvent,x=v.button===0&&v.ctrlKey===!0,y=v.button===2||x;(!d.modal||y)&&(p.current=!0)}),style:{...l.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"DropdownMenuContent")),QT=m.forwardRef(vr(function(l,o){const{__scopeDropdownMenu:i,...u}=l,d=xr(i);return s.jsx(BT,{...d,...u,ref:o})},"DropdownMenuLabel")),ZT=m.forwardRef(vr(function(l,o){const{__scopeDropdownMenu:i,...u}=l,d=xr(i);return s.jsx(HT,{...d,...u,ref:o})},"DropdownMenuItem")),JT=m.forwardRef(vr(function(l,o){const{__scopeDropdownMenu:i,...u}=l,d=xr(i);return s.jsx(PT,{...d,...u,ref:o})},"DropdownMenuSeparator")),WT=GT,eA=$T,tA=KT,Ub=FT,Bb=QT,Hb=ZT,Pb=JT;const nA=WT,aA=eA,qb=m.forwardRef(({className:a,sideOffset:l=4,...o},i)=>s.jsx(tA,{children:s.jsx(Ub,{ref:i,sideOffset:l,className:Re("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",a),...o})}));qb.displayName=Ub.displayName;const Ib=m.forwardRef(({className:a,inset:l,...o},i)=>s.jsx(Hb,{ref:i,className:Re("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",l&&"pl-8",a),...o}));Ib.displayName=Hb.displayName;const lA=m.forwardRef(({className:a,...l},o)=>s.jsx(Bb,{ref:o,className:Re("px-2 py-1.5 text-sm font-semibold",a),...l}));lA.displayName=Bb.displayName;const rA=m.forwardRef(({className:a,...l},o)=>s.jsx(Pb,{ref:o,className:Re("-mx-1 my-1 h-px bg-muted",a),...l}));rA.displayName=Pb.displayName;function sA(){const{theme:a,setTheme:l}=pE(),{user:o,logout:i}=Nh(),[u,d]=m.useState(!1),[h,p]=m.useState(null),g=Do(),v=a==="light"?bC:a==="dark"?hC:fC;return m.useEffect(()=>{we.get("/api/admin/update/check").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:[(h==null?void 0:h.hasUpdate)&&s.jsxs(he,{variant:"ghost",size:"sm",title:`New version available: v${h.latestVersion} — go to Settings → System to update`,onClick:()=>g("/settings?tab=system"),children:[s.jsx(tC,{className:"mr-1 h-4 w-4 text-blue-500"}),"Update v",h.latestVersion]}),s.jsx(he,{variant:"ghost",size:"icon",onClick:()=>l(a==="dark"?"light":"dark"),children:s.jsx(v,{className:"h-4 w-4"})}),s.jsxs(nA,{open:u,onOpenChange:d,children:[s.jsx(aA,{asChild:!0,children:s.jsx(he,{variant:"ghost",children:(o==null?void 0:o.username)??"admin"})}),s.jsx(qb,{align:"end",children:s.jsxs(Ib,{onClick:()=>void i(),children:[s.jsx(dC,{className:"mr-2 h-4 w-4"})," Sign out"]})})]})]})]})}const Ae=m.forwardRef(({className:a,type:l,...o},i)=>s.jsx("input",{type:l,className:Re("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",a),ref:i,...o}));Ae.displayName="Input";var oA=Object.defineProperty,iA=(a,l)=>oA(a,"name",{value:l,configurable:!0}),cA=m.forwardRef(iA(function(l,o){return s.jsx(Be.label,{...l,ref:o,onMouseDown:i=>{var d;i.target.closest("button, input, select, textarea")||((d=l.onMouseDown)==null||d.call(l,i),!i.defaultPrevented&&i.detail>1&&i.preventDefault())}})},"Label")),Vb=cA;const be=m.forwardRef(({className:a,...l},o)=>s.jsx(Vb,{ref:o,className:Re("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",a),...l}));be.displayName=Vb.displayName;const Xe=m.forwardRef(({className:a,...l},o)=>s.jsx("div",{ref:o,className:Re("rounded-lg border bg-card text-card-foreground shadow-sm",a),...l}));Xe.displayName="Card";const Fe=m.forwardRef(({className:a,...l},o)=>s.jsx("div",{ref:o,className:Re("flex flex-col space-y-1.5 p-6",a),...l}));Fe.displayName="CardHeader";const Qe=m.forwardRef(({className:a,...l},o)=>s.jsx("h3",{ref:o,className:Re("text-lg font-semibold leading-none tracking-tight",a),...l}));Qe.displayName="CardTitle";const on=m.forwardRef(({className:a,...l},o)=>s.jsx("p",{ref:o,className:Re("text-sm text-muted-foreground",a),...l}));on.displayName="CardDescription";const Ze=m.forwardRef(({className:a,...l},o)=>s.jsx("div",{ref:o,className:Re("p-6 pt-0",a),...l}));Ze.displayName="CardContent";const Gb=m.forwardRef(({className:a,...l},o)=>s.jsx("div",{ref:o,className:Re("flex items-center p-6 pt-0",a),...l}));Gb.displayName="CardFooter";var uA=a=>{switch(a){case"success":return hA;case"info":return pA;case"warning":return mA;case"error":return gA;default:return null}},dA=Array(12).fill(0),fA=({visible:a,className:l})=>ie.createElement("div",{className:["sonner-loading-wrapper",l].filter(Boolean).join(" "),"data-visible":a},ie.createElement("div",{className:"sonner-spinner"},dA.map((o,i)=>ie.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${i}`})))),hA=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"})),mA=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"})),pA=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"})),gA=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"})),vA=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"})),xA=()=>{let[a,l]=ie.useState(document.hidden);return ie.useEffect(()=>{let o=()=>{l(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),a},oh=1,yA=class{constructor(){this.subscribe=a=>(this.subscribers.push(a),()=>{let l=this.subscribers.indexOf(a);this.subscribers.splice(l,1)}),this.publish=a=>{this.subscribers.forEach(l=>l(a))},this.addToast=a=>{this.publish(a),this.toasts=[...this.toasts,a]},this.create=a=>{var l;let{message:o,...i}=a,u=typeof(a==null?void 0:a.id)=="number"||((l=a.id)==null?void 0:l.length)>0?a.id:oh++,d=this.toasts.find(p=>p.id===u),h=a.dismissible===void 0?!0:a.dismissible;return this.dismissedToasts.has(u)&&this.dismissedToasts.delete(u),d?this.toasts=this.toasts.map(p=>p.id===u?(this.publish({...p,...a,id:u,title:o}),{...p,...a,id:u,dismissible:h,title:o}):p):this.addToast({title:o,...i,dismissible:h,id:u}),u},this.dismiss=a=>(this.dismissedToasts.add(a),a||this.toasts.forEach(l=>{this.subscribers.forEach(o=>o({id:l.id,dismiss:!0}))}),this.subscribers.forEach(l=>l({id:a,dismiss:!0})),a),this.message=(a,l)=>this.create({...l,message:a}),this.error=(a,l)=>this.create({...l,message:a,type:"error"}),this.success=(a,l)=>this.create({...l,type:"success",message:a}),this.info=(a,l)=>this.create({...l,type:"info",message:a}),this.warning=(a,l)=>this.create({...l,type:"warning",message:a}),this.loading=(a,l)=>this.create({...l,type:"loading",message:a}),this.promise=(a,l)=>{if(!l)return;let o;l.loading!==void 0&&(o=this.create({...l,promise:a,type:"loading",message:l.loading,description:typeof l.description!="function"?l.description:void 0}));let i=a instanceof Promise?a:a(),u=o!==void 0,d,h=i.then(async g=>{if(d=["resolve",g],ie.isValidElement(g))u=!1,this.create({id:o,type:"default",message:g});else if(SA(g)&&!g.ok){u=!1;let v=typeof l.error=="function"?await l.error(`HTTP error! status: ${g.status}`):l.error,x=typeof l.description=="function"?await l.description(`HTTP error! status: ${g.status}`):l.description;this.create({id:o,type:"error",message:v,description:x})}else if(l.success!==void 0){u=!1;let v=typeof l.success=="function"?await l.success(g):l.success,x=typeof l.description=="function"?await l.description(g):l.description;this.create({id:o,type:"success",message:v,description:x})}}).catch(async g=>{if(d=["reject",g],l.error!==void 0){u=!1;let v=typeof l.error=="function"?await l.error(g):l.error,x=typeof l.description=="function"?await l.description(g):l.description;this.create({id:o,type:"error",message:v,description:x})}}).finally(()=>{var g;u&&(this.dismiss(o),o=void 0),(g=l.finally)==null||g.call(l)}),p=()=>new Promise((g,v)=>h.then(()=>d[0]==="reject"?v(d[1]):g(d[1])).catch(v));return typeof o!="string"&&typeof o!="number"?{unwrap:p}:Object.assign(o,{unwrap:p})},this.custom=(a,l)=>{let o=(l==null?void 0:l.id)||oh++;return this.create({jsx:a(o),id:o,...l}),o},this.getActiveToasts=()=>this.toasts.filter(a=>!this.dismissedToasts.has(a.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},sn=new yA,bA=(a,l)=>{let o=(l==null?void 0:l.id)||oh++;return sn.addToast({title:a,...l,id:o}),o},SA=a=>a&&typeof a=="object"&&"ok"in a&&typeof a.ok=="boolean"&&"status"in a&&typeof a.status=="number",wA=bA,jA=()=>sn.toasts,CA=()=>sn.getActiveToasts(),ve=Object.assign(wA,{success:sn.success,info:sn.info,warning:sn.warning,error:sn.error,custom:sn.custom,message:sn.message,promise:sn.promise,dismiss:sn.dismiss,loading:sn.loading},{getHistory:jA,getToasts:CA});function EA(a,{insertAt:l}={}){if(typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",l==="top"&&o.firstChild?o.insertBefore(i,o.firstChild):o.appendChild(i),i.styleSheet?i.styleSheet.cssText=a:i.appendChild(document.createTextNode(a))}EA(`: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%)}
|
|
326
|
+
`);function ic(a){return a.label!==void 0}var RA=3,NA="32px",TA="16px",dy=4e3,AA=356,MA=14,DA=20,_A=200;function na(...a){return a.filter(Boolean).join(" ")}function OA(a){let[l,o]=a.split("-"),i=[];return l&&i.push(l),o&&i.push(o),i}var kA=a=>{var l,o,i,u,d,h,p,g,v,x,y;let{invert:S,toast:w,unstyled:C,interacting:E,setHeights:j,visibleToasts:N,heights:M,index:T,toasts:_,expanded:O,removeToast:A,defaultRichColors:H,closeButton:z,style:K,cancelButtonStyle:se,actionButtonStyle:X,className:I="",descriptionClassName:re="",duration:ee,position:oe,gap:U,loadingIcon:$,expandByDefault:le,classNames:B,icons:Z,closeButtonAriaLabel:D="Close toast",pauseWhenPageIsHidden:q}=a,[Q,ae]=ie.useState(null),[ce,Se]=ie.useState(null),[ue,fe]=ie.useState(!1),[xe,J]=ie.useState(!1),[me,je]=ie.useState(!1),[Me,mt]=ie.useState(!1),[pt,bt]=ie.useState(!1),[St,Lt]=ie.useState(0),[hn,Qn]=ie.useState(0),mn=ie.useRef(w.duration||ee||dy),ja=ie.useRef(null),Ca=ie.useRef(null),$t=T===0,Jc=T+1<=N,Kt=w.type,Ea=w.dismissible!==!1,br=w.className||"",Wc=w.descriptionClassName||"",Vl=ie.useMemo(()=>M.findIndex(Te=>Te.toastId===w.id)||0,[M,w.id]),eu=ie.useMemo(()=>{var Te;return(Te=w.closeButton)!=null?Te:z},[w.closeButton,z]),Po=ie.useMemo(()=>w.duration||ee||dy,[w.duration,ee]),Ra=ie.useRef(0),wt=ie.useRef(0),Zn=ie.useRef(0),jt=ie.useRef(null),[tu,nu]=oe.split("-"),qo=ie.useMemo(()=>M.reduce((Te,Ke,st)=>st>=Vl?Te:Te+Ke.height,0),[M,Vl]),Gl=xA(),Sr=w.invert||S,sl=Kt==="loading";wt.current=ie.useMemo(()=>Vl*U+qo,[Vl,qo]),ie.useEffect(()=>{mn.current=Po},[Po]),ie.useEffect(()=>{fe(!0)},[]),ie.useEffect(()=>{let Te=Ca.current;if(Te){let Ke=Te.getBoundingClientRect().height;return Qn(Ke),j(st=>[{toastId:w.id,height:Ke,position:w.position},...st]),()=>j(st=>st.filter(Xt=>Xt.toastId!==w.id))}},[j,w.id]),ie.useLayoutEffect(()=>{if(!ue)return;let Te=Ca.current,Ke=Te.style.height;Te.style.height="auto";let st=Te.getBoundingClientRect().height;Te.style.height=Ke,Qn(st),j(Xt=>Xt.find(Ut=>Ut.toastId===w.id)?Xt.map(Ut=>Ut.toastId===w.id?{...Ut,height:st}:Ut):[{toastId:w.id,height:st,position:w.position},...Xt])},[ue,w.title,w.description,j,w.id]);let Vt=ie.useCallback(()=>{J(!0),Lt(wt.current),j(Te=>Te.filter(Ke=>Ke.toastId!==w.id)),setTimeout(()=>{A(w)},_A)},[w,A,j,wt]);ie.useEffect(()=>{if(w.promise&&Kt==="loading"||w.duration===1/0||w.type==="loading")return;let Te;return O||E||q&&Gl?(()=>{if(Zn.current<Ra.current){let Ke=new Date().getTime()-Ra.current;mn.current=mn.current-Ke}Zn.current=new Date().getTime()})():mn.current!==1/0&&(Ra.current=new Date().getTime(),Te=setTimeout(()=>{var Ke;(Ke=w.onAutoClose)==null||Ke.call(w,w),Vt()},mn.current)),()=>clearTimeout(Te)},[O,E,w,Kt,q,Gl,Vt]),ie.useEffect(()=>{w.delete&&Vt()},[Vt,w.delete]);function wr(){var Te,Ke,st;return Z!=null&&Z.loading?ie.createElement("div",{className:na(B==null?void 0:B.loader,(Te=w==null?void 0:w.classNames)==null?void 0:Te.loader,"sonner-loader"),"data-visible":Kt==="loading"},Z.loading):$?ie.createElement("div",{className:na(B==null?void 0:B.loader,(Ke=w==null?void 0:w.classNames)==null?void 0:Ke.loader,"sonner-loader"),"data-visible":Kt==="loading"},$):ie.createElement(fA,{className:na(B==null?void 0:B.loader,(st=w==null?void 0:w.classNames)==null?void 0:st.loader),visible:Kt==="loading"})}return ie.createElement("li",{tabIndex:0,ref:Ca,className:na(I,br,B==null?void 0:B.toast,(l=w==null?void 0:w.classNames)==null?void 0:l.toast,B==null?void 0:B.default,B==null?void 0:B[Kt],(o=w==null?void 0:w.classNames)==null?void 0:o[Kt]),"data-sonner-toast":"","data-rich-colors":(i=w.richColors)!=null?i:H,"data-styled":!(w.jsx||w.unstyled||C),"data-mounted":ue,"data-promise":!!w.promise,"data-swiped":pt,"data-removed":xe,"data-visible":Jc,"data-y-position":tu,"data-x-position":nu,"data-index":T,"data-front":$t,"data-swiping":me,"data-dismissible":Ea,"data-type":Kt,"data-invert":Sr,"data-swipe-out":Me,"data-swipe-direction":ce,"data-expanded":!!(O||le&&ue),style:{"--index":T,"--toasts-before":T,"--z-index":_.length-T,"--offset":`${xe?St:wt.current}px`,"--initial-height":le?"auto":`${hn}px`,...K,...w.style},onDragEnd:()=>{je(!1),ae(null),jt.current=null},onPointerDown:Te=>{sl||!Ea||(ja.current=new Date,Lt(wt.current),Te.target.setPointerCapture(Te.pointerId),Te.target.tagName!=="BUTTON"&&(je(!0),jt.current={x:Te.clientX,y:Te.clientY}))},onPointerUp:()=>{var Te,Ke,st,Xt;if(Me||!Ea)return;jt.current=null;let Ut=Number(((Te=Ca.current)==null?void 0:Te.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),oa=Number(((Ke=Ca.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ia=new Date().getTime()-((st=ja.current)==null?void 0:st.getTime()),Zt=Q==="x"?Ut:oa,Jn=Math.abs(Zt)/ia;if(Math.abs(Zt)>=DA||Jn>.11){Lt(wt.current),(Xt=w.onDismiss)==null||Xt.call(w,w),Se(Q==="x"?Ut>0?"right":"left":oa>0?"down":"up"),Vt(),mt(!0),bt(!1);return}je(!1),ae(null)},onPointerMove:Te=>{var Ke,st,Xt,Ut;if(!jt.current||!Ea||((Ke=window.getSelection())==null?void 0:Ke.toString().length)>0)return;let oa=Te.clientY-jt.current.y,ia=Te.clientX-jt.current.x,Zt=(st=a.swipeDirections)!=null?st:OA(oe);!Q&&(Math.abs(ia)>1||Math.abs(oa)>1)&&ae(Math.abs(ia)>Math.abs(oa)?"x":"y");let Jn={x:0,y:0};Q==="y"?(Zt.includes("top")||Zt.includes("bottom"))&&(Zt.includes("top")&&oa<0||Zt.includes("bottom")&&oa>0)&&(Jn.y=oa):Q==="x"&&(Zt.includes("left")||Zt.includes("right"))&&(Zt.includes("left")&&ia<0||Zt.includes("right")&&ia>0)&&(Jn.x=ia),(Math.abs(Jn.x)>0||Math.abs(Jn.y)>0)&&bt(!0),(Xt=Ca.current)==null||Xt.style.setProperty("--swipe-amount-x",`${Jn.x}px`),(Ut=Ca.current)==null||Ut.style.setProperty("--swipe-amount-y",`${Jn.y}px`)}},eu&&!w.jsx?ie.createElement("button",{"aria-label":D,"data-disabled":sl,"data-close-button":!0,onClick:sl||!Ea?()=>{}:()=>{var Te;Vt(),(Te=w.onDismiss)==null||Te.call(w,w)},className:na(B==null?void 0:B.closeButton,(u=w==null?void 0:w.classNames)==null?void 0:u.closeButton)},(d=Z==null?void 0:Z.close)!=null?d:vA):null,w.jsx||m.isValidElement(w.title)?w.jsx?w.jsx:typeof w.title=="function"?w.title():w.title:ie.createElement(ie.Fragment,null,Kt||w.icon||w.promise?ie.createElement("div",{"data-icon":"",className:na(B==null?void 0:B.icon,(h=w==null?void 0:w.classNames)==null?void 0:h.icon)},w.promise||w.type==="loading"&&!w.icon?w.icon||wr():null,w.type!=="loading"?w.icon||(Z==null?void 0:Z[Kt])||uA(Kt):null):null,ie.createElement("div",{"data-content":"",className:na(B==null?void 0:B.content,(p=w==null?void 0:w.classNames)==null?void 0:p.content)},ie.createElement("div",{"data-title":"",className:na(B==null?void 0:B.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:na(re,Wc,B==null?void 0:B.description,(v=w==null?void 0:w.classNames)==null?void 0:v.description)},typeof w.description=="function"?w.description():w.description):null),m.isValidElement(w.cancel)?w.cancel:w.cancel&&ic(w.cancel)?ie.createElement("button",{"data-button":!0,"data-cancel":!0,style:w.cancelButtonStyle||se,onClick:Te=>{var Ke,st;ic(w.cancel)&&Ea&&((st=(Ke=w.cancel).onClick)==null||st.call(Ke,Te),Vt())},className:na(B==null?void 0:B.cancelButton,(x=w==null?void 0:w.classNames)==null?void 0:x.cancelButton)},w.cancel.label):null,m.isValidElement(w.action)?w.action:w.action&&ic(w.action)?ie.createElement("button",{"data-button":!0,"data-action":!0,style:w.actionButtonStyle||X,onClick:Te=>{var Ke,st;ic(w.action)&&((st=(Ke=w.action).onClick)==null||st.call(Ke,Te),!Te.defaultPrevented&&Vt())},className:na(B==null?void 0:B.actionButton,(y=w==null?void 0:w.classNames)==null?void 0:y.actionButton)},w.action.label):null))};function fy(){if(typeof window>"u"||typeof document>"u")return"ltr";let a=document.documentElement.getAttribute("dir");return a==="auto"||!a?window.getComputedStyle(document.documentElement).direction:a}function zA(a,l){let o={};return[a,l].forEach((i,u)=>{let d=u===1,h=d?"--mobile-offset":"--offset",p=d?TA:NA;function g(v){["top","right","bottom","left"].forEach(x=>{o[`${h}-${x}`]=typeof v=="number"?`${v}px`:v})}typeof i=="number"||typeof i=="string"?g(i):typeof i=="object"?["top","right","bottom","left"].forEach(v=>{i[v]===void 0?o[`${h}-${v}`]=p:o[`${h}-${v}`]=typeof i[v]=="number"?`${i[v]}px`:i[v]}):g(p)}),o}var LA=m.forwardRef(function(a,l){let{invert:o,position:i="bottom-right",hotkey:u=["altKey","KeyT"],expand:d,closeButton:h,className:p,offset:g,mobileOffset:v,theme:x="light",richColors:y,duration:S,style:w,visibleToasts:C=RA,toastOptions:E,dir:j=fy(),gap:N=MA,loadingIcon:M,icons:T,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:O}=a,[A,H]=ie.useState([]),z=ie.useMemo(()=>Array.from(new Set([i].concat(A.filter(q=>q.position).map(q=>q.position)))),[A,i]),[K,se]=ie.useState([]),[X,I]=ie.useState(!1),[re,ee]=ie.useState(!1),[oe,U]=ie.useState(x!=="system"?x:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=ie.useRef(null),le=u.join("+").replace(/Key/g,"").replace(/Digit/g,""),B=ie.useRef(null),Z=ie.useRef(!1),D=ie.useCallback(q=>{H(Q=>{var ae;return(ae=Q.find(ce=>ce.id===q.id))!=null&&ae.delete||sn.dismiss(q.id),Q.filter(({id:ce})=>ce!==q.id)})},[]);return ie.useEffect(()=>sn.subscribe(q=>{if(q.dismiss){H(Q=>Q.map(ae=>ae.id===q.id?{...ae,delete:!0}:ae));return}setTimeout(()=>{G2.flushSync(()=>{H(Q=>{let ae=Q.findIndex(ce=>ce.id===q.id);return ae!==-1?[...Q.slice(0,ae),{...Q[ae],...q},...Q.slice(ae+1)]:[q,...Q]})})})}),[]),ie.useEffect(()=>{if(x!=="system"){U(x);return}if(x==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let q=window.matchMedia("(prefers-color-scheme: dark)");try{q.addEventListener("change",({matches:Q})=>{U(Q?"dark":"light")})}catch{q.addListener(({matches:ae})=>{try{U(ae?"dark":"light")}catch(ce){console.error(ce)}})}},[x]),ie.useEffect(()=>{A.length<=1&&I(!1)},[A]),ie.useEffect(()=>{let q=Q=>{var ae,ce;u.every(Se=>Q[Se]||Q.code===Se)&&(I(!0),(ae=$.current)==null||ae.focus()),Q.code==="Escape"&&(document.activeElement===$.current||(ce=$.current)!=null&&ce.contains(document.activeElement))&&I(!1)};return document.addEventListener("keydown",q),()=>document.removeEventListener("keydown",q)},[u]),ie.useEffect(()=>{if($.current)return()=>{B.current&&(B.current.focus({preventScroll:!0}),B.current=null,Z.current=!1)}},[$.current]),ie.createElement("section",{ref:l,"aria-label":`${_} ${le}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},z.map((q,Q)=>{var ae;let[ce,Se]=q.split("-");return A.length?ie.createElement("ol",{key:q,dir:j==="auto"?fy():j,tabIndex:-1,ref:$,className:p,"data-sonner-toaster":!0,"data-theme":oe,"data-y-position":ce,"data-lifted":X&&A.length>1&&!d,"data-x-position":Se,style:{"--front-toast-height":`${((ae=K[0])==null?void 0:ae.height)||0}px`,"--width":`${AA}px`,"--gap":`${N}px`,...w,...zA(g,v)},onBlur:ue=>{Z.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(Z.current=!1,B.current&&(B.current.focus({preventScroll:!0}),B.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||Z.current||(Z.current=!0,B.current=ue.relatedTarget)},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{re||I(!1)},onDragEnd:()=>I(!1),onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||ee(!0)},onPointerUp:()=>ee(!1)},A.filter(ue=>!ue.position&&Q===0||ue.position===q).map((ue,fe)=>{var xe,J;return ie.createElement(kA,{key:ue.id,icons:T,index:fe,toast:ue,defaultRichColors:y,duration:(xe=E==null?void 0:E.duration)!=null?xe:S,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:o,visibleToasts:C,closeButton:(J=E==null?void 0:E.closeButton)!=null?J:h,interacting:re,position:q,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,removeToast:D,toasts:A.filter(me=>me.position==ue.position),heights:K.filter(me=>me.position==ue.position),setHeights:se,expandByDefault:d,gap:N,loadingIcon:M,expanded:X,pauseWhenPageIsHidden:O,swipeDirections:a.swipeDirections})})):null}))});function UA(){const{login:a}=Nh(),[l,o]=m.useState("admin"),[i,u]=m.useState(""),[d,h]=m.useState(""),[p,g]=m.useState(""),[v,x]=m.useState(!1),[y,S]=m.useState(!1),w=Do(),C=dn();return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs(Xe,{className:"w-full max-w-sm",children:[s.jsxs(Fe,{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(Qe,{children:"Sign in"})]}),s.jsx(on,{children:"Enter your admin credentials."})]}),s.jsxs(Ze,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Username"}),s.jsx(Ae,{value:l,onChange:E=>o(E.target.value),autoFocus:!0})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Password"}),s.jsx(Ae,{type:"password",value:i,onChange:E=>u(E.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(Ae,{value:d,onChange:E=>h(E.target.value),placeholder:"123456",maxLength:6})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Recovery code (alternative)"}),s.jsx(Ae,{value:p,onChange:E=>g(E.target.value),placeholder:"ABCD12-EF3456"})]})]})]}),s.jsx("div",{className:"px-6 pb-6",children:s.jsx(he,{className:"w-full",disabled:y,onClick:async()=>{var E,j;S(!0);try{if((await a(l,i,d||void 0,p||void 0)).totpRequired){x(!0);return}const M=((j=(E=C.state)==null?void 0:E.from)==null?void 0:j.pathname)??"/";w(M,{replace:!0})}catch(N){ve.error(N.message)}finally{S(!1)}},children:"Sign in"})})]})})}function BA(){const[a,l]=m.useState("admin"),[o,i]=m.useState(""),[u,d]=m.useState(""),[h,p]=m.useState(!1),[g,v]=m.useState(!0);m.useEffect(()=>{we.get("/api/admin/setup/status").then(S=>v(!S.masterKeyConfigured)).catch(()=>v(!0))},[]);const x=!g||u.trim().length>=32,y=!h&&o.length>=12&&x;return s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:s.jsxs(Xe,{className:"w-full max-w-md",children:[s.jsxs(Fe,{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(Qe,{children:"Welcome to LateDev Router"})]}),s.jsx(on,{children:"Set up the administrator account to get started."})]}),s.jsxs(Ze,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Username"}),s.jsx(Ae,{value:a,onChange:S=>l(S.target.value)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Password (12+ chars)"}),s.jsx(Ae,{type:"password",value:o,onChange:S=>i(S.target.value)})]}),g&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Master encryption key (required, 32+ chars)"}),s.jsx(Ae,{type:"password",value:u,onChange:S=>d(S.target.value),placeholder:"Paste or generate a 32+ character key"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Provider API keys are encrypted with this key (AES-256-GCM). Store it somewhere safe — if it is lost, stored provider credentials cannot be recovered. Generate one with:"," ",s.jsx("code",{className:"break-all",children:`node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"`})]})]})]}),s.jsx(Gb,{children:s.jsx(he,{disabled:!y,onClick:async()=>{p(!0);try{await we.post("/api/admin/setup",{username:a,password:o,setupMasterKey:g?u.trim():void 0}),ve.success("Admin account created"),window.location.assign("/login")}catch(S){ve.error(S.message)}finally{p(!1)}},children:"Create admin"})})]})})}function wa({title:a,description:l,actions:o,className:i}){return s.jsxs("div",{className:Re("mb-6 flex items-start justify-between gap-4",i),children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:a}),l&&s.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:l})]}),o&&s.jsx("div",{className:"flex items-center gap-2",children:o})]})}const HA=m0("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",success:"border-transparent bg-emerald-600 text-white",warning:"border-transparent bg-amber-500 text-white",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function et({className:a,variant:l,...o}){return s.jsx("div",{className:Re(HA({variant:l}),a),...o})}function PA(){const[a,l]=m.useState(null);return m.useEffect(()=>{we.get("/api/admin/dashboard").then(l).catch(()=>l(null))},[]),a?s.jsxs("div",{children:[s.jsx(wa,{title:"Dashboard",description:"Operational summary for today",actions:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(he,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(ur,{to:"/providers",children:[s.jsx(Oo,{className:"mr-1 h-4 w-4"})," Provider"]})}),s.jsx(he,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(ur,{to:"/combos",children:[s.jsx(Zy,{className:"mr-1 h-4 w-4"})," Combo"]})}),s.jsx(he,{asChild:!0,variant:"outline",size:"sm",children:s.jsxs(ur,{to:"/api-keys",children:[s.jsx(Qy,{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(Xe,{children:[s.jsx(Fe,{className:"pb-1",children:s.jsx(Qe,{className:"text-sm text-muted-foreground",children:"Requests today"})}),s.jsx(Ze,{className:"text-2xl font-semibold",children:Mt(a.today.total)})]}),s.jsxs(Xe,{children:[s.jsx(Fe,{className:"pb-1",children:s.jsx(Qe,{className:"text-sm text-muted-foreground",children:"Success rate"})}),s.jsx(Ze,{className:"text-2xl font-semibold",children:a.today.total?kc(a.today.success/a.today.total):"—"})]}),s.jsxs(Xe,{children:[s.jsx(Fe,{className:"pb-1",children:s.jsx(Qe,{className:"text-sm text-muted-foreground",children:"Failed"})}),s.jsx(Ze,{className:"text-2xl font-semibold",children:Mt(a.today.failed)})]}),s.jsxs(Xe,{children:[s.jsx(Fe,{className:"pb-1",children:s.jsx(Qe,{className:"text-sm text-muted-foreground",children:"Tokens today"})}),s.jsx(Ze,{className:"text-2xl font-semibold",children:Mt(a.today.totalTokens)})]})]}),s.jsxs("div",{className:"mt-6 grid gap-4 lg:grid-cols-2",children:[s.jsxs(Xe,{children:[s.jsxs(Fe,{children:[s.jsx(Qe,{className:"text-base",children:"Provider health"}),s.jsxs(on,{children:[a.providers.length," configured"]})]}),s.jsxs(Ze,{className:"space-y-2",children:[a.providers.length===0&&s.jsxs("p",{className:"text-sm text-muted-foreground",children:["No providers yet. ",s.jsx(ur,{to:"/providers",className:"text-primary",children:"Add one"}),"."]}),a.providers.map(o=>s.jsxs("div",{className:"flex items-center justify-between rounded border p-2 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Jy,{className:"h-4 w-4 text-muted-foreground"}),s.jsx("span",{className:"font-medium",children:o.name}),s.jsx("span",{className:"text-xs text-muted-foreground",children:o.slug}),s.jsx(et,{variant:"outline",className:"ml-2",children:o.type})]}),s.jsx(et,{variant:o.health==="healthy"?"success":o.health==="down"?"destructive":"secondary",children:o.health})]},o.id))]})]}),s.jsxs(Xe,{children:[s.jsxs(Fe,{children:[s.jsx(Qe,{className:"text-base",children:"Recent failures"}),s.jsx(on,{children:"Today"})]}),s.jsxs(Ze,{className:"space-y-1 text-sm",children:[a.recentFailures.length===0&&s.jsx("p",{className:"text-muted-foreground",children:"No failures today."}),a.recentFailures.map(o=>{var i;return s.jsxs("div",{className:"flex items-center justify-between border-b py-1 last:border-0",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-mono text-xs",children:o.requestedModel}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:[o.errorType??`HTTP ${o.httpStatus}`," — ",(i=o.errorMessage)==null?void 0:i.slice(0,60)]})]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:Ah(o.createdAt)})]},o.id)})]})]})]})]}):s.jsx("div",{className:"text-muted-foreground",children:"Loading…"})}const Kn=m.forwardRef(({className:a,...l},o)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:o,className:Re("w-full caption-bottom text-sm",a),...l})}));Kn.displayName="Table";const Xn=m.forwardRef(({className:a,...l},o)=>s.jsx("thead",{ref:o,className:Re("[&_tr]:border-b",a),...l}));Xn.displayName="TableHeader";const Fn=m.forwardRef(({className:a,...l},o)=>s.jsx("tbody",{ref:o,className:Re("[&_tr:last-child]:border-0",a),...l}));Fn.displayName="TableBody";const Ye=m.forwardRef(({className:a,...l},o)=>s.jsx("tr",{ref:o,className:Re("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",a),...l}));Ye.displayName="TableRow";const pe=m.forwardRef(({className:a,...l},o)=>s.jsx("th",{ref:o,className:Re("h-10 px-2 text-left align-middle font-medium text-muted-foreground",a),...l}));pe.displayName="TableHead";const de=m.forwardRef(({className:a,...l},o)=>s.jsx("td",{ref:o,className:Re("p-2 align-middle",a),...l}));de.displayName="TableCell";var qA=Object.defineProperty,An=(a,l)=>qA(a,"name",{value:l,configurable:!0}),Zh="Dialog",[Yb,$b]=fn(Zh),[IA,sa]=Yb(Zh),Kb=An(a=>{const{__scopeDialog:l,children:o,open:i,defaultOpen:u,onOpenChange:d,modal:h=!0}=a,p=m.useRef(null),g=m.useRef(null),[v,x]=Ja({prop:i,defaultProp:u??!1,onChange:d,caller:Zh}),[y,S]=m.useState(0),[w,C]=m.useState(0);return s.jsx(IA,{scope:l,triggerRef:p,contentRef:g,contentId:ga(),titleId:ga(),descriptionId:ga(),titlePresent:y>0,descriptionPresent:w>0,setTitleCount:S,setDescriptionCount:C,open:v,onOpenChange:x,onOpenToggle:m.useCallback(()=>x(E=>!E),[x]),modal:h,children:o})},"Dialog"),VA="DialogTrigger",Xb=m.forwardRef(An(function(l,o){const{__scopeDialog:i,...u}=l,d=sa(VA,i),h=Ie(o,d.triggerRef);return s.jsx(Be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":Fc(d.open),...u,ref:h,onClick:Ee(l.onClick,d.onOpenToggle)})},"DialogTrigger")),Fb="DialogPortal",[GA,Qb]=Yb(Fb,{forceMount:void 0}),Zb=An(a=>{const{__scopeDialog:l,forceMount:o,children:i,container:u}=a,d=sa(Fb,l);return s.jsx(GA,{scope:l,forceMount:o,children:m.Children.map(i,h=>s.jsx(al,{present:o||d.open,children:s.jsx(Gh,{asChild:!0,container:u,children:h})}))})},"DialogPortal"),ih="DialogOverlay",Jh=m.forwardRef(An(function(l,o){const i=Qb(ih,l.__scopeDialog),{forceMount:u=i.forceMount,...d}=l,h=sa(ih,l.__scopeDialog);return h.modal?s.jsx(al,{present:u||h.open,children:s.jsx($A,{...d,ref:o})}):null},"DialogOverlay")),YA=va("DialogOverlay.RemoveScroll"),$A=m.forwardRef(An(function(l,o){const{__scopeDialog:i,...u}=l,d=sa(ih,i),h=T0(),p=Ie(o,h);return s.jsx(Kc,{as:YA,allowPinchZoom:!0,shards:[d.contentRef],children:s.jsx(Be.div,{"data-state":Fc(d.open),...u,ref:p,style:{pointerEvents:"auto",...u.style}})})},"DialogOverlayImpl")),No="DialogContent",Wh=m.forwardRef(An(function(l,o){const i=Qb(No,l.__scopeDialog),{forceMount:u=i.forceMount,...d}=l,h=sa(No,l.__scopeDialog);return s.jsx(al,{present:u||h.open,children:h.modal?s.jsx(KA,{...d,ref:o}):s.jsx(XA,{...d,ref:o})})},"DialogContent")),KA=m.forwardRef(An(function(l,o){const i=sa(No,l.__scopeDialog),u=m.useRef(null),d=Ie(o,i.contentRef,u);return m.useEffect(()=>{const h=u.current;if(h)return Kh(h)},[]),s.jsx(Jb,{...l,ref:d,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:Ee(l.onCloseAutoFocus,h=>{var p;h.preventDefault(),(p=i.triggerRef.current)==null||p.focus()}),onPointerDownOutside:Ee(l.onPointerDownOutside,h=>{const p=h.detail.originalEvent,g=p.button===0&&p.ctrlKey===!0;(p.button===2||g)&&h.preventDefault()}),onFocusOutside:Ee(l.onFocusOutside,h=>h.preventDefault())})},"DialogContentModal")),XA=m.forwardRef(An(function(l,o){const i=sa(No,l.__scopeDialog),u=m.useRef(!1),d=m.useRef(!1);return s.jsx(Jb,{...l,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:h=>{var p,g;(p=l.onCloseAutoFocus)==null||p.call(l,h),h.defaultPrevented||(u.current||(g=i.triggerRef.current)==null||g.focus(),h.preventDefault()),u.current=!1,d.current=!1},onInteractOutside:h=>{var v,x;(v=l.onInteractOutside)==null||v.call(l,h),h.defaultPrevented||(u.current=!0,h.detail.originalEvent.type==="pointerdown"&&(d.current=!0));const p=h.target;((x=i.triggerRef.current)==null?void 0:x.contains(p))&&h.preventDefault(),h.detail.originalEvent.type==="focusin"&&d.current&&h.preventDefault()}})},"DialogContentNonModal")),Jb=m.forwardRef(An(function(l,o){const{__scopeDialog:i,trapFocus:u,onOpenAutoFocus:d,onCloseAutoFocus:h,...p}=l,g=sa(No,i);return Lo(),s.jsx(s.Fragment,{children:s.jsx(zh,{asChild:!0,loop:!0,trapped:u,onMountAutoFocus:d,onUnmountAutoFocus:h,children:s.jsx(Lc,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionPresent?g.descriptionId:void 0,"aria-labelledby":g.titlePresent?g.titleId:void 0,"data-state":Fc(g.open),...p,ref:o,deferPointerDownOutside:!0,onDismiss:()=>g.onOpenChange(!1)})})})},"DialogContentImpl")),FA="DialogTitle",em=m.forwardRef(An(function(l,o){const{__scopeDialog:i,...u}=l,d=sa(FA,i),{setTitleCount:h}=d;return Dt(()=>(h(p=>p+1),()=>h(p=>p-1)),[h]),s.jsx(Be.h2,{id:d.titleId,...u,ref:o})},"DialogTitle")),QA="DialogDescription",tm=m.forwardRef(An(function(l,o){const{__scopeDialog:i,...u}=l,d=sa(QA,i),{setDescriptionCount:h}=d;return Dt(()=>(h(p=>p+1),()=>h(p=>p-1)),[h]),s.jsx(Be.p,{id:d.descriptionId,...u,ref:o})},"DialogDescription")),ZA="DialogClose",nm=m.forwardRef(An(function(l,o){const{__scopeDialog:i,...u}=l,d=sa(ZA,i);return s.jsx(Be.button,{type:"button",...u,ref:o,onClick:Ee(l.onClick,()=>d.onOpenChange(!1))})},"DialogClose"));function Fc(a){return a?"open":"closed"}An(Fc,"getState");const qn=Kb,Bo=Xb,JA=Zb,Wb=m.forwardRef(({className:a,...l},o)=>s.jsx(Jh,{ref:o,className:Re("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...l}));Wb.displayName=Jh.displayName;const jn=m.forwardRef(({className:a,children:l,...o},i)=>s.jsxs(JA,{children:[s.jsx(Wb,{}),s.jsxs(Wh,{ref:i,className:Re("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 sm:rounded-lg",a),...o,children:[l,s.jsxs(nm,{className:"absolute right-4 top-4 rounded-sm opacity-70 hover:opacity-100",children:[s.jsx(Oc,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));jn.displayName=Wh.displayName;const Cn=({className:a,...l})=>s.jsx("div",{className:Re("flex flex-col space-y-1.5 text-center sm:text-left",a),...l});Cn.displayName="DialogHeader";const In=({className:a,...l})=>s.jsx("div",{className:Re("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...l});In.displayName="DialogFooter";const En=m.forwardRef(({className:a,...l},o)=>s.jsx(em,{ref:o,className:Re("text-lg font-semibold leading-none tracking-tight",a),...l}));En.displayName=em.displayName;const ch=m.forwardRef(({className:a,...l},o)=>s.jsx(tm,{ref:o,className:Re("text-sm text-muted-foreground",a),...l}));ch.displayName=tm.displayName;var WA=Object.defineProperty,ll=(a,l)=>WA(a,"name",{value:l,configurable:!0}),eM="AlertDialog",[tM,Y_]=fn(eM,[$b]),rl=$b(),nM=ll(a=>{const{__scopeAlertDialog:l,...o}=a,i=rl(l);return s.jsx(Kb,{...i,...o,modal:!0})},"AlertDialog"),aM=m.forwardRef(ll(function(l,o){const{__scopeAlertDialog:i,...u}=l,d=rl(i);return s.jsx(Xb,{...d,...u,ref:o})},"AlertDialogTrigger")),lM=ll(a=>{const{__scopeAlertDialog:l,...o}=a,i=rl(l);return s.jsx(Zb,{...i,...o})},"AlertDialogPortal"),rM=m.forwardRef(ll(function(l,o){const{__scopeAlertDialog:i,...u}=l,d=rl(i);return s.jsx(Jh,{...d,...u,ref:o})},"AlertDialogOverlay")),sM="AlertDialogContent",[oM,iM]=tM(sM),cM=m.forwardRef(ll(function(l,o){const{__scopeAlertDialog:i,children:u,...d}=l,h=rl(i),p=m.useRef(null),g=Ie(o,p),v=m.useRef(null);return s.jsx(oM,{scope:i,cancelRef:v,children:s.jsx(Wh,{role:"alertdialog",...h,...d,ref:g,onOpenAutoFocus:Ee(d.onOpenAutoFocus,x=>{var y;x.preventDefault(),(y=v.current)==null||y.focus({preventScroll:!0})}),onPointerDownOutside:x=>x.preventDefault(),onInteractOutside:x=>x.preventDefault(),children:u})})},"AlertDialogContent")),uM=m.forwardRef(ll(function(l,o){const{__scopeAlertDialog:i,...u}=l,d=rl(i);return s.jsx(em,{...d,...u,ref:o})},"AlertDialogTitle")),dM=m.forwardRef(ll(function(l,o){const{__scopeAlertDialog:i,...u}=l,d=rl(i);return s.jsx(tm,{...d,...u,ref:o})},"AlertDialogDescription")),fM=m.forwardRef(ll(function(l,o){const{__scopeAlertDialog:i,...u}=l,d=rl(i);return s.jsx(nm,{...d,...u,ref:o})},"AlertDialogAction")),hM="AlertDialogCancel",mM=m.forwardRef(ll(function(l,o){const{__scopeAlertDialog:i,...u}=l,{cancelRef:d}=iM(hM,i),h=rl(i),p=Ie(o,d);return s.jsx(nm,{...h,...u,ref:p})},"AlertDialogCancel")),pM=nM,gM=aM,vM=lM,e1=rM,t1=cM,n1=fM,a1=mM,l1=uM,r1=dM;const s1=pM,xM=gM,yM=vM,o1=m.forwardRef(({className:a,...l},o)=>s.jsx(e1,{ref:o,className:Re("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...l}));o1.displayName=e1.displayName;const am=m.forwardRef(({className:a,...l},o)=>s.jsxs(yM,{children:[s.jsx(o1,{}),s.jsx(t1,{ref:o,className:Re("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg sm:max-w-[425px]",a),...l})]}));am.displayName=t1.displayName;const i1=({className:a,...l})=>s.jsx("div",{className:Re("flex flex-col space-y-2 text-center sm:text-left",a),...l}),c1=({className:a,...l})=>s.jsx("div",{className:Re("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...l}),lm=m.forwardRef(({className:a,...l},o)=>s.jsx(l1,{ref:o,className:Re("text-lg font-semibold",a),...l}));lm.displayName=l1.displayName;const rm=m.forwardRef(({className:a,...l},o)=>s.jsx(r1,{ref:o,className:Re("text-sm text-muted-foreground",a),...l}));rm.displayName=r1.displayName;const sm=m.forwardRef(({className:a,...l},o)=>s.jsx(n1,{ref:o,className:Re("inline-flex h-9 items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",a),...l}));sm.displayName=n1.displayName;const om=m.forwardRef(({className:a,...l},o)=>s.jsx(a1,{ref:o,className:Re("inline-flex h-9 items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium hover:bg-accent",a),...l}));om.displayName=a1.displayName;var bM=Object.defineProperty,SM=(a,l)=>bM(a,"name",{value:l,configurable:!0});function uh(a,[l,o]){return Math.min(o,Math.max(l,a))}SM(uh,"clamp");var wM=Object.defineProperty,jM=(a,l)=>wM(a,"name",{value:l,configurable:!0});function u1(a){const l=m.useRef({value:a,previous:a});return m.useMemo(()=>(l.current.value!==a&&(l.current.previous=l.current.value,l.current.value=a),l.current.previous),[a])}jM(u1,"usePrevious");var CM=Object.defineProperty,EM=(a,l)=>CM(a,"name",{value:l,configurable:!0}),d1=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"}),RM=m.forwardRef(EM(function(l,o){return s.jsx(Be.span,{...l,ref:o,style:{...d1,...l.style}})},"VisuallyHidden")),NM=RM,TM=Object.defineProperty,rt=(a,l)=>TM(a,"name",{value:l,configurable:!0}),AM=[" ","Enter","ArrowUp","ArrowDown"],MM=[" ","Enter"],ps="Select",[Qc,im,DM]=zc(ps),[yr,$_]=fn(ps,[DM,Es]),cm=Es(),[_M,Il]=yr(ps),[OM,kM]=yr(ps);function f1(a){const{__scopeSelect:l,children:o,open:i,defaultOpen:u,onOpenChange:d,value:h,defaultValue:p,onValueChange:g,dir:v,name:x,autoComplete:y,disabled:S,required:w,form:C,internal_do_not_use_render:E}=a,j=cm(l),[N,M]=m.useState(null),[T,_]=m.useState(null),[O,A]=m.useState(!1),H=zo(v),[z,K]=Ja({prop:i,defaultProp:u??!1,onChange:d,caller:ps}),[se,X]=Ja({prop:h,defaultProp:p,onChange:g,caller:ps}),I=m.useRef(null),re=m.useRef(se);m.useEffect(()=>{const q=C?N==null?void 0:N.ownerDocument.getElementById(C):N==null?void 0:N.form;if(q instanceof HTMLFormElement){const Q=rt(()=>X(re.current),"reset");return q.addEventListener("reset",Q),()=>q.removeEventListener("reset",Q)}},[C,N,X]);const ee=N?!!C||!!N.closest("form"):!0,[oe,U]=m.useState(new Set),$=ga(),le=Array.from(oe).map(q=>q.props.value).join(";"),B=m.useCallback(q=>{U(Q=>new Set(Q).add(q))},[]),Z=m.useCallback(q=>{U(Q=>{const ae=new Set(Q);return ae.delete(q),ae})},[]),D={required:w,trigger:N,onTriggerChange:M,valueNode:T,onValueNodeChange:_,valueNodeHasChildren:O,onValueNodeHasChildrenChange:A,contentId:$,value:se,onValueChange:X,open:z,onOpenChange:K,dir:H,triggerPointerDownPosRef:I,disabled:S,name:x,autoComplete:y,form:C,nativeOptions:oe,nativeSelectKey:le,isFormControl:ee};return s.jsx(W0,{...j,children:s.jsx(_M,{scope:l,...D,children:s.jsx(Qc.Provider,{scope:l,children:s.jsx(OM,{scope:l,onNativeOptionAdd:B,onNativeOptionRemove:Z,children:x1(E)?E(D):o})})})})}rt(f1,"SelectProvider");var zM=rt(a=>{const{__scopeSelect:l,children:o,...i}=a;return s.jsx(f1,{__scopeSelect:l,...i,internal_do_not_use_render:({isFormControl:u})=>s.jsxs(s.Fragment,{children:[o,u?s.jsx(aD,{__scopeSelect:l}):null]})})},"Select"),LM="SelectTrigger",h1=m.forwardRef(rt(function(l,o){const{__scopeSelect:i,disabled:u=!1,...d}=l,h=cm(i),p=Il(LM,i),g=p.disabled||u,v=Ie(o,p.onTriggerChange),x=im(i),y=m.useRef("touch"),[S,w,C]=um(j=>{const N=x().filter(_=>!_.disabled),M=N.find(_=>_.value===p.value),T=dm(N,j,M);T!==void 0&&p.onValueChange(T.value)}),E=rt(j=>{g||(p.onOpenChange(!0),C()),j&&(p.triggerPointerDownPosRef.current={x:Math.round(j.pageX),y:Math.round(j.pageY)})},"handleOpen");return s.jsx(eb,{asChild:!0,...h,children:s.jsx(Be.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":Ho(p.value)?"":void 0,...d,ref:v,onClick:Ee(d.onClick,j=>{j.currentTarget.focus(),y.current!=="mouse"&&E(j)}),onPointerDown:Ee(d.onPointerDown,j=>{y.current=j.pointerType;const N=j.target;N.hasPointerCapture(j.pointerId)&&N.releasePointerCapture(j.pointerId),j.button===0&&j.ctrlKey===!1&&j.pointerType==="mouse"&&(E(j),j.preventDefault())}),onKeyDown:Ee(d.onKeyDown,j=>{const N=S.current!=="";!(j.ctrlKey||j.altKey||j.metaKey)&&j.key.length===1&&w(j.key),!(N&&j.key===" ")&&AM.includes(j.key)&&(E(),j.preventDefault())})})})},"SelectTrigger")),UM="SelectValue",BM=m.forwardRef(rt(function(l,o){const{__scopeSelect:i,className:u,style:d,children:h,placeholder:p="",...g}=l,v=Il(UM,i),{onValueNodeHasChildrenChange:x}=v,y=h!==void 0,S=Ie(o,v.onValueNodeChange);Dt(()=>{x(y)},[x,y]);const w=Ho(v.value);return s.jsx(Be.span,{...g,asChild:w?!1:g.asChild,ref:S,style:{pointerEvents:"none"},children:s.jsx(m.Fragment,{children:w?p:h},w?"placeholder":"value")})},"SelectValue")),HM=m.forwardRef(rt(function(l,o){const{__scopeSelect:i,children:u,...d}=l;return s.jsx(Be.span,{"aria-hidden":!0,...d,ref:o,children:u||"▼"})},"SelectIcon")),PM="SelectPortal",[qM,IM]=yr(PM,{forceMount:void 0}),VM=rt(a=>{const{__scopeSelect:l,forceMount:o,...i}=a;return s.jsx(qM,{scope:a.__scopeSelect,forceMount:o,children:s.jsx(Gh,{asChild:!0,...i})})},"SelectPortal"),mr="SelectContent",m1=m.forwardRef(rt(function(l,o){const i=IM(mr,l.__scopeSelect),{forceMount:u=i.forceMount,...d}=l,h=Il(mr,l.__scopeSelect),[p,g]=m.useState();return Dt(()=>{g(new DocumentFragment)},[]),s.jsx(al,{present:u||h.open,children:({present:v})=>v?s.jsx($M,{...d,ref:o}):s.jsx(GM,{...d,fragment:p})})},"SelectContent")),GM=m.forwardRef(rt(function(l,o){const{__scopeSelect:i,children:u,fragment:d}=l;return d?bs.createPortal(s.jsx(p1,{scope:i,children:s.jsx(Qc.Slot,{scope:i,children:s.jsx("div",{ref:o,children:u})})}),d):null},"SelectContentFragment")),aa=10,[p1,Zc]=yr(mr),YM=va("SelectContent.RemoveScroll"),$M=m.forwardRef(rt(function(l,o){const{__scopeSelect:i}=l,{position:u="item-aligned",onCloseAutoFocus:d,onEscapeKeyDown:h,onPointerDownOutside:p,side:g,sideOffset:v,align:x,alignOffset:y,arrowPadding:S,collisionBoundary:w,collisionPadding:C,sticky:E,hideWhenDetached:j,avoidCollisions:N,...M}=l,T=Il(mr,i),[_,O]=m.useState(null),[A,H]=m.useState(null),z=Ie(o,O),[K,se]=m.useState(null),[X,I]=m.useState(null),re=im(i),[ee,oe]=m.useState(!1),U=m.useRef(!1);m.useEffect(()=>{if(_)return Kh(_)},[_]),Lo();const $=m.useCallback(fe=>{const[xe,...J]=re().map(Me=>Me.ref.current),[me]=J.slice(-1),je=document.activeElement;for(const Me of fe)if(Me===je||(Me==null||Me.scrollIntoView({block:"nearest"}),Me===xe&&A&&(A.scrollTop=0),Me===me&&A&&(A.scrollTop=A.scrollHeight),Me==null||Me.focus(),document.activeElement!==je))return},[re,A]),le=m.useCallback(()=>$([K,_]),[$,K,_]);m.useEffect(()=>{ee&&le()},[ee,le]);const{onOpenChange:B,triggerPointerDownPosRef:Z}=T;m.useEffect(()=>{if(_){let fe={x:0,y:0};const xe=rt(me=>{var je,Me;fe={x:Math.abs(Math.round(me.pageX)-(((je=Z.current)==null?void 0:je.x)??0)),y:Math.abs(Math.round(me.pageY)-(((Me=Z.current)==null?void 0:Me.y)??0))}},"handlePointerMove"),J=rt(me=>{fe.x<=10&&fe.y<=10?me.preventDefault():me.composedPath().includes(_)||B(!1),document.removeEventListener("pointermove",xe),Z.current=null},"handlePointerUp");return Z.current!==null&&(document.addEventListener("pointermove",xe),document.addEventListener("pointerup",J,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",xe),document.removeEventListener("pointerup",J,{capture:!0})}}},[_,B,Z]),m.useEffect(()=>{const fe=rt(()=>B(!1),"close");return window.addEventListener("blur",fe),window.addEventListener("resize",fe),()=>{window.removeEventListener("blur",fe),window.removeEventListener("resize",fe)}},[B]);const[D,q]=um(fe=>{const xe=re().filter(je=>!je.disabled),J=xe.find(je=>je.ref.current===document.activeElement),me=dm(xe,fe,J);me&&setTimeout(()=>{var je;return(je=me.ref.current)==null?void 0:je.focus()})}),Q=m.useCallback((fe,xe,J)=>{const me=!U.current&&!J;(T.value!==void 0&&T.value===xe||me)&&(se(fe),me&&(U.current=!0))},[T.value]),ae=m.useCallback(()=>_==null?void 0:_.focus(),[_]),ce=m.useCallback((fe,xe,J)=>{const me=!U.current&&!J;(T.value!==void 0&&T.value===xe||me)&&I(fe)},[T.value]),Se=u==="popper"?hy:KM,ue=Se===hy?{side:g,sideOffset:v,align:x,alignOffset:y,arrowPadding:S,collisionBoundary:w,collisionPadding:C,sticky:E,hideWhenDetached:j,avoidCollisions:N}:{};return s.jsx(p1,{scope:i,content:_,viewport:A,onViewportChange:H,itemRefCallback:Q,selectedItem:K,onItemLeave:ae,itemTextRefCallback:ce,focusSelectedItem:le,selectedItemText:X,position:u,isPositioned:ee,searchRef:D,children:s.jsx(Kc,{as:YM,allowPinchZoom:!0,children:s.jsx(zh,{asChild:!0,trapped:T.open,onMountAutoFocus:fe=>{fe.preventDefault()},onUnmountAutoFocus:Ee(d,fe=>{var xe;(xe=T.trigger)==null||xe.focus({preventScroll:!0}),fe.preventDefault()}),children:s.jsx(Lc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:h,onPointerDownOutside:p,onFocusOutside:fe=>fe.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:s.jsx(Se,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:fe=>fe.preventDefault(),...M,...ue,onPlaced:()=>oe(!0),ref:z,style:{display:"flex",flexDirection:"column",outline:"none",...M.style},onKeyDown:Ee(M.onKeyDown,fe=>{const xe=fe.ctrlKey||fe.altKey||fe.metaKey;if(fe.key==="Tab"&&fe.preventDefault(),!xe&&fe.key.length===1&&q(fe.key),["ArrowUp","ArrowDown","Home","End"].includes(fe.key)){let me=re().filter(je=>!je.disabled).map(je=>je.ref.current);if(["ArrowUp","End"].includes(fe.key)&&(me=me.slice().reverse()),["ArrowUp","ArrowDown"].includes(fe.key)){const je=fe.target,Me=me.indexOf(je);me=me.slice(Me+1)}setTimeout(()=>$(me)),fe.preventDefault()}})})})})})})},"SelectContentImpl")),KM=m.forwardRef(rt(function(l,o){const{__scopeSelect:i,onPlaced:u,...d}=l,h=Il(mr,i),p=Zc(mr,i),[g,v]=m.useState(null),[x,y]=m.useState(null),S=Ie(o,y),w=im(i),C=m.useRef(!1),E=m.useRef(!0),{viewport:j,selectedItem:N,selectedItemText:M,focusSelectedItem:T}=p,_=m.useCallback(()=>{if(h.trigger&&h.valueNode&&g&&x&&j&&N&&M){const z=h.trigger.getBoundingClientRect(),K=x.getBoundingClientRect(),se=h.valueNode.getBoundingClientRect(),X=M.getBoundingClientRect();if(h.dir!=="rtl"){const je=X.left-K.left,Me=se.left-je,mt=z.left-Me,pt=z.width+mt,bt=Math.max(pt,K.width),St=window.innerWidth-aa,Lt=uh(Me,[aa,Math.max(aa,St-bt)]);g.style.minWidth=pt+"px",g.style.left=Lt+"px"}else{const je=K.right-X.right,Me=window.innerWidth-se.right-je,mt=window.innerWidth-z.right-Me,pt=z.width+mt,bt=Math.max(pt,K.width),St=window.innerWidth-aa,Lt=uh(Me,[aa,Math.max(aa,St-bt)]);g.style.minWidth=pt+"px",g.style.right=Lt+"px"}const I=w(),re=window.innerHeight-aa*2,ee=j.scrollHeight,oe=window.getComputedStyle(x),U=parseInt(oe.borderTopWidth,10),$=parseInt(oe.paddingTop,10),le=parseInt(oe.borderBottomWidth,10),B=parseInt(oe.paddingBottom,10),Z=U+$+ee+B+le,D=Math.min(N.offsetHeight*5,Z),q=window.getComputedStyle(j),Q=parseInt(q.paddingTop,10),ae=parseInt(q.paddingBottom,10),ce=z.top+z.height/2-aa,Se=re-ce,ue=N.offsetHeight/2,fe=N.offsetTop+ue,xe=U+$+fe,J=Z-xe;if(xe<=ce){const je=I.length>0&&N===I[I.length-1].ref.current;g.style.bottom="0px";const Me=x.clientHeight-j.offsetTop-j.offsetHeight,mt=Math.max(Se,ue+(je?ae:0)+Me+le),pt=xe+mt;g.style.height=pt+"px"}else{const je=I.length>0&&N===I[0].ref.current;g.style.top="0px";const mt=Math.max(ce,U+j.offsetTop+(je?Q:0)+ue)+J;g.style.height=mt+"px",j.scrollTop=xe-ce+j.offsetTop}g.style.margin=`${aa}px 0`,g.style.minHeight=D+"px",g.style.maxHeight=re+"px",u==null||u(),requestAnimationFrame(()=>C.current=!0)}},[w,h.trigger,h.valueNode,g,x,j,N,M,h.dir,u]);Dt(()=>_(),[_]);const[O,A]=m.useState();Dt(()=>{x&&A(window.getComputedStyle(x).zIndex)},[x]);const H=m.useCallback(z=>{z&&E.current===!0&&(_(),T==null||T(),E.current=!1)},[_,T]);return s.jsx(XM,{scope:i,contentWrapper:g,shouldExpandOnScrollRef:C,onScrollButtonChange:H,children:s.jsx("div",{ref:v,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:s.jsx(Be.div,{...d,ref:S,style:{boxSizing:"border-box",maxHeight:"100%",...d.style}})})})},"SelectItemAlignedPosition")),hy=m.forwardRef(rt(function(l,o){const{__scopeSelect:i,align:u="start",collisionPadding:d=aa,...h}=l,p=cm(i);return s.jsx(Vh,{...p,...h,ref:o,align:u,collisionPadding:d,style:{boxSizing:"border-box",...h.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[XM,FM]=yr(mr,{}),my="SelectViewport",QM=m.forwardRef(rt(function(l,o){const{__scopeSelect:i,nonce:u,...d}=l,h=Zc(my,i),p=FM(my,i),g=Ie(o,h.onViewportChange),v=m.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:u}),s.jsx(Qc.Slot,{scope:i,children:s.jsx(Be.div,{"data-radix-select-viewport":"",role:"presentation",...d,ref:g,style:{position:"relative",flex:1,overflow:"hidden auto",...d.style},onScroll:Ee(d.onScroll,x=>{const y=x.currentTarget,{contentWrapper:S,shouldExpandOnScrollRef:w}=p;if(w!=null&&w.current&&S){const C=Math.abs(v.current-y.scrollTop);if(C>0){const E=window.innerHeight-aa*2,j=parseFloat(S.style.minHeight),N=parseFloat(S.style.height),M=Math.max(j,N);if(M<E){const T=M+C,_=Math.min(E,T),O=T-_;S.style.height=_+"px",S.style.bottom==="0px"&&(y.scrollTop=O>0?O:0,S.style.justifyContent="flex-end")}}}v.current=y.scrollTop})})})]})},"SelectViewport")),ZM="SelectGroup",[K_,X_]=yr(ZM),dh="SelectItem",[JM,g1]=yr(dh),v1=m.forwardRef(rt(function(l,o){const{__scopeSelect:i,value:u,disabled:d=!1,textValue:h,...p}=l,g=Il(dh,i),v=Zc(dh,i),x=g.value===u,[y,S]=m.useState(h??""),[w,C]=m.useState(!1),E=$n(_=>{var O;return(O=v.itemRefCallback)==null?void 0:O.call(v,_,u,d)}),j=Ie(o,E),N=ga(),M=m.useRef("touch"),T=rt(()=>{d||(g.onValueChange(u),g.onOpenChange(!1))},"handleSelect");return s.jsx(JM,{scope:i,value:u,disabled:d,textId:N,isSelected:x,onItemTextChange:m.useCallback(_=>{S(O=>O||((_==null?void 0:_.textContent)??"").trim())},[]),children:s.jsx(Qc.ItemSlot,{scope:i,value:u,disabled:d,textValue:y,children:s.jsx(Be.div,{role:"option","aria-labelledby":N,"data-highlighted":w?"":void 0,"aria-selected":x&&w,"data-state":x?"checked":"unchecked","aria-disabled":d||void 0,"data-disabled":d?"":void 0,tabIndex:d?void 0:-1,...p,ref:j,onFocus:Ee(p.onFocus,()=>C(!0)),onBlur:Ee(p.onBlur,()=>C(!1)),onClick:Ee(p.onClick,()=>{M.current!=="mouse"&&T()}),onPointerUp:Ee(p.onPointerUp,()=>{M.current==="mouse"&&T()}),onPointerDown:Ee(p.onPointerDown,_=>{M.current=_.pointerType}),onPointerMove:Ee(p.onPointerMove,_=>{var O;M.current=_.pointerType,d?(O=v.onItemLeave)==null||O.call(v):M.current==="mouse"&&_.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ee(p.onPointerLeave,_=>{var O;_.currentTarget===document.activeElement&&((O=v.onItemLeave)==null||O.call(v))}),onKeyDown:Ee(p.onKeyDown,_=>{var A;d||_.target!==_.currentTarget||((A=v.searchRef)==null?void 0:A.current)!==""&&_.key===" "||(MM.includes(_.key)&&T(),_.key===" "&&_.preventDefault())})})})})},"SelectItem")),cc="SelectItemText",WM=m.forwardRef(rt(function(l,o){const{__scopeSelect:i,className:u,style:d,...h}=l,p=Il(cc,i),g=Zc(cc,i),v=g1(cc,i),x=kM(cc,i),[y,S]=m.useState(null),w=$n(T=>{var _;return(_=g.itemTextRefCallback)==null?void 0:_.call(g,T,v.value,v.disabled)}),C=Ie(o,S,v.onItemTextChange,w),E=y==null?void 0:y.textContent,j=m.useMemo(()=>s.jsx("option",{value:v.value,disabled:v.disabled,children:E},v.value),[v.disabled,v.value,E]),{onNativeOptionAdd:N,onNativeOptionRemove:M}=x;return Dt(()=>(N(j),()=>M(j)),[N,M,j]),s.jsxs(s.Fragment,{children:[s.jsx(Be.span,{id:v.textId,...h,ref:C}),v.isSelected&&p.valueNode&&!p.valueNodeHasChildren&&!Ho(p.value)?bs.createPortal(h.children,p.valueNode):null]})},"SelectItemText")),eD="SelectItemIndicator",tD=m.forwardRef(rt(function(l,o){const{__scopeSelect:i,...u}=l;return g1(eD,i).isSelected?s.jsx(Be.span,{"aria-hidden":!0,...u,ref:o}):null},"SelectItemIndicator")),nD="SelectBubbleInput",aD=m.forwardRef(rt(function({__scopeSelect:l,...o},i){const u=Il(nD,l),{value:d,onValueChange:h,required:p,disabled:g,name:v,autoComplete:x,form:y}=u,{nativeOptions:S,nativeSelectKey:w}=u,C=m.useRef(null),E=Ie(i,C),j=d??"",N=u1(j),M=Array.from(S).some(T=>(T.props.value??"")==="");return m.useEffect(()=>{const T=C.current;if(!T)return;const _=window.HTMLSelectElement.prototype,A=Object.getOwnPropertyDescriptor(_,"value").set;if(N!==j&&A){const H=new Event("change",{bubbles:!0});A.call(T,j),T.dispatchEvent(H)}},[N,j]),s.jsxs(Be.select,{"aria-hidden":!0,required:p,tabIndex:-1,name:v,autoComplete:x,disabled:g,form:y,onChange:T=>h(T.target.value),...o,style:{...d1,...o.style},ref:E,defaultValue:j,children:[Ho(d)&&!M?s.jsx("option",{value:""}):null,Array.from(S)]},w)},"SelectBubbleInput"));function x1(a){return typeof a=="function"}rt(x1,"isFunction");function Ho(a){return a===""||a===void 0}rt(Ho,"shouldShowPlaceholder");function um(a){const l=$n(a),o=m.useRef(""),i=m.useRef(0),u=m.useCallback(h=>{const p=o.current+h;l(p),rt((function g(v){o.current=v,window.clearTimeout(i.current),v!==""&&(i.current=window.setTimeout(()=>g(""),1e3))}),"updateSearch")(p)},[l]),d=m.useCallback(()=>{o.current="",window.clearTimeout(i.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(i.current),[]),[o,u,d]}rt(um,"useTypeaheadSearch");function dm(a,l,o){const u=l.length>1&&Array.from(l).every(v=>v===l[0])?l[0]:l,d=o?a.indexOf(o):-1;let h=y1(a,Math.max(d,0));u.length===1&&(h=h.filter(v=>v!==o));const g=h.find(v=>v.textValue.toLowerCase().startsWith(u.toLowerCase()));return g!==o?g:void 0}rt(dm,"findNextItem");function y1(a,l){return a.map((o,i)=>a[(l+i)%a.length])}rt(y1,"wrapArray");const Vn=zM,Gn=BM,Rn=m.forwardRef(({className:a,children:l,...o},i)=>s.jsxs(h1,{ref:i,className:Re("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",a),...o,children:[l,s.jsx(HM,{asChild:!0,children:s.jsx(eC,{className:"h-4 w-4 opacity-50"})})]}));Rn.displayName=h1.displayName;const Nn=m.forwardRef(({className:a,children:l,position:o="popper",...i},u)=>s.jsx(VM,{children:s.jsx(m1,{ref:u,className:Re("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md",a),position:o,...i,children:s.jsx(QM,{className:Re("p-1",o==="popper"&&"w-full min-w-[var(--radix-select-trigger-width)]"),children:l})})}));Nn.displayName=m1.displayName;const lt=m.forwardRef(({className:a,children:l,...o},i)=>s.jsxs(v1,{ref:i,className:Re("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...o,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(tD,{children:s.jsx(Ky,{className:"h-4 w-4"})})}),s.jsx(WM,{children:l})]}));lt.displayName=v1.displayName;var lD=Object.defineProperty,Pl=(a,l)=>lD(a,"name",{value:l,configurable:!0}),fm="Switch",[rD,F_]=fn(fm),[sD,hm]=rD(fm);function b1(a){const{__scopeSwitch:l,checked:o,children:i,defaultChecked:u,disabled:d,form:h,name:p,onCheckedChange:g,required:v,value:x="on",internal_do_not_use_render:y}=a,[S,w]=Ja({prop:o,defaultProp:u??!1,onChange:g,caller:fm}),[C,E]=m.useState(null),[j,N]=m.useState(null),M=m.useRef(!1),[T,_]=m.useReducer(H=>H+1,0),O=C?!!h||!!C.closest("form"):!0,A={checked:S,setChecked:w,disabled:d,control:C,setControl:E,name:p,form:h,value:x,hasConsumerStoppedPropagationRef:M,userInteractionCount:T,onUserInteraction:_,required:v,defaultChecked:u,isFormControl:O,bubbleInput:j,setBubbleInput:N};return s.jsx(sD,{scope:l,...A,children:w1(y)?y(A):i})}Pl(b1,"SwitchProvider");var oD="SwitchTrigger",iD=m.forwardRef(Pl(function({__scopeSwitch:l,onClick:o,...i},u){const{control:d,form:h,value:p,disabled:g,checked:v,required:x,setControl:y,setChecked:S,hasConsumerStoppedPropagationRef:w,onUserInteraction:C,isFormControl:E,bubbleInput:j}=hm(oD,l),N=Ie(u,y),M=m.useRef(v);return m.useEffect(()=>{const T=h?d==null?void 0:d.ownerDocument.getElementById(h):d==null?void 0:d.form;if(T instanceof HTMLFormElement){const _=Pl(()=>S(M.current),"reset");return T.addEventListener("reset",_),()=>T.removeEventListener("reset",_)}},[d,h,S]),s.jsx(Be.button,{type:"button",role:"switch","aria-checked":v,"aria-required":x,"data-state":mm(v),"data-disabled":g?"":void 0,disabled:g,value:p,...i,ref:N,onClick:Ee(o,T=>{C(),S(_=>!_),j&&E&&(w.current=T.isPropagationStopped(),w.current||T.stopPropagation())})})},"SwitchTrigger")),S1=m.forwardRef(Pl(function(l,o){const{__scopeSwitch:i,name:u,checked:d,defaultChecked:h,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...S}=l;return s.jsx(b1,{__scopeSwitch:i,checked:d,defaultChecked:h,disabled:g,required:p,onCheckedChange:x,name:u,form:y,value:v,internal_do_not_use_render:({isFormControl:w})=>s.jsxs(s.Fragment,{children:[s.jsx(iD,{...S,ref:o,__scopeSwitch:i}),w&&s.jsx(fD,{__scopeSwitch:i})]})})},"Switch")),cD="SwitchThumb",uD=m.forwardRef(Pl(function(l,o){const{__scopeSwitch:i,...u}=l,d=hm(cD,i);return s.jsx(Be.span,{"data-state":mm(d.checked),"data-disabled":d.disabled?"":void 0,...u,ref:o})},"SwitchThumb")),dD="SwitchBubbleInput",fD=m.forwardRef(Pl(function({__scopeSwitch:l,onClick:o,...i},u){const{control:d,hasConsumerStoppedPropagationRef:h,userInteractionCount:p,checked:g,defaultChecked:v,required:x,disabled:y,name:S,value:w,form:C,bubbleInput:E,setBubbleInput:j}=hm(dD,l),N=Ie(u,j),M=Ic(d),T=m.useRef(!1),_=m.useRef(g),O=m.useRef(p);m.useEffect(()=>{const H=E;if(!H)return;const z=window.HTMLInputElement.prototype,se=Object.getOwnPropertyDescriptor(z,"checked").set,X=p!==O.current;O.current=p;const I=_.current!==g;_.current=g;const re=!(X&&h.current);if(I&&se){T.current=!X;const ee=new Event("click",{bubbles:re});se.call(H,g),H.dispatchEvent(ee),T.current=!1}},[E,g,h,p]);const A=m.useRef(g);return s.jsx(Be.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??A.current,required:x,disabled:y,name:S,value:w,form:C,...i,tabIndex:-1,ref:N,onClick:Ee(o,H=>{T.current&&H.stopPropagation()}),style:{...i.style,...M,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"SwitchBubbleInput"));function w1(a){return typeof a=="function"}Pl(w1,"isFunction");function mm(a){return a?"checked":"unchecked"}Pl(mm,"getState");const ba=m.forwardRef(({className:a,...l},o)=>s.jsx(S1,{className:Re("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",a),...l,ref:o,children:s.jsx(uD,{className:Re("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=S1.displayName;const cr={name:"",slug:"",type:"openai",baseUrl:"https://api.openai.com",apiKey:"",customHeaders:"",enabled:!0};function hD(){const[a,l]=m.useState([]),[o,i]=m.useState(!1),[u,d]=m.useState(cr),[h,p]=m.useState(!1),[g,v]=m.useState(null),[x,y]=m.useState(null),[S,w]=m.useState(cr),[C,E]=m.useState(null),[j,N]=m.useState(!1),M=()=>we.get("/api/admin/providers").then(z=>l(z.providers));m.useEffect(()=>{M()},[]);const T=async()=>{p(!0);try{let z;if(u.customHeaders.trim())try{z=JSON.parse(u.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await we.post("/api/admin/providers",{name:u.name,slug:u.slug||void 0,type:u.type,baseUrl:u.baseUrl,apiKey:u.apiKey,customHeaders:z,enabled:u.enabled}),ve.success("Provider created"),i(!1),d(cr),M()}catch(z){ve.error(z.message)}finally{p(!1)}},_=async z=>{v(z);try{const K=await we.post(`/api/admin/providers/${z}/test`);ve.success(K.ok?`Connection OK: ${K.detail}`:`Failed: ${K.detail}`),M()}catch(K){ve.error(K.message)}finally{v(null)}},O=z=>{y(z.id),w({...cr,name:z.name,slug:z.slug||"",type:z.type,baseUrl:z.baseUrl,apiKey:"",customHeaders:"",enabled:z.enabled})},A=async()=>{if(x){p(!0);try{let z;if(S.customHeaders.trim())try{z=JSON.parse(S.customHeaders)}catch{throw new Error("Custom headers must be valid JSON object")}await we.patch("/api/admin/providers",{id:x,name:S.name,slug:S.slug||void 0,type:S.type,baseUrl:S.baseUrl,apiKey:S.apiKey||void 0,customHeaders:z,enabled:S.enabled}),ve.success("Provider updated"),y(null),w(cr),M()}catch(z){ve.error(z.message)}finally{p(!1)}}},H=async z=>{N(!0);try{await we.del(`/api/admin/providers/${z}`),ve.success("Provider removed"),M()}catch(K){ve.error(K.message)}finally{N(!1),E(null)}};return s.jsxs("div",{children:[s.jsx(wa,{title:"Providers",description:"Upstream LLM providers and their credentials",actions:s.jsxs(qn,{open:o,onOpenChange:i,children:[s.jsx(Bo,{asChild:!0,children:s.jsxs(he,{children:[s.jsx(Oo,{className:"mr-1 h-4 w-4"})," Add provider"]})}),s.jsxs(jn,{children:[s.jsx(Cn,{children:s.jsx(En,{children:"New provider"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Ae,{value:u.name,onChange:z=>d({...u,name:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Slug (optional)"}),s.jsx(Ae,{value:u.slug,onChange:z=>d({...u,slug:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Type"}),s.jsxs(Vn,{value:u.type,onValueChange:z=>d({...u,type:z}),children:[s.jsx(Rn,{children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"openai",children:"OpenAI-compatible"}),s.jsx(lt,{value:"anthropic",children:"Anthropic-compatible"})]})]})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Base URL"}),s.jsx(Ae,{value:u.baseUrl,onChange:z=>d({...u,baseUrl:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"API key"}),s.jsx(Ae,{type:"password",value:u.apiKey,onChange:z=>d({...u,apiKey:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Custom headers (JSON)"}),s.jsx(Ae,{value:u.customHeaders,onChange:z=>d({...u,customHeaders:z.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ba,{checked:u.enabled,onCheckedChange:z=>d({...u,enabled:z})}),s.jsx(be,{children:"Enabled"})]})]}),s.jsxs(In,{children:[s.jsx(he,{variant:"outline",onClick:()=>i(!1),children:"Cancel"}),s.jsx(he,{disabled:h||!u.name||!u.apiKey,onClick:T,children:"Create"})]})]})]})}),s.jsxs(Xe,{children:[s.jsxs(Fe,{children:[s.jsx(Qe,{className:"text-base",children:"All providers"}),s.jsxs(on,{children:[a.length," total"]})]}),s.jsx(Ze,{children:s.jsxs(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{children:[s.jsx(pe,{children:"Name"}),s.jsx(pe,{children:"Type"}),s.jsx(pe,{children:"Base URL"}),s.jsx(pe,{children:"Models"}),s.jsx(pe,{children:"Health"}),s.jsx(pe,{children:"Enabled"}),s.jsx(pe,{className:"text-right",children:"Actions"})]})}),s.jsxs(Fn,{children:[a.length===0&&s.jsx(Ye,{children:s.jsx(de,{colSpan:7,className:"text-center text-muted-foreground",children:"No providers yet."})}),a.map(z=>s.jsxs(Ye,{children:[s.jsxs(de,{className:"font-medium",children:[z.name," ",s.jsx("span",{className:"text-xs text-muted-foreground",children:z.slug})]}),s.jsx(de,{children:s.jsx(et,{variant:"outline",children:z.type})}),s.jsx(de,{className:"text-xs text-muted-foreground",children:z.baseUrl}),s.jsx(de,{children:z.modelCount}),s.jsx(de,{children:s.jsx(et,{variant:z.health==="healthy"?"success":z.health==="down"?"destructive":"secondary",children:z.health})}),s.jsx(de,{children:z.enabled?"Yes":"No"}),s.jsx(de,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[s.jsx(he,{size:"sm",variant:"outline",disabled:g===z.id,onClick:()=>_(z.id),children:s.jsx(pC,{className:"h-3 w-3"})}),s.jsx(he,{size:"sm",variant:"outline",onClick:()=>O(z),children:"✎"}),s.jsx(he,{size:"sm",variant:"outline",onClick:()=>E(z.id),children:s.jsx(_c,{className:"h-3 w-3"})})]})})]},z.id))]})]})})]}),s.jsx(qn,{open:!!x,onOpenChange:z=>{z||(y(null),w(cr))},children:s.jsxs(jn,{children:[s.jsx(Cn,{children:s.jsx(En,{children:"Edit provider"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Ae,{value:S.name,onChange:z=>w({...S,name:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Slug (optional)"}),s.jsx(Ae,{value:S.slug,onChange:z=>w({...S,slug:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Type"}),s.jsxs(Vn,{value:S.type,onValueChange:z=>w({...S,type:z}),children:[s.jsx(Rn,{children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"openai",children:"OpenAI-compatible"}),s.jsx(lt,{value:"anthropic",children:"Anthropic-compatible"})]})]})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Base URL"}),s.jsx(Ae,{value:S.baseUrl,onChange:z=>w({...S,baseUrl:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"API key (leave empty to keep current)"}),s.jsx(Ae,{type:"password",value:S.apiKey,onChange:z=>w({...S,apiKey:z.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Custom headers (JSON)"}),s.jsx(Ae,{value:S.customHeaders,onChange:z=>w({...S,customHeaders:z.target.value}),placeholder:'{"X-Org":"acme"}'})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ba,{checked:S.enabled,onCheckedChange:z=>w({...S,enabled:z})}),s.jsx(be,{children:"Enabled"})]})]}),s.jsxs(In,{children:[s.jsx(he,{variant:"outline",onClick:()=>{y(null),w(cr)},children:"Cancel"}),s.jsx(he,{disabled:h||!S.name,onClick:A,children:"Save changes"})]})]})}),s.jsx(s1,{open:!!C,onOpenChange:z=>{z||E(null)},children:s.jsxs(am,{children:[s.jsxs(i1,{children:[s.jsx(lm,{children:"Delete provider?"}),s.jsx(rm,{children:"This will soft-disable the provider if models depend on it."})]}),s.jsxs(c1,{children:[s.jsx(om,{children:"Cancel"}),s.jsx(sm,{disabled:j,onClick:z=>{C&&(z.preventDefault(),H(C))},children:j?"Deleting…":"Delete"})]})]})})]})}var mD=Object.defineProperty,tl=(a,l)=>mD(a,"name",{value:l,configurable:!0}),pm="Checkbox",[pD,Q_]=fn(pm),[gD,gm]=pD(pm);function j1(a){const{__scopeCheckbox:l,checked:o,children:i,defaultChecked:u,disabled:d,form:h,name:p,onCheckedChange:g,required:v,value:x="on",internal_do_not_use_render:y}=a,[S,w]=Ja({prop:o,defaultProp:u??!1,onChange:g,caller:pm}),[C,E]=m.useState(null),[j,N]=m.useState(null),M=m.useRef(!1),[T,_]=m.useReducer(H=>H+1,0),O=C?!!h||!!C.closest("form"):!0,A={checked:S,disabled:d,setChecked:w,control:C,setControl:E,name:p,form:h,value:x,hasConsumerStoppedPropagationRef:M,userInteractionCount:T,onUserInteraction:_,required:v,defaultChecked:Qa(u)?!1:u,isFormControl:O,bubbleInput:j,setBubbleInput:N};return s.jsx(gD,{scope:l,...A,children:E1(y)?y(A):i})}tl(j1,"CheckboxProvider");var vD="CheckboxTrigger",xD=m.forwardRef(tl(function({__scopeCheckbox:l,onKeyDown:o,onClick:i,...u},d){const{control:h,value:p,disabled:g,checked:v,required:x,setControl:y,setChecked:S,hasConsumerStoppedPropagationRef:w,onUserInteraction:C,isFormControl:E,bubbleInput:j}=gm(vD,l),N=Ie(d,y),M=m.useRef(v);return m.useEffect(()=>{const T=h==null?void 0:h.form;if(T){const _=tl(()=>S(M.current),"reset");return T.addEventListener("reset",_),()=>T.removeEventListener("reset",_)}},[h,S]),s.jsx(Be.button,{type:"button",role:"checkbox","aria-checked":Qa(v)?"mixed":v,"aria-required":x,"data-state":vm(v),"data-disabled":g?"":void 0,disabled:g,value:p,...u,ref:N,onKeyDown:Ee(o,T=>{T.key==="Enter"&&T.preventDefault()}),onClick:Ee(i,T=>{C(),S(_=>Qa(_)?!0:!_),j&&E&&(w.current=T.isPropagationStopped(),w.current||T.stopPropagation())})})},"CheckboxTrigger")),C1=m.forwardRef(tl(function(l,o){const{__scopeCheckbox:i,name:u,checked:d,defaultChecked:h,required:p,disabled:g,value:v,onCheckedChange:x,form:y,...S}=l;return s.jsx(j1,{__scopeCheckbox:i,checked:d,defaultChecked:h,disabled:g,required:p,onCheckedChange:x,name:u,form:y,value:v,internal_do_not_use_render:({isFormControl:w})=>s.jsxs(s.Fragment,{children:[s.jsx(xD,{...S,ref:o,__scopeCheckbox:i}),w&&s.jsx(wD,{__scopeCheckbox:i})]})})},"Checkbox")),yD="CheckboxIndicator",bD=m.forwardRef(tl(function(l,o){const{__scopeCheckbox:i,forceMount:u,...d}=l,h=gm(yD,i);return s.jsx(al,{present:u||Qa(h.checked)||h.checked===!0,children:s.jsx(Be.span,{"data-state":vm(h.checked),"data-disabled":h.disabled?"":void 0,...d,ref:o,style:{pointerEvents:"none",...l.style}})})},"CheckboxIndicator")),SD="CheckboxBubbleInput",wD=m.forwardRef(tl(function({__scopeCheckbox:l,onClick:o,...i},u){const{control:d,hasConsumerStoppedPropagationRef:h,userInteractionCount:p,checked:g,defaultChecked:v,required:x,disabled:y,name:S,value:w,form:C,bubbleInput:E,setBubbleInput:j}=gm(SD,l),N=Ie(u,j),M=Ic(d),T=m.useRef(!1),_=m.useRef(g),O=m.useRef(p);m.useEffect(()=>{const H=E;if(!H)return;const z=window.HTMLInputElement.prototype,se=Object.getOwnPropertyDescriptor(z,"checked").set,X=p!==O.current;O.current=p;const I=_.current!==g;_.current=g;const re=!(X&&h.current);if(I&&se){T.current=!X;const ee=new Event("click",{bubbles:re});H.indeterminate=Qa(g),se.call(H,Qa(g)?!1:g),H.dispatchEvent(ee),T.current=!1}},[E,g,h,p]);const A=m.useRef(Qa(g)?!1:g);return s.jsx(Be.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??A.current,required:x,disabled:y,name:S,value:w,form:C,...i,tabIndex:-1,ref:N,onClick:Ee(o,H=>{T.current&&H.stopPropagation()}),style:{...i.style,...M,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function E1(a){return typeof a=="function"}tl(E1,"isFunction");function Qa(a){return a==="indeterminate"}tl(Qa,"isIndeterminate");function vm(a){return Qa(a)?"indeterminate":a?"checked":"unchecked"}tl(vm,"getState");const xm=m.forwardRef(({className:a,...l},o)=>s.jsx(C1,{ref:o,className:Re("peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",a),...l,children:s.jsx(bD,{className:Re("flex items-center justify-center text-current"),children:s.jsx(Ky,{className:"h-3.5 w-3.5"})})}));xm.displayName=C1.displayName;function jD(){const[a,l]=m.useState([]),[o,i]=m.useState([]),[u,d]=m.useState("all"),[h,p]=m.useState(!1),[g,v]=m.useState(""),[x,y]=m.useState([]),[S,w]=m.useState(new Set),[C,E]=m.useState(!1),[j,N]=m.useState(""),[M,T]=m.useState(""),[_,O]=m.useState(null),[A,H]=m.useState(!1),[z,K]=m.useState(null),[se,X]=m.useState(null),I=async()=>{const[B,Z]=await Promise.all([we.get("/api/admin/models"),we.get("/api/admin/providers")]);l(B.models),i(Z.providers)};m.useEffect(()=>{I()},[]);const re=a.filter(B=>!(u!=="all"&&B.providerId!==u||j&&!B.publicModelId.toLowerCase().includes(j.toLowerCase()))),ee=x.filter(B=>{if(!M)return!0;const Z=M.toLowerCase();return B.upstreamId.toLowerCase().includes(Z)||B.displayName.toLowerCase().includes(Z)}),oe=async()=>{if(g){E(!0);try{const B=await we.post(`/api/admin/providers/${g}/discover`);y(B.models),w(new Set)}catch(B){ve.error(B.message)}finally{E(!1)}}},U=async()=>{if(S.size!==0)try{const B=await we.post("/api/admin/models/import",{providerId:g,modelIds:Array.from(S)});ve.success(`Imported ${B.imported} of ${B.requested}`),p(!1),y([]),w(new Set),I()}catch(B){ve.error(B.message)}},$=async()=>{if(se)try{await we.del(`/api/admin/models/${se.id}`),ve.success("Model deleted"),X(null),I()}catch(B){ve.error(B.message)}},le=async B=>{var D,q,Q;O(B),H(!0);const Z=Date.now();K({phase:"streaming",startedAt:Z,text:"",progress:{}});try{const ae=await globalThis.fetch(`/api/admin/models/${B}/test-stream`,{method:"POST",headers:{"content-type":"application/json"},credentials:"include"});if(!ae.ok){const J=await ae.text().catch(()=>"");K({phase:"error",model:B,error:`HTTP ${ae.status}: ${J}`});return}const ce=(D=ae.body)==null?void 0:D.getReader();if(!ce){K({phase:"error",model:B,error:"No response body"});return}const Se=new TextDecoder;let ue="",fe="",xe=!1;for(;!xe;){const{value:J,done:me}=await ce.read();xe=me,J&&(ue+=Se.decode(J,{stream:!0}));let je;for(;(je=ue.indexOf(`
|
|
327
|
+
|
|
328
|
+
`))>=0;){const Me=ue.slice(0,je);ue=ue.slice(je+2);const mt=Me.split(`
|
|
329
|
+
`);let pt="",bt="";for(const St of mt)St.startsWith("event: ")?pt=St.slice(7):St.startsWith("data: ")&&(bt=St.slice(6));if(bt){if(pt===""||pt==="message")try{const Lt=(q=JSON.parse(bt).choices)==null?void 0:q[0];(Q=Lt==null?void 0:Lt.delta)!=null&&Q.content&&(fe+=Lt.delta.content),K(hn=>{if(!hn||hn.phase!=="streaming")return hn;const Qn=Date.now()-Z,mn=hn.progress.ttftMs??Qn;return{...hn,text:fe,progress:{ttftMs:mn,elapsedMs:Qn}}})}catch{}if(pt==="test_meta")try{const St=JSON.parse(bt);K({phase:"done",model:B,result:St,text:fe})}catch{}if(pt==="test_error")try{const St=JSON.parse(bt);K({phase:"error",model:B,error:St.message})}catch{}}}}K(J=>!J||J.phase==="streaming"?{phase:"error",model:B,error:"Stream ended unexpectedly"}:J)}catch(ae){K({phase:"error",model:B,error:ae.message})}finally{O(null)}};return s.jsxs("div",{children:[s.jsx(wa,{title:"Models",description:"Physical models imported from providers",actions:s.jsxs(qn,{open:h,onOpenChange:p,children:[s.jsx(Bo,{asChild:!0,children:s.jsxs(he,{variant:"outline",children:[s.jsx(Xy,{className:"mr-1 h-4 w-4"})," Fetch models"]})}),s.jsxs(jn,{className:"max-w-2xl",children:[s.jsx(Cn,{children:s.jsx(En,{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(Rn,{children:s.jsx(Gn,{placeholder:"Choose provider"})}),s.jsx(Nn,{children:o.map(B=>s.jsx(lt,{value:B.id,children:B.name},B.id))})]})}),s.jsx(he,{onClick:oe,disabled:!g||C,children:C?"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(Wy,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Ae,{className:"pl-8",placeholder:"Search models…",value:M,onChange:B=>T(B.target.value)}),M&&s.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>T(""),children:s.jsx(Oc,{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:[ee.length," / ",x.length," · ",S.size," selected"]}),s.jsx(he,{variant:"outline",size:"sm",onClick:()=>w(new Set(ee.filter(B=>!B.alreadyImported).map(B=>B.upstreamId))),children:"Select All (new)"}),s.jsx(he,{variant:"outline",size:"sm",onClick:()=>w(new Set),children:"Clear"})]})]}),s.jsx("div",{className:"max-h-80 space-y-1 overflow-auto rounded border p-2",children:ee.length===0&&x.length>0?s.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:"No models match your search."}):ee.map(B=>s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(xm,{checked:S.has(B.upstreamId),onCheckedChange:Z=>{const D=new Set(S);Z?D.add(B.upstreamId):D.delete(B.upstreamId),w(D)}}),s.jsx("span",{className:"font-mono text-xs",children:B.upstreamId}),B.alreadyImported&&s.jsx(et,{variant:"secondary",children:"imported"})]},B.upstreamId))})]})]}),s.jsxs(In,{children:[s.jsx(he,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsxs(he,{disabled:S.size===0,onClick:U,children:["Import ",S.size||""]})]})]})]})}),s.jsxs(Xe,{children:[s.jsxs(Fe,{children:[s.jsx(Qe,{className:"text-base",children:"All models"}),s.jsxs(on,{children:[a.length," total"]})]}),s.jsxs(Ze,{children:[s.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[s.jsxs(Vn,{value:u,onValueChange:d,children:[s.jsx(Rn,{className:"w-56",children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"all",children:"All providers"}),o.map(B=>s.jsx(lt,{value:B.id,children:B.name},B.id))]})]}),s.jsx(Ae,{className:"max-w-xs",placeholder:"Search public ID",value:j,onChange:B=>N(B.target.value)})]}),s.jsxs(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{children:[s.jsx(pe,{children:"Public ID"}),s.jsx(pe,{children:"Provider"}),s.jsx(pe,{children:"Upstream ID"}),s.jsx(pe,{children:"Capabilities"}),s.jsx(pe,{children:"Available"}),s.jsx(pe,{children:"Enabled"}),s.jsx(pe,{})]})}),s.jsxs(Fn,{children:[re.length===0&&s.jsx(Ye,{children:s.jsx(de,{colSpan:7,className:"text-center text-muted-foreground",children:"No models"})}),re.map(B=>s.jsxs(Ye,{children:[s.jsx(de,{className:"font-mono text-xs",children:B.publicModelId}),s.jsx(de,{children:B.providerSlug}),s.jsx(de,{className:"text-xs text-muted-foreground",children:B.upstreamModelId}),s.jsx(de,{className:"space-x-1",children:Object.entries(B.capabilities).filter(([,Z])=>Z===!0).slice(0,4).map(([Z])=>s.jsx(et,{variant:"outline",className:"mr-1",children:Z},Z))}),s.jsx(de,{children:B.upstreamAvailable?s.jsx(et,{variant:"success",children:"up"}):s.jsx(et,{variant:"destructive",children:"down"})}),s.jsx(de,{children:B.enabled?"Yes":"No"}),s.jsx(de,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(he,{size:"sm",variant:"outline",onClick:()=>void le(B.id),disabled:_!==null,children:[_===B.id?s.jsx(jo,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(uC,{className:"h-3.5 w-3.5"})," Test"]}),s.jsxs(he,{size:"sm",variant:"destructive",onClick:()=>X(B),disabled:_!==null,children:[s.jsx(_c,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},B.id))]})]})]})]}),s.jsx(qn,{open:!!se,onOpenChange:B=>{B||X(null)},children:s.jsxs(jn,{className:"max-w-md",children:[s.jsx(Cn,{children:s.jsx(En,{children:"Xoá model"})}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("p",{children:["Bạn có chắc muốn xoá model ",s.jsx("span",{className:"font-mono",children:se==null?void 0:se.publicModelId}),"?"]}),s.jsx("p",{className:"text-muted-foreground",children:"Model đang được dùng trong combo sẽ bị soft-disable (vô hiệu hoá) thay vì xoá hẳn, để giữ lịch sử và tham chiếu combo."})]}),s.jsxs(In,{children:[s.jsx(he,{variant:"outline",onClick:()=>X(null),children:"Huỷ"}),s.jsx(he,{variant:"destructive",onClick:$,children:"Xoá"})]})]})}),s.jsx(qn,{open:A,onOpenChange:H,children:s.jsxs(jn,{className:"max-w-2xl",children:[s.jsx(Cn,{children:s.jsx(En,{children:"Kết quả test model"})}),z&&z.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(jo,{className:"h-4 w-4 animate-spin"})," Đang stream…",s.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["TTFT ",z.progress.ttftMs!=null?`${z.progress.ttftMs} ms`:"…"]}),s.jsxs("span",{className:"font-mono text-xs text-muted-foreground/60",children:["· ",z.progress.elapsedMs!=null?`${z.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:[z.text||s.jsx("span",{className:"text-muted-foreground/60 animate-pulse",children:"waiting for first token…"}),z.phase==="streaming"&&s.jsx("span",{className:"ml-0.5 inline-block h-3.5 w-1.5 animate-pulse bg-primary/70"})]})]})]}),z&&z.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(et,{variant:z.result.success?"success":"destructive",children:z.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:[z.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:z.result.ttftMs!=null?`${z.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:[z.result.usage.input," / ",z.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:z.text||z.result.text||"(trống)"})]}),z.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:z.result.attempts.map((B,Z)=>s.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-xs",children:[s.jsx(et,{variant:B.success?"success":"destructive",children:B.success?"OK":"FAIL"}),s.jsxs("span",{className:"font-mono",children:[B.providerName," / ",B.modelId]}),s.jsxs("span",{className:"text-muted-foreground",children:[B.latencyMs," ms"]}),B.failureReason&&s.jsx("span",{className:"text-destructive",children:B.failureReason})]},Z))})]})]}),z&&z.phase==="error"&&s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsx(et,{variant:"destructive",children:"Thất bại"}),s.jsx("p",{className:"text-destructive",children:z.error})]}),s.jsx(In,{children:s.jsx(he,{variant:"outline",onClick:()=>H(!1),children:"Đóng"})})]})})]})}function CD(){const[a,l]=m.useState([]),[o,i]=m.useState([]),[u,d]=m.useState(!1),[h,p]=m.useState(!1),[g,v]=m.useState(null),[x,y]=m.useState(!1),[S,w]=m.useState(!1),[C,E]=m.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),[j,N]=m.useState({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),M=async()=>{const[X,I]=await Promise.all([we.get("/api/admin/combos"),we.get("/api/admin/models")]);l(X.combos),i(I.models)};m.useEffect(()=>{M()},[]);const T=X=>{E(I=>({...I,members:[...I.members,{modelId:X,weight:1,position:I.members.length,enabled:!0}]}))},_=X=>{E(I=>({...I,members:I.members.filter((re,ee)=>ee!==X).map((re,ee)=>({...re,position:ee}))}))},O=async()=>{if(C.members.length===0){ve.error("Add at least one member");return}y(!0);try{await we.post("/api/admin/combos",{name:C.name,slug:C.slug||void 0,mode:C.mode,enabled:C.enabled,members:C.members}),ve.success("Combo created"),d(!1),E({name:"",slug:"",mode:"fallback",enabled:!0,members:[]}),M()}catch(X){ve.error(X.message)}finally{y(!1)}},A=async X=>{try{const re=(await we.get(`/api/admin/combos/${X.id}`)).combo;v(re.id),N({name:re.name,slug:re.slug??"",mode:re.mode,enabled:re.enabled,members:re.members.map(ee=>({modelId:ee.modelId,weight:ee.weight,position:ee.position,enabled:ee.enabled}))}),p(!0)}catch(I){ve.error(I.message)}},H=async()=>{if(g){if(j.members.length===0){ve.error("Add at least one member");return}w(!0);try{await we.patch("/api/admin/combos",{id:g,name:j.name,slug:j.slug||void 0,mode:j.mode,enabled:j.enabled,members:j.members}),ve.success("Combo updated"),p(!1),v(null),M()}catch(X){ve.error(X.message)}finally{w(!1)}}},z=X=>{N(I=>({...I,members:[...I.members,{modelId:X,weight:1,position:I.members.length,enabled:!0}]}))},K=X=>{N(I=>({...I,members:I.members.filter((re,ee)=>ee!==X).map((re,ee)=>({...re,position:ee}))}))},se=async X=>{if(confirm("Delete this combo?"))try{await we.del(`/api/admin/combos/${X}`),ve.success("Combo removed"),M()}catch(I){ve.error(I.message)}};return s.jsxs("div",{children:[s.jsx(wa,{title:"Combos",description:"Virtual models combining physical models",actions:s.jsxs(qn,{open:u,onOpenChange:d,children:[s.jsx(Bo,{asChild:!0,children:s.jsxs(he,{children:[s.jsx(Oo,{className:"mr-1 h-4 w-4"})," New combo"]})}),s.jsxs(jn,{className:"max-w-2xl",children:[s.jsx(Cn,{children:s.jsx(En,{children:"New combo"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Ae,{value:C.name,onChange:X=>E({...C,name:X.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Slug (optional — leave empty to use the name as the model ID)"}),s.jsx(Ae,{value:C.slug,onChange:X=>E({...C,slug:X.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:X=>E({...C,mode:X}),children:[s.jsx(Rn,{children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"fallback",children:"Fallback (ordered)"}),s.jsx(lt,{value:"weighted_round_robin",children:"Weighted round-robin"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ba,{checked:C.enabled,onCheckedChange:X=>E({...C,enabled:X})}),s.jsx(be,{children:"Enabled"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Members"}),s.jsx(py,{models:o,addedIds:C.members.map(X=>X.modelId),onAdd:T}),s.jsx("div",{className:"mt-2 space-y-1",children:C.members.map((X,I)=>{var re;return s.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-sm",children:[s.jsx("span",{className:"font-mono text-xs",children:(re=o.find(ee=>ee.id===X.modelId))==null?void 0:re.publicModelId}),s.jsx(Ae,{type:"number",min:1,value:X.weight,onChange:ee=>{const oe=Number(ee.target.value);E(U=>({...U,members:U.members.map(($,le)=>le===I?{...$,weight:oe}:$)}))},className:"w-20"}),s.jsx(he,{size:"sm",variant:"outline",onClick:()=>_(I),children:"Remove"})]},I)})})]})]}),s.jsxs(In,{children:[s.jsx(he,{variant:"outline",onClick:()=>d(!1),children:"Cancel"}),s.jsx(he,{disabled:!C.name||x,onClick:O,children:x?"Creating…":"Create"})]})]})]})}),s.jsxs(Xe,{children:[s.jsxs(Fe,{children:[s.jsx(Qe,{className:"text-base",children:"All combos"}),s.jsxs(on,{children:[a.length," total"]})]}),s.jsx(Ze,{children:s.jsxs(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{children:[s.jsx(pe,{children:"Public ID"}),s.jsx(pe,{children:"Mode"}),s.jsx(pe,{children:"Members"}),s.jsx(pe,{children:"Healthy"}),s.jsx(pe,{children:"Enabled"}),s.jsx(pe,{})]})}),s.jsxs(Fn,{children:[a.length===0&&s.jsx(Ye,{children:s.jsx(de,{colSpan:6,className:"text-center text-muted-foreground",children:"No combos yet."})}),a.map(X=>s.jsxs(Ye,{children:[s.jsx(de,{className:"font-mono text-xs",children:X.publicModelId}),s.jsx(de,{children:s.jsx(et,{variant:"outline",children:X.mode})}),s.jsx(de,{children:X.memberCount}),s.jsx(de,{children:X.healthyMemberCount}),s.jsx(de,{children:X.enabled?"Yes":"No"}),s.jsx(de,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[s.jsxs(he,{size:"sm",variant:"outline",onClick:()=>void A(X),children:[s.jsx(yC,{className:"h-3.5 w-3.5"})," Sửa"]}),s.jsxs(he,{size:"sm",variant:"destructive",onClick:()=>se(X.id),children:[s.jsx(_c,{className:"h-3.5 w-3.5"})," Xoá"]})]})})]},X.id))]})]})})]}),s.jsx(qn,{open:h,onOpenChange:p,children:s.jsxs(jn,{className:"max-w-2xl",children:[s.jsx(Cn,{children:s.jsx(En,{children:"Edit combo"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Name"}),s.jsx(Ae,{value:j.name,onChange:X=>N({...j,name:X.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Slug (optional — leave empty to use the name as the model ID)"}),s.jsx(Ae,{value:j.slug,onChange:X=>N({...j,slug:X.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:j.mode,onValueChange:X=>N({...j,mode:X}),children:[s.jsx(Rn,{children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"fallback",children:"Fallback (ordered)"}),s.jsx(lt,{value:"weighted_round_robin",children:"Weighted round-robin"})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ba,{checked:j.enabled,onCheckedChange:X=>N({...j,enabled:X})}),s.jsx(be,{children:"Enabled"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Members"}),s.jsx(py,{models:o,addedIds:j.members.map(X=>X.modelId),onAdd:z}),s.jsx("div",{className:"mt-2 space-y-1",children:j.members.map((X,I)=>{var re;return s.jsxs("div",{className:"flex items-center gap-2 rounded border p-2 text-sm",children:[s.jsx("span",{className:"font-mono text-xs",children:(re=o.find(ee=>ee.id===X.modelId))==null?void 0:re.publicModelId}),s.jsx(Ae,{type:"number",min:1,value:X.weight,onChange:ee=>{const oe=Number(ee.target.value);N(U=>({...U,members:U.members.map(($,le)=>le===I?{...$,weight:oe}:$)}))},className:"w-20"}),s.jsx(he,{size:"sm",variant:"outline",onClick:()=>K(I),children:"Remove"})]},I)})})]})]}),s.jsxs(In,{children:[s.jsx(he,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsx(he,{disabled:!j.name||S,onClick:H,children:S?"Saving…":"Save"})]})]})})]})}function py({models:a,addedIds:l,onAdd:o}){const[i,u]=m.useState(""),h=(i?a.filter(p=>{const g=i.toLowerCase();return p.publicModelId.toLowerCase().includes(g)||p.displayName.toLowerCase().includes(g)}):a).filter(p=>!l.includes(p.id));return s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"relative",children:[s.jsx(Wy,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Ae,{className:"pl-8",placeholder:"Search models…",value:i,onChange:p=>u(p.target.value)}),i&&s.jsx("button",{className:"absolute right-2 top-2.5 text-muted-foreground hover:text-foreground",onClick:()=>u(""),children:s.jsx(Oc,{className:"h-4 w-4"})})]}),h.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No models match."}):s.jsx("div",{className:"max-h-40 space-y-1 overflow-auto rounded border p-1",children:h.map(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(he,{size:"sm",variant:"ghost",onClick:()=>o(p.id),children:"+ Add"})]},p.id))})]})}function ED(){const[a,l]=m.useState([]),[o,i]=m.useState([]),[u,d]=m.useState([]),[h,p]=m.useState(!1),[g,v]=m.useState({alias:"",targetKind:"model",targetId:"",enabled:!0}),x=async()=>{const[S,w,C]=await Promise.all([we.get("/api/admin/aliases"),we.get("/api/admin/models"),we.get("/api/admin/combos")]);l(S.aliases),i(w.models),d(C.combos)};m.useEffect(()=>{x()},[]);const y=async()=>{try{await we.post("/api/admin/aliases",g),ve.success("Alias created"),p(!1),v({alias:"",targetKind:"model",targetId:"",enabled:!0}),x()}catch(S){ve.error(S.message)}};return s.jsxs("div",{children:[s.jsx(wa,{title:"Aliases",description:"Stable client-visible names for models or combos",actions:s.jsxs(qn,{open:h,onOpenChange:p,children:[s.jsx(Bo,{asChild:!0,children:s.jsxs(he,{children:[s.jsx(Oo,{className:"mr-1 h-4 w-4"})," New alias"]})}),s.jsxs(jn,{children:[s.jsx(Cn,{children:s.jsx(En,{children:"New alias"})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx(be,{children:"Alias"}),s.jsx(Ae,{value:g.alias,onChange:S=>v({...g,alias:S.target.value}),placeholder:"coding"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Target type"}),s.jsxs(Vn,{value:g.targetKind,onValueChange:S=>v({...g,targetKind:S}),children:[s.jsx(Rn,{children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"model",children:"Model"}),s.jsx(lt,{value:"combo",children:"Combo"})]})]})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Target"}),s.jsxs(Vn,{value:g.targetId,onValueChange:S=>v({...g,targetId:S}),children:[s.jsx(Rn,{children:s.jsx(Gn,{placeholder:"Choose target"})}),s.jsx(Nn,{children:(g.targetKind==="model"?o:u).map(S=>s.jsx(lt,{value:S.id,children:S.publicModelId},S.id))})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ba,{checked:g.enabled,onCheckedChange:S=>v({...g,enabled:S})}),s.jsx(be,{children:"Enabled"})]})]}),s.jsxs(In,{children:[s.jsx(he,{variant:"outline",onClick:()=>p(!1),children:"Cancel"}),s.jsx(he,{disabled:!g.alias||!g.targetId,onClick:y,children:"Create"})]})]})]})}),s.jsxs(Xe,{children:[s.jsxs(Fe,{children:[s.jsx(Qe,{className:"text-base",children:"All aliases"}),s.jsxs(on,{children:[a.length," total"]})]}),s.jsx(Ze,{children:s.jsxs(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{children:[s.jsx(pe,{children:"Alias"}),s.jsx(pe,{children:"Target"}),s.jsx(pe,{children:"Type"}),s.jsx(pe,{children:"Enabled"}),s.jsx(pe,{})]})}),s.jsxs(Fn,{children:[a.length===0&&s.jsx(Ye,{children:s.jsx(de,{colSpan:5,className:"text-center text-muted-foreground",children:"No aliases yet."})}),a.map(S=>s.jsxs(Ye,{children:[s.jsx(de,{className:"font-mono text-xs",children:S.alias}),s.jsx(de,{className:"font-mono text-xs",children:S.targetName??S.targetId}),s.jsx(de,{children:s.jsx(et,{variant:"outline",children:S.targetKind})}),s.jsx(de,{children:S.enabled?"Yes":"No"}),s.jsx(de,{className:"text-right",children:s.jsx(he,{size:"sm",variant:"outline",onClick:async()=>{await we.del(`/api/admin/aliases/${S.id}`),ve.success("Removed"),x()},children:"Delete"})})]},S.id))]})]})})]})]})}function RD(){const[a,l]=m.useState([]),[o,i]=m.useState([]),[u,d]=m.useState([]),[h,p]=m.useState(!1),[g,v]=m.useState(null),[x,y]=m.useState(null),[S,w]=m.useState(null),[C,E]=m.useState({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),j=async()=>{const[A,H,z]=await Promise.all([we.get("/api/admin/api-keys"),we.get("/api/admin/models"),we.get("/api/admin/combos")]);l(A.apiKeys),i(H.models),d(z.combos)};m.useEffect(()=>{j()},[]);const N=async()=>{try{if(g){await we.patch("/api/admin/api-keys",{id:g,name:C.name,expiresAt:C.expiresAt||null,allowAllModels:C.allowAll,permissions:C.allowAll?[]:C.permissions,rpmLimit:C.rpmLimit?Number(C.rpmLimit):null,tpmLimit:C.tpmLimit?Number(C.tpmLimit):null,maxConcurrent:C.concurrency?Number(C.concurrency):null}),p(!1),v(null),E({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),ve.success("Key updated"),j();return}const A=await we.post("/api/admin/api-keys",{name:C.name,expiresAt:C.expiresAt||null,allowAllModels:C.allowAll,permissions:C.allowAll?void 0:C.permissions,rpmLimit:C.rpmLimit?Number(C.rpmLimit):null,tpmLimit:C.tpmLimit?Number(C.tpmLimit):null,maxConcurrent:C.concurrency?Number(C.concurrency):null,...C.customSecret.trim()?{secret:C.customSecret.trim()}:{}});p(!1),y({secret:A.secret,name:A.name}),E({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""}),j()}catch(A){ve.error(A.message)}},M=async A=>{try{const z=((await we.get(`/api/admin/api-keys/${A.id}`)).apiKey.permissions??[]).filter(K=>K.targetKind==="model"||K.targetKind==="combo");v(A.id),E({name:A.name,expiresAt:A.expiresAt?A.expiresAt.slice(0,16):"",allowAll:A.allowAllModels,permissions:z,rpmLimit:A.rpmLimit!=null?String(A.rpmLimit):"",tpmLimit:A.tpmLimit!=null?String(A.tpmLimit):"",concurrency:A.concurrencyLimit!=null?String(A.concurrencyLimit):"",customSecret:""}),p(!0)}catch(H){ve.error(H.message)}},T=()=>{p(!1),v(null),E({name:"",expiresAt:"",allowAll:!0,permissions:[],rpmLimit:"",tpmLimit:"",concurrency:"",customSecret:""})},_=async(A,H)=>{try{await we.patch("/api/admin/api-keys",{id:A,enabled:!H}),ve.success(H?"Key disabled":"Key enabled"),j()}catch(z){ve.error(z.message)}},O=async A=>{if(window.confirm("Delete this API key? This cannot be undone."))try{await we.del(`/api/admin/api-keys/${A}`),ve.success("Key deleted"),j()}catch(H){ve.error(H.message)}};return s.jsxs("div",{children:[s.jsx(wa,{title:"API Keys",description:"Gateway bearer keys for client applications",actions:s.jsxs(qn,{open:h,onOpenChange:A=>{A?p(!0):T()},children:[s.jsx(Bo,{asChild:!0,children:s.jsxs(he,{children:[s.jsx(Oo,{className:"mr-1 h-4 w-4"})," New key"]})}),s.jsxs(jn,{className:"max-w-2xl",children:[s.jsx(Cn,{children:s.jsx(En,{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(Ae,{value:C.name,onChange:A=>E({...C,name:A.target.value})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Expires (optional)"}),s.jsx(Ae,{type:"datetime-local",value:C.expiresAt,onChange:A=>E({...C,expiresAt:A.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(Ae,{value:C.rpmLimit,onChange:A=>E({...C,rpmLimit:A.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"TPM limit"}),s.jsx(Ae,{value:C.tpmLimit,onChange:A=>E({...C,tpmLimit:A.target.value}),type:"number"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Concurrency"}),s.jsx(Ae,{value:C.concurrency,onChange:A=>E({...C,concurrency:A.target.value}),type:"number"})]})]}),!g&&s.jsxs("div",{children:[s.jsx(be,{children:"Key value (optional)"}),s.jsx(Ae,{value:C.customSecret,onChange:A=>E({...C,customSecret:A.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:C.allowAll,onCheckedChange:A=>E({...C,allowAll:A})}),s.jsx(be,{children:"Allow all current and future models"})]}),!C.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:[...o.map(A=>({targetKind:"model",targetId:A.id,label:A.publicModelId})),...u.map(A=>({targetKind:"combo",targetId:A.id,label:A.publicModelId}))].map(A=>{const H=C.permissions.some(z=>z.targetKind===A.targetKind&&z.targetId===A.targetId);return s.jsxs("label",{className:"flex items-center gap-2 rounded p-1 text-sm hover:bg-accent",children:[s.jsx(xm,{checked:H,onCheckedChange:z=>{E(K=>({...K,permissions:z?[...K.permissions,{targetKind:A.targetKind,targetId:A.targetId}]:K.permissions.filter(se=>!(se.targetKind===A.targetKind&&se.targetId===A.targetId))}))}}),s.jsx("span",{className:"font-mono text-xs",children:A.label}),s.jsx(et,{variant:"outline",className:"ml-1",children:A.targetKind})]},`${A.targetKind}:${A.targetId}`)})})]})]}),s.jsxs(In,{children:[s.jsx(he,{variant:"outline",onClick:T,children:"Cancel"}),s.jsx(he,{disabled:!C.name,onClick:N,children:g?"Save changes":"Create"})]})]})]})}),s.jsxs(Xe,{children:[s.jsxs(Fe,{children:[s.jsx(Qe,{className:"text-base",children:"All keys"}),s.jsxs(on,{children:[a.length," total"]})]}),s.jsx(Ze,{children:s.jsxs(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{children:[s.jsx(pe,{children:"Name"}),s.jsx(pe,{children:"Prefix"}),s.jsx(pe,{children:"Status"}),s.jsx(pe,{children:"Scope"}),s.jsx(pe,{children:"RPM/TPM/Conc"}),s.jsx(pe,{})]})}),s.jsxs(Fn,{children:[a.length===0&&s.jsx(Ye,{children:s.jsx(de,{colSpan:6,className:"text-center text-muted-foreground",children:"No API keys yet."})}),a.map(A=>s.jsxs(Ye,{children:[s.jsx(de,{className:"font-medium",children:A.name}),s.jsxs(de,{className:"font-mono text-xs",children:[A.keyPrefix,"…"]}),s.jsx(de,{children:A.enabled?s.jsx(et,{variant:"success",children:"enabled"}):s.jsx(et,{variant:"destructive",children:"disabled"})}),s.jsx(de,{children:A.allowAllModels?"all":`${A.modelScopeCount} scoped`}),s.jsx(de,{className:"text-xs",children:[A.rpmLimit,A.tpmLimit,A.concurrencyLimit].map((H,z)=>H?["","RPM","TPM","Conc"][z+1]:null).filter(Boolean).join(" / ")||"—"}),s.jsx(de,{className:"text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-1",children:[A.secret&&s.jsxs(s.Fragment,{children:[s.jsx(he,{size:"sm",variant:"ghost",title:"Copy secret",onClick:()=>{navigator.clipboard.writeText(A.secret),ve.success("Copied")},children:s.jsx(Ef,{className:"h-3.5 w-3.5"})}),s.jsx(he,{size:"sm",variant:"ghost",title:"Show secret",onClick:()=>w({secret:A.secret,name:A.name}),children:s.jsx(iC,{className:"h-3.5 w-3.5"})})]}),s.jsx(he,{size:"sm",variant:"ghost",title:"Edit",onClick:()=>void M(A),children:s.jsx(mC,{className:"h-3.5 w-3.5"})}),s.jsxs(he,{size:"sm",variant:"outline",onClick:()=>_(A.id,A.enabled),children:[A.enabled?s.jsx(Z2,{className:"mr-1 h-3.5 w-3.5"}):s.jsx(Dc,{className:"mr-1 h-3.5 w-3.5"}),A.enabled?"Disable":"Enable"]}),s.jsx(he,{size:"sm",variant:"destructive",onClick:()=>O(A.id),children:s.jsx(_c,{className:"h-3.5 w-3.5"})})]})})]},A.id))]})]})})]}),s.jsx(qn,{open:!!x,onOpenChange:A=>{A||y(null)},children:s.jsxs(jn,{children:[s.jsxs(Cn,{children:[s.jsx(En,{children:"API key created"}),s.jsx(ch,{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(In,{children:[s.jsxs(he,{onClick:()=>{x&&(navigator.clipboard.writeText(x.secret),ve.success("Copied"))},children:[s.jsx(Ef,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(he,{variant:"outline",onClick:()=>y(null),children:"I have saved it"})]})]})}),s.jsx(qn,{open:!!S,onOpenChange:A=>{A||w(null)},children:s.jsxs(jn,{children:[s.jsxs(Cn,{children:[s.jsxs(En,{children:["API key: ",S==null?void 0:S.name]}),s.jsx(ch,{children:"Full secret for this key, readable any time."})]}),s.jsx("div",{className:"rounded border bg-muted p-3 font-mono text-xs break-all",children:S==null?void 0:S.secret}),s.jsxs(In,{children:[s.jsxs(he,{onClick:()=>{S&&(navigator.clipboard.writeText(S.secret),ve.success("Copied"))},children:[s.jsx(Ef,{className:"mr-1 h-4 w-4"})," Copy"]}),s.jsx(he,{variant:"outline",onClick:()=>w(null),children:"Close"})]})]})})]})}const ND=3e3;function TD(a,l){return!(l.success!=="all"&&a.success!==(l.success==="true")||l.protocol!=="all"&&a.protocol!==l.protocol||l.streaming!=="all"&&a.streaming!==(l.streaming==="true")||l.model&&!a.requestedModel.toLowerCase().includes(l.model.toLowerCase()))}function AD(){const[a,l]=m.useState([]),[o,i]=m.useState(0),[u,d]=m.useState(0),[h,p]=m.useState({success:"all",protocol:"all",streaming:"all",model:""}),[g,v]=m.useState(null),[x,y]=m.useState(null),[S,w]=m.useState(0),C=50,E=m.useRef(Date.now()),j=m.useRef(new Set),N=m.useRef(h);N.current=h;const M=m.useRef(u);M.current=u;const T=m.useCallback(async()=>{const O=new URLSearchParams;O.set("limit",String(C)),O.set("offset",String(u)),h.success!=="all"&&O.set("success",h.success),h.protocol!=="all"&&O.set("protocol",h.protocol),h.streaming!=="all"&&O.set("streaming",h.streaming),h.model&&O.set("requestedModel",h.model);const A=await we.get(`/api/admin/requests?${O.toString()}`);l(A.requests),i(A.total);for(const H of A.requests)j.current.add(H.id)},[u,h]);m.useEffect(()=>{T()},[T]),m.useEffect(()=>{w(0)},[u,h]),m.useEffect(()=>{let O=!1,A=null;const H=new Set,z=()=>{O||(A=new EventSource(`/api/admin/requests/stream?since=${E.current}`),A.addEventListener("request",K=>{if(!O)try{const se=JSON.parse(K.data),X=new Date(se.createdAt).getTime();if(Number.isFinite(X)&&(E.current=Math.max(E.current,X)),j.current.has(se.id))return;j.current.add(se.id),w(I=>I+1),M.current===0&&TD(se,N.current)&&(l(I=>I.some(re=>re.id===se.id)?I:[se,...I].slice(0,C)),i(I=>I+1))}catch{}}),A.onerror=()=>{A==null||A.close(),A=null,O||H.add(setTimeout(z,ND))})};return z(),()=>{O=!0,A==null||A.close();for(const K of H)clearTimeout(K);H.clear()}},[]);const _=async O=>{v(O);const A=await we.get(`/api/admin/requests/${O}`);y(A)};return s.jsxs("div",{children:[s.jsx(wa,{title:"Requests",description:`${o} matching · live updates`}),s.jsxs(Xe,{children:[s.jsxs(Fe,{children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(Vn,{value:h.success,onValueChange:O=>{d(0),p({...h,success:O})},children:[s.jsx(Rn,{className:"w-36",children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"all",children:"All"}),s.jsx(lt,{value:"true",children:"Success"}),s.jsx(lt,{value:"false",children:"Failed"})]})]}),s.jsxs(Vn,{value:h.protocol,onValueChange:O=>{d(0),p({...h,protocol:O})},children:[s.jsx(Rn,{className:"w-32",children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"all",children:"Any protocol"}),s.jsx(lt,{value:"openai",children:"OpenAI"}),s.jsx(lt,{value:"anthropic",children:"Anthropic"})]})]}),s.jsxs(Vn,{value:h.streaming,onValueChange:O=>{d(0),p({...h,streaming:O})},children:[s.jsx(Rn,{className:"w-32",children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"all",children:"Any"}),s.jsx(lt,{value:"true",children:"Streaming"}),s.jsx(lt,{value:"false",children:"Non-stream"})]})]}),s.jsx(Ae,{className:"max-w-xs",placeholder:"Model contains…",value:h.model,onChange:O=>{d(0),p({...h,model:O.target.value})}}),S>0&&s.jsxs(he,{size:"sm",variant:"secondary",onClick:()=>{w(0),T()},children:[S," new request",S>1?"s":""," — refresh"]})]}),s.jsx(Qe,{className:"mt-3 text-base",children:"Results"})]}),s.jsxs(Ze,{children:[s.jsxs(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{children:[s.jsx(pe,{children:"Time"}),s.jsx(pe,{children:"Status"}),s.jsx(pe,{children:"Requested"}),s.jsx(pe,{children:"Final"}),s.jsx(pe,{children:"Tokens"}),s.jsx(pe,{children:"Latency"}),s.jsx(pe,{children:"Attempts"}),s.jsx(pe,{children:"Key"}),s.jsx(pe,{children:"IP"}),s.jsx(pe,{})]})}),s.jsxs(Fn,{children:[a.length===0&&s.jsx(Ye,{children:s.jsx(de,{colSpan:10,className:"text-center text-muted-foreground",children:"No requests yet."})}),a.map(O=>s.jsxs(Ye,{className:"cursor-pointer",onClick:()=>_(O.id),children:[s.jsx(de,{className:"text-xs",children:Ah(O.createdAt)}),s.jsx(de,{children:O.success?s.jsx(et,{variant:"success",children:O.httpStatus}):s.jsx(et,{variant:"destructive",children:O.httpStatus})}),s.jsx(de,{className:"font-mono text-xs",children:O.requestedModel}),s.jsx(de,{className:"font-mono text-xs text-muted-foreground",children:O.finalModelPublicId??"—"}),s.jsxs(de,{className:"text-xs",children:[Mt(O.inputTokens+O.outputTokens)," ",O.cacheReadTokens?s.jsxs("span",{className:"text-amber-600",children:["(+",O.cacheReadTokens," cache)"]}):null]}),s.jsxs(de,{className:"text-xs",children:[dr(O.totalLatencyMs),O.ttftMs?s.jsxs("span",{className:"text-muted-foreground",children:[" · ttft ",O.ttftMs,"ms"]}):null]}),s.jsxs(de,{className:"text-xs",children:[O.attemptsCount,O.gatewayCacheHit?s.jsx(et,{variant:"secondary",className:"ml-1",children:"cache"}):null]}),s.jsx(de,{className:"text-xs",children:O.apiKeyName??"—"}),s.jsx(de,{className:"text-xs",children:O.clientIp}),s.jsx(de,{className:"text-right",children:s.jsx(he,{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 ",u+1,"–",Math.min(u+C,o)," of ",o]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(he,{size:"sm",variant:"outline",disabled:u===0,onClick:()=>d(Math.max(0,u-C)),children:"Prev"}),s.jsx(he,{size:"sm",variant:"outline",disabled:u+C>=o,onClick:()=>d(u+C),children:"Next"})]})]})]})]}),s.jsx(qn,{open:!!g,onOpenChange:O=>{O||(v(null),y(null))},children:s.jsxs(jn,{className:"max-w-3xl",children:[s.jsx(Cn,{children:s.jsxs(En,{children:["Request ",nE(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(et,{variant:"success",children:x.request.httpStatus}):s.jsx(et,{variant:"destructive",children:x.request.httpStatus})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Latency"}),dr(x.request.totalLatencyMs)]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-muted-foreground text-xs",children:"Tokens"}),"in ",Mt(x.request.inputTokens)," · out ",Mt(x.request.outputTokens)," · cache ",Mt(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(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{children:[s.jsx(pe,{children:"#"}),s.jsx(pe,{children:"Provider"}),s.jsx(pe,{children:"Model"}),s.jsx(pe,{children:"Status"}),s.jsx(pe,{children:"Latency"}),s.jsx(pe,{children:"Reason"})]})}),s.jsx(Fn,{children:x.attempts.map(O=>s.jsxs(Ye,{children:[s.jsx(de,{children:O.attemptNumber}),s.jsx(de,{children:O.providerName}),s.jsx(de,{className:"font-mono text-xs",children:O.modelPublicId}),s.jsx(de,{children:O.success?s.jsx(et,{variant:"success",children:String(O.statusCode??"OK")}):s.jsx(et,{variant:"destructive",children:String(O.statusCode??"err")})}),s.jsx(de,{className:"text-xs",children:dr(O.latencyMs)}),s.jsx(de,{className:"text-xs",children:O.failureReason??O.selectionReason})]},O.id))})]})]})]}):s.jsx("div",{className:"text-muted-foreground",children:"Loading…"})]})})]})}var MD=Object.defineProperty,Rs=(a,l)=>MD(a,"name",{value:l,configurable:!0}),ym="Tabs",[DD,Z_]=fn(ym,[Yc]),R1=Yc(),[_D,bm]=DD(ym),OD=m.forwardRef(Rs(function(l,o){const{__scopeTabs:i,value:u,onValueChange:d,defaultValue:h,orientation:p="horizontal",dir:g,activationMode:v="automatic",...x}=l,y=zo(g),[S,w]=Ja({prop:u,onChange:d,defaultProp:h??"",caller:ym});return s.jsx(_D,{scope:i,baseId:ga(),value:S,onValueChange:w,orientation:p,dir:y,activationMode:v,children:s.jsx(Be.div,{dir:y,"data-orientation":p,...x,ref:o})})},"Tabs")),kD="TabsList",zD=m.forwardRef(Rs(function(l,o){const{__scopeTabs:i,loop:u=!0,...d}=l,h=bm(kD,i),p=R1(i);return s.jsx(hb,{asChild:!0,...p,orientation:h.orientation,dir:h.dir,loop:u,children:s.jsx(Be.div,{role:"tablist","aria-orientation":h.orientation,...d,ref:o})})},"TabsList")),LD="TabsTrigger",UD=m.forwardRef(Rs(function(l,o){const{__scopeTabs:i,value:u,disabled:d=!1,...h}=l,p=bm(LD,i),g=R1(i),v=Sm(p.baseId,u),x=wm(p.baseId,u),y=u===p.value;return s.jsx(mb,{asChild:!0,...g,focusable:!d,active:y,children:s.jsx(Be.button,{type:"button",role:"tab","aria-selected":y,"aria-controls":x,"data-state":y?"active":"inactive","data-disabled":d?"":void 0,disabled:d,id:v,...h,ref:o,onMouseDown:Ee(l.onMouseDown,S=>{!d&&S.button===0&&S.ctrlKey===!1?p.onValueChange(u):S.preventDefault()}),onKeyDown:Ee(l.onKeyDown,S=>{d||S.target!==S.currentTarget||[" ","Enter"].includes(S.key)&&p.onValueChange(u)}),onFocus:Ee(l.onFocus,()=>{const S=p.activationMode!=="manual";!y&&!d&&S&&p.onValueChange(u)})})})},"TabsTrigger")),BD="TabsContent",HD=m.forwardRef(Rs(function(l,o){const{__scopeTabs:i,value:u,forceMount:d,children:h,...p}=l,g=bm(BD,i),v=Sm(g.baseId,u),x=wm(g.baseId,u),y=u===g.value,S=m.useRef(y);return m.useEffect(()=>{const w=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(w)},[]),s.jsx(al,{present:d||y,children:({present:w})=>s.jsx(Be.div,{"data-state":y?"active":"inactive","data-orientation":g.orientation,role:"tabpanel","aria-labelledby":v,hidden:!w,id:x,tabIndex:0,...p,ref:o,style:{...l.style,animationDuration:S.current?"0s":void 0},children:w&&h})})},"TabsContent"));function Sm(a,l){return`${a}-trigger-${l}`}Rs(Sm,"makeTriggerId");function wm(a,l){return`${a}-content-${l}`}Rs(wm,"makeContentId");var PD=OD,N1=zD,T1=UD,A1=HD;const M1=PD,jm=m.forwardRef(({className:a,...l},o)=>s.jsx(N1,{ref:o,className:Re("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",a),...l}));jm.displayName=N1.displayName;const Ka=m.forwardRef(({className:a,...l},o)=>s.jsx(T1,{ref:o,className:Re("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",a),...l}));Ka.displayName=T1.displayName;const ds=m.forwardRef(({className:a,...l},o)=>s.jsx(A1,{ref:o,className:Re("mt-2 ring-offset-background focus-visible:outline-none",a),...l}));ds.displayName=A1.displayName;const qD=3e3,ID=1600,VD=10,GD=3,YD=12,$D=10*6e4;function KD(a,l){return{...a,totalRequests:a.totalRequests+1,successfulRequests:a.successfulRequests+(l.success?1:0),failedRequests:a.failedRequests+(l.success?0:1),successRate:a.totalRequests+1?(a.successfulRequests+(l.success?1:0))/(a.totalRequests+1):0,inputTokens:a.inputTokens+l.inputTokens,outputTokens:a.outputTokens+l.outputTokens,totalTokens:a.totalTokens+l.inputTokens+l.outputTokens,cacheReadTokens:a.cacheReadTokens+l.cacheReadTokens,averageLatencyMs:(a.averageLatencyMs*a.totalRequests+l.totalLatencyMs)/(a.totalRequests+1)}}function XD(a){const[l,o]=m.useState(null),[i,u]=m.useState(null),[d,h]=m.useState([]),[p,g]=m.useState([]),[v,x]=m.useState([]),[y,S]=m.useState([]),[w,C]=m.useState(!0),[E,j]=m.useState(null),N=m.useRef([]),M=m.useRef(null),T=m.useRef(new Set),_=m.useRef(Date.now()),O=m.useRef(0),A=m.useRef([]),H=m.useRef([]);return m.useEffect(()=>{let z=!1;return C(!0),j(null),T.current=new Set,_.current=Date.now(),we.get(`/api/admin/stats?preset=${a}`).then(K=>{if(!z){o(K),u(K.summary),M.current=K.summary,h(K.recent),g(K.providers),N.current=K.providers;for(const se of K.recent)T.current.add(se.id);C(!1)}}).catch(K=>{z||(j(K.message),C(!1))}),()=>{z=!0}},[a]),m.useEffect(()=>{let z=!1,K=null;const se=new Set,X=()=>{z||(K=new EventSource(`/api/admin/requests/stream?since=${_.current}`),K.addEventListener("request",re=>{if(!z)try{const ee=JSON.parse(re.data),oe=new Date(ee.createdAt).getTime();if(Number.isFinite(oe)&&(_.current=Math.max(_.current,oe)),T.current.has(ee.id))return;if(T.current.add(ee.id),M.current&&u(KD(M.current,ee)),h(U=>U.some($=>$.id===ee.id)?U:[ee,...U].slice(0,VD)),ee.providerId){N.current=N.current.map(B=>B.id===ee.providerId?{...B,requests:B.requests+1,errorRate:B.requests+1?(B.errorRate*B.requests+(ee.success?0:1))/(B.requests+1):0}:B),g(N.current);const U=`p${++O.current}`,$={id:U,providerId:ee.providerId,success:ee.success};A.current=[...A.current.slice(-(GD*4)),$],x(A.current);const le=setTimeout(()=>{A.current=A.current.filter(B=>B.id!==U),x(A.current)},ID);se.add(le)}H.current.some(U=>U.id===ee.id)&&(H.current=H.current.filter(U=>U.id!==ee.id),S(H.current))}catch{}}),K.addEventListener("request_started",re=>{if(!z)try{const ee=JSON.parse(re.data);if(!ee.providerId||ee.providerId==="")return;H.current=[...H.current.filter(oe=>oe.id!==ee.requestId).slice(-(YD-1)),{id:ee.requestId,providerId:ee.providerId,startedAt:Date.now(),ttftMs:ee.ttftMs??0}],S(H.current)}catch{}}),K.onerror=()=>{K==null||K.close(),K=null,z||se.add(setTimeout(X,qD))})};X();const I=setInterval(()=>{const re=Date.now()-$D;H.current.some(ee=>ee.startedAt<re)&&(H.current=H.current.filter(ee=>ee.startedAt>=re),S(H.current))},3e4);return()=>{z=!0,K==null||K.close();for(const re of se)clearTimeout(re);se.clear(),clearInterval(I)}},[]),m.useEffect(()=>{const z=setInterval(()=>{we.get("/api/admin/providers").then(K=>{const se=new Map(K.providers.map(X=>[X.id,X]));N.current=N.current.map(X=>{const I=se.get(X.id);return I?{...X,health:I.health,enabled:I.enabled}:X}),g(N.current)}).catch(()=>{})},3e4);return()=>clearInterval(z)},[]),{snapshot:l,live:i??(l==null?void 0:l.summary)??FD,recent:d,providers:p,pulses:v,activeRoutes:y,loading:w,error:E}}const FD={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 D1({data:a,className:l,strokeClass:o="stroke-primary",fillClass:i}){if(a.length===0)return s.jsx("svg",{className:Re("h-6 w-20",l),viewBox:"0 0 80 24"});const h=Math.max(...a),p=Math.min(...a),g=h-p||1,x=a.map((y,S)=>{const w=S/(a.length-1)*78+1,C=22-(y-p)/g*20;return`${w.toFixed(1)},${C.toFixed(1)}`}).join(" ");return s.jsxs("svg",{className:Re("h-6 w-20",l),viewBox:"0 0 80 24",preserveAspectRatio:"none",children:[i&&s.jsx("polygon",{points:`1,23 ${x} 79,23`,className:i}),s.jsx("polyline",{points:x,fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:o})]})}function QD(a,l,o){const i=performance.now();let u=0;const d=h=>{const p=Math.min((h-i)/l,1),g=Math.round(a*p);g!==u&&(u=g,o(g)),p<1&&requestAnimationFrame(d)};requestAnimationFrame(d)}function ZD({delta:a,inverse:l}){if(Math.abs(a)<.005)return null;const o=a>0,i=l?!o:o,u=`${(Math.abs(a)*100).toFixed(1)}%`;return s.jsxs("span",{className:Re("ml-1.5 inline-flex items-center rounded-full px-1.5 py-0.5 text-[10px] font-semibold leading-none",i?"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:o?"▲":"▼"}),u]})}function Ol({icon:a,label:l,value:o,format:i="number",delta:u,deltaInverse:d,sparkData:h,sparkStroke:p}){const[g,v]=m.useState(0),x=m.useRef(0);m.useEffect(()=>{const S=x.current,w=o;x.current=o,S!==w&&QD(Math.abs(w-S),600,C=>v(S+(w>S?C:-C)))},[o]);const y=i==="percent"?kc(g):i==="latency"?dr(g):Mt(Math.round(g));return s.jsxs(Xe,{children:[s.jsxs(Fe,{className:"flex flex-row items-center justify-between pb-1",children:[s.jsxs(Qe,{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[s.jsx(a,{className:"h-4 w-4"}),l]}),u!==void 0&&s.jsx(ZD,{delta:u,inverse:d})]}),s.jsxs(Ze,{className:"flex items-end justify-between",children:[s.jsx("span",{className:"text-2xl font-semibold tabular-nums",children:y}),h&&h.length>1&&s.jsx(D1,{data:h,strokeClass:p??"stroke-primary",fillClass:"fill-primary/10"})]})]})}const _1=1e3,gy=380,uc=60,kl=_1/2,zl=720,Hf=62,JD=260;function WD(a){return a==="healthy"?"fill-emerald-400":a==="degraded"?"fill-amber-400":"fill-red-400"}function dc(a,l,o,i){const u=a+(o-a)*.45,d=a+(o-a)*.55;return`M${a},${l} C${u},${l} ${d},${i} ${o},${i}`}function e_({liveRequests:a,successRate:l,providers:o,pulses:i,activeRoutes:u}){const d=gy/2,h=d,p=Math.max(1,o.reduce((x,y)=>x+y.requests,0)),g=new Set(u.map(x=>x.providerId)),v=g.size>0;return s.jsxs(Xe,{children:[s.jsx(Fe,{className:"pb-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Qe,{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(Ze,{className:"pt-0",children:s.jsx("div",{className:"relative w-full",children:s.jsxs("svg",{viewBox:`0 0 ${_1} ${gy}`,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"})]})]})}),o.map(x=>{const S=60+o.indexOf(x)*Hf,w=x.requests/p,C=Math.max(1.5,Math.min(6,2+w*8)),E=g.has(x.id);return s.jsxs("g",{children:[E&&s.jsx("path",{d:dc(kl,d,zl-20,S),fill:"none",stroke:"hsl(var(--primary) / 0.25)",strokeWidth:C+6,strokeLinecap:"round"}),s.jsx("path",{d:dc(kl,d,zl-20,S),fill:"none",stroke:E?"hsl(var(--primary))":"hsl(var(--border))",strokeWidth:E?C+1:C,strokeLinecap:"round",opacity:E?.95:.6,className:E?"route-active":void 0})]},x.id)}),s.jsx("path",{d:dc(uc+30,h,kl-30,d),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}),i.map(x=>{const y=o.findIndex(E=>E.id===x.providerId);if(y===-1)return null;const S=60+y*Hf,w=dc(kl,d,zl-20,S),C=x.success?"var(--primary)":"#f87171";return s.jsxs("g",{filter:"url(#glow)",children:[s.jsx("circle",{r:5,fill:C,opacity:.9,children:s.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})}),s.jsx("circle",{r:9,fill:C,opacity:.25,children:s.jsx("animateMotion",{dur:"1.4s",fill:"freeze",path:w})})]},x.id)}),s.jsx("circle",{cx:uc,cy:h,r:28,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1.5}),s.jsx("text",{x:uc,y:h-4,textAnchor:"middle",className:"fill-foreground",fontSize:12,fontWeight:600,children:vy(a)}),s.jsx("text",{x:uc,y:h+10,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"requests"}),s.jsx("circle",{cx:kl,cy:d,r:36,fill:"hsl(var(--card))",stroke:"var(--primary)",strokeWidth:2}),s.jsx("image",{x:kl-12,y:d-16,width:24,height:24,href:"/logo.png"}),s.jsx("text",{x:kl,y:d+28,textAnchor:"middle",className:"fill-muted-foreground",fontSize:9,children:"AI Gateway"}),s.jsxs("text",{x:kl,y:d+38,textAnchor:"middle",className:"fill-emerald-500",fontSize:10,fontWeight:600,children:[(l*100).toFixed(1),"%"]}),o.map((x,y)=>{const S=60+y*Hf,w=x.requests/p,C=!x.enabled||x.requests===0;return s.jsxs("g",{opacity:C?.4:1,children:[s.jsx("rect",{x:zl-20,y:S-14,width:JD,height:50,rx:8,fill:"hsl(var(--card))",stroke:"hsl(var(--border))",strokeWidth:1}),s.jsx("circle",{cx:zl-6,cy:S+10,r:4,className:WD(x.health)}),s.jsx("text",{x:zl+6,y:S-2,className:"fill-foreground",fontSize:12,fontWeight:500,children:x.name}),s.jsxs("text",{x:zl+6,y:S+12,className:"fill-muted-foreground",fontSize:10,children:[x.modelCount," model",x.modelCount!==1?"s":""," · ",vy(x.requests)," req"]}),s.jsxs("text",{x:zl+6,y:S+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 vy(a){return a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(1)}K`:String(a)}function t_({rows:a}){return s.jsxs(Xe,{children:[s.jsx(Fe,{className:"pb-2",children:s.jsx(Qe,{className:"text-base",children:"Recent Requests"})}),s.jsx(Ze,{children:a.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(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{children:[s.jsx(pe,{children:"Model"}),s.jsx(pe,{children:"Provider"}),s.jsx(pe,{children:"Tokens"}),s.jsx(pe,{children:"Status"}),s.jsx(pe,{children:"Time"})]})}),s.jsx(Fn,{children:a.map(l=>s.jsxs(Ye,{children:[s.jsx(de,{className:"font-mono text-xs",children:l.requestedModel}),s.jsx(de,{className:"text-xs text-muted-foreground",children:l.providerName??"—"}),s.jsxs(de,{className:"text-xs",children:[s.jsxs("span",{className:"font-mono",children:["in ",Mt(l.inputTokens)," · out ",Mt(l.outputTokens)]}),l.cacheReadTokens>0&&s.jsxs("span",{className:"ml-1 text-amber-600",children:["(+",Mt(l.cacheReadTokens)," cache)"]})]}),s.jsx(de,{children:s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx("span",{className:l.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:l.success?l.httpStatus:`${l.httpStatus} err`})]})}),s.jsx(de,{className:"text-xs text-muted-foreground",children:aE(l.createdAt)})]},l.id))})]})})]})}const fh=34,xy=2*Math.PI*fh;function n_(a){return a>=.95?{stroke:"#4ade80",text:"text-emerald-500"}:a>=.8?{stroke:"#fbbf24",text:"text-amber-500"}:{stroke:"#f87171",text:"text-red-500"}}function a_({successRate:a,averageLatencyMs:l,latencySpark:o}){const{stroke:i,text:u}=n_(a),d=Math.min(1,Math.max(0,a)),h=xy*(1-d);return s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs(Xe,{children:[s.jsx(Fe,{className:"pb-2",children:s.jsx(Qe,{className:"text-base",children:"Success Rate"})}),s.jsxs(Ze,{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:fh,fill:"none",stroke:"hsl(var(--border))",strokeWidth:7}),s.jsx("circle",{cx:"40",cy:"40",r:fh,fill:"none",stroke:i,strokeWidth:7,strokeLinecap:"round",strokeDasharray:xy,strokeDashoffset:h,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 ${u}`,children:kc(a)})]}),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(Xe,{children:[s.jsx(Fe,{className:"pb-2",children:s.jsx(Qe,{className:"text-base",children:"Average Latency"})}),s.jsxs(Ze,{className:"flex items-end justify-between",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-2xl font-semibold tabular-nums",children:dr(l)}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Live average across the selected window"})]}),s.jsx(D1,{data:o,strokeClass:"stroke-amber-500",fillClass:"fill-amber-500/10",className:"h-10 w-28"})]})]})]})}function l_(){const[a,l]=m.useState("7d"),{snapshot:o,live:i,recent:u,providers:d,pulses:h,activeRoutes:p,loading:g,error:v}=XD(a);if(g)return s.jsx("div",{className:"text-muted-foreground",children:"Loading…"});if(v||!o)return s.jsxs("div",{className:"text-destructive",children:["Failed to load statistics: ",v??"unknown error"]});const x=i,y=o.previous,S=o.series;function w(j,N){return N>0?(j-N)/N:void 0}const C=S.map(j=>j.requests),E=S.map(j=>j.avgLatency);return s.jsxs("div",{children:[s.jsx(wa,{title:"Statistics",description:"Real-time monitoring dashboard",actions:s.jsx(M1,{value:a,onValueChange:j=>void l(j),children:s.jsxs(jm,{children:[s.jsx(Ka,{value:"today",children:"Today"}),s.jsx(Ka,{value:"7d",children:"7 days"}),s.jsx(Ka,{value:"30d",children:"30 days"})]})})}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[s.jsx(Ol,{icon:$y,label:"Requests",value:x.totalRequests,delta:w(x.totalRequests,y.totalRequests),sparkData:C}),s.jsx(Ol,{icon:Dc,label:"Success rate",format:"percent",value:x.successRate,delta:w(x.successRate,y.successRate),sparkData:C,sparkStroke:"stroke-emerald-500"}),s.jsx(Ol,{icon:sC,label:"Total tokens",value:x.totalTokens,delta:w(x.totalTokens,y.totalTokens),sparkData:S.map(j=>j.inputTokens+j.outputTokens)}),s.jsx(Ol,{icon:oC,label:"Cache hit rate",format:"percent",value:x.cacheHitRate,delta:w(x.cacheHitRate,y.cacheHitRate),sparkData:S.map(j=>j.cacheRead)}),s.jsx(Ol,{icon:aC,label:"Avg latency",format:"latency",value:x.averageLatencyMs,delta:w(x.averageLatencyMs,y.averageLatencyMs),deltaInverse:!0,sparkData:E,sparkStroke:"stroke-amber-500"}),s.jsx(Ol,{icon:Fy,label:"p95 latency",format:"latency",value:x.p95LatencyMs}),s.jsx(Ol,{icon:SC,label:"Avg TTFT",format:"latency",value:x.averageTtftMs??0}),s.jsx(Ol,{icon:gC,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(e_,{liveRequests:x.totalRequests,successRate:x.successRate,providers:d,pulses:h,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(t_,{rows:u})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs(Xe,{children:[s.jsx(Fe,{className:"pb-2",children:s.jsx(Qe,{className:"text-base",children:"Top Models"})}),s.jsx(Ze,{children:s.jsxs(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{children:[s.jsx(pe,{children:"Model"}),s.jsx(pe,{children:"Req"}),s.jsx(pe,{children:"Errors"}),s.jsx(pe,{children:"Tokens"})]})}),s.jsxs(Fn,{children:[o.topModels.length===0&&s.jsx(Ye,{children:s.jsx(de,{colSpan:4,className:"text-muted-foreground text-center",children:"No data"})}),o.topModels.map(j=>s.jsxs(Ye,{children:[s.jsx(de,{className:"font-mono text-xs",children:j.publicId}),s.jsx(de,{className:"text-xs",children:Mt(j.requests)}),s.jsx(de,{className:"text-xs",children:s.jsx("span",{className:j.errorRate>.1?"text-destructive":"text-muted-foreground",children:kc(j.errorRate)})}),s.jsx(de,{className:"text-xs",children:Mt(j.totalTokens)})]},j.publicId))]})]})})]}),s.jsxs(Xe,{children:[s.jsx(Fe,{className:"pb-2",children:s.jsx(Qe,{className:"text-base",children:"Top API Keys"})}),s.jsx(Ze,{children:s.jsxs(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{children:[s.jsx(pe,{children:"Key"}),s.jsx(pe,{children:"Requests"}),s.jsx(pe,{children:"Tokens"})]})}),s.jsxs(Fn,{children:[o.topApiKeys.length===0&&s.jsx(Ye,{children:s.jsx(de,{colSpan:3,className:"text-muted-foreground text-center",children:"No data"})}),o.topApiKeys.map((j,N)=>s.jsxs(Ye,{children:[s.jsx(de,{className:"text-xs",children:j.name}),s.jsx(de,{className:"text-xs",children:Mt(j.requests)}),s.jsx(de,{className:"text-xs",children:Mt(j.totalTokens)})]},N))]})]})})]})]})]}),s.jsx("div",{className:"mt-6",children:s.jsx(a_,{successRate:x.successRate,averageLatencyMs:x.averageLatencyMs,latencySpark:E})})]})}function r_(){const[a,l]=m.useState([]),[o,i]=m.useState(0);return m.useEffect(()=>{we.get("/api/admin/audit?limit=200").then(u=>{l(u.rows),i(u.total)})},[]),s.jsxs("div",{children:[s.jsx(wa,{title:"Audit Logs",description:`${o} entries · immutable`}),s.jsxs(Xe,{children:[s.jsx(Fe,{children:s.jsx(Qe,{className:"text-base",children:"All entries"})}),s.jsx(Ze,{children:s.jsxs(Kn,{children:[s.jsx(Xn,{children:s.jsxs(Ye,{children:[s.jsx(pe,{children:"Time"}),s.jsx(pe,{children:"Action"}),s.jsx(pe,{children:"Status"}),s.jsx(pe,{children:"Target"}),s.jsx(pe,{children:"IP"}),s.jsx(pe,{children:"Actor"})]})}),s.jsxs(Fn,{children:[a.length===0&&s.jsx(Ye,{children:s.jsx(de,{colSpan:6,className:"text-center text-muted-foreground",children:"No audit events yet."})}),a.map(u=>s.jsxs(Ye,{children:[s.jsx(de,{className:"text-xs",children:Ah(u.createdAt)}),s.jsx(de,{className:"font-mono text-xs",children:u.action}),s.jsx(de,{children:u.success?s.jsx(et,{variant:"success",children:"ok"}):s.jsx(et,{variant:"destructive",children:"fail"})}),s.jsx(de,{className:"text-xs",children:u.targetName??u.targetId??"—"}),s.jsx(de,{className:"text-xs",children:u.ip}),s.jsx(de,{className:"text-xs",children:u.actor})]},u.id))]})]})})]})]})}const hh={enabled:!0,sound:!0};let To=hh,mh=!1,fc=null;const ph=new Set;function O1(){for(const a of ph)a()}function k1(a=!1){return mh&&!a?Promise.resolve():(!a&&fc||(fc=(async()=>{try{const l=await we.get("/api/admin/settings");To={enabled:l.settings.notificationsEnabled??hh.enabled,sound:l.settings.notificationSoundEnabled??hh.sound},mh=!0,O1()}catch{}})()),fc)}async function yy(a){const l={};a.enabled!==void 0&&(l.notificationsEnabled=a.enabled),a.sound!==void 0&&(l.notificationSoundEnabled=a.sound),await we.patch("/api/admin/settings",l),To={...To,...a},mh=!0,O1()}function s_(a){return ph.add(a),()=>ph.delete(a)}function z1(){return m.useSyncExternalStore(s_,()=>To,()=>To)}const gh=m.forwardRef(({className:a,...l},o)=>s.jsx("textarea",{ref:o,className:Re("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",a),...l}));gh.displayName="Textarea";function o_(){const[a]=B2(),[l,o]=m.useState(null),[i,u]=m.useState(null),[d,h]=m.useState({current:"",next:""}),[p,g]=m.useState(""),[v,x]=m.useState(""),[y,S]=m.useState(null),[w,C]=m.useState(!1),[E,j]=m.useState("idle"),[N,M]=m.useState(null),T=async(J=!1)=>{j("checking"),M(null);try{const me=await we.get(`/api/admin/update/check${J?"?force=1":""}`);S(me),j("idle")}catch(me){M(me.message),j("error")}},_=async()=>{C(!0),j("installing"),M(null);try{const J=await we.post("/api/admin/update/run");j("restarting"),ve.success(J.message||"Update started — the gateway will restart shortly.");const me=setInterval(()=>{fetch("/health").then(je=>{je.ok&&(clearInterval(me),window.location.reload())}).catch(()=>{})},3e3);setTimeout(()=>clearInterval(me),12e4)}catch(J){ve.error(J.message),M(J.message),j("error")}finally{C(!1)}},[O,A]=m.useState("disabled"),[H,z]=m.useState(""),[K,se]=m.useState(""),[X,I]=m.useState(""),[re,ee]=m.useState([]),[oe,U]=m.useState(""),[$,le]=m.useState(""),[B,Z]=m.useState(!1),[D,q]=m.useState(null),Q=async()=>{const J=await we.get("/api/admin/settings");o(J.settings),g(J.settings.adminIpAllow??""),x(J.settings.adminIpBlock??"");const me=await we.get("/api/admin/settings/system");u(me);try{const je=await we.get("/api/admin/me");A(je.totpEnabled?"enabled":"disabled")}catch{}};if(m.useEffect(()=>{k1(!0)},[]),m.useEffect(()=>{Q(),T()},[]),!l)return s.jsx("div",{className:"text-muted-foreground",children:"Loading…"});const ae=async J=>{try{await we.patch("/api/admin/settings",J),ve.success("Saved"),Q()}catch(me){ve.error(me.message)}},ce=async()=>{try{const J=await we.post("/api/admin/account/totp/begin");z(J.secret),se(J.qr),A("setup"),ve.info("Scan the QR code with your authenticator app")}catch(J){ve.error(J.message)}},Se=async()=>{if(!X||X.length!==6){ve.error("Enter a 6-digit code");return}try{const J=await we.post("/api/admin/account/totp/verify",{code:X});ee(J.recoveryCodes),A("showingRecovery"),ve.success("TOTP enabled successfully")}catch(J){ve.error(J.message)}},ue=async()=>{if(!oe){ve.error("Enter your password");return}if(!$){ve.error("Enter a TOTP code or recovery code");return}try{await we.post("/api/admin/account/totp/disable",{password:oe,totp:$}),A("disabled"),U(""),le(""),ve.success("TOTP disabled"),Q()}catch(J){ve.error(J.message)}},fe=async()=>{Z(!0);try{const J=await we.post("/api/admin/account/totp/recovery/regenerate",{password:oe,totp:$});ee(J.recoveryCodes),A("showingRecovery"),ve.success("Recovery codes regenerated")}catch(J){ve.error(J.message)}Z(!1)},xe=a.get("tab")||"logging";return s.jsxs("div",{children:[s.jsx(wa,{title:"Settings",description:"Logging, security, backup, and system info"}),s.jsxs(M1,{defaultValue:xe,children:[s.jsxs(jm,{children:[s.jsx(Ka,{value:"logging",children:"Logging"}),s.jsx(Ka,{value:"access",children:"Access Control"}),s.jsx(Ka,{value:"security",children:"Security"}),s.jsx(Ka,{value:"backup",children:"Backup"}),s.jsx(Ka,{value:"system",children:"System"})]}),s.jsx(ds,{value:"logging",children:s.jsxs(Xe,{children:[s.jsx(Fe,{children:s.jsx(Qe,{className:"text-base",children:"Logging policy"})}),s.jsxs(Ze,{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Request-content logging"}),s.jsxs(Vn,{value:l.contentLogMode,onValueChange:J=>ae({contentLogMode:J}),children:[s.jsx(Rn,{children:s.jsx(Gn,{})}),s.jsxs(Nn,{children:[s.jsx(lt,{value:"off",children:"Off"}),s.jsx(lt,{value:"metadata",children:"Metadata only (default)"}),s.jsx(lt,{value:"prompt",children:"Prompt (sanitized)"}),s.jsx(lt,{value:"prompt_and_response",children:"Prompt + response (sanitized)"})]})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Retention (days)"}),s.jsx(Ae,{type:"number",min:1,max:3650,value:l.retentionDays,onChange:J=>ae({retentionDays:Number(J.target.value)})})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(be,{children:"Database size limit (MB)"}),s.jsx(Ae,{type:"number",min:64,value:l.dbSizeLimitMb,onChange:J=>ae({dbSizeLimitMb:Number(J.target.value)})})]}),s.jsx("div",{className:"flex items-center gap-2 pt-2",children:s.jsx(he,{onClick:async()=>{const J=await we.post("/api/admin/settings/cleanup");ve.success(`Deleted ${J.deletedRequests} old requests`)},children:"Run cleanup now"})})]})]})}),s.jsx(ds,{value:"access",children:s.jsxs(Xe,{children:[s.jsxs(Fe,{children:[s.jsx(Qe,{className:"text-base",children:"IP access control"}),s.jsx(on,{children:"Allowlist / Blocklist for this admin website (not model traffic)"})]}),s.jsxs(Ze,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(be,{children:"Allow only these IPs"}),s.jsx(gh,{placeholder:`192.168.1.0/24
|
|
330
|
+
10.0.0.1`,value:p,onChange:J=>g(J.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(gh,{placeholder:"192.168.1.100",value:v,onChange:J=>x(J.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(he,{onClick:()=>{const J={};p!==((l==null?void 0:l.adminIpAllow)??"")&&(J.adminIpAllow=p||null),v!==((l==null?void 0:l.adminIpBlock)??"")&&(J.adminIpBlock=v||null),we.patch("/api/admin/settings",J).then(me=>{ve.success("Saved"+(me.addedIp?` — added your IP: ${me.addedIp}`:"")),Q(),g(""),x("")}).catch(me=>ve.error(me.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(ds,{value:"security",children:s.jsxs(Xe,{children:[s.jsxs(Fe,{children:[s.jsx(Qe,{className:"text-base",children:"Security"}),s.jsx(on,{children:"Change password, 2FA, and trusted proxy configuration"})]}),s.jsxs(Ze,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(be,{children:"Trusted proxy hops"}),s.jsx(Ae,{type:"number",min:0,max:8,value:l.trustProxyHops,onChange:J=>ae({trustProxyHops:Number(J.target.value)})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"0 = never trust X-Forwarded-For (direct exposure). 1+ only when behind a single trusted reverse proxy."})]}),s.jsxs("div",{className:"space-y-2 border-t pt-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(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(he,{variant:"outline",onClick:ce,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."}),K&&s.jsx("img",{src:K,alt:"TOTP QR code",className:"h-40 w-40"}),s.jsxs("div",{className:"text-xs font-mono text-muted-foreground",children:["Secret: ",H]}),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(Ae,{value:X,onChange:J=>I(J.target.value),placeholder:"123456",maxLength:6})]}),s.jsx(he,{disabled:X.length<6,onClick:Se,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:re.map((J,me)=>s.jsx("div",{className:"font-mono text-xs",children:J},me))}),s.jsx(he,{onClick:()=>{A("enabled"),ve.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(Ae,{type:"password",value:oe,onChange:J=>U(J.target.value),placeholder:"Current password"})]}),s.jsxs("div",{children:[s.jsx(be,{children:"TOTP code"}),s.jsx(Ae,{value:$,onChange:J=>le(J.target.value),placeholder:"123456",maxLength:6})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(he,{variant:"outline",size:"sm",disabled:B||!oe||$.length<6,onClick:fe,children:"Regenerate recovery codes"}),s.jsx(he,{variant:"destructive",size:"sm",disabled:!oe||$.length<6,onClick:ue,children:"Disable TOTP"})]})]})]}),s.jsxs("div",{className:"space-y-2 border-t pt-4",children:[s.jsx(be,{children:"Change password"}),s.jsx(Ae,{type:"password",placeholder:"Current password",value:d.current,onChange:J=>h({...d,current:J.target.value})}),s.jsx(Ae,{type:"password",placeholder:"New password (12+ chars)",value:d.next,onChange:J=>h({...d,next:J.target.value})}),s.jsx(he,{disabled:!d.current||d.next.length<12,onClick:async()=>{try{await we.post("/api/admin/account/password",{currentPassword:d.current,newPassword:d.next}),ve.success("Password changed"),h({current:"",next:""})}catch(J){ve.error(J.message)}},children:"Change password"})]})]})]})}),s.jsx(ds,{value:"backup",children:s.jsxs(Xe,{children:[s.jsxs(Fe,{children:[s.jsx(Qe,{className:"text-base",children:"Backup & restore"}),s.jsx(on,{children:"Download a snapshot or restore from a previous backup"})]}),s.jsxs(Ze,{className:"space-y-3",children:[s.jsx(he,{onClick:async()=>{try{const J=await fetch("/api/admin/backup/create",{method:"POST",credentials:"include"});if(!J.ok)throw new Error("Backup failed");const me=await J.blob(),je=URL.createObjectURL(me),Me=document.createElement("a");Me.href=je,Me.download="latedev-backup.json",Me.click(),URL.revokeObjectURL(je),ve.success("Backup downloaded")}catch(J){ve.error(J.message)}},children:"Download backup"}),s.jsxs(s1,{open:D!==null,onOpenChange:J=>{J||q(null)},children:[s.jsx(xM,{asChild:!0,children:s.jsxs("div",{children:[s.jsx(be,{children:"Restore from backup file"}),s.jsx(Ae,{type:"file",accept:".json,application/json","data-testid":"restore-file",onChange:J=>{var je;const me=(je=J.target.files)==null?void 0:je[0];q(me??null)}})]})}),s.jsxs(am,{children:[s.jsxs(i1,{children:[s.jsx(lm,{children:"Restore backup?"}),s.jsxs(rm,{children:["Restoring will replace the entire current database with the selected backup (",(D==null?void 0:D.name)??"file","). This cannot be undone. A snapshot of the current database is kept for rollback only if validation fails."]})]}),s.jsxs(c1,{children:[s.jsx(om,{children:"Cancel"}),s.jsx(sm,{onClick:async()=>{var me,je;const J=D;if(J)try{const Me=await fetch("/api/admin/backup/restore",{method:"POST",body:J,credentials:"include",headers:{"content-type":"application/json"}});if(!Me.ok)throw new Error(((je=(me=await Me.json())==null?void 0:me.error)==null?void 0:je.message)??"Restore failed");ve.success("Restored. Reloading…"),q(null),setTimeout(()=>location.reload(),600)}catch(Me){ve.error(Me.message)}},children:"Restore"})]})]})]})]})]})}),s.jsxs(ds,{value:"system",children:[s.jsxs(Xe,{children:[s.jsx(Fe,{children:s.jsx(Qe,{className:"text-base",children:"System"})}),s.jsxs(Ze,{className:"space-y-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"App version:"})," ",i==null?void 0:i.appVersion]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Data directory:"})," ",s.jsx("span",{className:"font-mono",children:i==null?void 0:i.dataDir})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Encryption:"})," ",i!=null&&i.masterKeyConfigured?"Configured":"Not configured"," (v",i==null?void 0:i.masterKeyVersion,")"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-muted-foreground",children:"Environment:"})," ",i==null?void 0:i.environment]}),s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(ba,{checked:l.gatewayCacheEnabled,onCheckedChange:J=>ae({gatewayCacheEnabled:J})}),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(Ae,{type:"number",min:1,value:l.gatewayCacheDefaultTtlSeconds,onChange:J=>ae({gatewayCacheDefaultTtlSeconds:Number(J.target.value)})})]}),s.jsxs("div",{children:[s.jsx(be,{children:"Cache max size (MB)"}),s.jsx(Ae,{type:"number",min:1,value:l.gatewayCacheMaxSizeMb,onChange:J=>ae({gatewayCacheMaxSizeMb:Number(J.target.value)})})]})]}),s.jsx(he,{variant:"outline",onClick:async()=>{const J=await we.post("/api/admin/settings/cache/clear");ve.success(`Cleared ${J.deleted} entries`)},children:"Clear gateway cache"})]})]}),s.jsx(i_,{}),s.jsxs(Xe,{className:"mt-4",children:[s.jsxs(Fe,{children:[s.jsx(Qe,{className:"text-base",children:"Updates"}),s.jsx(on,{children:"Automatic updates from the npm registry"})]}),s.jsxs(Ze,{className:"space-y-3 text-sm",children:[E==="checking"&&!y&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(jo,{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(et,{variant:"secondary",children:y.status.watchtower?"Docker + Watchtower":"Docker"}):y.latestVersion===null?s.jsx(et,{variant:"secondary",children:"Registry unreachable"}):y.hasUpdate?s.jsx(et,{variant:"success",children:"Update available"}):s.jsxs(et,{variant:"outline",children:[s.jsx(Dc,{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). ",N&&s.jsx("span",{className:"text-destructive",children:N})]}),E==="installing"&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(jo,{className:"h-4 w-4 animate-spin"})," Applying the update… this can take a minute."]}),E==="restarting"&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[s.jsx(jo,{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&&E==="idle"&&(!y.status.docker||y.status.watchtower&&y.watchtowerReachable!==!1)&&s.jsxs(he,{disabled:w||y.status.docker&&y.watchtowerReachable===!1,onClick:_,children:[s.jsx(Xy,{className:"mr-1 h-4 w-4"})," Update now"]}),y.hasUpdate&&y.changelogUrl&&s.jsx(he,{variant:"outline",asChild:!0,children:s.jsx("a",{href:y.changelogUrl,target:"_blank",rel:"noreferrer",children:"View changes"})}),E==="idle"&&s.jsx(he,{variant:"ghost",disabled:w,onClick:()=>T(!0),children:"Check again"})]})]})]})]})]})]})]})}function i_(){const a=z1();return s.jsxs(Xe,{className:"mt-4",children:[s.jsx(Fe,{children:s.jsxs(Qe,{className:"text-base flex items-center gap-2",children:[s.jsx(J2,{className:"h-4 w-4"})," Notifications"]})}),s.jsxs(Ze,{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:a.enabled,onCheckedChange:l=>void yy({enabled:l})})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(wC,{className:"h-3 w-3"})," Play notification sound"]}),s.jsx(ba,{checked:a.sound,onCheckedChange:l=>void yy({sound:l})})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Notifications are disabled while muted. Changes apply immediately."})]})]})}function c_({items:a,onDismiss:l}){return a.length?s.jsx("div",{className:"fixed top-16 right-4 z-50 flex max-h-[calc(100vh-8rem)] w-80 flex-col gap-2 overflow-y-auto",children:a.map(o=>{const i=!o.success,u=o.success&&o.totalLatencyMs>15e3,d=Re("rounded-md border shadow-lg transition-all",i&&"bg-destructive text-destructive-foreground border-destructive",u&&"bg-amber-500/90 text-amber-950 border-amber-600/50",!i&&!u&&"bg-card text-card-foreground border-border");return s.jsxs(ur,{to:"/requests",className:Re("block shrink-0 p-3 hover:opacity-95",d),children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[i?s.jsx(nC,{className:"h-4 w-4 shrink-0"}):o.success?s.jsx(Dc,{className:"h-4 w-4 shrink-0"}):s.jsx(jC,{className:"h-4 w-4 shrink-0 opacity-70"}),s.jsx("div",{className:"min-w-0 truncate text-sm font-medium",title:o.requestedModel,children:o.requestedModel})]}),s.jsx("button",{className:"shrink-0 opacity-60 hover:opacity-100",onClick:h=>{h.preventDefault(),h.stopPropagation(),l(o.id)},"aria-label":"Dismiss",type:"button",children:s.jsx(Oc,{className:"h-3.5 w-3.5"})})]}),s.jsxs("div",{className:"mt-1 text-xs",children:[o.success?"Thành công":"Thất bại",!o.success&&o.errorType&&s.jsx("span",{className:"ml-1 inline-block rounded bg-black/15 px-1 py-0.5 align-text-bottom text-[10px]",children:o.errorType})]}),s.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:["in ",Mt(o.inputTokens)," · out ",Mt(o.outputTokens),(o.cacheReadTokens>0||o.cacheWriteTokens>0)&&s.jsxs(s.Fragment,{children:[" · cache ",o.cacheReadTokens>0&&s.jsxs("span",{children:["r",Mt(o.cacheReadTokens)]}),o.cacheReadTokens>0&&o.cacheWriteTokens>0&&"/",o.cacheWriteTokens>0&&s.jsxs("span",{children:["w",Mt(o.cacheWriteTokens)]})]})]}),s.jsxs("div",{className:"mt-1 text-[11px] opacity-90",children:[dr(o.totalLatencyMs),o.ttftMs!=null&&o.ttftMs>=0&&s.jsxs("span",{children:[" · TTFT ",dr(o.ttftMs)]})]})]},o.id)})}):null}const u_=5e3,d_=8,f_=3e3;let hc=null;function h_(){try{hc||(hc=new Audio("/notification.mp3")),hc.currentTime=0,hc.play().catch(()=>{})}catch{}}function m_(){const[a,l]=m.useState([]),o=m.useRef(null),i=m.useRef(new Map),u=m.useRef(Date.now()),d=m.useRef(new Set),h=z1(),p=m.useRef(h.sound);p.current=h.sound,m.useEffect(()=>{k1()},[]);const g=h.enabled;return m.useEffect(()=>{var w;if(!g){(w=o.current)==null||w.close(),o.current=null;const C=i.current;for(const E of C.values())clearTimeout(E);C.clear(),l([]);return}let x=!1;const y=i.current,S=()=>{if(x)return;const C=new EventSource(`/api/admin/requests/stream?since=${u.current}`);o.current=C,C.addEventListener("request",E=>{if(!x)try{const j=JSON.parse(E.data),N=new Date(j.createdAt).getTime();if(Number.isFinite(N)&&(u.current=Math.max(u.current,N)),d.current.has(j.id))return;d.current.add(j.id),l(T=>T.some(_=>_.id===j.id)?T:[j,...T].slice(0,d_));const M=setTimeout(()=>{l(T=>T.filter(_=>_.id!==j.id)),y.delete(j.id)},u_);y.set(j.id,M),p.current&&h_()}catch{}}),C.onerror=()=>{C.close(),o.current=null,x||setTimeout(S,f_)}};return S(),()=>{var C;x=!0,(C=o.current)==null||C.close(),o.current=null;for(const E of y.values())clearTimeout(E);y.clear()}},[g]),{items:a,dismiss:x=>{const y=i.current.get(x);y&&(clearTimeout(y),i.current.delete(x)),l(S=>S.filter(w=>w.id!==x))}}}function p_({children:a}){const{user:l,loading:o}=Nh(),i=dn();return o?s.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):l?s.jsx(s.Fragment,{children:a}):s.jsx(qf,{to:"/login",state:{from:i},replace:!0})}function g_(){const{items:a,dismiss:l}=m_();return s.jsxs("div",{className:"flex h-screen bg-background text-foreground",children:[s.jsx(rE,{}),s.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[s.jsx(sA,{}),s.jsx("main",{className:"flex-1 overflow-auto p-6",children:s.jsxs(Py,{children:[s.jsx(rn,{index:!0,element:s.jsx(PA,{})}),s.jsx(rn,{path:"/providers",element:s.jsx(hD,{})}),s.jsx(rn,{path:"/models",element:s.jsx(jD,{})}),s.jsx(rn,{path:"/combos",element:s.jsx(CD,{})}),s.jsx(rn,{path:"/aliases",element:s.jsx(ED,{})}),s.jsx(rn,{path:"/api-keys",element:s.jsx(RD,{})}),s.jsx(rn,{path:"/requests",element:s.jsx(AD,{})}),s.jsx(rn,{path:"/statistics",element:s.jsx(l_,{})}),s.jsx(rn,{path:"/audit",element:s.jsx(r_,{})}),s.jsx(rn,{path:"/settings/*",element:s.jsx(o_,{})})]})})]}),s.jsx(c_,{items:a,onDismiss:l})]})}function v_({children:a}){const[l,o]=m.useState(null),i=dn();return m.useEffect(()=>{we.get("/api/admin/setup/status").then(u=>o(u.setupComplete)).catch(()=>o(!0))},[]),l===null?s.jsx("div",{className:"flex h-screen items-center justify-center text-muted-foreground",children:"Loading…"}):!l&&i.pathname!=="/setup"?s.jsx(qf,{to:"/setup",replace:!0}):l&&i.pathname==="/setup"?s.jsx(qf,{to:"/",replace:!0}):s.jsx(s.Fragment,{children:a})}function x_(){return s.jsx(K2,{children:s.jsx(v_,{children:s.jsxs(Py,{children:[s.jsx(rn,{path:"/setup",element:s.jsx(BA,{})}),s.jsx(rn,{path:"/login",element:s.jsx(UA,{})}),s.jsx(rn,{path:"/*",element:s.jsx(p_,{children:s.jsx(g_,{})})})]})})})}const y_=LA;var b_=Object.defineProperty,cn=(a,l)=>b_(a,"name",{value:l,configurable:!0}),[Cm,J_]=fn("Tooltip",[Es]),S_=Es(),w_="TooltipProvider",j_=700,by="tooltip.open",[C_,E_]=Cm(w_),R_=cn(a=>{const{__scopeTooltip:l,delayDuration:o=j_,skipDelayDuration:i=300,disableHoverableContent:u=!1,children:d}=a,h=m.useRef(!0),p=m.useRef(!1),g=m.useRef(0);return m.useEffect(()=>{const v=g.current;return()=>window.clearTimeout(v)},[]),s.jsx(C_,{scope:l,isOpenDelayedRef:h,delayDuration:o,onOpen:m.useCallback(()=>{i<=0||(window.clearTimeout(g.current),h.current=!1)},[i]),onClose:m.useCallback(()=>{i<=0||(window.clearTimeout(g.current),g.current=window.setTimeout(()=>h.current=!0,i))},[i]),isPointerInTransitRef:p,onPointerInTransitChange:m.useCallback(v=>{p.current=v},[]),disableHoverableContent:u,children:d})},"TooltipProvider"),N_="Tooltip",[W_,Em]=Cm(N_),T_="TooltipPortal",[eO,A_]=Cm(T_,{forceMount:void 0}),Ao="TooltipContent",M_=m.forwardRef(cn(function(l,o){const i=A_(Ao,l.__scopeTooltip),{forceMount:u=i.forceMount,side:d="top",...h}=l,p=Em(Ao,l.__scopeTooltip);return s.jsx(al,{present:u||p.open,children:p.disableHoverableContent?s.jsx(L1,{side:d,...h,ref:o}):s.jsx(D_,{side:d,...h,ref:o})})},"TooltipContent")),D_=m.forwardRef(cn(function(l,o){const i=Em(Ao,l.__scopeTooltip),u=E_(Ao,l.__scopeTooltip),d=m.useRef(null),h=Ie(o,d),[p,g]=m.useState(null),{trigger:v,onClose:x}=i,y=d.current,{onPointerInTransitChange:S}=u,w=m.useCallback(()=>{g(null),S(!1)},[S]),C=m.useCallback((E,j)=>{const N=E.currentTarget,M={x:E.clientX,y:E.clientY},T=U1(M,N.getBoundingClientRect()),_=B1(M,T),O=H1(j.getBoundingClientRect()),A=q1([..._,...O]);g(A),S(!0)},[S]);return m.useEffect(()=>()=>w(),[w]),m.useEffect(()=>{if(v&&y){const E=cn(N=>C(N,y),"handleTriggerLeave"),j=cn(N=>C(N,v),"handleContentLeave");return v.addEventListener("pointerleave",E),y.addEventListener("pointerleave",j),()=>{v.removeEventListener("pointerleave",E),y.removeEventListener("pointerleave",j)}}},[v,y,C,w]),m.useEffect(()=>{if(p){const E=cn(j=>{const N=j.target,M={x:j.clientX,y:j.clientY},T=(v==null?void 0:v.contains(N))||(y==null?void 0:y.contains(N)),_=!P1(M,p);T?w():_&&(w(),x())},"handleTrackPointerGrace");return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[v,y,p,x,w]),s.jsx(L1,{...l,ref:h})},"TooltipContentHoverable")),__=c0("TooltipContent"),L1=m.forwardRef(cn(function(l,o){const{__scopeTooltip:i,children:u,"aria-label":d,id:h,onEscapeKeyDown:p,onPointerDownOutside:g,...v}=l,x=Em(Ao,i),y=S_(i),{onClose:S}=x;m.useEffect(()=>(document.addEventListener(by,S),()=>document.removeEventListener(by,S)),[S]),m.useEffect(()=>{if(x.trigger){const C=cn(E=>{E.target instanceof Node&&E.target.contains(x.trigger)&&S()},"handleScroll");return window.addEventListener("scroll",C,{capture:!0}),()=>window.removeEventListener("scroll",C,{capture:!0})}},[x.trigger,S]);const{setContentId:w}=x;return Dt(()=>(w(h),()=>{w(void 0)}),[h,w]),s.jsx(Lc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:p,onPointerDownOutside:g,onFocusOutside:C=>C.preventDefault(),onDismiss:S,children:s.jsxs(Vh,{"data-state":x.stateAttribute,role:d?void 0:"tooltip",id:d?void 0:x.contentId,...y,...v,ref:o,style:{...v.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(__,{children:u}),d?s.jsx(NM,{id:x.contentId,role:"tooltip",children:d}):null]})})},"TooltipContentImpl"));function U1(a,l){const o=Math.abs(l.top-a.y),i=Math.abs(l.bottom-a.y),u=Math.abs(l.right-a.x),d=Math.abs(l.left-a.x);switch(Math.min(o,i,u,d)){case d:return"left";case u:return"right";case o:return"top";case i:return"bottom";default:throw new Error("unreachable")}}cn(U1,"getExitSideFromRect");function B1(a,l,o=5){const i=[];switch(l){case"top":i.push({x:a.x-o,y:a.y+o},{x:a.x+o,y:a.y+o});break;case"bottom":i.push({x:a.x-o,y:a.y-o},{x:a.x+o,y:a.y-o});break;case"left":i.push({x:a.x+o,y:a.y-o},{x:a.x+o,y:a.y+o});break;case"right":i.push({x:a.x-o,y:a.y-o},{x:a.x-o,y:a.y+o});break}return i}cn(B1,"getPaddedExitPoints");function H1(a){const{top:l,right:o,bottom:i,left:u}=a;return[{x:u,y:l},{x:o,y:l},{x:o,y:i},{x:u,y:i}]}cn(H1,"getPointsFromRect");function P1(a,l){const{x:o,y:i}=a;let u=!1;for(let d=0,h=l.length-1;d<l.length;h=d++){const p=l[d],g=l[h],v=p.x,x=p.y,y=g.x,S=g.y;x>i!=S>i&&o<(y-v)*(i-x)/(S-x)+v&&(u=!u)}return u}cn(P1,"isPointInPolygon");function q1(a){const l=a.slice();return l.sort((o,i)=>o.x<i.x?-1:o.x>i.x?1:o.y<i.y?-1:o.y>i.y?1:0),I1(l)}cn(q1,"getHull");function I1(a){if(a.length<=1)return a.slice();const l=[];for(let i=0;i<a.length;i++){const u=a[i];for(;l.length>=2;){const d=l[l.length-1],h=l[l.length-2];if((d.x-h.x)*(u.y-h.y)>=(d.y-h.y)*(u.x-h.x))l.pop();else break}l.push(u)}l.pop();const o=[];for(let i=a.length-1;i>=0;i--){const u=a[i];for(;o.length>=2;){const d=o[o.length-1],h=o[o.length-2];if((d.x-h.x)*(u.y-h.y)>=(d.y-h.y)*(u.x-h.x))o.pop();else break}o.push(u)}return o.pop(),l.length===1&&o.length===1&&l[0].x===o[0].x&&l[0].y===o[0].y?l:l.concat(o)}cn(I1,"getHullPresorted");var O_=R_,V1=M_;const k_=O_,z_=m.forwardRef(({className:a,sideOffset:l=4,...o},i)=>s.jsx(V1,{ref:i,sideOffset:l,className:Re("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95",a),...o}));z_.displayName=V1.displayName;dj.createRoot(document.getElementById("root")).render(s.jsx(ie.StrictMode,{children:s.jsx(mE,{defaultTheme:"dark",storageKey:"latedev-theme",children:s.jsxs(k_,{children:[s.jsx(k2,{children:s.jsx(x_,{})}),s.jsx(y_,{position:"top-right"})]})})}));
|