@samanhappy/mcphub 0.12.4 → 0.12.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/index.js +6 -1
- package/dist/config/index.js.map +1 -1
- package/dist/controllers/builtinPromptController.js +119 -0
- package/dist/controllers/builtinPromptController.js.map +1 -0
- package/dist/controllers/builtinResourceController.js +142 -0
- package/dist/controllers/builtinResourceController.js.map +1 -0
- package/dist/controllers/serverController.js +134 -8
- package/dist/controllers/serverController.js.map +1 -1
- package/dist/dao/BuiltinPromptDao.js +72 -0
- package/dist/dao/BuiltinPromptDao.js.map +1 -0
- package/dist/dao/BuiltinPromptDaoDbImpl.js +76 -0
- package/dist/dao/BuiltinPromptDaoDbImpl.js.map +1 -0
- package/dist/dao/BuiltinResourceDao.js +72 -0
- package/dist/dao/BuiltinResourceDao.js.map +1 -0
- package/dist/dao/BuiltinResourceDaoDbImpl.js +76 -0
- package/dist/dao/BuiltinResourceDaoDbImpl.js.map +1 -0
- package/dist/dao/DaoFactory.js +24 -0
- package/dist/dao/DaoFactory.js.map +1 -1
- package/dist/dao/DatabaseDaoFactory.js +18 -0
- package/dist/dao/DatabaseDaoFactory.js.map +1 -1
- package/dist/dao/ServerDao.js +4 -0
- package/dist/dao/ServerDao.js.map +1 -1
- package/dist/dao/ServerDaoDbImpl.js +7 -0
- package/dist/dao/ServerDaoDbImpl.js.map +1 -1
- package/dist/dao/index.js +4 -0
- package/dist/dao/index.js.map +1 -1
- package/dist/db/connection.js +33 -14
- package/dist/db/connection.js.map +1 -1
- package/dist/db/entities/BuiltinPrompt.js +57 -0
- package/dist/db/entities/BuiltinPrompt.js.map +1 -0
- package/dist/db/entities/BuiltinResource.js +57 -0
- package/dist/db/entities/BuiltinResource.js.map +1 -0
- package/dist/db/entities/Server.js +4 -0
- package/dist/db/entities/Server.js.map +1 -1
- package/dist/db/entities/VectorEmbedding.js +1 -2
- package/dist/db/entities/VectorEmbedding.js.map +1 -1
- package/dist/db/entities/index.js +5 -1
- package/dist/db/entities/index.js.map +1 -1
- package/dist/db/repositories/BuiltinPromptRepository.js +40 -0
- package/dist/db/repositories/BuiltinPromptRepository.js.map +1 -0
- package/dist/db/repositories/BuiltinResourceRepository.js +40 -0
- package/dist/db/repositories/BuiltinResourceRepository.js.map +1 -0
- package/dist/db/repositories/index.js +3 -1
- package/dist/db/repositories/index.js.map +1 -1
- package/dist/routes/index.js +18 -1
- package/dist/routes/index.js.map +1 -1
- package/dist/services/mcpService.js +176 -8
- package/dist/services/mcpService.js.map +1 -1
- package/dist/services/sseService.js +13 -0
- package/dist/services/sseService.js.map +1 -1
- package/dist/services/vectorSearchService.js +35 -1
- package/dist/services/vectorSearchService.js.map +1 -1
- package/dist/utils/base64.js +59 -0
- package/dist/utils/base64.js.map +1 -0
- package/dist/utils/migration.js +47 -0
- package/dist/utils/migration.js.map +1 -1
- package/dist/utils/smartRouting.js +9 -0
- package/dist/utils/smartRouting.js.map +1 -1
- package/frontend/dist/assets/index-BT845f3p.js +314 -0
- package/frontend/dist/assets/index-BT845f3p.js.map +1 -0
- package/frontend/dist/assets/index-Cf9Rz7Uy.css +1 -0
- package/frontend/dist/assets/resourceService-B7vWfjLj.js +2 -0
- package/frontend/dist/assets/resourceService-B7vWfjLj.js.map +1 -0
- package/frontend/dist/index.html +2 -2
- package/mcp_settings.json +3 -1
- package/package.json +2 -2
- package/frontend/dist/assets/index-CtcblSpA.js +0 -294
- package/frontend/dist/assets/index-CtcblSpA.js.map +0 -1
- package/frontend/dist/assets/index-DM2_JGfR.css +0 -1
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
var Xy=Object.defineProperty;var Zy=(a,n,l)=>n in a?Xy(a,n,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[n]=l;var hn=(a,n,l)=>Zy(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 yg(a){return a&&a.__esModule&&Object.prototype.hasOwnProperty.call(a,"default")?a.default:a}var Eu={exports:{}},xl={};/**
|
|
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 gh;function Wy(){if(gh)return xl;gh=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 xl.Fragment=n,xl.jsx=l,xl.jsxs=l,xl}var xh;function eb(){return xh||(xh=1,Eu.exports=Wy()),Eu.exports}var r=eb(),Tu={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 yh;function tb(){if(yh)return Me;yh=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(A){return A===null||typeof A!="object"?null:(A=w&&A[w]||A["@@iterator"],typeof A=="function"?A:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,E={};function k(A,L,z){this.props=A,this.context=L,this.refs=E,this.updater=z||R}k.prototype.isReactComponent={},k.prototype.setState=function(A,L){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,L,"setState")},k.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function j(){}j.prototype=k.prototype;function S(A,L,z){this.props=A,this.context=L,this.refs=E,this.updater=z||R}var D=S.prototype=new j;D.constructor=S,O(D,k.prototype),D.isPureReactComponent=!0;var U=Array.isArray;function V(){}var I={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function $(A,L,z){var P=z.ref;return{$$typeof:a,type:A,key:L,ref:P!==void 0?P:null,props:z}}function pe(A,L){return $(A.type,L,A.props)}function K(A){return typeof A=="object"&&A!==null&&A.$$typeof===a}function q(A){var L={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(z){return L[z]})}var Q=/\/+/g;function G(A,L){return typeof A=="object"&&A!==null&&A.key!=null?q(""+A.key):L.toString(36)}function X(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(V,V):(A.status="pending",A.then(function(L){A.status==="pending"&&(A.status="fulfilled",A.value=L)},function(L){A.status==="pending"&&(A.status="rejected",A.reason=L)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function N(A,L,z,P,le){var ee=typeof A;(ee==="undefined"||ee==="boolean")&&(A=null);var Y=!1;if(A===null)Y=!0;else switch(ee){case"bigint":case"string":case"number":Y=!0;break;case"object":switch(A.$$typeof){case a:case n:Y=!0;break;case b:return Y=A._init,N(Y(A._payload),L,z,P,le)}}if(Y)return le=le(A),Y=P===""?"."+G(A,0):P,U(le)?(z="",Y!=null&&(z=Y.replace(Q,"$&/")+"/"),N(le,L,z,"",function(ye){return ye})):le!=null&&(K(le)&&(le=pe(le,z+(le.key==null||A&&A.key===le.key?"":(""+le.key).replace(Q,"$&/")+"/")+Y)),L.push(le)),1;Y=0;var ge=P===""?".":P+":";if(U(A))for(var ae=0;ae<A.length;ae++)P=A[ae],ee=ge+G(P,ae),Y+=N(P,L,z,ee,le);else if(ae=T(A),typeof ae=="function")for(A=ae.call(A),ae=0;!(P=A.next()).done;)P=P.value,ee=ge+G(P,ae++),Y+=N(P,L,z,ee,le);else if(ee==="object"){if(typeof A.then=="function")return N(X(A),L,z,P,le);throw L=String(A),Error("Objects are not valid as a React child (found: "+(L==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":L)+"). If you meant to render a collection of children, use an array instead.")}return Y}function H(A,L,z){if(A==null)return A;var P=[],le=0;return N(A,P,"","",function(ee){return L.call(z,ee,le++)}),P}function B(A){if(A._status===-1){var L=A._result;L=L(),L.then(function(z){(A._status===0||A._status===-1)&&(A._status=1,A._result=z)},function(z){(A._status===0||A._status===-1)&&(A._status=2,A._result=z)}),A._status===-1&&(A._status=0,A._result=L)}if(A._status===1)return A._result.default;throw A._result}var ce=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var L=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(L))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},Z={map:H,forEach:function(A,L,z){H(A,function(){L.apply(this,arguments)},z)},count:function(A){var L=0;return H(A,function(){L++}),L},toArray:function(A){return H(A,function(L){return L})||[]},only:function(A){if(!K(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return Me.Activity=x,Me.Children=Z,Me.Component=k,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=I,Me.__COMPILER_RUNTIME={__proto__:null,c:function(A){return I.H.useMemoCache(A)}},Me.cache=function(A){return function(){return A.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(A,L,z){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var P=O({},A.props),le=A.key;if(L!=null)for(ee in L.key!==void 0&&(le=""+L.key),L)!M.call(L,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&L.ref===void 0||(P[ee]=L[ee]);var ee=arguments.length-2;if(ee===1)P.children=z;else if(1<ee){for(var Y=Array(ee),ge=0;ge<ee;ge++)Y[ge]=arguments[ge+2];P.children=Y}return $(A.type,le,P)},Me.createContext=function(A){return A={$$typeof:m,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:d,_context:A},A},Me.createElement=function(A,L,z){var P,le={},ee=null;if(L!=null)for(P in L.key!==void 0&&(ee=""+L.key),L)M.call(L,P)&&P!=="key"&&P!=="__self"&&P!=="__source"&&(le[P]=L[P]);var Y=arguments.length-2;if(Y===1)le.children=z;else if(1<Y){for(var ge=Array(Y),ae=0;ae<Y;ae++)ge[ae]=arguments[ae+2];le.children=ge}if(A&&A.defaultProps)for(P in Y=A.defaultProps,Y)le[P]===void 0&&(le[P]=Y[P]);return $(A,ee,le)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(A){return{$$typeof:p,render:A}},Me.isValidElement=K,Me.lazy=function(A){return{$$typeof:b,_payload:{_status:-1,_result:A},_init:B}},Me.memo=function(A,L){return{$$typeof:h,type:A,compare:L===void 0?null:L}},Me.startTransition=function(A){var L=I.T,z={};I.T=z;try{var P=A(),le=I.S;le!==null&&le(z,P),typeof P=="object"&&P!==null&&typeof P.then=="function"&&P.then(V,ce)}catch(ee){ce(ee)}finally{L!==null&&z.types!==null&&(L.types=z.types),I.T=L}},Me.unstable_useCacheRefresh=function(){return I.H.useCacheRefresh()},Me.use=function(A){return I.H.use(A)},Me.useActionState=function(A,L,z){return I.H.useActionState(A,L,z)},Me.useCallback=function(A,L){return I.H.useCallback(A,L)},Me.useContext=function(A){return I.H.useContext(A)},Me.useDebugValue=function(){},Me.useDeferredValue=function(A,L){return I.H.useDeferredValue(A,L)},Me.useEffect=function(A,L){return I.H.useEffect(A,L)},Me.useEffectEvent=function(A){return I.H.useEffectEvent(A)},Me.useId=function(){return I.H.useId()},Me.useImperativeHandle=function(A,L,z){return I.H.useImperativeHandle(A,L,z)},Me.useInsertionEffect=function(A,L){return I.H.useInsertionEffect(A,L)},Me.useLayoutEffect=function(A,L){return I.H.useLayoutEffect(A,L)},Me.useMemo=function(A,L){return I.H.useMemo(A,L)},Me.useOptimistic=function(A,L){return I.H.useOptimistic(A,L)},Me.useReducer=function(A,L,z){return I.H.useReducer(A,L,z)},Me.useRef=function(A){return I.H.useRef(A)},Me.useState=function(A){return I.H.useState(A)},Me.useSyncExternalStore=function(A,L,z){return I.H.useSyncExternalStore(A,L,z)},Me.useTransition=function(){return I.H.useTransition()},Me.version="19.2.1",Me}var bh;function ud(){return bh||(bh=1,Tu.exports=tb()),Tu.exports}var y=ud();const Ta=yg(y);var Ru={exports:{}},yl={},Ou={exports:{}},zu={};/**
|
|
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 vh;function rb(){return vh||(vh=1,(function(a){function n(N,H){var B=N.length;N.push(H);e:for(;0<B;){var ce=B-1>>>1,Z=N[ce];if(0<c(Z,H))N[ce]=H,N[B]=Z,B=ce;else break e}}function l(N){return N.length===0?null:N[0]}function o(N){if(N.length===0)return null;var H=N[0],B=N.pop();if(B!==H){N[0]=B;e:for(var ce=0,Z=N.length,A=Z>>>1;ce<A;){var L=2*(ce+1)-1,z=N[L],P=L+1,le=N[P];if(0>c(z,B))P<Z&&0>c(le,z)?(N[ce]=le,N[P]=B,ce=P):(N[ce]=z,N[L]=B,ce=L);else if(P<Z&&0>c(le,B))N[ce]=le,N[P]=B,ce=P;else break e}}return H}function c(N,H){var B=N.sortIndex-H.sortIndex;return B!==0?B:N.id-H.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,k=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function D(N){for(var H=l(h);H!==null;){if(H.callback===null)o(h);else if(H.startTime<=N)o(h),H.sortIndex=H.expirationTime,n(g,H);else break;H=l(h)}}function U(N){if(O=!1,D(N),!R)if(l(g)!==null)R=!0,V||(V=!0,q());else{var H=l(h);H!==null&&X(U,H.startTime-N)}}var V=!1,I=-1,M=5,$=-1;function pe(){return E?!0:!(a.unstable_now()-$<M)}function K(){if(E=!1,V){var N=a.unstable_now();$=N;var H=!0;try{e:{R=!1,O&&(O=!1,j(I),I=-1),T=!0;var B=w;try{t:{for(D(N),x=l(g);x!==null&&!(x.expirationTime>N&&pe());){var ce=x.callback;if(typeof ce=="function"){x.callback=null,w=x.priorityLevel;var Z=ce(x.expirationTime<=N);if(N=a.unstable_now(),typeof Z=="function"){x.callback=Z,D(N),H=!0;break t}x===l(g)&&o(g),D(N)}else o(g);x=l(g)}if(x!==null)H=!0;else{var A=l(h);A!==null&&X(U,A.startTime-N),H=!1}}break e}finally{x=null,w=B,T=!1}H=void 0}}finally{H?q():V=!1}}}var q;if(typeof S=="function")q=function(){S(K)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,G=Q.port2;Q.port1.onmessage=K,q=function(){G.postMessage(null)}}else q=function(){k(K,0)};function X(N,H){I=k(function(){N(a.unstable_now())},H)}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(N){N.callback=null},a.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<N?Math.floor(1e3/N):5},a.unstable_getCurrentPriorityLevel=function(){return w},a.unstable_next=function(N){switch(w){case 1:case 2:case 3:var H=3;break;default:H=w}var B=w;w=H;try{return N()}finally{w=B}},a.unstable_requestPaint=function(){E=!0},a.unstable_runWithPriority=function(N,H){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var B=w;w=N;try{return H()}finally{w=B}},a.unstable_scheduleCallback=function(N,H,B){var ce=a.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?ce+B:ce):B=ce,N){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=B+Z,N={id:b++,callback:H,priorityLevel:N,startTime:B,expirationTime:Z,sortIndex:-1},B>ce?(N.sortIndex=B,n(h,N),l(g)===null&&N===l(h)&&(O?(j(I),I=-1):O=!0,X(U,B-ce))):(N.sortIndex=Z,n(g,N),R||T||(R=!0,V||(V=!0,q()))),N},a.unstable_shouldYield=pe,a.unstable_wrapCallback=function(N){var H=w;return function(){var B=w;w=H;try{return N.apply(this,arguments)}finally{w=B}}}})(zu)),zu}var wh;function ab(){return wh||(wh=1,Ou.exports=rb()),Ou.exports}var Mu={exports:{}},Zt={};/**
|
|
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 Sh;function sb(){if(Sh)return Zt;Sh=1;var a=ud();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 Zt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Zt.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)},Zt.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()}},Zt.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))},Zt.prefetchDNS=function(g){typeof g=="string"&&o.d.D(g)},Zt.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})}},Zt.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)},Zt.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})}},Zt.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)},Zt.requestFormReset=function(g){o.d.r(g)},Zt.unstable_batchedUpdates=function(g,h){return g(h)},Zt.useFormState=function(g,h,b){return m.H.useFormState(g,h,b)},Zt.useFormStatus=function(){return m.H.useHostTransitionStatus()},Zt.version="19.2.1",Zt}var jh;function nb(){if(jh)return Mu.exports;jh=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(),Mu.exports=sb(),Mu.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 Nh;function lb(){if(Nh)return yl;Nh=1;var a=ab(),n=ud(),l=nb();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,C=u.child;C;){if(C===s){v=!0,s=u,i=f;break}if(C===i){v=!0,i=u,s=f;break}C=C.sibling}if(!v){for(C=f.child;C;){if(C===s){v=!0,s=f,i=u;break}if(C===i){v=!0,i=f,s=u;break}C=C.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"),k=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),S=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),I=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),pe=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function q(e){return e===null||typeof e!="object"?null:(e=K&&e[K]||e["@@iterator"],typeof e=="function"?e:null)}var Q=Symbol.for("react.client.reference");function G(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Q?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case k:return"Profiler";case E:return"StrictMode";case U:return"Suspense";case V:return"SuspenseList";case $:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case R:return"Portal";case S:return e.displayName||"Context";case j: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 I:return t=e.displayName||null,t!==null?t:G(e.type)||"Memo";case M:t=e._payload,e=e._init;try{return G(e(t))}catch{}}return null}var X=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},ce=[],Z=-1;function A(e){return{current:e}}function L(e){0>Z||(e.current=ce[Z],ce[Z]=null,Z--)}function z(e,t){Z++,ce[Z]=e.current,e.current=t}var P=A(null),le=A(null),ee=A(null),Y=A(null);function ge(e,t){switch(z(ee,t),z(le,e),z(P,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Bp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Bp(t),e=Ip(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}L(P),z(P,e)}function ae(){L(P),L(le),L(ee)}function ye(e){e.memoizedState!==null&&z(Y,e);var t=P.current,s=Ip(t,e.type);t!==s&&(z(le,e),z(P,s))}function de(e){le.current===e&&(L(P),L(le)),Y.current===e&&(L(Y),fl._currentValue=B)}var oe,xe;function Xe(e){if(oe===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);oe=t&&t[1]||"",xe=-1<s.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+oe+e+xe}var $t=!1;function Yt(e,t){if(!e||$t)return"";$t=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(ne){var se=ne}Reflect.construct(e,[],fe)}else{try{fe.call()}catch(ne){se=ne}e.call(fe.prototype)}}else{try{throw Error()}catch(ne){se=ne}(fe=e())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(ne){if(ne&&se&&typeof ne.stack=="string")return[ne.stack,se.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],C=f[1];if(v&&C){var _=v.split(`
|
|
44
|
-
`),re=C.split(`
|
|
45
|
-
`);for(u=i=0;i<_.length&&!_[i].includes("DetermineComponentFrameRoot");)i++;for(;u<re.length&&!re[u].includes("DetermineComponentFrameRoot");)u++;if(i===_.length||u===re.length)for(i=_.length-1,u=re.length-1;1<=i&&0<=u&&_[i]!==re[u];)u--;for(;1<=i&&0<=u;i--,u--)if(_[i]!==re[u]){if(i!==1||u!==1)do if(i--,u--,0>u||_[i]!==re[u]){var ue=`
|
|
46
|
-
`+_[i].replace(" at new "," at ");return e.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",e.displayName)),ue}while(1<=i&&0<=u);break}}}finally{$t=!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 Yt(e.type,!1);case 11:return Yt(e.type.render,!1);case 1:return Yt(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 Jt=Object.prototype.hasOwnProperty,_t=a.unstable_scheduleCallback,Qt=a.unstable_cancelCallback,Ht=a.unstable_shouldYield,fr=a.unstable_requestPaint,tt=a.unstable_now,St=a.unstable_getCurrentPriorityLevel,lr=a.unstable_ImmediatePriority,ze=a.unstable_UserBlockingPriority,jt=a.unstable_NormalPriority,Ce=a.unstable_LowPriority,nt=a.unstable_IdlePriority,lt=a.log,rr=a.unstable_setDisableYieldValue,Xt=null,ft=null;function ar(e){if(typeof lt=="function"&&rr(e),ft&&typeof ft.setStrictMode=="function")try{ft.setStrictMode(Xt,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 pr=256,hr=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 Fe(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 C=i&134217727;return C!==0?(i=C&~f,i!==0?u=ve(i):(v&=C,v!==0?u=ve(v):s||(s=C&~e,s!==0&&(u=ve(s))))):(C=i&~f,C!==0?u=ve(C):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 Nt(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 C=e.entanglements,_=e.expirationTimes,re=e.hiddenUpdates;for(s=v&~s;0<s;){var ue=31-xt(s),fe=1<<ue;C[ue]=0,_[ue]=-1;var se=re[ue];if(se!==null)for(re[ue]=null,ue=0;ue<se.length;ue++){var ne=se[ue];ne!==null&&(ne.lane&=-536870913)}s&=~fe}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 ie(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:sr(s),(s&(e.suspendedLanes|t))!==0?0:s}function sr(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=H.p;return e!==0?e:(e=window.event,e===void 0?32:ch(e.type))}function ca(e,t){var s=H.p;try{return H.p=e,t()}finally{H.p=s}}var Tt=Math.random().toString(36).slice(2),$e="__reactFiber$"+Tt,yt="__reactProps$"+Tt,Gt="__reactContainer$"+Tt,Ee="__reactEvents$"+Tt,Te="__reactListeners$"+Tt,_e="__reactHandles$"+Tt,qe="__reactResources$"+Tt,ct="__reactMarker$"+Tt;function Jr(e){delete e[$e],delete e[yt],delete e[Ee],delete e[Te],delete e[_e]}function gr(e){var t=e[$e];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Gt]||s[$e]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=$p(e);e!==null;){if(s=e[$e])return s;e=$p(e)}return t}e=s,s=e.parentNode}return null}function xr(e){if(e=e[$e]||e[Gt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ar(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function bt(e){var t=e[qe];return t||(t=e[qe]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ct(e){e[ct]=!0}var Ms=new Set,Ad={};function ms(e,t){Ls(e,t),Ls(e+"Capture",t)}function Ls(e,t){for(Ad[e]=t,e=0;e<t.length;e++)Ms.add(t[e])}var G0=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]*$"),Ed={},Td={};function K0(e){return Jt.call(Td,e)?!0:Jt.call(Ed,e)?!1:G0.test(e)?Td[e]=!0:(Ed[e]=!0,!1)}function Dl(e,t,s){if(K0(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 Pl(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 Rd(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function q0(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 wo(e){if(!e._valueTracker){var t=Rd(e)?"checked":"value";e._valueTracker=q0(e,t,""+e[t])}}function Od(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),i="";return e&&(i=Rd(e)?e.checked?"true":"false":e.value),e=i,e!==s?(t.setValue(e),!0):!1}function Ul(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 F0=/[\n"\\]/g;function Tr(e){return e.replace(F0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function So(e,t,s,i,u,f,v,C){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?jo(e,v,Er(t)):s!=null?jo(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"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?e.name=""+Er(C):e.removeAttribute("name")}function zd(e,t,s,i,u,f,v,C){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)){wo(e);return}s=s!=null?""+Er(s):"",t=t!=null?""+Er(t):s,C||t===e.value||(e.value=t),e.defaultValue=t}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=C?e.checked:!!i,e.defaultChecked=!!i,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.name=v),wo(e)}function jo(e,t,s){t==="number"&&Ul(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Ds(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 Md(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 Ld(e,t,s,i){if(t==null){if(i!=null){if(s!=null)throw Error(o(92));if(X(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),wo(e)}function Ps(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var V0=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 Dd(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||V0.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Pd(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&&Dd(e,u,i)}else for(var f in t)t.hasOwnProperty(f)&&Dd(e,f,t[f])}function No(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 $0=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"]]),Y0=/^[\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 _l(e){return Y0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function da(){}var Co=null;function ko(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Us=null,_s=null;function Ud(e){var t=xr(e);if(t&&(e=t.stateNode)){var s=e[yt]||null;e:switch(e=t.stateNode,t.type){case"input":if(So(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[yt]||null;if(!u)throw Error(o(90));So(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&&Od(i)}break e;case"textarea":Md(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&Ds(e,!!s.multiple,t,!1)}}}var Ao=!1;function _d(e,t,s){if(Ao)return e(t,s);Ao=!0;try{var i=e(t);return i}finally{if(Ao=!1,(Us!==null||_s!==null)&&(Ci(),Us&&(t=Us,e=_s,_s=Us=null,Ud(t),e)))for(t=0;t<e.length;t++)Ud(e[t])}}function Rn(e,t){var s=e.stateNode;if(s===null)return null;var i=s[yt]||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"),Eo=!1;if(ma)try{var On={};Object.defineProperty(On,"passive",{get:function(){Eo=!0}}),window.addEventListener("test",On,On),window.removeEventListener("test",On,On)}catch{Eo=!1}var Da=null,To=null,Bl=null;function Bd(){if(Bl)return Bl;var e,t=To,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 Bl=u.slice(e,1<i?1-i:void 0)}function Il(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 Hl(){return!0}function Id(){return!1}function ir(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 C in e)e.hasOwnProperty(C)&&(s=e[C],this[C]=s?s(f):f[C]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Hl:Id,this.isPropagationStopped=Id,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=Hl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Hl)},persist:function(){},isPersistent:Hl}),t}var fs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gl=ir(fs),zn=x({},fs,{view:0,detail:0}),J0=ir(zn),Ro,Oo,Mn,Kl=x({},zn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mo,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!==Mn&&(Mn&&e.type==="mousemove"?(Ro=e.screenX-Mn.screenX,Oo=e.screenY-Mn.screenY):Oo=Ro=0,Mn=e),Ro)},movementY:function(e){return"movementY"in e?e.movementY:Oo}}),Hd=ir(Kl),Q0=x({},Kl,{dataTransfer:0}),X0=ir(Q0),Z0=x({},zn,{relatedTarget:0}),zo=ir(Z0),W0=x({},fs,{animationName:0,elapsedTime:0,pseudoElement:0}),ex=ir(W0),tx=x({},fs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),rx=ir(tx),ax=x({},fs,{data:0}),Gd=ir(ax),sx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},nx={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"},lx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ix(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=lx[e])?!!t[e]:!1}function Mo(){return ix}var ox=x({},zn,{key:function(e){if(e.key){var t=sx[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Il(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?nx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mo,charCode:function(e){return e.type==="keypress"?Il(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Il(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),cx=ir(ox),ux=x({},Kl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Kd=ir(ux),dx=x({},zn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mo}),mx=ir(dx),fx=x({},fs,{propertyName:0,elapsedTime:0,pseudoElement:0}),px=ir(fx),hx=x({},Kl,{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}),gx=ir(hx),xx=x({},fs,{newState:0,oldState:0}),yx=ir(xx),bx=[9,13,27,32],Lo=ma&&"CompositionEvent"in window,Ln=null;ma&&"documentMode"in document&&(Ln=document.documentMode);var vx=ma&&"TextEvent"in window&&!Ln,qd=ma&&(!Lo||Ln&&8<Ln&&11>=Ln),Fd=" ",Vd=!1;function $d(e,t){switch(e){case"keyup":return bx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bs=!1;function wx(e,t){switch(e){case"compositionend":return Yd(t);case"keypress":return t.which!==32?null:(Vd=!0,Fd);case"textInput":return e=t.data,e===Fd&&Vd?null:e;default:return null}}function Sx(e,t){if(Bs)return e==="compositionend"||!Lo&&$d(e,t)?(e=Bd(),Bl=To=Da=null,Bs=!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 qd&&t.locale!=="ko"?null:t.data;default:return null}}var jx={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 Jd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!jx[e.type]:t==="textarea"}function Qd(e,t,s,i){Us?_s?_s.push(i):_s=[i]:Us=i,t=zi(t,"onChange"),0<t.length&&(s=new Gl("onChange","change",null,s,i),e.push({event:s,listeners:t}))}var Dn=null,Pn=null;function Nx(e){Mp(e,0)}function ql(e){var t=Ar(e);if(Od(t))return e}function Xd(e,t){if(e==="change")return t}var Zd=!1;if(ma){var Do;if(ma){var Po="oninput"in document;if(!Po){var Wd=document.createElement("div");Wd.setAttribute("oninput","return;"),Po=typeof Wd.oninput=="function"}Do=Po}else Do=!1;Zd=Do&&(!document.documentMode||9<document.documentMode)}function em(){Dn&&(Dn.detachEvent("onpropertychange",tm),Pn=Dn=null)}function tm(e){if(e.propertyName==="value"&&ql(Pn)){var t=[];Qd(t,Pn,e,ko(e)),_d(Nx,t)}}function Cx(e,t,s){e==="focusin"?(em(),Dn=t,Pn=s,Dn.attachEvent("onpropertychange",tm)):e==="focusout"&&em()}function kx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ql(Pn)}function Ax(e,t){if(e==="click")return ql(t)}function Ex(e,t){if(e==="input"||e==="change")return ql(t)}function Tx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yr=typeof Object.is=="function"?Object.is:Tx;function Un(e,t){if(yr(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(!Jt.call(t,u)||!yr(e[u],t[u]))return!1}return!0}function rm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function am(e,t){var s=rm(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=rm(s)}}function sm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?sm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function nm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ul(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=Ul(e.document)}return t}function Uo(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 Rx=ma&&"documentMode"in document&&11>=document.documentMode,Is=null,_o=null,_n=null,Bo=!1;function lm(e,t,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Bo||Is==null||Is!==Ul(i)||(i=Is,"selectionStart"in i&&Uo(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}),_n&&Un(_n,i)||(_n=i,i=zi(_o,"onSelect"),0<i.length&&(t=new Gl("onSelect","select",null,t,s),e.push({event:t,listeners:i}),t.target=Is)))}function ps(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Hs={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")},Io={},im={};ma&&(im=document.createElement("div").style,"AnimationEvent"in window||(delete Hs.animationend.animation,delete Hs.animationiteration.animation,delete Hs.animationstart.animation),"TransitionEvent"in window||delete Hs.transitionend.transition);function hs(e){if(Io[e])return Io[e];if(!Hs[e])return e;var t=Hs[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in im)return Io[e]=t[s];return e}var om=hs("animationend"),cm=hs("animationiteration"),um=hs("animationstart"),Ox=hs("transitionrun"),zx=hs("transitionstart"),Mx=hs("transitioncancel"),dm=hs("transitionend"),mm=new Map,Ho="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(" ");Ho.push("scrollEnd");function Hr(e,t){mm.set(e,t),ms(t,[e])}var Fl=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=[],Gs=0,Go=0;function Vl(){for(var e=Gs,t=Go=Gs=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&&fm(s,u,f)}}function $l(e,t,s,i){Rr[Gs++]=e,Rr[Gs++]=t,Rr[Gs++]=s,Rr[Gs++]=i,Go|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Ko(e,t,s,i){return $l(e,t,s,i),Yl(e)}function gs(e,t){return $l(e,null,null,t),Yl(e)}function fm(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 Yl(e){if(50<ll)throw ll=0,Zc=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ks={};function Lx(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 br(e,t,s,i){return new Lx(e,t,s,i)}function qo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fa(e,t){var s=e.alternate;return s===null?(s=br(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 pm(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 Jl(e,t,s,i,u,f){var v=0;if(i=e,typeof e=="function")qo(e)&&(v=1);else if(typeof e=="string")v=By(e,s,P.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case $:return e=br(31,s,t,u),e.elementType=$,e.lanes=f,e;case O:return xs(s.children,u,f,t);case E:v=8,u|=24;break;case k:return e=br(12,s,t,u|2),e.elementType=k,e.lanes=f,e;case U:return e=br(13,s,t,u),e.elementType=U,e.lanes=f,e;case V:return e=br(19,s,t,u),e.elementType=V,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case S:v=10;break e;case j:v=9;break e;case D:v=11;break e;case I:v=14;break e;case M:v=16,i=null;break e}v=29,s=Error(o(130,e===null?"null":typeof e,"")),i=null}return t=br(v,s,t,u),t.elementType=e,t.type=i,t.lanes=f,t}function xs(e,t,s,i){return e=br(7,e,i,t),e.lanes=s,e}function Fo(e,t,s){return e=br(6,e,null,t),e.lanes=s,e}function hm(e){var t=br(18,null,null,0);return t.stateNode=e,t}function Vo(e,t,s){return t=br(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gm=new WeakMap;function Or(e,t){if(typeof e=="object"&&e!==null){var s=gm.get(e);return s!==void 0?s:(t={value:e,source:t,stack:gt(t)},gm.set(e,t),t)}return{value:e,source:t,stack:gt(t)}}var qs=[],Fs=0,Ql=null,Bn=0,zr=[],Mr=0,Pa=null,Qr=1,Xr="";function pa(e,t){qs[Fs++]=Bn,qs[Fs++]=Ql,Ql=e,Bn=t}function xm(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 $o(e){e.return!==null&&(pa(e,1),xm(e,1,0))}function Yo(e){for(;e===Ql;)Ql=qs[--Fs],qs[Fs]=null,Bn=qs[--Fs],qs[Fs]=null;for(;e===Pa;)Pa=zr[--Mr],zr[Mr]=null,Xr=zr[--Mr],zr[Mr]=null,Qr=zr[--Mr],zr[Mr]=null}function ym(e,t){zr[Mr++]=Qr,zr[Mr++]=Xr,zr[Mr++]=Pa,Qr=t.id,Xr=t.overflow,Pa=e}var Kt=null,ut=null,Ke=!1,Ua=null,Lr=!1,Jo=Error(o(519));function _a(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw In(Or(t,e)),Jo}function bm(e){var t=e.stateNode,s=e.type,i=e.memoizedProps;switch(t[$e]=e,t[yt]=i,s){case"dialog":Ie("cancel",t),Ie("close",t);break;case"iframe":case"object":case"embed":Ie("load",t);break;case"video":case"audio":for(s=0;s<ol.length;s++)Ie(ol[s],t);break;case"source":Ie("error",t);break;case"img":case"image":case"link":Ie("error",t),Ie("load",t);break;case"details":Ie("toggle",t);break;case"input":Ie("invalid",t),zd(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Ie("invalid",t);break;case"textarea":Ie("invalid",t),Ld(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||Up(t.textContent,s)?(i.popover!=null&&(Ie("beforetoggle",t),Ie("toggle",t)),i.onScroll!=null&&Ie("scroll",t),i.onScrollEnd!=null&&Ie("scrollend",t),i.onClick!=null&&(t.onclick=da),t=!0):t=!1,t||_a(e,!0)}function vm(e){for(Kt=e.return;Kt;)switch(Kt.tag){case 5:case 31:case 13:Lr=!1;return;case 27:case 3:Lr=!0;return;default:Kt=Kt.return}}function Vs(e){if(e!==Kt)return!1;if(!Ke)return vm(e),Ke=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||fu(e.type,e.memoizedProps)),s=!s),s&&ut&&_a(e),vm(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ut=Vp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));ut=Vp(e)}else t===27?(t=ut,Za(e.type)?(e=yu,yu=null,ut=e):ut=t):ut=Kt?Pr(e.stateNode.nextSibling):null;return!0}function ys(){ut=Kt=null,Ke=!1}function Qo(){var e=Ua;return e!==null&&(dr===null?dr=e:dr.push.apply(dr,e),Ua=null),e}function In(e){Ua===null?Ua=[e]:Ua.push(e)}var Xo=A(null),bs=null,ha=null;function Ba(e,t,s){z(Xo,t._currentValue),t._currentValue=s}function ga(e){e._currentValue=Xo.current,L(Xo)}function Zo(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 Wo(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 C=f;f=u;for(var _=0;_<t.length;_++)if(C.context===t[_]){f.lanes|=s,C=f.alternate,C!==null&&(C.lanes|=s),Zo(f.return,s,e),i||(v=null);break e}f=C.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),Zo(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 $s(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 C=u.type;yr(u.pendingProps.value,v.value)||(e!==null?e.push(C):e=[C])}}else if(u===Y.current){if(v=u.alternate,v===null)throw Error(o(387));v.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(fl):e=[fl])}u=u.return}e!==null&&Wo(t,e,s,i),t.flags|=262144}function Xl(e){for(e=e.firstContext;e!==null;){if(!yr(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 qt(e){return wm(bs,e)}function Zl(e,t){return bs===null&&vs(e),wm(e,t)}function wm(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 Dx=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()})}},Px=a.unstable_scheduleCallback,Ux=a.unstable_NormalPriority,Rt={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ec(){return{controller:new Dx,data:new Map,refCount:0}}function Hn(e){e.refCount--,e.refCount===0&&Px(Ux,function(){e.controller.abort()})}var Gn=null,tc=0,Ys=0,Js=null;function _x(e,t){if(Gn===null){var s=Gn=[];tc=0,Ys=su(),Js={status:"pending",value:void 0,then:function(i){s.push(i)}}}return tc++,t.then(Sm,Sm),t}function Sm(){if(--tc===0&&Gn!==null){Js!==null&&(Js.status="fulfilled");var e=Gn;Gn=null,Ys=0,Js=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Bx(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 jm=N.S;N.S=function(e,t){ip=tt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&_x(e,t),jm!==null&&jm(e,t)};var ws=A(null);function rc(){var e=ws.current;return e!==null?e:ot.pooledCache}function Wl(e,t){t===null?z(ws,ws.current):z(ws,t.pool)}function Nm(){var e=rc();return e===null?null:{parent:Rt._currentValue,pool:e}}var Qs=Error(o(460)),ac=Error(o(474)),ei=Error(o(542)),ti={then:function(){}};function Cm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function km(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,Em(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,Em(e),e}throw js=t,Qs}}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,Qs):s}}var js=null;function Am(){if(js===null)throw Error(o(459));var e=js;return js=null,e}function Em(e){if(e===Qs||e===ei)throw Error(o(483))}var Xs=null,Kn=0;function ri(e){var t=Kn;return Kn+=1,Xs===null&&(Xs=[]),km(Xs,e,t)}function qn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ai(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 Tm(e){function t(J,F){if(e){var te=J.deletions;te===null?(J.deletions=[F],J.flags|=16):te.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,te){return J.index=te,e?(te=J.alternate,te!==null?(te=te.index,te<F?(J.flags|=67108866,F):te):(J.flags|=67108866,F)):(J.flags|=1048576,F)}function v(J){return e&&J.alternate===null&&(J.flags|=67108866),J}function C(J,F,te,me){return F===null||F.tag!==6?(F=Fo(te,J.mode,me),F.return=J,F):(F=u(F,te),F.return=J,F)}function _(J,F,te,me){var Ae=te.type;return Ae===O?ue(J,F,te.props.children,me,te.key):F!==null&&(F.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===M&&Ss(Ae)===F.type)?(F=u(F,te.props),qn(F,te),F.return=J,F):(F=Jl(te.type,te.key,te.props,null,J.mode,me),qn(F,te),F.return=J,F)}function re(J,F,te,me){return F===null||F.tag!==4||F.stateNode.containerInfo!==te.containerInfo||F.stateNode.implementation!==te.implementation?(F=Vo(te,J.mode,me),F.return=J,F):(F=u(F,te.children||[]),F.return=J,F)}function ue(J,F,te,me,Ae){return F===null||F.tag!==7?(F=xs(te,J.mode,me,Ae),F.return=J,F):(F=u(F,te),F.return=J,F)}function fe(J,F,te){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=Fo(""+F,J.mode,te),F.return=J,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case T:return te=Jl(F.type,F.key,F.props,null,J.mode,te),qn(te,F),te.return=J,te;case R:return F=Vo(F,J.mode,te),F.return=J,F;case M:return F=Ss(F),fe(J,F,te)}if(X(F)||q(F))return F=xs(F,J.mode,te,null),F.return=J,F;if(typeof F.then=="function")return fe(J,ri(F),te);if(F.$$typeof===S)return fe(J,Zl(J,F),te);ai(J,F)}return null}function se(J,F,te,me){var Ae=F!==null?F.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Ae!==null?null:C(J,F,""+te,me);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case T:return te.key===Ae?_(J,F,te,me):null;case R:return te.key===Ae?re(J,F,te,me):null;case M:return te=Ss(te),se(J,F,te,me)}if(X(te)||q(te))return Ae!==null?null:ue(J,F,te,me,null);if(typeof te.then=="function")return se(J,F,ri(te),me);if(te.$$typeof===S)return se(J,F,Zl(J,te),me);ai(J,te)}return null}function ne(J,F,te,me,Ae){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return J=J.get(te)||null,C(F,J,""+me,Ae);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case T:return J=J.get(me.key===null?te:me.key)||null,_(F,J,me,Ae);case R:return J=J.get(me.key===null?te:me.key)||null,re(F,J,me,Ae);case M:return me=Ss(me),ne(J,F,te,me,Ae)}if(X(me)||q(me))return J=J.get(te)||null,ue(F,J,me,Ae,null);if(typeof me.then=="function")return ne(J,F,te,ri(me),Ae);if(me.$$typeof===S)return ne(J,F,te,Zl(F,me),Ae);ai(F,me)}return null}function we(J,F,te,me){for(var Ae=null,Ye=null,ke=F,De=F=0,Ge=null;ke!==null&&De<te.length;De++){ke.index>De?(Ge=ke,ke=null):Ge=ke.sibling;var Je=se(J,ke,te[De],me);if(Je===null){ke===null&&(ke=Ge);break}e&&ke&&Je.alternate===null&&t(J,ke),F=f(Je,F,De),Ye===null?Ae=Je:Ye.sibling=Je,Ye=Je,ke=Ge}if(De===te.length)return s(J,ke),Ke&&pa(J,De),Ae;if(ke===null){for(;De<te.length;De++)ke=fe(J,te[De],me),ke!==null&&(F=f(ke,F,De),Ye===null?Ae=ke:Ye.sibling=ke,Ye=ke);return Ke&&pa(J,De),Ae}for(ke=i(ke);De<te.length;De++)Ge=ne(ke,J,De,te[De],me),Ge!==null&&(e&&Ge.alternate!==null&&ke.delete(Ge.key===null?De:Ge.key),F=f(Ge,F,De),Ye===null?Ae=Ge:Ye.sibling=Ge,Ye=Ge);return e&&ke.forEach(function(as){return t(J,as)}),Ke&&pa(J,De),Ae}function Re(J,F,te,me){if(te==null)throw Error(o(151));for(var Ae=null,Ye=null,ke=F,De=F=0,Ge=null,Je=te.next();ke!==null&&!Je.done;De++,Je=te.next()){ke.index>De?(Ge=ke,ke=null):Ge=ke.sibling;var as=se(J,ke,Je.value,me);if(as===null){ke===null&&(ke=Ge);break}e&&ke&&as.alternate===null&&t(J,ke),F=f(as,F,De),Ye===null?Ae=as:Ye.sibling=as,Ye=as,ke=Ge}if(Je.done)return s(J,ke),Ke&&pa(J,De),Ae;if(ke===null){for(;!Je.done;De++,Je=te.next())Je=fe(J,Je.value,me),Je!==null&&(F=f(Je,F,De),Ye===null?Ae=Je:Ye.sibling=Je,Ye=Je);return Ke&&pa(J,De),Ae}for(ke=i(ke);!Je.done;De++,Je=te.next())Je=ne(ke,J,De,Je.value,me),Je!==null&&(e&&Je.alternate!==null&&ke.delete(Je.key===null?De:Je.key),F=f(Je,F,De),Ye===null?Ae=Je:Ye.sibling=Je,Ye=Je);return e&&ke.forEach(function(Qy){return t(J,Qy)}),Ke&&pa(J,De),Ae}function st(J,F,te,me){if(typeof te=="object"&&te!==null&&te.type===O&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case T:e:{for(var Ae=te.key;F!==null;){if(F.key===Ae){if(Ae=te.type,Ae===O){if(F.tag===7){s(J,F.sibling),me=u(F,te.props.children),me.return=J,J=me;break e}}else if(F.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===M&&Ss(Ae)===F.type){s(J,F.sibling),me=u(F,te.props),qn(me,te),me.return=J,J=me;break e}s(J,F);break}else t(J,F);F=F.sibling}te.type===O?(me=xs(te.props.children,J.mode,me,te.key),me.return=J,J=me):(me=Jl(te.type,te.key,te.props,null,J.mode,me),qn(me,te),me.return=J,J=me)}return v(J);case R:e:{for(Ae=te.key;F!==null;){if(F.key===Ae)if(F.tag===4&&F.stateNode.containerInfo===te.containerInfo&&F.stateNode.implementation===te.implementation){s(J,F.sibling),me=u(F,te.children||[]),me.return=J,J=me;break e}else{s(J,F);break}else t(J,F);F=F.sibling}me=Vo(te,J.mode,me),me.return=J,J=me}return v(J);case M:return te=Ss(te),st(J,F,te,me)}if(X(te))return we(J,F,te,me);if(q(te)){if(Ae=q(te),typeof Ae!="function")throw Error(o(150));return te=Ae.call(te),Re(J,F,te,me)}if(typeof te.then=="function")return st(J,F,ri(te),me);if(te.$$typeof===S)return st(J,F,Zl(J,te),me);ai(J,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,F!==null&&F.tag===6?(s(J,F.sibling),me=u(F,te),me.return=J,J=me):(s(J,F),me=Fo(te,J.mode,me),me.return=J,J=me),v(J)):s(J,F)}return function(J,F,te,me){try{Kn=0;var Ae=st(J,F,te,me);return Xs=null,Ae}catch(ke){if(ke===Qs||ke===ei)throw ke;var Ye=br(29,ke,null,J.mode);return Ye.lanes=me,Ye.return=J,Ye}finally{}}}var Ns=Tm(!0),Rm=Tm(!1),Ia=!1;function sc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nc(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=Yl(e),fm(e,null,s),t}return $l(e,i,t,s),Yl(e)}function Fn(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,ie(e,s)}}function lc(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 ic=!1;function Vn(){if(ic){var e=Js;if(e!==null)throw e}}function $n(e,t,s,i){ic=!1;var u=e.updateQueue;Ia=!1;var f=u.firstBaseUpdate,v=u.lastBaseUpdate,C=u.shared.pending;if(C!==null){u.shared.pending=null;var _=C,re=_.next;_.next=null,v===null?f=re:v.next=re,v=_;var ue=e.alternate;ue!==null&&(ue=ue.updateQueue,C=ue.lastBaseUpdate,C!==v&&(C===null?ue.firstBaseUpdate=re:C.next=re,ue.lastBaseUpdate=_))}if(f!==null){var fe=u.baseState;v=0,ue=re=_=null,C=f;do{var se=C.lane&-536870913,ne=se!==C.lane;if(ne?(He&se)===se:(i&se)===se){se!==0&&se===Ys&&(ic=!0),ue!==null&&(ue=ue.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var we=e,Re=C;se=t;var st=s;switch(Re.tag){case 1:if(we=Re.payload,typeof we=="function"){fe=we.call(st,fe,se);break e}fe=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Re.payload,se=typeof we=="function"?we.call(st,fe,se):we,se==null)break e;fe=x({},fe,se);break e;case 2:Ia=!0}}se=C.callback,se!==null&&(e.flags|=64,ne&&(e.flags|=8192),ne=u.callbacks,ne===null?u.callbacks=[se]:ne.push(se))}else ne={lane:se,tag:C.tag,payload:C.payload,callback:C.callback,next:null},ue===null?(re=ue=ne,_=fe):ue=ue.next=ne,v|=se;if(C=C.next,C===null){if(C=u.shared.pending,C===null)break;ne=C,C=ne.next,ne.next=null,u.lastBaseUpdate=ne,u.shared.pending=null}}while(!0);ue===null&&(_=fe),u.baseState=_,u.firstBaseUpdate=re,u.lastBaseUpdate=ue,f===null&&(u.shared.lanes=0),$a|=v,e.lanes=v,e.memoizedState=fe}}function Om(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function zm(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)Om(s[e],t)}var Zs=A(null),si=A(0);function Mm(e,t){e=Ca,z(si,e),z(Zs,t),Ca=e|t.baseLanes}function oc(){z(si,Ca),z(Zs,Zs.current)}function cc(){Ca=si.current,L(Zs),L(si)}var vr=A(null),Dr=null;function Ka(e){var t=e.alternate;z(kt,kt.current&1),z(vr,e),Dr===null&&(t===null||Zs.current!==null||t.memoizedState!==null)&&(Dr=e)}function uc(e){z(kt,kt.current),z(vr,e),Dr===null&&(Dr=e)}function Lm(e){e.tag===22?(z(kt,kt.current),z(vr,e),Dr===null&&(Dr=e)):qa()}function qa(){z(kt,kt.current),z(vr,vr.current)}function wr(e){L(vr),Dr===e&&(Dr=null),L(kt)}var kt=A(0);function ni(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||gu(s)||xu(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,Ot=null,li=!1,Ws=!1,Cs=!1,ii=0,Yn=0,en=null,Ix=0;function vt(){throw Error(o(321))}function dc(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!yr(e[s],t[s]))return!1;return!0}function mc(e,t,s,i,u,f){return xa=f,Le=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?yf:Ac,Cs=!1,f=s(i,u),Cs=!1,Ws&&(f=Pm(t,s,i,u)),Dm(e),f}function Dm(e){N.H=Xn;var t=rt!==null&&rt.next!==null;if(xa=0,Ot=rt=Le=null,li=!1,Yn=0,en=null,t)throw Error(o(300));e===null||zt||(e=e.dependencies,e!==null&&Xl(e)&&(zt=!0))}function Pm(e,t,s,i){Le=e;var u=0;do{if(Ws&&(en=null),Yn=0,Ws=!1,25<=u)throw Error(o(301));if(u+=1,Ot=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)}N.H=bf,f=t(s,i)}while(Ws);return f}function Hx(){var e=N.H,t=e.useState()[0];return t=typeof t.then=="function"?Jn(t):t,e=e.useState()[0],(rt!==null?rt.memoizedState:null)!==e&&(Le.flags|=1024),t}function fc(){var e=ii!==0;return ii=0,e}function pc(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function hc(e){if(li){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}li=!1}xa=0,Ot=rt=Le=null,Ws=!1,Yn=ii=0,en=null}function nr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ot===null?Le.memoizedState=Ot=e:Ot=Ot.next=e,Ot}function At(){if(rt===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=rt.next;var t=Ot===null?Le.memoizedState:Ot.next;if(t!==null)Ot=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},Ot===null?Le.memoizedState=Ot=e:Ot=Ot.next=e}return Ot}function oi(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Jn(e){var t=Yn;return Yn+=1,en===null&&(en=[]),e=km(en,e,t),t=Le,(Ot===null?t.memoizedState:Ot.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?yf:Ac),e}function ci(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Jn(e);if(e.$$typeof===S)return qt(e)}throw Error(o(438,String(e)))}function gc(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=oi(),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]=pe;return t.index++,s}function ya(e,t){return typeof t=="function"?t(e):t}function ui(e){var t=At();return xc(t,rt,e)}function xc(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 C=v=null,_=null,re=t,ue=!1;do{var fe=re.lane&-536870913;if(fe!==re.lane?(He&fe)===fe:(xa&fe)===fe){var se=re.revertLane;if(se===0)_!==null&&(_=_.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),fe===Ys&&(ue=!0);else if((xa&se)===se){re=re.next,se===Ys&&(ue=!0);continue}else fe={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},_===null?(C=_=fe,v=f):_=_.next=fe,Le.lanes|=se,$a|=se;fe=re.action,Cs&&s(f,fe),f=re.hasEagerState?re.eagerState:s(f,fe)}else se={lane:fe,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},_===null?(C=_=se,v=f):_=_.next=se,Le.lanes|=fe,$a|=fe;re=re.next}while(re!==null&&re!==t);if(_===null?v=f:_.next=C,!yr(f,e.memoizedState)&&(zt=!0,ue&&(s=Js,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 yc(e){var t=At(),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);yr(f,t.memoizedState)||(zt=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),s.lastRenderedState=f}return[f,i]}function Um(e,t,s){var i=Le,u=At(),f=Ke;if(f){if(s===void 0)throw Error(o(407));s=s()}else s=t();var v=!yr((rt||u).memoizedState,s);if(v&&(u.memoizedState=s,zt=!0),u=u.queue,wc(Im.bind(null,i,u,e),[e]),u.getSnapshot!==t||v||Ot!==null&&Ot.memoizedState.tag&1){if(i.flags|=2048,tn(9,{destroy:void 0},Bm.bind(null,i,u,s,t),null),ot===null)throw Error(o(349));f||(xa&127)!==0||_m(i,t,s)}return s}function _m(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Le.updateQueue,t===null?(t=oi(),Le.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function Bm(e,t,s,i){t.value=s,t.getSnapshot=i,Hm(t)&&Gm(e)}function Im(e,t,s){return s(function(){Hm(t)&&Gm(e)})}function Hm(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!yr(e,s)}catch{return!0}}function Gm(e){var t=gs(e,2);t!==null&&mr(t,e,2)}function bc(e){var t=nr();if(typeof e=="function"){var s=e;if(e=s(),Cs){ar(!0);try{s()}finally{ar(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:e},t}function Km(e,t,s,i){return e.baseState=s,xc(e,rt,typeof i=="function"?i:ya)}function Gx(e,t,s,i,u){if(fi(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)}};N.T!==null?s(!0):f.isTransition=!1,i(f),s=t.pending,s===null?(f.next=t.pending=f,qm(t,f)):(f.next=s.next,t.pending=s.next=f)}}function qm(e,t){var s=t.action,i=t.payload,u=e.state;if(t.isTransition){var f=N.T,v={};N.T=v;try{var C=s(u,i),_=N.S;_!==null&&_(v,C),Fm(e,t,C)}catch(re){vc(e,t,re)}finally{f!==null&&v.types!==null&&(f.types=v.types),N.T=f}}else try{f=s(u,i),Fm(e,t,f)}catch(re){vc(e,t,re)}}function Fm(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(i){Vm(e,t,i)},function(i){return vc(e,t,i)}):Vm(e,t,s)}function Vm(e,t,s){t.status="fulfilled",t.value=s,$m(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,qm(e,s)))}function vc(e,t,s){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=s,$m(t),t=t.next;while(t!==i)}e.action=null}function $m(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ym(e,t){return t}function Jm(e,t){if(Ke){var s=ot.formState;if(s!==null){e:{var i=Le;if(Ke){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=nr(),s.memoizedState=s.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ym,lastRenderedState:t},s.queue=i,s=hf.bind(null,Le,i),i.dispatch=s,i=bc(!1),f=kc.bind(null,Le,!1,i.queue),i=nr(),u={state:t,dispatch:null,action:e,pending:null},i.queue=u,s=Gx.bind(null,Le,u,f,s),u.dispatch=s,i.memoizedState=e,[t,s,!1]}function Qm(e){var t=At();return Xm(t,rt,e)}function Xm(e,t,s){if(t=xc(e,t,Ym)[0],e=ui(ya)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=Jn(t)}catch(v){throw v===Qs?ei:v}else i=t;t=At();var u=t.queue,f=u.dispatch;return s!==t.memoizedState&&(Le.flags|=2048,tn(9,{destroy:void 0},Kx.bind(null,u,s),null)),[i,f,e]}function Kx(e,t){e.action=t}function Zm(e){var t=At(),s=rt;if(s!==null)return Xm(t,s,e);At(),t=t.memoizedState,s=At();var i=s.queue.dispatch;return s.memoizedState=e,[t,i,!1]}function tn(e,t,s,i){return e={tag:e,create:s,deps:i,inst:t,next:null},t=Le.updateQueue,t===null&&(t=oi(),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 Wm(){return At().memoizedState}function di(e,t,s,i){var u=nr();Le.flags|=e,u.memoizedState=tn(1|t,{destroy:void 0},s,i===void 0?null:i)}function mi(e,t,s,i){var u=At();i=i===void 0?null:i;var f=u.memoizedState.inst;rt!==null&&i!==null&&dc(i,rt.memoizedState.deps)?u.memoizedState=tn(t,f,s,i):(Le.flags|=e,u.memoizedState=tn(1|t,f,s,i))}function ef(e,t){di(8390656,8,e,t)}function wc(e,t){mi(2048,8,e,t)}function qx(e){Le.flags|=4;var t=Le.updateQueue;if(t===null)t=oi(),Le.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function tf(e){var t=At().memoizedState;return qx({ref:t,nextImpl:e}),function(){if((Qe&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function rf(e,t){return mi(4,2,e,t)}function af(e,t){return mi(4,4,e,t)}function sf(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 nf(e,t,s){s=s!=null?s.concat([e]):null,mi(4,4,sf.bind(null,t,e),s)}function Sc(){}function lf(e,t){var s=At();t=t===void 0?null:t;var i=s.memoizedState;return t!==null&&dc(t,i[1])?i[0]:(s.memoizedState=[e,t],e)}function of(e,t){var s=At();t=t===void 0?null:t;var i=s.memoizedState;if(t!==null&&dc(t,i[1]))return i[0];if(i=e(),Cs){ar(!0);try{e()}finally{ar(!1)}}return s.memoizedState=[i,t],i}function jc(e,t,s){return s===void 0||(xa&1073741824)!==0&&(He&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=cp(),Le.lanes|=e,$a|=e,s)}function cf(e,t,s,i){return yr(s,t)?s:Zs.current!==null?(e=jc(e,s,i),yr(e,t)||(zt=!0),e):(xa&42)===0||(xa&1073741824)!==0&&(He&261930)===0?(zt=!0,e.memoizedState=s):(e=cp(),Le.lanes|=e,$a|=e,t)}function uf(e,t,s,i,u){var f=H.p;H.p=f!==0&&8>f?f:8;var v=N.T,C={};N.T=C,kc(e,!1,t,s);try{var _=u(),re=N.S;if(re!==null&&re(C,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var ue=Bx(_,i);Qn(e,t,ue,Nr(e))}else Qn(e,t,i,Nr(e))}catch(fe){Qn(e,t,{then:function(){},status:"rejected",reason:fe},Nr())}finally{H.p=f,v!==null&&C.types!==null&&(v.types=C.types),N.T=v}}function Fx(){}function Nc(e,t,s,i){if(e.tag!==5)throw Error(o(476));var u=df(e).queue;uf(e,u,t,B,s===null?Fx:function(){return mf(e),s(i)})}function df(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ya,lastRenderedState:B},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 mf(e){var t=df(e);t.next===null&&(t=e.alternate.memoizedState),Qn(e,t.next.queue,{},Nr())}function Cc(){return qt(fl)}function ff(){return At().memoizedState}function pf(){return At().memoizedState}function Vx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=Nr();e=Ha(s);var i=Ga(t,e,s);i!==null&&(mr(i,t,s),Fn(i,t,s)),t={cache:ec()},e.payload=t;return}t=t.return}}function $x(e,t,s){var i=Nr();s={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},fi(e)?gf(t,s):(s=Ko(e,t,s,i),s!==null&&(mr(s,e,i),xf(s,t,i)))}function hf(e,t,s){var i=Nr();Qn(e,t,s,i)}function Qn(e,t,s,i){var u={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(fi(e))gf(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,C=f(v,s);if(u.hasEagerState=!0,u.eagerState=C,yr(C,v))return $l(e,t,u,0),ot===null&&Vl(),!1}catch{}finally{}if(s=Ko(e,t,u,i),s!==null)return mr(s,e,i),xf(s,t,i),!0}return!1}function kc(e,t,s,i){if(i={lane:2,revertLane:su(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},fi(e)){if(t)throw Error(o(479))}else t=Ko(e,s,i,2),t!==null&&mr(t,e,2)}function fi(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function gf(e,t){Ws=li=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function xf(e,t,s){if((s&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,ie(e,s)}}var Xn={readContext:qt,use:ci,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useLayoutEffect:vt,useInsertionEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useSyncExternalStore:vt,useId:vt,useHostTransitionStatus:vt,useFormState:vt,useActionState:vt,useOptimistic:vt,useMemoCache:vt,useCacheRefresh:vt};Xn.useEffectEvent=vt;var yf={readContext:qt,use:ci,useCallback:function(e,t){return nr().memoizedState=[e,t===void 0?null:t],e},useContext:qt,useEffect:ef,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,di(4194308,4,sf.bind(null,t,e),s)},useLayoutEffect:function(e,t){return di(4194308,4,e,t)},useInsertionEffect:function(e,t){di(4,2,e,t)},useMemo:function(e,t){var s=nr();t=t===void 0?null:t;var i=e();if(Cs){ar(!0);try{e()}finally{ar(!1)}}return s.memoizedState=[i,t],i},useReducer:function(e,t,s){var i=nr();if(s!==void 0){var u=s(t);if(Cs){ar(!0);try{s(t)}finally{ar(!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=$x.bind(null,Le,e),[i.memoizedState,e]},useRef:function(e){var t=nr();return e={current:e},t.memoizedState=e},useState:function(e){e=bc(e);var t=e.queue,s=hf.bind(null,Le,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Sc,useDeferredValue:function(e,t){var s=nr();return jc(s,e,t)},useTransition:function(){var e=bc(!1);return e=uf.bind(null,Le,e.queue,!0,!1),nr().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var i=Le,u=nr();if(Ke){if(s===void 0)throw Error(o(407));s=s()}else{if(s=t(),ot===null)throw Error(o(349));(He&127)!==0||_m(i,t,s)}u.memoizedState=s;var f={value:s,getSnapshot:t};return u.queue=f,ef(Im.bind(null,i,f,e),[e]),i.flags|=2048,tn(9,{destroy:void 0},Bm.bind(null,i,f,s,t),null),s},useId:function(){var e=nr(),t=ot.identifierPrefix;if(Ke){var s=Xr,i=Qr;s=(i&~(1<<32-xt(i)-1)).toString(32)+s,t="_"+t+"R_"+s,s=ii++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=Ix++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Cc,useFormState:Jm,useActionState:Jm,useOptimistic:function(e){var t=nr();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=kc.bind(null,Le,!0,s),s.dispatch=t,[e,t]},useMemoCache:gc,useCacheRefresh:function(){return nr().memoizedState=Vx.bind(null,Le)},useEffectEvent:function(e){var t=nr(),s={impl:e};return t.memoizedState=s,function(){if((Qe&2)!==0)throw Error(o(440));return s.impl.apply(void 0,arguments)}}},Ac={readContext:qt,use:ci,useCallback:lf,useContext:qt,useEffect:wc,useImperativeHandle:nf,useInsertionEffect:rf,useLayoutEffect:af,useMemo:of,useReducer:ui,useRef:Wm,useState:function(){return ui(ya)},useDebugValue:Sc,useDeferredValue:function(e,t){var s=At();return cf(s,rt.memoizedState,e,t)},useTransition:function(){var e=ui(ya)[0],t=At().memoizedState;return[typeof e=="boolean"?e:Jn(e),t]},useSyncExternalStore:Um,useId:ff,useHostTransitionStatus:Cc,useFormState:Qm,useActionState:Qm,useOptimistic:function(e,t){var s=At();return Km(s,rt,e,t)},useMemoCache:gc,useCacheRefresh:pf};Ac.useEffectEvent=tf;var bf={readContext:qt,use:ci,useCallback:lf,useContext:qt,useEffect:wc,useImperativeHandle:nf,useInsertionEffect:rf,useLayoutEffect:af,useMemo:of,useReducer:yc,useRef:Wm,useState:function(){return yc(ya)},useDebugValue:Sc,useDeferredValue:function(e,t){var s=At();return rt===null?jc(s,e,t):cf(s,rt.memoizedState,e,t)},useTransition:function(){var e=yc(ya)[0],t=At().memoizedState;return[typeof e=="boolean"?e:Jn(e),t]},useSyncExternalStore:Um,useId:ff,useHostTransitionStatus:Cc,useFormState:Zm,useActionState:Zm,useOptimistic:function(e,t){var s=At();return rt!==null?Km(s,rt,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:gc,useCacheRefresh:pf};bf.useEffectEvent=tf;function Ec(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 Tc={enqueueSetState:function(e,t,s){e=e._reactInternals;var i=Nr(),u=Ha(i);u.payload=t,s!=null&&(u.callback=s),t=Ga(e,u,i),t!==null&&(mr(t,e,i),Fn(t,e,i))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var i=Nr(),u=Ha(i);u.tag=1,u.payload=t,s!=null&&(u.callback=s),t=Ga(e,u,i),t!==null&&(mr(t,e,i),Fn(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=Nr(),i=Ha(s);i.tag=2,t!=null&&(i.callback=t),t=Ga(e,i,s),t!==null&&(mr(t,e,s),Fn(t,e,s))}};function vf(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?!Un(s,i)||!Un(u,f):!0}function wf(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&&Tc.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 Sf(e){Fl(e)}function jf(e){console.error(e)}function Nf(e){Fl(e)}function pi(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Cf(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 Rc(e,t,s){return s=Ha(s),s.tag=3,s.payload={element:null},s.callback=function(){pi(e,t)},s}function kf(e){return e=Ha(e),e.tag=3,e}function Af(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(){Cf(t,s,i)}}var v=s.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(e.callback=function(){Cf(t,s,i),typeof u!="function"&&(Ya===null?Ya=new Set([this]):Ya.add(this));var C=i.stack;this.componentDidCatch(i.value,{componentStack:C!==null?C:""})})}function Yx(e,t,s,i,u){if(s.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=s.alternate,t!==null&&$s(t,s,u,!0),s=vr.current,s!==null){switch(s.tag){case 31:case 13:return Dr===null?ki():s.alternate===null&&wt===0&&(wt=3),s.flags&=-257,s.flags|=65536,s.lanes=u,i===ti?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([i]):t.add(i),tu(e,i,u)),!1;case 22:return s.flags|=65536,i===ti?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)),tu(e,i,u)),!1}throw Error(o(435,s.tag))}return tu(e,i,u),ki(),!1}if(Ke)return t=vr.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,i!==Jo&&(e=Error(o(422),{cause:i}),In(Or(e,s)))):(i!==Jo&&(t=Error(o(423),{cause:i}),In(Or(t,s))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=Or(i,s),u=Rc(e.stateNode,i,u),lc(e,u),wt!==4&&(wt=2)),!1;var f=Error(o(520),{cause:i});if(f=Or(f,s),nl===null?nl=[f]:nl.push(f),wt!==4&&(wt=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=Rc(s.stateNode,i,e),lc(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=kf(u),Af(u,e,s,i),lc(s,u),!1}s=s.return}while(s!==null);return!1}var Oc=Error(o(461)),zt=!1;function Ft(e,t,s,i){t.child=e===null?Rm(t,null,s,i):Ns(t,e.child,s,i)}function Ef(e,t,s,i,u){s=s.render;var f=t.ref;if("ref"in i){var v={};for(var C in i)C!=="ref"&&(v[C]=i[C])}else v=i;return vs(t),i=mc(e,t,s,v,f,u),C=fc(),e!==null&&!zt?(pc(e,t,u),ba(e,t,u)):(Ke&&C&&$o(t),t.flags|=1,Ft(e,t,i,u),t.child)}function Tf(e,t,s,i,u){if(e===null){var f=s.type;return typeof f=="function"&&!qo(f)&&f.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=f,Rf(e,t,f,i,u)):(e=Jl(s.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!Bc(e,u)){var v=f.memoizedProps;if(s=s.compare,s=s!==null?s:Un,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 Rf(e,t,s,i,u){if(e!==null){var f=e.memoizedProps;if(Un(f,i)&&e.ref===t.ref)if(zt=!1,t.pendingProps=i=f,Bc(e,u))(e.flags&131072)!==0&&(zt=!0);else return t.lanes=e.lanes,ba(e,t,u)}return zc(e,t,s,i,u)}function Of(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 zf(e,t,f,s,i)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Wl(t,f!==null?f.cachePool:null),f!==null?Mm(t,f):oc(),Lm(t);else return i=t.lanes=536870912,zf(e,t,f!==null?f.baseLanes|s:s,s,i)}else f!==null?(Wl(t,f.cachePool),Mm(t,f),qa(),t.memoizedState=null):(e!==null&&Wl(t,null),oc(),qa());return Ft(e,t,u,s),t.child}function Zn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function zf(e,t,s,i,u){var f=rc();return f=f===null?null:{parent:Rt._currentValue,pool:f},t.memoizedState={baseLanes:s,cachePool:f},e!==null&&Wl(t,null),oc(),Lm(t),e!==null&&$s(e,t,i,!0),t.childLanes=u,null}function hi(e,t){return t=xi({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Mf(e,t,s){return Ns(t,e.child,null,s),e=hi(t,t.pendingProps),e.flags|=2,wr(t),t.memoizedState=null,e}function Jx(e,t,s){var i=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ke){if(i.mode==="hidden")return e=hi(t,i),t.lanes=536870912,Zn(null,e);if(uc(t),(e=ut)?(e=Fp(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=hm(e),s.return=t,t.child=s,Kt=t,ut=null)):e=null,e===null)throw _a(t);return t.lanes=536870912,null}return hi(t,i)}var f=e.memoizedState;if(f!==null){var v=f.dehydrated;if(uc(t),u)if(t.flags&256)t.flags&=-257,t=Mf(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(zt||$s(e,t,s,!1),u=(s&e.childLanes)!==0,zt||u){if(i=ot,i!==null&&(v=be(i,s),v!==0&&v!==f.retryLane))throw f.retryLane=v,gs(e,v),mr(i,e,v),Oc;ki(),t=Mf(e,t,s)}else e=f.treeContext,ut=Pr(v.nextSibling),Kt=t,Ke=!0,Ua=null,Lr=!1,e!==null&&ym(t,e),t=hi(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 gi(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 zc(e,t,s,i,u){return vs(t),s=mc(e,t,s,i,void 0,u),i=fc(),e!==null&&!zt?(pc(e,t,u),ba(e,t,u)):(Ke&&i&&$o(t),t.flags|=1,Ft(e,t,s,u),t.child)}function Lf(e,t,s,i,u,f){return vs(t),t.updateQueue=null,s=Pm(t,i,s,u),Dm(e),i=fc(),e!==null&&!zt?(pc(e,t,f),ba(e,t,f)):(Ke&&i&&$o(t),t.flags|=1,Ft(e,t,s,f),t.child)}function Df(e,t,s,i,u){if(vs(t),t.stateNode===null){var f=Ks,v=s.contextType;typeof v=="object"&&v!==null&&(f=qt(v)),f=new s(i,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Tc,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=i,f.state=t.memoizedState,f.refs={},sc(t),v=s.contextType,f.context=typeof v=="object"&&v!==null?qt(v):Ks,f.state=t.memoizedState,v=s.getDerivedStateFromProps,typeof v=="function"&&(Ec(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&&Tc.enqueueReplaceState(f,f.state,null),$n(t,i,f,u),Vn(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){f=t.stateNode;var C=t.memoizedProps,_=ks(s,C);f.props=_;var re=f.context,ue=s.contextType;v=Ks,typeof ue=="object"&&ue!==null&&(v=qt(ue));var fe=s.getDerivedStateFromProps;ue=typeof fe=="function"||typeof f.getSnapshotBeforeUpdate=="function",C=t.pendingProps!==C,ue||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(C||re!==v)&&wf(t,f,i,v),Ia=!1;var se=t.memoizedState;f.state=se,$n(t,i,f,u),Vn(),re=t.memoizedState,C||se!==re||Ia?(typeof fe=="function"&&(Ec(t,s,fe,i),re=t.memoizedState),(_=Ia||vf(t,s,_,i,se,re,v))?(ue||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=re),f.props=i,f.state=re,f.context=v,i=_):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,nc(e,t),v=t.memoizedProps,ue=ks(s,v),f.props=ue,fe=t.pendingProps,se=f.context,re=s.contextType,_=Ks,typeof re=="object"&&re!==null&&(_=qt(re)),C=s.getDerivedStateFromProps,(re=typeof C=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(v!==fe||se!==_)&&wf(t,f,i,_),Ia=!1,se=t.memoizedState,f.state=se,$n(t,i,f,u),Vn();var ne=t.memoizedState;v!==fe||se!==ne||Ia||e!==null&&e.dependencies!==null&&Xl(e.dependencies)?(typeof C=="function"&&(Ec(t,s,C,i),ne=t.memoizedState),(ue=Ia||vf(t,s,ue,i,se,ne,_)||e!==null&&e.dependencies!==null&&Xl(e.dependencies))?(re||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&&se===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=ne),f.props=i,f.state=ne,f.context=_,i=ue):(typeof f.componentDidUpdate!="function"||v===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),i=!1)}return f=i,gi(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)):Ft(e,t,s,u),t.memoizedState=f.state,e=t.child):e=ba(e,t,u),e}function Pf(e,t,s,i){return ys(),t.flags|=256,Ft(e,t,s,i),t.child}var Mc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Lc(e){return{baseLanes:e,cachePool:Nm()}}function Dc(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=jr),e}function Uf(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:(kt.current&2)!==0),v&&(u=!0,t.flags&=-129),v=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ke){if(u?Ka(t):qa(),(e=ut)?(e=Fp(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=hm(e),s.return=t,t.child=s,Kt=t,ut=null)):e=null,e===null)throw _a(t);return xu(e)?t.lanes=32:t.lanes=536870912,null}var C=i.children;return i=i.fallback,u?(qa(),u=t.mode,C=xi({mode:"hidden",children:C},u),i=xs(i,u,s,null),C.return=t,i.return=t,C.sibling=i,t.child=C,i=t.child,i.memoizedState=Lc(s),i.childLanes=Dc(e,v,s),t.memoizedState=Mc,Zn(null,i)):(Ka(t),Pc(t,C))}var _=e.memoizedState;if(_!==null&&(C=_.dehydrated,C!==null)){if(f)t.flags&256?(Ka(t),t.flags&=-257,t=Uc(e,t,s)):t.memoizedState!==null?(qa(),t.child=e.child,t.flags|=128,t=null):(qa(),C=i.fallback,u=t.mode,i=xi({mode:"visible",children:i.children},u),C=xs(C,u,s,null),C.flags|=2,i.return=t,C.return=t,i.sibling=C,t.child=i,Ns(t,e.child,null,s),i=t.child,i.memoizedState=Lc(s),i.childLanes=Dc(e,v,s),t.memoizedState=Mc,t=Zn(null,i));else if(Ka(t),xu(C)){if(v=C.nextSibling&&C.nextSibling.dataset,v)var re=v.dgst;v=re,i=Error(o(419)),i.stack="",i.digest=v,In({value:i,source:null,stack:null}),t=Uc(e,t,s)}else if(zt||$s(e,t,s,!1),v=(s&e.childLanes)!==0,zt||v){if(v=ot,v!==null&&(i=be(v,s),i!==0&&i!==_.retryLane))throw _.retryLane=i,gs(e,i),mr(v,e,i),Oc;gu(C)||ki(),t=Uc(e,t,s)}else gu(C)?(t.flags|=192,t.child=e.child,t=null):(e=_.treeContext,ut=Pr(C.nextSibling),Kt=t,Ke=!0,Ua=null,Lr=!1,e!==null&&ym(t,e),t=Pc(t,i.children),t.flags|=4096);return t}return u?(qa(),C=i.fallback,u=t.mode,_=e.child,re=_.sibling,i=fa(_,{mode:"hidden",children:i.children}),i.subtreeFlags=_.subtreeFlags&65011712,re!==null?C=fa(re,C):(C=xs(C,u,s,null),C.flags|=2),C.return=t,i.return=t,i.sibling=C,t.child=i,Zn(null,i),i=t.child,C=e.child.memoizedState,C===null?C=Lc(s):(u=C.cachePool,u!==null?(_=Rt._currentValue,u=u.parent!==_?{parent:_,pool:_}:u):u=Nm(),C={baseLanes:C.baseLanes|s,cachePool:u}),i.memoizedState=C,i.childLanes=Dc(e,v,s),t.memoizedState=Mc,Zn(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 Pc(e,t){return t=xi({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function xi(e,t){return e=br(22,e,null,t),e.lanes=0,e}function Uc(e,t,s){return Ns(t,e.child,null,s),e=Pc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function _f(e,t,s){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Zo(e.return,t,s)}function _c(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 Bf(e,t,s){var i=t.pendingProps,u=i.revealOrder,f=i.tail;i=i.children;var v=kt.current,C=(v&2)!==0;if(C?(v=v&1|2,t.flags|=128):v&=1,z(kt,v),Ft(e,t,i,s),i=Ke?Bn:0,!C&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&_f(e,s,t);else if(e.tag===19)_f(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&&ni(e)===null&&(u=s),s=s.sibling;s=u,s===null?(u=t.child,t.child=null):(u=s.sibling,s.sibling=null),_c(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&&ni(e)===null){t.child=u;break}e=u.sibling,u.sibling=s,s=u,u=e}_c(t,!0,s,null,f,i);break;case"together":_c(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($s(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 Bc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Xl(e)))}function Qx(e,t,s){switch(t.tag){case 3:ge(t,t.stateNode.containerInfo),Ba(t,Rt,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,uc(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?Uf(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||($s(e,t,s,!1),i=(s&t.childLanes)!==0),u){if(i)return Bf(e,t,s);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),z(kt,kt.current),i)break;return null;case 22:return t.lanes=0,Of(e,t,s,t.pendingProps);case 24:Ba(t,Rt,e.memoizedState.cache)}return ba(e,t,s)}function If(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)zt=!0;else{if(!Bc(e,s)&&(t.flags&128)===0)return zt=!1,Qx(e,t,s);zt=(e.flags&131072)!==0}else zt=!1,Ke&&(t.flags&1048576)!==0&&xm(t,Bn,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")qo(e)?(i=ks(e,i),t.tag=1,t=Df(null,t,e,i,s)):(t.tag=0,t=zc(null,t,e,i,s));else{if(e!=null){var u=e.$$typeof;if(u===D){t.tag=11,t=Ef(null,t,e,i,s);break e}else if(u===I){t.tag=14,t=Tf(null,t,e,i,s);break e}}throw t=G(e)||e,Error(o(306,t,""))}}return t;case 0:return zc(e,t,t.type,t.pendingProps,s);case 1:return i=t.type,u=ks(i,t.pendingProps),Df(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,nc(e,t),$n(t,i,null,s);var v=t.memoizedState;if(i=v.cache,Ba(t,Rt,i),i!==f.cache&&Wo(t,[Rt],s,!0),Vn(),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=Pf(e,t,i,s);break e}else if(i!==u){u=Or(Error(o(424)),t),In(u),t=Pf(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),Kt=t,Ke=!0,Ua=null,Lr=!0,s=Rm(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}Ft(e,t,i,s)}t=t.child}return t;case 26:return gi(e,t),e===null?(s=Xp(t.type,null,t.pendingProps,null))?t.memoizedState=s:Ke||(s=t.type,e=t.pendingProps,i=Mi(ee.current).createElement(s),i[$e]=t,i[yt]=e,Vt(i,s,e),Ct(i),t.stateNode=i):t.memoizedState=Xp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ye(t),e===null&&Ke&&(i=t.stateNode=Yp(t.type,t.pendingProps,ee.current),Kt=t,Lr=!0,u=ut,Za(t.type)?(yu=u,ut=Pr(i.firstChild)):ut=u),Ft(e,t,t.pendingProps.children,s),gi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ke&&((u=i=ut)&&(i=ky(i,t.type,t.pendingProps,Lr),i!==null?(t.stateNode=i,Kt=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,fu(u,f)?i=null:v!==null&&fu(u,v)&&(t.flags|=32),t.memoizedState!==null&&(u=mc(e,t,Hx,null,null,s),fl._currentValue=u),gi(e,t),Ft(e,t,i,s),t.child;case 6:return e===null&&Ke&&((e=s=ut)&&(s=Ay(s,t.pendingProps,Lr),s!==null?(t.stateNode=s,Kt=t,ut=null,e=!0):e=!1),e||_a(t)),null;case 13:return Uf(e,t,s);case 4:return ge(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ns(t,null,i,s):Ft(e,t,i,s),t.child;case 11:return Ef(e,t,t.type,t.pendingProps,s);case 7:return Ft(e,t,t.pendingProps,s),t.child;case 8:return Ft(e,t,t.pendingProps.children,s),t.child;case 12:return Ft(e,t,t.pendingProps.children,s),t.child;case 10:return i=t.pendingProps,Ba(t,t.type,i.value),Ft(e,t,i.children,s),t.child;case 9:return u=t.type._context,i=t.pendingProps.children,vs(t),u=qt(u),i=i(u),t.flags|=1,Ft(e,t,i,s),t.child;case 14:return Tf(e,t,t.type,t.pendingProps,s);case 15:return Rf(e,t,t.type,t.pendingProps,s);case 19:return Bf(e,t,s);case 31:return Jx(e,t,s);case 22:return Of(e,t,s,t.pendingProps);case 24:return vs(t),i=qt(Rt),e===null?(u=rc(),u===null&&(u=ot,f=ec(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=s),u=f),t.memoizedState={parent:i,cache:u},sc(t),Ba(t,Rt,u)):((e.lanes&s)!==0&&(nc(e,t),$n(t,null,null,s),Vn()),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,Rt,i)):(i=f.cache,Ba(t,Rt,i),i!==u.cache&&Wo(t,[Rt],s,!0))),Ft(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 Ic(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(fp())e.flags|=8192;else throw js=ti,ac}else e.flags&=-16777217}function Hf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!rh(t))if(fp())e.flags|=8192;else throw js=ti,ac}function yi(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?oa():536870912,e.lanes|=t,nn|=t)}function Wn(e,t){if(!Ke)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 Xx(e,t,s){var i=t.pendingProps;switch(Yo(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(Rt),ae(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Vs(t)?va(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Qo())),dt(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(va(t),f!==null?(dt(t),Hf(t,f)):(dt(t),Ic(t,u,null,i,s))):f?f!==e.memoizedState?(va(t),dt(t),Hf(t,f)):(dt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&va(t),dt(t),Ic(t,u,e,i,s)),null;case 27:if(de(t),s=ee.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=P.current,Vs(t)?bm(t):(e=Yp(u,i,s),t.stateNode=e,va(t))}return dt(t),null;case 5:if(de(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=P.current,Vs(t))bm(t);else{var v=Mi(ee.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[yt]=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(Vt(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),Ic(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=ee.current,Vs(t)){if(e=t.stateNode,s=t.memoizedProps,i=null,u=Kt,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[$e]=t,e=!!(e.nodeValue===s||i!==null&&i.suppressHydrationWarning===!0||Up(e.nodeValue,s)),e||_a(t,!0)}else e=Mi(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=Vs(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=Qo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(wr(t),t):(wr(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=Vs(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=Qo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(wr(t),t):(wr(t),null)}return wr(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),yi(t,t.updateQueue),dt(t),null);case 4:return ae(),e===null&&ou(t.stateNode.containerInfo),dt(t),null;case 10:return ga(t.type),dt(t),null;case 19:if(L(kt),i=t.memoizedState,i===null)return dt(t),null;if(u=(t.flags&128)!==0,f=i.rendering,f===null)if(u)Wn(i,!1);else{if(wt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=ni(e),f!==null){for(t.flags|=128,Wn(i,!1),e=f.updateQueue,t.updateQueue=e,yi(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)pm(s,e),s=s.sibling;return z(kt,kt.current&1|2),Ke&&pa(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&tt()>ji&&(t.flags|=128,u=!0,Wn(i,!1),t.lanes=4194304)}else{if(!u)if(e=ni(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,yi(t,e),Wn(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!Ke)return dt(t),null}else 2*tt()-i.renderingStartTime>ji&&s!==536870912&&(t.flags|=128,u=!0,Wn(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=kt.current,z(kt,u?s&1|2:s&1),Ke&&pa(t,i.treeForkCount),e):(dt(t),null);case 22:case 23:return wr(t),cc(),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&&yi(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&&L(ws),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ga(Rt),dt(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Zx(e,t){switch(Yo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ga(Rt),ae(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if(wr(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(wr(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 L(kt),null;case 4:return ae(),null;case 10:return ga(t.type),null;case 22:case 23:return wr(t),cc(),e!==null&&L(ws),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ga(Rt),null;case 25:return null;default:return null}}function Gf(e,t){switch(Yo(t),t.tag){case 3:ga(Rt),ae();break;case 26:case 27:case 5:de(t);break;case 4:ae();break;case 31:t.memoizedState!==null&&wr(t);break;case 13:wr(t);break;case 19:L(kt);break;case 10:ga(t.type);break;case 22:case 23:wr(t),cc(),e!==null&&L(ws);break;case 24:ga(Rt)}}function el(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(C){et(t,t.return,C)}}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,C=v.destroy;if(C!==void 0){v.destroy=void 0,u=t;var _=s,re=C;try{re()}catch(ue){et(u,_,ue)}}}i=i.next}while(i!==f)}}catch(ue){et(t,t.return,ue)}}function Kf(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{zm(t,s)}catch(i){et(e,e.return,i)}}}function qf(e,t,s){s.props=ks(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(i){et(e,t,i)}}function tl(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 Ff(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 Hc(e,t,s){try{var i=e.stateNode;vy(i,e.type,s,t),i[yt]=t}catch(u){et(e,e.return,u)}}function Vf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Za(e.type)||e.tag===4}function Gc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Vf(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 Kc(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(Kc(e,t,s),e=e.sibling;e!==null;)Kc(e,t,s),e=e.sibling}function bi(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(bi(e,t,s),e=e.sibling;e!==null;)bi(e,t,s),e=e.sibling}function $f(e){var t=e.stateNode,s=e.memoizedProps;try{for(var i=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Vt(t,i,s),t[$e]=e,t[yt]=s}catch(f){et(e,e.return,f)}}var wa=!1,Mt=!1,qc=!1,Yf=typeof WeakSet=="function"?WeakSet:Set,Bt=null;function Wx(e,t){if(e=e.containerInfo,du=Ii,e=nm(e),Uo(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,C=-1,_=-1,re=0,ue=0,fe=e,se=null;t:for(;;){for(var ne;fe!==s||u!==0&&fe.nodeType!==3||(C=v+u),fe!==f||i!==0&&fe.nodeType!==3||(_=v+i),fe.nodeType===3&&(v+=fe.nodeValue.length),(ne=fe.firstChild)!==null;)se=fe,fe=ne;for(;;){if(fe===e)break t;if(se===s&&++re===u&&(C=v),se===f&&++ue===i&&(_=v),(ne=fe.nextSibling)!==null)break;fe=se,se=fe.parentNode}fe=ne}s=C===-1||_===-1?null:{start:C,end:_}}else s=null}s=s||{start:0,end:0}}else s=null;for(mu={focusedElem:e,selectionRange:s},Ii=!1,Bt=t;Bt!==null;)if(t=Bt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Bt=e;else for(;Bt!==null;){switch(t=Bt,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 we=ks(s.type,u);e=i.getSnapshotBeforeUpdate(we,f),i.__reactInternalSnapshotBeforeUpdate=e}catch(Re){et(s,s.return,Re)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)hu(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":hu(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,Bt=e;break}Bt=t.return}}function Jf(e,t,s){var i=s.flags;switch(s.tag){case 0:case 11:case 15:ja(e,s),i&4&&el(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&&Kf(s),i&512&&tl(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{zm(e,t)}catch(v){et(s,s.return,v)}}break;case 27:t===null&&i&4&&$f(s);case 26:case 5:ja(e,s),t===null&&i&4&&Ff(s),i&512&&tl(s,s.return);break;case 12:ja(e,s);break;case 31:ja(e,s),i&4&&Zf(e,s);break;case 13:ja(e,s),i&4&&Wf(e,s),i&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=oy.bind(null,s),Ey(e,s))));break;case 22:if(i=s.memoizedState!==null||wa,!i){t=t!==null&&t.memoizedState!==null||Mt,u=wa;var f=Mt;wa=i,(Mt=t)&&!f?Na(e,s,(s.subtreeFlags&8772)!==0):ja(e,s),wa=u,Mt=f}break;case 30:break;default:ja(e,s)}}function Qf(e){var t=e.alternate;t!==null&&(e.alternate=null,Qf(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,or=!1;function Sa(e,t,s){for(s=s.child;s!==null;)Xf(e,t,s),s=s.sibling}function Xf(e,t,s){if(ft&&typeof ft.onCommitFiberUnmount=="function")try{ft.onCommitFiberUnmount(Xt,s)}catch{}switch(s.tag){case 26:Mt||Zr(s,t),Sa(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Mt||Zr(s,t);var i=pt,u=or;Za(s.type)&&(pt=s.stateNode,or=!1),Sa(e,t,s),ul(s.stateNode),pt=i,or=u;break;case 5:Mt||Zr(s,t);case 6:if(i=pt,u=or,pt=null,Sa(e,t,s),pt=i,or=u,pt!==null)if(or)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&&(or?(e=pt,Kp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),pn(e)):Kp(pt,s.stateNode));break;case 4:i=pt,u=or,pt=s.stateNode.containerInfo,or=!0,Sa(e,t,s),pt=i,or=u;break;case 0:case 11:case 14:case 15:Fa(2,s,t),Mt||Fa(4,s,t),Sa(e,t,s);break;case 1:Mt||(Zr(s,t),i=s.stateNode,typeof i.componentWillUnmount=="function"&&qf(s,t,i)),Sa(e,t,s);break;case 21:Sa(e,t,s);break;case 22:Mt=(i=Mt)||s.memoizedState!==null,Sa(e,t,s),Mt=i;break;default:Sa(e,t,s)}}function Zf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{pn(e)}catch(s){et(t,t.return,s)}}}function Wf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{pn(e)}catch(s){et(t,t.return,s)}}function ey(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Yf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Yf),t;default:throw Error(o(435,e.tag))}}function vi(e,t){var s=ey(e);t.forEach(function(i){if(!s.has(i)){s.add(i);var u=cy.bind(null,e,i);i.then(u,u)}})}function cr(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,C=v;e:for(;C!==null;){switch(C.tag){case 27:if(Za(C.type)){pt=C.stateNode,or=!1;break e}break;case 5:pt=C.stateNode,or=!1;break e;case 3:case 4:pt=C.stateNode.containerInfo,or=!0;break e}C=C.return}if(pt===null)throw Error(o(160));Xf(f,v,u),pt=null,or=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ep(t,e),t=t.sibling}var Gr=null;function ep(e,t){var s=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:cr(t,e),ur(e),i&4&&(Fa(3,e,e.return),el(3,e),Fa(5,e,e.return));break;case 1:cr(t,e),ur(e),i&512&&(Mt||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(cr(t,e),ur(e),i&512&&(Mt||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"))),Vt(f,i,s),f[$e]=e,Ct(f),i=f;break e;case"link":var v=eh("link","href",u).get(i+(s.href||""));if(v){for(var C=0;C<v.length;C++)if(f=v[C],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(C,1);break t}}f=u.createElement(i),Vt(f,i,s),u.head.appendChild(f);break;case"meta":if(v=eh("meta","content",u).get(i+(s.content||""))){for(C=0;C<v.length;C++)if(f=v[C],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(C,1);break t}}f=u.createElement(i),Vt(f,i,s),u.head.appendChild(f);break;default:throw Error(o(468,i))}f[$e]=e,Ct(f),i=f}e.stateNode=i}else th(u,e.type,e.stateNode);else e.stateNode=Wp(u,i,e.memoizedProps);else f!==i?(f===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):f.count--,i===null?th(u,e.type,e.stateNode):Wp(u,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Hc(e,e.memoizedProps,s.memoizedProps)}break;case 27:cr(t,e),ur(e),i&512&&(Mt||s===null||Zr(s,s.return)),s!==null&&i&4&&Hc(e,e.memoizedProps,s.memoizedProps);break;case 5:if(cr(t,e),ur(e),i&512&&(Mt||s===null||Zr(s,s.return)),e.flags&32){u=e.stateNode;try{Ps(u,"")}catch(we){et(e,e.return,we)}}i&4&&e.stateNode!=null&&(u=e.memoizedProps,Hc(e,u,s!==null?s.memoizedProps:u)),i&1024&&(qc=!0);break;case 6:if(cr(t,e),ur(e),i&4){if(e.stateNode===null)throw Error(o(162));i=e.memoizedProps,s=e.stateNode;try{s.nodeValue=i}catch(we){et(e,e.return,we)}}break;case 3:if(Pi=null,u=Gr,Gr=Li(t.containerInfo),cr(t,e),Gr=u,ur(e),i&4&&s!==null&&s.memoizedState.isDehydrated)try{pn(t.containerInfo)}catch(we){et(e,e.return,we)}qc&&(qc=!1,tp(e));break;case 4:i=Gr,Gr=Li(e.stateNode.containerInfo),cr(t,e),ur(e),Gr=i;break;case 12:cr(t,e),ur(e);break;case 31:cr(t,e),ur(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,vi(e,i)));break;case 13:cr(t,e),ur(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Si=tt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,vi(e,i)));break;case 22:u=e.memoizedState!==null;var _=s!==null&&s.memoizedState!==null,re=wa,ue=Mt;if(wa=re||u,Mt=ue||_,cr(t,e),Mt=ue,wa=re,ur(e),i&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(s===null||_||wa||Mt||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{C=_.stateNode;var fe=_.memoizedProps.style,se=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;C.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(we){et(_,_.return,we)}}}else if(t.tag===6){if(s===null){_=t;try{_.stateNode.nodeValue=u?"":_.memoizedProps}catch(we){et(_,_.return,we)}}}else if(t.tag===18){if(s===null){_=t;try{var ne=_.stateNode;u?qp(ne,!0):qp(_.stateNode,!1)}catch(we){et(_,_.return,we)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;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,vi(e,s))));break;case 19:cr(t,e),ur(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,vi(e,i)));break;case 30:break;case 21:break;default:cr(t,e),ur(e)}}function ur(e){var t=e.flags;if(t&2){try{for(var s,i=e.return;i!==null;){if(Vf(i)){s=i;break}i=i.return}if(s==null)throw Error(o(160));switch(s.tag){case 27:var u=s.stateNode,f=Gc(e);bi(e,f,u);break;case 5:var v=s.stateNode;s.flags&32&&(Ps(v,""),s.flags&=-33);var C=Gc(e);bi(e,C,v);break;case 3:case 4:var _=s.stateNode.containerInfo,re=Gc(e);Kc(e,re,_);break;default:throw Error(o(161))}}catch(ue){et(e,e.return,ue)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function tp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;tp(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;)Jf(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"&&qf(t,t.return,s),As(t);break;case 27:ul(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),el(4,f);break;case 1:if(Na(u,f,s),i=f,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(re){et(i,i.return,re)}if(i=f,u=i.updateQueue,u!==null){var C=i.stateNode;try{var _=u.shared.hiddenCallbacks;if(_!==null)for(u.shared.hiddenCallbacks=null,u=0;u<_.length;u++)Om(_[u],C)}catch(re){et(i,i.return,re)}}s&&v&64&&Kf(f),tl(f,f.return);break;case 27:$f(f);case 26:case 5:Na(u,f,s),s&&i===null&&v&4&&Ff(f),tl(f,f.return);break;case 12:Na(u,f,s);break;case 31:Na(u,f,s),s&&v&4&&Zf(u,f);break;case 13:Na(u,f,s),s&&v&4&&Wf(u,f);break;case 22:f.memoizedState===null&&Na(u,f,s),tl(f,f.return);break;case 30:break;default:Na(u,f,s)}t=t.sibling}}function Fc(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&&Hn(s))}function Vc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Hn(e))}function Kr(e,t,s,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)rp(e,t,s,i),t=t.sibling}function rp(e,t,s,i){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Kr(e,t,s,i),u&2048&&el(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&&Hn(e)));break;case 12:if(u&2048){Kr(e,t,s,i),e=t.stateNode;try{var f=t.memoizedProps,v=f.id,C=f.onPostCommit;typeof C=="function"&&C(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):rl(e,t):f._visibility&2?Kr(e,t,s,i):(f._visibility|=2,rn(e,t,s,i,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Fc(v,t);break;case 24:Kr(e,t,s,i),u&2048&&Vc(t.alternate,t);break;default:Kr(e,t,s,i)}}function rn(e,t,s,i,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,v=t,C=s,_=i,re=v.flags;switch(v.tag){case 0:case 11:case 15:rn(f,v,C,_,u),el(8,v);break;case 23:break;case 22:var ue=v.stateNode;v.memoizedState!==null?ue._visibility&2?rn(f,v,C,_,u):rl(f,v):(ue._visibility|=2,rn(f,v,C,_,u)),u&&re&2048&&Fc(v.alternate,v);break;case 24:rn(f,v,C,_,u),u&&re&2048&&Vc(v.alternate,v);break;default:rn(f,v,C,_,u)}t=t.sibling}}function rl(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:rl(s,i),u&2048&&Fc(i.alternate,i);break;case 24:rl(s,i),u&2048&&Vc(i.alternate,i);break;default:rl(s,i)}t=t.sibling}}var al=8192;function an(e,t,s){if(e.subtreeFlags&al)for(e=e.child;e!==null;)ap(e,t,s),e=e.sibling}function ap(e,t,s){switch(e.tag){case 26:an(e,t,s),e.flags&al&&e.memoizedState!==null&&Iy(s,Gr,e.memoizedState,e.memoizedProps);break;case 5:an(e,t,s);break;case 3:case 4:var i=Gr;Gr=Li(e.stateNode.containerInfo),an(e,t,s),Gr=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=al,al=16777216,an(e,t,s),al=i):an(e,t,s));break;default:an(e,t,s)}}function sp(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 sl(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];Bt=i,lp(i,e)}sp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)np(e),e=e.sibling}function np(e){switch(e.tag){case 0:case 11:case 15:sl(e),e.flags&2048&&Fa(9,e,e.return);break;case 3:sl(e);break;case 12:sl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,wi(e)):sl(e);break;default:sl(e)}}function wi(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];Bt=i,lp(i,e)}sp(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Fa(8,t,t.return),wi(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,wi(t));break;default:wi(t)}e=e.sibling}}function lp(e,t){for(;Bt!==null;){var s=Bt;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:Hn(s.memoizedState.cache)}if(i=s.child,i!==null)i.return=s,Bt=i;else e:for(s=e;Bt!==null;){i=Bt;var u=i.sibling,f=i.return;if(Qf(i),i===s){Bt=null;break e}if(u!==null){u.return=f,Bt=u;break e}Bt=f}}}var ty={getCacheForType:function(e){var t=qt(Rt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return qt(Rt).controller.signal}},ry=typeof WeakMap=="function"?WeakMap:Map,Qe=0,ot=null,Be=null,He=0,We=0,Sr=null,Va=!1,sn=!1,$c=!1,Ca=0,wt=0,$a=0,Es=0,Yc=0,jr=0,nn=0,nl=null,dr=null,Jc=!1,Si=0,ip=0,ji=1/0,Ni=null,Ya=null,Dt=0,Ja=null,ln=null,ka=0,Qc=0,Xc=null,op=null,ll=0,Zc=null;function Nr(){return(Qe&2)!==0&&He!==0?He&-He:N.T!==null?su():ds()}function cp(){if(jr===0)if((He&536870912)===0||Ke){var e=hr;hr<<=1,(hr&3932160)===0&&(hr=262144),jr=e}else jr=536870912;return e=vr.current,e!==null&&(e.flags|=32),jr}function mr(e,t,s){(e===ot&&(We===2||We===9)||e.cancelPendingCommit!==null)&&(on(e,0),Qa(e,He,jr,!1)),Ve(e,s),((Qe&2)===0||e!==ot)&&(e===ot&&((Qe&2)===0&&(Es|=s),wt===4&&Qa(e,He,jr,!1)),Wr(e))}function up(e,t,s){if((Qe&6)!==0)throw Error(o(327));var i=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Nt(e,t),u=i?ny(e,t):eu(e,t,!0),f=i;do{if(u===0){sn&&!i&&Qa(e,t,0,!1);break}else{if(s=e.current.alternate,f&&!ay(s)){u=eu(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 C=e;u=nl;var _=C.current.memoizedState.isDehydrated;if(_&&(on(C,v).flags|=256),v=eu(C,v,!1),v!==2){if($c&&!_){C.errorRecoveryDisabledLanes|=f,Es|=f,u=4;break e}f=dr,dr=u,f!==null&&(dr===null?dr=f:dr.push.apply(dr,f))}u=v}if(f=!1,u!==2)continue}}if(u===1){on(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,jr,!Va);break e;case 2:dr=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(u=Si+300-tt(),10<u)){if(Qa(i,t,jr,!Va),Fe(i,0,!0)!==0)break e;ka=t,i.timeoutHandle=Hp(dp.bind(null,i,s,dr,Ni,Jc,t,jr,Es,nn,Va,f,"Throttled",-0,0),u);break e}dp(i,s,dr,Ni,Jc,t,jr,Es,nn,Va,f,null,-0,0)}}break}while(!0);Wr(e)}function dp(e,t,s,i,u,f,v,C,_,re,ue,fe,se,ne){if(e.timeoutHandle=-1,fe=t.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:da},ap(t,f,fe);var we=(f&62914560)===f?Si-tt():(f&4194048)===f?ip-tt():0;if(we=Hy(fe,we),we!==null){ka=f,e.cancelPendingCommit=we(bp.bind(null,e,t,f,s,i,u,v,C,_,ue,fe,null,se,ne)),Qa(e,f,v,!re);return}}bp(e,t,f,s,i,u,v,C,_)}function ay(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(!yr(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&=~Yc,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 Ci(){return(Qe&6)===0?(il(0),!1):!0}function Wc(){if(Be!==null){if(We===0)var e=Be.return;else e=Be,ha=bs=null,hc(e),Xs=null,Kn=0,e=Be;for(;e!==null;)Gf(e.alternate,e),e=e.return;Be=null}}function on(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,jy(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),ka=0,Wc(),ot=e,Be=s=fa(e.current,null),He=t,We=0,Sr=null,Va=!1,sn=Nt(e,t),$c=!1,nn=jr=Yc=Es=$a=wt=0,dr=nl=null,Jc=!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,Vl(),s}function mp(e,t){Le=null,N.H=Xn,t===Qs||t===ei?(t=Am(),We=3):t===ac?(t=Am(),We=4):We=t===Oc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Sr=t,Be===null&&(wt=1,pi(e,Or(t,e.current)))}function fp(){var e=vr.current;return e===null?!0:(He&4194048)===He?Dr===null:(He&62914560)===He||(He&536870912)!==0?e===Dr:!1}function pp(){var e=N.H;return N.H=Xn,e===null?Xn:e}function hp(){var e=N.A;return N.A=ty,e}function ki(){wt=4,Va||(He&4194048)!==He&&vr.current!==null||(sn=!0),($a&134217727)===0&&(Es&134217727)===0||ot===null||Qa(ot,He,jr,!1)}function eu(e,t,s){var i=Qe;Qe|=2;var u=pp(),f=hp();(ot!==e||He!==t)&&(Ni=null,on(e,t)),t=!1;var v=wt;e:do try{if(We!==0&&Be!==null){var C=Be,_=Sr;switch(We){case 8:Wc(),v=6;break e;case 3:case 2:case 9:case 6:vr.current===null&&(t=!0);var re=We;if(We=0,Sr=null,cn(e,C,_,re),s&&sn){v=0;break e}break;default:re=We,We=0,Sr=null,cn(e,C,_,re)}}sy(),v=wt;break}catch(ue){mp(e,ue)}while(!0);return t&&e.shellSuspendCounter++,ha=bs=null,Qe=i,N.H=u,N.A=f,Be===null&&(ot=null,He=0,Vl()),v}function sy(){for(;Be!==null;)gp(Be)}function ny(e,t){var s=Qe;Qe|=2;var i=pp(),u=hp();ot!==e||He!==t?(Ni=null,ji=tt()+500,on(e,t)):sn=Nt(e,t);e:do try{if(We!==0&&Be!==null){t=Be;var f=Sr;t:switch(We){case 1:We=0,Sr=null,cn(e,t,f,1);break;case 2:case 9:if(Cm(f)){We=0,Sr=null,xp(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:Cm(f)?(We=0,Sr=null,xp(t)):(We=0,Sr=null,cn(e,t,f,7));break;case 5:var v=null;switch(Be.tag){case 26:v=Be.memoizedState;case 5:case 27:var C=Be;if(v?rh(v):C.stateNode.complete){We=0,Sr=null;var _=C.sibling;if(_!==null)Be=_;else{var re=C.return;re!==null?(Be=re,Ai(re)):Be=null}break t}}We=0,Sr=null,cn(e,t,f,5);break;case 6:We=0,Sr=null,cn(e,t,f,6);break;case 8:Wc(),wt=6;break e;default:throw Error(o(462))}}ly();break}catch(ue){mp(e,ue)}while(!0);return ha=bs=null,N.H=i,N.A=u,Qe=s,Be!==null?0:(ot=null,He=0,Vl(),wt)}function ly(){for(;Be!==null&&!Ht();)gp(Be)}function gp(e){var t=If(e.alternate,e,Ca);e.memoizedProps=e.pendingProps,t===null?Ai(e):Be=t}function xp(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=Lf(s,t,t.pendingProps,t.type,void 0,He);break;case 11:t=Lf(s,t,t.pendingProps,t.type.render,t.ref,He);break;case 5:hc(t);default:Gf(s,t),t=Be=pm(t,Ca),t=If(s,t,Ca)}e.memoizedProps=e.pendingProps,t===null?Ai(e):Be=t}function cn(e,t,s,i){ha=bs=null,hc(t),Xs=null,Kn=0;var u=t.return;try{if(Yx(e,u,t,s,He)){wt=1,pi(e,Or(s,e.current)),Be=null;return}}catch(f){if(u!==null)throw Be=u,f;wt=1,pi(e,Or(s,e.current)),Be=null;return}t.flags&32768?(Ke||i===1?e=!0:sn||(He&536870912)!==0?e=!1:(Va=e=!0,(i===2||i===9||i===3||i===6)&&(i=vr.current,i!==null&&i.tag===13&&(i.flags|=16384))),yp(t,e)):Ai(t)}function Ai(e){var t=e;do{if((t.flags&32768)!==0){yp(t,Va);return}e=t.return;var s=Xx(t.alternate,t,Ca);if(s!==null){Be=s;return}if(t=t.sibling,t!==null){Be=t;return}Be=t=e}while(t!==null);wt===0&&(wt=5)}function yp(e,t){do{var s=Zx(e.alternate,e);if(s!==null){s.flags&=32767,Be=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){Be=e;return}Be=e=s}while(e!==null);wt=6,Be=null}function bp(e,t,s,i,u,f,v,C,_){e.cancelPendingCommit=null;do Ei();while(Dt!==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|=Go,it(e,s,f,v,C,_),e===ot&&(Be=ot=null,He=0),ln=t,Ja=e,ka=s,Qc=f,Xc=u,op=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,uy(jt,function(){return Np(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=N.T,N.T=null,u=H.p,H.p=2,v=Qe,Qe|=4;try{Wx(e,t,s)}finally{Qe=v,H.p=u,N.T=i}}Dt=1,vp(),wp(),Sp()}}function vp(){if(Dt===1){Dt=0;var e=Ja,t=ln,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=N.T,N.T=null;var i=H.p;H.p=2;var u=Qe;Qe|=4;try{ep(t,e);var f=mu,v=nm(e.containerInfo),C=f.focusedElem,_=f.selectionRange;if(v!==C&&C&&C.ownerDocument&&sm(C.ownerDocument.documentElement,C)){if(_!==null&&Uo(C)){var re=_.start,ue=_.end;if(ue===void 0&&(ue=re),"selectionStart"in C)C.selectionStart=re,C.selectionEnd=Math.min(ue,C.value.length);else{var fe=C.ownerDocument||document,se=fe&&fe.defaultView||window;if(se.getSelection){var ne=se.getSelection(),we=C.textContent.length,Re=Math.min(_.start,we),st=_.end===void 0?Re:Math.min(_.end,we);!ne.extend&&Re>st&&(v=st,st=Re,Re=v);var J=am(C,Re),F=am(C,st);if(J&&F&&(ne.rangeCount!==1||ne.anchorNode!==J.node||ne.anchorOffset!==J.offset||ne.focusNode!==F.node||ne.focusOffset!==F.offset)){var te=fe.createRange();te.setStart(J.node,J.offset),ne.removeAllRanges(),Re>st?(ne.addRange(te),ne.extend(F.node,F.offset)):(te.setEnd(F.node,F.offset),ne.addRange(te))}}}}for(fe=[],ne=C;ne=ne.parentNode;)ne.nodeType===1&&fe.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<fe.length;C++){var me=fe[C];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}Ii=!!du,mu=du=null}finally{Qe=u,H.p=i,N.T=s}}e.current=t,Dt=2}}function wp(){if(Dt===2){Dt=0;var e=Ja,t=ln,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=N.T,N.T=null;var i=H.p;H.p=2;var u=Qe;Qe|=4;try{Jf(e,t.alternate,t)}finally{Qe=u,H.p=i,N.T=s}}Dt=3}}function Sp(){if(Dt===4||Dt===3){Dt=0,fr();var e=Ja,t=ln,s=ka,i=op;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Dt=5:(Dt=0,ln=Ja=null,jp(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(Xt,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=N.T,u=H.p,H.p=2,N.T=null;try{for(var f=e.onRecoverableError,v=0;v<i.length;v++){var C=i[v];f(C.value,{componentStack:C.stack})}}finally{N.T=t,H.p=u}}(ka&3)!==0&&Ei(),Wr(e),u=e.pendingLanes,(s&261930)!==0&&(u&42)!==0?e===Zc?ll++:(ll=0,Zc=e):ll=0,il(0)}}function jp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Hn(t)))}function Ei(){return vp(),wp(),Sp(),Np()}function Np(){if(Dt!==5)return!1;var e=Ja,t=Qc;Qc=0;var s=Yr(ka),i=N.T,u=H.p;try{H.p=32>s?32:s,N.T=null,s=Xc,Xc=null;var f=Ja,v=ka;if(Dt=0,ln=Ja=null,ka=0,(Qe&6)!==0)throw Error(o(331));var C=Qe;if(Qe|=4,np(f.current),rp(f,f.current,v,s),Qe=C,il(0,!1),ft&&typeof ft.onPostCommitFiberRoot=="function")try{ft.onPostCommitFiberRoot(Xt,f)}catch{}return!0}finally{H.p=u,N.T=i,jp(e,t)}}function Cp(e,t,s){t=Or(s,t),t=Rc(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)Cp(e,e,s);else for(;t!==null;){if(t.tag===3){Cp(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=kf(2),i=Ga(t,s,2),i!==null&&(Af(s,i,t,e),Ve(i,2),Wr(i));break}}t=t.return}}function tu(e,t,s){var i=e.pingCache;if(i===null){i=e.pingCache=new ry;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)||($c=!0,u.add(s),e=iy.bind(null,e,t,s),t.then(e,e))}function iy(e,t,s){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,ot===e&&(He&s)===s&&(wt===4||wt===3&&(He&62914560)===He&&300>tt()-Si?(Qe&2)===0&&on(e,0):Yc|=s,nn===He&&(nn=0)),Wr(e)}function kp(e,t){t===0&&(t=oa()),e=gs(e,t),e!==null&&(Ve(e,t),Wr(e))}function oy(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),kp(e,s)}function cy(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),kp(e,s)}function uy(e,t){return _t(e,t)}var Ti=null,un=null,ru=!1,Ri=!1,au=!1,Xa=0;function Wr(e){e!==un&&e.next===null&&(un===null?Ti=un=e:un=un.next=e),Ri=!0,ru||(ru=!0,my())}function il(e,t){if(!au&&Ri){au=!0;do for(var s=!1,i=Ti;i!==null;){if(e!==0){var u=i.pendingLanes;if(u===0)var f=0;else{var v=i.suspendedLanes,C=i.pingedLanes;f=(1<<31-xt(42|e)+1)-1,f&=u&~(v&~C),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(s=!0,Rp(i,f))}else f=He,f=Fe(i,i===ot?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||Nt(i,f)||(s=!0,Rp(i,f));i=i.next}while(s);au=!1}}function dy(){Ap()}function Ap(){Ri=ru=!1;var e=0;Xa!==0&&Sy()&&(e=Xa);for(var t=tt(),s=null,i=Ti;i!==null;){var u=i.next,f=Ep(i,t);f===0?(i.next=null,s===null?Ti=u:s.next=u,u===null&&(un=s)):(s=i,(e!==0||(f&3)!==0)&&(Ri=!0)),i=u}Dt!==0&&Dt!==5||il(e),Xa!==0&&(Xa=0)}function Ep(e,t){for(var s=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var v=31-xt(f),C=1<<v,_=u[v];_===-1?((C&s)===0||(C&i)!==0)&&(u[v]=Vr(C,t)):_<=t&&(e.expiredLanes|=C),f&=~C}if(t=ot,s=He,s=Fe(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&&Qt(i),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Nt(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(i!==null&&Qt(i),Yr(s)){case 2:case 8:s=ze;break;case 32:s=jt;break;case 268435456:s=nt;break;default:s=jt}return i=Tp.bind(null,e),s=_t(s,i),e.callbackPriority=t,e.callbackNode=s,t}return i!==null&&i!==null&&Qt(i),e.callbackPriority=2,e.callbackNode=null,2}function Tp(e,t){if(Dt!==0&&Dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(Ei()&&e.callbackNode!==s)return null;var i=He;return i=Fe(e,e===ot?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(up(e,i,t),Ep(e,tt()),e.callbackNode!=null&&e.callbackNode===s?Tp.bind(null,e):null)}function Rp(e,t){if(Ei())return null;up(e,t,!0)}function my(){Ny(function(){(Qe&6)!==0?_t(lr,dy):Ap()})}function su(){if(Xa===0){var e=Ys;e===0&&(e=pr,pr<<=1,(pr&261888)===0&&(pr=256)),Xa=e}return Xa}function Op(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:_l(""+e)}function zp(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 fy(e,t,s,i,u){if(t==="submit"&&s&&s.stateNode===u){var f=Op((u[yt]||null).action),v=i.submitter;v&&(t=(t=v[yt]||null)?Op(t.formAction):v.getAttribute("formAction"),t!==null&&(f=t,v=null));var C=new Gl("action","action",null,i,u);e.push({event:C,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Xa!==0){var _=v?zp(u,v):new FormData(u);Nc(s,{pending:!0,data:_,method:u.method,action:f},null,_)}}else typeof f=="function"&&(C.preventDefault(),_=v?zp(u,v):new FormData(u),Nc(s,{pending:!0,data:_,method:u.method,action:f},f,_))},currentTarget:u}]})}}for(var nu=0;nu<Ho.length;nu++){var lu=Ho[nu],py=lu.toLowerCase(),hy=lu[0].toUpperCase()+lu.slice(1);Hr(py,"on"+hy)}Hr(om,"onAnimationEnd"),Hr(cm,"onAnimationIteration"),Hr(um,"onAnimationStart"),Hr("dblclick","onDoubleClick"),Hr("focusin","onFocus"),Hr("focusout","onBlur"),Hr(Ox,"onTransitionRun"),Hr(zx,"onTransitionStart"),Hr(Mx,"onTransitionCancel"),Hr(dm,"onTransitionEnd"),Ls("onMouseEnter",["mouseout","mouseover"]),Ls("onMouseLeave",["mouseout","mouseover"]),Ls("onPointerEnter",["pointerout","pointerover"]),Ls("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 ol="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(" "),gy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ol));function Mp(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 C=i[v],_=C.instance,re=C.currentTarget;if(C=C.listener,_!==f&&u.isPropagationStopped())break e;f=C,u.currentTarget=re;try{f(u)}catch(ue){Fl(ue)}u.currentTarget=null,f=_}else for(v=0;v<i.length;v++){if(C=i[v],_=C.instance,re=C.currentTarget,C=C.listener,_!==f&&u.isPropagationStopped())break e;f=C,u.currentTarget=re;try{f(u)}catch(ue){Fl(ue)}u.currentTarget=null,f=_}}}}function Ie(e,t){var s=t[Ee];s===void 0&&(s=t[Ee]=new Set);var i=e+"__bubble";s.has(i)||(Lp(t,e,2,!1),s.add(i))}function iu(e,t,s){var i=0;t&&(i|=4),Lp(s,e,i,t)}var Oi="_reactListening"+Math.random().toString(36).slice(2);function ou(e){if(!e[Oi]){e[Oi]=!0,Ms.forEach(function(s){s!=="selectionchange"&&(gy.has(s)||iu(s,!1,e),iu(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Oi]||(t[Oi]=!0,iu("selectionchange",!1,t))}}function Lp(e,t,s,i){switch(ch(t)){case 2:var u=qy;break;case 8:u=Fy;break;default:u=ju}s=u.bind(null,t,s,e),u=void 0,!Eo||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 cu(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 C=i.stateNode.containerInfo;if(C===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(;C!==null;){if(v=gr(C),v===null)return;if(_=v.tag,_===5||_===6||_===26||_===27){i=f=v;continue e}C=C.parentNode}}i=i.return}_d(function(){var re=f,ue=ko(s),fe=[];e:{var se=mm.get(e);if(se!==void 0){var ne=Gl,we=e;switch(e){case"keypress":if(Il(s)===0)break e;case"keydown":case"keyup":ne=cx;break;case"focusin":we="focus",ne=zo;break;case"focusout":we="blur",ne=zo;break;case"beforeblur":case"afterblur":ne=zo;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=Hd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=X0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=mx;break;case om:case cm:case um:ne=ex;break;case dm:ne=px;break;case"scroll":case"scrollend":ne=J0;break;case"wheel":ne=gx;break;case"copy":case"cut":case"paste":ne=rx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=Kd;break;case"toggle":case"beforetoggle":ne=yx}var Re=(t&4)!==0,st=!Re&&(e==="scroll"||e==="scrollend"),J=Re?se!==null?se+"Capture":null:se;Re=[];for(var F=re,te;F!==null;){var me=F;if(te=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||te===null||J===null||(me=Rn(F,J),me!=null&&Re.push(cl(F,me,te))),st)break;F=F.return}0<Re.length&&(se=new ne(se,we,null,s,ue),fe.push({event:se,listeners:Re}))}}if((t&7)===0){e:{if(se=e==="mouseover"||e==="pointerover",ne=e==="mouseout"||e==="pointerout",se&&s!==Co&&(we=s.relatedTarget||s.fromElement)&&(gr(we)||we[Gt]))break e;if((ne||se)&&(se=ue.window===ue?ue:(se=ue.ownerDocument)?se.defaultView||se.parentWindow:window,ne?(we=s.relatedTarget||s.toElement,ne=re,we=we?gr(we):null,we!==null&&(st=d(we),Re=we.tag,we!==st||Re!==5&&Re!==27&&Re!==6)&&(we=null)):(ne=null,we=re),ne!==we)){if(Re=Hd,me="onMouseLeave",J="onMouseEnter",F="mouse",(e==="pointerout"||e==="pointerover")&&(Re=Kd,me="onPointerLeave",J="onPointerEnter",F="pointer"),st=ne==null?se:Ar(ne),te=we==null?se:Ar(we),se=new Re(me,F+"leave",ne,s,ue),se.target=st,se.relatedTarget=te,me=null,gr(ue)===re&&(Re=new Re(J,F+"enter",we,s,ue),Re.target=te,Re.relatedTarget=st,me=Re),st=me,ne&&we)t:{for(Re=xy,J=ne,F=we,te=0,me=J;me;me=Re(me))te++;me=0;for(var Ae=F;Ae;Ae=Re(Ae))me++;for(;0<te-me;)J=Re(J),te--;for(;0<me-te;)F=Re(F),me--;for(;te--;){if(J===F||F!==null&&J===F.alternate){Re=J;break t}J=Re(J),F=Re(F)}Re=null}else Re=null;ne!==null&&Dp(fe,se,ne,Re,!1),we!==null&&st!==null&&Dp(fe,st,we,Re,!0)}}e:{if(se=re?Ar(re):window,ne=se.nodeName&&se.nodeName.toLowerCase(),ne==="select"||ne==="input"&&se.type==="file")var Ye=Xd;else if(Jd(se))if(Zd)Ye=Ex;else{Ye=kx;var ke=Cx}else ne=se.nodeName,!ne||ne.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?re&&No(re.elementType)&&(Ye=Xd):Ye=Ax;if(Ye&&(Ye=Ye(e,re))){Qd(fe,Ye,s,ue);break e}ke&&ke(e,se,re),e==="focusout"&&re&&se.type==="number"&&re.memoizedProps.value!=null&&jo(se,"number",se.value)}switch(ke=re?Ar(re):window,e){case"focusin":(Jd(ke)||ke.contentEditable==="true")&&(Is=ke,_o=re,_n=null);break;case"focusout":_n=_o=Is=null;break;case"mousedown":Bo=!0;break;case"contextmenu":case"mouseup":case"dragend":Bo=!1,lm(fe,s,ue);break;case"selectionchange":if(Rx)break;case"keydown":case"keyup":lm(fe,s,ue)}var De;if(Lo)e:{switch(e){case"compositionstart":var Ge="onCompositionStart";break e;case"compositionend":Ge="onCompositionEnd";break e;case"compositionupdate":Ge="onCompositionUpdate";break e}Ge=void 0}else Bs?$d(e,s)&&(Ge="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Ge="onCompositionStart");Ge&&(qd&&s.locale!=="ko"&&(Bs||Ge!=="onCompositionStart"?Ge==="onCompositionEnd"&&Bs&&(De=Bd()):(Da=ue,To="value"in Da?Da.value:Da.textContent,Bs=!0)),ke=zi(re,Ge),0<ke.length&&(Ge=new Gd(Ge,e,null,s,ue),fe.push({event:Ge,listeners:ke}),De?Ge.data=De:(De=Yd(s),De!==null&&(Ge.data=De)))),(De=vx?wx(e,s):Sx(e,s))&&(Ge=zi(re,"onBeforeInput"),0<Ge.length&&(ke=new Gd("onBeforeInput","beforeinput",null,s,ue),fe.push({event:ke,listeners:Ge}),ke.data=De)),fy(fe,e,re,s,ue)}Mp(fe,t)})}function cl(e,t,s){return{instance:e,listener:t,currentTarget:s}}function zi(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=Rn(e,s),u!=null&&i.unshift(cl(e,u,f)),u=Rn(e,t),u!=null&&i.push(cl(e,u,f))),e.tag===3)return i;e=e.return}return[]}function xy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dp(e,t,s,i,u){for(var f=t._reactName,v=[];s!==null&&s!==i;){var C=s,_=C.alternate,re=C.stateNode;if(C=C.tag,_!==null&&_===i)break;C!==5&&C!==26&&C!==27||re===null||(_=re,u?(re=Rn(s,f),re!=null&&v.unshift(cl(s,re,_))):u||(re=Rn(s,f),re!=null&&v.push(cl(s,re,_)))),s=s.return}v.length!==0&&e.push({event:t,listeners:v})}var yy=/\r\n?/g,by=/\u0000|\uFFFD/g;function Pp(e){return(typeof e=="string"?e:""+e).replace(yy,`
|
|
49
|
-
`).replace(by,"")}function Up(e,t){return t=Pp(t),Pp(e)===t}function at(e,t,s,i,u,f){switch(s){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||Ps(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&Ps(e,""+i);break;case"className":Pl(e,"class",i);break;case"tabIndex":Pl(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Pl(e,s,i);break;case"style":Pd(e,i,f);break;case"data":if(t!=="object"){Pl(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=_l(""+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=_l(""+i),e.setAttribute(s,i);break;case"onClick":i!=null&&(e.onclick=da);break;case"onScroll":i!=null&&Ie("scroll",e);break;case"onScrollEnd":i!=null&&Ie("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=_l(""+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":Ie("beforetoggle",e),Ie("toggle",e),Dl(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":Dl(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=$0.get(s)||s,Dl(e,s,i))}}function uu(e,t,s,i,u,f){switch(s){case"style":Pd(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"?Ps(e,i):(typeof i=="number"||typeof i=="bigint")&&Ps(e,""+i);break;case"onScroll":i!=null&&Ie("scroll",e);break;case"onScrollEnd":i!=null&&Ie("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(!Ad.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[yt]||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,""):Dl(e,s,i)}}}function Vt(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ie("error",e),Ie("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":Ie("invalid",e);var C=f=v=u=null,_=null,re=null;for(i in s)if(s.hasOwnProperty(i)){var ue=s[i];if(ue!=null)switch(i){case"name":u=ue;break;case"type":v=ue;break;case"checked":_=ue;break;case"defaultChecked":re=ue;break;case"value":f=ue;break;case"defaultValue":C=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(o(137,t));break;default:at(e,t,i,ue,s,null)}}zd(e,f,C,_,re,v,u,!1);return;case"select":Ie("invalid",e),i=v=f=null;for(u in s)if(s.hasOwnProperty(u)&&(C=s[u],C!=null))switch(u){case"value":f=C;break;case"defaultValue":v=C;break;case"multiple":i=C;default:at(e,t,u,C,s,null)}t=f,s=v,e.multiple=!!i,t!=null?Ds(e,!!i,t,!1):s!=null&&Ds(e,!!i,s,!0);return;case"textarea":Ie("invalid",e),f=u=i=null;for(v in s)if(s.hasOwnProperty(v)&&(C=s[v],C!=null))switch(v){case"value":i=C;break;case"defaultValue":u=C;break;case"children":f=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(o(91));break;default:at(e,t,v,C,s,null)}Ld(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":Ie("beforetoggle",e),Ie("toggle",e),Ie("cancel",e),Ie("close",e);break;case"iframe":case"object":Ie("load",e);break;case"video":case"audio":for(i=0;i<ol.length;i++)Ie(ol[i],e);break;case"image":Ie("error",e),Ie("load",e);break;case"details":Ie("toggle",e);break;case"embed":case"source":case"link":Ie("error",e),Ie("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(re in s)if(s.hasOwnProperty(re)&&(i=s[re],i!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:at(e,t,re,i,s,null)}return;default:if(No(t)){for(ue in s)s.hasOwnProperty(ue)&&(i=s[ue],i!==void 0&&uu(e,t,ue,i,s,void 0));return}}for(C in s)s.hasOwnProperty(C)&&(i=s[C],i!=null&&at(e,t,C,i,s,null))}function vy(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,C=null,_=null,re=null,ue=null;for(ne in s){var fe=s[ne];if(s.hasOwnProperty(ne)&&fe!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":_=fe;default:i.hasOwnProperty(ne)||at(e,t,ne,null,i,fe)}}for(var se in i){var ne=i[se];if(fe=s[se],i.hasOwnProperty(se)&&(ne!=null||fe!=null))switch(se){case"type":f=ne;break;case"name":u=ne;break;case"checked":re=ne;break;case"defaultChecked":ue=ne;break;case"value":v=ne;break;case"defaultValue":C=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(o(137,t));break;default:ne!==fe&&at(e,t,se,ne,i,fe)}}So(e,v,C,_,re,ue,f,u);return;case"select":ne=v=C=se=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":se=f;break;case"defaultValue":C=f;break;case"multiple":v=f;default:f!==_&&at(e,t,u,f,i,_)}t=C,s=v,i=ne,se!=null?Ds(e,!!s,se,!1):!!i!=!!s&&(t!=null?Ds(e,!!s,t,!0):Ds(e,!!s,s?[]:"",!1));return;case"textarea":ne=se=null;for(C in s)if(u=s[C],s.hasOwnProperty(C)&&u!=null&&!i.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:at(e,t,C,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":se=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)}Md(e,se,ne);return;case"option":for(var we in s)if(se=s[we],s.hasOwnProperty(we)&&se!=null&&!i.hasOwnProperty(we))switch(we){case"selected":e.selected=!1;break;default:at(e,t,we,null,i,se)}for(_ in i)if(se=i[_],ne=s[_],i.hasOwnProperty(_)&&se!==ne&&(se!=null||ne!=null))switch(_){case"selected":e.selected=se&&typeof se!="function"&&typeof se!="symbol";break;default:at(e,t,_,se,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 Re in s)se=s[Re],s.hasOwnProperty(Re)&&se!=null&&!i.hasOwnProperty(Re)&&at(e,t,Re,null,i,se);for(re in i)if(se=i[re],ne=s[re],i.hasOwnProperty(re)&&se!==ne&&(se!=null||ne!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(o(137,t));break;default:at(e,t,re,se,i,ne)}return;default:if(No(t)){for(var st in s)se=s[st],s.hasOwnProperty(st)&&se!==void 0&&!i.hasOwnProperty(st)&&uu(e,t,st,void 0,i,se);for(ue in i)se=i[ue],ne=s[ue],!i.hasOwnProperty(ue)||se===ne||se===void 0&&ne===void 0||uu(e,t,ue,se,i,ne);return}}for(var J in s)se=s[J],s.hasOwnProperty(J)&&se!=null&&!i.hasOwnProperty(J)&&at(e,t,J,null,i,se);for(fe in i)se=i[fe],ne=s[fe],!i.hasOwnProperty(fe)||se===ne||se==null&&ne==null||at(e,t,fe,se,i,ne)}function _p(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function wy(){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,C=u.duration;if(f&&C&&_p(v)){for(v=0,C=u.responseEnd,i+=1;i<s.length;i++){var _=s[i],re=_.startTime;if(re>C)break;var ue=_.transferSize,fe=_.initiatorType;ue&&_p(fe)&&(_=_.responseEnd,v+=ue*(_<C?1:(C-re)/(_-re)))}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 du=null,mu=null;function Mi(e){return e.nodeType===9?e:e.ownerDocument}function Bp(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 Ip(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 fu(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 pu=null;function Sy(){var e=window.event;return e&&e.type==="popstate"?e===pu?!1:(pu=e,!0):(pu=null,!1)}var Hp=typeof setTimeout=="function"?setTimeout:void 0,jy=typeof clearTimeout=="function"?clearTimeout:void 0,Gp=typeof Promise=="function"?Promise:void 0,Ny=typeof queueMicrotask=="function"?queueMicrotask:typeof Gp<"u"?function(e){return Gp.resolve(null).then(e).catch(Cy)}:Hp;function Cy(e){setTimeout(function(){throw e})}function Za(e){return e==="head"}function Kp(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),pn(t);return}i--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")i++;else if(s==="html")ul(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,ul(s);for(var f=s.firstChild;f;){var v=f.nextSibling,C=f.nodeName;f[ct]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&f.rel.toLowerCase()==="stylesheet"||s.removeChild(f),f=v}}else s==="body"&&ul(e.ownerDocument.body);s=u}while(s);pn(t)}function qp(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 hu(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":hu(s),Jr(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function ky(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 Ay(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 Fp(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 gu(e){return e.data==="$?"||e.data==="$~"}function xu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Ey(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 yu=null;function Vp(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 $p(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 Yp(e,t,s){switch(t=Mi(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 ul(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Jr(e)}var Ur=new Map,Jp=new Set;function Li(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Aa=H.d;H.d={f:Ty,r:Ry,D:Oy,C:zy,L:My,m:Ly,X:Py,S:Dy,M:Uy};function Ty(){var e=Aa.f(),t=Ci();return e||t}function Ry(e){var t=xr(e);t!==null&&t.tag===5&&t.type==="form"?mf(t):Aa.r(e)}var dn=typeof document>"u"?null:document;function Qp(e,t,s){var i=dn;if(i&&typeof t=="string"&&t){var u=Tr(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof s=="string"&&(u+='[crossorigin="'+s+'"]'),Jp.has(u)||(Jp.add(u),e={rel:e,crossOrigin:s,href:t},i.querySelector(u)===null&&(t=i.createElement("link"),Vt(t,"link",e),Ct(t),i.head.appendChild(t)))}}function Oy(e){Aa.D(e),Qp("dns-prefetch",e,null)}function zy(e,t){Aa.C(e,t),Qp("preconnect",e,t)}function My(e,t,s){Aa.L(e,t,s);var i=dn;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=mn(e);break;case"script":f=fn(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(dl(f))||t==="script"&&i.querySelector(ml(f))||(t=i.createElement("link"),Vt(t,"link",e),Ct(t),i.head.appendChild(t)))}}function Ly(e,t){Aa.m(e,t);var s=dn;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=fn(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(ml(f)))return}i=s.createElement("link"),Vt(i,"link",e),Ct(i),s.head.appendChild(i)}}}function Dy(e,t,s){Aa.S(e,t,s);var i=dn;if(i&&e){var u=bt(i).hoistableStyles,f=mn(e);t=t||"default";var v=u.get(f);if(!v){var C={loading:0,preload:null};if(v=i.querySelector(dl(f)))C.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Ur.get(f))&&bu(e,s);var _=v=i.createElement("link");Ct(_),Vt(_,"link",e),_._p=new Promise(function(re,ue){_.onload=re,_.onerror=ue}),_.addEventListener("load",function(){C.loading|=1}),_.addEventListener("error",function(){C.loading|=2}),C.loading|=4,Di(v,t,i)}v={type:"stylesheet",instance:v,count:1,state:C},u.set(f,v)}}}function Py(e,t){Aa.X(e,t);var s=dn;if(s&&e){var i=bt(s).hoistableScripts,u=fn(e),f=i.get(u);f||(f=s.querySelector(ml(u)),f||(e=x({src:e,async:!0},t),(t=Ur.get(u))&&vu(e,t),f=s.createElement("script"),Ct(f),Vt(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function Uy(e,t){Aa.M(e,t);var s=dn;if(s&&e){var i=bt(s).hoistableScripts,u=fn(e),f=i.get(u);f||(f=s.querySelector(ml(u)),f||(e=x({src:e,async:!0,type:"module"},t),(t=Ur.get(u))&&vu(e,t),f=s.createElement("script"),Ct(f),Vt(f,"link",e),s.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function Xp(e,t,s,i){var u=(u=ee.current)?Li(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=mn(s.href),s=bt(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=mn(s.href);var f=bt(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(dl(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||_y(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=fn(s),s=bt(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 mn(e){return'href="'+Tr(e)+'"'}function dl(e){return'link[rel="stylesheet"]['+e+"]"}function Zp(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function _y(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}),Vt(t,"link",s),Ct(t),e.head.appendChild(t))}function fn(e){return'[src="'+Tr(e)+'"]'}function ml(e){return"script[async]"+e}function Wp(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,Ct(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"),Ct(i),Vt(i,"style",u),Di(i,s.precedence,e),t.instance=i;case"stylesheet":u=mn(s.href);var f=e.querySelector(dl(u));if(f)return t.state.loading|=4,t.instance=f,Ct(f),f;i=Zp(s),(u=Ur.get(u))&&bu(i,u),f=(e.ownerDocument||e).createElement("link"),Ct(f);var v=f;return v._p=new Promise(function(C,_){v.onload=C,v.onerror=_}),Vt(f,"link",i),t.state.loading|=4,Di(f,s.precedence,e),t.instance=f;case"script":return f=fn(s.src),(u=e.querySelector(ml(f)))?(t.instance=u,Ct(u),u):(i=s,(u=Ur.get(f))&&(i=x({},s),vu(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),Ct(u),Vt(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,Di(i,s.precedence,e));return t.instance}function Di(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 C=i[v];if(C.dataset.precedence===t)f=C;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 bu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function vu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Pi=null;function eh(e,t,s){if(Pi===null){var i=new Map,u=Pi=new Map;u.set(s,i)}else u=Pi,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 C=i.get(v);C?C.push(f):i.set(v,[f])}}return i}function th(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function By(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 rh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Iy(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=mn(i.href),f=t.querySelector(dl(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ui.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=f,Ct(f);return}f=t.ownerDocument||t,i=Zp(i),(u=Ur.get(u))&&bu(i,u),f=f.createElement("link"),Ct(f);var v=f;v._p=new Promise(function(C,_){v.onload=C,v.onerror=_}),Vt(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=Ui.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var wu=0;function Hy(e,t){return e.stylesheets&&e.count===0&&Bi(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var i=setTimeout(function(){if(e.stylesheets&&Bi(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&wu===0&&(wu=62500*wy());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bi(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>wu?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function Ui(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bi(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var _i=null;function Bi(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,_i=new Map,t.forEach(Gy,e),_i=null,Ui.call(e))}function Gy(e,t){if(!(t.state.loading&4)){var s=_i.get(e);if(s)var i=s.get(null);else{s=new Map,_i.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=Ui.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 fl={$$typeof:S,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function Ky(e,t,s,i,u,f,v,C,_){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 ah(e,t,s,i,u,f,v,C,_,re,ue,fe){return e=new Ky(e,t,s,v,_,re,ue,fe,C),t=1,f===!0&&(t|=24),f=br(3,null,null,t),e.current=f,f.stateNode=e,t=ec(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:i,isDehydrated:s,cache:t},sc(f),e}function sh(e){return e?(e=Ks,e):Ks}function nh(e,t,s,i,u,f){u=sh(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&&(mr(s,e,t),Fn(s,e,t))}function lh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Su(e,t){lh(e,t),(e=e.alternate)&&lh(e,t)}function ih(e){if(e.tag===13||e.tag===31){var t=gs(e,67108864);t!==null&&mr(t,e,67108864),Su(e,67108864)}}function oh(e){if(e.tag===13||e.tag===31){var t=Nr();t=sr(t);var s=gs(e,t);s!==null&&mr(s,e,t),Su(e,t)}}var Ii=!0;function qy(e,t,s,i){var u=N.T;N.T=null;var f=H.p;try{H.p=2,ju(e,t,s,i)}finally{H.p=f,N.T=u}}function Fy(e,t,s,i){var u=N.T;N.T=null;var f=H.p;try{H.p=8,ju(e,t,s,i)}finally{H.p=f,N.T=u}}function ju(e,t,s,i){if(Ii){var u=Nu(i);if(u===null)cu(e,t,i,Hi,s),uh(e,i);else if($y(u,e,t,s,i))i.stopPropagation();else if(uh(e,i),t&4&&-1<Vy.indexOf(e)){for(;u!==null;){var f=xr(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 C=f;for(C.pendingLanes|=2,C.entangledLanes|=2;v;){var _=1<<31-xt(v);C.entanglements[1]|=_,v&=~_}Wr(f),(Qe&6)===0&&(ji=tt()+500,il(0))}}break;case 31:case 13:C=gs(f,2),C!==null&&mr(C,f,2),Ci(),Su(f,2)}if(f=Nu(i),f===null&&cu(e,t,i,Hi,s),f===u)break;u=f}u!==null&&i.stopPropagation()}else cu(e,t,i,null,s)}}function Nu(e){return e=ko(e),Cu(e)}var Hi=null;function Cu(e){if(Hi=null,e=gr(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 Hi=e,null}function ch(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(St()){case lr:return 2;case ze:return 8;case jt:case Ce:return 32;case nt:return 268435456;default:return 32}default:return 32}}var ku=!1,Wa=null,es=null,ts=null,pl=new Map,hl=new Map,rs=[],Vy="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 uh(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":pl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":hl.delete(t.pointerId)}}function gl(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=xr(t),t!==null&&ih(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function $y(e,t,s,i,u){switch(t){case"focusin":return Wa=gl(Wa,e,t,s,i,u),!0;case"dragenter":return es=gl(es,e,t,s,i,u),!0;case"mouseover":return ts=gl(ts,e,t,s,i,u),!0;case"pointerover":var f=u.pointerId;return pl.set(f,gl(pl.get(f)||null,e,t,s,i,u)),!0;case"gotpointercapture":return f=u.pointerId,hl.set(f,gl(hl.get(f)||null,e,t,s,i,u)),!0}return!1}function dh(e){var t=gr(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,ca(e.priority,function(){oh(s)});return}}else if(t===31){if(t=p(s),t!==null){e.blockedOn=t,ca(e.priority,function(){oh(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 Gi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=Nu(e.nativeEvent);if(s===null){s=e.nativeEvent;var i=new s.constructor(s.type,s);Co=i,s.target.dispatchEvent(i),Co=null}else return t=xr(s),t!==null&&ih(t),e.blockedOn=s,!1;t.shift()}return!0}function mh(e,t,s){Gi(e)&&s.delete(t)}function Yy(){ku=!1,Wa!==null&&Gi(Wa)&&(Wa=null),es!==null&&Gi(es)&&(es=null),ts!==null&&Gi(ts)&&(ts=null),pl.forEach(mh),hl.forEach(mh)}function Ki(e,t){e.blockedOn===t&&(e.blockedOn=null,ku||(ku=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Yy)))}var qi=null;function fh(e){qi!==e&&(qi=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){qi===e&&(qi=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(Cu(i||s)===null)continue;break}var f=xr(s);f!==null&&(e.splice(t,3),t-=3,Nc(f,{pending:!0,data:u,method:s.method,action:i},i,u))}}))}function pn(e){function t(_){return Ki(_,e)}Wa!==null&&Ki(Wa,e),es!==null&&Ki(es,e),ts!==null&&Ki(ts,e),pl.forEach(t),hl.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);)dh(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[yt]||null;if(typeof f=="function")v||fh(s);else if(v){var C=null;if(f&&f.hasAttribute("formAction")){if(u=f,v=f[yt]||null)C=v.formAction;else if(Cu(u)!==null)continue}else C=v.action;typeof C=="function"?s[i+1]=C:(s.splice(i,3),i-=3),fh(s)}}}function ph(){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 Au(e){this._internalRoot=e}Fi.prototype.render=Au.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var s=t.current,i=Nr();nh(s,i,e,t,null,null)},Fi.prototype.unmount=Au.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;nh(e.current,2,null,e,null,null),Ci(),t[Gt]=null}};function Fi(e){this._internalRoot=e}Fi.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&&dh(e)}};var hh=n.version;if(hh!=="19.2.1")throw Error(o(527,hh,"19.2.1"));H.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 Jy={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:N,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vi.isDisabled&&Vi.supportsFiber)try{Xt=Vi.inject(Jy),ft=Vi}catch{}}return yl.createRoot=function(e,t){if(!c(e))throw Error(o(299));var s=!1,i="",u=Sf,f=jf,v=Nf;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=ah(e,1,!1,null,null,s,i,null,u,f,v,ph),e[Gt]=t.current,ou(e),new Au(t)},yl.hydrateRoot=function(e,t,s){if(!c(e))throw Error(o(299));var i=!1,u="",f=Sf,v=jf,C=Nf,_=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&&(C=s.onRecoverableError),s.formState!==void 0&&(_=s.formState)),t=ah(e,1,!0,t,s??null,i,u,_,f,v,C,ph),t.context=sh(null),s=t.current,i=Nr(),i=sr(i),u=Ha(i),u.callback=null,Ga(s,u,i),s=i,t.current.lanes=s,Ve(t,s),Wr(t),e[Gt]=t.current,ou(e),new Fi(t)},yl.version="19.2.1",yl}var Ch;function ib(){if(Ch)return Ru.exports;Ch=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(),Ru.exports=lb(),Ru.exports}var ob=ib();const kh=yg(ob);/**
|
|
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 Ah="popstate";function cb(a={}){function n(o,c){let{pathname:d,search:m,hash:p}=o.location;return Ju("",{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:Cl(c)}return db(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 ub(){return Math.random().toString(36).substring(2,10)}function Eh(a,n){return{usr:a.state,key:a.key,idx:n}}function Ju(a,n,l=null,o){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof n=="string"?Nn(n):n,state:l,key:n&&n.key||o||ub()}}function Cl({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 Nn(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 db(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(),k=E==null?null:E-h;h=E,g&&g({action:p,location:O.location,delta:k})}function w(E,k){p="PUSH";let j=Ju(O.location,E,k);h=b()+1;let S=Eh(j,h),D=O.createHref(j);try{m.pushState(S,"",D)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;c.location.assign(D)}d&&g&&g({action:p,location:O.location,delta:1})}function T(E,k){p="REPLACE";let j=Ju(O.location,E,k);h=b();let S=Eh(j,h),D=O.createHref(j);m.replaceState(S,"",D),d&&g&&g({action:p,location:O.location,delta:0})}function R(E){return mb(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(Ah,x),g=E,()=>{c.removeEventListener(Ah,x),g=null}},createHref(E){return n(c,E)},createURL:R,encodeLocation(E){let k=R(E);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:w,replace:T,go(E){return m.go(E)}};return O}function mb(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:Cl(a);return o=o.replace(/ $/,"%20"),!n&&o.startsWith("//")&&(o=l+o),new URL(o,l)}function bg(a,n,l="/"){return fb(a,n,l,!1)}function fb(a,n,l,o){let c=typeof n=="string"?Nn(n):n,d=za(c.pathname||"/",l);if(d==null)return null;let m=vg(a);pb(m);let p=null;for(let g=0;p==null&&g<m.length;++g){let h=Cb(d);p=jb(m[g],h,o)}return p}function vg(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}".`),vg(m.children,n,w,x,g)),!(m.path==null&&!m.index)&&n.push({path:x,score:wb(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 wg(m.path))d(m,p,!0,h)}),n}function wg(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=wg(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 pb(a){a.sort((n,l)=>n.score!==l.score?l.score-n.score:Sb(n.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}var hb=/^:[\w-]+$/,gb=3,xb=2,yb=1,bb=10,vb=-2,Th=a=>a==="*";function wb(a,n){let l=a.split("/"),o=l.length;return l.some(Th)&&(o+=vb),n&&(o+=xb),l.filter(c=>!Th(c)).reduce((c,d)=>c+(hb.test(d)?gb:d===""?yb:bb),o)}function Sb(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 jb(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=co({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},b),w=g.route;if(!x&&h&&l&&!o[o.length-1].route.index&&(x=co({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:Tb(Ra([d,x.pathnameBase])),route:w}),x.pathnameBase!=="/"&&(d=Ra([d,x.pathnameBase]))}return m}function co(a,n){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[l,o]=Nb(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 Nb(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 Cb(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 kb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Ab(a,n="/"){let{pathname:l,search:o="",hash:c=""}=typeof a=="string"?Nn(a):a,d;return l?(l=l.replace(/\/\/+/g,"/"),l.startsWith("/")?d=Rh(l.substring(1),"/"):d=Rh(l,n)):d=n,{pathname:d,search:Rb(o),hash:Ob(c)}}function Rh(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 Lu(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 Eb(a){return a.filter((n,l)=>l===0||n.route.path&&n.route.path.length>0)}function dd(a){let n=Eb(a);return n.map((l,o)=>o===n.length-1?l.pathname:l.pathnameBase)}function md(a,n,l,o=!1){let c;typeof a=="string"?c=Nn(a):(c={...a},ht(!c.pathname||!c.pathname.includes("?"),Lu("?","pathname","search",c)),ht(!c.pathname||!c.pathname.includes("#"),Lu("#","pathname","hash",c)),ht(!c.search||!c.search.includes("#"),Lu("#","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=Ab(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,"/"),Tb=a=>a.replace(/\/+$/,"").replace(/^\/*/,"/"),Rb=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,Ob=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,zb=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 Mb(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function Lb(a){return a.map(n=>n.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Sg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function jg(a,n){let l=a;if(typeof l!="string"||!kb.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let o=l,c=!1;if(Sg)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 Ng=["POST","PUT","PATCH","DELETE"];new Set(Ng);var Db=["GET",...Ng];new Set(Db);var Cn=y.createContext(null);Cn.displayName="DataRouter";var go=y.createContext(null);go.displayName="DataRouterState";var Pb=y.createContext(!1),Cg=y.createContext({isTransitioning:!1});Cg.displayName="ViewTransition";var Ub=y.createContext(new Map);Ub.displayName="Fetchers";var _b=y.createContext(null);_b.displayName="Await";var kr=y.createContext(null);kr.displayName="Navigation";var El=y.createContext(null);El.displayName="Location";var Ir=y.createContext({outlet:null,matches:[],isDataRoute:!1});Ir.displayName="Route";var fd=y.createContext(null);fd.displayName="RouteError";var kg="REACT_ROUTER_ERROR",Bb="REDIRECT",Ib="ROUTE_ERROR_RESPONSE";function Hb(a){if(a.startsWith(`${kg}:${Bb}:{`))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 Gb(a){if(a.startsWith(`${kg}:${Ib}:{`))try{let n=JSON.parse(a.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new zb(n.status,n.statusText,n.data)}catch{}}function Kb(a,{relative:n}={}){ht(kn(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:o}=y.useContext(kr),{hash:c,pathname:d,search:m}=Tl(a,{relative:n}),p=d;return l!=="/"&&(p=d==="/"?l:Ra([l,d])),o.createHref({pathname:p,search:m,hash:c})}function kn(){return y.useContext(El)!=null}function na(){return ht(kn(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(El).location}var Ag="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Eg(a){y.useContext(kr).static||y.useLayoutEffect(a)}function la(){let{isDataRoute:a}=y.useContext(Ir);return a?sv():qb()}function qb(){ht(kn(),"useNavigate() may be used only in the context of a <Router> component.");let a=y.useContext(Cn),{basename:n,navigator:l}=y.useContext(kr),{matches:o}=y.useContext(Ir),{pathname:c}=na(),d=JSON.stringify(dd(o)),m=y.useRef(!1);return Eg(()=>{m.current=!0}),y.useCallback((g,h={})=>{if(Br(m.current,Ag),!m.current)return;if(typeof g=="number"){l.go(g);return}let b=md(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 Fb=y.createContext(null);function Vb(a){let n=y.useContext(Ir).outlet;return y.useMemo(()=>n&&y.createElement(Fb.Provider,{value:a},n),[n,a])}function Tg(){let{matches:a}=y.useContext(Ir),n=a[a.length-1];return n?n.params:{}}function Tl(a,{relative:n}={}){let{matches:l}=y.useContext(Ir),{pathname:o}=na(),c=JSON.stringify(dd(l));return y.useMemo(()=>md(a,JSON.parse(c),o,n==="path"),[a,c,o,n])}function $b(a,n){return Rg(a,n)}function Rg(a,n,l,o,c){var j;ht(kn(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=y.useContext(kr),{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||"";zg(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"?Nn(n):n;ht(b==="/"||((j=S.pathname)==null?void 0:j.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=bg(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 k=Zb(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&&k?y.createElement(El.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...T},navigationType:"POP"}},k):k}function Yb(){let a=av(),n=Mb(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 Jb=y.createElement(Yb,null),Og=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=Gb(a.digest);l&&(a=l)}let n=a!==void 0?y.createElement(Ir.Provider,{value:this.props.routeContext},y.createElement(fd.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?y.createElement(Qb,{error:a},n):n}};Og.contextType=Pb;var Du=new WeakMap;function Qb({children:a,error:n}){let{basename:l}=y.useContext(kr);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let o=Hb(n.digest);if(o){let c=Du.get(n);if(c)throw c;let d=jg(o.location,l);if(Sg&&!Du.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 Du.set(n,m),m}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return a}function Xb({routeContext:a,match:n,children:l}){let o=y.useContext(Cn);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 Zb(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:Lb(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||Jb,p&&(g<0&&w===0?(zg("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 k=n.concat(d.slice(0,w+1)),j=()=>{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(Xb,{match:x,routeContext:{outlet:b,matches:k,isDataRoute:l!=null},children:S})};return l&&(x.route.ErrorBoundary||x.route.errorElement||w===0)?y.createElement(Og,{location:l.location,revalidation:l.revalidation,component:O,error:T,children:j(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:h}):j()},null)}function pd(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Wb(a){let n=y.useContext(Cn);return ht(n,pd(a)),n}function ev(a){let n=y.useContext(go);return ht(n,pd(a)),n}function tv(a){let n=y.useContext(Ir);return ht(n,pd(a)),n}function hd(a){let n=tv(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 rv(){return hd("useRouteId")}function av(){var o;let a=y.useContext(fd),n=ev("useRouteError"),l=hd("useRouteError");return a!==void 0?a:(o=n.errors)==null?void 0:o[l]}function sv(){let{router:a}=Wb("useNavigate"),n=hd("useNavigate"),l=y.useRef(!1);return Eg(()=>{l.current=!0}),y.useCallback(async(c,d={})=>{Br(l.current,Ag),l.current&&(typeof c=="number"?await a.navigate(c):await a.navigate(c,{fromRouteId:n,...d}))},[a,n])}var Oh={};function zg(a,n,l){!n&&!Oh[a]&&(Oh[a]=!0,Br(!1,l))}y.memo(nv);function nv({routes:a,future:n,state:l,onError:o}){return Rg(a,void 0,l,o,n)}function uo({to:a,replace:n,state:l,relative:o}){ht(kn(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=y.useContext(kr);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=md(a,dd(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 Mg(a){return Vb(a.context)}function Wt(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 lv({basename:a="/",children:n=null,location:l,navigationType:o="POP",navigator:c,static:d=!1,unstable_useTransitions:m}){ht(!kn(),"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=Nn(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(kr.Provider,{value:g},y.createElement(El.Provider,{children:n,value:R}))}function iv({children:a,location:n}){return $b(Qu(a),n)}function Qu(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,Qu(o.props.children,d));return}ht(o.type===Wt,`[${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=Qu(o.props.children,d)),l.push(m)}),l}var ro="get",ao="application/x-www-form-urlencoded";function xo(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function ov(a){return xo(a)&&a.tagName.toLowerCase()==="button"}function cv(a){return xo(a)&&a.tagName.toLowerCase()==="form"}function uv(a){return xo(a)&&a.tagName.toLowerCase()==="input"}function dv(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function mv(a,n){return a.button===0&&(!n||n==="_self")&&!dv(a)}function Xu(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 fv(a,n){let l=Xu(a);return n&&n.forEach((o,c)=>{l.has(c)||n.getAll(c).forEach(d=>{l.append(c,d)})}),l}var $i=null;function pv(){if($i===null)try{new FormData(document.createElement("form"),0),$i=!1}catch{$i=!0}return $i}var hv=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Pu(a){return a!=null&&!hv.has(a)?(Br(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ao}"`),null):a}function gv(a,n){let l,o,c,d,m;if(cv(a)){let p=a.getAttribute("action");o=p?za(p,n):null,l=a.getAttribute("method")||ro,c=Pu(a.getAttribute("enctype"))||ao,d=new FormData(a)}else if(ov(a)||uv(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")||ro,c=Pu(a.getAttribute("formenctype"))||Pu(p.getAttribute("enctype"))||ao,d=new FormData(p,a),!pv()){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(xo(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=ro,o=null,c=ao,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 gd(a,n){if(a===!1||a===null||typeof a>"u")throw new Error(n)}function xv(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 yv(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 bv(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 vv(a,n,l){let o=await Promise.all(a.map(async c=>{let d=n.routes[c.route.id];if(d){let m=await yv(d,l);return m.links?m.links():[]}return[]}));return Nv(o.flat(1).filter(bv).filter(c=>c.rel==="stylesheet"||c.rel==="preload").map(c=>c.rel==="stylesheet"?{...c,rel:"prefetch",as:"style"}:{...c,rel:"prefetch"}))}function zh(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 wv(a,n,{includeHydrateFallback:l}={}){return Sv(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 Sv(a){return[...new Set(a)]}function jv(a){let n={},l=Object.keys(a).sort();for(let o of l)n[o]=a[o];return n}function Nv(a,n){let l=new Set;return new Set(n),a.reduce((o,c)=>{let d=JSON.stringify(jv(c));return l.has(d)||(l.add(d),o.push({key:d,link:c})),o},[])}function Lg(){let a=y.useContext(Cn);return gd(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function Cv(){let a=y.useContext(go);return gd(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var xd=y.createContext(void 0);xd.displayName="FrameworkContext";function Dg(){let a=y.useContext(xd);return gd(a,"You must render this element inside a <HydratedRouter> element"),a}function kv(a,n){let l=y.useContext(xd),[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=k=>{k.forEach(j=>{m(j.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:bl(p,T),onBlur:bl(g,R),onMouseEnter:bl(h,T),onMouseLeave:bl(b,R),onTouchStart:bl(x,T)}]:[!1,w,{}]}function bl(a,n){return l=>{a&&a(l),l.defaultPrevented||n(l)}}function Av({page:a,...n}){let{router:l}=Lg(),o=y.useMemo(()=>bg(l.routes,a,l.basename),[l.routes,a,l.basename]);return o?y.createElement(Tv,{page:a,matches:o,...n}):null}function Ev(a){let{manifest:n,routeModules:l}=Dg(),[o,c]=y.useState([]);return y.useEffect(()=>{let d=!1;return vv(a,n,l).then(m=>{d||c(m)}),()=>{d=!0}},[a,n,l]),o}function Tv({page:a,matches:n,...l}){let o=na(),{future:c,manifest:d,routeModules:m}=Dg(),{basename:p}=Lg(),{loaderData:g,matches:h}=Cv(),b=y.useMemo(()=>zh(a,n,h,d,o,"data"),[a,n,h,d,o]),x=y.useMemo(()=>zh(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(j=>{var D;let S=d.routes[j.route.id];!S||!S.hasLoader||(!b.some(U=>U.route.id===j.route.id)&&j.route.id in g&&((D=m[j.route.id])!=null&&D.shouldRevalidate)||S.hasClientLoader?E=!0:O.add(j.route.id))}),O.size===0)return[];let k=xv(a,p,c.unstable_trailingSlashAwareDataRequests,"data");return E&&O.size>0&&k.searchParams.set("_routes",n.filter(j=>O.has(j.route.id)).map(j=>j.route.id).join(",")),[k.pathname+k.search]},[p,c.unstable_trailingSlashAwareDataRequests,g,o,d,b,n,a,m]),T=y.useMemo(()=>wv(x,d),[x,d]),R=Ev(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 Rv(...a){return n=>{a.forEach(l=>{typeof l=="function"?l(n):l!=null&&(l.current=n)})}}var Ov=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ov&&(window.__reactRouterVersion="7.13.0")}catch{}function zv({basename:a,children:n,unstable_useTransitions:l,window:o}){let c=y.useRef();c.current==null&&(c.current=cb({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(lv,{basename:a,children:n,location:m.location,navigationType:m.action,navigator:d,unstable_useTransitions:l})}var Pg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ug=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(kr),k=typeof h=="string"&&Pg.test(h),j=jg(h,O);h=j.to;let S=Kb(h,{relative:c}),[D,U,V]=kv(o,T),I=Dv(h,{replace:m,state:p,target:g,preventScrollReset:b,relative:c,viewTransition:x,unstable_defaultShouldRevalidate:w,unstable_useTransitions:E});function M(pe){n&&n(pe),pe.defaultPrevented||I(pe)}let $=y.createElement("a",{...T,...V,href:j.absoluteURL||S,onClick:j.isExternal||d?n:M,ref:Rv(R,U),target:g,"data-discover":!k&&l==="render"?"true":void 0});return D&&!k?y.createElement(y.Fragment,null,$,y.createElement(Av,{page:S})):$});Ug.displayName="Link";var _g=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=Tl(m,{relative:h.relative}),w=na(),T=y.useContext(go),{navigator:R,basename:O}=y.useContext(kr),E=T!=null&&Hv(x)&&p===!0,k=R.encodeLocation?R.encodeLocation(x).pathname:x.pathname,j=w.pathname,S=T&&T.navigation&&T.navigation.location?T.navigation.location.pathname:null;l||(j=j.toLowerCase(),S=S?S.toLowerCase():null,k=k.toLowerCase()),S&&O&&(S=za(S,O)||S);const D=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let U=j===k||!c&&j.startsWith(k)&&j.charAt(D)==="/",V=S!=null&&(S===k||!c&&S.startsWith(k)&&S.charAt(k.length)==="/"),I={isActive:U,isPending:V,isTransitioning:E},M=U?n:void 0,$;typeof o=="function"?$=o(I):$=[o,U?"active":null,V?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let pe=typeof d=="function"?d(I):d;return y.createElement(Ug,{...h,"aria-current":M,className:$,ref:b,style:pe,to:m,viewTransition:p},typeof g=="function"?g(I):g)});_g.displayName="NavLink";var Mv=y.forwardRef(({discover:a="render",fetcherKey:n,navigate:l,reloadDocument:o,replace:c,state:d,method:m=ro,action:p,onSubmit:g,relative:h,preventScrollReset:b,viewTransition:x,unstable_defaultShouldRevalidate:w,...T},R)=>{let{unstable_useTransitions:O}=y.useContext(kr),E=Bv(),k=Iv(p,{relative:h}),j=m.toLowerCase()==="get"?"get":"post",S=typeof p=="string"&&Pg.test(p),D=U=>{if(g&&g(U),U.defaultPrevented)return;U.preventDefault();let V=U.nativeEvent.submitter,I=(V==null?void 0:V.getAttribute("formmethod"))||m,M=()=>E(V||U.currentTarget,{fetcherKey:n,method:I,navigate:l,replace:c,state:d,relative:h,preventScrollReset:b,viewTransition:x,unstable_defaultShouldRevalidate:w});O&&l!==!1?y.startTransition(()=>M()):M()};return y.createElement("form",{ref:R,method:j,action:k,onSubmit:o?g:D,...T,"data-discover":!S&&a==="render"?"true":void 0})});Mv.displayName="Form";function Lv(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Bg(a){let n=y.useContext(Cn);return ht(n,Lv(a)),n}function Dv(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=Tl(a,{relative:d});return y.useCallback(w=>{if(mv(w,n)){w.preventDefault();let T=l!==void 0?l:Cl(b)===Cl(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 Pv(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(Xu(a)),l=y.useRef(!1),o=na(),c=y.useMemo(()=>fv(o.search,l.current?null:n.current),[o.search]),d=la(),m=y.useCallback((p,g)=>{const h=Xu(typeof p=="function"?p(new URLSearchParams(c)):p);l.current=!0,d("?"+h,g)},[d,c]);return[c,m]}var Uv=0,_v=()=>`__${String(++Uv)}__`;function Bv(){let{router:a}=Bg("useSubmit"),{basename:n}=y.useContext(kr),l=rv(),o=a.fetch,c=a.navigate;return y.useCallback(async(d,m={})=>{let{action:p,method:g,encType:h,formData:b,body:x}=gv(d,n);if(m.navigate===!1){let w=m.fetcherKey||_v();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 Iv(a,{relative:n}={}){let{basename:l}=y.useContext(kr),o=y.useContext(Ir);ht(o,"useFormAction must be used inside a RouteContext");let[c]=o.matches.slice(-1),d={...Tl(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])),Cl(d)}function Hv(a,{relative:n}={}){let l=y.useContext(Cg);ht(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=Bg("useViewTransitionState"),c=Tl(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 co(c.pathname,m)!=null||co(c.pathname,d)!=null}const Gv=()=>window.__MCPHUB_CONFIG__||{basePath:"",version:"dev",name:"mcphub"},Rl=()=>{const n=Gv().basePath||"";return n&&!n.startsWith("/")?"/"+n:n},Kv=()=>Rl()+"/api",yd=a=>{const n=Kv(),l=a.startsWith("/")?a:"/"+a;return n+l},qv=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"}}},so=[],Fv=a=>{so.push(a)},bd=async(a,n={})=>{let l=a.toString(),o={...n};try{for(const d of so)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 so)d.response&&(c=await d.response(c));return c}catch(c){let d=c;for(const m of so)m.error&&(d=await m.error(d));throw d}},yo=async(a,n={})=>{try{const l=yd(a),o=await bd(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={})=>yo(a,{...n,method:"GET"}),Et=(a,n,l={})=>yo(a,{...l,method:"POST",headers:{"Content-Type":"application/json",...l.headers},body:n?JSON.stringify(n):void 0}),Ut=(a,n,l={})=>yo(a,{...l,method:"PUT",headers:{"Content-Type":"application/json",...l.headers},body:n?JSON.stringify(n):void 0}),Os=(a,n={})=>yo(a,{...n,method:"DELETE"}),vd="mcphub_token",An=()=>localStorage.getItem(vd),Ig=a=>{localStorage.setItem(vd,a)},mo=()=>{localStorage.removeItem(vd)},Vv={request:async(a,n)=>{const l=new Headers(n.headers),o=localStorage.getItem("i18nextLng")||"en";l.set("Accept-Language",o);const c=An();return c&&l.set("x-auth-token",c),{url:a,config:{...n,headers:l,credentials:n.credentials??"include"}}},response:async a=>(a.status===401&&mo(),a),error:async a=>(console.error("Auth interceptor error:",a),a)},$v=()=>{Fv(Vv)};var Yv={},Mh={};const no=Object.create(null),vl=a=>{var n;return Yv||((n=globalThis.Deno)==null?void 0:n.env.toObject())||globalThis.__env__||(a?no:globalThis)},_r=new Proxy(no,{get(a,n){return vl()[n]??no[n]},has(a,n){return n in vl()||n in no},set(a,n,l){const o=vl(!0);return o[n]=l,!0},deleteProperty(a,n){if(!n)return!1;const l=vl(!0);return delete l[n],!0},ownKeys(){const a=vl(!0);return Object.keys(a)}});function Lt(a,n){return typeof process<"u"&&Mh?Mh[a]??n:typeof Deno<"u"?Deno.env.get(a)??n:typeof Bun<"u"?Bun.env[a]??n:n}const wl=1,It=4,ra=8,Cr=24,Lh={eterm:It,cons25:It,console:It,cygwin:It,dtterm:It,gnome:It,hurd:It,jfbterm:It,konsole:It,kterm:It,mlterm:It,mosh:Cr,putty:It,st:It,"rxvt-unicode-24bit":Cr,terminator:Cr,"xterm-kitty":Cr},Jv=new Map(Object.entries({APPVEYOR:ra,BUILDKITE:ra,CIRCLECI:Cr,DRONE:ra,GITEA_ACTIONS:Cr,GITHUB_ACTIONS:Cr,GITLAB_CI:ra,TRAVIS:ra})),Qv=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function Xv(){if(Lt("FORCE_COLOR")!==void 0)switch(Lt("FORCE_COLOR")){case"":case"1":case"true":return It;case"2":return ra;case"3":return Cr;default:return wl}if(Lt("NODE_DISABLE_COLORS")!==void 0&&Lt("NODE_DISABLE_COLORS")!==""||Lt("NO_COLOR")!==void 0&&Lt("NO_COLOR")!==""||Lt("TERM")==="dumb")return wl;if(Lt("TMUX"))return Cr;if("TF_BUILD"in _r&&"AGENT_NAME"in _r)return It;if("CI"in _r){for(const{0:a,1:n}of Jv)if(a in _r)return n;return Lt("CI_NAME")==="codeship"?ra:wl}if("TEAMCITY_VERSION"in _r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(Lt("TEAMCITY_VERSION"))!==null?It:wl;switch(Lt("TERM_PROGRAM")){case"iTerm.app":return!Lt("TERM_PROGRAM_VERSION")||/^[0-2]\./.exec(Lt("TERM_PROGRAM_VERSION"))!==null?ra:Cr;case"HyperTerm":case"MacTerm":return Cr;case"Apple_Terminal":return ra}if(Lt("COLORTERM")==="truecolor"||Lt("COLORTERM")==="24bit")return Cr;if(Lt("TERM")){if(/truecolor/.exec(Lt("TERM"))!==null)return Cr;if(/^xterm-256/.exec(Lt("TERM"))!==null)return ra;const a=Lt("TERM").toLowerCase();if(Lh[a])return Lh[a];if(Qv.some(n=>n.exec(a)!==null))return It}return Lt("COLORTERM")?It:wl}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"}},Zu=["debug","info","success","warn","error"];function Zv(a,n){return Zu.indexOf(n)>=Zu.indexOf(a)}const Wv={info:aa.fg.blue,success:aa.fg.green,warn:aa.fg.yellow,error:aa.fg.red,debug:aa.fg.magenta},e1=(a,n,l)=>{const o=new Date().toISOString();return l?`${aa.dim}${o}${aa.reset} ${Wv[a]}${a.toUpperCase()}${aa.reset} ${aa.bright}[Better Auth]:${aa.reset} ${n}`:`${o} ${a.toUpperCase()} [Better Auth]: ${n}`},t1=a=>{const n="error",l=Xv()!==1,o=(c,d,m=[])=>{if(!Zv(n,c))return;const p=e1(c,d,l);{c==="error"?console.error(p,...m):c==="warn"?console.warn(p,...m):console.log(p,...m);return}};return{...Object.fromEntries(Zu.map(c=>[c,(...[d,...m])=>o(c,d,m)])),get level(){return n}}};t1();function r1(a){return a.charAt(0).toUpperCase()+a.slice(1)}var lo=class extends Error{constructor(a,n){super(a,n),this.name="BetterAuthError",this.message=a,this.stack=""}};function a1(a){try{return(new URL(a).pathname.replace(/\/+$/,"")||"/")!=="/"}catch{throw new lo(`Invalid base URL: ${a}. Please provide a valid base URL.`)}}function s1(a){try{const n=new URL(a);if(n.protocol!=="http:"&&n.protocol!=="https:")throw new lo(`Invalid base URL: ${a}. URL must include 'http://' or 'https://'`)}catch(n){throw n instanceof lo?n:new lo(`Invalid base URL: ${a}. Please provide a valid base URL.`,{cause:n})}}function Uu(a,n="/api/auth"){if(s1(a),a1(a))return a;const l=a.replace(/\/+$/,"");return!n||n==="/"?l:(n=n.startsWith("/")?n:`/${n}`,`${l}${n}`)}function n1(a,n,l,o,c){if(a)return Uu(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 Uu(d,n)}if(typeof window<"u"&&window.location)return Uu(window.location.origin,n)}const l1={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{}}}},i1={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*:/},o1=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,Dh={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},c1=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function u1(a){return a instanceof Date&&!isNaN(a.getTime())}function d1(a){const n=c1.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 u1(w)?w:null}function m1(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 Dh)return Dh[p];if(!o1.test(m)){if(l)throw new SyntaxError("[better-json] Invalid JSON");return a}if(Object.entries(i1).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=d1(b);if(x)return x}return c?c(h,b):b})}catch(g){if(l)throw g;return a}}function f1(a,n={strict:!0}){return m1(a,n)}let qr=[],ss=0;const Yi=4,Hg=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+Yi;d<qr.length;)qr[d]===o?qr.splice(d,Yi):d+=Yi;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+=Yi)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},p1=5,Ji=6,Qi=10;let h1=(a,n,l,o)=>(a.events=a.events||{},a.events[l+Qi]||(a.events[l+Qi]=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+Qi](),delete a.events[l+Qi])}),g1=1e3,Gg=(a,n)=>h1(a,o=>{let c=n(o);c&&a.events[Ji].push(c)},p1,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[Ji]=[],a.off=()=>{d(),setTimeout(()=>{if(a.active&&!a.lc){a.active=!1;for(let m of a.events[Ji])m();a.events[Ji]=[]}},g1)},()=>{a.listen=c,a.off=d}});function x1(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 y1=()=>typeof window>"u",b1=(a,n,l,o)=>{const c=Hg({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()=>{y1()||(m?await d():Gg(c,()=>{const g=setTimeout(async()=>{m||(await d(),m=!0)},0);return()=>{c.off(),p.off(),clearTimeout(g)}}))});return c},_u=Symbol.for("better-auth:broadcast-channel"),v1=()=>Math.floor(Date.now()/1e3);var w1=class{constructor(a="better-auth.message"){hn(this,"listeners",new Set);hn(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:v1()}))}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 Bu(a="better-auth.message"){return globalThis[_u]||(globalThis[_u]=new w1(a)),globalThis[_u]}const Iu=Symbol.for("better-auth:focus-manager");var S1=class{constructor(){hn(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 Ph(){return globalThis[Iu]||(globalThis[Iu]=new S1),globalThis[Iu]}const Hu=Symbol.for("better-auth:online-manager");var j1=class{constructor(){hn(this,"listeners",new Set);hn(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 Gu(){return globalThis[Hu]||(globalThis[Hu]=new j1),globalThis[Hu]}const gn=()=>Math.floor(Date.now()/1e3),N1=5;function C1(a){var j,S,D;const{sessionAtom:n,sessionSignal:l,$fetch:o,options:c={}}=a,d=((j=c.sessionOptions)==null?void 0:j.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||Gu().isOnline,b=U=>{if(!h())return;if((U==null?void 0:U.event)==="storage"){g.lastSync=gn(),l.set(!l.get());return}const V=n.get();if((U==null?void 0:U.event)==="poll"){g.lastSessionRequest=gn(),o("/get-session").then(I=>{I.error?n.set({...V,data:null,error:I.error}):n.set({...V,data:I.data,error:null}),g.lastSync=gn(),l.set(!l.get())}).catch(()=>{});return}if((U==null?void 0:U.event)==="visibilitychange"){if(gn()-g.lastSessionRequest<N1)return;g.lastSessionRequest=gn()}((V==null?void 0:V.data)===null||(V==null?void 0:V.data)===void 0||(U==null?void 0:U.event)==="visibilitychange")&&(g.lastSync=gn(),l.set(!l.get()))},x=U=>{Bu().post({event:"session",data:{trigger:U},clientId:Math.random().toString(36).substring(7)})},w=()=>{d&&d>0&&(g.pollInterval=setInterval(()=>{var U;(U=n.get())!=null&&U.data&&b({event:"poll"})},d*1e3))},T=()=>{g.unsubscribeBroadcast=Bu().subscribe(()=>{b({event:"storage"})})},R=()=>{m&&(g.unsubscribeFocus=Ph().subscribe(()=>{b({event:"visibilitychange"})}))},O=()=>{g.unsubscribeOnline=Gu().subscribe(U=>{U&&b({event:"visibilitychange"})})};return{init:()=>{w(),T(),R(),O(),Bu().setup(),Ph().setup(),Gu().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 k1(a,n){const l=Hg(!1),o=b1(l,"/get-session",a,{method:"GET"});return Gg(o,()=>{const c=C1({sessionAtom:o,sessionSignal:l,$fetch:a,options:n});return c.init(),()=>{c.cleanup()}}),{session:o,$sessionSignal:l}}var A1=Object.defineProperty,E1=Object.defineProperties,T1=Object.getOwnPropertyDescriptors,Uh=Object.getOwnPropertySymbols,R1=Object.prototype.hasOwnProperty,O1=Object.prototype.propertyIsEnumerable,_h=(a,n,l)=>n in a?A1(a,n,{enumerable:!0,configurable:!0,writable:!0,value:l}):a[n]=l,Fr=(a,n)=>{for(var l in n||(n={}))R1.call(n,l)&&_h(a,l,n[l]);if(Uh)for(var l of Uh(n))O1.call(n,l)&&_h(a,l,n[l]);return a},ta=(a,n)=>E1(a,T1(n)),z1=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)}},M1=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}},Bh=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}},L1=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 D1(a){if(typeof a=="number")return new Bh({type:"linear",attempts:a,delay:1e3});switch(a.type){case"linear":return new Bh(a);case"exponential":return new L1(a);default:throw new Error("Invalid retry strategy")}}var P1=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},U1=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function _1(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 U1.test(o)?"json":l.has(o)||o.startsWith("text/")?"text":"blob"}function B1(a){try{return JSON.parse(a),!0}catch{return!1}}function Wu(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 Ih(a){try{return JSON.parse(a)}catch{return a}}function Hh(a){return typeof a=="function"}function I1(a){if(a!=null&&a.customFetchImpl)return a.customFetchImpl;if(typeof globalThis<"u"&&Hh(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&Hh(window.fetch))return window.fetch;throw new Error("No fetch implementation found")}async function H1(a){const n=new Headers(a==null?void 0:a.headers),l=await P1(a);for(const[o,c]of Object.entries(l||{}))n.set(o,c);if(!n.has("content-type")){const o=G1(a==null?void 0:a.body);o&&n.set("content-type",o)}return n}function G1(a){return Wu(a)?"application/json":null}function K1(a){if(!(a!=null&&a.body))return null;const n=new Headers(a==null?void 0:a.headers);if(Wu(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"&&Wu(a.body)?new URLSearchParams(a.body).toString():a.body}function q1(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 qg.includes(o)?o.toUpperCase():n!=null&&n.body?"POST":"GET"}return n!=null&&n.body?"POST":"GET"}function F1(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 V1=class Kg extends Error{constructor(n,l){super(l||JSON.stringify(n,null,2)),this.issues=n,Object.setPrototypeOf(this,Kg.prototype)}};async function io(a,n){const l=await a["~standard"].validate(n);if(l.issues)throw new V1(l.issues);return l.value}var qg=["get","post","put","patch","delete"],$1=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 io(h.input,l==null?void 0:l.body):l==null?void 0:l.body,params:h.params?await io(h.params,l==null?void 0:l.params):l==null?void 0:l.params,query:h.query?await io(h.query,l==null?void 0:l.query):l==null?void 0:l.query})),{url:n,options:b}}}return{url:n,options:l}}}),Y1=a=>{async function n(l,o){const c=ta(Fr(Fr({},a),o),{plugins:[...(a==null?void 0:a.plugins)||[],$1(a||{}),...(o==null?void 0:o.plugins)||[]]});if(a!=null&&a.catchAllError)try{return await ed(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 ed(l,c)}return n};function J1(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];qg.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 ed=async(a,n)=>{var l,o,c,d,m,p,g,h;const{hooks:b,url:x,options:w}=await M1(a,n),T=I1(w),R=new AbortController,O=(l=w.signal)!=null?l:R.signal,E=J1(x,w),k=K1(w),j=await H1(w),S=q1(x,w);let D=ta(Fr({},w),{url:E,headers:j,body:k,method:S,signal:O});for(const Q of b.onRequest)if(Q){const G=await Q(D);typeof G=="object"&&G!==null&&(D=G)}("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:U}=F1(w,R);let V=await T(D.url,D);U();const I={response:V,request:D};for(const Q of b.onResponse)if(Q){const G=await Q(ta(Fr({},I),{response:(c=n==null?void 0:n.hookOptions)!=null&&c.cloneResponse?V.clone():V}));G instanceof Response?V=G:typeof G=="object"&&G!==null&&(V=G.response)}if(V.ok){if(!(D.method!=="HEAD"))return{data:"",error:null};const G=_1(V),X={data:null,response:V,request:D};if(G==="json"||G==="text"){const N=await V.text(),H=(d=D.jsonParser)!=null?d:Ih;X.data=await H(N)}else X.data=await V[G]();D!=null&&D.output&&D.output&&!D.disableValidation&&(X.data=await io(D.output,X.data));for(const N of b.onSuccess)N&&await N(ta(Fr({},X),{response:(m=n==null?void 0:n.hookOptions)!=null&&m.cloneResponse?V.clone():V}));return n!=null&&n.throw?X.data:{data:X.data,error:null}}const M=(p=n==null?void 0:n.jsonParser)!=null?p:Ih,$=await V.text(),pe=B1($),K=pe?await M($):null,q={response:V,responseText:$,request:D,error:ta(Fr({},K),{status:V.status,statusText:V.statusText})};for(const Q of b.onError)Q&&await Q(ta(Fr({},q),{response:(g=n==null?void 0:n.hookOptions)!=null&&g.cloneResponse?V.clone():V}));if(n!=null&&n.retry){const Q=D1(n.retry),G=(h=n.retryAttempt)!=null?h:0;if(await Q.shouldAttemptRetry(G,V)){for(const N of b.onRetry)N&&await N(I);const X=Q.getDelay(G);return await new Promise(N=>setTimeout(N,X)),await ed(a,ta(Fr({},n),{retryAttempt:G+1}))}}if(n!=null&&n.throw)throw new z1(V.status,V.statusText,pe?K:$);return{data:null,error:ta(Fr({},K),{status:V.status,statusText:V.statusText})}};const Q1=(a,n)=>{var D,U,V,I,M,$,pe;const l="credentials"in Request.prototype,o=n1(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(K=>K.fetchPlugins).filter(K=>K!==void 0))||[],d={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:(U=a==null?void 0:a.fetchOptions)==null?void 0:U.onSuccess,onError:(V=a==null?void 0:a.fetchOptions)==null?void 0:V.onError,onRequest:(I=a==null?void 0:a.fetchOptions)==null?void 0:I.onRequest,onResponse:(M=a==null?void 0:a.fetchOptions)==null?void 0:M.onResponse}},{onSuccess:m,onError:p,onRequest:g,onResponse:h,...b}=(a==null?void 0:a.fetchOptions)||{},x=Y1({baseURL:o,...l?{credentials:"include"}:{},method:"GET",jsonParser(K){return K?f1(K,{strict:!1}):null},customFetchImpl:fetch,...b,plugins:[d,...b.plugins||[],...a!=null&&a.disableDefaultFetchPlugins?[]:[l1],...c]}),{$sessionSignal:w,session:T}=k1(x,a),R=(a==null?void 0:a.plugins)||[],O={},E={$sessionSignal:w,session:T},k={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},j=[{signal:"$sessionSignal",matcher(K){return K==="/sign-out"||K==="/update-user"||K==="/sign-up/email"||K==="/sign-in/email"||K==="/delete-user"||K==="/verify-email"||K==="/revoke-sessions"||K==="/revoke-session"||K==="/change-email"}}];for(const K of R)K.getAtoms&&Object.assign(E,($=K.getAtoms)==null?void 0:$.call(K,x)),K.pathMethods&&Object.assign(k,K.pathMethods),K.atomListeners&&j.push(...K.atomListeners);const S={notify:K=>{E[K].set(!E[K].get())},listen:(K,q)=>{E[K].subscribe(q)},atoms:E};for(const K of R)K.getActions&&Object.assign(O,(pe=K.getActions)==null?void 0:pe.call(K,x,S,a));return{get baseURL(){return o},pluginsActions:O,pluginsAtoms:E,pluginPathMethods:k,atomListeners:j,$fetch:x,$store:S}};function X1(a){return typeof a=="object"&&a!==null&&"get"in a&&typeof a.get=="function"&&"lc"in a&&typeof a.lc=="number"}function Z1(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 W1(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"||X1(b)?b:d(h)},apply:async(p,g,h)=>{const b="/"+m.map(j=>j.replace(/[A-Z]/g,S=>`-${S.toLowerCase()}`)).join("/"),x=h[0]||{},w=h[1]||{},{query:T,fetchOptions:R,...O}=x,E={...w,...R},k=Z1(b,l,x);return await n(b,{...E,body:k==="GET"?void 0:{...O,...(E==null?void 0:E.body)||{}},query:T||(E==null?void 0:E.query),method:k,async onSuccess(j){var U;if(await((U=E==null?void 0:E.onSuccess)==null?void 0:U.call(E,j)),!c||E.disableSignal)return;const S=c.filter(V=>V.matcher(b));if(!S.length)return;const D=new Set;for(const V of S){const I=o[V.signal];if(!I)return;if(D.has(V.signal))continue;D.add(V.signal);const M=I.get();setTimeout(()=>{I.set(!M)},10)}}})}})}return d()}function e2(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?x1(a,o,g):a.listen(g)},c),m=()=>l.current;return y.useSyncExternalStore(d,m,m)}function t2(a){return`use${r1(a)}`}function r2(a){const{pluginPathMethods:n,pluginsActions:l,pluginsAtoms:o,$fetch:c,$store:d,atomListeners:m}=Q1(a),p={};for(const[g,h]of Object.entries(o))p[t2(g)]=()=>e2(h);return W1({...l,...p,$fetch:c,$store:d},c,n,o,m)}const a2=a=>a?a.startsWith("/")?a:`/${a}`:"/api/auth/better",s2=a=>{if(typeof window>"u")return"";const n=Rl(),l=a2(a||"/api/auth/better");return`${window.location.origin}${n}${l}`},Fg=a=>r2({baseURL:s2(a),fetchOptions:{credentials:"include"}}),n2=Fg(),l2=async a=>{try{const n=await Et("/auth/login",a);return n.success&&n.token?(Ig(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"}}},i2=async a=>{try{const n=await Et("/auth/register",a);return n.success&&n.token?(Ig(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"}}},o2=async()=>{if(!An())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"}}},Ku=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"}}},c2=async a=>{if(!An())return{success:!1,message:"No authentication token"};try{return await Et("/auth/change-password",a)}catch(l){return console.error("Change password error:",l),{success:!1,message:"An error occurred while changing password"}}},u2=()=>{mo(),n2.signOut().catch(a=>{console.debug("Better Auth sign out failed:",a)})},Vg=async()=>{var a,n,l;try{const o=Rl(),c=await bd(`${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},$g=y.createContext({auth:ea,login:async()=>({success:!1}),register:async()=>!1,logout:()=>{}}),d2=({children:a})=>{const[n,l]=y.useState(ea);y.useEffect(()=>{(async()=>{const{skipAuth:p,permissions:g}=await Vg();if(p){l({isAuthenticated:!0,loading:!1,user:{username:"guest",isAdmin:!0,permissions:g},error:null});return}if(!An()){const b=await Ku();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 o2();if(b.success&&b.user)l({isAuthenticated:!0,loading:!1,user:b.user,error:null});else{mo();const x=await Ku();x.success&&x.user?l({isAuthenticated:!0,loading:!1,user:x.user,error:null}):l({...ea,loading:!1})}}catch{mo();const x=await Ku();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 l2({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 i2({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=()=>{u2(),l({...ea,loading:!1})};return r.jsx($g.Provider,{value:{auth:n,login:o,register:c,logout:d},children:a})},cs=()=>y.useContext($g),m2=(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)},Gh={},td=(a,n,l,o)=>{Rs(l)&&Gh[l]||(Rs(l)&&(Gh[l]=new Date),m2(a,n,l,o))},Yg=(a,n)=>()=>{if(a.isInitialized)n();else{const l=()=>{setTimeout(()=>{a.off("initialized",l)},0),n()};a.on("initialized",l)}},rd=(a,n,l)=>{a.loadNamespaces(n,Yg(a,l))},Kh=(a,n,l,o)=>{if(Rs(l)&&(l=[l]),a.options.preload&&a.options.preload.indexOf(n)>-1)return rd(a,l,o);l.forEach(c=>{a.options.ns.indexOf(c)<0&&a.options.ns.push(c)}),a.loadLanguages(n,Yg(a,o))},f2=(a,n,l={})=>!n.languages||!n.languages.length?(td(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",p2=a=>typeof a=="object"&&a!==null,h2=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,g2={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},x2=a=>g2[a],y2=a=>a.replace(h2,x2);let ad={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:y2};const b2=(a={})=>{ad={...ad,...a}},v2=()=>ad;let Jg;const w2=a=>{Jg=a},S2=()=>Jg,j2={type:"3rdParty",init(a){b2(a.options.react),w2(a)}},N2=y.createContext();class C2{constructor(){this.usedNamespaces={}}addUsedNamespaces(n){n.forEach(l=>{this.usedNamespaces[l]||(this.usedNamespaces[l]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const k2=(a,n)=>{const l=y.useRef();return y.useEffect(()=>{l.current=a},[a,n]),l.current},Qg=(a,n,l,o)=>a.getFixedT(n,l,o),A2=(a,n,l,o)=>y.useCallback(Qg(a,n,l,o),[a,n,l,o]),Ne=(a,n={})=>{var D,U,V,I;const{i18n:l}=n,{i18n:o,defaultNS:c}=y.useContext(N2)||{},d=l||o||S2();if(d&&!d.reportNamespaces&&(d.reportNamespaces=new C2),!d){td(d,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const M=(pe,K)=>Rs(K)?K:p2(K)&&Rs(K.defaultValue)?K.defaultValue:Array.isArray(pe)?pe[pe.length-1]:pe,$=[M,{},!1];return $.t=M,$.i18n={},$.ready=!1,$}(D=d.options.react)!=null&&D.wait&&td(d,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const m={...v2(),...d.options.react,...n},{useSuspense:p,keyPrefix:g}=m;let h=c||((U=d.options)==null?void 0:U.defaultNS);h=Rs(h)?[h]:h||["translation"],(I=(V=d.reportNamespaces).addUsedNamespaces)==null||I.call(V,h);const b=(d.isInitialized||d.initializedStoreOnce)&&h.every(M=>f2(M,d,m)),x=A2(d,n.lng||null,m.nsMode==="fallback"?h:h[0],g),w=()=>x,T=()=>Qg(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 k=k2(E),j=y.useRef(!0);y.useEffect(()=>{const{bindI18n:M,bindI18nStore:$}=m;j.current=!0,!b&&!p&&(n.lng?Kh(d,n.lng,h,()=>{j.current&&O(T)}):rd(d,h,()=>{j.current&&O(T)})),b&&k&&k!==E&&j.current&&O(T);const pe=()=>{j.current&&O(T)};return M&&(d==null||d.on(M,pe)),$&&(d==null||d.store.on($,pe)),()=>{j.current=!1,d&&M&&(M==null||M.split(" ").forEach(K=>d.off(K,pe))),$&&d&&$.split(" ").forEach(K=>d.store.off(K,pe))}},[d,E]),y.useEffect(()=>{j.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(M=>{n.lng?Kh(d,n.lng,h,()=>M()):rd(d,h,()=>M())})};/**
|
|
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 E2=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),T2=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,l,o)=>o?o.toUpperCase():l.toLowerCase()),qh=a=>{const n=T2(a);return n.charAt(0).toUpperCase()+n.slice(1)},Xg=(...a)=>a.filter((n,l,o)=>!!n&&n.trim()!==""&&o.indexOf(n)===l).join(" ").trim(),R2=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 O2={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 z2=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,...O2,width:n,height:n,stroke:a,strokeWidth:o?Number(l)*24/Number(n):l,className:Xg("lucide",c),...!d&&!R2(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(z2,{ref:d,iconNode:n,className:Xg(`lucide-${E2(qh(a))}`,`lucide-${a}`,o),...c}));return l.displayName=qh(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 M2=[["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"}]],Zg=mt("book-open",M2);/**
|
|
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 L2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],os=mt("check",L2);/**
|
|
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 D2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ol=mt("chevron-down",D2);/**
|
|
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 P2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],wd=mt("chevron-right",P2);/**
|
|
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 U2=[["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"}]],Sd=mt("circle-alert",U2);/**
|
|
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 _2=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Wg=mt("circle-check-big",_2);/**
|
|
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 B2=[["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"}]],e0=mt("circle-x",B2);/**
|
|
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 I2=[["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"}]],Sn=mt("copy",I2);/**
|
|
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 H2=[["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"}]],G2=mt("download",H2);/**
|
|
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 K2=[["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"}]],q2=mt("file-code",K2);/**
|
|
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 F2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],V2=mt("info",F2);/**
|
|
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 $2=[["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"}]],Y2=mt("link",$2);/**
|
|
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 J2=[["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"}]],t0=mt("loader",J2);/**
|
|
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 Q2=[["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"}]],X2=mt("log-out",Q2);/**
|
|
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 Z2=[["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"}]],W2=mt("moon",Z2);/**
|
|
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 ew=[["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"}]],r0=mt("play",ew);/**
|
|
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 tw=[["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"}]],rw=mt("refresh-cw",tw);/**
|
|
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 aw=[["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"}]],sw=mt("settings",aw);/**
|
|
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 nw=[["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"}]],zl=mt("square-pen",nw);/**
|
|
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 lw=[["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"}]],iw=mt("sun",lw);/**
|
|
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 ow=[["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"}]],cw=mt("trash-2",ow);/**
|
|
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 uw=[["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"}]],a0=mt("trash",uw);/**
|
|
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 dw=[["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"}]],s0=mt("user",dw);/**
|
|
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 mw=[["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"}]],fw=mt("wrench",mw);/**
|
|
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 pw=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],jn=mt("x",pw);function n0(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=n0(a[n]))&&(o&&(o+=" "),o+=l)}else for(l in a)a[l]&&(o&&(o+=" "),o+=l);return o}function hw(){for(var a,n,l=0,o="",c=arguments.length;l<c;l++)(a=arguments[l])&&(n=n0(a))&&(o&&(o+=" "),o+=n);return o}const jd="-",gw=a=>{const n=yw(a),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=a;return{getClassGroupId:m=>{const p=m.split(jd);return p[0]===""&&p.length!==1&&p.shift(),l0(p,n)||xw(m)},getConflictingClassGroupIds:(m,p)=>{const g=l[m]||[];return p&&o[m]?[...g,...o[m]]:g}}},l0=(a,n)=>{var m;if(a.length===0)return n.classGroupId;const l=a[0],o=n.nextPart.get(l),c=o?l0(a.slice(1),o):void 0;if(c)return c;if(n.validators.length===0)return;const d=a.join(jd);return(m=n.validators.find(({validator:p})=>p(d)))==null?void 0:m.classGroupId},Fh=/^\[(.+)\]$/,xw=a=>{if(Fh.test(a)){const n=Fh.exec(a)[1],l=n==null?void 0:n.substring(0,n.indexOf(":"));if(l)return"arbitrary.."+l}},yw=a=>{const{theme:n,classGroups:l}=a,o={nextPart:new Map,validators:[]};for(const c in l)sd(l[c],o,c,n);return o},sd=(a,n,l,o)=>{a.forEach(c=>{if(typeof c=="string"){const d=c===""?n:Vh(n,c);d.classGroupId=l;return}if(typeof c=="function"){if(bw(c)){sd(c(o),n,l,o);return}n.validators.push({validator:c,classGroupId:l});return}Object.entries(c).forEach(([d,m])=>{sd(m,Vh(n,d),l,o)})})},Vh=(a,n)=>{let l=a;return n.split(jd).forEach(o=>{l.nextPart.has(o)||l.nextPart.set(o,{nextPart:new Map,validators:[]}),l=l.nextPart.get(o)}),l},bw=a=>a.isThemeGetter,vw=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)}}},nd="!",ld=":",ww=ld.length,Sw=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===ld){d.push(c.slice(g,R)),g=R+ww;continue}if(O==="/"){h=R;continue}}O==="["?m++:O==="]"?m--:O==="("?p++:O===")"&&p--}const b=d.length===0?c:c.substring(g),x=jw(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+ld,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},jw=a=>a.endsWith(nd)?a.substring(0,a.length-1):a.startsWith(nd)?a.substring(1):a,Nw=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}},Cw=a=>({cache:vw(a.cacheSize),parseClassName:Sw(a),sortModifiers:Nw(a),...gw(a)}),kw=/\s+/,Aw=(a,n)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c,sortModifiers:d}=n,m=[],p=a.trim().split(kw);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,k=o(E?R.substring(0,O):R);if(!k){if(!E){g=b+(g.length>0?" "+g:g);continue}if(k=o(R),!k){g=b+(g.length>0?" "+g:g);continue}E=!1}const j=d(w).join(":"),S=T?j+nd:j,D=S+k;if(m.includes(D))continue;m.push(D);const U=c(k,E);for(let V=0;V<U.length;++V){const I=U[V];m.push(S+I)}g=b+(g.length>0?" "+g:g)}return g};function Ew(){let a=0,n,l,o="";for(;a<arguments.length;)(n=arguments[a++])&&(l=i0(n))&&(o&&(o+=" "),o+=l);return o}const i0=a=>{if(typeof a=="string")return a;let n,l="";for(let o=0;o<a.length;o++)a[o]&&(n=i0(a[o]))&&(l&&(l+=" "),l+=n);return l};function Tw(a,...n){let l,o,c,d=m;function m(g){const h=n.reduce((b,x)=>x(b),a());return l=Cw(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=Aw(g,l);return c(g,b),b}return function(){return d(Ew.apply(null,arguments))}}const Pt=a=>{const n=l=>l[a]||[];return n.isThemeGetter=!0,n},o0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,c0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Rw=/^\d+\/\d+$/,Ow=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,zw=/\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$/,Mw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Lw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Dw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xn=a=>Rw.test(a),Pe=a=>!!a&&!Number.isNaN(Number(a)),ns=a=>!!a&&Number.isInteger(Number(a)),qu=a=>a.endsWith("%")&&Pe(a.slice(0,-1)),Ea=a=>Ow.test(a),Pw=()=>!0,Uw=a=>zw.test(a)&&!Mw.test(a),u0=()=>!1,_w=a=>Lw.test(a),Bw=a=>Dw.test(a),Iw=a=>!Se(a)&&!je(a),Hw=a=>En(a,f0,u0),Se=a=>o0.test(a),Ts=a=>En(a,p0,Uw),Fu=a=>En(a,Vw,Pe),$h=a=>En(a,d0,u0),Gw=a=>En(a,m0,Bw),Xi=a=>En(a,h0,_w),je=a=>c0.test(a),Sl=a=>Tn(a,p0),Kw=a=>Tn(a,$w),Yh=a=>Tn(a,d0),qw=a=>Tn(a,f0),Fw=a=>Tn(a,m0),Zi=a=>Tn(a,h0,!0),En=(a,n,l)=>{const o=o0.exec(a);return o?o[1]?n(o[1]):l(o[2]):!1},Tn=(a,n,l=!1)=>{const o=c0.exec(a);return o?o[1]?n(o[1]):l:!1},d0=a=>a==="position"||a==="percentage",m0=a=>a==="image"||a==="url",f0=a=>a==="length"||a==="size"||a==="bg-size",p0=a=>a==="length",Vw=a=>a==="number",$w=a=>a==="family-name",h0=a=>a==="shadow",Yw=()=>{const a=Pt("color"),n=Pt("font"),l=Pt("text"),o=Pt("font-weight"),c=Pt("tracking"),d=Pt("leading"),m=Pt("breakpoint"),p=Pt("container"),g=Pt("spacing"),h=Pt("radius"),b=Pt("shadow"),x=Pt("inset-shadow"),w=Pt("text-shadow"),T=Pt("drop-shadow"),R=Pt("blur"),O=Pt("perspective"),E=Pt("aspect"),k=Pt("ease"),j=Pt("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"],U=()=>[...D(),je,Se],V=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],M=()=>[je,Se,g],$=()=>[xn,"full","auto",...M()],pe=()=>[ns,"none","subgrid",je,Se],K=()=>["auto",{span:["full",ns,je,Se]},ns,je,Se],q=()=>[ns,"auto",je,Se],Q=()=>["auto","min","max","fr",je,Se],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...M()],H=()=>[xn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],B=()=>[a,je,Se],ce=()=>[...D(),Yh,$h,{position:[je,Se]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],A=()=>["auto","cover","contain",qw,Hw,{size:[je,Se]}],L=()=>[qu,Sl,Ts],z=()=>["","none","full",h,je,Se],P=()=>["",Pe,Sl,Ts],le=()=>["solid","dashed","dotted","double"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>[Pe,qu,Yh,$h],ge=()=>["","none",R,je,Se],ae=()=>["none",Pe,je,Se],ye=()=>["none",Pe,je,Se],de=()=>[Pe,je,Se],oe=()=>[xn,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ea],breakpoint:[Ea],color:[Pw],container:[Ea],"drop-shadow":[Ea],ease:["in","out","in-out"],font:[Iw],"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",xn,Se,je,E]}],container:["container"],columns:[{columns:[Pe,Se,je,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:U()}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{start:$()}],end:[{end:$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[ns,"auto",je,Se]}],basis:[{basis:[xn,"full","auto",p,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Pe,xn,"auto","initial","none",Se]}],grow:[{grow:["",Pe,je,Se]}],shrink:[{shrink:["",Pe,je,Se]}],order:[{order:[ns,"first","last","none",je,Se]}],"grid-cols":[{"grid-cols":pe()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":pe()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Q()}],"auto-rows":[{"auto-rows":Q()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[p,"screen",...H()]}],"min-w":[{"min-w":[p,"screen","none",...H()]}],"max-w":[{"max-w":[p,"screen","none","prose",{screen:[m]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",l,Sl,Ts]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,je,Fu]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qu,Se]}],"font-family":[{font:[Kw,Se,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,je,Se]}],"line-clamp":[{"line-clamp":[Pe,"none",je,Fu]}],leading:[{leading:[d,...M()]}],"list-image":[{"list-image":["none",je,Se]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",je,Se]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[Pe,"from-font","auto",je,Ts]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[Pe,"auto",je,Se]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",je,Se]}],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",je,Se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ce()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ns,je,Se],radial:["",je,Se],conic:[ns,je,Se]},Fw,Gw]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:L()}],"gradient-via-pos":[{via:L()}],"gradient-to-pos":[{to:L()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],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:P()}],"border-w-x":[{"border-x":P()}],"border-w-y":[{"border-y":P()}],"border-w-s":[{"border-s":P()}],"border-w-e":[{"border-e":P()}],"border-w-t":[{"border-t":P()}],"border-w-r":[{"border-r":P()}],"border-w-b":[{"border-b":P()}],"border-w-l":[{"border-l":P()}],"divide-x":[{"divide-x":P()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":P()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Pe,je,Se]}],"outline-w":[{outline:["",Pe,Sl,Ts]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",b,Zi,Xi]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",x,Zi,Xi]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:P()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[Pe,Ts]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":P()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",w,Zi,Xi]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[Pe,je,Se]}],"mix-blend":[{"mix-blend":[...ee(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ee()}],"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":Y()}],"mask-image-linear-to-pos":[{"mask-linear-to":Y()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":Y()}],"mask-image-t-to-pos":[{"mask-t-to":Y()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":Y()}],"mask-image-r-to-pos":[{"mask-r-to":Y()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":Y()}],"mask-image-b-to-pos":[{"mask-b-to":Y()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":Y()}],"mask-image-l-to-pos":[{"mask-l-to":Y()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":Y()}],"mask-image-x-to-pos":[{"mask-x-to":Y()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":Y()}],"mask-image-y-to-pos":[{"mask-y-to":Y()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[je,Se]}],"mask-image-radial-from-pos":[{"mask-radial-from":Y()}],"mask-image-radial-to-pos":[{"mask-radial-to":Y()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"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":Y()}],"mask-image-conic-to-pos":[{"mask-conic-to":Y()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ce()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",je,Se]}],filter:[{filter:["","none",je,Se]}],blur:[{blur:ge()}],brightness:[{brightness:[Pe,je,Se]}],contrast:[{contrast:[Pe,je,Se]}],"drop-shadow":[{"drop-shadow":["","none",T,Zi,Xi]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",Pe,je,Se]}],"hue-rotate":[{"hue-rotate":[Pe,je,Se]}],invert:[{invert:["",Pe,je,Se]}],saturate:[{saturate:[Pe,je,Se]}],sepia:[{sepia:["",Pe,je,Se]}],"backdrop-filter":[{"backdrop-filter":["","none",je,Se]}],"backdrop-blur":[{"backdrop-blur":ge()}],"backdrop-brightness":[{"backdrop-brightness":[Pe,je,Se]}],"backdrop-contrast":[{"backdrop-contrast":[Pe,je,Se]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Pe,je,Se]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Pe,je,Se]}],"backdrop-invert":[{"backdrop-invert":["",Pe,je,Se]}],"backdrop-opacity":[{"backdrop-opacity":[Pe,je,Se]}],"backdrop-saturate":[{"backdrop-saturate":[Pe,je,Se]}],"backdrop-sepia":[{"backdrop-sepia":["",Pe,je,Se]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",je,Se]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Pe,"initial",je,Se]}],ease:[{ease:["linear","initial",k,je,Se]}],delay:[{delay:[Pe,je,Se]}],animate:[{animate:["none",j,je,Se]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[O,je,Se]}],"perspective-origin":[{"perspective-origin":U()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":["scale-3d"],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[je,Se,"","none","gpu","cpu"]}],"transform-origin":[{origin:U()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"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",je,Se]}],"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":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",je,Se]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[Pe,Sl,Ts,Fu]}],stroke:[{stroke:["none",...B()]}],"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"]}},Jw=Tw(Yw);function Oa(...a){return Jw(hw(a))}const Qw=({message:a,type:n="info",duration:l=3e3,onClose:o,visible:c})=>{const{t:d}=Ne();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(jn,{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(jn,{className:"h-5 w-5"})]})})})]})})},g0=y.createContext(void 0),us=()=>{const a=y.useContext(g0);if(!a)throw new Error("useToast must be used within a ToastProvider");return a},Xw=({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(g0.Provider,{value:{showToast:o},children:[a,r.jsx(Qw,{message:n.message,type:n.type,duration:n.duration,onClose:c,visible:n.visible})]})},x0=y.createContext(void 0),Zw=()=>{const a=y.useContext(x0);if(!a)throw new Error("useTheme must be used within a ThemeProvider");return a},Ww=({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(x0.Provider,{value:{theme:n,setTheme:d,resolvedTheme:o},children:a})},y0="mcphub_servers_per_page",oo=5,b0=new Set([5,10,20,50]),eS=()=>{if(typeof window>"u")return oo;const a=window.localStorage.getItem(y0);if(!a)return oo;const n=Number(a);return b0.has(n)?n:oo},Wi={startup:{maxAttempts:60,pollingInterval:3e3},normal:{pollingInterval:1e4}},v0=y.createContext(void 0),tS=({children:a})=>{const{t:n}=Ne(),{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),[k,j]=y.useState(1),[S,D]=y.useState(eS),U=y.useRef(null),V=y.useRef(0),I=y.useRef(0),M=3e3,$=()=>{U.current&&(clearInterval(U.current),U.current=null)},pe=y.useCallback(A=>{const L=(A==null?void 0:A.immediate)??!0;$();const z=async()=>{try{console.log("[ServerContext] Fetching servers from API...");const P=new URLSearchParams;P.append("page",k.toString()),P.append("limit",S.toString());const[le,ee]=await Promise.all([Ue(`/servers?${P.toString()}`),Ue("/servers")]);I.current=Date.now(),le&&le.success&&Array.isArray(le.data)?(c(le.data),le.pagination?E(le.pagination):E(null)):le&&Array.isArray(le)?(c(le),E(null)):(console.error("Invalid server data format:",le),c([]),E(null)),ee&&ee.success&&Array.isArray(ee.data)?m(ee.data):ee&&Array.isArray(ee)?m(ee):m([]),g(null)}catch(P){console.error("Error fetching servers during normal polling:",P),navigator.onLine?P instanceof TypeError&&(P.message.includes("NetworkError")||P.message.includes("Failed to fetch"))?g(n("errors.serverConnection")):g(n("errors.serverFetch")):g(n("errors.network"))}};L&&z(),U.current=setInterval(z,Wi.normal.pollingInterval)},[n,k,S]);y.useEffect(()=>{l.isAuthenticated?(console.log("[ServerContext] User authenticated, triggering refresh"),b(A=>A+1)):(console.log("[ServerContext] User not authenticated, clearing data and stopping polling"),$(),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&&(V.current=0,R(0));const A=async()=>{try{console.log("[ServerContext] Initial fetch - attempt",V.current+1);const L=new URLSearchParams;L.append("page",k.toString()),L.append("limit",S.toString());const[z,P]=await Promise.all([Ue(`/servers?${L.toString()}`),Ue("/servers")]);return I.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)),P&&P.success&&Array.isArray(P.data)?m(P.data):P&&Array.isArray(P)?m(P):m([]),w(!1),pe({immediate:!1}),!0}catch(L){return V.current+=1,console.error(`Initial loading attempt ${V.current} failed:`,L),R(V.current),navigator.onLine?g(n("errors.initialStartup")):g(n("errors.network")),V.current>=Wi.startup.maxAttempts&&(console.log("Maximum startup attempts reached, switching to normal polling"),w(!1),$(),pe()),!1}};return x?($(),A(),U.current=setInterval(A,Wi.startup.pollingInterval),console.log(`Started initial polling with interval: ${Wi.startup.pollingInterval}ms`)):pe(),()=>{$()}},[h,n,x,pe,k,S]),y.useEffect(()=>{if(!O)return;const A=Math.max(1,O.totalPages||1);k>A&&j(A)},[O,k]);const K=y.useCallback(()=>{$(),x&&(w(!0),V.current=0,R(0)),b(A=>A+1)},[x]),q=y.useCallback(()=>{const L=Date.now()-I.current;console.log("[ServerContext] refreshIfNeeded called, time since last fetch:",L,"ms"),L>=M?(console.log("[ServerContext] Triggering refresh (exceeded MIN_REFRESH_INTERVAL:",M,"ms)"),K()):console.log("[ServerContext] Skipping refresh (MIN_REFRESH_INTERVAL:",M,"ms, time since last:",L,"ms)")},[K]),Q=y.useCallback(()=>{b(A=>A+1)},[]),G=y.useCallback(async A=>{try{const L=encodeURIComponent(A.name),z=await Ue(`/servers/${L}`);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:A.name})),null)}catch(L){return console.error("Error fetching server config:",L),g(L instanceof Error?L.message:String(L)),null}},[n]),X=y.useCallback(async A=>{try{const L=encodeURIComponent(A),z=await Os(`/servers/${L}`);return!z||!z.success?(g((z==null?void 0:z.message)||n("server.deleteError",{serverName:A})),!1):(b(P=>P+1),!0)}catch(L){return g(n("errors.general")+": "+(L instanceof Error?L.message:String(L))),!1}},[n]),N=y.useCallback(async(A,L)=>{try{const z=encodeURIComponent(A.name),P=await Et(`/servers/${z}/toggle`,{enabled:L});return!P||!P.success?(console.error("Failed to toggle server:",P),g((P==null?void 0:P.message)||n("server.toggleError",{serverName:A.name})),!1):(b(le=>le+1),!0)}catch(z){return console.error("Error toggling server:",z),g(z instanceof Error?z.message:String(z)),!1}},[n]),H=y.useCallback(async A=>{try{const L=encodeURIComponent(A.name),z=await Et(`/servers/${L}/reload`,{});return!z||!z.success?(console.error("Failed to reload server:",z),g(n("server.reloadError",{serverName:A.name})),!1):(K(),!0)}catch(L){return console.error("Error reloading server:",L),g(L instanceof Error?L.message:String(L)),!1}},[n,K]),B=y.useCallback(A=>{j(A)},[]),ce=y.useCallback(A=>{const L=b0.has(A)?A:oo;typeof window<"u"&&window.localStorage.setItem(y0,String(L)),D(L),j(1)},[]),Z={servers:o,allServers:d,error:p,setError:g,isLoading:x,fetchAttempts:T,pagination:O,currentPage:k,serversPerPage:S,setCurrentPage:B,setServersPerPage:ce,triggerRefresh:K,refreshIfNeeded:q,handleServerAdd:Q,handleServerEdit:G,handleServerRemove:X,handleServerToggle:N,handleServerReload:H};return r.jsx(v0.Provider,{value:Z,children:a})},w0=()=>{const a=y.useContext(v0);if(a===void 0)throw new Error("useServerContext must be used within a ServerProvider");return a},Vu=()=>({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}}),S0=y.createContext(void 0),rS=()=>{const a=y.useContext(S0);if(!a)throw new Error("useSettings must be used within a SettingsProvider");return a},aS=({children:a})=>{const{t:n}=Ne(),{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(Vu()),[E,k]=y.useState("-"),[j,S]=y.useState(!1),[D,U]=y.useState([]),[V,I]=y.useState(!1),[M,$]=y.useState(null),[pe,K]=y.useState(0),q=y.useCallback(()=>{K(de=>de+1)},[]),Q=y.useCallback(async()=>{var de,oe,xe,Xe,$t,Yt,Ze,gt,Jt,_t,Qt,Ht,fr,tt,St,lr,ze,jt;I(!0),$(null);try{const Ce=await Ue("/settings");if(Ce.success&&((oe=(de=Ce.data)==null?void 0:de.systemConfig)!=null&&oe.routing)&&d({enableGlobalRoute:Ce.data.systemConfig.routing.enableGlobalRoute??!0,enableGroupNameRoute:Ce.data.systemConfig.routing.enableGroupNameRoute??!0,enableBearerAuth:Ce.data.systemConfig.routing.enableBearerAuth??!0,bearerAuthKey:Ce.data.systemConfig.routing.bearerAuthKey||"",skipAuth:Ce.data.systemConfig.routing.skipAuth??!1}),Ce.success&&((Xe=(xe=Ce.data)==null?void 0:xe.systemConfig)!=null&&Xe.install)&&h({pythonIndexUrl:Ce.data.systemConfig.install.pythonIndexUrl||"",npmRegistry:Ce.data.systemConfig.install.npmRegistry||"",baseUrl:Ce.data.systemConfig.install.baseUrl||"http://localhost:3000"}),Ce.success&&((Yt=($t=Ce.data)==null?void 0:$t.systemConfig)!=null&&Yt.smartRouting)&&x({enabled:Ce.data.systemConfig.smartRouting.enabled??!1,dbUrl:Ce.data.systemConfig.smartRouting.dbUrl||"",embeddingProvider:Ce.data.systemConfig.smartRouting.embeddingProvider==="azure_openai"?"azure_openai":"openai",openaiApiBaseUrl:Ce.data.systemConfig.smartRouting.openaiApiBaseUrl||"",openaiApiKey:Ce.data.systemConfig.smartRouting.openaiApiKey||"",openaiApiEmbeddingModel:Ce.data.systemConfig.smartRouting.openaiApiEmbeddingModel||"",azureOpenaiEndpoint:Ce.data.systemConfig.smartRouting.azureOpenaiEndpoint||"",azureOpenaiApiKey:Ce.data.systemConfig.smartRouting.azureOpenaiApiKey||"",azureOpenaiApiVersion:Ce.data.systemConfig.smartRouting.azureOpenaiApiVersion||"",azureOpenaiEmbeddingDeployment:Ce.data.systemConfig.smartRouting.azureOpenaiEmbeddingDeployment||"",progressiveDisclosure:Ce.data.systemConfig.smartRouting.progressiveDisclosure??!1}),Ce.success&&((gt=(Ze=Ce.data)==null?void 0:Ze.systemConfig)!=null&>.mcpRouter)&&T({apiKey:Ce.data.systemConfig.mcpRouter.apiKey||"",referer:Ce.data.systemConfig.mcpRouter.referer||"https://www.mcphubx.com",title:Ce.data.systemConfig.mcpRouter.title||"MCPHub",baseUrl:Ce.data.systemConfig.mcpRouter.baseUrl||"https://api.mcprouter.to/v1"}),Ce.success)if((_t=(Jt=Ce.data)==null?void 0:Jt.systemConfig)!=null&&_t.oauthServer){const nt=Ce.data.systemConfig.oauthServer,lt=Vu(),rr=lt.dynamicRegistration,Xt=Array.isArray(nt.allowedScopes)?[...nt.allowedScopes]:[...lt.allowedScopes],ft=Array.isArray((Qt=nt.dynamicRegistration)==null?void 0:Qt.allowedGrantTypes)?[...nt.dynamicRegistration.allowedGrantTypes]:[...rr.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:Xt,dynamicRegistration:{enabled:((Ht=nt.dynamicRegistration)==null?void 0:Ht.enabled)??rr.enabled,allowedGrantTypes:ft,requiresAuthentication:((fr=nt.dynamicRegistration)==null?void 0:fr.requiresAuthentication)??rr.requiresAuthentication}})}else O(Vu());Ce.success&&((St=(tt=Ce.data)==null?void 0:tt.systemConfig)==null?void 0:St.nameSeparator)!==void 0&&k(Ce.data.systemConfig.nameSeparator),Ce.success&&((ze=(lr=Ce.data)==null?void 0:lr.systemConfig)==null?void 0:ze.enableSessionRebuild)!==void 0&&S(Ce.data.systemConfig.enableSessionRebuild),Ce.success&&Array.isArray((jt=Ce.data)==null?void 0:jt.bearerKeys)&&U(Ce.data.bearerKeys)}catch(Ce){console.error("Failed to fetch settings:",Ce),$(Ce instanceof Error?Ce.message:"Failed to fetch settings"),l(n("errors.failedToFetchSettings"))}finally{I(!1)}},[n,l]),G=async(de,oe)=>{I(!0),$(null);try{const xe=await Ut("/system-config",{routing:{[de]:oe}});return xe.success?(d({...c,[de]:oe}),l(n("settings.systemConfigUpdated")),!0):($(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),$(xe instanceof Error?xe.message:"Failed to update routing config"),l(n("errors.failedToUpdateRoutingConfig")),!1}finally{I(!1)}},X=async(de,oe)=>{I(!0),$(null);try{const xe=await Ut("/system-config",{install:{[de]:oe}});return xe.success?(h({...g,[de]:oe}),l(n("settings.systemConfigUpdated")),!0):($(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),$(xe instanceof Error?xe.message:"Failed to update install config"),l(n("errors.failedToUpdateInstallConfig")),!1}finally{I(!1)}},N=async(de,oe)=>{I(!0),$(null);try{const xe=await Ut("/system-config",{smartRouting:{[de]:oe}});return xe.success?(x({...b,[de]:oe}),l(n("settings.systemConfigUpdated")),!0):($(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),$(xe instanceof Error?xe.message:"Failed to update smart routing config"),l(n("errors.failedToUpdateSmartRoutingConfig")),!1}finally{I(!1)}},H=async de=>{I(!0),$(null);try{const oe=await Ut("/system-config",{smartRouting:de});return oe.success?(x({...b,...de}),l(n("settings.systemConfigUpdated")),!0):($(oe.error||"Failed to update smart routing config"),l(oe.error||n("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(oe){return console.error("Failed to update smart routing config:",oe),$(oe instanceof Error?oe.message:"Failed to update smart routing config"),l(n("errors.failedToUpdateSmartRoutingConfig")),!1}finally{I(!1)}},B=async de=>{I(!0),$(null);try{const oe=await Ut("/system-config",{routing:de});return oe.success?(d({...c,...de}),l(n("settings.systemConfigUpdated")),!0):($(oe.error||"Failed to update routing config"),l(oe.error||n("errors.failedToUpdateRoutingConfig")),!1)}catch(oe){return console.error("Failed to update routing config:",oe),$(oe instanceof Error?oe.message:"Failed to update routing config"),l(n("errors.failedToUpdateRoutingConfig")),!1}finally{I(!1)}},ce=async(de,oe)=>{I(!0),$(null);try{const xe=await Ut("/system-config",{mcpRouter:{[de]:oe}});return xe.success?(T({...w,[de]:oe}),l(n("settings.systemConfigUpdated")),!0):($(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),$(xe instanceof Error?xe.message:"Failed to update MCP Router config"),l(n("errors.failedToUpdateMCPRouterConfig")),!1}finally{I(!1)}},Z=async de=>{I(!0),$(null);try{const oe=await Ut("/system-config",{mcpRouter:de});return oe.success?(T({...w,...de}),l(n("settings.systemConfigUpdated")),!0):($(oe.error||"Failed to update MCP Router config"),l(oe.error||n("errors.failedToUpdateMCPRouterConfig")),!1)}catch(oe){return console.error("Failed to update MCP Router config:",oe),$(oe instanceof Error?oe.message:"Failed to update MCP Router config"),l(n("errors.failedToUpdateMCPRouterConfig")),!1}finally{I(!1)}},A=async(de,oe)=>{I(!0),$(null);try{const xe=await Ut("/system-config",{oauthServer:{[de]:oe}});return xe.success?(O({...R,[de]:oe}),l(n("settings.systemConfigUpdated")),!0):($(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),$(xe instanceof Error?xe.message:"Failed to update OAuth server config"),l(n("errors.failedToUpdateOAuthServerConfig")),!1}finally{I(!1)}},L=async de=>{I(!0),$(null);try{const oe=await Ut("/system-config",{oauthServer:de});return oe.success?(O({...R,...de}),l(n("settings.systemConfigUpdated")),!0):($(oe.error||"Failed to update OAuth server config"),l(oe.error||n("errors.failedToUpdateOAuthServerConfig")),!1)}catch(oe){return console.error("Failed to update OAuth server config:",oe),$(oe instanceof Error?oe.message:"Failed to update OAuth server config"),l(n("errors.failedToUpdateOAuthServerConfig")),!1}finally{I(!1)}},z=async de=>{I(!0),$(null);try{const oe=await Ut("/system-config",{nameSeparator:de});return oe.success?(k(de),l(n("settings.systemConfigUpdated")),!0):($(oe.error||"Failed to update name separator"),l(oe.error||n("errors.failedToUpdateNameSeparator")),!1)}catch(oe){return console.error("Failed to update name separator:",oe),$(oe instanceof Error?oe.message:"Failed to update name separator"),l(n("errors.failedToUpdateNameSeparator")),!1}finally{I(!1)}},P=async de=>{I(!0),$(null);try{const oe=await Ut("/system-config",{enableSessionRebuild:de});return oe.success?(S(de),l(n("settings.systemConfigUpdated")),!0):($(oe.error||"Failed to update session rebuild setting"),l(oe.error||n("errors.failedToUpdateSessionRebuild")),!1)}catch(oe){return console.error("Failed to update session rebuild setting:",oe),$(oe instanceof Error?oe.message:"Failed to update session rebuild setting"),l(n("errors.failedToUpdateSessionRebuild")),!1}finally{I(!1)}},le=async de=>{I(!0),$(null);try{return await Ue(`/mcp-settings/export?serverName=${de||""}`)}catch(oe){console.error("Failed to export MCP settings:",oe);const xe=oe instanceof Error?oe.message:"Failed to export MCP settings";$(xe),l(xe)}finally{I(!1)}},ee=async()=>{try{const de=await Ue("/auth/keys");de.success&&Array.isArray(de.data)&&U(de.data)}catch(de){console.error("Failed to refresh bearer keys:",de),l(n("errors.failedToFetchSettings"))}},Y=async de=>{try{const oe=await Et("/auth/keys",de);return oe.success&&oe.data?(await ee(),l(n("settings.systemConfigUpdated")),oe.data):(l(oe.message||n("errors.failedToUpdateRoutingConfig")),null)}catch(oe){return console.error("Failed to create bearer key:",oe),l(n("errors.failedToUpdateRoutingConfig")),null}},ge=async(de,oe)=>{try{const xe=await Ut(`/auth/keys/${de}`,oe);return xe.success&&xe.data?(await ee(),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}},ae=async de=>{try{const oe=await Os(`/auth/keys/${de}`);return oe.success?(await ee(),l(n("settings.systemConfigUpdated")),!0):(l(oe.message||n("errors.failedToUpdateRoutingConfig")),!1)}catch(oe){return console.error("Failed to delete bearer key:",oe),l(n("errors.failedToUpdateRoutingConfig")),!1}};y.useEffect(()=>{Q()},[Q,pe]),y.useEffect(()=>{o.isAuthenticated&&(console.log("[SettingsContext] User authenticated, triggering settings refresh"),q())},[o.isAuthenticated,q]),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:j,bearerKeys:D,loading:V,error:M,setError:$,triggerRefresh:q,fetchSettings:Q,updateRoutingConfig:G,updateInstallConfig:X,updateSmartRoutingConfig:N,updateSmartRoutingConfigBatch:H,updateRoutingConfigBatch:B,updateMCPRouterConfig:ce,updateMCPRouterConfigBatch:Z,updateOAuthServerConfig:A,updateOAuthServerConfigBatch:L,updateNameSeparator:z,updateSessionRebuild:P,exportMCPSettings:le,refreshBearerKeys:ee,createBearerKey:Y,updateBearerKey:ge,deleteBearerKey:ae};return r.jsx(S0.Provider,{value:ye,children:a})},j0=()=>{const{t:a}=Ne(),{theme:n,setTheme:l}=Zw(),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(W2,{className:"h-5 w-5"}):r.jsx(iw,{className:"h-5 w-5"})})},sS=a=>{const{t:n}=Ne();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"})]})},N0=()=>{const{i18n:a}=Ne(),[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(sS,{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))})})]})},nS=a=>{const{t:n}=Ne();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"})]})},lS=({onToggleSidebar:a})=>{const{t:n}=Ne();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.4"}),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(nS,{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(Zg,{className:"h-5 w-5"})}),r.jsx(j0,{}),r.jsx(N0,{})]})]})})},ls=({permissions:a,fallback:n=null,children:l})=>C0(a)?r.jsx(r.Fragment,{children:l}):r.jsx(r.Fragment,{children:n}),C0=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))},iS="https://registry.npmjs.org",oS="@samanhappy/mcphub",k0=async()=>{try{const a=await fetch(`${iS}/${oS}/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}},A0=(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},cS=({isOpen:a,onClose:n,version:l})=>{const{t:o}=Ne(),[c,d]=y.useState(!1),[m,p]=y.useState(""),[g,h]=y.useState(!1),b=async()=>{h(!0);try{const x=await k0();x&&(p(x),d(A0(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(jn,{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(rw,{className:`h-4 w-4 mr-2 ${g?"animate-spin":""}`}),o(g?"about.checking":"about.checkForUpdates")]})]})]})})}):null},uS=({open:a,onOpenChange:n})=>{const{i18n:l,t:o}=Ne();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(jn,{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},dS=({open:a,onOpenChange:n})=>{const{t:l}=Ne();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(jn,{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},mS=a=>{const{t:n}=Ne();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"})]})},fS=a=>{const{t:n}=Ne();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"})]})},pS=a=>{const{t:n}=Ne();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"})]})},hS=({collapsed:a,version:n})=>{var I;const{t:l,i18n:o}=Ne(),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),k=y.useRef(null);y.useEffect(()=>{(async()=>{try{const $=await k0();$&&b(A0(n,$)>0)}catch($){console.error("Error checking for new version:",$)}})()},[n]),y.useEffect(()=>{const M=$=>{k.current&&!k.current.contains($.target)&&g(!1)};return document.addEventListener("mousedown",M),()=>{document.removeEventListener("mousedown",M)}},[]);const j=()=>{c("/settings"),g(!1)},S=()=>{m(),c("/login")},D=()=>{w(!0),g(!1)},U=()=>{R(!0),g(!1)},V=()=>{E(!0),g(!1)};return r.jsxs("div",{ref:k,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(s0,{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:((I=d.user)==null?void 0:I.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:U,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(pS,{className:"h-4 w-4 mr-2"}),l("sponsor.label")]}),o.language==="zh"?r.jsxs("button",{onClick:V,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(mS,{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(fS,{className:"h-4 w-4 mr-2"}),l("discord.label")]}),r.jsxs("button",{onClick:j,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(sw,{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(V2,{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(X2,{className:"h-4 w-4 mr-2"}),l("app.logout")]})]}),r.jsx(cS,{isOpen:x,onClose:()=>w(!1),version:n}),r.jsx(uS,{open:T,onOpenChange:R}),r.jsx(dS,{open:O,onOpenChange:E})]})},gS=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}},xS=(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()},yS=async(a,n,l)=>{const o=xS(a,n,l);return await Ue(`/activities?${o}`)},bS=async a=>await Ue(`/activities/${a}`),vS=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}`:""}`)},wS=async()=>await Ue("/activities/filters"),SS=async(a=30)=>await Os(`/activities/cleanup?daysOld=${a}`),jS=({collapsed:a})=>{var p,g;const{t:n}=Ne(),{auth:l}=cs(),[o,c]=y.useState(!1),d="0.12.4";y.useEffect(()=>{gS().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&&C0("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(_g,{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(hS,{collapsed:a,version:d})})]})},NS=({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})}),CS=()=>{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(lS,{onToggleSidebar:l}),r.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[r.jsx(jS,{collapsed:a}),r.jsx(NS,{children:r.jsx(Mg,{})})]})]})},kS=({redirectPath:a="/login"})=>{const{t:n}=Ne(),{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(Mg,{}):r.jsx(uo,{to:a,replace:!0})},AS=({isOpen:a,onClose:n})=>{const{t:l}=Ne(),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")})]})]})})})},ES=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}},TS=()=>{const{t:a}=Ne(),[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}),[k,j]=y.useState(!1),{login:S,auth:D}=cs(),U=na(),V=la(),I=y.useMemo(()=>{const G=new URLSearchParams(U.search);return ES(G.get("returnUrl"))},[U.search]),M=y.useCallback(G=>{if(!G)return!1;const X=G.toLowerCase();return X.includes("failed to fetch")||X.includes("networkerror")||X.includes("network error")||X.includes("connection refused")||X.includes("unable to connect")||X.includes("fetch error")||X.includes("econnrefused")||X.includes("http 500")||X.includes("internal server error")||X.includes("proxy error")},[]),$=y.useCallback(()=>{if(!I)return"/";if(!I.startsWith("/oauth/authorize"))return I;const G=An();if(!G)return I;try{const X=window.location.origin,N=new URL(I,X);return N.searchParams.set("token",G),`${N.pathname}${N.search}${N.hash}`}catch{const X=I.includes("?")?"&":"?";return`${I}${X}token=${encodeURIComponent(G)}`}},[I]),pe=y.useCallback(()=>{I?window.location.assign($()):V("/")},[$,V,I]);y.useEffect(()=>{!D.loading&&D.isAuthenticated&&pe()},[D.isAuthenticated,D.loading,pe]),y.useEffect(()=>{(async()=>{var H,B,ce,Z;const N=(await Vg()).betterAuth;if(!(N!=null&&N.enabled)){E({google:!1,github:!1});return}R(N.basePath),E({google:((B=(H=N.providers)==null?void 0:H.google)==null?void 0:B.enabled)===!0,github:((Z=(ce=N.providers)==null?void 0:ce.github)==null?void 0:Z.enabled)===!0})})()},[]);const K=async G=>{G.preventDefault(),m(null),w(null),g(!0);try{if(!n||!o){m(a("auth.emptyFields")),g(!1);return}const X=await S(n,o);if(X.success)X.isUsingDefaultPassword?j(!0):pe();else{const N=X.message;M(N)?m(a("auth.serverUnavailable")):m(a("auth.loginFailed"))}}catch(X){const N=X instanceof Error?X.message:void 0;M(N)?m(a("auth.serverUnavailable")):m(a("auth.loginError"))}finally{g(!1)}},q=async G=>{w(null),b(G);try{await Fg(T).signIn.social({provider:G,callbackURL:I||"/",errorCallbackURL:`${Rl()}/login`})}catch(X){console.error("Social login error:",X),w(a("auth.socialLoginFailed")),b(null)}},Q=()=>{j(!1),pe()};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(Zg,{className:"h-5 w-5"})}),r.jsx(j0,{}),r.jsx(N0,{})]}),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:K,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:G=>l(G.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:G=>c(G.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:()=>q("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:()=>q("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(AS,{isOpen:k,onClose:Q})]})},Ml=a=>{const n=w0(),{refreshIfNeeded:l}=n;return y.useEffect(()=>{a!=null&&a.refreshOnMount&&l()},[a==null?void 0:a.refreshOnMount,l]),n},RS=()=>{const{t:a}=Ne(),{allServers:n,error:l,setError:o,isLoading:c}=Ml({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,disabled:n.filter(x=>x.enabled===!1).length,offline:n.filter(x=>x.status==="disconnected"&&x.enabled!==!1).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-5",children:Array.from({length:5}).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-5",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-gray-100 text-gray-700 icon-container",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 9v6m4-6v6m7-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.disabledServers")}),r.jsx("p",{className:"text-3xl font-bold text-gray-900",children:h.disabled})]})]})}),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-gray-500","aria-label":a("pages.dashboard.disabledServers"),children:"⏸"})})]},w)})})]})})]})]})},OS="modulepreload",zS=function(a,n){return new URL(a,n).href},Jh={},Qh=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=zS(b,o),b in Jh)return;Jh[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":OS,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)})},MS={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 eo({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",MS[n],o?"cursor-pointer":"",l),onClick:o,children:a})}const LS=({status:a,onAuthClick:n})=>{const{t:l}=Ne(),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)]})},E0=async(a,n)=>{try{const l=n?`/tools/${encodeURIComponent(n)}/${encodeURIComponent(a.toolName)}`:"/tools/call",o=await Et(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"}}},DS=async(a,n,l)=>{try{const o=await Et(`/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"}}},T0=async(a,n,l)=>{try{const o=await Ut(`/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"}}},PS=Object.freeze(Object.defineProperty({__proto__:null,callTool:E0,toggleTool:DS,updateToolDescription:T0},Symbol.toStringTag,{value:"Module"})),zs=()=>rS(),er=({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")})}),R0=({schema:a,onSubmit:n,onCancel:l,loading:o=!1,storageKey:c,title:d})=>{const{t:m}=Ne(),[p,g]=y.useState({}),[h,b]=y.useState({}),[x,w]=y.useState(!1),[T,R]=y.useState(""),[O,E]=y.useState(""),k=y.useMemo(()=>(q=>{const Q=G=>{if(typeof G=="object"&&G!==null){const X=G;return{type:X.type||"string",description:X.description,enum:X.enum,default:X.default,properties:X.properties?Object.fromEntries(Object.entries(X.properties).map(([N,H])=>[N,Q(H)])):void 0,required:X.required,items:X.items?Q(X.items):void 0}}return{type:"string"}};return{type:q.type,properties:q.properties?Object.fromEntries(Object.entries(q.properties).map(([G,X])=>[G,Q(X)])):void 0,required:q.required}})(a),[a]);y.useEffect(()=>{const K=(Q,G="")=>{const X={};return Q.type==="object"&&Q.properties&&Object.entries(Q.properties).forEach(([N,H])=>{const B=G?`${G}.${N}`:N;H.default!==void 0?X[N]=H.default:H.type==="string"?X[N]="":H.type==="number"||H.type==="integer"?X[N]=0:H.type==="boolean"?X[N]=!1:H.type==="array"?X[N]=[]:H.type==="object"&&(H.properties?X[N]=K(H,B):X[N]={})}),X};let q=K(k);if(c)try{const Q=localStorage.getItem(c);if(Q){const G=JSON.parse(Q);q={...q,...G}}}catch(Q){console.warn("Failed to load saved form data:",Q)}g(q)},[k,c]),y.useEffect(()=>{x&&Object.keys(p).length>0&&(R(JSON.stringify(p,null,2)),E(""))},[x,p]);const j=K=>{R(K),E("");try{const q=JSON.parse(K);if(g(q),c)try{localStorage.setItem(c,JSON.stringify(q))}catch(Q){console.warn("Failed to save form data to localStorage:",Q)}}catch{E(m("tool.invalidJsonFormat"))}},S=()=>{R(JSON.stringify(p,null,2)),E(""),w(!0)},D=()=>{if(T.trim())try{const K=JSON.parse(T);g(K),E(""),w(!1)}catch{E(m("tool.fixJsonBeforeSwitching"));return}else w(!1)},U=(K,q)=>{g(Q=>{const G={...Q},X=K.split(".");let N=G;for(let H=0;H<X.length-1;H++)N[X[H]]||(N[X[H]]={}),N=N[X[H]];if(N[X[X.length-1]]=q,c)try{localStorage.setItem(c,JSON.stringify(G))}catch(H){console.warn("Failed to save form data to localStorage:",H)}return G}),h[K]&&b(Q=>{const G={...Q};return delete G[K],G})},V=()=>{const K={},q=(Q,G,X="")=>{Q.type==="object"&&Q.properties&&Object.entries(Q.properties).forEach(([N,H])=>{var Z;const B=X?`${X}.${N}`:N,ce=G==null?void 0:G[N];if((Z=Q.required)!=null&&Z.includes(N)&&(ce==null||ce===""||Array.isArray(ce)&&ce.length===0)){K[B]=`${N} is required`;return}ce!=null&&ce!==""&&(H.type==="string"&&typeof ce!="string"?K[B]=`${N} must be a string`:H.type==="number"&&typeof ce!="number"?K[B]=`${N} must be a number`:H.type==="integer"&&(!Number.isInteger(ce)||typeof ce!="number")?K[B]=`${N} must be an integer`:H.type==="boolean"&&typeof ce!="boolean"?K[B]=`${N} must be a boolean`:H.type==="array"&&Array.isArray(ce)?H.items&&ce.forEach((A,L)=>{var z;((z=H.items)==null?void 0:z.type)==="object"&&H.items.properties&&q(H.items,A,`${B}.${L}`)}):H.type==="object"&&typeof ce=="object"&&q(H,ce,B))})};return q(k,p),b(K),Object.keys(K).length===0},I=K=>{K.preventDefault(),V()&&n(p)},M=(K,q)=>q.split(".").reduce((Q,G)=>Q==null?void 0:Q[G],K),$=(K,q,Q,G)=>{const X=Q==null?void 0:Q[K];return q.type==="string"?q.enum?r.jsxs("select",{value:X||"",onChange:N=>G(N.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")}),q.enum.map((N,H)=>r.jsx("option",{value:N,children:N},H))]}):r.jsx("input",{type:"text",value:X||"",onChange:N=>G(N.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:q.description||m("tool.enterKey",{key:K})}):q.type==="number"||q.type==="integer"?r.jsx("input",{type:"number",step:q.type==="integer"?"1":"any",value:X??"",onChange:N=>{const H=N.target.value===""?"":q.type==="integer"?parseInt(N.target.value):parseFloat(N.target.value);G(H)},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"}):q.type==="boolean"?r.jsx("input",{type:"checkbox",checked:X||!1,onChange:N=>G(N.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}):r.jsx("input",{type:"text",value:X||"",onChange:N=>G(N.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:q.description||m("tool.enterKey",{key:K})})},pe=(K,q,Q="")=>{var H,B,ce,Z,A,L,z,P,le,ee,Y,ge,ae,ye;const G=Q?`${Q}.${K}`:K,X=M(p,G),N=h[G];if(q.type==="array"){const de=M(p,G)||[];return r.jsxs("div",{className:"mb-6",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[K,(Q?(B=(H=M(k,Q))==null?void 0:H.required)==null?void 0:B.includes(K):(ce=k.required)==null?void 0:ce.includes(K))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),q.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:q.description}),r.jsxs("div",{className:"border border-gray-200 rounded-md p-3 bg-gray-50",children:[de.map((oe,xe)=>{var Xe,$t,Yt;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=[...de];Ze.splice(xe,1),U(G,Ze)},className:"text-status-red hover:text-red-700 text-sm",children:m("common.remove")})]}),((Xe=q.items)==null?void 0:Xe.type)==="string"&&q.items.enum?r.jsxs("select",{value:oe||"",onChange:Ze=>{const gt=[...de];gt[xe]=Ze.target.value,U(G,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")}),q.items.enum.map((Ze,gt)=>r.jsx("option",{value:Ze,children:Ze},gt))]}):(($t=q.items)==null?void 0:$t.type)==="object"&&q.items.properties?r.jsx("div",{className:"space-y-3",children:Object.entries(q.items.properties).map(([Ze,gt])=>{var Jt,_t;return r.jsxs("div",{children:[r.jsxs("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[Ze,((_t=(Jt=q.items)==null?void 0:Jt.required)==null?void 0:_t.includes(Ze))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),$(Ze,gt,oe,Qt=>{const Ht=[...de];Ht[xe]={...Ht[xe],[Ze]:Qt},U(G,Ht)})]},Ze)})}):r.jsx("input",{type:"text",value:oe||"",onChange:Ze=>{const gt=[...de];gt[xe]=Ze.target.value,U(G,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:((Yt=q.items)==null?void 0:Yt.type)||"value"})})]},xe)}),r.jsx("button",{type:"button",onClick:()=>{var xe;const oe=((xe=q.items)==null?void 0:xe.type)==="object"?{}:"";U(G,[...de,oe])},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:K})})]}),N&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:N})]},G)}return q.type==="object"?q.properties?r.jsxs("div",{className:"mb-6",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[K,(Q?(A=(Z=M(k,Q))==null?void 0:Z.required)==null?void 0:A.includes(K):(L=k.required)==null?void 0:L.includes(K))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),q.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:q.description}),r.jsx("div",{className:"border border-gray-200 rounded-md p-4 bg-gray-50",children:Object.entries(q.properties).map(([de,oe])=>pe(de,oe,G))}),N&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:N})]},G):r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[K,(Q?(P=(z=M(k,Q))==null?void 0:z.required)==null?void 0:P.includes(K):(le=k.required)==null?void 0:le.includes(K))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"}),r.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(JSON object)"})]}),q.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:q.description}),r.jsx("textarea",{value:typeof X=="object"?JSON.stringify(X,null,2):X||"{}",onChange:de=>{try{const oe=JSON.parse(de.target.value);U(G,oe)}catch{U(G,de.target.value)}},placeholder:`{
|
|
208
|
-
"key": "value"
|
|
209
|
-
}`,className:`w-full border rounded-md px-3 py-2 font-mono text-sm ${N?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`,rows:4}),N&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:N})]},G):q.type==="string"?q.enum?r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[K,(Q?!1:(ee=k.required)==null?void 0:ee.includes(K))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),q.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:q.description}),r.jsxs("select",{value:X||"",onChange:de=>U(G,de.target.value),className:`w-full border rounded-md px-3 py-2 ${N?"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")}),q.enum.map((de,oe)=>r.jsx("option",{value:de,children:de},oe))]}),N&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:N})]},G):r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[K,(Q?!1:(Y=k.required)==null?void 0:Y.includes(K))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),q.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:q.description}),r.jsx("input",{type:"text",value:X||"",onChange:de=>U(G,de.target.value),className:`w-full border rounded-md px-3 py-2 ${N?"border-red":"border-gray-200"} focus:outline-none form-input`}),N&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:N})]},G):q.type==="number"||q.type==="integer"?r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[K,(Q?!1:(ge=k.required)==null?void 0:ge.includes(K))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),q.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:q.description}),r.jsx("input",{type:"number",step:q.type==="integer"?"1":"any",value:X??"",onChange:de=>{const oe=de.target.value===""?"":q.type==="integer"?parseInt(de.target.value):parseFloat(de.target.value);U(G,oe)},className:`w-full border rounded-md px-3 py-2 form-input ${N?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),N&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:N})]},G):q.type==="boolean"?r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex items-center",children:[r.jsx("input",{type:"checkbox",checked:X||!1,onChange:de=>U(G,de.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:[K,(Q?!1:(ae=k.required)==null?void 0:ae.includes(K))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"})]})]}),q.description&&r.jsx("p",{className:"text-xs text-gray-500 mt-1",children:q.description}),N&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:N})]},G):r.jsxs("div",{className:"mb-4",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[K,(Q?!1:(ye=k.required)==null?void 0:ye.includes(K))&&r.jsx("span",{className:"text-status-red ml-1",children:"*"}),r.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",q.type,")"]})]}),q.description&&r.jsx("p",{className:"text-xs text-gray-500 mb-2",children:q.description}),r.jsx("input",{type:"text",value:X||"",onChange:de=>U(G,de.target.value),placeholder:m("tool.enterValue",{type:q.type}),className:`w-full border rounded-md px-3 py-2 ${N?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500 form-input`}),N&&r.jsx("p",{className:"text-status-red text-xs mt-1",children:N})]},G)};return k.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:K=>j(K.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 K=JSON.parse(T);n(K)}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:I,className:"space-y-4",children:[Object.entries(k.properties||{}).map(([K,q])=>pe(K,q)),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")})]})]})},US=({result:a,onClose:n})=>{const{t:l}=Ne(),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(Wg,{size:20,className:"text-status-green"}):r.jsx(e0,{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(Sd,{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 _S(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 BS=({tool:a,server:n,onToggle:l,onDescriptionUpdate:o})=>{const{t:c}=Ne(),{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),[k,j]=y.useState(a.description||""),S=y.useRef(null),D=y.useRef(null),[U,V]=y.useState(0),[I,M]=y.useState(!1);y.useEffect(()=>{O&&S.current&&(S.current.focus(),U>0&&(S.current.style.width=`${U+20}px`))},[O,U]),y.useEffect(()=>{!O&&D.current&&V(D.current.offsetWidth)},[O,k]);const $=y.useCallback(()=>`mcphub_tool_form_${n?`${n}_`:""}${a.name}`,[a.name,n]),pe=y.useCallback(()=>{localStorage.removeItem($())},[$]),K=Z=>{l&&l(a.name,Z)},q=()=>{E(!0)},Q=async()=>{try{const Z=await T0(n,a.name,k);Z.success?(E(!1),o&&o(a.name,k)):(j(a.description||""),console.error("Failed to update tool description:",Z.error))}catch(Z){console.error("Error updating tool description:",Z),j(a.description||""),E(!1)}},G=Z=>{j(Z.target.value)},X=Z=>{Z.key==="Enter"?Q():Z.key==="Escape"&&(j(a.description||""),E(!1))},N=async Z=>{Z.stopPropagation();try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(a.name),M(!0),d(c("common.copySuccess"),"success"),setTimeout(()=>M(!1),2e3);else{const A=document.createElement("textarea");A.value=a.name,A.style.position="fixed",A.style.left="-9999px",document.body.appendChild(A),A.focus(),A.select();try{document.execCommand("copy"),M(!0),d(c("common.copySuccess"),"success"),setTimeout(()=>M(!1),2e3)}catch(L){d(c("common.copyFailed"),"error"),console.error("Copy to clipboard failed:",L)}document.body.removeChild(A)}}catch(A){d(c("common.copyFailed"),"error"),console.error("Copy to clipboard failed:",A)}},H=async Z=>{w(!0);try{Z=Object.fromEntries(Object.entries(Z).filter(([L,z])=>!_S(z)));const A=await E0({toolName:a.name,arguments:Z},n);R(A)}catch(A){R({success:!1,error:A instanceof Error?A.message:"Unknown error occurred"})}finally{w(!1)}},B=()=>{b(!1),pe(),R(null)},ce=()=>{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:Z=>{Z.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:N,title:c("common.copy"),children:I?r.jsx(os,{size:16,className:"text-green-500"}):r.jsx(Sn,{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:k,onChange:G,onKeyDown:X,onClick:Z=>Z.stopPropagation(),style:{minWidth:"100px",width:U>0?`${U+20}px`:"auto"}}),r.jsx("button",{className:"ml-2 p-1 text-green-600 hover:text-green-800 cursor-pointer transition-colors",onClick:Z=>{Z.stopPropagation(),Q()},children:r.jsx(os,{size:16})})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{ref:D,children:k||c("tool.noDescription")}),r.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:Z=>{Z.stopPropagation(),q()},children:r.jsx(zl,{size:14})})]})})]})}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx("div",{className:"flex items-center space-x-2",onClick:Z=>Z.stopPropagation(),children:r.jsx(er,{checked:a.enabled??!0,onCheckedChange:K,disabled:x})}),r.jsxs("button",{onClick:Z=>{Z.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(t0,{size:14,className:"animate-spin"}):r.jsx(r0,{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(Ol,{size:18}):r.jsx(wd,{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(R0,{schema:a.inputSchema||{type:"object"},onSubmit:H,onCancel:B,loading:x,storageKey:$(),title:c("tool.runToolWithName",{name:a.name.replace(n+m,"")})}),T&&r.jsx("div",{className:"mt-4",children:r.jsx(US,{result:T,onClose:ce})})]})]})]})},O0=async(a,n)=>{try{const l=await Et(`/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"}}},IS=async(a,n,l)=>{try{const o=await Et(`/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"}}},z0=async(a,n,l)=>{try{const o=await Ut(`/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"}}},HS=Object.freeze(Object.defineProperty({__proto__:null,getPrompt:O0,togglePrompt:IS,updatePromptDescription:z0},Symbol.toStringTag,{value:"Module"})),Xh=({result:a,onClose:n})=>{const{t:l}=Ne(),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(Wg,{size:20,className:"text-status-green"}):r.jsx(e0,{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(Sd,{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")})})]})})]})},GS=({prompt:a,server:n,onToggle:l,onDescriptionUpdate:o})=>{const{t:c}=Ne(),{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),[k,j]=y.useState(a.description||""),S=y.useRef(null),D=y.useRef(null),[U,V]=y.useState(0);y.useEffect(()=>{O&&S.current&&(S.current.focus(),U>0&&(S.current.style.width=`${U+20}px`))},[O,U]),y.useEffect(()=>{!O&&D.current&&V(D.current.offsetWidth)},[O,k]);const I=y.useCallback(()=>`mcphub_prompt_form_${n?`${n}_`:""}${a.name}`,[a.name,n]),M=y.useCallback(()=>{localStorage.removeItem(I())},[I]),$=B=>{l&&l(a.name,B)},pe=()=>{E(!0)},K=async()=>{E(!1);try{const B=await z0(n,a.name,k);B.success?(d(c("prompt.descriptionUpdateSuccess"),"success"),o&&o(a.name,k)):(d(B.error||c("prompt.descriptionUpdateFailed"),"error"),j(a.description||""))}catch(B){console.error("Error updating prompt description:",B),d(c("prompt.descriptionUpdateFailed"),"error"),j(a.description||"")}},q=B=>{j(B.target.value)},Q=B=>{B.key==="Enter"?K():B.key==="Escape"&&(j(a.description||""),E(!1))},G=async B=>{w(!0);try{const ce=await O0({promptName:a.name,arguments:B},n);console.log("GetPrompt result:",ce),R({success:ce.success,data:ce.data,error:ce.error})}catch(ce){R({success:!1,error:ce instanceof Error?ce.message:"Unknown error occurred"})}finally{w(!1)}},X=()=>{b(!1),M(),R(null)},N=()=>{R(null)},H=()=>{if(!a.arguments||a.arguments.length===0)return{type:"object",properties:{},required:[]};const B={},ce=[];return a.arguments.forEach(Z=>{B[Z.name]={type:"string",description:Z.description||""},Z.required&&ce.push(Z.name)}),{type:"object",properties:B,required:ce}};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:k,onChange:q,onKeyDown:Q,onClick:B=>B.stopPropagation(),style:{minWidth:"100px",width:U>0?`${U+20}px`:"auto"}}),r.jsx("button",{className:"ml-2 p-1 text-green-600 hover:text-green-800 cursor-pointer transition-colors",onClick:B=>{B.stopPropagation(),K()},children:r.jsx(os,{size:16})})]}):r.jsxs(r.Fragment,{children:[r.jsx("span",{ref:D,children:k||c("tool.noDescription")}),r.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:B=>{B.stopPropagation(),pe()},children:r.jsx(zl,{size:14})})]})})]})}),r.jsxs("div",{className:"flex items-center space-x-2",children:[r.jsx("div",{className:"flex items-center space-x-2",onClick:B=>B.stopPropagation(),children:a.enabled!==void 0&&r.jsx(er,{checked:a.enabled,onCheckedChange:$,disabled:x})}),r.jsxs("button",{onClick:B=>{B.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(t0,{size:14,className:"animate-spin"}):r.jsx(r0,{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(Ol,{size:18}):r.jsx(wd,{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(R0,{schema:H(),onSubmit:G,onCancel:X,loading:x,storageKey:I(),title:c("prompt.runPromptWithName",{name:a.name.replace(n+m,"")})}),T&&r.jsx("div",{className:"mt-4",children:r.jsx(Xh,{result:T,onClose:N})})]}),!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((B,ce)=>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:B.name}),B.required&&r.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),B.description&&r.jsx("p",{className:"text-sm text-gray-600 mt-1",children:B.description})]}),r.jsx("div",{className:"text-xs text-gray-500 ml-2",children:B.title||""})]},ce))})]}),!h&&T&&r.jsx("div",{className:"mt-4",children:r.jsx(Xh,{result:T,onClose:N})})]})]})},Nd=({isOpen:a,onClose:n,onConfirm:l,serverName:o,isGroup:c=!1,isUser:d=!1})=>{const{t:m}=Ne();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},KS=({server:a,onRemove:n,onEdit:l,onToggle:o,onRefresh:c,onReload:d})=>{var ce,Z,A,L,z;const{t:m}=Ne(),{showToast:p}=us(),[g,h]=y.useState(!1),[b,x]=y.useState(!1),[w,T]=y.useState(!1),[R,O]=y.useState(!1),[E,k]=y.useState(!1),[j,S]=y.useState(!1),D=y.useRef(null);y.useEffect(()=>{const P=le=>{D.current&&!D.current.contains(le.target)&&k(!1)};return document.addEventListener("mousedown",P),()=>{document.removeEventListener("mousedown",P)}},[]);const{exportMCPSettings:U}=zs(),V=((ce=a.tools)==null?void 0:ce.length)||0,I=((Z=a.tools)==null?void 0:Z.filter(P=>P.enabled!==!1).length)||0,M=P=>{P.stopPropagation(),x(!0)},$=P=>{P.stopPropagation(),l(a)},pe=async P=>{if(P.stopPropagation(),!(w||!o)){T(!0);try{await o(a,a.enabled===!1)}finally{T(!1)}}},K=async P=>{if(P.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)}}},q=P=>{P.stopPropagation(),k(!E)},Q=P=>{if(P.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 le=document.createElement("textarea");le.value=a.error,le.style.position="fixed",le.style.left="-9999px",document.body.appendChild(le),le.focus(),le.select();try{document.execCommand("copy"),S(!0),p(m("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>S(!1),2e3)}catch(ee){p(m("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",ee)}document.body.removeChild(le)}},G=async P=>{P.stopPropagation();try{const le=await U(a.name);if(!le||!le.success||!le.data){p((le==null?void 0:le.message)||m("common.copyFailed")||"Copy failed","error");return}const ee=JSON.stringify(le.data,null,2);if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(ee),p(m("common.copySuccess")||"Copied to clipboard","success");else{const Y=document.createElement("textarea");Y.value=ee,Y.style.position="fixed",Y.style.left="-9999px",document.body.appendChild(Y),Y.focus(),Y.select();try{document.execCommand("copy"),p(m("common.copySuccess")||"Copied to clipboard","success")}catch(ge){p(m("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",ge)}document.body.removeChild(Y)}}catch(le){console.error("Error copying server configuration:",le),p(m("common.copyFailed")||"Copy failed","error")}},X=()=>{n(a.name),x(!1)},N=async(P,le)=>{try{const{toggleTool:ee}=await Qh(async()=>{const{toggleTool:ge}=await Promise.resolve().then(()=>PS);return{toggleTool:ge}},[],import.meta.url),Y=await ee(a.name,P,le);Y.success?(p(m(le?"tool.enableSuccess":"tool.disableSuccess",{name:P}),"success"),c&&c()):p(Y.error||m("tool.toggleFailed"),"error")}catch(ee){console.error("Error toggling tool:",ee),p(m("tool.toggleFailed"),"error")}},H=async(P,le)=>{try{const{togglePrompt:ee}=await Qh(async()=>{const{togglePrompt:ge}=await Promise.resolve().then(()=>HS);return{togglePrompt:ge}},void 0,import.meta.url),Y=await ee(a.name,P,le);Y.success?(p(m(le?"tool.enableSuccess":"tool.disableSuccess",{name:P}),"success"),c&&c()):p(Y.error||m("tool.toggleFailed"),"error")}catch(ee){console.error("Error toggling prompt:",ee),p(m("tool.toggleFailed"),"error")}},B=P=>{var le;if(P.stopPropagation(),(le=a.oauth)!=null&&le.authorizationUrl){const ge=window.screen.width/2-300,ae=window.screen.height/2-700/2;window.open(a.oauth.authorizationUrl,"OAuth Authorization",`width=600,height=700,left=${ge},top=${ae}`),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",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-2",children:[r.jsx("h2",{className:`text-xl font-semibold ${a.enabled===!1?"text-gray-600":"text-gray-900"}`,children:a.name}),((A=a.config)==null?void 0:A.description)&&r.jsxs("span",{className:"text-sm text-gray-500",children:["(",a.config.description,")"]}),r.jsx(LS,{status:a.status,onAuthClick:B}),((L=a.config)==null?void 0:L.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:[I,"/",V," ",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:[((z=a.prompts)==null?void 0:z.length)||0," ",m("server.prompts")]})]}),a.error&&r.jsxs("div",{className:"relative",children:[r.jsx("div",{className:"cursor-pointer",onClick:q,"aria-label":m("server.viewErrorDetails"),children:r.jsx(Sd,{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:P=>P.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:Q,className:"p-1 text-gray-400 hover:text-gray-600 transition-colors btn-secondary",title:m("common.copy"),children:j?r.jsx(os,{size:14,className:"text-green-500"}):r.jsx(Sn,{size:14})})]}),r.jsx("button",{onClick:P=>{P.stopPropagation(),k(!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:G,className:"px-3 py-1 btn-secondary",children:m("server.copy")}),r.jsx("button",{onClick:$,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:pe,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-blue-100 text-blue-800 hover:bg-blue-200 btn-primary"}`,disabled:w||R,children:w?m("common.processing"):a.enabled!==!1?m("server.disable"):m("server.enable")})}),d&&r.jsx("button",{onClick:K,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||a.enabled===!1,children:m(R?"common.processing":"server.reload")}),r.jsx("button",{onClick:M,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(Ol,{size:18}):r.jsx(wd,{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((P,le)=>r.jsx(BS,{server:a.name,tool:P,onToggle:N},le))})]}),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((P,le)=>r.jsx(GS,{server:a.name,prompt:P,onToggle:H},le))})]})]})]}),r.jsx(Nd,{isOpen:b,onClose:()=>x(!1),onConfirm:X,serverName:a.name})]})},Ll=({onSubmit:a,onCancel:n,initialData:l=null,modalTitle:o,formError:c=null})=>{var L,z,P,le,ee,Y,ge,ae,ye,de,oe,xe,Xe,$t,Yt,Ze,gt,Jt,_t,Qt,Ht,fr,tt,St,lr,ze,jt,Ce,nt,lt,rr,Xt,ft,ar,xt,Ma,ia,La,pr,hr,W,ve,Fe,Nt,Vr,oa,$r,Ve,it;const{t:d}=Ne(),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(([ie,be])=>({key:ie,value:be,description:""})),g=he=>{var be;const ie=(be=he==null?void 0:he.config)==null?void 0:be.oauth;return{clientId:(ie==null?void 0:ie.clientId)||"",clientSecret:(ie==null?void 0:ie.clientSecret)||"",scopes:ie!=null&&ie.scopes?ie.scopes.join(" "):"",accessToken:(ie==null?void 0:ie.accessToken)||"",refreshToken:(ie==null?void 0:ie.refreshToken)||"",authorizationEndpoint:(ie==null?void 0:ie.authorizationEndpoint)||"",tokenEndpoint:(ie==null?void 0:ie.tokenEndpoint)||"",resource:(ie==null?void 0:ie.resource)||""}},[h,b]=y.useState(m()),[x,w]=y.useState({name:l&&l.name||"",description:l&&l.config&&l.config.description||"",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:((L=l==null?void 0:l.config)==null?void 0:L.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:((P=l.config.openapi.security)==null?void 0:P.type)||"none",apiKeyName:((ee=(le=l.config.openapi.security)==null?void 0:le.apiKey)==null?void 0:ee.name)||"",apiKeyIn:((ge=(Y=l.config.openapi.security)==null?void 0:Y.apiKey)==null?void 0:ge.in)||"header",apiKeyValue:((ye=(ae=l.config.openapi.security)==null?void 0:ae.apiKey)==null?void 0:ye.value)||"",httpScheme:((oe=(de=l.config.openapi.security)==null?void 0:de.http)==null?void 0:oe.scheme)||"bearer",httpCredentials:((Xe=(xe=l.config.openapi.security)==null?void 0:xe.http)==null?void 0:Xe.credentials)||"",oauth2Token:((Yt=($t=l.config.openapi.security)==null?void 0:$t.oauth2)==null?void 0:Yt.token)||"",openIdConnectUrl:((gt=(Ze=l.config.openapi.security)==null?void 0:Ze.openIdConnect)==null?void 0:gt.url)||"",openIdConnectToken:((_t=(Jt=l.config.openapi.security)==null?void 0:Jt.openIdConnect)==null?void 0:_t.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,ie])=>({key:he,value:ie})):[]),[O,E]=y.useState(l&&l.config&&l.config.headers?Object.entries(l.config.headers).map(([he,ie])=>({key:he,value:ie})):[]),[k,j]=y.useState(!1),[S,D]=y.useState(!1),[U,V]=y.useState(!1),[I,M]=y.useState(null),$=!!l,pe=he=>{const{name:ie,value:be}=he.target;w({...x,[ie]:be})},K=he=>{const ie=he.split(" ").filter(be=>be.trim()!=="");w({...x,arguments:he,args:ie})},q=he=>{b(he),w(ie=>({...ie,type:he}))},Q=(he,ie,be)=>{const sr=[...T];sr[he][ie]=be,R(sr)},G=()=>{R([...T,{key:"",value:""}])},X=he=>{const ie=[...T];ie.splice(he,1),R(ie)},N=(he,ie,be)=>{const sr=[...O];sr[he][ie]=be,E(sr)},H=()=>{E([...O,{key:"",value:""}])},B=he=>{const ie=[...O];ie.splice(he,1),E(ie)},ce=(he,ie)=>{w(be=>({...be,oauth:{...be.oauth||{},[he]:ie}}))},Z=(he,ie)=>{w(be=>({...be,options:{...be.options,[he]:ie}}))},A=async he=>{var ie,be,sr,Yr,ds,ca;he.preventDefault(),M(null);try{const Tt={};T.forEach(({key:Te,value:_e})=>{Te.trim()&&(Tt[Te.trim()]=_e)});const $e={};O.forEach(({key:Te,value:_e})=>{Te.trim()&&($e[Te.trim()]=_e)});const yt={};(ie=x.options)!=null&&ie.timeout&&x.options.timeout!==6e4&&(yt.timeout=x.options.timeout),(be=x.options)!=null&&be.resetTimeoutOnProgress&&(yt.resetTimeoutOnProgress=x.options.resetTimeoutOnProgress),(sr=x.options)!=null&&sr.maxTotalTimeout&&(yt.maxTotalTimeout=x.options.maxTotalTimeout);const Gt=(()=>{if(!x.oauth)return;const{clientId:Te,clientSecret:_e,scopes:qe,accessToken:ct,refreshToken:Jr,authorizationEndpoint:gr,tokenEndpoint:xr,resource:Ar}=x.oauth,bt={};if(Te&&Te.trim()&&(bt.clientId=Te.trim()),_e&&_e.trim()&&(bt.clientSecret=_e.trim()),qe&&qe.trim()){const Ct=qe.split(/[\s,]+/).map(Ms=>Ms.trim()).filter(Ms=>Ms.length>0);Ct.length>0&&(bt.scopes=Ct)}return ct&&ct.trim()&&(bt.accessToken=ct.trim()),Jr&&Jr.trim()&&(bt.refreshToken=Jr.trim()),gr&&gr.trim()&&(bt.authorizationEndpoint=gr.trim()),xr&&xr.trim()&&(bt.tokenEndpoint=xr.trim()),Ar&&Ar.trim()&&(bt.resource=Ar.trim()),Object.keys(bt).length>0?bt:void 0})(),Ee={name:x.name,config:{type:h,description:((Yr=x.description)==null?void 0:Yr.trim())||void 0,...h==="openapi"?{openapi:(()=>{var _e,qe,ct,Jr,gr,xr,Ar;const Te={version:((_e=x.openapi)==null?void 0:_e.version)||"3.1.0"};if(((qe=x.openapi)==null?void 0:qe.inputMode)==="url")Te.url=((ct=x.openapi)==null?void 0:ct.url)||"";else if(((Jr=x.openapi)==null?void 0:Jr.inputMode)==="schema"&&((gr=x.openapi)!=null&&gr.schema))try{Te.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"&&(Te.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||""}}}),(Ar=x.openapi)!=null&&Ar.passthroughHeaders&&x.openapi.passthroughHeaders.trim()&&(Te.passthroughHeaders=x.openapi.passthroughHeaders.split(",").map(bt=>bt.trim()).filter(bt=>bt.length>0)),Te})(),...Object.keys($e).length>0?{headers:$e}:{}}:h==="sse"||h==="streamable-http"?{url:x.url,...Object.keys($e).length>0?{headers:$e}:{},...Object.keys(Tt).length>0?{env:Tt}:{},...Gt?{oauth:Gt}:{}}:{command:x.command,args:x.args,env:Object.keys(Tt).length>0?Tt:void 0},...Object.keys(yt).length>0?{options:yt}:{},...h==="sse"||h==="streamable-http"?{enableKeepAlive:((ds=x.keepAlive)==null?void 0:ds.enabled)||!1,...(ca=x.keepAlive)!=null&&ca.enabled?{keepAliveInterval:x.keepAlive.interval||6e4}:{}}:{}}};a(Ee)}catch(Tt){M(`Error: ${Tt instanceof Error?Tt.message:String(Tt)}`)}};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:"✕"})]}),(I||c)&&r.jsx("div",{className:"bg-red-50 text-red-700 p-3 rounded mb-4",children:c||I}),r.jsxs("form",{onSubmit:A,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:pe,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",htmlFor:"description",children:d("server.description")}),r.jsx("input",{type:"text",name:"description",id:"description",value:x.description||"",onChange:pe,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:d("server.descriptionPlaceholder")})]}),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:()=>q("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:()=>q("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:()=>q("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:()=>q("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:((Qt=x.openapi)==null?void 0:Qt.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:((Ht=x.openapi)==null?void 0:Ht.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")})]})]})]}),((fr=x.openapi)==null?void 0:fr.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(ie=>({...ie,openapi:{...ie.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"&&((St=x.openapi)==null?void 0:St.inputMode)==="url"})]}),((lr=x.openapi)==null?void 0:lr.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(ie=>({...ie,openapi:{...ie.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"&&((jt=x.openapi)==null?void 0:jt.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:((Ce=x.openapi)==null?void 0:Ce.securityType)||"none",onChange:he=>w(ie=>{var be;return{...ie,openapi:{...ie.openapi,securityType:he.target.value,url:((be=ie.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(ie=>{var be;return{...ie,openapi:{...ie.openapi,apiKeyName:he.target.value,url:((be=ie.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:((rr=x.openapi)==null?void 0:rr.apiKeyIn)||"header",onChange:he=>w(ie=>{var be;return{...ie,openapi:{...ie.openapi,apiKeyIn:he.target.value,url:((be=ie.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:((Xt=x.openapi)==null?void 0:Xt.apiKeyValue)||"",onChange:he=>w(ie=>{var be;return{...ie,openapi:{...ie.openapi,apiKeyValue:he.target.value,url:((be=ie.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:((ar=x.openapi)==null?void 0:ar.httpScheme)||"bearer",onChange:he=>w(ie=>{var be;return{...ie,openapi:{...ie.openapi,httpScheme:he.target.value,url:((be=ie.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(ie=>{var be;return{...ie,openapi:{...ie.openapi,httpCredentials:he.target.value,url:((be=ie.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(ie=>{var be;return{...ie,openapi:{...ie.openapi,oauth2Token:he.target.value,url:((be=ie.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"})]})})]}),((pr=x.openapi)==null?void 0:pr.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:((hr=x.openapi)==null?void 0:hr.openIdConnectUrl)||"",onChange:he=>w(ie=>{var be;return{...ie,openapi:{...ie.openapi,openIdConnectUrl:he.target.value,url:((be=ie.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(ie=>{var be;return{...ie,openapi:{...ie.openapi,openIdConnectToken:he.target.value,url:((be=ie.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(ie=>{var be;return{...ie,openapi:{...ie.openapi,passthroughHeaders:he.target.value,url:((be=ie.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: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:"+"})]}),O.map((he,ie)=>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=>N(ie,"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=>N(ie,"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:()=>B(ie),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:"-"})]},ie))]})]}):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:pe,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: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:"+"})]}),O.map((he,ie)=>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=>N(ie,"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=>N(ie,"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:()=>B(ie),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:"-"})]},ie))]}),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:G,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,ie)=>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=>Q(ie,"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=>Q(ie,"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:()=>X(ie),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:"-"})]},ie))]}),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:((Fe=x.oauth)==null?void 0:Fe.clientId)||"",onChange:he=>ce("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:((Nt=x.oauth)==null?void 0:Nt.clientSecret)||"",onChange:he=>ce("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:pe,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=>K(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:G,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,ie)=>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=>Q(ie,"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=>Q(ie,"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:()=>X(ie),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:"-"})]},ie))]})]}),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:()=>j(!k),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:k?"▼":"▶"})]}),k&&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=>Z("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=>Z("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=>Z("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:()=>V(!U),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:U?"▼":"▶"})]}),U&&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(ie=>({...ie,keepAlive:{...ie.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(ie=>({...ie,keepAlive:{...ie.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($?"server.save":"server.add")})]})]})]})},M0=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)},qS=({onAdd:a})=>{const{t:n}=Ne(),[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 k=await Et("/servers",E);if(!k.success){k&&k.message?d(k.message):d(n("server.addError"));return}o(!1),a()}catch(k){console.error("Error adding server:",k),navigator.onLine?k instanceof TypeError&&(k.message.includes("NetworkError")||k.message.includes("Failed to fetch"))?d(n("errors.serverConnection")):d(n("errors.serverAdd")):d(n("errors.network"))}},O=async E=>{try{const k=M0(E);k.length>0?(x(k),h(E),p(!0)):await R(E)}catch(k){console.error("Error processing server submission:",k),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(Ll,{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,k)=>r.jsxs("li",{className:"font-mono",children:["$",`{${E}}`]},k))})]})]})}),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")})]})]})})]})},FS=({server:a,onEdit:n,onCancel:l})=>{const{t:o}=Ne(),[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 Ut(`/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(Ll,{onSubmit:m,onCancel:l,initialData:a,modalTitle:o("server.editTitle",{serverName:a.name}),formError:c})})},VS=({isOpen:a,onClose:n,onConfirm:l,title:o,message:c,confirmText:d,cancelText:m,variant:p="warning"})=>{const{t:g}=Ne();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")})]})]})})})},$S=({onSuccess:a,onCancel:n})=>{const{t:l}=Ne(),[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(""),[k,j]=y.useState(!1),[S,D]=y.useState(""),U=G=>{G.preventDefault(),c(!0)},V=G=>{G.preventDefault(),c(!1)},I=G=>{G.preventDefault(),c(!1);const X=G.dataTransfer.files;if(X.length>0){const N=X[0];N.name.endsWith(".mcpb")?(b(N),g(null)):g(l("mcpb.invalidFileType"))}},M=G=>{const X=G.target.files;if(X&&X.length>0){const N=X[0];N.name.endsWith(".mcpb")?(b(N),g(null)):g(l("mcpb.invalidFileType"))}},$=async()=>{if(!h){g(l("mcpb.noFileSelected"));return}m(!0),g(null);try{const G=new FormData;G.append("mcpbFile",h);const X=await bd(yd("/mcpb/upload"),{method:"POST",body:G}),N=await X.json();if(!X.ok)throw new Error(N.message||`HTTP error! Status: ${X.status}`);if(N.success&&N.data)R(N.data.manifest),E(N.data.extractDir),w(!0);else throw new Error(N.message||l("mcpb.uploadFailed"))}catch(G){console.error("MCPB upload error:",G),g(G instanceof Error?G.message:l("mcpb.uploadFailed"))}finally{m(!1)}},pe=async(G,X=!1)=>{var N;m(!0),g(null);try{const H=Q(T,O,G);if(!X){const ce=await Ue("/servers");if(ce.success&&((N=ce.data)==null?void 0:N.find(A=>A.name===G))){D(G),j(!0),m(!1);return}}let B;if(X?B=await Ut(`/servers/${encodeURIComponent(G)}`,{name:G,config:H}):B=await Et("/servers",{name:G,config:H}),B.success)a(H);else throw new Error(B.message||l("mcpb.installFailed"))}catch(H){console.error("MCPB install error:",H),g(H instanceof Error?H.message:l("mcpb.installFailed")),m(!1)}},K=()=>{j(!1),S&&pe(S,!0)},q=()=>{j(!1),D(""),m(!1)},Q=(G,X,N)=>{var ce;const H=((ce=G.server)==null?void 0:ce.mcp_config)||{},B={type:"stdio",command:H.command||"node",args:(H.args||[]).map(Z=>Z.replace("${__dirname}",X))};return H.env&&Object.keys(H.env).length>0&&(B.env={...H.env},Object.keys(B.env).forEach(Z=>{typeof B.env[Z]=="string"&&(B.env[Z]=B.env[Z].replace("${__dirname}",X))})),B};return x&&T?r.jsxs(r.Fragment,{children:[r.jsx(VS,{isOpen:k,onClose:q,onConfirm:K,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 ${k?"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((G,X)=>r.jsxs("li",{children:[G.name," - ",G.description]},X))})]})]})]}),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 G=document.getElementById("serverName"),X=(G==null?void 0:G.value.trim())||T.name;pe(X)},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:U,onDragLeave:V,onDrop:I,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:M,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:$,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")})]})]})})},YS=({onSuccess:a,onCancel:n})=>{const{t:l}=Ne(),[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(([k,j])=>{const S={};return j.type==="sse"||j.type==="streamable-http"?(S.type=j.type,S.url=j.url,j.headers&&(S.headers=j.headers)):j.type==="openapi"?(S.type="openapi",S.openapi=j.openapi):(S.type="stdio",S.command=j.command,S.args=j.args||[],j.env&&(S.env=j.env)),{name:k,config:S}});b(E)},R=async()=>{if(h){g(!0),m(null);try{const O=await Et("/servers/batch",{servers:h});if(O.success&&O.data){const{successCount:E,failureCount:k,results:j}=O.data;if(k>0){const S=j.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")})]})]})]})})},Cd=({currentPage:a,totalPages:n,onPageChange:l,disabled:o=!1})=>{const{t:c}=Ne(),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")," »"]})]})},JS=()=>{const{t:a}=Ne(),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}=Ml({refreshOnMount:!0}),[k,j]=y.useState(null),[S,D]=y.useState(!1),[U,V]=y.useState(!1),[I,M]=y.useState(!1),$=async G=>{const X=await w(G);X&&j(X)},pe=()=>{j(null),E()},K=async()=>{D(!0);try{E(),await new Promise(G=>setTimeout(G,500))}finally{D(!1)}},q=G=>{V(!1),E()},Q=()=>{M(!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(qS,{onAdd:x}),r.jsxs("button",{onClick:()=>M(!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:()=>V(!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:K,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((G,X)=>r.jsx(KS,{server:G,onRemove:T,onEdit:$,onToggle:R,onRefresh:E,onReload:O},X))}),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(Cd,{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:G=>b(Number(G.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"})]})]})]})]}),k&&r.jsx(FS,{server:k,onEdit:pe,onCancel:()=>j(null)}),U&&r.jsx($S,{onSuccess:q,onCancel:()=>V(!1)}),I&&r.jsx(YS,{onSuccess:Q,onCancel:()=>M(!1)})]})},bo=()=>{const{t:a}=Ne(),[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 k=await Ue("/groups");k&&k.success&&Array.isArray(k.data)?l(k.data):(console.error("Invalid group data format:",k),l([])),m(null)}catch(k){console.error("Error fetching groups:",k),m(k instanceof Error?k.message:"Failed to fetch groups"),l([])}finally{c(!1)}},[]),b=y.useCallback(()=>{g(k=>k+1)},[]),x=async(k,j,S=[])=>{try{const D=await Et("/groups",{name:k,description:j,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(k,j)=>{try{const S=await Ut(`/groups/${k}`,j);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(k,j)=>{try{const S=await Ut(`/groups/${k}/servers/batch`,{servers:j});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 k=>{try{const j=await Os(`/groups/${k}`);return!j||!j.success?(m((j==null?void 0:j.message)||a("groups.deleteError")),j):(b(),j)}catch(j){return m(j instanceof Error?j.message:"Failed to delete group"),null}},O=async(k,j)=>{try{const S=await Et(`/groups/${k}/servers`,{serverName:j});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(k,j)=>{try{const S=await Os(`/groups/${k}/servers/${j}`);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}},L0=({servers:a,value:n,onChange:l,className:o})=>{const{t:c}=Ne(),{nameSeparator:d}=zs(),[m,p]=y.useState(new Set),g=Ta.useMemo(()=>n.map(j=>typeof j=="string"?{name:j,tools:"all"}:{...j,tools:j.tools||"all"}),[n]),h=Ta.useMemo(()=>a.filter(j=>j.enabled!==!1),[a]);Ta.useEffect(()=>{const j=new Set(g.map(D=>D.name)),S=new Set(h.map(D=>D.name));p(D=>{const U=new Set;return D.forEach(V=>{(j.has(V)||S.has(V))&&U.add(V)}),U})},[g,h]);const b=j=>{if(g.findIndex(D=>D.name===j)>=0){const D=g.filter(U=>U.name!==j);l(D)}else{const D=[...g,{name:j,tools:"all"}];l(D)}},x=j=>{p(S=>{const D=new Set(S);return D.has(j)?D.delete(j):D.add(j),D})},w=(j,S,D=!1)=>{if(Array.isArray(S)&&S.length===0){const U=g.filter(V=>V.name!==j);l(U),D||p(V=>{const I=new Set(V);return I.delete(j),I})}else if(g.findIndex(V=>V.name===j)>=0){const V=g.map(I=>I.name===j?{...I,tools:S}:I);l(V)}else{const V=[...g,{name:j,tools:S}];l(V)}},T=(j,S)=>{var I;const D=h.find(M=>M.name===j);if(!D)return;const U=((I=D.tools)==null?void 0:I.map(M=>M.name.replace(`${j}${d}`,"")))||[],V=g.find(M=>M.name===j);if(!V){const M=[...g,{name:j,tools:[S]}];l(M);return}if(V.tools==="all"){const M=U.filter($=>$!==S);w(j,M)}else if(Array.isArray(V.tools)){const M=V.tools;if(M.includes(S)){const $=M.filter(pe=>pe!==S);w(j,$)}else{const $=[...M,S];$.length===U.length?w(j,"all"):w(j,$)}}},R=j=>{const S=g.find(D=>D.name===j);return S?S.tools==="all":!1},O=j=>{const S=g.find(D=>D.name===j);return S?Array.isArray(S.tools)&&S.tools.length>0:!1},E=(j,S)=>{const D=g.find(U=>U.name===j);return D?D.tools==="all"?!0:Array.isArray(D.tools)?D.tools.includes(S):!1:!1},k=j=>{const S=h.find(D=>D.name===j);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(j=>{const S=R(j.name),D=O(j.name),U=m.has(j.name),V=k(j.name),I=g.find(M=>M.name===j.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(j.name),children:[r.jsxs("div",{className:"flex items-center space-x-3",onClick:M=>{M.stopPropagation(),b(j.name)},children:[r.jsx("input",{type:"checkbox",checked:S||D,onChange:()=>b(j.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:j.name})]}),r.jsxs("div",{className:"flex items-center space-x-3",children:[I&&I.tools!=="all"&&Array.isArray(I.tools)&&r.jsxs("span",{className:"text-sm text-green-600",children:["(",c("groups.toolsSelected")," ",I.tools.length,"/",V.length,")"]}),I&&I.tools==="all"&&r.jsxs("span",{className:"text-sm text-green-600",children:["(",c("groups.allTools")," ",V.length,"/",V.length,")"]}),V.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",U&&"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"})})})]})]}),U&&V.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:()=>{(I==null?void 0:I.tools)==="all"||Array.isArray(I==null?void 0:I.tools)&&I.tools.length===V.length?w(j.name,[],!0):w(j.name,"all")},className:"text-sm text-blue-600 hover:text-blue-800 transition-colors",children:(I==null?void 0:I.tools)==="all"||Array.isArray(I==null?void 0:I.tools)&&I.tools.length===V.length?c("groups.selectNone"):c("groups.selectAll")})]}),r.jsx("div",{className:"grid grid-cols-1 gap-2 max-h-32 overflow-y-auto",children:V.map(M=>{const $=M.name.replace(`${j.name}${d}`,""),pe=E(j.name,$);return r.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[r.jsx("input",{type:"checkbox",checked:pe,onChange:()=>T(j.name,$),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:$}),M.description&&r.jsx("span",{className:"text-gray-400 text-xs truncate",children:M.description})]},M.name)})})]})]},j.name)})}),h.length===0&&r.jsx("p",{className:"text-gray-500 text-sm",children:c("groups.noServerOptions")})]})},QS=({onAdd:a,onCancel:n})=>{const{t:l}=Ne(),{createGroup:o}=bo(),{allServers:c}=Ml(),[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:k}=O.target;w(j=>({...j,[E]:k}))},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(L0,{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")})]})]})]})})},XS=({group:a,onEdit:n,onCancel:l})=>{const{t:o}=Ne(),{updateGroup:c}=bo(),{allServers:d}=Ml(),[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:k,value:j}=E.target;T(S=>({...S,[k]:j}))},O=async E=>{E.preventDefault(),x(!0),h(null);try{if(!w.name.trim()){h(o("groups.nameRequired")),x(!1);return}const k=await c(a.id,{name:w.name,description:w.description,servers:w.servers});if(!k||!k.success){h((k==null?void 0:k.message)||o("groups.updateError")),x(!1);return}n()}catch(k){h(k instanceof Error?k.message:String(k)),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(L0,{servers:m,value:w.servers,onChange:E=>T(k=>({...k,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")})]})]})]})})},ZS=({group:a,servers:n,onEdit:l,onDelete:o})=>{const{t:c}=Ne(),{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 K=q=>{O.current&&!O.current.contains(q.target)&&w(!1)};return document.addEventListener("mousedown",K),()=>{document.removeEventListener("mousedown",K)}},[]);const E=()=>{l(a)},k=()=>{g(!0)},j=()=>{o(a.id),g(!1)},S=K=>{if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(K).then(()=>{b(!0),w(!1),d(c("common.copySuccess"),"success"),setTimeout(()=>b(!1),2e3)});else{const q=document.createElement("textarea");q.value=K,q.style.position="fixed",q.style.left="-9999px",document.body.appendChild(q),q.focus(),q.select();try{document.execCommand("copy"),b(!0),w(!1),d(c("common.copySuccess"),"success"),setTimeout(()=>b(!1),2e3)}catch(Q){d(c("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",Q)}document.body.removeChild(q)}},D=()=>{S(a.id)},U=()=>{S(`${m.baseUrl}/mcp/${a.id}`)},V=()=>{const K={mcpServers:{mcphub:{url:`${m.baseUrl}/mcp/${a.id}`,headers:{Authorization:"Bearer <your-access-token>"}}}};S(JSON.stringify(K,null,2))},I=K=>K.map(q=>typeof q=="string"?q:q.name),M=K=>{const q=a.servers.find(Q=>typeof Q=="string"?Q===K:Q.name===K);return typeof q=="string"?{name:q,tools:"all"}:q},$=I(a.servers),pe=n.filter(K=>$.includes(K.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(Sn,{size:14}),r.jsx(Ol,{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(Sn,{size:12,className:"mr-2"}),c("common.copyId")]}),r.jsxs("button",{onClick:U,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[r.jsx(Y2,{size:12,className:"mr-2"}),c("common.copyUrl")]}),r.jsxs("button",{onClick:V,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[r.jsx(q2,{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(zl,{size:18})}),r.jsx("button",{onClick:k,className:"text-gray-500 hover:text-red-600",title:c("groups.delete"),children:r.jsx(a0,{size:18})})]})]}),r.jsx("div",{className:"",children:pe.length===0?r.jsx("p",{className:"text-gray-500 italic",children:c("groups.noServers")}):r.jsx("div",{className:"flex flex-wrap gap-2",children:pe.map(K=>{var B;const q=M(K.name),Q=q&&q.tools!=="all"&&Array.isArray(q.tools),G=Q&&Array.isArray(q==null?void 0:q.tools)?q.tools.length:((B=K.tools)==null?void 0:B.length)||0,X=T===K.name,N=()=>Q&&Array.isArray(q==null?void 0:q.tools)?q.tools:K.tools&&K.tools.length>0?K.tools.map(ce=>ce.name):[],H=()=>{R(X?null:K.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:H,children:[r.jsx("span",{className:"font-medium text-gray-700 text-sm",children:K.name}),r.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${K.status==="connected"?"bg-green-500":K.status==="connecting"?"bg-yellow-500":"bg-red-500"}`}),G>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(fw,{size:12}),G]})]}),X&&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(Q?"groups.selectedTools":"groups.allTools"),":"]}),r.jsx("div",{className:"flex flex-wrap gap-1",children:N().map((ce,Z)=>r.jsx("span",{className:"inline-block bg-gray-100 text-gray-700 px-2 py-1 rounded text-xs",children:ce},Z))})]})]},K.name)})})}),r.jsx(Nd,{isOpen:p,onClose:()=>g(!1),onConfirm:j,serverName:a.name,isGroup:!0})]})},WS=({onSuccess:a,onCancel:n})=>{const{t:l}=Ne(),[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 k=JSON.parse(E.trim());if(!k.groups||!Array.isArray(k.groups))return m(l("groupImport.invalidFormat")),null;for(const j of k.groups)if(!j.name||typeof j.name!="string")return m(l("groupImport.missingName")),null;return k}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 Et("/groups/batch",{groups:h});if(E.success){const{successCount:k,failureCount:j,results:S}=E;if(j>0){const D=S.filter(U=>!U.success).map(U=>`${U.name}: ${U.message||l("groupImport.addFailed")}`);m(l("groupImport.partialSuccess",{count:k,total:h.length})+`
|
|
281
|
-
`+D.join(`
|
|
282
|
-
`))}k>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((k,j)=>typeof k=="string"?r.jsxs("div",{className:"text-sm",children:["• ",k]},j):r.jsxs("div",{className:"text-sm",children:["• ",k.name,k.tools&&k.tools!=="all"&&r.jsxs("span",{className:"text-gray-500 ml-2",children:["(",Array.isArray(k.tools)?k.tools.join(", "):k.tools,")"]}),k.tools==="all"&&r.jsx("span",{className:"text-gray-500 ml-2",children:"(all tools)"})]},j))});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,k)=>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)})]})]})})},k))})]}),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")})]})]})]})})},ej=()=>{const{t:a}=Ne(),{groups:n,loading:l,error:o,setError:c,deleteGroup:d,triggerRefresh:m}=bo(),{allServers:p}=Ml({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 U=await d(D);(!U||!U.success)&&c((U==null?void 0:U.message)||a("groups.deleteError"))},k=()=>{x(!0)},j=()=>{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:k,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(ZS,{group:D,servers:p,onEdit:R,onDelete:E},D.id))}),b&&r.jsx(QS,{onAdd:j,onCancel:j}),w&&r.jsx(WS,{onSuccess:S,onCancel:()=>T(!1)}),g&&r.jsx(XS,{group:g,onEdit:O,onCancel:()=>h(null)})]})},kd=()=>{const{t:a}=Ne(),[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 Et("/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 Ut(`/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}},tj=({onAdd:a,onCancel:n})=>{const{t:l}=Ne(),{createUser:o}=kd(),[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(k=>({...k,[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")]})]})]})})})},rj=({user:a,onEdit:n,onCancel:l})=>{const{t:o}=Ne(),{updateUser:c}=kd(),[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:k}=T.target;b(j=>({...j,[R]:E==="checkbox"?k: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")]})]})]})})})},aj=()=>{const{t:a}=Ne(),{auth:n}=cs(),l=n.user,{users:o,loading:c,error:d,setError:m,deleteUser:p,triggerRefresh:g}=kd(),[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=U=>{b(U)},E=()=>{b(null),g()},k=U=>{R(U)},j=async()=>{if(T){const U=await p(T);U!=null&&U.success||m((U==null?void 0:U.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(s0,{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(U=>{const V=(l==null?void 0:l.username)===U.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:U.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:[U.username,V&&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 ${U.isAdmin?"bg-purple-100 text-purple-800 border border-purple-200":"bg-gray-100 text-gray-800 border border-gray-200"}`,children:U.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(U),className:"text-blue-600 hover:text-blue-900 p-1 rounded hover:bg-blue-50 transition-colors",title:a("users.edit"),children:r.jsx(zl,{size:18})}),!V&&r.jsx("button",{onClick:()=>k(U.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(a0,{size:18})})]})})]},U.username)})})]})}),x&&r.jsx(tj,{onAdd:D,onCancel:D}),h&&r.jsx(rj,{user:h,onEdit:E,onCancel:()=>b(null)}),r.jsx(Nd,{isOpen:!!T,onClose:()=>R(null),onConfirm:j,serverName:T||"",isGroup:!1,isUser:!0})]})},Zh=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}},sj=({onSuccess:a,onCancel:n})=>{const{t:l}=Ne(),[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=k=>{const{name:j,value:S}=k.target;if(j==="confirmPassword")m(S);else if(c(D=>({...D,[j]:S})),j==="newPassword"){const D=Zh(S);R(D.errors)}},E=async k=>{k.preventDefault(),b(null);const j=Zh(o.newPassword);if(!j.isValid){b(l("auth.passwordStrengthError")),R(j.errors);return}if(o.newPassword!==d){b(l("auth.passwordsNotMatch"));return}g(!0);try{const S=await c2(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(k=>r.jsx("li",{className:"text-red-600",children:l(`auth.${k}`)},k))})]}),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")})]})]})]})},wn=({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 k=j=>{b.current&&!b.current.contains(j.target)&&(p(!1),h(""))};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[]);const w=a.filter(k=>k.label.toLowerCase().includes(g.toLowerCase())),T=k=>{if(c)return;const j=n.includes(k)?n.filter(S=>S!==k):[...n,k];l(j)},R=(k,j)=>{j.stopPropagation(),!c&&l(n.filter(S=>S!==k))},O=()=>{c||(p(!m),m||setTimeout(()=>{var k;return(k=x.current)==null?void 0:k.focus()},0))},E=()=>n.map(k=>{var j;return((j=a.find(S=>S.value===k))==null?void 0:j.label)||k}).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((k,j)=>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:[k,!c&&r.jsx("button",{type:"button",onClick:S=>R(n[j],S),className:"ml-1 hover:bg-blue-200 rounded-full p-0.5 transition-colors",children:r.jsx(jn,{className:"h-3 w-3"})})]},n[j]))}):r.jsx("span",{className:"text-gray-400 text-sm",children:o}),r.jsx("div",{className:"flex-1"}),r.jsx(Ol,{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:k=>h(k.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:k=>k.stopPropagation()})}),r.jsx("div",{className:"max-h-48 overflow-y-auto",children:w.length>0?w.map(k=>{const j=n.includes(k.value);return r.jsxs("div",{onClick:()=>T(k.value),className:`
|
|
289
|
-
px-3 py-2 cursor-pointer flex items-center justify-between
|
|
290
|
-
transition-colors duration-150
|
|
291
|
-
${j?"bg-blue-50 text-blue-700":"hover:bg-gray-100"}
|
|
292
|
-
`,children:[r.jsx("span",{className:"text-sm",children:k.label}),j&&r.jsx(os,{className:"h-4 w-4 text-blue-600"})]},k.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 nj(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"},lj=({keyData:a,loading:n,availableServers:l,availableGroups:o,onSave:c,onDelete:d})=>{const{t:m}=Ne(),{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,k]=y.useState(a.accessType||"all"),[j,S]=y.useState(a.allowedGroups||[]),[D,U]=y.useState(a.allowedServers||[]),[V,I]=y.useState(!1),[M,$]=y.useState(!1);y.useEffect(()=>{g||(x(a.name),T(a.token),O(a.enabled),k(a.accessType||"all"),S(a.allowedGroups||[]),U(a.allowedServers||[]))},[a,g]);const pe=async()=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(a.token),p(m("common.copySuccess")||"Copied to clipboard","success");else{const N=document.createElement("textarea");N.value=a.token,N.style.position="fixed",N.style.left="-9999px",document.body.appendChild(N),N.focus(),N.select();try{document.execCommand("copy"),p(m("common.copySuccess")||"Copied to clipboard","success")}catch{p(m("common.copyFailed")||"Copy failed","error")}document.body.removeChild(N)}}catch(N){console.error("Failed to copy",N),p(m("common.copyFailed")||"Copy failed","error")}},K=async()=>{if(E==="groups"&&j.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"&&j.length===0&&D.length===0){p(m("settings.selectAtLeastOneGroupOrServer")||"Please select at least one group or server","error");return}I(!0);try{await c(a.id,{name:b,token:w,enabled:R,accessType:E,allowedGroups:j.join(", "),allowedServers:D.join(", ")}),h(!1)}finally{I(!1)}},q=async()=>{if(window.confirm(m("settings.deleteBearerKeyConfirm")||"Delete this key?")){$(!0);try{await d(a.id)}finally{$(!1)}}},Q=E==="groups",G=E==="custom",X=N=>{if(N.accessType==="all")return m("settings.bearerKeyAccessAll")||"All Resources";if(N.accessType==="groups")return`${m("settings.bearerKeyAccessGroups")||"Groups"}: ${N.allowedGroups}`;if(N.accessType==="servers")return`${m("settings.bearerKeyAccessServers")||"Servers"}: ${N.allowedServers}`;if(N.accessType==="custom"){const H=[];return N.allowedGroups&&N.allowedGroups.length>0&&H.push(`${m("settings.bearerKeyAccessGroups")||"Groups"}: ${N.allowedGroups}`),N.allowedServers&&N.allowedServers.length>0&&H.push(`${m("settings.bearerKeyAccessServers")||"Servers"}: ${N.allowedServers}`),`${m("settings.bearerKeyAccessCustom")||"Custom"}: ${H.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:N=>x(N.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:N=>T(N.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(er,{disabled:n,checked:R,onCheckedChange:N=>O(N)})]})]}),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:N=>k(N.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)"})]})]}),!G&&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:Q?m("settings.bearerKeyAllowedGroups")||"Allowed groups":m("settings.bearerKeyAllowedServers")||"Allowed servers"}),r.jsx(wn,{options:Q?o:l,selected:Q?j:D,onChange:Q?S:U,placeholder:Q?m("settings.selectGroups")||"Select groups...":m("settings.selectServers")||"Select servers...",disabled:n||E==="all"})]}),G&&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(wn,{options:o,selected:j,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(wn,{options:l,selected:D,onChange:U,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:K,disabled:n||V,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:V?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:pe,className:"text-gray-400 hover:text-gray-600 transition-colors",title:m("common.copy")||"Copy",children:r.jsx(Sn,{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:X(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(zl,{className:"h-4 w-4"})}),r.jsx("button",{onClick:q,disabled:M,className:"text-red-600 hover:text-red-900 inline-flex items-center",title:m("common.delete")||"Delete",children:r.jsx(cw,{className:"h-4 w-4"})})]})]})},ij=()=>{const{t:a}=Ne(),n=la(),{showToast:l}=us(),{allServers:o}=w0(),{groups:c}=bo(),[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:k,installConfig:j,smartRoutingConfig:S,mcpRouterConfig:D,oauthServerConfig:U,nameSeparator:V,enableSessionRebuild:I,loading:M,bearerKeys:$,updateRoutingConfig:pe,updateInstallConfig:K,updateSmartRoutingConfig:q,updateSmartRoutingConfigBatch:Q,updateMCPRouterConfig:G,updateOAuthServerConfig:X,updateNameSeparator:N,updateSessionRebuild:H,exportMCPSettings:B,createBearerKey:ce,updateBearerKey:Z,deleteBearerKey:A,refreshBearerKeys:L}=zs();y.useEffect(()=>{j&&m(j)},[j]),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;U&&w({accessTokenLifetime:U.accessTokenLifetime!==void 0?String(U.accessTokenLifetime):"",refreshTokenLifetime:U.refreshTokenLifetime!==void 0?String(U.refreshTokenLifetime):"",authorizationCodeLifetime:U.authorizationCodeLifetime!==void 0?String(U.authorizationCodeLifetime):"",allowedScopes:U.allowedScopes&&U.allowedScopes.length>0?U.allowedScopes.join(", "):"",dynamicRegistrationAllowedGrantTypes:(ve=(W=U.dynamicRegistration)==null?void 0:W.allowedGrantTypes)!=null&&ve.length?U.dynamicRegistration.allowedGrantTypes.join(", "):""})},[U]),y.useEffect(()=>{R(V)},[V]),y.useEffect(()=>{L()},[]);const[z,P]=y.useState({routingConfig:!1,installConfig:!1,smartRoutingConfig:!1,oauthServerConfig:!1,mcpRouterConfig:!1,nameSeparator:!1,password:!1,exportConfig:!1,bearerKeys:!1}),le=W=>{P(ve=>({...ve,[W]:!ve[W]}))},ee=async(W,ve)=>{await pe(W,ve)},Y=(W,ve)=>{m({...d,[W]:ve})},ge=async W=>{await K(W,d[W])},ae=(W,ve)=>{g({...p,[W]:ve})},ye=(W,ve)=>{b({...h,[W]:ve})},de=async W=>{await G(W,h[W])},oe=(W,ve)=>{w(Fe=>({...Fe,[W]:ve}))},xe=(W,ve)=>{w(Fe=>({...Fe,[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 Fe=Number(ve);if(Number.isNaN(Fe)||Fe<0){l(a("settings.invalidNumberInput")||"Please enter a valid number","error");return}await X(W,Fe)},$t=async()=>{const W=x.allowedScopes.split(",").map(ve=>ve.trim()).filter(ve=>ve.length>0);await X("allowedScopes",W)},Yt=async()=>{const W=x.dynamicRegistrationAllowedGrantTypes.split(",").map(ve=>ve.trim()).filter(ve=>ve.length>0);await X("dynamicRegistration",{...U.dynamicRegistration,allowedGrantTypes:W})},Ze=async(W,ve)=>{await X(W,ve)},gt=async W=>{await X("dynamicRegistration",{...U.dynamicRegistration,...W})},Jt=async()=>{await N(T)},_t=async W=>{if(W){const ve=p.dbUrl||S.dbUrl,Fe=[];if(ve||Fe.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)&&Fe.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||Fe.push(a("settings.openaiApiKey")||"OpenAI API Key");if(Fe.length>0){l(a("settings.smartRoutingValidationError",{fields:Fe.join(", ")}));return}const Nt={enabled:W};p.dbUrl!==S.dbUrl&&(Nt.dbUrl=p.dbUrl),p.embeddingProvider!==S.embeddingProvider&&(Nt.embeddingProvider=p.embeddingProvider),p.openaiApiBaseUrl!==S.openaiApiBaseUrl&&(Nt.openaiApiBaseUrl=p.openaiApiBaseUrl),p.openaiApiKey!==S.openaiApiKey&&(Nt.openaiApiKey=p.openaiApiKey),p.openaiApiEmbeddingModel!==S.openaiApiEmbeddingModel&&(Nt.openaiApiEmbeddingModel=p.openaiApiEmbeddingModel),p.azureOpenaiEndpoint!==S.azureOpenaiEndpoint&&(Nt.azureOpenaiEndpoint=p.azureOpenaiEndpoint),p.azureOpenaiApiKey!==S.azureOpenaiApiKey&&(Nt.azureOpenaiApiKey=p.azureOpenaiApiKey),p.azureOpenaiApiVersion!==S.azureOpenaiApiVersion&&(Nt.azureOpenaiApiVersion=p.azureOpenaiApiVersion),p.azureOpenaiEmbeddingDeployment!==S.azureOpenaiEmbeddingDeployment&&(Nt.azureOpenaiEmbeddingDeployment=p.azureOpenaiEmbeddingDeployment),await Q(Nt)}else await q("enabled",W)},Qt=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 Q(W):l(a("settings.noChanges")||"No changes to save","info")},Ht=()=>{setTimeout(()=>{n("/")},2e3)},[fr,tt]=y.useState(!1),[St,lr]=y.useState(""),[ze,jt]=y.useState({name:"",token:"",enabled:!0,accessType:"all",allowedGroups:"",allowedServers:""}),[Ce,nt]=y.useState([]),[lt,rr]=y.useState([]),Xt=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"&&rr([])},[ze.accessType]);const ar=async()=>{try{const W=await B();console.log("Fetched MCP settings:",W);const ve=JSON.stringify(W.data,null,2);lr(ve)}catch(W){console.error("Error fetching MCP settings:",W),l(a("settings.exportError")||"Failed to fetch settings","error")}};y.useEffect(()=>{z.exportConfig&&!St&&ar()},[z.exportConfig]);const xt=async()=>{if(St)try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(St),tt(!0),l(a("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>tt(!1),2e3);else{const W=document.createElement("textarea");W.value=St,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(!St)return;const W=new Blob([St],{type:"application/json"}),ve=URL.createObjectURL(W),Fe=document.createElement("a");Fe.href=ve,Fe.download="mcp_settings.json",document.body.appendChild(Fe),Fe.click(),document.body.removeChild(Fe),URL.revokeObjectURL(ve),l(a("settings.exportSuccess")||"Settings exported successfully","success")},ia=W=>{const ve=W.split(",").map(Fe=>Fe.trim()).filter(Fe=>Fe.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"&&Ce.length===0){l(a("settings.selectAtLeastOneGroup")||"Please select at least one group","error");return}if(ze.accessType==="servers"&<.length===0){l(a("settings.selectAtLeastOneServer")||"Please select at least one server","error");return}if(ze.accessType==="custom"&&Ce.length===0&<.length===0){l(a("settings.selectAtLeastOneGroupOrServer")||"Please select at least one group or server","error");return}await ce({name:ze.name,token:ze.token,enabled:ze.enabled,accessType:ze.accessType,allowedGroups:(ze.accessType==="groups"||ze.accessType==="custom")&&Ce.length>0?Ce:void 0,allowedServers:(ze.accessType==="servers"||ze.accessType==="custom")&<.length>0?lt:void 0}),jt({name:"",token:"",enabled:!0,accessType:"all",allowedGroups:"",allowedServers:""}),nt([]),rr([]),await L()},pr=async(W,ve)=>{await Z(W,{name:ve.name,token:ve.token,enabled:ve.enabled,accessType:ve.accessType,allowedGroups:ia(ve.allowedGroups),allowedServers:ia(ve.allowedServers)}),await L()},hr=async W=>{await A(W),await L()};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:()=>le("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(er,{disabled:M,checked:k.enableBearerAuth,onCheckedChange:W=>ee("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"]})]}),$.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:$.map(W=>r.jsx(lj,{keyData:W,loading:M,availableServers:Xt,availableGroups:ft,onSave:pr,onDelete:hr},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=>jt(ve=>({...ve,name:W.target.value})),disabled:M})]}),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=>jt(ve=>({...ve,token:W.target.value})),disabled:M}),r.jsx("button",{type:"button",onClick:()=>jt(W=>({...W,token:nj()})),disabled:M,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(er,{disabled:M,checked:ze.enabled,onCheckedChange:W=>jt(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=>jt(ve=>({...ve,accessType:W.target.value})),disabled:M,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(wn,{options:ze.accessType==="groups"?ft:Xt,selected:ze.accessType==="groups"?Ce:lt,onChange:ze.accessType==="groups"?nt:rr,placeholder:ze.accessType==="groups"?a("settings.selectGroups")||"Select groups...":a("settings.selectServers")||"Select servers...",disabled:M||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(wn,{options:ft,selected:Ce,onChange:nt,placeholder:a("settings.selectGroups")||"Select groups...",disabled:M})]}),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(wn,{options:Xt,selected:lt,onChange:rr,placeholder:a("settings.selectServers")||"Select servers...",disabled:M})]})]}),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:M,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:()=>le("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(er,{disabled:M,checked:S.enabled,onCheckedChange:W=>_t(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=>ae("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:M})})]}),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=>ae("embeddingProvider",W.target.value),disabled:M,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=>ae("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:M})})]}),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=>ae("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:M})})]}),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=>ae("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:M})})]})]}):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=>ae("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:M})})]}),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=>ae("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:M})})]}),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=>ae("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:M})})]}),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=>ae("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:M})})]})]}),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(er,{disabled:M||!S.enabled,checked:S.progressiveDisclosure,onCheckedChange:W=>q("progressiveDisclosure",W)})]}),r.jsx("div",{className:"flex justify-end pt-2",children:r.jsx("button",{onClick:Qt,disabled:M,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:()=>le("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(er,{disabled:M,checked:U.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(er,{disabled:M||!U.enabled,checked:U.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(er,{disabled:M||!U.enabled,checked:U.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=>oe("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:M}),r.jsx("button",{onClick:()=>Xe("accessTokenLifetime"),disabled:M,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=>oe("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:M}),r.jsx("button",{onClick:()=>Xe("refreshTokenLifetime"),disabled:M,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=>oe("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:M}),r.jsx("button",{onClick:()=>Xe("authorizationCodeLifetime"),disabled:M,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:M}),r.jsx("button",{onClick:$t,disabled:M,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(er,{disabled:M||!U.enabled,checked:U.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:M||!U.enabled||!U.dynamicRegistration.enabled}),r.jsx("button",{onClick:Yt,disabled:M||!U.enabled||!U.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(er,{disabled:M||!U.enabled||!U.dynamicRegistration.enabled,checked:U.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:()=>le("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:M}),r.jsx("button",{onClick:()=>de("apiKey"),disabled:M,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:M}),r.jsx("button",{onClick:()=>de("baseUrl"),disabled:M,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:()=>le("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:M,maxLength:5}),r.jsx("button",{onClick:Jt,disabled:M,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(er,{disabled:M,checked:I,onCheckedChange:W=>H(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:()=>le("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(er,{disabled:M,checked:k.enableGlobalRoute,onCheckedChange:W=>ee("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(er,{disabled:M,checked:k.enableGroupNameRoute,onCheckedChange:W=>ee("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(er,{disabled:M,checked:k.skipAuth,onCheckedChange:W=>ee("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:()=>le("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=>Y("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:M}),r.jsx("button",{onClick:()=>ge("baseUrl"),disabled:M,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=>Y("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:M}),r.jsx("button",{onClick:()=>ge("pythonIndexUrl"),disabled:M,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=>Y("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:M}),r.jsx("button",{onClick:()=>ge("npmRegistry"),disabled:M,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:()=>le("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(sj,{onSuccess:Ht})})]}),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:()=>le("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:!St,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:[fr?r.jsx(os,{size:16}):r.jsx(Sn,{size:16}),a(fr?"common.copied":"settings.copyToClipboard")]}),r.jsxs("button",{onClick:Ma,disabled:!St,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(G2,{size:16}),a("settings.downloadJson")]})]}),St&&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:St})})]})]})})]})})]})},oj=()=>{const{t:a}=Ne(),[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),[k,j]=y.useState(null),[S,D]=y.useState(null),[U,V]=y.useState([]),[I,M]=y.useState(1),[$,pe]=y.useState(9),[K,q]=y.useState(1),Q=y.useCallback(async()=>{try{E(!0);const ee=await Ue("/market/servers");ee&&ee.success&&Array.isArray(ee.data)?(c(ee.data),G(ee.data,I)):(console.error("Invalid market servers data format:",ee),j(a("market.fetchError")))}catch(ee){console.error("Error fetching market servers:",ee),j(ee instanceof Error?ee.message:String(ee))}finally{E(!1)}},[a]),G=y.useCallback((ee,Y,ge=$)=>{const ae=ee.length,ye=Math.ceil(ae/ge);q(ye);const de=Math.max(1,Math.min(Y,ye));de!==Y&&M(de);const oe=(de-1)*ge,xe=ee.slice(oe,oe+ge);l(xe)},[$]),X=y.useCallback(ee=>{M(ee),G(o,ee,$)},[o,G,$]),N=y.useCallback(async()=>{try{const ee=await Ue("/market/categories");ee&&ee.success&&Array.isArray(ee.data)?m(ee.data):console.error("Invalid categories data format:",ee)}catch(ee){console.error("Error fetching categories:",ee)}},[]),H=y.useCallback(async()=>{try{const ee=await Ue("/market/tags");ee&&ee.success&&Array.isArray(ee.data)?g(ee.data):console.error("Invalid tags data format:",ee)}catch(ee){console.error("Error fetching tags:",ee)}},[]),B=y.useCallback(async ee=>{try{E(!0);const Y=await Ue(`/market/servers/${ee}`);return Y&&Y.success&&Y.data?(D(Y.data),Y.data):(console.error("Invalid server data format:",Y),j(a("market.serverNotFound")),null)}catch(Y){return console.error(`Error fetching server ${ee}:`,Y),j(Y instanceof Error?Y.message:String(Y)),null}finally{E(!1)}},[a]),ce=y.useCallback(async ee=>{try{if(E(!0),R(ee),!ee.trim()){Q();return}const Y=await Ue(`/market/servers/search?query=${encodeURIComponent(ee)}`);Y&&Y.success&&Array.isArray(Y.data)?(c(Y.data),M(1),G(Y.data,1)):(console.error("Invalid search results format:",Y),j(a("market.searchError")))}catch(Y){console.error("Error searching servers:",Y),j(Y instanceof Error?Y.message:String(Y))}finally{E(!1)}},[a,o,G,Q]),Z=y.useCallback(async ee=>{try{if(E(!0),b(ee),w(""),!ee){Q();return}const Y=await Ue(`/market/categories/${encodeURIComponent(ee)}`);Y&&Y.success&&Array.isArray(Y.data)?(c(Y.data),M(1),G(Y.data,1)):(console.error("Invalid category filter results format:",Y),j(a("market.filterError")))}catch(Y){console.error("Error filtering servers by category:",Y),j(Y instanceof Error?Y.message:String(Y))}finally{E(!1)}},[a,Q,G]),A=y.useCallback(async ee=>{try{if(E(!0),w(ee),b(""),!ee){Q();return}const Y=await Ue(`/market/tags/${encodeURIComponent(ee)}`);Y&&Y.success&&Array.isArray(Y.data)?(c(Y.data),M(1),G(Y.data,1)):(console.error("Invalid tag filter results format:",Y),j(a("market.tagFilterError")))}catch(Y){console.error("Error filtering servers by tag:",Y),j(Y instanceof Error?Y.message:String(Y))}finally{E(!1)}},[a,Q,G]),L=y.useCallback(async()=>{try{const ee=await Ue("/servers");if(ee&&ee.success&&Array.isArray(ee.data)){const Y=ee.data.map(ge=>ge.name);V(Y)}}catch(ee){console.error("Error fetching installed servers:",ee)}},[]),z=y.useCallback(ee=>U.includes(ee),[U]),P=y.useCallback(async(ee,Y)=>{var ge,ae;try{const ye=(ge=ee.installations)!=null&&ge.npm?"npm":Object.keys(ee.installations||{}).length>0?Object.keys(ee.installations)[0]:null;if(!ye||!((ae=ee.installations)!=null&&ae[ye]))return j(a("market.noInstallationMethod")),!1;const de=ee.installations[ye],oe={name:ee.name,config:Y.type==="stdio"?{command:Y.command||de.command||"",args:Y.args||de.args||[],env:{...de.env,...Y.env}}:Y},xe=await Et("/servers",oe);if(!xe.success)throw new Error(xe.message||"Failed to install server");return await L(),!0}catch(ye){return console.error("Error installing server:",ye),j(ye instanceof Error?ye.message:String(ye)),!1}},[a,L]),le=y.useCallback(ee=>{pe(ee),M(1),G(o,1,ee)},[o,G]);return y.useEffect(()=>{Q(),N(),H(),L()},[Q,N,H,L]),{servers:n,allServers:o,categories:d,tags:p,selectedCategory:h,selectedTag:x,searchQuery:T,loading:O,error:k,setError:j,currentServer:S,fetchMarketServers:Q,fetchServerByName:B,searchServers:ce,filterByCategory:Z,filterByTag:A,installServer:P,currentPage:I,totalPages:K,serversPerPage:$,changePage:X,changeServersPerPage:le,isServerInstalled:z}},cj=()=>{const{t:a}=Ne(),[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),[k,j]=y.useState(null),[S,D]=y.useState(null),[U,V]=y.useState(1),[I,M]=y.useState(9),[$,pe]=y.useState(1),K=y.useCallback(async()=>{try{E(!0);const z=await Ue("/cloud/servers");z&&z.success&&Array.isArray(z.data)?(c(z.data),q(z.data,U)):(console.error("Invalid cloud market servers data format:",z),j(a("cloud.fetchError")))}catch(z){console.error("Error fetching cloud market servers:",z);const P=z instanceof Error?z.message:String(z);P==="MCPROUTER_API_KEY_NOT_CONFIGURED"||P.toLowerCase().includes("mcprouter api key not configured"),j(P)}finally{E(!1)}},[a]),q=y.useCallback((z,P,le=I)=>{const ee=z.length,Y=Math.ceil(ee/le);pe(Y);const ge=Math.max(1,Math.min(P,Y));ge!==P&&V(ge);const ae=(ge-1)*le,ye=z.slice(ae,ae+le);l(ye)},[I]),Q=y.useCallback(z=>{V(z),q(o,z,I)},[o,q,I]),G=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)}},[]),X=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)}},[]),N=y.useCallback(async z=>{try{E(!0);const P=await Ue(`/cloud/servers/${z}`);return P&&P.success&&P.data?(D(P.data),P.data):(console.error("Invalid cloud server data format:",P),j(a("cloud.serverNotFound")),null)}catch(P){console.error(`Error fetching cloud server ${z}:`,P);const le=P instanceof Error?P.message:String(P);return le==="MCPROUTER_API_KEY_NOT_CONFIGURED"||le.toLowerCase().includes("mcprouter api key not configured"),j(le),null}finally{E(!1)}},[a]),H=y.useCallback(async z=>{try{if(E(!0),R(z),!z.trim()){K();return}const P=await Ue(`/cloud/servers/search?query=${encodeURIComponent(z)}`);P&&P.success&&Array.isArray(P.data)?(c(P.data),V(1),q(P.data,1)):(console.error("Invalid cloud search results format:",P),j(a("cloud.searchError")))}catch(P){console.error("Error searching cloud servers:",P),j(P instanceof Error?P.message:String(P))}finally{E(!1)}},[a,o,q,K]),B=y.useCallback(async z=>{try{if(E(!0),b(z),w(""),!z){K();return}const P=await Ue(`/cloud/categories/${encodeURIComponent(z)}`);P&&P.success&&Array.isArray(P.data)?(c(P.data),V(1),q(P.data,1)):(console.error("Invalid cloud category filter results format:",P),j(a("cloud.filterError")))}catch(P){console.error("Error filtering cloud servers by category:",P),j(P instanceof Error?P.message:String(P))}finally{E(!1)}},[a,K,q]),ce=y.useCallback(async z=>{try{if(E(!0),w(z),b(""),!z){K();return}const P=await Ue(`/cloud/tags/${encodeURIComponent(z)}`);P&&P.success&&Array.isArray(P.data)?(c(P.data),V(1),q(P.data,1)):(console.error("Invalid cloud tag filter results format:",P),j(a("cloud.tagFilterError")))}catch(P){console.error("Error filtering cloud servers by tag:",P),j(P instanceof Error?P.message:String(P))}finally{E(!1)}},[a,K,q]),Z=y.useCallback(async z=>{try{const P=await Ue(`/cloud/servers/${z}/tools`);if(!P.success)throw console.error("Failed to fetch cloud server tools:",P),new Error(P.message||"Failed to fetch cloud server tools");return P&&P.success&&Array.isArray(P.data)?P.data:(console.error("Invalid cloud server tools data format:",P),[])}catch(P){console.error(`Error fetching tools for cloud server ${z}:`,P);const le=P instanceof Error?P.message:String(P);if(le==="MCPROUTER_API_KEY_NOT_CONFIGURED"||le.toLowerCase().includes("mcprouter api key not configured"))throw P;return[]}},[]),A=y.useCallback(async(z,P,le)=>{try{const ee=await Et(`/cloud/servers/${encodeURIComponent(z)}/tools/${encodeURIComponent(P)}/call`,{arguments:le});if(ee&&ee.success)return ee.data;throw new Error(ee.message||"Failed to call tool")}catch(ee){throw console.error(`Error calling tool ${P} on cloud server ${z}:`,ee),ee}},[]),L=y.useCallback(z=>{M(z),V(1),q(o,1,z)},[o,q]);return y.useEffect(()=>{K(),G(),X()},[K,G,X]),{servers:n,allServers:o,categories:d,tags:p,selectedCategory:h,selectedTag:x,searchQuery:T,loading:O,error:k,setError:j,currentServer:S,fetchCloudServers:K,fetchServerByName:N,searchServers:H,filterByCategory:B,filterByTag:ce,fetchServerTools:Z,callServerTool:A,currentPage:U,totalPages:$,serversPerPage:I,changePage:Q,changeServersPerPage:L}},uj=()=>{const{t:a}=Ne(),[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),[k,j]=y.useState(!1),[S,D]=y.useState([]),[U]=y.useState(1),V=y.useCallback(async(N,H)=>{try{m(!0),g(null);const B=new URLSearchParams;B.append("limit",T.toString()),N&&B.append("cursor",N);const ce=H!==void 0?H:h;ce.trim()&&B.append("search",ce.trim());const Z=await Ue(`/registry/servers?${B.toString()}`);if(Z&&Z.success&&Z.data){const A=Z.data;if(A.servers&&Array.isArray(A.servers)){l(A.servers);const L=A.metadata.count===T&&!!A.metadata.nextCursor;j(L),E(A.metadata.nextCursor||null),c(N?z=>[...z,...A.servers]:A.servers)}else console.error("Invalid registry servers data format:",A),g(a("registry.fetchError"))}else g(a("registry.fetchError"))}catch(B){console.error("Error fetching registry servers:",B);const ce=B instanceof Error?B.message:String(B);g(ce)}finally{m(!1)}},[a,T]),I=y.useCallback(async()=>{if(!k||!O)return;const N=S[S.length-1]||"";D(H=>[...H,N]),w(H=>H+1),await V(O,h)},[k,O,S,h,V]),M=y.useCallback(async()=>{if(x<=1)return;const N=[...S];N.pop();const H=N[N.length-1];D(N),w(B=>B-1),await V(H||void 0,h)},[x,S,h,V]),$=y.useCallback(async N=>{N!==x&&(N>x&&k?await I():N<x&&x>1&&await M())},[x,k,I,M]),pe=y.useCallback(async N=>{R(N),w(1),D([]),c([]),await V(void 0,h)},[h,V]),K=y.useCallback(async N=>{try{m(!0),g(null);const H=encodeURIComponent(N),B=await Ue(`/registry/servers/${H}/versions`);if(B&&B.success&&B.data){const ce=B.data;return ce.servers&&Array.isArray(ce.servers)&&ce.servers.length>0?ce.servers[0]:(console.error("Invalid registry server data format:",ce),g(a("registry.serverNotFound")),null)}else return g(a("registry.serverNotFound")),null}catch(H){console.error(`Error fetching registry server ${N}:`,H);const B=H instanceof Error?H.message:String(H);return g(B),null}finally{m(!1)}},[a]),q=y.useCallback(async N=>{try{g(null);const H=encodeURIComponent(N),B=await Ue(`/registry/servers/${H}/versions`);if(B&&B.success&&B.data){const ce=B.data;return ce.servers&&Array.isArray(ce.servers)?ce.servers:(console.error("Invalid registry server versions data format:",ce),[])}else return[]}catch(H){console.error(`Error fetching versions for server ${N}:`,H);const B=H instanceof Error?H.message:String(H);return g(B),[]}},[]),Q=y.useCallback(async(N,H)=>{try{g(null);const B=encodeURIComponent(N),ce=encodeURIComponent(H),Z=await Ue(`/registry/servers/${B}/versions/${ce}`);if(Z&&Z.success&&Z.data){const A=Z.data;return A&&A.server?A:(console.error("Invalid registry server version data format:",A),null)}else return null}catch(B){console.error(`Error fetching version ${H} for server ${N}:`,B);const ce=B instanceof Error?B.message:String(B);return g(ce),null}},[]),G=y.useCallback(async N=>{console.log("Searching registry servers with query:",N),b(N),w(1),D([]),c([]),await V(void 0,N)},[V]),X=y.useCallback(async()=>{b(""),w(1),D([]),c([]),await V(void 0,"")},[V]);return y.useEffect(()=>{V(void 0,h)},[]),{servers:n,allServers:o,loading:d,error:p,setError:g,searchQuery:h,searchServers:G,clearSearch:X,fetchServerByName:K,fetchServerVersions:q,fetchServerVersion:Q,currentPage:x,totalPages:U,hasNextPage:k,hasPreviousPage:x>1,changePage:$,goToNextPage:I,goToPreviousPage:M,serversPerPage:T,changeServersPerPage:pe}},dj=({server:a,onClick:n})=>{var g,h,b,x;const{t:l}=Ne(),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 k=E.length-O,j=3+String(k).length+l("market.moreTags").length;return R+j<=w||O<1?{tagsToShow:E.slice(0,O),hasMore:!0,moreCount:k}:{tagsToShow:E.slice(0,Math.max(1,O-1)),hasMore:!0,moreCount:k+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:"-"})})})]})]})},mj=({server:a,onBack:n,onInstall:l,installing:o=!1,isInstalled:c=!1})=>{var $,pe,K;const{t:d}=Ne(),[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")},k=()=>{p(!m),h(null),x(!1),T(null)},j=async()=>{w&&(await S(w),x(!1),T(null))},S=async q=>{try{h(null),l(a,q.config),p(!1)}catch(Q){console.error("Error installing server:",Q),h(d("errors.serverInstall"))}},D=()=>{c||k()},U=()=>{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 q=Object.keys(a.installations);if(q.length>0)return a.installations[q[0]]},V=async q=>{try{const Q=M0(q);Q.length>0?(O(Q),T(q),x(!0)):await S(q)}catch(Q){console.error("Error processing server installation:",Q),h(d("errors.serverInstall"))}},I=E(),M=U();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"),": ",(($=a.author)==null?void 0:$.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:I.disabled,className:I.className,children:I.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:[(pe=a.categories)==null?void 0:pe.map((q,Q)=>r.jsx("span",{className:"bg-gray-100 text-gray-800 px-3 py-1 rounded",children:q},`cat-${Q}`)),a.tags&&a.tags.map((q,Q)=>r.jsxs("span",{className:"bg-gray-100 text-green-700 px-2 py-1 rounded text-sm",children:["#",q]},`tag-${Q}`))]})]}),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(([q,Q],G)=>r.jsxs("tr",{children:[r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:q}),r.jsx("td",{className:"px-6 py-4 text-sm text-gray-500",children:Q.description}),r.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:Q.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:Q.example})})]},G))})]})})]}),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:(K=a.tools)==null?void 0:K.map((q,Q)=>r.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[r.jsxs("h4",{className:"font-medium mb-2",children:[q.name,r.jsx("button",{type:"button",onClick:()=>{const G=document.getElementById(`schema-${Q}`);G&&G.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:q.description}),r.jsx("div",{className:"mt-2",children:r.jsx("pre",{id:`schema-${Q}`,className:"hidden bg-gray-50 p-3 rounded text-sm overflow-auto mt-2",children:JSON.stringify(q.inputSchema,null,2)})})]},Q))})]}),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((q,Q)=>r.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[r.jsx("h4",{className:"font-medium mb-2",children:q.title}),r.jsx("p",{className:"text-gray-600 mb-2",children:q.description}),r.jsx("pre",{className:"bg-gray-50 p-3 rounded text-sm overflow-auto",children:q.prompt})]},Q))})]}),r.jsx("div",{className:"mt-6 flex justify-end",children:r.jsx("button",{onClick:D,disabled:I.disabled,className:I.className,children:I.text})}),m&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx(Ll,{onSubmit:V,onCancel:k,modalTitle:d("market.installServer",{name:a.display_name}),formError:g,initialData:{name:a.name,status:"disconnected",config:M?{command:M.command||"",args:M.args||[],env:M.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((q,Q)=>r.jsxs("li",{className:"font-mono",children:["$",`{${q}}`]},Q))})]})]})}),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:j,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 btn-primary",children:d("market.confirmAndInstall")})]})]})})]})},fj=({server:a,onClick:n})=>{const{t:l}=Ne(),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"})})]})]})]})]})},id=()=>{const{t:a}=Ne(),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")]})]})]})]})})},pj=({serverName:a,onBack:n,onCallTool:l,fetchServerTools:o,onInstall:c,installing:d=!1,isInstalled:m=!1})=>{const{t:p}=Ne(),{mcpRouterConfig:g}=zs(),[h,b]=y.useState(null),[x,w]=y.useState(!0),[T,R]=y.useState(null),[O,E]=y.useState([]),[k,j]=y.useState(!1),[S,D]=y.useState(!1),[U,V]=y.useState(null),[I,M]=y.useState({}),[$,pe]=y.useState({}),[K,q]=y.useState({}),[Q,G]=y.useState(!1),[X,N]=y.useState(null),H=Y=>(console.error("Checking for MCPRouter API key error:",Y),Y==="MCPROUTER_API_KEY_NOT_CONFIGURED"||Y.toLowerCase().includes("mcprouter api key not configured")),B=()=>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")},ce=()=>{!m&&c&&(G(!0),N(null))},Z=()=>{G(!1),N(null)},A=async Y=>{try{if(!h||!c)return;N(null),c(h,Y.config),G(!1)}catch(ge){console.error("Error installing server:",ge),N(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){j(!0),D(!1);try{const ge=await o(h.name);E(ge)}catch(ge){console.error("Failed to load tools:",ge);const ae=ge instanceof Error?ge.message:String(ge);H(ae)&&D(!0)}finally{j(!1)}}})()},[h==null?void 0:h.name,h==null?void 0:h.tools,o]);const L=Y=>{try{const ge=new Date(Y),ae=ge.getFullYear(),ye=String(ge.getMonth()+1).padStart(2,"0"),de=String(ge.getDate()).padStart(2,"0"),oe=String(ge.getHours()).padStart(2,"0"),xe=String(ge.getMinutes()).padStart(2,"0"),Xe=String(ge.getSeconds()).padStart(2,"0");return`${ae}-${ye}-${de} ${oe}:${xe}:${Xe}`}catch{return Y}},z=(Y,ge,ae)=>{pe(ye=>({...ye,[Y]:{...ye[Y],[ge]:ae}}))},P=async Y=>{if(!(!l||!h)){V(Y);try{const ge=$[Y]||{},ae=await l(h.server_key,Y,ge);M(ye=>({...ye,[Y]:ae}))}catch(ge){console.error("Tool call failed:",ge);const ae=ge instanceof Error?ge.message:String(ge);M(ye=>({...ye,[Y]:{error:ae}}))}finally{V(null)}}},le=Y=>{q(ge=>({...ge,[Y]:!ge[Y]}))},ee=(Y,ge,ae)=>{var oe;const ye=((oe=$[Y.name])==null?void 0:oe[ge])||"",de=xe=>{let Xe=xe.target.value;ae.type==="number"||ae.type==="integer"?Xe=Xe===""?void 0:Number(Xe):ae.type==="boolean"&&(Xe=xe.target.value==="true"),z(Y.name,ge,Xe)};return ae.type==="boolean"?r.jsxs("select",{value:ye===!0?"true":ye===!1?"false":"",onChange:de,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")})]}):ae.type==="number"||ae.type==="integer"?r.jsx("input",{type:"number",step:ae.type==="integer"?"1":"any",value:ye||"",onChange:de,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:de,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&&!H(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"),": ",L(h.updated_at)]}),c&&!H(T||"")&&!S&&r.jsx("button",{onClick:ce,disabled:B().disabled,className:B().className,children:B().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(id,{}),k?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((Y,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"}),Y.name]}),r.jsx("p",{className:"text-gray-600 leading-relaxed whitespace-pre-wrap",children:Y.description})]}),l&&r.jsx("button",{onClick:()=>P(Y.name),disabled:U===Y.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:U===Y.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")]})})]}),Y.inputSchema&&Y.inputSchema.properties&&Object.keys(Y.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:()=>le(Y.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 ${K[Y.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"})})]})]}),K[Y.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(Y.inputSchema,null,2)})})}),r.jsx("div",{className:"space-y-4",children:Object.entries(Y.inputSchema.properties).map(([ae,ye])=>{var de;return r.jsxs("div",{className:"space-y-2",children:[r.jsxs("label",{className:"block text-sm font-medium text-gray-700",children:[ae,((de=Y.inputSchema.required)==null?void 0:de.includes(ae))&&r.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),ye.description&&r.jsx("p",{className:"text-xs text-gray-500",children:ye.description}),ee(Y,ae,ye)]},ae)})})]}),I[Y.name]&&r.jsx("div",{className:"border-t border-gray-100 pt-4 mt-4",children:I[Y.name].error?r.jsx(r.Fragment,{children:H(I[Y.name].error)?r.jsx(id,{}):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:I[Y.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(I[Y.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")})]})}),Q&&h&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx(Ll,{onSubmit:A,onCancel:Z,modalTitle:p("cloud.installServer",{name:h.title||h.name}),formError:X,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>"}}}})})]})},hj=({serverEntry:a,onClick:n})=>{var k,j;const{t:l}=Ne(),{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),U=D.getFullYear(),V=(D.getMonth()+1).toString().padStart(2,"0"),I=D.getDate().toString().padStart(2,"0");return`${U}/${V}/${I}`}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=((k=o.packages)==null?void 0:k.length)||0,O=((j=o.remotes)==null?void 0:j.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"})})]})]})]})]})},gj=({serverEntry:a,onBack:n,onInstall:l,installing:o=!1,isInstalled:c=!1,fetchVersions:d})=>{const{t:m}=Ne(),{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),[k,j]=y.useState(null),[S,D]=y.useState(null),[U,V]=y.useState(null),[I,M]=y.useState({packages:!0,remotes:!0,repository:!0}),$=g==null?void 0:g["io.modelcontextprotocol.registry/official"];y.useEffect(()=>{(async()=>{if(d){R(!0);try{const A=await d(p.name);w(A)}catch(A){console.error("Failed to load versions:",A)}finally{R(!1)}}})()},[p.name,d]);const K=p.icons&&p.icons.length>0?p.icons.find(A=>!A.theme||A.theme==="light")||p.icons[0]:null,q=Z=>{if(!Z)return"";try{return new Date(Z).toLocaleDateString()}catch{return""}},Q=Z=>{M(A=>({...A,[Z]:!A[Z]}))},G=(Z,A)=>{j(Z),D(A),V(null),E(!0)},X=()=>{E(!1),V(null)},N=async Z=>{try{if(!l||!S||!k)return;V(null);const A=Z.config;l(p,A),E(!1)}catch(A){console.error("Error installing server:",A),V(m("errors.serverInstall"))}},H=()=>{if(!S||!k)return null;if(console.log("Building initial form data for:",S),k==="package"&&"identifier"in S){const Z=S,A={};Z.environmentVariables&&Z.environmentVariables.forEach(z=>{A[z.name]=z.default||""});const L=xj(Z.registryType);return{name:p.name,status:"disconnected",config:{type:"stdio",command:L,args:yj(L,Z),env:Object.keys(A).length>0?A:void 0}}}else if(k==="remote"&&"url"in S){const Z=S,A={};Z.headers&&Z.headers.forEach(z=>{A[z.name]=z.default||z.value||""});const L=Z.type==="sse"?"sse":"streamable-http";return{name:p.name,status:"disconnected",config:{type:L,url:Z.url,headers:Object.keys(A).length>0?A:void 0}}}return null},B=(Z,A)=>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:Z.identifier}),Z.version&&r.jsxs("p",{className:"text-sm text-gray-500",children:["Version: ",Z.version]}),Z.runtimeHint&&r.jsx("p",{className:"text-sm text-gray-600 mt-1",children:Z.runtimeHint})]}),r.jsx("button",{onClick:()=>G("package",Z),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")})]}),Z.registryType&&r.jsxs("div",{className:"text-sm text-gray-600 mb-2",children:[r.jsx("span",{className:"font-medium",children:"Registry:"})," ",Z.registryType]}),Z.transport&&r.jsxs("div",{className:"text-sm text-gray-600 mb-2",children:[r.jsx("span",{className:"font-medium",children:"Transport:"})," ",Z.transport.type,Z.transport.url&&r.jsxs("span",{className:"ml-2 text-gray-500",children:["(",Z.transport.url,")"]})]}),Z.environmentVariables&&Z.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:Z.environmentVariables.map((L,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:L.name}),L.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")}),L.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")})]}),L.description&&r.jsx("p",{className:"text-gray-600 mt-1",children:L.description}),L.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:L.default})]})]},z))})]}),Z.packageArguments&&Z.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:Z.packageArguments.map((L,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:L.name}),L.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")}),L.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")}),L.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")})]}),L.description&&r.jsx("p",{className:"text-gray-600 mt-1",children:L.description}),L.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:L.type})]}),L.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:L.default})]}),L.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:L.value})]}),L.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:L.valueHint})]}),L.choices&&L.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:L.choices.join(", ")})]})]},z))})]})]},A),ce=(Z,A)=>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:Z.type}),r.jsx("p",{className:"text-sm text-gray-600 mt-1 break-all",children:Z.url})]}),r.jsx("button",{onClick:()=>G("remote",Z),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")})]}),Z.headers&&Z.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:Z.headers.map((L,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:L.name}),L.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")}),L.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")})]}),L.description&&r.jsx("p",{className:"text-gray-600 mt-1",children:L.description}),L.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:L.value})]}),L.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:L.default})]})]},z))})]})]},A);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:[K?r.jsx("img",{src:K.src,alt:p.title,className:"w-20 h-20 rounded-lg object-cover flex-shrink-0",onError:Z=>{Z.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:[($==null?void 0:$.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]}),($==null?void 0:$.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:$.status}),r.jsxs("span",{className:"flex flex-wrap items-center gap-4 text-sm text-gray-600",children:[($==null?void 0:$.publishedAt)&&r.jsxs("div",{children:[r.jsxs("span",{className:"font-medium",children:[m("registry.published"),":"]})," ",q($.publishedAt)]}),($==null?void 0:$.updatedAt)&&r.jsxs("div",{children:[r.jsxs("span",{className:"font-medium",children:[m("registry.updated"),":"]})," ",q($.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:()=>Q("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 ${I.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"})})]}),I.packages&&r.jsx("div",{className:"space-y-3",children:p.packages.map(B)})]}),p.remotes&&p.remotes.length>0&&r.jsxs("div",{className:"mb-6",children:[r.jsxs("button",{onClick:()=>Q("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 ${I.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"})})]}),I.remotes&&r.jsx("div",{className:"space-y-3",children:p.remotes.map(ce)})]}),p.repository&&r.jsxs("div",{className:"mb-6",children:[r.jsxs("button",{onClick:()=>Q("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 ${I.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"})})]}),I.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&&k&&r.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:r.jsx(Ll,{onSubmit:N,onCancel:X,modalTitle:m("registry.installServer",{name:p.title||p.name}),formError:U,initialData:H()})})]})};function xj(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 yj(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 bj=({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"})})]})]}),Wh=()=>{const{t:a}=Ne(),n=la(),{serverName:l}=Tg(),{showToast:o}=us(),[c,d]=Pv(),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:k,installServer:j,fetchServerByName:S,isServerInstalled:D,currentPage:U,totalPages:V,changePage:I,serversPerPage:M,changeServersPerPage:$}=oj(),{servers:pe,allServers:K,loading:q,error:Q,setError:G,fetchServerTools:X,callServerTool:N,currentPage:H,totalPages:B,changePage:ce,serversPerPage:Z,changeServersPerPage:A}=cj(),{servers:L,allServers:z,loading:P,error:le,setError:ee,searchServers:Y,clearSearch:ge,fetchServerByName:ae,fetchServerVersions:ye,currentPage:de,totalPages:oe,hasNextPage:xe,hasPreviousPage:Xe,changePage:$t,goToNextPage:Yt,goToPreviousPage:Ze,serversPerPage:gt,changeServersPerPage:Jt}=uj(),[_t,Qt]=y.useState(null),[Ht,fr]=y.useState(null),[tt,St]=y.useState(null),[lr,ze]=y.useState(""),[jt,Ce]=y.useState(""),[nt,lt]=y.useState(!1),[rr,Xt]=y.useState(new Set),[ft,ar]=y.useState(new Set);y.useEffect(()=>{(async()=>{if(l)if(m==="cloud"){const Te=pe.find(_e=>_e.name===l);Te?fr(Te):n("/market?tab=cloud")}else if(m==="registry"){console.log("Loading registry server details for:",l);const Te=await ae(l);Te?St(Te):n("/market?tab=registry")}else{const Te=await S(l);Te?Qt(Te):n("/market?tab=local")}else Qt(null),fr(null),St(null)})()},[l,m,pe,S,ae,n]);const xt=Ee=>{const Te=new URLSearchParams(c);Te.set("tab",Ee),d(Te),l&&n("/market?"+Te.toString())},Ma=Ee=>{Ee.preventDefault(),m==="local"?T(lr):m==="registry"&&Y(jt)},ia=Ee=>{m==="local"&&R(Ee)},La=()=>{m==="local"?(ze(""),R(""),O("")):m==="registry"&&(Ce(""),ge())},pr=Ee=>{var Te;if(m==="cloud")n(`/market/${Ee.name}?tab=cloud`);else if(m==="registry"){const _e=Ee;console.log("Registry server clicked:",_e);const qe=(Te=_e.server)==null?void 0:Te.name;if(console.log("Server name extracted:",qe),qe){const ct=`/market/${encodeURIComponent(qe)}?tab=registry`;console.log("Navigating to:",ct),n(ct)}else console.error("Server name is undefined in registry server:",_e)}else n(`/market/${Ee.name}?tab=local`)},hr=()=>{n(`/market?tab=${m}`)},W=async(Ee,Te)=>{try{lt(!0),await j(Ee,Te)&&o(a("market.installSuccess",{serverName:Ee.display_name}),"success")}finally{lt(!1)}},ve=async(Ee,Te)=>{try{lt(!0);const _e={name:Ee.name,config:Te},qe=await Et("/servers",_e);if(!qe.success){const ct=(qe==null?void 0:qe.message)||a("server.addError");o(ct,"error");return}Xt(ct=>new Set(ct).add(Ee.name)),o(a("cloud.installSuccess",{name:Ee.title||Ee.name}),"success")}catch(_e){console.error("Error installing cloud server:",_e);const qe=_e instanceof Error?_e.message:String(_e);o(a("cloud.installError",{error:qe}),"error")}finally{lt(!1)}},Fe=async(Ee,Te)=>{try{lt(!0);const _e={name:Ee.name,config:Te},qe=await Et("/servers",_e);if(!qe.success){const ct=(qe==null?void 0:qe.message)||a("server.addError");o(ct,"error");return}ar(ct=>new Set(ct).add(Ee.name)),o(a("registry.installSuccess",{name:Ee.title||Ee.name}),"success")}catch(_e){console.error("Error installing registry server:",_e);const qe=_e instanceof Error?_e.message:String(_e);o(a("registry.installError",{error:qe}),"error")}finally{lt(!1)}},Nt=async(Ee,Te,_e)=>{try{const qe=await N(Ee,Te,_e);return o(a("cloud.toolCallSuccess",{toolName:Te}),"success"),qe}catch(qe){const ct=qe instanceof Error?qe.message:String(qe);throw Vr(ct)||o(a("cloud.toolCallError",{toolName:Te,error:ct}),"error"),qe}},Vr=Ee=>Ee==="MCPROUTER_API_KEY_NOT_CONFIGURED"||Ee.toLowerCase().includes("mcprouter api key not configured"),oa=Ee=>{m==="local"?I(Ee):m==="registry"?$t(Ee):ce(Ee),window.scrollTo({top:0,behavior:"smooth"})},$r=Ee=>{const Te=parseInt(Ee.target.value,10);m==="local"?$(Te):m==="registry"?Jt(Te):A(Te)};if(_t)return r.jsx(mj,{server:_t,onBack:hr,onInstall:W,installing:nt,isInstalled:D(_t.name)});if(Ht)return r.jsx(pj,{serverName:Ht.name,onBack:hr,onCallTool:Nt,fetchServerTools:X,onInstall:ve,installing:nt,isInstalled:rr.has(Ht.name)});if(tt)return r.jsx(gj,{serverEntry:tt,onBack:hr,onInstall:Fe,installing:nt,isInstalled:ft.has(tt.server.name),fetchVersions:ye});const Ve=m==="local",it=m==="registry",he=Ve?p:it?L:pe,ie=Ve?g:it?z:K,be=Ve?h:[],sr=Ve?b:it?P:q,Yr=Ve?x:it?le:Q,ds=Ve?w:it?ee:G,ca=Ve?E:"",Tt=Ve?k:"",$e=Ve?U:it?de:H,yt=Ve?V:it?oe:B,Gt=Ve?M:it?gt:Z;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(id,{}):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?jt:lr,onChange:Ee=>{it?Ce(Ee.target.value):ze(Ee.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&&(lr||ca||Tt)||it&&jt)&&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")}),ca&&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(Ee=>r.jsx("button",{onClick:()=>ia(Ee),className:`px-3 py-2 rounded text-sm text-left transition-all duration-200 ${ca===Ee?"bg-blue-100 text-blue-800 font-medium btn-primary":"bg-gray-100 text-gray-800 hover:bg-gray-200 btn-secondary"}`,children:Ee},Ee))})]}):sr?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:sr?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((Ee,Te)=>Ve?r.jsx(dj,{server:Ee,onClick:pr},Te):it?r.jsx(hj,{serverEntry:Ee,onClick:pr},Te):r.jsx(fj,{server:Ee,onClick:pr},Te))}),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)*Gt+1,to:Math.min($e*Gt,ie.length),total:ie.length}):it?a("registry.showing",{from:($e-1)*Gt+1,to:($e-1)*Gt+he.length,total:ie.length+(xe?"+":"")}):a("cloud.showing",{from:($e-1)*Gt+1,to:Math.min($e*Gt,ie.length),total:ie.length})}),r.jsx("div",{className:"flex-[4] flex justify-center",children:it?r.jsx(bj,{currentPage:$e,hasNextPage:xe,hasPreviousPage:Xe,onNextPage:Yt,onPreviousPage:Ze}):r.jsx(Cd,{currentPage:$e,totalPages:yt,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:Gt,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"})]})]})]})]})})]})]})},vj={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"},wj={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 Sj({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",vj[a],wj[n],l),disabled:o,...d,children:c})}const jj=({logs:a,isLoading:n=!1,error:l=null,onClear:o})=>{const{t:c}=Ne(),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(j=>{const S=g?j.message.toLowerCase().includes(g.toLowerCase()):!0,D=b.includes(j.type),U=w.includes(j.source);return S&&D&&U}),O=j=>new Date(j).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),E=j=>{switch(j){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"}},k=j=>{switch(j){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:j=>h(j.target.value)}),r.jsx("div",{className:"flex gap-1 items-center",children:["debug","info","error","warn"].map(j=>r.jsx(eo,{variant:b.includes(j)?"default":"outline",className:`cursor-pointer ${b.includes(j)?E(j):""}`,onClick:()=>{b.includes(j)?x(S=>S.filter(D=>D!==j)):x(S=>[...S,j])},children:j},j))}),r.jsx("div",{className:"flex gap-1 items-center ml-2",children:["main","child"].map(j=>r.jsx(eo,{variant:w.includes(j)?"default":"outline",className:`cursor-pointer ${w.includes(j)?k(j):""}`,onClick:()=>{w.includes(j)?T(S=>S.filter(D=>D!==j)):T(S=>[...S,j])},children:c(j==="main"?"logs.mainProcess":"logs.childProcess")},j))})]}),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(Sj,{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((j,S)=>r.jsxs("div",{className:`py-1 ${j.type==="error"?"text-red-500":j.type==="warn"?"text-yellow-500":""}`,children:[r.jsxs("span",{className:"text-gray-400",children:["[",O(j.timestamp),"]"]}),r.jsx(eo,{className:`ml-2 mr-1 ${E(j.type)}`,children:j.type}),r.jsxs(eo,{variant:"default",className:`mr-2 ${k(j.source)}`,children:[j.source==="main"?c("logs.main"):c("logs.child"),j.processId?` (${j.processId})`:""]}),r.jsx("span",{className:"whitespace-pre-wrap",children:j.message})]},`${j.timestamp}-${S}`))})]})},Nj=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}},Cj=()=>{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=An();p=new EventSource(yd(`/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 Nj(),n([])}catch(p){d(p instanceof Error?p:new Error("Failed to clear logs"))}}}},kj=()=>{const{t:a}=Ne(),{logs:n,loading:l,error:o,clearLogs:c}=Cj();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(jj,{logs:n,isLoading:l,error:o,onClear:c})})]})},D0=["success","error"],Aj=a=>D0.includes(a),Ej=()=>{const{t:a}=Ne(),[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),[k,j]=y.useState(null),[S,D]=y.useState(!1),[U,V]=y.useState({}),[I,M]=y.useState(""),[$,pe]=y.useState(""),[K,q]=y.useState(""),[Q,G]=y.useState(""),[X,N]=y.useState(""),H=y.useCallback(async()=>{R(!0),E(null);try{const ae={...U},[ye,de,oe]=await Promise.all([yS(h,x,ae),vS(ae),wS()]);ye!=null&&ye.success&&Array.isArray(ye.data)&&(l(ye.data),ye.pagination&&g(ye.pagination)),de!=null&&de.success&&de.data&&c(de.data),oe!=null&&oe.success&&oe.data&&m(oe.data)}catch(ae){console.error("Error fetching activity data:",ae),E(a("activity.fetchError"))}finally{R(!1)}},[h,x,U,a]);y.useEffect(()=>{H()},[H]),y.useEffect(()=>{if(!p)return;const ae=Math.max(1,p.totalPages||1);h>ae&&b(ae)},[p,h]);const B=async ae=>{try{const ye=await bS(ae.id);ye!=null&&ye.success&&ye.data&&(j(ye.data),D(!0))}catch(ye){console.error("Error fetching activity details:",ye)}},ce=async()=>{var ae;if(window.confirm(a("activity.confirmCleanup")))try{const ye=await SS(30);ye!=null&&ye.success&&(alert(a("activity.cleanupSuccess",{count:((ae=ye.data)==null?void 0:ae.deletedCount)||0})),H())}catch(ye){console.error("Error cleaning up activities:",ye),alert(a("activity.cleanupError"))}},Z=()=>{const ae={};I&&(ae.server=I),$&&(ae.tool=$),K&&Aj(K)&&(ae.status=K),Q&&(ae.group=Q),X&&(ae.keyName=X),V(ae),b(1)},A=()=>{M(""),pe(""),q(""),G(""),N(""),V({}),b(1)},L=ae=>ae<1e3?`${ae}ms`:ae<6e4?`${(ae/1e3).toFixed(2)}s`:`${(ae/6e4).toFixed(2)}m`,z=ae=>new Date(ae).toLocaleString(),P=ae=>{if(!ae)return null;try{return JSON.parse(ae)}catch{return ae}},le=()=>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:L(o.avgDuration)})]})]})}):null,ee=()=>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:I,onChange:ae=>M(ae.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"}),I&&r.jsx("button",{onClick:()=>M(""),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(ae=>r.jsx("option",{value:ae},ae))})]}),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:$,onChange:ae=>pe(ae.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"}),$&&r.jsx("button",{onClick:()=>pe(""),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(ae=>r.jsx("option",{value:ae},ae))})]}),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:K,onChange:ae=>q(ae.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"}),K&&r.jsx("button",{onClick:()=>q(""),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:D0.map(ae=>r.jsx("option",{value:ae},ae))})]}),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:Q,onChange:ae=>G(ae.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"}),Q&&r.jsx("button",{onClick:()=>G(""),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(ae=>r.jsx("option",{value:ae},ae))})]}),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:X,onChange:ae=>N(ae.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"}),X&&r.jsx("button",{onClick:()=>N(""),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(ae=>r.jsx("option",{value:ae},ae))})]}),r.jsxs("div",{className:"flex-shrink-0 flex items-center gap-2",children:[r.jsxs("button",{onClick:Z,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:A,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")]})]})]})}),Y=()=>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(ae=>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(ae.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:ae.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:ae.tool})}),r.jsx("td",{className:"px-4 py-3 text-sm text-gray-900 dark:text-gray-200 whitespace-nowrap",children:L(ae.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 ${ae.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:ae.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:ae.group||"-"}),r.jsx("td",{className:"px-4 py-3 text-sm text-gray-500 dark:text-gray-400",children:ae.keyName||"-"}),r.jsx("td",{className:"px-4 py-3 text-sm",children:r.jsx("button",{onClick:()=>B(ae),className:"text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300",children:a("common.view")})})]},ae.id))})]})})}),ge=()=>{if(!S||!k)return null;const ae=P(k.input),ye=P(k.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(k.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:L(k.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:k.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:k.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 ${k.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:k.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:k.group||"-"})]}),k.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:k.keyName})]})]}),k.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:k.errorMessage})]}),ae&&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 ae=="string"?ae:JSON.stringify(ae,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:ce,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:[le(),ee(),Y(),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(Cd,{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:ae=>{w(Number(ae.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()]})},Tj=()=>{const{serverName:a}=Tg();return r.jsx(uo,{to:`/market/${a}?tab=cloud`,replace:!0})};function eg(){const a=Rl();return r.jsx(Ww,{children:r.jsx(d2,{children:r.jsx(tS,{children:r.jsx(Xw,{children:r.jsx(aS,{children:r.jsx(zv,{basename:a,children:r.jsxs(iv,{children:[r.jsx(Wt,{path:"/login",element:r.jsx(TS,{})}),r.jsx(Wt,{element:r.jsx(kS,{}),children:r.jsxs(Wt,{element:r.jsx(CS,{}),children:[r.jsx(Wt,{path:"/",element:r.jsx(RS,{})}),r.jsx(Wt,{path:"/servers",element:r.jsx(JS,{})}),r.jsx(Wt,{path:"/groups",element:r.jsx(ej,{})}),r.jsx(Wt,{path:"/users",element:r.jsx(aj,{})}),r.jsx(Wt,{path:"/market",element:r.jsx(Wh,{})}),r.jsx(Wt,{path:"/market/:serverName",element:r.jsx(Wh,{})}),r.jsx(Wt,{path:"/cloud",element:r.jsx(uo,{to:"/market?tab=cloud",replace:!0})}),r.jsx(Wt,{path:"/cloud/:serverName",element:r.jsx(Tj,{})}),r.jsx(Wt,{path:"/logs",element:r.jsx(kj,{})}),r.jsx(Wt,{path:"/activity",element:r.jsx(Ej,{})}),r.jsx(Wt,{path:"/settings",element:r.jsx(ij,{})})]})}),r.jsx(Wt,{path:"*",element:r.jsx(uo,{to:"/"})})]})})})})})})})}const Oe=a=>typeof a=="string",jl=()=>{let a,n;const l=new Promise((o,c)=>{a=o,n=c});return l.resolve=a,l.reject=n,l},tg=a=>a==null?"":""+a,Rj=(a,n,l)=>{a.forEach(o=>{n[o]&&(l[o]=n[o])})},Oj=/###/g,rg=a=>a&&a.indexOf("###")>-1?a.replace(Oj,"."):a,ag=a=>!a||Oe(a),Nl=(a,n,l)=>{const o=Oe(n)?n.split("."):n;let c=0;for(;c<o.length-1;){if(ag(a))return{};const d=rg(o[c]);!a[d]&&l&&(a[d]=new l),Object.prototype.hasOwnProperty.call(a,d)?a=a[d]:a={},++c}return ag(a)?{}:{obj:a,k:rg(o[c])}},sg=(a,n,l)=>{const{obj:o,k:c}=Nl(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=Nl(a,m,Object);for(;p.obj===void 0&&m.length;)d=`${m[m.length-1]}.${d}`,m=m.slice(0,m.length-1),p=Nl(a,m,Object),p!=null&&p.obj&&typeof p.obj[`${p.k}.${d}`]<"u"&&(p.obj=void 0);p.obj[`${p.k}.${d}`]=l},zj=(a,n,l,o)=>{const{obj:c,k:d}=Nl(a,n,Object);c[d]=c[d]||[],c[d].push(l)},fo=(a,n)=>{const{obj:l,k:o}=Nl(a,n);if(l&&Object.prototype.hasOwnProperty.call(l,o))return l[o]},Mj=(a,n,l)=>{const o=fo(a,l);return o!==void 0?o:fo(n,l)},P0=(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]):P0(a[o],n[o],l):a[o]=n[o]);return a},yn=a=>a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Lj={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Dj=a=>Oe(a)?a.replace(/[&<>"'\/]/g,n=>Lj[n]):a;class Pj{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 Uj=[" ",",","?","!",";"],_j=new Pj(20),Bj=(a,n,l)=>{n=n||"",l=l||"";const o=Uj.filter(m=>n.indexOf(m)<0&&l.indexOf(m)<0);if(o.length===0)return!0;const c=_j.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},od=(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},kl=a=>a==null?void 0:a.replace("_","-"),Ij={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 po{constructor(n,l={}){this.init(n,l)}init(n,l={}){this.prefix=l.prefix||"i18next:",this.logger=n||Ij,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 po(this.logger,{prefix:`${this.prefix}:${n}:`,...this.options})}clone(n){return n=n||this.options,n.prefix=n.prefix||this.prefix,new po(this.logger,n)}}var sa=new po;class vo{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 ng extends vo{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=fo(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:od((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),sg(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=fo(this.data,p)||{};m.skipCopy||(o=JSON.parse(JSON.stringify(o))),c?P0(g,o,d):g={...g,...o},sg(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 U0={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 _0=Symbol("i18next/PATH_KEY");function Hj(){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===_0?a:(a.push(c),l=Proxy.revocable(o,n),l.proxy)},Proxy.revocable(Object.create(null),n).proxy}function cd(a,n){const{[_0]:l}=a(Hj());return l.join((n==null?void 0:n.keySeparator)??".")}const lg={},$u=a=>!Oe(a)&&typeof a!="boolean"&&typeof a!="number";class ho extends vo{constructor(n,l={}){super(),Rj(["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=$u(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&&!Bj(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=cd(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,k=["[object Number]","[object Function]","[object RegExp]"],j=c.joinArrays!==void 0?c.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject,D=c.count!==void 0&&!Oe(c.count),U=ho.hasDefaultValue(c),V=D?this.pluralResolver.getSuffix(x,c.count,c):"",I=c.ordinal&&D?this.pluralResolver.getSuffix(x,c.count,{ordinal:!1}):"",M=D&&!c.ordinal&&c.count===0,$=M&&c[`defaultValue${this.options.pluralSeparator}zero`]||c[`defaultValue${V}`]||c[`defaultValue${I}`]||c.defaultValue;let pe=R;S&&!R&&U&&(pe=$);const K=$u(pe),q=Object.prototype.toString.apply(pe);if(S&&pe&&K&&k.indexOf(q)<0&&!(Oe(j)&&Array.isArray(pe))){if(!c.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const Q=this.options.returnedObjectHandler?this.options.returnedObjectHandler(O,pe,{...c,ns:g}):`key '${p} (${this.language})' returned an object instead of string.`;return d?(T.res=Q,T.usedParams=this.getUsedParamsDetails(c),T):Q}if(m){const Q=Array.isArray(pe),G=Q?[]:{},X=Q?E:O;for(const N in pe)if(Object.prototype.hasOwnProperty.call(pe,N)){const H=`${X}${m}${N}`;U&&!R?G[N]=this.translate(H,{...c,defaultValue:$u($)?$[N]:void 0,joinArrays:!1,ns:g}):G[N]=this.translate(H,{...c,joinArrays:!1,ns:g}),G[N]===H&&(G[N]=pe[N])}R=G}}else if(S&&Oe(j)&&Array.isArray(R))R=R.join(j),R&&(R=this.extendTranslation(R,n,c,o));else{let Q=!1,G=!1;!this.isValidLookup(R)&&U&&(Q=!0,R=$),this.isValidLookup(R)||(G=!0,R=p);const N=(c.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&G?void 0:R,H=U&&$!==R&&this.options.updateMissing;if(G||Q||H){if(this.logger.log(H?"updateKey":"missingKey",x,h,p,H?$:R),m){const A=this.resolve(p,{...c,keySeparator:!1});A&&A.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 B=[];const ce=this.languageUtils.getFallbackCodes(this.options.fallbackLng,c.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ce&&ce[0])for(let A=0;A<ce.length;A++)B.push(ce[A]);else this.options.saveMissingTo==="all"?B=this.languageUtils.toResolveHierarchy(c.lng||this.language):B.push(c.lng||this.language);const Z=(A,L,z)=>{var le;const P=U&&z!==R?z:N;this.options.missingKeyHandler?this.options.missingKeyHandler(A,h,L,P,H,c):(le=this.backendConnector)!=null&&le.saveMissing&&this.backendConnector.saveMissing(A,h,L,P,H,c),this.emit("missingKey",A,h,L,R)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?B.forEach(A=>{const L=this.pluralResolver.getSuffixes(A,c);M&&c[`defaultValue${this.options.pluralSeparator}zero`]&&L.indexOf(`${this.options.pluralSeparator}zero`)<0&&L.push(`${this.options.pluralSeparator}zero`),L.forEach(z=>{Z([A],p+z,c[`defaultValue${z}`]||$)})}):Z(B,p,$))}R=this.extendTranslation(R,n,c,T,o),G&&R===p&&this.options.appendNamespaceToMissingKey&&(R=`${h}${b}${p}`),(G||Q)&&this.options.parseMissingKeyHandler&&(R=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${b}${p}`:p,Q?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=U0.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 k,j;this.isValidLookup(o)||(p=E,!lg[`${O[0]}-${E}`]&&((k=this.utils)!=null&&k.hasLoadedNamespace)&&!((j=this.utils)!=null&&j.hasLoadedNamespace(p))&&(lg[`${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 V;if(this.isValidLookup(o))return;m=S;const D=[b];if((V=this.i18nFormat)!=null&&V.addLookupKeys)this.i18nFormat.addLookupKeys(D,b,S,E,l);else{let I;w&&(I=this.pluralResolver.getSuffix(S,l.count,l));const M=`${this.options.pluralSeparator}zero`,$=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(w&&(l.ordinal&&I.indexOf($)===0&&D.push(b+I.replace($,this.options.pluralSeparator)),D.push(b+I),T&&D.push(b+M)),R){const pe=`${b}${this.options.contextSeparator||"_"}${l.context}`;D.push(pe),w&&(l.ordinal&&I.indexOf($)===0&&D.push(pe+I.replace($,this.options.pluralSeparator)),D.push(pe+I),T&&D.push(pe+M))}}let U;for(;U=D.pop();)this.isValidLookup(o)||(d=U,o=this.getResource(S,E,U,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 ig{constructor(n){this.options=n,this.supportedLngs=this.options.supportedLngs||!1,this.logger=sa.create("languageUtils")}getScriptPartFromCode(n){if(n=kl(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=kl(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 og={zero:0,one:1,two:2,few:3,many:4,other:5},cg={select:a=>a===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Gj{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=kl(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!"),cg;if(!n.match(/-|_/))return cg;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)=>og[c]-og[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 ug=(a,n,l,o=".",c=!0)=>{let d=Mj(a,n,l);return!d&&c&&Oe(l)&&(d=od(a,l,o),d===void 0&&(d=od(n,l,o))),d},Yu=a=>a.replace(/\$/g,"$$$$");class Kj{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:k,alwaysFormat:j}=n.interpolation;this.escape=l!==void 0?l:Dj,this.escapeValue=o!==void 0?o:!0,this.useRawValueToEscape=c!==void 0?c:!1,this.prefix=d?yn(d):m||"{{",this.suffix=p?yn(p):g||"}}",this.formatSeparator=h||",",this.unescapePrefix=b?"":x||"-",this.unescapeSuffix=this.unescapePrefix?"":b||"",this.nestingPrefix=w?yn(w):T||yn("$t("),this.nestingSuffix=R?yn(R):O||yn(")"),this.nestingOptionsSeparator=E||",",this.maxReplaces=k||1e3,this.alwaysFormat=j!==void 0?j:!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 j=ug(l,g,R,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(j,void 0,o,{...c,...l,interpolationkey:R}):j}const O=R.split(this.formatSeparator),E=O.shift().trim(),k=O.join(this.formatSeparator).trim();return this.format(ug(l,g,E,this.options.keySeparator,this.options.ignoreJSONStructure),k,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=>Yu(R)},{regex:this.regexp,safeValue:R=>this.escapeValue?Yu(this.escape(R)):Yu(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 k=b(n,d,c);m=Oe(k)?k:""}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=tg(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=tg(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 qj=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}},dg=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(kl(o),c),n[m]=p),p(l)}},Fj=a=>(n,l,o)=>a(kl(l),o)(n);class Vj{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?dg:Fj;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()]=dg(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}=qj(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 $j=(a,n)=>{a.pending[n]!==void 0&&(delete a.pending[n],a.pendingCount--)};class Yj extends vo{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=>{zj(g.loaded,[d],m),$j(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 mg=()=>({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}),fg=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},to=()=>{},Jj=a=>{Object.getOwnPropertyNames(Object.getPrototypeOf(a)).forEach(l=>{typeof a[l]=="function"&&(a[l]=a[l].bind(a))})};class Al extends vo{constructor(n={},l){if(super(),this.options=fg(n),this.services={},this.logger=sa,this.modules={external:[]},Jj(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=mg();this.options={...o,...this.options,...fg(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=Vj;const b=new ig(this.options);this.store=new ng(this.options.resources,this.options);const x=this.services;x.logger=sa,x.resourceStore=this.store,x.languageUtils=b,x.pluralResolver=new Gj(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 Kj(this.options),x.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},x.backendConnector=new Yj(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 ho(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=to),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=jl(),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=to){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=jl();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=to),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"&&U0.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=jl();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=cd(x,{...this.options,...m})),`${g.keyPrefix}${h}${x}`)):(typeof d=="function"&&(d=cd(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=jl();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=jl();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 ig(mg());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 Al(n,l)}cloneInstance(n={},l=to){const o=n.forkResourceStore;o&&delete n.forkResourceStore;const c={...this.options,...n,isClone:!0},d=new Al(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 ng(p,c),d.services.resourceStore=d.store}return d.translator=new ho(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 tr=Al.createInstance();tr.createInstance=Al.createInstance;tr.createInstance;tr.dir;tr.init;tr.loadResources;tr.reloadResources;tr.use;tr.changeLanguage;tr.getFixedT;tr.t;tr.exists;tr.setDefaultNamespace;tr.hasLoadedNamespace;tr.loadNamespaces;tr.loadLanguages;const{slice:Qj,forEach:Xj}=[];function Zj(a){return Xj.call(Qj.call(arguments,1),n=>{if(n)for(const l in n)a[l]===void 0&&(a[l]=n[l])}),a}function Wj(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 pg=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,eN=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(!pg.test(o.domain))throw new TypeError("option domain is invalid");d+=`; Domain=${o.domain}`}if(o.path){if(!pg.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},hg={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=eN(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 tN={name:"cookie",lookup(a){let{lookupCookie:n}=a;if(n&&typeof document<"u")return hg.read(n)||void 0},cacheUserLanguage(a,n){let{lookupCookie:l,cookieMinutes:o,cookieDomain:c,cookieOptions:d}=n;l&&typeof document<"u"&&hg.create(l,a,o,c,d)}},rN={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}},aN={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 bn=null;const gg=()=>{if(bn!==null)return bn;try{if(bn=typeof window<"u"&&window.localStorage!==null,!bn)return!1;const a="i18next.translate.boo";window.localStorage.setItem(a,"foo"),window.localStorage.removeItem(a)}catch{bn=!1}return bn};var sN={name:"localStorage",lookup(a){let{lookupLocalStorage:n}=a;if(n&&gg())return window.localStorage.getItem(n)||void 0},cacheUserLanguage(a,n){let{lookupLocalStorage:l}=n;l&&gg()&&window.localStorage.setItem(l,a)}};let vn=null;const xg=()=>{if(vn!==null)return vn;try{if(vn=typeof window<"u"&&window.sessionStorage!==null,!vn)return!1;const a="i18next.translate.boo";window.sessionStorage.setItem(a,"foo"),window.sessionStorage.removeItem(a)}catch{vn=!1}return vn};var nN={name:"sessionStorage",lookup(a){let{lookupSessionStorage:n}=a;if(n&&xg())return window.sessionStorage.getItem(n)||void 0},cacheUserLanguage(a,n){let{lookupSessionStorage:l}=n;l&&xg()&&window.sessionStorage.setItem(l,a)}},lN={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}},iN={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}},oN={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}},cN={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 B0=!1;try{document.cookie,B0=!0}catch{}const I0=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];B0||I0.splice(1,1);const uN=()=>({order:I0,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:a=>a});class H0{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=Zj(l,this.options||{},uN()),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(tN),this.addDetector(rN),this.addDetector(sN),this.addDetector(nN),this.addDetector(lN),this.addDetector(iN),this.addDetector(oN),this.addDetector(cN),this.addDetector(aN)}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&&!Wj(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)}))}}H0.type="languageDetector";const dN={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"},mN={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..."},fN={viewProfile:"View profile",userCenter:"User Center"},pN={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"},hN={label:"WeChat",title:"Connect via WeChat",qrCodeAlt:"WeChat QR Code",scanMessage:"Scan this QR code to connect with us on WeChat"},gN={label:"Discord",title:"Join our Discord server",community:"Join our growing community on Discord for support, discussions, and updates!"},xN={title:"Theme",light:"Light",dark:"Dark",system:"System"},yN={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"},bN={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",description:"Server Note",descriptionPlaceholder:"Optional note to describe this server",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"}},vN={online:"Online",offline:"Offline",connecting:"Connecting",oauthRequired:"OAuth Required",clickToAuthorize:"Click to authorize with OAuth",oauthWindowOpened:"OAuth authorization window opened. Please complete the authorization."},wN={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"},SN={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"},jN={rowsPerPage:"Rows per page",showing:"Showing {{from}}-{{to}} of {{total}}"},NN={dashboard:"Dashboard",servers:"Servers",groups:"Groups",users:"Users",settings:"Settings",changePassword:"Change Password",market:"Market",cloud:"Cloud Market",logs:"Logs",activity:"Activity"},CN={dashboard:{title:"Dashboard",totalServers:"Total",onlineServers:"Online",disabledServers:"Disabled",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"}},kN={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"},AN={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"},EN={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"},TN={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."}},RN={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}}"},ON={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"},zN={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}}"},MN={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"},LN={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"},DN={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"},PN={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:"},UN={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:"},_N={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."},BN={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"}},IN={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"},HN={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"},GN={app:dN,about:mN,profile:fN,sponsor:pN,wechat:hN,discord:gN,theme:xN,auth:yN,server:bN,status:vN,errors:wN,common:SN,pagination:jN,nav:NN,pages:CN,logs:kN,groups:AN,market:EN,oauthServer:TN,cloud:RN,registry:ON,tool:zN,prompt:MN,settings:LN,mcpb:DN,jsonImport:PN,groupImport:UN,users:_N,api:BN,oauthCallback:IN,activity:HN},KN={title:"MCPHub 控制面板",error:"错误",closeButton:"关闭",noServers:"没有可用的 MCP 服务器",loading:"加载中...",logout:"退出登录",profile:"个人资料",changePassword:"修改密码",toggleSidebar:"切换侧边栏",welcomeUser:"欢迎, {{username}}",name:"MCPHub"},qN={title:"关于",versionInfo:"MCPHub 版本: {{version}}",newVersion:"有新版本可用!",currentVersion:"当前版本",newVersionAvailable:"新版本 {{version}} 已发布",viewOnGitHub:"在 GitHub 上查看",checkForUpdates:"检查更新",checking:"检查更新中..."},FN={viewProfile:"查看个人中心",userCenter:"个人中心"},VN={label:"赞助",title:"支持项目",rewardAlt:"赞赏码",supportMessage:"通过捐赠支持 MCPHub 的开发!",supportButton:"在 Ko-fi 上支持"},$N={label:"微信",title:"微信联系",qrCodeAlt:"微信二维码",scanMessage:"扫描二维码添加微信"},YN={label:"Discord",title:"加入我们的 Discord 服务器",community:"加入我们不断壮大的 Discord 社区,获取支持、参与讨论并了解最新动态!"},JN={title:"主题",light:"浅色",dark:"深色",system:"系统"},QN={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 个字符,且包含字母、数字和特殊字符"},XN={addServer:"添加服务器",add:"添加",edit:"编辑",copy:"复制",delete:"删除",confirmDelete:"您确定要删除此服务器吗?",deleteWarning:"删除服务器 '{{name}}' 将会移除该服务器及其所有数据。此操作无法撤销。",status:"状态",tools:"工具",prompts:"提示词",name:"服务器名称",description:"服务器注释",descriptionPlaceholder:"可选:记录这个服务器的用途说明",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:"刷新令牌"}},ZN={online:"在线",offline:"离线",connecting:"连接中",oauthRequired:"需要OAuth授权",clickToAuthorize:"点击进行OAuth授权",oauthWindowOpened:"OAuth授权窗口已打开,请完成授权。"},WN={general:"发生错误",network:"网络连接错误,请检查您的互联网连接",serverConnection:"无法连接到服务器,请检查服务器是否正在运行",serverAdd:"添加服务器失败,请检查服务器状态",serverUpdate:"编辑服务器 {{serverName}} 失败,请检查服务器状态",serverFetch:"获取服务器数据失败,请稍后重试",failedToReloadServer:"重载服务器失败",initialStartup:"服务器可能正在启动中。首次启动可能需要一些时间,请耐心等候...",serverInstall:"安装服务器失败",failedToFetchSettings:"获取设置失败",failedToUpdateSystemConfig:"更新系统配置失败",failedToUpdateRouteConfig:"更新路由配置失败",failedToUpdateSmartRoutingConfig:"更新智能路由配置失败"},e4={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:"未激活"},t4={rowsPerPage:"每页行数",showing:"显示第 {{from}}-{{to}} 条,共 {{total}} 条"},r4={dashboard:"仪表盘",servers:"服务器",settings:"设置",changePassword:"修改密码",groups:"分组",users:"用户",market:"市场",cloud:"云端市场",logs:"日志",activity:"活动"},a4={dashboard:{title:"仪表盘",totalServers:"总数",onlineServers:"在线",disabledServers:"禁用",offlineServers:"离线",connectingServers:"连接中",recentServers:"最近的服务器"},servers:{title:"服务器管理"},settings:{title:"设置",language:"语言",account:"账户设置",password:"修改密码",appearance:"外观",routeConfig:"安全配置",installConfig:"安装",smartRouting:"智能路由",oauthServer:"OAuth"},groups:{title:"分组管理"},users:{title:"用户管理"},market:{title:"市场中心 - 本地市场和云端市场"},logs:{title:"系统日志"}},s4={filters:"筛选",search:"搜索日志...",autoScroll:"自动滚动",clearLogs:"清除日志",loading:"加载日志中...",noLogs:"暂无日志。",noMatch:"没有匹配当前筛选条件的日志。",mainProcess:"主进程",childProcess:"子进程",main:"主",child:"子"},n4={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:"配置工具"},l4={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:"确认并安装"},i4={authorizeTitle:"授权应用",authorizeSubtitle:"允许此应用访问您的 MCPHub 账号。",buttons:{approve:"允许访问",deny:"拒绝",approveSubtitle:"如果您信任此应用,建议选择允许。",denySubtitle:"您可以在之后随时再次授权。"}},o4={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}}"},c4={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:"请求头"},u4={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}}"},d4={run:"获取",running:"获取中...",result:"提示词结果",error:"提示词错误",execution:"提示词执行",successful:"成功",failed:"失败",errorDetails:"错误详情:",noContent:"提示词执行成功但未返回内容。",unknownError:"发生未知错误",jsonResponse:"JSON 响应:",description:"描述",messages:"消息",noDescription:"无描述信息",runPromptWithName:"获取提示词: {{name}}",descriptionUpdateSuccess:"提示词描述更新成功",descriptionUpdateFailed:"更新提示词描述失败"},m4={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:"请输入合法的非负数字"},f4={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:"覆盖"},p4={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}} 个服务器。部分服务器失败:"},h4={button:"导入",title:"从 JSON 导入分组",inputLabel:"分组配置 JSON",inputHelp:"粘贴您的分组配置 JSON。每个分组可以包含一个服务器列表。",preview:"预览",previewTitle:"预览要导入的分组",import:"导入",importing:"导入中...",invalidFormat:"无效的 JSON 格式。JSON 必须包含 'groups' 数组。",missingName:"每个分组必须有 'name' 字段。",parseError:"解析 JSON 失败。请检查格式后重试。",addFailed:"添加分组失败",importFailed:"导入分组失败",partialSuccess:"成功导入 {{count}} / {{total}} 个分组。部分分组失败:"},g4={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}}' 吗?此操作无法撤消。"},x4={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:"服务器工具更新成功"}},y4={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:"关闭窗口"},b4={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:"活动跟踪功能仅在数据库模式下可用"},v4={app:KN,about:qN,profile:FN,sponsor:VN,wechat:$N,discord:YN,theme:JN,auth:QN,server:XN,status:ZN,errors:WN,common:e4,pagination:t4,nav:r4,pages:a4,logs:s4,groups:n4,market:l4,oauthServer:i4,cloud:o4,registry:c4,tool:u4,prompt:d4,settings:m4,mcpb:f4,jsonImport:p4,groupImport:h4,users:g4,api:x4,oauthCallback:y4,activity:b4},w4={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"},S4={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..."},j4={viewProfile:"Voir le profil",userCenter:"Centre utilisateur"},N4={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"},C4={label:"WeChat",title:"Se connecter via WeChat",qrCodeAlt:"QR Code WeChat",scanMessage:"Scannez ce QR code pour nous contacter sur WeChat"},k4={label:"Discord",title:"Rejoignez notre serveur Discord",community:"Rejoignez notre communauté grandissante sur Discord pour du support, des discussions et des mises à jour !"},A4={title:"Thème",light:"Clair",dark:"Sombre",system:"Système"},E4={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"},T4={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",description:"Note du serveur",descriptionPlaceholder:"Optionnel : décrivez l'utilité de ce 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"}},R4={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."},O4={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"},z4={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"},M4={rowsPerPage:"Lignes par page",showing:"Affichage de {{from}}-{{to}} sur {{total}}"},L4={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é"},D4={dashboard:{title:"Tableau de bord",totalServers:"Total",onlineServers:"En ligne",disabledServers:"Désactivés",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"}},P4={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"},U4={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"},_4={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"},B4={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."}},I4={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}}"},H4={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"},G4={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}}"},K4={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"},q4={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"},F4={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"},V4={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é :"},$4={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é :"},Y4={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."},J4={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"}},Q4={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"},X4={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"},Z4={app:w4,about:S4,profile:j4,sponsor:N4,wechat:C4,discord:k4,theme:A4,auth:E4,server:T4,status:R4,errors:O4,common:z4,pagination:M4,nav:L4,pages:D4,logs:P4,groups:U4,market:_4,oauthServer:B4,cloud:I4,registry:H4,tool:G4,prompt:K4,settings:q4,mcpb:F4,jsonImport:V4,groupImport:$4,users:Y4,api:J4,oauthCallback:Q4,activity:X4},W4={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"},eC={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..."},tC={viewProfile:"Profili görüntüle",userCenter:"Kullanıcı Merkezi"},rC={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"},aC={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"},sC={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!"},nC={title:"Tema",light:"Açık",dark:"Koyu",system:"Sistem"},lC={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"},iC={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ı",description:"Sunucu Notu",descriptionPlaceholder:"İsteğe bağlı: Bu sunucunun ne işe yaradığını yazın",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"}},oC={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."},cC={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"},uC={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"},dC={rowsPerPage:"Sayfa başına satır",showing:"Toplam {{total}} öğeden {{from}}-{{to}} gösteriliyor"},mC={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"},fC={dashboard:{title:"Kontrol Paneli",totalServers:"Toplam",onlineServers:"Çevrimiçi",disabledServers:"Devre Dışı",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"}},pC={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"},hC={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"},gC={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"},xC={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."}},yC={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}}"},bC={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"},vC={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"},wC={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"},SC={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"},jC={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"},NC={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:"},CC={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:"},kC={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."},AC={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"}},EC={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"},TC={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"},RC={app:W4,about:eC,profile:tC,sponsor:rC,wechat:aC,discord:sC,theme:nC,auth:lC,server:iC,status:oC,errors:cC,common:uC,pagination:dC,nav:mC,pages:fC,logs:pC,groups:hC,market:gC,oauthServer:xC,cloud:yC,registry:bC,tool:vC,prompt:wC,settings:SC,mcpb:jC,jsonImport:NC,groupImport:CC,users:kC,api:AC,oauthCallback:EC,activity:TC};tr.use(H0).use(j2).init({resources:{en:{translation:GN},zh:{translation:v4},fr:{translation:Z4},tr:{translation:RC}},fallbackLng:"en",debug:!1,defaultNS:"translation",interpolation:{escapeValue:!1},detection:{order:["localStorage","cookie","htmlTag","navigator"],caches:["localStorage","cookie"]}});const OC=()=>{$v()};OC();async function zC(){try{console.log("Loading runtime configuration...");const a=await qv();console.log("Runtime configuration loaded:",a),window.__MCPHUB_CONFIG__=a,kh.createRoot(document.getElementById("root")).render(r.jsx(Ta.StrictMode,{children:r.jsx(eg,{})}))}catch(a){console.error("Failed to initialize app:",a),console.log("Starting app with default configuration..."),window.__MCPHUB_CONFIG__={basePath:"",version:"dev",name:"mcphub"},kh.createRoot(document.getElementById("root")).render(r.jsx(Ta.StrictMode,{children:r.jsx(eg,{})}))}}zC();
|
|
294
|
-
//# sourceMappingURL=index-CtcblSpA.js.map
|