@samanhappy/mcphub 0.12.2 → 0.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,294 @@
1
+ var Yy=Object.defineProperty;var Jy=(a,n,l)=>n in a?Yy(a,n,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[n]=l;var pn=(a,n,l)=>Jy(a,typeof n!="symbol"?n+"":n,l);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const m of d.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&o(m)}).observe(document,{childList:!0,subtree:!0});function l(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function o(c){if(c.ep)return;c.ep=!0;const d=l(c);fetch(c.href,d)}})();function xg(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var ku={exports:{}},gl={};/**
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 hh;function Qy(){if(hh)return gl;hh=1;var a=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function l(o,c,d){var m=null;if(d!==void 0&&(m=""+d),c.key!==void 0&&(m=""+c.key),"key"in c){d={};for(var p in c)p!=="key"&&(d[p]=c[p])}else d=c;return c=d.ref,{$$typeof:a,type:o,key:m,ref:c!==void 0?c:null,props:d}}return gl.Fragment=n,gl.jsx=l,gl.jsxs=l,gl}var gh;function Xy(){return gh||(gh=1,ku.exports=Qy()),ku.exports}var r=Xy(),Au={exports:{}},Me={};/**
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 xh;function Zy(){if(xh)return Me;xh=1;var a=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),m=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),w=Symbol.iterator;function T(j){return j===null||typeof j!="object"?null:(j=w&&j[w]||j["@@iterator"],typeof j=="function"?j:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,E={};function A(j,M,z){this.props=j,this.context=M,this.refs=E,this.updater=z||R}A.prototype.isReactComponent={},A.prototype.setState=function(j,M){if(typeof j!="object"&&typeof j!="function"&&j!=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,j,M,"setState")},A.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function N(){}N.prototype=A.prototype;function S(j,M,z){this.props=j,this.context=M,this.refs=E,this.updater=z||R}var D=S.prototype=new N;D.constructor=S,O(D,A.prototype),D.isPureReactComponent=!0;var P=Array.isArray;function $(){}var B={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function Y(j,M,z){var q=z.ref;return{$$typeof:a,type:j,key:M,ref:q!==void 0?q:null,props:z}}function fe(j,M){return Y(j.type,M,j.props)}function G(j){return typeof j=="object"&&j!==null&&j.$$typeof===a}function K(j){var M={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(z){return M[z]})}var X=/\/+/g;function H(j,M){return typeof j=="object"&&j!==null&&j.key!=null?K(""+j.key):M.toString(36)}function Z(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then($,$):(j.status="pending",j.then(function(M){j.status==="pending"&&(j.status="fulfilled",j.value=M)},function(M){j.status==="pending"&&(j.status="rejected",j.reason=M)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function C(j,M,z,q,pe){var se=typeof j;(se==="undefined"||se==="boolean")&&(j=null);var Q=!1;if(j===null)Q=!0;else switch(se){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(j.$$typeof){case a:case n:Q=!0;break;case b:return Q=j._init,C(Q(j._payload),M,z,q,pe)}}if(Q)return pe=pe(j),Q=q===""?"."+H(j,0):q,P(pe)?(z="",Q!=null&&(z=Q.replace(X,"$&/")+"/"),C(pe,M,z,"",function(ye){return ye})):pe!=null&&(G(pe)&&(pe=fe(pe,z+(pe.key==null||j&&j.key===pe.key?"":(""+pe.key).replace(X,"$&/")+"/")+Q)),M.push(pe)),1;Q=0;var ge=q===""?".":q+":";if(P(j))for(var re=0;re<j.length;re++)q=j[re],se=ge+H(q,re),Q+=C(q,M,z,se,pe);else if(re=T(j),typeof re=="function")for(j=re.call(j),re=0;!(q=j.next()).done;)q=q.value,se=ge+H(q,re++),Q+=C(q,M,z,se,pe);else if(se==="object"){if(typeof j.then=="function")return C(Z(j),M,z,q,pe);throw M=String(j),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.")}return Q}function I(j,M,z){if(j==null)return j;var q=[],pe=0;return C(j,q,"","",function(se){return M.call(z,se,pe++)}),q}function U(j){if(j._status===-1){var M=j._result;M=M(),M.then(function(z){(j._status===0||j._status===-1)&&(j._status=1,j._result=z)},function(z){(j._status===0||j._status===-1)&&(j._status=2,j._result=z)}),j._status===-1&&(j._status=0,j._result=M)}if(j._status===1)return j._result.default;throw j._result}var oe=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var M=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(M))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)},V={map:I,forEach:function(j,M,z){I(j,function(){M.apply(this,arguments)},z)},count:function(j){var M=0;return I(j,function(){M++}),M},toArray:function(j){return I(j,function(M){return M})||[]},only:function(j){if(!G(j))throw Error("React.Children.only expected to receive a single React element child.");return j}};return Me.Activity=x,Me.Children=V,Me.Component=A,Me.Fragment=l,Me.Profiler=c,Me.PureComponent=S,Me.StrictMode=o,Me.Suspense=g,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,Me.__COMPILER_RUNTIME={__proto__:null,c:function(j){return B.H.useMemoCache(j)}},Me.cache=function(j){return function(){return j.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(j,M,z){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var q=O({},j.props),pe=j.key;if(M!=null)for(se in M.key!==void 0&&(pe=""+M.key),M)!L.call(M,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&M.ref===void 0||(q[se]=M[se]);var se=arguments.length-2;if(se===1)q.children=z;else if(1<se){for(var Q=Array(se),ge=0;ge<se;ge++)Q[ge]=arguments[ge+2];q.children=Q}return Y(j.type,pe,q)},Me.createContext=function(j){return j={$$typeof:m,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:d,_context:j},j},Me.createElement=function(j,M,z){var q,pe={},se=null;if(M!=null)for(q in M.key!==void 0&&(se=""+M.key),M)L.call(M,q)&&q!=="key"&&q!=="__self"&&q!=="__source"&&(pe[q]=M[q]);var Q=arguments.length-2;if(Q===1)pe.children=z;else if(1<Q){for(var ge=Array(Q),re=0;re<Q;re++)ge[re]=arguments[re+2];pe.children=ge}if(j&&j.defaultProps)for(q in Q=j.defaultProps,Q)pe[q]===void 0&&(pe[q]=Q[q]);return Y(j,se,pe)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(j){return{$$typeof:p,render:j}},Me.isValidElement=G,Me.lazy=function(j){return{$$typeof:b,_payload:{_status:-1,_result:j},_init:U}},Me.memo=function(j,M){return{$$typeof:h,type:j,compare:M===void 0?null:M}},Me.startTransition=function(j){var M=B.T,z={};B.T=z;try{var q=j(),pe=B.S;pe!==null&&pe(z,q),typeof q=="object"&&q!==null&&typeof q.then=="function"&&q.then($,oe)}catch(se){oe(se)}finally{M!==null&&z.types!==null&&(M.types=z.types),B.T=M}},Me.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},Me.use=function(j){return B.H.use(j)},Me.useActionState=function(j,M,z){return B.H.useActionState(j,M,z)},Me.useCallback=function(j,M){return B.H.useCallback(j,M)},Me.useContext=function(j){return B.H.useContext(j)},Me.useDebugValue=function(){},Me.useDeferredValue=function(j,M){return B.H.useDeferredValue(j,M)},Me.useEffect=function(j,M){return B.H.useEffect(j,M)},Me.useEffectEvent=function(j){return B.H.useEffectEvent(j)},Me.useId=function(){return B.H.useId()},Me.useImperativeHandle=function(j,M,z){return B.H.useImperativeHandle(j,M,z)},Me.useInsertionEffect=function(j,M){return B.H.useInsertionEffect(j,M)},Me.useLayoutEffect=function(j,M){return B.H.useLayoutEffect(j,M)},Me.useMemo=function(j,M){return B.H.useMemo(j,M)},Me.useOptimistic=function(j,M){return B.H.useOptimistic(j,M)},Me.useReducer=function(j,M,z){return B.H.useReducer(j,M,z)},Me.useRef=function(j){return B.H.useRef(j)},Me.useState=function(j){return B.H.useState(j)},Me.useSyncExternalStore=function(j,M,z){return B.H.useSyncExternalStore(j,M,z)},Me.useTransition=function(){return B.H.useTransition()},Me.version="19.2.1",Me}var yh;function od(){return yh||(yh=1,Au.exports=Zy()),Au.exports}var y=od();const Ta=xg(y);var Eu={exports:{}},xl={},Tu={exports:{}},Ru={};/**
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 bh;function Wy(){return bh||(bh=1,(function(a){function n(C,I){var U=C.length;C.push(I);e:for(;0<U;){var oe=U-1>>>1,V=C[oe];if(0<c(V,I))C[oe]=I,C[U]=V,U=oe;else break e}}function l(C){return C.length===0?null:C[0]}function o(C){if(C.length===0)return null;var I=C[0],U=C.pop();if(U!==I){C[0]=U;e:for(var oe=0,V=C.length,j=V>>>1;oe<j;){var M=2*(oe+1)-1,z=C[M],q=M+1,pe=C[q];if(0>c(z,U))q<V&&0>c(pe,z)?(C[oe]=pe,C[q]=U,oe=q):(C[oe]=z,C[M]=U,oe=M);else if(q<V&&0>c(pe,U))C[oe]=pe,C[q]=U,oe=q;else break e}}return I}function c(C,I){var U=C.sortIndex-I.sortIndex;return U!==0?U:C.id-I.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 m=Date,p=m.now();a.unstable_now=function(){return m.now()-p}}var g=[],h=[],b=1,x=null,w=3,T=!1,R=!1,O=!1,E=!1,A=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function D(C){for(var I=l(h);I!==null;){if(I.callback===null)o(h);else if(I.startTime<=C)o(h),I.sortIndex=I.expirationTime,n(g,I);else break;I=l(h)}}function P(C){if(O=!1,D(C),!R)if(l(g)!==null)R=!0,$||($=!0,K());else{var I=l(h);I!==null&&Z(P,I.startTime-C)}}var $=!1,B=-1,L=5,Y=-1;function fe(){return E?!0:!(a.unstable_now()-Y<L)}function G(){if(E=!1,$){var C=a.unstable_now();Y=C;var I=!0;try{e:{R=!1,O&&(O=!1,N(B),B=-1),T=!0;var U=w;try{t:{for(D(C),x=l(g);x!==null&&!(x.expirationTime>C&&fe());){var oe=x.callback;if(typeof oe=="function"){x.callback=null,w=x.priorityLevel;var V=oe(x.expirationTime<=C);if(C=a.unstable_now(),typeof V=="function"){x.callback=V,D(C),I=!0;break t}x===l(g)&&o(g),D(C)}else o(g);x=l(g)}if(x!==null)I=!0;else{var j=l(h);j!==null&&Z(P,j.startTime-C),I=!1}}break e}finally{x=null,w=U,T=!1}I=void 0}}finally{I?K():$=!1}}}var K;if(typeof S=="function")K=function(){S(G)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,H=X.port2;X.port1.onmessage=G,K=function(){H.postMessage(null)}}else K=function(){A(G,0)};function Z(C,I){B=A(function(){C(a.unstable_now())},I)}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(C){C.callback=null},a.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<C?Math.floor(1e3/C):5},a.unstable_getCurrentPriorityLevel=function(){return w},a.unstable_next=function(C){switch(w){case 1:case 2:case 3:var I=3;break;default:I=w}var U=w;w=I;try{return C()}finally{w=U}},a.unstable_requestPaint=function(){E=!0},a.unstable_runWithPriority=function(C,I){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var U=w;w=C;try{return I()}finally{w=U}},a.unstable_scheduleCallback=function(C,I,U){var oe=a.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?oe+U:oe):U=oe,C){case 1:var V=-1;break;case 2:V=250;break;case 5:V=1073741823;break;case 4:V=1e4;break;default:V=5e3}return V=U+V,C={id:b++,callback:I,priorityLevel:C,startTime:U,expirationTime:V,sortIndex:-1},U>oe?(C.sortIndex=U,n(h,C),l(g)===null&&C===l(h)&&(O?(N(B),B=-1):O=!0,Z(P,U-oe))):(C.sortIndex=V,n(g,C),R||T||(R=!0,$||($=!0,K()))),C},a.unstable_shouldYield=fe,a.unstable_wrapCallback=function(C){var I=w;return function(){var U=w;w=I;try{return C.apply(this,arguments)}finally{w=U}}}})(Ru)),Ru}var vh;function eb(){return vh||(vh=1,Tu.exports=Wy()),Tu.exports}var Ou={exports:{}},Wt={};/**
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 wh;function tb(){if(wh)return Wt;wh=1;var a=od();function n(g){var h="https://react.dev/errors/"+g;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)h+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(){}var o={d:{f:l,r:function(){throw Error(n(522))},D:l,C:l,L:l,m:l,X:l,S:l,M:l},p:0,findDOMNode:null},c=Symbol.for("react.portal");function d(g,h,b){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:x==null?null:""+x,children:g,containerInfo:h,implementation:b}}var m=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,h){if(g==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Wt.createPortal=function(g,h){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(n(299));return d(g,h,null,b)},Wt.flushSync=function(g){var h=m.T,b=o.p;try{if(m.T=null,o.p=2,g)return g()}finally{m.T=h,o.p=b,o.d.f()}},Wt.preconnect=function(g,h){typeof g=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,o.d.C(g,h))},Wt.prefetchDNS=function(g){typeof g=="string"&&o.d.D(g)},Wt.preinit=function(g,h){if(typeof g=="string"&&h&&typeof h.as=="string"){var b=h.as,x=p(b,h.crossOrigin),w=typeof h.integrity=="string"?h.integrity:void 0,T=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;b==="style"?o.d.S(g,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:x,integrity:w,fetchPriority:T}):b==="script"&&o.d.X(g,{crossOrigin:x,integrity:w,fetchPriority:T,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Wt.preinitModule=function(g,h){if(typeof g=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var b=p(h.as,h.crossOrigin);o.d.M(g,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&o.d.M(g)},Wt.preload=function(g,h){if(typeof g=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var b=h.as,x=p(b,h.crossOrigin);o.d.L(g,b,{crossOrigin:x,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Wt.preloadModule=function(g,h){if(typeof g=="string")if(h){var b=p(h.as,h.crossOrigin);o.d.m(g,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else o.d.m(g)},Wt.requestFormReset=function(g){o.d.r(g)},Wt.unstable_batchedUpdates=function(g,h){return g(h)},Wt.useFormState=function(g,h,b){return m.H.useFormState(g,h,b)},Wt.useFormStatus=function(){return m.H.useHostTransitionStatus()},Wt.version="19.2.1",Wt}var Sh;function rb(){if(Sh)return Ou.exports;Sh=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(n){console.error(n)}}return a(),Ou.exports=tb(),Ou.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 jh;function ab(){if(jh)return xl;jh=1;var a=eb(),n=od(),l=rb();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function m(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(o(188))}function h(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(o(188));return t!==e?null:e}for(var s=e,i=t;;){var u=s.return;if(u===null)break;var f=u.alternate;if(f===null){if(i=u.return,i!==null){s=i;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===s)return g(u),e;if(f===i)return g(u),t;f=f.sibling}throw Error(o(188))}if(s.return!==i.return)s=u,i=f;else{for(var v=!1,k=u.child;k;){if(k===s){v=!0,s=u,i=f;break}if(k===i){v=!0,i=u,s=f;break}k=k.sibling}if(!v){for(k=f.child;k;){if(k===s){v=!0,s=f,i=u;break}if(k===i){v=!0,i=f,s=u;break}k=k.sibling}if(!v)throw Error(o(189))}}if(s.alternate!==i)throw Error(o(190))}if(s.tag!==3)throw Error(o(188));return s.stateNode.current===s?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var x=Object.assign,w=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),S=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),fe=Symbol.for("react.memo_cache_sentinel"),G=Symbol.iterator;function K(e){return e===null||typeof e!="object"?null:(e=G&&e[G]||e["@@iterator"],typeof e=="function"?e:null)}var X=Symbol.for("react.client.reference");function H(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===X?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case A:return"Profiler";case E:return"StrictMode";case P:return"Suspense";case $:return"SuspenseList";case Y:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case R:return"Portal";case S:return e.displayName||"Context";case N:return(e._context.displayName||"Context")+".Consumer";case D:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case B:return t=e.displayName||null,t!==null?t:H(e.type)||"Memo";case L:t=e._payload,e=e._init;try{return H(e(t))}catch{}}return null}var Z=Array.isArray,C=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},oe=[],V=-1;function j(e){return{current:e}}function M(e){0>V||(e.current=oe[V],oe[V]=null,V--)}function z(e,t){V++,oe[V]=e.current,e.current=t}var q=j(null),pe=j(null),se=j(null),Q=j(null);function ge(e,t){switch(z(se,t),z(pe,e),z(q,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?_p(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=_p(t),e=Bp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}M(q),z(q,e)}function re(){M(q),M(pe),M(se)}function ye(e){e.memoizedState!==null&&z(Q,e);var t=q.current,s=Bp(t,e.type);t!==s&&(z(pe,e),z(q,s))}function ue(e){pe.current===e&&(M(q),M(pe)),Q.current===e&&(M(Q),ml._currentValue=U)}var ie,xe;function Xe(e){if(ie===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);ie=t&&t[1]||"",xe=-1<s.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+ie+e+xe}var Ft=!1;function Vt(e,t){if(!e||Ft)return"";Ft=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(ne){var ae=ne}Reflect.construct(e,[],me)}else{try{me.call()}catch(ne){ae=ne}e.call(me.prototype)}}else{try{throw Error()}catch(ne){ae=ne}(me=e())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(ne){if(ne&&ae&&typeof ne.stack=="string")return[ne.stack,ae.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=i.DetermineComponentFrameRoot(),v=f[0],k=f[1];if(v&&k){var _=v.split(`
44
+ `),te=k.split(`
45
+ `);for(u=i=0;i<_.length&&!_[i].includes("DetermineComponentFrameRoot");)i++;for(;u<te.length&&!te[u].includes("DetermineComponentFrameRoot");)u++;if(i===_.length||u===te.length)for(i=_.length-1,u=te.length-1;1<=i&&0<=u&&_[i]!==te[u];)u--;for(;1<=i&&0<=u;i--,u--)if(_[i]!==te[u]){if(i!==1||u!==1)do if(i--,u--,0>u||_[i]!==te[u]){var ce=`
46
+ `+_[i].replace(" at new "," at ");return e.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",e.displayName)),ce}while(1<=i&&0<=u);break}}}finally{Ft=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?Xe(s):""}function Ze(e,t){switch(e.tag){case 26:case 27:case 5:return Xe(e.type);case 16:return Xe("Lazy");case 13:return e.child!==t&&t!==null?Xe("Suspense Fallback"):Xe("Suspense");case 19:return Xe("SuspenseList");case 0:case 15:return Vt(e.type,!1);case 11:return Vt(e.type.render,!1);case 1:return Vt(e.type,!0);case 31:return Xe("Activity");default:return""}}function gt(e){try{var t="",s=null;do t+=Ze(e,s),s=e,e=e.return;while(e);return t}catch(i){return`
47
+ Error generating stack: `+i.message+`
48
+ `+i.stack}}var $t=Object.prototype.hasOwnProperty,Ut=a.unstable_scheduleCallback,Yt=a.unstable_cancelCallback,It=a.unstable_shouldYield,pr=a.unstable_requestPaint,tt=a.unstable_now,wt=a.unstable_getCurrentPriorityLevel,ir=a.unstable_ImmediatePriority,ze=a.unstable_UserBlockingPriority,St=a.unstable_NormalPriority,ke=a.unstable_LowPriority,nt=a.unstable_IdlePriority,lt=a.log,ar=a.unstable_setDisableYieldValue,Jt=null,ft=null;function sr(e){if(typeof lt=="function"&&ar(e),ft&&typeof ft.setStrictMode=="function")try{ft.setStrictMode(Jt,e)}catch{}}var xt=Math.clz32?Math.clz32:La,Ma=Math.log,ia=Math.LN2;function La(e){return e>>>=0,e===0?32:31-(Ma(e)/ia|0)|0}var hr=256,gr=262144,W=4194304;function ve(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 qe(e,t,s){var i=e.pendingLanes;if(i===0)return 0;var u=0,f=e.suspendedLanes,v=e.pingedLanes;e=e.warmLanes;var k=i&134217727;return k!==0?(i=k&~f,i!==0?u=ve(i):(v&=k,v!==0?u=ve(v):s||(s=k&~e,s!==0&&(u=ve(s))))):(k=i&~f,k!==0?u=ve(k):v!==0?u=ve(v):s||(s=i&~e,s!==0&&(u=ve(s)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,s=t&-t,f>=s||f===32&&(s&4194048)!==0)?t:u}function jt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Vr(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 oa(){var e=W;return W<<=1,(W&62914560)===0&&(W=4194304),e}function $r(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function Ve(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function it(e,t,s,i,u,f){var v=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var k=e.entanglements,_=e.expirationTimes,te=e.hiddenUpdates;for(s=v&~s;0<s;){var ce=31-xt(s),me=1<<ce;k[ce]=0,_[ce]=-1;var ae=te[ce];if(ae!==null)for(te[ce]=null,ce=0;ce<ae.length;ce++){var ne=ae[ce];ne!==null&&(ne.lane&=-536870913)}s&=~me}i!==0&&he(e,i,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(v&~t))}function he(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-xt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|s&261930}function le(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var i=31-xt(s),u=1<<i;u&t|e[i]&t&&(e[i]|=t),s&=~u}}function be(e,t){var s=t&-t;return s=(s&42)!==0?1:nr(s),(s&(e.suspendedLanes|t))!==0?0:s}function nr(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 Yr(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function ds(){var e=I.p;return e!==0?e:(e=window.event,e===void 0?32:oh(e.type))}function Qt(e,t){var s=I.p;try{return I.p=e,t()}finally{I.p=s}}var Xt=Math.random().toString(36).slice(2),$e="__reactFiber$"+Xt,Mt="__reactProps$"+Xt,Zt="__reactContainer$"+Xt,we="__reactEvents$"+Xt,Re="__reactListeners$"+Xt,Fe="__reactHandles$"+Xt,Ke="__reactResources$"+Xt,ct="__reactMarker$"+Xt;function Jr(e){delete e[$e],delete e[Mt],delete e[we],delete e[Re],delete e[Fe]}function xr(e){var t=e[$e];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Zt]||s[$e]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=Vp(e);e!==null;){if(s=e[$e])return s;e=Vp(e)}return t}e=s,s=e.parentNode}return null}function yr(e){if(e=e[$e]||e[Zt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Nt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function ca(e){var t=e[Ke];return t||(t=e[Ke]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function yt(e){e[ct]=!0}var Cd=new Set,kd={};function ms(e,t){Ms(e,t),Ms(e+"Capture",t)}function Ms(e,t){for(kd[e]=t,e=0;e<t.length;e++)Cd.add(t[e])}var B0=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]*$"),Ad={},Ed={};function I0(e){return $t.call(Ed,e)?!0:$t.call(Ad,e)?!1:B0.test(e)?Ed[e]=!0:(Ad[e]=!0,!1)}function Ll(e,t,s){if(I0(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function Dl(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function ua(e,t,s,i){if(i===null)e.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+i)}}function Er(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Td(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function H0(e,t,s){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var u=i.get,f=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(v){s=""+v,f.call(this,v)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return s},setValue:function(v){s=""+v},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function bo(e){if(!e._valueTracker){var t=Td(e)?"checked":"value";e._valueTracker=H0(e,t,""+e[t])}}function Rd(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),i="";return e&&(i=Td(e)?e.checked?"true":"false":e.value),e=i,e!==s?(t.setValue(e),!0):!1}function Pl(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 G0=/[\n"\\]/g;function Tr(e){return e.replace(G0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function vo(e,t,s,i,u,f,v,k){e.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.type=v:e.removeAttribute("type"),t!=null?v==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Er(t)):e.value!==""+Er(t)&&(e.value=""+Er(t)):v!=="submit"&&v!=="reset"||e.removeAttribute("value"),t!=null?wo(e,v,Er(t)):s!=null?wo(e,v,Er(s)):i!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?e.name=""+Er(k):e.removeAttribute("name")}function Od(e,t,s,i,u,f,v,k){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||s!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){bo(e);return}s=s!=null?""+Er(s):"",t=t!=null?""+Er(t):s,k||t===e.value||(e.value=t),e.defaultValue=t}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=k?e.checked:!!i,e.defaultChecked=!!i,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.name=v),bo(e)}function wo(e,t,s){t==="number"&&Pl(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Ls(e,t,s,i){if(e=e.options,t){t={};for(var u=0;u<s.length;u++)t["$"+s[u]]=!0;for(s=0;s<e.length;s++)u=t.hasOwnProperty("$"+e[s].value),e[s].selected!==u&&(e[s].selected=u),u&&i&&(e[s].defaultSelected=!0)}else{for(s=""+Er(s),t=null,u=0;u<e.length;u++){if(e[u].value===s){e[u].selected=!0,i&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function zd(e,t,s){if(t!=null&&(t=""+Er(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Er(s):""}function Md(e,t,s,i){if(t==null){if(i!=null){if(s!=null)throw Error(o(92));if(Z(i)){if(1<i.length)throw Error(o(93));i=i[0]}s=i}s==null&&(s=""),t=s}s=Er(t),e.defaultValue=s,i=e.textContent,i===s&&i!==""&&i!==null&&(e.value=i),bo(e)}function Ds(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var K0=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 Ld(e,t,s){var i=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,s):typeof s!="number"||s===0||K0.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Dd(e,t,s){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,s!=null){for(var i in s)!s.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var u in t)i=t[u],t.hasOwnProperty(u)&&s[u]!==i&&Ld(e,u,i)}else for(var f in t)t.hasOwnProperty(f)&&Ld(e,f,t[f])}function So(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 q0=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"]]),F0=/^[\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 Ul(e){return F0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function da(){}var jo=null;function No(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ps=null,Us=null;function Pd(e){var t=yr(e);if(t&&(e=t.stateNode)){var s=e[Mt]||null;e:switch(e=t.stateNode,t.type){case"input":if(vo(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Tr(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var i=s[t];if(i!==e&&i.form===e.form){var u=i[Mt]||null;if(!u)throw Error(o(90));vo(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<s.length;t++)i=s[t],i.form===e.form&&Rd(i)}break e;case"textarea":zd(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&Ls(e,!!s.multiple,t,!1)}}}var Co=!1;function Ud(e,t,s){if(Co)return e(t,s);Co=!0;try{var i=e(t);return i}finally{if(Co=!1,(Ps!==null||Us!==null)&&(Ni(),Ps&&(t=Ps,e=Us,Us=Ps=null,Pd(t),e)))for(t=0;t<e.length;t++)Pd(e[t])}}function Tn(e,t){var s=e.stateNode;if(s===null)return null;var i=s[Mt]||null;if(i===null)return null;s=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(o(231,t,typeof s));return s}var ma=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ko=!1;if(ma)try{var Rn={};Object.defineProperty(Rn,"passive",{get:function(){ko=!0}}),window.addEventListener("test",Rn,Rn),window.removeEventListener("test",Rn,Rn)}catch{ko=!1}var Da=null,Ao=null,_l=null;function _d(){if(_l)return _l;var e,t=Ao,s=t.length,i,u="value"in Da?Da.value:Da.textContent,f=u.length;for(e=0;e<s&&t[e]===u[e];e++);var v=s-e;for(i=1;i<=v&&t[s-i]===u[f-i];i++);return _l=u.slice(e,1<i?1-i:void 0)}function Bl(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 Il(){return!0}function Bd(){return!1}function or(e){function t(s,i,u,f,v){this._reactName=s,this._targetInst=u,this.type=i,this.nativeEvent=f,this.target=v,this.currentTarget=null;for(var k in e)e.hasOwnProperty(k)&&(s=e[k],this[k]=s?s(f):f[k]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Il:Bd,this.isPropagationStopped=Bd,this}return x(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Il)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Il)},persist:function(){},isPersistent:Il}),t}var fs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hl=or(fs),On=x({},fs,{view:0,detail:0}),V0=or(On),Eo,To,zn,Gl=x({},On,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Oo,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!==zn&&(zn&&e.type==="mousemove"?(Eo=e.screenX-zn.screenX,To=e.screenY-zn.screenY):To=Eo=0,zn=e),Eo)},movementY:function(e){return"movementY"in e?e.movementY:To}}),Id=or(Gl),$0=x({},Gl,{dataTransfer:0}),Y0=or($0),J0=x({},On,{relatedTarget:0}),Ro=or(J0),Q0=x({},fs,{animationName:0,elapsedTime:0,pseudoElement:0}),X0=or(Q0),Z0=x({},fs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),W0=or(Z0),ex=x({},fs,{data:0}),Hd=or(ex),tx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},rx={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"},ax={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function sx(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ax[e])?!!t[e]:!1}function Oo(){return sx}var nx=x({},On,{key:function(e){if(e.key){var t=tx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Bl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?rx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Oo,charCode:function(e){return e.type==="keypress"?Bl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Bl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),lx=or(nx),ix=x({},Gl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Gd=or(ix),ox=x({},On,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Oo}),cx=or(ox),ux=x({},fs,{propertyName:0,elapsedTime:0,pseudoElement:0}),dx=or(ux),mx=x({},Gl,{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}),fx=or(mx),px=x({},fs,{newState:0,oldState:0}),hx=or(px),gx=[9,13,27,32],zo=ma&&"CompositionEvent"in window,Mn=null;ma&&"documentMode"in document&&(Mn=document.documentMode);var xx=ma&&"TextEvent"in window&&!Mn,Kd=ma&&(!zo||Mn&&8<Mn&&11>=Mn),qd=" ",Fd=!1;function Vd(e,t){switch(e){case"keyup":return gx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $d(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _s=!1;function yx(e,t){switch(e){case"compositionend":return $d(t);case"keypress":return t.which!==32?null:(Fd=!0,qd);case"textInput":return e=t.data,e===qd&&Fd?null:e;default:return null}}function bx(e,t){if(_s)return e==="compositionend"||!zo&&Vd(e,t)?(e=_d(),_l=Ao=Da=null,_s=!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 Kd&&t.locale!=="ko"?null:t.data;default:return null}}var vx={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 Yd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!vx[e.type]:t==="textarea"}function Jd(e,t,s,i){Ps?Us?Us.push(i):Us=[i]:Ps=i,t=Oi(t,"onChange"),0<t.length&&(s=new Hl("onChange","change",null,s,i),e.push({event:s,listeners:t}))}var Ln=null,Dn=null;function wx(e){zp(e,0)}function Kl(e){var t=Nt(e);if(Rd(t))return e}function Qd(e,t){if(e==="change")return t}var Xd=!1;if(ma){var Mo;if(ma){var Lo="oninput"in document;if(!Lo){var Zd=document.createElement("div");Zd.setAttribute("oninput","return;"),Lo=typeof Zd.oninput=="function"}Mo=Lo}else Mo=!1;Xd=Mo&&(!document.documentMode||9<document.documentMode)}function Wd(){Ln&&(Ln.detachEvent("onpropertychange",em),Dn=Ln=null)}function em(e){if(e.propertyName==="value"&&Kl(Dn)){var t=[];Jd(t,Dn,e,No(e)),Ud(wx,t)}}function Sx(e,t,s){e==="focusin"?(Wd(),Ln=t,Dn=s,Ln.attachEvent("onpropertychange",em)):e==="focusout"&&Wd()}function jx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Kl(Dn)}function Nx(e,t){if(e==="click")return Kl(t)}function Cx(e,t){if(e==="input"||e==="change")return Kl(t)}function kx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var br=typeof Object.is=="function"?Object.is:kx;function Pn(e,t){if(br(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(i=0;i<s.length;i++){var u=s[i];if(!$t.call(t,u)||!br(e[u],t[u]))return!1}return!0}function tm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function rm(e,t){var s=tm(e);e=0;for(var i;s;){if(s.nodeType===3){if(i=e+s.textContent.length,e<=t&&i>=t)return{node:s,offset:t-e};e=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=tm(s)}}function am(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?am(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function sm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Pl(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Pl(e.document)}return t}function Do(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 Ax=ma&&"documentMode"in document&&11>=document.documentMode,Bs=null,Po=null,Un=null,Uo=!1;function nm(e,t,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Uo||Bs==null||Bs!==Pl(i)||(i=Bs,"selectionStart"in i&&Do(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Un&&Pn(Un,i)||(Un=i,i=Oi(Po,"onSelect"),0<i.length&&(t=new Hl("onSelect","select",null,t,s),e.push({event:t,listeners:i}),t.target=Bs)))}function ps(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Is={animationend:ps("Animation","AnimationEnd"),animationiteration:ps("Animation","AnimationIteration"),animationstart:ps("Animation","AnimationStart"),transitionrun:ps("Transition","TransitionRun"),transitionstart:ps("Transition","TransitionStart"),transitioncancel:ps("Transition","TransitionCancel"),transitionend:ps("Transition","TransitionEnd")},_o={},lm={};ma&&(lm=document.createElement("div").style,"AnimationEvent"in window||(delete Is.animationend.animation,delete Is.animationiteration.animation,delete Is.animationstart.animation),"TransitionEvent"in window||delete Is.transitionend.transition);function hs(e){if(_o[e])return _o[e];if(!Is[e])return e;var t=Is[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in lm)return _o[e]=t[s];return e}var im=hs("animationend"),om=hs("animationiteration"),cm=hs("animationstart"),Ex=hs("transitionrun"),Tx=hs("transitionstart"),Rx=hs("transitioncancel"),um=hs("transitionend"),dm=new Map,Bo="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(" ");Bo.push("scrollEnd");function Hr(e,t){dm.set(e,t),ms(t,[e])}var ql=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)},Rr=[],Hs=0,Io=0;function Fl(){for(var e=Hs,t=Io=Hs=0;t<e;){var s=Rr[t];Rr[t++]=null;var i=Rr[t];Rr[t++]=null;var u=Rr[t];Rr[t++]=null;var f=Rr[t];if(Rr[t++]=null,i!==null&&u!==null){var v=i.pending;v===null?u.next=u:(u.next=v.next,v.next=u),i.pending=u}f!==0&&mm(s,u,f)}}function Vl(e,t,s,i){Rr[Hs++]=e,Rr[Hs++]=t,Rr[Hs++]=s,Rr[Hs++]=i,Io|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Ho(e,t,s,i){return Vl(e,t,s,i),$l(e)}function gs(e,t){return Vl(e,null,null,t),$l(e)}function mm(e,t,s){e.lanes|=s;var i=e.alternate;i!==null&&(i.lanes|=s);for(var u=!1,f=e.return;f!==null;)f.childLanes|=s,i=f.alternate,i!==null&&(i.childLanes|=s),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&t!==null&&(u=31-xt(s),e=f.hiddenUpdates,i=e[u],i===null?e[u]=[t]:i.push(t),t.lane=s|536870912),f):null}function $l(e){if(50<nl)throw nl=0,Qc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Gs={};function Ox(e,t,s,i){this.tag=e,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vr(e,t,s,i){return new Ox(e,t,s,i)}function Go(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fa(e,t){var s=e.alternate;return s===null?(s=vr(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function fm(e,t){e.flags&=65011714;var s=e.alternate;return s===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=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Yl(e,t,s,i,u,f){var v=0;if(i=e,typeof e=="function")Go(e)&&(v=1);else if(typeof e=="string")v=Py(e,s,q.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Y:return e=vr(31,s,t,u),e.elementType=Y,e.lanes=f,e;case O:return xs(s.children,u,f,t);case E:v=8,u|=24;break;case A:return e=vr(12,s,t,u|2),e.elementType=A,e.lanes=f,e;case P:return e=vr(13,s,t,u),e.elementType=P,e.lanes=f,e;case $:return e=vr(19,s,t,u),e.elementType=$,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case S:v=10;break e;case N:v=9;break e;case D:v=11;break e;case B:v=14;break e;case L:v=16,i=null;break e}v=29,s=Error(o(130,e===null?"null":typeof e,"")),i=null}return t=vr(v,s,t,u),t.elementType=e,t.type=i,t.lanes=f,t}function xs(e,t,s,i){return e=vr(7,e,i,t),e.lanes=s,e}function Ko(e,t,s){return e=vr(6,e,null,t),e.lanes=s,e}function pm(e){var t=vr(18,null,null,0);return t.stateNode=e,t}function qo(e,t,s){return t=vr(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var hm=new WeakMap;function Or(e,t){if(typeof e=="object"&&e!==null){var s=hm.get(e);return s!==void 0?s:(t={value:e,source:t,stack:gt(t)},hm.set(e,t),t)}return{value:e,source:t,stack:gt(t)}}var Ks=[],qs=0,Jl=null,_n=0,zr=[],Mr=0,Pa=null,Qr=1,Xr="";function pa(e,t){Ks[qs++]=_n,Ks[qs++]=Jl,Jl=e,_n=t}function gm(e,t,s){zr[Mr++]=Qr,zr[Mr++]=Xr,zr[Mr++]=Pa,Pa=e;var i=Qr;e=Xr;var u=32-xt(i)-1;i&=~(1<<u),s+=1;var f=32-xt(t)+u;if(30<f){var v=u-u%5;f=(i&(1<<v)-1).toString(32),i>>=v,u-=v,Qr=1<<32-xt(t)+u|s<<u|i,Xr=f+e}else Qr=1<<f|s<<u|i,Xr=e}function Fo(e){e.return!==null&&(pa(e,1),gm(e,1,0))}function Vo(e){for(;e===Jl;)Jl=Ks[--qs],Ks[qs]=null,_n=Ks[--qs],Ks[qs]=null;for(;e===Pa;)Pa=zr[--Mr],zr[Mr]=null,Xr=zr[--Mr],zr[Mr]=null,Qr=zr[--Mr],zr[Mr]=null}function xm(e,t){zr[Mr++]=Qr,zr[Mr++]=Xr,zr[Mr++]=Pa,Qr=t.id,Xr=t.overflow,Pa=e}var Ht=null,ut=null,Ge=!1,Ua=null,Lr=!1,$o=Error(o(519));function _a(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Bn(Or(t,e)),$o}function ym(e){var t=e.stateNode,s=e.type,i=e.memoizedProps;switch(t[$e]=e,t[Mt]=i,s){case"dialog":Be("cancel",t),Be("close",t);break;case"iframe":case"object":case"embed":Be("load",t);break;case"video":case"audio":for(s=0;s<il.length;s++)Be(il[s],t);break;case"source":Be("error",t);break;case"img":case"image":case"link":Be("error",t),Be("load",t);break;case"details":Be("toggle",t);break;case"input":Be("invalid",t),Od(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Be("invalid",t);break;case"textarea":Be("invalid",t),Md(t,i.value,i.defaultValue,i.children)}s=i.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||i.suppressHydrationWarning===!0||Pp(t.textContent,s)?(i.popover!=null&&(Be("beforetoggle",t),Be("toggle",t)),i.onScroll!=null&&Be("scroll",t),i.onScrollEnd!=null&&Be("scrollend",t),i.onClick!=null&&(t.onclick=da),t=!0):t=!1,t||_a(e,!0)}function bm(e){for(Ht=e.return;Ht;)switch(Ht.tag){case 5:case 31:case 13:Lr=!1;return;case 27:case 3:Lr=!0;return;default:Ht=Ht.return}}function Fs(e){if(e!==Ht)return!1;if(!Ge)return bm(e),Ge=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||du(e.type,e.memoizedProps)),s=!s),s&&ut&&_a(e),bm(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ut=Fp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ut=Fp(e)}else t===27?(t=ut,Za(e.type)?(e=gu,gu=null,ut=e):ut=t):ut=Ht?Pr(e.stateNode.nextSibling):null;return!0}function ys(){ut=Ht=null,Ge=!1}function Yo(){var e=Ua;return e!==null&&(mr===null?mr=e:mr.push.apply(mr,e),Ua=null),e}function Bn(e){Ua===null?Ua=[e]:Ua.push(e)}var Jo=j(null),bs=null,ha=null;function Ba(e,t,s){z(Jo,t._currentValue),t._currentValue=s}function ga(e){e._currentValue=Jo.current,M(Jo)}function Qo(e,t,s){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===s)break;e=e.return}}function Xo(e,t,s,i){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var v=u.child;f=f.firstContext;e:for(;f!==null;){var k=f;f=u;for(var _=0;_<t.length;_++)if(k.context===t[_]){f.lanes|=s,k=f.alternate,k!==null&&(k.lanes|=s),Qo(f.return,s,e),i||(v=null);break e}f=k.next}}else if(u.tag===18){if(v=u.return,v===null)throw Error(o(341));v.lanes|=s,f=v.alternate,f!==null&&(f.lanes|=s),Qo(v,s,e),v=null}else v=u.child;if(v!==null)v.return=u;else for(v=u;v!==null;){if(v===e){v=null;break}if(u=v.sibling,u!==null){u.return=v.return,v=u;break}v=v.return}u=v}}function Vs(e,t,s,i){e=null;for(var u=t,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var v=u.alternate;if(v===null)throw Error(o(387));if(v=v.memoizedProps,v!==null){var k=u.type;br(u.pendingProps.value,v.value)||(e!==null?e.push(k):e=[k])}}else if(u===Q.current){if(v=u.alternate,v===null)throw Error(o(387));v.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(ml):e=[ml])}u=u.return}e!==null&&Xo(t,e,s,i),t.flags|=262144}function Ql(e){for(e=e.firstContext;e!==null;){if(!br(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function vs(e){bs=e,ha=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Gt(e){return vm(bs,e)}function Xl(e,t){return bs===null&&vs(e),vm(e,t)}function vm(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},ha===null){if(e===null)throw Error(o(308));ha=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ha=ha.next=t;return s}var zx=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},Mx=a.unstable_scheduleCallback,Lx=a.unstable_NormalPriority,Et={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Zo(){return{controller:new zx,data:new Map,refCount:0}}function In(e){e.refCount--,e.refCount===0&&Mx(Lx,function(){e.controller.abort()})}var Hn=null,Wo=0,$s=0,Ys=null;function Dx(e,t){if(Hn===null){var s=Hn=[];Wo=0,$s=ru(),Ys={status:"pending",value:void 0,then:function(i){s.push(i)}}}return Wo++,t.then(wm,wm),t}function wm(){if(--Wo===0&&Hn!==null){Ys!==null&&(Ys.status="fulfilled");var e=Hn;Hn=null,$s=0,Ys=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Px(e,t){var s=[],i={status:"pending",value:null,reason:null,then:function(u){s.push(u)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var u=0;u<s.length;u++)(0,s[u])(t)},function(u){for(i.status="rejected",i.reason=u,u=0;u<s.length;u++)(0,s[u])(void 0)}),i}var Sm=C.S;C.S=function(e,t){lp=tt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Dx(e,t),Sm!==null&&Sm(e,t)};var ws=j(null);function ec(){var e=ws.current;return e!==null?e:ot.pooledCache}function Zl(e,t){t===null?z(ws,ws.current):z(ws,t.pool)}function jm(){var e=ec();return e===null?null:{parent:Et._currentValue,pool:e}}var Js=Error(o(460)),tc=Error(o(474)),Wl=Error(o(542)),ei={then:function(){}};function Nm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Cm(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(da,da),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Am(e),e;default:if(typeof t.status=="string")t.then(da,da);else{if(e=ot,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=i}},function(i){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Am(e),e}throw js=t,Js}}function Ss(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(js=s,Js):s}}var js=null;function km(){if(js===null)throw Error(o(459));var e=js;return js=null,e}function Am(e){if(e===Js||e===Wl)throw Error(o(483))}var Qs=null,Gn=0;function ti(e){var t=Gn;return Gn+=1,Qs===null&&(Qs=[]),Cm(Qs,e,t)}function Kn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ri(e,t){throw t.$$typeof===w?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Em(e){function t(J,F){if(e){var ee=J.deletions;ee===null?(J.deletions=[F],J.flags|=16):ee.push(F)}}function s(J,F){if(!e)return null;for(;F!==null;)t(J,F),F=F.sibling;return null}function i(J){for(var F=new Map;J!==null;)J.key!==null?F.set(J.key,J):F.set(J.index,J),J=J.sibling;return F}function u(J,F){return J=fa(J,F),J.index=0,J.sibling=null,J}function f(J,F,ee){return J.index=ee,e?(ee=J.alternate,ee!==null?(ee=ee.index,ee<F?(J.flags|=67108866,F):ee):(J.flags|=67108866,F)):(J.flags|=1048576,F)}function v(J){return e&&J.alternate===null&&(J.flags|=67108866),J}function k(J,F,ee,de){return F===null||F.tag!==6?(F=Ko(ee,J.mode,de),F.return=J,F):(F=u(F,ee),F.return=J,F)}function _(J,F,ee,de){var Ee=ee.type;return Ee===O?ce(J,F,ee.props.children,de,ee.key):F!==null&&(F.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===L&&Ss(Ee)===F.type)?(F=u(F,ee.props),Kn(F,ee),F.return=J,F):(F=Yl(ee.type,ee.key,ee.props,null,J.mode,de),Kn(F,ee),F.return=J,F)}function te(J,F,ee,de){return F===null||F.tag!==4||F.stateNode.containerInfo!==ee.containerInfo||F.stateNode.implementation!==ee.implementation?(F=qo(ee,J.mode,de),F.return=J,F):(F=u(F,ee.children||[]),F.return=J,F)}function ce(J,F,ee,de,Ee){return F===null||F.tag!==7?(F=xs(ee,J.mode,de,Ee),F.return=J,F):(F=u(F,ee),F.return=J,F)}function me(J,F,ee){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=Ko(""+F,J.mode,ee),F.return=J,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case T:return ee=Yl(F.type,F.key,F.props,null,J.mode,ee),Kn(ee,F),ee.return=J,ee;case R:return F=qo(F,J.mode,ee),F.return=J,F;case L:return F=Ss(F),me(J,F,ee)}if(Z(F)||K(F))return F=xs(F,J.mode,ee,null),F.return=J,F;if(typeof F.then=="function")return me(J,ti(F),ee);if(F.$$typeof===S)return me(J,Xl(J,F),ee);ri(J,F)}return null}function ae(J,F,ee,de){var Ee=F!==null?F.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Ee!==null?null:k(J,F,""+ee,de);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case T:return ee.key===Ee?_(J,F,ee,de):null;case R:return ee.key===Ee?te(J,F,ee,de):null;case L:return ee=Ss(ee),ae(J,F,ee,de)}if(Z(ee)||K(ee))return Ee!==null?null:ce(J,F,ee,de,null);if(typeof ee.then=="function")return ae(J,F,ti(ee),de);if(ee.$$typeof===S)return ae(J,F,Xl(J,ee),de);ri(J,ee)}return null}function ne(J,F,ee,de,Ee){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return J=J.get(ee)||null,k(F,J,""+de,Ee);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case T:return J=J.get(de.key===null?ee:de.key)||null,_(F,J,de,Ee);case R:return J=J.get(de.key===null?ee:de.key)||null,te(F,J,de,Ee);case L:return de=Ss(de),ne(J,F,ee,de,Ee)}if(Z(de)||K(de))return J=J.get(ee)||null,ce(F,J,de,Ee,null);if(typeof de.then=="function")return ne(J,F,ee,ti(de),Ee);if(de.$$typeof===S)return ne(J,F,ee,Xl(F,de),Ee);ri(F,de)}return null}function Se(J,F,ee,de){for(var Ee=null,Ye=null,Ae=F,De=F=0,He=null;Ae!==null&&De<ee.length;De++){Ae.index>De?(He=Ae,Ae=null):He=Ae.sibling;var Je=ae(J,Ae,ee[De],de);if(Je===null){Ae===null&&(Ae=He);break}e&&Ae&&Je.alternate===null&&t(J,Ae),F=f(Je,F,De),Ye===null?Ee=Je:Ye.sibling=Je,Ye=Je,Ae=He}if(De===ee.length)return s(J,Ae),Ge&&pa(J,De),Ee;if(Ae===null){for(;De<ee.length;De++)Ae=me(J,ee[De],de),Ae!==null&&(F=f(Ae,F,De),Ye===null?Ee=Ae:Ye.sibling=Ae,Ye=Ae);return Ge&&pa(J,De),Ee}for(Ae=i(Ae);De<ee.length;De++)He=ne(Ae,J,De,ee[De],de),He!==null&&(e&&He.alternate!==null&&Ae.delete(He.key===null?De:He.key),F=f(He,F,De),Ye===null?Ee=He:Ye.sibling=He,Ye=He);return e&&Ae.forEach(function(as){return t(J,as)}),Ge&&pa(J,De),Ee}function Te(J,F,ee,de){if(ee==null)throw Error(o(151));for(var Ee=null,Ye=null,Ae=F,De=F=0,He=null,Je=ee.next();Ae!==null&&!Je.done;De++,Je=ee.next()){Ae.index>De?(He=Ae,Ae=null):He=Ae.sibling;var as=ae(J,Ae,Je.value,de);if(as===null){Ae===null&&(Ae=He);break}e&&Ae&&as.alternate===null&&t(J,Ae),F=f(as,F,De),Ye===null?Ee=as:Ye.sibling=as,Ye=as,Ae=He}if(Je.done)return s(J,Ae),Ge&&pa(J,De),Ee;if(Ae===null){for(;!Je.done;De++,Je=ee.next())Je=me(J,Je.value,de),Je!==null&&(F=f(Je,F,De),Ye===null?Ee=Je:Ye.sibling=Je,Ye=Je);return Ge&&pa(J,De),Ee}for(Ae=i(Ae);!Je.done;De++,Je=ee.next())Je=ne(Ae,J,De,Je.value,de),Je!==null&&(e&&Je.alternate!==null&&Ae.delete(Je.key===null?De:Je.key),F=f(Je,F,De),Ye===null?Ee=Je:Ye.sibling=Je,Ye=Je);return e&&Ae.forEach(function($y){return t(J,$y)}),Ge&&pa(J,De),Ee}function st(J,F,ee,de){if(typeof ee=="object"&&ee!==null&&ee.type===O&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case T:e:{for(var Ee=ee.key;F!==null;){if(F.key===Ee){if(Ee=ee.type,Ee===O){if(F.tag===7){s(J,F.sibling),de=u(F,ee.props.children),de.return=J,J=de;break e}}else if(F.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===L&&Ss(Ee)===F.type){s(J,F.sibling),de=u(F,ee.props),Kn(de,ee),de.return=J,J=de;break e}s(J,F);break}else t(J,F);F=F.sibling}ee.type===O?(de=xs(ee.props.children,J.mode,de,ee.key),de.return=J,J=de):(de=Yl(ee.type,ee.key,ee.props,null,J.mode,de),Kn(de,ee),de.return=J,J=de)}return v(J);case R:e:{for(Ee=ee.key;F!==null;){if(F.key===Ee)if(F.tag===4&&F.stateNode.containerInfo===ee.containerInfo&&F.stateNode.implementation===ee.implementation){s(J,F.sibling),de=u(F,ee.children||[]),de.return=J,J=de;break e}else{s(J,F);break}else t(J,F);F=F.sibling}de=qo(ee,J.mode,de),de.return=J,J=de}return v(J);case L:return ee=Ss(ee),st(J,F,ee,de)}if(Z(ee))return Se(J,F,ee,de);if(K(ee)){if(Ee=K(ee),typeof Ee!="function")throw Error(o(150));return ee=Ee.call(ee),Te(J,F,ee,de)}if(typeof ee.then=="function")return st(J,F,ti(ee),de);if(ee.$$typeof===S)return st(J,F,Xl(J,ee),de);ri(J,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,F!==null&&F.tag===6?(s(J,F.sibling),de=u(F,ee),de.return=J,J=de):(s(J,F),de=Ko(ee,J.mode,de),de.return=J,J=de),v(J)):s(J,F)}return function(J,F,ee,de){try{Gn=0;var Ee=st(J,F,ee,de);return Qs=null,Ee}catch(Ae){if(Ae===Js||Ae===Wl)throw Ae;var Ye=vr(29,Ae,null,J.mode);return Ye.lanes=de,Ye.return=J,Ye}finally{}}}var Ns=Em(!0),Tm=Em(!1),Ia=!1;function rc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ac(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 Ha(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ga(e,t,s){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Qe&2)!==0){var u=i.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),i.pending=t,t=$l(e),mm(e,null,s),t}return Vl(e,i,t,s),$l(e)}function qn(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,le(e,s)}}function sc(e,t){var s=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,s===i)){var u=null,f=null;if(s=s.firstBaseUpdate,s!==null){do{var v={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};f===null?u=f=v:f=f.next=v,s=s.next}while(s!==null);f===null?u=f=t:f=f.next=t}else u=f=t;s={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:f,shared:i.shared,callbacks:i.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var nc=!1;function Fn(){if(nc){var e=Ys;if(e!==null)throw e}}function Vn(e,t,s,i){nc=!1;var u=e.updateQueue;Ia=!1;var f=u.firstBaseUpdate,v=u.lastBaseUpdate,k=u.shared.pending;if(k!==null){u.shared.pending=null;var _=k,te=_.next;_.next=null,v===null?f=te:v.next=te,v=_;var ce=e.alternate;ce!==null&&(ce=ce.updateQueue,k=ce.lastBaseUpdate,k!==v&&(k===null?ce.firstBaseUpdate=te:k.next=te,ce.lastBaseUpdate=_))}if(f!==null){var me=u.baseState;v=0,ce=te=_=null,k=f;do{var ae=k.lane&-536870913,ne=ae!==k.lane;if(ne?(Ie&ae)===ae:(i&ae)===ae){ae!==0&&ae===$s&&(nc=!0),ce!==null&&(ce=ce.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var Se=e,Te=k;ae=t;var st=s;switch(Te.tag){case 1:if(Se=Te.payload,typeof Se=="function"){me=Se.call(st,me,ae);break e}me=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Te.payload,ae=typeof Se=="function"?Se.call(st,me,ae):Se,ae==null)break e;me=x({},me,ae);break e;case 2:Ia=!0}}ae=k.callback,ae!==null&&(e.flags|=64,ne&&(e.flags|=8192),ne=u.callbacks,ne===null?u.callbacks=[ae]:ne.push(ae))}else ne={lane:ae,tag:k.tag,payload:k.payload,callback:k.callback,next:null},ce===null?(te=ce=ne,_=me):ce=ce.next=ne,v|=ae;if(k=k.next,k===null){if(k=u.shared.pending,k===null)break;ne=k,k=ne.next,ne.next=null,u.lastBaseUpdate=ne,u.shared.pending=null}}while(!0);ce===null&&(_=me),u.baseState=_,u.firstBaseUpdate=te,u.lastBaseUpdate=ce,f===null&&(u.shared.lanes=0),$a|=v,e.lanes=v,e.memoizedState=me}}function Rm(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Om(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)Rm(s[e],t)}var Xs=j(null),ai=j(0);function zm(e,t){e=Ca,z(ai,e),z(Xs,t),Ca=e|t.baseLanes}function lc(){z(ai,Ca),z(Xs,Xs.current)}function ic(){Ca=ai.current,M(Xs),M(ai)}var wr=j(null),Dr=null;function Ka(e){var t=e.alternate;z(Ct,Ct.current&1),z(wr,e),Dr===null&&(t===null||Xs.current!==null||t.memoizedState!==null)&&(Dr=e)}function oc(e){z(Ct,Ct.current),z(wr,e),Dr===null&&(Dr=e)}function Mm(e){e.tag===22?(z(Ct,Ct.current),z(wr,e),Dr===null&&(Dr=e)):qa()}function qa(){z(Ct,Ct.current),z(wr,wr.current)}function Sr(e){M(wr),Dr===e&&(Dr=null),M(Ct)}var Ct=j(0);function si(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||pu(s)||hu(s)))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 xa=0,Le=null,rt=null,Tt=null,ni=!1,Zs=!1,Cs=!1,li=0,$n=0,Ws=null,Ux=0;function bt(){throw Error(o(321))}function cc(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!br(e[s],t[s]))return!1;return!0}function uc(e,t,s,i,u,f){return xa=f,Le=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,C.H=e===null||e.memoizedState===null?xf:Cc,Cs=!1,f=s(i,u),Cs=!1,Zs&&(f=Dm(t,s,i,u)),Lm(e),f}function Lm(e){C.H=Qn;var t=rt!==null&&rt.next!==null;if(xa=0,Tt=rt=Le=null,ni=!1,$n=0,Ws=null,t)throw Error(o(300));e===null||Rt||(e=e.dependencies,e!==null&&Ql(e)&&(Rt=!0))}function Dm(e,t,s,i){Le=e;var u=0;do{if(Zs&&(Ws=null),$n=0,Zs=!1,25<=u)throw Error(o(301));if(u+=1,Tt=rt=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}C.H=yf,f=t(s,i)}while(Zs);return f}function _x(){var e=C.H,t=e.useState()[0];return t=typeof t.then=="function"?Yn(t):t,e=e.useState()[0],(rt!==null?rt.memoizedState:null)!==e&&(Le.flags|=1024),t}function dc(){var e=li!==0;return li=0,e}function mc(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function fc(e){if(ni){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ni=!1}xa=0,Tt=rt=Le=null,Zs=!1,$n=li=0,Ws=null}function lr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tt===null?Le.memoizedState=Tt=e:Tt=Tt.next=e,Tt}function kt(){if(rt===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=rt.next;var t=Tt===null?Le.memoizedState:Tt.next;if(t!==null)Tt=t,rt=e;else{if(e===null)throw Le.alternate===null?Error(o(467)):Error(o(310));rt=e,e={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},Tt===null?Le.memoizedState=Tt=e:Tt=Tt.next=e}return Tt}function ii(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Yn(e){var t=$n;return $n+=1,Ws===null&&(Ws=[]),e=Cm(Ws,e,t),t=Le,(Tt===null?t.memoizedState:Tt.next)===null&&(t=t.alternate,C.H=t===null||t.memoizedState===null?xf:Cc),e}function oi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Yn(e);if(e.$$typeof===S)return Gt(e)}throw Error(o(438,String(e)))}function pc(e){var t=null,s=Le.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var i=Le.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=ii(),Le.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),i=0;i<e;i++)s[i]=fe;return t.index++,s}function ya(e,t){return typeof t=="function"?t(e):t}function ci(e){var t=kt();return hc(t,rt,e)}function hc(e,t,s){var i=e.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=s;var u=e.baseQueue,f=i.pending;if(f!==null){if(u!==null){var v=u.next;u.next=f.next,f.next=v}t.baseQueue=u=f,i.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var k=v=null,_=null,te=t,ce=!1;do{var me=te.lane&-536870913;if(me!==te.lane?(Ie&me)===me:(xa&me)===me){var ae=te.revertLane;if(ae===0)_!==null&&(_=_.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),me===$s&&(ce=!0);else if((xa&ae)===ae){te=te.next,ae===$s&&(ce=!0);continue}else me={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},_===null?(k=_=me,v=f):_=_.next=me,Le.lanes|=ae,$a|=ae;me=te.action,Cs&&s(f,me),f=te.hasEagerState?te.eagerState:s(f,me)}else ae={lane:me,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},_===null?(k=_=ae,v=f):_=_.next=ae,Le.lanes|=me,$a|=me;te=te.next}while(te!==null&&te!==t);if(_===null?v=f:_.next=k,!br(f,e.memoizedState)&&(Rt=!0,ce&&(s=Ys,s!==null)))throw s;e.memoizedState=f,e.baseState=v,e.baseQueue=_,i.lastRenderedState=f}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function gc(e){var t=kt(),s=t.queue;if(s===null)throw Error(o(311));s.lastRenderedReducer=e;var i=s.dispatch,u=s.pending,f=t.memoizedState;if(u!==null){s.pending=null;var v=u=u.next;do f=e(f,v.action),v=v.next;while(v!==u);br(f,t.memoizedState)||(Rt=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),s.lastRenderedState=f}return[f,i]}function Pm(e,t,s){var i=Le,u=kt(),f=Ge;if(f){if(s===void 0)throw Error(o(407));s=s()}else s=t();var v=!br((rt||u).memoizedState,s);if(v&&(u.memoizedState=s,Rt=!0),u=u.queue,bc(Bm.bind(null,i,u,e),[e]),u.getSnapshot!==t||v||Tt!==null&&Tt.memoizedState.tag&1){if(i.flags|=2048,en(9,{destroy:void 0},_m.bind(null,i,u,s,t),null),ot===null)throw Error(o(349));f||(xa&127)!==0||Um(i,t,s)}return s}function Um(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Le.updateQueue,t===null?(t=ii(),Le.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function _m(e,t,s,i){t.value=s,t.getSnapshot=i,Im(t)&&Hm(e)}function Bm(e,t,s){return s(function(){Im(t)&&Hm(e)})}function Im(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!br(e,s)}catch{return!0}}function Hm(e){var t=gs(e,2);t!==null&&fr(t,e,2)}function xc(e){var t=lr();if(typeof e=="function"){var s=e;if(e=s(),Cs){sr(!0);try{s()}finally{sr(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:e},t}function Gm(e,t,s,i){return e.baseState=s,hc(e,rt,typeof i=="function"?i:ya)}function Bx(e,t,s,i,u){if(mi(e))throw Error(o(485));if(e=t.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){f.listeners.push(v)}};C.T!==null?s(!0):f.isTransition=!1,i(f),s=t.pending,s===null?(f.next=t.pending=f,Km(t,f)):(f.next=s.next,t.pending=s.next=f)}}function Km(e,t){var s=t.action,i=t.payload,u=e.state;if(t.isTransition){var f=C.T,v={};C.T=v;try{var k=s(u,i),_=C.S;_!==null&&_(v,k),qm(e,t,k)}catch(te){yc(e,t,te)}finally{f!==null&&v.types!==null&&(f.types=v.types),C.T=f}}else try{f=s(u,i),qm(e,t,f)}catch(te){yc(e,t,te)}}function qm(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(i){Fm(e,t,i)},function(i){return yc(e,t,i)}):Fm(e,t,s)}function Fm(e,t,s){t.status="fulfilled",t.value=s,Vm(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,Km(e,s)))}function yc(e,t,s){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=s,Vm(t),t=t.next;while(t!==i)}e.action=null}function Vm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function $m(e,t){return t}function Ym(e,t){if(Ge){var s=ot.formState;if(s!==null){e:{var i=Le;if(Ge){if(ut){t:{for(var u=ut,f=Lr;u.nodeType!==8;){if(!f){u=null;break t}if(u=Pr(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){ut=Pr(u.nextSibling),i=u.data==="F!";break e}}_a(i)}i=!1}i&&(t=s[0])}}return s=lr(),s.memoizedState=s.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$m,lastRenderedState:t},s.queue=i,s=pf.bind(null,Le,i),i.dispatch=s,i=xc(!1),f=Nc.bind(null,Le,!1,i.queue),i=lr(),u={state:t,dispatch:null,action:e,pending:null},i.queue=u,s=Bx.bind(null,Le,u,f,s),u.dispatch=s,i.memoizedState=e,[t,s,!1]}function Jm(e){var t=kt();return Qm(t,rt,e)}function Qm(e,t,s){if(t=hc(e,t,$m)[0],e=ci(ya)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=Yn(t)}catch(v){throw v===Js?Wl:v}else i=t;t=kt();var u=t.queue,f=u.dispatch;return s!==t.memoizedState&&(Le.flags|=2048,en(9,{destroy:void 0},Ix.bind(null,u,s),null)),[i,f,e]}function Ix(e,t){e.action=t}function Xm(e){var t=kt(),s=rt;if(s!==null)return Qm(t,s,e);kt(),t=t.memoizedState,s=kt();var i=s.queue.dispatch;return s.memoizedState=e,[t,i,!1]}function en(e,t,s,i){return e={tag:e,create:s,deps:i,inst:t,next:null},t=Le.updateQueue,t===null&&(t=ii(),Le.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(i=s.next,s.next=e,e.next=i,t.lastEffect=e),e}function Zm(){return kt().memoizedState}function ui(e,t,s,i){var u=lr();Le.flags|=e,u.memoizedState=en(1|t,{destroy:void 0},s,i===void 0?null:i)}function di(e,t,s,i){var u=kt();i=i===void 0?null:i;var f=u.memoizedState.inst;rt!==null&&i!==null&&cc(i,rt.memoizedState.deps)?u.memoizedState=en(t,f,s,i):(Le.flags|=e,u.memoizedState=en(1|t,f,s,i))}function Wm(e,t){ui(8390656,8,e,t)}function bc(e,t){di(2048,8,e,t)}function Hx(e){Le.flags|=4;var t=Le.updateQueue;if(t===null)t=ii(),Le.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function ef(e){var t=kt().memoizedState;return Hx({ref:t,nextImpl:e}),function(){if((Qe&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function tf(e,t){return di(4,2,e,t)}function rf(e,t){return di(4,4,e,t)}function af(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function sf(e,t,s){s=s!=null?s.concat([e]):null,di(4,4,af.bind(null,t,e),s)}function vc(){}function nf(e,t){var s=kt();t=t===void 0?null:t;var i=s.memoizedState;return t!==null&&cc(t,i[1])?i[0]:(s.memoizedState=[e,t],e)}function lf(e,t){var s=kt();t=t===void 0?null:t;var i=s.memoizedState;if(t!==null&&cc(t,i[1]))return i[0];if(i=e(),Cs){sr(!0);try{e()}finally{sr(!1)}}return s.memoizedState=[i,t],i}function wc(e,t,s){return s===void 0||(xa&1073741824)!==0&&(Ie&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=op(),Le.lanes|=e,$a|=e,s)}function of(e,t,s,i){return br(s,t)?s:Xs.current!==null?(e=wc(e,s,i),br(e,t)||(Rt=!0),e):(xa&42)===0||(xa&1073741824)!==0&&(Ie&261930)===0?(Rt=!0,e.memoizedState=s):(e=op(),Le.lanes|=e,$a|=e,t)}function cf(e,t,s,i,u){var f=I.p;I.p=f!==0&&8>f?f:8;var v=C.T,k={};C.T=k,Nc(e,!1,t,s);try{var _=u(),te=C.S;if(te!==null&&te(k,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var ce=Px(_,i);Jn(e,t,ce,Cr(e))}else Jn(e,t,i,Cr(e))}catch(me){Jn(e,t,{then:function(){},status:"rejected",reason:me},Cr())}finally{I.p=f,v!==null&&k.types!==null&&(v.types=k.types),C.T=v}}function Gx(){}function Sc(e,t,s,i){if(e.tag!==5)throw Error(o(476));var u=uf(e).queue;cf(e,u,t,U,s===null?Gx:function(){return df(e),s(i)})}function uf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:U},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function df(e){var t=uf(e);t.next===null&&(t=e.alternate.memoizedState),Jn(e,t.next.queue,{},Cr())}function jc(){return Gt(ml)}function mf(){return kt().memoizedState}function ff(){return kt().memoizedState}function Kx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=Cr();e=Ha(s);var i=Ga(t,e,s);i!==null&&(fr(i,t,s),qn(i,t,s)),t={cache:Zo()},e.payload=t;return}t=t.return}}function qx(e,t,s){var i=Cr();s={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},mi(e)?hf(t,s):(s=Ho(e,t,s,i),s!==null&&(fr(s,e,i),gf(s,t,i)))}function pf(e,t,s){var i=Cr();Jn(e,t,s,i)}function Jn(e,t,s,i){var u={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(mi(e))hf(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var v=t.lastRenderedState,k=f(v,s);if(u.hasEagerState=!0,u.eagerState=k,br(k,v))return Vl(e,t,u,0),ot===null&&Fl(),!1}catch{}finally{}if(s=Ho(e,t,u,i),s!==null)return fr(s,e,i),gf(s,t,i),!0}return!1}function Nc(e,t,s,i){if(i={lane:2,revertLane:ru(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},mi(e)){if(t)throw Error(o(479))}else t=Ho(e,s,i,2),t!==null&&fr(t,e,2)}function mi(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function hf(e,t){Zs=ni=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function gf(e,t,s){if((s&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,le(e,s)}}var Qn={readContext:Gt,use:oi,useCallback:bt,useContext:bt,useEffect:bt,useImperativeHandle:bt,useLayoutEffect:bt,useInsertionEffect:bt,useMemo:bt,useReducer:bt,useRef:bt,useState:bt,useDebugValue:bt,useDeferredValue:bt,useTransition:bt,useSyncExternalStore:bt,useId:bt,useHostTransitionStatus:bt,useFormState:bt,useActionState:bt,useOptimistic:bt,useMemoCache:bt,useCacheRefresh:bt};Qn.useEffectEvent=bt;var xf={readContext:Gt,use:oi,useCallback:function(e,t){return lr().memoizedState=[e,t===void 0?null:t],e},useContext:Gt,useEffect:Wm,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,ui(4194308,4,af.bind(null,t,e),s)},useLayoutEffect:function(e,t){return ui(4194308,4,e,t)},useInsertionEffect:function(e,t){ui(4,2,e,t)},useMemo:function(e,t){var s=lr();t=t===void 0?null:t;var i=e();if(Cs){sr(!0);try{e()}finally{sr(!1)}}return s.memoizedState=[i,t],i},useReducer:function(e,t,s){var i=lr();if(s!==void 0){var u=s(t);if(Cs){sr(!0);try{s(t)}finally{sr(!1)}}}else u=t;return i.memoizedState=i.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},i.queue=e,e=e.dispatch=qx.bind(null,Le,e),[i.memoizedState,e]},useRef:function(e){var t=lr();return e={current:e},t.memoizedState=e},useState:function(e){e=xc(e);var t=e.queue,s=pf.bind(null,Le,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:vc,useDeferredValue:function(e,t){var s=lr();return wc(s,e,t)},useTransition:function(){var e=xc(!1);return e=cf.bind(null,Le,e.queue,!0,!1),lr().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var i=Le,u=lr();if(Ge){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),ot===null)throw Error(o(349));(Ie&127)!==0||Um(i,t,s)}u.memoizedState=s;var f={value:s,getSnapshot:t};return u.queue=f,Wm(Bm.bind(null,i,f,e),[e]),i.flags|=2048,en(9,{destroy:void 0},_m.bind(null,i,f,s,t),null),s},useId:function(){var e=lr(),t=ot.identifierPrefix;if(Ge){var s=Xr,i=Qr;s=(i&~(1<<32-xt(i)-1)).toString(32)+s,t="_"+t+"R_"+s,s=li++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=Ux++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:jc,useFormState:Ym,useActionState:Ym,useOptimistic:function(e){var t=lr();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Nc.bind(null,Le,!0,s),s.dispatch=t,[e,t]},useMemoCache:pc,useCacheRefresh:function(){return lr().memoizedState=Kx.bind(null,Le)},useEffectEvent:function(e){var t=lr(),s={impl:e};return t.memoizedState=s,function(){if((Qe&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},Cc={readContext:Gt,use:oi,useCallback:nf,useContext:Gt,useEffect:bc,useImperativeHandle:sf,useInsertionEffect:tf,useLayoutEffect:rf,useMemo:lf,useReducer:ci,useRef:Zm,useState:function(){return ci(ya)},useDebugValue:vc,useDeferredValue:function(e,t){var s=kt();return of(s,rt.memoizedState,e,t)},useTransition:function(){var e=ci(ya)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:Yn(e),t]},useSyncExternalStore:Pm,useId:mf,useHostTransitionStatus:jc,useFormState:Jm,useActionState:Jm,useOptimistic:function(e,t){var s=kt();return Gm(s,rt,e,t)},useMemoCache:pc,useCacheRefresh:ff};Cc.useEffectEvent=ef;var yf={readContext:Gt,use:oi,useCallback:nf,useContext:Gt,useEffect:bc,useImperativeHandle:sf,useInsertionEffect:tf,useLayoutEffect:rf,useMemo:lf,useReducer:gc,useRef:Zm,useState:function(){return gc(ya)},useDebugValue:vc,useDeferredValue:function(e,t){var s=kt();return rt===null?wc(s,e,t):of(s,rt.memoizedState,e,t)},useTransition:function(){var e=gc(ya)[0],t=kt().memoizedState;return[typeof e=="boolean"?e:Yn(e),t]},useSyncExternalStore:Pm,useId:mf,useHostTransitionStatus:jc,useFormState:Xm,useActionState:Xm,useOptimistic:function(e,t){var s=kt();return rt!==null?Gm(s,rt,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:pc,useCacheRefresh:ff};yf.useEffectEvent=ef;function kc(e,t,s,i){t=e.memoizedState,s=s(i,t),s=s==null?t:x({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Ac={enqueueSetState:function(e,t,s){e=e._reactInternals;var i=Cr(),u=Ha(i);u.payload=t,s!=null&&(u.callback=s),t=Ga(e,u,i),t!==null&&(fr(t,e,i),qn(t,e,i))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var i=Cr(),u=Ha(i);u.tag=1,u.payload=t,s!=null&&(u.callback=s),t=Ga(e,u,i),t!==null&&(fr(t,e,i),qn(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=Cr(),i=Ha(s);i.tag=2,t!=null&&(i.callback=t),t=Ga(e,i,s),t!==null&&(fr(t,e,s),qn(t,e,s))}};function bf(e,t,s,i,u,f,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,v):t.prototype&&t.prototype.isPureReactComponent?!Pn(s,i)||!Pn(u,f):!0}function vf(e,t,s,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,i),t.state!==e&&Ac.enqueueReplaceState(t,t.state,null)}function ks(e,t){var s=t;if("ref"in t){s={};for(var i in t)i!=="ref"&&(s[i]=t[i])}if(e=e.defaultProps){s===t&&(s=x({},s));for(var u in e)s[u]===void 0&&(s[u]=e[u])}return s}function wf(e){ql(e)}function Sf(e){console.error(e)}function jf(e){ql(e)}function fi(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Nf(e,t,s){try{var i=e.onCaughtError;i(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Ec(e,t,s){return s=Ha(s),s.tag=3,s.payload={element:null},s.callback=function(){fi(e,t)},s}function Cf(e){return e=Ha(e),e.tag=3,e}function kf(e,t,s,i){var u=s.type.getDerivedStateFromError;if(typeof u=="function"){var f=i.value;e.payload=function(){return u(f)},e.callback=function(){Nf(t,s,i)}}var v=s.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(e.callback=function(){Nf(t,s,i),typeof u!="function"&&(Ya===null?Ya=new Set([this]):Ya.add(this));var k=i.stack;this.componentDidCatch(i.value,{componentStack:k!==null?k:""})})}function Fx(e,t,s,i,u){if(s.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=s.alternate,t!==null&&Vs(t,s,u,!0),s=wr.current,s!==null){switch(s.tag){case 31:case 13:return Dr===null?Ci():s.alternate===null&&vt===0&&(vt=3),s.flags&=-257,s.flags|=65536,s.lanes=u,i===ei?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([i]):t.add(i),Wc(e,i,u)),!1;case 22:return s.flags|=65536,i===ei?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([i]):s.add(i)),Wc(e,i,u)),!1}throw Error(o(435,s.tag))}return Wc(e,i,u),Ci(),!1}if(Ge)return t=wr.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,i!==$o&&(e=Error(o(422),{cause:i}),Bn(Or(e,s)))):(i!==$o&&(t=Error(o(423),{cause:i}),Bn(Or(t,s))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=Or(i,s),u=Ec(e.stateNode,i,u),sc(e,u),vt!==4&&(vt=2)),!1;var f=Error(o(520),{cause:i});if(f=Or(f,s),sl===null?sl=[f]:sl.push(f),vt!==4&&(vt=2),t===null)return!0;i=Or(i,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=u&-u,s.lanes|=e,e=Ec(s.stateNode,i,e),sc(s,e),!1;case 1:if(t=s.type,f=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Ya===null||!Ya.has(f))))return s.flags|=65536,u&=-u,s.lanes|=u,u=Cf(u),kf(u,e,s,i),sc(s,u),!1}s=s.return}while(s!==null);return!1}var Tc=Error(o(461)),Rt=!1;function Kt(e,t,s,i){t.child=e===null?Tm(t,null,s,i):Ns(t,e.child,s,i)}function Af(e,t,s,i,u){s=s.render;var f=t.ref;if("ref"in i){var v={};for(var k in i)k!=="ref"&&(v[k]=i[k])}else v=i;return vs(t),i=uc(e,t,s,v,f,u),k=dc(),e!==null&&!Rt?(mc(e,t,u),ba(e,t,u)):(Ge&&k&&Fo(t),t.flags|=1,Kt(e,t,i,u),t.child)}function Ef(e,t,s,i,u){if(e===null){var f=s.type;return typeof f=="function"&&!Go(f)&&f.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=f,Tf(e,t,f,i,u)):(e=Yl(s.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Uc(e,u)){var v=f.memoizedProps;if(s=s.compare,s=s!==null?s:Pn,s(v,i)&&e.ref===t.ref)return ba(e,t,u)}return t.flags|=1,e=fa(f,i),e.ref=t.ref,e.return=t,t.child=e}function Tf(e,t,s,i,u){if(e!==null){var f=e.memoizedProps;if(Pn(f,i)&&e.ref===t.ref)if(Rt=!1,t.pendingProps=i=f,Uc(e,u))(e.flags&131072)!==0&&(Rt=!0);else return t.lanes=e.lanes,ba(e,t,u)}return Rc(e,t,s,i,u)}function Rf(e,t,s,i){var u=i.children,f=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(f=f!==null?f.baseLanes|s:s,e!==null){for(i=t.child=e.child,u=0;i!==null;)u=u|i.lanes|i.childLanes,i=i.sibling;i=u&~f}else i=0,t.child=null;return Of(e,t,f,s,i)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Zl(t,f!==null?f.cachePool:null),f!==null?zm(t,f):lc(),Mm(t);else return i=t.lanes=536870912,Of(e,t,f!==null?f.baseLanes|s:s,s,i)}else f!==null?(Zl(t,f.cachePool),zm(t,f),qa(),t.memoizedState=null):(e!==null&&Zl(t,null),lc(),qa());return Kt(e,t,u,s),t.child}function Xn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Of(e,t,s,i,u){var f=ec();return f=f===null?null:{parent:Et._currentValue,pool:f},t.memoizedState={baseLanes:s,cachePool:f},e!==null&&Zl(t,null),lc(),Mm(t),e!==null&&Vs(e,t,i,!0),t.childLanes=u,null}function pi(e,t){return t=gi({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function zf(e,t,s){return Ns(t,e.child,null,s),e=pi(t,t.pendingProps),e.flags|=2,Sr(t),t.memoizedState=null,e}function Vx(e,t,s){var i=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ge){if(i.mode==="hidden")return e=pi(t,i),t.lanes=536870912,Xn(null,e);if(oc(t),(e=ut)?(e=qp(e,Lr),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Pa!==null?{id:Qr,overflow:Xr}:null,retryLane:536870912,hydrationErrors:null},s=pm(e),s.return=t,t.child=s,Ht=t,ut=null)):e=null,e===null)throw _a(t);return t.lanes=536870912,null}return pi(t,i)}var f=e.memoizedState;if(f!==null){var v=f.dehydrated;if(oc(t),u)if(t.flags&256)t.flags&=-257,t=zf(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(Rt||Vs(e,t,s,!1),u=(s&e.childLanes)!==0,Rt||u){if(i=ot,i!==null&&(v=be(i,s),v!==0&&v!==f.retryLane))throw f.retryLane=v,gs(e,v),fr(i,e,v),Tc;Ci(),t=zf(e,t,s)}else e=f.treeContext,ut=Pr(v.nextSibling),Ht=t,Ge=!0,Ua=null,Lr=!1,e!==null&&xm(t,e),t=pi(t,i),t.flags|=4096;return t}return e=fa(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function hi(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(o(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Rc(e,t,s,i,u){return vs(t),s=uc(e,t,s,i,void 0,u),i=dc(),e!==null&&!Rt?(mc(e,t,u),ba(e,t,u)):(Ge&&i&&Fo(t),t.flags|=1,Kt(e,t,s,u),t.child)}function Mf(e,t,s,i,u,f){return vs(t),t.updateQueue=null,s=Dm(t,i,s,u),Lm(e),i=dc(),e!==null&&!Rt?(mc(e,t,f),ba(e,t,f)):(Ge&&i&&Fo(t),t.flags|=1,Kt(e,t,s,f),t.child)}function Lf(e,t,s,i,u){if(vs(t),t.stateNode===null){var f=Gs,v=s.contextType;typeof v=="object"&&v!==null&&(f=Gt(v)),f=new s(i,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Ac,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=i,f.state=t.memoizedState,f.refs={},rc(t),v=s.contextType,f.context=typeof v=="object"&&v!==null?Gt(v):Gs,f.state=t.memoizedState,v=s.getDerivedStateFromProps,typeof v=="function"&&(kc(t,s,v,i),f.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(v=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),v!==f.state&&Ac.enqueueReplaceState(f,f.state,null),Vn(t,i,f,u),Fn(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){f=t.stateNode;var k=t.memoizedProps,_=ks(s,k);f.props=_;var te=f.context,ce=s.contextType;v=Gs,typeof ce=="object"&&ce!==null&&(v=Gt(ce));var me=s.getDerivedStateFromProps;ce=typeof me=="function"||typeof f.getSnapshotBeforeUpdate=="function",k=t.pendingProps!==k,ce||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(k||te!==v)&&vf(t,f,i,v),Ia=!1;var ae=t.memoizedState;f.state=ae,Vn(t,i,f,u),Fn(),te=t.memoizedState,k||ae!==te||Ia?(typeof me=="function"&&(kc(t,s,me,i),te=t.memoizedState),(_=Ia||bf(t,s,_,i,ae,te,v))?(ce||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=i,t.memoizedState=te),f.props=i,f.state=te,f.context=v,i=_):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,ac(e,t),v=t.memoizedProps,ce=ks(s,v),f.props=ce,me=t.pendingProps,ae=f.context,te=s.contextType,_=Gs,typeof te=="object"&&te!==null&&(_=Gt(te)),k=s.getDerivedStateFromProps,(te=typeof k=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(v!==me||ae!==_)&&vf(t,f,i,_),Ia=!1,ae=t.memoizedState,f.state=ae,Vn(t,i,f,u),Fn();var ne=t.memoizedState;v!==me||ae!==ne||Ia||e!==null&&e.dependencies!==null&&Ql(e.dependencies)?(typeof k=="function"&&(kc(t,s,k,i),ne=t.memoizedState),(ce=Ia||bf(t,s,ce,i,ae,ne,_)||e!==null&&e.dependencies!==null&&Ql(e.dependencies))?(te||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,ne,_),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,ne,_)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||v===e.memoizedProps&&ae===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&ae===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=ne),f.props=i,f.state=ne,f.context=_,i=ce):(typeof f.componentDidUpdate!="function"||v===e.memoizedProps&&ae===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&ae===e.memoizedState||(t.flags|=1024),i=!1)}return f=i,hi(e,t),i=(t.flags&128)!==0,f||i?(f=t.stateNode,s=i&&typeof s.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&i?(t.child=Ns(t,e.child,null,u),t.child=Ns(t,null,s,u)):Kt(e,t,s,u),t.memoizedState=f.state,e=t.child):e=ba(e,t,u),e}function Df(e,t,s,i){return ys(),t.flags|=256,Kt(e,t,s,i),t.child}var Oc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function zc(e){return{baseLanes:e,cachePool:jm()}}function Mc(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=Nr),e}function Pf(e,t,s){var i=t.pendingProps,u=!1,f=(t.flags&128)!==0,v;if((v=f)||(v=e!==null&&e.memoizedState===null?!1:(Ct.current&2)!==0),v&&(u=!0,t.flags&=-129),v=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ge){if(u?Ka(t):qa(),(e=ut)?(e=qp(e,Lr),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Pa!==null?{id:Qr,overflow:Xr}:null,retryLane:536870912,hydrationErrors:null},s=pm(e),s.return=t,t.child=s,Ht=t,ut=null)):e=null,e===null)throw _a(t);return hu(e)?t.lanes=32:t.lanes=536870912,null}var k=i.children;return i=i.fallback,u?(qa(),u=t.mode,k=gi({mode:"hidden",children:k},u),i=xs(i,u,s,null),k.return=t,i.return=t,k.sibling=i,t.child=k,i=t.child,i.memoizedState=zc(s),i.childLanes=Mc(e,v,s),t.memoizedState=Oc,Xn(null,i)):(Ka(t),Lc(t,k))}var _=e.memoizedState;if(_!==null&&(k=_.dehydrated,k!==null)){if(f)t.flags&256?(Ka(t),t.flags&=-257,t=Dc(e,t,s)):t.memoizedState!==null?(qa(),t.child=e.child,t.flags|=128,t=null):(qa(),k=i.fallback,u=t.mode,i=gi({mode:"visible",children:i.children},u),k=xs(k,u,s,null),k.flags|=2,i.return=t,k.return=t,i.sibling=k,t.child=i,Ns(t,e.child,null,s),i=t.child,i.memoizedState=zc(s),i.childLanes=Mc(e,v,s),t.memoizedState=Oc,t=Xn(null,i));else if(Ka(t),hu(k)){if(v=k.nextSibling&&k.nextSibling.dataset,v)var te=v.dgst;v=te,i=Error(o(419)),i.stack="",i.digest=v,Bn({value:i,source:null,stack:null}),t=Dc(e,t,s)}else if(Rt||Vs(e,t,s,!1),v=(s&e.childLanes)!==0,Rt||v){if(v=ot,v!==null&&(i=be(v,s),i!==0&&i!==_.retryLane))throw _.retryLane=i,gs(e,i),fr(v,e,i),Tc;pu(k)||Ci(),t=Dc(e,t,s)}else pu(k)?(t.flags|=192,t.child=e.child,t=null):(e=_.treeContext,ut=Pr(k.nextSibling),Ht=t,Ge=!0,Ua=null,Lr=!1,e!==null&&xm(t,e),t=Lc(t,i.children),t.flags|=4096);return t}return u?(qa(),k=i.fallback,u=t.mode,_=e.child,te=_.sibling,i=fa(_,{mode:"hidden",children:i.children}),i.subtreeFlags=_.subtreeFlags&65011712,te!==null?k=fa(te,k):(k=xs(k,u,s,null),k.flags|=2),k.return=t,i.return=t,i.sibling=k,t.child=i,Xn(null,i),i=t.child,k=e.child.memoizedState,k===null?k=zc(s):(u=k.cachePool,u!==null?(_=Et._currentValue,u=u.parent!==_?{parent:_,pool:_}:u):u=jm(),k={baseLanes:k.baseLanes|s,cachePool:u}),i.memoizedState=k,i.childLanes=Mc(e,v,s),t.memoizedState=Oc,Xn(e.child,i)):(Ka(t),s=e.child,e=s.sibling,s=fa(s,{mode:"visible",children:i.children}),s.return=t,s.sibling=null,e!==null&&(v=t.deletions,v===null?(t.deletions=[e],t.flags|=16):v.push(e)),t.child=s,t.memoizedState=null,s)}function Lc(e,t){return t=gi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function gi(e,t){return e=vr(22,e,null,t),e.lanes=0,e}function Dc(e,t,s){return Ns(t,e.child,null,s),e=Lc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Uf(e,t,s){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Qo(e.return,t,s)}function Pc(e,t,s,i,u,f){var v=e.memoizedState;v===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:s,tailMode:u,treeForkCount:f}:(v.isBackwards=t,v.rendering=null,v.renderingStartTime=0,v.last=i,v.tail=s,v.tailMode=u,v.treeForkCount=f)}function _f(e,t,s){var i=t.pendingProps,u=i.revealOrder,f=i.tail;i=i.children;var v=Ct.current,k=(v&2)!==0;if(k?(v=v&1|2,t.flags|=128):v&=1,z(Ct,v),Kt(e,t,i,s),i=Ge?_n:0,!k&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Uf(e,s,t);else if(e.tag===19)Uf(e,s,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(u){case"forwards":for(s=t.child,u=null;s!==null;)e=s.alternate,e!==null&&si(e)===null&&(u=s),s=s.sibling;s=u,s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null),Pc(t,!1,u,s,f,i);break;case"backwards":case"unstable_legacy-backwards":for(s=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&si(e)===null){t.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}Pc(t,!0,s,null,f,i);break;case"together":Pc(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function ba(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),$a|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(Vs(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,s=fa(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=fa(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Uc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ql(e)))}function $x(e,t,s){switch(t.tag){case 3:ge(t,t.stateNode.containerInfo),Ba(t,Et,e.memoizedState.cache),ys();break;case 27:case 5:ye(t);break;case 4:ge(t,t.stateNode.containerInfo);break;case 10:Ba(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,oc(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Ka(t),t.flags|=128,null):(s&t.child.childLanes)!==0?Pf(e,t,s):(Ka(t),e=ba(e,t,s),e!==null?e.sibling:null);Ka(t);break;case 19:var u=(e.flags&128)!==0;if(i=(s&t.childLanes)!==0,i||(Vs(e,t,s,!1),i=(s&t.childLanes)!==0),u){if(i)return _f(e,t,s);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),z(Ct,Ct.current),i)break;return null;case 22:return t.lanes=0,Rf(e,t,s,t.pendingProps);case 24:Ba(t,Et,e.memoizedState.cache)}return ba(e,t,s)}function Bf(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)Rt=!0;else{if(!Uc(e,s)&&(t.flags&128)===0)return Rt=!1,$x(e,t,s);Rt=(e.flags&131072)!==0}else Rt=!1,Ge&&(t.flags&1048576)!==0&&gm(t,_n,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Ss(t.elementType),t.type=e,typeof e=="function")Go(e)?(i=ks(e,i),t.tag=1,t=Lf(null,t,e,i,s)):(t.tag=0,t=Rc(null,t,e,i,s));else{if(e!=null){var u=e.$$typeof;if(u===D){t.tag=11,t=Af(null,t,e,i,s);break e}else if(u===B){t.tag=14,t=Ef(null,t,e,i,s);break e}}throw t=H(e)||e,Error(o(306,t,""))}}return t;case 0:return Rc(e,t,t.type,t.pendingProps,s);case 1:return i=t.type,u=ks(i,t.pendingProps),Lf(e,t,i,u,s);case 3:e:{if(ge(t,t.stateNode.containerInfo),e===null)throw Error(o(387));i=t.pendingProps;var f=t.memoizedState;u=f.element,ac(e,t),Vn(t,i,null,s);var v=t.memoizedState;if(i=v.cache,Ba(t,Et,i),i!==f.cache&&Xo(t,[Et],s,!0),Fn(),i=v.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:v.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=Df(e,t,i,s);break e}else if(i!==u){u=Or(Error(o(424)),t),Bn(u),t=Df(e,t,i,s);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(ut=Pr(e.firstChild),Ht=t,Ge=!0,Ua=null,Lr=!0,s=Tm(t,null,i,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(ys(),i===u){t=ba(e,t,s);break e}Kt(e,t,i,s)}t=t.child}return t;case 26:return hi(e,t),e===null?(s=Qp(t.type,null,t.pendingProps,null))?t.memoizedState=s:Ge||(s=t.type,e=t.pendingProps,i=zi(se.current).createElement(s),i[$e]=t,i[Mt]=e,qt(i,s,e),yt(i),t.stateNode=i):t.memoizedState=Qp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ye(t),e===null&&Ge&&(i=t.stateNode=$p(t.type,t.pendingProps,se.current),Ht=t,Lr=!0,u=ut,Za(t.type)?(gu=u,ut=Pr(i.firstChild)):ut=u),Kt(e,t,t.pendingProps.children,s),hi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ge&&((u=i=ut)&&(i=jy(i,t.type,t.pendingProps,Lr),i!==null?(t.stateNode=i,Ht=t,ut=Pr(i.firstChild),Lr=!1,u=!0):u=!1),u||_a(t)),ye(t),u=t.type,f=t.pendingProps,v=e!==null?e.memoizedProps:null,i=f.children,du(u,f)?i=null:v!==null&&du(u,v)&&(t.flags|=32),t.memoizedState!==null&&(u=uc(e,t,_x,null,null,s),ml._currentValue=u),hi(e,t),Kt(e,t,i,s),t.child;case 6:return e===null&&Ge&&((e=s=ut)&&(s=Ny(s,t.pendingProps,Lr),s!==null?(t.stateNode=s,Ht=t,ut=null,e=!0):e=!1),e||_a(t)),null;case 13:return Pf(e,t,s);case 4:return ge(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ns(t,null,i,s):Kt(e,t,i,s),t.child;case 11:return Af(e,t,t.type,t.pendingProps,s);case 7:return Kt(e,t,t.pendingProps,s),t.child;case 8:return Kt(e,t,t.pendingProps.children,s),t.child;case 12:return Kt(e,t,t.pendingProps.children,s),t.child;case 10:return i=t.pendingProps,Ba(t,t.type,i.value),Kt(e,t,i.children,s),t.child;case 9:return u=t.type._context,i=t.pendingProps.children,vs(t),u=Gt(u),i=i(u),t.flags|=1,Kt(e,t,i,s),t.child;case 14:return Ef(e,t,t.type,t.pendingProps,s);case 15:return Tf(e,t,t.type,t.pendingProps,s);case 19:return _f(e,t,s);case 31:return Vx(e,t,s);case 22:return Rf(e,t,s,t.pendingProps);case 24:return vs(t),i=Gt(Et),e===null?(u=ec(),u===null&&(u=ot,f=Zo(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=s),u=f),t.memoizedState={parent:i,cache:u},rc(t),Ba(t,Et,u)):((e.lanes&s)!==0&&(ac(e,t),Vn(t,null,null,s),Fn()),u=e.memoizedState,f=t.memoizedState,u.parent!==i?(u={parent:i,cache:i},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),Ba(t,Et,i)):(i=f.cache,Ba(t,Et,i),i!==u.cache&&Xo(t,[Et],s,!0))),Kt(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function va(e){e.flags|=4}function _c(e,t,s,i,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(mp())e.flags|=8192;else throw js=ei,tc}else e.flags&=-16777217}function If(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!th(t))if(mp())e.flags|=8192;else throw js=ei,tc}function xi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?oa():536870912,e.lanes|=t,sn|=t)}function Zn(e,t){if(!Ge)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function dt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,i=0;if(t)for(var u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags&65011712,i|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)s|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=s,t}function Yx(e,t,s){var i=t.pendingProps;switch(Vo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dt(t),null;case 1:return dt(t),null;case 3:return s=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),ga(Et),re(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Fs(t)?va(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Yo())),dt(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(va(t),f!==null?(dt(t),If(t,f)):(dt(t),_c(t,u,null,i,s))):f?f!==e.memoizedState?(va(t),dt(t),If(t,f)):(dt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&va(t),dt(t),_c(t,u,e,i,s)),null;case 27:if(ue(t),s=se.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&va(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return dt(t),null}e=q.current,Fs(t)?ym(t):(e=$p(u,i,s),t.stateNode=e,va(t))}return dt(t),null;case 5:if(ue(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&va(t);else{if(!i){if(t.stateNode===null)throw Error(o(166));return dt(t),null}if(f=q.current,Fs(t))ym(t);else{var v=zi(se.current);switch(f){case 1:f=v.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=v.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=v.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=v.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=v.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof i.is=="string"?v.createElement("select",{is:i.is}):v.createElement("select"),i.multiple?f.multiple=!0:i.size&&(f.size=i.size);break;default:f=typeof i.is=="string"?v.createElement(u,{is:i.is}):v.createElement(u)}}f[$e]=t,f[Mt]=i;e:for(v=t.child;v!==null;){if(v.tag===5||v.tag===6)f.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===t)break e;for(;v.sibling===null;){if(v.return===null||v.return===t)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}t.stateNode=f;e:switch(qt(f,u,i),u){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&va(t)}}return dt(t),_c(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&va(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(o(166));if(e=se.current,Fs(t)){if(e=t.stateNode,s=t.memoizedProps,i=null,u=Ht,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[$e]=t,e=!!(e.nodeValue===s||i!==null&&i.suppressHydrationWarning===!0||Pp(e.nodeValue,s)),e||_a(t,!0)}else e=zi(e).createTextNode(i),e[$e]=t,t.stateNode=e}return dt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(i=Fs(t),s!==null){if(e===null){if(!i)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[$e]=t}else ys(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;dt(t),e=!1}else s=Yo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(Sr(t),t):(Sr(t),null);if((t.flags&128)!==0)throw Error(o(558))}return dt(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Fs(t),i!==null&&i.dehydrated!==null){if(e===null){if(!u)throw Error(o(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[$e]=t}else ys(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;dt(t),u=!1}else u=Yo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Sr(t),t):(Sr(t),null)}return Sr(t),(t.flags&128)!==0?(t.lanes=s,t):(s=i!==null,e=e!==null&&e.memoizedState!==null,s&&(i=t.child,u=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(u=i.alternate.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==u&&(i.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),xi(t,t.updateQueue),dt(t),null);case 4:return re(),e===null&&lu(t.stateNode.containerInfo),dt(t),null;case 10:return ga(t.type),dt(t),null;case 19:if(M(Ct),i=t.memoizedState,i===null)return dt(t),null;if(u=(t.flags&128)!==0,f=i.rendering,f===null)if(u)Zn(i,!1);else{if(vt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=si(e),f!==null){for(t.flags|=128,Zn(i,!1),e=f.updateQueue,t.updateQueue=e,xi(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)fm(s,e),s=s.sibling;return z(Ct,Ct.current&1|2),Ge&&pa(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&tt()>Si&&(t.flags|=128,u=!0,Zn(i,!1),t.lanes=4194304)}else{if(!u)if(e=si(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,xi(t,e),Zn(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!Ge)return dt(t),null}else 2*tt()-i.renderingStartTime>Si&&s!==536870912&&(t.flags|=128,u=!0,Zn(i,!1),t.lanes=4194304);i.isBackwards?(f.sibling=t.child,t.child=f):(e=i.last,e!==null?e.sibling=f:t.child=f,i.last=f)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=tt(),e.sibling=null,s=Ct.current,z(Ct,u?s&1|2:s&1),Ge&&pa(t,i.treeForkCount),e):(dt(t),null);case 22:case 23:return Sr(t),ic(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(s&536870912)!==0&&(t.flags&128)===0&&(dt(t),t.subtreeFlags&6&&(t.flags|=8192)):dt(t),s=t.updateQueue,s!==null&&xi(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==s&&(t.flags|=2048),e!==null&&M(ws),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ga(Et),dt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Jx(e,t){switch(Vo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ga(Et),re(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ue(t),null;case 31:if(t.memoizedState!==null){if(Sr(t),t.alternate===null)throw Error(o(340));ys()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Sr(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));ys()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return M(Ct),null;case 4:return re(),null;case 10:return ga(t.type),null;case 22:case 23:return Sr(t),ic(),e!==null&&M(ws),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ga(Et),null;case 25:return null;default:return null}}function Hf(e,t){switch(Vo(t),t.tag){case 3:ga(Et),re();break;case 26:case 27:case 5:ue(t);break;case 4:re();break;case 31:t.memoizedState!==null&&Sr(t);break;case 13:Sr(t);break;case 19:M(Ct);break;case 10:ga(t.type);break;case 22:case 23:Sr(t),ic(),e!==null&&M(ws);break;case 24:ga(Et)}}function Wn(e,t){try{var s=t.updateQueue,i=s!==null?s.lastEffect:null;if(i!==null){var u=i.next;s=u;do{if((s.tag&e)===e){i=void 0;var f=s.create,v=s.inst;i=f(),v.destroy=i}s=s.next}while(s!==u)}}catch(k){et(t,t.return,k)}}function Fa(e,t,s){try{var i=t.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var f=u.next;i=f;do{if((i.tag&e)===e){var v=i.inst,k=v.destroy;if(k!==void 0){v.destroy=void 0,u=t;var _=s,te=k;try{te()}catch(ce){et(u,_,ce)}}}i=i.next}while(i!==f)}}catch(ce){et(t,t.return,ce)}}function Gf(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Om(t,s)}catch(i){et(e,e.return,i)}}}function Kf(e,t,s){s.props=ks(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(i){et(e,t,i)}}function el(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof s=="function"?e.refCleanup=s(i):s.current=i}}catch(u){et(e,t,u)}}function Zr(e,t){var s=e.ref,i=e.refCleanup;if(s!==null)if(typeof i=="function")try{i()}catch(u){et(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(u){et(e,t,u)}else s.current=null}function qf(e){var t=e.type,s=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&i.focus();break e;case"img":s.src?i.src=s.src:s.srcSet&&(i.srcset=s.srcSet)}}catch(u){et(e,e.return,u)}}function Bc(e,t,s){try{var i=e.stateNode;xy(i,e.type,s,t),i[Mt]=t}catch(u){et(e,e.return,u)}}function Ff(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Za(e.type)||e.tag===4}function Ic(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ff(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&&Za(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 Hc(e,t,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=da));else if(i!==4&&(i===27&&Za(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(Hc(e,t,s),e=e.sibling;e!==null;)Hc(e,t,s),e=e.sibling}function yi(e,t,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(i!==4&&(i===27&&Za(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(yi(e,t,s),e=e.sibling;e!==null;)yi(e,t,s),e=e.sibling}function Vf(e){var t=e.stateNode,s=e.memoizedProps;try{for(var i=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);qt(t,i,s),t[$e]=e,t[Mt]=s}catch(f){et(e,e.return,f)}}var wa=!1,Ot=!1,Gc=!1,$f=typeof WeakSet=="function"?WeakSet:Set,_t=null;function Qx(e,t){if(e=e.containerInfo,cu=Bi,e=sm(e),Do(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var i=s.getSelection&&s.getSelection();if(i&&i.rangeCount!==0){s=i.anchorNode;var u=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{s.nodeType,f.nodeType}catch{s=null;break e}var v=0,k=-1,_=-1,te=0,ce=0,me=e,ae=null;t:for(;;){for(var ne;me!==s||u!==0&&me.nodeType!==3||(k=v+u),me!==f||i!==0&&me.nodeType!==3||(_=v+i),me.nodeType===3&&(v+=me.nodeValue.length),(ne=me.firstChild)!==null;)ae=me,me=ne;for(;;){if(me===e)break t;if(ae===s&&++te===u&&(k=v),ae===f&&++ce===i&&(_=v),(ne=me.nextSibling)!==null)break;me=ae,ae=me.parentNode}me=ne}s=k===-1||_===-1?null:{start:k,end:_}}else s=null}s=s||{start:0,end:0}}else s=null;for(uu={focusedElem:e,selectionRange:s},Bi=!1,_t=t;_t!==null;)if(t=_t,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_t=e;else for(;_t!==null;){switch(t=_t,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(s=0;s<e.length;s++)u=e[s],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,s=t,u=f.memoizedProps,f=f.memoizedState,i=s.stateNode;try{var Se=ks(s.type,u);e=i.getSnapshotBeforeUpdate(Se,f),i.__reactInternalSnapshotBeforeUpdate=e}catch(Te){et(s,s.return,Te)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)fu(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":fu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,_t=e;break}_t=t.return}}function Yf(e,t,s){var i=s.flags;switch(s.tag){case 0:case 11:case 15:ja(e,s),i&4&&Wn(5,s);break;case 1:if(ja(e,s),i&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(v){et(s,s.return,v)}else{var u=ks(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(v){et(s,s.return,v)}}i&64&&Gf(s),i&512&&el(s,s.return);break;case 3:if(ja(e,s),i&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{Om(e,t)}catch(v){et(s,s.return,v)}}break;case 27:t===null&&i&4&&Vf(s);case 26:case 5:ja(e,s),t===null&&i&4&&qf(s),i&512&&el(s,s.return);break;case 12:ja(e,s);break;case 31:ja(e,s),i&4&&Xf(e,s);break;case 13:ja(e,s),i&4&&Zf(e,s),i&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=ny.bind(null,s),Cy(e,s))));break;case 22:if(i=s.memoizedState!==null||wa,!i){t=t!==null&&t.memoizedState!==null||Ot,u=wa;var f=Ot;wa=i,(Ot=t)&&!f?Na(e,s,(s.subtreeFlags&8772)!==0):ja(e,s),wa=u,Ot=f}break;case 30:break;default:ja(e,s)}}function Jf(e){var t=e.alternate;t!==null&&(e.alternate=null,Jf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Jr(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 pt=null,cr=!1;function Sa(e,t,s){for(s=s.child;s!==null;)Qf(e,t,s),s=s.sibling}function Qf(e,t,s){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(Jt,s)}catch{}switch(s.tag){case 26:Ot||Zr(s,t),Sa(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Ot||Zr(s,t);var i=pt,u=cr;Za(s.type)&&(pt=s.stateNode,cr=!1),Sa(e,t,s),cl(s.stateNode),pt=i,cr=u;break;case 5:Ot||Zr(s,t);case 6:if(i=pt,u=cr,pt=null,Sa(e,t,s),pt=i,cr=u,pt!==null)if(cr)try{(pt.nodeType===9?pt.body:pt.nodeName==="HTML"?pt.ownerDocument.body:pt).removeChild(s.stateNode)}catch(f){et(s,t,f)}else try{pt.removeChild(s.stateNode)}catch(f){et(s,t,f)}break;case 18:pt!==null&&(cr?(e=pt,Gp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),fn(e)):Gp(pt,s.stateNode));break;case 4:i=pt,u=cr,pt=s.stateNode.containerInfo,cr=!0,Sa(e,t,s),pt=i,cr=u;break;case 0:case 11:case 14:case 15:Fa(2,s,t),Ot||Fa(4,s,t),Sa(e,t,s);break;case 1:Ot||(Zr(s,t),i=s.stateNode,typeof i.componentWillUnmount=="function"&&Kf(s,t,i)),Sa(e,t,s);break;case 21:Sa(e,t,s);break;case 22:Ot=(i=Ot)||s.memoizedState!==null,Sa(e,t,s),Ot=i;break;default:Sa(e,t,s)}}function Xf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{fn(e)}catch(s){et(t,t.return,s)}}}function Zf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{fn(e)}catch(s){et(t,t.return,s)}}function Xx(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new $f),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new $f),t;default:throw Error(o(435,e.tag))}}function bi(e,t){var s=Xx(e);t.forEach(function(i){if(!s.has(i)){s.add(i);var u=ly.bind(null,e,i);i.then(u,u)}})}function ur(e,t){var s=t.deletions;if(s!==null)for(var i=0;i<s.length;i++){var u=s[i],f=e,v=t,k=v;e:for(;k!==null;){switch(k.tag){case 27:if(Za(k.type)){pt=k.stateNode,cr=!1;break e}break;case 5:pt=k.stateNode,cr=!1;break e;case 3:case 4:pt=k.stateNode.containerInfo,cr=!0;break e}k=k.return}if(pt===null)throw Error(o(160));Qf(f,v,u),pt=null,cr=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Wf(t,e),t=t.sibling}var Gr=null;function Wf(e,t){var s=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ur(t,e),dr(e),i&4&&(Fa(3,e,e.return),Wn(3,e),Fa(5,e,e.return));break;case 1:ur(t,e),dr(e),i&512&&(Ot||s===null||Zr(s,s.return)),i&64&&wa&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?i:s.concat(i))));break;case 26:var u=Gr;if(ur(t,e),dr(e),i&512&&(Ot||s===null||Zr(s,s.return)),i&4){var f=s!==null?s.memoizedState:null;if(i=e.memoizedState,s===null)if(i===null)if(e.stateNode===null){e:{i=e.type,s=e.memoizedProps,u=u.ownerDocument||u;t:switch(i){case"title":f=u.getElementsByTagName("title")[0],(!f||f[ct]||f[$e]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(i),u.head.insertBefore(f,u.querySelector("head > title"))),qt(f,i,s),f[$e]=e,yt(f),i=f;break e;case"link":var v=Wp("link","href",u).get(i+(s.href||""));if(v){for(var k=0;k<v.length;k++)if(f=v[k],f.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&f.getAttribute("rel")===(s.rel==null?null:s.rel)&&f.getAttribute("title")===(s.title==null?null:s.title)&&f.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){v.splice(k,1);break t}}f=u.createElement(i),qt(f,i,s),u.head.appendChild(f);break;case"meta":if(v=Wp("meta","content",u).get(i+(s.content||""))){for(k=0;k<v.length;k++)if(f=v[k],f.getAttribute("content")===(s.content==null?null:""+s.content)&&f.getAttribute("name")===(s.name==null?null:s.name)&&f.getAttribute("property")===(s.property==null?null:s.property)&&f.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&f.getAttribute("charset")===(s.charSet==null?null:s.charSet)){v.splice(k,1);break t}}f=u.createElement(i),qt(f,i,s),u.head.appendChild(f);break;default:throw Error(o(468,i))}f[$e]=e,yt(f),i=f}e.stateNode=i}else eh(u,e.type,e.stateNode);else e.stateNode=Zp(u,i,e.memoizedProps);else f!==i?(f===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):f.count--,i===null?eh(u,e.type,e.stateNode):Zp(u,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Bc(e,e.memoizedProps,s.memoizedProps)}break;case 27:ur(t,e),dr(e),i&512&&(Ot||s===null||Zr(s,s.return)),s!==null&&i&4&&Bc(e,e.memoizedProps,s.memoizedProps);break;case 5:if(ur(t,e),dr(e),i&512&&(Ot||s===null||Zr(s,s.return)),e.flags&32){u=e.stateNode;try{Ds(u,"")}catch(Se){et(e,e.return,Se)}}i&4&&e.stateNode!=null&&(u=e.memoizedProps,Bc(e,u,s!==null?s.memoizedProps:u)),i&1024&&(Gc=!0);break;case 6:if(ur(t,e),dr(e),i&4){if(e.stateNode===null)throw Error(o(162));i=e.memoizedProps,s=e.stateNode;try{s.nodeValue=i}catch(Se){et(e,e.return,Se)}}break;case 3:if(Di=null,u=Gr,Gr=Mi(t.containerInfo),ur(t,e),Gr=u,dr(e),i&4&&s!==null&&s.memoizedState.isDehydrated)try{fn(t.containerInfo)}catch(Se){et(e,e.return,Se)}Gc&&(Gc=!1,ep(e));break;case 4:i=Gr,Gr=Mi(e.stateNode.containerInfo),ur(t,e),dr(e),Gr=i;break;case 12:ur(t,e),dr(e);break;case 31:ur(t,e),dr(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,bi(e,i)));break;case 13:ur(t,e),dr(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(wi=tt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,bi(e,i)));break;case 22:u=e.memoizedState!==null;var _=s!==null&&s.memoizedState!==null,te=wa,ce=Ot;if(wa=te||u,Ot=ce||_,ur(t,e),Ot=ce,wa=te,dr(e),i&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(s===null||_||wa||Ot||As(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){_=s=t;try{if(f=_.stateNode,u)v=f.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{k=_.stateNode;var me=_.memoizedProps.style,ae=me!=null&&me.hasOwnProperty("display")?me.display:null;k.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(Se){et(_,_.return,Se)}}}else if(t.tag===6){if(s===null){_=t;try{_.stateNode.nodeValue=u?"":_.memoizedProps}catch(Se){et(_,_.return,Se)}}}else if(t.tag===18){if(s===null){_=t;try{var ne=_.stateNode;u?Kp(ne,!0):Kp(_.stateNode,!1)}catch(Se){et(_,_.return,Se)}}}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;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(s=i.retryQueue,s!==null&&(i.retryQueue=null,bi(e,s))));break;case 19:ur(t,e),dr(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,bi(e,i)));break;case 30:break;case 21:break;default:ur(t,e),dr(e)}}function dr(e){var t=e.flags;if(t&2){try{for(var s,i=e.return;i!==null;){if(Ff(i)){s=i;break}i=i.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var u=s.stateNode,f=Ic(e);yi(e,f,u);break;case 5:var v=s.stateNode;s.flags&32&&(Ds(v,""),s.flags&=-33);var k=Ic(e);yi(e,k,v);break;case 3:case 4:var _=s.stateNode.containerInfo,te=Ic(e);Hc(e,te,_);break;default:throw Error(o(161))}}catch(ce){et(e,e.return,ce)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ep(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ep(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ja(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Yf(e,t.alternate,t),t=t.sibling}function As(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Fa(4,t,t.return),As(t);break;case 1:Zr(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&Kf(t,t.return,s),As(t);break;case 27:cl(t.stateNode);case 26:case 5:Zr(t,t.return),As(t);break;case 22:t.memoizedState===null&&As(t);break;case 30:As(t);break;default:As(t)}e=e.sibling}}function Na(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,u=e,f=t,v=f.flags;switch(f.tag){case 0:case 11:case 15:Na(u,f,s),Wn(4,f);break;case 1:if(Na(u,f,s),i=f,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(te){et(i,i.return,te)}if(i=f,u=i.updateQueue,u!==null){var k=i.stateNode;try{var _=u.shared.hiddenCallbacks;if(_!==null)for(u.shared.hiddenCallbacks=null,u=0;u<_.length;u++)Rm(_[u],k)}catch(te){et(i,i.return,te)}}s&&v&64&&Gf(f),el(f,f.return);break;case 27:Vf(f);case 26:case 5:Na(u,f,s),s&&i===null&&v&4&&qf(f),el(f,f.return);break;case 12:Na(u,f,s);break;case 31:Na(u,f,s),s&&v&4&&Xf(u,f);break;case 13:Na(u,f,s),s&&v&4&&Zf(u,f);break;case 22:f.memoizedState===null&&Na(u,f,s),el(f,f.return);break;case 30:break;default:Na(u,f,s)}t=t.sibling}}function Kc(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&In(s))}function qc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&In(e))}function Kr(e,t,s,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)tp(e,t,s,i),t=t.sibling}function tp(e,t,s,i){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Kr(e,t,s,i),u&2048&&Wn(9,t);break;case 1:Kr(e,t,s,i);break;case 3:Kr(e,t,s,i),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&In(e)));break;case 12:if(u&2048){Kr(e,t,s,i),e=t.stateNode;try{var f=t.memoizedProps,v=f.id,k=f.onPostCommit;typeof k=="function"&&k(v,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(_){et(t,t.return,_)}}else Kr(e,t,s,i);break;case 31:Kr(e,t,s,i);break;case 13:Kr(e,t,s,i);break;case 23:break;case 22:f=t.stateNode,v=t.alternate,t.memoizedState!==null?f._visibility&2?Kr(e,t,s,i):tl(e,t):f._visibility&2?Kr(e,t,s,i):(f._visibility|=2,tn(e,t,s,i,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Kc(v,t);break;case 24:Kr(e,t,s,i),u&2048&&qc(t.alternate,t);break;default:Kr(e,t,s,i)}}function tn(e,t,s,i,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,v=t,k=s,_=i,te=v.flags;switch(v.tag){case 0:case 11:case 15:tn(f,v,k,_,u),Wn(8,v);break;case 23:break;case 22:var ce=v.stateNode;v.memoizedState!==null?ce._visibility&2?tn(f,v,k,_,u):tl(f,v):(ce._visibility|=2,tn(f,v,k,_,u)),u&&te&2048&&Kc(v.alternate,v);break;case 24:tn(f,v,k,_,u),u&&te&2048&&qc(v.alternate,v);break;default:tn(f,v,k,_,u)}t=t.sibling}}function tl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,i=t,u=i.flags;switch(i.tag){case 22:tl(s,i),u&2048&&Kc(i.alternate,i);break;case 24:tl(s,i),u&2048&&qc(i.alternate,i);break;default:tl(s,i)}t=t.sibling}}var rl=8192;function rn(e,t,s){if(e.subtreeFlags&rl)for(e=e.child;e!==null;)rp(e,t,s),e=e.sibling}function rp(e,t,s){switch(e.tag){case 26:rn(e,t,s),e.flags&rl&&e.memoizedState!==null&&Uy(s,Gr,e.memoizedState,e.memoizedProps);break;case 5:rn(e,t,s);break;case 3:case 4:var i=Gr;Gr=Mi(e.stateNode.containerInfo),rn(e,t,s),Gr=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=rl,rl=16777216,rn(e,t,s),rl=i):rn(e,t,s));break;default:rn(e,t,s)}}function ap(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 al(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];_t=i,np(i,e)}ap(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)sp(e),e=e.sibling}function sp(e){switch(e.tag){case 0:case 11:case 15:al(e),e.flags&2048&&Fa(9,e,e.return);break;case 3:al(e);break;case 12:al(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,vi(e)):al(e);break;default:al(e)}}function vi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];_t=i,np(i,e)}ap(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Fa(8,t,t.return),vi(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,vi(t));break;default:vi(t)}e=e.sibling}}function np(e,t){for(;_t!==null;){var s=_t;switch(s.tag){case 0:case 11:case 15:Fa(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var i=s.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:In(s.memoizedState.cache)}if(i=s.child,i!==null)i.return=s,_t=i;else e:for(s=e;_t!==null;){i=_t;var u=i.sibling,f=i.return;if(Jf(i),i===s){_t=null;break e}if(u!==null){u.return=f,_t=u;break e}_t=f}}}var Zx={getCacheForType:function(e){var t=Gt(Et),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Gt(Et).controller.signal}},Wx=typeof WeakMap=="function"?WeakMap:Map,Qe=0,ot=null,_e=null,Ie=0,We=0,jr=null,Va=!1,an=!1,Fc=!1,Ca=0,vt=0,$a=0,Es=0,Vc=0,Nr=0,sn=0,sl=null,mr=null,$c=!1,wi=0,lp=0,Si=1/0,ji=null,Ya=null,Lt=0,Ja=null,nn=null,ka=0,Yc=0,Jc=null,ip=null,nl=0,Qc=null;function Cr(){return(Qe&2)!==0&&Ie!==0?Ie&-Ie:C.T!==null?ru():ds()}function op(){if(Nr===0)if((Ie&536870912)===0||Ge){var e=gr;gr<<=1,(gr&3932160)===0&&(gr=262144),Nr=e}else Nr=536870912;return e=wr.current,e!==null&&(e.flags|=32),Nr}function fr(e,t,s){(e===ot&&(We===2||We===9)||e.cancelPendingCommit!==null)&&(ln(e,0),Qa(e,Ie,Nr,!1)),Ve(e,s),((Qe&2)===0||e!==ot)&&(e===ot&&((Qe&2)===0&&(Es|=s),vt===4&&Qa(e,Ie,Nr,!1)),Wr(e))}function cp(e,t,s){if((Qe&6)!==0)throw Error(o(327));var i=!s&&(t&127)===0&&(t&e.expiredLanes)===0||jt(e,t),u=i?ry(e,t):Zc(e,t,!0),f=i;do{if(u===0){an&&!i&&Qa(e,t,0,!1);break}else{if(s=e.current.alternate,f&&!ey(s)){u=Zc(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var v=0;else v=e.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){t=v;e:{var k=e;u=sl;var _=k.current.memoizedState.isDehydrated;if(_&&(ln(k,v).flags|=256),v=Zc(k,v,!1),v!==2){if(Fc&&!_){k.errorRecoveryDisabledLanes|=f,Es|=f,u=4;break e}f=mr,mr=u,f!==null&&(mr===null?mr=f:mr.push.apply(mr,f))}u=v}if(f=!1,u!==2)continue}}if(u===1){ln(e,0),Qa(e,t,0,!0);break}e:{switch(i=e,f=u,f){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Qa(i,t,Nr,!Va);break e;case 2:mr=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(u=wi+300-tt(),10<u)){if(Qa(i,t,Nr,!Va),qe(i,0,!0)!==0)break e;ka=t,i.timeoutHandle=Ip(up.bind(null,i,s,mr,ji,$c,t,Nr,Es,sn,Va,f,"Throttled",-0,0),u);break e}up(i,s,mr,ji,$c,t,Nr,Es,sn,Va,f,null,-0,0)}}break}while(!0);Wr(e)}function up(e,t,s,i,u,f,v,k,_,te,ce,me,ae,ne){if(e.timeoutHandle=-1,me=t.subtreeFlags,me&8192||(me&16785408)===16785408){me={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:da},rp(t,f,me);var Se=(f&62914560)===f?wi-tt():(f&4194048)===f?lp-tt():0;if(Se=_y(me,Se),Se!==null){ka=f,e.cancelPendingCommit=Se(yp.bind(null,e,t,f,s,i,u,v,k,_,ce,me,null,ae,ne)),Qa(e,f,v,!te);return}}yp(e,t,f,s,i,u,v,k,_)}function ey(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var i=0;i<s.length;i++){var u=s[i],f=u.getSnapshot;u=u.value;try{if(!br(f(),u))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;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 Qa(e,t,s,i){t&=~Vc,t&=~Es,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var u=t;0<u;){var f=31-xt(u),v=1<<f;i[f]=-1,u&=~v}s!==0&&he(e,s,t)}function Ni(){return(Qe&6)===0?(ll(0),!1):!0}function Xc(){if(_e!==null){if(We===0)var e=_e.return;else e=_e,ha=bs=null,fc(e),Qs=null,Gn=0,e=_e;for(;e!==null;)Hf(e.alternate,e),e=e.return;_e=null}}function ln(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,vy(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),ka=0,Xc(),ot=e,_e=s=fa(e.current,null),Ie=t,We=0,jr=null,Va=!1,an=jt(e,t),Fc=!1,sn=Nr=Vc=Es=$a=vt=0,mr=sl=null,$c=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var u=31-xt(i),f=1<<u;t|=e[u],i&=~f}return Ca=t,Fl(),s}function dp(e,t){Le=null,C.H=Qn,t===Js||t===Wl?(t=km(),We=3):t===tc?(t=km(),We=4):We=t===Tc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,jr=t,_e===null&&(vt=1,fi(e,Or(t,e.current)))}function mp(){var e=wr.current;return e===null?!0:(Ie&4194048)===Ie?Dr===null:(Ie&62914560)===Ie||(Ie&536870912)!==0?e===Dr:!1}function fp(){var e=C.H;return C.H=Qn,e===null?Qn:e}function pp(){var e=C.A;return C.A=Zx,e}function Ci(){vt=4,Va||(Ie&4194048)!==Ie&&wr.current!==null||(an=!0),($a&134217727)===0&&(Es&134217727)===0||ot===null||Qa(ot,Ie,Nr,!1)}function Zc(e,t,s){var i=Qe;Qe|=2;var u=fp(),f=pp();(ot!==e||Ie!==t)&&(ji=null,ln(e,t)),t=!1;var v=vt;e:do try{if(We!==0&&_e!==null){var k=_e,_=jr;switch(We){case 8:Xc(),v=6;break e;case 3:case 2:case 9:case 6:wr.current===null&&(t=!0);var te=We;if(We=0,jr=null,on(e,k,_,te),s&&an){v=0;break e}break;default:te=We,We=0,jr=null,on(e,k,_,te)}}ty(),v=vt;break}catch(ce){dp(e,ce)}while(!0);return t&&e.shellSuspendCounter++,ha=bs=null,Qe=i,C.H=u,C.A=f,_e===null&&(ot=null,Ie=0,Fl()),v}function ty(){for(;_e!==null;)hp(_e)}function ry(e,t){var s=Qe;Qe|=2;var i=fp(),u=pp();ot!==e||Ie!==t?(ji=null,Si=tt()+500,ln(e,t)):an=jt(e,t);e:do try{if(We!==0&&_e!==null){t=_e;var f=jr;t:switch(We){case 1:We=0,jr=null,on(e,t,f,1);break;case 2:case 9:if(Nm(f)){We=0,jr=null,gp(t);break}t=function(){We!==2&&We!==9||ot!==e||(We=7),Wr(e)},f.then(t,t);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:Nm(f)?(We=0,jr=null,gp(t)):(We=0,jr=null,on(e,t,f,7));break;case 5:var v=null;switch(_e.tag){case 26:v=_e.memoizedState;case 5:case 27:var k=_e;if(v?th(v):k.stateNode.complete){We=0,jr=null;var _=k.sibling;if(_!==null)_e=_;else{var te=k.return;te!==null?(_e=te,ki(te)):_e=null}break t}}We=0,jr=null,on(e,t,f,5);break;case 6:We=0,jr=null,on(e,t,f,6);break;case 8:Xc(),vt=6;break e;default:throw Error(o(462))}}ay();break}catch(ce){dp(e,ce)}while(!0);return ha=bs=null,C.H=i,C.A=u,Qe=s,_e!==null?0:(ot=null,Ie=0,Fl(),vt)}function ay(){for(;_e!==null&&!It();)hp(_e)}function hp(e){var t=Bf(e.alternate,e,Ca);e.memoizedProps=e.pendingProps,t===null?ki(e):_e=t}function gp(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=Mf(s,t,t.pendingProps,t.type,void 0,Ie);break;case 11:t=Mf(s,t,t.pendingProps,t.type.render,t.ref,Ie);break;case 5:fc(t);default:Hf(s,t),t=_e=fm(t,Ca),t=Bf(s,t,Ca)}e.memoizedProps=e.pendingProps,t===null?ki(e):_e=t}function on(e,t,s,i){ha=bs=null,fc(t),Qs=null,Gn=0;var u=t.return;try{if(Fx(e,u,t,s,Ie)){vt=1,fi(e,Or(s,e.current)),_e=null;return}}catch(f){if(u!==null)throw _e=u,f;vt=1,fi(e,Or(s,e.current)),_e=null;return}t.flags&32768?(Ge||i===1?e=!0:an||(Ie&536870912)!==0?e=!1:(Va=e=!0,(i===2||i===9||i===3||i===6)&&(i=wr.current,i!==null&&i.tag===13&&(i.flags|=16384))),xp(t,e)):ki(t)}function ki(e){var t=e;do{if((t.flags&32768)!==0){xp(t,Va);return}e=t.return;var s=Yx(t.alternate,t,Ca);if(s!==null){_e=s;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);vt===0&&(vt=5)}function xp(e,t){do{var s=Jx(e.alternate,e);if(s!==null){s.flags&=32767,_e=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){_e=e;return}_e=e=s}while(e!==null);vt=6,_e=null}function yp(e,t,s,i,u,f,v,k,_){e.cancelPendingCommit=null;do Ai();while(Lt!==0);if((Qe&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(f=t.lanes|t.childLanes,f|=Io,it(e,s,f,v,k,_),e===ot&&(_e=ot=null,Ie=0),nn=t,Ja=e,ka=s,Yc=f,Jc=u,ip=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,iy(St,function(){return jp(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=C.T,C.T=null,u=I.p,I.p=2,v=Qe,Qe|=4;try{Qx(e,t,s)}finally{Qe=v,I.p=u,C.T=i}}Lt=1,bp(),vp(),wp()}}function bp(){if(Lt===1){Lt=0;var e=Ja,t=nn,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=C.T,C.T=null;var i=I.p;I.p=2;var u=Qe;Qe|=4;try{Wf(t,e);var f=uu,v=sm(e.containerInfo),k=f.focusedElem,_=f.selectionRange;if(v!==k&&k&&k.ownerDocument&&am(k.ownerDocument.documentElement,k)){if(_!==null&&Do(k)){var te=_.start,ce=_.end;if(ce===void 0&&(ce=te),"selectionStart"in k)k.selectionStart=te,k.selectionEnd=Math.min(ce,k.value.length);else{var me=k.ownerDocument||document,ae=me&&me.defaultView||window;if(ae.getSelection){var ne=ae.getSelection(),Se=k.textContent.length,Te=Math.min(_.start,Se),st=_.end===void 0?Te:Math.min(_.end,Se);!ne.extend&&Te>st&&(v=st,st=Te,Te=v);var J=rm(k,Te),F=rm(k,st);if(J&&F&&(ne.rangeCount!==1||ne.anchorNode!==J.node||ne.anchorOffset!==J.offset||ne.focusNode!==F.node||ne.focusOffset!==F.offset)){var ee=me.createRange();ee.setStart(J.node,J.offset),ne.removeAllRanges(),Te>st?(ne.addRange(ee),ne.extend(F.node,F.offset)):(ee.setEnd(F.node,F.offset),ne.addRange(ee))}}}}for(me=[],ne=k;ne=ne.parentNode;)ne.nodeType===1&&me.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<me.length;k++){var de=me[k];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}Bi=!!cu,uu=cu=null}finally{Qe=u,I.p=i,C.T=s}}e.current=t,Lt=2}}function vp(){if(Lt===2){Lt=0;var e=Ja,t=nn,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=C.T,C.T=null;var i=I.p;I.p=2;var u=Qe;Qe|=4;try{Yf(e,t.alternate,t)}finally{Qe=u,I.p=i,C.T=s}}Lt=3}}function wp(){if(Lt===4||Lt===3){Lt=0,pr();var e=Ja,t=nn,s=ka,i=ip;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Lt=5:(Lt=0,nn=Ja=null,Sp(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Ya=null),Yr(s),t=t.stateNode,ft&&typeof ft.onCommitFiberRoot=="function")try{ft.onCommitFiberRoot(Jt,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=C.T,u=I.p,I.p=2,C.T=null;try{for(var f=e.onRecoverableError,v=0;v<i.length;v++){var k=i[v];f(k.value,{componentStack:k.stack})}}finally{C.T=t,I.p=u}}(ka&3)!==0&&Ai(),Wr(e),u=e.pendingLanes,(s&261930)!==0&&(u&42)!==0?e===Qc?nl++:(nl=0,Qc=e):nl=0,ll(0)}}function Sp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,In(t)))}function Ai(){return bp(),vp(),wp(),jp()}function jp(){if(Lt!==5)return!1;var e=Ja,t=Yc;Yc=0;var s=Yr(ka),i=C.T,u=I.p;try{I.p=32>s?32:s,C.T=null,s=Jc,Jc=null;var f=Ja,v=ka;if(Lt=0,nn=Ja=null,ka=0,(Qe&6)!==0)throw Error(o(331));var k=Qe;if(Qe|=4,sp(f.current),tp(f,f.current,v,s),Qe=k,ll(0,!1),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(Jt,f)}catch{}return!0}finally{I.p=u,C.T=i,Sp(e,t)}}function Np(e,t,s){t=Or(s,t),t=Ec(e.stateNode,t,2),e=Ga(e,t,2),e!==null&&(Ve(e,2),Wr(e))}function et(e,t,s){if(e.tag===3)Np(e,e,s);else for(;t!==null;){if(t.tag===3){Np(t,e,s);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Ya===null||!Ya.has(i))){e=Or(s,e),s=Cf(2),i=Ga(t,s,2),i!==null&&(kf(s,i,t,e),Ve(i,2),Wr(i));break}}t=t.return}}function Wc(e,t,s){var i=e.pingCache;if(i===null){i=e.pingCache=new Wx;var u=new Set;i.set(t,u)}else u=i.get(t),u===void 0&&(u=new Set,i.set(t,u));u.has(s)||(Fc=!0,u.add(s),e=sy.bind(null,e,t,s),t.then(e,e))}function sy(e,t,s){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,ot===e&&(Ie&s)===s&&(vt===4||vt===3&&(Ie&62914560)===Ie&&300>tt()-wi?(Qe&2)===0&&ln(e,0):Vc|=s,sn===Ie&&(sn=0)),Wr(e)}function Cp(e,t){t===0&&(t=oa()),e=gs(e,t),e!==null&&(Ve(e,t),Wr(e))}function ny(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),Cp(e,s)}function ly(e,t){var s=0;switch(e.tag){case 31:case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(s=u.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(o(314))}i!==null&&i.delete(t),Cp(e,s)}function iy(e,t){return Ut(e,t)}var Ei=null,cn=null,eu=!1,Ti=!1,tu=!1,Xa=0;function Wr(e){e!==cn&&e.next===null&&(cn===null?Ei=cn=e:cn=cn.next=e),Ti=!0,eu||(eu=!0,cy())}function ll(e,t){if(!tu&&Ti){tu=!0;do for(var s=!1,i=Ei;i!==null;){if(e!==0){var u=i.pendingLanes;if(u===0)var f=0;else{var v=i.suspendedLanes,k=i.pingedLanes;f=(1<<31-xt(42|e)+1)-1,f&=u&~(v&~k),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(s=!0,Tp(i,f))}else f=Ie,f=qe(i,i===ot?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||jt(i,f)||(s=!0,Tp(i,f));i=i.next}while(s);tu=!1}}function oy(){kp()}function kp(){Ti=eu=!1;var e=0;Xa!==0&&by()&&(e=Xa);for(var t=tt(),s=null,i=Ei;i!==null;){var u=i.next,f=Ap(i,t);f===0?(i.next=null,s===null?Ei=u:s.next=u,u===null&&(cn=s)):(s=i,(e!==0||(f&3)!==0)&&(Ti=!0)),i=u}Lt!==0&&Lt!==5||ll(e),Xa!==0&&(Xa=0)}function Ap(e,t){for(var s=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var v=31-xt(f),k=1<<v,_=u[v];_===-1?((k&s)===0||(k&i)!==0)&&(u[v]=Vr(k,t)):_<=t&&(e.expiredLanes|=k),f&=~k}if(t=ot,s=Ie,s=qe(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,s===0||e===t&&(We===2||We===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Yt(i),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||jt(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(i!==null&&Yt(i),Yr(s)){case 2:case 8:s=ze;break;case 32:s=St;break;case 268435456:s=nt;break;default:s=St}return i=Ep.bind(null,e),s=Ut(s,i),e.callbackPriority=t,e.callbackNode=s,t}return i!==null&&i!==null&&Yt(i),e.callbackPriority=2,e.callbackNode=null,2}function Ep(e,t){if(Lt!==0&&Lt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(Ai()&&e.callbackNode!==s)return null;var i=Ie;return i=qe(e,e===ot?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(cp(e,i,t),Ap(e,tt()),e.callbackNode!=null&&e.callbackNode===s?Ep.bind(null,e):null)}function Tp(e,t){if(Ai())return null;cp(e,t,!0)}function cy(){wy(function(){(Qe&6)!==0?Ut(ir,oy):kp()})}function ru(){if(Xa===0){var e=$s;e===0&&(e=hr,hr<<=1,(hr&261888)===0&&(hr=256)),Xa=e}return Xa}function Rp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ul(""+e)}function Op(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function uy(e,t,s,i,u){if(t==="submit"&&s&&s.stateNode===u){var f=Rp((u[Mt]||null).action),v=i.submitter;v&&(t=(t=v[Mt]||null)?Rp(t.formAction):v.getAttribute("formAction"),t!==null&&(f=t,v=null));var k=new Hl("action","action",null,i,u);e.push({event:k,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Xa!==0){var _=v?Op(u,v):new FormData(u);Sc(s,{pending:!0,data:_,method:u.method,action:f},null,_)}}else typeof f=="function"&&(k.preventDefault(),_=v?Op(u,v):new FormData(u),Sc(s,{pending:!0,data:_,method:u.method,action:f},f,_))},currentTarget:u}]})}}for(var au=0;au<Bo.length;au++){var su=Bo[au],dy=su.toLowerCase(),my=su[0].toUpperCase()+su.slice(1);Hr(dy,"on"+my)}Hr(im,"onAnimationEnd"),Hr(om,"onAnimationIteration"),Hr(cm,"onAnimationStart"),Hr("dblclick","onDoubleClick"),Hr("focusin","onFocus"),Hr("focusout","onBlur"),Hr(Ex,"onTransitionRun"),Hr(Tx,"onTransitionStart"),Hr(Rx,"onTransitionCancel"),Hr(um,"onTransitionEnd"),Ms("onMouseEnter",["mouseout","mouseover"]),Ms("onMouseLeave",["mouseout","mouseover"]),Ms("onPointerEnter",["pointerout","pointerover"]),Ms("onPointerLeave",["pointerout","pointerover"]),ms("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ms("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ms("onBeforeInput",["compositionend","keypress","textInput","paste"]),ms("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ms("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ms("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var il="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),fy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(il));function zp(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var i=e[s],u=i.event;i=i.listeners;e:{var f=void 0;if(t)for(var v=i.length-1;0<=v;v--){var k=i[v],_=k.instance,te=k.currentTarget;if(k=k.listener,_!==f&&u.isPropagationStopped())break e;f=k,u.currentTarget=te;try{f(u)}catch(ce){ql(ce)}u.currentTarget=null,f=_}else for(v=0;v<i.length;v++){if(k=i[v],_=k.instance,te=k.currentTarget,k=k.listener,_!==f&&u.isPropagationStopped())break e;f=k,u.currentTarget=te;try{f(u)}catch(ce){ql(ce)}u.currentTarget=null,f=_}}}}function Be(e,t){var s=t[we];s===void 0&&(s=t[we]=new Set);var i=e+"__bubble";s.has(i)||(Mp(t,e,2,!1),s.add(i))}function nu(e,t,s){var i=0;t&&(i|=4),Mp(s,e,i,t)}var Ri="_reactListening"+Math.random().toString(36).slice(2);function lu(e){if(!e[Ri]){e[Ri]=!0,Cd.forEach(function(s){s!=="selectionchange"&&(fy.has(s)||nu(s,!1,e),nu(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ri]||(t[Ri]=!0,nu("selectionchange",!1,t))}}function Mp(e,t,s,i){switch(oh(t)){case 2:var u=Hy;break;case 8:u=Gy;break;default:u=wu}s=u.bind(null,t,s,e),u=void 0,!ko||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),i?u!==void 0?e.addEventListener(t,s,{capture:!0,passive:u}):e.addEventListener(t,s,!0):u!==void 0?e.addEventListener(t,s,{passive:u}):e.addEventListener(t,s,!1)}function iu(e,t,s,i,u){var f=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var v=i.tag;if(v===3||v===4){var k=i.stateNode.containerInfo;if(k===u)break;if(v===4)for(v=i.return;v!==null;){var _=v.tag;if((_===3||_===4)&&v.stateNode.containerInfo===u)return;v=v.return}for(;k!==null;){if(v=xr(k),v===null)return;if(_=v.tag,_===5||_===6||_===26||_===27){i=f=v;continue e}k=k.parentNode}}i=i.return}Ud(function(){var te=f,ce=No(s),me=[];e:{var ae=dm.get(e);if(ae!==void 0){var ne=Hl,Se=e;switch(e){case"keypress":if(Bl(s)===0)break e;case"keydown":case"keyup":ne=lx;break;case"focusin":Se="focus",ne=Ro;break;case"focusout":Se="blur",ne=Ro;break;case"beforeblur":case"afterblur":ne=Ro;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=Id;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=Y0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=cx;break;case im:case om:case cm:ne=X0;break;case um:ne=dx;break;case"scroll":case"scrollend":ne=V0;break;case"wheel":ne=fx;break;case"copy":case"cut":case"paste":ne=W0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=Gd;break;case"toggle":case"beforetoggle":ne=hx}var Te=(t&4)!==0,st=!Te&&(e==="scroll"||e==="scrollend"),J=Te?ae!==null?ae+"Capture":null:ae;Te=[];for(var F=te,ee;F!==null;){var de=F;if(ee=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||ee===null||J===null||(de=Tn(F,J),de!=null&&Te.push(ol(F,de,ee))),st)break;F=F.return}0<Te.length&&(ae=new ne(ae,Se,null,s,ce),me.push({event:ae,listeners:Te}))}}if((t&7)===0){e:{if(ae=e==="mouseover"||e==="pointerover",ne=e==="mouseout"||e==="pointerout",ae&&s!==jo&&(Se=s.relatedTarget||s.fromElement)&&(xr(Se)||Se[Zt]))break e;if((ne||ae)&&(ae=ce.window===ce?ce:(ae=ce.ownerDocument)?ae.defaultView||ae.parentWindow:window,ne?(Se=s.relatedTarget||s.toElement,ne=te,Se=Se?xr(Se):null,Se!==null&&(st=d(Se),Te=Se.tag,Se!==st||Te!==5&&Te!==27&&Te!==6)&&(Se=null)):(ne=null,Se=te),ne!==Se)){if(Te=Id,de="onMouseLeave",J="onMouseEnter",F="mouse",(e==="pointerout"||e==="pointerover")&&(Te=Gd,de="onPointerLeave",J="onPointerEnter",F="pointer"),st=ne==null?ae:Nt(ne),ee=Se==null?ae:Nt(Se),ae=new Te(de,F+"leave",ne,s,ce),ae.target=st,ae.relatedTarget=ee,de=null,xr(ce)===te&&(Te=new Te(J,F+"enter",Se,s,ce),Te.target=ee,Te.relatedTarget=st,de=Te),st=de,ne&&Se)t:{for(Te=py,J=ne,F=Se,ee=0,de=J;de;de=Te(de))ee++;de=0;for(var Ee=F;Ee;Ee=Te(Ee))de++;for(;0<ee-de;)J=Te(J),ee--;for(;0<de-ee;)F=Te(F),de--;for(;ee--;){if(J===F||F!==null&&J===F.alternate){Te=J;break t}J=Te(J),F=Te(F)}Te=null}else Te=null;ne!==null&&Lp(me,ae,ne,Te,!1),Se!==null&&st!==null&&Lp(me,st,Se,Te,!0)}}e:{if(ae=te?Nt(te):window,ne=ae.nodeName&&ae.nodeName.toLowerCase(),ne==="select"||ne==="input"&&ae.type==="file")var Ye=Qd;else if(Yd(ae))if(Xd)Ye=Cx;else{Ye=jx;var Ae=Sx}else ne=ae.nodeName,!ne||ne.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?te&&So(te.elementType)&&(Ye=Qd):Ye=Nx;if(Ye&&(Ye=Ye(e,te))){Jd(me,Ye,s,ce);break e}Ae&&Ae(e,ae,te),e==="focusout"&&te&&ae.type==="number"&&te.memoizedProps.value!=null&&wo(ae,"number",ae.value)}switch(Ae=te?Nt(te):window,e){case"focusin":(Yd(Ae)||Ae.contentEditable==="true")&&(Bs=Ae,Po=te,Un=null);break;case"focusout":Un=Po=Bs=null;break;case"mousedown":Uo=!0;break;case"contextmenu":case"mouseup":case"dragend":Uo=!1,nm(me,s,ce);break;case"selectionchange":if(Ax)break;case"keydown":case"keyup":nm(me,s,ce)}var De;if(zo)e:{switch(e){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else _s?Vd(e,s)&&(He="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(He="onCompositionStart");He&&(Kd&&s.locale!=="ko"&&(_s||He!=="onCompositionStart"?He==="onCompositionEnd"&&_s&&(De=_d()):(Da=ce,Ao="value"in Da?Da.value:Da.textContent,_s=!0)),Ae=Oi(te,He),0<Ae.length&&(He=new Hd(He,e,null,s,ce),me.push({event:He,listeners:Ae}),De?He.data=De:(De=$d(s),De!==null&&(He.data=De)))),(De=xx?yx(e,s):bx(e,s))&&(He=Oi(te,"onBeforeInput"),0<He.length&&(Ae=new Hd("onBeforeInput","beforeinput",null,s,ce),me.push({event:Ae,listeners:He}),Ae.data=De)),uy(me,e,te,s,ce)}zp(me,t)})}function ol(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Oi(e,t){for(var s=t+"Capture",i=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=Tn(e,s),u!=null&&i.unshift(ol(e,u,f)),u=Tn(e,t),u!=null&&i.push(ol(e,u,f))),e.tag===3)return i;e=e.return}return[]}function py(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Lp(e,t,s,i,u){for(var f=t._reactName,v=[];s!==null&&s!==i;){var k=s,_=k.alternate,te=k.stateNode;if(k=k.tag,_!==null&&_===i)break;k!==5&&k!==26&&k!==27||te===null||(_=te,u?(te=Tn(s,f),te!=null&&v.unshift(ol(s,te,_))):u||(te=Tn(s,f),te!=null&&v.push(ol(s,te,_)))),s=s.return}v.length!==0&&e.push({event:t,listeners:v})}var hy=/\r\n?/g,gy=/\u0000|\uFFFD/g;function Dp(e){return(typeof e=="string"?e:""+e).replace(hy,`
49
+ `).replace(gy,"")}function Pp(e,t){return t=Dp(t),Dp(e)===t}function at(e,t,s,i,u,f){switch(s){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Ds(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Ds(e,""+i);break;case"className":Dl(e,"class",i);break;case"tabIndex":Dl(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Dl(e,s,i);break;case"style":Dd(e,i,f);break;case"data":if(t!=="object"){Dl(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=Ul(""+i),e.setAttribute(s,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(s,"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"&&(s==="formAction"?(t!=="input"&&at(e,t,"name",u.name,u,null),at(e,t,"formEncType",u.formEncType,u,null),at(e,t,"formMethod",u.formMethod,u,null),at(e,t,"formTarget",u.formTarget,u,null)):(at(e,t,"encType",u.encType,u,null),at(e,t,"method",u.method,u,null),at(e,t,"target",u.target,u,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=Ul(""+i),e.setAttribute(s,i);break;case"onClick":i!=null&&(e.onclick=da);break;case"onScroll":i!=null&&Be("scroll",e);break;case"onScrollEnd":i!=null&&Be("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(s=i.__html,s!=null){if(u.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}s=Ul(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""+i):e.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":i===!0?e.setAttribute(s,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,i):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(s,i):e.removeAttribute(s);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(s):e.setAttribute(s,i);break;case"popover":Be("beforetoggle",e),Be("toggle",e),Ll(e,"popover",i);break;case"xlinkActuate":ua(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":ua(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":ua(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":ua(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":ua(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":ua(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":ua(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":ua(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":ua(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Ll(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=q0.get(s)||s,Ll(e,s,i))}}function ou(e,t,s,i,u,f){switch(s){case"style":Dd(e,i,f);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(s=i.__html,s!=null){if(u.children!=null)throw Error(o(60));e.innerHTML=s}}break;case"children":typeof i=="string"?Ds(e,i):(typeof i=="number"||typeof i=="bigint")&&Ds(e,""+i);break;case"onScroll":i!=null&&Be("scroll",e);break;case"onScrollEnd":i!=null&&Be("scrollend",e);break;case"onClick":i!=null&&(e.onclick=da);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!kd.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(u=s.endsWith("Capture"),t=s.slice(2,u?s.length-7:void 0),f=e[Mt]||null,f=f!=null?f[s]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof i=="function")){typeof f!="function"&&f!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,i,u);break e}s in e?e[s]=i:i===!0?e.setAttribute(s,""):Ll(e,s,i)}}}function qt(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",e),Be("load",e);var i=!1,u=!1,f;for(f in s)if(s.hasOwnProperty(f)){var v=s[f];if(v!=null)switch(f){case"src":i=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:at(e,t,f,v,s,null)}}u&&at(e,t,"srcSet",s.srcSet,s,null),i&&at(e,t,"src",s.src,s,null);return;case"input":Be("invalid",e);var k=f=v=u=null,_=null,te=null;for(i in s)if(s.hasOwnProperty(i)){var ce=s[i];if(ce!=null)switch(i){case"name":u=ce;break;case"type":v=ce;break;case"checked":_=ce;break;case"defaultChecked":te=ce;break;case"value":f=ce;break;case"defaultValue":k=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(o(137,t));break;default:at(e,t,i,ce,s,null)}}Od(e,f,k,_,te,v,u,!1);return;case"select":Be("invalid",e),i=v=f=null;for(u in s)if(s.hasOwnProperty(u)&&(k=s[u],k!=null))switch(u){case"value":f=k;break;case"defaultValue":v=k;break;case"multiple":i=k;default:at(e,t,u,k,s,null)}t=f,s=v,e.multiple=!!i,t!=null?Ls(e,!!i,t,!1):s!=null&&Ls(e,!!i,s,!0);return;case"textarea":Be("invalid",e),f=u=i=null;for(v in s)if(s.hasOwnProperty(v)&&(k=s[v],k!=null))switch(v){case"value":i=k;break;case"defaultValue":u=k;break;case"children":f=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(o(91));break;default:at(e,t,v,k,s,null)}Md(e,i,u,f);return;case"option":for(_ in s)if(s.hasOwnProperty(_)&&(i=s[_],i!=null))switch(_){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:at(e,t,_,i,s,null)}return;case"dialog":Be("beforetoggle",e),Be("toggle",e),Be("cancel",e),Be("close",e);break;case"iframe":case"object":Be("load",e);break;case"video":case"audio":for(i=0;i<il.length;i++)Be(il[i],e);break;case"image":Be("error",e),Be("load",e);break;case"details":Be("toggle",e);break;case"embed":case"source":case"link":Be("error",e),Be("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(te in s)if(s.hasOwnProperty(te)&&(i=s[te],i!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:at(e,t,te,i,s,null)}return;default:if(So(t)){for(ce in s)s.hasOwnProperty(ce)&&(i=s[ce],i!==void 0&&ou(e,t,ce,i,s,void 0));return}}for(k in s)s.hasOwnProperty(k)&&(i=s[k],i!=null&&at(e,t,k,i,s,null))}function xy(e,t,s,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,f=null,v=null,k=null,_=null,te=null,ce=null;for(ne in s){var me=s[ne];if(s.hasOwnProperty(ne)&&me!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":_=me;default:i.hasOwnProperty(ne)||at(e,t,ne,null,i,me)}}for(var ae in i){var ne=i[ae];if(me=s[ae],i.hasOwnProperty(ae)&&(ne!=null||me!=null))switch(ae){case"type":f=ne;break;case"name":u=ne;break;case"checked":te=ne;break;case"defaultChecked":ce=ne;break;case"value":v=ne;break;case"defaultValue":k=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(o(137,t));break;default:ne!==me&&at(e,t,ae,ne,i,me)}}vo(e,v,k,_,te,ce,f,u);return;case"select":ne=v=k=ae=null;for(f in s)if(_=s[f],s.hasOwnProperty(f)&&_!=null)switch(f){case"value":break;case"multiple":ne=_;default:i.hasOwnProperty(f)||at(e,t,f,null,i,_)}for(u in i)if(f=i[u],_=s[u],i.hasOwnProperty(u)&&(f!=null||_!=null))switch(u){case"value":ae=f;break;case"defaultValue":k=f;break;case"multiple":v=f;default:f!==_&&at(e,t,u,f,i,_)}t=k,s=v,i=ne,ae!=null?Ls(e,!!s,ae,!1):!!i!=!!s&&(t!=null?Ls(e,!!s,t,!0):Ls(e,!!s,s?[]:"",!1));return;case"textarea":ne=ae=null;for(k in s)if(u=s[k],s.hasOwnProperty(k)&&u!=null&&!i.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:at(e,t,k,null,i,u)}for(v in i)if(u=i[v],f=s[v],i.hasOwnProperty(v)&&(u!=null||f!=null))switch(v){case"value":ae=u;break;case"defaultValue":ne=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(o(91));break;default:u!==f&&at(e,t,v,u,i,f)}zd(e,ae,ne);return;case"option":for(var Se in s)if(ae=s[Se],s.hasOwnProperty(Se)&&ae!=null&&!i.hasOwnProperty(Se))switch(Se){case"selected":e.selected=!1;break;default:at(e,t,Se,null,i,ae)}for(_ in i)if(ae=i[_],ne=s[_],i.hasOwnProperty(_)&&ae!==ne&&(ae!=null||ne!=null))switch(_){case"selected":e.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:at(e,t,_,ae,i,ne)}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 Te in s)ae=s[Te],s.hasOwnProperty(Te)&&ae!=null&&!i.hasOwnProperty(Te)&&at(e,t,Te,null,i,ae);for(te in i)if(ae=i[te],ne=s[te],i.hasOwnProperty(te)&&ae!==ne&&(ae!=null||ne!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(o(137,t));break;default:at(e,t,te,ae,i,ne)}return;default:if(So(t)){for(var st in s)ae=s[st],s.hasOwnProperty(st)&&ae!==void 0&&!i.hasOwnProperty(st)&&ou(e,t,st,void 0,i,ae);for(ce in i)ae=i[ce],ne=s[ce],!i.hasOwnProperty(ce)||ae===ne||ae===void 0&&ne===void 0||ou(e,t,ce,ae,i,ne);return}}for(var J in s)ae=s[J],s.hasOwnProperty(J)&&ae!=null&&!i.hasOwnProperty(J)&&at(e,t,J,null,i,ae);for(me in i)ae=i[me],ne=s[me],!i.hasOwnProperty(me)||ae===ne||ae==null&&ne==null||at(e,t,me,ae,i,ne)}function Up(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function yy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),i=0;i<s.length;i++){var u=s[i],f=u.transferSize,v=u.initiatorType,k=u.duration;if(f&&k&&Up(v)){for(v=0,k=u.responseEnd,i+=1;i<s.length;i++){var _=s[i],te=_.startTime;if(te>k)break;var ce=_.transferSize,me=_.initiatorType;ce&&Up(me)&&(_=_.responseEnd,v+=ce*(_<k?1:(k-te)/(_-te)))}if(--i,t+=8*(f+v)/(u.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 cu=null,uu=null;function zi(e){return e.nodeType===9?e:e.ownerDocument}function _p(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 Bp(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 du(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 mu=null;function by(){var e=window.event;return e&&e.type==="popstate"?e===mu?!1:(mu=e,!0):(mu=null,!1)}var Ip=typeof setTimeout=="function"?setTimeout:void 0,vy=typeof clearTimeout=="function"?clearTimeout:void 0,Hp=typeof Promise=="function"?Promise:void 0,wy=typeof queueMicrotask=="function"?queueMicrotask:typeof Hp<"u"?function(e){return Hp.resolve(null).then(e).catch(Sy)}:Ip;function Sy(e){setTimeout(function(){throw e})}function Za(e){return e==="head"}function Gp(e,t){var s=t,i=0;do{var u=s.nextSibling;if(e.removeChild(s),u&&u.nodeType===8)if(s=u.data,s==="/$"||s==="/&"){if(i===0){e.removeChild(u),fn(t);return}i--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")i++;else if(s==="html")cl(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,cl(s);for(var f=s.firstChild;f;){var v=f.nextSibling,k=f.nodeName;f[ct]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&f.rel.toLowerCase()==="stylesheet"||s.removeChild(f),f=v}}else s==="body"&&cl(e.ownerDocument.body);s=u}while(s);fn(t)}function Kp(e,t){var s=e;e=0;do{var i=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),i&&i.nodeType===8)if(s=i.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=i}while(s)}function fu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":fu(s),Jr(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function jy(e,t,s,i){for(;e.nodeType===1;){var u=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[ct])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!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=Pr(e.nextSibling),e===null)break}return null}function Ny(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Pr(e.nextSibling),e===null))return null;return e}function qp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Pr(e.nextSibling),e===null))return null;return e}function pu(e){return e.data==="$?"||e.data==="$~"}function hu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Cy(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var i=function(){t(),s.removeEventListener("DOMContentLoaded",i)};s.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function Pr(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 gu=null;function Fp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return Pr(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function Vp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function $p(e,t,s){switch(t=zi(s),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function cl(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Jr(e)}var Ur=new Map,Yp=new Set;function Mi(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Aa=I.d;I.d={f:ky,r:Ay,D:Ey,C:Ty,L:Ry,m:Oy,X:My,S:zy,M:Ly};function ky(){var e=Aa.f(),t=Ni();return e||t}function Ay(e){var t=yr(e);t!==null&&t.tag===5&&t.type==="form"?df(t):Aa.r(e)}var un=typeof document>"u"?null:document;function Jp(e,t,s){var i=un;if(i&&typeof t=="string"&&t){var u=Tr(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),Yp.has(u)||(Yp.add(u),e={rel:e,crossOrigin:s,href:t},i.querySelector(u)===null&&(t=i.createElement("link"),qt(t,"link",e),yt(t),i.head.appendChild(t)))}}function Ey(e){Aa.D(e),Jp("dns-prefetch",e,null)}function Ty(e,t){Aa.C(e,t),Jp("preconnect",e,t)}function Ry(e,t,s){Aa.L(e,t,s);var i=un;if(i&&e&&t){var u='link[rel="preload"][as="'+Tr(t)+'"]';t==="image"&&s&&s.imageSrcSet?(u+='[imagesrcset="'+Tr(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(u+='[imagesizes="'+Tr(s.imageSizes)+'"]')):u+='[href="'+Tr(e)+'"]';var f=u;switch(t){case"style":f=dn(e);break;case"script":f=mn(e)}Ur.has(f)||(e=x({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Ur.set(f,e),i.querySelector(u)!==null||t==="style"&&i.querySelector(ul(f))||t==="script"&&i.querySelector(dl(f))||(t=i.createElement("link"),qt(t,"link",e),yt(t),i.head.appendChild(t)))}}function Oy(e,t){Aa.m(e,t);var s=un;if(s&&e){var i=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Tr(i)+'"][href="'+Tr(e)+'"]',f=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=mn(e)}if(!Ur.has(f)&&(e=x({rel:"modulepreload",href:e},t),Ur.set(f,e),s.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(dl(f)))return}i=s.createElement("link"),qt(i,"link",e),yt(i),s.head.appendChild(i)}}}function zy(e,t,s){Aa.S(e,t,s);var i=un;if(i&&e){var u=ca(i).hoistableStyles,f=dn(e);t=t||"default";var v=u.get(f);if(!v){var k={loading:0,preload:null};if(v=i.querySelector(ul(f)))k.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Ur.get(f))&&xu(e,s);var _=v=i.createElement("link");yt(_),qt(_,"link",e),_._p=new Promise(function(te,ce){_.onload=te,_.onerror=ce}),_.addEventListener("load",function(){k.loading|=1}),_.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Li(v,t,i)}v={type:"stylesheet",instance:v,count:1,state:k},u.set(f,v)}}}function My(e,t){Aa.X(e,t);var s=un;if(s&&e){var i=ca(s).hoistableScripts,u=mn(e),f=i.get(u);f||(f=s.querySelector(dl(u)),f||(e=x({src:e,async:!0},t),(t=Ur.get(u))&&yu(e,t),f=s.createElement("script"),yt(f),qt(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function Ly(e,t){Aa.M(e,t);var s=un;if(s&&e){var i=ca(s).hoistableScripts,u=mn(e),f=i.get(u);f||(f=s.querySelector(dl(u)),f||(e=x({src:e,async:!0,type:"module"},t),(t=Ur.get(u))&&yu(e,t),f=s.createElement("script"),yt(f),qt(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function Qp(e,t,s,i){var u=(u=se.current)?Mi(u):null;if(!u)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=dn(s.href),s=ca(u).hoistableStyles,i=s.get(t),i||(i={type:"style",instance:null,count:0,state:null},s.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=dn(s.href);var f=ca(u).hoistableStyles,v=f.get(e);if(v||(u=u.ownerDocument||u,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,v),(f=u.querySelector(ul(e)))&&!f._p&&(v.instance=f,v.state.loading=5),Ur.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Ur.set(e,s),f||Dy(u,e,s,v.state))),t&&i===null)throw Error(o(528,""));return v}if(t&&i!==null)throw Error(o(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=mn(s),s=ca(u).hoistableScripts,i=s.get(t),i||(i={type:"script",instance:null,count:0,state:null},s.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function dn(e){return'href="'+Tr(e)+'"'}function ul(e){return'link[rel="stylesheet"]['+e+"]"}function Xp(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function Dy(e,t,s,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),qt(t,"link",s),yt(t),e.head.appendChild(t))}function mn(e){return'[src="'+Tr(e)+'"]'}function dl(e){return"script[async]"+e}function Zp(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Tr(s.href)+'"]');if(i)return t.instance=i,yt(i),i;var u=x({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),yt(i),qt(i,"style",u),Li(i,s.precedence,e),t.instance=i;case"stylesheet":u=dn(s.href);var f=e.querySelector(ul(u));if(f)return t.state.loading|=4,t.instance=f,yt(f),f;i=Xp(s),(u=Ur.get(u))&&xu(i,u),f=(e.ownerDocument||e).createElement("link"),yt(f);var v=f;return v._p=new Promise(function(k,_){v.onload=k,v.onerror=_}),qt(f,"link",i),t.state.loading|=4,Li(f,s.precedence,e),t.instance=f;case"script":return f=mn(s.src),(u=e.querySelector(dl(f)))?(t.instance=u,yt(u),u):(i=s,(u=Ur.get(f))&&(i=x({},s),yu(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),yt(u),qt(u,"link",i),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Li(i,s.precedence,e));return t.instance}function Li(e,t,s){for(var i=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=i.length?i[i.length-1]:null,f=u,v=0;v<i.length;v++){var k=i[v];if(k.dataset.precedence===t)f=k;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function xu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function yu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Di=null;function Wp(e,t,s){if(Di===null){var i=new Map,u=Di=new Map;u.set(s,i)}else u=Di,i=u.get(s),i||(i=new Map,u.set(s,i));if(i.has(e))return i;for(i.set(e,null),s=s.getElementsByTagName(e),u=0;u<s.length;u++){var f=s[u];if(!(f[ct]||f[$e]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var v=f.getAttribute(t)||"";v=e+v;var k=i.get(v);k?k.push(f):i.set(v,[f])}}return i}function eh(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function Py(e,t,s){if(s===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 th(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Uy(e,t,s,i){if(s.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var u=dn(i.href),f=t.querySelector(ul(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Pi.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=f,yt(f);return}f=t.ownerDocument||t,i=Xp(i),(u=Ur.get(u))&&xu(i,u),f=f.createElement("link"),yt(f);var v=f;v._p=new Promise(function(k,_){v.onload=k,v.onerror=_}),qt(f,"link",i),s.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Pi.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var bu=0;function _y(e,t){return e.stylesheets&&e.count===0&&_i(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var i=setTimeout(function(){if(e.stylesheets&&_i(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&bu===0&&(bu=62500*yy());var u=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>bu?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function Pi(){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 Ui=null;function _i(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ui=new Map,t.forEach(By,e),Ui=null,Pi.call(e))}function By(e,t){if(!(t.state.loading&4)){var s=Ui.get(e);if(s)var i=s.get(null);else{s=new Map,Ui.set(e,s);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var v=u[f];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(s.set(v.dataset.precedence,v),i=v)}i&&s.set(null,i)}u=t.instance,v=u.getAttribute("data-precedence"),f=s.get(v)||i,f===i&&s.set(null,u),s.set(v,u),this.count++,i=Pi.bind(this),u.addEventListener("load",i),u.addEventListener("error",i),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var ml={$$typeof:S,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function Iy(e,t,s,i,u,f,v,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=$r(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$r(0),this.hiddenUpdates=$r(null),this.identifierPrefix=i,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=_,this.incompleteTransitions=new Map}function rh(e,t,s,i,u,f,v,k,_,te,ce,me){return e=new Iy(e,t,s,v,_,te,ce,me,k),t=1,f===!0&&(t|=24),f=vr(3,null,null,t),e.current=f,f.stateNode=e,t=Zo(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:i,isDehydrated:s,cache:t},rc(f),e}function ah(e){return e?(e=Gs,e):Gs}function sh(e,t,s,i,u,f){u=ah(u),i.context===null?i.context=u:i.pendingContext=u,i=Ha(t),i.payload={element:s},f=f===void 0?null:f,f!==null&&(i.callback=f),s=Ga(e,i,t),s!==null&&(fr(s,e,t),qn(s,e,t))}function nh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function vu(e,t){nh(e,t),(e=e.alternate)&&nh(e,t)}function lh(e){if(e.tag===13||e.tag===31){var t=gs(e,67108864);t!==null&&fr(t,e,67108864),vu(e,67108864)}}function ih(e){if(e.tag===13||e.tag===31){var t=Cr();t=nr(t);var s=gs(e,t);s!==null&&fr(s,e,t),vu(e,t)}}var Bi=!0;function Hy(e,t,s,i){var u=C.T;C.T=null;var f=I.p;try{I.p=2,wu(e,t,s,i)}finally{I.p=f,C.T=u}}function Gy(e,t,s,i){var u=C.T;C.T=null;var f=I.p;try{I.p=8,wu(e,t,s,i)}finally{I.p=f,C.T=u}}function wu(e,t,s,i){if(Bi){var u=Su(i);if(u===null)iu(e,t,i,Ii,s),ch(e,i);else if(qy(u,e,t,s,i))i.stopPropagation();else if(ch(e,i),t&4&&-1<Ky.indexOf(e)){for(;u!==null;){var f=yr(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var v=ve(f.pendingLanes);if(v!==0){var k=f;for(k.pendingLanes|=2,k.entangledLanes|=2;v;){var _=1<<31-xt(v);k.entanglements[1]|=_,v&=~_}Wr(f),(Qe&6)===0&&(Si=tt()+500,ll(0))}}break;case 31:case 13:k=gs(f,2),k!==null&&fr(k,f,2),Ni(),vu(f,2)}if(f=Su(i),f===null&&iu(e,t,i,Ii,s),f===u)break;u=f}u!==null&&i.stopPropagation()}else iu(e,t,i,null,s)}}function Su(e){return e=No(e),ju(e)}var Ii=null;function ju(e){if(Ii=null,e=xr(e),e!==null){var t=d(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=m(t),e!==null)return e;e=null}else if(s===31){if(e=p(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Ii=e,null}function oh(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(wt()){case ir:return 2;case ze:return 8;case St:case ke:return 32;case nt:return 268435456;default:return 32}default:return 32}}var Nu=!1,Wa=null,es=null,ts=null,fl=new Map,pl=new Map,rs=[],Ky="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 ch(e,t){switch(e){case"focusin":case"focusout":Wa=null;break;case"dragenter":case"dragleave":es=null;break;case"mouseover":case"mouseout":ts=null;break;case"pointerover":case"pointerout":fl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":pl.delete(t.pointerId)}}function hl(e,t,s,i,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:s,eventSystemFlags:i,nativeEvent:f,targetContainers:[u]},t!==null&&(t=yr(t),t!==null&&lh(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function qy(e,t,s,i,u){switch(t){case"focusin":return Wa=hl(Wa,e,t,s,i,u),!0;case"dragenter":return es=hl(es,e,t,s,i,u),!0;case"mouseover":return ts=hl(ts,e,t,s,i,u),!0;case"pointerover":var f=u.pointerId;return fl.set(f,hl(fl.get(f)||null,e,t,s,i,u)),!0;case"gotpointercapture":return f=u.pointerId,pl.set(f,hl(pl.get(f)||null,e,t,s,i,u)),!0}return!1}function uh(e){var t=xr(e.target);if(t!==null){var s=d(t);if(s!==null){if(t=s.tag,t===13){if(t=m(s),t!==null){e.blockedOn=t,Qt(e.priority,function(){ih(s)});return}}else if(t===31){if(t=p(s),t!==null){e.blockedOn=t,Qt(e.priority,function(){ih(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Hi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Su(e.nativeEvent);if(s===null){s=e.nativeEvent;var i=new s.constructor(s.type,s);jo=i,s.target.dispatchEvent(i),jo=null}else return t=yr(s),t!==null&&lh(t),e.blockedOn=s,!1;t.shift()}return!0}function dh(e,t,s){Hi(e)&&s.delete(t)}function Fy(){Nu=!1,Wa!==null&&Hi(Wa)&&(Wa=null),es!==null&&Hi(es)&&(es=null),ts!==null&&Hi(ts)&&(ts=null),fl.forEach(dh),pl.forEach(dh)}function Gi(e,t){e.blockedOn===t&&(e.blockedOn=null,Nu||(Nu=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Fy)))}var Ki=null;function mh(e){Ki!==e&&(Ki=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Ki===e&&(Ki=null);for(var t=0;t<e.length;t+=3){var s=e[t],i=e[t+1],u=e[t+2];if(typeof i!="function"){if(ju(i||s)===null)continue;break}var f=yr(s);f!==null&&(e.splice(t,3),t-=3,Sc(f,{pending:!0,data:u,method:s.method,action:i},i,u))}}))}function fn(e){function t(_){return Gi(_,e)}Wa!==null&&Gi(Wa,e),es!==null&&Gi(es,e),ts!==null&&Gi(ts,e),fl.forEach(t),pl.forEach(t);for(var s=0;s<rs.length;s++){var i=rs[s];i.blockedOn===e&&(i.blockedOn=null)}for(;0<rs.length&&(s=rs[0],s.blockedOn===null);)uh(s),s.blockedOn===null&&rs.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(i=0;i<s.length;i+=3){var u=s[i],f=s[i+1],v=u[Mt]||null;if(typeof f=="function")v||mh(s);else if(v){var k=null;if(f&&f.hasAttribute("formAction")){if(u=f,v=f[Mt]||null)k=v.formAction;else if(ju(u)!==null)continue}else k=v.action;typeof k=="function"?s[i+1]=k:(s.splice(i,3),i-=3),mh(s)}}}function fh(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(v){return u=v})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),i||setTimeout(s,20)}function s(){if(!i&&!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 i=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Cu(e){this._internalRoot=e}qi.prototype.render=Cu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var s=t.current,i=Cr();sh(s,i,e,t,null,null)},qi.prototype.unmount=Cu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;sh(e.current,2,null,e,null,null),Ni(),t[Zt]=null}};function qi(e){this._internalRoot=e}qi.prototype.unstable_scheduleHydration=function(e){if(e){var t=ds();e={blockedOn:null,target:e,priority:t};for(var s=0;s<rs.length&&t!==0&&t<rs[s].priority;s++);rs.splice(s,0,e),s===0&&uh(e)}};var ph=n.version;if(ph!=="19.2.1")throw Error(o(527,ph,"19.2.1"));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=h(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var Vy={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fi.isDisabled&&Fi.supportsFiber)try{Jt=Fi.inject(Vy),ft=Fi}catch{}}return xl.createRoot=function(e,t){if(!c(e))throw Error(o(299));var s=!1,i="",u=wf,f=Sf,v=jf;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(v=t.onRecoverableError)),t=rh(e,1,!1,null,null,s,i,null,u,f,v,fh),e[Zt]=t.current,lu(e),new Cu(t)},xl.hydrateRoot=function(e,t,s){if(!c(e))throw Error(o(299));var i=!1,u="",f=wf,v=Sf,k=jf,_=null;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(f=s.onUncaughtError),s.onCaughtError!==void 0&&(v=s.onCaughtError),s.onRecoverableError!==void 0&&(k=s.onRecoverableError),s.formState!==void 0&&(_=s.formState)),t=rh(e,1,!0,t,s??null,i,u,_,f,v,k,fh),t.context=ah(null),s=t.current,i=Cr(),i=nr(i),u=Ha(i),u.callback=null,Ga(s,u,i),s=i,t.current.lanes=s,Ve(t,s),Wr(t),e[Zt]=t.current,lu(e),new qi(t)},xl.version="19.2.1",xl}var Nh;function sb(){if(Nh)return Eu.exports;Nh=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(n){console.error(n)}}return a(),Eu.exports=ab(),Eu.exports}var nb=sb();const Ch=xg(nb);/**
50
+ * react-router v7.13.0
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 kh="popstate";function lb(a={}){function n(o,c){let{pathname:d,search:m,hash:p}=o.location;return $u("",{pathname:d,search:m,hash:p},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function l(o,c){return typeof c=="string"?c:Nl(c)}return ob(n,l,null,a)}function ht(a,n){if(a===!1||a===null||typeof a>"u")throw new Error(n)}function Br(a,n){if(!a){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function ib(){return Math.random().toString(36).substring(2,10)}function Ah(a,n){return{usr:a.state,key:a.key,idx:n}}function $u(a,n,l=null,o){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof n=="string"?jn(n):n,state:l,key:n&&n.key||o||ib()}}function Nl({pathname:a="/",search:n="",hash:l=""}){return n&&n!=="?"&&(a+=n.charAt(0)==="?"?n:"?"+n),l&&l!=="#"&&(a+=l.charAt(0)==="#"?l:"#"+l),a}function jn(a){let n={};if(a){let l=a.indexOf("#");l>=0&&(n.hash=a.substring(l),a=a.substring(0,l));let o=a.indexOf("?");o>=0&&(n.search=a.substring(o),a=a.substring(0,o)),a&&(n.pathname=a)}return n}function ob(a,n,l,o={}){let{window:c=document.defaultView,v5Compat:d=!1}=o,m=c.history,p="POP",g=null,h=b();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function b(){return(m.state||{idx:null}).idx}function x(){p="POP";let E=b(),A=E==null?null:E-h;h=E,g&&g({action:p,location:O.location,delta:A})}function w(E,A){p="PUSH";let N=$u(O.location,E,A);h=b()+1;let S=Ah(N,h),D=O.createHref(N);try{m.pushState(S,"",D)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;c.location.assign(D)}d&&g&&g({action:p,location:O.location,delta:1})}function T(E,A){p="REPLACE";let N=$u(O.location,E,A);h=b();let S=Ah(N,h),D=O.createHref(N);m.replaceState(S,"",D),d&&g&&g({action:p,location:O.location,delta:0})}function R(E){return cb(E)}let O={get action(){return p},get location(){return a(c,m)},listen(E){if(g)throw new Error("A history only accepts one active listener");return c.addEventListener(kh,x),g=E,()=>{c.removeEventListener(kh,x),g=null}},createHref(E){return n(c,E)},createURL:R,encodeLocation(E){let A=R(E);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:w,replace:T,go(E){return m.go(E)}};return O}function cb(a,n=!1){let l="http://localhost";typeof window<"u"&&(l=window.location.origin!=="null"?window.location.origin:window.location.href),ht(l,"No window.location.(origin|href) available to create URL");let o=typeof a=="string"?a:Nl(a);return o=o.replace(/ $/,"%20"),!n&&o.startsWith("//")&&(o=l+o),new URL(o,l)}function yg(a,n,l="/"){return ub(a,n,l,!1)}function ub(a,n,l,o){let c=typeof n=="string"?jn(n):n,d=za(c.pathname||"/",l);if(d==null)return null;let m=bg(a);db(m);let p=null;for(let g=0;p==null&&g<m.length;++g){let h=Sb(d);p=vb(m[g],h,o)}return p}function bg(a,n=[],l=[],o="",c=!1){let d=(m,p,g=c,h)=>{let b={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:p,route:m};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(o)&&g)return;ht(b.relativePath.startsWith(o),`Absolute route path "${b.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(o.length)}let x=Ra([o,b.relativePath]),w=l.concat(b);m.children&&m.children.length>0&&(ht(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),bg(m.children,n,w,x,g)),!(m.path==null&&!m.index)&&n.push({path:x,score:yb(x,m.index),routesMeta:w})};return a.forEach((m,p)=>{var g;if(m.path===""||!((g=m.path)!=null&&g.includes("?")))d(m,p);else for(let h of vg(m.path))d(m,p,!0,h)}),n}function vg(a){let n=a.split("/");if(n.length===0)return[];let[l,...o]=n,c=l.endsWith("?"),d=l.replace(/\?$/,"");if(o.length===0)return c?[d,""]:[d];let m=vg(o.join("/")),p=[];return p.push(...m.map(g=>g===""?d:[d,g].join("/"))),c&&p.push(...m),p.map(g=>a.startsWith("/")&&g===""?"/":g)}function db(a){a.sort((n,l)=>n.score!==l.score?l.score-n.score:bb(n.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}var mb=/^:[\w-]+$/,fb=3,pb=2,hb=1,gb=10,xb=-2,Eh=a=>a==="*";function yb(a,n){let l=a.split("/"),o=l.length;return l.some(Eh)&&(o+=xb),n&&(o+=pb),l.filter(c=>!Eh(c)).reduce((c,d)=>c+(mb.test(d)?fb:d===""?hb:gb),o)}function bb(a,n){return a.length===n.length&&a.slice(0,-1).every((o,c)=>o===n[c])?a[a.length-1]-n[n.length-1]:0}function vb(a,n,l=!1){let{routesMeta:o}=a,c={},d="/",m=[];for(let p=0;p<o.length;++p){let g=o[p],h=p===o.length-1,b=d==="/"?n:n.slice(d.length)||"/",x=io({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},b),w=g.route;if(!x&&h&&l&&!o[o.length-1].route.index&&(x=io({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},b)),!x)return null;Object.assign(c,x.params),m.push({params:c,pathname:Ra([d,x.pathname]),pathnameBase:kb(Ra([d,x.pathnameBase])),route:w}),x.pathnameBase!=="/"&&(d=Ra([d,x.pathnameBase]))}return m}function io(a,n){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[l,o]=wb(a.path,a.caseSensitive,a.end),c=n.match(l);if(!c)return null;let d=c[0],m=d.replace(/(.)\/+$/,"$1"),p=c.slice(1);return{params:o.reduce((h,{paramName:b,isOptional:x},w)=>{if(b==="*"){let R=p[w]||"";m=d.slice(0,d.length-R.length).replace(/(.)\/+$/,"$1")}const T=p[w];return x&&!T?h[b]=void 0:h[b]=(T||"").replace(/%2F/g,"/"),h},{}),pathname:d,pathnameBase:m,pattern:a}}function wb(a,n=!1,l=!0){Br(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 o=[],c="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,p,g)=>(o.push({paramName:p,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(o.push({paramName:"*"}),c+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":a!==""&&a!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,n?void 0:"i"),o]}function Sb(a){try{return a.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Br(!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 (${n}).`),a}}function za(a,n){if(n==="/")return a;if(!a.toLowerCase().startsWith(n.toLowerCase()))return null;let l=n.endsWith("/")?n.length-1:n.length,o=a.charAt(l);return o&&o!=="/"?null:a.slice(l)||"/"}var jb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Nb(a,n="/"){let{pathname:l,search:o="",hash:c=""}=typeof a=="string"?jn(a):a,d;return l?(l=l.replace(/\/\/+/g,"/"),l.startsWith("/")?d=Th(l.substring(1),"/"):d=Th(l,n)):d=n,{pathname:d,search:Ab(o),hash:Eb(c)}}function Th(a,n){let l=n.replace(/\/+$/,"").split("/");return a.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function zu(a,n,l,o){return`Cannot include a '${a}' character in a manually specified \`to.${n}\` field [${JSON.stringify(o)}]. Please separate it out to the \`to.${l}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Cb(a){return a.filter((n,l)=>l===0||n.route.path&&n.route.path.length>0)}function cd(a){let n=Cb(a);return n.map((l,o)=>o===n.length-1?l.pathname:l.pathnameBase)}function ud(a,n,l,o=!1){let c;typeof a=="string"?c=jn(a):(c={...a},ht(!c.pathname||!c.pathname.includes("?"),zu("?","pathname","search",c)),ht(!c.pathname||!c.pathname.includes("#"),zu("#","pathname","hash",c)),ht(!c.search||!c.search.includes("#"),zu("#","search","hash",c)));let d=a===""||c.pathname==="",m=d?"/":c.pathname,p;if(m==null)p=l;else{let x=n.length-1;if(!o&&m.startsWith("..")){let w=m.split("/");for(;w[0]==="..";)w.shift(),x-=1;c.pathname=w.join("/")}p=x>=0?n[x]:"/"}let g=Nb(c,p),h=m&&m!=="/"&&m.endsWith("/"),b=(d||m===".")&&l.endsWith("/");return!g.pathname.endsWith("/")&&(h||b)&&(g.pathname+="/"),g}var Ra=a=>a.join("/").replace(/\/\/+/g,"/"),kb=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),Ab=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,Eb=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,Tb=class{constructor(a,n,l,o=!1){this.status=a,this.statusText=n||"",this.internal=o,l instanceof Error?(this.data=l.toString(),this.error=l):this.data=l}};function Rb(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function Ob(a){return a.map(n=>n.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var wg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Sg(a,n){let l=a;if(typeof l!="string"||!jb.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let o=l,c=!1;if(wg)try{let d=new URL(window.location.href),m=l.startsWith("//")?new URL(d.protocol+l):new URL(l),p=za(m.pathname,n);m.origin===d.origin&&p!=null?l=p+m.search+m.hash:c=!0}catch{Br(!1,`<Link to="${l}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:c,to:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var jg=["POST","PUT","PATCH","DELETE"];new Set(jg);var zb=["GET",...jg];new Set(zb);var Nn=y.createContext(null);Nn.displayName="DataRouter";var po=y.createContext(null);po.displayName="DataRouterState";var Mb=y.createContext(!1),Ng=y.createContext({isTransitioning:!1});Ng.displayName="ViewTransition";var Lb=y.createContext(new Map);Lb.displayName="Fetchers";var Db=y.createContext(null);Db.displayName="Await";var Ar=y.createContext(null);Ar.displayName="Navigation";var Al=y.createContext(null);Al.displayName="Location";var Ir=y.createContext({outlet:null,matches:[],isDataRoute:!1});Ir.displayName="Route";var dd=y.createContext(null);dd.displayName="RouteError";var Cg="REACT_ROUTER_ERROR",Pb="REDIRECT",Ub="ROUTE_ERROR_RESPONSE";function _b(a){if(a.startsWith(`${Cg}:${Pb}:{`))try{let n=JSON.parse(a.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function Bb(a){if(a.startsWith(`${Cg}:${Ub}:{`))try{let n=JSON.parse(a.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new Tb(n.status,n.statusText,n.data)}catch{}}function Ib(a,{relative:n}={}){ht(Cn(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:o}=y.useContext(Ar),{hash:c,pathname:d,search:m}=El(a,{relative:n}),p=d;return l!=="/"&&(p=d==="/"?l:Ra([l,d])),o.createHref({pathname:p,search:m,hash:c})}function Cn(){return y.useContext(Al)!=null}function na(){return ht(Cn(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(Al).location}var kg="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ag(a){y.useContext(Ar).static||y.useLayoutEffect(a)}function la(){let{isDataRoute:a}=y.useContext(Ir);return a?tv():Hb()}function Hb(){ht(Cn(),"useNavigate() may be used only in the context of a <Router> component.");let a=y.useContext(Nn),{basename:n,navigator:l}=y.useContext(Ar),{matches:o}=y.useContext(Ir),{pathname:c}=na(),d=JSON.stringify(cd(o)),m=y.useRef(!1);return Ag(()=>{m.current=!0}),y.useCallback((g,h={})=>{if(Br(m.current,kg),!m.current)return;if(typeof g=="number"){l.go(g);return}let b=ud(g,JSON.parse(d),c,h.relative==="path");a==null&&n!=="/"&&(b.pathname=b.pathname==="/"?n:Ra([n,b.pathname])),(h.replace?l.replace:l.push)(b,h.state,h)},[n,l,d,c,a])}var Gb=y.createContext(null);function Kb(a){let n=y.useContext(Ir).outlet;return y.useMemo(()=>n&&y.createElement(Gb.Provider,{value:a},n),[n,a])}function Eg(){let{matches:a}=y.useContext(Ir),n=a[a.length-1];return n?n.params:{}}function El(a,{relative:n}={}){let{matches:l}=y.useContext(Ir),{pathname:o}=na(),c=JSON.stringify(cd(l));return y.useMemo(()=>ud(a,JSON.parse(c),o,n==="path"),[a,c,o,n])}function qb(a,n){return Tg(a,n)}function Tg(a,n,l,o,c){var N;ht(Cn(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=y.useContext(Ar),{matches:m}=y.useContext(Ir),p=m[m.length-1],g=p?p.params:{},h=p?p.pathname:"/",b=p?p.pathnameBase:"/",x=p&&p.route;{let S=x&&x.path||"";Og(h,!x||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${S}">) 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="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let w=na(),T;if(n){let S=typeof n=="string"?jn(n):n;ht(b==="/"||((N=S.pathname)==null?void 0:N.startsWith(b)),`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 "${b}" but pathname "${S.pathname}" was given in the \`location\` prop.`),T=S}else T=w;let R=T.pathname||"/",O=R;if(b!=="/"){let S=b.replace(/^\//,"").split("/");O="/"+R.replace(/^\//,"").split("/").slice(S.length).join("/")}let E=yg(a,{pathname:O});Br(x||E!=null,`No routes matched location "${T.pathname}${T.search}${T.hash}" `),Br(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${T.pathname}${T.search}${T.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 A=Jb(E&&E.map(S=>Object.assign({},S,{params:Object.assign({},g,S.params),pathname:Ra([b,d.encodeLocation?d.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?b:Ra([b,d.encodeLocation?d.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),m,l,o,c);return n&&A?y.createElement(Al.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...T},navigationType:"POP"}},A):A}function Fb(){let a=ev(),n=Rb(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),l=a instanceof Error?a.stack:null,o="rgba(200,200,200, 0.5)",c={padding:"0.5rem",backgroundColor:o},d={padding:"2px 4px",backgroundColor:o},m=null;return console.error("Error handled by React Router default ErrorBoundary:",a),m=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:d},"ErrorBoundary")," or"," ",y.createElement("code",{style:d},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},n),l?y.createElement("pre",{style:c},l):null,m)}var Vb=y.createElement(Fb,null),Rg=class extends y.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,n){return n.location!==a.location||n.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:n.error,location:n.location,revalidation:a.revalidation||n.revalidation}}componentDidCatch(a,n){this.props.onError?this.props.onError(a,n):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 l=Bb(a.digest);l&&(a=l)}let n=a!==void 0?y.createElement(Ir.Provider,{value:this.props.routeContext},y.createElement(dd.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?y.createElement($b,{error:a},n):n}};Rg.contextType=Mb;var Mu=new WeakMap;function $b({children:a,error:n}){let{basename:l}=y.useContext(Ar);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let o=_b(n.digest);if(o){let c=Mu.get(n);if(c)throw c;let d=Sg(o.location,l);if(wg&&!Mu.get(n))if(d.isExternal||o.reloadDocument)window.location.href=d.absoluteURL||d.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:o.replace}));throw Mu.set(n,m),m}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return a}function Yb({routeContext:a,match:n,children:l}){let o=y.useContext(Nn);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(Ir.Provider,{value:a},l)}function Jb(a,n=[],l=null,o=null,c=null){if(a==null){if(!l)return null;if(l.errors)a=l.matches;else if(n.length===0&&!l.initialized&&l.matches.length>0)a=l.matches;else return null}let d=a,m=l==null?void 0:l.errors;if(m!=null){let b=d.findIndex(x=>x.route.id&&(m==null?void 0:m[x.route.id])!==void 0);ht(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),d=d.slice(0,Math.min(d.length,b+1))}let p=!1,g=-1;if(l)for(let b=0;b<d.length;b++){let x=d[b];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(g=b),x.route.id){let{loaderData:w,errors:T}=l,R=x.route.loader&&!w.hasOwnProperty(x.route.id)&&(!T||T[x.route.id]===void 0);if(x.route.lazy||R){p=!0,g>=0?d=d.slice(0,g+1):d=[d[0]];break}}}let h=l&&o?(b,x)=>{var w,T;o(b,{location:l.location,params:((T=(w=l.matches)==null?void 0:w[0])==null?void 0:T.params)??{},unstable_pattern:Ob(l.matches),errorInfo:x})}:void 0;return d.reduceRight((b,x,w)=>{let T,R=!1,O=null,E=null;l&&(T=m&&x.route.id?m[x.route.id]:void 0,O=x.route.errorElement||Vb,p&&(g<0&&w===0?(Og("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),R=!0,E=null):g===w&&(R=!0,E=x.route.hydrateFallbackElement||null)));let A=n.concat(d.slice(0,w+1)),N=()=>{let S;return T?S=O:R?S=E:x.route.Component?S=y.createElement(x.route.Component,null):x.route.element?S=x.route.element:S=b,y.createElement(Yb,{match:x,routeContext:{outlet:b,matches:A,isDataRoute:l!=null},children:S})};return l&&(x.route.ErrorBoundary||x.route.errorElement||w===0)?y.createElement(Rg,{location:l.location,revalidation:l.revalidation,component:O,error:T,children:N(),routeContext:{outlet:null,matches:A,isDataRoute:!0},onError:h}):N()},null)}function md(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Qb(a){let n=y.useContext(Nn);return ht(n,md(a)),n}function Xb(a){let n=y.useContext(po);return ht(n,md(a)),n}function Zb(a){let n=y.useContext(Ir);return ht(n,md(a)),n}function fd(a){let n=Zb(a),l=n.matches[n.matches.length-1];return ht(l.route.id,`${a} can only be used on routes that contain a unique "id"`),l.route.id}function Wb(){return fd("useRouteId")}function ev(){var o;let a=y.useContext(dd),n=Xb("useRouteError"),l=fd("useRouteError");return a!==void 0?a:(o=n.errors)==null?void 0:o[l]}function tv(){let{router:a}=Qb("useNavigate"),n=fd("useNavigate"),l=y.useRef(!1);return Ag(()=>{l.current=!0}),y.useCallback(async(c,d={})=>{Br(l.current,kg),l.current&&(typeof c=="number"?await a.navigate(c):await a.navigate(c,{fromRouteId:n,...d}))},[a,n])}var Rh={};function Og(a,n,l){!n&&!Rh[a]&&(Rh[a]=!0,Br(!1,l))}y.memo(rv);function rv({routes:a,future:n,state:l,onError:o}){return Tg(a,void 0,l,o,n)}function oo({to:a,replace:n,state:l,relative:o}){ht(Cn(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=y.useContext(Ar);Br(!c,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:d}=y.useContext(Ir),{pathname:m}=na(),p=la(),g=ud(a,cd(d),m,o==="path"),h=JSON.stringify(g);return y.useEffect(()=>{p(JSON.parse(h),{replace:n,state:l,relative:o})},[p,h,o,n,l]),null}function zg(a){return Kb(a.context)}function er(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 av({basename:a="/",children:n=null,location:l,navigationType:o="POP",navigator:c,static:d=!1,unstable_useTransitions:m}){ht(!Cn(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=a.replace(/^\/*/,"/"),g=y.useMemo(()=>({basename:p,navigator:c,static:d,unstable_useTransitions:m,future:{}}),[p,c,d,m]);typeof l=="string"&&(l=jn(l));let{pathname:h="/",search:b="",hash:x="",state:w=null,key:T="default"}=l,R=y.useMemo(()=>{let O=za(h,p);return O==null?null:{location:{pathname:O,search:b,hash:x,state:w,key:T},navigationType:o}},[p,h,b,x,w,T,o]);return Br(R!=null,`<Router basename="${p}"> is not able to match the URL "${h}${b}${x}" because it does not start with the basename, so the <Router> won't render anything.`),R==null?null:y.createElement(Ar.Provider,{value:g},y.createElement(Al.Provider,{children:n,value:R}))}function sv({children:a,location:n}){return qb(Yu(a),n)}function Yu(a,n=[]){let l=[];return y.Children.forEach(a,(o,c)=>{if(!y.isValidElement(o))return;let d=[...n,c];if(o.type===y.Fragment){l.push.apply(l,Yu(o.props.children,d));return}ht(o.type===er,`[${typeof o.type=="string"?o.type:o.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ht(!o.props.index||!o.props.children,"An index route cannot have child routes.");let m={id:o.props.id||d.join("-"),caseSensitive:o.props.caseSensitive,element:o.props.element,Component:o.props.Component,index:o.props.index,path:o.props.path,middleware:o.props.middleware,loader:o.props.loader,action:o.props.action,hydrateFallbackElement:o.props.hydrateFallbackElement,HydrateFallback:o.props.HydrateFallback,errorElement:o.props.errorElement,ErrorBoundary:o.props.ErrorBoundary,hasErrorBoundary:o.props.hasErrorBoundary===!0||o.props.ErrorBoundary!=null||o.props.errorElement!=null,shouldRevalidate:o.props.shouldRevalidate,handle:o.props.handle,lazy:o.props.lazy};o.props.children&&(m.children=Yu(o.props.children,d)),l.push(m)}),l}var to="get",ro="application/x-www-form-urlencoded";function ho(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function nv(a){return ho(a)&&a.tagName.toLowerCase()==="button"}function lv(a){return ho(a)&&a.tagName.toLowerCase()==="form"}function iv(a){return ho(a)&&a.tagName.toLowerCase()==="input"}function ov(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function cv(a,n){return a.button===0&&(!n||n==="_self")&&!ov(a)}function Ju(a=""){return new URLSearchParams(typeof a=="string"||Array.isArray(a)||a instanceof URLSearchParams?a:Object.keys(a).reduce((n,l)=>{let o=a[l];return n.concat(Array.isArray(o)?o.map(c=>[l,c]):[[l,o]])},[]))}function uv(a,n){let l=Ju(a);return n&&n.forEach((o,c)=>{l.has(c)||n.getAll(c).forEach(d=>{l.append(c,d)})}),l}var Vi=null;function dv(){if(Vi===null)try{new FormData(document.createElement("form"),0),Vi=!1}catch{Vi=!0}return Vi}var mv=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Lu(a){return a!=null&&!mv.has(a)?(Br(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ro}"`),null):a}function fv(a,n){let l,o,c,d,m;if(lv(a)){let p=a.getAttribute("action");o=p?za(p,n):null,l=a.getAttribute("method")||to,c=Lu(a.getAttribute("enctype"))||ro,d=new FormData(a)}else if(nv(a)||iv(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(o=g?za(g,n):null,l=a.getAttribute("formmethod")||p.getAttribute("method")||to,c=Lu(a.getAttribute("formenctype"))||Lu(p.getAttribute("enctype"))||ro,d=new FormData(p,a),!dv()){let{name:h,type:b,value:x}=a;if(b==="image"){let w=h?`${h}.`:"";d.append(`${w}x`,"0"),d.append(`${w}y`,"0")}else h&&d.append(h,x)}}else{if(ho(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=to,o=null,c=ro,m=a}return d&&c==="text/plain"&&(m=d,d=void 0),{action:o,method:l.toLowerCase(),encType:c,formData:d,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function pd(a,n){if(a===!1||a===null||typeof a>"u")throw new Error(n)}function pv(a,n,l,o){let c=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return l?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${o}`:c.pathname=`${c.pathname}.${o}`:c.pathname==="/"?c.pathname=`_root.${o}`:n&&za(c.pathname,n)==="/"?c.pathname=`${n.replace(/\/$/,"")}/_root.${o}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${o}`,c}async function hv(a,n){if(a.id in n)return n[a.id];try{let l=await import(a.module);return n[a.id]=l,l}catch(l){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(l),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function gv(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 xv(a,n,l){let o=await Promise.all(a.map(async c=>{let d=n.routes[c.route.id];if(d){let m=await hv(d,l);return m.links?m.links():[]}return[]}));return wv(o.flat(1).filter(gv).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function Oh(a,n,l,o,c,d){let m=(g,h)=>l[h]?g.route.id!==l[h].route.id:!0,p=(g,h)=>{var b;return l[h].pathname!==g.pathname||((b=l[h].route.path)==null?void 0:b.endsWith("*"))&&l[h].params["*"]!==g.params["*"]};return d==="assets"?n.filter((g,h)=>m(g,h)||p(g,h)):d==="data"?n.filter((g,h)=>{var x;let b=o.routes[g.route.id];if(!b||!b.hasLoader)return!1;if(m(g,h)||p(g,h))return!0;if(g.route.shouldRevalidate){let w=g.route.shouldRevalidate({currentUrl:new URL(c.pathname+c.search+c.hash,window.origin),currentParams:((x=l[0])==null?void 0:x.params)||{},nextUrl:new URL(a,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function yv(a,n,{includeHydrateFallback:l}={}){return bv(a.map(o=>{let c=n.routes[o.route.id];if(!c)return[];let d=[c.module];return c.clientActionModule&&(d=d.concat(c.clientActionModule)),c.clientLoaderModule&&(d=d.concat(c.clientLoaderModule)),l&&c.hydrateFallbackModule&&(d=d.concat(c.hydrateFallbackModule)),c.imports&&(d=d.concat(c.imports)),d}).flat(1))}function bv(a){return[...new Set(a)]}function vv(a){let n={},l=Object.keys(a).sort();for(let o of l)n[o]=a[o];return n}function wv(a,n){let l=new Set;return new Set(n),a.reduce((o,c)=>{let d=JSON.stringify(vv(c));return l.has(d)||(l.add(d),o.push({key:d,link:c})),o},[])}function Mg(){let a=y.useContext(Nn);return pd(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function Sv(){let a=y.useContext(po);return pd(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var hd=y.createContext(void 0);hd.displayName="FrameworkContext";function Lg(){let a=y.useContext(hd);return pd(a,"You must render this element inside a <HydratedRouter> element"),a}function jv(a,n){let l=y.useContext(hd),[o,c]=y.useState(!1),[d,m]=y.useState(!1),{onFocus:p,onBlur:g,onMouseEnter:h,onMouseLeave:b,onTouchStart:x}=n,w=y.useRef(null);y.useEffect(()=>{if(a==="render"&&m(!0),a==="viewport"){let O=A=>{A.forEach(N=>{m(N.isIntersecting)})},E=new IntersectionObserver(O,{threshold:.5});return w.current&&E.observe(w.current),()=>{E.disconnect()}}},[a]),y.useEffect(()=>{if(o){let O=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(O)}}},[o]);let T=()=>{c(!0)},R=()=>{c(!1),m(!1)};return l?a!=="intent"?[d,w,{}]:[d,w,{onFocus:yl(p,T),onBlur:yl(g,R),onMouseEnter:yl(h,T),onMouseLeave:yl(b,R),onTouchStart:yl(x,T)}]:[!1,w,{}]}function yl(a,n){return l=>{a&&a(l),l.defaultPrevented||n(l)}}function Nv({page:a,...n}){let{router:l}=Mg(),o=y.useMemo(()=>yg(l.routes,a,l.basename),[l.routes,a,l.basename]);return o?y.createElement(kv,{page:a,matches:o,...n}):null}function Cv(a){let{manifest:n,routeModules:l}=Lg(),[o,c]=y.useState([]);return y.useEffect(()=>{let d=!1;return xv(a,n,l).then(m=>{d||c(m)}),()=>{d=!0}},[a,n,l]),o}function kv({page:a,matches:n,...l}){let o=na(),{future:c,manifest:d,routeModules:m}=Lg(),{basename:p}=Mg(),{loaderData:g,matches:h}=Sv(),b=y.useMemo(()=>Oh(a,n,h,d,o,"data"),[a,n,h,d,o]),x=y.useMemo(()=>Oh(a,n,h,d,o,"assets"),[a,n,h,d,o]),w=y.useMemo(()=>{if(a===o.pathname+o.search+o.hash)return[];let O=new Set,E=!1;if(n.forEach(N=>{var D;let S=d.routes[N.route.id];!S||!S.hasLoader||(!b.some(P=>P.route.id===N.route.id)&&N.route.id in g&&((D=m[N.route.id])!=null&&D.shouldRevalidate)||S.hasClientLoader?E=!0:O.add(N.route.id))}),O.size===0)return[];let A=pv(a,p,c.unstable_trailingSlashAwareDataRequests,"data");return E&&O.size>0&&A.searchParams.set("_routes",n.filter(N=>O.has(N.route.id)).map(N=>N.route.id).join(",")),[A.pathname+A.search]},[p,c.unstable_trailingSlashAwareDataRequests,g,o,d,b,n,a,m]),T=y.useMemo(()=>yv(x,d),[x,d]),R=Cv(x);return y.createElement(y.Fragment,null,w.map(O=>y.createElement("link",{key:O,rel:"prefetch",as:"fetch",href:O,...l})),T.map(O=>y.createElement("link",{key:O,rel:"modulepreload",href:O,...l})),R.map(({key:O,link:E})=>y.createElement("link",{key:O,nonce:l.nonce,...E,crossOrigin:E.crossOrigin??l.crossOrigin})))}function Av(...a){return n=>{a.forEach(l=>{typeof l=="function"?l(n):l!=null&&(l.current=n)})}}var Ev=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ev&&(window.__reactRouterVersion="7.13.0")}catch{}function Tv({basename:a,children:n,unstable_useTransitions:l,window:o}){let c=y.useRef();c.current==null&&(c.current=lb({window:o,v5Compat:!0}));let d=c.current,[m,p]=y.useState({action:d.action,location:d.location}),g=y.useCallback(h=>{l===!1?p(h):y.startTransition(()=>p(h))},[l]);return y.useLayoutEffect(()=>d.listen(g),[d,g]),y.createElement(av,{basename:a,children:n,location:m.location,navigationType:m.action,navigator:d,unstable_useTransitions:l})}var Dg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Pg=y.forwardRef(function({onClick:n,discover:l="render",prefetch:o="none",relative:c,reloadDocument:d,replace:m,state:p,target:g,to:h,preventScrollReset:b,viewTransition:x,unstable_defaultShouldRevalidate:w,...T},R){let{basename:O,unstable_useTransitions:E}=y.useContext(Ar),A=typeof h=="string"&&Dg.test(h),N=Sg(h,O);h=N.to;let S=Ib(h,{relative:c}),[D,P,$]=jv(o,T),B=zv(h,{replace:m,state:p,target:g,preventScrollReset:b,relative:c,viewTransition:x,unstable_defaultShouldRevalidate:w,unstable_useTransitions:E});function L(fe){n&&n(fe),fe.defaultPrevented||B(fe)}let Y=y.createElement("a",{...T,...$,href:N.absoluteURL||S,onClick:N.isExternal||d?n:L,ref:Av(R,P),target:g,"data-discover":!A&&l==="render"?"true":void 0});return D&&!A?y.createElement(y.Fragment,null,Y,y.createElement(Nv,{page:S})):Y});Pg.displayName="Link";var Ug=y.forwardRef(function({"aria-current":n="page",caseSensitive:l=!1,className:o="",end:c=!1,style:d,to:m,viewTransition:p,children:g,...h},b){let x=El(m,{relative:h.relative}),w=na(),T=y.useContext(po),{navigator:R,basename:O}=y.useContext(Ar),E=T!=null&&_v(x)&&p===!0,A=R.encodeLocation?R.encodeLocation(x).pathname:x.pathname,N=w.pathname,S=T&&T.navigation&&T.navigation.location?T.navigation.location.pathname:null;l||(N=N.toLowerCase(),S=S?S.toLowerCase():null,A=A.toLowerCase()),S&&O&&(S=za(S,O)||S);const D=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let P=N===A||!c&&N.startsWith(A)&&N.charAt(D)==="/",$=S!=null&&(S===A||!c&&S.startsWith(A)&&S.charAt(A.length)==="/"),B={isActive:P,isPending:$,isTransitioning:E},L=P?n:void 0,Y;typeof o=="function"?Y=o(B):Y=[o,P?"active":null,$?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let fe=typeof d=="function"?d(B):d;return y.createElement(Pg,{...h,"aria-current":L,className:Y,ref:b,style:fe,to:m,viewTransition:p},typeof g=="function"?g(B):g)});Ug.displayName="NavLink";var Rv=y.forwardRef(({discover:a="render",fetcherKey:n,navigate:l,reloadDocument:o,replace:c,state:d,method:m=to,action:p,onSubmit:g,relative:h,preventScrollReset:b,viewTransition:x,unstable_defaultShouldRevalidate:w,...T},R)=>{let{unstable_useTransitions:O}=y.useContext(Ar),E=Pv(),A=Uv(p,{relative:h}),N=m.toLowerCase()==="get"?"get":"post",S=typeof p=="string"&&Dg.test(p),D=P=>{if(g&&g(P),P.defaultPrevented)return;P.preventDefault();let $=P.nativeEvent.submitter,B=($==null?void 0:$.getAttribute("formmethod"))||m,L=()=>E($||P.currentTarget,{fetcherKey:n,method:B,navigate:l,replace:c,state:d,relative:h,preventScrollReset:b,viewTransition:x,unstable_defaultShouldRevalidate:w});O&&l!==!1?y.startTransition(()=>L()):L()};return y.createElement("form",{ref:R,method:N,action:A,onSubmit:o?g:D,...T,"data-discover":!S&&a==="render"?"true":void 0})});Rv.displayName="Form";function Ov(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function _g(a){let n=y.useContext(Nn);return ht(n,Ov(a)),n}function zv(a,{target:n,replace:l,state:o,preventScrollReset:c,relative:d,viewTransition:m,unstable_defaultShouldRevalidate:p,unstable_useTransitions:g}={}){let h=la(),b=na(),x=El(a,{relative:d});return y.useCallback(w=>{if(cv(w,n)){w.preventDefault();let T=l!==void 0?l:Nl(b)===Nl(x),R=()=>h(a,{replace:T,state:o,preventScrollReset:c,relative:d,viewTransition:m,unstable_defaultShouldRevalidate:p});g?y.startTransition(()=>R()):R()}},[b,h,x,l,o,n,a,c,d,m,p,g])}function Mv(a){Br(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 n=y.useRef(Ju(a)),l=y.useRef(!1),o=na(),c=y.useMemo(()=>uv(o.search,l.current?null:n.current),[o.search]),d=la(),m=y.useCallback((p,g)=>{const h=Ju(typeof p=="function"?p(new URLSearchParams(c)):p);l.current=!0,d("?"+h,g)},[d,c]);return[c,m]}var Lv=0,Dv=()=>`__${String(++Lv)}__`;function Pv(){let{router:a}=_g("useSubmit"),{basename:n}=y.useContext(Ar),l=Wb(),o=a.fetch,c=a.navigate;return y.useCallback(async(d,m={})=>{let{action:p,method:g,encType:h,formData:b,body:x}=fv(d,n);if(m.navigate===!1){let w=m.fetcherKey||Dv();await o(w,l,m.action||p,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:x,formMethod:m.method||g,formEncType:m.encType||h,flushSync:m.flushSync})}else await c(m.action||p,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:x,formMethod:m.method||g,formEncType:m.encType||h,replace:m.replace,state:m.state,fromRouteId:l,flushSync:m.flushSync,viewTransition:m.viewTransition})},[o,c,n,l])}function Uv(a,{relative:n}={}){let{basename:l}=y.useContext(Ar),o=y.useContext(Ir);ht(o,"useFormAction must be used inside a RouteContext");let[c]=o.matches.slice(-1),d={...El(a||".",{relative:n})},m=na();if(a==null){d.search=m.search;let p=new URLSearchParams(d.search),g=p.getAll("index");if(g.some(b=>b==="")){p.delete("index"),g.filter(x=>x).forEach(x=>p.append("index",x));let b=p.toString();d.search=b?`?${b}`:""}}return(!a||a===".")&&c.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(d.pathname=d.pathname==="/"?l:Ra([l,d.pathname])),Nl(d)}function _v(a,{relative:n}={}){let l=y.useContext(Ng);ht(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=_g("useViewTransitionState"),c=El(a,{relative:n});if(!l.isTransitioning)return!1;let d=za(l.currentLocation.pathname,o)||l.currentLocation.pathname,m=za(l.nextLocation.pathname,o)||l.nextLocation.pathname;return io(c.pathname,m)!=null||io(c.pathname,d)!=null}const Bv=()=>window.__MCPHUB_CONFIG__||{basePath:"",version:"dev",name:"mcphub"},Tl=()=>{const n=Bv().basePath||"";return n&&!n.startsWith("/")?"/"+n:n},Iv=()=>Tl()+"/api",gd=a=>{const n=Iv(),l=a.startsWith("/")?a:"/"+a;return n+l},Hv=async()=>{try{const a=window.location.pathname,n=[a.replace(/\/[^/]*$/,"")+"/config","/config",...a.includes("/")?[a.split("/")[1]?`/${a.split("/")[1]}/config`:"/config"]:["/config"]];for(const l of n)try{const o=await fetch(l,{method:"GET",headers:{Accept:"application/json","Cache-Control":"no-cache"}});if(o.ok){const c=await o.json();if(c.success&&c.data)return c.data}}catch(o){console.debug(`Failed to load config from ${l}:`,o)}return console.warn("Could not load runtime config from server, using defaults"),{basePath:"",version:"dev",name:"mcphub"}}catch(a){return console.error("Error loading runtime config:",a),{basePath:"",version:"dev",name:"mcphub"}}},ao=[],Gv=a=>{ao.push(a)},xd=async(a,n={})=>{let l=a.toString(),o={...n};try{for(const d of ao)if(d.request){const m=await d.request(l,o);l=m.url,o=m.config}let c=await fetch(l,o);for(const d of ao)d.response&&(c=await d.response(c));return c}catch(c){let d=c;for(const m of ao)m.error&&(d=await m.error(d));throw d}},go=async(a,n={})=>{try{const l=gd(a),o=await xd(l,n);let c;try{c=await o.json()}catch{c={success:o.ok,message:o.ok?"Request successful":`HTTP ${o.status}: ${o.statusText}`}}if(!o.ok&&typeof c=="object"&&c!==null){const d=c;d.success!==!1&&(d.success=!1,d.message=d.message||`HTTP ${o.status}: ${o.statusText}`)}return c}catch(l){return console.error("API request error:",l),{success:!1,message:l instanceof Error?l.message:"An unknown error occurred"}}},Ue=(a,n={})=>go(a,{...n,method:"GET"}),At=(a,n,l={})=>go(a,{...l,method:"POST",headers:{"Content-Type":"application/json",...l.headers},body:n?JSON.stringify(n):void 0}),Pt=(a,n,l={})=>go(a,{...l,method:"PUT",headers:{"Content-Type":"application/json",...l.headers},body:n?JSON.stringify(n):void 0}),Os=(a,n={})=>go(a,{...n,method:"DELETE"}),yd="mcphub_token",kn=()=>localStorage.getItem(yd),Bg=a=>{localStorage.setItem(yd,a)},co=()=>{localStorage.removeItem(yd)},Kv={request:async(a,n)=>{const l=new Headers(n.headers),o=localStorage.getItem("i18nextLng")||"en";l.set("Accept-Language",o);const c=kn();return c&&l.set("x-auth-token",c),{url:a,config:{...n,headers:l,credentials:n.credentials??"include"}}},response:async a=>(a.status===401&&co(),a),error:async a=>(console.error("Auth interceptor error:",a),a)},qv=()=>{Gv(Kv)};var Fv={},zh={};const so=Object.create(null),bl=a=>{var n;return Fv||((n=globalThis.Deno)==null?void 0:n.env.toObject())||globalThis.__env__||(a?so:globalThis)},_r=new Proxy(so,{get(a,n){return bl()[n]??so[n]},has(a,n){return n in bl()||n in so},set(a,n,l){const o=bl(!0);return o[n]=l,!0},deleteProperty(a,n){if(!n)return!1;const l=bl(!0);return delete l[n],!0},ownKeys(){const a=bl(!0);return Object.keys(a)}});function zt(a,n){return typeof process<"u"&&zh?zh[a]??n:typeof Deno<"u"?Deno.env.get(a)??n:typeof Bun<"u"?Bun.env[a]??n:n}const vl=1,Bt=4,ra=8,kr=24,Mh={eterm:Bt,cons25:Bt,console:Bt,cygwin:Bt,dtterm:Bt,gnome:Bt,hurd:Bt,jfbterm:Bt,konsole:Bt,kterm:Bt,mlterm:Bt,mosh:kr,putty:Bt,st:Bt,"rxvt-unicode-24bit":kr,terminator:kr,"xterm-kitty":kr},Vv=new Map(Object.entries({APPVEYOR:ra,BUILDKITE:ra,CIRCLECI:kr,DRONE:ra,GITEA_ACTIONS:kr,GITHUB_ACTIONS:kr,GITLAB_CI:ra,TRAVIS:ra})),$v=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function Yv(){if(zt("FORCE_COLOR")!==void 0)switch(zt("FORCE_COLOR")){case"":case"1":case"true":return Bt;case"2":return ra;case"3":return kr;default:return vl}if(zt("NODE_DISABLE_COLORS")!==void 0&&zt("NODE_DISABLE_COLORS")!==""||zt("NO_COLOR")!==void 0&&zt("NO_COLOR")!==""||zt("TERM")==="dumb")return vl;if(zt("TMUX"))return kr;if("TF_BUILD"in _r&&"AGENT_NAME"in _r)return Bt;if("CI"in _r){for(const{0:a,1:n}of Vv)if(a in _r)return n;return zt("CI_NAME")==="codeship"?ra:vl}if("TEAMCITY_VERSION"in _r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(zt("TEAMCITY_VERSION"))!==null?Bt:vl;switch(zt("TERM_PROGRAM")){case"iTerm.app":return!zt("TERM_PROGRAM_VERSION")||/^[0-2]\./.exec(zt("TERM_PROGRAM_VERSION"))!==null?ra:kr;case"HyperTerm":case"MacTerm":return kr;case"Apple_Terminal":return ra}if(zt("COLORTERM")==="truecolor"||zt("COLORTERM")==="24bit")return kr;if(zt("TERM")){if(/truecolor/.exec(zt("TERM"))!==null)return kr;if(/^xterm-256/.exec(zt("TERM"))!==null)return ra;const a=zt("TERM").toLowerCase();if(Mh[a])return Mh[a];if($v.some(n=>n.exec(a)!==null))return Bt}return zt("COLORTERM")?Bt:vl}const aa={reset:"\x1B[0m",bright:"\x1B[1m",dim:"\x1B[2m",fg:{red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m"}},Qu=["debug","info","success","warn","error"];function Jv(a,n){return Qu.indexOf(n)>=Qu.indexOf(a)}const Qv={info:aa.fg.blue,success:aa.fg.green,warn:aa.fg.yellow,error:aa.fg.red,debug:aa.fg.magenta},Xv=(a,n,l)=>{const o=new Date().toISOString();return l?`${aa.dim}${o}${aa.reset} ${Qv[a]}${a.toUpperCase()}${aa.reset} ${aa.bright}[Better Auth]:${aa.reset} ${n}`:`${o} ${a.toUpperCase()} [Better Auth]: ${n}`},Zv=a=>{const n="error",l=Yv()!==1,o=(c,d,m=[])=>{if(!Jv(n,c))return;const p=Xv(c,d,l);{c==="error"?console.error(p,...m):c==="warn"?console.warn(p,...m):console.log(p,...m);return}};return{...Object.fromEntries(Qu.map(c=>[c,(...[d,...m])=>o(c,d,m)])),get level(){return n}}};Zv();function Wv(a){return a.charAt(0).toUpperCase()+a.slice(1)}var no=class extends Error{constructor(a,n){super(a,n),this.name="BetterAuthError",this.message=a,this.stack=""}};function e1(a){try{return(new URL(a).pathname.replace(/\/+$/,"")||"/")!=="/"}catch{throw new no(`Invalid base URL: ${a}. Please provide a valid base URL.`)}}function t1(a){try{const n=new URL(a);if(n.protocol!=="http:"&&n.protocol!=="https:")throw new no(`Invalid base URL: ${a}. URL must include 'http://' or 'https://'`)}catch(n){throw n instanceof no?n:new no(`Invalid base URL: ${a}. Please provide a valid base URL.`,{cause:n})}}function Du(a,n="/api/auth"){if(t1(a),e1(a))return a;const l=a.replace(/\/+$/,"");return!n||n==="/"?l:(n=n.startsWith("/")?n:`/${n}`,`${l}${n}`)}function r1(a,n,l,o,c){if(a)return Du(a,n);{const d=_r.BETTER_AUTH_URL||_r.NEXT_PUBLIC_BETTER_AUTH_URL||_r.PUBLIC_BETTER_AUTH_URL||_r.NUXT_PUBLIC_BETTER_AUTH_URL||_r.NUXT_PUBLIC_AUTH_URL||(_r.BASE_URL!=="/"?_r.BASE_URL:void 0);if(d)return Du(d,n)}if(typeof window<"u"&&window.location)return Du(window.location.origin,n)}const a1={id:"redirect",name:"Redirect",hooks:{onSuccess(a){var n,l;if((n=a.data)!=null&&n.url&&((l=a.data)!=null&&l.redirect)&&typeof window<"u"&&window.location&&window.location)try{window.location.href=a.data.url}catch{}}}},s1={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},n1=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,Lh={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},l1=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function i1(a){return a instanceof Date&&!isNaN(a.getTime())}function o1(a){const n=l1.exec(a);if(!n)return null;const[,l,o,c,d,m,p,g,h,b,x]=n,w=new Date(Date.UTC(parseInt(l,10),parseInt(o,10)-1,parseInt(c,10),parseInt(d,10),parseInt(m,10),parseInt(p,10),g?parseInt(g.padEnd(3,"0"),10):0));if(h){const T=(parseInt(b,10)*60+parseInt(x,10))*(h==="+"?-1:1);w.setUTCMinutes(w.getUTCMinutes()+T)}return i1(w)?w:null}function c1(a,n={}){const{strict:l=!1,warnings:o=!1,reviver:c,parseDates:d=!0}=n;if(typeof a!="string")return a;const m=a.trim();if(m.length>0&&m[0]==='"'&&m.endsWith('"')&&!m.slice(1,-1).includes('"'))return m.slice(1,-1);const p=m.toLowerCase();if(p.length<=9&&p in Lh)return Lh[p];if(!n1.test(m)){if(l)throw new SyntaxError("[better-json] Invalid JSON");return a}if(Object.entries(s1).some(([g,h])=>{const b=h.test(m);return b&&o&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${g} pattern`),b})&&l)throw new Error("[better-json] Potential prototype pollution attempt detected");try{return JSON.parse(m,(h,b)=>{if(h==="__proto__"||h==="constructor"&&b&&typeof b=="object"&&"prototype"in b){o&&console.warn(`[better-json] Dropping "${h}" key to prevent prototype pollution`);return}if(d&&typeof b=="string"){const x=o1(b);if(x)return x}return c?c(h,b):b})}catch(g){if(l)throw g;return a}}function u1(a,n={strict:!0}){return c1(a,n)}let qr=[],ss=0;const $i=4,Ig=a=>{let n=[],l={get(){return l.lc||l.listen(()=>{})(),l.value},lc:0,listen(o){return l.lc=n.push(o),()=>{for(let d=ss+$i;d<qr.length;)qr[d]===o?qr.splice(d,$i):d+=$i;let c=n.indexOf(o);~c&&(n.splice(c,1),--l.lc||l.off())}},notify(o,c){let d=!qr.length;for(let m of n)qr.push(m,l.value,o,c);if(d){for(ss=0;ss<qr.length;ss+=$i)qr[ss](qr[ss+1],qr[ss+2],qr[ss+3]);qr.length=0}},off(){},set(o){let c=l.value;c!==o&&(l.value=o,l.notify(c))},subscribe(o){let c=l.listen(o);return o(l.value),c},value:a};return l},d1=5,Yi=6,Ji=10;let m1=(a,n,l,o)=>(a.events=a.events||{},a.events[l+Ji]||(a.events[l+Ji]=o(c=>{a.events[l].reduceRight((d,m)=>(m(d),d),{shared:{},...c})})),a.events[l]=a.events[l]||[],a.events[l].push(n),()=>{let c=a.events[l],d=c.indexOf(n);c.splice(d,1),c.length||(delete a.events[l],a.events[l+Ji](),delete a.events[l+Ji])}),f1=1e3,Hg=(a,n)=>m1(a,o=>{let c=n(o);c&&a.events[Yi].push(c)},d1,o=>{let c=a.listen;a.listen=(...m)=>(!a.lc&&!a.active&&(a.active=!0,o()),c(...m));let d=a.off;return a.events[Yi]=[],a.off=()=>{d(),setTimeout(()=>{if(a.active&&!a.lc){a.active=!1;for(let m of a.events[Yi])m();a.events[Yi]=[]}},f1)},()=>{a.listen=c,a.off=d}});function p1(a,n,l){let o=new Set(n).add(void 0);return a.listen((c,d,m)=>{o.has(m)&&l(c,d,m)})}const h1=()=>typeof window>"u",g1=(a,n,l,o)=>{const c=Ig({data:null,error:null,isPending:!0,isRefetching:!1,refetch:p=>d(p)}),d=async p=>new Promise(g=>{const h=typeof o=="function"?o({data:c.get().data,error:c.get().error,isPending:c.get().isPending}):o;l(n,{...h,query:{...h==null?void 0:h.query,...p==null?void 0:p.query},async onSuccess(b){var x;c.set({data:b.data,error:null,isPending:!1,isRefetching:!1,refetch:c.value.refetch}),await((x=h==null?void 0:h.onSuccess)==null?void 0:x.call(h,b))},async onError(b){var R,O;const{request:x}=b,w=typeof x.retry=="number"?x.retry:(R=x.retry)==null?void 0:R.attempts,T=x.retryAttempt||0;w&&T<w||(c.set({error:b.error,data:null,isPending:!1,isRefetching:!1,refetch:c.value.refetch}),await((O=h==null?void 0:h.onError)==null?void 0:O.call(h,b)))},async onRequest(b){var w;const x=c.get();c.set({isPending:x.data===null,data:x.data,error:null,isRefetching:!0,refetch:c.value.refetch}),await((w=h==null?void 0:h.onRequest)==null?void 0:w.call(h,b))}}).catch(b=>{c.set({error:b,data:null,isPending:!1,isRefetching:!1,refetch:c.value.refetch})}).finally(()=>{g(void 0)})});a=Array.isArray(a)?a:[a];let m=!1;for(const p of a)p.subscribe(async()=>{h1()||(m?await d():Hg(c,()=>{const g=setTimeout(async()=>{m||(await d(),m=!0)},0);return()=>{c.off(),p.off(),clearTimeout(g)}}))});return c},Pu=Symbol.for("better-auth:broadcast-channel"),x1=()=>Math.floor(Date.now()/1e3);var y1=class{constructor(a="better-auth.message"){pn(this,"listeners",new Set);pn(this,"name");this.name=a}subscribe(a){return this.listeners.add(a),()=>{this.listeners.delete(a)}}post(a){if(!(typeof window>"u"))try{localStorage.setItem(this.name,JSON.stringify({...a,timestamp:x1()}))}catch{}}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const a=n=>{if(n.key!==this.name)return;const l=JSON.parse(n.newValue??"{}");(l==null?void 0:l.event)!=="session"||!(l!=null&&l.data)||this.listeners.forEach(o=>o(l))};return window.addEventListener("storage",a),()=>{window.removeEventListener("storage",a)}}};function Uu(a="better-auth.message"){return globalThis[Pu]||(globalThis[Pu]=new y1(a)),globalThis[Pu]}const _u=Symbol.for("better-auth:focus-manager");var b1=class{constructor(){pn(this,"listeners",new Set)}subscribe(a){return this.listeners.add(a),()=>{this.listeners.delete(a)}}setFocused(a){this.listeners.forEach(n=>n(a))}setup(){if(typeof window>"u"||typeof document>"u"||typeof window.addEventListener>"u")return()=>{};const a=()=>{document.visibilityState==="visible"&&this.setFocused(!0)};return document.addEventListener("visibilitychange",a,!1),()=>{document.removeEventListener("visibilitychange",a,!1)}}};function Dh(){return globalThis[_u]||(globalThis[_u]=new b1),globalThis[_u]}const Bu=Symbol.for("better-auth:online-manager");var v1=class{constructor(){pn(this,"listeners",new Set);pn(this,"isOnline",typeof navigator<"u"?navigator.onLine:!0)}subscribe(a){return this.listeners.add(a),()=>{this.listeners.delete(a)}}setOnline(a){this.isOnline=a,this.listeners.forEach(n=>n(a))}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const a=()=>this.setOnline(!0),n=()=>this.setOnline(!1);return window.addEventListener("online",a,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",a,!1),window.removeEventListener("offline",n,!1)}}};function Iu(){return globalThis[Bu]||(globalThis[Bu]=new v1),globalThis[Bu]}const hn=()=>Math.floor(Date.now()/1e3),w1=5;function S1(a){var N,S,D;const{sessionAtom:n,sessionSignal:l,$fetch:o,options:c={}}=a,d=((N=c.sessionOptions)==null?void 0:N.refetchInterval)??0,m=((S=c.sessionOptions)==null?void 0:S.refetchOnWindowFocus)??!0,p=((D=c.sessionOptions)==null?void 0:D.refetchWhenOffline)??!1,g={lastSync:0,lastSessionRequest:0,cachedSession:void 0},h=()=>p||Iu().isOnline,b=P=>{if(!h())return;if((P==null?void 0:P.event)==="storage"){g.lastSync=hn(),l.set(!l.get());return}const $=n.get();if((P==null?void 0:P.event)==="poll"){g.lastSessionRequest=hn(),o("/get-session").then(B=>{B.error?n.set({...$,data:null,error:B.error}):n.set({...$,data:B.data,error:null}),g.lastSync=hn(),l.set(!l.get())}).catch(()=>{});return}if((P==null?void 0:P.event)==="visibilitychange"){if(hn()-g.lastSessionRequest<w1)return;g.lastSessionRequest=hn()}(($==null?void 0:$.data)===null||($==null?void 0:$.data)===void 0||(P==null?void 0:P.event)==="visibilitychange")&&(g.lastSync=hn(),l.set(!l.get()))},x=P=>{Uu().post({event:"session",data:{trigger:P},clientId:Math.random().toString(36).substring(7)})},w=()=>{d&&d>0&&(g.pollInterval=setInterval(()=>{var P;(P=n.get())!=null&&P.data&&b({event:"poll"})},d*1e3))},T=()=>{g.unsubscribeBroadcast=Uu().subscribe(()=>{b({event:"storage"})})},R=()=>{m&&(g.unsubscribeFocus=Dh().subscribe(()=>{b({event:"visibilitychange"})}))},O=()=>{g.unsubscribeOnline=Iu().subscribe(P=>{P&&b({event:"visibilitychange"})})};return{init:()=>{w(),T(),R(),O(),Uu().setup(),Dh().setup(),Iu().setup()},cleanup:()=>{g.pollInterval&&(clearInterval(g.pollInterval),g.pollInterval=void 0),g.unsubscribeBroadcast&&(g.unsubscribeBroadcast(),g.unsubscribeBroadcast=void 0),g.unsubscribeFocus&&(g.unsubscribeFocus(),g.unsubscribeFocus=void 0),g.unsubscribeOnline&&(g.unsubscribeOnline(),g.unsubscribeOnline=void 0),g.lastSync=0,g.lastSessionRequest=0,g.cachedSession=void 0},triggerRefetch:b,broadcastSessionUpdate:x}}function j1(a,n){const l=Ig(!1),o=g1(l,"/get-session",a,{method:"GET"});return Hg(o,()=>{const c=S1({sessionAtom:o,sessionSignal:l,$fetch:a,options:n});return c.init(),()=>{c.cleanup()}}),{session:o,$sessionSignal:l}}var N1=Object.defineProperty,C1=Object.defineProperties,k1=Object.getOwnPropertyDescriptors,Ph=Object.getOwnPropertySymbols,A1=Object.prototype.hasOwnProperty,E1=Object.prototype.propertyIsEnumerable,Uh=(a,n,l)=>n in a?N1(a,n,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[n]=l,Fr=(a,n)=>{for(var l in n||(n={}))A1.call(n,l)&&Uh(a,l,n[l]);if(Ph)for(var l of Ph(n))E1.call(n,l)&&Uh(a,l,n[l]);return a},ta=(a,n)=>C1(a,k1(n)),T1=class extends Error{constructor(a,n,l){super(n||a.toString(),{cause:l}),this.status=a,this.statusText=n,this.error=l,Error.captureStackTrace(this,this.constructor)}},R1=async(a,n)=>{var l,o,c,d,m,p;let g=n||{};const h={onRequest:[n==null?void 0:n.onRequest],onResponse:[n==null?void 0:n.onResponse],onSuccess:[n==null?void 0:n.onSuccess],onError:[n==null?void 0:n.onError],onRetry:[n==null?void 0:n.onRetry]};if(!n||!(n!=null&&n.plugins))return{url:a,options:g,hooks:h};for(const b of(n==null?void 0:n.plugins)||[]){if(b.init){const x=await((l=b.init)==null?void 0:l.call(b,a.toString(),n));g=x.options||g,a=x.url}h.onRequest.push((o=b.hooks)==null?void 0:o.onRequest),h.onResponse.push((c=b.hooks)==null?void 0:c.onResponse),h.onSuccess.push((d=b.hooks)==null?void 0:d.onSuccess),h.onError.push((m=b.hooks)==null?void 0:m.onError),h.onRetry.push((p=b.hooks)==null?void 0:p.onRetry)}return{url:a,options:g,hooks:h}},_h=class{constructor(a){this.options=a}shouldAttemptRetry(a,n){return this.options.shouldRetry?Promise.resolve(a<this.options.attempts&&this.options.shouldRetry(n)):Promise.resolve(a<this.options.attempts)}getDelay(){return this.options.delay}},O1=class{constructor(a){this.options=a}shouldAttemptRetry(a,n){return this.options.shouldRetry?Promise.resolve(a<this.options.attempts&&this.options.shouldRetry(n)):Promise.resolve(a<this.options.attempts)}getDelay(a){return Math.min(this.options.maxDelay,this.options.baseDelay*2**a)}};function z1(a){if(typeof a=="number")return new _h({type:"linear",attempts:a,delay:1e3});switch(a.type){case"linear":return new _h(a);case"exponential":return new O1(a);default:throw new Error("Invalid retry strategy")}}var M1=async a=>{const n={},l=async o=>typeof o=="function"?await o():o;if(a!=null&&a.auth){if(a.auth.type==="Bearer"){const o=await l(a.auth.token);if(!o)return n;n.authorization=`Bearer ${o}`}else if(a.auth.type==="Basic"){const[o,c]=await Promise.all([l(a.auth.username),l(a.auth.password)]);if(!o||!c)return n;n.authorization=`Basic ${btoa(`${o}:${c}`)}`}else if(a.auth.type==="Custom"){const[o,c]=await Promise.all([l(a.auth.prefix),l(a.auth.value)]);if(!c)return n;n.authorization=`${o??""} ${c}`}}return n},L1=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function D1(a){const n=a.headers.get("content-type"),l=new Set(["image/svg","application/xml","application/xhtml","application/html"]);if(!n)return"json";const o=n.split(";").shift()||"";return L1.test(o)?"json":l.has(o)||o.startsWith("text/")?"text":"blob"}function P1(a){try{return JSON.parse(a),!0}catch{return!1}}function Xu(a){if(a===void 0)return!1;const n=typeof a;return n==="string"||n==="number"||n==="boolean"||n===null?!0:n!=="object"?!1:Array.isArray(a)?!0:a.buffer?!1:a.constructor&&a.constructor.name==="Object"||typeof a.toJSON=="function"}function Bh(a){try{return JSON.parse(a)}catch{return a}}function Ih(a){return typeof a=="function"}function U1(a){if(a!=null&&a.customFetchImpl)return a.customFetchImpl;if(typeof globalThis<"u"&&Ih(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&Ih(window.fetch))return window.fetch;throw new Error("No fetch implementation found")}async function _1(a){const n=new Headers(a==null?void 0:a.headers),l=await M1(a);for(const[o,c]of Object.entries(l||{}))n.set(o,c);if(!n.has("content-type")){const o=B1(a==null?void 0:a.body);o&&n.set("content-type",o)}return n}function B1(a){return Xu(a)?"application/json":null}function I1(a){if(!(a!=null&&a.body))return null;const n=new Headers(a==null?void 0:a.headers);if(Xu(a.body)&&!n.has("content-type")){for(const[l,o]of Object.entries(a==null?void 0:a.body))o instanceof Date&&(a.body[l]=o.toISOString());return JSON.stringify(a.body)}return n.has("content-type")&&n.get("content-type")==="application/x-www-form-urlencoded"&&Xu(a.body)?new URLSearchParams(a.body).toString():a.body}function H1(a,n){var l;if(n!=null&&n.method)return n.method.toUpperCase();if(a.startsWith("@")){const o=(l=a.split("@")[1])==null?void 0:l.split("/")[0];return Kg.includes(o)?o.toUpperCase():n!=null&&n.body?"POST":"GET"}return n!=null&&n.body?"POST":"GET"}function G1(a,n){let l;return!(a!=null&&a.signal)&&(a!=null&&a.timeout)&&(l=setTimeout(()=>n==null?void 0:n.abort(),a==null?void 0:a.timeout)),{abortTimeout:l,clearTimeout:()=>{l&&clearTimeout(l)}}}var K1=class Gg extends Error{constructor(n,l){super(l||JSON.stringify(n,null,2)),this.issues=n,Object.setPrototypeOf(this,Gg.prototype)}};async function lo(a,n){const l=await a["~standard"].validate(n);if(l.issues)throw new K1(l.issues);return l.value}var Kg=["get","post","put","patch","delete"],q1=a=>({id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(n,l){var o,c,d,m;const p=((c=(o=a.plugins)==null?void 0:o.find(g=>{var h;return(h=g.schema)!=null&&h.config?n.startsWith(g.schema.config.baseURL||"")||n.startsWith(g.schema.config.prefix||""):!1}))==null?void 0:c.schema)||a.schema;if(p){let g=n;(d=p.config)!=null&&d.prefix&&g.startsWith(p.config.prefix)&&(g=g.replace(p.config.prefix,""),p.config.baseURL&&(n=n.replace(p.config.prefix,p.config.baseURL))),(m=p.config)!=null&&m.baseURL&&g.startsWith(p.config.baseURL)&&(g=g.replace(p.config.baseURL,""));const h=p.schema[g];if(h){let b=ta(Fr({},l),{method:h.method,output:h.output});return l!=null&&l.disableValidation||(b=ta(Fr({},b),{body:h.input?await lo(h.input,l==null?void 0:l.body):l==null?void 0:l.body,params:h.params?await lo(h.params,l==null?void 0:l.params):l==null?void 0:l.params,query:h.query?await lo(h.query,l==null?void 0:l.query):l==null?void 0:l.query})),{url:n,options:b}}}return{url:n,options:l}}}),F1=a=>{async function n(l,o){const c=ta(Fr(Fr({},a),o),{plugins:[...(a==null?void 0:a.plugins)||[],q1(a||{}),...(o==null?void 0:o.plugins)||[]]});if(a!=null&&a.catchAllError)try{return await Zu(l,c)}catch(d){return{data:null,error:{status:500,statusText:"Fetch Error",message:"Fetch related error. Captured by catchAllError option. See error property for more details.",error:d}}}return await Zu(l,c)}return n};function V1(a,n){const{baseURL:l,params:o,query:c}=n||{query:{},params:{},baseURL:""};let d=a.startsWith("http")?a.split("/").slice(0,3).join("/"):l||"";if(a.startsWith("@")){const x=a.toString().split("@")[1].split("/")[0];Kg.includes(x)&&(a=a.replace(`@${x}/`,"/"))}d.endsWith("/")||(d+="/");let[m,p]=a.replace(d,"").split("?");const g=new URLSearchParams(p);for(const[x,w]of Object.entries(c||{})){if(w==null)continue;let T;if(typeof w=="string")T=w;else if(Array.isArray(w)){for(const R of w)g.append(x,R);continue}else T=JSON.stringify(w);g.set(x,T)}if(o)if(Array.isArray(o)){const x=m.split("/").filter(w=>w.startsWith(":"));for(const[w,T]of x.entries()){const R=o[w];m=m.replace(T,R)}}else for(const[x,w]of Object.entries(o))m=m.replace(`:${x}`,String(w));m=m.split("/").map(encodeURIComponent).join("/"),m.startsWith("/")&&(m=m.slice(1));let h=g.toString();return h=h.length>0?`?${h}`.replace(/\+/g,"%20"):"",d.startsWith("http")?new URL(`${m}${h}`,d):`${d}${m}${h}`}var Zu=async(a,n)=>{var l,o,c,d,m,p,g,h;const{hooks:b,url:x,options:w}=await R1(a,n),T=U1(w),R=new AbortController,O=(l=w.signal)!=null?l:R.signal,E=V1(x,w),A=I1(w),N=await _1(w),S=H1(x,w);let D=ta(Fr({},w),{url:E,headers:N,body:A,method:S,signal:O});for(const X of b.onRequest)if(X){const H=await X(D);typeof H=="object"&&H!==null&&(D=H)}("pipeTo"in D&&typeof D.pipeTo=="function"||typeof((o=n==null?void 0:n.body)==null?void 0:o.pipe)=="function")&&("duplex"in D||(D.duplex="half"));const{clearTimeout:P}=G1(w,R);let $=await T(D.url,D);P();const B={response:$,request:D};for(const X of b.onResponse)if(X){const H=await X(ta(Fr({},B),{response:(c=n==null?void 0:n.hookOptions)!=null&&c.cloneResponse?$.clone():$}));H instanceof Response?$=H:typeof H=="object"&&H!==null&&($=H.response)}if($.ok){if(!(D.method!=="HEAD"))return{data:"",error:null};const H=D1($),Z={data:null,response:$,request:D};if(H==="json"||H==="text"){const C=await $.text(),I=(d=D.jsonParser)!=null?d:Bh;Z.data=await I(C)}else Z.data=await $[H]();D!=null&&D.output&&D.output&&!D.disableValidation&&(Z.data=await lo(D.output,Z.data));for(const C of b.onSuccess)C&&await C(ta(Fr({},Z),{response:(m=n==null?void 0:n.hookOptions)!=null&&m.cloneResponse?$.clone():$}));return n!=null&&n.throw?Z.data:{data:Z.data,error:null}}const L=(p=n==null?void 0:n.jsonParser)!=null?p:Bh,Y=await $.text(),fe=P1(Y),G=fe?await L(Y):null,K={response:$,responseText:Y,request:D,error:ta(Fr({},G),{status:$.status,statusText:$.statusText})};for(const X of b.onError)X&&await X(ta(Fr({},K),{response:(g=n==null?void 0:n.hookOptions)!=null&&g.cloneResponse?$.clone():$}));if(n!=null&&n.retry){const X=z1(n.retry),H=(h=n.retryAttempt)!=null?h:0;if(await X.shouldAttemptRetry(H,$)){for(const C of b.onRetry)C&&await C(B);const Z=X.getDelay(H);return await new Promise(C=>setTimeout(C,Z)),await Zu(a,ta(Fr({},n),{retryAttempt:H+1}))}}if(n!=null&&n.throw)throw new T1($.status,$.statusText,fe?G:Y);return{data:null,error:ta(Fr({},G),{status:$.status,statusText:$.statusText})}};const $1=(a,n)=>{var D,P,$,B,L,Y,fe;const l="credentials"in Request.prototype,o=r1(a==null?void 0:a.baseURL,a==null?void 0:a.basePath)??"/api/auth",c=((D=a==null?void 0:a.plugins)==null?void 0:D.flatMap(G=>G.fetchPlugins).filter(G=>G!==void 0))||[],d={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:(P=a==null?void 0:a.fetchOptions)==null?void 0:P.onSuccess,onError:($=a==null?void 0:a.fetchOptions)==null?void 0:$.onError,onRequest:(B=a==null?void 0:a.fetchOptions)==null?void 0:B.onRequest,onResponse:(L=a==null?void 0:a.fetchOptions)==null?void 0:L.onResponse}},{onSuccess:m,onError:p,onRequest:g,onResponse:h,...b}=(a==null?void 0:a.fetchOptions)||{},x=F1({baseURL:o,...l?{credentials:"include"}:{},method:"GET",jsonParser(G){return G?u1(G,{strict:!1}):null},customFetchImpl:fetch,...b,plugins:[d,...b.plugins||[],...a!=null&&a.disableDefaultFetchPlugins?[]:[a1],...c]}),{$sessionSignal:w,session:T}=j1(x,a),R=(a==null?void 0:a.plugins)||[],O={},E={$sessionSignal:w,session:T},A={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},N=[{signal:"$sessionSignal",matcher(G){return G==="/sign-out"||G==="/update-user"||G==="/sign-up/email"||G==="/sign-in/email"||G==="/delete-user"||G==="/verify-email"||G==="/revoke-sessions"||G==="/revoke-session"||G==="/change-email"}}];for(const G of R)G.getAtoms&&Object.assign(E,(Y=G.getAtoms)==null?void 0:Y.call(G,x)),G.pathMethods&&Object.assign(A,G.pathMethods),G.atomListeners&&N.push(...G.atomListeners);const S={notify:G=>{E[G].set(!E[G].get())},listen:(G,K)=>{E[G].subscribe(K)},atoms:E};for(const G of R)G.getActions&&Object.assign(O,(fe=G.getActions)==null?void 0:fe.call(G,x,S,a));return{get baseURL(){return o},pluginsActions:O,pluginsAtoms:E,pluginPathMethods:A,atomListeners:N,$fetch:x,$store:S}};function Y1(a){return typeof a=="object"&&a!==null&&"get"in a&&typeof a.get=="function"&&"lc"in a&&typeof a.lc=="number"}function J1(a,n,l){const o=n[a],{fetchOptions:c,query:d,...m}=l||{};return o||(c!=null&&c.method?c.method:m&&Object.keys(m).length>0?"POST":"GET")}function Q1(a,n,l,o,c){function d(m=[]){return new Proxy(function(){},{get(p,g){if(typeof g!="string"||g==="then"||g==="catch"||g==="finally")return;const h=[...m,g];let b=a;for(const x of h)if(b&&typeof b=="object"&&x in b)b=b[x];else{b=void 0;break}return typeof b=="function"||Y1(b)?b:d(h)},apply:async(p,g,h)=>{const b="/"+m.map(N=>N.replace(/[A-Z]/g,S=>`-${S.toLowerCase()}`)).join("/"),x=h[0]||{},w=h[1]||{},{query:T,fetchOptions:R,...O}=x,E={...w,...R},A=J1(b,l,x);return await n(b,{...E,body:A==="GET"?void 0:{...O,...(E==null?void 0:E.body)||{}},query:T||(E==null?void 0:E.query),method:A,async onSuccess(N){var P;if(await((P=E==null?void 0:E.onSuccess)==null?void 0:P.call(E,N)),!c||E.disableSignal)return;const S=c.filter($=>$.matcher(b));if(!S.length)return;const D=new Set;for(const $ of S){const B=o[$.signal];if(!B)return;if(D.has($.signal))continue;D.add($.signal);const L=B.get();setTimeout(()=>{B.set(!L)},10)}}})}})}return d()}function X1(a,n={}){const l=y.useRef(a.get()),{keys:o,deps:c=[a,o]}=n,d=y.useCallback(p=>{const g=h=>{l.current!==h&&(l.current=h,p())};return g(a.value),o!=null&&o.length?p1(a,o,g):a.listen(g)},c),m=()=>l.current;return y.useSyncExternalStore(d,m,m)}function Z1(a){return`use${Wv(a)}`}function W1(a){const{pluginPathMethods:n,pluginsActions:l,pluginsAtoms:o,$fetch:c,$store:d,atomListeners:m}=$1(a),p={};for(const[g,h]of Object.entries(o))p[Z1(g)]=()=>X1(h);return Q1({...l,...p,$fetch:c,$store:d},c,n,o,m)}const e2=a=>a?a.startsWith("/")?a:`/${a}`:"/api/auth/better",t2=a=>{if(typeof window>"u")return"";const n=Tl(),l=e2(a||"/api/auth/better");return`${window.location.origin}${n}${l}`},qg=a=>W1({baseURL:t2(a),fetchOptions:{credentials:"include"}}),r2=qg(),a2=async a=>{try{const n=await At("/auth/login",a);return n.success&&n.token?(Bg(n.token),n):{success:!1,message:n.message||"Login failed"}}catch(n){return console.error("Login error:",n),{success:!1,message:n instanceof Error?n.message:"An error occurred during login"}}},s2=async a=>{try{const n=await At("/auth/register",a);return n.success&&n.token?(Bg(n.token),n):{success:!1,message:n.message||"Registration failed"}}catch(n){return console.error("Register error:",n),{success:!1,message:"An error occurred during registration"}}},n2=async()=>{if(!kn())return{success:!1,message:"No authentication token"};try{return await Ue("/auth/user")}catch(n){return console.error("Get current user error:",n),{success:!1,message:"An error occurred while fetching user data"}}},Hu=async()=>{try{return await Ue("/better-auth/user")}catch(a){return console.error("Get Better Auth user error:",a),{success:!1,message:"An error occurred while fetching user data"}}},l2=async a=>{if(!kn())return{success:!1,message:"No authentication token"};try{return await At("/auth/change-password",a)}catch(l){return console.error("Change password error:",l),{success:!1,message:"An error occurred while changing password"}}},i2=()=>{co(),r2.signOut().catch(a=>{console.debug("Better Auth sign out failed:",a)})},Fg=async()=>{var a,n,l;try{const o=Tl(),c=await xd(`${o}/public-config`,{method:"GET",headers:{"Content-Type":"application/json"}});if(c.ok){const d=await c.json();return{skipAuth:((a=d.data)==null?void 0:a.skipAuth)===!0,permissions:((n=d.data)==null?void 0:n.permissions)||{},betterAuth:(l=d.data)==null?void 0:l.betterAuth}}return{skipAuth:!1}}catch(o){return console.debug("Failed to get public config:",o),{skipAuth:!1}}},ea={isAuthenticated:!1,loading:!0,user:null,error:null},Vg=y.createContext({auth:ea,login:async()=>({success:!1}),register:async()=>!1,logout:()=>{}}),o2=({children:a})=>{const[n,l]=y.useState(ea);y.useEffect(()=>{(async()=>{const{skipAuth:p,permissions:g}=await Fg();if(p){l({isAuthenticated:!0,loading:!1,user:{username:"guest",isAdmin:!0,permissions:g},error:null});return}if(!kn()){const b=await Hu();if(b.success&&b.user){l({isAuthenticated:!0,loading:!1,user:b.user,error:null});return}l({...ea,loading:!1});return}try{const b=await n2();if(b.success&&b.user)l({isAuthenticated:!0,loading:!1,user:b.user,error:null});else{co();const x=await Hu();x.success&&x.user?l({isAuthenticated:!0,loading:!1,user:x.user,error:null}):l({...ea,loading:!1})}}catch{co();const x=await Hu();x.success&&x.user?l({isAuthenticated:!0,loading:!1,user:x.user,error:null}):l({...ea,loading:!1})}})()},[]);const o=async(m,p)=>{try{const g=await a2({username:m,password:p});return g.success&&g.token&&g.user?(l({isAuthenticated:!0,loading:!1,user:g.user,error:null}),{success:!0,isUsingDefaultPassword:g.isUsingDefaultPassword}):(l({...ea,loading:!1,error:g.message||"Authentication failed"}),{success:!1,message:g.message})}catch(g){return l({...ea,loading:!1,error:"Authentication failed"}),{success:!1,message:g instanceof Error?g.message:void 0}}},c=async(m,p,g=!1)=>{try{const h=await s2({username:m,password:p,isAdmin:g});return h.success&&h.token&&h.user?(l({isAuthenticated:!0,loading:!1,user:h.user,error:null}),!0):(l({...ea,loading:!1,error:h.message||"Registration failed"}),!1)}catch{return l({...ea,loading:!1,error:"Registration failed"}),!1}},d=()=>{i2(),l({...ea,loading:!1})};return r.jsx(Vg.Provider,{value:{auth:n,login:o,register:c,logout:d},children:a})},cs=()=>y.useContext(Vg),c2=(a,n,l,o)=>{var d,m,p,g;const c=[l,{code:n,...o||{}}];if((m=(d=a==null?void 0:a.services)==null?void 0:d.logger)!=null&&m.forward)return a.services.logger.forward(c,"warn","react-i18next::",!0);Rs(c[0])&&(c[0]=`react-i18next:: ${c[0]}`),(g=(p=a==null?void 0:a.services)==null?void 0:p.logger)!=null&&g.warn?a.services.logger.warn(...c):console!=null&&console.warn&&console.warn(...c)},Hh={},Wu=(a,n,l,o)=>{Rs(l)&&Hh[l]||(Rs(l)&&(Hh[l]=new Date),c2(a,n,l,o))},$g=(a,n)=>()=>{if(a.isInitialized)n();else{const l=()=>{setTimeout(()=>{a.off("initialized",l)},0),n()};a.on("initialized",l)}},ed=(a,n,l)=>{a.loadNamespaces(n,$g(a,l))},Gh=(a,n,l,o)=>{if(Rs(l)&&(l=[l]),a.options.preload&&a.options.preload.indexOf(n)>-1)return ed(a,l,o);l.forEach(c=>{a.options.ns.indexOf(c)<0&&a.options.ns.push(c)}),a.loadLanguages(n,$g(a,o))},u2=(a,n,l={})=>!n.languages||!n.languages.length?(Wu(n,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:n.languages}),!0):n.hasLoadedNamespace(a,{lng:l.lng,precheck:(o,c)=>{if(l.bindI18n&&l.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!c(o.isLanguageChangingTo,a))return!1}}),Rs=a=>typeof a=="string",d2=a=>typeof a=="object"&&a!==null,m2=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,f2={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},p2=a=>f2[a],h2=a=>a.replace(m2,p2);let td={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:h2};const g2=(a={})=>{td={...td,...a}},x2=()=>td;let Yg;const y2=a=>{Yg=a},b2=()=>Yg,v2={type:"3rdParty",init(a){g2(a.options.react),y2(a)}},w2=y.createContext();class S2{constructor(){this.usedNamespaces={}}addUsedNamespaces(n){n.forEach(l=>{this.usedNamespaces[l]||(this.usedNamespaces[l]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const j2=(a,n)=>{const l=y.useRef();return y.useEffect(()=>{l.current=a},[a,n]),l.current},Jg=(a,n,l,o)=>a.getFixedT(n,l,o),N2=(a,n,l,o)=>y.useCallback(Jg(a,n,l,o),[a,n,l,o]),Ce=(a,n={})=>{var D,P,$,B;const{i18n:l}=n,{i18n:o,defaultNS:c}=y.useContext(w2)||{},d=l||o||b2();if(d&&!d.reportNamespaces&&(d.reportNamespaces=new S2),!d){Wu(d,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const L=(fe,G)=>Rs(G)?G:d2(G)&&Rs(G.defaultValue)?G.defaultValue:Array.isArray(fe)?fe[fe.length-1]:fe,Y=[L,{},!1];return Y.t=L,Y.i18n={},Y.ready=!1,Y}(D=d.options.react)!=null&&D.wait&&Wu(d,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const m={...x2(),...d.options.react,...n},{useSuspense:p,keyPrefix:g}=m;let h=c||((P=d.options)==null?void 0:P.defaultNS);h=Rs(h)?[h]:h||["translation"],(B=($=d.reportNamespaces).addUsedNamespaces)==null||B.call($,h);const b=(d.isInitialized||d.initializedStoreOnce)&&h.every(L=>u2(L,d,m)),x=N2(d,n.lng||null,m.nsMode==="fallback"?h:h[0],g),w=()=>x,T=()=>Jg(d,n.lng||null,m.nsMode==="fallback"?h:h[0],g),[R,O]=y.useState(w);let E=h.join();n.lng&&(E=`${n.lng}${E}`);const A=j2(E),N=y.useRef(!0);y.useEffect(()=>{const{bindI18n:L,bindI18nStore:Y}=m;N.current=!0,!b&&!p&&(n.lng?Gh(d,n.lng,h,()=>{N.current&&O(T)}):ed(d,h,()=>{N.current&&O(T)})),b&&A&&A!==E&&N.current&&O(T);const fe=()=>{N.current&&O(T)};return L&&(d==null||d.on(L,fe)),Y&&(d==null||d.store.on(Y,fe)),()=>{N.current=!1,d&&L&&(L==null||L.split(" ").forEach(G=>d.off(G,fe))),Y&&d&&Y.split(" ").forEach(G=>d.store.off(G,fe))}},[d,E]),y.useEffect(()=>{N.current&&b&&O(w)},[d,g,b]);const S=[R,d,b];if(S.t=R,S.i18n=d,S.ready=b,b||!b&&!p)return S;throw new Promise(L=>{n.lng?Gh(d,n.lng,h,()=>L()):ed(d,h,()=>L())})};/**
61
+ * @license lucide-react v0.552.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 C2=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),k2=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,l,o)=>o?o.toUpperCase():l.toLowerCase()),Kh=a=>{const n=k2(a);return n.charAt(0).toUpperCase()+n.slice(1)},Qg=(...a)=>a.filter((n,l,o)=>!!n&&n.trim()!==""&&o.indexOf(n)===l).join(" ").trim(),A2=a=>{for(const n in a)if(n.startsWith("aria-")||n==="role"||n==="title")return!0};/**
66
+ * @license lucide-react v0.552.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 E2={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.552.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 T2=y.forwardRef(({color:a="currentColor",size:n=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:d,iconNode:m,...p},g)=>y.createElement("svg",{ref:g,...E2,width:n,height:n,stroke:a,strokeWidth:o?Number(l)*24/Number(n):l,className:Qg("lucide",c),...!d&&!A2(p)&&{"aria-hidden":"true"},...p},[...m.map(([h,b])=>y.createElement(h,b)),...Array.isArray(d)?d:[d]]));/**
76
+ * @license lucide-react v0.552.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 mt=(a,n)=>{const l=y.forwardRef(({className:o,...c},d)=>y.createElement(T2,{ref:d,iconNode:n,className:Qg(`lucide-${C2(Kh(a))}`,`lucide-${a}`,o),...c}));return l.displayName=Kh(a),l};/**
81
+ * @license lucide-react v0.552.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 R2=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Xg=mt("book-open",R2);/**
86
+ * @license lucide-react v0.552.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 O2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],os=mt("check",O2);/**
91
+ * @license lucide-react v0.552.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 z2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Rl=mt("chevron-down",z2);/**
96
+ * @license lucide-react v0.552.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 M2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],bd=mt("chevron-right",M2);/**
101
+ * @license lucide-react v0.552.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 L2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],vd=mt("circle-alert",L2);/**
106
+ * @license lucide-react v0.552.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 D2=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Zg=mt("circle-check-big",D2);/**
111
+ * @license lucide-react v0.552.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 P2=[["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"}]],Wg=mt("circle-x",P2);/**
116
+ * @license lucide-react v0.552.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 U2=[["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"}]],wn=mt("copy",U2);/**
121
+ * @license lucide-react v0.552.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 _2=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],B2=mt("download",_2);/**
126
+ * @license lucide-react v0.552.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 I2=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],H2=mt("file-code",I2);/**
131
+ * @license lucide-react v0.552.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 G2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],K2=mt("info",G2);/**
136
+ * @license lucide-react v0.552.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 q2=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],F2=mt("link",q2);/**
141
+ * @license lucide-react v0.552.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 V2=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],e0=mt("loader",V2);/**
146
+ * @license lucide-react v0.552.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 $2=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Y2=mt("log-out",$2);/**
151
+ * @license lucide-react v0.552.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 J2=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],Q2=mt("moon",J2);/**
156
+ * @license lucide-react v0.552.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 X2=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],t0=mt("play",X2);/**
161
+ * @license lucide-react v0.552.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 Z2=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],W2=mt("refresh-cw",Z2);/**
166
+ * @license lucide-react v0.552.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 ew=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],tw=mt("settings",ew);/**
171
+ * @license lucide-react v0.552.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 rw=[["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"}]],Ol=mt("square-pen",rw);/**
176
+ * @license lucide-react v0.552.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 aw=[["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"}]],sw=mt("sun",aw);/**
181
+ * @license lucide-react v0.552.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 nw=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],lw=mt("trash-2",nw);/**
186
+ * @license lucide-react v0.552.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 iw=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],r0=mt("trash",iw);/**
191
+ * @license lucide-react v0.552.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 ow=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],a0=mt("user",ow);/**
196
+ * @license lucide-react v0.552.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 cw=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],uw=mt("wrench",cw);/**
201
+ * @license lucide-react v0.552.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 dw=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Sn=mt("x",dw);function s0(a){var n,l,o="";if(typeof a=="string"||typeof a=="number")o+=a;else if(typeof a=="object")if(Array.isArray(a)){var c=a.length;for(n=0;n<c;n++)a[n]&&(l=s0(a[n]))&&(o&&(o+=" "),o+=l)}else for(l in a)a[l]&&(o&&(o+=" "),o+=l);return o}function mw(){for(var a,n,l=0,o="",c=arguments.length;l<c;l++)(a=arguments[l])&&(n=s0(a))&&(o&&(o+=" "),o+=n);return o}const wd="-",fw=a=>{const n=hw(a),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=a;return{getClassGroupId:m=>{const p=m.split(wd);return p[0]===""&&p.length!==1&&p.shift(),n0(p,n)||pw(m)},getConflictingClassGroupIds:(m,p)=>{const g=l[m]||[];return p&&o[m]?[...g,...o[m]]:g}}},n0=(a,n)=>{var m;if(a.length===0)return n.classGroupId;const l=a[0],o=n.nextPart.get(l),c=o?n0(a.slice(1),o):void 0;if(c)return c;if(n.validators.length===0)return;const d=a.join(wd);return(m=n.validators.find(({validator:p})=>p(d)))==null?void 0:m.classGroupId},qh=/^\[(.+)\]$/,pw=a=>{if(qh.test(a)){const n=qh.exec(a)[1],l=n==null?void 0:n.substring(0,n.indexOf(":"));if(l)return"arbitrary.."+l}},hw=a=>{const{theme:n,classGroups:l}=a,o={nextPart:new Map,validators:[]};for(const c in l)rd(l[c],o,c,n);return o},rd=(a,n,l,o)=>{a.forEach(c=>{if(typeof c=="string"){const d=c===""?n:Fh(n,c);d.classGroupId=l;return}if(typeof c=="function"){if(gw(c)){rd(c(o),n,l,o);return}n.validators.push({validator:c,classGroupId:l});return}Object.entries(c).forEach(([d,m])=>{rd(m,Fh(n,d),l,o)})})},Fh=(a,n)=>{let l=a;return n.split(wd).forEach(o=>{l.nextPart.has(o)||l.nextPart.set(o,{nextPart:new Map,validators:[]}),l=l.nextPart.get(o)}),l},gw=a=>a.isThemeGetter,xw=a=>{if(a<1)return{get:()=>{},set:()=>{}};let n=0,l=new Map,o=new Map;const c=(d,m)=>{l.set(d,m),n++,n>a&&(n=0,o=l,l=new Map)};return{get(d){let m=l.get(d);if(m!==void 0)return m;if((m=o.get(d))!==void 0)return c(d,m),m},set(d,m){l.has(d)?l.set(d,m):c(d,m)}}},ad="!",sd=":",yw=sd.length,bw=a=>{const{prefix:n,experimentalParseClassName:l}=a;let o=c=>{const d=[];let m=0,p=0,g=0,h;for(let R=0;R<c.length;R++){let O=c[R];if(m===0&&p===0){if(O===sd){d.push(c.slice(g,R)),g=R+yw;continue}if(O==="/"){h=R;continue}}O==="["?m++:O==="]"?m--:O==="("?p++:O===")"&&p--}const b=d.length===0?c:c.substring(g),x=vw(b),w=x!==b,T=h&&h>g?h-g:void 0;return{modifiers:d,hasImportantModifier:w,baseClassName:x,maybePostfixModifierPosition:T}};if(n){const c=n+sd,d=o;o=m=>m.startsWith(c)?d(m.substring(c.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:m,maybePostfixModifierPosition:void 0}}if(l){const c=o;o=d=>l({className:d,parseClassName:c})}return o},vw=a=>a.endsWith(ad)?a.substring(0,a.length-1):a.startsWith(ad)?a.substring(1):a,ww=a=>{const n=Object.fromEntries(a.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const c=[];let d=[];return o.forEach(m=>{m[0]==="["||n[m]?(c.push(...d.sort(),m),d=[]):d.push(m)}),c.push(...d.sort()),c}},Sw=a=>({cache:xw(a.cacheSize),parseClassName:bw(a),sortModifiers:ww(a),...fw(a)}),jw=/\s+/,Nw=(a,n)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c,sortModifiers:d}=n,m=[],p=a.trim().split(jw);let g="";for(let h=p.length-1;h>=0;h-=1){const b=p[h],{isExternal:x,modifiers:w,hasImportantModifier:T,baseClassName:R,maybePostfixModifierPosition:O}=l(b);if(x){g=b+(g.length>0?" "+g:g);continue}let E=!!O,A=o(E?R.substring(0,O):R);if(!A){if(!E){g=b+(g.length>0?" "+g:g);continue}if(A=o(R),!A){g=b+(g.length>0?" "+g:g);continue}E=!1}const N=d(w).join(":"),S=T?N+ad:N,D=S+A;if(m.includes(D))continue;m.push(D);const P=c(A,E);for(let $=0;$<P.length;++$){const B=P[$];m.push(S+B)}g=b+(g.length>0?" "+g:g)}return g};function Cw(){let a=0,n,l,o="";for(;a<arguments.length;)(n=arguments[a++])&&(l=l0(n))&&(o&&(o+=" "),o+=l);return o}const l0=a=>{if(typeof a=="string")return a;let n,l="";for(let o=0;o<a.length;o++)a[o]&&(n=l0(a[o]))&&(l&&(l+=" "),l+=n);return l};function kw(a,...n){let l,o,c,d=m;function m(g){const h=n.reduce((b,x)=>x(b),a());return l=Sw(h),o=l.cache.get,c=l.cache.set,d=p,p(g)}function p(g){const h=o(g);if(h)return h;const b=Nw(g,l);return c(g,b),b}return function(){return d(Cw.apply(null,arguments))}}const Dt=a=>{const n=l=>l[a]||[];return n.isThemeGetter=!0,n},i0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,o0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Aw=/^\d+\/\d+$/,Ew=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Tw=/\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$/,Rw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ow=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,gn=a=>Aw.test(a),Pe=a=>!!a&&!Number.isNaN(Number(a)),ns=a=>!!a&&Number.isInteger(Number(a)),Gu=a=>a.endsWith("%")&&Pe(a.slice(0,-1)),Ea=a=>Ew.test(a),Mw=()=>!0,Lw=a=>Tw.test(a)&&!Rw.test(a),c0=()=>!1,Dw=a=>Ow.test(a),Pw=a=>zw.test(a),Uw=a=>!je(a)&&!Ne(a),_w=a=>An(a,m0,c0),je=a=>i0.test(a),Ts=a=>An(a,f0,Lw),Ku=a=>An(a,Kw,Pe),Vh=a=>An(a,u0,c0),Bw=a=>An(a,d0,Pw),Qi=a=>An(a,p0,Dw),Ne=a=>o0.test(a),wl=a=>En(a,f0),Iw=a=>En(a,qw),$h=a=>En(a,u0),Hw=a=>En(a,m0),Gw=a=>En(a,d0),Xi=a=>En(a,p0,!0),An=(a,n,l)=>{const o=i0.exec(a);return o?o[1]?n(o[1]):l(o[2]):!1},En=(a,n,l=!1)=>{const o=o0.exec(a);return o?o[1]?n(o[1]):l:!1},u0=a=>a==="position"||a==="percentage",d0=a=>a==="image"||a==="url",m0=a=>a==="length"||a==="size"||a==="bg-size",f0=a=>a==="length",Kw=a=>a==="number",qw=a=>a==="family-name",p0=a=>a==="shadow",Fw=()=>{const a=Dt("color"),n=Dt("font"),l=Dt("text"),o=Dt("font-weight"),c=Dt("tracking"),d=Dt("leading"),m=Dt("breakpoint"),p=Dt("container"),g=Dt("spacing"),h=Dt("radius"),b=Dt("shadow"),x=Dt("inset-shadow"),w=Dt("text-shadow"),T=Dt("drop-shadow"),R=Dt("blur"),O=Dt("perspective"),E=Dt("aspect"),A=Dt("ease"),N=Dt("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...D(),Ne,je],$=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto","contain","none"],L=()=>[Ne,je,g],Y=()=>[gn,"full","auto",...L()],fe=()=>[ns,"none","subgrid",Ne,je],G=()=>["auto",{span:["full",ns,Ne,je]},ns,Ne,je],K=()=>[ns,"auto",Ne,je],X=()=>["auto","min","max","fr",Ne,je],H=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],C=()=>["auto",...L()],I=()=>[gn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],U=()=>[a,Ne,je],oe=()=>[...D(),$h,Vh,{position:[Ne,je]}],V=()=>["no-repeat",{repeat:["","x","y","space","round"]}],j=()=>["auto","cover","contain",Hw,_w,{size:[Ne,je]}],M=()=>[Gu,wl,Ts],z=()=>["","none","full",h,Ne,je],q=()=>["",Pe,wl,Ts],pe=()=>["solid","dashed","dotted","double"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[Pe,Gu,$h,Vh],ge=()=>["","none",R,Ne,je],re=()=>["none",Pe,Ne,je],ye=()=>["none",Pe,Ne,je],ue=()=>[Pe,Ne,je],ie=()=>[gn,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ea],breakpoint:[Ea],color:[Mw],container:[Ea],"drop-shadow":[Ea],ease:["in","out","in-out"],font:[Uw],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ea],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ea],shadow:[Ea],spacing:["px",Pe],text:[Ea],"text-shadow":[Ea],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",gn,je,Ne,E]}],container:["container"],columns:[{columns:[Pe,je,Ne,p]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"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"],sr:["sr-only","not-sr-only"],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:P()}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Y()}],"inset-x":[{"inset-x":Y()}],"inset-y":[{"inset-y":Y()}],start:[{start:Y()}],end:[{end:Y()}],top:[{top:Y()}],right:[{right:Y()}],bottom:[{bottom:Y()}],left:[{left:Y()}],visibility:["visible","invisible","collapse"],z:[{z:[ns,"auto",Ne,je]}],basis:[{basis:[gn,"full","auto",p,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Pe,gn,"auto","initial","none",je]}],grow:[{grow:["",Pe,Ne,je]}],shrink:[{shrink:["",Pe,Ne,je]}],order:[{order:[ns,"first","last","none",Ne,je]}],"grid-cols":[{"grid-cols":fe()}],"col-start-end":[{col:G()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":fe()}],"row-start-end":[{row:G()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...H(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...H()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":H()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:I()}],w:[{w:[p,"screen",...I()]}],"min-w":[{"min-w":[p,"screen","none",...I()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[m]},...I()]}],h:[{h:["screen","lh",...I()]}],"min-h":[{"min-h":["screen","lh","none",...I()]}],"max-h":[{"max-h":["screen","lh",...I()]}],"font-size":[{text:["base",l,wl,Ts]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Ne,Ku]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Gu,je]}],"font-family":[{font:[Iw,je,n]}],"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:[c,Ne,je]}],"line-clamp":[{"line-clamp":[Pe,"none",Ne,Ku]}],leading:[{leading:[d,...L()]}],"list-image":[{"list-image":["none",Ne,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ne,je]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...pe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Pe,"from-font","auto",Ne,Ts]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[Pe,"auto",Ne,je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ne,je]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ne,je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:oe()}],"bg-repeat":[{bg:V()}],"bg-size":[{bg:j()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ns,Ne,je],radial:["",Ne,je],conic:[ns,Ne,je]},Gw,Bw]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:M()}],"gradient-via-pos":[{via:M()}],"gradient-to-pos":[{to:M()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:z()}],"rounded-s":[{"rounded-s":z()}],"rounded-e":[{"rounded-e":z()}],"rounded-t":[{"rounded-t":z()}],"rounded-r":[{"rounded-r":z()}],"rounded-b":[{"rounded-b":z()}],"rounded-l":[{"rounded-l":z()}],"rounded-ss":[{"rounded-ss":z()}],"rounded-se":[{"rounded-se":z()}],"rounded-ee":[{"rounded-ee":z()}],"rounded-es":[{"rounded-es":z()}],"rounded-tl":[{"rounded-tl":z()}],"rounded-tr":[{"rounded-tr":z()}],"rounded-br":[{"rounded-br":z()}],"rounded-bl":[{"rounded-bl":z()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...pe(),"hidden","none"]}],"divide-style":[{divide:[...pe(),"hidden","none"]}],"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:[...pe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Pe,Ne,je]}],"outline-w":[{outline:["",Pe,wl,Ts]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",b,Xi,Qi]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",x,Xi,Qi]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Pe,Ts]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",w,Xi,Qi]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Pe,Ne,je]}],"mix-blend":[{"mix-blend":[...se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Pe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[Ne,je]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":D()}],"mask-image-conic-pos":[{"mask-conic":[Pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:oe()}],"mask-repeat":[{mask:V()}],"mask-size":[{mask:j()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ne,je]}],filter:[{filter:["","none",Ne,je]}],blur:[{blur:ge()}],brightness:[{brightness:[Pe,Ne,je]}],contrast:[{contrast:[Pe,Ne,je]}],"drop-shadow":[{"drop-shadow":["","none",T,Xi,Qi]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",Pe,Ne,je]}],"hue-rotate":[{"hue-rotate":[Pe,Ne,je]}],invert:[{invert:["",Pe,Ne,je]}],saturate:[{saturate:[Pe,Ne,je]}],sepia:[{sepia:["",Pe,Ne,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Ne,je]}],"backdrop-blur":[{"backdrop-blur":ge()}],"backdrop-brightness":[{"backdrop-brightness":[Pe,Ne,je]}],"backdrop-contrast":[{"backdrop-contrast":[Pe,Ne,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Pe,Ne,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Pe,Ne,je]}],"backdrop-invert":[{"backdrop-invert":["",Pe,Ne,je]}],"backdrop-opacity":[{"backdrop-opacity":[Pe,Ne,je]}],"backdrop-saturate":[{"backdrop-saturate":[Pe,Ne,je]}],"backdrop-sepia":[{"backdrop-sepia":["",Pe,Ne,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ne,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Pe,"initial",Ne,je]}],ease:[{ease:["linear","initial",A,Ne,je]}],delay:[{delay:[Pe,Ne,je]}],animate:[{animate:["none",N,Ne,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[O,Ne,je]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":["scale-3d"],skew:[{skew:ue()}],"skew-x":[{"skew-x":ue()}],"skew-y":[{"skew-y":ue()}],transform:[{transform:[Ne,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ie()}],"translate-x":[{"translate-x":ie()}],"translate-y":[{"translate-y":ie()}],"translate-z":[{"translate-z":ie()}],"translate-none":["translate-none"],accent:[{accent:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],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",Ne,je]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",Ne,je]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[Pe,wl,Ts,Ku]}],stroke:[{stroke:["none",...U()]}],"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-x","border-w-y","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-x","border-color-y","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"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"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"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Vw=kw(Fw);function Oa(...a){return Vw(mw(a))}const $w=({message:a,type:n="info",duration:l=3e3,onClose:o,visible:c})=>{const{t:d}=Ce();y.useEffect(()=>{if(c){const h=setTimeout(()=>{o()},l);return()=>clearTimeout(h)}},[c,l,o]);const m={success:r.jsx(os,{className:"w-5 h-5 text-green-500"}),error:r.jsx(Sn,{className:"w-5 h-5 text-red-500"}),info:r.jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),warning:r.jsx("svg",{className:"w-5 h-5 text-yellow-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})},p={success:"bg-green-50 border-green-200",error:"bg-red-50 border-red-200",info:"bg-blue-50 border-blue-200",warning:"bg-yellow-50 border-yellow-200"},g={success:"text-green-800",error:"text-red-800",info:"text-blue-800",warning:"text-yellow-800"};return r.jsx("div",{className:Oa("fixed top-4 right-4 z-50 max-w-sm p-4 rounded-md shadow-lg border",p[n],"transform transition-all duration-300 ease-in-out",c?"translate-x-0 opacity-100":"translate-x-full opacity-0"),children:r.jsxs("div",{className:"flex items-start",children:[r.jsx("div",{className:"flex-shrink-0",children:m[n]}),r.jsx("div",{className:"ml-3",children:r.jsx("p",{className:Oa("text-sm font-medium",g[n]),children:a})}),r.jsx("div",{className:"ml-auto pl-3",children:r.jsx("div",{className:"-mx-1.5 -my-1.5",children:r.jsxs("button",{onClick:o,className:Oa("inline-flex rounded-md p-1.5",`hover:bg-${n}-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-${n}-500`),children:[r.jsx("span",{className:"sr-only",children:d("common.dismiss")}),r.jsx(Sn,{className:"h-5 w-5"})]})})})]})})},h0=y.createContext(void 0),us=()=>{const a=y.useContext(h0);if(!a)throw new Error("useToast must be used within a ToastProvider");return a},Yw=({children:a})=>{const[n,l]=y.useState({message:"",type:"info",visible:!1,duration:3e3}),o=y.useCallback((d,m="info",p=3e3)=>{l({message:d,type:m,visible:!0,duration:p})},[]),c=y.useCallback(()=>{l(d=>({...d,visible:!1}))},[]);return r.jsxs(h0.Provider,{value:{showToast:o},children:[a,r.jsx($w,{message:n.message,type:n.type,duration:n.duration,onClose:c,visible:n.visible})]})},g0=y.createContext(void 0),Jw=()=>{const a=y.useContext(g0);if(!a)throw new Error("useTheme must be used within a ThemeProvider");return a},Qw=({children:a})=>{const[n,l]=y.useState(()=>localStorage.getItem("theme")||"system"),[o,c]=y.useState("light"),d=m=>{l(m),localStorage.setItem("theme",m)};return y.useEffect(()=>{const m=()=>{const g=window.document.documentElement,h=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",b=n==="system"?h:n;c(b),b==="dark"?(console.log("Applying dark mode to HTML root element"),g.classList.add("dark"),document.body.style.backgroundColor="#111827"):(console.log("Removing dark mode from HTML root element"),g.classList.remove("dark"),document.body.style.backgroundColor="")},p=window.matchMedia("(prefers-color-scheme: dark)");return p.addEventListener("change",m),m(),()=>{p.removeEventListener("change",m)}},[n]),r.jsx(g0.Provider,{value:{theme:n,setTheme:d,resolvedTheme:o},children:a})},Zi={startup:{maxAttempts:60,pollingInterval:3e3},normal:{pollingInterval:1e4}},x0=y.createContext(void 0),Xw=({children:a})=>{const{t:n}=Ce(),{auth:l}=cs(),[o,c]=y.useState([]),[d,m]=y.useState([]),[p,g]=y.useState(null),[h,b]=y.useState(0),[x,w]=y.useState(!0),[T,R]=y.useState(0),[O,E]=y.useState(null),[A,N]=y.useState(1),[S,D]=y.useState(5),P=y.useRef(null),$=y.useRef(0),B=y.useRef(0),L=3e3,Y=()=>{P.current&&(clearInterval(P.current),P.current=null)},fe=y.useCallback(j=>{const M=(j==null?void 0:j.immediate)??!0;Y();const z=async()=>{try{console.log("[ServerContext] Fetching servers from API...");const q=new URLSearchParams;q.append("page",A.toString()),q.append("limit",S.toString());const[pe,se]=await Promise.all([Ue(`/servers?${q.toString()}`),Ue("/servers")]);B.current=Date.now(),pe&&pe.success&&Array.isArray(pe.data)?(c(pe.data),pe.pagination?E(pe.pagination):E(null)):pe&&Array.isArray(pe)?(c(pe),E(null)):(console.error("Invalid server data format:",pe),c([]),E(null)),se&&se.success&&Array.isArray(se.data)?m(se.data):se&&Array.isArray(se)?m(se):m([]),g(null)}catch(q){console.error("Error fetching servers during normal polling:",q),navigator.onLine?q instanceof TypeError&&(q.message.includes("NetworkError")||q.message.includes("Failed to fetch"))?g(n("errors.serverConnection")):g(n("errors.serverFetch")):g(n("errors.network"))}};M&&z(),P.current=setInterval(z,Zi.normal.pollingInterval)},[n,A,S]);y.useEffect(()=>{l.isAuthenticated?(console.log("[ServerContext] User authenticated, triggering refresh"),b(j=>j+1)):(console.log("[ServerContext] User not authenticated, clearing data and stopping polling"),Y(),c([]),m([]),w(!1),g(null))},[l.isAuthenticated]),y.useEffect(()=>{if(!l.isAuthenticated){console.log("[ServerContext] User not authenticated, skipping polling setup");return}h>0&&($.current=0,R(0));const j=async()=>{try{console.log("[ServerContext] Initial fetch - attempt",$.current+1);const M=new URLSearchParams;M.append("page",A.toString()),M.append("limit",S.toString());const[z,q]=await Promise.all([Ue(`/servers?${M.toString()}`),Ue("/servers")]);return B.current=Date.now(),z&&z.success&&Array.isArray(z.data)?(c(z.data),z.pagination?E(z.pagination):E(null)):z&&Array.isArray(z)?(c(z),E(null)):(console.error("Invalid server data format:",z),c([]),E(null)),q&&q.success&&Array.isArray(q.data)?m(q.data):q&&Array.isArray(q)?m(q):m([]),w(!1),fe({immediate:!1}),!0}catch(M){return $.current+=1,console.error(`Initial loading attempt ${$.current} failed:`,M),R($.current),navigator.onLine?g(n("errors.initialStartup")):g(n("errors.network")),$.current>=Zi.startup.maxAttempts&&(console.log("Maximum startup attempts reached, switching to normal polling"),w(!1),Y(),fe()),!1}};return x?(Y(),j(),P.current=setInterval(j,Zi.startup.pollingInterval),console.log(`Started initial polling with interval: ${Zi.startup.pollingInterval}ms`)):fe(),()=>{Y()}},[h,n,x,fe,A,S]),y.useEffect(()=>{if(!O)return;const j=Math.max(1,O.totalPages||1);A>j&&N(j)},[O,A]);const G=y.useCallback(()=>{Y(),x&&(w(!0),$.current=0,R(0)),b(j=>j+1)},[x]),K=y.useCallback(()=>{const M=Date.now()-B.current;console.log("[ServerContext] refreshIfNeeded called, time since last fetch:",M,"ms"),M>=L?(console.log("[ServerContext] Triggering refresh (exceeded MIN_REFRESH_INTERVAL:",L,"ms)"),G()):console.log("[ServerContext] Skipping refresh (MIN_REFRESH_INTERVAL:",L,"ms, time since last:",M,"ms)")},[G]),X=y.useCallback(()=>{b(j=>j+1)},[]),H=y.useCallback(async j=>{try{const M=encodeURIComponent(j.name),z=await Ue(`/servers/${M}`);return z&&z.success&&z.data?{name:z.data.name,status:z.data.status,tools:z.data.tools||[],config:z.data.config}:(console.error("Failed to get server config:",z),g(n("server.invalidConfig",{serverName:j.name})),null)}catch(M){return console.error("Error fetching server config:",M),g(M instanceof Error?M.message:String(M)),null}},[n]),Z=y.useCallback(async j=>{try{const M=encodeURIComponent(j),z=await Os(`/servers/${M}`);return!z||!z.success?(g((z==null?void 0:z.message)||n("server.deleteError",{serverName:j})),!1):(b(q=>q+1),!0)}catch(M){return g(n("errors.general")+": "+(M instanceof Error?M.message:String(M))),!1}},[n]),C=y.useCallback(async(j,M)=>{try{const z=encodeURIComponent(j.name),q=await At(`/servers/${z}/toggle`,{enabled:M});return!q||!q.success?(console.error("Failed to toggle server:",q),g((q==null?void 0:q.message)||n("server.toggleError",{serverName:j.name})),!1):(b(pe=>pe+1),!0)}catch(z){return console.error("Error toggling server:",z),g(z instanceof Error?z.message:String(z)),!1}},[n]),I=y.useCallback(async j=>{try{const M=encodeURIComponent(j.name),z=await At(`/servers/${M}/reload`,{});return!z||!z.success?(console.error("Failed to reload server:",z),g(n("server.reloadError",{serverName:j.name})),!1):(G(),!0)}catch(M){return console.error("Error reloading server:",M),g(M instanceof Error?M.message:String(M)),!1}},[n,G]),U=y.useCallback(j=>{N(j)},[]),oe=y.useCallback(j=>{D(j),N(1)},[]),V={servers:o,allServers:d,error:p,setError:g,isLoading:x,fetchAttempts:T,pagination:O,currentPage:A,serversPerPage:S,setCurrentPage:U,setServersPerPage:oe,triggerRefresh:G,refreshIfNeeded:K,handleServerAdd:X,handleServerEdit:H,handleServerRemove:Z,handleServerToggle:C,handleServerReload:I};return r.jsx(x0.Provider,{value:V,children:a})},y0=()=>{const a=y.useContext(x0);if(a===void 0)throw new Error("useServerContext must be used within a ServerProvider");return a},qu=()=>({enabled:!0,accessTokenLifetime:3600,refreshTokenLifetime:1209600,authorizationCodeLifetime:300,requireClientSecret:!1,allowedScopes:["read","write"],requireState:!1,dynamicRegistration:{enabled:!0,allowedGrantTypes:["authorization_code","refresh_token"],requiresAuthentication:!1}}),b0=y.createContext(void 0),Zw=()=>{const a=y.useContext(b0);if(!a)throw new Error("useSettings must be used within a SettingsProvider");return a},Ww=({children:a})=>{const{t:n}=Ce(),{showToast:l}=us(),{auth:o}=cs(),[c,d]=y.useState({enableGlobalRoute:!0,enableGroupNameRoute:!0,enableBearerAuth:!0,bearerAuthKey:"",skipAuth:!1}),[m,p]=y.useState({bearerAuthKey:""}),[g,h]=y.useState({pythonIndexUrl:"",npmRegistry:"",baseUrl:"http://localhost:3000"}),[b,x]=y.useState({enabled:!1,dbUrl:"",embeddingProvider:"openai",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:"",azureOpenaiEndpoint:"",azureOpenaiApiKey:"",azureOpenaiApiVersion:"",azureOpenaiEmbeddingDeployment:"",progressiveDisclosure:!1}),[w,T]=y.useState({apiKey:"",referer:"https://www.mcphubx.com",title:"MCPHub",baseUrl:"https://api.mcprouter.to/v1"}),[R,O]=y.useState(qu()),[E,A]=y.useState("-"),[N,S]=y.useState(!1),[D,P]=y.useState([]),[$,B]=y.useState(!1),[L,Y]=y.useState(null),[fe,G]=y.useState(0),K=y.useCallback(()=>{G(ue=>ue+1)},[]),X=y.useCallback(async()=>{var ue,ie,xe,Xe,Ft,Vt,Ze,gt,$t,Ut,Yt,It,pr,tt,wt,ir,ze,St;B(!0),Y(null);try{const ke=await Ue("/settings");if(ke.success&&((ie=(ue=ke.data)==null?void 0:ue.systemConfig)!=null&&ie.routing)&&d({enableGlobalRoute:ke.data.systemConfig.routing.enableGlobalRoute??!0,enableGroupNameRoute:ke.data.systemConfig.routing.enableGroupNameRoute??!0,enableBearerAuth:ke.data.systemConfig.routing.enableBearerAuth??!0,bearerAuthKey:ke.data.systemConfig.routing.bearerAuthKey||"",skipAuth:ke.data.systemConfig.routing.skipAuth??!1}),ke.success&&((Xe=(xe=ke.data)==null?void 0:xe.systemConfig)!=null&&Xe.install)&&h({pythonIndexUrl:ke.data.systemConfig.install.pythonIndexUrl||"",npmRegistry:ke.data.systemConfig.install.npmRegistry||"",baseUrl:ke.data.systemConfig.install.baseUrl||"http://localhost:3000"}),ke.success&&((Vt=(Ft=ke.data)==null?void 0:Ft.systemConfig)!=null&&Vt.smartRouting)&&x({enabled:ke.data.systemConfig.smartRouting.enabled??!1,dbUrl:ke.data.systemConfig.smartRouting.dbUrl||"",embeddingProvider:ke.data.systemConfig.smartRouting.embeddingProvider==="azure_openai"?"azure_openai":"openai",openaiApiBaseUrl:ke.data.systemConfig.smartRouting.openaiApiBaseUrl||"",openaiApiKey:ke.data.systemConfig.smartRouting.openaiApiKey||"",openaiApiEmbeddingModel:ke.data.systemConfig.smartRouting.openaiApiEmbeddingModel||"",azureOpenaiEndpoint:ke.data.systemConfig.smartRouting.azureOpenaiEndpoint||"",azureOpenaiApiKey:ke.data.systemConfig.smartRouting.azureOpenaiApiKey||"",azureOpenaiApiVersion:ke.data.systemConfig.smartRouting.azureOpenaiApiVersion||"",azureOpenaiEmbeddingDeployment:ke.data.systemConfig.smartRouting.azureOpenaiEmbeddingDeployment||"",progressiveDisclosure:ke.data.systemConfig.smartRouting.progressiveDisclosure??!1}),ke.success&&((gt=(Ze=ke.data)==null?void 0:Ze.systemConfig)!=null&&gt.mcpRouter)&&T({apiKey:ke.data.systemConfig.mcpRouter.apiKey||"",referer:ke.data.systemConfig.mcpRouter.referer||"https://www.mcphubx.com",title:ke.data.systemConfig.mcpRouter.title||"MCPHub",baseUrl:ke.data.systemConfig.mcpRouter.baseUrl||"https://api.mcprouter.to/v1"}),ke.success)if((Ut=($t=ke.data)==null?void 0:$t.systemConfig)!=null&&Ut.oauthServer){const nt=ke.data.systemConfig.oauthServer,lt=qu(),ar=lt.dynamicRegistration,Jt=Array.isArray(nt.allowedScopes)?[...nt.allowedScopes]:[...lt.allowedScopes],ft=Array.isArray((Yt=nt.dynamicRegistration)==null?void 0:Yt.allowedGrantTypes)?[...nt.dynamicRegistration.allowedGrantTypes]:[...ar.allowedGrantTypes];O({enabled:nt.enabled??lt.enabled,accessTokenLifetime:nt.accessTokenLifetime??lt.accessTokenLifetime,refreshTokenLifetime:nt.refreshTokenLifetime??lt.refreshTokenLifetime,authorizationCodeLifetime:nt.authorizationCodeLifetime??lt.authorizationCodeLifetime,requireClientSecret:nt.requireClientSecret??lt.requireClientSecret,requireState:nt.requireState??lt.requireState,allowedScopes:Jt,dynamicRegistration:{enabled:((It=nt.dynamicRegistration)==null?void 0:It.enabled)??ar.enabled,allowedGrantTypes:ft,requiresAuthentication:((pr=nt.dynamicRegistration)==null?void 0:pr.requiresAuthentication)??ar.requiresAuthentication}})}else O(qu());ke.success&&((wt=(tt=ke.data)==null?void 0:tt.systemConfig)==null?void 0:wt.nameSeparator)!==void 0&&A(ke.data.systemConfig.nameSeparator),ke.success&&((ze=(ir=ke.data)==null?void 0:ir.systemConfig)==null?void 0:ze.enableSessionRebuild)!==void 0&&S(ke.data.systemConfig.enableSessionRebuild),ke.success&&Array.isArray((St=ke.data)==null?void 0:St.bearerKeys)&&P(ke.data.bearerKeys)}catch(ke){console.error("Failed to fetch settings:",ke),Y(ke instanceof Error?ke.message:"Failed to fetch settings"),l(n("errors.failedToFetchSettings"))}finally{B(!1)}},[n,l]),H=async(ue,ie)=>{B(!0),Y(null);try{const xe=await Pt("/system-config",{routing:{[ue]:ie}});return xe.success?(d({...c,[ue]:ie}),l(n("settings.systemConfigUpdated")),!0):(Y(xe.error||"Failed to update routing config"),l(xe.error||n("errors.failedToUpdateRoutingConfig")),!1)}catch(xe){return console.error("Failed to update routing config:",xe),Y(xe instanceof Error?xe.message:"Failed to update routing config"),l(n("errors.failedToUpdateRoutingConfig")),!1}finally{B(!1)}},Z=async(ue,ie)=>{B(!0),Y(null);try{const xe=await Pt("/system-config",{install:{[ue]:ie}});return xe.success?(h({...g,[ue]:ie}),l(n("settings.systemConfigUpdated")),!0):(Y(xe.error||"Failed to update install config"),l(xe.error||n("errors.failedToUpdateInstallConfig")),!1)}catch(xe){return console.error("Failed to update install config:",xe),Y(xe instanceof Error?xe.message:"Failed to update install config"),l(n("errors.failedToUpdateInstallConfig")),!1}finally{B(!1)}},C=async(ue,ie)=>{B(!0),Y(null);try{const xe=await Pt("/system-config",{smartRouting:{[ue]:ie}});return xe.success?(x({...b,[ue]:ie}),l(n("settings.systemConfigUpdated")),!0):(Y(xe.error||"Failed to update smart routing config"),l(xe.error||n("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(xe){return console.error("Failed to update smart routing config:",xe),Y(xe instanceof Error?xe.message:"Failed to update smart routing config"),l(n("errors.failedToUpdateSmartRoutingConfig")),!1}finally{B(!1)}},I=async ue=>{B(!0),Y(null);try{const ie=await Pt("/system-config",{smartRouting:ue});return ie.success?(x({...b,...ue}),l(n("settings.systemConfigUpdated")),!0):(Y(ie.error||"Failed to update smart routing config"),l(ie.error||n("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(ie){return console.error("Failed to update smart routing config:",ie),Y(ie instanceof Error?ie.message:"Failed to update smart routing config"),l(n("errors.failedToUpdateSmartRoutingConfig")),!1}finally{B(!1)}},U=async ue=>{B(!0),Y(null);try{const ie=await Pt("/system-config",{routing:ue});return ie.success?(d({...c,...ue}),l(n("settings.systemConfigUpdated")),!0):(Y(ie.error||"Failed to update routing config"),l(ie.error||n("errors.failedToUpdateRoutingConfig")),!1)}catch(ie){return console.error("Failed to update routing config:",ie),Y(ie instanceof Error?ie.message:"Failed to update routing config"),l(n("errors.failedToUpdateRoutingConfig")),!1}finally{B(!1)}},oe=async(ue,ie)=>{B(!0),Y(null);try{const xe=await Pt("/system-config",{mcpRouter:{[ue]:ie}});return xe.success?(T({...w,[ue]:ie}),l(n("settings.systemConfigUpdated")),!0):(Y(xe.error||"Failed to update MCP Router config"),l(xe.error||n("errors.failedToUpdateMCPRouterConfig")),!1)}catch(xe){return console.error("Failed to update MCP Router config:",xe),Y(xe instanceof Error?xe.message:"Failed to update MCP Router config"),l(n("errors.failedToUpdateMCPRouterConfig")),!1}finally{B(!1)}},V=async ue=>{B(!0),Y(null);try{const ie=await Pt("/system-config",{mcpRouter:ue});return ie.success?(T({...w,...ue}),l(n("settings.systemConfigUpdated")),!0):(Y(ie.error||"Failed to update MCP Router config"),l(ie.error||n("errors.failedToUpdateMCPRouterConfig")),!1)}catch(ie){return console.error("Failed to update MCP Router config:",ie),Y(ie instanceof Error?ie.message:"Failed to update MCP Router config"),l(n("errors.failedToUpdateMCPRouterConfig")),!1}finally{B(!1)}},j=async(ue,ie)=>{B(!0),Y(null);try{const xe=await Pt("/system-config",{oauthServer:{[ue]:ie}});return xe.success?(O({...R,[ue]:ie}),l(n("settings.systemConfigUpdated")),!0):(Y(xe.error||"Failed to update OAuth server config"),l(xe.error||n("errors.failedToUpdateOAuthServerConfig")),!1)}catch(xe){return console.error("Failed to update OAuth server config:",xe),Y(xe instanceof Error?xe.message:"Failed to update OAuth server config"),l(n("errors.failedToUpdateOAuthServerConfig")),!1}finally{B(!1)}},M=async ue=>{B(!0),Y(null);try{const ie=await Pt("/system-config",{oauthServer:ue});return ie.success?(O({...R,...ue}),l(n("settings.systemConfigUpdated")),!0):(Y(ie.error||"Failed to update OAuth server config"),l(ie.error||n("errors.failedToUpdateOAuthServerConfig")),!1)}catch(ie){return console.error("Failed to update OAuth server config:",ie),Y(ie instanceof Error?ie.message:"Failed to update OAuth server config"),l(n("errors.failedToUpdateOAuthServerConfig")),!1}finally{B(!1)}},z=async ue=>{B(!0),Y(null);try{const ie=await Pt("/system-config",{nameSeparator:ue});return ie.success?(A(ue),l(n("settings.systemConfigUpdated")),!0):(Y(ie.error||"Failed to update name separator"),l(ie.error||n("errors.failedToUpdateNameSeparator")),!1)}catch(ie){return console.error("Failed to update name separator:",ie),Y(ie instanceof Error?ie.message:"Failed to update name separator"),l(n("errors.failedToUpdateNameSeparator")),!1}finally{B(!1)}},q=async ue=>{B(!0),Y(null);try{const ie=await Pt("/system-config",{enableSessionRebuild:ue});return ie.success?(S(ue),l(n("settings.systemConfigUpdated")),!0):(Y(ie.error||"Failed to update session rebuild setting"),l(ie.error||n("errors.failedToUpdateSessionRebuild")),!1)}catch(ie){return console.error("Failed to update session rebuild setting:",ie),Y(ie instanceof Error?ie.message:"Failed to update session rebuild setting"),l(n("errors.failedToUpdateSessionRebuild")),!1}finally{B(!1)}},pe=async ue=>{B(!0),Y(null);try{return await Ue(`/mcp-settings/export?serverName=${ue||""}`)}catch(ie){console.error("Failed to export MCP settings:",ie);const xe=ie instanceof Error?ie.message:"Failed to export MCP settings";Y(xe),l(xe)}finally{B(!1)}},se=async()=>{try{const ue=await Ue("/auth/keys");ue.success&&Array.isArray(ue.data)&&P(ue.data)}catch(ue){console.error("Failed to refresh bearer keys:",ue),l(n("errors.failedToFetchSettings"))}},Q=async ue=>{try{const ie=await At("/auth/keys",ue);return ie.success&&ie.data?(await se(),l(n("settings.systemConfigUpdated")),ie.data):(l(ie.message||n("errors.failedToUpdateRoutingConfig")),null)}catch(ie){return console.error("Failed to create bearer key:",ie),l(n("errors.failedToUpdateRoutingConfig")),null}},ge=async(ue,ie)=>{try{const xe=await Pt(`/auth/keys/${ue}`,ie);return xe.success&&xe.data?(await se(),l(n("settings.systemConfigUpdated")),xe.data):(l(xe.message||n("errors.failedToUpdateRoutingConfig")),null)}catch(xe){return console.error("Failed to update bearer key:",xe),l(n("errors.failedToUpdateRoutingConfig")),null}},re=async ue=>{try{const ie=await Os(`/auth/keys/${ue}`);return ie.success?(await se(),l(n("settings.systemConfigUpdated")),!0):(l(ie.message||n("errors.failedToUpdateRoutingConfig")),!1)}catch(ie){return console.error("Failed to delete bearer key:",ie),l(n("errors.failedToUpdateRoutingConfig")),!1}};y.useEffect(()=>{X()},[X,fe]),y.useEffect(()=>{o.isAuthenticated&&(console.log("[SettingsContext] User authenticated, triggering settings refresh"),K())},[o.isAuthenticated,K]),y.useEffect(()=>{c&&p({bearerAuthKey:c.bearerAuthKey})},[c]);const ye={routingConfig:c,tempRoutingConfig:m,setTempRoutingConfig:p,installConfig:g,smartRoutingConfig:b,mcpRouterConfig:w,oauthServerConfig:R,nameSeparator:E,enableSessionRebuild:N,bearerKeys:D,loading:$,error:L,setError:Y,triggerRefresh:K,fetchSettings:X,updateRoutingConfig:H,updateInstallConfig:Z,updateSmartRoutingConfig:C,updateSmartRoutingConfigBatch:I,updateRoutingConfigBatch:U,updateMCPRouterConfig:oe,updateMCPRouterConfigBatch:V,updateOAuthServerConfig:j,updateOAuthServerConfigBatch:M,updateNameSeparator:z,updateSessionRebuild:q,exportMCPSettings:pe,refreshBearerKeys:se,createBearerKey:Q,updateBearerKey:ge,deleteBearerKey:re};return r.jsx(b0.Provider,{value:ye,children:a})},v0=()=>{const{t:a}=Ce(),{theme:n,setTheme:l}=Jw(),o=()=>{l(n==="light"?"dark":"light")};return r.jsx("button",{onClick:o,className:"p-2 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none",title:a(n==="light"?"theme.dark":"theme.light"),"aria-label":a(n==="light"?"theme.dark":"theme.light"),children:n==="light"?r.jsx(Q2,{className:"h-5 w-5"}):r.jsx(sw,{className:"h-5 w-5"})})},eS=a=>{const{t:n}=Ce();return r.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeWidth:2,...a,children:[r.jsx("title",{children:n("common.language")}),r.jsx("circle",{cx:"12",cy:"12",r:"10"}),r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2 12h20"}),r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z"})]})},w0=()=>{const{i18n:a}=Ce(),[n,l]=y.useState(!1),[o,c]=y.useState(a.language),d=[{code:"en",label:"English"},{code:"zh",label:"中文"},{code:"fr",label:"Français"},{code:"tr",label:"Türkçe"}];y.useEffect(()=>{c(a.language)},[a.language]),y.useEffect(()=>{const g=h=>{h.target.closest(".language-dropdown")||l(!1)};return n&&document.addEventListener("mousedown",g),()=>{document.removeEventListener("mousedown",g)}},[n]);const m=g=>{localStorage.setItem("i18nextLng",g),l(!1),window.location.reload()},p=()=>{l(!n)};return r.jsxs("div",{className:"relative language-dropdown",children:[r.jsx("button",{onClick:p,className:"p-2 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none","aria-label":"Language Switcher",children:r.jsx(eS,{className:"h-5 w-5"})}),n&&r.jsx("div",{className:"absolute right-0 mt-2 w-24 bg-white dark:bg-gray-800 rounded-md shadow-lg border border-gray-200 dark:border-gray-700 z-50",children:r.jsx("div",{children:d.map(g=>r.jsx("button",{onClick:()=>m(g.code),className:`flex items-center w-full px-4 py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-700 ${o.startsWith(g.code)?"bg-blue-50 text-blue-700":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-100"}`,children:g.label},g.code))})})]})},tS=a=>{const{t:n}=Ce();return r.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...a,children:[r.jsx("title",{children:n("common.github")}),r.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]})},rS=({onToggleSidebar:a})=>{const{t:n}=Ce();return r.jsx("header",{className:"bg-white dark:bg-gray-800 shadow-sm z-10",children:r.jsxs("div",{className:"flex justify-between items-center px-3 py-3",children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("button",{onClick:a,className:"p-2 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none","aria-label":n("app.toggleSidebar"),children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),r.jsx("h1",{className:"ml-4 text-xl font-bold text-gray-900 dark:text-white",children:n("app.title")})]}),r.jsxs("div",{className:"flex items-center space-x-1",children:[r.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400 mr-2",children:"v0.12.3"}),r.jsx("a",{href:"https://github.com/samanhappy/mcphub",target:"_blank",rel:"noopener noreferrer",className:"p-2 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700","aria-label":"GitHub Repository",children:r.jsx(tS,{className:"h-5 w-5"})}),r.jsx("a",{href:"https://docs.mcphubx.com",target:"_blank",rel:"noopener noreferrer",className:"p-2 rounded-md text-gray-500 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700","aria-label":"Documentation",children:r.jsx(Xg,{className:"h-5 w-5"})}),r.jsx(v0,{}),r.jsx(w0,{})]})]})})},ls=({permissions:a,fallback:n=null,children:l})=>S0(a)?r.jsx(r.Fragment,{children:l}):r.jsx(r.Fragment,{children:n}),S0=a=>{const{auth:n}=cs();if(!n.isAuthenticated||!n.user)return!1;const l=n.user.permissions||[];return a==="x"&&!l.includes("x")?!1:l.includes("*")||n.user.isAdmin?!0:(Array.isArray(a)?a:[a]).some(c=>l.includes(c))},aS="https://registry.npmjs.org",sS="@samanhappy/mcphub",j0=async()=>{try{const a=await fetch(`${aS}/${sS}/latest`);if(!a.ok)throw new Error(`Failed to fetch latest version: ${a.status}`);return(await a.json()).version||null}catch(a){return console.error("Error checking for latest version:",a),null}},N0=(a,n)=>{if(a==="dev")return-1;const l=a.split(".").map(Number),o=n.split(".").map(Number);for(let c=0;c<3;c++){const d=l[c]||0,m=o[c]||0;if(d>m)return-1;if(d<m)return 1}return 0},nS=({isOpen:a,onClose:n,version:l})=>{const{t:o}=Ce(),[c,d]=y.useState(!1),[m,p]=y.useState(""),[g,h]=y.useState(!1),b=async()=>{h(!0);try{const x=await j0();x&&(p(x),d(N0(l,x)>0))}catch(x){console.error("Failed to check for updates:",x)}finally{h(!1)}};return y.useEffect(()=>{a&&b()},[a,l]),a?r.jsx("div",{className:"fixed inset-0 bg-black/50 bg-opacity-30 z-50 flex items-center justify-center p-4",children:r.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:r.jsxs("div",{className:"p-6 relative",children:[r.jsx("button",{onClick:n,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400","aria-label":o("common.close"),children:r.jsx(Sn,{className:"h-5 w-5"})}),r.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:o("about.title")}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-gray-700 dark:text-gray-300",children:[o("about.currentVersion"),":"]}),r.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:l})]}),c&&m&&r.jsx("div",{className:"bg-blue-50 dark:bg-blue-900 p-3 rounded",children:r.jsxs("div",{className:"flex items-start",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx("svg",{className:"h-5 w-5 text-blue-600 dark:text-blue-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),r.jsxs("div",{className:"ml-3 flex-1 text-sm text-blue-700 dark:text-blue-300",children:[r.jsx("p",{children:o("about.newVersionAvailable",{version:m})}),r.jsx("p",{className:"mt-1",children:r.jsx("a",{href:"https://github.com/samanhappy/mcphub",target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 dark:text-blue-400 hover:underline",children:o("about.viewOnGitHub")})})]})]})}),r.jsxs("button",{onClick:b,disabled:g,className:`mt-4 inline-flex items-center px-4 py-2 border border-gray-200 dark:border-gray-600 rounded-md shadow-sm text-sm font-medium btn-secondary
206
+ ${g?"text-gray-400 dark:text-gray-500 bg-gray-100 dark:bg-gray-800":"text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600"} focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500`,children:[r.jsx(W2,{className:`h-4 w-4 mr-2 ${g?"animate-spin":""}`}),o(g?"about.checking":"about.checkForUpdates")]})]})]})})}):null},lS=({open:a,onOpenChange:n})=>{const{i18n:l,t:o}=Ce();return a?r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:r.jsxs("div",{className:"p-6 relative",children:[r.jsx("button",{onClick:()=>n(!1),className:"absolute top-4 right-4 text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400","aria-label":o("common.close"),children:r.jsx(Sn,{className:"h-5 w-5"})}),r.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:o("sponsor.title")}),r.jsx("div",{className:"flex flex-col items-center justify-center py-4",children:l.language==="zh"?r.jsx("img",{src:"./assets/reward.png",alt:o("sponsor.rewardAlt"),className:"max-w-full h-auto",style:{maxHeight:"400px"}}):r.jsxs("div",{className:"text-center",children:[r.jsx("p",{className:"mb-4 text-gray-700 dark:text-gray-300",children:o("sponsor.supportMessage")}),r.jsx("a",{href:"https://ko-fi.com/samanhappy",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center bg-[#13C3FF] text-white px-4 py-2 rounded-md hover:bg-[#00A5E5] transition-colors",children:o("sponsor.supportButton")})]})})]})})}):null},iS=({open:a,onOpenChange:n})=>{const{t:l}=Ce();return a?r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:r.jsxs("div",{className:"p-6 relative",children:[r.jsx("button",{onClick:()=>n(!1),className:"absolute top-4 right-4 text-gray-400 hover:text-gray-500 dark:text-gray-500 dark:hover:text-gray-400","aria-label":l("common.close"),children:r.jsx(Sn,{className:"h-5 w-5"})}),r.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:l("wechat.title")}),r.jsxs("div",{className:"flex flex-col items-center justify-center py-4",children:[r.jsx("img",{src:"./assets/wexin.png",alt:l("wechat.qrCodeAlt"),className:"max-w-full h-auto",style:{maxHeight:"400px"}}),r.jsx("p",{className:"mt-4 text-center text-gray-700 dark:text-gray-300",children:l("wechat.scanMessage")})]})]})})}):null},oS=a=>{const{t:n}=Ce();return r.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...a,children:[r.jsx("title",{children:n("common.wechat")}),r.jsx("path",{d:"M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 0 1 .213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 0 0 .167-.054l1.903-1.114a.864.864 0 0 1 .717-.098 10.16 10.16 0 0 0 2.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178A1.17 1.17 0 0 1 4.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178 1.17 1.17 0 0 1-1.162-1.178c0-.651.52-1.18 1.162-1.18zm5.34 2.867c-1.797-.052-3.746.512-5.28 1.786-1.72 1.428-2.687 3.72-1.78 6.22.942 2.453 3.666 4.229 6.884 4.229.826 0 1.622-.12 2.361-.336a.722.722 0 0 1 .598.082l1.584.926a.272.272 0 0 0 .14.047c.134 0 .24-.111.24-.247 0-.06-.023-.12-.038-.177l-.327-1.233a.582.582 0 0 1-.023-.156.49.49 0 0 1 .201-.398C23.024 18.48 24 16.82 24 14.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-.135-.01-.27-.027-.407-.03zm-2.53 3.274c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.97-.982zm4.844 0c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.969-.982z"})]})},cS=a=>{const{t:n}=Ce();return r.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...a,children:[r.jsx("title",{children:n("common.discord")}),r.jsx("path",{d:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"})]})},uS=a=>{const{t:n}=Ce();return r.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...a,children:[r.jsx("title",{children:n("sponsor.label")}),r.jsx("path",{d:"M17.625 1.499c-2.32 0-4.354 1.203-5.625 3.03-1.271-1.827-3.305-3.03-5.625-3.03C3.129 1.499 0 4.253 0 8.249c0 4.275 3.068 7.847 5.828 10.227a33.14 33.14 0 0 0 5.616 3.876l.028.017.008.003-.001.003c.163.085.342.126.521.125.179.001.358-.041.521-.125l-.001-.003.008-.003.028-.017a33.14 33.14 0 0 0 5.616-3.876C20.932 16.096 24 12.524 24 8.249c0-3.996-3.129-6.75-6.375-6.75zm-.919 15.275a30.766 30.766 0 0 1-4.703 3.316l-.004-.002-.004.002a30.955 30.955 0 0 1-4.703-3.316c-2.677-2.307-5.047-5.298-5.047-8.523 0-2.754 2.121-4.5 4.125-4.5 2.06 0 3.914 1.479 4.544 3.684.143.495.596.797 1.086.796.49.001.943-.302 1.085-.796.63-2.205 2.484-3.684 4.544-3.684 2.004 0 4.125 1.746 4.125 4.5 0 3.225-2.37 6.216-5.048 8.523z"})]})},dS=({collapsed:a,version:n})=>{var B;const{t:l,i18n:o}=Ce(),c=la(),{auth:d,logout:m}=cs(),[p,g]=y.useState(!1),[h,b]=y.useState(!1),[x,w]=y.useState(!1),[T,R]=y.useState(!1),[O,E]=y.useState(!1),A=y.useRef(null);y.useEffect(()=>{(async()=>{try{const Y=await j0();Y&&b(N0(n,Y)>0)}catch(Y){console.error("Error checking for new version:",Y)}})()},[n]),y.useEffect(()=>{const L=Y=>{A.current&&!A.current.contains(Y.target)&&g(!1)};return document.addEventListener("mousedown",L),()=>{document.removeEventListener("mousedown",L)}},[]);const N=()=>{c("/settings"),g(!1)},S=()=>{m(),c("/login")},D=()=>{w(!0),g(!1)},P=()=>{R(!0),g(!1)},$=()=>{E(!0),g(!1)};return r.jsxs("div",{ref:A,className:"relative",children:[r.jsxs("button",{onClick:()=>g(!p),className:`flex ${a?"justify-center":"items-center"} w-full p-2 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors rounded-md ${p?"bg-gray-100 dark:bg-gray-700":""}`,children:[r.jsxs("div",{className:"flex-shrink-0 relative",children:[r.jsx("div",{className:"w-5 h-5 flex items-center justify-center rounded-full border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-700",children:r.jsx(a0,{className:"h-4 w-4 text-gray-700 dark:text-gray-300"})}),h&&r.jsx("span",{className:"absolute -top-1 -right-1 block w-2 h-2 bg-red-500 rounded-full"})]}),!a&&r.jsx("div",{className:"ml-3 flex flex-col items-start",children:r.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:((B=d.user)==null?void 0:B.username)||l("auth.user")})})]}),p&&r.jsxs("div",{className:"absolute top-0 transform -translate-y-full left-0 w-full min-w-max bg-white border border-gray-200 dark:bg-gray-800 z-50",children:[r.jsxs("button",{onClick:P,className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700",children:[r.jsx(uS,{className:"h-4 w-4 mr-2"}),l("sponsor.label")]}),o.language==="zh"?r.jsxs("button",{onClick:$,className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700",children:[r.jsx(oS,{className:"h-4 w-4 mr-2"}),l("wechat.label")]}):r.jsxs("a",{href:"https://discord.gg/qMKNsn5Q",target:"_blank",rel:"noopener noreferrer",className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700",children:[r.jsx(cS,{className:"h-4 w-4 mr-2"}),l("discord.label")]}),r.jsxs("button",{onClick:N,className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700",children:[r.jsx(tw,{className:"h-4 w-4 mr-2"}),l("nav.settings")]}),r.jsxs("button",{onClick:D,className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 relative",children:[r.jsx(K2,{className:"h-4 w-4 mr-2"}),l("about.title"),h&&r.jsx("span",{className:"absolute top-2 right-4 block w-2 h-2 bg-red-500 rounded-full"})]}),r.jsx("div",{className:"border-t border-gray-200 dark:border-gray-600"}),r.jsxs("button",{onClick:S,className:"flex items-center w-full px-4 py-2 text-left text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700",children:[r.jsx(Y2,{className:"h-4 w-4 mr-2"}),l("app.logout")]})]}),r.jsx(nS,{isOpen:x,onClose:()=>w(!1),version:n}),r.jsx(lS,{open:T,onOpenChange:R}),r.jsx(iS,{open:O,onOpenChange:E})]})},mS=async()=>{var a;try{const n=await Ue("/activities/available");return((a=n==null?void 0:n.data)==null?void 0:a.available)||!1}catch(n){return console.error("Error checking activity availability:",n),!1}},fS=(a,n,l)=>{const o=new URLSearchParams;return o.append("page",a.toString()),o.append("limit",n.toString()),l!=null&&l.server&&o.append("server",l.server),l!=null&&l.tool&&o.append("tool",l.tool),l!=null&&l.status&&o.append("status",l.status),l!=null&&l.group&&o.append("group",l.group),l!=null&&l.keyId&&o.append("keyId",l.keyId),l!=null&&l.keyName&&o.append("keyName",l.keyName),l!=null&&l.startDate&&o.append("startDate",l.startDate),l!=null&&l.endDate&&o.append("endDate",l.endDate),o.toString()},pS=async(a,n,l)=>{const o=fS(a,n,l);return await Ue(`/activities?${o}`)},hS=async a=>await Ue(`/activities/${a}`),gS=async a=>{const n=new URLSearchParams;a!=null&&a.server&&n.append("server",a.server),a!=null&&a.tool&&n.append("tool",a.tool),a!=null&&a.status&&n.append("status",a.status),a!=null&&a.group&&n.append("group",a.group),a!=null&&a.keyId&&n.append("keyId",a.keyId),a!=null&&a.keyName&&n.append("keyName",a.keyName),a!=null&&a.startDate&&n.append("startDate",a.startDate),a!=null&&a.endDate&&n.append("endDate",a.endDate);const l=n.toString();return await Ue(`/activities/stats${l?`?${l}`:""}`)},xS=async()=>await Ue("/activities/filters"),yS=async(a=30)=>await Os(`/activities/cleanup?daysOld=${a}`),bS=({collapsed:a})=>{var p,g;const{t:n}=Ce(),{auth:l}=cs(),[o,c]=y.useState(!1),d="0.12.3";y.useEffect(()=>{mS().then(c).catch(()=>c(!1))},[]);const m=[{path:"/",label:n("nav.dashboard"),icon:r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:[r.jsx("path",{d:"M2 10a8 8 0 018-8v8h8a8 8 0 11-16 0z"}),r.jsx("path",{d:"M12 2.252A8.014 8.014 0 0117.748 8H12V2.252z"})]})},{path:"/servers",label:n("nav.servers"),icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M2 5a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm14 1a1 1 0 11-2 0 1 1 0 012 0zM2 13a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2v-2zm14 1a1 1 0 11-2 0 1 1 0 012 0z",clipRule:"evenodd"})})},{path:"/groups",label:n("nav.groups"),icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{d:"M13 6a3 3 0 11-6 0 3 3 0 016 0zM18 8a2 2 0 11-4 0 2 2 0 014 0zM14 15a4 4 0 00-8 0v3h8v-3zM6 8a2 2 0 11-4 0 2 2 0 014 0zM16 18v-3a5.972 5.972 0 00-.75-2.906A3.005 3.005 0 0119 15v3h-3zM4.75 12.094A5.973 5.973 0 004 15v3H1v-3a3 3 0 013.75-2.906z"})})},{path:"/market",label:n("nav.market"),icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{d:"M3 1a1 1 0 000 2h1.22l.305 1.222a.997.997 0 00.01.042l1.358 5.43-.893.892C3.74 11.846 4.632 14 6.414 14H15a1 1 0 000-2H6.414l1-1H14a1 1 0 00.894-.553l3-6A1 1 0 0017 3H6.28l-.31-1.243A1 1 0 005 1H3zM16 16.5a1.5 1.5 0 11-3 0 1.5 1.5 0 013 0zM6.5 18a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"})})},...(p=l.user)!=null&&p.isAdmin&&S0("x")?[{path:"/users",label:n("nav.users"),icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{d:"M9 6a3 3 0 11-6 0 3 3 0 016 0zM17 6a3 3 0 11-6 0 3 3 0 016 0zM12.93 17c.046-.327.07-.66.07-1a6.97 6.97 0 00-1.5-4.33A5 5 0 0119 16v1h-6.07zM6 11a5 5 0 015 5v1H1v-1a5 5 0 015-5z"})})}]:[],...o&&((g=l.user)!=null&&g.isAdmin)?[{path:"/activity",label:n("nav.activity"),icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M3 3a1 1 0 000 2v8a2 2 0 002 2h2.586l-1.293 1.293a1 1 0 101.414 1.414L10 15.414l2.293 2.293a1 1 0 001.414-1.414L12.414 15H15a2 2 0 002-2V5a1 1 0 100-2H3zm11.707 4.707a1 1 0 00-1.414-1.414L10 9.586 8.707 8.293a1 1 0 00-1.414 0l-2 2a1 1 0 101.414 1.414L8 10.414l1.293 1.293a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})})}]:[],{path:"/logs",label:n("nav.logs"),icon:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z",clipRule:"evenodd"})})}];return r.jsxs("aside",{className:`bg-white dark:bg-gray-800 shadow-sm transition-all duration-300 ease-in-out flex flex-col h-full relative ${a?"w-16":"w-64"}`,children:[r.jsx("div",{className:"overflow-y-auto flex-grow",children:r.jsx("nav",{className:"p-3 space-y-1",children:m.map(h=>r.jsxs(Ug,{to:h.path,className:({isActive:b})=>`flex items-center px-2.5 py-2 rounded-lg transition-colors duration-200
207
+ ${b?"bg-blue-50 text-blue-700":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-100"}`,end:h.path==="/",children:[r.jsx("span",{className:"flex-shrink-0",children:h.icon}),!a&&r.jsx("span",{className:"ml-3",children:h.label})]},h.path))})}),r.jsx("div",{className:"p-3 bg-white dark:bg-gray-800",children:r.jsx(dS,{collapsed:a,version:d})})]})},vS=({children:a})=>r.jsx("main",{className:"flex-1 overflow-auto p-6 bg-gray-100 dark:bg-gray-900",children:r.jsx("div",{className:"container mx-auto",children:a})}),wS=()=>{const[a,n]=Ta.useState(!1),l=()=>{n(!a)};return r.jsxs("div",{className:"flex flex-col h-screen bg-gray-100 dark:bg-gray-900",children:[r.jsx(rS,{onToggleSidebar:l}),r.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[r.jsx(bS,{collapsed:a}),r.jsx(vS,{children:r.jsx(zg,{})})]})]})},SS=({redirectPath:a="/login"})=>{const{t:n}=Ce(),{auth:l}=cs();return l.loading?r.jsx("div",{className:"flex items-center justify-center h-screen",children:n("app.loading")}):l.isAuthenticated?r.jsx(zg,{}):r.jsx(oo,{to:a,replace:!0})},jS=({isOpen:a,onClose:n})=>{const{t:l}=Ce(),o=la();if(!a)return null;const c=()=>{n(),o("/settings"),setTimeout(()=>{const p=document.querySelector('[data-section="password"]');if(p){p.scrollIntoView({behavior:"smooth",block:"start"});const g=p.querySelector('[role="button"]');g&&!p.querySelector(".mt-4")&&g.click()}},100)},d=p=>{p.target===p.currentTarget&&n()},m=p=>{p.key==="Escape"&&n()};return r.jsx("div",{className:"fixed inset-0 bg-black/50 z-[100] flex items-center justify-center p-4",onClick:d,onKeyDown:m,tabIndex:-1,children:r.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-md w-full transform transition-all duration-200 ease-out",role:"dialog","aria-modal":"true","aria-labelledby":"password-warning-title","aria-describedby":"password-warning-message",children:r.jsxs("div",{className:"p-6",children:[r.jsxs("div",{className:"flex items-start space-x-3",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx("svg",{className:"w-6 h-6 text-yellow-600 dark:text-yellow-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("h3",{id:"password-warning-title",className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:l("auth.defaultPasswordWarning")}),r.jsx("p",{id:"password-warning-message",className:"text-gray-600 dark:text-gray-300 leading-relaxed",children:l("auth.defaultPasswordMessage")})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx("button",{onClick:n,className:"px-4 py-2 text-gray-600 dark:text-gray-300 hover:text-gray-800 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors duration-150 btn-secondary",children:l("common.cancel")}),r.jsx("button",{onClick:c,className:"px-4 py-2 bg-yellow-600 hover:bg-yellow-700 text-white rounded-md transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-yellow-500 btn-warning",autoFocus:!0,children:l("auth.goToSettings")})]})]})})})},NS=a=>{if(!a)return null;try{const n=typeof window<"u"?window.location.origin:"http://localhost",l=new URL(a,n);return l.origin!==n?null:`${l.pathname}${l.search}${l.hash}`||"/"}catch{return a.startsWith("/")&&!a.startsWith("//")?a:null}},CS=()=>{const{t:a}=Ce(),[n,l]=y.useState(""),[o,c]=y.useState(""),[d,m]=y.useState(null),[p,g]=y.useState(!1),[h,b]=y.useState(null),[x,w]=y.useState(null),[T,R]=y.useState(void 0),[O,E]=y.useState({google:!1,github:!1}),[A,N]=y.useState(!1),{login:S,auth:D}=cs(),P=na(),$=la(),B=y.useMemo(()=>{const H=new URLSearchParams(P.search);return NS(H.get("returnUrl"))},[P.search]),L=y.useCallback(H=>{if(!H)return!1;const Z=H.toLowerCase();return Z.includes("failed to fetch")||Z.includes("networkerror")||Z.includes("network error")||Z.includes("connection refused")||Z.includes("unable to connect")||Z.includes("fetch error")||Z.includes("econnrefused")||Z.includes("http 500")||Z.includes("internal server error")||Z.includes("proxy error")},[]),Y=y.useCallback(()=>{if(!B)return"/";if(!B.startsWith("/oauth/authorize"))return B;const H=kn();if(!H)return B;try{const Z=window.location.origin,C=new URL(B,Z);return C.searchParams.set("token",H),`${C.pathname}${C.search}${C.hash}`}catch{const Z=B.includes("?")?"&":"?";return`${B}${Z}token=${encodeURIComponent(H)}`}},[B]),fe=y.useCallback(()=>{B?window.location.assign(Y()):$("/")},[Y,$,B]);y.useEffect(()=>{!D.loading&&D.isAuthenticated&&fe()},[D.isAuthenticated,D.loading,fe]),y.useEffect(()=>{(async()=>{var I,U,oe,V;const C=(await Fg()).betterAuth;if(!(C!=null&&C.enabled)){E({google:!1,github:!1});return}R(C.basePath),E({google:((U=(I=C.providers)==null?void 0:I.google)==null?void 0:U.enabled)===!0,github:((V=(oe=C.providers)==null?void 0:oe.github)==null?void 0:V.enabled)===!0})})()},[]);const G=async H=>{H.preventDefault(),m(null),w(null),g(!0);try{if(!n||!o){m(a("auth.emptyFields")),g(!1);return}const Z=await S(n,o);if(Z.success)Z.isUsingDefaultPassword?N(!0):fe();else{const C=Z.message;L(C)?m(a("auth.serverUnavailable")):m(a("auth.loginFailed"))}}catch(Z){const C=Z instanceof Error?Z.message:void 0;L(C)?m(a("auth.serverUnavailable")):m(a("auth.loginError"))}finally{g(!1)}},K=async H=>{w(null),b(H);try{await qg(T).signIn.social({provider:H,callbackURL:B||"/",errorCallbackURL:`${Tl()}/login`})}catch(Z){console.error("Social login error:",Z),w(a("auth.socialLoginFailed")),b(null)}},X=()=>{N(!1),fe()};return r.jsxs("div",{className:"relative min-h-screen w-full overflow-hidden bg-gray-50 dark:bg-gray-950",children:[r.jsxs("div",{className:"absolute top-4 right-4 z-20 flex items-center gap-2",children:[r.jsx("a",{href:"https://docs.mcphubx.com",target:"_blank",rel:"noopener noreferrer",className:"rounded-md p-2 text-gray-500 hover:bg-gray-100 hover:text-gray-900 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200","aria-label":"Documentation",children:r.jsx(Xg,{className:"h-5 w-5"})}),r.jsx(v0,{}),r.jsx(w0,{})]}),r.jsx("div",{className:"pointer-events-none absolute inset-0 -z-10 opacity-60 dark:opacity-70",style:{backgroundImage:"radial-gradient(60rem 60rem at 20% -10%, rgba(99,102,241,0.25), transparent), radial-gradient(50rem 50rem at 120% 10%, rgba(168,85,247,0.15), transparent)"}}),r.jsx("div",{className:"pointer-events-none absolute inset-0 -z-10",children:r.jsxs("svg",{className:"h-full w-full opacity-[0.08] dark:opacity-[0.12]",xmlns:"http://www.w3.org/2000/svg",children:[r.jsx("defs",{children:r.jsx("pattern",{id:"grid",width:"32",height:"32",patternUnits:"userSpaceOnUse",children:r.jsx("path",{d:"M 32 0 L 0 0 0 32",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})})}),r.jsx("rect",{width:"100%",height:"100%",fill:"url(#grid)",className:"text-gray-400 dark:text-gray-300"})]})}),r.jsx("div",{className:"relative mx-auto flex min-h-screen w-full max-w-md items-center justify-center px-6 py-16",children:r.jsxs("div",{className:"w-full space-y-16",children:[r.jsx("div",{className:"flex justify-center w-full",children:r.jsx("h1",{className:"text-5xl sm:text-5xl font-extrabold leading-tight tracking-tight text-gray-900 dark:text-white whitespace-nowrap",children:r.jsx("span",{className:"bg-gradient-to-r from-indigo-400 via-cyan-400 to-emerald-400 bg-clip-text text-transparent",children:a("auth.slogan")})})}),r.jsxs("div",{className:"login-card relative w-full rounded-2xl border border-white/10 bg-white/60 p-8 shadow-xl backdrop-blur-md transition dark:border-white/10 dark:bg-gray-900/60",children:[r.jsx("div",{className:"absolute -top-24 right-12 h-40 w-40 -translate-y-6 rounded-full bg-indigo-500/30 blur-3xl"}),r.jsx("div",{className:"absolute -bottom-24 -left-12 h-40 w-40 translate-y-6 rounded-full bg-cyan-500/20 blur-3xl"}),r.jsxs("form",{className:"mt-4 space-y-4",onSubmit:G,children:[r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"username",className:"sr-only",children:a("auth.username")}),r.jsx("input",{id:"username",name:"username",type:"text",autoComplete:"username",required:!0,className:"login-input appearance-none relative block w-full rounded-md border border-gray-300/60 bg-white/70 px-3 py-3 text-gray-900 shadow-sm outline-none ring-0 transition-all placeholder:text-gray-500 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500 dark:border-gray-700/60 dark:bg-gray-800/70 dark:text-white dark:placeholder:text-gray-400",placeholder:a("auth.username"),value:n,onChange:H=>l(H.target.value)})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"password",className:"sr-only",children:a("auth.password")}),r.jsx("input",{id:"password",name:"password",type:"password",autoComplete:"current-password",required:!0,className:"login-input appearance-none relative block w-full rounded-md border border-gray-300/60 bg-white/70 px-3 py-3 text-gray-900 shadow-sm outline-none ring-0 transition-all placeholder:text-gray-500 focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500 dark:border-gray-700/60 dark:bg-gray-800/70 dark:text-white dark:placeholder:text-gray-400",placeholder:a("auth.password"),value:o,onChange:H=>c(H.target.value)})]})]}),d&&r.jsx("div",{className:"error-box rounded border border-red-500/20 bg-red-500/10 p-2 text-center text-sm text-red-600 dark:text-red-400",children:d}),r.jsx("div",{children:r.jsx("button",{type:"submit",disabled:p,className:"login-button btn-primary group relative flex w-full items-center justify-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white transition-all hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-70",children:a(p?"auth.loggingIn":"auth.login")})})]}),(O.google||O.github)&&r.jsxs("div",{className:"mt-6 space-y-4",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"h-px flex-1 bg-gray-200/80 dark:bg-gray-700/80"}),r.jsx("span",{className:"text-xs uppercase tracking-widest text-gray-500 dark:text-gray-400",children:a("auth.orContinue")}),r.jsx("div",{className:"h-px flex-1 bg-gray-200/80 dark:bg-gray-700/80"})]}),x&&r.jsx("div",{className:"error-box rounded border border-red-500/20 bg-red-500/10 p-2 text-center text-sm text-red-600 dark:text-red-400",children:x}),r.jsxs("div",{className:"space-y-3",children:[O.google&&r.jsx("button",{type:"button",onClick:()=>K("google"),disabled:h!==null,className:"flex w-full items-center justify-center gap-2 rounded-md border border-gray-200 bg-white/80 px-4 py-2 text-sm font-medium text-gray-700 shadow-sm transition hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-70 dark:border-gray-700 dark:bg-gray-900/70 dark:text-gray-200",children:a(h==="google"?"auth.loggingIn":"auth.loginWithGoogle")}),O.github&&r.jsx("button",{type:"button",onClick:()=>K("github"),disabled:h!==null,className:"flex w-full items-center justify-center gap-2 rounded-md border border-gray-200 bg-gray-900 px-4 py-2 text-sm font-medium text-white shadow-sm transition hover:bg-gray-800 disabled:cursor-not-allowed disabled:opacity-70 dark:border-gray-700",children:a(h==="github"?"auth.loggingIn":"auth.loginWithGithub")})]})]})]})]})}),r.jsx(jS,{isOpen:A,onClose:X})]})},zl=a=>{const n=y0(),{refreshIfNeeded:l}=n;return y.useEffect(()=>{a!=null&&a.refreshOnMount&&l()},[a==null?void 0:a.refreshOnMount,l]),n},kS=()=>{const{t:a}=Ce(),{allServers:n,error:l,setError:o,isLoading:c}=zl({refreshOnMount:!0}),[d,m]=Ta.useState(!1),p=Ta.useRef(!1);Ta.useEffect(()=>{if(c){p.current=!0;return}if(p.current){m(!0);return}(n.length>0||l)&&m(!0)},[c,n.length,l]);const g=!d,h={total:n.length,online:n.filter(x=>x.status==="connected").length,offline:n.filter(x=>x.status==="disconnected").length,connecting:n.filter(x=>x.status==="connecting").length,oauthRequired:n.filter(x=>x.status==="oauth_required").length},b={connected:"status.online",disconnected:"status.offline",connecting:"status.connecting",oauth_required:"status.oauthRequired"};return r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-8",children:a("pages.dashboard.title")}),l&&r.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm error-box",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-status-red text-lg font-medium",children:a("app.error")}),r.jsx("p",{className:"text-gray-600 mt-1",children:l})]}),r.jsx("button",{onClick:()=>o(null),className:"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200","aria-label":a("app.closeButton"),children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 011.414 0L10 8.586l4.293-4.293a1 1 111.414 1.414L11.414 10l4.293 4.293a1 1 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 01-1.414-1.414L8.586 10 4.293 5.707a1 1 010-1.414z",clipRule:"evenodd"})})})]})}),g&&r.jsxs("div",{className:"space-y-8","aria-busy":"true","aria-live":"polite",children:[r.jsx("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-4",children:Array.from({length:4}).map((x,w)=>r.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:"h-14 w-14 rounded-full bg-gray-200 animate-pulse"}),r.jsxs("div",{className:"ml-4 flex-1 space-y-3",children:[r.jsx("div",{className:"h-4 w-32 rounded bg-gray-200 animate-pulse"}),r.jsx("div",{className:"h-8 w-20 rounded bg-gray-200 animate-pulse"})]})]})},`stats-skeleton-${w}`))}),r.jsxs("div",{children:[r.jsx("div",{className:"h-6 w-40 rounded bg-gray-200 animate-pulse mb-4"}),r.jsx("div",{className:"bg-white shadow rounded-lg overflow-hidden table-container",children:r.jsx("div",{className:"divide-y divide-gray-200",children:Array.from({length:5}).map((x,w)=>r.jsx("div",{className:"px-6 py-4",children:r.jsxs("div",{className:"grid grid-cols-5 gap-6",children:[r.jsx("div",{className:"h-4 w-28 rounded bg-gray-200 animate-pulse"}),r.jsx("div",{className:"h-4 w-24 rounded bg-gray-200 animate-pulse"}),r.jsx("div",{className:"h-4 w-12 rounded bg-gray-200 animate-pulse"}),r.jsx("div",{className:"h-4 w-12 rounded bg-gray-200 animate-pulse"}),r.jsx("div",{className:"h-4 w-10 rounded bg-gray-200 animate-pulse"})]})},`row-skeleton-${w}`))})})]})]}),!g&&r.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-4",children:[r.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:"p-3 rounded-full bg-blue-100 text-blue-800 icon-container status-icon-blue",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"})})}),r.jsxs("div",{className:"ml-4",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:a("pages.dashboard.totalServers")}),r.jsx("p",{className:"text-3xl font-bold text-gray-900",children:h.total})]})]})}),r.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:"p-3 rounded-full bg-green-100 text-green-800 icon-container status-icon-green",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),r.jsxs("div",{className:"ml-4",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:a("pages.dashboard.onlineServers")}),r.jsx("p",{className:"text-3xl font-bold text-gray-900",children:h.online})]})]})}),r.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:"p-3 rounded-full bg-red-100 text-red-800 icon-container status-icon-red",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),r.jsxs("div",{className:"ml-4",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:a("pages.dashboard.offlineServers")}),r.jsx("p",{className:"text-3xl font-bold text-gray-900",children:h.offline})]})]})}),r.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:"p-3 rounded-full bg-yellow-100 text-yellow-800 icon-container status-icon-yellow",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})}),r.jsxs("div",{className:"ml-4",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:a("pages.dashboard.connectingServers")}),r.jsx("p",{className:"text-3xl font-bold text-gray-900",children:h.connecting})]})]})})]}),n.length>0&&!g&&r.jsxs("div",{className:"mt-8",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:a("pages.dashboard.recentServers")}),r.jsx("div",{className:"bg-white shadow rounded-lg overflow-hidden table-container",children:r.jsxs("table",{className:"min-w-full",children:[r.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:r.jsxs("tr",{children:[r.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("server.name")}),r.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("server.status")}),r.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("server.tools")}),r.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("server.prompts")}),r.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("server.enabled")})]})}),r.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:n.slice(0,5).map((x,w)=>{var T,R;return r.jsxs("tr",{children:[r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:x.name}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:r.jsxs("span",{className:`px-2 py-1 inline-flex text-xs leading-5 font-semibold rounded-full ${x.status==="connected"?"status-badge-online":x.status==="disconnected"?"status-badge-offline":x.status==="oauth_required"?"status-badge-oauth-required":"status-badge-connecting"}`,children:[x.status==="oauth_required"&&"🔐 ",a(b[x.status]||x.status)]})}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:((T=x.tools)==null?void 0:T.length)||0}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:((R=x.prompts)==null?void 0:R.length)||0}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:x.enabled!==!1?r.jsx("span",{className:"text-green-600",children:"✓"}):r.jsx("span",{className:"text-status-red",children:"✗"})})]},w)})})]})})]})]})},AS="modulepreload",ES=function(a,n){return new URL(a,n).href},Yh={},Jh=function(n,l,o){let c=Promise.resolve();if(l&&l.length>0){let m=function(b){return Promise.all(b.map(x=>Promise.resolve(x).then(w=>({status:"fulfilled",value:w}),w=>({status:"rejected",reason:w}))))};const p=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),h=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));c=m(l.map(b=>{if(b=ES(b,o),b in Yh)return;Yh[b]=!0;const x=b.endsWith(".css"),w=x?'[rel="stylesheet"]':"";if(!!o)for(let O=p.length-1;O>=0;O--){const E=p[O];if(E.href===b&&(!x||E.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${w}`))return;const R=document.createElement("link");if(R.rel=x?"stylesheet":AS,x||(R.as="script"),R.crossOrigin="",R.href=b,h&&R.setAttribute("nonce",h),document.head.appendChild(R),x)return new Promise((O,E)=>{R.addEventListener("load",O),R.addEventListener("error",()=>E(new Error(`Unable to preload CSS for ${b}`)))})}))}function d(m){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=m,window.dispatchEvent(p),!p.defaultPrevented)throw m}return c.then(m=>{for(const p of m||[])p.status==="rejected"&&d(p.reason);return n().catch(d)})},TS={default:"bg-blue-500 text-white hover:bg-blue-600",secondary:"bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600",outline:"bg-transparent border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800",destructive:"bg-red-500 text-white hover:bg-red-600"};function Wi({children:a,variant:n="default",className:l,onClick:o}){return r.jsx("span",{className:Oa("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors",TS[n],o?"cursor-pointer":"",l),onClick:o,children:a})}const RS=({status:a,onAuthClick:n})=>{const{t:l}=Ce(),o={connecting:"status-badge-connecting",connected:"status-badge-online",disconnected:"status-badge-offline",oauth_required:"status-badge-oauth-required"},c={connected:"status.online",disconnected:"status.offline",connecting:"status.connecting",oauth_required:"status.oauthRequired"},d=a==="oauth_required";return r.jsxs("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${o[a]} ${d&&n?"cursor-pointer hover:opacity-80":""}`,onClick:d&&n?m=>n(m):void 0,title:d?l("status.clickToAuthorize"):void 0,children:[d&&"🔐 ",l(c[a]||a)]})},C0=async(a,n)=>{try{const l=n?`/tools/${encodeURIComponent(n)}/${encodeURIComponent(a.toolName)}`:"/tools/call",o=await At(l,a.arguments,{headers:{Authorization:`Bearer ${localStorage.getItem("mcphub_token")}`}});return o.success===!1?{success:!1,error:o.message||"Tool call failed"}:{success:!0,content:(o==null?void 0:o.content)||[]}}catch(l){return console.error("Error calling tool:",l),{success:!1,error:l instanceof Error?l.message:"Unknown error occurred"}}},OS=async(a,n,l)=>{try{const o=await At(`/servers/${encodeURIComponent(a)}/tools/${encodeURIComponent(n)}/toggle`,{enabled:l},{headers:{Authorization:`Bearer ${localStorage.getItem("mcphub_token")}`}});return{success:o.success,error:o.success?void 0:o.message}}catch(o){return console.error("Error toggling tool:",o),{success:!1,error:o instanceof Error?o.message:"Unknown error occurred"}}},k0=async(a,n,l)=>{try{const o=await Pt(`/servers/${encodeURIComponent(a)}/tools/${encodeURIComponent(n)}/description`,{description:l},{headers:{Authorization:`Bearer ${localStorage.getItem("mcphub_token")}`}});return{success:o.success,error:o.success?void 0:o.message}}catch(o){return console.error("Error updating tool description:",o),{success:!1,error:o instanceof Error?o.message:"Unknown error occurred"}}},zS=Object.freeze(Object.defineProperty({__proto__:null,callTool:C0,toggleTool:OS,updateToolDescription:k0},Symbol.toStringTag,{value:"Module"})),zs=()=>Zw(),tr=({checked:a,onCheckedChange:n,disabled:l=!1})=>r.jsx("button",{type:"button",role:"switch","aria-checked":a,disabled:l,className:Oa("relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-500",a?"bg-blue-200":"bg-gray-100",l?"opacity-50 cursor-not-allowed":"cursor-pointer"),onClick:()=>!l&&n(!a),children:r.jsx("span",{className:Oa("inline-block h-4 w-4 transform rounded-full bg-white transition-transform",a?"translate-x-6":"translate-x-1")})}),A0=({schema:a,onSubmit:n,onCancel:l,loading:o=!1,storageKey:c,title:d})=>{const{t:m}=Ce(),[p,g]=y.useState({}),[h,b]=y.useState({}),[x,w]=y.useState(!1),[T,R]=y.useState(""),[O,E]=y.useState(""),A=y.useMemo(()=>(K=>{const X=H=>{if(typeof H=="object"&&H!==null){const Z=H;return{type:Z.type||"string",description:Z.description,enum:Z.enum,default:Z.default,properties:Z.properties?Object.fromEntries(Object.entries(Z.properties).map(([C,I])=>[C,X(I)])):void 0,required:Z.required,items:Z.items?X(Z.items):void 0}}return{type:"string"}};return{type:K.type,properties:K.properties?Object.fromEntries(Object.entries(K.properties).map(([H,Z])=>[H,X(Z)])):void 0,required:K.required}})(a),[a]);y.useEffect(()=>{const G=(X,H="")=>{const Z={};return X.type==="object"&&X.properties&&Object.entries(X.properties).forEach(([C,I])=>{const U=H?`${H}.${C}`:C;I.default!==void 0?Z[C]=I.default:I.type==="string"?Z[C]="":I.type==="number"||I.type==="integer"?Z[C]=0:I.type==="boolean"?Z[C]=!1:I.type==="array"?Z[C]=[]:I.type==="object"&&(I.properties?Z[C]=G(I,U):Z[C]={})}),Z};let K=G(A);if(c)try{const X=localStorage.getItem(c);if(X){const H=JSON.parse(X);K={...K,...H}}}catch(X){console.warn("Failed to load saved form data:",X)}g(K)},[A,c]),y.useEffect(()=>{x&&Object.keys(p).length>0&&(R(JSON.stringify(p,null,2)),E(""))},[x,p]);const N=G=>{R(G),E("");try{const K=JSON.parse(G);if(g(K),c)try{localStorage.setItem(c,JSON.stringify(K))}catch(X){console.warn("Failed to save form data to localStorage:",X)}}catch{E(m("tool.invalidJsonFormat"))}},S=()=>{R(JSON.stringify(p,null,2)),E(""),w(!0)},D=()=>{if(T.trim())try{const G=JSON.parse(T);g(G),E(""),w(!1)}catch{E(m("tool.fixJsonBeforeSwitching"));return}else w(!1)},P=(G,K)=>{g(X=>{const H={...X},Z=G.split(".");let C=H;for(let I=0;I<Z.length-1;I++)C[Z[I]]||(C[Z[I]]={}),C=C[Z[I]];if(C[Z[Z.length-1]]=K,c)try{localStorage.setItem(c,JSON.stringify(H))}catch(I){console.warn("Failed to save form data to localStorage:",I)}return H}),h[G]&&b(X=>{const H={...X};return delete H[G],H})},$=()=>{const G={},K=(X,H,Z="")=>{X.type==="object"&&X.properties&&Object.entries(X.properties).forEach(([C,I])=>{var V;const U=Z?`${Z}.${C}`:C,oe=H==null?void 0:H[C];if((V=X.required)!=null&&V.includes(C)&&(oe==null||oe===""||Array.isArray(oe)&&oe.length===0)){G[U]=`${C} is required`;return}oe!=null&&oe!==""&&(I.type==="string"&&typeof oe!="string"?G[U]=`${C} must be a string`:I.type==="number"&&typeof oe!="number"?G[U]=`${C} must be a number`:I.type==="integer"&&(!Number.isInteger(oe)||typeof oe!="number")?G[U]=`${C} must be an integer`:I.type==="boolean"&&typeof oe!="boolean"?G[U]=`${C} must be a boolean`:I.type==="array"&&Array.isArray(oe)?I.items&&oe.forEach((j,M)=>{var z;((z=I.items)==null?void 0:z.type)==="object"&&I.items.properties&&K(I.items,j,`${U}.${M}`)}):I.type==="object"&&typeof oe=="object"&&K(I,oe,U))})};return K(A,p),b(G),Object.keys(G).length===0},B=G=>{G.preventDefault(),$()&&n(p)},L=(G,K)=>K.split(".").reduce((X,H)=>X==null?void 0:X[H],G),Y=(G,K,X,H)=>{const Z=X==null?void 0:X[G];return K.type==="string"?K.enum?r.jsxs("select",{value:Z||"",onChange:C=>H(C.target.value),className:"w-full border rounded-md px-2 py-1 text-sm border-gray-300 focus:outline-none focus:ring-1 focus:ring-blue-500",children:[r.jsx("option",{value:"",children:m("tool.selectOption")}),K.enum.map((C,I)=>r.jsx("option",{value:C,children:C},I))]}):r.jsx("input",{type:"text",value:Z||"",onChange:C=>H(C.target.value),className:"w-full border rounded-md px-2 py-1 text-sm border-gray-300 focus:outline-none focus:ring-1 focus:ring-blue-500 form-input",placeholder:K.description||m("tool.enterKey",{key:G})}):K.type==="number"||K.type==="integer"?r.jsx("input",{type:"number",step:K.type==="integer"?"1":"any",value:Z??"",onChange:C=>{const I=C.target.value===""?"":K.type==="integer"?parseInt(C.target.value):parseFloat(C.target.value);H(I)},className:"w-full border rounded-md px-2 py-1 text-sm border-gray-300 focus:outline-none focus:ring-1 focus:ring-blue-500 form-input"}):K.type==="boolean"?r.jsx("input",{type:"checkbox",checked:Z||!1,onChange:C=>H(C.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}):r.jsx("input",{type:"text",value:Z||"",onChange:C=>H(C.target.value),className:"w-full border rounded-md px-2 py-1 text-sm border-gray-300 focus:outline-none focus:ring-1 focus:ring-blue-500 form-input",placeholder:K.description||m("tool.enterKey",{key:G})})},fe=(G,K,X="")=>{var I,U,oe,V,j,M,z,q,pe,se,Q,ge,re,ye;const H=X?`${X}.${G}`:G,Z=L(p,H),C=h[H];if(K.type==="array"){const ue=L(p,H)||[];return r.jsxs("div",{className:"mb-6",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[G,(X?(U=(I=L(A,X))==null?void 0:I.required)==null?void 0:U.includes(G):(oe=A.required)==null?void 0:oe.includes(G))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),K.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:K.description}),r.jsxs("div",{className:"border border-gray-200 rounded-md p-3 bg-gray-50",children:[ue.map((ie,xe)=>{var Xe,Ft,Vt;return r.jsxs("div",{className:"mb-3 p-3 bg-white border border-gray-200 rounded-md",children:[r.jsxs("div",{className:"flex justify-between items-center mb-2",children:[r.jsx("span",{className:"text-sm font-medium text-gray-600",children:m("tool.item",{index:xe+1})}),r.jsx("button",{type:"button",onClick:()=>{const Ze=[...ue];Ze.splice(xe,1),P(H,Ze)},className:"text-status-red hover:text-red-700 text-sm",children:m("common.remove")})]}),((Xe=K.items)==null?void 0:Xe.type)==="string"&&K.items.enum?r.jsxs("select",{value:ie||"",onChange:Ze=>{const gt=[...ue];gt[xe]=Ze.target.value,P(H,gt)},className:"w-full border rounded-md px-3 py-2 border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[r.jsx("option",{value:"",children:m("tool.selectOption")}),K.items.enum.map((Ze,gt)=>r.jsx("option",{value:Ze,children:Ze},gt))]}):((Ft=K.items)==null?void 0:Ft.type)==="object"&&K.items.properties?r.jsx("div",{className:"space-y-3",children:Object.entries(K.items.properties).map(([Ze,gt])=>{var $t,Ut;return r.jsxs("div",{children:[r.jsxs("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[Ze,((Ut=($t=K.items)==null?void 0:$t.required)==null?void 0:Ut.includes(Ze))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),Y(Ze,gt,ie,Yt=>{const It=[...ue];It[xe]={...It[xe],[Ze]:Yt},P(H,It)})]},Ze)})}):r.jsx("input",{type:"text",value:ie||"",onChange:Ze=>{const gt=[...ue];gt[xe]=Ze.target.value,P(H,gt)},className:"w-full border rounded-md px-3 py-2 border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",placeholder:m("tool.enterValue",{type:((Vt=K.items)==null?void 0:Vt.type)||"value"})})]},xe)}),r.jsx("button",{type:"button",onClick:()=>{var xe;const ie=((xe=K.items)==null?void 0:xe.type)==="object"?{}:"";P(H,[...ue,ie])},className:"w-full mt-2 px-3 py-2 text-sm text-blue-600 border border-blue-300 rounded-md hover:bg-blue-50",children:m("tool.addItem",{key:G})})]}),C&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:C})]},H)}return K.type==="object"?K.properties?r.jsxs("div",{className:"mb-6",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[G,(X?(j=(V=L(A,X))==null?void 0:V.required)==null?void 0:j.includes(G):(M=A.required)==null?void 0:M.includes(G))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),K.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:K.description}),r.jsx("div",{className:"border border-gray-200 rounded-md p-4 bg-gray-50",children:Object.entries(K.properties).map(([ue,ie])=>fe(ue,ie,H))}),C&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:C})]},H):r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[G,(X?(q=(z=L(A,X))==null?void 0:z.required)==null?void 0:q.includes(G):(pe=A.required)==null?void 0:pe.includes(G))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"}),r.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(JSON object)"})]}),K.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:K.description}),r.jsx("textarea",{value:typeof Z=="object"?JSON.stringify(Z,null,2):Z||"{}",onChange:ue=>{try{const ie=JSON.parse(ue.target.value);P(H,ie)}catch{P(H,ue.target.value)}},placeholder:`{
208
+ "key": "value"
209
+ }`,className:`w-full border rounded-md px-3 py-2 font-mono text-sm ${C?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`,rows:4}),C&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:C})]},H):K.type==="string"?K.enum?r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[G,(X?!1:(se=A.required)==null?void 0:se.includes(G))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),K.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:K.description}),r.jsxs("select",{value:Z||"",onChange:ue=>P(H,ue.target.value),className:`w-full border rounded-md px-3 py-2 ${C?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[r.jsx("option",{value:"",children:m("tool.selectOption")}),K.enum.map((ue,ie)=>r.jsx("option",{value:ue,children:ue},ie))]}),C&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:C})]},H):r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[G,(X?!1:(Q=A.required)==null?void 0:Q.includes(G))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),K.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:K.description}),r.jsx("input",{type:"text",value:Z||"",onChange:ue=>P(H,ue.target.value),className:`w-full border rounded-md px-3 py-2 ${C?"border-red":"border-gray-200"} focus:outline-none form-input`}),C&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:C})]},H):K.type==="number"||K.type==="integer"?r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[G,(X?!1:(ge=A.required)==null?void 0:ge.includes(G))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),K.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:K.description}),r.jsx("input",{type:"number",step:K.type==="integer"?"1":"any",value:Z??"",onChange:ue=>{const ie=ue.target.value===""?"":K.type==="integer"?parseInt(ue.target.value):parseFloat(ue.target.value);P(H,ie)},className:`w-full border rounded-md px-3 py-2 form-input ${C?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),C&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:C})]},H):K.type==="boolean"?r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("input",{type:"checkbox",checked:Z||!1,onChange:ue=>P(H,ue.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}),r.jsxs("label",{className:"ml-2 block text-sm text-gray-700",children:[G,(X?!1:(re=A.required)==null?void 0:re.includes(G))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]})]}),K.description&&r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:K.description}),C&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:C})]},H):r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[G,(X?!1:(ye=A.required)==null?void 0:ye.includes(G))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"}),r.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",K.type,")"]})]}),K.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:K.description}),r.jsx("input",{type:"text",value:Z||"",onChange:ue=>P(H,ue.target.value),placeholder:m("tool.enterValue",{type:K.type}),className:`w-full border rounded-md px-3 py-2 ${C?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500 form-input`}),C&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:C})]},H)};return A.properties?r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex justify-between items-center pb-3",children:[r.jsx("h6",{className:"text-md font-medium text-gray-900",children:d}),r.jsxs("div",{className:"flex space-x-2",children:[r.jsx("button",{type:"button",onClick:D,className:`px-3 py-1 text-sm rounded-md transition-colors ${x?"text-sm text-gray-600 bg-gray-200 rounded hover:bg-gray-300 btn-secondary":"bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary"}`,children:m("tool.formMode")}),r.jsx("button",{type:"button",onClick:S,className:`px-3 py-1 text-sm rounded-md transition-colors ${x?"px-4 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary":"text-sm text-gray-600 bg-gray-200 rounded hover:bg-gray-300 btn-secondary"}`,children:m("tool.jsonMode")})]})]}),x?r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:m("tool.jsonConfiguration")}),r.jsx("textarea",{value:T,onChange:G=>N(G.target.value),placeholder:`{
210
+ "key": "value"
211
+ }`,className:`w-full h-64 border rounded-md px-3 py-2 font-mono text-sm resize-y form-input ${O?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),O&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:O})]}),r.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[r.jsx("button",{type:"button",onClick:l,className:"px-4 py-1 text-sm text-gray-600 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:m("tool.cancel")}),r.jsx("button",{onClick:()=>{try{const G=JSON.parse(T);n(G)}catch{E(m("tool.invalidJsonFormat"))}},disabled:o||!!O,className:"px-4 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:m(o?"tool.running":"tool.runTool")})]})]}):r.jsxs("form",{onSubmit:B,className:"space-y-4",children:[Object.entries(A.properties||{}).map(([G,K])=>fe(G,K)),r.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[r.jsx("button",{type:"button",onClick:l,className:"px-4 py-1 text-sm text-gray-600 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:m("tool.cancel")}),r.jsx("button",{type:"submit",disabled:o,className:"px-4 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:m(o?"tool.running":"tool.runTool")})]})]})]}):r.jsxs("div",{className:"p-4 bg-gray-50 rounded-md",children:[r.jsx("p",{className:"text-sm text-gray-600",children:m("tool.noParameters")}),r.jsxs("div",{className:"flex justify-end space-x-2 mt-4",children:[r.jsx("button",{type:"button",onClick:l,className:"px-4 py-2 text-sm text-gray-600 bg-gray-100 rounded-md hover:bg-gray-200",children:m("tool.cancel")}),r.jsx("button",{onClick:()=>n({}),disabled:o,className:"px-4 py-2 text-sm text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:opacity-50",children:m(o?"tool.running":"tool.runTool")})]})]})},MS=({result:a,onClose:n})=>{const{t:l}=Ce(),o=a.content,c=b=>b?b.startsWith("image/")?b:`image/${b}`:"image/png",d=b=>{if(!b)return[];if(Array.isArray(b))return b.flatMap(T=>d(T));if(typeof b!="object")return[];const x=[];b.type==="image"&&b.data&&x.push({data:String(b.data),mimeType:c(b.mimeType||b.mime_type)});const w=b.image_base64||b.imageBase64||b.image_data||b.imageData||b.base64;return w&&x.push({data:String(w),mimeType:c(b.image_mimeType||b.image_mime_type||b.mimeType||b.mime_type)}),b.image&&typeof b.image=="object"&&x.push(...d(b.image)),Array.isArray(b.images)&&x.push(...d(b.images)),Array.isArray(b.content)&&x.push(...d(b.content)),x},m=b=>{const x=[];try{const R=JSON.parse(b);if(x.push(...d(R)),x.length>0)return x}catch{}const w=/data:image\/(png|jpe?g|gif|webp);base64,([A-Za-z0-9+/=]+)/g;let T;for(;(T=w.exec(b))!==null;){const R=`image/${T[1]==="jpg"?"jpeg":T[1]}`;x.push({data:T[2],mimeType:R})}return x},p=b=>{try{const x=JSON.parse(b),w=T=>{if(Array.isArray(T))return T.map(w);if(T&&typeof T=="object"){const R={};for(const[O,E]of Object.entries(T))typeof E=="string"&&O.toLowerCase().includes("base64")?R[O]="[base64 omitted]":R[O]=w(E);return R}return T};return JSON.stringify(w(x),null,2)}catch{return b.replace(/data:image\/(png|jpe?g|gif|webp);base64,[A-Za-z0-9+/=]+/g,"[image data omitted]")}},g=b=>Array.isArray(b)?b.map((x,w)=>r.jsx("div",{className:"mb-3 last:mb-0",children:h(x)},w)):h(b),h=b=>{if(typeof b=="string"){const x=m(b),w=p(b);return r.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[x.length>0&&r.jsx("div",{className:"mb-3 space-y-3",children:x.map((T,R)=>r.jsx("img",{src:`data:${T.mimeType||"image/png"};base64,${T.data}`,alt:l("tool.toolResult"),className:"max-w-full h-auto rounded-md"},R))}),r.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:w})]})}if(typeof b=="object"&&b!==null){if(b.type==="text"&&b.text){const x=m(b.text),w=p(b.text);return r.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[x.length>0&&r.jsx("div",{className:"mb-3 space-y-3",children:x.map((T,R)=>r.jsx("img",{src:`data:${T.mimeType||"image/png"};base64,${T.data}`,alt:l("tool.toolResult"),className:"max-w-full h-auto rounded-md"},R))}),r.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:w})]})}if(b.type==="image"&&b.data)return r.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:r.jsx("img",{src:`data:${b.mimeType||"image/png"};base64,${b.data}`,alt:l("tool.toolResult"),className:"max-w-full h-auto rounded-md"})});try{const x=typeof b=="string"?JSON.parse(b):b;return r.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[r.jsx("div",{className:"text-xs text-gray-500 mb-2",children:l("tool.jsonResponse")}),r.jsx("pre",{className:"text-sm text-gray-800 overflow-auto",children:JSON.stringify(x,null,2)})]})}catch{return r.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:r.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(b)})})}}return r.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:r.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(b)})})};return r.jsxs("div",{className:"border border-gray-300 rounded-lg bg-white shadow-sm",children:[r.jsx("div",{className:"border-b border-gray-300 px-4 py-3 bg-gray-50 rounded-t-lg",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[a.success?r.jsx(Zg,{size:20,className:"text-status-green"}):r.jsx(Wg,{size:20,className:"text-status-red"}),r.jsx("div",{children:r.jsxs("h4",{className:"text-sm font-medium text-gray-900",children:[l("tool.execution")," ",a.success?l("tool.successful"):l("tool.failed")]})})]}),r.jsx("button",{onClick:n,className:"text-gray-400 hover:text-gray-600 text-sm",children:"✕"})]})}),r.jsx("div",{className:"p-4",children:a.success?r.jsx("div",{children:a.content&&a.content.length>0?r.jsxs("div",{children:[r.jsx("div",{className:"text-sm text-gray-600 mb-3",children:l("tool.result")}),g(a.content)]}):r.jsx("div",{className:"text-sm text-gray-500 italic",children:l("tool.noContent")})}):r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[r.jsx(vd,{size:16,className:"text-red-500"}),r.jsx("span",{className:"text-sm font-medium text-red-700",children:l("tool.error")})]}),o&&o.length>0?r.jsxs("div",{children:[r.jsx("div",{className:"text-sm text-gray-600 mb-3",children:l("tool.errorDetails")}),g(o)]}):r.jsx("div",{className:"bg-red-50 border border-red-300 rounded-md p-3",children:r.jsx("pre",{className:"text-sm text-red-800 whitespace-pre-wrap",children:a.error||a.message||l("tool.unknownError")})})]})})]})};function LS(a){return a==null?!0:typeof a=="string"?a.trim()==="":Array.isArray(a)?a.length===0:typeof a=="object"?Object.keys(a).length===0:!1}const DS=({tool:a,server:n,onToggle:l,onDescriptionUpdate:o})=>{const{t:c}=Ce(),{showToast:d}=us(),{nameSeparator:m}=zs(),[p,g]=y.useState(!1),[h,b]=y.useState(!1),[x,w]=y.useState(!1),[T,R]=y.useState(null),[O,E]=y.useState(!1),[A,N]=y.useState(a.description||""),S=y.useRef(null),D=y.useRef(null),[P,$]=y.useState(0),[B,L]=y.useState(!1);y.useEffect(()=>{O&&S.current&&(S.current.focus(),P>0&&(S.current.style.width=`${P+20}px`))},[O,P]),y.useEffect(()=>{!O&&D.current&&$(D.current.offsetWidth)},[O,A]);const Y=y.useCallback(()=>`mcphub_tool_form_${n?`${n}_`:""}${a.name}`,[a.name,n]),fe=y.useCallback(()=>{localStorage.removeItem(Y())},[Y]),G=V=>{l&&l(a.name,V)},K=()=>{E(!0)},X=async()=>{try{const V=await k0(n,a.name,A);V.success?(E(!1),o&&o(a.name,A)):(N(a.description||""),console.error("Failed to update tool description:",V.error))}catch(V){console.error("Error updating tool description:",V),N(a.description||""),E(!1)}},H=V=>{N(V.target.value)},Z=V=>{V.key==="Enter"?X():V.key==="Escape"&&(N(a.description||""),E(!1))},C=async V=>{V.stopPropagation();try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(a.name),L(!0),d(c("common.copySuccess"),"success"),setTimeout(()=>L(!1),2e3);else{const j=document.createElement("textarea");j.value=a.name,j.style.position="fixed",j.style.left="-9999px",document.body.appendChild(j),j.focus(),j.select();try{document.execCommand("copy"),L(!0),d(c("common.copySuccess"),"success"),setTimeout(()=>L(!1),2e3)}catch(M){d(c("common.copyFailed"),"error"),console.error("Copy to clipboard failed:",M)}document.body.removeChild(j)}}catch(j){d(c("common.copyFailed"),"error"),console.error("Copy to clipboard failed:",j)}},I=async V=>{w(!0);try{V=Object.fromEntries(Object.entries(V).filter(([M,z])=>!LS(z)));const j=await C0({toolName:a.name,arguments:V},n);R(j)}catch(j){R({success:!1,error:j instanceof Error?j.message:"Unknown error occurred"})}finally{w(!1)}},U=()=>{b(!1),fe(),R(null)},oe=()=>{R(null)};return r.jsxs("div",{className:"bg-white border border-gray-200 shadow rounded-lg mb-4",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer p-2",onClick:V=>{V.stopPropagation(),g(!p)},children:[r.jsx("div",{className:"flex-1",children:r.jsxs("h3",{className:"text-lg font-medium text-gray-900 inline-flex items-center",children:[a.name.replace(n+m,""),r.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:C,title:c("common.copy"),children:B?r.jsx(os,{size:16,className:"text-green-500"}):r.jsx(wn,{size:16})}),r.jsx("span",{className:"ml-2 text-sm font-normal text-gray-600 inline-flex items-center",children:O?r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:S,type:"text",className:"px-2 py-1 border border-blue-300 rounded bg-white text-sm focus:outline-none form-input",value:A,onChange:H,onKeyDown:Z,onClick:V=>V.stopPropagation(),style:{minWidth:"100px",width:P>0?`${P+20}px`:"auto"}}),r.jsx("button",{className:"ml-2 p-1 text-green-600 hover:text-green-800 cursor-pointer transition-colors",onClick:V=>{V.stopPropagation(),X()},children:r.jsx(os,{size:16})})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{ref:D,children:A||c("tool.noDescription")}),r.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:V=>{V.stopPropagation(),K()},children:r.jsx(Ol,{size:14})})]})})]})}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx("div",{className:"flex items-center space-x-2",onClick:V=>V.stopPropagation(),children:r.jsx(tr,{checked:a.enabled??!0,onCheckedChange:G,disabled:x})}),r.jsxs("button",{onClick:V=>{V.stopPropagation(),g(!0),b(!0)},className:"flex items-center space-x-1 px-3 py-1 text-sm text-blue-600 bg-blue-50 hover:bg-blue-100 rounded-md transition-colors btn-primary",disabled:x||!a.enabled,children:[x?r.jsx(e0,{size:14,className:"animate-spin"}):r.jsx(t0,{size:14}),r.jsx("span",{children:c(x?"tool.running":"tool.run")})]}),r.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:p?r.jsx(Rl,{size:18}):r.jsx(bd,{size:18})})]})]}),p&&r.jsxs("div",{className:"mt-4 space-y-4",children:[!h&&r.jsxs("div",{className:"bg-gray-50 rounded p-3 border border-gray-300",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:c("tool.inputSchema")}),r.jsx("pre",{className:"text-xs text-gray-600 overflow-auto",children:JSON.stringify(a.inputSchema,null,2)})]}),h&&r.jsxs("div",{className:"border border-gray-300 rounded-lg p-4",children:[r.jsx(A0,{schema:a.inputSchema||{type:"object"},onSubmit:I,onCancel:U,loading:x,storageKey:Y(),title:c("tool.runToolWithName",{name:a.name.replace(n+m,"")})}),T&&r.jsx("div",{className:"mt-4",children:r.jsx(MS,{result:T,onClose:oe})})]})]})]})},E0=async(a,n)=>{try{const l=await At(`/mcp/${encodeURIComponent(n||"")}/prompts/${encodeURIComponent(a.promptName)}`,{name:a.promptName,arguments:a.arguments});if(!l.success)throw new Error(`Failed to get prompt: ${l.message||"Unknown error"}`);return{success:!0,data:l.data}}catch(l){return console.error("Error getting prompt:",l),{success:!1,error:l instanceof Error?l.message:"Unknown error occurred"}}},PS=async(a,n,l)=>{try{const o=await At(`/servers/${encodeURIComponent(a)}/prompts/${encodeURIComponent(n)}/toggle`,{enabled:l});return{success:o.success,error:o.success?void 0:o.message}}catch(o){return console.error("Error toggling prompt:",o),{success:!1,error:o instanceof Error?o.message:"Unknown error occurred"}}},T0=async(a,n,l)=>{try{const o=await Pt(`/servers/${encodeURIComponent(a)}/prompts/${encodeURIComponent(n)}/description`,{description:l},{headers:{Authorization:`Bearer ${localStorage.getItem("mcphub_token")}`}});return{success:o.success,error:o.success?void 0:o.message}}catch(o){return console.error("Error updating prompt description:",o),{success:!1,error:o instanceof Error?o.message:"Unknown error occurred"}}},US=Object.freeze(Object.defineProperty({__proto__:null,getPrompt:E0,togglePrompt:PS,updatePromptDescription:T0},Symbol.toStringTag,{value:"Module"})),Qh=({result:a,onClose:n})=>{const{t:l}=Ce(),o=c=>{if(typeof c=="string")return r.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:r.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:c})});if(typeof c=="object"&&c!==null){if(c.description||c.messages)return r.jsxs("div",{className:"space-y-4",children:[c.description&&r.jsxs("div",{children:[r.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:l("prompt.description")}),r.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:r.jsx("p",{className:"text-sm text-gray-800",children:c.description})})]}),c.messages&&r.jsxs("div",{children:[r.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:l("prompt.messages")}),r.jsx("div",{className:"space-y-3",children:c.messages.map((d,m)=>r.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[r.jsx("div",{className:"flex items-center mb-2",children:r.jsxs("span",{className:"inline-block w-16 text-xs font-medium text-gray-500",children:[d.role,":"]})}),typeof d.content=="string"?r.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:d.content}):typeof d.content=="object"&&d.content.type==="text"?r.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:d.content.text}):r.jsx("pre",{className:"text-sm text-gray-800 overflow-auto",children:JSON.stringify(d.content,null,2)})]},m))})]})]});try{const d=typeof c=="string"?JSON.parse(c):c;return r.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[r.jsx("div",{className:"text-xs text-gray-500 mb-2",children:l("prompt.jsonResponse")}),r.jsx("pre",{className:"text-sm text-gray-800 overflow-auto",children:JSON.stringify(d,null,2)})]})}catch{return r.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:r.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(c)})})}}return r.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:r.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(c)})})};return r.jsxs("div",{className:"border border-gray-300 rounded-lg bg-white shadow-sm",children:[r.jsx("div",{className:"border-b border-gray-300 px-4 py-3 bg-gray-50 rounded-t-lg",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[a.success?r.jsx(Zg,{size:20,className:"text-status-green"}):r.jsx(Wg,{size:20,className:"text-status-red"}),r.jsx("div",{children:r.jsxs("h4",{className:"text-sm font-medium text-gray-900",children:[l("prompt.execution")," ",a.success?l("prompt.successful"):l("prompt.failed")]})})]}),r.jsx("button",{onClick:n,className:"text-gray-400 hover:text-gray-600 text-sm",children:"✕"})]})}),r.jsx("div",{className:"p-4",children:a.success?r.jsx("div",{children:a.data?r.jsxs("div",{children:[r.jsx("div",{className:"text-sm text-gray-600 mb-3",children:l("prompt.result")}),o(a.data)]}):r.jsx("div",{className:"text-sm text-gray-500 italic",children:l("prompt.noContent")})}):r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[r.jsx(vd,{size:16,className:"text-red-500"}),r.jsx("span",{className:"text-sm font-medium text-red-700",children:l("prompt.error")})]}),r.jsx("div",{className:"bg-red-50 border border-red-300 rounded-md p-3",children:r.jsx("pre",{className:"text-sm text-red-800 whitespace-pre-wrap",children:a.error||a.message||l("prompt.unknownError")})})]})})]})},_S=({prompt:a,server:n,onToggle:l,onDescriptionUpdate:o})=>{const{t:c}=Ce(),{showToast:d}=us(),{nameSeparator:m}=zs(),[p,g]=y.useState(!1),[h,b]=y.useState(!1),[x,w]=y.useState(!1),[T,R]=y.useState(null),[O,E]=y.useState(!1),[A,N]=y.useState(a.description||""),S=y.useRef(null),D=y.useRef(null),[P,$]=y.useState(0);y.useEffect(()=>{O&&S.current&&(S.current.focus(),P>0&&(S.current.style.width=`${P+20}px`))},[O,P]),y.useEffect(()=>{!O&&D.current&&$(D.current.offsetWidth)},[O,A]);const B=y.useCallback(()=>`mcphub_prompt_form_${n?`${n}_`:""}${a.name}`,[a.name,n]),L=y.useCallback(()=>{localStorage.removeItem(B())},[B]),Y=U=>{l&&l(a.name,U)},fe=()=>{E(!0)},G=async()=>{E(!1);try{const U=await T0(n,a.name,A);U.success?(d(c("prompt.descriptionUpdateSuccess"),"success"),o&&o(a.name,A)):(d(U.error||c("prompt.descriptionUpdateFailed"),"error"),N(a.description||""))}catch(U){console.error("Error updating prompt description:",U),d(c("prompt.descriptionUpdateFailed"),"error"),N(a.description||"")}},K=U=>{N(U.target.value)},X=U=>{U.key==="Enter"?G():U.key==="Escape"&&(N(a.description||""),E(!1))},H=async U=>{w(!0);try{const oe=await E0({promptName:a.name,arguments:U},n);console.log("GetPrompt result:",oe),R({success:oe.success,data:oe.data,error:oe.error})}catch(oe){R({success:!1,error:oe instanceof Error?oe.message:"Unknown error occurred"})}finally{w(!1)}},Z=()=>{b(!1),L(),R(null)},C=()=>{R(null)},I=()=>{if(!a.arguments||a.arguments.length===0)return{type:"object",properties:{},required:[]};const U={},oe=[];return a.arguments.forEach(V=>{U[V.name]={type:"string",description:V.description||""},V.required&&oe.push(V.name)}),{type:"object",properties:U,required:oe}};return r.jsxs("div",{className:"bg-white border border-gray-200 shadow rounded-lg mb-4",children:[r.jsxs("div",{className:"flex justify-between items-center p-2 cursor-pointer",onClick:()=>g(!p),children:[r.jsx("div",{className:"flex-1",children:r.jsxs("h3",{className:"text-lg font-medium text-gray-900",children:[a.name.replace(n+m,""),a.title&&r.jsx("span",{className:"ml-2 text-sm font-normal text-gray-600",children:a.title}),r.jsx("span",{className:"ml-2 text-sm font-normal text-gray-500 inline-flex items-center",children:O?r.jsxs(r.Fragment,{children:[r.jsx("input",{ref:S,type:"text",className:"px-2 py-1 border border-blue-300 rounded bg-white text-sm focus:outline-none form-input",value:A,onChange:K,onKeyDown:X,onClick:U=>U.stopPropagation(),style:{minWidth:"100px",width:P>0?`${P+20}px`:"auto"}}),r.jsx("button",{className:"ml-2 p-1 text-green-600 hover:text-green-800 cursor-pointer transition-colors",onClick:U=>{U.stopPropagation(),G()},children:r.jsx(os,{size:16})})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{ref:D,children:A||c("tool.noDescription")}),r.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:U=>{U.stopPropagation(),fe()},children:r.jsx(Ol,{size:14})})]})})]})}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx("div",{className:"flex items-center space-x-2",onClick:U=>U.stopPropagation(),children:a.enabled!==void 0&&r.jsx(tr,{checked:a.enabled,onCheckedChange:Y,disabled:x})}),r.jsxs("button",{onClick:U=>{U.stopPropagation(),g(!0),b(!0)},className:"flex items-center space-x-1 px-3 py-1 text-sm text-blue-600 bg-blue-50 hover:bg-blue-100 rounded-md transition-colors btn-primary",disabled:x||!a.enabled,children:[x?r.jsx(e0,{size:14,className:"animate-spin"}):r.jsx(t0,{size:14}),r.jsx("span",{children:c(x?"tool.running":"tool.run")})]}),r.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:p?r.jsx(Rl,{size:18}):r.jsx(bd,{size:18})})]})]}),p&&r.jsxs("div",{className:"mt-4 space-y-4",children:[h&&r.jsxs("div",{className:"border border-gray-300 rounded-lg p-4",children:[r.jsx(A0,{schema:I(),onSubmit:H,onCancel:Z,loading:x,storageKey:B(),title:c("prompt.runPromptWithName",{name:a.name.replace(n+m,"")})}),T&&r.jsx("div",{className:"mt-4",children:r.jsx(Qh,{result:T,onClose:C})})]}),!h&&a.arguments&&a.arguments.length>0&&r.jsxs("div",{className:"bg-gray-50 rounded p-3 border border-gray-300",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:c("tool.parameters")}),r.jsx("div",{className:"space-y-2",children:a.arguments.map((U,oe)=>r.jsxs("div",{className:"flex items-start",children:[r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("span",{className:"font-medium text-gray-700",children:U.name}),U.required&&r.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),U.description&&r.jsx("p",{className:"text-sm text-gray-600 mt-1",children:U.description})]}),r.jsx("div",{className:"text-xs text-gray-500 ml-2",children:U.title||""})]},oe))})]}),!h&&T&&r.jsx("div",{className:"mt-4",children:r.jsx(Qh,{result:T,onClose:C})})]})]})},Sd=({isOpen:a,onClose:n,onConfirm:l,serverName:o,isGroup:c=!1,isUser:d=!1})=>{const{t:m}=Ce();return a?r.jsx("div",{className:"fixed inset-0 bg-black/50 bg-opacity-30 z-50 flex items-center justify-center p-4",children:r.jsx("div",{className:"bg-white rounded-lg shadow-lg max-w-md w-full",children:r.jsxs("div",{className:"p-6",children:[r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-3",children:m(d?"users.confirmDelete":c?"groups.confirmDelete":"server.confirmDelete")}),r.jsx("p",{className:"text-gray-500 mb-6",children:d?m("users.deleteWarning",{username:o}):c?m("groups.deleteWarning",{name:o}):m("server.deleteWarning",{name:o})}),r.jsxs("div",{className:"flex justify-end space-x-3",children:[r.jsx("button",{onClick:n,className:"px-4 py-2 text-gray-600 hover:text-gray-800 btn-secondary",children:m("common.cancel")}),r.jsx("button",{onClick:l,className:"px-4 py-2 bg-red-500 text-white rounded hover:bg-red-600 btn-danger",children:m("common.delete")})]})]})})}):null},BS=({server:a,onRemove:n,onEdit:l,onToggle:o,onRefresh:c,onReload:d})=>{var I,U,oe;const{t:m}=Ce(),{showToast:p}=us(),[g,h]=y.useState(!1),[b,x]=y.useState(!1),[w,T]=y.useState(!1),[R,O]=y.useState(!1),[E,A]=y.useState(!1),[N,S]=y.useState(!1),D=y.useRef(null);y.useEffect(()=>{const V=j=>{D.current&&!D.current.contains(j.target)&&A(!1)};return document.addEventListener("mousedown",V),()=>{document.removeEventListener("mousedown",V)}},[]);const{exportMCPSettings:P}=zs(),$=V=>{V.stopPropagation(),x(!0)},B=V=>{V.stopPropagation(),l(a)},L=async V=>{if(V.stopPropagation(),!(w||!o)){T(!0);try{await o(a,a.enabled===!1)}finally{T(!1)}}},Y=async V=>{if(V.stopPropagation(),!(R||!d)){O(!0);try{await d(a)?p(m("server.reloadSuccess")||"Server reloaded successfully","success"):p(m("server.reloadError",{serverName:a.name})||"Failed to reload server","error")}finally{O(!1)}}},fe=V=>{V.stopPropagation(),A(!E)},G=V=>{if(V.stopPropagation(),!!a.error)if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(a.error).then(()=>{S(!0),p(m("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>S(!1),2e3)});else{const j=document.createElement("textarea");j.value=a.error,j.style.position="fixed",j.style.left="-9999px",document.body.appendChild(j),j.focus(),j.select();try{document.execCommand("copy"),S(!0),p(m("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>S(!1),2e3)}catch(M){p(m("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",M)}document.body.removeChild(j)}},K=async V=>{V.stopPropagation();try{const j=await P(a.name);if(!j||!j.success||!j.data){p((j==null?void 0:j.message)||m("common.copyFailed")||"Copy failed","error");return}const M=JSON.stringify(j.data,null,2);if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(M),p(m("common.copySuccess")||"Copied to clipboard","success");else{const z=document.createElement("textarea");z.value=M,z.style.position="fixed",z.style.left="-9999px",document.body.appendChild(z),z.focus(),z.select();try{document.execCommand("copy"),p(m("common.copySuccess")||"Copied to clipboard","success")}catch(q){p(m("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",q)}document.body.removeChild(z)}}catch(j){console.error("Error copying server configuration:",j),p(m("common.copyFailed")||"Copy failed","error")}},X=()=>{n(a.name),x(!1)},H=async(V,j)=>{try{const{toggleTool:M}=await Jh(async()=>{const{toggleTool:q}=await Promise.resolve().then(()=>zS);return{toggleTool:q}},[],import.meta.url),z=await M(a.name,V,j);z.success?(p(m(j?"tool.enableSuccess":"tool.disableSuccess",{name:V}),"success"),c&&c()):p(z.error||m("tool.toggleFailed"),"error")}catch(M){console.error("Error toggling tool:",M),p(m("tool.toggleFailed"),"error")}},Z=async(V,j)=>{try{const{togglePrompt:M}=await Jh(async()=>{const{togglePrompt:q}=await Promise.resolve().then(()=>US);return{togglePrompt:q}},void 0,import.meta.url),z=await M(a.name,V,j);z.success?(p(m(j?"tool.enableSuccess":"tool.disableSuccess",{name:V}),"success"),c&&c()):p(z.error||m("tool.toggleFailed"),"error")}catch(M){console.error("Error toggling prompt:",M),p(m("tool.toggleFailed"),"error")}},C=V=>{var j;if(V.stopPropagation(),(j=a.oauth)!=null&&j.authorizationUrl){const q=window.screen.width/2-300,pe=window.screen.height/2-700/2;window.open(a.oauth.authorizationUrl,"OAuth Authorization",`width=600,height=700,left=${q},top=${pe}`),p(m("status.oauthWindowOpened"),"info")}};return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:`bg-white shadow rounded-lg mb-6 page-card transition-all duration-200 ${a.enabled===!1?"opacity-60":""}`,children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer p-4",onClick:()=>h(!g),children:[r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("h2",{className:`text-xl font-semibold ${a.enabled===!1?"text-gray-600":"text-gray-900"}`,children:a.name}),r.jsx(RS,{status:a.status,onAuthClick:C}),((I=a.config)==null?void 0:I.type)&&r.jsx("div",{className:"flex items-center px-2 py-1 bg-gray-100 text-gray-700 rounded-full text-xs",children:r.jsxs("span",{children:[a.config.type==="stdio"&&m("server.typeStdio"),a.config.type==="sse"&&m("server.typeSse"),a.config.type==="streamable-http"&&m("server.typeStreamableHttp"),a.config.type==="openapi"&&m("server.typeOpenapi")]})}),r.jsxs("div",{className:"flex items-center px-2 py-1 bg-blue-50 text-blue-700 rounded-full text-sm btn-primary",children:[r.jsx("svg",{className:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z",clipRule:"evenodd"})}),r.jsxs("span",{children:[((U=a.tools)==null?void 0:U.length)||0," ",m("server.tools")]})]}),r.jsxs("div",{className:"flex items-center px-2 py-1 bg-purple-50 text-purple-700 rounded-full text-sm btn-primary",children:[r.jsxs("svg",{className:"w-4 h-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:[r.jsx("path",{d:"M2 5a2 2 0 012-2h7a2 2 0 012 2v4a2 2 0 01-2 2H9l-3 3v-3H4a2 2 0 01-2-2V5z"}),r.jsx("path",{d:"M15 7v2a4 4 0 01-4 4H9.828l-1.766 1.767c.28.149.599.233.938.233h2l3 3v-3h2a2 2 0 002-2V9a2 2 0 00-2-2h-1z"})]}),r.jsxs("span",{children:[((oe=a.prompts)==null?void 0:oe.length)||0," ",m("server.prompts")]})]}),a.error&&r.jsxs("div",{className:"relative",children:[r.jsx("div",{className:"cursor-pointer",onClick:fe,"aria-label":m("server.viewErrorDetails"),children:r.jsx(vd,{className:"text-red-500 hover:text-red-600",size:18})}),E&&r.jsxs("div",{ref:D,className:"absolute z-10 mt-2 bg-white border border-gray-200 rounded-md shadow-lg p-0 w-120",style:{left:"-231px",top:"24px",maxHeight:"300px",overflowY:"auto",width:"480px",transform:"translateX(50%)"},onClick:V=>V.stopPropagation(),children:[r.jsxs("div",{className:"flex justify-between items-center sticky top-0 bg-white py-2 px-4 border-b border-gray-200 z-20 shadow-sm",children:[r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx("h4",{className:"text-sm font-medium text-red-600",children:m("server.errorDetails")}),r.jsx("button",{onClick:G,className:"p-1 text-gray-400 hover:text-gray-600 transition-colors btn-secondary",title:m("common.copy"),children:N?r.jsx(os,{size:14,className:"text-green-500"}):r.jsx(wn,{size:14})})]}),r.jsx("button",{onClick:V=>{V.stopPropagation(),A(!1)},className:"text-gray-400 hover:text-gray-600",children:"✕"})]}),r.jsx("div",{className:"p-4 pt-2",children:r.jsx("pre",{className:"text-sm text-gray-700 break-words whitespace-pre-wrap",children:a.error})})]})]})]}),r.jsxs("div",{className:"flex space-x-2",children:[r.jsx("button",{onClick:K,className:"px-3 py-1 btn-secondary",children:m("server.copy")}),r.jsx("button",{onClick:B,className:"px-3 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:m("server.edit")}),r.jsx("div",{className:"flex items-center",children:r.jsx("button",{onClick:L,className:`px-3 py-1 text-sm rounded transition-colors ${w?"bg-gray-200 text-gray-500":a.enabled!==!1?"bg-green-100 text-green-800 hover:bg-green-200 btn-secondary":"bg-gray-100 text-gray-800 hover:bg-gray-200 btn-primary"}`,disabled:w||R,children:w?m("common.processing"):a.enabled!==!1?m("server.disable"):m("server.enable")})}),a.enabled!==!1&&d&&r.jsx("button",{onClick:Y,className:"px-3 py-1 bg-purple-100 text-purple-800 rounded hover:bg-purple-200 text-sm btn-secondary disabled:opacity-70 disabled:cursor-not-allowed",disabled:R||w,children:m(R?"common.processing":"server.reload")}),r.jsx("button",{onClick:$,className:"px-3 py-1 bg-red-100 text-red-800 rounded hover:bg-red-200 text-sm btn-danger",children:m("server.delete")}),r.jsx("button",{className:"text-gray-400 hover:text-gray-600 btn-secondary",children:g?r.jsx(Rl,{size:18}):r.jsx(bd,{size:18})})]})]}),g&&r.jsxs(r.Fragment,{children:[a.tools&&r.jsxs("div",{className:"px-4",children:[r.jsx("h6",{className:`font-medium ${a.enabled===!1?"text-gray-600":"text-gray-900"} mb-2`,children:m("server.tools")}),r.jsx("div",{className:"space-y-4",children:a.tools.map((V,j)=>r.jsx(DS,{server:a.name,tool:V,onToggle:H},j))})]}),a.prompts&&r.jsxs("div",{className:"px-4 pb-2",children:[r.jsx("h6",{className:`font-medium ${a.enabled===!1?"text-gray-600":"text-gray-900"}`,children:m("server.prompts")}),r.jsx("div",{className:"space-y-4",children:a.prompts.map((V,j)=>r.jsx(_S,{server:a.name,prompt:V,onToggle:Z},j))})]})]})]}),r.jsx(Sd,{isOpen:b,onClose:()=>x(!1),onConfirm:X,serverName:a.name})]})},Ml=({onSubmit:a,onCancel:n,initialData:l=null,modalTitle:o,formError:c=null})=>{var M,z,q,pe,se,Q,ge,re,ye,ue,ie,xe,Xe,Ft,Vt,Ze,gt,$t,Ut,Yt,It,pr,tt,wt,ir,ze,St,ke,nt,lt,ar,Jt,ft,sr,xt,Ma,ia,La,hr,gr,W,ve,qe,jt,Vr,oa,$r,Ve,it;const{t:d}=Ce(),m=()=>!l||!l.config?"stdio":l.config.type?l.config.type:l.config.url?"sse":"stdio",p=he=>!he||!he.config||!he.config.env?[]:Object.entries(he.config.env).map(([le,be])=>({key:le,value:be,description:""})),g=he=>{var be;const le=(be=he==null?void 0:he.config)==null?void 0:be.oauth;return{clientId:(le==null?void 0:le.clientId)||"",clientSecret:(le==null?void 0:le.clientSecret)||"",scopes:le!=null&&le.scopes?le.scopes.join(" "):"",accessToken:(le==null?void 0:le.accessToken)||"",refreshToken:(le==null?void 0:le.refreshToken)||"",authorizationEndpoint:(le==null?void 0:le.authorizationEndpoint)||"",tokenEndpoint:(le==null?void 0:le.tokenEndpoint)||"",resource:(le==null?void 0:le.resource)||""}},[h,b]=y.useState(m()),[x,w]=y.useState({name:l&&l.name||"",url:l&&l.config&&l.config.url||"",command:l&&l.config&&l.config.command||"",arguments:l&&l.config&&l.config.args?Array.isArray(l.config.args)?l.config.args.join(" "):String(l.config.args):"",args:l&&l.config&&l.config.args||[],type:m(),env:p(l),headers:[],options:{timeout:l&&l.config&&l.config.options&&l.config.options.timeout||6e4,resetTimeoutOnProgress:l&&l.config&&l.config.options&&l.config.options.resetTimeoutOnProgress||!1,maxTotalTimeout:l&&l.config&&l.config.options&&l.config.options.maxTotalTimeout||void 0},oauth:g(l),keepAlive:{enabled:((M=l==null?void 0:l.config)==null?void 0:M.enableKeepAlive)||!1,interval:((z=l==null?void 0:l.config)==null?void 0:z.keepAliveInterval)||6e4},openapi:l&&l.config&&l.config.openapi?{url:l.config.openapi.url||"",schema:l.config.openapi.schema?JSON.stringify(l.config.openapi.schema,null,2):"",inputMode:l.config.openapi.url?"url":l.config.openapi.schema?"schema":"url",version:l.config.openapi.version||"3.1.0",securityType:((q=l.config.openapi.security)==null?void 0:q.type)||"none",apiKeyName:((se=(pe=l.config.openapi.security)==null?void 0:pe.apiKey)==null?void 0:se.name)||"",apiKeyIn:((ge=(Q=l.config.openapi.security)==null?void 0:Q.apiKey)==null?void 0:ge.in)||"header",apiKeyValue:((ye=(re=l.config.openapi.security)==null?void 0:re.apiKey)==null?void 0:ye.value)||"",httpScheme:((ie=(ue=l.config.openapi.security)==null?void 0:ue.http)==null?void 0:ie.scheme)||"bearer",httpCredentials:((Xe=(xe=l.config.openapi.security)==null?void 0:xe.http)==null?void 0:Xe.credentials)||"",oauth2Token:((Vt=(Ft=l.config.openapi.security)==null?void 0:Ft.oauth2)==null?void 0:Vt.token)||"",openIdConnectUrl:((gt=(Ze=l.config.openapi.security)==null?void 0:Ze.openIdConnect)==null?void 0:gt.url)||"",openIdConnectToken:((Ut=($t=l.config.openapi.security)==null?void 0:$t.openIdConnect)==null?void 0:Ut.token)||"",passthroughHeaders:l.config.openapi.passthroughHeaders?l.config.openapi.passthroughHeaders.join(", "):""}:{inputMode:"url",url:"",schema:"",version:"3.1.0",securityType:"none",passthroughHeaders:""}}),[T,R]=y.useState(l&&l.config&&l.config.env?Object.entries(l.config.env).map(([he,le])=>({key:he,value:le})):[]),[O,E]=y.useState(l&&l.config&&l.config.headers?Object.entries(l.config.headers).map(([he,le])=>({key:he,value:le})):[]),[A,N]=y.useState(!1),[S,D]=y.useState(!1),[P,$]=y.useState(!1),[B,L]=y.useState(null),Y=!!l,fe=he=>{const{name:le,value:be}=he.target;w({...x,[le]:be})},G=he=>{const le=he.split(" ").filter(be=>be.trim()!=="");w({...x,arguments:he,args:le})},K=he=>{b(he),w(le=>({...le,type:he}))},X=(he,le,be)=>{const nr=[...T];nr[he][le]=be,R(nr)},H=()=>{R([...T,{key:"",value:""}])},Z=he=>{const le=[...T];le.splice(he,1),R(le)},C=(he,le,be)=>{const nr=[...O];nr[he][le]=be,E(nr)},I=()=>{E([...O,{key:"",value:""}])},U=he=>{const le=[...O];le.splice(he,1),E(le)},oe=(he,le)=>{w(be=>({...be,oauth:{...be.oauth||{},[he]:le}}))},V=(he,le)=>{w(be=>({...be,options:{...be.options,[he]:le}}))},j=async he=>{var le,be,nr,Yr,ds;he.preventDefault(),L(null);try{const Qt={};T.forEach(({key:we,value:Re})=>{we.trim()&&(Qt[we.trim()]=Re)});const Xt={};O.forEach(({key:we,value:Re})=>{we.trim()&&(Xt[we.trim()]=Re)});const $e={};(le=x.options)!=null&&le.timeout&&x.options.timeout!==6e4&&($e.timeout=x.options.timeout),(be=x.options)!=null&&be.resetTimeoutOnProgress&&($e.resetTimeoutOnProgress=x.options.resetTimeoutOnProgress),(nr=x.options)!=null&&nr.maxTotalTimeout&&($e.maxTotalTimeout=x.options.maxTotalTimeout);const Mt=(()=>{if(!x.oauth)return;const{clientId:we,clientSecret:Re,scopes:Fe,accessToken:Ke,refreshToken:ct,authorizationEndpoint:Jr,tokenEndpoint:xr,resource:yr}=x.oauth,Nt={};if(we&&we.trim()&&(Nt.clientId=we.trim()),Re&&Re.trim()&&(Nt.clientSecret=Re.trim()),Fe&&Fe.trim()){const ca=Fe.split(/[\s,]+/).map(yt=>yt.trim()).filter(yt=>yt.length>0);ca.length>0&&(Nt.scopes=ca)}return Ke&&Ke.trim()&&(Nt.accessToken=Ke.trim()),ct&&ct.trim()&&(Nt.refreshToken=ct.trim()),Jr&&Jr.trim()&&(Nt.authorizationEndpoint=Jr.trim()),xr&&xr.trim()&&(Nt.tokenEndpoint=xr.trim()),yr&&yr.trim()&&(Nt.resource=yr.trim()),Object.keys(Nt).length>0?Nt:void 0})(),Zt={name:x.name,config:{type:h,...h==="openapi"?{openapi:(()=>{var Re,Fe,Ke,ct,Jr,xr,yr;const we={version:((Re=x.openapi)==null?void 0:Re.version)||"3.1.0"};if(((Fe=x.openapi)==null?void 0:Fe.inputMode)==="url")we.url=((Ke=x.openapi)==null?void 0:Ke.url)||"";else if(((ct=x.openapi)==null?void 0:ct.inputMode)==="schema"&&((Jr=x.openapi)!=null&&Jr.schema))try{we.schema=JSON.parse(x.openapi.schema)}catch{throw new Error("Invalid JSON schema format")}return(xr=x.openapi)!=null&&xr.securityType&&x.openapi.securityType!=="none"&&(we.security={type:x.openapi.securityType,...x.openapi.securityType==="apiKey"&&{apiKey:{name:x.openapi.apiKeyName||"",in:x.openapi.apiKeyIn||"header",value:x.openapi.apiKeyValue||""}},...x.openapi.securityType==="http"&&{http:{scheme:x.openapi.httpScheme||"bearer",credentials:x.openapi.httpCredentials||""}},...x.openapi.securityType==="oauth2"&&{oauth2:{token:x.openapi.oauth2Token||""}},...x.openapi.securityType==="openIdConnect"&&{openIdConnect:{url:x.openapi.openIdConnectUrl||"",token:x.openapi.openIdConnectToken||""}}}),(yr=x.openapi)!=null&&yr.passthroughHeaders&&x.openapi.passthroughHeaders.trim()&&(we.passthroughHeaders=x.openapi.passthroughHeaders.split(",").map(Nt=>Nt.trim()).filter(Nt=>Nt.length>0)),we})(),...Object.keys(Xt).length>0?{headers:Xt}:{}}:h==="sse"||h==="streamable-http"?{url:x.url,...Object.keys(Xt).length>0?{headers:Xt}:{},...Object.keys(Qt).length>0?{env:Qt}:{},...Mt?{oauth:Mt}:{}}:{command:x.command,args:x.args,env:Object.keys(Qt).length>0?Qt:void 0},...Object.keys($e).length>0?{options:$e}:{},...h==="sse"||h==="streamable-http"?{enableKeepAlive:((Yr=x.keepAlive)==null?void 0:Yr.enabled)||!1,...(ds=x.keepAlive)!=null&&ds.enabled?{keepAliveInterval:x.keepAlive.interval||6e4}:{}}:{}}};a(Zt)}catch(Qt){L(`Error: ${Qt instanceof Error?Qt.message:String(Qt)}`)}};return r.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-xl max-h-screen overflow-y-auto",children:[r.jsxs("div",{className:"flex justify-between items-center mb-4",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:o}),r.jsx("button",{onClick:n,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),(B||c)&&r.jsx("div",{className:"bg-red-50 text-red-700 p-3 rounded mb-4",children:c||B}),r.jsxs("form",{onSubmit:j,children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:d("server.name")}),r.jsx("input",{type:"text",name:"name",id:"name",value:x.name,onChange:fe,className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"e.g.: time-mcp",required:!0})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:d("server.type")}),r.jsxs("div",{className:"flex space-x-4",children:[r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"command",name:"serverType",value:"command",checked:h==="stdio",onChange:()=>K("stdio"),className:"mr-1"}),r.jsx("label",{htmlFor:"command",children:d("server.typeStdio")})]}),r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"url",name:"serverType",value:"url",checked:h==="sse",onChange:()=>K("sse"),className:"mr-1"}),r.jsx("label",{htmlFor:"url",children:d("server.typeSse")})]}),r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"streamable-http",name:"serverType",value:"streamable-http",checked:h==="streamable-http",onChange:()=>K("streamable-http"),className:"mr-1"}),r.jsx("label",{htmlFor:"streamable-http",children:d("server.typeStreamableHttp")})]}),r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"openapi",name:"serverType",value:"openapi",checked:h==="openapi",onChange:()=>K("openapi"),className:"mr-1"}),r.jsx("label",{htmlFor:"openapi",children:d("server.typeOpenapi")})]})]})]}),h==="openapi"?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:d("server.openapi.inputMode")}),r.jsxs("div",{className:"flex space-x-4",children:[r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"input-mode-url",name:"inputMode",value:"url",checked:((Yt=x.openapi)==null?void 0:Yt.inputMode)==="url",onChange:()=>w(he=>({...he,openapi:{...he.openapi,inputMode:"url"}})),className:"mr-1"}),r.jsx("label",{htmlFor:"input-mode-url",children:d("server.openapi.inputModeUrl")})]}),r.jsxs("div",{children:[r.jsx("input",{type:"radio",id:"input-mode-schema",name:"inputMode",value:"schema",checked:((It=x.openapi)==null?void 0:It.inputMode)==="schema",onChange:()=>w(he=>({...he,openapi:{...he.openapi,inputMode:"schema"}})),className:"mr-1"}),r.jsx("label",{htmlFor:"input-mode-schema",children:d("server.openapi.inputModeSchema")})]})]})]}),((pr=x.openapi)==null?void 0:pr.inputMode)==="url"&&r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"openapi-url",children:d("server.openapi.specUrl")}),r.jsx("input",{type:"url",name:"openapi-url",id:"openapi-url",value:((tt=x.openapi)==null?void 0:tt.url)||"",onChange:he=>w(le=>({...le,openapi:{...le.openapi,url:he.target.value}})),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"e.g.: https://api.example.com/openapi.json",required:h==="openapi"&&((wt=x.openapi)==null?void 0:wt.inputMode)==="url"})]}),((ir=x.openapi)==null?void 0:ir.inputMode)==="schema"&&r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"openapi-schema",children:d("server.openapi.schema")}),r.jsx("textarea",{name:"openapi-schema",id:"openapi-schema",rows:10,value:((ze=x.openapi)==null?void 0:ze.schema)||"",onChange:he=>w(le=>({...le,openapi:{...le.openapi,schema:he.target.value}})),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline font-mono text-sm",placeholder:`{
212
+ "openapi": "3.1.0",
213
+ "info": {
214
+ "title": "API",
215
+ "version": "1.0.0"
216
+ },
217
+ "servers": [
218
+ {
219
+ "url": "https://api.example.com"
220
+ }
221
+ ],
222
+ "paths": {
223
+ ...
224
+ }
225
+ }`,required:h==="openapi"&&((St=x.openapi)==null?void 0:St.inputMode)==="schema"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:d("server.openapi.schemaHelp")})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:d("server.openapi.security")}),r.jsxs("select",{value:((ke=x.openapi)==null?void 0:ke.securityType)||"none",onChange:he=>w(le=>{var be;return{...le,openapi:{...le.openapi,securityType:he.target.value,url:((be=le.openapi)==null?void 0:be.url)||""}}}),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",children:[r.jsx("option",{value:"none",children:d("server.openapi.securityNone")}),r.jsx("option",{value:"apiKey",children:d("server.openapi.securityApiKey")}),r.jsx("option",{value:"http",children:d("server.openapi.securityHttp")}),r.jsx("option",{value:"oauth2",children:d("server.openapi.securityOAuth2")}),r.jsx("option",{value:"openIdConnect",children:d("server.openapi.securityOpenIdConnect")})]})]}),((nt=x.openapi)==null?void 0:nt.securityType)==="apiKey"&&r.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:d("server.openapi.apiKeyConfig")}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.apiKeyName")}),r.jsx("input",{type:"text",value:((lt=x.openapi)==null?void 0:lt.apiKeyName)||"",onChange:he=>w(le=>{var be;return{...le,openapi:{...le.openapi,apiKeyName:he.target.value,url:((be=le.openapi)==null?void 0:be.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm form-input focus:outline-none",placeholder:"Authorization"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.apiKeyIn")}),r.jsxs("select",{value:((ar=x.openapi)==null?void 0:ar.apiKeyIn)||"header",onChange:he=>w(le=>{var be;return{...le,openapi:{...le.openapi,apiKeyIn:he.target.value,url:((be=le.openapi)==null?void 0:be.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[r.jsx("option",{value:"header",children:d("server.openapi.apiKeyInHeader")}),r.jsx("option",{value:"query",children:d("server.openapi.apiKeyInQuery")}),r.jsx("option",{value:"cookie",children:d("server.openapi.apiKeyInCookie")})]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.apiKeyValue")}),r.jsx("input",{type:"password",value:((Jt=x.openapi)==null?void 0:Jt.apiKeyValue)||"",onChange:he=>w(le=>{var be;return{...le,openapi:{...le.openapi,apiKeyValue:he.target.value,url:((be=le.openapi)==null?void 0:be.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"your-api-key"})]})]})]}),((ft=x.openapi)==null?void 0:ft.securityType)==="http"&&r.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:d("server.openapi.httpAuthConfig")}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.httpScheme")}),r.jsxs("select",{value:((sr=x.openapi)==null?void 0:sr.httpScheme)||"bearer",onChange:he=>w(le=>{var be;return{...le,openapi:{...le.openapi,httpScheme:he.target.value,url:((be=le.openapi)==null?void 0:be.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[r.jsx("option",{value:"basic",children:d("server.openapi.httpSchemeBasic")}),r.jsx("option",{value:"bearer",children:d("server.openapi.httpSchemeBearer")}),r.jsx("option",{value:"digest",children:d("server.openapi.httpSchemeDigest")})]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.httpCredentials")}),r.jsx("input",{type:"password",value:((xt=x.openapi)==null?void 0:xt.httpCredentials)||"",onChange:he=>w(le=>{var be;return{...le,openapi:{...le.openapi,httpCredentials:he.target.value,url:((be=le.openapi)==null?void 0:be.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:((Ma=x.openapi)==null?void 0:Ma.httpScheme)==="basic"?"base64-encoded-credentials":"bearer-token"})]})]})]}),((ia=x.openapi)==null?void 0:ia.securityType)==="oauth2"&&r.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:d("server.openapi.oauth2Config")}),r.jsx("div",{className:"grid grid-cols-1 gap-3",children:r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.oauth2Token")}),r.jsx("input",{type:"password",value:((La=x.openapi)==null?void 0:La.oauth2Token)||"",onChange:he=>w(le=>{var be;return{...le,openapi:{...le.openapi,oauth2Token:he.target.value,url:((be=le.openapi)==null?void 0:be.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"access-token"})]})})]}),((hr=x.openapi)==null?void 0:hr.securityType)==="openIdConnect"&&r.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:d("server.openapi.openIdConnectConfig")}),r.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.openIdConnectUrl")}),r.jsx("input",{type:"url",value:((gr=x.openapi)==null?void 0:gr.openIdConnectUrl)||"",onChange:he=>w(le=>{var be;return{...le,openapi:{...le.openapi,openIdConnectUrl:he.target.value,url:((be=le.openapi)==null?void 0:be.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"https://example.com/.well-known/openid_configuration"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.openIdConnectToken")}),r.jsx("input",{type:"password",value:((W=x.openapi)==null?void 0:W.openIdConnectToken)||"",onChange:he=>w(le=>{var be;return{...le,openapi:{...le.openapi,openIdConnectToken:he.target.value,url:((be=le.openapi)==null?void 0:be.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"id-token"})]})]})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:d("server.openapi.passthroughHeaders")}),r.jsx("input",{type:"text",value:((ve=x.openapi)==null?void 0:ve.passthroughHeaders)||"",onChange:he=>w(le=>{var be;return{...le,openapi:{...le.openapi,passthroughHeaders:he.target.value,url:((be=le.openapi)==null?void 0:be.url)||""}}}),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"Authorization, X-API-Key, X-Custom-Header"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:d("server.openapi.passthroughHeadersHelp")})]}),r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex justify-between items-center mb-2",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:d("server.headers")}),r.jsx("button",{type:"button",onClick:I,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),O.map((he,le)=>r.jsxs("div",{className:"flex items-center mb-2",children:[r.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[r.jsx("input",{type:"text",value:he.key,onChange:be=>C(le,"key",be.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:"Authorization"}),r.jsx("span",{className:"flex items-center",children:":"}),r.jsx("input",{type:"text",value:he.value,onChange:be=>C(le,"value",be.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:"Bearer token..."})]}),r.jsx("button",{type:"button",onClick:()=>U(le),className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] ml-2 btn-danger",children:"-"})]},le))]})]}):h==="sse"||h==="streamable-http"?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"url",children:d("server.url")}),r.jsx("input",{type:"url",name:"url",id:"url",value:x.url,onChange:fe,className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:h==="streamable-http"?"e.g.: http://localhost:3000/mcp":"e.g.: http://localhost:3000/sse",required:h==="sse"||h==="streamable-http"})]}),r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex justify-between items-center mb-2",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:d("server.headers")}),r.jsx("button",{type:"button",onClick:I,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),O.map((he,le)=>r.jsxs("div",{className:"flex items-center mb-2",children:[r.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[r.jsx("input",{type:"text",value:he.key,onChange:be=>C(le,"key",be.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:"Authorization"}),r.jsx("span",{className:"flex items-center",children:":"}),r.jsx("input",{type:"text",value:he.value,onChange:be=>C(le,"value",be.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:"Bearer token..."})]}),r.jsx("button",{type:"button",onClick:()=>U(le),className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] ml-2 btn-danger",children:"-"})]},le))]}),r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex justify-between items-center mb-2",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:d("server.envVars")}),r.jsx("button",{type:"button",onClick:H,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),T.map((he,le)=>r.jsxs("div",{className:"flex items-center mb-2",children:[r.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[r.jsx("input",{type:"text",value:he.key,onChange:be=>X(le,"key",be.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:d("server.key")}),r.jsx("span",{className:"flex items-center",children:":"}),r.jsx("input",{type:"text",value:he.value,onChange:be=>X(le,"value",be.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:d("server.value")})]}),r.jsx("button",{type:"button",onClick:()=>Z(le),className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] ml-2 btn-danger",children:"-"})]},le))]}),r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex items-center justify-between cursor-pointer bg-gray-50 hover:bg-gray-100 p-3 rounded border border-gray-200",onClick:()=>D(!S),children:[r.jsx("label",{className:"text-gray-700 text-sm font-bold",children:d("server.oauth.sectionTitle")}),r.jsx("span",{className:"text-gray-500 text-sm",children:S?"▼":"▶"})]}),S&&r.jsxs("div",{className:"border border-gray-200 rounded-b p-4 bg-gray-50 border-t-0",children:[r.jsx("p",{className:"text-xs text-gray-500 mb-3",children:d("server.oauth.sectionDescription")}),r.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.oauth.clientId")}),r.jsx("input",{type:"text",value:((qe=x.oauth)==null?void 0:qe.clientId)||"",onChange:he=>oe("clientId",he.target.value),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"client id",autoComplete:"off"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.oauth.clientSecret")}),r.jsx("input",{type:"password",value:((jt=x.oauth)==null?void 0:jt.clientSecret)||"",onChange:he=>oe("clientSecret",he.target.value),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"client secret",autoComplete:"off"})]})]})]})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"command",children:d("server.command")}),r.jsx("input",{type:"text",name:"command",id:"command",value:x.command,onChange:fe,className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"e.g.: npx",required:h==="stdio"})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"arguments",children:d("server.arguments")}),r.jsx("input",{type:"text",name:"arguments",id:"arguments",value:x.arguments,onChange:he=>G(he.target.value),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"e.g.: -y time-mcp",required:h==="stdio"})]}),r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex justify-between items-center mb-2",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:d("server.envVars")}),r.jsx("button",{type:"button",onClick:H,className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] btn-primary",children:"+"})]}),T.map((he,le)=>r.jsxs("div",{className:"flex items-center mb-2",children:[r.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[r.jsx("input",{type:"text",value:he.key,onChange:be=>X(le,"key",be.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:d("server.key")}),r.jsx("span",{className:"flex items-center",children:":"}),r.jsx("input",{type:"text",value:he.value,onChange:be=>X(le,"value",be.target.value),className:"shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-1/2 form-input",placeholder:d("server.value")})]}),r.jsx("button",{type:"button",onClick:()=>Z(le),className:"bg-gray-200 hover:bg-gray-300 text-gray-700 font-medium py-1 px-2 rounded text-sm flex items-center justify-center min-w-[30px] min-h-[30px] ml-2 btn-danger",children:"-"})]},le))]})]}),h!=="openapi"&&r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex items-center justify-between cursor-pointer bg-gray-50 hover:bg-gray-100 p-3 rounded border border-gray-200",onClick:()=>N(!A),children:[r.jsx("label",{className:"text-gray-700 text-sm font-bold",children:d("server.requestOptions")}),r.jsx("span",{className:"text-gray-500 text-sm",children:A?"▼":"▶"})]}),A&&r.jsxs("div",{className:"border border-gray-200 rounded-b p-4 bg-gray-50 border-t-0",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"timeout",children:d("server.timeout")}),r.jsx("input",{type:"number",id:"timeout",value:((Vr=x.options)==null?void 0:Vr.timeout)||6e4,onChange:he=>V("timeout",parseInt(he.target.value)||6e4),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"30000",min:"1000",max:"300000"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:d("server.timeoutDescription")})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"maxTotalTimeout",children:d("server.maxTotalTimeout")}),r.jsx("input",{type:"number",id:"maxTotalTimeout",value:((oa=x.options)==null?void 0:oa.maxTotalTimeout)||"",onChange:he=>V("maxTotalTimeout",he.target.value?parseInt(he.target.value):void 0),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"Optional",min:"1000"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:d("server.maxTotalTimeoutDescription")})]})]}),r.jsxs("div",{className:"mt-3",children:[r.jsxs("label",{className:"flex items-center",children:[r.jsx("input",{type:"checkbox",checked:(($r=x.options)==null?void 0:$r.resetTimeoutOnProgress)||!1,onChange:he=>V("resetTimeoutOnProgress",he.target.checked),className:"mr-2"}),r.jsx("span",{className:"text-gray-600 text-sm",children:d("server.resetTimeoutOnProgress")})]}),r.jsx("p",{className:"text-xs text-gray-500 mt-1 ml-6",children:d("server.resetTimeoutOnProgressDescription")})]})]})]}),(h==="sse"||h==="streamable-http")&&r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex items-center justify-between cursor-pointer bg-gray-50 hover:bg-gray-100 p-3 rounded border border-gray-200",onClick:()=>$(!P),children:[r.jsx("label",{className:"text-gray-700 text-sm font-bold",children:d("server.keepAlive","Keep-Alive")}),r.jsx("span",{className:"text-gray-500 text-sm",children:P?"▼":"▶"})]}),P&&r.jsxs("div",{className:"border border-gray-200 rounded-b p-4 bg-gray-50 border-t-0",children:[r.jsxs("div",{className:"flex items-center mb-3",children:[r.jsx("input",{type:"checkbox",id:"enableKeepAlive",checked:((Ve=x.keepAlive)==null?void 0:Ve.enabled)||!1,onChange:he=>w(le=>({...le,keepAlive:{...le.keepAlive,enabled:he.target.checked}})),className:"mr-2"}),r.jsx("label",{htmlFor:"enableKeepAlive",className:"text-gray-600 text-sm",children:d("server.enableKeepAlive","Enable Keep-Alive")})]}),r.jsx("p",{className:"text-xs text-gray-500 mb-3",children:d("server.keepAliveDescription","Send periodic ping requests to maintain the connection. Useful for long-running connections that may timeout.")}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"keepAliveInterval",children:d("server.keepAliveInterval","Interval (ms)")}),r.jsx("input",{type:"number",id:"keepAliveInterval",value:((it=x.keepAlive)==null?void 0:it.interval)||6e4,onChange:he=>w(le=>({...le,keepAlive:{...le.keepAlive,interval:parseInt(he.target.value)||6e4}})),className:"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",placeholder:"60000",min:"5000",max:"300000"}),r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:d("server.keepAliveIntervalDescription","Time between keep-alive pings in milliseconds (default: 60000ms = 1 minute)")})]})]})]}),r.jsxs("div",{className:"flex justify-end mt-6",children:[r.jsx("button",{type:"button",onClick:n,className:"bg-gray-300 hover:bg-gray-400 text-gray-800 font-medium py-2 px-4 rounded mr-2 btn-secondary",children:d("server.cancel")}),r.jsx("button",{type:"submit",className:"bg-blue-500 hover:bg-blue-600 text-white font-medium py-2 px-4 rounded btn-primary",children:d(Y?"server.save":"server.add")})]})]})]})},R0=a=>{const n=new Set,l=/\$\{([^}]+)\}/g,o=d=>{let m;for(;(m=l.exec(d))!==null;)n.add(m[1])},c=(d,m="")=>{typeof d=="string"?o(d):Array.isArray(d)?d.forEach((p,g)=>c(p,`${m}[${g}]`)):d&&typeof d=="object"&&Object.entries(d).forEach(([p,g])=>{c(g,m?`${m}.${p}`:p)})};return c(a),Array.from(n)},IS=({onAdd:a})=>{const{t:n}=Ce(),[l,o]=y.useState(!1),[c,d]=y.useState(null),[m,p]=y.useState(!1),[g,h]=y.useState(null),[b,x]=y.useState([]),w=()=>{o(!l),d(null),p(!1),h(null)},T=async()=>{g&&(await R(g),p(!1),h(null))},R=async E=>{try{d(null);const A=await At("/servers",E);if(!A.success){A&&A.message?d(A.message):d(n("server.addError"));return}o(!1),a()}catch(A){console.error("Error adding server:",A),navigator.onLine?A instanceof TypeError&&(A.message.includes("NetworkError")||A.message.includes("Failed to fetch"))?d(n("errors.serverConnection")):d(n("errors.serverAdd")):d(n("errors.network"))}},O=async E=>{try{const A=R0(E);A.length>0?(x(A),h(E),p(!0)):await R(E)}catch(A){console.error("Error processing server submission:",A),d(n("errors.serverAdd"))}};return r.jsxs("div",{children:[r.jsxs("button",{onClick:w,className:"w-full bg-blue-100 text-blue-800 rounded hover:bg-blue-200 py-2 px-4 flex items-center justify-center btn-primary",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z",clipRule:"evenodd"})}),n("server.add")]}),l&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx(Ml,{onSubmit:O,onCancel:w,modalTitle:n("server.addServer"),formError:c})}),m&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-[60] flex items-center justify-center p-4",children:r.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-md",children:[r.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:n("server.confirmVariables")}),r.jsx("p",{className:"text-gray-600 mb-4",children:n("server.variablesDetected")}),r.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded p-3 mb-4",children:r.jsxs("div",{className:"flex items-start",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),r.jsxs("div",{className:"ml-3",children:[r.jsxs("h4",{className:"text-sm font-medium text-yellow-800",children:[n("server.detectedVariables"),":"]}),r.jsx("ul",{className:"mt-1 text-sm text-yellow-700",children:b.map((E,A)=>r.jsxs("li",{className:"font-mono",children:["$",`{${E}}`]},A))})]})]})}),r.jsx("p",{className:"text-gray-600 text-sm mb-6",children:n("server.confirmVariablesMessage")}),r.jsxs("div",{className:"flex justify-end space-x-3",children:[r.jsx("button",{onClick:()=>{p(!1),h(null)},className:"px-4 py-2 text-gray-600 border border-gray-300 rounded hover:bg-gray-50 btn-secondary",children:n("common.cancel")}),r.jsx("button",{onClick:T,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 btn-primary",children:n("server.confirmAndAdd")})]})]})})]})},HS=({server:a,onEdit:n,onCancel:l})=>{const{t:o}=Ce(),[c,d]=y.useState(null),m=async p=>{try{d(null);const g=encodeURIComponent(a.name),h=p.name&&p.name!==a.name,b={config:p.config,...h?{newName:p.name}:{}},x=await Pt(`/servers/${g}`,b);if(!x.success){x&&x.message?d(x.message):d(o("server.updateError",{serverName:a.name}));return}n()}catch(g){console.error("Error updating server:",g),navigator.onLine?g instanceof TypeError&&(g.message.includes("NetworkError")||g.message.includes("Failed to fetch"))?d(o("errors.serverConnection")):d(o("errors.serverUpdate",{serverName:a.name})):d(o("errors.network"))}};return r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx(Ml,{onSubmit:m,onCancel:l,initialData:a,modalTitle:o("server.editTitle",{serverName:a.name}),formError:c})})},GS=({isOpen:a,onClose:n,onConfirm:l,title:o,message:c,confirmText:d,cancelText:m,variant:p="warning"})=>{const{t:g}=Ce();if(!a)return null;const h=()=>{switch(p){case"danger":return{icon:r.jsx("svg",{className:"w-6 h-6 text-red-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})}),confirmClass:"bg-red-600 hover:bg-red-700 text-white"};case"warning":return{icon:r.jsx("svg",{className:"w-6 h-6 text-yellow-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})}),confirmClass:"bg-yellow-600 hover:bg-yellow-700 text-white"};case"info":return{icon:r.jsx("svg",{className:"w-6 h-6 text-blue-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),confirmClass:"bg-blue-600 hover:bg-blue-700 text-white"};default:return{icon:null,confirmClass:"bg-blue-600 hover:bg-blue-700 text-white"}}},{icon:b,confirmClass:x}=h(),w=R=>{R.target===R.currentTarget&&n()},T=R=>{R.key==="Escape"?n():R.key==="Enter"&&l()};return r.jsx("div",{className:"fixed inset-0 bg-black/50 z-[100] flex items-center justify-center p-4",onClick:w,onKeyDown:T,tabIndex:-1,children:r.jsx("div",{className:"bg-white rounded-lg shadow-xl max-w-md w-full transform transition-all duration-200 ease-out",role:"dialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title","aria-describedby":"confirm-dialog-message",children:r.jsxs("div",{className:"p-6",children:[r.jsxs("div",{className:"flex items-start space-x-3",children:[b&&r.jsx("div",{className:"flex-shrink-0",children:b}),r.jsxs("div",{className:"flex-1",children:[o&&r.jsx("h3",{id:"confirm-dialog-title",className:"text-lg font-medium text-gray-900 mb-2",children:o}),r.jsx("p",{id:"confirm-dialog-message",className:"text-gray-600 leading-relaxed",children:c})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[r.jsx("button",{onClick:n,className:"px-4 py-2 text-gray-600 hover:text-gray-800 hover:bg-gray-100 rounded-md transition-colors duration-150 btn-secondary",autoFocus:!0,children:m||g("common.cancel")}),r.jsx("button",{onClick:l,className:`px-4 py-2 rounded-md transition-colors duration-150 focus:outline-none focus:ring-2 focus:ring-offset-2 ${x} ${p==="danger"?"btn-danger":p==="warning"?"btn-warning":"btn-primary"}`,children:d||g("common.confirm")})]})]})})})},KS=({onSuccess:a,onCancel:n})=>{const{t:l}=Ce(),[o,c]=y.useState(!1),[d,m]=y.useState(!1),[p,g]=y.useState(null),[h,b]=y.useState(null),[x,w]=y.useState(!1),[T,R]=y.useState(null),[O,E]=y.useState(""),[A,N]=y.useState(!1),[S,D]=y.useState(""),P=H=>{H.preventDefault(),c(!0)},$=H=>{H.preventDefault(),c(!1)},B=H=>{H.preventDefault(),c(!1);const Z=H.dataTransfer.files;if(Z.length>0){const C=Z[0];C.name.endsWith(".mcpb")?(b(C),g(null)):g(l("mcpb.invalidFileType"))}},L=H=>{const Z=H.target.files;if(Z&&Z.length>0){const C=Z[0];C.name.endsWith(".mcpb")?(b(C),g(null)):g(l("mcpb.invalidFileType"))}},Y=async()=>{if(!h){g(l("mcpb.noFileSelected"));return}m(!0),g(null);try{const H=new FormData;H.append("mcpbFile",h);const Z=await xd(gd("/mcpb/upload"),{method:"POST",body:H}),C=await Z.json();if(!Z.ok)throw new Error(C.message||`HTTP error! Status: ${Z.status}`);if(C.success&&C.data)R(C.data.manifest),E(C.data.extractDir),w(!0);else throw new Error(C.message||l("mcpb.uploadFailed"))}catch(H){console.error("MCPB upload error:",H),g(H instanceof Error?H.message:l("mcpb.uploadFailed"))}finally{m(!1)}},fe=async(H,Z=!1)=>{var C;m(!0),g(null);try{const I=X(T,O,H);if(!Z){const oe=await Ue("/servers");if(oe.success&&((C=oe.data)==null?void 0:C.find(j=>j.name===H))){D(H),N(!0),m(!1);return}}let U;if(Z?U=await Pt(`/servers/${encodeURIComponent(H)}`,{name:H,config:I}):U=await At("/servers",{name:H,config:I}),U.success)a(I);else throw new Error(U.message||l("mcpb.installFailed"))}catch(I){console.error("MCPB install error:",I),g(I instanceof Error?I.message:l("mcpb.installFailed")),m(!1)}},G=()=>{N(!1),S&&fe(S,!0)},K=()=>{N(!1),D(""),m(!1)},X=(H,Z,C)=>{var oe;const I=((oe=H.server)==null?void 0:oe.mcp_config)||{},U={type:"stdio",command:I.command||"node",args:(I.args||[]).map(V=>V.replace("${__dirname}",Z))};return I.env&&Object.keys(I.env).length>0&&(U.env={...I.env},Object.keys(U.env).forEach(V=>{typeof U.env[V]=="string"&&(U.env[V]=U.env[V].replace("${__dirname}",Z))})),U};return x&&T?r.jsxs(r.Fragment,{children:[r.jsx(GS,{isOpen:A,onClose:K,onConfirm:G,title:l("mcpb.serverExistsTitle"),message:l("mcpb.serverExistsConfirm",{serverName:S}),confirmText:l("mcpb.override"),cancelText:l("common.cancel"),variant:"warning"}),r.jsx("div",{className:`fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4 ${A?"opacity-50 pointer-events-none":""}`,children:r.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-2xl max-h-screen overflow-y-auto",children:[r.jsxs("div",{className:"flex justify-between items-center mb-6",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:l("mcpb.installServer")}),r.jsx("button",{onClick:n,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),p&&r.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:r.jsx("p",{className:"text-red-700",children:p})}),r.jsxs("div",{className:"space-y-6",children:[r.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[r.jsx("h3",{className:"font-medium text-gray-900 mb-2",children:l("mcpb.extensionInfo")}),r.jsxs("div",{className:"space-y-2 text-sm",children:[r.jsxs("div",{children:[r.jsxs("strong",{children:[l("mcpb.name"),":"]})," ",T.display_name||T.name]}),r.jsxs("div",{children:[r.jsxs("strong",{children:[l("mcpb.version"),":"]})," ",T.version]}),r.jsxs("div",{children:[r.jsxs("strong",{children:[l("mcpb.description"),":"]})," ",T.description]}),T.author&&r.jsxs("div",{children:[r.jsxs("strong",{children:[l("mcpb.author"),":"]})," ",T.author.name]}),T.tools&&T.tools.length>0&&r.jsxs("div",{children:[r.jsxs("strong",{children:[l("mcpb.tools"),":"]}),r.jsx("ul",{className:"list-disc list-inside ml-4",children:T.tools.map((H,Z)=>r.jsxs("li",{children:[H.name," - ",H.description]},Z))})]})]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:l("mcpb.serverName")}),r.jsx("input",{type:"text",id:"serverName",defaultValue:T.name,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",placeholder:l("mcpb.serverNamePlaceholder")})]}),r.jsxs("div",{className:"flex justify-end space-x-4",children:[r.jsx("button",{onClick:n,disabled:d,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 disabled:opacity-50 btn-secondary",children:l("common.cancel")}),r.jsx("button",{onClick:()=>{const H=document.getElementById("serverName"),Z=(H==null?void 0:H.value.trim())||T.name;fe(Z)},disabled:d,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center btn-primary",children:d?r.jsxs(r.Fragment,{children:[r.jsxs("svg",{className:"animate-spin h-4 w-4 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),l("mcpb.installing")]}):l("mcpb.install")})]})]})]})})]}):r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-lg",children:[r.jsxs("div",{className:"flex justify-between items-center mb-6",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:l("mcpb.uploadTitle")}),r.jsx("button",{onClick:n,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),p&&r.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:r.jsx("p",{className:"text-red-700",children:p})}),r.jsxs("div",{className:`relative border-2 border-dashed rounded-lg p-8 text-center transition-colors ${o?"border-blue-500 bg-blue-50":h?"border-gray-500 ":"border-gray-300 hover:border-gray-400"}`,onDragOver:P,onDragLeave:$,onDrop:B,children:[h?r.jsxs("div",{className:"space-y-2",children:[r.jsx("svg",{className:"mx-auto h-12 w-12 text-green-200",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})}),r.jsx("p",{className:"text-sm text-gray-900 font-medium",children:h.name}),r.jsxs("p",{className:"text-xs text-gray-500",children:[(h.size/1024/1024).toFixed(2)," MB"]})]}):r.jsxs("div",{className:"space-y-2",children:[r.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm text-gray-900",children:l("mcpb.dropFileHere")}),r.jsx("p",{className:"text-xs text-gray-500",children:l("mcpb.orClickToSelect")})]})]}),r.jsx("input",{type:"file",accept:".mcpb",onChange:L,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"})]}),r.jsxs("div",{className:"mt-6 flex justify-end space-x-4",children:[r.jsx("button",{onClick:n,disabled:d,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 disabled:opacity-50 btn-secondary",children:l("common.cancel")}),r.jsx("button",{onClick:Y,disabled:!h||d,className:"px-4 py-2 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center btn-primary",children:d?r.jsxs(r.Fragment,{children:[r.jsxs("svg",{className:"animate-spin h-4 w-4 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),l("mcpb.uploading")]}):l("mcpb.upload")})]})]})})},qS=({onSuccess:a,onCancel:n})=>{const{t:l}=Ce(),[o,c]=y.useState(""),[d,m]=y.useState(null),[p,g]=y.useState(!1),[h,b]=y.useState(null),x=`{
226
+ "mcpServers": {
227
+ "stdio-server-example": {
228
+ "command": "npx",
229
+ "args": ["-y", "mcp-server-example"]
230
+ },
231
+ "sse-server-example": {
232
+ "type": "sse",
233
+ "url": "http://localhost:3000"
234
+ },
235
+ "http-server-example": {
236
+ "type": "streamable-http",
237
+ "url": "http://localhost:3001",
238
+ "headers": {
239
+ "Content-Type": "application/json",
240
+ "Authorization": "Bearer your-token"
241
+ }
242
+ },
243
+ "openapi-server-example": {
244
+ "type": "openapi",
245
+ "openapi": {
246
+ "url": "https://petstore.swagger.io/v2/swagger.json"
247
+ }
248
+ }
249
+ }
250
+ }
251
+
252
+ Supports: STDIO, SSE, HTTP (streamable-http), OpenAPI
253
+ All servers will be imported in a single efficient batch operation.`,w=O=>{try{const E=JSON.parse(O.trim());return!E.mcpServers||typeof E.mcpServers!="object"?(m(l("jsonImport.invalidFormat")),null):E}catch{return m(l("jsonImport.parseError")),null}},T=()=>{m(null);const O=w(o);if(!O)return;const E=Object.entries(O.mcpServers).map(([A,N])=>{const S={};return N.type==="sse"||N.type==="streamable-http"?(S.type=N.type,S.url=N.url,N.headers&&(S.headers=N.headers)):N.type==="openapi"?(S.type="openapi",S.openapi=N.openapi):(S.type="stdio",S.command=N.command,S.args=N.args||[],N.env&&(S.env=N.env)),{name:A,config:S}});b(E)},R=async()=>{if(h){g(!0),m(null);try{const O=await At("/servers/batch",{servers:h});if(O.success&&O.data){const{successCount:E,failureCount:A,results:N}=O.data;if(A>0){const S=N.filter(D=>!D.success).map(D=>`${D.name}: ${D.message||l("jsonImport.addFailed")}`);m(l("jsonImport.partialSuccess",{count:E,total:h.length})+`
254
+ `+S.join(`
255
+ `))}E>0&&a()}else m(O.message||l("jsonImport.importFailed"))}catch(O){console.error("Import error:",O),m(l("jsonImport.importFailed"))}finally{g(!1)}}};return r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[r.jsxs("div",{className:"flex justify-between items-center mb-6",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:l("jsonImport.title")}),r.jsx("button",{onClick:n,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),d&&r.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:r.jsx("p",{className:"text-red-700 whitespace-pre-wrap",children:d})}),h?r.jsxs("div",{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-3",children:l("jsonImport.previewTitle")}),r.jsx("div",{className:"space-y-3",children:h.map((O,E)=>r.jsx("div",{className:"bg-gray-50 p-4 rounded-lg border border-gray-200",children:r.jsx("div",{className:"flex items-start justify-between",children:r.jsxs("div",{className:"flex-1",children:[r.jsx("h4",{className:"font-medium text-gray-900",children:O.name}),r.jsxs("div",{className:"mt-2 space-y-1 text-sm text-gray-600",children:[r.jsxs("div",{children:[r.jsxs("strong",{children:[l("server.type"),":"]})," ",O.config.type||"stdio"]}),O.config.command&&r.jsxs("div",{children:[r.jsxs("strong",{children:[l("server.command"),":"]})," ",O.config.command]}),O.config.args&&O.config.args.length>0&&r.jsxs("div",{children:[r.jsxs("strong",{children:[l("server.arguments"),":"]})," ",O.config.args.join(" ")]}),O.config.url&&r.jsxs("div",{children:[r.jsxs("strong",{children:[l("server.url"),":"]})," ",O.config.url]}),O.config.env&&Object.keys(O.config.env).length>0&&r.jsxs("div",{children:[r.jsxs("strong",{children:[l("server.envVars"),":"]})," ",Object.keys(O.config.env).join(", ")]}),O.config.headers&&Object.keys(O.config.headers).length>0&&r.jsxs("div",{children:[r.jsxs("strong",{children:[l("server.headers"),":"]})," ",Object.keys(O.config.headers).join(", ")]})]})]})})},E))})]}),r.jsxs("div",{className:"flex justify-end space-x-4",children:[r.jsx("button",{onClick:()=>b(null),disabled:p,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 disabled:opacity-50 btn-secondary",children:l("common.back")}),r.jsx("button",{onClick:R,disabled:p,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center btn-primary",children:p?r.jsxs(r.Fragment,{children:[r.jsxs("svg",{className:"animate-spin h-4 w-4 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),l("jsonImport.importing")]}):l("jsonImport.import")})]})]}):r.jsxs("div",{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:l("jsonImport.inputLabel")}),r.jsx("textarea",{value:o,onChange:O=>c(O.target.value),className:"w-full h-96 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono text-sm",placeholder:x}),r.jsx("p",{className:"text-xs text-gray-500 mt-2",children:l("jsonImport.inputHelp")})]}),r.jsxs("div",{className:"flex justify-end space-x-4",children:[r.jsx("button",{onClick:n,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:l("common.cancel")}),r.jsx("button",{onClick:T,disabled:!o.trim(),className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 btn-primary",children:l("jsonImport.preview")})]})]})]})})},jd=({currentPage:a,totalPages:n,onPageChange:l,disabled:o=!1})=>{const{t:c}=Ce(),d=()=>{const m=[];m.push(r.jsx("button",{onClick:()=>l(1),className:`px-3 py-1 mx-1 rounded ${a===1?"bg-blue-500 text-white btn-primary":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:"1"},"first"));const g=Math.max(2,a-Math.floor(5/2));g>2&&m.push(r.jsx("span",{className:"px-3 py-1",children:"..."},"ellipsis1"));for(let h=g;h<=Math.min(n-1,g+5-3);h++)m.push(r.jsx("button",{onClick:()=>l(h),className:`px-3 py-1 mx-1 rounded ${a===h?"bg-blue-500 text-white btn-primary":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:h},h));return g+5-3<n-1&&m.push(r.jsx("span",{className:"px-3 py-1",children:"..."},"ellipsis2")),n>1&&m.push(r.jsx("button",{onClick:()=>l(n),className:`px-3 py-1 mx-1 rounded ${a===n?"bg-blue-500 text-white btn-primary":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:n},"last")),m};return n<=1?null:r.jsxs("div",{className:"flex justify-center items-center my-6",children:[r.jsxs("button",{onClick:()=>l(Math.max(1,a-1)),disabled:o||a===1,className:`px-3 py-1 rounded mr-2 ${o||a===1?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:["« ",c("common.previous")]}),r.jsx("div",{className:"flex",children:d()}),r.jsxs("button",{onClick:()=>l(Math.min(n,a+1)),disabled:o||a===n,className:`px-3 py-1 rounded ml-2 ${o||a===n?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary"}`,children:[c("common.next")," »"]})]})},FS=()=>{const{t:a}=Ce(),n=la(),{servers:l,error:o,setError:c,isLoading:d,pagination:m,currentPage:p,serversPerPage:g,setCurrentPage:h,setServersPerPage:b,handleServerAdd:x,handleServerEdit:w,handleServerRemove:T,handleServerToggle:R,handleServerReload:O,triggerRefresh:E}=zl({refreshOnMount:!0}),[A,N]=y.useState(null),[S,D]=y.useState(!1),[P,$]=y.useState(!1),[B,L]=y.useState(!1),Y=async H=>{const Z=await w(H);Z&&N(Z)},fe=()=>{N(null),E()},G=async()=>{D(!0);try{E(),await new Promise(H=>setTimeout(H,500))}finally{D(!1)}},K=H=>{$(!1),E()},X=()=>{L(!1),E()};return r.jsxs("div",{children:[r.jsxs("div",{className:"flex justify-between items-center mb-8",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:a("pages.servers.title")}),r.jsxs("div",{className:"flex space-x-4",children:[r.jsxs("button",{onClick:()=>n("/market"),className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{d:"M3 1a1 1 0 000 2h1.22l.305 1.222a.997.997 0 00.01.042l1.358 5.43-.893.892C3.74 11.846 4.632 14 6.414 14H15a1 1 0 000-2H6.414l1-1H14a1 1 0 00.894-.553l3-6A1 1 0 0017 3H6.28l-.31-1.243A1 1 0 005 1H3z"})}),a("nav.market")]}),r.jsx(IS,{onAdd:x}),r.jsxs("button",{onClick:()=>L(!0),className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM6.293 6.707a1 1 0 010-1.414l3-3a1 1 0 011.414 0l3 3a1 1 0 01-1.414 1.414L11 5.414V13a1 1 0 11-2 0V5.414L7.707 6.707a1 1 0 01-1.414 0z",clipRule:"evenodd"})}),a("jsonImport.button")]}),r.jsxs("button",{onClick:()=>$(!0),className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{d:"M5.5 13a3.5 3.5 0 01-.369-6.98 4 4 0 117.753-1.977A4.5 4.5 0 1113.5 13H11V9.413l1.293 1.293a1 1 0 001.414-1.414l-3-3a1 1 0 00-1.414 0l-3 3a1 1 0 001.414 1.414L9 9.413V13H5.5z"})}),a("mcpb.upload")]}),r.jsxs("button",{onClick:G,disabled:S,className:`px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200 ${S?"opacity-70 cursor-not-allowed":""}`,children:[S?r.jsxs("svg",{className:"animate-spin h-4 w-4 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4 2a1 1 0 011 1v2.101a7.002 7.002 0 0111.601 2.566 1 1 0 11-1.885.666A5.002 5.002 0 005.999 7H9a1 1 0 010 2H4a1 1 0 01-1-1V3a1 1 0 011-1zm.008 9.057a1 1 0 011.276.61A5.002 5.002 0 0014.001 13H11a1 1 0 110-2h5a1 1 0 011 1v5a1 1 0 11-2 0v-2.101a7.002 7.002 0 01-11.601-2.566 1 1 0 01.61-1.276z",clipRule:"evenodd"})}),a("common.refresh")]})]})]}),o&&r.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm error-box",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{children:r.jsx("p",{className:"text-gray-600 mt-1",children:o})}),r.jsx("button",{onClick:()=>c(null),className:"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200 btn-secondary","aria-label":a("app.closeButton"),children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 011.414 0L10 8.586l4.293-4.293a1 1 111.414 1.414L11.414 10l4.293 4.293a1 1 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 01-1.414-1.414L8.586 10 4.293 5.707a1 1 010-1.414z",clipRule:"evenodd"})})})]})}),d?r.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center loading-container",children:r.jsxs("div",{className:"flex flex-col items-center",children:[r.jsxs("svg",{className:"animate-spin h-10 w-10 text-blue-500 mb-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("p",{className:"text-gray-600",children:a("app.loading")})]})}):l.length===0?r.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state",children:r.jsx("p",{className:"text-gray-600",children:a("app.noServers")})}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"space-y-6",children:l.map((H,Z)=>r.jsx(BS,{server:H,onRemove:T,onEdit:Y,onToggle:R,onRefresh:E,onReload:O},Z))}),r.jsxs("div",{className:"flex items-center mb-4",children:[r.jsx("div",{className:"flex-[2] text-sm text-gray-500",children:m?a("common.showing",{start:(m.page-1)*m.limit+1,end:Math.min(m.page*m.limit,m.total),total:m.total}):a("common.showing",{start:1,end:l.length,total:l.length})}),r.jsx("div",{className:"flex-[4] flex justify-center",children:m&&m.totalPages>1&&r.jsx(jd,{currentPage:p,totalPages:m.totalPages,onPageChange:h,disabled:d})}),r.jsxs("div",{className:"flex-[2] flex items-center justify-end space-x-2",children:[r.jsxs("label",{htmlFor:"perPage",className:"text-sm text-gray-600",children:[a("common.itemsPerPage"),":"]}),r.jsxs("select",{id:"perPage",value:g,onChange:H=>b(Number(H.target.value)),disabled:d,className:"border rounded p-1 text-sm btn-secondary outline-none disabled:opacity-50 disabled:cursor-not-allowed",children:[r.jsx("option",{value:5,children:"5"}),r.jsx("option",{value:10,children:"10"}),r.jsx("option",{value:20,children:"20"}),r.jsx("option",{value:50,children:"50"})]})]})]})]}),A&&r.jsx(HS,{server:A,onEdit:fe,onCancel:()=>N(null)}),P&&r.jsx(KS,{onSuccess:K,onCancel:()=>$(!1)}),B&&r.jsx(qS,{onSuccess:X,onCancel:()=>L(!1)})]})},xo=()=>{const{t:a}=Ce(),[n,l]=y.useState([]),[o,c]=y.useState(!0),[d,m]=y.useState(null),[p,g]=y.useState(0),h=y.useCallback(async()=>{try{c(!0);const A=await Ue("/groups");A&&A.success&&Array.isArray(A.data)?l(A.data):(console.error("Invalid group data format:",A),l([])),m(null)}catch(A){console.error("Error fetching groups:",A),m(A instanceof Error?A.message:"Failed to fetch groups"),l([])}finally{c(!1)}},[]),b=y.useCallback(()=>{g(A=>A+1)},[]),x=async(A,N,S=[])=>{try{const D=await At("/groups",{name:A,description:N,servers:S});return console.log("Group created successfully:",D),!D||!D.success?(m((D==null?void 0:D.message)||a("groups.createError")),D):(b(),D||null)}catch(D){return m(D instanceof Error?D.message:"Failed to create group"),null}},w=async(A,N)=>{try{const S=await Pt(`/groups/${A}`,N);return!S||!S.success?(m((S==null?void 0:S.message)||a("groups.updateError")),S):(b(),S||null)}catch(S){return m(S instanceof Error?S.message:"Failed to update group"),null}},T=async(A,N)=>{try{const S=await Pt(`/groups/${A}/servers/batch`,{servers:N});return!S||!S.success?(m((S==null?void 0:S.message)||a("groups.updateError")),null):(b(),S.data||null)}catch(S){return m(S instanceof Error?S.message:"Failed to update group servers"),null}},R=async A=>{try{const N=await Os(`/groups/${A}`);return!N||!N.success?(m((N==null?void 0:N.message)||a("groups.deleteError")),N):(b(),N)}catch(N){return m(N instanceof Error?N.message:"Failed to delete group"),null}},O=async(A,N)=>{try{const S=await At(`/groups/${A}/servers`,{serverName:N});return!S||!S.success?(m((S==null?void 0:S.message)||a("groups.serverAddError")),null):(b(),S.data||null)}catch(S){return m(S instanceof Error?S.message:"Failed to add server to group"),null}},E=async(A,N)=>{try{const S=await Os(`/groups/${A}/servers/${N}`);return!S||!S.success?(m((S==null?void 0:S.message)||a("groups.serverRemoveError")),null):(b(),S.data||null)}catch(S){return m(S instanceof Error?S.message:"Failed to remove server from group"),null}};return y.useEffect(()=>{h()},[h,p]),{groups:n,loading:o,error:d,setError:m,triggerRefresh:b,createGroup:x,updateGroup:w,updateGroupServers:T,deleteGroup:R,addServerToGroup:O,removeServerFromGroup:E}},O0=({servers:a,value:n,onChange:l,className:o})=>{const{t:c}=Ce(),{nameSeparator:d}=zs(),[m,p]=y.useState(new Set),g=Ta.useMemo(()=>n.map(N=>typeof N=="string"?{name:N,tools:"all"}:{...N,tools:N.tools||"all"}),[n]),h=Ta.useMemo(()=>a.filter(N=>N.enabled!==!1),[a]);Ta.useEffect(()=>{const N=new Set(g.map(D=>D.name)),S=new Set(h.map(D=>D.name));p(D=>{const P=new Set;return D.forEach($=>{(N.has($)||S.has($))&&P.add($)}),P})},[g,h]);const b=N=>{if(g.findIndex(D=>D.name===N)>=0){const D=g.filter(P=>P.name!==N);l(D)}else{const D=[...g,{name:N,tools:"all"}];l(D)}},x=N=>{p(S=>{const D=new Set(S);return D.has(N)?D.delete(N):D.add(N),D})},w=(N,S,D=!1)=>{if(Array.isArray(S)&&S.length===0){const P=g.filter($=>$.name!==N);l(P),D||p($=>{const B=new Set($);return B.delete(N),B})}else if(g.findIndex($=>$.name===N)>=0){const $=g.map(B=>B.name===N?{...B,tools:S}:B);l($)}else{const $=[...g,{name:N,tools:S}];l($)}},T=(N,S)=>{var B;const D=h.find(L=>L.name===N);if(!D)return;const P=((B=D.tools)==null?void 0:B.map(L=>L.name.replace(`${N}${d}`,"")))||[],$=g.find(L=>L.name===N);if(!$){const L=[...g,{name:N,tools:[S]}];l(L);return}if($.tools==="all"){const L=P.filter(Y=>Y!==S);w(N,L)}else if(Array.isArray($.tools)){const L=$.tools;if(L.includes(S)){const Y=L.filter(fe=>fe!==S);w(N,Y)}else{const Y=[...L,S];Y.length===P.length?w(N,"all"):w(N,Y)}}},R=N=>{const S=g.find(D=>D.name===N);return S?S.tools==="all":!1},O=N=>{const S=g.find(D=>D.name===N);return S?Array.isArray(S.tools)&&S.tools.length>0:!1},E=(N,S)=>{const D=g.find(P=>P.name===N);return D?D.tools==="all"?!0:Array.isArray(D.tools)?D.tools.includes(S):!1:!1},A=N=>{const S=h.find(D=>D.name===N);return(S==null?void 0:S.tools)||[]};return r.jsxs("div",{className:Oa("space-y-4",o),children:[r.jsx("div",{className:"space-y-3",children:h.map(N=>{const S=R(N.name),D=O(N.name),P=m.has(N.name),$=A(N.name),B=g.find(L=>L.name===N.name);return r.jsxs("div",{className:"border border-gray-200 rounded-lg hover:border-gray-300 hover:bg-gray-50 transition-colors",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 cursor-pointer rounded-lg transition-colors",onClick:()=>x(N.name),children:[r.jsxs("div",{className:"flex items-center space-x-3",onClick:L=>{L.stopPropagation(),b(N.name)},children:[r.jsx("input",{type:"checkbox",checked:S||D,onChange:()=>b(N.name),className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"}),r.jsx("span",{className:"font-medium text-gray-900 cursor-pointer select-none",children:N.name})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[B&&B.tools!=="all"&&Array.isArray(B.tools)&&r.jsxs("span",{className:"text-sm text-green-600",children:["(",c("groups.toolsSelected")," ",B.tools.length,"/",$.length,")"]}),B&&B.tools==="all"&&r.jsxs("span",{className:"text-sm text-green-600",children:["(",c("groups.allTools")," ",$.length,"/",$.length,")"]}),$.length>0&&r.jsx("button",{type:"button",className:"p-1 text-gray-400 hover:text-gray-600 transition-colors",children:r.jsx("svg",{className:Oa("w-5 h-5 transition-transform",P&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})]}),P&&$.length>0&&r.jsxs("div",{className:"border-t border-gray-200 bg-gray-50 p-3",children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsx("span",{className:"text-sm font-medium text-gray-700",children:c("groups.toolSelection")}),r.jsx("button",{type:"button",onClick:()=>{(B==null?void 0:B.tools)==="all"||Array.isArray(B==null?void 0:B.tools)&&B.tools.length===$.length?w(N.name,[],!0):w(N.name,"all")},className:"text-sm text-blue-600 hover:text-blue-800 transition-colors",children:(B==null?void 0:B.tools)==="all"||Array.isArray(B==null?void 0:B.tools)&&B.tools.length===$.length?c("groups.selectNone"):c("groups.selectAll")})]}),r.jsx("div",{className:"grid grid-cols-1 gap-2 max-h-32 overflow-y-auto",children:$.map(L=>{const Y=L.name.replace(`${N.name}${d}`,""),fe=E(N.name,Y);return r.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[r.jsx("input",{type:"checkbox",checked:fe,onChange:()=>T(N.name,Y),className:"w-3 h-3 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"}),r.jsx("span",{className:"text-gray-700",children:Y}),L.description&&r.jsx("span",{className:"text-gray-400 text-xs truncate",children:L.description})]},L.name)})})]})]},N.name)})}),h.length===0&&r.jsx("p",{className:"text-gray-500 text-sm",children:c("groups.noServerOptions")})]})},VS=({onAdd:a,onCancel:n})=>{const{t:l}=Ce(),{createGroup:o}=xo(),{allServers:c}=zl(),[d,m]=y.useState([]),[p,g]=y.useState(null),[h,b]=y.useState(!1),[x,w]=y.useState({name:"",description:"",servers:[]});y.useEffect(()=>{m(c.filter(O=>O.enabled!==!1))},[c]);const T=O=>{const{name:E,value:A}=O.target;w(N=>({...N,[E]:A}))},R=async O=>{O.preventDefault(),b(!0),g(null);try{if(!x.name.trim()){g(l("groups.nameRequired")),b(!1);return}const E=await o(x.name,x.description,x.servers);if(!E||!E.success){g((E==null?void 0:E.message)||l("groups.createError")),b(!1);return}a()}catch(E){g(E instanceof Error?E.message:String(E)),b(!1)}};return r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsxs("div",{className:"bg-white rounded-lg shadow-lg max-w-2xl w-full max-h-[90vh] flex flex-col",children:[r.jsxs("div",{className:"p-6 flex-shrink-0",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:l("groups.addNew")}),p&&r.jsx("div",{className:"mb-4 p-3 bg-red-100 text-red-700 rounded-md border border-gray-200",children:p})]}),r.jsxs("form",{onSubmit:R,className:"flex flex-col flex-1 min-h-0",children:[r.jsx("div",{className:"flex-1 overflow-y-auto px-6",children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsxs("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:[l("groups.name")," *"]}),r.jsx("input",{type:"text",id:"name",name:"name",value:x.name,onChange:T,className:"w-full border border-gray-300 rounded-md px-3 py-2 text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:l("groups.namePlaceholder"),required:!0})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:l("groups.configureTools")}),r.jsx(O0,{servers:d,value:x.servers,onChange:O=>w(E=>({...E,servers:O})),className:"border border-gray-200 rounded-lg p-4 bg-gray-50"})]})]})}),r.jsxs("div",{className:"flex justify-end space-x-3 p-6 pt-4 border-t border-gray-200 flex-shrink-0",children:[r.jsx("button",{type:"button",onClick:n,className:"px-4 py-2 text-gray-600 hover:text-gray-800 border border-gray-300 rounded-md hover:bg-gray-50 transition-colors",disabled:h,children:l("common.cancel")}),r.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 disabled:opacity-50 transition-colors",disabled:h,children:l(h?"common.submitting":"common.create")})]})]})]})})},$S=({group:a,onEdit:n,onCancel:l})=>{const{t:o}=Ce(),{updateGroup:c}=xo(),{allServers:d}=zl(),[m,p]=y.useState([]),[g,h]=y.useState(null),[b,x]=y.useState(!1),[w,T]=y.useState({name:a.name,description:a.description||"",servers:a.servers||[]});y.useEffect(()=>{p(d.filter(E=>E.enabled!==!1))},[d]);const R=E=>{const{name:A,value:N}=E.target;T(S=>({...S,[A]:N}))},O=async E=>{E.preventDefault(),x(!0),h(null);try{if(!w.name.trim()){h(o("groups.nameRequired")),x(!1);return}const A=await c(a.id,{name:w.name,description:w.description,servers:w.servers});if(!A||!A.success){h((A==null?void 0:A.message)||o("groups.updateError")),x(!1);return}n()}catch(A){h(A instanceof Error?A.message:String(A)),x(!1)}};return r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsxs("div",{className:"bg-white rounded-lg shadow-lg max-w-2xl w-full max-h-[90vh] flex flex-col",children:[r.jsxs("div",{className:"p-6 flex-shrink-0",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:o("groups.edit")}),g&&r.jsx("div",{className:"mb-4 p-3 bg-red-100 text-red-700 rounded-md border border-gray-200",children:g})]}),r.jsxs("form",{onSubmit:O,className:"flex flex-col flex-1 min-h-0",children:[r.jsx("div",{className:"flex-1 overflow-y-auto px-6",children:r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsxs("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:[o("groups.name")," *"]}),r.jsx("input",{type:"text",id:"name",name:"name",value:w.name,onChange:R,className:"w-full border border-gray-300 rounded-md px-3 py-2 text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:o("groups.namePlaceholder"),required:!0})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:o("groups.configureTools")}),r.jsx(O0,{servers:m,value:w.servers,onChange:E=>T(A=>({...A,servers:E})),className:"border border-gray-200 rounded-lg p-4 bg-gray-50"})]})]})}),r.jsxs("div",{className:"flex justify-end space-x-3 p-6 pt-4 border-t border-gray-200 flex-shrink-0",children:[r.jsx("button",{type:"button",onClick:l,className:"px-4 py-2 text-gray-600 hover:text-gray-800 border border-gray-300 rounded-md hover:bg-gray-50 transition-colors",disabled:b,children:o("common.cancel")}),r.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 disabled:opacity-50 transition-colors",disabled:b,children:o(b?"common.submitting":"common.save")})]})]})]})})},YS=({group:a,servers:n,onEdit:l,onDelete:o})=>{const{t:c}=Ce(),{showToast:d}=us(),{installConfig:m}=zs(),[p,g]=y.useState(!1),[h,b]=y.useState(!1),[x,w]=y.useState(!1),[T,R]=y.useState(null),O=y.useRef(null);y.useEffect(()=>{const G=K=>{O.current&&!O.current.contains(K.target)&&w(!1)};return document.addEventListener("mousedown",G),()=>{document.removeEventListener("mousedown",G)}},[]);const E=()=>{l(a)},A=()=>{g(!0)},N=()=>{o(a.id),g(!1)},S=G=>{if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(G).then(()=>{b(!0),w(!1),d(c("common.copySuccess"),"success"),setTimeout(()=>b(!1),2e3)});else{const K=document.createElement("textarea");K.value=G,K.style.position="fixed",K.style.left="-9999px",document.body.appendChild(K),K.focus(),K.select();try{document.execCommand("copy"),b(!0),w(!1),d(c("common.copySuccess"),"success"),setTimeout(()=>b(!1),2e3)}catch(X){d(c("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",X)}document.body.removeChild(K)}},D=()=>{S(a.id)},P=()=>{S(`${m.baseUrl}/mcp/${a.id}`)},$=()=>{const G={mcpServers:{mcphub:{url:`${m.baseUrl}/mcp/${a.id}`,headers:{Authorization:"Bearer <your-access-token>"}}}};S(JSON.stringify(G,null,2))},B=G=>G.map(K=>typeof K=="string"?K:K.name),L=G=>{const K=a.servers.find(X=>typeof X=="string"?X===G:X.name===G);return typeof K=="string"?{name:K,tools:"all"}:K},Y=B(a.servers),fe=n.filter(G=>Y.includes(G.name));return r.jsxs("div",{className:"bg-white shadow rounded-lg p-4",children:[r.jsxs("div",{className:"flex justify-between items-center",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-800",children:a.name}),r.jsxs("div",{className:"flex items-center ml-3",children:[r.jsx("span",{className:"text-xs text-gray-500 mr-1",children:a.id}),r.jsxs("div",{className:"relative",ref:O,children:[r.jsxs("button",{onClick:()=>w(!x),className:"p-1 text-gray-400 hover:text-gray-600 transition-colors flex items-center",title:c("common.copy"),children:[h?r.jsx(os,{size:14,className:"text-green-500"}):r.jsx(wn,{size:14}),r.jsx(Rl,{size:12,className:"ml-1"})]}),x&&r.jsxs("div",{className:"absolute top-full left-0 mt-1 bg-white shadow-lg rounded-md border border-gray-200 py-1 z-10 min-w-[140px]",children:[r.jsxs("button",{onClick:D,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[r.jsx(wn,{size:12,className:"mr-2"}),c("common.copyId")]}),r.jsxs("button",{onClick:P,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[r.jsx(F2,{size:12,className:"mr-2"}),c("common.copyUrl")]}),r.jsxs("button",{onClick:$,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[r.jsx(H2,{size:12,className:"mr-2"}),c("common.copyJson")]})]})]})]})]}),a.description&&r.jsx("p",{className:"text-gray-600 text-sm mt-1",children:a.description})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[r.jsx("div",{className:"bg-blue-50 text-blue-700 px-3 py-1 rounded-full text-sm btn-secondary",children:c("groups.serverCount",{count:a.servers.length})}),r.jsx("button",{onClick:E,className:"text-gray-500 hover:text-gray-700",title:c("groups.edit"),children:r.jsx(Ol,{size:18})}),r.jsx("button",{onClick:A,className:"text-gray-500 hover:text-red-600",title:c("groups.delete"),children:r.jsx(r0,{size:18})})]})]}),r.jsx("div",{className:"",children:fe.length===0?r.jsx("p",{className:"text-gray-500 italic",children:c("groups.noServers")}):r.jsx("div",{className:"flex flex-wrap gap-2",children:fe.map(G=>{var U;const K=L(G.name),X=K&&K.tools!=="all"&&Array.isArray(K.tools),H=X&&Array.isArray(K==null?void 0:K.tools)?K.tools.length:((U=G.tools)==null?void 0:U.length)||0,Z=T===G.name,C=()=>X&&Array.isArray(K==null?void 0:K.tools)?K.tools:G.tools&&G.tools.length>0?G.tools.map(oe=>oe.name):[],I=()=>{R(Z?null:G.name)};return r.jsxs("div",{className:"relative",children:[r.jsxs("div",{className:"flex items-center space-x-2 bg-gray-50 rounded-lg px-3 py-2 cursor-pointer hover:bg-gray-100 transition-colors",onClick:I,children:[r.jsx("span",{className:"font-medium text-gray-700 text-sm",children:G.name}),r.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${G.status==="connected"?"bg-green-500":G.status==="connecting"?"bg-yellow-500":"bg-red-500"}`}),H>0&&r.jsxs("span",{className:"text-xs text-blue-600 bg-blue-100 px-2 py-0.5 rounded flex items-center gap-1",children:[r.jsx(uw,{size:12}),H]})]}),Z&&r.jsxs("div",{className:"absolute top-full left-0 mt-1 bg-white shadow-lg rounded-md border border-gray-200 p-3 z-10 min-w-[300px] max-w-[400px]",children:[r.jsxs("div",{className:"text-gray-600 text-xs mb-2",children:[c(X?"groups.selectedTools":"groups.allTools"),":"]}),r.jsx("div",{className:"flex flex-wrap gap-1",children:C().map((oe,V)=>r.jsx("span",{className:"inline-block bg-gray-100 text-gray-700 px-2 py-1 rounded text-xs",children:oe},V))})]})]},G.name)})})}),r.jsx(Sd,{isOpen:p,onClose:()=>g(!1),onConfirm:N,serverName:a.name,isGroup:!0})]})},JS=({onSuccess:a,onCancel:n})=>{const{t:l}=Ce(),[o,c]=y.useState(""),[d,m]=y.useState(null),[p,g]=y.useState(!1),[h,b]=y.useState(null),x=`{
256
+ "groups": [
257
+ {
258
+ "name": "AI Assistants",
259
+ "servers": ["openai-server", "anthropic-server"]
260
+ },
261
+ {
262
+ "name": "Development Tools",
263
+ "servers": [
264
+ {
265
+ "name": "github-server",
266
+ "tools": ["create_issue", "list_repos"]
267
+ },
268
+ {
269
+ "name": "gitlab-server",
270
+ "tools": "all"
271
+ }
272
+ ]
273
+ }
274
+ ]
275
+ }
276
+
277
+ Supports:
278
+ - Simple server list: ["server1", "server2"]
279
+ - Advanced server config: [{"name": "server1", "tools": ["tool1", "tool2"]}]
280
+ - All groups will be imported in a single efficient batch operation.`,w=E=>{try{const A=JSON.parse(E.trim());if(!A.groups||!Array.isArray(A.groups))return m(l("groupImport.invalidFormat")),null;for(const N of A.groups)if(!N.name||typeof N.name!="string")return m(l("groupImport.missingName")),null;return A}catch{return m(l("groupImport.parseError")),null}},T=()=>{m(null);const E=w(o);E&&b(E.groups)},R=async()=>{if(h){g(!0),m(null);try{const E=await At("/groups/batch",{groups:h});if(E.success){const{successCount:A,failureCount:N,results:S}=E;if(N>0){const D=S.filter(P=>!P.success).map(P=>`${P.name}: ${P.message||l("groupImport.addFailed")}`);m(l("groupImport.partialSuccess",{count:A,total:h.length})+`
281
+ `+D.join(`
282
+ `))}A>0&&a()}else m(E.message||l("groupImport.importFailed"))}catch(E){console.error("Import error:",E),m(l("groupImport.importFailed"))}finally{g(!1)}}},O=E=>!E||E.length===0?r.jsx("span",{className:"text-gray-500",children:l("groups.noServers")}):r.jsx("div",{className:"space-y-1",children:E.map((A,N)=>typeof A=="string"?r.jsxs("div",{className:"text-sm",children:["• ",A]},N):r.jsxs("div",{className:"text-sm",children:["• ",A.name,A.tools&&A.tools!=="all"&&r.jsxs("span",{className:"text-gray-500 ml-2",children:["(",Array.isArray(A.tools)?A.tools.join(", "):A.tools,")"]}),A.tools==="all"&&r.jsx("span",{className:"text-gray-500 ml-2",children:"(all tools)"})]},N))});return r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[r.jsxs("div",{className:"flex justify-between items-center mb-6",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:l("groupImport.title")}),r.jsx("button",{onClick:n,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),d&&r.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:r.jsx("p",{className:"text-red-700 whitespace-pre-wrap",children:d})}),h?r.jsxs("div",{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-3",children:l("groupImport.previewTitle")}),r.jsx("div",{className:"space-y-3",children:h.map((E,A)=>r.jsx("div",{className:"bg-gray-50 p-4 rounded-lg border border-gray-200",children:r.jsx("div",{className:"flex items-start justify-between",children:r.jsxs("div",{className:"flex-1",children:[r.jsx("h4",{className:"font-medium text-gray-900",children:E.name}),E.description&&r.jsx("p",{className:"text-sm text-gray-600 mt-1",children:E.description}),r.jsxs("div",{className:"mt-2 text-sm text-gray-600",children:[r.jsxs("strong",{children:[l("groups.servers"),":"]}),r.jsx("div",{className:"mt-1",children:O(E.servers)})]})]})})},A))})]}),r.jsxs("div",{className:"flex justify-end space-x-4",children:[r.jsx("button",{onClick:()=>b(null),disabled:p,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 disabled:opacity-50 btn-secondary",children:l("common.back")}),r.jsx("button",{onClick:R,disabled:p,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center btn-primary",children:p?r.jsxs(r.Fragment,{children:[r.jsxs("svg",{className:"animate-spin h-4 w-4 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),l("groupImport.importing")]}):l("groupImport.import")})]})]}):r.jsxs("div",{children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:l("groupImport.inputLabel")}),r.jsx("textarea",{value:o,onChange:E=>c(E.target.value),className:"w-full h-96 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono text-sm",placeholder:x}),r.jsx("p",{className:"text-xs text-gray-500 mt-2",children:l("groupImport.inputHelp")})]}),r.jsxs("div",{className:"flex justify-end space-x-4",children:[r.jsx("button",{onClick:n,className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:l("common.cancel")}),r.jsx("button",{onClick:T,disabled:!o.trim(),className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 btn-primary",children:l("groupImport.preview")})]})]})]})})},QS=()=>{const{t:a}=Ce(),{groups:n,loading:l,error:o,setError:c,deleteGroup:d,triggerRefresh:m}=xo(),{allServers:p}=zl({refreshOnMount:!0}),[g,h]=y.useState(null),[b,x]=y.useState(!1),[w,T]=y.useState(!1),R=D=>{h(D)},O=()=>{h(null),m()},E=async D=>{const P=await d(D);(!P||!P.success)&&c((P==null?void 0:P.message)||a("groups.deleteError"))},A=()=>{x(!0)},N=()=>{x(!1),m()},S=()=>{T(!1),m()};return r.jsxs("div",{children:[r.jsxs("div",{className:"flex justify-between items-center mb-8",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:a("pages.groups.title")}),r.jsxs("div",{className:"flex space-x-4",children:[r.jsxs("button",{onClick:A,className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M10 3a1 1 0 00-1 1v5H4a1 1 0 100 2h5v5a1 1 0 102 0v-5h5a1 1 0 100-2h-5V4a1 1 0 00-1-1z",clipRule:"evenodd"})}),a("groups.add")]}),r.jsxs("button",{onClick:()=>T(!0),className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",clipRule:"evenodd"})}),a("groupImport.button")]})]})]}),o&&r.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6 error-box rounded-lg",children:r.jsx("p",{children:o})}),l?r.jsx("div",{className:"bg-white shadow rounded-lg p-6 loading-container",children:r.jsxs("div",{className:"flex flex-col items-center justify-center",children:[r.jsxs("svg",{className:"animate-spin h-10 w-10 text-blue-500 mb-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("p",{className:"text-gray-600",children:a("app.loading")})]})}):n.length===0?r.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state",children:r.jsx("p",{className:"text-gray-600",children:a("groups.noGroups")})}):r.jsx("div",{className:"space-y-6",children:n.map(D=>r.jsx(YS,{group:D,servers:p,onEdit:R,onDelete:E},D.id))}),b&&r.jsx(VS,{onAdd:N,onCancel:N}),w&&r.jsx(JS,{onSuccess:S,onCancel:()=>T(!1)}),g&&r.jsx($S,{group:g,onEdit:O,onCancel:()=>h(null)})]})},Nd=()=>{const{t:a}=Ce(),[n,l]=y.useState([]),[o,c]=y.useState(!0),[d,m]=y.useState(null),[p,g]=y.useState(0),h=y.useCallback(async()=>{try{c(!0);const R=await Ue("/users");if(!R.success){m(R.message||a("users.fetchError"));return}R&&R.success&&Array.isArray(R.data)?l(R.data):(console.error("Invalid user data format:",R),l([])),m(null)}catch(R){console.error("Error fetching users:",R),m(R instanceof Error?R.message:"Failed to fetch users"),l([])}finally{c(!1)}},[]),b=y.useCallback(()=>{g(R=>R+1)},[]),x=async R=>{try{const O=await At("/users",R);return b(),O}catch(O){return m(O instanceof Error?O.message:"Failed to create user"),null}},w=async(R,O)=>{try{const E=await Pt(`/users/${R}`,O);return b(),E||null}catch(E){return m(E instanceof Error?E.message:"Failed to update user"),null}},T=async R=>{try{const O=await Os(`/users/${R}`);return O!=null&&O.success?(b(),O):(m((O==null?void 0:O.message)||a("users.deleteError")),O)}catch(O){return m(O instanceof Error?O.message:"Failed to delete user"),!1}};return y.useEffect(()=>{h()},[h,p]),{users:n,loading:o,error:d,setError:m,triggerRefresh:b,createUser:x,updateUser:w,deleteUser:T}},XS=({onAdd:a,onCancel:n})=>{const{t:l}=Ce(),{createUser:o}=Nd(),[c,d]=y.useState(null),[m,p]=y.useState(!1),[g,h]=y.useState({username:"",password:"",isAdmin:!1}),b=async w=>{if(w.preventDefault(),d(null),!g.username.trim()){d(l("users.usernameRequired"));return}if(!g.password.trim()){d(l("users.passwordRequired"));return}if(g.password.length<6){d(l("users.passwordTooShort"));return}p(!0);try{const T=await o(g);T!=null&&T.success?a():d((T==null?void 0:T.message)||l("users.createError"))}catch(T){d(T instanceof Error?T.message:l("users.createError"))}finally{p(!1)}},x=w=>{const{name:T,value:R,type:O,checked:E}=w.target;h(A=>({...A,[T]:O==="checkbox"?E:R}))};return r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx("div",{className:"bg-white p-8 rounded-xl shadow-2xl max-w-md w-full mx-4 border border-gray-100",children:r.jsxs("form",{onSubmit:b,children:[r.jsx("h2",{className:"text-xl font-bold text-gray-900 mb-6",children:l("users.addNew")}),c&&r.jsx("div",{className:"bg-red-50 border-l-4 border-red-500 text-red-700 p-4 mb-6 rounded-md",children:r.jsx("p",{className:"text-sm font-medium",children:c})}),r.jsxs("div",{className:"space-y-5",children:[r.jsxs("div",{children:[r.jsxs("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-700 mb-1",children:[l("users.username")," ",r.jsx("span",{className:"text-red-500",children:"*"})]}),r.jsx("input",{type:"text",id:"username",name:"username",value:g.username,onChange:x,placeholder:l("users.usernamePlaceholder"),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent form-input transition-all duration-200",required:!0,disabled:m})]}),r.jsxs("div",{children:[r.jsxs("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 mb-1",children:[l("users.password")," ",r.jsx("span",{className:"text-red-500",children:"*"})]}),r.jsx("input",{type:"password",id:"password",name:"password",value:g.password,onChange:x,placeholder:l("users.passwordPlaceholder"),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent form-input transition-all duration-200",required:!0,disabled:m,minLength:6})]}),r.jsxs("div",{className:"flex items-center pt-2",children:[r.jsx("input",{type:"checkbox",id:"isAdmin",name:"isAdmin",checked:g.isAdmin,onChange:x,className:"h-5 w-5 text-blue-600 focus:ring-blue-500 border-gray-300 rounded transition-colors duration-200",disabled:m}),r.jsx("label",{htmlFor:"isAdmin",className:"ml-3 block text-sm font-medium text-gray-700 cursor-pointer select-none",children:l("users.adminRole")})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[r.jsx("button",{type:"button",onClick:n,className:"px-5 py-2.5 text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition-all duration-200 font-medium btn-secondary shadow-sm",disabled:m,children:l("common.cancel")}),r.jsxs("button",{type:"submit",className:"px-5 py-2.5 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-all duration-200 font-medium btn-primary shadow-md disabled:opacity-70 disabled:cursor-not-allowed flex items-center",disabled:m,children:[m&&r.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),l(m?"common.creating":"users.create")]})]})]})})})},ZS=({user:a,onEdit:n,onCancel:l})=>{const{t:o}=Ce(),{updateUser:c}=Nd(),[d,m]=y.useState(null),[p,g]=y.useState(!1),[h,b]=y.useState({isAdmin:a.isAdmin,newPassword:"",confirmPassword:""}),x=async T=>{if(T.preventDefault(),m(null),h.newPassword&&h.newPassword!==h.confirmPassword){m(o("users.passwordMismatch"));return}if(h.newPassword&&h.newPassword.length<6){m(o("users.passwordTooShort"));return}g(!0);try{const R={isAdmin:h.isAdmin};h.newPassword&&(R.newPassword=h.newPassword);const O=await c(a.username,R);O!=null&&O.success?n():m((O==null?void 0:O.message)||o("users.updateError"))}catch(R){m(R instanceof Error?R.message:o("users.updateError"))}finally{g(!1)}},w=T=>{const{name:R,value:O,type:E,checked:A}=T.target;b(N=>({...N,[R]:E==="checkbox"?A:O}))};return r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx("div",{className:"bg-white p-8 rounded-xl shadow-2xl max-w-md w-full mx-4 border border-gray-100",children:r.jsxs("form",{onSubmit:x,children:[r.jsxs("h2",{className:"text-xl font-bold text-gray-900 mb-6",children:[o("users.edit")," - ",r.jsx("span",{className:"text-blue-600",children:a.username})]}),d&&r.jsx("div",{className:"bg-red-50 border-l-4 border-red-500 text-red-700 p-4 mb-6 rounded-md",children:r.jsx("p",{className:"text-sm font-medium",children:d})}),r.jsxs("div",{className:"space-y-5",children:[r.jsxs("div",{className:"flex items-center pt-2",children:[r.jsx("input",{type:"checkbox",id:"isAdmin",name:"isAdmin",checked:h.isAdmin,onChange:w,className:"h-5 w-5 text-blue-600 focus:ring-blue-500 border-gray-300 rounded transition-colors duration-200",disabled:p}),r.jsx("label",{htmlFor:"isAdmin",className:"ml-3 block text-sm font-medium text-gray-700 cursor-pointer select-none",children:o("users.adminRole")})]}),r.jsxs("div",{className:"border-t border-gray-100 pt-4 mt-2",children:[r.jsx("p",{className:"text-xs text-gray-500 uppercase font-semibold tracking-wider mb-3",children:o("users.changePassword")}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"newPassword",className:"block text-sm font-medium text-gray-700 mb-1",children:o("users.newPassword")}),r.jsx("input",{type:"password",id:"newPassword",name:"newPassword",value:h.newPassword,onChange:w,placeholder:o("users.newPasswordPlaceholder"),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent form-input transition-all duration-200",disabled:p,minLength:6})]}),h.newPassword&&r.jsxs("div",{className:"animate-fadeIn",children:[r.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-gray-700 mb-1",children:o("users.confirmPassword")}),r.jsx("input",{type:"password",id:"confirmPassword",name:"confirmPassword",value:h.confirmPassword,onChange:w,placeholder:o("users.confirmPasswordPlaceholder"),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent form-input transition-all duration-200",disabled:p,minLength:6})]})]})]})]}),r.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[r.jsx("button",{type:"button",onClick:l,className:"px-5 py-2.5 text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition-all duration-200 font-medium btn-secondary shadow-sm",disabled:p,children:o("common.cancel")}),r.jsxs("button",{type:"submit",className:"px-5 py-2.5 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-all duration-200 font-medium btn-primary shadow-md disabled:opacity-70 disabled:cursor-not-allowed flex items-center",disabled:p,children:[p&&r.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),o(p?"common.updating":"users.update")]})]})]})})})},WS=()=>{const{t:a}=Ce(),{auth:n}=cs(),l=n.user,{users:o,loading:c,error:d,setError:m,deleteUser:p,triggerRefresh:g}=Nd(),[h,b]=y.useState(null),[x,w]=y.useState(!1),[T,R]=y.useState(null);if(!(l!=null&&l.isAdmin))return r.jsx("div",{className:"bg-white shadow rounded-lg p-6 dashboard-card",children:r.jsx("p",{className:"text-red-600",children:a("users.adminRequired")})});const O=P=>{b(P)},E=()=>{b(null),g()},A=P=>{R(P)},N=async()=>{if(T){const P=await p(T);P!=null&&P.success||m((P==null?void 0:P.message)||a("users.deleteError")),R(null)}},S=()=>{w(!0)},D=()=>{w(!1),g()};return r.jsxs("div",{className:"container mx-auto",children:[r.jsxs("div",{className:"flex justify-between items-center mb-8",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:a("pages.users.title")}),r.jsx("div",{className:"flex space-x-4",children:r.jsxs("button",{onClick:S,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 flex items-center btn-primary transition-all duration-200 shadow-sm",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M10 3a1 1 0 00-1 1v5H4a1 1 0 100 2h5v5a1 1 0 102 0v-5h5a1 1 0 100-2h-5V4a1 1 0 00-1-1z",clipRule:"evenodd"})}),a("users.add")]})})]}),d&&r.jsx("div",{className:"bg-red-50 border-l-4 border-red-500 text-red-700 p-4 mb-6 error-box rounded-lg shadow-sm",children:r.jsxs("div",{className:"flex justify-between items-center",children:[r.jsx("p",{children:d}),r.jsx("button",{onClick:()=>m(null),className:"text-red-500 hover:text-red-700",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 011.414 0L10 8.586l4.293-4.293a1 1 111.414 1.414L11.414 10l4.293 4.293a1 1 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 01-1.414-1.414L8.586 10 4.293 5.707a1 1 010-1.414z",clipRule:"evenodd"})})})]})}),c?r.jsx("div",{className:"bg-white shadow rounded-lg p-6 loading-container flex justify-center items-center h-64",children:r.jsxs("div",{className:"flex flex-col items-center justify-center",children:[r.jsxs("svg",{className:"animate-spin h-10 w-10 text-blue-500 mb-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("p",{className:"text-gray-600",children:a("app.loading")})]})}):o.length===0?r.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state dashboard-card",children:r.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[r.jsx("div",{className:"p-4 bg-gray-100 rounded-full mb-4",children:r.jsx(a0,{className:"h-8 w-8 text-gray-400"})}),r.jsx("p",{className:"text-gray-600 text-lg font-medium",children:a("users.noUsers")}),r.jsx("button",{onClick:S,className:"mt-4 text-blue-600 hover:text-blue-800 font-medium",children:a("users.addFirst")})]})}):r.jsx("div",{className:"bg-white shadow rounded-lg overflow-hidden table-container dashboard-card",children:r.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[r.jsx("thead",{className:"bg-gray-50",children:r.jsxs("tr",{children:[r.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("users.username")}),r.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("users.role")}),r.jsx("th",{scope:"col",className:"px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("users.actions")})]})}),r.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:o.map(P=>{const $=(l==null?void 0:l.username)===P.username;return r.jsxs("tr",{className:"hover:bg-gray-50 transition-colors duration-150",children:[r.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:r.jsxs("div",{className:"flex items-center",children:[r.jsx("div",{className:"flex-shrink-0 h-10 w-10",children:r.jsx("div",{className:"h-10 w-10 rounded-full bg-blue-100 flex items-center justify-center text-blue-600 font-bold text-lg",children:P.username.charAt(0).toUpperCase()})}),r.jsx("div",{className:"ml-4",children:r.jsxs("div",{className:"text-sm font-medium text-gray-900 flex items-center",children:[P.username,$&&r.jsx("span",{className:"ml-2 px-2 py-0.5 text-xs bg-blue-100 text-blue-800 rounded-full border border-blue-200",children:a("users.currentUser")})]})})]})}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:r.jsx("span",{className:`px-2 py-1 inline-flex text-xs leading-5 font-semibold rounded-full ${P.isAdmin?"bg-purple-100 text-purple-800 border border-purple-200":"bg-gray-100 text-gray-800 border border-gray-200"}`,children:P.isAdmin?a("users.admin"):a("users.user")})}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium",children:r.jsxs("div",{className:"flex justify-end space-x-3",children:[r.jsx("button",{onClick:()=>O(P),className:"text-blue-600 hover:text-blue-900 p-1 rounded hover:bg-blue-50 transition-colors",title:a("users.edit"),children:r.jsx(Ol,{size:18})}),!$&&r.jsx("button",{onClick:()=>A(P.username),className:"text-red-600 hover:text-red-900 p-1 rounded hover:bg-red-50 transition-colors",title:a("users.delete"),children:r.jsx(r0,{size:18})})]})})]},P.username)})})]})}),x&&r.jsx(XS,{onAdd:D,onCancel:D}),h&&r.jsx(ZS,{user:h,onEdit:E,onCancel:()=>b(null)}),r.jsx(Sd,{isOpen:!!T,onClose:()=>R(null),onConfirm:N,serverName:T||"",isGroup:!1,isUser:!0})]})},Xh=a=>{const n=[];return a.length<8&&n.push("passwordMinLength"),/[a-zA-Z]/.test(a)||n.push("passwordRequireLetter"),/\d/.test(a)||n.push("passwordRequireNumber"),/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/.test(a)||n.push("passwordRequireSpecial"),{isValid:n.length===0,errors:n}},ej=({onSuccess:a,onCancel:n})=>{const{t:l}=Ce(),[o,c]=y.useState({currentPassword:"",newPassword:""}),[d,m]=y.useState(""),[p,g]=y.useState(!1),[h,b]=y.useState(null),[x,w]=y.useState(!1),[T,R]=y.useState([]),O=A=>{const{name:N,value:S}=A.target;if(N==="confirmPassword")m(S);else if(c(D=>({...D,[N]:S})),N==="newPassword"){const D=Xh(S);R(D.errors)}},E=async A=>{A.preventDefault(),b(null);const N=Xh(o.newPassword);if(!N.isValid){b(l("auth.passwordStrengthError")),R(N.errors);return}if(o.newPassword!==d){b(l("auth.passwordsNotMatch"));return}g(!0);try{const S=await l2(o);S.success?(w(!0),a&&a()):b(S.message||l("auth.changePasswordError"))}catch{b(l("auth.changePasswordError"))}finally{g(!1)}};return r.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-md",children:[r.jsx("h2",{className:"text-xl font-bold mb-4",children:l("auth.changePassword")}),x?r.jsx("div",{className:"bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-4",children:l("auth.changePasswordSuccess")}):r.jsxs("form",{onSubmit:E,children:[h&&r.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4",children:h}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"currentPassword",children:l("auth.currentPassword")}),r.jsx("input",{type:"password",id:"currentPassword",name:"currentPassword",className:"w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",value:o.currentPassword,onChange:O,required:!0})]}),r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"newPassword",children:l("auth.newPassword")}),r.jsx("input",{type:"password",id:"newPassword",name:"newPassword",className:"w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",value:o.newPassword,onChange:O,required:!0,minLength:8}),o.newPassword&&T.length>0&&r.jsxs("div",{className:"mt-2 text-sm text-gray-600",children:[r.jsx("p",{className:"font-semibold mb-1",children:l("auth.passwordStrengthHint")}),r.jsx("ul",{className:"list-disc list-inside space-y-1",children:T.map(A=>r.jsx("li",{className:"text-red-600",children:l(`auth.${A}`)},A))})]}),o.newPassword&&T.length===0&&r.jsxs("p",{className:"mt-2 text-sm text-green-600",children:["✓ ",l("auth.passwordStrengthHint")]})]}),r.jsxs("div",{className:"mb-6",children:[r.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"confirmPassword",children:l("auth.confirmPassword")}),r.jsx("input",{type:"password",id:"confirmPassword",name:"confirmPassword",className:"w-full p-2 border rounded focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",value:d,onChange:O,required:!0,minLength:8})]}),r.jsxs("div",{className:"flex justify-end space-x-2",children:[n&&r.jsx("button",{type:"button",onClick:n,disabled:p,className:"py-2 px-4 border border-gray-300 rounded-md text-sm font-medium text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500",children:l("common.cancel")}),r.jsx("button",{type:"submit",disabled:p,className:"py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 btn-primary",children:p?r.jsxs("span",{className:"flex items-center",children:[r.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),l("common.save")]}):l("common.save")})]})]})]})},vn=({options:a,selected:n,onChange:l,placeholder:o="Select items...",disabled:c=!1,className:d=""})=>{const[m,p]=y.useState(!1),[g,h]=y.useState(""),b=y.useRef(null),x=y.useRef(null);y.useEffect(()=>{const A=N=>{b.current&&!b.current.contains(N.target)&&(p(!1),h(""))};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[]);const w=a.filter(A=>A.label.toLowerCase().includes(g.toLowerCase())),T=A=>{if(c)return;const N=n.includes(A)?n.filter(S=>S!==A):[...n,A];l(N)},R=(A,N)=>{N.stopPropagation(),!c&&l(n.filter(S=>S!==A))},O=()=>{c||(p(!m),m||setTimeout(()=>{var A;return(A=x.current)==null?void 0:A.focus()},0))},E=()=>n.map(A=>{var N;return((N=a.find(S=>S.value===A))==null?void 0:N.label)||A}).filter(Boolean);return r.jsxs("div",{ref:b,className:`relative ${d}`,children:[r.jsxs("div",{onClick:O,className:`
283
+ min-h-[38px] w-full px-3 py-1.5 border rounded-md shadow-sm
284
+ flex flex-wrap items-center gap-1.5 cursor-pointer
285
+ transition-all duration-200
286
+ ${c?"bg-gray-100 cursor-not-allowed":"bg-white hover:border-blue-400"}
287
+ ${m?"border-blue-500 ring-1 ring-blue-500":"border-gray-300"}
288
+ `,children:[n.length>0?r.jsx(r.Fragment,{children:E().map((A,N)=>r.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-blue-100 text-blue-800",children:[A,!c&&r.jsx("button",{type:"button",onClick:S=>R(n[N],S),className:"ml-1 hover:bg-blue-200 rounded-full p-0.5 transition-colors",children:r.jsx(Sn,{className:"h-3 w-3"})})]},n[N]))}):r.jsx("span",{className:"text-gray-400 text-sm",children:o}),r.jsx("div",{className:"flex-1"}),r.jsx(Rl,{className:`h-4 w-4 text-gray-400 transition-transform duration-200 ${m?"transform rotate-180":""}`})]}),m&&!c&&r.jsxs("div",{className:"absolute z-50 w-full mt-1 bg-white border border-gray-300 rounded-md shadow-lg max-h-60 overflow-hidden",children:[r.jsx("div",{className:"p-2 border-b border-gray-200",children:r.jsx("input",{ref:x,type:"text",value:g,onChange:A=>h(A.target.value),placeholder:"Search...",className:"w-full px-3 py-1.5 text-sm border border-gray-300 rounded focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500",onClick:A=>A.stopPropagation()})}),r.jsx("div",{className:"max-h-48 overflow-y-auto",children:w.length>0?w.map(A=>{const N=n.includes(A.value);return r.jsxs("div",{onClick:()=>T(A.value),className:`
289
+ px-3 py-2 cursor-pointer flex items-center justify-between
290
+ transition-colors duration-150
291
+ ${N?"bg-blue-50 text-blue-700":"hover:bg-gray-100"}
292
+ `,children:[r.jsx("span",{className:"text-sm",children:A.label}),N&&r.jsx(os,{className:"h-4 w-4 text-blue-600"})]},A.value)}):r.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 text-center",children:g?"No results found":"No options available"})})]})]})};function tj(a=32){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",l=new Uint8Array(a);return crypto.getRandomValues(l),Array.from(l).map(o=>n.charAt(o%n.length)).join("")}const is={SETTINGS_SMART_ROUTING:"settings:smart_routing",SETTINGS_ROUTE_CONFIG:"settings:route_config",SETTINGS_INSTALL_CONFIG:"settings:install_config",SETTINGS_SYSTEM_CONFIG:"settings:system_config",SETTINGS_OAUTH_SERVER:"settings:oauth_server",SETTINGS_EXPORT_CONFIG:"settings:export_config"},rj=({keyData:a,loading:n,availableServers:l,availableGroups:o,onSave:c,onDelete:d})=>{const{t:m}=Ce(),{showToast:p}=us(),[g,h]=y.useState(!1),[b,x]=y.useState(a.name),[w,T]=y.useState(a.token),[R,O]=y.useState(a.enabled),[E,A]=y.useState(a.accessType||"all"),[N,S]=y.useState(a.allowedGroups||[]),[D,P]=y.useState(a.allowedServers||[]),[$,B]=y.useState(!1),[L,Y]=y.useState(!1);y.useEffect(()=>{g||(x(a.name),T(a.token),O(a.enabled),A(a.accessType||"all"),S(a.allowedGroups||[]),P(a.allowedServers||[]))},[a,g]);const fe=async()=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(a.token),p(m("common.copySuccess")||"Copied to clipboard","success");else{const C=document.createElement("textarea");C.value=a.token,C.style.position="fixed",C.style.left="-9999px",document.body.appendChild(C),C.focus(),C.select();try{document.execCommand("copy"),p(m("common.copySuccess")||"Copied to clipboard","success")}catch{p(m("common.copyFailed")||"Copy failed","error")}document.body.removeChild(C)}}catch(C){console.error("Failed to copy",C),p(m("common.copyFailed")||"Copy failed","error")}},G=async()=>{if(E==="groups"&&N.length===0){p(m("settings.selectAtLeastOneGroup")||"Please select at least one group","error");return}if(E==="servers"&&D.length===0){p(m("settings.selectAtLeastOneServer")||"Please select at least one server","error");return}if(E==="custom"&&N.length===0&&D.length===0){p(m("settings.selectAtLeastOneGroupOrServer")||"Please select at least one group or server","error");return}B(!0);try{await c(a.id,{name:b,token:w,enabled:R,accessType:E,allowedGroups:N.join(", "),allowedServers:D.join(", ")}),h(!1)}finally{B(!1)}},K=async()=>{if(window.confirm(m("settings.deleteBearerKeyConfirm")||"Delete this key?")){Y(!0);try{await d(a.id)}finally{Y(!1)}}},X=E==="groups",H=E==="custom",Z=C=>{if(C.accessType==="all")return m("settings.bearerKeyAccessAll")||"All Resources";if(C.accessType==="groups")return`${m("settings.bearerKeyAccessGroups")||"Groups"}: ${C.allowedGroups}`;if(C.accessType==="servers")return`${m("settings.bearerKeyAccessServers")||"Servers"}: ${C.allowedServers}`;if(C.accessType==="custom"){const I=[];return C.allowedGroups&&C.allowedGroups.length>0&&I.push(`${m("settings.bearerKeyAccessGroups")||"Groups"}: ${C.allowedGroups}`),C.allowedServers&&C.allowedServers.length>0&&I.push(`${m("settings.bearerKeyAccessServers")||"Servers"}: ${C.allowedServers}`),`${m("settings.bearerKeyAccessCustom")||"Custom"}: ${I.join("; ")}`}return""};return g?r.jsx("tr",{children:r.jsx("td",{colSpan:5,className:"p-0 border-b border-gray-200",children:r.jsxs("div",{className:"bg-gray-50 p-5",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-4 mb-4",children:[r.jsxs("div",{className:"md:col-span-3",children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:m("settings.bearerKeyName")||"Name"}),r.jsx("input",{type:"text",className:"block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input transition-shadow duration-200",value:b,onChange:C=>x(C.target.value),disabled:n})]}),r.jsxs("div",{className:"md:col-span-9",children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:m("settings.bearerKeyToken")||"Token"}),r.jsx("input",{type:"text",className:"block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input transition-shadow duration-200",value:w,onChange:C=>T(C.target.value),disabled:n})]})]}),r.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[r.jsxs("div",{className:"w-40",children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:m("settings.bearerKeyEnabled")||"Status"}),r.jsxs("div",{className:"flex items-center h-[38px] px-3 bg-white border border-gray-300 rounded-md",children:[r.jsx("span",{className:`text-sm mr-3 ${R?"text-green-600 font-medium":"text-gray-500"}`,children:R?"Active":"Inactive"}),r.jsx(tr,{disabled:n,checked:R,onCheckedChange:C=>O(C)})]})]}),r.jsxs("div",{className:"w-48",children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:m("settings.bearerKeyAccessType")||"Access scope"}),r.jsxs("select",{className:"block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-select transition-shadow duration-200",value:E,onChange:C=>A(C.target.value),disabled:n,children:[r.jsx("option",{value:"all",children:m("settings.bearerKeyAccessAll")||"All Resources"}),r.jsx("option",{value:"groups",children:m("settings.bearerKeyAccessGroups")||"Specific Groups"}),r.jsx("option",{value:"servers",children:m("settings.bearerKeyAccessServers")||"Specific Servers"}),r.jsx("option",{value:"custom",children:m("settings.bearerKeyAccessCustom")||"Custom (Groups & Servers)"})]})]}),!H&&r.jsxs("div",{className:"flex-1 min-w-[200px]",children:[r.jsx("label",{className:`block text-sm font-medium mb-1 ${E==="all"?"text-gray-400":"text-gray-700"}`,children:X?m("settings.bearerKeyAllowedGroups")||"Allowed groups":m("settings.bearerKeyAllowedServers")||"Allowed servers"}),r.jsx(vn,{options:X?o:l,selected:X?N:D,onChange:X?S:P,placeholder:X?m("settings.selectGroups")||"Select groups...":m("settings.selectServers")||"Select servers...",disabled:n||E==="all"})]}),H&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex-1 min-w-[200px]",children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:m("settings.bearerKeyAllowedGroups")||"Allowed groups"}),r.jsx(vn,{options:o,selected:N,onChange:S,placeholder:m("settings.selectGroups")||"Select groups...",disabled:n})]}),r.jsxs("div",{className:"flex-1 min-w-[200px]",children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:m("settings.bearerKeyAllowedServers")||"Allowed servers"}),r.jsx(vn,{options:l,selected:D,onChange:P,placeholder:m("settings.selectServers")||"Select servers...",disabled:n})]})]}),r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx("button",{type:"button",onClick:()=>h(!1),className:"px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-md text-sm font-medium hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 h-[38px]",children:m("common.cancel")||"Cancel"}),r.jsx("button",{type:"button",onClick:G,disabled:n||$,className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary h-[38px]",children:$?m("common.saving")||"Saving...":m("common.save")||"Save"})]})]})]})})}):r.jsxs("tr",{className:"hover:bg-gray-50",children:[r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:a.name}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 font-mono",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{children:a.token.length>12?`${a.token.substring(0,8)}...${a.token.substring(a.token.length-4)}`:a.token}),r.jsx("button",{onClick:fe,className:"text-gray-400 hover:text-gray-600 transition-colors",title:m("common.copy")||"Copy",children:r.jsx(wn,{className:"h-3.5 w-3.5"})})]})}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:r.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${a.enabled?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800"}`,children:a.enabled?m("common.active")||"Active":m("common.inactive")||"Inactive"})}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:Z(a)}),r.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium",children:[r.jsx("button",{onClick:()=>h(!0),className:"text-blue-600 hover:text-blue-900 mr-4 inline-flex items-center",title:m("common.edit")||"Edit",children:r.jsx(Ol,{className:"h-4 w-4"})}),r.jsx("button",{onClick:K,disabled:L,className:"text-red-600 hover:text-red-900 inline-flex items-center",title:m("common.delete")||"Delete",children:r.jsx(lw,{className:"h-4 w-4"})})]})]})},aj=()=>{const{t:a}=Ce(),n=la(),{showToast:l}=us(),{allServers:o}=y0(),{groups:c}=xo(),[d,m]=y.useState({pythonIndexUrl:"",npmRegistry:"",baseUrl:"http://localhost:3000"}),[p,g]=y.useState({dbUrl:"",embeddingProvider:"openai",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:"",azureOpenaiEndpoint:"",azureOpenaiApiKey:"",azureOpenaiApiVersion:"2024-02-15-preview",azureOpenaiEmbeddingDeployment:""}),[h,b]=y.useState({apiKey:"",referer:"https://www.mcphubx.com",title:"MCPHub",baseUrl:"https://api.mcprouter.to/v1"}),[x,w]=y.useState({accessTokenLifetime:"3600",refreshTokenLifetime:"1209600",authorizationCodeLifetime:"300",allowedScopes:"read, write",dynamicRegistrationAllowedGrantTypes:"authorization_code, refresh_token"}),[T,R]=y.useState("-"),[O,E]=y.useState(!1),{routingConfig:A,installConfig:N,smartRoutingConfig:S,mcpRouterConfig:D,oauthServerConfig:P,nameSeparator:$,enableSessionRebuild:B,loading:L,bearerKeys:Y,updateRoutingConfig:fe,updateInstallConfig:G,updateSmartRoutingConfig:K,updateSmartRoutingConfigBatch:X,updateMCPRouterConfig:H,updateOAuthServerConfig:Z,updateNameSeparator:C,updateSessionRebuild:I,exportMCPSettings:U,createBearerKey:oe,updateBearerKey:V,deleteBearerKey:j,refreshBearerKeys:M}=zs();y.useEffect(()=>{N&&m(N)},[N]),y.useEffect(()=>{S&&g({dbUrl:S.dbUrl||"",embeddingProvider:S.embeddingProvider==="azure_openai"?"azure_openai":"openai",openaiApiBaseUrl:S.openaiApiBaseUrl||"",openaiApiKey:S.openaiApiKey||"",openaiApiEmbeddingModel:S.openaiApiEmbeddingModel||"",azureOpenaiEndpoint:S.azureOpenaiEndpoint||"",azureOpenaiApiKey:S.azureOpenaiApiKey||"",azureOpenaiApiVersion:S.azureOpenaiApiVersion||"2024-02-15-preview",azureOpenaiEmbeddingDeployment:S.azureOpenaiEmbeddingDeployment||""})},[S]),y.useEffect(()=>{D&&b({apiKey:D.apiKey||"",referer:D.referer||"https://www.mcphubx.com",title:D.title||"MCPHub",baseUrl:D.baseUrl||"https://api.mcprouter.to/v1"})},[D]),y.useEffect(()=>{var W,ve;P&&w({accessTokenLifetime:P.accessTokenLifetime!==void 0?String(P.accessTokenLifetime):"",refreshTokenLifetime:P.refreshTokenLifetime!==void 0?String(P.refreshTokenLifetime):"",authorizationCodeLifetime:P.authorizationCodeLifetime!==void 0?String(P.authorizationCodeLifetime):"",allowedScopes:P.allowedScopes&&P.allowedScopes.length>0?P.allowedScopes.join(", "):"",dynamicRegistrationAllowedGrantTypes:(ve=(W=P.dynamicRegistration)==null?void 0:W.allowedGrantTypes)!=null&&ve.length?P.dynamicRegistration.allowedGrantTypes.join(", "):""})},[P]),y.useEffect(()=>{R($)},[$]),y.useEffect(()=>{M()},[]);const[z,q]=y.useState({routingConfig:!1,installConfig:!1,smartRoutingConfig:!1,oauthServerConfig:!1,mcpRouterConfig:!1,nameSeparator:!1,password:!1,exportConfig:!1,bearerKeys:!1}),pe=W=>{q(ve=>({...ve,[W]:!ve[W]}))},se=async(W,ve)=>{await fe(W,ve)},Q=(W,ve)=>{m({...d,[W]:ve})},ge=async W=>{await G(W,d[W])},re=(W,ve)=>{g({...p,[W]:ve})},ye=(W,ve)=>{b({...h,[W]:ve})},ue=async W=>{await H(W,h[W])},ie=(W,ve)=>{w(qe=>({...qe,[W]:ve}))},xe=(W,ve)=>{w(qe=>({...qe,[W]:ve}))},Xe=async W=>{const ve=x[W];if(!ve||ve.trim()===""){l(a("settings.invalidNumberInput")||"Please enter a valid number","error");return}const qe=Number(ve);if(Number.isNaN(qe)||qe<0){l(a("settings.invalidNumberInput")||"Please enter a valid number","error");return}await Z(W,qe)},Ft=async()=>{const W=x.allowedScopes.split(",").map(ve=>ve.trim()).filter(ve=>ve.length>0);await Z("allowedScopes",W)},Vt=async()=>{const W=x.dynamicRegistrationAllowedGrantTypes.split(",").map(ve=>ve.trim()).filter(ve=>ve.length>0);await Z("dynamicRegistration",{...P.dynamicRegistration,allowedGrantTypes:W})},Ze=async(W,ve)=>{await Z(W,ve)},gt=async W=>{await Z("dynamicRegistration",{...P.dynamicRegistration,...W})},$t=async()=>{await C(T)},Ut=async W=>{if(W){const ve=p.dbUrl||S.dbUrl,qe=[];if(ve||qe.push(a("settings.dbUrl")||"Database URL"),p.embeddingProvider==="azure_openai"){const Vr=p.azureOpenaiEndpoint||S.azureOpenaiEndpoint,oa=p.azureOpenaiApiKey||S.azureOpenaiApiKey,$r=p.azureOpenaiApiVersion||S.azureOpenaiApiVersion,Ve=p.azureOpenaiEmbeddingDeployment||S.azureOpenaiEmbeddingDeployment;(!Vr||!oa||!$r||!Ve)&&qe.push(a("settings.azureOpenaiEndpoint")||"Azure OpenAI Endpoint",a("settings.azureOpenaiApiKey")||"Azure OpenAI API Key",a("settings.azureOpenaiApiVersion")||"Azure OpenAI API Version",a("settings.azureOpenaiEmbeddingDeployment")||"Azure Embedding Deployment")}else p.openaiApiKey||S.openaiApiKey||qe.push(a("settings.openaiApiKey")||"OpenAI API Key");if(qe.length>0){l(a("settings.smartRoutingValidationError",{fields:qe.join(", ")}));return}const jt={enabled:W};p.dbUrl!==S.dbUrl&&(jt.dbUrl=p.dbUrl),p.embeddingProvider!==S.embeddingProvider&&(jt.embeddingProvider=p.embeddingProvider),p.openaiApiBaseUrl!==S.openaiApiBaseUrl&&(jt.openaiApiBaseUrl=p.openaiApiBaseUrl),p.openaiApiKey!==S.openaiApiKey&&(jt.openaiApiKey=p.openaiApiKey),p.openaiApiEmbeddingModel!==S.openaiApiEmbeddingModel&&(jt.openaiApiEmbeddingModel=p.openaiApiEmbeddingModel),p.azureOpenaiEndpoint!==S.azureOpenaiEndpoint&&(jt.azureOpenaiEndpoint=p.azureOpenaiEndpoint),p.azureOpenaiApiKey!==S.azureOpenaiApiKey&&(jt.azureOpenaiApiKey=p.azureOpenaiApiKey),p.azureOpenaiApiVersion!==S.azureOpenaiApiVersion&&(jt.azureOpenaiApiVersion=p.azureOpenaiApiVersion),p.azureOpenaiEmbeddingDeployment!==S.azureOpenaiEmbeddingDeployment&&(jt.azureOpenaiEmbeddingDeployment=p.azureOpenaiEmbeddingDeployment),await X(jt)}else await K("enabled",W)},Yt=async()=>{const W={};p.dbUrl!==S.dbUrl&&(W.dbUrl=p.dbUrl),p.embeddingProvider!==S.embeddingProvider&&(W.embeddingProvider=p.embeddingProvider),p.openaiApiBaseUrl!==S.openaiApiBaseUrl&&(W.openaiApiBaseUrl=p.openaiApiBaseUrl),p.openaiApiKey!==S.openaiApiKey&&(W.openaiApiKey=p.openaiApiKey),p.openaiApiEmbeddingModel!==S.openaiApiEmbeddingModel&&(W.openaiApiEmbeddingModel=p.openaiApiEmbeddingModel),p.azureOpenaiEndpoint!==S.azureOpenaiEndpoint&&(W.azureOpenaiEndpoint=p.azureOpenaiEndpoint),p.azureOpenaiApiKey!==S.azureOpenaiApiKey&&(W.azureOpenaiApiKey=p.azureOpenaiApiKey),p.azureOpenaiApiVersion!==S.azureOpenaiApiVersion&&(W.azureOpenaiApiVersion=p.azureOpenaiApiVersion),p.azureOpenaiEmbeddingDeployment!==S.azureOpenaiEmbeddingDeployment&&(W.azureOpenaiEmbeddingDeployment=p.azureOpenaiEmbeddingDeployment),Object.keys(W).length>0?await X(W):l(a("settings.noChanges")||"No changes to save","info")},It=()=>{setTimeout(()=>{n("/")},2e3)},[pr,tt]=y.useState(!1),[wt,ir]=y.useState(""),[ze,St]=y.useState({name:"",token:"",enabled:!0,accessType:"all",allowedGroups:"",allowedServers:""}),[ke,nt]=y.useState([]),[lt,ar]=y.useState([]),Jt=o.map(W=>({value:W.name,label:W.name})),ft=c.map(W=>({value:W.name,label:W.name}));y.useEffect(()=>{ze.accessType!=="groups"&&ze.accessType!=="custom"&&nt([]),ze.accessType!=="servers"&&ze.accessType!=="custom"&&ar([])},[ze.accessType]);const sr=async()=>{try{const W=await U();console.log("Fetched MCP settings:",W);const ve=JSON.stringify(W.data,null,2);ir(ve)}catch(W){console.error("Error fetching MCP settings:",W),l(a("settings.exportError")||"Failed to fetch settings","error")}};y.useEffect(()=>{z.exportConfig&&!wt&&sr()},[z.exportConfig]);const xt=async()=>{if(wt)try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(wt),tt(!0),l(a("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>tt(!1),2e3);else{const W=document.createElement("textarea");W.value=wt,W.style.position="fixed",W.style.left="-9999px",document.body.appendChild(W),W.focus(),W.select();try{document.execCommand("copy"),tt(!0),l(a("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>tt(!1),2e3)}catch(ve){l(a("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",ve)}document.body.removeChild(W)}}catch(W){console.error("Error copying configuration:",W),l(a("common.copyFailed")||"Copy failed","error")}},Ma=()=>{if(!wt)return;const W=new Blob([wt],{type:"application/json"}),ve=URL.createObjectURL(W),qe=document.createElement("a");qe.href=ve,qe.download="mcp_settings.json",document.body.appendChild(qe),qe.click(),document.body.removeChild(qe),URL.revokeObjectURL(ve),l(a("settings.exportSuccess")||"Settings exported successfully","success")},ia=W=>{const ve=W.split(",").map(qe=>qe.trim()).filter(qe=>qe.length>0);return ve.length>0?ve:void 0},La=async()=>{if(!ze.name||!ze.token){l(a("settings.bearerKeyRequired")||"Name and token are required","error");return}if(ze.accessType==="groups"&&ke.length===0){l(a("settings.selectAtLeastOneGroup")||"Please select at least one group","error");return}if(ze.accessType==="servers"&&lt.length===0){l(a("settings.selectAtLeastOneServer")||"Please select at least one server","error");return}if(ze.accessType==="custom"&&ke.length===0&&lt.length===0){l(a("settings.selectAtLeastOneGroupOrServer")||"Please select at least one group or server","error");return}await oe({name:ze.name,token:ze.token,enabled:ze.enabled,accessType:ze.accessType,allowedGroups:(ze.accessType==="groups"||ze.accessType==="custom")&&ke.length>0?ke:void 0,allowedServers:(ze.accessType==="servers"||ze.accessType==="custom")&&lt.length>0?lt:void 0}),St({name:"",token:"",enabled:!0,accessType:"all",allowedGroups:"",allowedServers:""}),nt([]),ar([]),await M()},hr=async(W,ve)=>{await V(W,{name:ve.name,token:ve.token,enabled:ve.enabled,accessType:ve.accessType,allowedGroups:ia(ve.allowedGroups),allowedServers:ia(ve.allowedServers)}),await M()},gr=async W=>{await j(W),await M()};return r.jsxs("div",{className:"container mx-auto",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-8",children:a("pages.settings.title")}),r.jsx(ls,{permissions:is.SETTINGS_ROUTE_CONFIG,children:r.jsxs("div",{className:"bg-white shadow rounded-lg mb-6 page-card dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600 py-4 px-6",onClick:()=>pe("bearerKeys"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:a("settings.bearerKeysSectionTitle")||"Bearer authentication keys"}),r.jsx("span",{className:"text-gray-500 transition-transform duration-200",children:z.bearerKeys?"▼":"►"})]}),z.bearerKeys&&r.jsxs("div",{className:"space-y-4 pb-4 px-6",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.enableBearerAuth")||"Enable Bearer Authentication"}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.enableBearerAuthDescription")||"Require bearer token authentication for MCP requests"})]}),r.jsx(tr,{disabled:L,checked:A.enableBearerAuth,onCheckedChange:W=>se("enableBearerAuth",W)})]}),r.jsxs("div",{className:"flex justify-between items-center",children:[r.jsx("p",{className:"text-sm text-gray-600",children:a("settings.bearerKeysSectionDescription")||"Manage multiple bearer authentication keys with different access scopes."}),!O&&r.jsxs("button",{type:"button",onClick:()=>E(!0),className:"flex items-center text-blue-600 hover:text-blue-800 font-medium transition-colors duration-200",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-1",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z",clipRule:"evenodd"})}),a("settings.addBearerKey")||"Add bearer key"]})]}),Y.length===0?r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.noBearerKeys")||"No bearer keys configured yet."}):r.jsx("div",{className:"mt-2 overflow-x-auto",children:r.jsxs("table",{className:"min-w-full divide-y divide-gray-200 border border-gray-200 rounded-lg",children:[r.jsx("thead",{className:"bg-gray-50",children:r.jsxs("tr",{children:[r.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("settings.bearerKeyName")||"Name"}),r.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("settings.bearerKeyToken")||"Token"}),r.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("settings.bearerKeyEnabled")||"Status"}),r.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("settings.bearerKeyAccessType")||"Access Scope"}),r.jsx("th",{scope:"col",className:"px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider",children:a("common.actions")||"Actions"})]})}),r.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:Y.map(W=>r.jsx(rj,{keyData:W,loading:L,availableServers:Jt,availableGroups:ft,onSave:hr,onDelete:gr},W.id))})]})}),O&&r.jsx("div",{className:"mt-6 border-t border-gray-200 pt-6",children:r.jsxs("div",{className:"bg-gray-50 rounded-lg p-5 border border-gray-200",children:[r.jsxs("h3",{className:"font-medium text-gray-900 mb-4 flex items-center gap-2",children:[r.jsx("span",{className:"bg-blue-100 text-blue-600 p-1 rounded",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M10 3a1 1 0 011 1v5h5a1 1 0 110 2h-5v5a1 1 0 11-2 0v-5H4a1 1 0 110-2h5V4a1 1 0 011-1z",clipRule:"evenodd"})})}),a("settings.addBearerKey")||"Add bearer key"]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-4 mb-4",children:[r.jsxs("div",{className:"md:col-span-3",children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:a("settings.bearerKeyName")||"Name"}),r.jsx("input",{type:"text",className:"block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input transition-shadow duration-200",placeholder:"e.g. My API Key",value:ze.name,onChange:W=>St(ve=>({...ve,name:W.target.value})),disabled:L})]}),r.jsxs("div",{className:"md:col-span-9",children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:a("settings.bearerKeyToken")||"Token"}),r.jsxs("div",{className:"flex rounded-md shadow-sm",children:[r.jsx("input",{type:"text",className:"flex-1 block w-full py-2 px-3 border border-gray-300 rounded-l-md rounded-r-none border-r-0 focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input transition-shadow duration-200",placeholder:"sk-...",value:ze.token,onChange:W=>St(ve=>({...ve,token:W.target.value})),disabled:L}),r.jsx("button",{type:"button",onClick:()=>St(W=>({...W,token:tj()})),disabled:L,className:"relative -ml-[5px] inline-flex items-center px-4 py-2 border border-gray-300 bg-gray-100 text-gray-700 text-sm font-medium rounded-r-md rounded-l-none hover:bg-gray-200 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 transition-colors duration-200 z-10",children:a("settings.generate")||"Generate"})]})]})]}),r.jsxs("div",{className:"flex flex-wrap items-end gap-4 mb-2",children:[r.jsxs("div",{className:"w-40",children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:a("settings.bearerKeyEnabled")||"Status"}),r.jsxs("div",{className:"flex items-center h-[38px] px-3 bg-white border border-gray-300 rounded-md",children:[r.jsx("span",{className:`text-sm mr-3 ${ze.enabled?"text-green-600 font-medium":"text-gray-500"}`,children:ze.enabled?"Active":"Inactive"}),r.jsx(tr,{disabled:L,checked:ze.enabled,onCheckedChange:W=>St(ve=>({...ve,enabled:W}))})]})]}),r.jsxs("div",{className:"w-48",children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:a("settings.bearerKeyAccessType")||"Access scope"}),r.jsxs("select",{className:"block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-select transition-shadow duration-200",value:ze.accessType,onChange:W=>St(ve=>({...ve,accessType:W.target.value})),disabled:L,children:[r.jsx("option",{value:"all",children:a("settings.bearerKeyAccessAll")||"All Resources"}),r.jsx("option",{value:"groups",children:a("settings.bearerKeyAccessGroups")||"Specific Groups"}),r.jsx("option",{value:"servers",children:a("settings.bearerKeyAccessServers")||"Specific Servers"}),r.jsx("option",{value:"custom",children:a("settings.bearerKeyAccessCustom")||"Custom (Groups & Servers)"})]})]}),ze.accessType!=="custom"&&r.jsxs("div",{className:"flex-1 min-w-[200px]",children:[r.jsx("label",{className:`block text-sm font-medium mb-1 ${ze.accessType==="all"?"text-gray-400":"text-gray-700"}`,children:ze.accessType==="groups"?a("settings.bearerKeyAllowedGroups")||"Allowed groups":a("settings.bearerKeyAllowedServers")||"Allowed servers"}),r.jsx(vn,{options:ze.accessType==="groups"?ft:Jt,selected:ze.accessType==="groups"?ke:lt,onChange:ze.accessType==="groups"?nt:ar,placeholder:ze.accessType==="groups"?a("settings.selectGroups")||"Select groups...":a("settings.selectServers")||"Select servers...",disabled:L||ze.accessType==="all"})]}),ze.accessType==="custom"&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex-1 min-w-[200px]",children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:a("settings.bearerKeyAllowedGroups")||"Allowed groups"}),r.jsx(vn,{options:ft,selected:ke,onChange:nt,placeholder:a("settings.selectGroups")||"Select groups...",disabled:L})]}),r.jsxs("div",{className:"flex-1 min-w-[200px]",children:[r.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:a("settings.bearerKeyAllowedServers")||"Allowed servers"}),r.jsx(vn,{options:Jt,selected:lt,onChange:ar,placeholder:a("settings.selectServers")||"Select servers...",disabled:L})]})]}),r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx("button",{type:"button",onClick:()=>E(!1),className:"px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-md text-sm font-medium hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 h-[38px]",children:a("common.cancel")||"Cancel"}),r.jsx("button",{type:"button",onClick:La,disabled:L,className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary h-[38px]",children:a("settings.addBearerKeyButton")||"Create Key"})]})]})]})})]})]})}),r.jsx(ls,{permissions:is.SETTINGS_SMART_ROUTING,children:r.jsxs("div",{className:"bg-white shadow rounded-lg mb-6 page-card dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600 py-4 px-6",onClick:()=>pe("smartRoutingConfig"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:a("pages.settings.smartRouting")}),r.jsx("span",{className:"text-gray-500 transition-transform duration-200",children:z.smartRoutingConfig?"▼":"►"})]}),z.smartRoutingConfig&&r.jsxs("div",{className:"space-y-4 pb-4 px-6",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.enableSmartRouting")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.enableSmartRoutingDescription")})]}),r.jsx(tr,{disabled:L,checked:S.enabled,onCheckedChange:W=>Ut(W)})]}),S.dbUrl!=="${DB_URL}"&&r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsx("div",{className:"mb-2",children:r.jsxs("h3",{className:"font-medium text-gray-700",children:[r.jsx("span",{className:"text-red-500 px-1",children:"*"}),a("settings.dbUrl")]})}),r.jsx("div",{className:"flex items-center gap-3",children:r.jsx("input",{type:"text",value:p.dbUrl,onChange:W=>re("dbUrl",W.target.value),placeholder:a("settings.dbUrlPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm border-gray-300 form-input",disabled:L})})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsx("div",{className:"mb-2",children:r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.embeddingProvider")||"Embedding Provider"})}),r.jsx("div",{className:"flex items-center gap-3",children:r.jsxs("select",{className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-select",value:p.embeddingProvider,onChange:W=>re("embeddingProvider",W.target.value),disabled:L,children:[r.jsx("option",{value:"openai",children:"OpenAI"}),r.jsx("option",{value:"azure_openai",children:"Azure OpenAI"})]})})]}),p.embeddingProvider==="openai"?r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsx("div",{className:"mb-2",children:r.jsxs("h3",{className:"font-medium text-gray-700",children:[r.jsx("span",{className:"text-red-500 px-1",children:"*"}),a("settings.openaiApiKey")]})}),r.jsx("div",{className:"flex items-center gap-3",children:r.jsx("input",{type:"password",value:p.openaiApiKey,onChange:W=>re("openaiApiKey",W.target.value),placeholder:a("settings.openaiApiKeyPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm border-gray-300",disabled:L})})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsx("div",{className:"mb-2",children:r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.openaiApiBaseUrl")})}),r.jsx("div",{className:"flex items-center gap-3",children:r.jsx("input",{type:"text",value:p.openaiApiBaseUrl,onChange:W=>re("openaiApiBaseUrl",W.target.value),placeholder:a("settings.openaiApiBaseUrlPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:L})})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsx("div",{className:"mb-2",children:r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.openaiApiEmbeddingModel")})}),r.jsx("div",{className:"flex items-center gap-3",children:r.jsx("input",{type:"text",value:p.openaiApiEmbeddingModel,onChange:W=>re("openaiApiEmbeddingModel",W.target.value),placeholder:a("settings.openaiApiEmbeddingModelPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:L})})]})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsx("div",{className:"mb-2",children:r.jsxs("h3",{className:"font-medium text-gray-700",children:[r.jsx("span",{className:"text-red-500 px-1",children:"*"}),a("settings.azureOpenaiEndpoint")||"Azure OpenAI Endpoint"]})}),r.jsx("div",{className:"flex items-center gap-3",children:r.jsx("input",{type:"text",value:p.azureOpenaiEndpoint,onChange:W=>re("azureOpenaiEndpoint",W.target.value),placeholder:a("settings.azureOpenaiEndpointPlaceholder")||"https://YOUR_RESOURCE_NAME.openai.azure.com",className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:L})})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsx("div",{className:"mb-2",children:r.jsxs("h3",{className:"font-medium text-gray-700",children:[r.jsx("span",{className:"text-red-500 px-1",children:"*"}),a("settings.azureOpenaiApiKey")||"Azure OpenAI API Key"]})}),r.jsx("div",{className:"flex items-center gap-3",children:r.jsx("input",{type:"password",value:p.azureOpenaiApiKey,onChange:W=>re("azureOpenaiApiKey",W.target.value),placeholder:a("settings.azureOpenaiApiKeyPlaceholder")||"***",className:"flex-1 mt-1 block w-full py-2 px-3 border rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm border-gray-300",disabled:L})})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsx("div",{className:"mb-2",children:r.jsxs("h3",{className:"font-medium text-gray-700",children:[r.jsx("span",{className:"text-red-500 px-1",children:"*"}),a("settings.azureOpenaiApiVersion")||"Azure OpenAI API Version"]})}),r.jsx("div",{className:"flex items-center gap-3",children:r.jsx("input",{type:"text",value:p.azureOpenaiApiVersion,onChange:W=>re("azureOpenaiApiVersion",W.target.value),placeholder:a("settings.azureOpenaiApiVersionPlaceholder")||"2024-02-15-preview",className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:L})})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsx("div",{className:"mb-2",children:r.jsxs("h3",{className:"font-medium text-gray-700",children:[r.jsx("span",{className:"text-red-500 px-1",children:"*"}),a("settings.azureOpenaiEmbeddingDeployment")||"Azure Embedding Deployment"]})}),r.jsx("div",{className:"flex items-center gap-3",children:r.jsx("input",{type:"text",value:p.azureOpenaiEmbeddingDeployment,onChange:W=>re("azureOpenaiEmbeddingDeployment",W.target.value),placeholder:a("settings.azureOpenaiEmbeddingDeploymentPlaceholder")||"your-embedding-deployment-name",className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:L})})]})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.progressiveDisclosure")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.progressiveDisclosureDescription")})]}),r.jsx(tr,{disabled:L||!S.enabled,checked:S.progressiveDisclosure,onCheckedChange:W=>K("progressiveDisclosure",W)})]}),r.jsx("div",{className:"flex justify-end pt-2",children:r.jsx("button",{onClick:Yt,disabled:L,className:"px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:a("common.save")})})]})]})}),r.jsx(ls,{permissions:is.SETTINGS_OAUTH_SERVER,children:r.jsxs("div",{className:"bg-white shadow rounded-lg mb-6 dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600 py-4 px-6",onClick:()=>pe("oauthServerConfig"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:a("pages.settings.oauthServer")}),r.jsx("span",{className:"text-gray-500",children:z.oauthServerConfig?"▼":"►"})]}),z.oauthServerConfig&&r.jsxs("div",{className:"space-y-4 pb-4 px-6",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.enableOauthServer")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.enableOauthServerDescription")})]}),r.jsx(tr,{disabled:L,checked:P.enabled,onCheckedChange:W=>Ze("enabled",W)})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.requireClientSecret")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.requireClientSecretDescription")})]}),r.jsx(tr,{disabled:L||!P.enabled,checked:P.requireClientSecret,onCheckedChange:W=>Ze("requireClientSecret",W)})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.requireState")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.requireStateDescription")})]}),r.jsx(tr,{disabled:L||!P.enabled,checked:P.requireState,onCheckedChange:W=>Ze("requireState",W)})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.accessTokenLifetime")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.accessTokenLifetimeDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"number",value:x.accessTokenLifetime,onChange:W=>ie("accessTokenLifetime",W.target.value),placeholder:a("settings.accessTokenLifetimePlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:L}),r.jsx("button",{onClick:()=>Xe("accessTokenLifetime"),disabled:L,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:a("common.save")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.refreshTokenLifetime")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.refreshTokenLifetimeDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"number",value:x.refreshTokenLifetime,onChange:W=>ie("refreshTokenLifetime",W.target.value),placeholder:a("settings.refreshTokenLifetimePlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:L}),r.jsx("button",{onClick:()=>Xe("refreshTokenLifetime"),disabled:L,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:a("common.save")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.authorizationCodeLifetime")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.authorizationCodeLifetimeDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"number",value:x.authorizationCodeLifetime,onChange:W=>ie("authorizationCodeLifetime",W.target.value),placeholder:a("settings.authorizationCodeLifetimePlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:L}),r.jsx("button",{onClick:()=>Xe("authorizationCodeLifetime"),disabled:L,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:a("common.save")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.allowedScopes")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.allowedScopesDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:x.allowedScopes,onChange:W=>xe("allowedScopes",W.target.value),placeholder:a("settings.allowedScopesPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:L}),r.jsx("button",{onClick:Ft,disabled:L,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:a("common.save")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md space-y-4",children:[r.jsxs("div",{className:"flex justify-between items-center",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.enableDynamicRegistration")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.dynamicRegistrationDescription")})]}),r.jsx(tr,{disabled:L||!P.enabled,checked:P.dynamicRegistration.enabled,onCheckedChange:W=>gt({enabled:W})})]}),r.jsxs("div",{children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.dynamicRegistrationAllowedGrantTypes")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.dynamicRegistrationAllowedGrantTypesDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:x.dynamicRegistrationAllowedGrantTypes,onChange:W=>xe("dynamicRegistrationAllowedGrantTypes",W.target.value),placeholder:a("settings.dynamicRegistrationAllowedGrantTypesPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:L||!P.enabled||!P.dynamicRegistration.enabled}),r.jsx("button",{onClick:Vt,disabled:L||!P.enabled||!P.dynamicRegistration.enabled,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:a("common.save")})]})]}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.dynamicRegistrationAuth")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.dynamicRegistrationAuthDescription")})]}),r.jsx(tr,{disabled:L||!P.enabled||!P.dynamicRegistration.enabled,checked:P.dynamicRegistration.requiresAuthentication,onCheckedChange:W=>gt({requiresAuthentication:W})})]})]})]})]})}),r.jsx(ls,{permissions:is.SETTINGS_INSTALL_CONFIG,children:r.jsxs("div",{className:"bg-white shadow rounded-lg mb-6 page-card dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600 py-4 px-6",onClick:()=>pe("mcpRouterConfig"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:a("settings.mcpRouterConfig")}),r.jsx("span",{className:"text-gray-500 transition-transform duration-200",children:z.mcpRouterConfig?"▼":"►"})]}),z.mcpRouterConfig&&r.jsxs("div",{className:"space-y-4 pb-4 px-6",children:[r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.mcpRouterApiKey")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.mcpRouterApiKeyDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"password",value:h.apiKey,onChange:W=>ye("apiKey",W.target.value),placeholder:a("settings.mcpRouterApiKeyPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm border-gray-300 form-input",disabled:L}),r.jsx("button",{onClick:()=>ue("apiKey"),disabled:L,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:a("common.save")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.mcpRouterBaseUrl")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.mcpRouterBaseUrlDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:h.baseUrl,onChange:W=>ye("baseUrl",W.target.value),placeholder:a("settings.mcpRouterBaseUrlPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:L}),r.jsx("button",{onClick:()=>ue("baseUrl"),disabled:L,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:a("common.save")})]})]})]})]})}),r.jsx(ls,{permissions:is.SETTINGS_SYSTEM_CONFIG,children:r.jsxs("div",{className:"bg-white shadow rounded-lg mb-6 dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600 py-4 px-6",onClick:()=>pe("nameSeparator"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:a("settings.systemSettings")}),r.jsx("span",{className:"text-gray-500",children:z.nameSeparator?"▼":"►"})]}),z.nameSeparator&&r.jsxs("div",{className:"space-y-4 pb-4 px-6",children:[r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.nameSeparatorLabel")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.nameSeparatorDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:T,onChange:W=>R(W.target.value),placeholder:"-",className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:L,maxLength:5}),r.jsx("button",{onClick:$t,disabled:L,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:a("common.save")})]})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.enableSessionRebuild")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.enableSessionRebuildDescription")})]}),r.jsx(tr,{disabled:L,checked:B,onCheckedChange:W=>I(W)})]})]})]})}),r.jsx(ls,{permissions:is.SETTINGS_ROUTE_CONFIG,children:r.jsxs("div",{className:"bg-white shadow rounded-lg mb-6 dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600 py-4 px-6",onClick:()=>pe("routingConfig"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:a("pages.settings.routeConfig")}),r.jsx("span",{className:"text-gray-500",children:z.routingConfig?"▼":"►"})]}),z.routingConfig&&r.jsxs("div",{className:"space-y-4 pb-4 px-6",children:[r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.enableGlobalRoute")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.enableGlobalRouteDescription")})]}),r.jsx(tr,{disabled:L,checked:A.enableGlobalRoute,onCheckedChange:W=>se("enableGlobalRoute",W)})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.enableGroupNameRoute")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.enableGroupNameRouteDescription")})]}),r.jsx(tr,{disabled:L,checked:A.enableGroupNameRoute,onCheckedChange:W=>se("enableGroupNameRoute",W)})]}),r.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.skipAuth")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.skipAuthDescription")})]}),r.jsx(tr,{disabled:L,checked:A.skipAuth,onCheckedChange:W=>se("skipAuth",W)})]})]})]})}),r.jsx(ls,{permissions:is.SETTINGS_INSTALL_CONFIG,children:r.jsxs("div",{className:"bg-white shadow rounded-lg mb-6 dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600 py-4 px-6",onClick:()=>pe("installConfig"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:a("settings.installConfig")}),r.jsx("span",{className:"text-gray-500",children:z.installConfig?"▼":"►"})]}),z.installConfig&&r.jsxs("div",{className:"space-y-4 pb-4 px-6",children:[r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.baseUrl")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.baseUrlDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:d.baseUrl,onChange:W=>Q("baseUrl",W.target.value),placeholder:a("settings.baseUrlPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:L}),r.jsx("button",{onClick:()=>ge("baseUrl"),disabled:L,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:a("common.save")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.pythonIndexUrl")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.pythonIndexUrlDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:d.pythonIndexUrl,onChange:W=>Q("pythonIndexUrl",W.target.value),placeholder:a("settings.pythonIndexUrlPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:L}),r.jsx("button",{onClick:()=>ge("pythonIndexUrl"),disabled:L,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:a("common.save")})]})]}),r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-2",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.npmRegistry")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.npmRegistryDescription")})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"text",value:d.npmRegistry,onChange:W=>Q("npmRegistry",W.target.value),placeholder:a("settings.npmRegistryPlaceholder"),className:"flex-1 mt-1 block w-full py-2 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 sm:text-sm form-input",disabled:L}),r.jsx("button",{onClick:()=>ge("npmRegistry"),disabled:L,className:"mt-1 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:a("common.save")})]})]})]})]})}),r.jsxs("div",{className:"bg-white shadow rounded-lg mb-6 dashboard-card","data-section":"password",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600 py-4 px-6",onClick:()=>pe("password"),role:"button",children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:a("auth.changePassword")}),r.jsx("span",{className:"text-gray-500",children:z.password?"▼":"►"})]}),z.password&&r.jsx("div",{className:"max-w-lg pb-4 px-6",children:r.jsx(ej,{onSuccess:It})})]}),r.jsx(ls,{permissions:is.SETTINGS_EXPORT_CONFIG,children:r.jsxs("div",{className:"bg-white shadow rounded-lg mb-6 dashboard-card",children:[r.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600 py-4 px-6",onClick:()=>pe("exportConfig"),children:[r.jsx("h2",{className:"font-semibold text-gray-800",children:a("settings.exportMcpSettings")}),r.jsx("span",{className:"text-gray-500",children:z.exportConfig?"▼":"►"})]}),z.exportConfig&&r.jsx("div",{className:"space-y-4 pb-4 px-6",children:r.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[r.jsxs("div",{className:"mb-4",children:[r.jsx("h3",{className:"font-medium text-gray-700",children:a("settings.mcpSettingsJson")}),r.jsx("p",{className:"text-sm text-gray-500",children:a("settings.mcpSettingsJsonDescription")})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("button",{onClick:xt,disabled:!wt,className:"flex items-center gap-2 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:[pr?r.jsx(os,{size:16}):r.jsx(wn,{size:16}),a(pr?"common.copied":"settings.copyToClipboard")]}),r.jsxs("button",{onClick:Ma,disabled:!wt,className:"flex items-center gap-2 px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-md text-sm font-medium disabled:opacity-50 btn-primary",children:[r.jsx(B2,{size:16}),a("settings.downloadJson")]})]}),wt&&r.jsx("div",{className:"mt-3",children:r.jsx("pre",{className:"bg-gray-900 text-gray-100 p-4 rounded-md overflow-x-auto text-xs max-h-96",children:wt})})]})]})})]})})]})},sj=()=>{const{t:a}=Ce(),[n,l]=y.useState([]),[o,c]=y.useState([]),[d,m]=y.useState([]),[p,g]=y.useState([]),[h,b]=y.useState(""),[x,w]=y.useState(""),[T,R]=y.useState(""),[O,E]=y.useState(!0),[A,N]=y.useState(null),[S,D]=y.useState(null),[P,$]=y.useState([]),[B,L]=y.useState(1),[Y,fe]=y.useState(9),[G,K]=y.useState(1),X=y.useCallback(async()=>{try{E(!0);const se=await Ue("/market/servers");se&&se.success&&Array.isArray(se.data)?(c(se.data),H(se.data,B)):(console.error("Invalid market servers data format:",se),N(a("market.fetchError")))}catch(se){console.error("Error fetching market servers:",se),N(se instanceof Error?se.message:String(se))}finally{E(!1)}},[a]),H=y.useCallback((se,Q,ge=Y)=>{const re=se.length,ye=Math.ceil(re/ge);K(ye);const ue=Math.max(1,Math.min(Q,ye));ue!==Q&&L(ue);const ie=(ue-1)*ge,xe=se.slice(ie,ie+ge);l(xe)},[Y]),Z=y.useCallback(se=>{L(se),H(o,se,Y)},[o,H,Y]),C=y.useCallback(async()=>{try{const se=await Ue("/market/categories");se&&se.success&&Array.isArray(se.data)?m(se.data):console.error("Invalid categories data format:",se)}catch(se){console.error("Error fetching categories:",se)}},[]),I=y.useCallback(async()=>{try{const se=await Ue("/market/tags");se&&se.success&&Array.isArray(se.data)?g(se.data):console.error("Invalid tags data format:",se)}catch(se){console.error("Error fetching tags:",se)}},[]),U=y.useCallback(async se=>{try{E(!0);const Q=await Ue(`/market/servers/${se}`);return Q&&Q.success&&Q.data?(D(Q.data),Q.data):(console.error("Invalid server data format:",Q),N(a("market.serverNotFound")),null)}catch(Q){return console.error(`Error fetching server ${se}:`,Q),N(Q instanceof Error?Q.message:String(Q)),null}finally{E(!1)}},[a]),oe=y.useCallback(async se=>{try{if(E(!0),R(se),!se.trim()){X();return}const Q=await Ue(`/market/servers/search?query=${encodeURIComponent(se)}`);Q&&Q.success&&Array.isArray(Q.data)?(c(Q.data),L(1),H(Q.data,1)):(console.error("Invalid search results format:",Q),N(a("market.searchError")))}catch(Q){console.error("Error searching servers:",Q),N(Q instanceof Error?Q.message:String(Q))}finally{E(!1)}},[a,o,H,X]),V=y.useCallback(async se=>{try{if(E(!0),b(se),w(""),!se){X();return}const Q=await Ue(`/market/categories/${encodeURIComponent(se)}`);Q&&Q.success&&Array.isArray(Q.data)?(c(Q.data),L(1),H(Q.data,1)):(console.error("Invalid category filter results format:",Q),N(a("market.filterError")))}catch(Q){console.error("Error filtering servers by category:",Q),N(Q instanceof Error?Q.message:String(Q))}finally{E(!1)}},[a,X,H]),j=y.useCallback(async se=>{try{if(E(!0),w(se),b(""),!se){X();return}const Q=await Ue(`/market/tags/${encodeURIComponent(se)}`);Q&&Q.success&&Array.isArray(Q.data)?(c(Q.data),L(1),H(Q.data,1)):(console.error("Invalid tag filter results format:",Q),N(a("market.tagFilterError")))}catch(Q){console.error("Error filtering servers by tag:",Q),N(Q instanceof Error?Q.message:String(Q))}finally{E(!1)}},[a,X,H]),M=y.useCallback(async()=>{try{const se=await Ue("/servers");if(se&&se.success&&Array.isArray(se.data)){const Q=se.data.map(ge=>ge.name);$(Q)}}catch(se){console.error("Error fetching installed servers:",se)}},[]),z=y.useCallback(se=>P.includes(se),[P]),q=y.useCallback(async(se,Q)=>{var ge,re;try{const ye=(ge=se.installations)!=null&&ge.npm?"npm":Object.keys(se.installations||{}).length>0?Object.keys(se.installations)[0]:null;if(!ye||!((re=se.installations)!=null&&re[ye]))return N(a("market.noInstallationMethod")),!1;const ue=se.installations[ye],ie={name:se.name,config:Q.type==="stdio"?{command:Q.command||ue.command||"",args:Q.args||ue.args||[],env:{...ue.env,...Q.env}}:Q},xe=await At("/servers",ie);if(!xe.success)throw new Error(xe.message||"Failed to install server");return await M(),!0}catch(ye){return console.error("Error installing server:",ye),N(ye instanceof Error?ye.message:String(ye)),!1}},[a,M]),pe=y.useCallback(se=>{fe(se),L(1),H(o,1,se)},[o,H]);return y.useEffect(()=>{X(),C(),I(),M()},[X,C,I,M]),{servers:n,allServers:o,categories:d,tags:p,selectedCategory:h,selectedTag:x,searchQuery:T,loading:O,error:A,setError:N,currentServer:S,fetchMarketServers:X,fetchServerByName:U,searchServers:oe,filterByCategory:V,filterByTag:j,installServer:q,currentPage:B,totalPages:G,serversPerPage:Y,changePage:Z,changeServersPerPage:pe,isServerInstalled:z}},nj=()=>{const{t:a}=Ce(),[n,l]=y.useState([]),[o,c]=y.useState([]),[d,m]=y.useState([]),[p,g]=y.useState([]),[h,b]=y.useState(""),[x,w]=y.useState(""),[T,R]=y.useState(""),[O,E]=y.useState(!0),[A,N]=y.useState(null),[S,D]=y.useState(null),[P,$]=y.useState(1),[B,L]=y.useState(9),[Y,fe]=y.useState(1),G=y.useCallback(async()=>{try{E(!0);const z=await Ue("/cloud/servers");z&&z.success&&Array.isArray(z.data)?(c(z.data),K(z.data,P)):(console.error("Invalid cloud market servers data format:",z),N(a("cloud.fetchError")))}catch(z){console.error("Error fetching cloud market servers:",z);const q=z instanceof Error?z.message:String(z);q==="MCPROUTER_API_KEY_NOT_CONFIGURED"||q.toLowerCase().includes("mcprouter api key not configured"),N(q)}finally{E(!1)}},[a]),K=y.useCallback((z,q,pe=B)=>{const se=z.length,Q=Math.ceil(se/pe);fe(Q);const ge=Math.max(1,Math.min(q,Q));ge!==q&&$(ge);const re=(ge-1)*pe,ye=z.slice(re,re+pe);l(ye)},[B]),X=y.useCallback(z=>{$(z),K(o,z,B)},[o,K,B]),H=y.useCallback(async()=>{try{const z=await Ue("/cloud/categories");z&&z.success&&Array.isArray(z.data)?m(z.data):console.error("Invalid cloud market categories data format:",z)}catch(z){console.error("Error fetching cloud market categories:",z)}},[]),Z=y.useCallback(async()=>{try{const z=await Ue("/cloud/tags");z&&z.success&&Array.isArray(z.data)?g(z.data):console.error("Invalid cloud market tags data format:",z)}catch(z){console.error("Error fetching cloud market tags:",z)}},[]),C=y.useCallback(async z=>{try{E(!0);const q=await Ue(`/cloud/servers/${z}`);return q&&q.success&&q.data?(D(q.data),q.data):(console.error("Invalid cloud server data format:",q),N(a("cloud.serverNotFound")),null)}catch(q){console.error(`Error fetching cloud server ${z}:`,q);const pe=q instanceof Error?q.message:String(q);return pe==="MCPROUTER_API_KEY_NOT_CONFIGURED"||pe.toLowerCase().includes("mcprouter api key not configured"),N(pe),null}finally{E(!1)}},[a]),I=y.useCallback(async z=>{try{if(E(!0),R(z),!z.trim()){G();return}const q=await Ue(`/cloud/servers/search?query=${encodeURIComponent(z)}`);q&&q.success&&Array.isArray(q.data)?(c(q.data),$(1),K(q.data,1)):(console.error("Invalid cloud search results format:",q),N(a("cloud.searchError")))}catch(q){console.error("Error searching cloud servers:",q),N(q instanceof Error?q.message:String(q))}finally{E(!1)}},[a,o,K,G]),U=y.useCallback(async z=>{try{if(E(!0),b(z),w(""),!z){G();return}const q=await Ue(`/cloud/categories/${encodeURIComponent(z)}`);q&&q.success&&Array.isArray(q.data)?(c(q.data),$(1),K(q.data,1)):(console.error("Invalid cloud category filter results format:",q),N(a("cloud.filterError")))}catch(q){console.error("Error filtering cloud servers by category:",q),N(q instanceof Error?q.message:String(q))}finally{E(!1)}},[a,G,K]),oe=y.useCallback(async z=>{try{if(E(!0),w(z),b(""),!z){G();return}const q=await Ue(`/cloud/tags/${encodeURIComponent(z)}`);q&&q.success&&Array.isArray(q.data)?(c(q.data),$(1),K(q.data,1)):(console.error("Invalid cloud tag filter results format:",q),N(a("cloud.tagFilterError")))}catch(q){console.error("Error filtering cloud servers by tag:",q),N(q instanceof Error?q.message:String(q))}finally{E(!1)}},[a,G,K]),V=y.useCallback(async z=>{try{const q=await Ue(`/cloud/servers/${z}/tools`);if(!q.success)throw console.error("Failed to fetch cloud server tools:",q),new Error(q.message||"Failed to fetch cloud server tools");return q&&q.success&&Array.isArray(q.data)?q.data:(console.error("Invalid cloud server tools data format:",q),[])}catch(q){console.error(`Error fetching tools for cloud server ${z}:`,q);const pe=q instanceof Error?q.message:String(q);if(pe==="MCPROUTER_API_KEY_NOT_CONFIGURED"||pe.toLowerCase().includes("mcprouter api key not configured"))throw q;return[]}},[]),j=y.useCallback(async(z,q,pe)=>{try{const se=await At(`/cloud/servers/${encodeURIComponent(z)}/tools/${encodeURIComponent(q)}/call`,{arguments:pe});if(se&&se.success)return se.data;throw new Error(se.message||"Failed to call tool")}catch(se){throw console.error(`Error calling tool ${q} on cloud server ${z}:`,se),se}},[]),M=y.useCallback(z=>{L(z),$(1),K(o,1,z)},[o,K]);return y.useEffect(()=>{G(),H(),Z()},[G,H,Z]),{servers:n,allServers:o,categories:d,tags:p,selectedCategory:h,selectedTag:x,searchQuery:T,loading:O,error:A,setError:N,currentServer:S,fetchCloudServers:G,fetchServerByName:C,searchServers:I,filterByCategory:U,filterByTag:oe,fetchServerTools:V,callServerTool:j,currentPage:P,totalPages:Y,serversPerPage:B,changePage:X,changeServersPerPage:M}},lj=()=>{const{t:a}=Ce(),[n,l]=y.useState([]),[o,c]=y.useState([]),[d,m]=y.useState(!0),[p,g]=y.useState(null),[h,b]=y.useState(""),[x,w]=y.useState(1),[T,R]=y.useState(9),[O,E]=y.useState(null),[A,N]=y.useState(!1),[S,D]=y.useState([]),[P]=y.useState(1),$=y.useCallback(async(C,I)=>{try{m(!0),g(null);const U=new URLSearchParams;U.append("limit",T.toString()),C&&U.append("cursor",C);const oe=I!==void 0?I:h;oe.trim()&&U.append("search",oe.trim());const V=await Ue(`/registry/servers?${U.toString()}`);if(V&&V.success&&V.data){const j=V.data;if(j.servers&&Array.isArray(j.servers)){l(j.servers);const M=j.metadata.count===T&&!!j.metadata.nextCursor;N(M),E(j.metadata.nextCursor||null),c(C?z=>[...z,...j.servers]:j.servers)}else console.error("Invalid registry servers data format:",j),g(a("registry.fetchError"))}else g(a("registry.fetchError"))}catch(U){console.error("Error fetching registry servers:",U);const oe=U instanceof Error?U.message:String(U);g(oe)}finally{m(!1)}},[a,T]),B=y.useCallback(async()=>{if(!A||!O)return;const C=S[S.length-1]||"";D(I=>[...I,C]),w(I=>I+1),await $(O,h)},[A,O,S,h,$]),L=y.useCallback(async()=>{if(x<=1)return;const C=[...S];C.pop();const I=C[C.length-1];D(C),w(U=>U-1),await $(I||void 0,h)},[x,S,h,$]),Y=y.useCallback(async C=>{C!==x&&(C>x&&A?await B():C<x&&x>1&&await L())},[x,A,B,L]),fe=y.useCallback(async C=>{R(C),w(1),D([]),c([]),await $(void 0,h)},[h,$]),G=y.useCallback(async C=>{try{m(!0),g(null);const I=encodeURIComponent(C),U=await Ue(`/registry/servers/${I}/versions`);if(U&&U.success&&U.data){const oe=U.data;return oe.servers&&Array.isArray(oe.servers)&&oe.servers.length>0?oe.servers[0]:(console.error("Invalid registry server data format:",oe),g(a("registry.serverNotFound")),null)}else return g(a("registry.serverNotFound")),null}catch(I){console.error(`Error fetching registry server ${C}:`,I);const U=I instanceof Error?I.message:String(I);return g(U),null}finally{m(!1)}},[a]),K=y.useCallback(async C=>{try{g(null);const I=encodeURIComponent(C),U=await Ue(`/registry/servers/${I}/versions`);if(U&&U.success&&U.data){const oe=U.data;return oe.servers&&Array.isArray(oe.servers)?oe.servers:(console.error("Invalid registry server versions data format:",oe),[])}else return[]}catch(I){console.error(`Error fetching versions for server ${C}:`,I);const U=I instanceof Error?I.message:String(I);return g(U),[]}},[]),X=y.useCallback(async(C,I)=>{try{g(null);const U=encodeURIComponent(C),oe=encodeURIComponent(I),V=await Ue(`/registry/servers/${U}/versions/${oe}`);if(V&&V.success&&V.data){const j=V.data;return j&&j.server?j:(console.error("Invalid registry server version data format:",j),null)}else return null}catch(U){console.error(`Error fetching version ${I} for server ${C}:`,U);const oe=U instanceof Error?U.message:String(U);return g(oe),null}},[]),H=y.useCallback(async C=>{console.log("Searching registry servers with query:",C),b(C),w(1),D([]),c([]),await $(void 0,C)},[$]),Z=y.useCallback(async()=>{b(""),w(1),D([]),c([]),await $(void 0,"")},[$]);return y.useEffect(()=>{$(void 0,h)},[]),{servers:n,allServers:o,loading:d,error:p,setError:g,searchQuery:h,searchServers:H,clearSearch:Z,fetchServerByName:G,fetchServerVersions:K,fetchServerVersion:X,currentPage:x,totalPages:P,hasNextPage:A,hasPreviousPage:x>1,changePage:Y,goToNextPage:B,goToPreviousPage:L,serversPerPage:T,changeServersPerPage:fe}},ij=({server:a,onClick:n})=>{var g,h,b,x;const{t:l}=Ce(),o=w=>w.split(" ").map(T=>T.charAt(0)).join("").toUpperCase().slice(0,2),c=()=>{if(!a.tags||a.tags.length===0)return{tagsToShow:[],hasMore:!1,moreCount:0};const w=28,T=S=>S.length+3;let R=0,O=0;const E=[...a.tags].sort((S,D)=>S.length-D.length);for(O=0;O<E.length;O++){const S=T(E[O]);if(R+S>w)break;if(R+=S,O===E.length-1)return{tagsToShow:E,hasMore:!1,moreCount:0}}O===0&&E.length>0&&(O=1);const A=E.length-O,N=3+String(A).length+l("market.moreTags").length;return R+N<=w||O<1?{tagsToShow:E.slice(0,O),hasMore:!0,moreCount:A}:{tagsToShow:E.slice(0,Math.max(1,O-1)),hasMore:!0,moreCount:A+1}},{tagsToShow:d,hasMore:m,moreCount:p}=c();return r.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-4 hover:shadow-lg hover:border-blue-400 hover:-translate-y-1 transition-all duration-300 cursor-pointer group relative overflow-hidden h-full flex flex-col",onClick:()=>n(a),children:[r.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-blue-50/0 to-purple-50/0 group-hover:from-blue-50/30 group-hover:to-purple-50/30 transition-all duration-300 pointer-events-none"}),r.jsxs("div",{className:"relative z-10 flex-1 flex flex-col",children:[r.jsxs("div",{className:"flex items-start justify-between mb-2",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx("h3",{className:"text-lg font-bold text-gray-900 group-hover:text-blue-600 transition-colors duration-200 mb-1 line-clamp-1 mr-2",children:a.display_name}),r.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[r.jsx("div",{className:"w-6 h-6 bg-gradient-to-br from-blue-500 to-purple-600 rounded-full flex items-center justify-center text-white text-xs font-semibold",children:o(((g=a.author)==null?void 0:g.name)||l("market.unknown"))}),r.jsx("div",{children:r.jsx("p",{className:"text-xs font-medium text-gray-700",children:((h=a.author)==null?void 0:h.name)||l("market.unknown")})})]})]}),r.jsx("div",{className:"flex flex-col items-end space-y-2",children:a.is_official&&r.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:l("market.official")})})]}),r.jsx("div",{className:"mb-2 flex-1",children:r.jsx("p",{className:"text-gray-600 text-sm leading-relaxed line-clamp-2 min-h-[36px]",children:a.description})}),r.jsx("div",{className:"mb-2",children:r.jsx("div",{className:"flex flex-wrap gap-1 min-h-[24px]",children:((b=a.categories)==null?void 0:b.length)>0?a.categories.map((w,T)=>r.jsx("span",{className:"bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded whitespace-nowrap",children:w},T)):r.jsx("span",{className:"text-xs text-gray-400 py-1",children:"-"})})}),r.jsx("div",{className:"mb-2",children:r.jsx("div",{className:"relative min-h-[24px] overflow-x-auto",children:((x=a.tags)==null?void 0:x.length)>0?r.jsxs("div",{className:"flex gap-1 items-center whitespace-nowrap",children:[d.map((w,T)=>r.jsxs("span",{className:"bg-green-50 text-green-700 text-xs px-2 py-1 rounded flex-shrink-0",children:["#",w]},T)),m&&r.jsxs("span",{className:"bg-gray-100 text-gray-600 text-xs px-1.5 py-1 rounded flex-shrink-0",children:["+",p," ",l("market.moreTags")]})]}):r.jsx("span",{className:"text-xs text-gray-400 py-1",children:"-"})})})]})]})},oj=({server:a,onBack:n,onInstall:l,installing:o=!1,isInstalled:c=!1})=>{var Y,fe,G;const{t:d}=Ce(),[m,p]=y.useState(!1),[g,h]=y.useState(null),[b,x]=y.useState(!1),[w,T]=y.useState(null),[R,O]=y.useState([]),E=()=>c?{className:"bg-green-600 cursor-default px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:d("market.installed")}:o?{className:"bg-gray-400 cursor-not-allowed px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:d("market.installing")}:{className:"bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded text-sm font-medium text-white btn-primary",disabled:!1,text:d("market.install")},A=()=>{p(!m),h(null),x(!1),T(null)},N=async()=>{w&&(await S(w),x(!1),T(null))},S=async K=>{try{h(null),l(a,K.config),p(!1)}catch(X){console.error("Error installing server:",X),h(d("errors.serverInstall"))}},D=()=>{c||A()},P=()=>{if(!a.installations)return;if(a.installations.npm)return a.installations.npm;if(a.installations.uvx)return a.installations.uvx;if(a.installations.default)return a.installations.default;const K=Object.keys(a.installations);if(K.length>0)return a.installations[K[0]]},$=async K=>{try{const X=R0(K);X.length>0?(O(X),T(K),x(!0)):await S(K)}catch(X){console.error("Error processing server installation:",X),h(d("errors.serverInstall"))}},B=E(),L=P();return r.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6",children:[r.jsx("div",{className:"mb-4",children:r.jsxs("button",{onClick:n,className:"text-gray-600 hover:text-gray-900 flex items-center",children:[r.jsx("svg",{className:"h-5 w-5 mr-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z",clipRule:"evenodd"})}),d("market.backToList")]})}),r.jsxs("div",{className:"flex justify-between items-start mb-4",children:[r.jsx("div",{children:r.jsxs("h2",{className:"text-2xl font-bold text-gray-900 flex items-center flex-wrap",children:[a.display_name,r.jsxs("span",{className:"text-sm font-normal text-gray-500 ml-2",children:["(",a.name,")"]}),r.jsxs("span",{className:"text-sm font-normal text-gray-600 ml-4",children:[d("market.author"),": ",((Y=a.author)==null?void 0:Y.name)||d("market.unknown")," •"," ",d("market.license"),": ",a.license," •",r.jsx("a",{href:a.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:underline ml-1",children:d("market.repository")})]})]})}),r.jsxs("div",{className:"flex items-center",children:[a.is_official&&r.jsx("span",{className:"bg-blue-100 text-blue-800 text-sm font-normal px-4 py-2 rounded mr-2 flex items-center label-primary",children:d("market.official")}),r.jsx("button",{onClick:D,disabled:B.disabled,className:B.className,children:B.text})]})]}),r.jsx("p",{className:"text-gray-700 mb-6",children:a.description}),r.jsxs("div",{className:"mb-6",children:[r.jsxs("h3",{className:"text-lg font-semibold mb-3",children:[d("market.categories")," & ",d("market.tags")]}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[(fe=a.categories)==null?void 0:fe.map((K,X)=>r.jsx("span",{className:"bg-gray-100 text-gray-800 px-3 py-1 rounded",children:K},`cat-${X}`)),a.tags&&a.tags.map((K,X)=>r.jsxs("span",{className:"bg-gray-100 text-green-700 px-2 py-1 rounded text-sm",children:["#",K]},`tag-${X}`))]})]}),a.arguments&&Object.keys(a.arguments).length>0&&r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:"text-lg font-semibold mb-3",children:d("market.arguments")}),r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[r.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:r.jsxs("tr",{children:[r.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:d("market.argumentName")}),r.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:d("market.description")}),r.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:d("market.required")}),r.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider whitespace-nowrap",children:d("market.example")})]})}),r.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:Object.entries(a.arguments).map(([K,X],H)=>r.jsxs("tr",{children:[r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:K}),r.jsx("td",{className:"px-6 py-4 text-sm text-gray-500",children:X.description}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:X.required?r.jsx("span",{className:"text-green-600",children:"✓"}):r.jsx("span",{className:"text-gray-600",children:"✗"})}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:r.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:X.example})})]},H))})]})})]}),r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:"text-lg font-semibold mb-3",children:d("market.tools")}),r.jsx("div",{className:"space-y-4",children:(G=a.tools)==null?void 0:G.map((K,X)=>r.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[r.jsxs("h4",{className:"font-medium mb-2",children:[K.name,r.jsx("button",{type:"button",onClick:()=>{const H=document.getElementById(`schema-${X}`);H&&H.classList.toggle("hidden")},className:"text-sm text-blue-500 font-normal hover:underline focus:outline-none ml-2",children:d("market.viewSchema")})]}),r.jsx("p",{className:"text-gray-600 mb-2",children:K.description}),r.jsx("div",{className:"mt-2",children:r.jsx("pre",{id:`schema-${X}`,className:"hidden bg-gray-50 p-3 rounded text-sm overflow-auto mt-2",children:JSON.stringify(K.inputSchema,null,2)})})]},X))})]}),a.examples&&a.examples.length>0&&r.jsxs("div",{className:"mb-6",children:[r.jsx("h3",{className:"text-lg font-semibold mb-3",children:d("market.examples")}),r.jsx("div",{className:"space-y-4",children:a.examples.map((K,X)=>r.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[r.jsx("h4",{className:"font-medium mb-2",children:K.title}),r.jsx("p",{className:"text-gray-600 mb-2",children:K.description}),r.jsx("pre",{className:"bg-gray-50 p-3 rounded text-sm overflow-auto",children:K.prompt})]},X))})]}),r.jsx("div",{className:"mt-6 flex justify-end",children:r.jsx("button",{onClick:D,disabled:B.disabled,className:B.className,children:B.text})}),m&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx(Ml,{onSubmit:$,onCancel:A,modalTitle:d("market.installServer",{name:a.display_name}),formError:g,initialData:{name:a.name,status:"disconnected",config:L?{command:L.command||"",args:L.args||[],env:L.env||{}}:void 0}})}),b&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-[60] flex items-center justify-center p-4",children:r.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-md",children:[r.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:d("server.confirmVariables")}),r.jsx("p",{className:"text-gray-600 mb-4",children:d("server.variablesDetected")}),r.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded p-3 mb-4",children:r.jsxs("div",{className:"flex items-start",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),r.jsxs("div",{className:"ml-3",children:[r.jsxs("h4",{className:"text-sm font-medium text-yellow-800",children:[d("server.detectedVariables"),":"]}),r.jsx("ul",{className:"mt-1 text-sm text-yellow-700",children:R.map((K,X)=>r.jsxs("li",{className:"font-mono",children:["$",`{${K}}`]},X))})]})]})}),r.jsx("p",{className:"text-gray-600 text-sm mb-6",children:d("market.confirmVariablesMessage")}),r.jsxs("div",{className:"flex justify-end space-x-3",children:[r.jsx("button",{onClick:()=>{x(!1),T(null)},className:"px-4 py-2 text-gray-600 border border-gray-300 rounded hover:bg-gray-50 btn-secondary",children:d("common.cancel")}),r.jsx("button",{onClick:N,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 btn-primary",children:d("market.confirmAndInstall")})]})]})})]})},cj=({server:a,onClick:n})=>{const{t:l}=Ce(),o=()=>{n(a)},c=()=>{if(a.description&&a.description.length<=150)return a.description;if(a.content){const p=a.content.split(`
293
+ `).filter(g=>g.trim());for(const g of p)if(g.length>50&&g.length<=150)return g}return a.description?a.description.slice(0,150)+"...":l("cloud.noDescription")},d=p=>{try{const g=new Date(p),h=g.getFullYear(),b=(g.getMonth()+1).toString().padStart(2,"0"),x=g.getDate().toString().padStart(2,"0");return`${h}/${b}/${x}`}catch{return""}},m=p=>p.split(" ").map(g=>g.charAt(0)).join("").toUpperCase().slice(0,2);return r.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-4 hover:shadow-lg hover:border-blue-400 hover:-translate-y-1 transition-all duration-300 cursor-pointer group relative overflow-hidden h-full flex flex-col",onClick:o,children:[r.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-blue-50/0 to-purple-50/0 group-hover:from-blue-50/30 group-hover:to-purple-50/30 transition-all duration-300 pointer-events-none"}),r.jsxs("div",{className:"relative z-10 flex-1 flex flex-col",children:[r.jsxs("div",{className:"flex items-start justify-between mb-3",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx("h3",{className:"text-lg font-bold text-gray-900 group-hover:text-blue-600 transition-colors duration-200 mb-2 line-clamp-2",children:a.title||a.name}),r.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[r.jsx("div",{className:"w-7 h-7 bg-gradient-to-br from-blue-500 to-purple-600 rounded-full flex items-center justify-center text-white text-xs font-semibold",children:m(a.author_name)}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-medium text-gray-700",children:a.author_name}),a.updated_at&&r.jsxs("p",{className:"text-xs text-gray-500",children:[l("cloud.updated")," ",d(a.updated_at)]})]})]})]}),r.jsx("div",{className:"flex flex-col items-end space-y-2",children:r.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:"MCP Server"})})]}),r.jsx("div",{className:"mb-3 flex-1",children:r.jsx("p",{className:"text-gray-600 text-sm leading-relaxed line-clamp-2",children:c()})}),a.tools&&a.tools.length>0&&r.jsx("div",{className:"mb-3",children:r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsxs("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),r.jsxs("span",{className:"text-sm text-gray-600 font-medium",children:[a.tools.length," ",a.tools.length===1?l("cloud.tool"):l("cloud.tools")]})]})}),r.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-gray-100 mt-auto",children:[r.jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500",children:[r.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"})}),r.jsx("span",{children:d(a.created_at)})]}),r.jsxs("div",{className:"flex items-center text-blue-600 text-sm font-medium group-hover:text-blue-700 transition-colors",children:[r.jsx("span",{children:l("cloud.viewDetails")}),r.jsx("svg",{className:"w-4 h-4 ml-1 transform group-hover:translate-x-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]})]})},nd=()=>{const{t:a}=Ce(),n=la(),l=()=>{n("/settings")},o=()=>{window.open("https://mcprouter.co","_blank","noopener,noreferrer")};return r.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-6 mb-6",children:r.jsxs("div",{className:"flex items-start",children:[r.jsx("div",{className:"flex-shrink-0",children:r.jsx("svg",{className:"h-5 w-5 text-amber-400",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),r.jsxs("div",{className:"ml-3 flex-1",children:[r.jsx("h3",{className:"text-sm font-medium text-amber-800",children:a("cloud.apiKeyNotConfigured")}),r.jsx("div",{className:"mt-2 text-sm text-amber-700",children:r.jsx("p",{children:a("cloud.apiKeyNotConfiguredDescription")})}),r.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[r.jsxs("button",{onClick:o,className:"inline-flex items-center px-3 py-2 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors duration-200",children:[r.jsx("svg",{className:"w-4 h-4 mr-1.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),a("cloud.getApiKey")]}),r.jsxs("button",{onClick:l,className:"inline-flex items-center px-3 py-2 text-sm font-medium text-amber-800 bg-amber-100 border border-amber-300 rounded-md hover:bg-amber-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-amber-500 transition-colors duration-200",children:[r.jsxs("svg",{className:"w-4 h-4 mr-1.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),a("cloud.configureInSettings")]})]})]})]})})},uj=({serverName:a,onBack:n,onCallTool:l,fetchServerTools:o,onInstall:c,installing:d=!1,isInstalled:m=!1})=>{const{t:p}=Ce(),{mcpRouterConfig:g}=zs(),[h,b]=y.useState(null),[x,w]=y.useState(!0),[T,R]=y.useState(null),[O,E]=y.useState([]),[A,N]=y.useState(!1),[S,D]=y.useState(!1),[P,$]=y.useState(null),[B,L]=y.useState({}),[Y,fe]=y.useState({}),[G,K]=y.useState({}),[X,H]=y.useState(!1),[Z,C]=y.useState(null),I=Q=>(console.error("Checking for MCPRouter API key error:",Q),Q==="MCPROUTER_API_KEY_NOT_CONFIGURED"||Q.toLowerCase().includes("mcprouter api key not configured")),U=()=>m?{className:"bg-green-600 cursor-default px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:p("market.installed")}:d?{className:"bg-gray-400 cursor-not-allowed px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:p("market.installing")}:{className:"bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded text-sm font-medium text-white transition-colors",disabled:!1,text:p("market.install")},oe=()=>{!m&&c&&(H(!0),C(null))},V=()=>{H(!1),C(null)},j=async Q=>{try{if(!h||!c)return;C(null),c(h,Q.config),H(!1)}catch(ge){console.error("Error installing server:",ge),C(p("errors.serverInstall"))}};y.useEffect(()=>{(async()=>{try{w(!0),R(null);const ge=await Ue(`/cloud/servers/${a}`);ge&&ge.success&&ge.data?(b(ge.data),E(ge.data.tools||[])):R(p("cloud.serverNotFound"))}catch(ge){console.error("Failed to load server details:",ge),R(ge instanceof Error?ge.message:String(ge))}finally{w(!1)}})()},[a,p]),y.useEffect(()=>{(async()=>{if(h&&(!h.tools||h.tools.length===0)&&o){N(!0),D(!1);try{const ge=await o(h.name);E(ge)}catch(ge){console.error("Failed to load tools:",ge);const re=ge instanceof Error?ge.message:String(ge);I(re)&&D(!0)}finally{N(!1)}}})()},[h==null?void 0:h.name,h==null?void 0:h.tools,o]);const M=Q=>{try{const ge=new Date(Q),re=ge.getFullYear(),ye=String(ge.getMonth()+1).padStart(2,"0"),ue=String(ge.getDate()).padStart(2,"0"),ie=String(ge.getHours()).padStart(2,"0"),xe=String(ge.getMinutes()).padStart(2,"0"),Xe=String(ge.getSeconds()).padStart(2,"0");return`${re}-${ye}-${ue} ${ie}:${xe}:${Xe}`}catch{return Q}},z=(Q,ge,re)=>{fe(ye=>({...ye,[Q]:{...ye[Q],[ge]:re}}))},q=async Q=>{if(!(!l||!h)){$(Q);try{const ge=Y[Q]||{},re=await l(h.server_key,Q,ge);L(ye=>({...ye,[Q]:re}))}catch(ge){console.error("Tool call failed:",ge);const re=ge instanceof Error?ge.message:String(ge);L(ye=>({...ye,[Q]:{error:re}}))}finally{$(null)}}},pe=Q=>{K(ge=>({...ge,[Q]:!ge[Q]}))},se=(Q,ge,re)=>{var ie;const ye=((ie=Y[Q.name])==null?void 0:ie[ge])||"",ue=xe=>{let Xe=xe.target.value;re.type==="number"||re.type==="integer"?Xe=Xe===""?void 0:Number(Xe):re.type==="boolean"&&(Xe=xe.target.value==="true"),z(Q.name,ge,Xe)};return re.type==="boolean"?r.jsxs("select",{value:ye===!0?"true":ye===!1?"false":"",onChange:ue,className:"w-full border rounded-md px-3 py-2 border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 form-input",children:[r.jsx("option",{value:""}),r.jsx("option",{value:"true",children:p("common.true")}),r.jsx("option",{value:"false",children:p("common.false")})]}):re.type==="number"||re.type==="integer"?r.jsx("input",{type:"number",step:re.type==="integer"?"1":"any",value:ye||"",onChange:ue,className:"w-full border rounded-md px-3 py-2 border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 form-input"}):r.jsx("input",{type:"text",value:ye||"",onChange:ue,className:"w-full border rounded-md px-3 py-2 border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500 form-input"})};return r.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6",children:[r.jsx("div",{className:"mb-6",children:r.jsxs("button",{onClick:n,className:"inline-flex items-center text-gray-600 hover:text-gray-900 transition-colors group",children:[r.jsx("svg",{className:"h-5 w-5 mr-2 transform group-hover:-translate-x-1 transition-transform",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M9.707 16.707a1 1 0 01-1.414 0l-6-6a1 1 0 010-1.414l6-6a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l4.293 4.293a1 1 0 010 1.414z",clipRule:"evenodd"})}),p("cloud.backToList")]})}),x?r.jsx("div",{className:"bg-white rounded-xl shadow-sm p-12",children:r.jsxs("div",{className:"flex flex-col items-center",children:[r.jsxs("svg",{className:"animate-spin h-12 w-12 text-blue-500 mb-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("p",{className:"text-gray-600 text-lg",children:p("app.loading")})]})}):T&&!I(T)?r.jsx("div",{className:"bg-white rounded-xl shadow-sm p-6",children:r.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:r.jsxs("div",{className:"flex items-center",children:[r.jsx("svg",{className:"h-5 w-5 text-red-400 mr-3",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),r.jsx("p",{className:"text-red-700",children:T})]})})}):h?r.jsxs("div",{className:"space-y-6",children:[r.jsx("div",{className:"bg-white rounded-xl shadow-sm overflow-hidden",children:r.jsx("div",{className:"bg-gradient-to-r from-gray-100 to-gray-200 px-6 py-4",children:r.jsxs("div",{className:"flex justify-between items-end",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-800 mb-2",children:h.title||h.name}),r.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-gray-600",children:[r.jsx("span",{className:"text-sm bg-white/60 text-gray-700 px-3 py-1 rounded-full",children:h.name}),r.jsxs("div",{className:"flex items-center",children:[r.jsx("svg",{className:"h-4 w-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",clipRule:"evenodd"})}),p("cloud.by")," ",h.author_name]})]})]}),r.jsxs("div",{className:"text-right flex flex-col items-end gap-3",children:[r.jsxs("div",{className:"text-xs text-gray-500",children:[p("cloud.updated"),": ",M(h.updated_at)]}),c&&!I(T||"")&&!S&&r.jsx("button",{onClick:oe,disabled:U().disabled,className:U().className,children:U().text})]})]})})}),r.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6",children:[r.jsxs("h2",{className:"text-xl font-semibold text-gray-900 mb-4 flex items-center",children:[r.jsx("svg",{className:"h-5 w-5 text-gray-500 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),p("cloud.description")]}),r.jsx("p",{className:"text-gray-700 leading-relaxed",children:h.description})]}),h.content&&r.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6",children:[r.jsxs("h2",{className:"text-xl font-semibold text-gray-900 mb-4 flex items-center",children:[r.jsx("svg",{className:"h-5 w-5 text-gray-500 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})}),p("cloud.details")]}),r.jsx("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4 overflow-auto",children:r.jsx("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:h.content})})]}),r.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6",children:[r.jsxs("h2",{className:"text-xl font-semibold text-gray-900 mb-4 flex items-center",children:[r.jsxs("svg",{className:"h-5 w-5 text-gray-500 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),p("cloud.tools"),O.length>0&&r.jsx("span",{className:"ml-2 bg-blue-100 text-blue-800 text-sm font-medium px-2.5 py-0.5 rounded-full",children:O.length})]}),S&&r.jsx(nd,{}),A?r.jsxs("div",{className:"flex items-center justify-center py-12",children:[r.jsxs("svg",{className:"animate-spin h-8 w-8 text-blue-500 mr-3",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("span",{className:"text-gray-600",children:p("cloud.loadingTools")})]}):O.length===0&&!S?r.jsxs("div",{className:"text-center py-12",children:[r.jsx("svg",{className:"h-12 w-12 text-gray-400 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})}),r.jsx("p",{className:"text-gray-600",children:p("cloud.noTools")})]}):O.length>0?r.jsx("div",{className:"space-y-4",children:O.map((Q,ge)=>r.jsxs("div",{className:"border border-gray-200 rounded-lg p-6 hover:border-gray-300 transition-colors",children:[r.jsxs("div",{className:"flex justify-between items-start mb-4",children:[r.jsxs("div",{className:"flex-1",children:[r.jsxs("h3",{className:"text-lg font-medium text-gray-900 mb-2 flex items-center",children:[r.jsx("span",{className:"bg-blue-100 text-blue-800 text-xs font-medium px-2 py-1 rounded mr-3",children:"TOOL"}),Q.name]}),r.jsx("p",{className:"text-gray-600 leading-relaxed whitespace-pre-wrap",children:Q.description})]}),l&&r.jsx("button",{onClick:()=>q(Q.name),disabled:P===Q.name,className:"ml-4 bg-blue-600 text-white px-4 py-2 rounded-lg hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center min-w-[100px] justify-center",children:P===Q.name?r.jsxs(r.Fragment,{children:[r.jsxs("svg",{className:"animate-spin h-4 w-4 mr-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),p("cloud.calling")]}):r.jsxs(r.Fragment,{children:[r.jsx("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.828 14.828a4 4 0 01-5.656 0M9 10h6m2 8l4-4H7l4 4z"})}),p("cloud.callTool")]})})]}),Q.inputSchema&&Q.inputSchema.properties&&Object.keys(Q.inputSchema.properties).length>0&&r.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[r.jsx("h4",{className:"text-sm font-medium text-gray-700",children:p("cloud.parameters")}),r.jsxs("button",{onClick:()=>pe(Q.name),className:"text-sm text-blue-600 hover:text-blue-800 focus:outline-none flex items-center gap-1 transition-colors",children:[p("cloud.viewSchema"),r.jsx("svg",{className:`h-3 w-3 transition-transform duration-200 ${G[Q.name]?"rotate-90":"rotate-0"}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})})]})]}),G[Q.name]&&r.jsx("div",{className:"mb-4",children:r.jsx("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-3 overflow-auto",children:r.jsx("pre",{className:"text-sm text-gray-800",children:JSON.stringify(Q.inputSchema,null,2)})})}),r.jsx("div",{className:"space-y-4",children:Object.entries(Q.inputSchema.properties).map(([re,ye])=>{var ue;return r.jsxs("div",{className:"space-y-2",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700",children:[re,((ue=Q.inputSchema.required)==null?void 0:ue.includes(re))&&r.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),ye.description&&r.jsx("p",{className:"text-xs text-gray-500",children:ye.description}),se(Q,re,ye)]},re)})})]}),B[Q.name]&&r.jsx("div",{className:"border-t border-gray-100 pt-4 mt-4",children:B[Q.name].error?r.jsx(r.Fragment,{children:I(B[Q.name].error)?r.jsx(nd,{}):r.jsxs(r.Fragment,{children:[r.jsxs("h4",{className:"text-sm font-medium text-red-600 mb-3 flex items-center",children:[r.jsx("svg",{className:"h-4 w-4 text-red-500 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})}),p("cloud.error")]}),r.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:r.jsx("pre",{className:"text-sm text-red-800 whitespace-pre-wrap overflow-auto",children:B[Q.name].error})})]})}):r.jsxs(r.Fragment,{children:[r.jsxs("h4",{className:"text-sm font-medium text-gray-700 mb-3 flex items-center",children:[r.jsx("svg",{className:"h-4 w-4 text-green-500 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})}),p("cloud.result")]}),r.jsx("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4",children:r.jsx("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap overflow-auto",children:JSON.stringify(B[Q.name],null,2)})})]})})]},ge))}):null]})]}):r.jsx("div",{className:"bg-white rounded-xl shadow-sm p-12",children:r.jsxs("div",{className:"text-center",children:[r.jsx("svg",{className:"h-12 w-12 text-gray-400 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M9.172 16.172a4 4 0 015.656 0M9 12h6m-6-4h6m2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})}),r.jsx("p",{className:"text-gray-600 text-lg",children:p("cloud.serverNotFound")})]})}),X&&h&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx(Ml,{onSubmit:j,onCancel:V,modalTitle:p("cloud.installServer",{name:h.title||h.name}),formError:Z,initialData:{name:h.name,status:"disconnected",config:{type:"streamable-http",url:h.server_url,headers:{Authorization:`Bearer ${g.apiKey||"<MCPROUTER_API_KEY>"}`,"HTTP-Referer":g.referer||"<YOUR_APP_URL>","X-Title":g.title||"<YOUR_APP_NAME>"}}}})})]})},dj=({serverEntry:a,onClick:n})=>{var A,N;const{t:l}=Ce(),{server:o,_meta:c}=a,d=()=>{n(a)},m=()=>o.description&&o.description.length<=150?o.description:o.description?o.description.slice(0,150)+"...":l("registry.noDescription"),p=S=>{if(!S)return"";try{const D=new Date(S),P=D.getFullYear(),$=(D.getMonth()+1).toString().padStart(2,"0"),B=D.getDate().toString().padStart(2,"0");return`${P}/${$}/${B}`}catch{return""}},h=o.icons&&o.icons.length>0?o.icons.find(D=>!D.theme||D.theme==="light")||o.icons[0]:null,b=c==null?void 0:c["io.modelcontextprotocol.registry/official"],x=b==null?void 0:b.isLatest,w=b==null?void 0:b.publishedAt,T=b==null?void 0:b.updatedAt,R=((A=o.packages)==null?void 0:A.length)||0,O=((N=o.remotes)==null?void 0:N.length)||0,E=R+O;return r.jsxs("div",{className:"bg-white border border-gray-200 rounded-xl p-4 hover:shadow-lg hover:border-blue-400 hover:-translate-y-1 transition-all duration-300 cursor-pointer group relative overflow-hidden h-full flex flex-col",onClick:d,children:[r.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-blue-50/0 to-purple-50/0 group-hover:from-blue-50/30 group-hover:to-purple-50/30 transition-all duration-300 pointer-events-none"}),r.jsxs("div",{className:"relative z-10 flex-1 flex flex-col",children:[r.jsx("div",{className:"flex items-start justify-between mb-3",children:r.jsxs("div",{className:"flex items-start space-x-3 flex-1",children:[h?r.jsx("img",{src:h.src,alt:o.title,className:"w-12 h-12 rounded-lg object-cover flex-shrink-0",onError:S=>{S.currentTarget.style.display="none"}}):r.jsx("div",{className:"w-12 h-12 bg-gradient-to-br from-blue-500 to-purple-600 rounded-lg flex items-center justify-center text-white text-xl font-semibold flex-shrink-0",children:"M"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("h3",{className:"text-lg font-bold text-gray-900 group-hover:text-blue-600 transition-colors duration-200 mb-1 line-clamp-2",children:o.name}),r.jsxs("div",{className:"flex flex-wrap gap-1 mb-1",children:[x&&r.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800",children:l("registry.latest")}),r.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:["v",o.version]})]})]})]})}),r.jsx("div",{className:"mb-3 flex-1",children:r.jsx("p",{className:"text-gray-600 text-sm leading-relaxed line-clamp-3",children:m()})}),E>0&&r.jsx("div",{className:"mb-3",children:r.jsxs("div",{className:"flex items-center space-x-4",children:[R>0&&r.jsxs("div",{className:"flex items-center space-x-1",children:[r.jsx("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4"})}),r.jsxs("span",{className:"text-sm text-gray-600",children:[R," ",l(R===1?"registry.package":"registry.packages")]})]}),O>0&&r.jsxs("div",{className:"flex items-center space-x-1",children:[r.jsx("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"})}),r.jsxs("span",{className:"text-sm text-gray-600",children:[O," ",l(O===1?"registry.remote":"registry.remotes")]})]})]})}),r.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-gray-100 mt-auto",children:[r.jsx("div",{className:"flex items-center space-x-2 text-xs text-gray-500",children:(w||T)&&r.jsxs(r.Fragment,{children:[r.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:r.jsx("path",{fillRule:"evenodd",d:"M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",clipRule:"evenodd"})}),r.jsx("span",{children:p(T||w)})]})}),r.jsxs("div",{className:"flex items-center text-blue-600 text-sm font-medium group-hover:text-blue-700 transition-colors",children:[r.jsx("span",{children:l("registry.viewDetails")}),r.jsx("svg",{className:"w-4 h-4 ml-1 transform group-hover:translate-x-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]})]})},mj=({serverEntry:a,onBack:n,onInstall:l,installing:o=!1,isInstalled:c=!1,fetchVersions:d})=>{const{t:m}=Ce(),{server:p,_meta:g}=a,[h,b]=y.useState(p.version),[x,w]=y.useState([]),[T,R]=y.useState(!1),[O,E]=y.useState(!1),[A,N]=y.useState(null),[S,D]=y.useState(null),[P,$]=y.useState(null),[B,L]=y.useState({packages:!0,remotes:!0,repository:!0}),Y=g==null?void 0:g["io.modelcontextprotocol.registry/official"];y.useEffect(()=>{(async()=>{if(d){R(!0);try{const j=await d(p.name);w(j)}catch(j){console.error("Failed to load versions:",j)}finally{R(!1)}}})()},[p.name,d]);const G=p.icons&&p.icons.length>0?p.icons.find(j=>!j.theme||j.theme==="light")||p.icons[0]:null,K=V=>{if(!V)return"";try{return new Date(V).toLocaleDateString()}catch{return""}},X=V=>{L(j=>({...j,[V]:!j[V]}))},H=(V,j)=>{N(V),D(j),$(null),E(!0)},Z=()=>{E(!1),$(null)},C=async V=>{try{if(!l||!S||!A)return;$(null);const j=V.config;l(p,j),E(!1)}catch(j){console.error("Error installing server:",j),$(m("errors.serverInstall"))}},I=()=>{if(!S||!A)return null;if(console.log("Building initial form data for:",S),A==="package"&&"identifier"in S){const V=S,j={};V.environmentVariables&&V.environmentVariables.forEach(z=>{j[z.name]=z.default||""});const M=fj(V.registryType);return{name:p.name,status:"disconnected",config:{type:"stdio",command:M,args:pj(M,V),env:Object.keys(j).length>0?j:void 0}}}else if(A==="remote"&&"url"in S){const V=S,j={};V.headers&&V.headers.forEach(z=>{j[z.name]=z.default||z.value||""});const M=V.type==="sse"?"sse":"streamable-http";return{name:p.name,status:"disconnected",config:{type:M,url:V.url,headers:Object.keys(j).length>0?j:void 0}}}return null},U=(V,j)=>r.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 mb-3 hover:border-blue-400 transition-colors",children:[r.jsxs("div",{className:"flex items-start justify-between mb-3",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx("h4",{className:"font-medium text-gray-900",children:V.identifier}),V.version&&r.jsxs("p",{className:"text-sm text-gray-500",children:["Version: ",V.version]}),V.runtimeHint&&r.jsx("p",{className:"text-sm text-gray-600 mt-1",children:V.runtimeHint})]}),r.jsx("button",{onClick:()=>H("package",V),disabled:c||o,className:`px-4 py-2 rounded text-sm font-medium transition-colors ${c?"bg-green-600 text-white cursor-default":o?"bg-gray-400 text-white cursor-not-allowed":"bg-blue-600 text-white hover:bg-blue-700"}`,children:m(c?"registry.installed":o?"registry.installing":"registry.install")})]}),V.registryType&&r.jsxs("div",{className:"text-sm text-gray-600 mb-2",children:[r.jsx("span",{className:"font-medium",children:"Registry:"})," ",V.registryType]}),V.transport&&r.jsxs("div",{className:"text-sm text-gray-600 mb-2",children:[r.jsx("span",{className:"font-medium",children:"Transport:"})," ",V.transport.type,V.transport.url&&r.jsxs("span",{className:"ml-2 text-gray-500",children:["(",V.transport.url,")"]})]}),V.environmentVariables&&V.environmentVariables.length>0&&r.jsxs("div",{className:"mt-3 border-t border-gray-200 pt-3",children:[r.jsxs("h5",{className:"text-sm font-medium text-gray-700 mb-2",children:[m("registry.environmentVariables"),":"]}),r.jsx("div",{className:"space-y-2",children:V.environmentVariables.map((M,z)=>r.jsxs("div",{className:"text-sm",children:[r.jsxs("div",{className:"flex items-start",children:[r.jsx("span",{className:"font-mono text-gray-900 font-medium",children:M.name}),M.isRequired&&r.jsx("span",{className:"ml-2 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-red-100 text-red-800",children:m("common.required")}),M.isSecret&&r.jsx("span",{className:"ml-2 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:m("common.secret")})]}),M.description&&r.jsx("p",{className:"text-gray-600 mt-1",children:M.description}),M.default&&r.jsxs("p",{className:"text-gray-500 mt-1",children:[r.jsxs("span",{className:"font-medium",children:[m("common.default"),":"]})," ",r.jsx("span",{className:"font-mono",children:M.default})]})]},z))})]}),V.packageArguments&&V.packageArguments.length>0&&r.jsxs("div",{className:"mt-3 border-t border-gray-200 pt-3",children:[r.jsxs("h5",{className:"text-sm font-medium text-gray-700 mb-2",children:[m("registry.packageArguments"),":"]}),r.jsx("div",{className:"space-y-2",children:V.packageArguments.map((M,z)=>r.jsxs("div",{className:"text-sm",children:[r.jsxs("div",{className:"flex items-start",children:[r.jsx("span",{className:"font-mono text-gray-900 font-medium",children:M.name}),M.isRequired&&r.jsx("span",{className:"ml-2 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-red-100 text-red-800",children:m("common.required")}),M.isSecret&&r.jsx("span",{className:"ml-2 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:m("common.secret")}),M.isRepeated&&r.jsx("span",{className:"ml-2 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-purple-100 text-purple-800",children:m("common.repeated")})]}),M.description&&r.jsx("p",{className:"text-gray-600 mt-1",children:M.description}),M.type&&r.jsxs("p",{className:"text-gray-500 mt-1",children:[r.jsxs("span",{className:"font-medium",children:[m("common.type"),":"]})," ",r.jsx("span",{className:"font-mono",children:M.type})]}),M.default&&r.jsxs("p",{className:"text-gray-500 mt-1",children:[r.jsxs("span",{className:"font-medium",children:[m("common.default"),":"]})," ",r.jsx("span",{className:"font-mono",children:M.default})]}),M.value&&r.jsxs("p",{className:"text-gray-500 mt-1",children:[r.jsxs("span",{className:"font-medium",children:[m("common.value"),":"]})," ",r.jsx("span",{className:"font-mono",children:M.value})]}),M.valueHint&&r.jsxs("p",{className:"text-gray-500 mt-1",children:[r.jsxs("span",{className:"font-medium",children:[m("common.valueHint"),":"]})," ",r.jsx("span",{className:"font-mono",children:M.valueHint})]}),M.choices&&M.choices.length>0&&r.jsxs("p",{className:"text-gray-500 mt-1",children:[r.jsxs("span",{className:"font-medium",children:[m("common.choices"),":"]})," ",r.jsx("span",{className:"font-mono",children:M.choices.join(", ")})]})]},z))})]})]},j),oe=(V,j)=>r.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 mb-3 hover:border-blue-400 transition-colors",children:[r.jsxs("div",{className:"flex items-start justify-between mb-3",children:[r.jsxs("div",{className:"flex-1",children:[r.jsx("h4",{className:"font-medium text-gray-900",children:V.type}),r.jsx("p",{className:"text-sm text-gray-600 mt-1 break-all",children:V.url})]}),r.jsx("button",{onClick:()=>H("remote",V),disabled:c||o,className:`px-4 py-2 rounded text-sm font-medium transition-colors ${c?"bg-green-600 text-white cursor-default":o?"bg-gray-400 text-white cursor-not-allowed":"bg-blue-600 text-white hover:bg-blue-700"}`,children:m(c?"registry.installed":o?"registry.installing":"registry.install")})]}),V.headers&&V.headers.length>0&&r.jsxs("div",{className:"mt-3 border-t border-gray-200 pt-3",children:[r.jsxs("h5",{className:"text-sm font-medium text-gray-700 mb-2",children:[m("registry.headers"),":"]}),r.jsx("div",{className:"space-y-2",children:V.headers.map((M,z)=>r.jsxs("div",{className:"text-sm",children:[r.jsxs("div",{className:"flex items-start",children:[r.jsx("span",{className:"font-mono text-gray-900 font-medium",children:M.name}),M.isRequired&&r.jsx("span",{className:"ml-2 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-red-100 text-red-800",children:m("common.required")}),M.isSecret&&r.jsx("span",{className:"ml-2 inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-yellow-100 text-yellow-800",children:m("common.secret")})]}),M.description&&r.jsx("p",{className:"text-gray-600 mt-1",children:M.description}),M.value&&r.jsxs("p",{className:"text-gray-500 mt-1",children:[r.jsxs("span",{className:"font-medium",children:[m("common.value"),":"]})," ",r.jsx("span",{className:"font-mono",children:M.value})]}),M.default&&r.jsxs("p",{className:"text-gray-500 mt-1",children:[r.jsxs("span",{className:"font-medium",children:[m("common.default"),":"]})," ",r.jsx("span",{className:"font-mono",children:M.default})]})]},z))})]})]},j);return r.jsxs("div",{className:"bg-white shadow rounded-lg p-6",children:[r.jsxs("div",{className:"mb-6",children:[r.jsxs("button",{onClick:n,className:"flex items-center text-blue-600 hover:text-blue-800 mb-4 transition-colors",children:[r.jsx("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),m("registry.backToList")]}),r.jsxs("div",{className:"flex items-start space-x-4",children:[G?r.jsx("img",{src:G.src,alt:p.title,className:"w-20 h-20 rounded-lg object-cover flex-shrink-0",onError:V=>{V.currentTarget.style.display="none"}}):r.jsx("div",{className:"w-20 h-20 bg-gradient-to-br from-blue-500 to-purple-600 rounded-lg flex items-center justify-center text-white text-3xl font-semibold flex-shrink-0",children:"M"}),r.jsxs("div",{className:"flex-1",children:[r.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:p.name}),r.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[(Y==null?void 0:Y.isLatest)&&r.jsx("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-green-100 text-green-800",children:m("registry.latest")}),r.jsxs("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-blue-100 text-blue-800",children:["v",p.version]}),(Y==null?void 0:Y.status)&&r.jsx("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-gray-100 text-gray-800",children:Y.status}),r.jsxs("span",{className:"flex flex-wrap items-center gap-4 text-sm text-gray-600",children:[(Y==null?void 0:Y.publishedAt)&&r.jsxs("div",{children:[r.jsxs("span",{className:"font-medium",children:[m("registry.published"),":"]})," ",K(Y.publishedAt)]}),(Y==null?void 0:Y.updatedAt)&&r.jsxs("div",{children:[r.jsxs("span",{className:"font-medium",children:[m("registry.updated"),":"]})," ",K(Y.updatedAt)]})]})]})]})]})]}),r.jsxs("div",{className:"mb-6",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-3",children:m("registry.description")}),r.jsx("p",{className:"text-gray-700 leading-relaxed whitespace-pre-wrap",children:p.description})]}),p.websiteUrl&&r.jsxs("div",{className:"mb-6",children:[r.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-3",children:m("registry.website")}),r.jsx("a",{href:p.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 hover:underline",children:p.websiteUrl})]}),p.packages&&p.packages.length>0&&r.jsxs("div",{className:"mb-6",children:[r.jsxs("button",{onClick:()=>X("packages"),className:"flex items-center justify-between w-full text-xl font-semibold text-gray-900 mb-3 hover:text-blue-600 transition-colors",children:[r.jsxs("span",{children:[m("registry.packages")," (",p.packages.length,")"]}),r.jsx("svg",{className:`w-5 h-5 transform transition-transform ${B.packages?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),B.packages&&r.jsx("div",{className:"space-y-3",children:p.packages.map(U)})]}),p.remotes&&p.remotes.length>0&&r.jsxs("div",{className:"mb-6",children:[r.jsxs("button",{onClick:()=>X("remotes"),className:"flex items-center justify-between w-full text-xl font-semibold text-gray-900 mb-3 hover:text-blue-600 transition-colors",children:[r.jsxs("span",{children:[m("registry.remotes")," (",p.remotes.length,")"]}),r.jsx("svg",{className:`w-5 h-5 transform transition-transform ${B.remotes?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),B.remotes&&r.jsx("div",{className:"space-y-3",children:p.remotes.map(oe)})]}),p.repository&&r.jsxs("div",{className:"mb-6",children:[r.jsxs("button",{onClick:()=>X("repository"),className:"flex items-center justify-between w-full text-xl font-semibold text-gray-900 mb-3 hover:text-blue-600 transition-colors",children:[r.jsx("span",{children:m("registry.repository")}),r.jsx("svg",{className:`w-5 h-5 transform transition-transform ${B.repository?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),B.repository&&r.jsxs("div",{className:"border border-gray-200 rounded-lg p-4",children:[p.repository.url&&r.jsxs("div",{className:"mb-2",children:[r.jsx("span",{className:"font-medium text-gray-700",children:"URL:"})," ",r.jsx("a",{href:p.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 hover:underline break-all",children:p.repository.url})]}),p.repository.source&&r.jsxs("div",{className:"mb-2",children:[r.jsx("span",{className:"font-medium text-gray-700",children:"Source:"})," ",p.repository.source]}),p.repository.subfolder&&r.jsxs("div",{className:"mb-2",children:[r.jsx("span",{className:"font-medium text-gray-700",children:"Subfolder:"})," ",p.repository.subfolder]}),p.repository.id&&r.jsxs("div",{children:[r.jsx("span",{className:"font-medium text-gray-700",children:"ID:"})," ",p.repository.id]})]})]}),O&&S&&A&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx(Ml,{onSubmit:C,onCancel:Z,modalTitle:m("registry.installServer",{name:p.title||p.name}),formError:P,initialData:I()})})]})};function fj(a){switch(a.toLowerCase()){case"pypi":case"python":return"uvx";case"npm":case"node":return"npx";case"oci":case"docker":return"docker";default:return""}}function pj(a,n){const l=[n.identifier+(n.version?`@${n.version}`:"")],o=[];switch(n.packageArguments&&n.packageArguments.length>0&&n.packageArguments.forEach(c=>{if(c.isRequired||c.default||c.value){const d=`--${c.name}`,m=c.value||c.default||`\${${c.name.toUpperCase()}}`;o.push(d,m)}}),a.toLowerCase()){case"uvx":return[...l,...o];case"npx":return[...l,...o];case"docker":{const c=[];return n.environmentVariables&&n.environmentVariables.forEach(d=>{c.push("-e",`${d.name}`)}),["run","-i","--rm",...c,...l,...o]}default:return[...l,...o]}}const hj=({currentPage:a,hasNextPage:n,hasPreviousPage:l,onNextPage:o,onPreviousPage:c})=>r.jsxs("div",{className:"flex items-center justify-center space-x-2 my-6",children:[r.jsxs("button",{onClick:c,disabled:!l,className:`px-4 py-2 rounded transition-all duration-200 ${l?"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary":"bg-gray-100 text-gray-400 cursor-not-allowed"}`,children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 inline-block mr-1",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Prev"]}),r.jsxs("span",{className:"px-4 py-2 bg-blue-500 text-white rounded btn-primary",children:["Page ",a]}),r.jsxs("button",{onClick:o,disabled:!n,className:`px-4 py-2 rounded transition-all duration-200 ${n?"bg-gray-200 hover:bg-gray-300 text-gray-700 btn-secondary":"bg-gray-100 text-gray-400 cursor-not-allowed"}`,children:["Next",r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 inline-block ml-1",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})})]})]}),Zh=()=>{const{t:a}=Ce(),n=la(),{serverName:l}=Eg(),{showToast:o}=us(),[c,d]=Mv(),m=c.get("tab")||"cloud",{servers:p,allServers:g,categories:h,loading:b,error:x,setError:w,searchServers:T,filterByCategory:R,filterByTag:O,selectedCategory:E,selectedTag:A,installServer:N,fetchServerByName:S,isServerInstalled:D,currentPage:P,totalPages:$,changePage:B,serversPerPage:L,changeServersPerPage:Y}=sj(),{servers:fe,allServers:G,loading:K,error:X,setError:H,fetchServerTools:Z,callServerTool:C,currentPage:I,totalPages:U,changePage:oe,serversPerPage:V,changeServersPerPage:j}=nj(),{servers:M,allServers:z,loading:q,error:pe,setError:se,searchServers:Q,clearSearch:ge,fetchServerByName:re,fetchServerVersions:ye,currentPage:ue,totalPages:ie,hasNextPage:xe,hasPreviousPage:Xe,changePage:Ft,goToNextPage:Vt,goToPreviousPage:Ze,serversPerPage:gt,changeServersPerPage:$t}=lj(),[Ut,Yt]=y.useState(null),[It,pr]=y.useState(null),[tt,wt]=y.useState(null),[ir,ze]=y.useState(""),[St,ke]=y.useState(""),[nt,lt]=y.useState(!1),[ar,Jt]=y.useState(new Set),[ft,sr]=y.useState(new Set);y.useEffect(()=>{(async()=>{if(l)if(m==="cloud"){const Re=fe.find(Fe=>Fe.name===l);Re?pr(Re):n("/market?tab=cloud")}else if(m==="registry"){console.log("Loading registry server details for:",l);const Re=await re(l);Re?wt(Re):n("/market?tab=registry")}else{const Re=await S(l);Re?Yt(Re):n("/market?tab=local")}else Yt(null),pr(null),wt(null)})()},[l,m,fe,S,re,n]);const xt=we=>{const Re=new URLSearchParams(c);Re.set("tab",we),d(Re),l&&n("/market?"+Re.toString())},Ma=we=>{we.preventDefault(),m==="local"?T(ir):m==="registry"&&Q(St)},ia=we=>{m==="local"&&R(we)},La=()=>{m==="local"?(ze(""),R(""),O("")):m==="registry"&&(ke(""),ge())},hr=we=>{var Re;if(m==="cloud")n(`/market/${we.name}?tab=cloud`);else if(m==="registry"){const Fe=we;console.log("Registry server clicked:",Fe);const Ke=(Re=Fe.server)==null?void 0:Re.name;if(console.log("Server name extracted:",Ke),Ke){const ct=`/market/${encodeURIComponent(Ke)}?tab=registry`;console.log("Navigating to:",ct),n(ct)}else console.error("Server name is undefined in registry server:",Fe)}else n(`/market/${we.name}?tab=local`)},gr=()=>{n(`/market?tab=${m}`)},W=async(we,Re)=>{try{lt(!0),await N(we,Re)&&o(a("market.installSuccess",{serverName:we.display_name}),"success")}finally{lt(!1)}},ve=async(we,Re)=>{try{lt(!0);const Fe={name:we.name,config:Re},Ke=await At("/servers",Fe);if(!Ke.success){const ct=(Ke==null?void 0:Ke.message)||a("server.addError");o(ct,"error");return}Jt(ct=>new Set(ct).add(we.name)),o(a("cloud.installSuccess",{name:we.title||we.name}),"success")}catch(Fe){console.error("Error installing cloud server:",Fe);const Ke=Fe instanceof Error?Fe.message:String(Fe);o(a("cloud.installError",{error:Ke}),"error")}finally{lt(!1)}},qe=async(we,Re)=>{try{lt(!0);const Fe={name:we.name,config:Re},Ke=await At("/servers",Fe);if(!Ke.success){const ct=(Ke==null?void 0:Ke.message)||a("server.addError");o(ct,"error");return}sr(ct=>new Set(ct).add(we.name)),o(a("registry.installSuccess",{name:we.title||we.name}),"success")}catch(Fe){console.error("Error installing registry server:",Fe);const Ke=Fe instanceof Error?Fe.message:String(Fe);o(a("registry.installError",{error:Ke}),"error")}finally{lt(!1)}},jt=async(we,Re,Fe)=>{try{const Ke=await C(we,Re,Fe);return o(a("cloud.toolCallSuccess",{toolName:Re}),"success"),Ke}catch(Ke){const ct=Ke instanceof Error?Ke.message:String(Ke);throw Vr(ct)||o(a("cloud.toolCallError",{toolName:Re,error:ct}),"error"),Ke}},Vr=we=>we==="MCPROUTER_API_KEY_NOT_CONFIGURED"||we.toLowerCase().includes("mcprouter api key not configured"),oa=we=>{m==="local"?B(we):m==="registry"?Ft(we):oe(we),window.scrollTo({top:0,behavior:"smooth"})},$r=we=>{const Re=parseInt(we.target.value,10);m==="local"?Y(Re):m==="registry"?$t(Re):j(Re)};if(Ut)return r.jsx(oj,{server:Ut,onBack:gr,onInstall:W,installing:nt,isInstalled:D(Ut.name)});if(It)return r.jsx(uj,{serverName:It.name,onBack:gr,onCallTool:jt,fetchServerTools:Z,onInstall:ve,installing:nt,isInstalled:ar.has(It.name)});if(tt)return r.jsx(mj,{serverEntry:tt,onBack:gr,onInstall:qe,installing:nt,isInstalled:ft.has(tt.server.name),fetchVersions:ye});const Ve=m==="local",it=m==="registry",he=Ve?p:it?M:fe,le=Ve?g:it?z:G,be=Ve?h:[],nr=Ve?b:it?q:K,Yr=Ve?x:it?pe:X,ds=Ve?w:it?se:H,Qt=Ve?E:"",Xt=Ve?A:"",$e=Ve?P:it?ue:I,Mt=Ve?$:it?ie:U,Zt=Ve?L:it?gt:V;return r.jsxs("div",{children:[r.jsx("div",{className:"mb-6",children:r.jsx("div",{className:"border-b border-gray-200",children:r.jsxs("nav",{className:"-mb-px flex space-x-3",children:[r.jsxs("button",{onClick:()=>xt("cloud"),className:`py-2 px-1 border-b-2 font-medium text-lg hover:cursor-pointer transition-colors duration-200 ${!Ve&&!it?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:[a("cloud.title"),r.jsxs("span",{className:"text-xs text-gray-400 font-normal ml-1",children:["(",r.jsx("a",{href:"https://mcprouter.co",target:"_blank",rel:"noopener noreferrer",className:"external-link",children:"MCPRouter"}),")"]})]}),r.jsxs("button",{onClick:()=>xt("local"),className:`py-2 px-1 border-b-2 font-medium text-lg hover:cursor-pointer transition-colors duration-200 ${Ve?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:[a("market.title"),r.jsxs("span",{className:"text-xs text-gray-400 font-normal ml-1",children:["(",r.jsx("a",{href:"https://mcpm.sh",target:"_blank",rel:"noopener noreferrer",className:"external-link",children:"MCPM"}),")"]})]}),r.jsxs("button",{onClick:()=>xt("registry"),className:`py-2 px-1 border-b-2 font-medium text-lg hover:cursor-pointer transition-colors duration-200 ${it?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:[a("registry.title"),r.jsxs("span",{className:"text-xs text-gray-400 font-normal ml-1",children:["(",r.jsx("a",{href:"https://registry.modelcontextprotocol.io",target:"_blank",rel:"noopener noreferrer",className:"external-link",children:a("registry.official")}),")"]})]})]})})}),Yr&&r.jsx(r.Fragment,{children:!Ve&&Vr(Yr)?r.jsx(nd,{}):r.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6 error-box rounded-lg",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("p",{children:Yr}),r.jsx("button",{onClick:()=>ds(null),className:"text-red-700 hover:text-red-900 transition-colors duration-200",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 011.414 0L10 8.586l4.293-4.293a1 1 01.414 1.414L11.414 10l4.293 4.293a1 1 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 01-1.414-1.414L8.586 10 4.293 5.707a1 1 010-1.414z",clipRule:"evenodd"})})})]})})}),(Ve||it)&&r.jsx("div",{className:"bg-white shadow rounded-lg p-6 mb-6 page-card",children:r.jsxs("form",{onSubmit:Ma,className:"flex space-x-4 mb-0",children:[r.jsx("div",{className:"flex-grow",children:r.jsx("input",{type:"text",value:it?St:ir,onChange:we=>{it?ke(we.target.value):ze(we.target.value)},placeholder:a(it?"registry.searchPlaceholder":"market.searchPlaceholder"),className:"shadow appearance-none border border-gray-200 rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input"})}),r.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:a(it?"registry.search":"market.search")}),(Ve&&(ir||Qt||Xt)||it&&St)&&r.jsx("button",{type:"button",onClick:La,className:"border border-gray-300 text-gray-700 font-medium py-2 px-4 rounded hover:bg-gray-50 btn-secondary transition-all duration-200",children:a(it?"registry.clearFilters":"market.clearFilters")})]})}),r.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[Ve&&r.jsx("div",{className:"md:w-48 flex-shrink-0",children:r.jsx("div",{className:"bg-white shadow rounded-lg p-4 mb-6 sticky top-4 page-card",children:be.length>0?r.jsxs("div",{className:"mb-6",children:[r.jsxs("div",{className:"flex justify-between items-center mb-3",children:[r.jsx("h3",{className:"font-medium text-gray-900",children:a("market.categories")}),Qt&&r.jsx("span",{className:"text-xs text-blue-600 cursor-pointer hover:underline transition-colors duration-200",onClick:()=>R(""),children:a("market.clearCategoryFilter")})]}),r.jsx("div",{className:"flex flex-col gap-2",children:be.map(we=>r.jsx("button",{onClick:()=>ia(we),className:`px-3 py-2 rounded text-sm text-left transition-all duration-200 ${Qt===we?"bg-blue-100 text-blue-800 font-medium btn-primary":"bg-gray-100 text-gray-800 hover:bg-gray-200 btn-secondary"}`,children:we},we))})]}):nr?r.jsxs("div",{className:"mb-6",children:[r.jsx("div",{className:"mb-3",children:r.jsx("h3",{className:"font-medium text-gray-900",children:a("market.categories")})}),r.jsxs("div",{className:"flex flex-col gap-2 items-center py-4 loading-container",children:[r.jsxs("svg",{className:"animate-spin h-6 w-6 text-blue-500 mb-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("p",{className:"text-sm text-gray-600",children:a("app.loading")})]})]}):r.jsxs("div",{className:"mb-6",children:[r.jsx("div",{className:"mb-3",children:r.jsx("h3",{className:"font-medium text-gray-900",children:a("market.categories")})}),r.jsx("p",{className:"text-sm text-gray-600 py-2",children:a("market.noCategories")})]})})}),r.jsx("div",{className:"flex-grow",children:nr?r.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center",children:r.jsxs("div",{className:"flex flex-col items-center",children:[r.jsxs("svg",{className:"animate-spin h-10 w-10 text-blue-500 mb-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("p",{className:"text-gray-600",children:a("app.loading")})]})}):he.length===0?r.jsx("div",{className:"bg-white shadow rounded-lg p-6",children:r.jsx("p",{className:"text-gray-600",children:a(Ve?"market.noServers":it?"registry.noServers":"cloud.noServers")})}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 gap-6",children:he.map((we,Re)=>Ve?r.jsx(ij,{server:we,onClick:hr},Re):it?r.jsx(dj,{serverEntry:we,onClick:hr},Re):r.jsx(cj,{server:we,onClick:hr},Re))}),r.jsxs("div",{className:"flex items-center mb-4",children:[r.jsx("div",{className:"flex-[2] text-sm text-gray-500",children:Ve?a("market.showing",{from:($e-1)*Zt+1,to:Math.min($e*Zt,le.length),total:le.length}):it?a("registry.showing",{from:($e-1)*Zt+1,to:($e-1)*Zt+he.length,total:le.length+(xe?"+":"")}):a("cloud.showing",{from:($e-1)*Zt+1,to:Math.min($e*Zt,le.length),total:le.length})}),r.jsx("div",{className:"flex-[4] flex justify-center",children:it?r.jsx(hj,{currentPage:$e,hasNextPage:xe,hasPreviousPage:Xe,onNextPage:Vt,onPreviousPage:Ze}):r.jsx(jd,{currentPage:$e,totalPages:Mt,onPageChange:oa})}),r.jsxs("div",{className:"flex-[2] flex items-center justify-end space-x-2",children:[r.jsxs("label",{htmlFor:"perPage",className:"text-sm text-gray-600",children:[a(Ve?"market.perPage":it?"registry.perPage":"cloud.perPage"),":"]}),r.jsxs("select",{id:"perPage",value:Zt,onChange:$r,className:"border rounded p-1 text-sm btn-secondary outline-none",children:[r.jsx("option",{value:"6",children:"6"}),r.jsx("option",{value:"9",children:"9"}),r.jsx("option",{value:"12",children:"12"}),r.jsx("option",{value:"24",children:"24"})]})]})]})]})})]})]})},gj={default:"bg-blue-500 text-white hover:bg-blue-600 focus:ring-blue-500",outline:"border border-gray-300 dark:border-gray-700 bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-700 dark:text-gray-300",ghost:"bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-700 dark:text-gray-300",link:"bg-transparent underline-offset-4 hover:underline text-blue-500 hover:text-blue-600",destructive:"bg-red-500 text-white hover:bg-red-600 focus:ring-red-500"},xj={default:"h-10 py-2 px-4",sm:"h-8 px-3 text-sm",lg:"h-12 px-6",icon:"h-10 w-10 p-0"};function yj({variant:a="default",size:n="default",className:l,disabled:o,children:c,...d}){return r.jsx("button",{className:Oa("rounded-md inline-flex items-center justify-center font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none",gj[a],xj[n],l),disabled:o,...d,children:c})}const bj=({logs:a,isLoading:n=!1,error:l=null,onClear:o})=>{const{t:c}=Ce(),d=y.useRef(null),[m,p]=y.useState(!0),[g,h]=y.useState(""),[b,x]=y.useState(["info","error","warn","debug"]),[w,T]=y.useState(["main","child"]);y.useEffect(()=>{m&&d.current&&(d.current.scrollTop=d.current.scrollHeight)},[a,m]);const R=a.filter(N=>{const S=g?N.message.toLowerCase().includes(g.toLowerCase()):!0,D=b.includes(N.type),P=w.includes(N.source);return S&&D&&P}),O=N=>new Date(N).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),E=N=>{switch(N){case"error":return"bg-red-400/80 text-white";case"warn":return"bg-yellow-400/80 text-gray-900";case"debug":return"bg-purple-400/80 text-white";case"info":return"bg-blue-400/80 text-white";default:return"bg-blue-400/80 text-white"}},A=N=>{switch(N){case"main":return"bg-green-400/80 text-white";case"child":return"bg-orange-400/80 text-white";default:return"bg-gray-400/80 text-white"}};return r.jsxs("div",{className:"flex flex-col h-full",children:[r.jsxs("div",{className:"bg-card p-3 rounded-t-md flex flex-wrap items-center justify-between gap-2",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[r.jsxs("span",{className:"font-semibold text-sm",children:[c("logs.filters"),":"]}),r.jsx("input",{type:"text",placeholder:c("logs.search"),className:"shadow appearance-none border border-gray-200 rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline form-input",value:g,onChange:N=>h(N.target.value)}),r.jsx("div",{className:"flex gap-1 items-center",children:["debug","info","error","warn"].map(N=>r.jsx(Wi,{variant:b.includes(N)?"default":"outline",className:`cursor-pointer ${b.includes(N)?E(N):""}`,onClick:()=>{b.includes(N)?x(S=>S.filter(D=>D!==N)):x(S=>[...S,N])},children:N},N))}),r.jsx("div",{className:"flex gap-1 items-center ml-2",children:["main","child"].map(N=>r.jsx(Wi,{variant:w.includes(N)?"default":"outline",className:`cursor-pointer ${w.includes(N)?A(N):""}`,onClick:()=>{w.includes(N)?T(S=>S.filter(D=>D!==N)):T(S=>[...S,N])},children:c(N==="main"?"logs.mainProcess":"logs.childProcess")},N))})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("label",{className:"flex items-center gap-1 text-sm",children:[r.jsx("input",{type:"checkbox",checked:m,onChange:()=>p(!m),className:"form-checkbox h-4 w-4"}),c("logs.autoScroll")]}),r.jsx(yj,{variant:"outline",size:"sm",onClick:o,className:"btn-secondary",disabled:n||a.length===0,children:c("logs.clearLogs")})]})]}),r.jsx("div",{ref:d,className:"flex-grow p-2 overflow-auto bg-card rounded-b-md font-mono text-sm",style:{maxHeight:"calc(100vh - 300px)"},children:n?r.jsx("div",{className:"flex justify-center items-center h-full",children:r.jsx("span",{children:c("logs.loading")})}):l?r.jsx("div",{className:"text-red-500 p-2",children:l.message}):R.length===0?r.jsx("div",{className:"text-center text-muted-foreground p-8",children:g||b.length<4||w.length<2?c("logs.noMatch"):c("logs.noLogs")}):R.map((N,S)=>r.jsxs("div",{className:`py-1 ${N.type==="error"?"text-red-500":N.type==="warn"?"text-yellow-500":""}`,children:[r.jsxs("span",{className:"text-gray-400",children:["[",O(N.timestamp),"]"]}),r.jsx(Wi,{className:`ml-2 mr-1 ${E(N.type)}`,children:N.type}),r.jsxs(Wi,{variant:"default",className:`mr-2 ${A(N.source)}`,children:[N.source==="main"?c("logs.main"):c("logs.child"),N.processId?` (${N.processId})`:""]}),r.jsx("span",{className:"whitespace-pre-wrap",children:N.message})]},`${N.timestamp}-${S}`))})]})},vj=async()=>{try{const a=await Os("/logs");if(!a.success)throw new Error(a.error||"Failed to clear logs")}catch(a){throw console.error("Error clearing logs:",a),a}},wj=()=>{const[a,n]=y.useState([]),[l,o]=y.useState(!0),[c,d]=y.useState(null);return y.useEffect(()=>{let p=null,g=!0;const h=()=>{try{p&&p.close();const b=kn();p=new EventSource(gd(`/logs/stream?token=${b}`)),p.onmessage=x=>{if(g)try{const w=JSON.parse(x.data);w.type==="initial"?(n(w.logs),o(!1)):w.type==="log"&&n(T=>[...T,w.log])}catch(w){console.error("Error parsing SSE message:",w)}},p.onerror=()=>{g&&(p&&(p.close(),setTimeout(h,5e3)),d(new Error("Connection to log stream lost, attempting to reconnect...")))}}catch(b){if(!g)return;d(b instanceof Error?b:new Error("Failed to connect to log stream")),o(!1)}};return h(),()=>{g=!1,p&&p.close()}},[]),{logs:a,loading:l,error:c,clearLogs:async()=>{try{await vj(),n([])}catch(p){d(p instanceof Error?p:new Error("Failed to clear logs"))}}}},Sj=()=>{const{t:a}=Ce(),{logs:n,loading:l,error:o,clearLogs:c}=wj();return r.jsxs("div",{className:"container mx-auto p-4",children:[r.jsx("div",{className:"flex justify-between items-center mb-4",children:r.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:a("pages.logs.title")})}),r.jsx("div",{className:"bg-card rounded-md shadow-sm border border-gray-200 page-card",children:r.jsx(bj,{logs:n,isLoading:l,error:o,onClear:c})})]})},z0=["success","error"],jj=a=>z0.includes(a),Nj=()=>{const{t:a}=Ce(),[n,l]=y.useState([]),[o,c]=y.useState(null),[d,m]=y.useState(null),[p,g]=y.useState(null),[h,b]=y.useState(1),[x,w]=y.useState(10),[T,R]=y.useState(!0),[O,E]=y.useState(null),[A,N]=y.useState(null),[S,D]=y.useState(!1),[P,$]=y.useState({}),[B,L]=y.useState(""),[Y,fe]=y.useState(""),[G,K]=y.useState(""),[X,H]=y.useState(""),[Z,C]=y.useState(""),I=y.useCallback(async()=>{R(!0),E(null);try{const re={...P},[ye,ue,ie]=await Promise.all([pS(h,x,re),gS(re),xS()]);ye!=null&&ye.success&&Array.isArray(ye.data)&&(l(ye.data),ye.pagination&&g(ye.pagination)),ue!=null&&ue.success&&ue.data&&c(ue.data),ie!=null&&ie.success&&ie.data&&m(ie.data)}catch(re){console.error("Error fetching activity data:",re),E(a("activity.fetchError"))}finally{R(!1)}},[h,x,P,a]);y.useEffect(()=>{I()},[I]),y.useEffect(()=>{if(!p)return;const re=Math.max(1,p.totalPages||1);h>re&&b(re)},[p,h]);const U=async re=>{try{const ye=await hS(re.id);ye!=null&&ye.success&&ye.data&&(N(ye.data),D(!0))}catch(ye){console.error("Error fetching activity details:",ye)}},oe=async()=>{var re;if(window.confirm(a("activity.confirmCleanup")))try{const ye=await yS(30);ye!=null&&ye.success&&(alert(a("activity.cleanupSuccess",{count:((re=ye.data)==null?void 0:re.deletedCount)||0})),I())}catch(ye){console.error("Error cleaning up activities:",ye),alert(a("activity.cleanupError"))}},V=()=>{const re={};B&&(re.server=B),Y&&(re.tool=Y),G&&jj(G)&&(re.status=G),X&&(re.group=X),Z&&(re.keyName=Z),$(re),b(1)},j=()=>{L(""),fe(""),K(""),H(""),C(""),$({}),b(1)},M=re=>re<1e3?`${re}ms`:re<6e4?`${(re/1e3).toFixed(2)}s`:`${(re/6e4).toFixed(2)}m`,z=re=>new Date(re).toLocaleString(),q=re=>{if(!re)return null;try{return JSON.parse(re)}catch{return re}},pe=()=>o?r.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm px-4 py-3 mb-4",children:r.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap",children:a("activity.totalCalls")}),r.jsx("div",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:o.totalCalls})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap",children:a("activity.successCount")}),r.jsx("div",{className:"text-lg font-semibold text-green-600",children:o.successCount})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap",children:a("activity.errorCount")}),r.jsx("div",{className:"text-lg font-semibold text-red-600",children:o.errorCount})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap",children:a("activity.avgDuration")}),r.jsx("div",{className:"text-lg font-semibold text-blue-600",children:M(o.avgDuration)})]})]})}):null,se=()=>r.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm px-4 py-3 mb-4",children:r.jsxs("div",{className:"flex flex-wrap gap-3 items-end",children:[r.jsxs("div",{className:"flex-1 min-w-[140px]",children:[r.jsx("label",{className:"sr-only",htmlFor:"activity-server",children:a("activity.server")}),r.jsxs("div",{className:"relative",children:[r.jsx("input",{id:"activity-server",type:"text",value:B,onChange:re=>L(re.target.value),placeholder:a("activity.searchServer"),className:"w-full h-10 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white pr-9",list:"server-options"}),B&&r.jsx("button",{onClick:()=>L(""),className:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300","aria-label":a("common.clear"),type:"button",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),(d==null?void 0:d.servers)&&r.jsx("datalist",{id:"server-options",children:d.servers.map(re=>r.jsx("option",{value:re},re))})]}),r.jsxs("div",{className:"flex-1 min-w-[140px]",children:[r.jsx("label",{className:"sr-only",htmlFor:"activity-tool",children:a("activity.tool")}),r.jsxs("div",{className:"relative",children:[r.jsx("input",{id:"activity-tool",type:"text",value:Y,onChange:re=>fe(re.target.value),placeholder:a("activity.searchTool"),className:"w-full h-10 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white pr-9",list:"tool-options"}),Y&&r.jsx("button",{onClick:()=>fe(""),className:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300","aria-label":a("common.clear"),type:"button",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),(d==null?void 0:d.tools)&&r.jsx("datalist",{id:"tool-options",children:d.tools.map(re=>r.jsx("option",{value:re},re))})]}),r.jsxs("div",{className:"flex-1 min-w-[140px]",children:[r.jsx("label",{className:"sr-only",htmlFor:"activity-status",children:a("activity.status")}),r.jsxs("div",{className:"relative",children:[r.jsx("input",{id:"activity-status",type:"text",value:G,onChange:re=>K(re.target.value.toLowerCase()),placeholder:a("activity.searchStatus"),className:"w-full h-10 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white pr-9",list:"activity-status-options"}),G&&r.jsx("button",{onClick:()=>K(""),className:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300","aria-label":a("common.clear"),type:"button",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),r.jsx("datalist",{id:"activity-status-options",children:z0.map(re=>r.jsx("option",{value:re},re))})]}),r.jsxs("div",{className:"flex-1 min-w-[140px]",children:[r.jsx("label",{className:"sr-only",htmlFor:"activity-group",children:a("activity.group")}),r.jsxs("div",{className:"relative",children:[r.jsx("input",{id:"activity-group",type:"text",value:X,onChange:re=>H(re.target.value),placeholder:a("activity.searchGroup"),className:"w-full h-10 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white pr-9",list:"group-options"}),X&&r.jsx("button",{onClick:()=>H(""),className:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300","aria-label":a("common.clear"),type:"button",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),(d==null?void 0:d.groups)&&r.jsx("datalist",{id:"group-options",children:d.groups.map(re=>r.jsx("option",{value:re},re))})]}),r.jsxs("div",{className:"flex-1 min-w-[140px]",children:[r.jsx("label",{className:"sr-only",htmlFor:"activity-keyname",children:a("activity.keyName")}),r.jsxs("div",{className:"relative",children:[r.jsx("input",{id:"activity-keyname",type:"text",value:Z,onChange:re=>C(re.target.value),placeholder:a("activity.searchKeyName"),className:"w-full h-10 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white pr-9",list:"keyname-options"}),Z&&r.jsx("button",{onClick:()=>C(""),className:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300","aria-label":a("common.clear"),type:"button",children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),(d==null?void 0:d.keyNames)&&r.jsx("datalist",{id:"keyname-options",children:d.keyNames.map(re=>r.jsx("option",{value:re},re))})]}),r.jsxs("div",{className:"flex-shrink-0 flex items-center gap-2",children:[r.jsxs("button",{onClick:V,className:"h-10 px-3 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200 whitespace-nowrap",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"})}),a("common.search")]}),r.jsxs("button",{onClick:j,className:"h-10 px-3 bg-gray-100 text-gray-800 rounded hover:bg-gray-200 flex items-center btn-secondary transition-all duration-200 dark:bg-gray-700 dark:text-gray-200 dark:hover:bg-gray-600 whitespace-nowrap",children:[r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[r.jsx("circle",{cx:"12",cy:"12",r:"9"}),r.jsx("path",{strokeLinecap:"round",d:"M9 9l6 6M15 9l-6 6"})]}),a("common.clear")]})]})]})}),Q=()=>n.length===0?r.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow p-8 text-center text-gray-500 dark:text-gray-400",children:a("activity.noData")}):r.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow overflow-hidden",children:r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[r.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:r.jsxs("tr",{children:[r.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:a("activity.timestamp")}),r.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:a("activity.server")}),r.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:a("activity.tool")}),r.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:a("activity.duration")}),r.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:a("activity.status")}),r.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:a("activity.group")}),r.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:a("activity.key")}),r.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:a("common.actions")})]})}),r.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:n.map(re=>r.jsxs("tr",{className:"hover:bg-gray-50 dark:hover:bg-gray-700",children:[r.jsx("td",{className:"px-4 py-3 text-sm text-gray-900 dark:text-gray-200 whitespace-nowrap",children:z(re.timestamp)}),r.jsx("td",{className:"px-4 py-3 text-sm text-gray-900 dark:text-gray-200",children:r.jsx("span",{className:"font-mono bg-gray-100 dark:bg-gray-700 px-2 py-1 rounded text-xs",children:re.server})}),r.jsx("td",{className:"px-4 py-3 text-sm text-gray-900 dark:text-gray-200",children:r.jsx("span",{className:"font-mono bg-blue-100 dark:bg-blue-900 text-blue-800 dark:text-blue-200 px-2 py-1 rounded text-xs",children:re.tool})}),r.jsx("td",{className:"px-4 py-3 text-sm text-gray-900 dark:text-gray-200 whitespace-nowrap",children:M(re.duration)}),r.jsx("td",{className:"px-4 py-3 text-sm whitespace-nowrap",children:r.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${re.status==="success"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:re.status==="success"?a("activity.statusSuccess"):a("activity.statusError")})}),r.jsx("td",{className:"px-4 py-3 text-sm text-gray-500 dark:text-gray-400",children:re.group||"-"}),r.jsx("td",{className:"px-4 py-3 text-sm text-gray-500 dark:text-gray-400",children:re.keyName||"-"}),r.jsx("td",{className:"px-4 py-3 text-sm",children:r.jsx("button",{onClick:()=>U(re),className:"text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300",children:a("common.view")})})]},re.id))})]})})}),ge=()=>{if(!S||!A)return null;const re=q(A.input),ye=q(A.output);return r.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:r.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-4xl w-full mx-4 max-h-[90vh] overflow-hidden",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:[r.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white",children:a("activity.details")}),r.jsx("button",{onClick:()=>D(!1),className:"text-gray-400 hover:text-gray-500 dark:hover:text-gray-300",children:r.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),r.jsxs("div",{className:"px-6 py-4 overflow-y-auto max-h-[calc(90vh-120px)]",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:a("activity.timestamp")}),r.jsx("p",{className:"text-gray-900 dark:text-white",children:z(A.timestamp)})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:a("activity.duration")}),r.jsx("p",{className:"text-gray-900 dark:text-white",children:M(A.duration)})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:a("activity.server")}),r.jsx("p",{className:"text-gray-900 dark:text-white font-mono",children:A.server})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:a("activity.tool")}),r.jsx("p",{className:"text-gray-900 dark:text-white font-mono",children:A.tool})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:a("activity.status")}),r.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${A.status==="success"?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:A.status==="success"?a("activity.statusSuccess"):a("activity.statusError")})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:a("activity.group")}),r.jsx("p",{className:"text-gray-900 dark:text-white",children:A.group||"-"})]}),A.keyName&&r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:a("activity.key")}),r.jsx("p",{className:"text-gray-900 dark:text-white",children:A.keyName})]})]}),A.errorMessage&&r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-sm font-medium text-red-500 mb-1",children:a("activity.errorMessage")}),r.jsx("div",{className:"bg-red-50 dark:bg-red-900/20 rounded p-3 text-sm text-red-800 dark:text-red-200",children:A.errorMessage})]}),re&&r.jsxs("div",{className:"mb-4",children:[r.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:a("activity.input")}),r.jsx("pre",{className:"bg-gray-100 dark:bg-gray-700 rounded p-3 text-sm overflow-x-auto max-h-64",children:typeof re=="string"?re:JSON.stringify(re,null,2)})]}),ye&&r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:a("activity.output")}),r.jsx("pre",{className:"bg-gray-100 dark:bg-gray-700 rounded p-3 text-sm overflow-x-auto max-h-64",children:typeof ye=="string"?ye:JSON.stringify(ye,null,2)})]})]})]})})};return r.jsxs("div",{children:[r.jsxs("div",{className:"flex justify-between items-center mb-6",children:[r.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:a("activity.title")}),r.jsx("div",{className:"flex space-x-4",children:r.jsxs("button",{onClick:oe,className:"px-4 py-2 bg-red-100 text-red-800 rounded hover:bg-red-200 flex items-center transition-all duration-200",children:[r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:r.jsx("path",{fillRule:"evenodd",d:"M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z",clipRule:"evenodd"})}),a("activity.cleanup")]})})]}),O&&r.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("p",{className:"text-red-700",children:O}),r.jsx("button",{onClick:()=>E(null),className:"ml-4 text-gray-500 hover:text-gray-700",children:r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",children:[r.jsx("circle",{cx:"12",cy:"12",r:"9"}),r.jsx("path",{strokeLinecap:"round",d:"M9 9l6 6M15 9l-6 6"})]})})]})}),T&&n.length===0?r.jsx("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg p-6 flex items-center justify-center",children:r.jsxs("div",{className:"flex flex-col items-center",children:[r.jsxs("svg",{className:"animate-spin h-10 w-10 text-blue-500 mb-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),r.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),r.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:a("app.loading")})]})}):r.jsxs(r.Fragment,{children:[pe(),se(),Q(),r.jsxs("div",{className:"flex items-center mt-6",children:[r.jsx("div",{className:"flex-[2] text-sm text-gray-500 dark:text-gray-400",children:p&&a("common.showing",{start:(p.page-1)*p.limit+1,end:Math.min(p.page*p.limit,p.total),total:p.total})}),r.jsx("div",{className:"flex-[4] flex justify-center",children:p&&p.totalPages>1&&r.jsx(jd,{currentPage:h,totalPages:p.totalPages,onPageChange:b,disabled:T})}),r.jsxs("div",{className:"flex-[2] flex items-center justify-end space-x-2",children:[r.jsxs("label",{htmlFor:"perPage",className:"text-sm text-gray-500 dark:text-gray-400",children:[a("common.itemsPerPage"),":"]}),r.jsxs("select",{id:"perPage",value:x,onChange:re=>{w(Number(re.target.value)),b(1)},disabled:T,className:"border border-gray-300 dark:border-gray-600 rounded p-1 text-sm dark:bg-gray-700 dark:text-white outline-none disabled:opacity-50 disabled:cursor-not-allowed",children:[r.jsx("option",{value:10,children:"10"}),r.jsx("option",{value:20,children:"20"}),r.jsx("option",{value:50,children:"50"}),r.jsx("option",{value:100,children:"100"})]})]})]})]}),ge()]})},Cj=()=>{const{serverName:a}=Eg();return r.jsx(oo,{to:`/market/${a}?tab=cloud`,replace:!0})};function Wh(){const a=Tl();return r.jsx(Qw,{children:r.jsx(o2,{children:r.jsx(Xw,{children:r.jsx(Yw,{children:r.jsx(Ww,{children:r.jsx(Tv,{basename:a,children:r.jsxs(sv,{children:[r.jsx(er,{path:"/login",element:r.jsx(CS,{})}),r.jsx(er,{element:r.jsx(SS,{}),children:r.jsxs(er,{element:r.jsx(wS,{}),children:[r.jsx(er,{path:"/",element:r.jsx(kS,{})}),r.jsx(er,{path:"/servers",element:r.jsx(FS,{})}),r.jsx(er,{path:"/groups",element:r.jsx(QS,{})}),r.jsx(er,{path:"/users",element:r.jsx(WS,{})}),r.jsx(er,{path:"/market",element:r.jsx(Zh,{})}),r.jsx(er,{path:"/market/:serverName",element:r.jsx(Zh,{})}),r.jsx(er,{path:"/cloud",element:r.jsx(oo,{to:"/market?tab=cloud",replace:!0})}),r.jsx(er,{path:"/cloud/:serverName",element:r.jsx(Cj,{})}),r.jsx(er,{path:"/logs",element:r.jsx(Sj,{})}),r.jsx(er,{path:"/activity",element:r.jsx(Nj,{})}),r.jsx(er,{path:"/settings",element:r.jsx(aj,{})})]})}),r.jsx(er,{path:"*",element:r.jsx(oo,{to:"/"})})]})})})})})})})}const Oe=a=>typeof a=="string",Sl=()=>{let a,n;const l=new Promise((o,c)=>{a=o,n=c});return l.resolve=a,l.reject=n,l},eg=a=>a==null?"":""+a,kj=(a,n,l)=>{a.forEach(o=>{n[o]&&(l[o]=n[o])})},Aj=/###/g,tg=a=>a&&a.indexOf("###")>-1?a.replace(Aj,"."):a,rg=a=>!a||Oe(a),jl=(a,n,l)=>{const o=Oe(n)?n.split("."):n;let c=0;for(;c<o.length-1;){if(rg(a))return{};const d=tg(o[c]);!a[d]&&l&&(a[d]=new l),Object.prototype.hasOwnProperty.call(a,d)?a=a[d]:a={},++c}return rg(a)?{}:{obj:a,k:tg(o[c])}},ag=(a,n,l)=>{const{obj:o,k:c}=jl(a,n,Object);if(o!==void 0||n.length===1){o[c]=l;return}let d=n[n.length-1],m=n.slice(0,n.length-1),p=jl(a,m,Object);for(;p.obj===void 0&&m.length;)d=`${m[m.length-1]}.${d}`,m=m.slice(0,m.length-1),p=jl(a,m,Object),p!=null&&p.obj&&typeof p.obj[`${p.k}.${d}`]<"u"&&(p.obj=void 0);p.obj[`${p.k}.${d}`]=l},Ej=(a,n,l,o)=>{const{obj:c,k:d}=jl(a,n,Object);c[d]=c[d]||[],c[d].push(l)},uo=(a,n)=>{const{obj:l,k:o}=jl(a,n);if(l&&Object.prototype.hasOwnProperty.call(l,o))return l[o]},Tj=(a,n,l)=>{const o=uo(a,l);return o!==void 0?o:uo(n,l)},M0=(a,n,l)=>{for(const o in n)o!=="__proto__"&&o!=="constructor"&&(o in a?Oe(a[o])||a[o]instanceof String||Oe(n[o])||n[o]instanceof String?l&&(a[o]=n[o]):M0(a[o],n[o],l):a[o]=n[o]);return a},xn=a=>a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Rj={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Oj=a=>Oe(a)?a.replace(/[&<>"'\/]/g,n=>Rj[n]):a;class zj{constructor(n){this.capacity=n,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(n){const l=this.regExpMap.get(n);if(l!==void 0)return l;const o=new RegExp(n);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(n,o),this.regExpQueue.push(n),o}}const Mj=[" ",",","?","!",";"],Lj=new zj(20),Dj=(a,n,l)=>{n=n||"",l=l||"";const o=Mj.filter(m=>n.indexOf(m)<0&&l.indexOf(m)<0);if(o.length===0)return!0;const c=Lj.getRegExp(`(${o.map(m=>m==="?"?"\\?":m).join("|")})`);let d=!c.test(a);if(!d){const m=a.indexOf(l);m>0&&!c.test(a.substring(0,m))&&(d=!0)}return d},ld=(a,n,l=".")=>{if(!a)return;if(a[n])return Object.prototype.hasOwnProperty.call(a,n)?a[n]:void 0;const o=n.split(l);let c=a;for(let d=0;d<o.length;){if(!c||typeof c!="object")return;let m,p="";for(let g=d;g<o.length;++g)if(g!==d&&(p+=l),p+=o[g],m=c[p],m!==void 0){if(["string","number","boolean"].indexOf(typeof m)>-1&&g<o.length-1)continue;d+=g-d+1;break}c=m}return c},Cl=a=>a==null?void 0:a.replace("_","-"),Pj={type:"logger",log(a){this.output("log",a)},warn(a){this.output("warn",a)},error(a){this.output("error",a)},output(a,n){var l,o;(o=(l=console==null?void 0:console[a])==null?void 0:l.apply)==null||o.call(l,console,n)}};class mo{constructor(n,l={}){this.init(n,l)}init(n,l={}){this.prefix=l.prefix||"i18next:",this.logger=n||Pj,this.options=l,this.debug=l.debug}log(...n){return this.forward(n,"log","",!0)}warn(...n){return this.forward(n,"warn","",!0)}error(...n){return this.forward(n,"error","")}deprecate(...n){return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(n,l,o,c){return c&&!this.debug?null:(Oe(n[0])&&(n[0]=`${o}${this.prefix} ${n[0]}`),this.logger[l](n))}create(n){return new mo(this.logger,{prefix:`${this.prefix}:${n}:`,...this.options})}clone(n){return n=n||this.options,n.prefix=n.prefix||this.prefix,new mo(this.logger,n)}}var sa=new mo;class yo{constructor(){this.observers={}}on(n,l){return n.split(" ").forEach(o=>{this.observers[o]||(this.observers[o]=new Map);const c=this.observers[o].get(l)||0;this.observers[o].set(l,c+1)}),this}off(n,l){if(this.observers[n]){if(!l){delete this.observers[n];return}this.observers[n].delete(l)}}emit(n,...l){this.observers[n]&&Array.from(this.observers[n].entries()).forEach(([c,d])=>{for(let m=0;m<d;m++)c(...l)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([c,d])=>{for(let m=0;m<d;m++)c.apply(c,[n,...l])})}}class sg extends yo{constructor(n,l={ns:["translation"],defaultNS:"translation"}){super(),this.data=n||{},this.options=l,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(n){this.options.ns.indexOf(n)<0&&this.options.ns.push(n)}removeNamespaces(n){const l=this.options.ns.indexOf(n);l>-1&&this.options.ns.splice(l,1)}getResource(n,l,o,c={}){var h,b;const d=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,m=c.ignoreJSONStructure!==void 0?c.ignoreJSONStructure:this.options.ignoreJSONStructure;let p;n.indexOf(".")>-1?p=n.split("."):(p=[n,l],o&&(Array.isArray(o)?p.push(...o):Oe(o)&&d?p.push(...o.split(d)):p.push(o)));const g=uo(this.data,p);return!g&&!l&&!o&&n.indexOf(".")>-1&&(n=p[0],l=p[1],o=p.slice(2).join(".")),g||!m||!Oe(o)?g:ld((b=(h=this.data)==null?void 0:h[n])==null?void 0:b[l],o,d)}addResource(n,l,o,c,d={silent:!1}){const m=d.keySeparator!==void 0?d.keySeparator:this.options.keySeparator;let p=[n,l];o&&(p=p.concat(m?o.split(m):o)),n.indexOf(".")>-1&&(p=n.split("."),c=l,l=p[1]),this.addNamespaces(l),ag(this.data,p,c),d.silent||this.emit("added",n,l,o,c)}addResources(n,l,o,c={silent:!1}){for(const d in o)(Oe(o[d])||Array.isArray(o[d]))&&this.addResource(n,l,d,o[d],{silent:!0});c.silent||this.emit("added",n,l,o)}addResourceBundle(n,l,o,c,d,m={silent:!1,skipCopy:!1}){let p=[n,l];n.indexOf(".")>-1&&(p=n.split("."),c=o,o=l,l=p[1]),this.addNamespaces(l);let g=uo(this.data,p)||{};m.skipCopy||(o=JSON.parse(JSON.stringify(o))),c?M0(g,o,d):g={...g,...o},ag(this.data,p,g),m.silent||this.emit("added",n,l,o)}removeResourceBundle(n,l){this.hasResourceBundle(n,l)&&delete this.data[n][l],this.removeNamespaces(l),this.emit("removed",n,l)}hasResourceBundle(n,l){return this.getResource(n,l)!==void 0}getResourceBundle(n,l){return l||(l=this.options.defaultNS),this.getResource(n,l)}getDataByLanguage(n){return this.data[n]}hasLanguageSomeTranslations(n){const l=this.getDataByLanguage(n);return!!(l&&Object.keys(l)||[]).find(c=>l[c]&&Object.keys(l[c]).length>0)}toJSON(){return this.data}}var L0={processors:{},addPostProcessor(a){this.processors[a.name]=a},handle(a,n,l,o,c){return a.forEach(d=>{var m;n=((m=this.processors[d])==null?void 0:m.process(n,l,o,c))??n}),n}};const D0=Symbol("i18next/PATH_KEY");function Uj(){const a=[],n=Object.create(null);let l;return n.get=(o,c)=>{var d;return(d=l==null?void 0:l.revoke)==null||d.call(l),c===D0?a:(a.push(c),l=Proxy.revocable(o,n),l.proxy)},Proxy.revocable(Object.create(null),n).proxy}function id(a,n){const{[D0]:l}=a(Uj());return l.join((n==null?void 0:n.keySeparator)??".")}const ng={},Fu=a=>!Oe(a)&&typeof a!="boolean"&&typeof a!="number";class fo extends yo{constructor(n,l={}){super(),kj(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,this),this.options=l,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=sa.create("translator")}changeLanguage(n){n&&(this.language=n)}exists(n,l={interpolation:{}}){const o={...l};if(n==null)return!1;const c=this.resolve(n,o);if((c==null?void 0:c.res)===void 0)return!1;const d=Fu(c.res);return!(o.returnObjects===!1&&d)}extractFromKey(n,l){let o=l.nsSeparator!==void 0?l.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");const c=l.keySeparator!==void 0?l.keySeparator:this.options.keySeparator;let d=l.ns||this.options.defaultNS||[];const m=o&&n.indexOf(o)>-1,p=!this.options.userDefinedKeySeparator&&!l.keySeparator&&!this.options.userDefinedNsSeparator&&!l.nsSeparator&&!Dj(n,o,c);if(m&&!p){const g=n.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:n,namespaces:Oe(d)?[d]:d};const h=n.split(o);(o!==c||o===c&&this.options.ns.indexOf(h[0])>-1)&&(d=h.shift()),n=h.join(c)}return{key:n,namespaces:Oe(d)?[d]:d}}translate(n,l,o){let c=typeof l=="object"?{...l}:l;if(typeof c!="object"&&this.options.overloadTranslationOptionHandler&&(c=this.options.overloadTranslationOptionHandler(arguments)),typeof c=="object"&&(c={...c}),c||(c={}),n==null)return"";typeof n=="function"&&(n=id(n,{...this.options,...c})),Array.isArray(n)||(n=[String(n)]);const d=c.returnDetails!==void 0?c.returnDetails:this.options.returnDetails,m=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,{key:p,namespaces:g}=this.extractFromKey(n[n.length-1],c),h=g[g.length-1];let b=c.nsSeparator!==void 0?c.nsSeparator:this.options.nsSeparator;b===void 0&&(b=":");const x=c.lng||this.language,w=c.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((x==null?void 0:x.toLowerCase())==="cimode")return w?d?{res:`${h}${b}${p}`,usedKey:p,exactUsedKey:p,usedLng:x,usedNS:h,usedParams:this.getUsedParamsDetails(c)}:`${h}${b}${p}`:d?{res:p,usedKey:p,exactUsedKey:p,usedLng:x,usedNS:h,usedParams:this.getUsedParamsDetails(c)}:p;const T=this.resolve(n,c);let R=T==null?void 0:T.res;const O=(T==null?void 0:T.usedKey)||p,E=(T==null?void 0:T.exactUsedKey)||p,A=["[object Number]","[object Function]","[object RegExp]"],N=c.joinArrays!==void 0?c.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject,D=c.count!==void 0&&!Oe(c.count),P=fo.hasDefaultValue(c),$=D?this.pluralResolver.getSuffix(x,c.count,c):"",B=c.ordinal&&D?this.pluralResolver.getSuffix(x,c.count,{ordinal:!1}):"",L=D&&!c.ordinal&&c.count===0,Y=L&&c[`defaultValue${this.options.pluralSeparator}zero`]||c[`defaultValue${$}`]||c[`defaultValue${B}`]||c.defaultValue;let fe=R;S&&!R&&P&&(fe=Y);const G=Fu(fe),K=Object.prototype.toString.apply(fe);if(S&&fe&&G&&A.indexOf(K)<0&&!(Oe(N)&&Array.isArray(fe))){if(!c.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const X=this.options.returnedObjectHandler?this.options.returnedObjectHandler(O,fe,{...c,ns:g}):`key '${p} (${this.language})' returned an object instead of string.`;return d?(T.res=X,T.usedParams=this.getUsedParamsDetails(c),T):X}if(m){const X=Array.isArray(fe),H=X?[]:{},Z=X?E:O;for(const C in fe)if(Object.prototype.hasOwnProperty.call(fe,C)){const I=`${Z}${m}${C}`;P&&!R?H[C]=this.translate(I,{...c,defaultValue:Fu(Y)?Y[C]:void 0,joinArrays:!1,ns:g}):H[C]=this.translate(I,{...c,joinArrays:!1,ns:g}),H[C]===I&&(H[C]=fe[C])}R=H}}else if(S&&Oe(N)&&Array.isArray(R))R=R.join(N),R&&(R=this.extendTranslation(R,n,c,o));else{let X=!1,H=!1;!this.isValidLookup(R)&&P&&(X=!0,R=Y),this.isValidLookup(R)||(H=!0,R=p);const C=(c.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&H?void 0:R,I=P&&Y!==R&&this.options.updateMissing;if(H||X||I){if(this.logger.log(I?"updateKey":"missingKey",x,h,p,I?Y:R),m){const j=this.resolve(p,{...c,keySeparator:!1});j&&j.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let U=[];const oe=this.languageUtils.getFallbackCodes(this.options.fallbackLng,c.lng||this.language);if(this.options.saveMissingTo==="fallback"&&oe&&oe[0])for(let j=0;j<oe.length;j++)U.push(oe[j]);else this.options.saveMissingTo==="all"?U=this.languageUtils.toResolveHierarchy(c.lng||this.language):U.push(c.lng||this.language);const V=(j,M,z)=>{var pe;const q=P&&z!==R?z:C;this.options.missingKeyHandler?this.options.missingKeyHandler(j,h,M,q,I,c):(pe=this.backendConnector)!=null&&pe.saveMissing&&this.backendConnector.saveMissing(j,h,M,q,I,c),this.emit("missingKey",j,h,M,R)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?U.forEach(j=>{const M=this.pluralResolver.getSuffixes(j,c);L&&c[`defaultValue${this.options.pluralSeparator}zero`]&&M.indexOf(`${this.options.pluralSeparator}zero`)<0&&M.push(`${this.options.pluralSeparator}zero`),M.forEach(z=>{V([j],p+z,c[`defaultValue${z}`]||Y)})}):V(U,p,Y))}R=this.extendTranslation(R,n,c,T,o),H&&R===p&&this.options.appendNamespaceToMissingKey&&(R=`${h}${b}${p}`),(H||X)&&this.options.parseMissingKeyHandler&&(R=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${b}${p}`:p,X?R:void 0,c))}return d?(T.res=R,T.usedParams=this.getUsedParamsDetails(c),T):R}extendTranslation(n,l,o,c,d){var g,h;if((g=this.i18nFormat)!=null&&g.parse)n=this.i18nFormat.parse(n,{...this.options.interpolation.defaultVariables,...o},o.lng||this.language||c.usedLng,c.usedNS,c.usedKey,{resolved:c});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init({...o,interpolation:{...this.options.interpolation,...o.interpolation}});const b=Oe(n)&&(((h=o==null?void 0:o.interpolation)==null?void 0:h.skipOnVariables)!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let x;if(b){const T=n.match(this.interpolator.nestingRegexp);x=T&&T.length}let w=o.replace&&!Oe(o.replace)?o.replace:o;if(this.options.interpolation.defaultVariables&&(w={...this.options.interpolation.defaultVariables,...w}),n=this.interpolator.interpolate(n,w,o.lng||this.language||c.usedLng,o),b){const T=n.match(this.interpolator.nestingRegexp),R=T&&T.length;x<R&&(o.nest=!1)}!o.lng&&c&&c.res&&(o.lng=this.language||c.usedLng),o.nest!==!1&&(n=this.interpolator.nest(n,(...T)=>(d==null?void 0:d[0])===T[0]&&!o.context?(this.logger.warn(`It seems you are nesting recursively key: ${T[0]} in key: ${l[0]}`),null):this.translate(...T,l),o)),o.interpolation&&this.interpolator.reset()}const m=o.postProcess||this.options.postProcess,p=Oe(m)?[m]:m;return n!=null&&(p!=null&&p.length)&&o.applyPostProcessor!==!1&&(n=L0.handle(p,n,l,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...c,usedParams:this.getUsedParamsDetails(o)},...o}:o,this)),n}resolve(n,l={}){let o,c,d,m,p;return Oe(n)&&(n=[n]),n.forEach(g=>{if(this.isValidLookup(o))return;const h=this.extractFromKey(g,l),b=h.key;c=b;let x=h.namespaces;this.options.fallbackNS&&(x=x.concat(this.options.fallbackNS));const w=l.count!==void 0&&!Oe(l.count),T=w&&!l.ordinal&&l.count===0,R=l.context!==void 0&&(Oe(l.context)||typeof l.context=="number")&&l.context!=="",O=l.lngs?l.lngs:this.languageUtils.toResolveHierarchy(l.lng||this.language,l.fallbackLng);x.forEach(E=>{var A,N;this.isValidLookup(o)||(p=E,!ng[`${O[0]}-${E}`]&&((A=this.utils)!=null&&A.hasLoadedNamespace)&&!((N=this.utils)!=null&&N.hasLoadedNamespace(p))&&(ng[`${O[0]}-${E}`]=!0,this.logger.warn(`key "${c}" for languages "${O.join(", ")}" won't get resolved as namespace "${p}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),O.forEach(S=>{var $;if(this.isValidLookup(o))return;m=S;const D=[b];if(($=this.i18nFormat)!=null&&$.addLookupKeys)this.i18nFormat.addLookupKeys(D,b,S,E,l);else{let B;w&&(B=this.pluralResolver.getSuffix(S,l.count,l));const L=`${this.options.pluralSeparator}zero`,Y=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(w&&(l.ordinal&&B.indexOf(Y)===0&&D.push(b+B.replace(Y,this.options.pluralSeparator)),D.push(b+B),T&&D.push(b+L)),R){const fe=`${b}${this.options.contextSeparator||"_"}${l.context}`;D.push(fe),w&&(l.ordinal&&B.indexOf(Y)===0&&D.push(fe+B.replace(Y,this.options.pluralSeparator)),D.push(fe+B),T&&D.push(fe+L))}}let P;for(;P=D.pop();)this.isValidLookup(o)||(d=P,o=this.getResource(S,E,P,l))}))})}),{res:o,usedKey:c,exactUsedKey:d,usedLng:m,usedNS:p}}isValidLookup(n){return n!==void 0&&!(!this.options.returnNull&&n===null)&&!(!this.options.returnEmptyString&&n==="")}getResource(n,l,o,c={}){var d;return(d=this.i18nFormat)!=null&&d.getResource?this.i18nFormat.getResource(n,l,o,c):this.resourceStore.getResource(n,l,o,c)}getUsedParamsDetails(n={}){const l=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],o=n.replace&&!Oe(n.replace);let c=o?n.replace:n;if(o&&typeof n.count<"u"&&(c.count=n.count),this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),!o){c={...c};for(const d of l)delete c[d]}return c}static hasDefaultValue(n){const l="defaultValue";for(const o in n)if(Object.prototype.hasOwnProperty.call(n,o)&&l===o.substring(0,l.length)&&n[o]!==void 0)return!0;return!1}}class lg{constructor(n){this.options=n,this.supportedLngs=this.options.supportedLngs||!1,this.logger=sa.create("languageUtils")}getScriptPartFromCode(n){if(n=Cl(n),!n||n.indexOf("-")<0)return null;const l=n.split("-");return l.length===2||(l.pop(),l[l.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(l.join("-"))}getLanguagePartFromCode(n){if(n=Cl(n),!n||n.indexOf("-")<0)return n;const l=n.split("-");return this.formatLanguageCode(l[0])}formatLanguageCode(n){if(Oe(n)&&n.indexOf("-")>-1){let l;try{l=Intl.getCanonicalLocales(n)[0]}catch{}return l&&this.options.lowerCaseLng&&(l=l.toLowerCase()),l||(this.options.lowerCaseLng?n.toLowerCase():n)}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}isSupportedCode(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}getBestMatchFromCodes(n){if(!n)return null;let l;return n.forEach(o=>{if(l)return;const c=this.formatLanguageCode(o);(!this.options.supportedLngs||this.isSupportedCode(c))&&(l=c)}),!l&&this.options.supportedLngs&&n.forEach(o=>{if(l)return;const c=this.getScriptPartFromCode(o);if(this.isSupportedCode(c))return l=c;const d=this.getLanguagePartFromCode(o);if(this.isSupportedCode(d))return l=d;l=this.options.supportedLngs.find(m=>{if(m===d)return m;if(!(m.indexOf("-")<0&&d.indexOf("-")<0)&&(m.indexOf("-")>0&&d.indexOf("-")<0&&m.substring(0,m.indexOf("-"))===d||m.indexOf(d)===0&&d.length>1))return m})}),l||(l=this.getFallbackCodes(this.options.fallbackLng)[0]),l}getFallbackCodes(n,l){if(!n)return[];if(typeof n=="function"&&(n=n(l)),Oe(n)&&(n=[n]),Array.isArray(n))return n;if(!l)return n.default||[];let o=n[l];return o||(o=n[this.getScriptPartFromCode(l)]),o||(o=n[this.formatLanguageCode(l)]),o||(o=n[this.getLanguagePartFromCode(l)]),o||(o=n.default),o||[]}toResolveHierarchy(n,l){const o=this.getFallbackCodes((l===!1?[]:l)||this.options.fallbackLng||[],n),c=[],d=m=>{m&&(this.isSupportedCode(m)?c.push(m):this.logger.warn(`rejecting language code not found in supportedLngs: ${m}`))};return Oe(n)&&(n.indexOf("-")>-1||n.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&d(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&d(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&d(this.getLanguagePartFromCode(n))):Oe(n)&&d(this.formatLanguageCode(n)),o.forEach(m=>{c.indexOf(m)<0&&d(this.formatLanguageCode(m))}),c}}const ig={zero:0,one:1,two:2,few:3,many:4,other:5},og={select:a=>a===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class _j{constructor(n,l={}){this.languageUtils=n,this.options=l,this.logger=sa.create("pluralResolver"),this.pluralRulesCache={}}addRule(n,l){this.rules[n]=l}clearCache(){this.pluralRulesCache={}}getRule(n,l={}){const o=Cl(n==="dev"?"en":n),c=l.ordinal?"ordinal":"cardinal",d=JSON.stringify({cleanedCode:o,type:c});if(d in this.pluralRulesCache)return this.pluralRulesCache[d];let m;try{m=new Intl.PluralRules(o,{type:c})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),og;if(!n.match(/-|_/))return og;const g=this.languageUtils.getLanguagePartFromCode(n);m=this.getRule(g,l)}return this.pluralRulesCache[d]=m,m}needsPlural(n,l={}){let o=this.getRule(n,l);return o||(o=this.getRule("dev",l)),(o==null?void 0:o.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(n,l,o={}){return this.getSuffixes(n,o).map(c=>`${l}${c}`)}getSuffixes(n,l={}){let o=this.getRule(n,l);return o||(o=this.getRule("dev",l)),o?o.resolvedOptions().pluralCategories.sort((c,d)=>ig[c]-ig[d]).map(c=>`${this.options.prepend}${l.ordinal?`ordinal${this.options.prepend}`:""}${c}`):[]}getSuffix(n,l,o={}){const c=this.getRule(n,o);return c?`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${c.select(l)}`:(this.logger.warn(`no plural rule found for: ${n}`),this.getSuffix("dev",l,o))}}const cg=(a,n,l,o=".",c=!0)=>{let d=Tj(a,n,l);return!d&&c&&Oe(l)&&(d=ld(a,l,o),d===void 0&&(d=ld(n,l,o))),d},Vu=a=>a.replace(/\$/g,"$$$$");class Bj{constructor(n={}){var l;this.logger=sa.create("interpolator"),this.options=n,this.format=((l=n==null?void 0:n.interpolation)==null?void 0:l.format)||(o=>o),this.init(n)}init(n={}){n.interpolation||(n.interpolation={escapeValue:!0});const{escape:l,escapeValue:o,useRawValueToEscape:c,prefix:d,prefixEscaped:m,suffix:p,suffixEscaped:g,formatSeparator:h,unescapeSuffix:b,unescapePrefix:x,nestingPrefix:w,nestingPrefixEscaped:T,nestingSuffix:R,nestingSuffixEscaped:O,nestingOptionsSeparator:E,maxReplaces:A,alwaysFormat:N}=n.interpolation;this.escape=l!==void 0?l:Oj,this.escapeValue=o!==void 0?o:!0,this.useRawValueToEscape=c!==void 0?c:!1,this.prefix=d?xn(d):m||"{{",this.suffix=p?xn(p):g||"}}",this.formatSeparator=h||",",this.unescapePrefix=b?"":x||"-",this.unescapeSuffix=this.unescapePrefix?"":b||"",this.nestingPrefix=w?xn(w):T||xn("$t("),this.nestingSuffix=R?xn(R):O||xn(")"),this.nestingOptionsSeparator=E||",",this.maxReplaces=A||1e3,this.alwaysFormat=N!==void 0?N:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const n=(l,o)=>(l==null?void 0:l.source)===o?(l.lastIndex=0,l):new RegExp(o,"g");this.regexp=n(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=n(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=n(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(n,l,o,c){var T;let d,m,p;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=R=>{if(R.indexOf(this.formatSeparator)<0){const N=cg(l,g,R,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(N,void 0,o,{...c,...l,interpolationkey:R}):N}const O=R.split(this.formatSeparator),E=O.shift().trim(),A=O.join(this.formatSeparator).trim();return this.format(cg(l,g,E,this.options.keySeparator,this.options.ignoreJSONStructure),A,o,{...c,...l,interpolationkey:E})};this.resetRegExp();const b=(c==null?void 0:c.missingInterpolationHandler)||this.options.missingInterpolationHandler,x=((T=c==null?void 0:c.interpolation)==null?void 0:T.skipOnVariables)!==void 0?c.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:R=>Vu(R)},{regex:this.regexp,safeValue:R=>this.escapeValue?Vu(this.escape(R)):Vu(R)}].forEach(R=>{for(p=0;d=R.regex.exec(n);){const O=d[1].trim();if(m=h(O),m===void 0)if(typeof b=="function"){const A=b(n,d,c);m=Oe(A)?A:""}else if(c&&Object.prototype.hasOwnProperty.call(c,O))m="";else if(x){m=d[0];continue}else this.logger.warn(`missed to pass in variable ${O} for interpolating ${n}`),m="";else!Oe(m)&&!this.useRawValueToEscape&&(m=eg(m));const E=R.safeValue(m);if(n=n.replace(d[0],E),x?(R.regex.lastIndex+=m.length,R.regex.lastIndex-=d[0].length):R.regex.lastIndex=0,p++,p>=this.maxReplaces)break}}),n}nest(n,l,o={}){let c,d,m;const p=(g,h)=>{const b=this.nestingOptionsSeparator;if(g.indexOf(b)<0)return g;const x=g.split(new RegExp(`${b}[ ]*{`));let w=`{${x[1]}`;g=x[0],w=this.interpolate(w,m);const T=w.match(/'/g),R=w.match(/"/g);(((T==null?void 0:T.length)??0)%2===0&&!R||R.length%2!==0)&&(w=w.replace(/'/g,'"'));try{m=JSON.parse(w),h&&(m={...h,...m})}catch(O){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,O),`${g}${b}${w}`}return m.defaultValue&&m.defaultValue.indexOf(this.prefix)>-1&&delete m.defaultValue,g};for(;c=this.nestingRegexp.exec(n);){let g=[];m={...o},m=m.replace&&!Oe(m.replace)?m.replace:m,m.applyPostProcessor=!1,delete m.defaultValue;const h=/{.*}/.test(c[1])?c[1].lastIndexOf("}")+1:c[1].indexOf(this.formatSeparator);if(h!==-1&&(g=c[1].slice(h).split(this.formatSeparator).map(b=>b.trim()).filter(Boolean),c[1]=c[1].slice(0,h)),d=l(p.call(this,c[1].trim(),m),m),d&&c[0]===n&&!Oe(d))return d;Oe(d)||(d=eg(d)),d||(this.logger.warn(`missed to resolve ${c[1]} for nesting ${n}`),d=""),g.length&&(d=g.reduce((b,x)=>this.format(b,x,o.lng,{...o,interpolationkey:c[1].trim()}),d.trim())),n=n.replace(c[0],d),this.regexp.lastIndex=0}return n}}const Ij=a=>{let n=a.toLowerCase().trim();const l={};if(a.indexOf("(")>-1){const o=a.split("(");n=o[0].toLowerCase().trim();const c=o[1].substring(0,o[1].length-1);n==="currency"&&c.indexOf(":")<0?l.currency||(l.currency=c.trim()):n==="relativetime"&&c.indexOf(":")<0?l.range||(l.range=c.trim()):c.split(";").forEach(m=>{if(m){const[p,...g]=m.split(":"),h=g.join(":").trim().replace(/^'+|'+$/g,""),b=p.trim();l[b]||(l[b]=h),h==="false"&&(l[b]=!1),h==="true"&&(l[b]=!0),isNaN(h)||(l[b]=parseInt(h,10))}})}return{formatName:n,formatOptions:l}},ug=a=>{const n={};return(l,o,c)=>{let d=c;c&&c.interpolationkey&&c.formatParams&&c.formatParams[c.interpolationkey]&&c[c.interpolationkey]&&(d={...d,[c.interpolationkey]:void 0});const m=o+JSON.stringify(d);let p=n[m];return p||(p=a(Cl(o),c),n[m]=p),p(l)}},Hj=a=>(n,l,o)=>a(Cl(l),o)(n);class Gj{constructor(n={}){this.logger=sa.create("formatter"),this.options=n,this.init(n)}init(n,l={interpolation:{}}){this.formatSeparator=l.interpolation.formatSeparator||",";const o=l.cacheInBuiltFormats?ug:Hj;this.formats={number:o((c,d)=>{const m=new Intl.NumberFormat(c,{...d});return p=>m.format(p)}),currency:o((c,d)=>{const m=new Intl.NumberFormat(c,{...d,style:"currency"});return p=>m.format(p)}),datetime:o((c,d)=>{const m=new Intl.DateTimeFormat(c,{...d});return p=>m.format(p)}),relativetime:o((c,d)=>{const m=new Intl.RelativeTimeFormat(c,{...d});return p=>m.format(p,d.range||"day")}),list:o((c,d)=>{const m=new Intl.ListFormat(c,{...d});return p=>m.format(p)})}}add(n,l){this.formats[n.toLowerCase().trim()]=l}addCached(n,l){this.formats[n.toLowerCase().trim()]=ug(l)}format(n,l,o,c={}){const d=l.split(this.formatSeparator);if(d.length>1&&d[0].indexOf("(")>1&&d[0].indexOf(")")<0&&d.find(p=>p.indexOf(")")>-1)){const p=d.findIndex(g=>g.indexOf(")")>-1);d[0]=[d[0],...d.splice(1,p)].join(this.formatSeparator)}return d.reduce((p,g)=>{var x;const{formatName:h,formatOptions:b}=Ij(g);if(this.formats[h]){let w=p;try{const T=((x=c==null?void 0:c.formatParams)==null?void 0:x[c.interpolationkey])||{},R=T.locale||T.lng||c.locale||c.lng||o;w=this.formats[h](p,R,{...b,...c,...T})}catch(T){this.logger.warn(T)}return w}else this.logger.warn(`there was no format function for ${h}`);return p},n)}}const Kj=(a,n)=>{a.pending[n]!==void 0&&(delete a.pending[n],a.pendingCount--)};class qj extends yo{constructor(n,l,o,c={}){var d,m;super(),this.backend=n,this.store=l,this.services=o,this.languageUtils=o.languageUtils,this.options=c,this.logger=sa.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=c.maxParallelReads||10,this.readingCalls=0,this.maxRetries=c.maxRetries>=0?c.maxRetries:5,this.retryTimeout=c.retryTimeout>=1?c.retryTimeout:350,this.state={},this.queue=[],(m=(d=this.backend)==null?void 0:d.init)==null||m.call(d,o,c.backend,c)}queueLoad(n,l,o,c){const d={},m={},p={},g={};return n.forEach(h=>{let b=!0;l.forEach(x=>{const w=`${h}|${x}`;!o.reload&&this.store.hasResourceBundle(h,x)?this.state[w]=2:this.state[w]<0||(this.state[w]===1?m[w]===void 0&&(m[w]=!0):(this.state[w]=1,b=!1,m[w]===void 0&&(m[w]=!0),d[w]===void 0&&(d[w]=!0),g[x]===void 0&&(g[x]=!0)))}),b||(p[h]=!0)}),(Object.keys(d).length||Object.keys(m).length)&&this.queue.push({pending:m,pendingCount:Object.keys(m).length,loaded:{},errors:[],callback:c}),{toLoad:Object.keys(d),pending:Object.keys(m),toLoadLanguages:Object.keys(p),toLoadNamespaces:Object.keys(g)}}loaded(n,l,o){const c=n.split("|"),d=c[0],m=c[1];l&&this.emit("failedLoading",d,m,l),!l&&o&&this.store.addResourceBundle(d,m,o,void 0,void 0,{skipCopy:!0}),this.state[n]=l?-1:2,l&&o&&(this.state[n]=0);const p={};this.queue.forEach(g=>{Ej(g.loaded,[d],m),Kj(g,n),l&&g.errors.push(l),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(h=>{p[h]||(p[h]={});const b=g.loaded[h];b.length&&b.forEach(x=>{p[h][x]===void 0&&(p[h][x]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",p),this.queue=this.queue.filter(g=>!g.done)}read(n,l,o,c=0,d=this.retryTimeout,m){if(!n.length)return m(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:n,ns:l,fcName:o,tried:c,wait:d,callback:m});return}this.readingCalls++;const p=(h,b)=>{if(this.readingCalls--,this.waitingReads.length>0){const x=this.waitingReads.shift();this.read(x.lng,x.ns,x.fcName,x.tried,x.wait,x.callback)}if(h&&b&&c<this.maxRetries){setTimeout(()=>{this.read.call(this,n,l,o,c+1,d*2,m)},d);return}m(h,b)},g=this.backend[o].bind(this.backend);if(g.length===2){try{const h=g(n,l);h&&typeof h.then=="function"?h.then(b=>p(null,b)).catch(p):p(null,h)}catch(h){p(h)}return}return g(n,l,p)}prepareLoading(n,l,o={},c){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),c&&c();Oe(n)&&(n=this.languageUtils.toResolveHierarchy(n)),Oe(l)&&(l=[l]);const d=this.queueLoad(n,l,o,c);if(!d.toLoad.length)return d.pending.length||c(),null;d.toLoad.forEach(m=>{this.loadOne(m)})}load(n,l,o){this.prepareLoading(n,l,{},o)}reload(n,l,o){this.prepareLoading(n,l,{reload:!0},o)}loadOne(n,l=""){const o=n.split("|"),c=o[0],d=o[1];this.read(c,d,"read",void 0,void 0,(m,p)=>{m&&this.logger.warn(`${l}loading namespace ${d} for language ${c} failed`,m),!m&&p&&this.logger.log(`${l}loaded namespace ${d} for language ${c}`,p),this.loaded(n,m,p)})}saveMissing(n,l,o,c,d,m={},p=()=>{}){var g,h,b,x,w;if((h=(g=this.services)==null?void 0:g.utils)!=null&&h.hasLoadedNamespace&&!((x=(b=this.services)==null?void 0:b.utils)!=null&&x.hasLoadedNamespace(l))){this.logger.warn(`did not save key "${o}" as the namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(o==null||o==="")){if((w=this.backend)!=null&&w.create){const T={...m,isUpdate:d},R=this.backend.create.bind(this.backend);if(R.length<6)try{let O;R.length===5?O=R(n,l,o,c,T):O=R(n,l,o,c),O&&typeof O.then=="function"?O.then(E=>p(null,E)).catch(p):p(null,O)}catch(O){p(O)}else R(n,l,o,c,p,T)}!n||!n[0]||this.store.addResource(n[0],l,o,c)}}}const dg=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:a=>{let n={};if(typeof a[1]=="object"&&(n=a[1]),Oe(a[1])&&(n.defaultValue=a[1]),Oe(a[2])&&(n.tDescription=a[2]),typeof a[2]=="object"||typeof a[3]=="object"){const l=a[3]||a[2];Object.keys(l).forEach(o=>{n[o]=l[o]})}return n},interpolation:{escapeValue:!0,format:a=>a,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),mg=a=>{var n,l;return Oe(a.ns)&&(a.ns=[a.ns]),Oe(a.fallbackLng)&&(a.fallbackLng=[a.fallbackLng]),Oe(a.fallbackNS)&&(a.fallbackNS=[a.fallbackNS]),((l=(n=a.supportedLngs)==null?void 0:n.indexOf)==null?void 0:l.call(n,"cimode"))<0&&(a.supportedLngs=a.supportedLngs.concat(["cimode"])),typeof a.initImmediate=="boolean"&&(a.initAsync=a.initImmediate),a},eo=()=>{},Fj=a=>{Object.getOwnPropertyNames(Object.getPrototypeOf(a)).forEach(l=>{typeof a[l]=="function"&&(a[l]=a[l].bind(a))})};class kl extends yo{constructor(n={},l){if(super(),this.options=mg(n),this.services={},this.logger=sa,this.modules={external:[]},Fj(this),l&&!this.isInitialized&&!n.isClone){if(!this.options.initAsync)return this.init(n,l),this;setTimeout(()=>{this.init(n,l)},0)}}init(n={},l){this.isInitializing=!0,typeof n=="function"&&(l=n,n={}),n.defaultNS==null&&n.ns&&(Oe(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const o=dg();this.options={...o,...this.options,...mg(n)},this.options.interpolation={...o.interpolation,...this.options.interpolation},n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);const c=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?sa.init(c(this.modules.logger),this.options):sa.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=Gj;const b=new lg(this.options);this.store=new sg(this.options.resources,this.options);const x=this.services;x.logger=sa,x.resourceStore=this.store,x.languageUtils=b,x.pluralResolver=new _j(b,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==o.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),h&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(x.formatter=c(h),x.formatter.init&&x.formatter.init(x,this.options),this.options.interpolation.format=x.formatter.format.bind(x.formatter)),x.interpolator=new Bj(this.options),x.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},x.backendConnector=new qj(c(this.modules.backend),x.resourceStore,x,this.options),x.backendConnector.on("*",(T,...R)=>{this.emit(T,...R)}),this.modules.languageDetector&&(x.languageDetector=c(this.modules.languageDetector),x.languageDetector.init&&x.languageDetector.init(x,this.options.detection,this.options)),this.modules.i18nFormat&&(x.i18nFormat=c(this.modules.i18nFormat),x.i18nFormat.init&&x.i18nFormat.init(this)),this.translator=new fo(this.services,this.options),this.translator.on("*",(T,...R)=>{this.emit(T,...R)}),this.modules.external.forEach(T=>{T.init&&T.init(this)})}if(this.format=this.options.interpolation.format,l||(l=eo),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(h=>{this[h]=(...b)=>this.store[h](...b)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=(...b)=>(this.store[h](...b),this)});const p=Sl(),g=()=>{const h=(b,x)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),p.resolve(x),l(b,x)};if(this.languages&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initAsync?g():setTimeout(g,0),p}loadResources(n,l=eo){var d,m;let o=l;const c=Oe(n)?n:this.language;if(typeof n=="function"&&(o=n),!this.options.resources||this.options.partialBundledLanguages){if((c==null?void 0:c.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return o();const p=[],g=h=>{if(!h||h==="cimode")return;this.services.languageUtils.toResolveHierarchy(h).forEach(x=>{x!=="cimode"&&p.indexOf(x)<0&&p.push(x)})};c?g(c):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(b=>g(b)),(m=(d=this.options.preload)==null?void 0:d.forEach)==null||m.call(d,h=>g(h)),this.services.backendConnector.load(p,this.options.ns,h=>{!h&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),o(h)})}else o(null)}reloadResources(n,l,o){const c=Sl();return typeof n=="function"&&(o=n,n=void 0),typeof l=="function"&&(o=l,l=void 0),n||(n=this.languages),l||(l=this.options.ns),o||(o=eo),this.services.backendConnector.reload(n,l,d=>{c.resolve(),o(d)}),c}use(n){if(!n)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!n.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return n.type==="backend"&&(this.modules.backend=n),(n.type==="logger"||n.log&&n.warn&&n.error)&&(this.modules.logger=n),n.type==="languageDetector"&&(this.modules.languageDetector=n),n.type==="i18nFormat"&&(this.modules.i18nFormat=n),n.type==="postProcessor"&&L0.addPostProcessor(n),n.type==="formatter"&&(this.modules.formatter=n),n.type==="3rdParty"&&this.modules.external.push(n),this}setResolvedLanguage(n){if(!(!n||!this.languages)&&!(["cimode","dev"].indexOf(n)>-1)){for(let l=0;l<this.languages.length;l++){const o=this.languages[l];if(!(["cimode","dev"].indexOf(o)>-1)&&this.store.hasLanguageSomeTranslations(o)){this.resolvedLanguage=o;break}}!this.resolvedLanguage&&this.languages.indexOf(n)<0&&this.store.hasLanguageSomeTranslations(n)&&(this.resolvedLanguage=n,this.languages.unshift(n))}}changeLanguage(n,l){this.isLanguageChangingTo=n;const o=Sl();this.emit("languageChanging",n);const c=p=>{this.language=p,this.languages=this.services.languageUtils.toResolveHierarchy(p),this.resolvedLanguage=void 0,this.setResolvedLanguage(p)},d=(p,g)=>{g?this.isLanguageChangingTo===n&&(c(g),this.translator.changeLanguage(g),this.isLanguageChangingTo=void 0,this.emit("languageChanged",g),this.logger.log("languageChanged",g)):this.isLanguageChangingTo=void 0,o.resolve((...h)=>this.t(...h)),l&&l(p,(...h)=>this.t(...h))},m=p=>{var b,x;!n&&!p&&this.services.languageDetector&&(p=[]);const g=Oe(p)?p:p&&p[0],h=this.store.hasLanguageSomeTranslations(g)?g:this.services.languageUtils.getBestMatchFromCodes(Oe(p)?[p]:p);h&&(this.language||c(h),this.translator.language||this.translator.changeLanguage(h),(x=(b=this.services.languageDetector)==null?void 0:b.cacheUserLanguage)==null||x.call(b,h)),this.loadResources(h,w=>{d(w,h)})};return!n&&this.services.languageDetector&&!this.services.languageDetector.async?m(this.services.languageDetector.detect()):!n&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(m):this.services.languageDetector.detect(m):m(n),o}getFixedT(n,l,o){const c=(d,m,...p)=>{let g;typeof m!="object"?g=this.options.overloadTranslationOptionHandler([d,m].concat(p)):g={...m},g.lng=g.lng||c.lng,g.lngs=g.lngs||c.lngs,g.ns=g.ns||c.ns,g.keyPrefix!==""&&(g.keyPrefix=g.keyPrefix||o||c.keyPrefix);const h=this.options.keySeparator||".";let b;return g.keyPrefix&&Array.isArray(d)?b=d.map(x=>(typeof x=="function"&&(x=id(x,{...this.options,...m})),`${g.keyPrefix}${h}${x}`)):(typeof d=="function"&&(d=id(d,{...this.options,...m})),b=g.keyPrefix?`${g.keyPrefix}${h}${d}`:d),this.t(b,g)};return Oe(n)?c.lng=n:c.lngs=n,c.ns=l,c.keyPrefix=o,c}t(...n){var l;return(l=this.translator)==null?void 0:l.translate(...n)}exists(...n){var l;return(l=this.translator)==null?void 0:l.exists(...n)}setDefaultNamespace(n){this.options.defaultNS=n}hasLoadedNamespace(n,l={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const o=l.lng||this.resolvedLanguage||this.languages[0],c=this.options?this.options.fallbackLng:!1,d=this.languages[this.languages.length-1];if(o.toLowerCase()==="cimode")return!0;const m=(p,g)=>{const h=this.services.backendConnector.state[`${p}|${g}`];return h===-1||h===0||h===2};if(l.precheck){const p=l.precheck(this,m);if(p!==void 0)return p}return!!(this.hasResourceBundle(o,n)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||m(o,n)&&(!c||m(d,n)))}loadNamespaces(n,l){const o=Sl();return this.options.ns?(Oe(n)&&(n=[n]),n.forEach(c=>{this.options.ns.indexOf(c)<0&&this.options.ns.push(c)}),this.loadResources(c=>{o.resolve(),l&&l(c)}),o):(l&&l(),Promise.resolve())}loadLanguages(n,l){const o=Sl();Oe(n)&&(n=[n]);const c=this.options.preload||[],d=n.filter(m=>c.indexOf(m)<0&&this.services.languageUtils.isSupportedCode(m));return d.length?(this.options.preload=c.concat(d),this.loadResources(m=>{o.resolve(),l&&l(m)}),o):(l&&l(),Promise.resolve())}dir(n){var c,d;if(n||(n=this.resolvedLanguage||(((c=this.languages)==null?void 0:c.length)>0?this.languages[0]:this.language)),!n)return"rtl";try{const m=new Intl.Locale(n);if(m&&m.getTextInfo){const p=m.getTextInfo();if(p&&p.direction)return p.direction}}catch{}const l=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],o=((d=this.services)==null?void 0:d.languageUtils)||new lg(dg());return n.toLowerCase().indexOf("-latn")>1?"ltr":l.indexOf(o.getLanguagePartFromCode(n))>-1||n.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(n={},l){return new kl(n,l)}cloneInstance(n={},l=eo){const o=n.forkResourceStore;o&&delete n.forkResourceStore;const c={...this.options,...n,isClone:!0},d=new kl(c);if((n.debug!==void 0||n.prefix!==void 0)&&(d.logger=d.logger.clone(n)),["store","services","language"].forEach(p=>{d[p]=this[p]}),d.services={...this.services},d.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},o){const p=Object.keys(this.store.data).reduce((g,h)=>(g[h]={...this.store.data[h]},g[h]=Object.keys(g[h]).reduce((b,x)=>(b[x]={...g[h][x]},b),g[h]),g),{});d.store=new sg(p,c),d.services.resourceStore=d.store}return d.translator=new fo(d.services,c),d.translator.on("*",(p,...g)=>{d.emit(p,...g)}),d.init(c,l),d.translator.options=c,d.translator.backendConnector.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},d}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const rr=kl.createInstance();rr.createInstance=kl.createInstance;rr.createInstance;rr.dir;rr.init;rr.loadResources;rr.reloadResources;rr.use;rr.changeLanguage;rr.getFixedT;rr.t;rr.exists;rr.setDefaultNamespace;rr.hasLoadedNamespace;rr.loadNamespaces;rr.loadLanguages;const{slice:Vj,forEach:$j}=[];function Yj(a){return $j.call(Vj.call(arguments,1),n=>{if(n)for(const l in n)a[l]===void 0&&(a[l]=n[l])}),a}function Jj(a){return typeof a!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(l=>l.test(a))}const fg=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Qj=function(a,n){const o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},c=encodeURIComponent(n);let d=`${a}=${c}`;if(o.maxAge>0){const m=o.maxAge-0;if(Number.isNaN(m))throw new Error("maxAge should be a Number");d+=`; Max-Age=${Math.floor(m)}`}if(o.domain){if(!fg.test(o.domain))throw new TypeError("option domain is invalid");d+=`; Domain=${o.domain}`}if(o.path){if(!fg.test(o.path))throw new TypeError("option path is invalid");d+=`; Path=${o.path}`}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");d+=`; Expires=${o.expires.toUTCString()}`}if(o.httpOnly&&(d+="; HttpOnly"),o.secure&&(d+="; Secure"),o.sameSite)switch(typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite){case!0:d+="; SameSite=Strict";break;case"lax":d+="; SameSite=Lax";break;case"strict":d+="; SameSite=Strict";break;case"none":d+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return o.partitioned&&(d+="; Partitioned"),d},pg={create(a,n,l,o){let c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};l&&(c.expires=new Date,c.expires.setTime(c.expires.getTime()+l*60*1e3)),o&&(c.domain=o),document.cookie=Qj(a,n,c)},read(a){const n=`${a}=`,l=document.cookie.split(";");for(let o=0;o<l.length;o++){let c=l[o];for(;c.charAt(0)===" ";)c=c.substring(1,c.length);if(c.indexOf(n)===0)return c.substring(n.length,c.length)}return null},remove(a,n){this.create(a,"",-1,n)}};var Xj={name:"cookie",lookup(a){let{lookupCookie:n}=a;if(n&&typeof document<"u")return pg.read(n)||void 0},cacheUserLanguage(a,n){let{lookupCookie:l,cookieMinutes:o,cookieDomain:c,cookieOptions:d}=n;l&&typeof document<"u"&&pg.create(l,a,o,c,d)}},Zj={name:"querystring",lookup(a){var o;let{lookupQuerystring:n}=a,l;if(typeof window<"u"){let{search:c}=window.location;!window.location.search&&((o=window.location.hash)==null?void 0:o.indexOf("?"))>-1&&(c=window.location.hash.substring(window.location.hash.indexOf("?")));const m=c.substring(1).split("&");for(let p=0;p<m.length;p++){const g=m[p].indexOf("=");g>0&&m[p].substring(0,g)===n&&(l=m[p].substring(g+1))}}return l}},Wj={name:"hash",lookup(a){var c;let{lookupHash:n,lookupFromHashIndex:l}=a,o;if(typeof window<"u"){const{hash:d}=window.location;if(d&&d.length>2){const m=d.substring(1);if(n){const p=m.split("&");for(let g=0;g<p.length;g++){const h=p[g].indexOf("=");h>0&&p[g].substring(0,h)===n&&(o=p[g].substring(h+1))}}if(o)return o;if(!o&&l>-1){const p=d.match(/\/([a-zA-Z-]*)/g);return Array.isArray(p)?(c=p[typeof l=="number"?l:0])==null?void 0:c.replace("/",""):void 0}}}return o}};let yn=null;const hg=()=>{if(yn!==null)return yn;try{if(yn=typeof window<"u"&&window.localStorage!==null,!yn)return!1;const a="i18next.translate.boo";window.localStorage.setItem(a,"foo"),window.localStorage.removeItem(a)}catch{yn=!1}return yn};var eN={name:"localStorage",lookup(a){let{lookupLocalStorage:n}=a;if(n&&hg())return window.localStorage.getItem(n)||void 0},cacheUserLanguage(a,n){let{lookupLocalStorage:l}=n;l&&hg()&&window.localStorage.setItem(l,a)}};let bn=null;const gg=()=>{if(bn!==null)return bn;try{if(bn=typeof window<"u"&&window.sessionStorage!==null,!bn)return!1;const a="i18next.translate.boo";window.sessionStorage.setItem(a,"foo"),window.sessionStorage.removeItem(a)}catch{bn=!1}return bn};var tN={name:"sessionStorage",lookup(a){let{lookupSessionStorage:n}=a;if(n&&gg())return window.sessionStorage.getItem(n)||void 0},cacheUserLanguage(a,n){let{lookupSessionStorage:l}=n;l&&gg()&&window.sessionStorage.setItem(l,a)}},rN={name:"navigator",lookup(a){const n=[];if(typeof navigator<"u"){const{languages:l,userLanguage:o,language:c}=navigator;if(l)for(let d=0;d<l.length;d++)n.push(l[d]);o&&n.push(o),c&&n.push(c)}return n.length>0?n:void 0}},aN={name:"htmlTag",lookup(a){let{htmlTag:n}=a,l;const o=n||(typeof document<"u"?document.documentElement:null);return o&&typeof o.getAttribute=="function"&&(l=o.getAttribute("lang")),l}},sN={name:"path",lookup(a){var c;let{lookupFromPathIndex:n}=a;if(typeof window>"u")return;const l=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(l)?(c=l[typeof n=="number"?n:0])==null?void 0:c.replace("/",""):void 0}},nN={name:"subdomain",lookup(a){var c,d;let{lookupFromSubdomainIndex:n}=a;const l=typeof n=="number"?n+1:1,o=typeof window<"u"&&((d=(c=window.location)==null?void 0:c.hostname)==null?void 0:d.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(o)return o[l]}};let P0=!1;try{document.cookie,P0=!0}catch{}const U0=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];P0||U0.splice(1,1);const lN=()=>({order:U0,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:a=>a});class _0{constructor(n){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(n,l)}init(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=Yj(l,this.options||{},lN()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=c=>c.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(Xj),this.addDetector(Zj),this.addDetector(eN),this.addDetector(tN),this.addDetector(rN),this.addDetector(aN),this.addDetector(sN),this.addDetector(nN),this.addDetector(Wj)}addDetector(n){return this.detectors[n.name]=n,this}detect(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,l=[];return n.forEach(o=>{if(this.detectors[o]){let c=this.detectors[o].lookup(this.options);c&&typeof c=="string"&&(c=[c]),c&&(l=l.concat(c))}}),l=l.filter(o=>o!=null&&!Jj(o)).map(o=>this.options.convertDetectedLanguage(o)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?l:l.length>0?l[0]:null}cacheUserLanguage(n){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;l&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||l.forEach(o=>{this.detectors[o]&&this.detectors[o].cacheUserLanguage(n,this.options)}))}}_0.type="languageDetector";const iN={title:"MCPHub Dashboard",error:"Error",closeButton:"Close",noServers:"No MCP servers available",loading:"Loading...",logout:"Logout",profile:"Profile",changePassword:"Change Password",toggleSidebar:"Toggle Sidebar",welcomeUser:"Welcome, {{username}}",name:"MCPHub"},oN={title:"About",versionInfo:"MCPHub Version: {{version}}",newVersion:"New version available!",currentVersion:"Current version",newVersionAvailable:"New version {{version}} is available",viewOnGitHub:"View on GitHub",checkForUpdates:"Check for Updates",checking:"Checking for updates..."},cN={viewProfile:"View profile",userCenter:"User Center"},uN={label:"Sponsor",title:"Support the Project",rewardAlt:"Reward QR Code",supportMessage:"Support the development of MCPHub by buying me a coffee!",supportButton:"Support on Ko-fi"},dN={label:"WeChat",title:"Connect via WeChat",qrCodeAlt:"WeChat QR Code",scanMessage:"Scan this QR code to connect with us on WeChat"},mN={label:"Discord",title:"Join our Discord server",community:"Join our growing community on Discord for support, discussions, and updates!"},fN={title:"Theme",light:"Light",dark:"Dark",system:"System"},pN={login:"Login",loginTitle:"Login to MCPHub",slogan:"The Unified Hub for MCP Servers",subtitle:"Centralized management platform for Model Context Protocol servers. Organize, monitor, and scale multiple MCP servers with flexible routing strategies.",username:"Username",password:"Password",loggingIn:"Logging in...",orContinue:"Or continue with",loginWithGoogle:"Continue with Google",loginWithGithub:"Continue with GitHub",socialLoginFailed:"Social login failed. Please try again.",emptyFields:"Username and password cannot be empty",loginFailed:"Login failed, please check your username and password",loginError:"An error occurred during login",serverUnavailable:"Unable to connect to the server. Please check your network connection or try again later",currentPassword:"Current Password",newPassword:"New Password",confirmPassword:"Confirm Password",passwordsNotMatch:"New password and confirmation do not match",changePasswordSuccess:"Password changed successfully",changePasswordError:"Failed to change password",changePassword:"Change Password",passwordChanged:"Password changed successfully",passwordChangeError:"Failed to change password",defaultPasswordWarning:"Default Password Security Warning",defaultPasswordMessage:"You are using the default password (admin123), which poses a security risk. Please change your password immediately to protect your account.",goToSettings:"Go to Settings",passwordStrengthError:"Password does not meet security requirements",passwordMinLength:"Password must be at least 8 characters long",passwordRequireLetter:"Password must contain at least one letter",passwordRequireNumber:"Password must contain at least one number",passwordRequireSpecial:"Password must contain at least one special character",passwordStrengthHint:"Password must be at least 8 characters and contain letters, numbers, and special characters"},hN={addServer:"Add Server",add:"Add",edit:"Edit",copy:"Copy",delete:"Delete",confirmDelete:"Are you sure you want to delete this server?",deleteWarning:"Deleting server '{{name}}' will remove it and all its data. This action cannot be undone.",status:"Status",tools:"Tools",prompts:"Prompts",name:"Server Name",url:"Server URL",apiKey:"API Key",save:"Save",cancel:"Cancel",invalidConfig:"Could not find configuration data for {{serverName}}",addError:"Failed to add server",editError:"Failed to edit server {{serverName}}",deleteError:"Failed to delete server {{serverName}}",updateError:"Failed to update server",editTitle:"Edit Server: {{serverName}}",type:"Server Type",typeStdio:"STDIO",typeSse:"SSE",typeStreamableHttp:"Streamable HTTP",typeOpenapi:"OpenAPI",command:"Command",arguments:"Arguments",envVars:"Environment Variables",headers:"HTTP Headers",key:"key",value:"value",enabled:"Enabled",enable:"Enable",disable:"Disable",reload:"Reload",reloadSuccess:"Server reloaded successfully",reloadError:"Failed to reload server {{serverName}}",requestOptions:"Connection Configuration",timeout:"Request Timeout",timeoutDescription:"Timeout for requests to the MCP server (ms)",maxTotalTimeout:"Maximum Total Timeout",maxTotalTimeoutDescription:"Maximum total timeout for requests sent to the MCP server (ms) (Use with progress notifications)",resetTimeoutOnProgress:"Reset Timeout on Progress",resetTimeoutOnProgressDescription:"Reset timeout on progress notifications",keepAlive:"Keep-Alive Configuration",enableKeepAlive:"Enable Keep-Alive",keepAliveDescription:"Send periodic ping requests to maintain the connection. Useful for long-running connections that may timeout.",keepAliveInterval:"Interval (ms)",keepAliveIntervalDescription:"Time between keep-alive pings in milliseconds (default: 60000ms = 1 minute)",remove:"Remove",toggleError:"Failed to toggle server {{serverName}}",alreadyExists:"Server {{serverName}} already exists",invalidData:"Invalid server data provided",notFound:"Server {{serverName}} not found",namePlaceholder:"Enter server name",urlPlaceholder:"Enter server URL",commandPlaceholder:"Enter command",argumentsPlaceholder:"Enter arguments",errorDetails:"Error Details",viewErrorDetails:"View error details",copyConfig:"Copy Configuration",confirmVariables:"Confirm Variable Configuration",variablesDetected:"Variables detected in configuration. Please confirm these variables are properly configured:",detectedVariables:"Detected Variables",confirmVariablesMessage:"Please ensure these variables are properly defined in your runtime environment. Continue adding server?",confirmAndAdd:"Confirm and Add",openapi:{inputMode:"Input Mode",inputModeUrl:"Specification URL",inputModeSchema:"JSON Schema",specUrl:"OpenAPI Specification URL",schema:"OpenAPI JSON Schema",schemaHelp:"Paste your complete OpenAPI JSON schema here",security:"Security Type",securityNone:"None",securityApiKey:"API Key",securityHttp:"HTTP Authentication",securityOAuth2:"OAuth 2.0",securityOpenIdConnect:"OpenID Connect",apiKeyConfig:"API Key Configuration",apiKeyName:"Header/Parameter Name",apiKeyIn:"Location",apiKeyValue:"API Key Value",httpAuthConfig:"HTTP Authentication Configuration",httpScheme:"Authentication Scheme",httpCredentials:"Credentials",httpSchemeBasic:"Basic",httpSchemeBearer:"Bearer",httpSchemeDigest:"Digest",oauth2Config:"OAuth 2.0 Configuration",oauth2Token:"Access Token",openIdConnectConfig:"OpenID Connect Configuration",openIdConnectUrl:"Discovery URL",openIdConnectToken:"ID Token",apiKeyInHeader:"Header",apiKeyInQuery:"Query",apiKeyInCookie:"Cookie",passthroughHeaders:"Passthrough Headers",passthroughHeadersHelp:"Comma-separated list of header names to pass through from tool call requests to upstream OpenAPI endpoints (e.g., Authorization, X-API-Key)"},oauth:{sectionTitle:"OAuth Configuration",sectionDescription:"Configure client credentials for OAuth-protected servers (optional).",clientId:"Client ID",clientSecret:"Client Secret",authorizationEndpoint:"Authorization Endpoint",tokenEndpoint:"Token Endpoint",scopes:"Scopes",scopesPlaceholder:"scope1 scope2",resource:"Resource / Audience",accessToken:"Access Token",refreshToken:"Refresh Token"}},gN={online:"Online",offline:"Offline",connecting:"Connecting",oauthRequired:"OAuth Required",clickToAuthorize:"Click to authorize with OAuth",oauthWindowOpened:"OAuth authorization window opened. Please complete the authorization."},xN={general:"Something went wrong",network:"Network connection error. Please check your internet connection",serverConnection:"Unable to connect to the server. Please check if the server is running",serverAdd:"Failed to add server. Please check the server status",serverUpdate:"Failed to edit server {{serverName}}. Please check the server status",serverFetch:"Failed to retrieve server data. Please try again later",initialStartup:"The server might be starting up. Please wait a moment as this process can take some time on first launch...",serverInstall:"Failed to install server",failedToFetchSettings:"Failed to fetch settings",failedToUpdateRouteConfig:"Failed to update route configuration",failedToUpdateSmartRoutingConfig:"Failed to update smart routing configuration"},yN={processing:"Processing...",save:"Save",cancel:"Cancel",back:"Back",refresh:"Refresh",search:"Search",clear:"Clear",view:"View",create:"Create",creating:"Creating...",update:"Update",updating:"Updating...",submitting:"Submitting...",delete:"Delete",remove:"Remove",copy:"Copy",copyId:"Copy ID",copyUrl:"Copy URL",copyJson:"Copy JSON",copySuccess:"Copied to clipboard",copyFailed:"Copy failed",copied:"Copied",close:"Close",confirm:"Confirm",language:"Language",true:"True",false:"False",dismiss:"Dismiss",github:"GitHub",wechat:"WeChat",discord:"Discord",required:"Required",itemsPerPage:"Items per page",showing:"Showing {{start}}-{{end}} of {{total}}",previous:"Previous",next:"Next",secret:"Secret",default:"Default",value:"Value",type:"Type",repeated:"Repeated",valueHint:"Value Hint",choices:"Choices",actions:"Actions",saving:"Saving...",active:"Active",inactive:"Inactive"},bN={rowsPerPage:"Rows per page",showing:"Showing {{from}}-{{to}} of {{total}}"},vN={dashboard:"Dashboard",servers:"Servers",groups:"Groups",users:"Users",settings:"Settings",changePassword:"Change Password",market:"Market",cloud:"Cloud Market",logs:"Logs",activity:"Activity"},wN={dashboard:{title:"Dashboard",totalServers:"Total",onlineServers:"Online",offlineServers:"Offline",connectingServers:"Connecting",recentServers:"Recent Servers"},servers:{title:"Server Management"},groups:{title:"Group Management"},users:{title:"User Management"},settings:{title:"Settings",language:"Language",account:"Account Settings",password:"Change Password",appearance:"Appearance",routeConfig:"Security",installConfig:"Installation",smartRouting:"Smart Routing",oauthServer:"OAuth Server"},market:{title:"Market Hub - Local and Cloud Markets"},logs:{title:"System Logs"}},SN={filters:"Filters",search:"Search logs...",autoScroll:"Auto-scroll",clearLogs:"Clear logs",loading:"Loading logs...",noLogs:"No logs available.",noMatch:"No logs match the current filters.",mainProcess:"Main Process",childProcess:"Child Process",main:"Main",child:"Child"},jN={add:"Add",addNew:"Add New Group",edit:"Edit Group",delete:"Delete",confirmDelete:"Are you sure you want to delete this group?",deleteWarning:"Deleting group '{{name}}' will remove it and all its server associations. This action cannot be undone.",name:"Group Name",namePlaceholder:"Enter group name",nameRequired:"Group name is required",description:"Description",descriptionPlaceholder:"Enter group description (optional)",createError:"Failed to create group",updateError:"Failed to update group",deleteError:"Failed to delete group",serverAddError:"Failed to add server to group",serverRemoveError:"Failed to remove server from group",addServer:"Add Server to Group",selectServer:"Select a server to add",servers:"Servers in Group",remove:"Remove",noGroups:"No groups available. Create a new group to get started.",noServers:"No servers in this group.",noServerOptions:"No servers available",serverCount:"{{count}} Servers",toolSelection:"Tool Selection",toolsSelected:"Selected",allTools:"All",selectedTools:"Selected tools",selectAll:"Select All",selectNone:"Select None",configureTools:"Configure Tools"},NN={title:"Local Installation",official:"Official",by:"By",unknown:"Unknown",tools:"tools",search:"Search",searchPlaceholder:"Search for servers by name, category, or tags",clearFilters:"Clear",clearCategoryFilter:"",clearTagFilter:"",categories:"Categories",tags:"Tags",showTags:"Show tags",hideTags:"Hide tags",moreTags:"",noServers:"No servers found matching your search",backToList:"Back to list",install:"Install",installing:"Installing...",installed:"Installed",installServer:"Install Server: {{name}}",installSuccess:"Server {{serverName}} installed successfully",author:"Author",license:"License",repository:"Repository",examples:"Examples",arguments:"Arguments",argumentName:"Name",description:"Description",required:"Required",example:"Example",viewSchema:"View schema",fetchError:"Error fetching market servers",serverNotFound:"Server not found",searchError:"Error searching servers",filterError:"Error filtering servers by category",tagFilterError:"Error filtering servers by tag",noInstallationMethod:"No installation method available for this server",showing:"Showing {{from}}-{{to}} of {{total}} servers",perPage:"Per page",confirmVariablesMessage:"Please ensure these variables are properly defined in your runtime environment. Continue installing server?",confirmAndInstall:"Confirm and Install"},CN={authorizeTitle:"Authorize Application",authorizeSubtitle:"Allow this application to access your MCPHub account.",buttons:{approve:"Allow access",deny:"Deny",approveSubtitle:"Recommended if you trust this application.",denySubtitle:"You can always grant access later."}},kN={title:"Cloud Support",subtitle:"Powered by MCPRouter",by:"By",server:"Server",config:"Config",created:"Created",updated:"Updated",available:"Available",description:"Description",details:"Details",tools:"Tools",tool:"tool",toolsAvailable:"{{count}} tool available||{{count}} tools available",loadingTools:"Loading tools...",noTools:"No tools available for this server",noDescription:"No description available",viewDetails:"View Details",parameters:"Parameters",result:"Result",error:"Error",callTool:"Call",calling:"Calling...",toolCallSuccess:"Tool {{toolName}} executed successfully",toolCallError:"Failed to call tool {{toolName}}: {{error}}",viewSchema:"View Schema",backToList:"Back to Cloud Market",search:"Search",searchPlaceholder:"Search cloud servers by name, title, or author",clearFilters:"Clear Filters",clearCategoryFilter:"Clear",clearTagFilter:"Clear",categories:"Categories",tags:"Tags",noCategories:"No categories found",noTags:"No tags found",noServers:"No cloud servers found",fetchError:"Error fetching cloud servers",serverNotFound:"Cloud server not found",searchError:"Error searching cloud servers",filterError:"Error filtering cloud servers by category",tagFilterError:"Error filtering cloud servers by tag",showing:"Showing {{from}}-{{to}} of {{total}} cloud servers",perPage:"Per page",apiKeyNotConfigured:"MCPRouter API key not configured",apiKeyNotConfiguredDescription:"To use cloud servers, you need to configure your MCPRouter API key.",getApiKey:"Get API Key",configureInSettings:"Configure in Settings",installServer:"Install {{name}}",installSuccess:"Server {{name}} installed successfully",installError:"Failed to install server: {{error}}"},AN={title:"Registry",official:"Official",latest:"Latest",description:"Description",website:"Website",repository:"Repository",packages:"Packages",package:"package",remotes:"Remotes",remote:"remote",published:"Published",updated:"Updated",install:"Install",installing:"Installing...",installed:"Installed",installServer:"Install {{name}}",installSuccess:"Server {{name}} installed successfully",installError:"Failed to install server: {{error}}",noDescription:"No description available",viewDetails:"View Details",backToList:"Back to Registry",search:"Search",searchPlaceholder:"Search registry servers by name",clearFilters:"Clear",noServers:"No registry servers found",fetchError:"Error fetching registry servers",serverNotFound:"Registry server not found",showing:"Showing {{from}}-{{to}} of {{total}} registry servers",perPage:"Per page",environmentVariables:"Environment Variables",packageArguments:"Package Arguments",runtimeArguments:"Runtime Arguments",headers:"Headers"},EN={run:"Run",running:"Running...",runTool:"Run Tool",cancel:"Cancel",noDescription:"No description available",inputSchema:"Input Schema:",runToolWithName:"Run Tool: {{name}}",execution:"Tool Execution",successful:"Successful",failed:"Failed",result:"Result:",error:"Error",errorDetails:"Error Details:",noContent:"Tool executed successfully but returned no content.",unknownError:"Unknown error occurred",jsonResponse:"JSON Response:",toolResult:"Tool result",noParameters:"This tool does not require any parameters.",selectOption:"Select an option",enterValue:"Enter {{type}} value",enabled:"Enabled",enableSuccess:"Tool {{name}} enabled successfully",disableSuccess:"Tool {{name}} disabled successfully",toggleFailed:"Failed to toggle tool status",parameters:"Tool Parameters",formMode:"Form Mode",jsonMode:"JSON Mode",jsonConfiguration:"JSON Configuration",invalidJsonFormat:"Invalid JSON format",fixJsonBeforeSwitching:"Please fix JSON format before switching to form mode",item:"Item {{index}}",addItem:"Add {{key}} item",enterKey:"Enter {{key}}"},TN={run:"Get",running:"Getting...",result:"Prompt Result",error:"Prompt Error",execution:"Prompt Execution",successful:"Successful",failed:"Failed",errorDetails:"Error Details:",noContent:"Prompt executed successfully but returned no content.",unknownError:"Unknown error occurred",jsonResponse:"JSON Response:",description:"Description",messages:"Messages",noDescription:"No description available",runPromptWithName:"Get Prompt: {{name}}",descriptionUpdateSuccess:"Prompt description updated successfully",descriptionUpdateFailed:"Failed to update prompt description"},RN={enableGlobalRoute:"Enable Global Route",enableGlobalRouteDescription:"Allow connections to /sse endpoint without specifying a group ID",enableGroupNameRoute:"Enable Group Name Route",enableGroupNameRouteDescription:"Allow connections to /sse endpoint using group names instead of just group IDs",enableBearerAuth:"Enable Bearer Authentication",enableBearerAuthDescription:"Require bearer token authentication for MCP endpoints (default on)",bearerAuthKey:"Bearer Authentication Key",bearerAuthKeyDescription:"The authentication key that will be required in the Bearer token",bearerAuthKeyPlaceholder:"Enter bearer authentication key",bearerKeysSectionTitle:"Keys",bearerKeysSectionDescription:"Manage multiple keys with different access scopes.",noBearerKeys:"No keys configured yet.",bearerKeyName:"Name",bearerKeyToken:"Token",bearerKeyEnabled:"Enabled",bearerKeyAccessType:"Access scope",bearerKeyAccessAll:"All",bearerKeyAccessGroups:"Groups",bearerKeyAccessServers:"Servers",bearerKeyAccessCustom:"Custom",bearerKeyAllowedGroups:"Allowed groups",bearerKeyAllowedServers:"Allowed servers",addBearerKey:"Add key",addBearerKeyButton:"Create",bearerKeyRequired:"Name and token are required",deleteBearerKeyConfirm:"Are you sure you want to delete this key?",generate:"Generate",selectGroups:"Select Groups",selectServers:"Select Servers",selectAtLeastOneGroup:"Please select at least one group",selectAtLeastOneServer:"Please select at least one server",skipAuth:"Skip Authentication",skipAuthDescription:"Allow dashboard access without login (does not affect MCP endpoint auth)",pythonIndexUrl:"Python Package Repository URL",pythonIndexUrlDescription:"Set UV_DEFAULT_INDEX environment variable for Python package installation",pythonIndexUrlPlaceholder:"e.g. https://pypi.org/simple",npmRegistry:"NPM Registry URL",npmRegistryDescription:"Set npm_config_registry environment variable for NPM package installation",npmRegistryPlaceholder:"e.g. https://registry.npmjs.org/",baseUrl:"Base URL",baseUrlDescription:"Base URL for MCP requests and OAuth callbacks",baseUrlPlaceholder:"e.g. http://localhost:3000",installConfig:"Installation",systemConfigUpdated:"System configuration updated successfully",enableSmartRouting:"Enable Smart Routing",enableSmartRoutingDescription:"Enable smart routing feature to search the most suitable tool based on input (using $smart group name)",dbUrl:"PostgreSQL URL (requires pgvector support)",dbUrlPlaceholder:"e.g. postgresql://user:password@localhost:5432/dbname",embeddingProvider:"Embedding Provider",openaiApiBaseUrl:"OpenAI API Base URL",openaiApiBaseUrlPlaceholder:"https://api.openai.com/v1",openaiApiKey:"OpenAI API Key",openaiApiKeyPlaceholder:"Enter OpenAI API key",openaiApiEmbeddingModel:"OpenAI Embedding Model",openaiApiEmbeddingModelPlaceholder:"text-embedding-3-small",azureOpenaiEndpoint:"Azure OpenAI Endpoint",azureOpenaiEndpointPlaceholder:"https://YOUR_RESOURCE_NAME.openai.azure.com",azureOpenaiApiKey:"Azure OpenAI API Key",azureOpenaiApiKeyPlaceholder:"Enter Azure OpenAI API key",azureOpenaiApiVersion:"Azure OpenAI API Version",azureOpenaiApiVersionPlaceholder:"2024-02-15-preview",azureOpenaiEmbeddingDeployment:"Azure OpenAI Embedding Deployment",azureOpenaiEmbeddingDeploymentPlaceholder:"text-embedding-3-small",progressiveDisclosure:"Progressive Disclosure",progressiveDisclosureDescription:"When enabled, search_tools returns only tool names and descriptions. Use describe_tool to get full parameter schema, reducing token usage.",smartRoutingConfigUpdated:"Smart routing configuration updated successfully",smartRoutingRequiredFields:"Database URL and OpenAI API Key are required to enable smart routing",smartRoutingValidationError:"Please fill in the required fields before enabling Smart Routing: {{fields}}",mcpRouterConfig:"Cloud Market",mcpRouterApiKey:"MCPRouter API Key",mcpRouterApiKeyDescription:"API key for accessing MCPRouter cloud market services",mcpRouterApiKeyPlaceholder:"Enter MCPRouter API key",mcpRouterReferer:"Referer",mcpRouterRefererDescription:"Referer header for MCPRouter API requests",mcpRouterRefererPlaceholder:"https://www.mcphubx.com",mcpRouterTitle:"Title",mcpRouterTitleDescription:"Title header for MCPRouter API requests",mcpRouterTitlePlaceholder:"MCPHub",mcpRouterBaseUrl:"Base URL",mcpRouterBaseUrlDescription:"Base URL for MCPRouter API",mcpRouterBaseUrlPlaceholder:"https://api.mcprouter.to/v1",systemSettings:"System Settings",nameSeparatorLabel:"Name Separator",nameSeparatorDescription:"Character used to separate server name and tool/prompt name (default: -)",enableSessionRebuild:"Enable Server Session Rebuild",enableSessionRebuildDescription:"When enabled, applies the improved server session rebuild code for better session management experience",restartRequired:"Configuration saved. It is recommended to restart the application to ensure all services load the new settings correctly.",exportMcpSettings:"Export Settings",mcpSettingsJson:"MCP Settings JSON",mcpSettingsJsonDescription:"View, copy, or download your current mcp_settings.json configuration for backup or migration to other tools",copyToClipboard:"Copy to Clipboard",downloadJson:"Download JSON",exportSuccess:"Settings exported successfully",exportError:"Failed to fetch settings",enableOauthServer:"Enable OAuth Server",enableOauthServerDescription:"Allow MCPHub to issue OAuth tokens for external clients",requireClientSecret:"Require Client Secret",requireClientSecretDescription:"When enabled, confidential clients must present a client secret (disable for PKCE-only clients)",requireState:"Require State Parameter",requireStateDescription:"Reject authorization requests that omit the OAuth state parameter",accessTokenLifetime:"Access Token Lifetime (seconds)",accessTokenLifetimeDescription:"How long issued access tokens remain valid",accessTokenLifetimePlaceholder:"e.g. 3600",refreshTokenLifetime:"Refresh Token Lifetime (seconds)",refreshTokenLifetimeDescription:"How long refresh tokens remain valid",refreshTokenLifetimePlaceholder:"e.g. 1209600",authorizationCodeLifetime:"Authorization Code Lifetime (seconds)",authorizationCodeLifetimeDescription:"How long authorization codes remain valid before they can be exchanged",authorizationCodeLifetimePlaceholder:"e.g. 300",allowedScopes:"Allowed Scopes",allowedScopesDescription:"Comma-separated list of scopes users can approve during authorization",allowedScopesPlaceholder:"e.g. read, write",enableDynamicRegistration:"Enable Dynamic Client Registration",dynamicRegistrationDescription:"Allow RFC 7591 compliant clients to self-register using the public endpoint",dynamicRegistrationAllowedGrantTypes:"Allowed Grant Types",dynamicRegistrationAllowedGrantTypesDescription:"Comma-separated list of grants permitted for dynamically registered clients",dynamicRegistrationAllowedGrantTypesPlaceholder:"e.g. authorization_code, refresh_token",dynamicRegistrationAuth:"Require Authentication",dynamicRegistrationAuthDescription:"Protect the registration endpoint so only authenticated requests can register clients",invalidNumberInput:"Please enter a valid non-negative number"},ON={upload:"Upload",uploadTitle:"Upload MCPB Bundle",dropFileHere:"Drop your .mcpb file here",orClickToSelect:"or click to select from your computer",invalidFileType:"Please select a valid .mcpb file",noFileSelected:"Please select a .mcpb file to upload",uploading:"Uploading...",uploadFailed:"Failed to upload MCPB file",installServer:"Install MCP Server from MCPB",extensionInfo:"Extension Information",name:"Name",version:"Version",description:"Description",author:"Author",tools:"Tools",serverName:"Server Name",serverNamePlaceholder:"Enter a name for this server",install:"Install",installing:"Installing...",installFailed:"Failed to install server from MCPB",serverExistsTitle:"Server Already Exists",serverExistsConfirm:"Server '{{serverName}}' already exists. Do you want to override it with the new version?",override:"Override"},zN={button:"Import",title:"Import Servers from JSON",inputLabel:"Server Configuration JSON",inputHelp:"Paste your server configuration JSON. Supports STDIO, SSE, and HTTP (streamable-http) server types.",preview:"Preview",previewTitle:"Preview Servers to Import",import:"Import",importing:"Importing...",invalidFormat:"Invalid JSON format. The JSON must contain an 'mcpServers' object.",parseError:"Failed to parse JSON. Please check the format and try again.",addFailed:"Failed to add server",importFailed:"Failed to import servers",partialSuccess:"Imported {{count}} of {{total}} servers successfully. Some servers failed:"},MN={button:"Import",title:"Import Groups from JSON",inputLabel:"Group Configuration JSON",inputHelp:"Paste your group configuration JSON. Each group can contain a list of servers.",preview:"Preview",previewTitle:"Preview Groups to Import",import:"Import",importing:"Importing...",invalidFormat:"Invalid JSON format. The JSON must contain a 'groups' array.",missingName:"Each group must have a 'name' field.",parseError:"Failed to parse JSON. Please check the format and try again.",addFailed:"Failed to add group",importFailed:"Failed to import groups",partialSuccess:"Imported {{count}} of {{total}} groups successfully. Some groups failed:"},LN={add:"Add User",addNew:"Add New User",edit:"Edit User",delete:"Delete User",create:"Create User",update:"Update User",username:"Username",password:"Password",newPassword:"New Password",confirmPassword:"Confirm Password",changePassword:"Change Password",adminRole:"Administrator",admin:"Admin",user:"User",role:"Role",actions:"Actions",addFirst:"Add your first user",permissions:"Permissions",adminPermissions:"Full system access",userPermissions:"Limited access",currentUser:"You",noUsers:"No users found",adminRequired:"Administrator access required to manage users",usernameRequired:"Username is required",passwordRequired:"Password is required",passwordTooShort:"Password must be at least 6 characters long",passwordMismatch:"Passwords do not match",usernamePlaceholder:"Enter username",passwordPlaceholder:"Enter password",newPasswordPlaceholder:"Leave empty to keep current password",confirmPasswordPlaceholder:"Confirm new password",createError:"Failed to create user",updateError:"Failed to update user",deleteError:"Failed to delete user",statsError:"Failed to fetch user statistics",deleteConfirmation:"Are you sure you want to delete user '{{username}}'? This action cannot be undone.",confirmDelete:"Delete User",deleteWarning:"Are you sure you want to delete user '{{username}}'? This action cannot be undone."},DN={errors:{readonly:"Readonly for demo environment",invalid_credentials:"Invalid username or password",serverNameRequired:"Server name is required",serverConfigRequired:"Server configuration is required",serverConfigInvalid:"Server configuration must include either a URL, OpenAPI specification URL or schema, or command with arguments",serverTypeInvalid:"Server type must be one of: stdio, sse, streamable-http, openapi",urlRequiredForType:"URL is required for {{type}} server type",openapiSpecRequired:"OpenAPI specification URL or schema is required for openapi server type",headersInvalidFormat:"Headers must be an object",headersNotSupportedForStdio:"Headers are not supported for stdio server type",serverNotFound:"Server not found",failedToRemoveServer:"Server not found or failed to remove",internalServerError:"Internal server error",failedToGetServers:"Failed to get servers information",failedToReloadServer:"Failed to reload server",failedToGetServerSettings:"Failed to get server settings",failedToGetServerConfig:"Failed to get server configuration",failedToSaveSettings:"Failed to save settings",toolNameRequired:"Server name and tool name are required",descriptionMustBeString:"Description must be a string",groupIdRequired:"Group ID is required",groupNameRequired:"Group name is required",groupNotFound:"Group not found",groupIdAndServerNameRequired:"Group ID and server name are required",groupOrServerNotFound:"Group or server not found",toolsMustBeAllOrArray:'Tools must be "all" or an array of strings',serverNameAndToolNameRequired:"Server name and tool name are required",usernameRequired:"Username is required",userNotFound:"User not found",failedToGetUsers:"Failed to get users information",failedToGetUserInfo:"Failed to get user information",failedToGetUserStats:"Failed to get user statistics",marketServerNameRequired:"Server name is required",marketServerNotFound:"Market server not found",failedToGetMarketServers:"Failed to get market servers information",failedToGetMarketServer:"Failed to get market server information",failedToGetMarketCategories:"Failed to get market categories",failedToGetMarketTags:"Failed to get market tags",failedToSearchMarketServers:"Failed to search market servers",failedToFilterMarketServers:"Failed to filter market servers",failedToProcessMcpbFile:"Failed to process MCPB file"},success:{serverCreated:"Server created successfully",serverUpdated:"Server updated successfully",serverRemoved:"Server removed successfully",serverToggled:"Server status toggled successfully",toolToggled:"Tool {{name}} {{action}} successfully",toolDescriptionUpdated:"Tool {{name}} description updated successfully",systemConfigUpdated:"System configuration updated successfully",groupCreated:"Group created successfully",groupUpdated:"Group updated successfully",groupDeleted:"Group deleted successfully",serverAddedToGroup:"Server added to group successfully",serverRemovedFromGroup:"Server removed from group successfully",serverToolsUpdated:"Server tools updated successfully"}},PN={authorizationFailed:"Authorization Failed",authorizationFailedError:"Error",authorizationFailedDetails:"Details",invalidRequest:"Invalid Request",missingStateParameter:"Missing required OAuth state parameter.",missingCodeParameter:"Missing required authorization code parameter.",serverNotFound:"Server Not Found",serverNotFoundMessage:"Could not find server associated with this authorization request.",sessionExpiredMessage:"The authorization session may have expired. Please try authorizing again.",authorizationSuccessful:"Authorization Successful",server:"Server",status:"Status",connected:"Connected",successMessage:"The server has been successfully authorized and connected.",autoCloseMessage:"This window will close automatically in 3 seconds...",closeNow:"Close Now",connectionError:"Connection Error",connectionErrorMessage:"Authorization was successful, but failed to connect to the server.",reconnectMessage:"Please try reconnecting from the dashboard.",configurationError:"Configuration Error",configurationErrorMessage:"Server transport does not support OAuth finishAuth(). Please ensure the server is configured with streamable-http transport.",internalError:"Internal Error",internalErrorMessage:"An unexpected error occurred while processing the OAuth callback.",closeWindow:"Close Window"},UN={title:"Activity",totalCalls:"Total Calls",successCount:"Successful",errorCount:"Failed",avgDuration:"Avg Duration",timestamp:"Timestamp",server:"Server",tool:"Tool",duration:"Duration",status:"Status",group:"Group",key:"API Key",input:"Input",output:"Output",details:"Activity Details",errorMessage:"Error Message",searchServer:"Server...",searchTool:"Tool...",searchStatus:"Status...",searchGroup:"Group...",searchKeyName:"API key...",keyName:"API Key Name",allStatus:"All Status",statusSuccess:"Success",statusError:"Error",noData:"No activity data available",fetchError:"Failed to load activity data",cleanup:"Cleanup",confirmCleanup:"Are you sure you want to delete activities older than 30 days?",cleanupSuccess:"Deleted {{count}} old activities",cleanupError:"Failed to cleanup old activities",notAvailable:"Activity tracking is only available in database mode"},_N={app:iN,about:oN,profile:cN,sponsor:uN,wechat:dN,discord:mN,theme:fN,auth:pN,server:hN,status:gN,errors:xN,common:yN,pagination:bN,nav:vN,pages:wN,logs:SN,groups:jN,market:NN,oauthServer:CN,cloud:kN,registry:AN,tool:EN,prompt:TN,settings:RN,mcpb:ON,jsonImport:zN,groupImport:MN,users:LN,api:DN,oauthCallback:PN,activity:UN},BN={title:"MCPHub 控制面板",error:"错误",closeButton:"关闭",noServers:"没有可用的 MCP 服务器",loading:"加载中...",logout:"退出登录",profile:"个人资料",changePassword:"修改密码",toggleSidebar:"切换侧边栏",welcomeUser:"欢迎, {{username}}",name:"MCPHub"},IN={title:"关于",versionInfo:"MCPHub 版本: {{version}}",newVersion:"有新版本可用!",currentVersion:"当前版本",newVersionAvailable:"新版本 {{version}} 已发布",viewOnGitHub:"在 GitHub 上查看",checkForUpdates:"检查更新",checking:"检查更新中..."},HN={viewProfile:"查看个人中心",userCenter:"个人中心"},GN={label:"赞助",title:"支持项目",rewardAlt:"赞赏码",supportMessage:"通过捐赠支持 MCPHub 的开发!",supportButton:"在 Ko-fi 上支持"},KN={label:"微信",title:"微信联系",qrCodeAlt:"微信二维码",scanMessage:"扫描二维码添加微信"},qN={label:"Discord",title:"加入我们的 Discord 服务器",community:"加入我们不断壮大的 Discord 社区,获取支持、参与讨论并了解最新动态!"},FN={title:"主题",light:"浅色",dark:"深色",system:"系统"},VN={login:"登录",loginTitle:"登录 MCPHub",slogan:"统一的 MCP 服务器管理平台",subtitle:"模型上下文协议服务器的集中管理平台,通过灵活的路由策略组织、监控和扩展多个 MCP 服务器。",username:"用户名",password:"密码",loggingIn:"登录中...",orContinue:"或使用以下方式继续",loginWithGoogle:"使用 Google 登录",loginWithGithub:"使用 GitHub 登录",socialLoginFailed:"社交登录失败,请重试。",emptyFields:"用户名和密码不能为空",loginFailed:"登录失败,请检查用户名和密码",loginError:"登录过程中出现错误",serverUnavailable:"无法连接到服务器,请检查网络连接或稍后再试",currentPassword:"当前密码",newPassword:"新密码",confirmPassword:"确认密码",passwordsNotMatch:"新密码与确认密码不一致",changePasswordSuccess:"密码修改成功",changePasswordError:"修改密码失败",changePassword:"修改密码",passwordChanged:"密码修改成功",passwordChangeError:"修改密码失败",defaultPasswordWarning:"默认密码安全警告",defaultPasswordMessage:"您正在使用默认密码(admin123),这存在安全风险。为了保护您的账户安全,请立即修改密码。",goToSettings:"前往修改",passwordStrengthError:"密码不符合安全要求",passwordMinLength:"密码长度至少为 8 个字符",passwordRequireLetter:"密码必须包含至少一个字母",passwordRequireNumber:"密码必须包含至少一个数字",passwordRequireSpecial:"密码必须包含至少一个特殊字符",passwordStrengthHint:"密码必须至少 8 个字符,且包含字母、数字和特殊字符"},$N={addServer:"添加服务器",add:"添加",edit:"编辑",copy:"复制",delete:"删除",confirmDelete:"您确定要删除此服务器吗?",deleteWarning:"删除服务器 '{{name}}' 将会移除该服务器及其所有数据。此操作无法撤销。",status:"状态",tools:"工具",prompts:"提示词",name:"服务器名称",url:"服务器 URL",apiKey:"API 密钥",save:"保存",cancel:"取消",addError:"添加服务器失败",editError:"编辑服务器 {{serverName}} 失败",invalidConfig:"无法找到 {{serverName}} 的配置数据",deleteError:"删除服务器 {{serverName}} 失败",updateError:"更新服务器失败",editTitle:"编辑服务器: {{serverName}}",type:"服务器类型",typeStdio:"STDIO",typeSse:"SSE",typeStreamableHttp:"流式 HTTP",typeOpenapi:"OpenAPI",command:"命令",arguments:"参数",envVars:"环境变量",headers:"HTTP 请求头",key:"键",value:"值",enabled:"已启用",enable:"启用",disable:"禁用",reload:"重载",reloadSuccess:"服务器重载成功",reloadError:"重载服务器 {{serverName}} 失败",requestOptions:"连接配置",timeout:"请求超时",timeoutDescription:"请求超时时间(毫秒)",maxTotalTimeout:"最大总超时",maxTotalTimeoutDescription:"无论是否有进度通知的最大总超时时间(毫秒)",resetTimeoutOnProgress:"收到进度通知时重置超时",resetTimeoutOnProgressDescription:"适用于发送周期性进度更新的长时间运行操作",keepAlive:"保活配置",enableKeepAlive:"启用保活",keepAliveDescription:"定期发送 ping 请求以维持连接。适用于可能超时的长期连接。",keepAliveInterval:"间隔时间(毫秒)",keepAliveIntervalDescription:"保活 ping 的时间间隔(默认:60000毫秒 = 1分钟)",remove:"移除",toggleError:"切换服务器 {{serverName}} 状态失败",alreadyExists:"服务器 {{serverName}} 已经存在",invalidData:"提供的服务器数据无效",notFound:"找不到服务器 {{serverName}}",namePlaceholder:"请输入服务器名称",urlPlaceholder:"请输入服务器URL",commandPlaceholder:"请输入命令",argumentsPlaceholder:"请输入参数",errorDetails:"错误详情",viewErrorDetails:"查看错误详情",copyConfig:"复制配置",confirmVariables:"确认变量配置",variablesDetected:"检测到配置中包含变量,请确认这些变量是否已正确配置:",detectedVariables:"检测到的变量",confirmVariablesMessage:"请确保这些变量在运行环境中已正确定义。是否继续添加服务器?",confirmAndAdd:"确认并添加",openapi:{inputMode:"输入模式",inputModeUrl:"规范 URL",inputModeSchema:"JSON 模式",specUrl:"OpenAPI 规范 URL",schema:"OpenAPI JSON 模式",schemaHelp:"请在此处粘贴完整的 OpenAPI JSON 模式",security:"安全类型",securityNone:"无",securityApiKey:"API 密钥",securityHttp:"HTTP 认证",securityOAuth2:"OAuth 2.0",securityOpenIdConnect:"OpenID Connect",apiKeyConfig:"API 密钥配置",apiKeyName:"请求头/参数名称",apiKeyIn:"位置",apiKeyValue:"API 密钥值",httpAuthConfig:"HTTP 认证配置",httpScheme:"认证方案",httpCredentials:"凭据",httpSchemeBasic:"Basic",httpSchemeBearer:"Bearer",httpSchemeDigest:"Digest",oauth2Config:"OAuth 2.0 配置",oauth2Token:"访问令牌",openIdConnectConfig:"OpenID Connect 配置",openIdConnectUrl:"发现 URL",openIdConnectToken:"ID 令牌",apiKeyInHeader:"请求头",apiKeyInQuery:"查询",apiKeyInCookie:"Cookie",passthroughHeaders:"透传请求头",passthroughHeadersHelp:"要从工具调用请求透传到上游OpenAPI接口的请求头名称列表,用逗号分隔(如:Authorization, X-API-Key)"},oauth:{sectionTitle:"OAuth 配置",sectionDescription:"为需要 OAuth 的服务器配置客户端凭据(可选)。",clientId:"客户端 ID",clientSecret:"客户端密钥",authorizationEndpoint:"授权端点",tokenEndpoint:"令牌端点",scopes:"权限范围(Scopes)",scopesPlaceholder:"scope1 scope2",resource:"资源 / 受众",accessToken:"访问令牌",refreshToken:"刷新令牌"}},YN={online:"在线",offline:"离线",connecting:"连接中",oauthRequired:"需要OAuth授权",clickToAuthorize:"点击进行OAuth授权",oauthWindowOpened:"OAuth授权窗口已打开,请完成授权。"},JN={general:"发生错误",network:"网络连接错误,请检查您的互联网连接",serverConnection:"无法连接到服务器,请检查服务器是否正在运行",serverAdd:"添加服务器失败,请检查服务器状态",serverUpdate:"编辑服务器 {{serverName}} 失败,请检查服务器状态",serverFetch:"获取服务器数据失败,请稍后重试",failedToReloadServer:"重载服务器失败",initialStartup:"服务器可能正在启动中。首次启动可能需要一些时间,请耐心等候...",serverInstall:"安装服务器失败",failedToFetchSettings:"获取设置失败",failedToUpdateSystemConfig:"更新系统配置失败",failedToUpdateRouteConfig:"更新路由配置失败",failedToUpdateSmartRoutingConfig:"更新智能路由配置失败"},QN={processing:"处理中...",save:"保存",cancel:"取消",back:"返回",refresh:"刷新",search:"搜索",clear:"清除",view:"查看",create:"创建",creating:"创建中...",update:"更新",updating:"更新中...",submitting:"提交中...",delete:"删除",remove:"移除",copy:"复制",copyId:"复制ID",copyUrl:"复制URL",copyJson:"复制JSON",copySuccess:"已复制到剪贴板",copyFailed:"复制失败",copied:"已复制",close:"关闭",confirm:"确认",language:"语言",true:"是",false:"否",dismiss:"忽略",github:"GitHub",wechat:"微信",itemsPerPage:"每页显示",showing:"显示第 {{start}}-{{end}} 条,共 {{total}} 条",previous:"上一页",next:"下一页",discord:"Discord",required:"必填",secret:"敏感",default:"默认值",value:"值",type:"类型",repeated:"可重复",valueHint:"值提示",choices:"可选值",actions:"操作",saving:"保存中...",active:"已激活",inactive:"未激活"},XN={rowsPerPage:"每页行数",showing:"显示第 {{from}}-{{to}} 条,共 {{total}} 条"},ZN={dashboard:"仪表盘",servers:"服务器",settings:"设置",changePassword:"修改密码",groups:"分组",users:"用户",market:"市场",cloud:"云端市场",logs:"日志",activity:"活动"},WN={dashboard:{title:"仪表盘",totalServers:"总数",onlineServers:"在线",offlineServers:"离线",connectingServers:"连接中",recentServers:"最近的服务器"},servers:{title:"服务器管理"},settings:{title:"设置",language:"语言",account:"账户设置",password:"修改密码",appearance:"外观",routeConfig:"安全配置",installConfig:"安装",smartRouting:"智能路由",oauthServer:"OAuth"},groups:{title:"分组管理"},users:{title:"用户管理"},market:{title:"市场中心 - 本地市场和云端市场"},logs:{title:"系统日志"}},e4={filters:"筛选",search:"搜索日志...",autoScroll:"自动滚动",clearLogs:"清除日志",loading:"加载日志中...",noLogs:"暂无日志。",noMatch:"没有匹配当前筛选条件的日志。",mainProcess:"主进程",childProcess:"子进程",main:"主",child:"子"},t4={add:"添加",addNew:"添加新分组",edit:"编辑分组",delete:"删除",confirmDelete:"您确定要删除此分组吗?",deleteWarning:"删除分组 '{{name}}' 将会移除该分组及其所有服务器关联。此操作无法撤销。",name:"分组名称",namePlaceholder:"请输入分组名称",nameRequired:"分组名称不能为空",description:"描述",descriptionPlaceholder:"请输入分组描述(可选)",createError:"创建分组失败",updateError:"更新分组失败",deleteError:"删除分组失败",serverAddError:"向分组添加服务器失败",serverRemoveError:"从分组移除服务器失败",addServer:"添加服务器到分组",selectServer:"选择要添加的服务器",servers:"分组中的服务器",remove:"移除",noGroups:"暂无可用分组。创建一个新分组以开始使用。",noServers:"此分组中没有服务器。",noServerOptions:"没有可用的服务器",serverCount:"{{count}} 台服务器",toolSelection:"工具选择",toolsSelected:"选择",allTools:"全部",selectedTools:"选中的工具",selectAll:"全选",selectNone:"全不选",configureTools:"配置工具"},r4={title:"本地安装",official:"官方",by:"作者",unknown:"未知",tools:"工具",search:"搜索",searchPlaceholder:"搜索服务器名称、分类或标签",clearFilters:"清除",clearCategoryFilter:"",clearTagFilter:"",categories:"分类",tags:"标签",showTags:"显示标签",hideTags:"隐藏标签",moreTags:"",noServers:"未找到匹配的服务器",backToList:"返回列表",install:"安装",installing:"安装中...",installed:"已安装",installServer:"安装服务器: {{name}}",installSuccess:"服务器 {{serverName}} 安装成功",author:"作者",license:"许可证",repository:"代码仓库",examples:"示例",arguments:"参数",argumentName:"名称",description:"描述",required:"必填",example:"示例",viewSchema:"查看结构",fetchError:"获取本地市场服务器数据失败",serverNotFound:"未找到服务器",searchError:"搜索服务器失败",filterError:"按分类筛选服务器失败",tagFilterError:"按标签筛选服务器失败",noInstallationMethod:"该服务器没有可用的安装方法",showing:"显示 {{from}}-{{to}}/{{total}} 个服务器",perPage:"每页显示",confirmVariablesMessage:"请确保这些变量在运行环境中已正确定义。是否继续安装服务器?",confirmAndInstall:"确认并安装"},a4={authorizeTitle:"授权应用",authorizeSubtitle:"允许此应用访问您的 MCPHub 账号。",buttons:{approve:"允许访问",deny:"拒绝",approveSubtitle:"如果您信任此应用,建议选择允许。",denySubtitle:"您可以在之后随时再次授权。"}},s4={title:"云端支持",subtitle:"由 MCPRouter 提供支持",by:"作者",server:"服务器",config:"配置",created:"创建时间",updated:"更新时间",available:"可用",description:"描述",details:"详细信息",tools:"工具",tool:"个工具",toolsAvailable:"{{count}} 个工具可用",loadingTools:"加载工具中...",noTools:"该服务器没有可用工具",noDescription:"无描述信息",viewDetails:"查看详情",parameters:"参数",result:"结果",error:"错误",callTool:"调用",calling:"调用中...",toolCallSuccess:"工具 {{toolName}} 执行成功",toolCallError:"调用工具 {{toolName}} 失败:{{error}}",viewSchema:"查看结构",backToList:"返回云端市场",search:"搜索",searchPlaceholder:"搜索云端服务器名称、标题或作者",clearFilters:"清除筛选",clearCategoryFilter:"清除",clearTagFilter:"清除",categories:"分类",tags:"标签",noCategories:"未找到分类",noTags:"未找到标签",noServers:"未找到云端服务器",fetchError:"获取云端服务器失败",serverNotFound:"未找到云端服务器",searchError:"搜索云端服务器失败",filterError:"按分类筛选云端服务器失败",tagFilterError:"按标签筛选云端服务器失败",showing:"显示 {{from}}-{{to}}/{{total}} 个云端服务器",perPage:"每页显示",apiKeyNotConfigured:"MCPRouter API 密钥未配置",apiKeyNotConfiguredDescription:"要使用云端服务器,您需要配置 MCPRouter API 密钥。",getApiKey:"获取 API 密钥",configureInSettings:"在设置中配置",installServer:"安装 {{name}}",installSuccess:"服务器 {{name}} 安装成功",installError:"安装服务器失败:{{error}}"},n4={title:"注册中心",official:"官方",latest:"最新版本",description:"描述",website:"网站",repository:"代码仓库",packages:"安装包",package:"安装包",remotes:"远程服务",remote:"远程服务",published:"发布时间",updated:"更新时间",install:"安装",installing:"安装中...",installed:"已安装",installServer:"安装 {{name}}",installSuccess:"服务器 {{name}} 安装成功",installError:"安装服务器失败:{{error}}",noDescription:"无描述信息",viewDetails:"查看详情",backToList:"返回注册中心",search:"搜索",searchPlaceholder:"按名称搜索注册中心服务器",clearFilters:"清除",noServers:"未找到注册中心服务器",fetchError:"获取注册中心服务器失败",serverNotFound:"未找到注册中心服务器",showing:"显示 {{from}}-{{to}}/{{total}} 个注册中心服务器",perPage:"每页显示",environmentVariables:"环境变量",packageArguments:"安装包参数",runtimeArguments:"运行时参数",headers:"请求头"},l4={run:"运行",running:"运行中...",runTool:"运行",cancel:"取消",noDescription:"无描述信息",inputSchema:"输入模式:",runToolWithName:"运行工具:{{name}}",execution:"工具执行",successful:"成功",failed:"失败",result:"结果:",error:"错误",errorDetails:"错误详情:",noContent:"工具执行成功但未返回内容。",unknownError:"发生未知错误",jsonResponse:"JSON 响应:",toolResult:"工具结果",noParameters:"此工具不需要任何参数。",selectOption:"选择一个选项",enterValue:"输入{{type}}值",enabled:"已启用",enableSuccess:"工具 {{name}} 启用成功",disableSuccess:"工具 {{name}} 禁用成功",toggleFailed:"切换工具状态失败",parameters:"工具参数",formMode:"表单模式",jsonMode:"JSON 模式",jsonConfiguration:"JSON 配置",invalidJsonFormat:"无效的 JSON 格式",fixJsonBeforeSwitching:"请修复 JSON 格式后再切换到表单模式",item:"项目 {{index}}",addItem:"添加 {{key}} 项目",enterKey:"输入 {{key}}"},i4={run:"获取",running:"获取中...",result:"提示词结果",error:"提示词错误",execution:"提示词执行",successful:"成功",failed:"失败",errorDetails:"错误详情:",noContent:"提示词执行成功但未返回内容。",unknownError:"发生未知错误",jsonResponse:"JSON 响应:",description:"描述",messages:"消息",noDescription:"无描述信息",runPromptWithName:"获取提示词: {{name}}",descriptionUpdateSuccess:"提示词描述更新成功",descriptionUpdateFailed:"更新提示词描述失败"},o4={enableGlobalRoute:"启用全局路由",enableGlobalRouteDescription:"允许不指定组 ID 就连接到 /sse 端点",enableGroupNameRoute:"启用组名路由",enableGroupNameRouteDescription:"允许使用组名而不仅仅是组 ID 连接到 /sse 端点",enableBearerAuth:"启用 Bearer 认证",enableBearerAuthDescription:"对 MCP 端点启用 Bearer 令牌认证(默认开启)",bearerAuthKey:"Bearer 认证密钥",bearerAuthKeyDescription:"Bearer 令牌中需要携带的认证密钥",bearerAuthKeyPlaceholder:"请输入 Bearer 认证密钥",bearerKeysSectionTitle:"密钥",bearerKeysSectionDescription:"管理多条密钥,并为不同密钥配置不同的访问范围。",noBearerKeys:"当前还没有配置任何密钥。",bearerKeyName:"名称",bearerKeyToken:"密钥值",bearerKeyEnabled:"启用",bearerKeyAccessType:"访问范围",bearerKeyAccessAll:"全部",bearerKeyAccessGroups:"指定分组",bearerKeyAccessServers:"指定服务器",bearerKeyAccessCustom:"自定义",bearerKeyAllowedGroups:"允许访问的分组",bearerKeyAllowedServers:"允许访问的服务器",addBearerKey:"新增密钥",addBearerKeyButton:"创建",bearerKeyRequired:"名称和密钥值为必填项",deleteBearerKeyConfirm:"确定要删除这条密钥吗?",generate:"生成",selectGroups:"选择分组",selectServers:"选择服务器",selectAtLeastOneGroup:"请至少选择一个分组",selectAtLeastOneServer:"请至少选择一个服务器",skipAuth:"免登录开关",skipAuthDescription:"允许仪表盘免登录(不影响 MCP 端点认证)",pythonIndexUrl:"Python 包仓库地址",pythonIndexUrlDescription:"设置 UV_DEFAULT_INDEX 环境变量,用于 Python 包安装",pythonIndexUrlPlaceholder:"例如: https://pypi.org/simple",npmRegistry:"NPM 仓库地址",npmRegistryDescription:"设置 npm_config_registry 环境变量,用于 NPM 包安装",npmRegistryPlaceholder:"例如: https://registry.npmjs.org/",baseUrl:"基础地址",baseUrlDescription:"用于 MCP 请求与 OAuth 回调的基础地址",baseUrlPlaceholder:"例如: http://localhost:3000",installConfig:"安装配置",systemConfigUpdated:"系统配置更新成功",enableSmartRouting:"启用智能路由",enableSmartRoutingDescription:"开启智能路由功能,根据输入自动搜索最合适的工具(使用 $smart 分组)",dbUrl:"PostgreSQL 连接地址(必须支持 pgvector)",dbUrlPlaceholder:"例如: postgresql://user:password@localhost:5432/dbname",embeddingProvider:"嵌入提供方",openaiApiBaseUrl:"OpenAI API 基础地址",openaiApiBaseUrlPlaceholder:"https://api.openai.com/v1",openaiApiKey:"OpenAI API 密钥",openaiApiKeyDescription:"用于访问 OpenAI API 的密钥",openaiApiKeyPlaceholder:"请输入 OpenAI API 密钥",openaiApiEmbeddingModel:"OpenAI 嵌入模型",openaiApiEmbeddingModelPlaceholder:"text-embedding-3-small",azureOpenaiEndpoint:"Azure OpenAI 终端地址",azureOpenaiEndpointPlaceholder:"https://YOUR_RESOURCE_NAME.openai.azure.com",azureOpenaiApiKey:"Azure OpenAI API 密钥",azureOpenaiApiKeyPlaceholder:"请输入 Azure OpenAI API 密钥",azureOpenaiApiVersion:"Azure OpenAI API 版本",azureOpenaiApiVersionPlaceholder:"2024-02-15-preview",azureOpenaiEmbeddingDeployment:"Azure OpenAI 嵌入部署",azureOpenaiEmbeddingDeploymentPlaceholder:"text-embedding-3-small",progressiveDisclosure:"渐进式披露",progressiveDisclosureDescription:"开启后,search_tools 只返回工具名称和描述,通过 describe_tool 获取完整参数定义,可减少 Token 消耗",smartRoutingConfigUpdated:"智能路由配置更新成功",smartRoutingRequiredFields:"启用智能路由需要填写数据库连接地址和 OpenAI API 密钥",smartRoutingValidationError:"启用智能路由前请先填写必要字段:{{fields}}",mcpRouterConfig:"云端市场",mcpRouterApiKey:"MCPRouter API 密钥",mcpRouterApiKeyDescription:"用于访问 MCPRouter 云端市场服务的 API 密钥",mcpRouterApiKeyPlaceholder:"请输入 MCPRouter API 密钥",mcpRouterReferer:"引用地址",mcpRouterRefererDescription:"MCPRouter API 请求的引用地址头",mcpRouterRefererPlaceholder:"https://www.mcphubx.com",mcpRouterTitle:"标题",mcpRouterTitleDescription:"MCPRouter API 请求的标题头",mcpRouterTitlePlaceholder:"MCPHub",mcpRouterBaseUrl:"基础地址",mcpRouterBaseUrlDescription:"MCPRouter API 的基础地址",mcpRouterBaseUrlPlaceholder:"https://api.mcprouter.to/v1",systemSettings:"系统设置",nameSeparatorLabel:"名称分隔符",nameSeparatorDescription:"用于分隔服务器名称和工具/提示名称(默认:-)",enableSessionRebuild:"启用服务端会话重建",enableSessionRebuildDescription:"开启后会应用服务端会话重建的改进代码,提供更好的会话管理体验",restartRequired:"配置已保存。为确保所有服务正确加载新设置,建议重启应用。",exportMcpSettings:"导出配置",mcpSettingsJson:"MCP 配置 JSON",mcpSettingsJsonDescription:"查看、复制或下载当前的 mcp_settings.json 配置,可用于备份或迁移到其他工具",copyToClipboard:"复制到剪贴板",downloadJson:"下载 JSON",exportSuccess:"配置导出成功",exportError:"获取配置失败",enableOauthServer:"启用 OAuth 服务器",enableOauthServerDescription:"允许 MCPHub 作为 OAuth 2.0 授权服务器向外部客户端签发令牌",requireClientSecret:"需要客户端密钥",requireClientSecretDescription:"开启后,保密客户端必须携带 client secret(如需仅使用 PKCE 的公共客户端可关闭)",requireState:"要求 state 参数",requireStateDescription:"拒绝未携带 state 参数的授权请求",accessTokenLifetime:"访问令牌有效期(秒)",accessTokenLifetimeDescription:"控制访问令牌可使用的时长",accessTokenLifetimePlaceholder:"例如:3600",refreshTokenLifetime:"刷新令牌有效期(秒)",refreshTokenLifetimeDescription:"控制刷新令牌的过期时间",refreshTokenLifetimePlaceholder:"例如:1209600",authorizationCodeLifetime:"授权码有效期(秒)",authorizationCodeLifetimeDescription:"授权码在被兑换前可保持有效的时间",authorizationCodeLifetimePlaceholder:"例如:300",allowedScopes:"允许的作用域",allowedScopesDescription:"使用逗号分隔的作用域列表,在授权时展示给用户",allowedScopesPlaceholder:"例如:read, write",enableDynamicRegistration:"启用动态客户端注册",dynamicRegistrationDescription:"允许遵循 RFC 7591 的客户端通过公共端点自行注册",dynamicRegistrationAllowedGrantTypes:"允许的授权类型",dynamicRegistrationAllowedGrantTypesDescription:"使用逗号分隔动态注册客户端可以使用的授权类型",dynamicRegistrationAllowedGrantTypesPlaceholder:"例如:authorization_code, refresh_token",dynamicRegistrationAuth:"注册需要认证",dynamicRegistrationAuthDescription:"开启后,注册端点需要认证请求才能创建客户端",invalidNumberInput:"请输入合法的非负数字"},c4={upload:"上传",uploadTitle:"上传 MCPB 文件",dropFileHere:"将 .mcpb 文件拖拽到此处",orClickToSelect:"或点击从计算机选择",invalidFileType:"请选择有效的 .mcpb 文件",noFileSelected:"请选择要上传的 .mcpb 文件",uploading:"上传中...",uploadFailed:"上传 MCPB 文件失败",installServer:"从 MCPB 安装 MCP 服务器",extensionInfo:"扩展信息",name:"名称",version:"版本",description:"描述",author:"作者",tools:"工具",serverName:"服务器名称",serverNamePlaceholder:"为此服务器输入名称",install:"安装",installing:"安装中...",installFailed:"从 MCPB 安装服务器失败",serverExistsTitle:"服务器已存在",serverExistsConfirm:"服务器 '{{serverName}}' 已存在。是否要用新版本覆盖它?",override:"覆盖"},u4={button:"导入",title:"从 JSON 导入服务器",inputLabel:"服务器配置 JSON",inputHelp:"粘贴您的服务器配置 JSON。支持 STDIO、SSE 和 HTTP (streamable-http) 服务器类型。",preview:"预览",previewTitle:"预览要导入的服务器",import:"导入",importing:"导入中...",invalidFormat:"无效的 JSON 格式。JSON 必须包含 'mcpServers' 对象。",parseError:"解析 JSON 失败。请检查格式后重试。",addFailed:"添加服务器失败",importFailed:"导入服务器失败",partialSuccess:"成功导入 {{count}} / {{total}} 个服务器。部分服务器失败:"},d4={button:"导入",title:"从 JSON 导入分组",inputLabel:"分组配置 JSON",inputHelp:"粘贴您的分组配置 JSON。每个分组可以包含一个服务器列表。",preview:"预览",previewTitle:"预览要导入的分组",import:"导入",importing:"导入中...",invalidFormat:"无效的 JSON 格式。JSON 必须包含 'groups' 数组。",missingName:"每个分组必须有 'name' 字段。",parseError:"解析 JSON 失败。请检查格式后重试。",addFailed:"添加分组失败",importFailed:"导入分组失败",partialSuccess:"成功导入 {{count}} / {{total}} 个分组。部分分组失败:"},m4={add:"添加",addNew:"添加新用户",edit:"编辑用户",delete:"删除用户",create:"创建",update:"更新",username:"用户名",password:"密码",newPassword:"新密码",confirmPassword:"确认密码",changePassword:"修改密码",adminRole:"管理员",admin:"管理员",user:"用户",role:"角色",actions:"操作",addFirst:"添加第一个用户",permissions:"权限",adminPermissions:"完全系统访问权限",userPermissions:"受限访问权限",currentUser:"当前用户",noUsers:"没有找到用户",adminRequired:"需要管理员权限才能管理用户",usernameRequired:"用户名是必需的",passwordRequired:"密码是必需的",passwordTooShort:"密码至少需要6个字符",passwordMismatch:"密码不匹配",usernamePlaceholder:"输入用户名",passwordPlaceholder:"输入密码",newPasswordPlaceholder:"留空保持当前密码",confirmPasswordPlaceholder:"确认新密码",createError:"创建用户失败",updateError:"更新用户失败",deleteError:"删除用户失败",statsError:"获取用户统计失败",deleteConfirmation:"您确定要删除用户 '{{username}}' 吗?此操作无法撤消。",confirmDelete:"删除用户",deleteWarning:"您确定要删除用户 '{{username}}' 吗?此操作无法撤消。"},f4={errors:{readonly:"演示环境无法修改数据",invalid_credentials:"用户名或密码错误",serverNameRequired:"服务器名称是必需的",serverConfigRequired:"服务器配置是必需的",serverConfigInvalid:"服务器配置必须包含 URL、OpenAPI 规范 URL 或模式,或者带参数的命令",serverTypeInvalid:"服务器类型必须是以下之一:stdio、sse、streamable-http、openapi",urlRequiredForType:"{{type}} 服务器类型需要 URL",openapiSpecRequired:"openapi 服务器类型需要 OpenAPI 规范 URL 或模式",headersInvalidFormat:"请求头必须是对象格式",headersNotSupportedForStdio:"stdio 服务器类型不支持请求头",serverNotFound:"找不到服务器",failedToRemoveServer:"找不到服务器或删除失败",internalServerError:"服务器内部错误",failedToGetServers:"获取服务器信息失败",failedToGetServerSettings:"获取服务器设置失败",failedToGetServerConfig:"获取服务器配置失败",failedToSaveSettings:"保存设置失败",toolNameRequired:"服务器名称和工具名称是必需的",descriptionMustBeString:"描述必须是字符串",groupIdRequired:"分组 ID 是必需的",groupNameRequired:"分组名称是必需的",groupNotFound:"找不到分组",groupIdAndServerNameRequired:"分组 ID 和服务器名称是必需的",groupOrServerNotFound:"找不到分组或服务器",toolsMustBeAllOrArray:'工具必须是 "all" 或字符串数组',serverNameAndToolNameRequired:"服务器名称和工具名称是必需的",usernameRequired:"用户名是必需的",userNotFound:"找不到用户",failedToGetUsers:"获取用户信息失败",failedToGetUserInfo:"获取用户信息失败",failedToGetUserStats:"获取用户统计信息失败",marketServerNameRequired:"服务器名称是必需的",marketServerNotFound:"找不到市场服务器",failedToGetMarketServers:"获取市场服务器信息失败",failedToGetMarketServer:"获取市场服务器信息失败",failedToGetMarketCategories:"获取市场类别失败",failedToGetMarketTags:"获取市场标签失败",failedToSearchMarketServers:"搜索市场服务器失败",failedToFilterMarketServers:"过滤市场服务器失败",failedToProcessMcpbFile:"处理 MCPB 文件失败"},success:{serverCreated:"服务器创建成功",serverUpdated:"服务器更新成功",serverRemoved:"服务器删除成功",serverToggled:"服务器状态切换成功",toolToggled:"工具 {{name}} {{action}} 成功",toolDescriptionUpdated:"工具 {{name}} 描述更新成功",systemConfigUpdated:"系统配置更新成功",groupCreated:"分组创建成功",groupUpdated:"分组更新成功",groupDeleted:"分组删除成功",serverAddedToGroup:"服务器添加到分组成功",serverRemovedFromGroup:"服务器从分组移除成功",serverToolsUpdated:"服务器工具更新成功"}},p4={authorizationFailed:"授权失败",authorizationFailedError:"错误",authorizationFailedDetails:"详情",invalidRequest:"无效请求",missingStateParameter:"缺少必需的 OAuth 状态参数。",missingCodeParameter:"缺少必需的授权码参数。",serverNotFound:"服务器未找到",serverNotFoundMessage:"无法找到与此授权请求关联的服务器。",sessionExpiredMessage:"授权会话可能已过期。请重新进行授权。",authorizationSuccessful:"授权成功",server:"服务器",status:"状态",connected:"已连接",successMessage:"服务器已成功授权并连接。",autoCloseMessage:"此窗口将在 3 秒后自动关闭...",closeNow:"立即关闭",connectionError:"连接错误",connectionErrorMessage:"授权成功,但连接服务器失败。",reconnectMessage:"请尝试从控制面板重新连接。",configurationError:"配置错误",configurationErrorMessage:"服务器传输不支持 OAuth finishAuth()。请确保服务器配置为 streamable-http 传输。",internalError:"内部错误",internalErrorMessage:"处理 OAuth 回调时发生意外错误。",closeWindow:"关闭窗口"},h4={title:"活动",totalCalls:"总调用次数",successCount:"成功次数",errorCount:"失败次数",avgDuration:"平均耗时",timestamp:"时间",server:"服务器",tool:"工具",duration:"耗时",status:"状态",group:"分组",key:"API密钥",input:"输入",output:"输出",details:"活动详情",errorMessage:"错误信息",searchServer:"服务器...",searchTool:"工具...",searchStatus:"状态...",searchGroup:"分组...",searchKeyName:"API密钥...",keyName:"API密钥名称",allStatus:"全部状态",statusSuccess:"成功",statusError:"失败",noData:"暂无活动数据",fetchError:"加载活动数据失败",cleanup:"清理",confirmCleanup:"确定要删除30天前的活动记录吗?",cleanupSuccess:"已删除 {{count}} 条旧记录",cleanupError:"清理旧记录失败",notAvailable:"活动跟踪功能仅在数据库模式下可用"},g4={app:BN,about:IN,profile:HN,sponsor:GN,wechat:KN,discord:qN,theme:FN,auth:VN,server:$N,status:YN,errors:JN,common:QN,pagination:XN,nav:ZN,pages:WN,logs:e4,groups:t4,market:r4,oauthServer:a4,cloud:s4,registry:n4,tool:l4,prompt:i4,settings:o4,mcpb:c4,jsonImport:u4,groupImport:d4,users:m4,api:f4,oauthCallback:p4,activity:h4},x4={title:"Tableau de bord MCPHub",error:"Erreur",closeButton:"Fermer",noServers:"Aucun serveur MCP disponible",loading:"Chargement...",logout:"Déconnexion",profile:"Profil",changePassword:"Changer le mot de passe",toggleSidebar:"Basculer la barre latérale",welcomeUser:"Bienvenue, {{username}}",name:"MCPHub"},y4={title:"À propos",versionInfo:"Version MCPHub : {{version}}",newVersion:"Nouvelle version disponible !",currentVersion:"Version actuelle",newVersionAvailable:"La nouvelle version {{version}} est disponible",viewOnGitHub:"Voir sur GitHub",checkForUpdates:"Vérifier les mises à jour",checking:"Vérification des mises à jour..."},b4={viewProfile:"Voir le profil",userCenter:"Centre utilisateur"},v4={label:"Sponsor",title:"Soutenir le projet",rewardAlt:"QR Code de récompense",supportMessage:"Soutenez le développement de MCPHub en m'offrant un café !",supportButton:"Soutenir sur Ko-fi"},w4={label:"WeChat",title:"Se connecter via WeChat",qrCodeAlt:"QR Code WeChat",scanMessage:"Scannez ce QR code pour nous contacter sur WeChat"},S4={label:"Discord",title:"Rejoignez notre serveur Discord",community:"Rejoignez notre communauté grandissante sur Discord pour du support, des discussions et des mises à jour !"},j4={title:"Thème",light:"Clair",dark:"Sombre",system:"Système"},N4={login:"Connexion",loginTitle:"Se connecter à MCPHub",slogan:"Le Hub unifié pour les serveurs MCP",subtitle:"Plateforme de gestion centralisée pour les serveurs Model Context Protocol. Organisez, surveillez et mettez à l'échelle plusieurs serveurs MCP avec des stratégies de routage flexibles.",username:"Nom d'utilisateur",password:"Mot de passe",loggingIn:"Connexion en cours...",orContinue:"Ou continuer avec",loginWithGoogle:"Continuer avec Google",loginWithGithub:"Continuer avec GitHub",socialLoginFailed:"La connexion sociale a échoué. Veuillez réessayer.",emptyFields:"Le nom d'utilisateur et le mot de passe ne peuvent pas être vides",loginFailed:"Échec de la connexion, veuillez vérifier votre nom d'utilisateur et votre mot de passe",loginError:"Une erreur est survenue lors de la connexion",serverUnavailable:"Impossible de se connecter au serveur. Veuillez vérifier votre connexion réseau ou réessayer plus tard",currentPassword:"Mot de passe actuel",newPassword:"Nouveau mot de passe",confirmPassword:"Confirmer le mot de passe",passwordsNotMatch:"Le nouveau mot de passe et la confirmation ne correspondent pas",changePasswordSuccess:"Mot de passe changé avec succès",changePasswordError:"Échec du changement de mot de passe",changePassword:"Changer le mot de passe",passwordChanged:"Mot de passe changé avec succès",passwordChangeError:"Échec du changement de mot de passe",defaultPasswordWarning:"Avertissement de sécurité du mot de passe par défaut",defaultPasswordMessage:"Vous utilisez le mot de passe par défaut (admin123), ce qui présente un risque de sécurité. Veuillez changer votre mot de passe immédiatement pour protéger votre compte.",goToSettings:"Aller aux paramètres",passwordStrengthError:"Le mot de passe ne répond pas aux exigences de sécurité",passwordMinLength:"Le mot de passe doit contenir au moins 8 caractères",passwordRequireLetter:"Le mot de passe doit contenir au moins une lettre",passwordRequireNumber:"Le mot de passe doit contenir au moins un chiffre",passwordRequireSpecial:"Le mot de passe doit contenir au moins un caractère spécial",passwordStrengthHint:"Le mot de passe doit contenir au moins 8 caractères et inclure des lettres, des chiffres et des caractères spéciaux"},C4={addServer:"Ajouter un serveur",add:"Ajouter",edit:"Modifier",copy:"Copier",delete:"Supprimer",confirmDelete:"Êtes-vous sûr de vouloir supprimer ce serveur ?",deleteWarning:"La suppression du serveur '{{name}}' le supprimera ainsi que toutes ses données. Cette action est irréversible.",status:"Statut",tools:"Outils",prompts:"Invites",name:"Nom du serveur",url:"URL du serveur",apiKey:"Clé API",save:"Enregistrer",cancel:"Annuler",invalidConfig:"Impossible de trouver les données de configuration pour {{serverName}}",addError:"Échec de l'ajout du serveur",editError:"Échec de la modification du serveur {{serverName}}",deleteError:"Échec de la suppression du serveur {{serverName}}",updateError:"Échec de la mise à jour du serveur",editTitle:"Modifier le serveur : {{serverName}}",type:"Type de serveur",typeStdio:"STDIO",typeSse:"SSE",typeStreamableHttp:"HTTP diffusable",typeOpenapi:"OpenAPI",command:"Commande",arguments:"Arguments",envVars:"Variables d'environnement",headers:"En-têtes HTTP",key:"clé",value:"valeur",enabled:"Activé",enable:"Activer",disable:"Désactiver",reload:"Recharger",reloadSuccess:"Serveur rechargé avec succès",reloadError:"Échec du rechargement du serveur {{serverName}}",requestOptions:"Configuration de la connexion",timeout:"Délai d'attente de la requête",timeoutDescription:"Délai d'attente pour les requêtes vers le serveur MCP (ms)",maxTotalTimeout:"Délai d'attente total maximum",maxTotalTimeoutDescription:"Délai d'attente total maximum pour les requêtes envoyées au serveur MCP (ms) (à utiliser avec les notifications de progression)",resetTimeoutOnProgress:"Réinitialiser le délai d'attente en cas de progression",resetTimeoutOnProgressDescription:"Réinitialiser le délai d'attente lors des notifications de progression",keepAlive:"Configuration du maintien de connexion",enableKeepAlive:"Activer le maintien de connexion",keepAliveDescription:"Envoyer des requêtes ping périodiques pour maintenir la connexion. Utile pour les connexions de longue durée qui peuvent expirer.",keepAliveInterval:"Intervalle (ms)",keepAliveIntervalDescription:"Temps entre les pings de maintien de connexion en millisecondes (par défaut : 60000ms = 1 minute)",remove:"Retirer",toggleError:"Échec du basculement du serveur {{serverName}}",alreadyExists:"Le serveur {{serverName}} existe déjà",invalidData:"Données de serveur invalides fournies",notFound:"Serveur {{serverName}} non trouvé",namePlaceholder:"Entrez le nom du serveur",urlPlaceholder:"Entrez l'URL du serveur",commandPlaceholder:"Entrez la commande",argumentsPlaceholder:"Entrez les arguments",errorDetails:"Détails de l'erreur",viewErrorDetails:"Voir les détails de l'erreur",copyConfig:"Copier la configuration",confirmVariables:"Confirmer la configuration des variables",variablesDetected:"Variables détectées dans la configuration. Veuillez confirmer que ces variables sont correctement configurées :",detectedVariables:"Variables détectées",confirmVariablesMessage:"Veuillez vous assurer que ces variables sont correctement définies dans votre environnement d'exécution. Continuer l'ajout du serveur ?",confirmAndAdd:"Confirmer et ajouter",openapi:{inputMode:"Mode de saisie",inputModeUrl:"URL de la spécification",inputModeSchema:"Schéma JSON",specUrl:"URL de la spécification OpenAPI",schema:"Schéma JSON OpenAPI",schemaHelp:"Collez votre schéma JSON OpenAPI complet ici",security:"Type de sécurité",securityNone:"Aucun",securityApiKey:"Clé API",securityHttp:"Authentification HTTP",securityOAuth2:"OAuth 2.0",securityOpenIdConnect:"OpenID Connect",apiKeyConfig:"Configuration de la clé API",apiKeyName:"Nom de l'en-tête/paramètre",apiKeyIn:"Emplacement",apiKeyValue:"Valeur de la clé API",httpAuthConfig:"Configuration de l'authentification HTTP",httpScheme:"Schéma d'authentification",httpCredentials:"Identifiants",httpSchemeBasic:"Basic",httpSchemeBearer:"Bearer",httpSchemeDigest:"Digest",oauth2Config:"Configuration OAuth 2.0",oauth2Token:"Jeton d'accès",openIdConnectConfig:"Configuration OpenID Connect",openIdConnectUrl:"URL de découverte",openIdConnectToken:"Jeton d'identification",apiKeyInHeader:"En-tête",apiKeyInQuery:"Requête",apiKeyInCookie:"Cookie",passthroughHeaders:"En-têtes de transmission",passthroughHeadersHelp:"Liste séparée par des virgules des noms d'en-têtes à transmettre des requêtes d'appel d'outils vers les points de terminaison OpenAPI en amont (par ex. : Authorization, X-API-Key)"},oauth:{sectionTitle:"Configuration OAuth",sectionDescription:"Configurez les identifiants client pour les serveurs protégés par OAuth (optionnel).",clientId:"Identifiant client",clientSecret:"Secret client",authorizationEndpoint:"Point de terminaison d'autorisation",tokenEndpoint:"Point de terminaison de jeton",scopes:"Scopes",scopesPlaceholder:"scope1 scope2",resource:"Ressource / Audience",accessToken:"Jeton d'accès",refreshToken:"Jeton d'actualisation"}},k4={online:"En ligne",offline:"Hors ligne",connecting:"Connexion en cours",oauthRequired:"OAuth requis",clickToAuthorize:"Cliquez pour autoriser avec OAuth",oauthWindowOpened:"Fenêtre d'autorisation OAuth ouverte. Veuillez compléter l'autorisation."},A4={general:"Une erreur est survenue",network:"Erreur de connexion réseau. Veuillez vérifier votre connexion Internet",serverConnection:"Impossible de se connecter au serveur. Veuillez vérifier si le serveur est en cours d'exécution",serverAdd:"Échec de l'ajout du serveur. Veuillez vérifier l'état du serveur",serverUpdate:"Échec de la modification du serveur {{serverName}}. Veuillez vérifier l'état du serveur",serverFetch:"Échec de la récupération des données du serveur. Veuillez réessayer plus tard",failedToReloadServer:"Échec du rechargement du serveur",initialStartup:"Le serveur est peut-être en cours de démarrage. Veuillez patienter un instant car ce processus peut prendre du temps au premier lancement...",serverInstall:"Échec de l'installation du serveur",failedToFetchSettings:"Échec de la récupération des paramètres",failedToUpdateRouteConfig:"Échec de la mise à jour de la configuration de routage",failedToUpdateSmartRoutingConfig:"Échec de la mise à jour de la configuration du routage intelligent"},E4={processing:"En cours de traitement...",save:"Enregistrer",cancel:"Annuler",back:"Retour",refresh:"Actualiser",search:"Rechercher",clear:"Effacer",view:"Voir",create:"Créer",creating:"Création en cours...",update:"Mettre à jour",updating:"Mise à jour en cours...",submitting:"Envoi en cours...",delete:"Supprimer",remove:"Retirer",copy:"Copier",copyId:"Copier l'ID",copyUrl:"Copier l'URL",copyJson:"Copier le JSON",copySuccess:"Copié dans le presse-papiers",copyFailed:"Échec de la copie",copied:"Copié",close:"Fermer",confirm:"Confirmer",language:"Langue",true:"Vrai",false:"Faux",dismiss:"Rejeter",github:"GitHub",wechat:"WeChat",discord:"Discord",itemsPerPage:"Éléments par page",showing:"Affichage de {{start}}-{{end}} sur {{total}}",previous:"Précédent",next:"Suivant",required:"Requis",secret:"Secret",default:"Défaut",value:"Valeur",type:"Type",repeated:"Répété",valueHint:"Indice de valeur",choices:"Choix",actions:"Actions",saving:"Enregistrement...",active:"Actif",inactive:"Inactif"},T4={rowsPerPage:"Lignes par page",showing:"Affichage de {{from}}-{{to}} sur {{total}}"},R4={dashboard:"Tableau de bord",servers:"Serveurs",groups:"Groupes",users:"Utilisateurs",settings:"Paramètres",changePassword:"Changer le mot de passe",market:"Marché",cloud:"Marché Cloud",logs:"Journaux",activity:"Activité"},O4={dashboard:{title:"Tableau de bord",totalServers:"Total",onlineServers:"En ligne",offlineServers:"Hors ligne",connectingServers:"En connexion",recentServers:"Serveurs récents"},servers:{title:"Gestion des serveurs"},groups:{title:"Gestion des groupes"},users:{title:"Gestion des utilisateurs"},settings:{title:"Paramètres",language:"Langue",account:"Paramètres du compte",password:"Changer le mot de passe",appearance:"Apparence",routeConfig:"Sécurité",installConfig:"Installation",smartRouting:"Routage intelligent",oauthServer:"Serveur OAuth"},market:{title:"Marché Hub - Marchés locaux et Cloud"},logs:{title:"Journaux système"}},z4={filters:"Filtres",search:"Rechercher dans les journaux...",autoScroll:"Défilement automatique",clearLogs:"Effacer les journaux",loading:"Chargement des journaux...",noLogs:"Aucun journal disponible.",noMatch:"Aucun journal ne correspond aux filtres actuels.",mainProcess:"Processus principal",childProcess:"Processus enfant",main:"Principal",child:"Enfant"},M4={add:"Ajouter",addNew:"Ajouter un nouveau groupe",edit:"Modifier le groupe",delete:"Supprimer",confirmDelete:"Êtes-vous sûr de vouloir supprimer ce groupe ?",deleteWarning:"La suppression du groupe '{{name}}' le supprimera ainsi que toutes ses associations de serveurs. Cette action est irréversible.",name:"Nom du groupe",namePlaceholder:"Entrez le nom du groupe",nameRequired:"Le nom du groupe est requis",description:"Description",descriptionPlaceholder:"Entrez la description du groupe (facultatif)",createError:"Échec de la création du groupe",updateError:"Échec de la mise à jour du groupe",deleteError:"Échec de la suppression du groupe",serverAddError:"Échec de l'ajout du serveur au groupe",serverRemoveError:"Échec de la suppression du serveur du groupe",addServer:"Ajouter un serveur au groupe",selectServer:"Sélectionnez un serveur à ajouter",servers:"Serveurs dans le groupe",remove:"Retirer",noGroups:"Aucun groupe disponible. Créez un nouveau groupe pour commencer.",noServers:"Aucun serveur dans ce groupe.",noServerOptions:"Aucun serveur disponible",serverCount:"{{count}} serveurs",toolSelection:"Sélection d'outils",toolsSelected:"Sélectionné",allTools:"Tous",selectedTools:"Outils sélectionnés",selectAll:"Tout sélectionner",selectNone:"Ne rien sélectionner",configureTools:"Configurer les outils"},L4={title:"Installation locale",official:"Officiel",by:"Par",unknown:"Inconnu",tools:"outils",search:"Rechercher",searchPlaceholder:"Rechercher des serveurs par nom, catégorie ou tags",clearFilters:"Effacer",clearCategoryFilter:"",clearTagFilter:"",categories:"Catégories",tags:"Tags",showTags:"Afficher les tags",hideTags:"Masquer les tags",moreTags:"",noServers:"Aucun serveur trouvé correspondant à votre recherche",backToList:"Retour à la liste",install:"Installer",installing:"Installation en cours...",installed:"Installé",installServer:"Installer le serveur : {{name}}",installSuccess:"Serveur {{serverName}} installé avec succès",author:"Auteur",license:"Licence",repository:"Dépôt",examples:"Exemples",arguments:"Arguments",argumentName:"Nom",description:"Description",required:"Requis",example:"Exemple",viewSchema:"Voir le schéma",fetchError:"Erreur lors de la récupération des serveurs du marché",serverNotFound:"Serveur non trouvé",searchError:"Erreur lors de la recherche de serveurs",filterError:"Erreur lors du filtrage des serveurs par catégorie",tagFilterError:"Erreur lors du filtrage des serveurs par tag",noInstallationMethod:"Aucune méthode d'installation disponible pour ce serveur",showing:"Affichage de {{from}}-{{to}} sur {{total}} serveurs",perPage:"Par page",confirmVariablesMessage:"Veuillez vous assurer que ces variables sont correctement définies dans votre environnement d'exécution. Continuer l'installation du serveur ?",confirmAndInstall:"Confirmer et installer"},D4={authorizeTitle:"Autoriser l'application",authorizeSubtitle:"Autorisez cette application à accéder à votre compte MCPHub.",buttons:{approve:"Autoriser l'accès",deny:"Refuser",approveSubtitle:"Recommandé si vous faites confiance à cette application.",denySubtitle:"Vous pourrez toujours accorder l'accès plus tard."}},P4={title:"Support Cloud",subtitle:"Propulsé par MCPRouter",by:"Par",server:"Serveur",config:"Config",created:"Créé",updated:"Mis à jour",available:"Disponible",description:"Description",details:"Détails",tools:"Outils",tool:"outil",toolsAvailable:"{{count}} outil disponible||{{count}} outils disponibles",loadingTools:"Chargement des outils...",noTools:"Aucun outil disponible pour ce serveur",noDescription:"Aucune description disponible",viewDetails:"Voir les détails",parameters:"Paramètres",result:"Résultat",error:"Erreur",callTool:"Appeler",calling:"Appel en cours...",toolCallSuccess:"L'outil {{toolName}} a été exécuté avec succès",toolCallError:"Échec de l'appel de l'outil {{toolName}} : {{error}}",viewSchema:"Voir le schéma",backToList:"Retour au marché Cloud",search:"Rechercher",searchPlaceholder:"Rechercher des serveurs cloud par nom, titre ou auteur",clearFilters:"Effacer les filtres",clearCategoryFilter:"Effacer",clearTagFilter:"Effacer",categories:"Catégories",tags:"Tags",noCategories:"Aucune catégorie trouvée",noTags:"Aucun tag trouvé",noServers:"Aucun serveur cloud trouvé",fetchError:"Erreur lors de la récupération des serveurs cloud",serverNotFound:"Serveur cloud non trouvé",searchError:"Erreur lors de la recherche de serveurs cloud",filterError:"Erreur lors du filtrage des serveurs cloud par catégorie",tagFilterError:"Erreur lors du filtrage des serveurs cloud par tag",showing:"Affichage de {{from}}-{{to}} sur {{total}} serveurs cloud",perPage:"Par page",apiKeyNotConfigured:"Clé API MCPRouter non configurée",apiKeyNotConfiguredDescription:"Pour utiliser les serveurs cloud, vous devez configurer votre clé API MCPRouter.",getApiKey:"Obtenir une clé API",configureInSettings:"Configurer dans les paramètres",installServer:"Installer {{name}}",installSuccess:"Serveur {{name}} installé avec succès",installError:"Échec de l'installation du serveur : {{error}}"},U4={title:"Registre",official:"Officiel",latest:"Dernière version",description:"Description",website:"Site web",repository:"Dépôt",packages:"Paquets",package:"paquet",remotes:"Services distants",remote:"service distant",published:"Publié",updated:"Mis à jour",install:"Installer",installing:"Installation...",installed:"Installé",installServer:"Installer {{name}}",installSuccess:"Serveur {{name}} installé avec succès",installError:"Échec de l'installation du serveur : {{error}}",noDescription:"Aucune description disponible",viewDetails:"Voir les détails",backToList:"Retour au registre",search:"Rechercher",searchPlaceholder:"Rechercher des serveurs par nom",clearFilters:"Effacer",noServers:"Aucun serveur trouvé dans le registre",fetchError:"Erreur lors de la récupération des serveurs du registre",serverNotFound:"Serveur du registre non trouvé",showing:"Affichage de {{from}}-{{to}} sur {{total}} serveurs du registre",perPage:"Par page",environmentVariables:"Variables d'environnement",packageArguments:"Arguments du paquet",runtimeArguments:"Arguments d'exécution",headers:"En-têtes"},_4={run:"Exécuter",running:"Exécution en cours...",runTool:"Exécuter l'outil",cancel:"Annuler",noDescription:"Aucune description disponible",inputSchema:"Schéma d'entrée :",runToolWithName:"Exécuter l'outil : {{name}}",execution:"Exécution de l'outil",successful:"Réussi",failed:"Échoué",result:"Résultat :",error:"Erreur",errorDetails:"Détails de l'erreur :",noContent:"L'outil a été exécuté avec succès mais n'a renvoyé aucun contenu.",unknownError:"Une erreur inconnue est survenue",jsonResponse:"Réponse JSON :",toolResult:"Résultat de l'outil",noParameters:"Cet outil ne nécessite aucun paramètre.",selectOption:"Sélectionnez une option",enterValue:"Entrez la valeur {{type}}",enabled:"Activé",enableSuccess:"Outil {{name}} activé avec succès",disableSuccess:"Outil {{name}} désactivé avec succès",toggleFailed:"Échec du basculement de l'état de l'outil",parameters:"Paramètres de l'outil",formMode:"Mode formulaire",jsonMode:"Mode JSON",jsonConfiguration:"Configuration JSON",invalidJsonFormat:"Format JSON invalide",fixJsonBeforeSwitching:"Veuillez corriger le format JSON avant de passer en mode formulaire",item:"Élément {{index}}",addItem:"Ajouter un élément {{key}}",enterKey:"Entrez {{key}}"},B4={run:"Obtenir",running:"Obtention en cours...",result:"Résultat de l'invite",error:"Erreur de l'invite",execution:"Exécution de l'invite",successful:"Réussi",failed:"Échoué",errorDetails:"Détails de l'erreur :",noContent:"L'invite a été exécutée avec succès mais n'a renvoyé aucun contenu.",unknownError:"Une erreur inconnue est survenue",jsonResponse:"Réponse JSON :",description:"Description",messages:"Messages",noDescription:"Aucune description disponible",runPromptWithName:"Obtenir l'invite : {{name}}",descriptionUpdateSuccess:"Description de l'invite mise à jour avec succès",descriptionUpdateFailed:"Échec de la mise à jour de la description de l'invite"},I4={enableGlobalRoute:"Activer la route globale",enableGlobalRouteDescription:"Autoriser les connexions au point de terminaison /sse sans spécifier d'ID de groupe",enableGroupNameRoute:"Activer la route par nom de groupe",enableGroupNameRouteDescription:"Autoriser les connexions au point de terminaison /sse en utilisant les noms de groupe au lieu des ID de groupe",enableBearerAuth:"Activer l'authentification Bearer",enableBearerAuthDescription:"Exiger une authentification par jeton Bearer pour les points de terminaison MCP (activé par défaut)",bearerAuthKey:"Clé d'authentification Bearer",bearerAuthKeyDescription:"La clé d'authentification qui sera requise dans le jeton Bearer",bearerAuthKeyPlaceholder:"Entrez la clé d'authentification Bearer",bearerKeysSectionTitle:"Clés",bearerKeysSectionDescription:"Gérez plusieurs clés avec différentes portées d’accès.",noBearerKeys:"Aucune clé configurée pour le moment.",bearerKeyName:"Nom",bearerKeyToken:"Jeton",bearerKeyEnabled:"Activée",bearerKeyAccessType:"Portée d’accès",bearerKeyAccessAll:"Toutes",bearerKeyAccessGroups:"Groupes",bearerKeyAccessServers:"Serveurs",bearerKeyAccessCustom:"Personnalisée",bearerKeyAllowedGroups:"Groupes autorisés",bearerKeyAllowedServers:"Serveurs autorisés",addBearerKey:"Ajouter une clé",addBearerKeyButton:"Créer",bearerKeyRequired:"Le nom et le jeton sont obligatoires",deleteBearerKeyConfirm:"Voulez-vous vraiment supprimer cette clé ?",generate:"Générer",selectGroups:"Sélectionner des groupes",selectServers:"Sélectionner des serveurs",selectAtLeastOneGroup:"Veuillez sélectionner au moins un groupe",selectAtLeastOneServer:"Veuillez sélectionner au moins un serveur",skipAuth:"Ignorer l'authentification",skipAuthDescription:"Autoriser l'accès au tableau de bord sans connexion (n'affecte pas l'auth MCP)",pythonIndexUrl:"URL du dépôt de paquets Python",pythonIndexUrlDescription:"Définir la variable d'environnement UV_DEFAULT_INDEX pour l'installation de paquets Python",pythonIndexUrlPlaceholder:"ex. https://pypi.org/simple",npmRegistry:"URL du registre NPM",npmRegistryDescription:"Définir la variable d'environnement npm_config_registry pour l'installation de paquets NPM",npmRegistryPlaceholder:"ex. https://registry.npmjs.org/",baseUrl:"URL de base",baseUrlDescription:"URL de base pour les requêtes MCP et les callbacks OAuth",baseUrlPlaceholder:"ex. http://localhost:3000",installConfig:"Installation",systemConfigUpdated:"Configuration système mise à jour avec succès",enableSmartRouting:"Activer le routage intelligent",enableSmartRoutingDescription:"Activer la fonctionnalité de routage intelligent pour rechercher l'outil le plus approprié en fonction de l'entrée (en utilisant le nom de groupe $smart)",dbUrl:"URL PostgreSQL (nécessite le support de pgvector)",dbUrlPlaceholder:"ex. postgresql://user:password@localhost:5432/dbname",embeddingProvider:"Fournisseur d'embeddings",openaiApiBaseUrl:"URL de base de l'API OpenAI",openaiApiBaseUrlPlaceholder:"https://api.openai.com/v1",openaiApiKey:"Clé API OpenAI",openaiApiKeyPlaceholder:"Entrez la clé API OpenAI",openaiApiEmbeddingModel:"Modèle d'intégration OpenAI",openaiApiEmbeddingModelPlaceholder:"text-embedding-3-small",azureOpenaiEndpoint:"Point de terminaison Azure OpenAI",azureOpenaiEndpointPlaceholder:"https://VOTRE_NOM_DE_RESSOURCE.openai.azure.com",azureOpenaiApiKey:"Clé API Azure OpenAI",azureOpenaiApiKeyPlaceholder:"Entrez la clé API Azure OpenAI",azureOpenaiApiVersion:"Version de l'API Azure OpenAI",azureOpenaiApiVersionPlaceholder:"2024-02-15-preview",azureOpenaiEmbeddingDeployment:"Déploiement d'embeddings Azure OpenAI",azureOpenaiEmbeddingDeploymentPlaceholder:"text-embedding-3-small",smartRoutingConfigUpdated:"Configuration du routage intelligent mise à jour avec succès",smartRoutingRequiredFields:"L'URL de la base de données et la clé API OpenAI sont requises pour activer le routage intelligent",smartRoutingValidationError:"Veuillez remplir les champs obligatoires avant d'activer le routage intelligent : {{fields}}",mcpRouterConfig:"Marché Cloud",mcpRouterApiKey:"Clé API MCPRouter",mcpRouterApiKeyDescription:"Clé API pour accéder aux services du marché cloud MCPRouter",mcpRouterApiKeyPlaceholder:"Entrez la clé API MCPRouter",mcpRouterReferer:"Référent",mcpRouterRefererDescription:"En-tête Referer pour les requêtes API MCPRouter",mcpRouterRefererPlaceholder:"https://www.mcphubx.com",mcpRouterTitle:"Titre",mcpRouterTitleDescription:"En-tête Title pour les requêtes API MCPRouter",mcpRouterTitlePlaceholder:"MCPHub",mcpRouterBaseUrl:"URL de base",mcpRouterBaseUrlDescription:"URL de base pour l'API MCPRouter",mcpRouterBaseUrlPlaceholder:"https://api.mcprouter.to/v1",systemSettings:"Paramètres système",nameSeparatorLabel:"Séparateur de noms",nameSeparatorDescription:"Caractère utilisé pour séparer le nom du serveur et le nom de l'outil/prompt (par défaut : -)",enableSessionRebuild:"Activer la reconstruction de session serveur",enableSessionRebuildDescription:"Lorsqu'il est activé, applique le code de reconstruction de session serveur amélioré pour une meilleure expérience de gestion de session",restartRequired:"Configuration enregistrée. Il est recommandé de redémarrer l'application pour s'assurer que tous les services chargent correctement les nouveaux paramètres.",exportMcpSettings:"Exporter les paramètres",mcpSettingsJson:"JSON des paramètres MCP",mcpSettingsJsonDescription:"Afficher, copier ou télécharger votre configuration mcp_settings.json actuelle pour la sauvegarde ou la migration vers d'autres outils",copyToClipboard:"Copier dans le presse-papiers",downloadJson:"Télécharger JSON",exportSuccess:"Paramètres exportés avec succès",exportError:"Échec de la récupération des paramètres",enableOauthServer:"Activer le serveur OAuth",enableOauthServerDescription:"Permet à MCPHub d'émettre des jetons OAuth pour les clients externes",requireClientSecret:"Exiger un secret client",requireClientSecretDescription:"Lorsque activé, les clients confidentiels doivent présenter un client secret (désactivez-le pour les clients PKCE publics)",requireState:"Exiger le paramètre state",requireStateDescription:"Refuser les demandes d'autorisation qui n'incluent pas le paramètre state",accessTokenLifetime:"Durée de vie du jeton d'accès (secondes)",accessTokenLifetimeDescription:"Durée pendant laquelle les jetons d'accès émis restent valides",accessTokenLifetimePlaceholder:"ex. 3600",refreshTokenLifetime:"Durée de vie du jeton d'actualisation (secondes)",refreshTokenLifetimeDescription:"Durée pendant laquelle les jetons d'actualisation restent valides",refreshTokenLifetimePlaceholder:"ex. 1209600",authorizationCodeLifetime:"Durée de vie du code d'autorisation (secondes)",authorizationCodeLifetimeDescription:"Temps pendant lequel les codes d'autorisation peuvent être échangés",authorizationCodeLifetimePlaceholder:"ex. 300",allowedScopes:"Scopes autorisés",allowedScopesDescription:"Liste séparée par des virgules des scopes que les utilisateurs peuvent approuver",allowedScopesPlaceholder:"ex. read, write",enableDynamicRegistration:"Activer l'enregistrement dynamique",dynamicRegistrationDescription:"Autoriser les clients conformes RFC 7591 à s'enregistrer via l'endpoint public",dynamicRegistrationAllowedGrantTypes:"Types de flux autorisés",dynamicRegistrationAllowedGrantTypesDescription:"Liste séparée par des virgules des types de flux disponibles pour les clients enregistrés dynamiquement",dynamicRegistrationAllowedGrantTypesPlaceholder:"ex. authorization_code, refresh_token",dynamicRegistrationAuth:"Exiger une authentification",dynamicRegistrationAuthDescription:"Protège l'endpoint d'enregistrement afin que seules les requêtes authentifiées puissent créer des clients",invalidNumberInput:"Veuillez saisir un nombre valide supérieur ou égal à zéro"},H4={upload:"Télécharger",uploadTitle:"Télécharger le bundle MCPB",dropFileHere:"Déposez votre fichier .mcpb ici",orClickToSelect:"ou cliquez pour sélectionner depuis votre ordinateur",invalidFileType:"Veuillez sélectionner un fichier .mcpb valide",noFileSelected:"Veuillez sélectionner un fichier .mcpb à télécharger",uploading:"Téléchargement en cours...",uploadFailed:"Échec du téléchargement du fichier MCPB",installServer:"Installer le serveur MCP depuis MCPB",extensionInfo:"Informations sur l'extension",name:"Nom",version:"Version",description:"Description",author:"Auteur",tools:"Outils",serverName:"Nom du serveur",serverNamePlaceholder:"Entrez un nom pour ce serveur",install:"Installer",installing:"Installation en cours...",installFailed:"Échec de l'installation du serveur depuis MCPB",serverExistsTitle:"Le serveur existe déjà",serverExistsConfirm:"Le serveur '{{serverName}}' existe déjà. Voulez-vous le remplacer par la nouvelle version ?",override:"Remplacer"},G4={button:"Importer",title:"Importer des serveurs depuis JSON",inputLabel:"Configuration JSON du serveur",inputHelp:"Collez votre configuration JSON de serveur. Prend en charge les types de serveurs STDIO, SSE et HTTP (streamable-http).",preview:"Aperçu",previewTitle:"Aperçu des serveurs à importer",import:"Importer",importing:"Importation en cours...",invalidFormat:"Format JSON invalide. Le JSON doit contenir un objet 'mcpServers'.",parseError:"Échec de l'analyse du JSON. Veuillez vérifier le format et réessayer.",addFailed:"Échec de l'ajout du serveur",importFailed:"Échec de l'importation des serveurs",partialSuccess:"{{count}} serveur(s) sur {{total}} importé(s) avec succès. Certains serveurs ont échoué :"},K4={button:"Importer",title:"Importer des groupes depuis JSON",inputLabel:"Configuration JSON des groupes",inputHelp:"Collez votre configuration JSON de groupes. Chaque groupe peut contenir une liste de serveurs.",preview:"Aperçu",previewTitle:"Aperçu des groupes à importer",import:"Importer",importing:"Importation en cours...",invalidFormat:"Format JSON invalide. Le JSON doit contenir un tableau 'groups'.",missingName:"Chaque groupe doit avoir un champ 'name'.",parseError:"Échec de l'analyse du JSON. Veuillez vérifier le format et réessayer.",addFailed:"Échec de l'ajout du groupe",importFailed:"Échec de l'importation des groupes",partialSuccess:"{{count}} groupe(s) sur {{total}} importé(s) avec succès. Certains groupes ont échoué :"},q4={add:"Ajouter un utilisateur",addNew:"Ajouter un nouvel utilisateur",edit:"Modifier l'utilisateur",delete:"Supprimer l'utilisateur",create:"Créer un utilisateur",update:"Mettre à jour l'utilisateur",username:"Nom d'utilisateur",password:"Mot de passe",newPassword:"Nouveau mot de passe",confirmPassword:"Confirmer le mot de passe",changePassword:"Changer le mot de passe",adminRole:"Administrateur",admin:"Admin",user:"Utilisateur",role:"Rôle",actions:"Actions",addFirst:"Ajoutez votre premier utilisateur",permissions:"Permissions",adminPermissions:"Accès complet au système",userPermissions:"Accès limité",currentUser:"Vous",noUsers:"Aucun utilisateur trouvé",adminRequired:"Un accès administrateur est requis pour gérer les utilisateurs",usernameRequired:"Le nom d'utilisateur est requis",passwordRequired:"Le mot de passe est requis",passwordTooShort:"Le mot de passe doit comporter au moins 6 caractères",passwordMismatch:"Les mots de passe ne correspondent pas",usernamePlaceholder:"Entrez le nom d'utilisateur",passwordPlaceholder:"Entrez le mot de passe",newPasswordPlaceholder:"Laissez vide pour conserver le mot de passe actuel",confirmPasswordPlaceholder:"Confirmez le nouveau mot de passe",createError:"Échec de la création de l'utilisateur",updateError:"Échec de la mise à jour de l'utilisateur",deleteError:"Échec de la suppression de l'utilisateur",statsError:"Échec de la récupération des statistiques utilisateur",deleteConfirmation:"Êtes-vous sûr de vouloir supprimer l'utilisateur '{{username}}' ? Cette action est irréversible.",confirmDelete:"Supprimer l'utilisateur",deleteWarning:"Êtes-vous sûr de vouloir supprimer l'utilisateur '{{username}}' ? Cette action est irréversible."},F4={errors:{readonly:"Lecture seule pour l'environnement de démonstration",invalid_credentials:"Nom d'utilisateur ou mot de passe invalide",serverNameRequired:"Le nom du serveur est requis",serverConfigRequired:"La configuration du serveur est requise",serverConfigInvalid:"La configuration du serveur doit inclure une URL, une URL de spécification OpenAPI ou un schéma, ou une commande avec des arguments",serverTypeInvalid:"Le type de serveur doit être l'un des suivants : stdio, sse, streamable-http, openapi",urlRequiredForType:"L'URL est requise pour le type de serveur {{type}}",openapiSpecRequired:"L'URL de la spécification OpenAPI ou le schéma est requis pour le type de serveur openapi",headersInvalidFormat:"Les en-têtes doivent être un objet",headersNotSupportedForStdio:"Les en-têtes ne sont pas pris en charge pour le type de serveur stdio",serverNotFound:"Serveur non trouvé",failedToRemoveServer:"Serveur non trouvé ou échec de la suppression",internalServerError:"Erreur interne du serveur",failedToGetServers:"Échec de la récupération des informations sur les serveurs",failedToGetServerSettings:"Échec de la récupération des paramètres du serveur",failedToGetServerConfig:"Échec de la récupération de la configuration du serveur",failedToSaveSettings:"Échec de l'enregistrement des paramètres",toolNameRequired:"Le nom du serveur et le nom de l'outil sont requis",descriptionMustBeString:"La description doit être une chaîne de caractères",groupIdRequired:"L'ID de groupe est requis",groupNameRequired:"Le nom du groupe est requis",groupNotFound:"Groupe non trouvé",groupIdAndServerNameRequired:"L'ID de groupe和le nom du serveur sont requis",groupOrServerNotFound:"Groupe ou serveur non trouvé",toolsMustBeAllOrArray:'Les outils doivent être "all" ou un tableau de chaînes de caractères',serverNameAndToolNameRequired:"Le nom du serveur et le nom de l'outil sont requis",usernameRequired:"Le nom d'utilisateur est requis",userNotFound:"Utilisateur non trouvé",failedToGetUsers:"Échec de la récupération des informations sur les utilisateurs",failedToGetUserInfo:"Échec de la récupération des informations sur l'utilisateur",failedToGetUserStats:"Échec de la récupération des statistiques de l'utilisateur",marketServerNameRequired:"Le nom du serveur du marché est requis",marketServerNotFound:"Serveur du marché non trouvé",failedToGetMarketServers:"Échec de la récupération des informations sur les serveurs du marché",failedToGetMarketServer:"Échec de la récupération des informations sur le serveur du marché",failedToGetMarketCategories:"Échec de la récupération des catégories du marché",failedToGetMarketTags:"Échec de la récupération des tags du marché",failedToSearchMarketServers:"Échec de la recherche des serveurs du marché",failedToFilterMarketServers:"Échec du filtrage des serveurs du marché",failedToProcessMcpbFile:"Échec du traitement du fichier MCPB"},success:{serverCreated:"Serveur créé avec succès",serverUpdated:"Serveur mis à jour avec succès",serverRemoved:"Serveur supprimé avec succès",serverToggled:"État du serveur basculé avec succès",toolToggled:"Outil {{name}} {{action}} avec succès",toolDescriptionUpdated:"Description de l'outil {{name}} mise à jour avec succès",systemConfigUpdated:"Configuration système mise à jour avec succès",groupCreated:"Groupe créé avec succès",groupUpdated:"Groupe mis à jour avec succès",groupDeleted:"Groupe supprimé avec succès",serverAddedToGroup:"Serveur ajouté au groupe avec succès",serverRemovedFromGroup:"Serveur supprimé du groupe avec succès",serverToolsUpdated:"Outils du serveur mis à jour avec succès"}},V4={authorizationFailed:"Échec de l'autorisation",authorizationFailedError:"Erreur",authorizationFailedDetails:"Détails",invalidRequest:"Requête invalide",missingStateParameter:"Paramètre d'état OAuth requis manquant.",missingCodeParameter:"Paramètre de code d'autorisation requis manquant.",serverNotFound:"Serveur introuvable",serverNotFoundMessage:"Impossible de trouver le serveur associé à cette demande d'autorisation.",sessionExpiredMessage:"La session d'autorisation a peut-être expiré. Veuillez réessayer l'autorisation.",authorizationSuccessful:"Autorisation réussie",server:"Serveur",status:"État",connected:"Connecté",successMessage:"Le serveur a été autorisé et connecté avec succès.",autoCloseMessage:"Cette fenêtre se fermera automatiquement dans 3 secondes...",closeNow:"Fermer maintenant",connectionError:"Erreur de connexion",connectionErrorMessage:"L'autorisation a réussi, mais la connexion au serveur a échoué.",reconnectMessage:"Veuillez essayer de vous reconnecter à partir du tableau de bord.",configurationError:"Erreur de configuration",configurationErrorMessage:"Le transport du serveur ne prend pas en charge OAuth finishAuth(). Veuillez vous assurer que le serveur est configuré avec le transport streamable-http.",internalError:"Erreur interne",internalErrorMessage:"Une erreur inattendue s'est produite lors du traitement du callback OAuth.",closeWindow:"Fermer la fenêtre"},$4={title:"Activité",totalCalls:"Total des appels",successCount:"Réussites",errorCount:"Échecs",avgDuration:"Durée moyenne",timestamp:"Horodatage",server:"Serveur",tool:"Outil",duration:"Durée",status:"Statut",group:"Groupe",key:"Clé API",input:"Entrée",output:"Sortie",details:"Détails de l’activité",errorMessage:"Message d’erreur",searchServer:"Serveur...",searchTool:"Outil...",searchStatus:"Statut...",searchGroup:"Groupe...",searchKeyName:"Clé API...",keyName:"Nom de la clé API",allStatus:"Tous les statuts",statusSuccess:"Succès",statusError:"Erreur",noData:"Aucune activité disponible",fetchError:"Impossible de charger les données d’activité",cleanup:"Nettoyer",confirmCleanup:"Voulez-vous vraiment supprimer les activités de plus de 30 jours ?",cleanupSuccess:"{{count}} anciennes activités supprimées",cleanupError:"Échec du nettoyage des anciennes activités",notAvailable:"Le suivi des activités est disponible uniquement en mode base de données"},Y4={app:x4,about:y4,profile:b4,sponsor:v4,wechat:w4,discord:S4,theme:j4,auth:N4,server:C4,status:k4,errors:A4,common:E4,pagination:T4,nav:R4,pages:O4,logs:z4,groups:M4,market:L4,oauthServer:D4,cloud:P4,registry:U4,tool:_4,prompt:B4,settings:I4,mcpb:H4,jsonImport:G4,groupImport:K4,users:q4,api:F4,oauthCallback:V4,activity:$4},J4={title:"MCPHub Kontrol Paneli",error:"Hata",closeButton:"Kapat",noServers:"Kullanılabilir MCP sunucusu yok",loading:"Yükleniyor...",logout:"Çıkış Yap",profile:"Profil",changePassword:"Şifre Değiştir",toggleSidebar:"Kenar Çubuğunu Aç/Kapat",welcomeUser:"Hoş geldin, {{username}}",name:"MCPHub"},Q4={title:"Hakkında",versionInfo:"MCPHub Sürümü: {{version}}",newVersion:"Yeni sürüm mevcut!",currentVersion:"Mevcut sürüm",newVersionAvailable:"Yeni sürüm {{version}} mevcut",viewOnGitHub:"GitHub'da Görüntüle",checkForUpdates:"Güncellemeleri Kontrol Et",checking:"Güncellemeler kontrol ediliyor..."},X4={viewProfile:"Profili görüntüle",userCenter:"Kullanıcı Merkezi"},Z4={label:"Sponsor",title:"Projeyi Destekle",rewardAlt:"Ödül QR Kodu",supportMessage:"Bana bir kahve ısmarlayarak MCPHub'ın geliştirilmesini destekleyin!",supportButton:"Ko-fi'de Destek Ol"},W4={label:"WeChat",title:"WeChat ile Bağlan",qrCodeAlt:"WeChat QR Kodu",scanMessage:"WeChat'te bizimle bağlantı kurmak için bu QR kodunu tarayın"},eC={label:"Discord",title:"Discord sunucumuza katılın",community:"Destek, tartışmalar ve güncellemeler için büyüyen Discord topluluğumuza katılın!"},tC={title:"Tema",light:"Açık",dark:"Koyu",system:"Sistem"},rC={login:"Giriş Yap",loginTitle:"MCPHub'a Giriş Yap",slogan:"Birleşik MCP sunucu yönetim platformu",subtitle:"Model Context Protocol sunucuları için merkezi yönetim platformu. Esnek yönlendirme stratejileri ile birden fazla MCP sunucusunu organize edin, izleyin ve ölçeklendirin.",username:"Kullanıcı Adı",password:"Şifre",loggingIn:"Giriş yapılıyor...",orContinue:"Veya şununla devam et",loginWithGoogle:"Google ile devam et",loginWithGithub:"GitHub ile devam et",socialLoginFailed:"Sosyal giriş başarısız oldu. Lütfen tekrar deneyin.",emptyFields:"Kullanıcı adı ve şifre boş olamaz",loginFailed:"Giriş başarısız, lütfen kullanıcı adınızı ve şifrenizi kontrol edin",loginError:"Giriş sırasında bir hata oluştu",serverUnavailable:"Sunucuya bağlanılamıyor. Lütfen ağ bağlantınızı kontrol edin veya daha sonra tekrar deneyin",currentPassword:"Mevcut Şifre",newPassword:"Yeni Şifre",confirmPassword:"Şifreyi Onayla",passwordsNotMatch:"Yeni şifre ve onay eşleşmiyor",changePasswordSuccess:"Şifre başarıyla değiştirildi",changePasswordError:"Şifre değişikliği başarısız oldu",changePassword:"Şifre Değiştir",passwordChanged:"Şifre başarıyla değiştirildi",passwordChangeError:"Şifre değişikliği başarısız oldu",defaultPasswordWarning:"Varsayılan Şifre Güvenlik Uyarısı",defaultPasswordMessage:"Varsayılan şifreyi (admin123) kullanıyorsunuz, bu bir güvenlik riski oluşturur. Hesabınızı korumak için lütfen şifrenizi hemen değiştirin.",goToSettings:"Ayarlara Git",passwordStrengthError:"Şifre güvenlik gereksinimlerini karşılamıyor",passwordMinLength:"Şifre en az 8 karakter uzunluğunda olmalıdır",passwordRequireLetter:"Şifre en az bir harf içermelidir",passwordRequireNumber:"Şifre en az bir rakam içermelidir",passwordRequireSpecial:"Şifre en az bir özel karakter içermelidir",passwordStrengthHint:"Şifre en az 8 karakter olmalı ve harf, rakam ve özel karakter içermelidir"},aC={addServer:"Sunucu Ekle",add:"Ekle",edit:"Düzenle",copy:"Kopyala",delete:"Sil",confirmDelete:"Bu sunucuyu silmek istediğinizden emin misiniz?",deleteWarning:"'{{name}}' sunucusunu silmek, onu ve tüm verilerini kaldıracaktır. Bu işlem geri alınamaz.",status:"Durum",tools:"Araçlar",prompts:"İstekler",name:"Sunucu Adı",url:"Sunucu URL'si",apiKey:"API Anahtarı",save:"Kaydet",cancel:"İptal",invalidConfig:"{{serverName}} için yapılandırma verisi bulunamadı",addError:"Sunucu eklenemedi",editError:"{{serverName}} sunucusu düzenlenemedi",deleteError:"{{serverName}} sunucusu silinemedi",updateError:"Sunucu güncellenemedi",editTitle:"Sunucuyu Düzenle: {{serverName}}",type:"Sunucu Türü",typeStdio:"STDIO",typeSse:"SSE",typeStreamableHttp:"Akış Yapılabilir HTTP",typeOpenapi:"OpenAPI",command:"Komut",arguments:"Argümanlar",envVars:"Ortam Değişkenleri",headers:"HTTP Başlıkları",key:"anahtar",value:"değer",enabled:"Etkin",enable:"Etkinleştir",disable:"Devre Dışı Bırak",reload:"Yeniden Yükle",reloadSuccess:"Sunucu başarıyla yeniden yüklendi",reloadError:"Sunucu {{serverName}} yeniden yüklenemedi",requestOptions:"Bağlantı Yapılandırması",timeout:"İstek Zaman Aşımı",timeoutDescription:"MCP sunucusuna yapılan istekler için zaman aşımı (ms)",maxTotalTimeout:"Maksimum Toplam Zaman Aşımı",maxTotalTimeoutDescription:"MCP sunucusuna gönderilen istekler için maksimum toplam zaman aşımı (ms) (İlerleme bildirimleriyle kullanın)",resetTimeoutOnProgress:"İlerlemede Zaman Aşımını Sıfırla",resetTimeoutOnProgressDescription:"İlerleme bildirimlerinde zaman aşımını sıfırla",keepAlive:"Bağlantı Canlı Tutma Yapılandırması",enableKeepAlive:"Bağlantı Canlı Tutmayı Etkinleştir",keepAliveDescription:"Bağlantıyı korumak için periyodik ping istekleri gönderin. Zaman aşımına uğrayabilecek uzun süreli bağlantılar için yararlıdır.",keepAliveInterval:"Aralık (ms)",keepAliveIntervalDescription:"Canlı tutma pingleri arasındaki süre milisaniye cinsinden (varsayılan: 60000ms = 1 dakika)",remove:"Kaldır",toggleError:"{{serverName}} sunucusu açılamadı/kapatılamadı",alreadyExists:"{{serverName}} sunucusu zaten mevcut",invalidData:"Geçersiz sunucu verisi sağlandı",notFound:"{{serverName}} sunucusu bulunamadı",namePlaceholder:"Sunucu adını girin",urlPlaceholder:"Sunucu URL'sini girin",commandPlaceholder:"Komutu girin",argumentsPlaceholder:"Argümanları girin",errorDetails:"Hata Detayları",viewErrorDetails:"Hata detaylarını görüntüle",copyConfig:"Yapılandırmayı Kopyala",confirmVariables:"Değişken Yapılandırmasını Onayla",variablesDetected:"Yapılandırmada değişkenler algılandı. Lütfen bu değişkenlerin düzgün yapılandırıldığını onaylayın:",detectedVariables:"Algılanan Değişkenler",confirmVariablesMessage:"Lütfen bu değişkenlerin çalışma ortamınızda düzgün tanımlandığından emin olun. Sunucu eklemeye devam edilsin mi?",confirmAndAdd:"Onayla ve Ekle",openapi:{inputMode:"Giriş Modu",inputModeUrl:"Şartname URL'si",inputModeSchema:"JSON Şeması",specUrl:"OpenAPI Şartname URL'si",schema:"OpenAPI JSON Şeması",schemaHelp:"Eksiksiz OpenAPI JSON şemanızı buraya yapıştırın",security:"Güvenlik Türü",securityNone:"Yok",securityApiKey:"API Anahtarı",securityHttp:"HTTP Kimlik Doğrulaması",securityOAuth2:"OAuth 2.0",securityOpenIdConnect:"OpenID Connect",apiKeyConfig:"API Anahtarı Yapılandırması",apiKeyName:"Başlık/Parametre Adı",apiKeyIn:"Konum",apiKeyValue:"API Anahtarı Değeri",httpAuthConfig:"HTTP Kimlik Doğrulama Yapılandırması",httpScheme:"Kimlik Doğrulama Şeması",httpCredentials:"Kimlik Bilgileri",httpSchemeBasic:"Basit",httpSchemeBearer:"Bearer",httpSchemeDigest:"Digest",oauth2Config:"OAuth 2.0 Yapılandırması",oauth2Token:"Erişim Anahtarı",openIdConnectConfig:"OpenID Connect Yapılandırması",openIdConnectUrl:"URL'yi Keşfet",openIdConnectToken:"ID Token",apiKeyInHeader:"Başlık",apiKeyInQuery:"Sorgu",apiKeyInCookie:"Çerez",passthroughHeaders:"Geçiş Başlıkları",passthroughHeadersHelp:"Araç çağrısı isteklerinden yukarı akış OpenAPI uç noktalarına geçirilecek başlık adlarının virgülle ayrılmış listesi (örn. Authorization, X-API-Key)"},oauth:{sectionTitle:"OAuth Yapılandırması",sectionDescription:"OAuth korumalı sunucular için istemci kimlik bilgilerini yapılandırın (isteğe bağlı).",clientId:"İstemci ID",clientSecret:"İstemci Gizli Anahtarı",authorizationEndpoint:"Yetkilendirme Uç Noktası",tokenEndpoint:"Token Uç Noktası",scopes:"Kapsamlar",scopesPlaceholder:"scope1 scope2",resource:"Kaynak / Hedef Kitle",accessToken:"Erişim Tokeni",refreshToken:"Yenileme Tokeni"}},sC={online:"Çevrimiçi",offline:"Çevrimdışı",connecting:"Bağlanıyor",oauthRequired:"OAuth Gerekli",clickToAuthorize:"OAuth ile yetkilendirmek için tıklayın",oauthWindowOpened:"OAuth yetkilendirme penceresi açıldı. Lütfen yetkilendirmeyi tamamlayın."},nC={general:"Bir şeyler yanlış gitti",network:"Ağ bağlantı hatası. Lütfen internet bağlantınızı kontrol edin",serverConnection:"Sunucuya bağlanılamıyor. Lütfen sunucunun çalışıp çalışmadığını kontrol edin",serverAdd:"Sunucu eklenemedi. Lütfen sunucu durumunu kontrol edin",serverUpdate:"{{serverName}} sunucusu düzenlenemedi. Lütfen sunucu durumunu kontrol edin",serverFetch:"Sunucu verileri alınamadı. Lütfen daha sonra tekrar deneyin",failedToReloadServer:"Sunucu yeniden yüklenemedi",initialStartup:"Sunucu başlatılıyor olabilir. İlk başlatmada bu işlem biraz zaman alabileceğinden lütfen bekleyin...",serverInstall:"Sunucu yüklenemedi",failedToFetchSettings:"Ayarlar getirilemedi",failedToUpdateRouteConfig:"Route yapılandırması güncellenemedi",failedToUpdateSmartRoutingConfig:"Akıllı yönlendirme yapılandırması güncellenemedi"},lC={processing:"İşleniyor...",save:"Kaydet",cancel:"İptal",back:"Geri",refresh:"Yenile",search:"Ara",clear:"Temizle",view:"Görüntüle",create:"Oluştur",creating:"Oluşturuluyor...",update:"Güncelle",updating:"Güncelleniyor...",submitting:"Gönderiliyor...",delete:"Sil",remove:"Kaldır",copy:"Kopyala",copyId:"ID'yi Kopyala",copyUrl:"URL'yi Kopyala",copyJson:"JSON'u Kopyala",copySuccess:"Panoya kopyalandı",copyFailed:"Kopyalama başarısız",copied:"Kopyalandı",close:"Kapat",confirm:"Onayla",language:"Dil",true:"Doğru",false:"Yanlış",dismiss:"Anımsatma",github:"GitHub",wechat:"WeChat",discord:"Discord",itemsPerPage:"Sayfa başına öğe",showing:"{{total}} öğeden {{start}}-{{end}} gösteriliyor",previous:"Önceki",next:"Sonraki",required:"Gerekli",secret:"Gizli",default:"Varsayılan",value:"Değer",type:"Tür",repeated:"Tekrarlanan",valueHint:"Değer İpucu",choices:"Seçenekler",actions:"Eylemler",saving:"Kaydediliyor...",active:"Aktif",inactive:"Pasif"},iC={rowsPerPage:"Sayfa başına satır",showing:"Toplam {{total}} öğeden {{from}}-{{to}} gösteriliyor"},oC={dashboard:"Kontrol Paneli",servers:"Sunucular",groups:"Gruplar",users:"Kullanıcılar",settings:"Ayarlar",changePassword:"Şifre Değiştir",market:"Market",cloud:"Bulut Market",logs:"Günlükler",activity:"Etkinlik"},cC={dashboard:{title:"Kontrol Paneli",totalServers:"Toplam",onlineServers:"Çevrimiçi",offlineServers:"Çevrimdışı",connectingServers:"Bağlanıyor",recentServers:"Son Sunucular"},servers:{title:"Sunucu Yönetimi"},groups:{title:"Grup Yönetimi"},users:{title:"Kullanıcı Yönetimi"},settings:{title:"Ayarlar",language:"Dil",account:"Hesap Ayarları",password:"Şifre Değiştir",appearance:"Görünüm",routeConfig:"Güvenlik",installConfig:"Kurulum",smartRouting:"Akıllı Yönlendirme",oauthServer:"OAuth Sunucusu"},market:{title:"Market Yönetimi - Yerel ve Bulut Marketler"},logs:{title:"Sistem Günlükleri"}},uC={filters:"Filtreler",search:"Günlüklerde ara...",autoScroll:"Otomatik kaydır",clearLogs:"Günlükleri temizle",loading:"Günlükler yükleniyor...",noLogs:"Kullanılabilir günlük yok.",noMatch:"Mevcut filtrelerle eşleşen günlük yok.",mainProcess:"Ana İşlem",childProcess:"Alt İşlem",main:"Ana",child:"Alt"},dC={add:"Ekle",addNew:"Yeni Grup Ekle",edit:"Grubu Düzenle",delete:"Sil",confirmDelete:"Bu grubu silmek istediğinizden emin misiniz?",deleteWarning:"'{{name}}' grubunu silmek, onu ve tüm sunucu ilişkilerini kaldıracaktır. Bu işlem geri alınamaz.",name:"Grup Adı",namePlaceholder:"Grup adını girin",nameRequired:"Grup adı gereklidir",description:"Açıklama",descriptionPlaceholder:"Grup açıklamasını girin (isteğe bağlı)",createError:"Grup oluşturulamadı",updateError:"Grup güncellenemedi",deleteError:"Grup silinemedi",serverAddError:"Sunucu gruba eklenemedi",serverRemoveError:"Sunucu gruptan kaldırılamadı",addServer:"Gruba Sunucu Ekle",selectServer:"Eklenecek bir sunucu seçin",servers:"Gruptaki Sunucular",remove:"Kaldır",noGroups:"Kullanılabilir grup yok. Başlamak için yeni bir grup oluşturun.",noServers:"Bu grupta sunucu yok.",noServerOptions:"Kullanılabilir sunucu yok",serverCount:"{{count}} Sunucu",toolSelection:"Araç Seçimi",toolsSelected:"Seçildi",allTools:"Tümü",selectedTools:"Seçili araçlar",selectAll:"Tümünü Seç",selectNone:"Hiçbirini Seçme",configureTools:"Araçları Yapılandır"},mC={title:"Yerel Kurulum",official:"Resmi",by:"Geliştirici",unknown:"Bilinmeyen",tools:"araçlar",search:"Ara",searchPlaceholder:"Sunucuları isme, kategoriye veya etiketlere göre ara",clearFilters:"Temizle",clearCategoryFilter:"",clearTagFilter:"",categories:"Kategoriler",tags:"Etiketler",showTags:"Etiketleri göster",hideTags:"Etiketleri gizle",moreTags:"",noServers:"Aramanızla eşleşen sunucu bulunamadı",backToList:"Listeye dön",install:"Yükle",installing:"Yükleniyor...",installed:"Yüklendi",installServer:"Sunucu Yükle: {{name}}",installSuccess:"{{serverName}} sunucusu başarıyla yüklendi",author:"Yazar",license:"Lisans",repository:"Depo",examples:"Örnekler",arguments:"Argümanlar",argumentName:"Ad",description:"Açıklama",required:"Gerekli",example:"Örnek",viewSchema:"Şemayı görüntüle",fetchError:"Market sunucuları getirilirken hata",serverNotFound:"Sunucu bulunamadı",searchError:"Sunucular aranırken hata",filterError:"Sunucular kategoriye göre filtrelenirken hata",tagFilterError:"Sunucular etikete göre filtrelenirken hata",noInstallationMethod:"Bu sunucu için kullanılabilir kurulum yöntemi yok",showing:"{{total}} sunucudan {{from}}-{{to}} arası gösteriliyor",perPage:"Sayfa başına",confirmVariablesMessage:"Lütfen bu değişkenlerin çalışma ortamınızda düzgün tanımlandığından emin olun. Sunucu yüklemeye devam edilsin mi?",confirmAndInstall:"Onayla ve Yükle"},fC={authorizeTitle:"Uygulamayı Yetkilendir",authorizeSubtitle:"Bu uygulamanın MCPHub hesabınıza erişmesine izin verin.",buttons:{approve:"Erişime izin ver",deny:"Reddet",approveSubtitle:"Bu uygulamaya güveniyorsanız izin vermeniz önerilir.",denySubtitle:"İstediğiniz zaman daha sonra erişim verebilirsiniz."}},pC={title:"Bulut Desteği",subtitle:"MCPRouter tarafından desteklenmektedir",by:"Geliştirici",server:"Sunucu",config:"Yapılandırma",created:"Oluşturuldu",updated:"Güncellendi",available:"Kullanılabilir",description:"Açıklama",details:"Detaylar",tools:"Araçlar",tool:"araç",toolsAvailable:"{{count}} araç mevcut",loadingTools:"Araçlar yükleniyor...",noTools:"Bu sunucu için kullanılabilir araç yok",noDescription:"Kullanılabilir açıklama yok",viewDetails:"Detayları Görüntüle",parameters:"Parametreler",result:"Sonuç",error:"Hata",callTool:"Çalıştır",calling:"Çalıştırılıyor...",toolCallSuccess:"{{toolName}} aracı başarıyla çalıştırıldı",toolCallError:"{{toolName}} aracı çalıştırılamadı: {{error}}",viewSchema:"Şemayı Görüntüle",backToList:"Bulut Market'e Dön",search:"Ara",searchPlaceholder:"Bulut sunucularını isme, başlığa veya geliştiriciye göre ara",clearFilters:"Filtreleri Temizle",clearCategoryFilter:"Temizle",clearTagFilter:"Temizle",categories:"Kategoriler",tags:"Etiketler",noCategories:"Kategori bulunamadı",noTags:"Etiket bulunamadı",noServers:"Bulut sunucusu bulunamadı",fetchError:"Bulut sunucuları getirilirken hata",serverNotFound:"Bulut sunucusu bulunamadı",searchError:"Bulut sunucuları aranırken hata",filterError:"Bulut sunucuları kategoriye göre filtrelenirken hata",tagFilterError:"Bulut sunucuları etikete göre filtrelenirken hata",showing:"{{total}} bulut sunucusundan {{from}}-{{to}} arası gösteriliyor",perPage:"Sayfa başına",apiKeyNotConfigured:"MCPRouter API anahtarı yapılandırılmamış",apiKeyNotConfiguredDescription:"Bulut sunucularını kullanmak için MCPRouter API anahtarınızı yapılandırmanız gerekir.",getApiKey:"API Anahtarı Al",configureInSettings:"Ayarlarda Yapılandır",installServer:"{{name}} Yükle",installSuccess:"{{name}} sunucusu başarıyla yüklendi",installError:"Sunucu yüklenemedi: {{error}}"},hC={title:"Kayıt",official:"Resmi",latest:"En Son",description:"Açıklama",website:"Web Sitesi",repository:"Depo",packages:"Paketler",package:"paket",remotes:"Uzak Sunucular",remote:"uzak sunucu",published:"Yayınlandı",updated:"Güncellendi",install:"Yükle",installing:"Yükleniyor...",installed:"Yüklendi",installServer:"{{name}} Yükle",installSuccess:"{{name}} sunucusu başarıyla yüklendi",installError:"Sunucu yüklenemedi: {{error}}",noDescription:"Kullanılabilir açıklama yok",viewDetails:"Detayları Görüntüle",backToList:"Kayda Dön",search:"Ara",searchPlaceholder:"Kayıt sunucularını isme göre ara",clearFilters:"Temizle",noServers:"Kayıt sunucusu bulunamadı",fetchError:"Kayıt sunucuları getirilirken hata",serverNotFound:"Kayıt sunucusu bulunamadı",showing:"{{total}} kayıt sunucusundan {{from}}-{{to}} arası gösteriliyor",perPage:"Sayfa başına",environmentVariables:"Ortam Değişkenleri",packageArguments:"Paket Argümanları",runtimeArguments:"Çalışma Zamanı Argümanları",headers:"Başlıklar"},gC={run:"Çalıştır",running:"Çalıştırılıyor...",runTool:"Aracı Çalıştır",cancel:"İptal",noDescription:"Kullanılabilir açıklama yok",inputSchema:"Giriş Şeması:",runToolWithName:"Aracı Çalıştır: {{name}}",execution:"Araç Çalıştırma",successful:"Başarılı",failed:"Başarısız",result:"Sonuç:",error:"Hata",errorDetails:"Hata Detayları:",noContent:"Araç başarıyla çalıştırıldı ancak içerik döndürmedi.",unknownError:"Bilinmeyen hata oluştu",jsonResponse:"JSON Yanıtı:",toolResult:"Araç sonucu",noParameters:"Bu araç herhangi bir parametre gerektirmez.",selectOption:"Bir seçenek seçin",enterValue:"{{type}} değeri girin",enabled:"Etkin",enableSuccess:"{{name}} aracı başarıyla etkinleştirildi",disableSuccess:"{{name}} aracı başarıyla devre dışı bırakıldı",toggleFailed:"Araç durumu değiştirilemedi",parameters:"Araç Parametreleri",formMode:"Form Modu",jsonMode:"JSON Modu",jsonConfiguration:"JSON Yapılandırması",invalidJsonFormat:"Geçersiz JSON formatı",fixJsonBeforeSwitching:"Form moduna geçmeden önce lütfen JSON formatını düzeltin",item:"Öğe {{index}}",addItem:"{{key}} öğesi ekle",enterKey:"{{key}} girin"},xC={run:"Getir",running:"Getiriliyor...",result:"İstek Sonucu",error:"İstek Hatası",execution:"İstek Çalıştırma",successful:"Başarılı",failed:"Başarısız",errorDetails:"Hata Detayları:",noContent:"İstek başarıyla çalıştırıldı ancak içerik döndürmedi.",unknownError:"Bilinmeyen hata oluştu",jsonResponse:"JSON Yanıtı:",description:"Açıklama",messages:"Mesajlar",noDescription:"Kullanılabilir açıklama yok",runPromptWithName:"İsteği Getir: {{name}}",descriptionUpdateSuccess:"İstek açıklaması başarıyla güncellendi",descriptionUpdateFailed:"İstek açıklaması güncellenemedi"},yC={enableGlobalRoute:"Global Yönlendirmeyi Etkinleştir",enableGlobalRouteDescription:"Grup ID'si belirtmeden /sse uç noktasına bağlantıya izin ver",enableGroupNameRoute:"Grup Adı Yönlendirmeyi Etkinleştir",enableGroupNameRouteDescription:"Sadece grup ID'leri yerine grup adları kullanarak /sse uç noktasına bağlantıya izin ver",enableBearerAuth:"Bearer Kimlik Doğrulamasını Etkinleştir",enableBearerAuthDescription:"MCP uç noktaları için bearer token kimlik doğrulaması gerektirir (varsayılan açık)",bearerAuthKey:"Bearer Kimlik Doğrulama Anahtarı",bearerAuthKeyDescription:"Bearer token'da gerekli olacak kimlik doğrulama anahtarı",bearerAuthKeyPlaceholder:"Bearer kimlik doğrulama anahtarını girin",bearerKeysSectionTitle:"Anahtarlar",bearerKeysSectionDescription:"Farklı erişim kapsamlarına sahip birden fazla anahtarı yönetin.",noBearerKeys:"Henüz yapılandırılmış herhangi bir anahtar yok.",bearerKeyName:"Ad",bearerKeyToken:"Token",bearerKeyEnabled:"Etkin",bearerKeyAccessType:"Erişim kapsamı",bearerKeyAccessAll:"Tümü",bearerKeyAccessGroups:"Gruplar",bearerKeyAccessServers:"Sunucular",bearerKeyAccessCustom:"Özel",bearerKeyAllowedGroups:"İzin verilen gruplar",bearerKeyAllowedServers:"İzin verilen sunucular",addBearerKey:"Anahtar ekle",addBearerKeyButton:"Oluştur",bearerKeyRequired:"Ad ve token zorunludur",deleteBearerKeyConfirm:"Bu anahtarı silmek istediğinizden emin misiniz?",generate:"Oluştur",selectGroups:"Grupları Seç",selectServers:"Sunucuları Seç",selectAtLeastOneGroup:"Lütfen en az bir grup seçin",selectAtLeastOneServer:"Lütfen en az bir sunucu seçin",skipAuth:"Kimlik Doğrulamayı Atla",skipAuthDescription:"Kontrol paneline giriş olmadan erişime izin ver (MCP kimlik doğrulamasını etkilemez)",pythonIndexUrl:"Python Paket Deposu URL'si",pythonIndexUrlDescription:"Python paket kurulumu için UV_DEFAULT_INDEX ortam değişkenini ayarla",pythonIndexUrlPlaceholder:"örn. https://pypi.org/simple",npmRegistry:"NPM Kayıt URL'si",npmRegistryDescription:"NPM paket kurulumu için npm_config_registry ortam değişkenini ayarla",npmRegistryPlaceholder:"örn. https://registry.npmjs.org/",baseUrl:"Temel URL",baseUrlDescription:"MCP istekleri ve OAuth geri çağrıları için temel URL",baseUrlPlaceholder:"örn. http://localhost:3000",installConfig:"Kurulum",systemConfigUpdated:"Sistem yapılandırması başarıyla güncellendi",enableSmartRouting:"Akıllı Yönlendirmeyi Etkinleştir",enableSmartRoutingDescription:"Girdiye göre en uygun aracı aramak için akıllı yönlendirme özelliğini etkinleştir ($smart grup adını kullanarak)",dbUrl:"PostgreSQL URL'si (pgvector desteği gerektirir)",dbUrlPlaceholder:"örn. postgresql://kullanıcı:şifre@localhost:5432/veritabanıadı",embeddingProvider:"Embedding Sağlayıcısı",openaiApiBaseUrl:"OpenAI API Temel URL'si",openaiApiBaseUrlPlaceholder:"https://api.openai.com/v1",openaiApiKey:"OpenAI API Anahtarı",openaiApiKeyPlaceholder:"OpenAI API anahtarını girin",openaiApiEmbeddingModel:"OpenAI Entegrasyon Modeli",openaiApiEmbeddingModelPlaceholder:"text-embedding-3-small",azureOpenaiEndpoint:"Azure OpenAI Uç Noktası",azureOpenaiEndpointPlaceholder:"https://KAYNAK_ADINIZ.openai.azure.com",azureOpenaiApiKey:"Azure OpenAI API Anahtarı",azureOpenaiApiKeyPlaceholder:"Azure OpenAI API anahtarını girin",azureOpenaiApiVersion:"Azure OpenAI API Sürümü",azureOpenaiApiVersionPlaceholder:"2024-02-15-preview",azureOpenaiEmbeddingDeployment:"Azure OpenAI Embedding Dağıtımı",azureOpenaiEmbeddingDeploymentPlaceholder:"text-embedding-3-small",smartRoutingConfigUpdated:"Akıllı yönlendirme yapılandırması başarıyla güncellendi",smartRoutingRequiredFields:"Akıllı yönlendirmeyi etkinleştirmek için Veritabanı URL'si ve OpenAI API Anahtarı gereklidir",smartRoutingValidationError:"Akıllı Yönlendirmeyi etkinleştirmeden önce lütfen gerekli alanları doldurun: {{fields}}",mcpRouterConfig:"Bulut Market",mcpRouterApiKey:"MCPRouter API Anahtarı",mcpRouterApiKeyDescription:"MCPRouter bulut market hizmetlerine erişim için API anahtarı",mcpRouterApiKeyPlaceholder:"MCPRouter API anahtarını girin",mcpRouterReferer:"Yönlendiren",mcpRouterRefererDescription:"MCPRouter API istekleri için Referer başlığı",mcpRouterRefererPlaceholder:"https://www.mcphubx.com",mcpRouterTitle:"Başlık",mcpRouterTitleDescription:"MCPRouter API istekleri için Başlık başlığı",mcpRouterTitlePlaceholder:"MCPHub",mcpRouterBaseUrl:"Temel URL",mcpRouterBaseUrlDescription:"MCPRouter API için temel URL",mcpRouterBaseUrlPlaceholder:"https://api.mcprouter.to/v1",systemSettings:"Sistem Ayarları",nameSeparatorLabel:"İsim Ayırıcı",nameSeparatorDescription:"Sunucu adı ile araç/istek adını ayırmak için kullanılan karakter (varsayılan: -)",enableSessionRebuild:"Sunucu Oturum Yeniden Oluşturmayı Etkinleştir",enableSessionRebuildDescription:"Etkinleştirildiğinde, daha iyi oturum yönetimi deneyimi için geliştirilmiş sunucu oturum yeniden oluşturma kodunu uygular",restartRequired:"Yapılandırma kaydedildi. Tüm hizmetlerin yeni ayarları doğru şekilde yüklemesini sağlamak için uygulamayı yeniden başlatmanız önerilir.",exportMcpSettings:"Ayarları Dışa Aktar",mcpSettingsJson:"MCP Ayarları JSON",mcpSettingsJsonDescription:"Yedekleme veya diğer araçlara taşıma için mevcut mcp_settings.json yapılandırmanızı görüntüleyin, kopyalayın veya indirin",copyToClipboard:"Panoya Kopyala",downloadJson:"JSON Olarak İndir",exportSuccess:"Ayarlar başarıyla dışa aktarıldı",exportError:"Ayarlar getirilemedi",enableOauthServer:"OAuth Sunucusunu Etkinleştir",enableOauthServerDescription:"MCPHub'ın harici istemciler için OAuth jetonları vermesine izin ver",requireClientSecret:"İstemci Sırrı Zorunlu",requireClientSecretDescription:"Etkin olduğunda gizli istemciler client secret sunmalıdır (yalnızca PKCE kullanan istemciler için kapatabilirsiniz)",requireState:"State parametresi zorunlu",requireStateDescription:"State parametresi olmayan yetkilendirme isteklerini reddeder",accessTokenLifetime:"Erişim jetonu süresi (saniye)",accessTokenLifetimeDescription:"Verilen erişim jetonlarının geçerli kalacağı süre",accessTokenLifetimePlaceholder:"örn. 3600",refreshTokenLifetime:"Yenileme jetonu süresi (saniye)",refreshTokenLifetimeDescription:"Yenileme jetonlarının geçerli kalacağı süre",refreshTokenLifetimePlaceholder:"örn. 1209600",authorizationCodeLifetime:"Yetkilendirme kodu süresi (saniye)",authorizationCodeLifetimeDescription:"Yetkilendirme kodlarının takas edilebileceği süre",authorizationCodeLifetimePlaceholder:"örn. 300",allowedScopes:"İzin verilen kapsamlar",allowedScopesDescription:"Kullanıcıların onaylayabileceği kapsamların virgülle ayrılmış listesi",allowedScopesPlaceholder:"örn. read, write",enableDynamicRegistration:"Dinamik istemci kaydını etkinleştir",dynamicRegistrationDescription:"RFC 7591 uyumlu istemcilerin herkese açık uç nokta üzerinden kayıt olmasına izin ver",dynamicRegistrationAllowedGrantTypes:"İzin verilen grant türleri",dynamicRegistrationAllowedGrantTypesDescription:"Dinamik olarak kaydedilen istemciler için kullanılabilecek grant türlerinin virgülle ayrılmış listesi",dynamicRegistrationAllowedGrantTypesPlaceholder:"örn. authorization_code, refresh_token",dynamicRegistrationAuth:"Kayıt için kimlik doğrulaması iste",dynamicRegistrationAuthDescription:"Kayıt uç noktasını korur, yalnızca kimliği doğrulanmış istekler yeni istemci oluşturabilir",invalidNumberInput:"Lütfen sıfırdan küçük olmayan geçerli bir sayı girin"},bC={upload:"Yükle",uploadTitle:"MCPB Paketi Yükle",dropFileHere:".mcpb dosyanızı buraya bırakın",orClickToSelect:"veya bilgisayarınızdan seçmek için tıklayın",invalidFileType:"Lütfen geçerli bir .mcpb dosyası seçin",noFileSelected:"Lütfen yüklemek için bir .mcpb dosyası seçin",uploading:"Yükleniyor...",uploadFailed:"MCPB dosyası yüklenemedi",installServer:"MCPB'den MCP Sunucusu Yükle",extensionInfo:"Uzantı Bilgisi",name:"Ad",version:"Sürüm",description:"Açıklama",author:"Geliştirici",tools:"Araçlar",serverName:"Sunucu Adı",serverNamePlaceholder:"Bu sunucu için bir ad girin",install:"Yükle",installing:"Yükleniyor...",installFailed:"MCPB'den sunucu yüklenemedi",serverExistsTitle:"Sunucu Zaten Mevcut",serverExistsConfirm:"'{{serverName}}' sunucusu zaten mevcut. Yeni sürümle geçersiz kılmak istiyor musunuz?",override:"Geçersiz Kıl"},vC={button:"İçe Aktar",title:"JSON'dan Sunucuları İçe Aktar",inputLabel:"Sunucu Yapılandırma JSON",inputHelp:"Sunucu yapılandırma JSON'unuzu yapıştırın. STDIO, SSE ve HTTP (streamable-http) sunucu türlerini destekler.",preview:"Önizle",previewTitle:"İçe Aktarılacak Sunucuları Önizle",import:"İçe Aktar",importing:"İçe aktarılıyor...",invalidFormat:"Geçersiz JSON formatı. JSON bir 'mcpServers' nesnesi içermelidir.",parseError:"JSON ayrıştırılamadı. Lütfen formatı kontrol edip tekrar deneyin.",addFailed:"Sunucu eklenemedi",importFailed:"Sunucular içe aktarılamadı",partialSuccess:"{{total}} sunucudan {{count}} tanesi başarıyla içe aktarıldı. Bazı sunucular başarısız oldu:"},wC={button:"İçe Aktar",title:"JSON'dan Grupları İçe Aktar",inputLabel:"Grup Yapılandırma JSON",inputHelp:"Grup yapılandırma JSON'unuzu yapıştırın. Her grup bir sunucu listesi içerebilir.",preview:"Önizle",previewTitle:"İçe Aktarılacak Grupları Önizle",import:"İçe Aktar",importing:"İçe aktarılıyor...",invalidFormat:"Geçersiz JSON formatı. JSON bir 'groups' dizisi içermelidir.",missingName:"Her grubun bir 'name' alanı olmalıdır.",parseError:"JSON ayrıştırılamadı. Lütfen formatı kontrol edip tekrar deneyin.",addFailed:"Grup eklenemedi",importFailed:"Gruplar içe aktarılamadı",partialSuccess:"{{total}} gruptan {{count}} tanesi başarıyla içe aktarıldı. Bazı gruplar başarısız oldu:"},SC={add:"Kullanıcı Ekle",addNew:"Yeni Kullanıcı Ekle",edit:"Kullanıcıyı Düzenle",delete:"Kullanıcıyı Sil",create:"Kullanıcı Oluştur",update:"Kullanıcıyı Güncelle",username:"Kullanıcı Adı",password:"Şifre",newPassword:"Yeni Şifre",confirmPassword:"Şifreyi Onayla",changePassword:"Şifre Değiştir",adminRole:"Yönetici",admin:"Yönetici",user:"Kullanıcı",role:"Rol",actions:"Eylemler",addFirst:"İlk kullanıcınızı ekleyin",permissions:"İzinler",adminPermissions:"Tam sistem erişimi",userPermissions:"Sınırlı erişim",currentUser:"Siz",noUsers:"Kullanıcı bulunamadı",adminRequired:"Kullanıcıları yönetmek için yönetici erişimi gereklidir",usernameRequired:"Kullanıcı adı gereklidir",passwordRequired:"Şifre gereklidir",passwordTooShort:"Şifre en az 6 karakter uzunluğunda olmalıdır",passwordMismatch:"Şifreler eşleşmiyor",usernamePlaceholder:"Kullanıcı adını girin",passwordPlaceholder:"Şifreyi girin",newPasswordPlaceholder:"Mevcut şifreyi korumak için boş bırakın",confirmPasswordPlaceholder:"Yeni şifreyi onaylayın",createError:"Kullanıcı oluşturulamadı",updateError:"Kullanıcı güncellenemedi",deleteError:"Kullanıcı silinemedi",statsError:"Kullanıcı istatistikleri getirilemedi",deleteConfirmation:"'{{username}}' kullanıcısını silmek istediğinizden emin misiniz? Bu işlem geri alınamaz.",confirmDelete:"Kullanıcıyı Sil",deleteWarning:"'{{username}}' kullanıcısını silmek istediğinizden emin misiniz? Bu işlem geri alınamaz."},jC={errors:{readonly:"Demo ortamı için salt okunur",invalid_credentials:"Geçersiz kullanıcı adı veya şifre",serverNameRequired:"Sunucu adı gereklidir",serverConfigRequired:"Sunucu yapılandırması gereklidir",serverConfigInvalid:"Sunucu yapılandırması bir URL, OpenAPI şartname URL'si veya şema, ya da argümanlı komut içermelidir",serverTypeInvalid:"Sunucu türü şunlardan biri olmalıdır: stdio, sse, streamable-http, openapi",urlRequiredForType:"{{type}} sunucu türü için URL gereklidir",openapiSpecRequired:"OpenAPI sunucu türü için OpenAPI şartname URL'si veya şema gereklidir",headersInvalidFormat:"Başlıklar bir nesne olmalıdır",headersNotSupportedForStdio:"Başlıklar stdio sunucu türü için desteklenmez",serverNotFound:"Sunucu bulunamadı",failedToRemoveServer:"Sunucu bulunamadı veya kaldırılamadı",internalServerError:"Dahili sunucu hatası",failedToGetServers:"Sunucu bilgileri alınamadı",failedToGetServerSettings:"Sunucu ayarları alınamadı",failedToGetServerConfig:"Sunucu yapılandırması alınamadı",failedToSaveSettings:"Ayarlar kaydedilemedi",toolNameRequired:"Sunucu adı ve araç adı gereklidir",descriptionMustBeString:"Açıklama bir string olmalıdır",groupIdRequired:"Grup ID gereklidir",groupNameRequired:"Grup adı gereklidir",groupNotFound:"Grup bulunamadı",groupIdAndServerNameRequired:"Grup ID ve sunucu adı gereklidir",groupOrServerNotFound:"Grup veya sunucu bulunamadı",toolsMustBeAllOrArray:'Araçlar "all" veya bir string dizisi olmalıdır',serverNameAndToolNameRequired:"Sunucu adı ve araç adı gereklidir",usernameRequired:"Kullanıcı adı gereklidir",userNotFound:"Kullanıcı bulunamadı",failedToGetUsers:"Kullanıcı bilgileri alınamadı",failedToGetUserInfo:"Kullanıcı bilgisi alınamadı",failedToGetUserStats:"Kullanıcı istatistikleri alınamadı",marketServerNameRequired:"Sunucu adı gereklidir",marketServerNotFound:"Market sunucusu bulunamadı",failedToGetMarketServers:"Market sunucuları bilgisi alınamadı",failedToGetMarketServer:"Market sunucusu bilgisi alınamadı",failedToGetMarketCategories:"Market kategorileri alınamadı",failedToGetMarketTags:"Market etiketleri alınamadı",failedToSearchMarketServers:"Market sunucuları aranamadı",failedToFilterMarketServers:"Market sunucuları filtrelenemedi",failedToProcessMcpbFile:"MCPB dosyası işlenemedi"},success:{serverCreated:"Sunucu başarıyla oluşturuldu",serverUpdated:"Sunucu başarıyla güncellendi",serverRemoved:"Sunucu başarıyla kaldırıldı",serverToggled:"Sunucu durumu başarıyla değiştirildi",toolToggled:"{{name}} aracı başarıyla {{action}}",toolDescriptionUpdated:"{{name}} aracının açıklaması başarıyla güncellendi",systemConfigUpdated:"Sistem yapılandırması başarıyla güncellendi",groupCreated:"Grup başarıyla oluşturuldu",groupUpdated:"Grup başarıyla güncellendi",groupDeleted:"Grup başarıyla silindi",serverAddedToGroup:"Sunucu başarıyla gruba eklendi",serverRemovedFromGroup:"Sunucu başarıyla gruptan kaldırıldı",serverToolsUpdated:"Sunucu araçları başarıyla güncellendi"}},NC={authorizationFailed:"Yetkilendirme Başarısız",authorizationFailedError:"Hata",authorizationFailedDetails:"Detaylar",invalidRequest:"Geçersiz İstek",missingStateParameter:"Gerekli OAuth durum parametresi eksik.",missingCodeParameter:"Gerekli yetkilendirme kodu parametresi eksik.",serverNotFound:"Sunucu Bulunamadı",serverNotFoundMessage:"Bu yetkilendirme isteğiyle ilişkili sunucu bulunamadı.",sessionExpiredMessage:"Yetkilendirme oturumunun süresi dolmuş olabilir. Lütfen tekrar yetkilendirmeyi deneyin.",authorizationSuccessful:"Yetkilendirme Başarılı",server:"Sunucu",status:"Durum",connected:"Bağlandı",successMessage:"Sunucu başarıyla yetkilendirildi ve bağlandı.",autoCloseMessage:"Bu pencere 3 saniye içinde otomatik olarak kapanacak...",closeNow:"Şimdi Kapat",connectionError:"Bağlantı Hatası",connectionErrorMessage:"Yetkilendirme başarılı oldu, ancak sunucuya bağlanılamadı.",reconnectMessage:"Lütfen kontrol panelinden yeniden bağlanmayı deneyin.",configurationError:"Yapılandırma Hatası",configurationErrorMessage:"Sunucu aktarımı OAuth finishAuth() desteklemiyor. Lütfen sunucunun streamable-http aktarımıyla yapılandırıldığından emin olun.",internalError:"İçsel Hata",internalErrorMessage:"OAuth geri araması işlenirken beklenmeyen bir hata oluştu.",closeWindow:"Pencereyi Kapat"},CC={title:"Etkinlik",totalCalls:"Toplam çağrı",successCount:"Başarılı",errorCount:"Başarısız",avgDuration:"Ort. süre",timestamp:"Zaman damgası",server:"Sunucu",tool:"Araç",duration:"Süre",status:"Durum",group:"Grup",key:"API Anahtarı",input:"Girdi",output:"Çıktı",details:"Etkinlik detayları",errorMessage:"Hata mesajı",searchServer:"Sunucu...",searchTool:"Araç...",searchStatus:"Durum...",searchGroup:"Grup...",searchKeyName:"API anahtarı...",keyName:"API Anahtarı Adı",allStatus:"Tüm durumlar",statusSuccess:"Başarılı",statusError:"Hata",noData:"Kullanılabilir etkinlik verisi yok",fetchError:"Etkinlik verileri yüklenemedi",cleanup:"Temizle",confirmCleanup:"30 günden eski etkinlikleri silmek istediğinizden emin misiniz?",cleanupSuccess:"{{count}} eski etkinlik silindi",cleanupError:"Eski etkinlikler temizlenemedi",notAvailable:"Etkinlik takibi yalnızca veritabanı modunda kullanılabilir"},kC={app:J4,about:Q4,profile:X4,sponsor:Z4,wechat:W4,discord:eC,theme:tC,auth:rC,server:aC,status:sC,errors:nC,common:lC,pagination:iC,nav:oC,pages:cC,logs:uC,groups:dC,market:mC,oauthServer:fC,cloud:pC,registry:hC,tool:gC,prompt:xC,settings:yC,mcpb:bC,jsonImport:vC,groupImport:wC,users:SC,api:jC,oauthCallback:NC,activity:CC};rr.use(_0).use(v2).init({resources:{en:{translation:_N},zh:{translation:g4},fr:{translation:Y4},tr:{translation:kC}},fallbackLng:"en",debug:!1,defaultNS:"translation",interpolation:{escapeValue:!1},detection:{order:["localStorage","cookie","htmlTag","navigator"],caches:["localStorage","cookie"]}});const AC=()=>{qv()};AC();async function EC(){try{console.log("Loading runtime configuration...");const a=await Hv();console.log("Runtime configuration loaded:",a),window.__MCPHUB_CONFIG__=a,Ch.createRoot(document.getElementById("root")).render(r.jsx(Ta.StrictMode,{children:r.jsx(Wh,{})}))}catch(a){console.error("Failed to initialize app:",a),console.log("Starting app with default configuration..."),window.__MCPHUB_CONFIG__={basePath:"",version:"dev",name:"mcphub"},Ch.createRoot(document.getElementById("root")).render(r.jsx(Ta.StrictMode,{children:r.jsx(Wh,{})}))}}EC();
294
+ //# sourceMappingURL=index-AkdLybCq.js.map