@samanhappy/mcphub 0.12.12 → 0.12.14

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.
Files changed (37) hide show
  1. package/README.md +1 -1
  2. package/dist/controllers/mcpbController.js +32 -3
  3. package/dist/controllers/mcpbController.js.map +1 -1
  4. package/dist/controllers/oauthCallbackController.js +1 -1
  5. package/dist/controllers/oauthCallbackController.js.map +1 -1
  6. package/dist/controllers/oauthServerController.js +39 -6
  7. package/dist/controllers/oauthServerController.js.map +1 -1
  8. package/dist/controllers/registryController.js +3 -2
  9. package/dist/controllers/registryController.js.map +1 -1
  10. package/dist/dao/GroupDao.js +2 -2
  11. package/dist/dao/GroupDao.js.map +1 -1
  12. package/dist/routes/index.js +2 -2
  13. package/dist/routes/index.js.map +1 -1
  14. package/dist/services/groupService.js +2 -2
  15. package/dist/services/groupService.js.map +1 -1
  16. package/dist/services/mcpOAuthProvider.js +4 -56
  17. package/dist/services/mcpOAuthProvider.js.map +1 -1
  18. package/dist/services/mcpService.js +34 -9
  19. package/dist/services/mcpService.js.map +1 -1
  20. package/dist/services/oauthClientRegistration.js +5 -1
  21. package/dist/services/oauthClientRegistration.js.map +1 -1
  22. package/dist/services/vectorSearchService.js +4 -4
  23. package/dist/services/vectorSearchService.js.map +1 -1
  24. package/dist/utils/oauthRedirectUri.js +65 -0
  25. package/dist/utils/oauthRedirectUri.js.map +1 -0
  26. package/dist/utils/tokenTruncation.js +45 -37
  27. package/dist/utils/tokenTruncation.js.map +1 -1
  28. package/frontend/dist/assets/index-BXnenfU5.js +323 -0
  29. package/frontend/dist/assets/index-BXnenfU5.js.map +1 -0
  30. package/frontend/dist/assets/index-PEyR1nSL.css +1 -0
  31. package/frontend/dist/assets/{resourceService-CVrdQC8j.js → resourceService-BWgF7k0a.js} +2 -2
  32. package/frontend/dist/assets/{resourceService-CVrdQC8j.js.map → resourceService-BWgF7k0a.js.map} +1 -1
  33. package/frontend/dist/index.html +2 -2
  34. package/package.json +4 -5
  35. package/frontend/dist/assets/index-bo1V8P8e.css +0 -1
  36. package/frontend/dist/assets/index-dXv8v-Od.js +0 -323
  37. package/frontend/dist/assets/index-dXv8v-Od.js.map +0 -1
@@ -1,323 +0,0 @@
1
- var xb=Object.defineProperty;var yb=(s,n,l)=>n in s?xb(s,n,{enumerable:!0,configurable:!0,writable:!0,value:l}):s[n]=l;var Wr=(s,n,l)=>yb(s,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 Ph(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Mu={exports:{}},vl={};/**
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 kg;function bb(){if(kg)return vl;kg=1;var s=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 f in c)f!=="key"&&(d[f]=c[f])}else d=c;return c=d.ref,{$$typeof:s,type:o,key:m,ref:c!==void 0?c:null,props:d}}return vl.Fragment=n,vl.jsx=l,vl.jsxs=l,vl}var Cg;function vb(){return Cg||(Cg=1,Mu.exports=bb()),Mu.exports}var t=vb(),Pu={exports:{}},Ue={};/**
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 Ag;function wb(){if(Ag)return Ue;Ag=1;var s=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"),f=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),w=Symbol.iterator;function N(k){return k===null||typeof k!="object"?null:(k=w&&k[w]||k["@@iterator"],typeof k=="function"?k:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function z(k,U,M){this.props=k,this.context=U,this.refs=C,this.updater=M||S}z.prototype.isReactComponent={},z.prototype.setState=function(k,U){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,U,"setState")},z.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function E(){}E.prototype=z.prototype;function T(k,U,M){this.props=k,this.context=U,this.refs=C,this.updater=M||S}var B=T.prototype=new E;B.constructor=T,j(B,z.prototype),B.isPureReactComponent=!0;var D=Array.isArray;function Y(){}var R={H:null,A:null,T:null,S:null},_=Object.prototype.hasOwnProperty;function P(k,U,M){var q=M.ref;return{$$typeof:s,type:k,key:U,ref:q!==void 0?q:null,props:M}}function V(k,U){return P(k.type,U,k.props)}function K(k){return typeof k=="object"&&k!==null&&k.$$typeof===s}function G(k){var U={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(M){return U[M]})}var I=/\/+/g;function L(k,U){return typeof k=="object"&&k!==null&&k.key!=null?G(""+k.key):U.toString(36)}function Z(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(Y,Y):(k.status="pending",k.then(function(U){k.status==="pending"&&(k.status="fulfilled",k.value=U)},function(U){k.status==="pending"&&(k.status="rejected",k.reason=U)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function A(k,U,M,q,de){var ee=typeof k;(ee==="undefined"||ee==="boolean")&&(k=null);var X=!1;if(k===null)X=!0;else switch(ee){case"bigint":case"string":case"number":X=!0;break;case"object":switch(k.$$typeof){case s:case n:X=!0;break;case b:return X=k._init,A(X(k._payload),U,M,q,de)}}if(X)return de=de(k),X=q===""?"."+L(k,0):q,D(de)?(M="",X!=null&&(M=X.replace(I,"$&/")+"/"),A(de,U,M,"",function(ye){return ye})):de!=null&&(K(de)&&(de=V(de,M+(de.key==null||k&&k.key===de.key?"":(""+de.key).replace(I,"$&/")+"/")+X)),U.push(de)),1;X=0;var he=q===""?".":q+":";if(D(k))for(var ae=0;ae<k.length;ae++)q=k[ae],ee=he+L(q,ae),X+=A(q,U,M,ee,de);else if(ae=N(k),typeof ae=="function")for(k=ae.call(k),ae=0;!(q=k.next()).done;)q=q.value,ee=he+L(q,ae++),X+=A(q,U,M,ee,de);else if(ee==="object"){if(typeof k.then=="function")return A(Z(k),U,M,q,de);throw U=String(k),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return X}function H(k,U,M){if(k==null)return k;var q=[],de=0;return A(k,q,"","",function(ee){return U.call(M,ee,de++)}),q}function J(k){if(k._status===-1){var U=k._result;U=U(),U.then(function(M){(k._status===0||k._status===-1)&&(k._status=1,k._result=M)},function(M){(k._status===0||k._status===-1)&&(k._status=2,k._result=M)}),k._status===-1&&(k._status=0,k._result=U)}if(k._status===1)return k._result.default;throw k._result}var me=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},le={map:H,forEach:function(k,U,M){H(k,function(){U.apply(this,arguments)},M)},count:function(k){var U=0;return H(k,function(){U++}),U},toArray:function(k){return H(k,function(U){return U})||[]},only:function(k){if(!K(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return Ue.Activity=y,Ue.Children=le,Ue.Component=z,Ue.Fragment=l,Ue.Profiler=c,Ue.PureComponent=T,Ue.StrictMode=o,Ue.Suspense=g,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(k){return R.H.useMemoCache(k)}},Ue.cache=function(k){return function(){return k.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(k,U,M){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var q=j({},k.props),de=k.key;if(U!=null)for(ee in U.key!==void 0&&(de=""+U.key),U)!_.call(U,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&U.ref===void 0||(q[ee]=U[ee]);var ee=arguments.length-2;if(ee===1)q.children=M;else if(1<ee){for(var X=Array(ee),he=0;he<ee;he++)X[he]=arguments[he+2];q.children=X}return P(k.type,de,q)},Ue.createContext=function(k){return k={$$typeof:m,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:d,_context:k},k},Ue.createElement=function(k,U,M){var q,de={},ee=null;if(U!=null)for(q in U.key!==void 0&&(ee=""+U.key),U)_.call(U,q)&&q!=="key"&&q!=="__self"&&q!=="__source"&&(de[q]=U[q]);var X=arguments.length-2;if(X===1)de.children=M;else if(1<X){for(var he=Array(X),ae=0;ae<X;ae++)he[ae]=arguments[ae+2];de.children=he}if(k&&k.defaultProps)for(q in X=k.defaultProps,X)de[q]===void 0&&(de[q]=X[q]);return P(k,ee,de)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(k){return{$$typeof:f,render:k}},Ue.isValidElement=K,Ue.lazy=function(k){return{$$typeof:b,_payload:{_status:-1,_result:k},_init:J}},Ue.memo=function(k,U){return{$$typeof:h,type:k,compare:U===void 0?null:U}},Ue.startTransition=function(k){var U=R.T,M={};R.T=M;try{var q=k(),de=R.S;de!==null&&de(M,q),typeof q=="object"&&q!==null&&typeof q.then=="function"&&q.then(Y,me)}catch(ee){me(ee)}finally{U!==null&&M.types!==null&&(U.types=M.types),R.T=U}},Ue.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},Ue.use=function(k){return R.H.use(k)},Ue.useActionState=function(k,U,M){return R.H.useActionState(k,U,M)},Ue.useCallback=function(k,U){return R.H.useCallback(k,U)},Ue.useContext=function(k){return R.H.useContext(k)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(k,U){return R.H.useDeferredValue(k,U)},Ue.useEffect=function(k,U){return R.H.useEffect(k,U)},Ue.useEffectEvent=function(k){return R.H.useEffectEvent(k)},Ue.useId=function(){return R.H.useId()},Ue.useImperativeHandle=function(k,U,M){return R.H.useImperativeHandle(k,U,M)},Ue.useInsertionEffect=function(k,U){return R.H.useInsertionEffect(k,U)},Ue.useLayoutEffect=function(k,U){return R.H.useLayoutEffect(k,U)},Ue.useMemo=function(k,U){return R.H.useMemo(k,U)},Ue.useOptimistic=function(k,U){return R.H.useOptimistic(k,U)},Ue.useReducer=function(k,U,M){return R.H.useReducer(k,U,M)},Ue.useRef=function(k){return R.H.useRef(k)},Ue.useState=function(k){return R.H.useState(k)},Ue.useSyncExternalStore=function(k,U,M){return R.H.useSyncExternalStore(k,U,M)},Ue.useTransition=function(){return R.H.useTransition()},Ue.version="19.2.1",Ue}var Eg;function gd(){return Eg||(Eg=1,Pu.exports=wb()),Pu.exports}var x=gd();const As=Ph(x);var Du={exports:{}},wl={},Lu={exports:{}},Uu={};/**
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 Rg;function jb(){return Rg||(Rg=1,(function(s){function n(A,H){var J=A.length;A.push(H);e:for(;0<J;){var me=J-1>>>1,le=A[me];if(0<c(le,H))A[me]=H,A[J]=le,J=me;else break e}}function l(A){return A.length===0?null:A[0]}function o(A){if(A.length===0)return null;var H=A[0],J=A.pop();if(J!==H){A[0]=J;e:for(var me=0,le=A.length,k=le>>>1;me<k;){var U=2*(me+1)-1,M=A[U],q=U+1,de=A[q];if(0>c(M,J))q<le&&0>c(de,M)?(A[me]=de,A[q]=J,me=q):(A[me]=M,A[U]=J,me=U);else if(q<le&&0>c(de,J))A[me]=de,A[q]=J,me=q;else break e}}return H}function c(A,H){var J=A.sortIndex-H.sortIndex;return J!==0?J:A.id-H.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;s.unstable_now=function(){return d.now()}}else{var m=Date,f=m.now();s.unstable_now=function(){return m.now()-f}}var g=[],h=[],b=1,y=null,w=3,N=!1,S=!1,j=!1,C=!1,z=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function B(A){for(var H=l(h);H!==null;){if(H.callback===null)o(h);else if(H.startTime<=A)o(h),H.sortIndex=H.expirationTime,n(g,H);else break;H=l(h)}}function D(A){if(j=!1,B(A),!S)if(l(g)!==null)S=!0,Y||(Y=!0,G());else{var H=l(h);H!==null&&Z(D,H.startTime-A)}}var Y=!1,R=-1,_=5,P=-1;function V(){return C?!0:!(s.unstable_now()-P<_)}function K(){if(C=!1,Y){var A=s.unstable_now();P=A;var H=!0;try{e:{S=!1,j&&(j=!1,E(R),R=-1),N=!0;var J=w;try{t:{for(B(A),y=l(g);y!==null&&!(y.expirationTime>A&&V());){var me=y.callback;if(typeof me=="function"){y.callback=null,w=y.priorityLevel;var le=me(y.expirationTime<=A);if(A=s.unstable_now(),typeof le=="function"){y.callback=le,B(A),H=!0;break t}y===l(g)&&o(g),B(A)}else o(g);y=l(g)}if(y!==null)H=!0;else{var k=l(h);k!==null&&Z(D,k.startTime-A),H=!1}}break e}finally{y=null,w=J,N=!1}H=void 0}}finally{H?G():Y=!1}}}var G;if(typeof T=="function")G=function(){T(K)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,L=I.port2;I.port1.onmessage=K,G=function(){L.postMessage(null)}}else G=function(){z(K,0)};function Z(A,H){R=z(function(){A(s.unstable_now())},H)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(A){A.callback=null},s.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<A?Math.floor(1e3/A):5},s.unstable_getCurrentPriorityLevel=function(){return w},s.unstable_next=function(A){switch(w){case 1:case 2:case 3:var H=3;break;default:H=w}var J=w;w=H;try{return A()}finally{w=J}},s.unstable_requestPaint=function(){C=!0},s.unstable_runWithPriority=function(A,H){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var J=w;w=A;try{return H()}finally{w=J}},s.unstable_scheduleCallback=function(A,H,J){var me=s.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?me+J:me):J=me,A){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=J+le,A={id:b++,callback:H,priorityLevel:A,startTime:J,expirationTime:le,sortIndex:-1},J>me?(A.sortIndex=J,n(h,A),l(g)===null&&A===l(h)&&(j?(E(R),R=-1):j=!0,Z(D,J-me))):(A.sortIndex=le,n(g,A),S||N||(S=!0,Y||(Y=!0,G()))),A},s.unstable_shouldYield=V,s.unstable_wrapCallback=function(A){var H=w;return function(){var J=w;w=H;try{return A.apply(this,arguments)}finally{w=J}}}})(Uu)),Uu}var Tg;function Sb(){return Tg||(Tg=1,Lu.exports=jb()),Lu.exports}var _u={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 Og;function Nb(){if(Og)return Zt;Og=1;var s=gd();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 y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:y==null?null:""+y,children:g,containerInfo:h,implementation:b}}var m=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(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,y=f(b,h.crossOrigin),w=typeof h.integrity=="string"?h.integrity:void 0,N=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;b==="style"?o.d.S(g,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:w,fetchPriority:N}):b==="script"&&o.d.X(g,{crossOrigin:y,integrity:w,fetchPriority:N,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=f(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,y=f(b,h.crossOrigin);o.d.L(g,b,{crossOrigin:y,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=f(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 zg;function kb(){if(zg)return _u.exports;zg=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(n){console.error(n)}}return s(),_u.exports=Nb(),_u.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 Mg;function Cb(){if(Mg)return wl;Mg=1;var s=Sb(),n=gd(),l=kb();function o(e){var r="https://react.dev/errors/"+e;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+r+" 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 r=e,a=e;if(e.alternate)for(;r.return;)r=r.return;else{e=r;do r=e,(r.flags&4098)!==0&&(a=r.return),e=r.return;while(e)}return r.tag===3?a:null}function m(e){if(e.tag===13){var r=e.memoizedState;if(r===null&&(e=e.alternate,e!==null&&(r=e.memoizedState)),r!==null)return r.dehydrated}return null}function f(e){if(e.tag===31){var r=e.memoizedState;if(r===null&&(e=e.alternate,e!==null&&(r=e.memoizedState)),r!==null)return r.dehydrated}return null}function g(e){if(d(e)!==e)throw Error(o(188))}function h(e){var r=e.alternate;if(!r){if(r=d(e),r===null)throw Error(o(188));return r!==e?null:e}for(var a=e,i=r;;){var u=a.return;if(u===null)break;var p=u.alternate;if(p===null){if(i=u.return,i!==null){a=i;continue}break}if(u.child===p.child){for(p=u.child;p;){if(p===a)return g(u),e;if(p===i)return g(u),r;p=p.sibling}throw Error(o(188))}if(a.return!==i.return)a=u,i=p;else{for(var v=!1,O=u.child;O;){if(O===a){v=!0,a=u,i=p;break}if(O===i){v=!0,i=u,a=p;break}O=O.sibling}if(!v){for(O=p.child;O;){if(O===a){v=!0,a=p,i=u;break}if(O===i){v=!0,i=p,a=u;break}O=O.sibling}if(!v)throw Error(o(189))}}if(a.alternate!==i)throw Error(o(190))}if(a.tag!==3)throw Error(o(188));return a.stateNode.current===a?e:r}function b(e){var r=e.tag;if(r===5||r===26||r===27||r===6)return e;for(e=e.child;e!==null;){if(r=b(e),r!==null)return r;e=e.sibling}return null}var y=Object.assign,w=Symbol.for("react.element"),N=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),T=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function G(e){return e===null||typeof e!="object"?null:(e=K&&e[K]||e["@@iterator"],typeof e=="function"?e:null)}var I=Symbol.for("react.client.reference");function L(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===I?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case z:return"Profiler";case C:return"StrictMode";case D:return"Suspense";case Y:return"SuspenseList";case P:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case S:return"Portal";case T:return e.displayName||"Context";case E:return(e._context.displayName||"Context")+".Consumer";case B:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case R:return r=e.displayName||null,r!==null?r:L(e.type)||"Memo";case _:r=e._payload,e=e._init;try{return L(e(r))}catch{}}return null}var Z=Array.isArray,A=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,J={pending:!1,data:null,method:null,action:null},me=[],le=-1;function k(e){return{current:e}}function U(e){0>le||(e.current=me[le],me[le]=null,le--)}function M(e,r){le++,me[le]=e.current,e.current=r}var q=k(null),de=k(null),ee=k(null),X=k(null);function he(e,r){switch(M(ee,r),M(de,e),M(q,null),r.nodeType){case 9:case 11:e=(e=r.documentElement)&&(e=e.namespaceURI)?Yf(e):0;break;default:if(e=r.tagName,r=r.namespaceURI)r=Yf(r),e=Jf(r,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(q),M(q,e)}function ae(){U(q),U(de),U(ee)}function ye(e){e.memoizedState!==null&&M(X,e);var r=q.current,a=Jf(r,e.type);r!==a&&(M(de,e),M(q,a))}function ie(e){de.current===e&&(U(q),U(de)),X.current===e&&(U(X),hl._currentValue=J)}var se,be;function Ne(e){if(se===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);se=r&&r[1]||"",be=-1<a.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+se+e+be}var xe=!1;function ke(e,r){if(!e||xe)return"";xe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(r){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(ce){var ne=ce}Reflect.construct(e,[],fe)}else{try{fe.call()}catch(ce){ne=ce}e.call(fe.prototype)}}else{try{throw Error()}catch(ce){ne=ce}(fe=e())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(ce){if(ce&&ne&&typeof ce.stack=="string")return[ce.stack,ne.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 p=i.DetermineComponentFrameRoot(),v=p[0],O=p[1];if(v&&O){var F=v.split(`
44
- `),re=O.split(`
45
- `);for(u=i=0;i<F.length&&!F[i].includes("DetermineComponentFrameRoot");)i++;for(;u<re.length&&!re[u].includes("DetermineComponentFrameRoot");)u++;if(i===F.length||u===re.length)for(i=F.length-1,u=re.length-1;1<=i&&0<=u&&F[i]!==re[u];)u--;for(;1<=i&&0<=u;i--,u--)if(F[i]!==re[u]){if(i!==1||u!==1)do if(i--,u--,0>u||F[i]!==re[u]){var ue=`
46
- `+F[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{xe=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Ne(a):""}function Se(e,r){switch(e.tag){case 26:case 27:case 5:return Ne(e.type);case 16:return Ne("Lazy");case 13:return e.child!==r&&r!==null?Ne("Suspense Fallback"):Ne("Suspense");case 19:return Ne("SuspenseList");case 0:case 15:return ke(e.type,!1);case 11:return ke(e.type.render,!1);case 1:return ke(e.type,!0);case 31:return Ne("Activity");default:return""}}function Le(e){try{var r="",a=null;do r+=Se(e,a),a=e,e=e.return;while(e);return r}catch(i){return`
47
- Error generating stack: `+i.message+`
48
- `+i.stack}}var st=Object.prototype.hasOwnProperty,ft=s.unstable_scheduleCallback,Mt=s.unstable_cancelCallback,Pt=s.unstable_shouldYield,Sr=s.unstable_requestPaint,gt=s.unstable_now,Nr=s.unstable_getCurrentPriorityLevel,er=s.unstable_ImmediatePriority,Qt=s.unstable_UserBlockingPriority,ht=s.unstable_NormalPriority,Re=s.unstable_LowPriority,Oe=s.unstable_IdlePriority,it=s.log,qt=s.unstable_setDisableYieldValue,Gt=null,ot=null;function _t(e){if(typeof it=="function"&&qt(e),ot&&typeof ot.setStrictMode=="function")try{ot.setStrictMode(Gt,e)}catch{}}var bt=Math.clz32?Math.clz32:Ds,Vr=Math.log,Ps=Math.LN2;function Ds(e){return e>>>=0,e===0?32:31-(Vr(e)/Ps|0)|0}var mr=256,sr=262144,_r=4194304;function ar(e){var r=e&42;if(r!==0)return r;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 Br(e,r,a){var i=e.pendingLanes;if(i===0)return 0;var u=0,p=e.suspendedLanes,v=e.pingedLanes;e=e.warmLanes;var O=i&134217727;return O!==0?(i=O&~p,i!==0?u=ar(i):(v&=O,v!==0?u=ar(v):a||(a=O&~e,a!==0&&(u=ar(a))))):(O=i&~p,O!==0?u=ar(O):v!==0?u=ar(v):a||(a=i&~e,a!==0&&(u=ar(a)))),u===0?0:r!==0&&r!==u&&(r&p)===0&&(p=u&-u,a=r&-r,p>=a||p===32&&(a&4194048)!==0)?r:u}function Q(e,r){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&r)===0}function je(e,r){switch(e){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 He(){var e=_r;return _r<<=1,(_r&62914560)===0&&(_r=4194304),e}function jt(e){for(var r=[],a=0;31>a;a++)r.push(e);return r}function Je(e,r){e.pendingLanes|=r,r!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function We(e,r,a,i,u,p){var v=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var O=e.entanglements,F=e.expirationTimes,re=e.hiddenUpdates;for(a=v&~a;0<a;){var ue=31-bt(a),fe=1<<ue;O[ue]=0,F[ue]=-1;var ne=re[ue];if(ne!==null)for(re[ue]=null,ue=0;ue<ne.length;ue++){var ce=ne[ue];ce!==null&&(ce.lane&=-536870913)}a&=~fe}i!==0&&pr(e,i,0),p!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=p&~(v&~r))}function pr(e,r,a){e.pendingLanes|=r,e.suspendedLanes&=~r;var i=31-bt(r);e.entangledLanes|=r,e.entanglements[i]=e.entanglements[i]|1073741824|a&261930}function tr(e,r){var a=e.entangledLanes|=r;for(e=e.entanglements;a;){var i=31-bt(a),u=1<<i;u&r|e[i]&r&&(e[i]|=r),a&=~u}}function ge(e,r){var a=r&-r;return a=(a&42)!==0?1:oe(a),(a&(e.suspendedLanes|r))!==0?0:a}function oe(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 we(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function $r(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:yg(e.type))}function Oa(e,r){var a=H.p;try{return H.p=e,r()}finally{H.p=a}}var Yr=Math.random().toString(36).slice(2),dt="__reactFiber$"+Yr,Xt="__reactProps$"+Yr,nr="__reactContainer$"+Yr,Pe="__reactEvents$"+Yr,$e="__reactListeners$"+Yr,mt="__reactHandles$"+Yr,ct="__reactResources$"+Yr,Dt="__reactMarker$"+Yr;function ko(e){delete e[dt],delete e[Xt],delete e[Pe],delete e[$e],delete e[mt]}function za(e){var r=e[dt];if(r)return r;for(var a=e.parentNode;a;){if(r=a[nr]||a[dt]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(e=rg(e);e!==null;){if(a=e[dt])return a;e=rg(e)}return r}e=a,a=e.parentNode}return null}function Ma(e){if(e=e[dt]||e[nr]){var r=e.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return e}return null}function zn(e){var r=e.tag;if(r===5||r===26||r===27||r===6)return e.stateNode;throw Error(o(33))}function Pa(e){var r=e[ct];return r||(r=e[ct]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Bt(e){e[Dt]=!0}var Dd=new Set,Ld={};function da(e,r){Da(e,r),Da(e+"Capture",r)}function Da(e,r){for(Ld[e]=r,e=0;e<r.length;e++)Dd.add(r[e])}var ox=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]*$"),Ud={},_d={};function cx(e){return st.call(_d,e)?!0:st.call(Ud,e)?!1:ox.test(e)?_d[e]=!0:(Ud[e]=!0,!1)}function Ll(e,r,a){if(cx(r))if(a===null)e.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(r);return;case"boolean":var i=r.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(r);return}}e.setAttribute(r,""+a)}}function Ul(e,r,a){if(a===null)e.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttribute(r,""+a)}}function os(e,r,a,i){if(i===null)e.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(r,a,""+i)}}function kr(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Bd(e){var r=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function ux(e,r,a){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,r);if(!e.hasOwnProperty(r)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var u=i.get,p=i.set;return Object.defineProperty(e,r,{configurable:!0,get:function(){return u.call(this)},set:function(v){a=""+v,p.call(this,v)}}),Object.defineProperty(e,r,{enumerable:i.enumerable}),{getValue:function(){return a},setValue:function(v){a=""+v},stopTracking:function(){e._valueTracker=null,delete e[r]}}}}function Co(e){if(!e._valueTracker){var r=Bd(e)?"checked":"value";e._valueTracker=ux(e,r,""+e[r])}}function Id(e){if(!e)return!1;var r=e._valueTracker;if(!r)return!0;var a=r.getValue(),i="";return e&&(i=Bd(e)?e.checked?"true":"false":e.value),e=i,e!==a?(r.setValue(e),!0):!1}function _l(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 dx=/[\n"\\]/g;function Cr(e){return e.replace(dx,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Ao(e,r,a,i,u,p,v,O){e.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.type=v:e.removeAttribute("type"),r!=null?v==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+kr(r)):e.value!==""+kr(r)&&(e.value=""+kr(r)):v!=="submit"&&v!=="reset"||e.removeAttribute("value"),r!=null?Eo(e,v,kr(r)):a!=null?Eo(e,v,kr(a)):i!=null&&e.removeAttribute("value"),u==null&&p!=null&&(e.defaultChecked=!!p),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?e.name=""+kr(O):e.removeAttribute("name")}function Fd(e,r,a,i,u,p,v,O){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.type=p),r!=null||a!=null){if(!(p!=="submit"&&p!=="reset"||r!=null)){Co(e);return}a=a!=null?""+kr(a):"",r=r!=null?""+kr(r):a,O||r===e.value||(e.value=r),e.defaultValue=r}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=O?e.checked:!!i,e.defaultChecked=!!i,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.name=v),Co(e)}function Eo(e,r,a){r==="number"&&_l(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function La(e,r,a,i){if(e=e.options,r){r={};for(var u=0;u<a.length;u++)r["$"+a[u]]=!0;for(a=0;a<e.length;a++)u=r.hasOwnProperty("$"+e[a].value),e[a].selected!==u&&(e[a].selected=u),u&&i&&(e[a].defaultSelected=!0)}else{for(a=""+kr(a),r=null,u=0;u<e.length;u++){if(e[u].value===a){e[u].selected=!0,i&&(e[u].defaultSelected=!0);return}r!==null||e[u].disabled||(r=e[u])}r!==null&&(r.selected=!0)}}function Hd(e,r,a){if(r!=null&&(r=""+kr(r),r!==e.value&&(e.value=r),a==null)){e.defaultValue!==r&&(e.defaultValue=r);return}e.defaultValue=a!=null?""+kr(a):""}function qd(e,r,a,i){if(r==null){if(i!=null){if(a!=null)throw Error(o(92));if(Z(i)){if(1<i.length)throw Error(o(93));i=i[0]}a=i}a==null&&(a=""),r=a}a=kr(r),e.defaultValue=a,i=e.textContent,i===a&&i!==""&&i!==null&&(e.value=i),Co(e)}function Ua(e,r){if(r){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=r;return}}e.textContent=r}var mx=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 Gd(e,r,a){var i=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?i?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="":i?e.setProperty(r,a):typeof a!="number"||a===0||mx.has(r)?r==="float"?e.cssFloat=a:e[r]=(""+a).trim():e[r]=a+"px"}function Kd(e,r,a){if(r!=null&&typeof r!="object")throw Error(o(62));if(e=e.style,a!=null){for(var i in a)!a.hasOwnProperty(i)||r!=null&&r.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var u in r)i=r[u],r.hasOwnProperty(u)&&a[u]!==i&&Gd(e,u,i)}else for(var p in r)r.hasOwnProperty(p)&&Gd(e,p,r[p])}function Ro(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 px=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"]]),fx=/^[\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 Bl(e){return fx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function cs(){}var To=null;function Oo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _a=null,Ba=null;function Vd(e){var r=Ma(e);if(r&&(e=r.stateNode)){var a=e[Xt]||null;e:switch(e=r.stateNode,r.type){case"input":if(Ao(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Cr(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var i=a[r];if(i!==e&&i.form===e.form){var u=i[Xt]||null;if(!u)throw Error(o(90));Ao(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(r=0;r<a.length;r++)i=a[r],i.form===e.form&&Id(i)}break e;case"textarea":Hd(e,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&La(e,!!a.multiple,r,!1)}}}var zo=!1;function $d(e,r,a){if(zo)return e(r,a);zo=!0;try{var i=e(r);return i}finally{if(zo=!1,(_a!==null||Ba!==null)&&(Ci(),_a&&(r=_a,e=Ba,Ba=_a=null,Vd(r),e)))for(r=0;r<e.length;r++)Vd(e[r])}}function Mn(e,r){var a=e.stateNode;if(a===null)return null;var i=a[Xt]||null;if(i===null)return null;a=i[r];e:switch(r){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(a&&typeof a!="function")throw Error(o(231,r,typeof a));return a}var us=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mo=!1;if(us)try{var Pn={};Object.defineProperty(Pn,"passive",{get:function(){Mo=!0}}),window.addEventListener("test",Pn,Pn),window.removeEventListener("test",Pn,Pn)}catch{Mo=!1}var Ls=null,Po=null,Il=null;function Yd(){if(Il)return Il;var e,r=Po,a=r.length,i,u="value"in Ls?Ls.value:Ls.textContent,p=u.length;for(e=0;e<a&&r[e]===u[e];e++);var v=a-e;for(i=1;i<=v&&r[a-i]===u[p-i];i++);return Il=u.slice(e,1<i?1-i:void 0)}function Fl(e){var r=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&r===13&&(e=13)):e=r,e===10&&(e=13),32<=e||e===13?e:0}function Hl(){return!0}function Jd(){return!1}function lr(e){function r(a,i,u,p,v){this._reactName=a,this._targetInst=u,this.type=i,this.nativeEvent=p,this.target=v,this.currentTarget=null;for(var O in e)e.hasOwnProperty(O)&&(a=e[O],this[O]=a?a(p):p[O]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Hl:Jd,this.isPropagationStopped=Jd,this}return y(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Hl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Hl)},persist:function(){},isPersistent:Hl}),r}var ma={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ql=lr(ma),Dn=y({},ma,{view:0,detail:0}),gx=lr(Dn),Do,Lo,Ln,Gl=y({},Dn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_o,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!==Ln&&(Ln&&e.type==="mousemove"?(Do=e.screenX-Ln.screenX,Lo=e.screenY-Ln.screenY):Lo=Do=0,Ln=e),Do)},movementY:function(e){return"movementY"in e?e.movementY:Lo}}),Qd=lr(Gl),hx=y({},Gl,{dataTransfer:0}),xx=lr(hx),yx=y({},Dn,{relatedTarget:0}),Uo=lr(yx),bx=y({},ma,{animationName:0,elapsedTime:0,pseudoElement:0}),vx=lr(bx),wx=y({},ma,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),jx=lr(wx),Sx=y({},ma,{data:0}),Xd=lr(Sx),Nx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kx={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"},Cx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ax(e){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(e):(e=Cx[e])?!!r[e]:!1}function _o(){return Ax}var Ex=y({},Dn,{key:function(e){if(e.key){var r=Nx[e.key]||e.key;if(r!=="Unidentified")return r}return e.type==="keypress"?(e=Fl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?kx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_o,charCode:function(e){return e.type==="keypress"?Fl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Rx=lr(Ex),Tx=y({},Gl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zd=lr(Tx),Ox=y({},Dn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_o}),zx=lr(Ox),Mx=y({},ma,{propertyName:0,elapsedTime:0,pseudoElement:0}),Px=lr(Mx),Dx=y({},Gl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Lx=lr(Dx),Ux=y({},ma,{newState:0,oldState:0}),_x=lr(Ux),Bx=[9,13,27,32],Bo=us&&"CompositionEvent"in window,Un=null;us&&"documentMode"in document&&(Un=document.documentMode);var Ix=us&&"TextEvent"in window&&!Un,Wd=us&&(!Bo||Un&&8<Un&&11>=Un),em=" ",tm=!1;function rm(e,r){switch(e){case"keyup":return Bx.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function sm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ia=!1;function Fx(e,r){switch(e){case"compositionend":return sm(r);case"keypress":return r.which!==32?null:(tm=!0,em);case"textInput":return e=r.data,e===em&&tm?null:e;default:return null}}function Hx(e,r){if(Ia)return e==="compositionend"||!Bo&&rm(e,r)?(e=Yd(),Il=Po=Ls=null,Ia=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return Wd&&r.locale!=="ko"?null:r.data;default:return null}}var qx={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 am(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r==="input"?!!qx[e.type]:r==="textarea"}function nm(e,r,a,i){_a?Ba?Ba.push(i):Ba=[i]:_a=i,r=Mi(r,"onChange"),0<r.length&&(a=new ql("onChange","change",null,a,i),e.push({event:a,listeners:r}))}var _n=null,Bn=null;function Gx(e){Hf(e,0)}function Kl(e){var r=zn(e);if(Id(r))return e}function lm(e,r){if(e==="change")return r}var im=!1;if(us){var Io;if(us){var Fo="oninput"in document;if(!Fo){var om=document.createElement("div");om.setAttribute("oninput","return;"),Fo=typeof om.oninput=="function"}Io=Fo}else Io=!1;im=Io&&(!document.documentMode||9<document.documentMode)}function cm(){_n&&(_n.detachEvent("onpropertychange",um),Bn=_n=null)}function um(e){if(e.propertyName==="value"&&Kl(Bn)){var r=[];nm(r,Bn,e,Oo(e)),$d(Gx,r)}}function Kx(e,r,a){e==="focusin"?(cm(),_n=r,Bn=a,_n.attachEvent("onpropertychange",um)):e==="focusout"&&cm()}function Vx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Kl(Bn)}function $x(e,r){if(e==="click")return Kl(r)}function Yx(e,r){if(e==="input"||e==="change")return Kl(r)}function Jx(e,r){return e===r&&(e!==0||1/e===1/r)||e!==e&&r!==r}var fr=typeof Object.is=="function"?Object.is:Jx;function In(e,r){if(fr(e,r))return!0;if(typeof e!="object"||e===null||typeof r!="object"||r===null)return!1;var a=Object.keys(e),i=Object.keys(r);if(a.length!==i.length)return!1;for(i=0;i<a.length;i++){var u=a[i];if(!st.call(r,u)||!fr(e[u],r[u]))return!1}return!0}function dm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function mm(e,r){var a=dm(e);e=0;for(var i;a;){if(a.nodeType===3){if(i=e+a.textContent.length,e<=r&&i>=r)return{node:a,offset:r-e};e=i}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=dm(a)}}function pm(e,r){return e&&r?e===r?!0:e&&e.nodeType===3?!1:r&&r.nodeType===3?pm(e,r.parentNode):"contains"in e?e.contains(r):e.compareDocumentPosition?!!(e.compareDocumentPosition(r)&16):!1:!1}function fm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var r=_l(e.document);r instanceof e.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)e=r.contentWindow;else break;r=_l(e.document)}return r}function Ho(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r&&(r==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||r==="textarea"||e.contentEditable==="true")}var Qx=us&&"documentMode"in document&&11>=document.documentMode,Fa=null,qo=null,Fn=null,Go=!1;function gm(e,r,a){var i=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Go||Fa==null||Fa!==_l(i)||(i=Fa,"selectionStart"in i&&Ho(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}),Fn&&In(Fn,i)||(Fn=i,i=Mi(qo,"onSelect"),0<i.length&&(r=new ql("onSelect","select",null,r,a),e.push({event:r,listeners:i}),r.target=Fa)))}function pa(e,r){var a={};return a[e.toLowerCase()]=r.toLowerCase(),a["Webkit"+e]="webkit"+r,a["Moz"+e]="moz"+r,a}var Ha={animationend:pa("Animation","AnimationEnd"),animationiteration:pa("Animation","AnimationIteration"),animationstart:pa("Animation","AnimationStart"),transitionrun:pa("Transition","TransitionRun"),transitionstart:pa("Transition","TransitionStart"),transitioncancel:pa("Transition","TransitionCancel"),transitionend:pa("Transition","TransitionEnd")},Ko={},hm={};us&&(hm=document.createElement("div").style,"AnimationEvent"in window||(delete Ha.animationend.animation,delete Ha.animationiteration.animation,delete Ha.animationstart.animation),"TransitionEvent"in window||delete Ha.transitionend.transition);function fa(e){if(Ko[e])return Ko[e];if(!Ha[e])return e;var r=Ha[e],a;for(a in r)if(r.hasOwnProperty(a)&&a in hm)return Ko[e]=r[a];return e}var xm=fa("animationend"),ym=fa("animationiteration"),bm=fa("animationstart"),Xx=fa("transitionrun"),Zx=fa("transitionstart"),Wx=fa("transitioncancel"),vm=fa("transitionend"),wm=new Map,Vo="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(" ");Vo.push("scrollEnd");function Ir(e,r){wm.set(e,r),da(r,[e])}var Vl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=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(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ar=[],qa=0,$o=0;function $l(){for(var e=qa,r=$o=qa=0;r<e;){var a=Ar[r];Ar[r++]=null;var i=Ar[r];Ar[r++]=null;var u=Ar[r];Ar[r++]=null;var p=Ar[r];if(Ar[r++]=null,i!==null&&u!==null){var v=i.pending;v===null?u.next=u:(u.next=v.next,v.next=u),i.pending=u}p!==0&&jm(a,u,p)}}function Yl(e,r,a,i){Ar[qa++]=e,Ar[qa++]=r,Ar[qa++]=a,Ar[qa++]=i,$o|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function Yo(e,r,a,i){return Yl(e,r,a,i),Jl(e)}function ga(e,r){return Yl(e,null,null,r),Jl(e)}function jm(e,r,a){e.lanes|=a;var i=e.alternate;i!==null&&(i.lanes|=a);for(var u=!1,p=e.return;p!==null;)p.childLanes|=a,i=p.alternate,i!==null&&(i.childLanes|=a),p.tag===22&&(e=p.stateNode,e===null||e._visibility&1||(u=!0)),e=p,p=p.return;return e.tag===3?(p=e.stateNode,u&&r!==null&&(u=31-bt(a),e=p.hiddenUpdates,i=e[u],i===null?e[u]=[r]:i.push(r),r.lane=a|536870912),p):null}function Jl(e){if(50<cl)throw cl=0,su=null,Error(o(185));for(var r=e.return;r!==null;)e=r,r=e.return;return e.tag===3?e.stateNode:null}var Ga={};function ey(e,r,a,i){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,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 gr(e,r,a,i){return new ey(e,r,a,i)}function Jo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ds(e,r){var a=e.alternate;return a===null?(a=gr(e.tag,r,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=r,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,r=e.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Sm(e,r){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=r,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,r=a.dependencies,e.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),e}function Ql(e,r,a,i,u,p){var v=0;if(i=e,typeof e=="function")Jo(e)&&(v=1);else if(typeof e=="string")v=nb(e,a,q.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case P:return e=gr(31,a,r,u),e.elementType=P,e.lanes=p,e;case j:return ha(a.children,u,p,r);case C:v=8,u|=24;break;case z:return e=gr(12,a,r,u|2),e.elementType=z,e.lanes=p,e;case D:return e=gr(13,a,r,u),e.elementType=D,e.lanes=p,e;case Y:return e=gr(19,a,r,u),e.elementType=Y,e.lanes=p,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case T:v=10;break e;case E:v=9;break e;case B:v=11;break e;case R:v=14;break e;case _:v=16,i=null;break e}v=29,a=Error(o(130,e===null?"null":typeof e,"")),i=null}return r=gr(v,a,r,u),r.elementType=e,r.type=i,r.lanes=p,r}function ha(e,r,a,i){return e=gr(7,e,i,r),e.lanes=a,e}function Qo(e,r,a){return e=gr(6,e,null,r),e.lanes=a,e}function Nm(e){var r=gr(18,null,null,0);return r.stateNode=e,r}function Xo(e,r,a){return r=gr(4,e.children!==null?e.children:[],e.key,r),r.lanes=a,r.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},r}var km=new WeakMap;function Er(e,r){if(typeof e=="object"&&e!==null){var a=km.get(e);return a!==void 0?a:(r={value:e,source:r,stack:Le(r)},km.set(e,r),r)}return{value:e,source:r,stack:Le(r)}}var Ka=[],Va=0,Xl=null,Hn=0,Rr=[],Tr=0,Us=null,Jr=1,Qr="";function ms(e,r){Ka[Va++]=Hn,Ka[Va++]=Xl,Xl=e,Hn=r}function Cm(e,r,a){Rr[Tr++]=Jr,Rr[Tr++]=Qr,Rr[Tr++]=Us,Us=e;var i=Jr;e=Qr;var u=32-bt(i)-1;i&=~(1<<u),a+=1;var p=32-bt(r)+u;if(30<p){var v=u-u%5;p=(i&(1<<v)-1).toString(32),i>>=v,u-=v,Jr=1<<32-bt(r)+u|a<<u|i,Qr=p+e}else Jr=1<<p|a<<u|i,Qr=e}function Zo(e){e.return!==null&&(ms(e,1),Cm(e,1,0))}function Wo(e){for(;e===Xl;)Xl=Ka[--Va],Ka[Va]=null,Hn=Ka[--Va],Ka[Va]=null;for(;e===Us;)Us=Rr[--Tr],Rr[Tr]=null,Qr=Rr[--Tr],Rr[Tr]=null,Jr=Rr[--Tr],Rr[Tr]=null}function Am(e,r){Rr[Tr++]=Jr,Rr[Tr++]=Qr,Rr[Tr++]=Us,Jr=r.id,Qr=r.overflow,Us=e}var Kt=null,xt=null,Ye=!1,_s=null,Or=!1,ec=Error(o(519));function Bs(e){var r=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qn(Er(r,e)),ec}function Em(e){var r=e.stateNode,a=e.type,i=e.memoizedProps;switch(r[dt]=e,r[Xt]=i,a){case"dialog":Ge("cancel",r),Ge("close",r);break;case"iframe":case"object":case"embed":Ge("load",r);break;case"video":case"audio":for(a=0;a<dl.length;a++)Ge(dl[a],r);break;case"source":Ge("error",r);break;case"img":case"image":case"link":Ge("error",r),Ge("load",r);break;case"details":Ge("toggle",r);break;case"input":Ge("invalid",r),Fd(r,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Ge("invalid",r);break;case"textarea":Ge("invalid",r),qd(r,i.value,i.defaultValue,i.children)}a=i.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||i.suppressHydrationWarning===!0||Vf(r.textContent,a)?(i.popover!=null&&(Ge("beforetoggle",r),Ge("toggle",r)),i.onScroll!=null&&Ge("scroll",r),i.onScrollEnd!=null&&Ge("scrollend",r),i.onClick!=null&&(r.onclick=cs),r=!0):r=!1,r||Bs(e,!0)}function Rm(e){for(Kt=e.return;Kt;)switch(Kt.tag){case 5:case 31:case 13:Or=!1;return;case 27:case 3:Or=!0;return;default:Kt=Kt.return}}function $a(e){if(e!==Kt)return!1;if(!Ye)return Rm(e),Ye=!0,!1;var r=e.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||yu(e.type,e.memoizedProps)),a=!a),a&&xt&&Bs(e),Rm(e),r===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));xt=tg(e)}else if(r===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));xt=tg(e)}else r===27?(r=xt,Ws(e.type)?(e=Su,Su=null,xt=e):xt=r):xt=Kt?Mr(e.stateNode.nextSibling):null;return!0}function xa(){xt=Kt=null,Ye=!1}function tc(){var e=_s;return e!==null&&(ur===null?ur=e:ur.push.apply(ur,e),_s=null),e}function qn(e){_s===null?_s=[e]:_s.push(e)}var rc=k(null),ya=null,ps=null;function Is(e,r,a){M(rc,r._currentValue),r._currentValue=a}function fs(e){e._currentValue=rc.current,U(rc)}function sc(e,r,a){for(;e!==null;){var i=e.alternate;if((e.childLanes&r)!==r?(e.childLanes|=r,i!==null&&(i.childLanes|=r)):i!==null&&(i.childLanes&r)!==r&&(i.childLanes|=r),e===a)break;e=e.return}}function ac(e,r,a,i){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var p=u.dependencies;if(p!==null){var v=u.child;p=p.firstContext;e:for(;p!==null;){var O=p;p=u;for(var F=0;F<r.length;F++)if(O.context===r[F]){p.lanes|=a,O=p.alternate,O!==null&&(O.lanes|=a),sc(p.return,a,e),i||(v=null);break e}p=O.next}}else if(u.tag===18){if(v=u.return,v===null)throw Error(o(341));v.lanes|=a,p=v.alternate,p!==null&&(p.lanes|=a),sc(v,a,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 Ya(e,r,a,i){e=null;for(var u=r,p=!1;u!==null;){if(!p){if((u.flags&524288)!==0)p=!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 O=u.type;fr(u.pendingProps.value,v.value)||(e!==null?e.push(O):e=[O])}}else if(u===X.current){if(v=u.alternate,v===null)throw Error(o(387));v.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(hl):e=[hl])}u=u.return}e!==null&&ac(r,e,a,i),r.flags|=262144}function Zl(e){for(e=e.firstContext;e!==null;){if(!fr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ba(e){ya=e,ps=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Vt(e){return Tm(ya,e)}function Wl(e,r){return ya===null&&ba(e),Tm(e,r)}function Tm(e,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},ps===null){if(e===null)throw Error(o(308));ps=r,e.dependencies={lanes:0,firstContext:r},e.flags|=524288}else ps=ps.next=r;return a}var ty=typeof AbortController<"u"?AbortController:function(){var e=[],r=this.signal={aborted:!1,addEventListener:function(a,i){e.push(i)}};this.abort=function(){r.aborted=!0,e.forEach(function(a){return a()})}},ry=s.unstable_scheduleCallback,sy=s.unstable_NormalPriority,Et={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function nc(){return{controller:new ty,data:new Map,refCount:0}}function Gn(e){e.refCount--,e.refCount===0&&ry(sy,function(){e.controller.abort()})}var Kn=null,lc=0,Ja=0,Qa=null;function ay(e,r){if(Kn===null){var a=Kn=[];lc=0,Ja=cu(),Qa={status:"pending",value:void 0,then:function(i){a.push(i)}}}return lc++,r.then(Om,Om),r}function Om(){if(--lc===0&&Kn!==null){Qa!==null&&(Qa.status="fulfilled");var e=Kn;Kn=null,Ja=0,Qa=null;for(var r=0;r<e.length;r++)(0,e[r])()}}function ny(e,r){var a=[],i={status:"pending",value:null,reason:null,then:function(u){a.push(u)}};return e.then(function(){i.status="fulfilled",i.value=r;for(var u=0;u<a.length;u++)(0,a[u])(r)},function(u){for(i.status="rejected",i.reason=u,u=0;u<a.length;u++)(0,a[u])(void 0)}),i}var zm=A.S;A.S=function(e,r){hf=gt(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&ay(e,r),zm!==null&&zm(e,r)};var va=k(null);function ic(){var e=va.current;return e!==null?e:ut.pooledCache}function ei(e,r){r===null?M(va,va.current):M(va,r.pool)}function Mm(){var e=ic();return e===null?null:{parent:Et._currentValue,pool:e}}var Xa=Error(o(460)),oc=Error(o(474)),ti=Error(o(542)),ri={then:function(){}};function Pm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Dm(e,r,a){switch(a=e[a],a===void 0?e.push(r):a!==r&&(r.then(cs,cs),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw e=r.reason,Um(e),e;default:if(typeof r.status=="string")r.then(cs,cs);else{if(e=ut,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=r,e.status="pending",e.then(function(i){if(r.status==="pending"){var u=r;u.status="fulfilled",u.value=i}},function(i){if(r.status==="pending"){var u=r;u.status="rejected",u.reason=i}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw e=r.reason,Um(e),e}throw ja=r,Xa}}function wa(e){try{var r=e._init;return r(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(ja=a,Xa):a}}var ja=null;function Lm(){if(ja===null)throw Error(o(459));var e=ja;return ja=null,e}function Um(e){if(e===Xa||e===ti)throw Error(o(483))}var Za=null,Vn=0;function si(e){var r=Vn;return Vn+=1,Za===null&&(Za=[]),Dm(Za,e,r)}function $n(e,r){r=r.props.ref,e.ref=r!==void 0?r:null}function ai(e,r){throw r.$$typeof===w?Error(o(525)):(e=Object.prototype.toString.call(r),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":e)))}function _m(e){function r(W,$){if(e){var te=W.deletions;te===null?(W.deletions=[$],W.flags|=16):te.push($)}}function a(W,$){if(!e)return null;for(;$!==null;)r(W,$),$=$.sibling;return null}function i(W){for(var $=new Map;W!==null;)W.key!==null?$.set(W.key,W):$.set(W.index,W),W=W.sibling;return $}function u(W,$){return W=ds(W,$),W.index=0,W.sibling=null,W}function p(W,$,te){return W.index=te,e?(te=W.alternate,te!==null?(te=te.index,te<$?(W.flags|=67108866,$):te):(W.flags|=67108866,$)):(W.flags|=1048576,$)}function v(W){return e&&W.alternate===null&&(W.flags|=67108866),W}function O(W,$,te,pe){return $===null||$.tag!==6?($=Qo(te,W.mode,pe),$.return=W,$):($=u($,te),$.return=W,$)}function F(W,$,te,pe){var ze=te.type;return ze===j?ue(W,$,te.props.children,pe,te.key):$!==null&&($.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===_&&wa(ze)===$.type)?($=u($,te.props),$n($,te),$.return=W,$):($=Ql(te.type,te.key,te.props,null,W.mode,pe),$n($,te),$.return=W,$)}function re(W,$,te,pe){return $===null||$.tag!==4||$.stateNode.containerInfo!==te.containerInfo||$.stateNode.implementation!==te.implementation?($=Xo(te,W.mode,pe),$.return=W,$):($=u($,te.children||[]),$.return=W,$)}function ue(W,$,te,pe,ze){return $===null||$.tag!==7?($=ha(te,W.mode,pe,ze),$.return=W,$):($=u($,te),$.return=W,$)}function fe(W,$,te){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Qo(""+$,W.mode,te),$.return=W,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case N:return te=Ql($.type,$.key,$.props,null,W.mode,te),$n(te,$),te.return=W,te;case S:return $=Xo($,W.mode,te),$.return=W,$;case _:return $=wa($),fe(W,$,te)}if(Z($)||G($))return $=ha($,W.mode,te,null),$.return=W,$;if(typeof $.then=="function")return fe(W,si($),te);if($.$$typeof===T)return fe(W,Wl(W,$),te);ai(W,$)}return null}function ne(W,$,te,pe){var ze=$!==null?$.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return ze!==null?null:O(W,$,""+te,pe);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case N:return te.key===ze?F(W,$,te,pe):null;case S:return te.key===ze?re(W,$,te,pe):null;case _:return te=wa(te),ne(W,$,te,pe)}if(Z(te)||G(te))return ze!==null?null:ue(W,$,te,pe,null);if(typeof te.then=="function")return ne(W,$,si(te),pe);if(te.$$typeof===T)return ne(W,$,Wl(W,te),pe);ai(W,te)}return null}function ce(W,$,te,pe,ze){if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return W=W.get(te)||null,O($,W,""+pe,ze);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case N:return W=W.get(pe.key===null?te:pe.key)||null,F($,W,pe,ze);case S:return W=W.get(pe.key===null?te:pe.key)||null,re($,W,pe,ze);case _:return pe=wa(pe),ce(W,$,te,pe,ze)}if(Z(pe)||G(pe))return W=W.get(te)||null,ue($,W,pe,ze,null);if(typeof pe.then=="function")return ce(W,$,te,si(pe),ze);if(pe.$$typeof===T)return ce(W,$,te,Wl($,pe),ze);ai($,pe)}return null}function Ce(W,$,te,pe){for(var ze=null,Qe=null,Te=$,Ie=$=0,Ve=null;Te!==null&&Ie<te.length;Ie++){Te.index>Ie?(Ve=Te,Te=null):Ve=Te.sibling;var Xe=ne(W,Te,te[Ie],pe);if(Xe===null){Te===null&&(Te=Ve);break}e&&Te&&Xe.alternate===null&&r(W,Te),$=p(Xe,$,Ie),Qe===null?ze=Xe:Qe.sibling=Xe,Qe=Xe,Te=Ve}if(Ie===te.length)return a(W,Te),Ye&&ms(W,Ie),ze;if(Te===null){for(;Ie<te.length;Ie++)Te=fe(W,te[Ie],pe),Te!==null&&($=p(Te,$,Ie),Qe===null?ze=Te:Qe.sibling=Te,Qe=Te);return Ye&&ms(W,Ie),ze}for(Te=i(Te);Ie<te.length;Ie++)Ve=ce(Te,W,Ie,te[Ie],pe),Ve!==null&&(e&&Ve.alternate!==null&&Te.delete(Ve.key===null?Ie:Ve.key),$=p(Ve,$,Ie),Qe===null?ze=Ve:Qe.sibling=Ve,Qe=Ve);return e&&Te.forEach(function(aa){return r(W,aa)}),Ye&&ms(W,Ie),ze}function Me(W,$,te,pe){if(te==null)throw Error(o(151));for(var ze=null,Qe=null,Te=$,Ie=$=0,Ve=null,Xe=te.next();Te!==null&&!Xe.done;Ie++,Xe=te.next()){Te.index>Ie?(Ve=Te,Te=null):Ve=Te.sibling;var aa=ne(W,Te,Xe.value,pe);if(aa===null){Te===null&&(Te=Ve);break}e&&Te&&aa.alternate===null&&r(W,Te),$=p(aa,$,Ie),Qe===null?ze=aa:Qe.sibling=aa,Qe=aa,Te=Ve}if(Xe.done)return a(W,Te),Ye&&ms(W,Ie),ze;if(Te===null){for(;!Xe.done;Ie++,Xe=te.next())Xe=fe(W,Xe.value,pe),Xe!==null&&($=p(Xe,$,Ie),Qe===null?ze=Xe:Qe.sibling=Xe,Qe=Xe);return Ye&&ms(W,Ie),ze}for(Te=i(Te);!Xe.done;Ie++,Xe=te.next())Xe=ce(Te,W,Ie,Xe.value,pe),Xe!==null&&(e&&Xe.alternate!==null&&Te.delete(Xe.key===null?Ie:Xe.key),$=p(Xe,$,Ie),Qe===null?ze=Xe:Qe.sibling=Xe,Qe=Xe);return e&&Te.forEach(function(hb){return r(W,hb)}),Ye&&ms(W,Ie),ze}function lt(W,$,te,pe){if(typeof te=="object"&&te!==null&&te.type===j&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case N:e:{for(var ze=te.key;$!==null;){if($.key===ze){if(ze=te.type,ze===j){if($.tag===7){a(W,$.sibling),pe=u($,te.props.children),pe.return=W,W=pe;break e}}else if($.elementType===ze||typeof ze=="object"&&ze!==null&&ze.$$typeof===_&&wa(ze)===$.type){a(W,$.sibling),pe=u($,te.props),$n(pe,te),pe.return=W,W=pe;break e}a(W,$);break}else r(W,$);$=$.sibling}te.type===j?(pe=ha(te.props.children,W.mode,pe,te.key),pe.return=W,W=pe):(pe=Ql(te.type,te.key,te.props,null,W.mode,pe),$n(pe,te),pe.return=W,W=pe)}return v(W);case S:e:{for(ze=te.key;$!==null;){if($.key===ze)if($.tag===4&&$.stateNode.containerInfo===te.containerInfo&&$.stateNode.implementation===te.implementation){a(W,$.sibling),pe=u($,te.children||[]),pe.return=W,W=pe;break e}else{a(W,$);break}else r(W,$);$=$.sibling}pe=Xo(te,W.mode,pe),pe.return=W,W=pe}return v(W);case _:return te=wa(te),lt(W,$,te,pe)}if(Z(te))return Ce(W,$,te,pe);if(G(te)){if(ze=G(te),typeof ze!="function")throw Error(o(150));return te=ze.call(te),Me(W,$,te,pe)}if(typeof te.then=="function")return lt(W,$,si(te),pe);if(te.$$typeof===T)return lt(W,$,Wl(W,te),pe);ai(W,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,$!==null&&$.tag===6?(a(W,$.sibling),pe=u($,te),pe.return=W,W=pe):(a(W,$),pe=Qo(te,W.mode,pe),pe.return=W,W=pe),v(W)):a(W,$)}return function(W,$,te,pe){try{Vn=0;var ze=lt(W,$,te,pe);return Za=null,ze}catch(Te){if(Te===Xa||Te===ti)throw Te;var Qe=gr(29,Te,null,W.mode);return Qe.lanes=pe,Qe.return=W,Qe}finally{}}}var Sa=_m(!0),Bm=_m(!1),Fs=!1;function cc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function uc(e,r){e=e.updateQueue,r.updateQueue===e&&(r.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Hs(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function qs(e,r,a){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ze&2)!==0){var u=i.pending;return u===null?r.next=r:(r.next=u.next,u.next=r),i.pending=r,r=Jl(e),jm(e,null,a),r}return Yl(e,i,r,a),Jl(e)}function Yn(e,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194048)!==0)){var i=r.lanes;i&=e.pendingLanes,a|=i,r.lanes=a,tr(e,a)}}function dc(e,r){var a=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,a===i)){var u=null,p=null;if(a=a.firstBaseUpdate,a!==null){do{var v={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};p===null?u=p=v:p=p.next=v,a=a.next}while(a!==null);p===null?u=p=r:p=p.next=r}else u=p=r;a={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:p,shared:i.shared,callbacks:i.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=r:e.next=r,a.lastBaseUpdate=r}var mc=!1;function Jn(){if(mc){var e=Qa;if(e!==null)throw e}}function Qn(e,r,a,i){mc=!1;var u=e.updateQueue;Fs=!1;var p=u.firstBaseUpdate,v=u.lastBaseUpdate,O=u.shared.pending;if(O!==null){u.shared.pending=null;var F=O,re=F.next;F.next=null,v===null?p=re:v.next=re,v=F;var ue=e.alternate;ue!==null&&(ue=ue.updateQueue,O=ue.lastBaseUpdate,O!==v&&(O===null?ue.firstBaseUpdate=re:O.next=re,ue.lastBaseUpdate=F))}if(p!==null){var fe=u.baseState;v=0,ue=re=F=null,O=p;do{var ne=O.lane&-536870913,ce=ne!==O.lane;if(ce?(Ke&ne)===ne:(i&ne)===ne){ne!==0&&ne===Ja&&(mc=!0),ue!==null&&(ue=ue.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var Ce=e,Me=O;ne=r;var lt=a;switch(Me.tag){case 1:if(Ce=Me.payload,typeof Ce=="function"){fe=Ce.call(lt,fe,ne);break e}fe=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Me.payload,ne=typeof Ce=="function"?Ce.call(lt,fe,ne):Ce,ne==null)break e;fe=y({},fe,ne);break e;case 2:Fs=!0}}ne=O.callback,ne!==null&&(e.flags|=64,ce&&(e.flags|=8192),ce=u.callbacks,ce===null?u.callbacks=[ne]:ce.push(ne))}else ce={lane:ne,tag:O.tag,payload:O.payload,callback:O.callback,next:null},ue===null?(re=ue=ce,F=fe):ue=ue.next=ce,v|=ne;if(O=O.next,O===null){if(O=u.shared.pending,O===null)break;ce=O,O=ce.next,ce.next=null,u.lastBaseUpdate=ce,u.shared.pending=null}}while(!0);ue===null&&(F=fe),u.baseState=F,u.firstBaseUpdate=re,u.lastBaseUpdate=ue,p===null&&(u.shared.lanes=0),Ys|=v,e.lanes=v,e.memoizedState=fe}}function Im(e,r){if(typeof e!="function")throw Error(o(191,e));e.call(r)}function Fm(e,r){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Im(a[e],r)}var Wa=k(null),ni=k(0);function Hm(e,r){e=Ss,M(ni,e),M(Wa,r),Ss=e|r.baseLanes}function pc(){M(ni,Ss),M(Wa,Wa.current)}function fc(){Ss=ni.current,U(Wa),U(ni)}var hr=k(null),zr=null;function Gs(e){var r=e.alternate;M(kt,kt.current&1),M(hr,e),zr===null&&(r===null||Wa.current!==null||r.memoizedState!==null)&&(zr=e)}function gc(e){M(kt,kt.current),M(hr,e),zr===null&&(zr=e)}function qm(e){e.tag===22?(M(kt,kt.current),M(hr,e),zr===null&&(zr=e)):Ks()}function Ks(){M(kt,kt.current),M(hr,hr.current)}function xr(e){U(hr),zr===e&&(zr=null),U(kt)}var kt=k(0);function li(e){for(var r=e;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||wu(a)||ju(a)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var gs=0,_e=null,at=null,Rt=null,ii=!1,en=!1,Na=!1,oi=0,Xn=0,tn=null,ly=0;function St(){throw Error(o(321))}function hc(e,r){if(r===null)return!1;for(var a=0;a<r.length&&a<e.length;a++)if(!fr(e[a],r[a]))return!1;return!0}function xc(e,r,a,i,u,p){return gs=p,_e=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,A.H=e===null||e.memoizedState===null?Cp:zc,Na=!1,p=a(i,u),Na=!1,en&&(p=Km(r,a,i,u)),Gm(e),p}function Gm(e){A.H=el;var r=at!==null&&at.next!==null;if(gs=0,Rt=at=_e=null,ii=!1,Xn=0,tn=null,r)throw Error(o(300));e===null||Tt||(e=e.dependencies,e!==null&&Zl(e)&&(Tt=!0))}function Km(e,r,a,i){_e=e;var u=0;do{if(en&&(tn=null),Xn=0,en=!1,25<=u)throw Error(o(301));if(u+=1,Rt=at=null,e.updateQueue!=null){var p=e.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}A.H=Ap,p=r(a,i)}while(en);return p}function iy(){var e=A.H,r=e.useState()[0];return r=typeof r.then=="function"?Zn(r):r,e=e.useState()[0],(at!==null?at.memoizedState:null)!==e&&(_e.flags|=1024),r}function yc(){var e=oi!==0;return oi=0,e}function bc(e,r,a){r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~a}function vc(e){if(ii){for(e=e.memoizedState;e!==null;){var r=e.queue;r!==null&&(r.pending=null),e=e.next}ii=!1}gs=0,Rt=at=_e=null,en=!1,Xn=oi=0,tn=null}function rr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?_e.memoizedState=Rt=e:Rt=Rt.next=e,Rt}function Ct(){if(at===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=at.next;var r=Rt===null?_e.memoizedState:Rt.next;if(r!==null)Rt=r,at=e;else{if(e===null)throw _e.alternate===null?Error(o(467)):Error(o(310));at=e,e={memoizedState:at.memoizedState,baseState:at.baseState,baseQueue:at.baseQueue,queue:at.queue,next:null},Rt===null?_e.memoizedState=Rt=e:Rt=Rt.next=e}return Rt}function ci(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zn(e){var r=Xn;return Xn+=1,tn===null&&(tn=[]),e=Dm(tn,e,r),r=_e,(Rt===null?r.memoizedState:Rt.next)===null&&(r=r.alternate,A.H=r===null||r.memoizedState===null?Cp:zc),e}function ui(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Zn(e);if(e.$$typeof===T)return Vt(e)}throw Error(o(438,String(e)))}function wc(e){var r=null,a=_e.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var i=_e.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(r={data:i.data.map(function(u){return u.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),a===null&&(a=ci(),_e.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(e),i=0;i<e;i++)a[i]=V;return r.index++,a}function hs(e,r){return typeof r=="function"?r(e):r}function di(e){var r=Ct();return jc(r,at,e)}function jc(e,r,a){var i=e.queue;if(i===null)throw Error(o(311));i.lastRenderedReducer=a;var u=e.baseQueue,p=i.pending;if(p!==null){if(u!==null){var v=u.next;u.next=p.next,p.next=v}r.baseQueue=u=p,i.pending=null}if(p=e.baseState,u===null)e.memoizedState=p;else{r=u.next;var O=v=null,F=null,re=r,ue=!1;do{var fe=re.lane&-536870913;if(fe!==re.lane?(Ke&fe)===fe:(gs&fe)===fe){var ne=re.revertLane;if(ne===0)F!==null&&(F=F.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),fe===Ja&&(ue=!0);else if((gs&ne)===ne){re=re.next,ne===Ja&&(ue=!0);continue}else fe={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},F===null?(O=F=fe,v=p):F=F.next=fe,_e.lanes|=ne,Ys|=ne;fe=re.action,Na&&a(p,fe),p=re.hasEagerState?re.eagerState:a(p,fe)}else ne={lane:fe,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},F===null?(O=F=ne,v=p):F=F.next=ne,_e.lanes|=fe,Ys|=fe;re=re.next}while(re!==null&&re!==r);if(F===null?v=p:F.next=O,!fr(p,e.memoizedState)&&(Tt=!0,ue&&(a=Qa,a!==null)))throw a;e.memoizedState=p,e.baseState=v,e.baseQueue=F,i.lastRenderedState=p}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Sc(e){var r=Ct(),a=r.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=e;var i=a.dispatch,u=a.pending,p=r.memoizedState;if(u!==null){a.pending=null;var v=u=u.next;do p=e(p,v.action),v=v.next;while(v!==u);fr(p,r.memoizedState)||(Tt=!0),r.memoizedState=p,r.baseQueue===null&&(r.baseState=p),a.lastRenderedState=p}return[p,i]}function Vm(e,r,a){var i=_e,u=Ct(),p=Ye;if(p){if(a===void 0)throw Error(o(407));a=a()}else a=r();var v=!fr((at||u).memoizedState,a);if(v&&(u.memoizedState=a,Tt=!0),u=u.queue,Cc(Jm.bind(null,i,u,e),[e]),u.getSnapshot!==r||v||Rt!==null&&Rt.memoizedState.tag&1){if(i.flags|=2048,rn(9,{destroy:void 0},Ym.bind(null,i,u,a,r),null),ut===null)throw Error(o(349));p||(gs&127)!==0||$m(i,r,a)}return a}function $m(e,r,a){e.flags|=16384,e={getSnapshot:r,value:a},r=_e.updateQueue,r===null?(r=ci(),_e.updateQueue=r,r.stores=[e]):(a=r.stores,a===null?r.stores=[e]:a.push(e))}function Ym(e,r,a,i){r.value=a,r.getSnapshot=i,Qm(r)&&Xm(e)}function Jm(e,r,a){return a(function(){Qm(r)&&Xm(e)})}function Qm(e){var r=e.getSnapshot;e=e.value;try{var a=r();return!fr(e,a)}catch{return!0}}function Xm(e){var r=ga(e,2);r!==null&&dr(r,e,2)}function Nc(e){var r=rr();if(typeof e=="function"){var a=e;if(e=a(),Na){_t(!0);try{a()}finally{_t(!1)}}}return r.memoizedState=r.baseState=e,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:e},r}function Zm(e,r,a,i){return e.baseState=a,jc(e,at,typeof i=="function"?i:hs)}function oy(e,r,a,i,u){if(fi(e))throw Error(o(485));if(e=r.action,e!==null){var p={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){p.listeners.push(v)}};A.T!==null?a(!0):p.isTransition=!1,i(p),a=r.pending,a===null?(p.next=r.pending=p,Wm(r,p)):(p.next=a.next,r.pending=a.next=p)}}function Wm(e,r){var a=r.action,i=r.payload,u=e.state;if(r.isTransition){var p=A.T,v={};A.T=v;try{var O=a(u,i),F=A.S;F!==null&&F(v,O),ep(e,r,O)}catch(re){kc(e,r,re)}finally{p!==null&&v.types!==null&&(p.types=v.types),A.T=p}}else try{p=a(u,i),ep(e,r,p)}catch(re){kc(e,r,re)}}function ep(e,r,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(i){tp(e,r,i)},function(i){return kc(e,r,i)}):tp(e,r,a)}function tp(e,r,a){r.status="fulfilled",r.value=a,rp(r),e.state=a,r=e.pending,r!==null&&(a=r.next,a===r?e.pending=null:(a=a.next,r.next=a,Wm(e,a)))}function kc(e,r,a){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do r.status="rejected",r.reason=a,rp(r),r=r.next;while(r!==i)}e.action=null}function rp(e){e=e.listeners;for(var r=0;r<e.length;r++)(0,e[r])()}function sp(e,r){return r}function ap(e,r){if(Ye){var a=ut.formState;if(a!==null){e:{var i=_e;if(Ye){if(xt){t:{for(var u=xt,p=Or;u.nodeType!==8;){if(!p){u=null;break t}if(u=Mr(u.nextSibling),u===null){u=null;break t}}p=u.data,u=p==="F!"||p==="F"?u:null}if(u){xt=Mr(u.nextSibling),i=u.data==="F!";break e}}Bs(i)}i=!1}i&&(r=a[0])}}return a=rr(),a.memoizedState=a.baseState=r,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sp,lastRenderedState:r},a.queue=i,a=Sp.bind(null,_e,i),i.dispatch=a,i=Nc(!1),p=Oc.bind(null,_e,!1,i.queue),i=rr(),u={state:r,dispatch:null,action:e,pending:null},i.queue=u,a=oy.bind(null,_e,u,p,a),u.dispatch=a,i.memoizedState=e,[r,a,!1]}function np(e){var r=Ct();return lp(r,at,e)}function lp(e,r,a){if(r=jc(e,r,sp)[0],e=di(hs)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var i=Zn(r)}catch(v){throw v===Xa?ti:v}else i=r;r=Ct();var u=r.queue,p=u.dispatch;return a!==r.memoizedState&&(_e.flags|=2048,rn(9,{destroy:void 0},cy.bind(null,u,a),null)),[i,p,e]}function cy(e,r){e.action=r}function ip(e){var r=Ct(),a=at;if(a!==null)return lp(r,a,e);Ct(),r=r.memoizedState,a=Ct();var i=a.queue.dispatch;return a.memoizedState=e,[r,i,!1]}function rn(e,r,a,i){return e={tag:e,create:a,deps:i,inst:r,next:null},r=_e.updateQueue,r===null&&(r=ci(),_e.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=e.next=e:(i=a.next,a.next=e,e.next=i,r.lastEffect=e),e}function op(){return Ct().memoizedState}function mi(e,r,a,i){var u=rr();_e.flags|=e,u.memoizedState=rn(1|r,{destroy:void 0},a,i===void 0?null:i)}function pi(e,r,a,i){var u=Ct();i=i===void 0?null:i;var p=u.memoizedState.inst;at!==null&&i!==null&&hc(i,at.memoizedState.deps)?u.memoizedState=rn(r,p,a,i):(_e.flags|=e,u.memoizedState=rn(1|r,p,a,i))}function cp(e,r){mi(8390656,8,e,r)}function Cc(e,r){pi(2048,8,e,r)}function uy(e){_e.flags|=4;var r=_e.updateQueue;if(r===null)r=ci(),_e.updateQueue=r,r.events=[e];else{var a=r.events;a===null?r.events=[e]:a.push(e)}}function up(e){var r=Ct().memoizedState;return uy({ref:r,nextImpl:e}),function(){if((Ze&2)!==0)throw Error(o(440));return r.impl.apply(void 0,arguments)}}function dp(e,r){return pi(4,2,e,r)}function mp(e,r){return pi(4,4,e,r)}function pp(e,r){if(typeof r=="function"){e=e();var a=r(e);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return e=e(),r.current=e,function(){r.current=null}}function fp(e,r,a){a=a!=null?a.concat([e]):null,pi(4,4,pp.bind(null,r,e),a)}function Ac(){}function gp(e,r){var a=Ct();r=r===void 0?null:r;var i=a.memoizedState;return r!==null&&hc(r,i[1])?i[0]:(a.memoizedState=[e,r],e)}function hp(e,r){var a=Ct();r=r===void 0?null:r;var i=a.memoizedState;if(r!==null&&hc(r,i[1]))return i[0];if(i=e(),Na){_t(!0);try{e()}finally{_t(!1)}}return a.memoizedState=[i,r],i}function Ec(e,r,a){return a===void 0||(gs&1073741824)!==0&&(Ke&261930)===0?e.memoizedState=r:(e.memoizedState=a,e=yf(),_e.lanes|=e,Ys|=e,a)}function xp(e,r,a,i){return fr(a,r)?a:Wa.current!==null?(e=Ec(e,a,i),fr(e,r)||(Tt=!0),e):(gs&42)===0||(gs&1073741824)!==0&&(Ke&261930)===0?(Tt=!0,e.memoizedState=a):(e=yf(),_e.lanes|=e,Ys|=e,r)}function yp(e,r,a,i,u){var p=H.p;H.p=p!==0&&8>p?p:8;var v=A.T,O={};A.T=O,Oc(e,!1,r,a);try{var F=u(),re=A.S;if(re!==null&&re(O,F),F!==null&&typeof F=="object"&&typeof F.then=="function"){var ue=ny(F,i);Wn(e,r,ue,vr(e))}else Wn(e,r,i,vr(e))}catch(fe){Wn(e,r,{then:function(){},status:"rejected",reason:fe},vr())}finally{H.p=p,v!==null&&O.types!==null&&(v.types=O.types),A.T=v}}function dy(){}function Rc(e,r,a,i){if(e.tag!==5)throw Error(o(476));var u=bp(e).queue;yp(e,u,r,J,a===null?dy:function(){return vp(e),a(i)})}function bp(e){var r=e.memoizedState;if(r!==null)return r;r={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:J},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:a},next:null},e.memoizedState=r,e=e.alternate,e!==null&&(e.memoizedState=r),r}function vp(e){var r=bp(e);r.next===null&&(r=e.alternate.memoizedState),Wn(e,r.next.queue,{},vr())}function Tc(){return Vt(hl)}function wp(){return Ct().memoizedState}function jp(){return Ct().memoizedState}function my(e){for(var r=e.return;r!==null;){switch(r.tag){case 24:case 3:var a=vr();e=Hs(a);var i=qs(r,e,a);i!==null&&(dr(i,r,a),Yn(i,r,a)),r={cache:nc()},e.payload=r;return}r=r.return}}function py(e,r,a){var i=vr();a={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},fi(e)?Np(r,a):(a=Yo(e,r,a,i),a!==null&&(dr(a,e,i),kp(a,r,i)))}function Sp(e,r,a){var i=vr();Wn(e,r,a,i)}function Wn(e,r,a,i){var u={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(fi(e))Np(r,u);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=r.lastRenderedReducer,p!==null))try{var v=r.lastRenderedState,O=p(v,a);if(u.hasEagerState=!0,u.eagerState=O,fr(O,v))return Yl(e,r,u,0),ut===null&&$l(),!1}catch{}finally{}if(a=Yo(e,r,u,i),a!==null)return dr(a,e,i),kp(a,r,i),!0}return!1}function Oc(e,r,a,i){if(i={lane:2,revertLane:cu(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},fi(e)){if(r)throw Error(o(479))}else r=Yo(e,a,i,2),r!==null&&dr(r,e,2)}function fi(e){var r=e.alternate;return e===_e||r!==null&&r===_e}function Np(e,r){en=ii=!0;var a=e.pending;a===null?r.next=r:(r.next=a.next,a.next=r),e.pending=r}function kp(e,r,a){if((a&4194048)!==0){var i=r.lanes;i&=e.pendingLanes,a|=i,r.lanes=a,tr(e,a)}}var el={readContext:Vt,use:ui,useCallback:St,useContext:St,useEffect:St,useImperativeHandle:St,useLayoutEffect:St,useInsertionEffect:St,useMemo:St,useReducer:St,useRef:St,useState:St,useDebugValue:St,useDeferredValue:St,useTransition:St,useSyncExternalStore:St,useId:St,useHostTransitionStatus:St,useFormState:St,useActionState:St,useOptimistic:St,useMemoCache:St,useCacheRefresh:St};el.useEffectEvent=St;var Cp={readContext:Vt,use:ui,useCallback:function(e,r){return rr().memoizedState=[e,r===void 0?null:r],e},useContext:Vt,useEffect:cp,useImperativeHandle:function(e,r,a){a=a!=null?a.concat([e]):null,mi(4194308,4,pp.bind(null,r,e),a)},useLayoutEffect:function(e,r){return mi(4194308,4,e,r)},useInsertionEffect:function(e,r){mi(4,2,e,r)},useMemo:function(e,r){var a=rr();r=r===void 0?null:r;var i=e();if(Na){_t(!0);try{e()}finally{_t(!1)}}return a.memoizedState=[i,r],i},useReducer:function(e,r,a){var i=rr();if(a!==void 0){var u=a(r);if(Na){_t(!0);try{a(r)}finally{_t(!1)}}}else u=r;return i.memoizedState=i.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},i.queue=e,e=e.dispatch=py.bind(null,_e,e),[i.memoizedState,e]},useRef:function(e){var r=rr();return e={current:e},r.memoizedState=e},useState:function(e){e=Nc(e);var r=e.queue,a=Sp.bind(null,_e,r);return r.dispatch=a,[e.memoizedState,a]},useDebugValue:Ac,useDeferredValue:function(e,r){var a=rr();return Ec(a,e,r)},useTransition:function(){var e=Nc(!1);return e=yp.bind(null,_e,e.queue,!0,!1),rr().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,r,a){var i=_e,u=rr();if(Ye){if(a===void 0)throw Error(o(407));a=a()}else{if(a=r(),ut===null)throw Error(o(349));(Ke&127)!==0||$m(i,r,a)}u.memoizedState=a;var p={value:a,getSnapshot:r};return u.queue=p,cp(Jm.bind(null,i,p,e),[e]),i.flags|=2048,rn(9,{destroy:void 0},Ym.bind(null,i,p,a,r),null),a},useId:function(){var e=rr(),r=ut.identifierPrefix;if(Ye){var a=Qr,i=Jr;a=(i&~(1<<32-bt(i)-1)).toString(32)+a,r="_"+r+"R_"+a,a=oi++,0<a&&(r+="H"+a.toString(32)),r+="_"}else a=ly++,r="_"+r+"r_"+a.toString(32)+"_";return e.memoizedState=r},useHostTransitionStatus:Tc,useFormState:ap,useActionState:ap,useOptimistic:function(e){var r=rr();r.memoizedState=r.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=Oc.bind(null,_e,!0,a),a.dispatch=r,[e,r]},useMemoCache:wc,useCacheRefresh:function(){return rr().memoizedState=my.bind(null,_e)},useEffectEvent:function(e){var r=rr(),a={impl:e};return r.memoizedState=a,function(){if((Ze&2)!==0)throw Error(o(440));return a.impl.apply(void 0,arguments)}}},zc={readContext:Vt,use:ui,useCallback:gp,useContext:Vt,useEffect:Cc,useImperativeHandle:fp,useInsertionEffect:dp,useLayoutEffect:mp,useMemo:hp,useReducer:di,useRef:op,useState:function(){return di(hs)},useDebugValue:Ac,useDeferredValue:function(e,r){var a=Ct();return xp(a,at.memoizedState,e,r)},useTransition:function(){var e=di(hs)[0],r=Ct().memoizedState;return[typeof e=="boolean"?e:Zn(e),r]},useSyncExternalStore:Vm,useId:wp,useHostTransitionStatus:Tc,useFormState:np,useActionState:np,useOptimistic:function(e,r){var a=Ct();return Zm(a,at,e,r)},useMemoCache:wc,useCacheRefresh:jp};zc.useEffectEvent=up;var Ap={readContext:Vt,use:ui,useCallback:gp,useContext:Vt,useEffect:Cc,useImperativeHandle:fp,useInsertionEffect:dp,useLayoutEffect:mp,useMemo:hp,useReducer:Sc,useRef:op,useState:function(){return Sc(hs)},useDebugValue:Ac,useDeferredValue:function(e,r){var a=Ct();return at===null?Ec(a,e,r):xp(a,at.memoizedState,e,r)},useTransition:function(){var e=Sc(hs)[0],r=Ct().memoizedState;return[typeof e=="boolean"?e:Zn(e),r]},useSyncExternalStore:Vm,useId:wp,useHostTransitionStatus:Tc,useFormState:ip,useActionState:ip,useOptimistic:function(e,r){var a=Ct();return at!==null?Zm(a,at,e,r):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:wc,useCacheRefresh:jp};Ap.useEffectEvent=up;function Mc(e,r,a,i){r=e.memoizedState,a=a(i,r),a=a==null?r:y({},r,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Pc={enqueueSetState:function(e,r,a){e=e._reactInternals;var i=vr(),u=Hs(i);u.payload=r,a!=null&&(u.callback=a),r=qs(e,u,i),r!==null&&(dr(r,e,i),Yn(r,e,i))},enqueueReplaceState:function(e,r,a){e=e._reactInternals;var i=vr(),u=Hs(i);u.tag=1,u.payload=r,a!=null&&(u.callback=a),r=qs(e,u,i),r!==null&&(dr(r,e,i),Yn(r,e,i))},enqueueForceUpdate:function(e,r){e=e._reactInternals;var a=vr(),i=Hs(a);i.tag=2,r!=null&&(i.callback=r),r=qs(e,i,a),r!==null&&(dr(r,e,a),Yn(r,e,a))}};function Ep(e,r,a,i,u,p,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,p,v):r.prototype&&r.prototype.isPureReactComponent?!In(a,i)||!In(u,p):!0}function Rp(e,r,a,i){e=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,i),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,i),r.state!==e&&Pc.enqueueReplaceState(r,r.state,null)}function ka(e,r){var a=r;if("ref"in r){a={};for(var i in r)i!=="ref"&&(a[i]=r[i])}if(e=e.defaultProps){a===r&&(a=y({},a));for(var u in e)a[u]===void 0&&(a[u]=e[u])}return a}function Tp(e){Vl(e)}function Op(e){console.error(e)}function zp(e){Vl(e)}function gi(e,r){try{var a=e.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(i){setTimeout(function(){throw i})}}function Mp(e,r,a){try{var i=e.onCaughtError;i(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function Dc(e,r,a){return a=Hs(a),a.tag=3,a.payload={element:null},a.callback=function(){gi(e,r)},a}function Pp(e){return e=Hs(e),e.tag=3,e}function Dp(e,r,a,i){var u=a.type.getDerivedStateFromError;if(typeof u=="function"){var p=i.value;e.payload=function(){return u(p)},e.callback=function(){Mp(r,a,i)}}var v=a.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(e.callback=function(){Mp(r,a,i),typeof u!="function"&&(Js===null?Js=new Set([this]):Js.add(this));var O=i.stack;this.componentDidCatch(i.value,{componentStack:O!==null?O:""})})}function fy(e,r,a,i,u){if(a.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(r=a.alternate,r!==null&&Ya(r,a,u,!0),a=hr.current,a!==null){switch(a.tag){case 31:case 13:return zr===null?Ai():a.alternate===null&&Nt===0&&(Nt=3),a.flags&=-257,a.flags|=65536,a.lanes=u,i===ri?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([i]):r.add(i),lu(e,i,u)),!1;case 22:return a.flags|=65536,i===ri?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([i])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([i]):a.add(i)),lu(e,i,u)),!1}throw Error(o(435,a.tag))}return lu(e,i,u),Ai(),!1}if(Ye)return r=hr.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=u,i!==ec&&(e=Error(o(422),{cause:i}),qn(Er(e,a)))):(i!==ec&&(r=Error(o(423),{cause:i}),qn(Er(r,a))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=Er(i,a),u=Dc(e.stateNode,i,u),dc(e,u),Nt!==4&&(Nt=2)),!1;var p=Error(o(520),{cause:i});if(p=Er(p,a),ol===null?ol=[p]:ol.push(p),Nt!==4&&(Nt=2),r===null)return!0;i=Er(i,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,e=u&-u,a.lanes|=e,e=Dc(a.stateNode,i,e),dc(a,e),!1;case 1:if(r=a.type,p=a.stateNode,(a.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Js===null||!Js.has(p))))return a.flags|=65536,u&=-u,a.lanes|=u,u=Pp(u),Dp(u,e,a,i),dc(a,u),!1}a=a.return}while(a!==null);return!1}var Lc=Error(o(461)),Tt=!1;function $t(e,r,a,i){r.child=e===null?Bm(r,null,a,i):Sa(r,e.child,a,i)}function Lp(e,r,a,i,u){a=a.render;var p=r.ref;if("ref"in i){var v={};for(var O in i)O!=="ref"&&(v[O]=i[O])}else v=i;return ba(r),i=xc(e,r,a,v,p,u),O=yc(),e!==null&&!Tt?(bc(e,r,u),xs(e,r,u)):(Ye&&O&&Zo(r),r.flags|=1,$t(e,r,i,u),r.child)}function Up(e,r,a,i,u){if(e===null){var p=a.type;return typeof p=="function"&&!Jo(p)&&p.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=p,_p(e,r,p,i,u)):(e=Ql(a.type,null,i,r,r.mode,u),e.ref=r.ref,e.return=r,r.child=e)}if(p=e.child,!Gc(e,u)){var v=p.memoizedProps;if(a=a.compare,a=a!==null?a:In,a(v,i)&&e.ref===r.ref)return xs(e,r,u)}return r.flags|=1,e=ds(p,i),e.ref=r.ref,e.return=r,r.child=e}function _p(e,r,a,i,u){if(e!==null){var p=e.memoizedProps;if(In(p,i)&&e.ref===r.ref)if(Tt=!1,r.pendingProps=i=p,Gc(e,u))(e.flags&131072)!==0&&(Tt=!0);else return r.lanes=e.lanes,xs(e,r,u)}return Uc(e,r,a,i,u)}function Bp(e,r,a,i){var u=i.children,p=e!==null?e.memoizedState:null;if(e===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((r.flags&128)!==0){if(p=p!==null?p.baseLanes|a:a,e!==null){for(i=r.child=e.child,u=0;i!==null;)u=u|i.lanes|i.childLanes,i=i.sibling;i=u&~p}else i=0,r.child=null;return Ip(e,r,p,a,i)}if((a&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},e!==null&&ei(r,p!==null?p.cachePool:null),p!==null?Hm(r,p):pc(),qm(r);else return i=r.lanes=536870912,Ip(e,r,p!==null?p.baseLanes|a:a,a,i)}else p!==null?(ei(r,p.cachePool),Hm(r,p),Ks(),r.memoizedState=null):(e!==null&&ei(r,null),pc(),Ks());return $t(e,r,u,a),r.child}function tl(e,r){return e!==null&&e.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Ip(e,r,a,i,u){var p=ic();return p=p===null?null:{parent:Et._currentValue,pool:p},r.memoizedState={baseLanes:a,cachePool:p},e!==null&&ei(r,null),pc(),qm(r),e!==null&&Ya(e,r,i,!0),r.childLanes=u,null}function hi(e,r){return r=yi({mode:r.mode,children:r.children},e.mode),r.ref=e.ref,e.child=r,r.return=e,r}function Fp(e,r,a){return Sa(r,e.child,null,a),e=hi(r,r.pendingProps),e.flags|=2,xr(r),r.memoizedState=null,e}function gy(e,r,a){var i=r.pendingProps,u=(r.flags&128)!==0;if(r.flags&=-129,e===null){if(Ye){if(i.mode==="hidden")return e=hi(r,i),r.lanes=536870912,tl(null,e);if(gc(r),(e=xt)?(e=eg(e,Or),e=e!==null&&e.data==="&"?e:null,e!==null&&(r.memoizedState={dehydrated:e,treeContext:Us!==null?{id:Jr,overflow:Qr}:null,retryLane:536870912,hydrationErrors:null},a=Nm(e),a.return=r,r.child=a,Kt=r,xt=null)):e=null,e===null)throw Bs(r);return r.lanes=536870912,null}return hi(r,i)}var p=e.memoizedState;if(p!==null){var v=p.dehydrated;if(gc(r),u)if(r.flags&256)r.flags&=-257,r=Fp(e,r,a);else if(r.memoizedState!==null)r.child=e.child,r.flags|=128,r=null;else throw Error(o(558));else if(Tt||Ya(e,r,a,!1),u=(a&e.childLanes)!==0,Tt||u){if(i=ut,i!==null&&(v=ge(i,a),v!==0&&v!==p.retryLane))throw p.retryLane=v,ga(e,v),dr(i,e,v),Lc;Ai(),r=Fp(e,r,a)}else e=p.treeContext,xt=Mr(v.nextSibling),Kt=r,Ye=!0,_s=null,Or=!1,e!==null&&Am(r,e),r=hi(r,i),r.flags|=4096;return r}return e=ds(e.child,{mode:i.mode,children:i.children}),e.ref=r.ref,r.child=e,e.return=r,e}function xi(e,r){var a=r.ref;if(a===null)e!==null&&e.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(o(284));(e===null||e.ref!==a)&&(r.flags|=4194816)}}function Uc(e,r,a,i,u){return ba(r),a=xc(e,r,a,i,void 0,u),i=yc(),e!==null&&!Tt?(bc(e,r,u),xs(e,r,u)):(Ye&&i&&Zo(r),r.flags|=1,$t(e,r,a,u),r.child)}function Hp(e,r,a,i,u,p){return ba(r),r.updateQueue=null,a=Km(r,i,a,u),Gm(e),i=yc(),e!==null&&!Tt?(bc(e,r,p),xs(e,r,p)):(Ye&&i&&Zo(r),r.flags|=1,$t(e,r,a,p),r.child)}function qp(e,r,a,i,u){if(ba(r),r.stateNode===null){var p=Ga,v=a.contextType;typeof v=="object"&&v!==null&&(p=Vt(v)),p=new a(i,p),r.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Pc,r.stateNode=p,p._reactInternals=r,p=r.stateNode,p.props=i,p.state=r.memoizedState,p.refs={},cc(r),v=a.contextType,p.context=typeof v=="object"&&v!==null?Vt(v):Ga,p.state=r.memoizedState,v=a.getDerivedStateFromProps,typeof v=="function"&&(Mc(r,a,v,i),p.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(v=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),v!==p.state&&Pc.enqueueReplaceState(p,p.state,null),Qn(r,i,p,u),Jn(),p.state=r.memoizedState),typeof p.componentDidMount=="function"&&(r.flags|=4194308),i=!0}else if(e===null){p=r.stateNode;var O=r.memoizedProps,F=ka(a,O);p.props=F;var re=p.context,ue=a.contextType;v=Ga,typeof ue=="object"&&ue!==null&&(v=Vt(ue));var fe=a.getDerivedStateFromProps;ue=typeof fe=="function"||typeof p.getSnapshotBeforeUpdate=="function",O=r.pendingProps!==O,ue||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(O||re!==v)&&Rp(r,p,i,v),Fs=!1;var ne=r.memoizedState;p.state=ne,Qn(r,i,p,u),Jn(),re=r.memoizedState,O||ne!==re||Fs?(typeof fe=="function"&&(Mc(r,a,fe,i),re=r.memoizedState),(F=Fs||Ep(r,a,F,i,ne,re,v))?(ue||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(r.flags|=4194308)):(typeof p.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=i,r.memoizedState=re),p.props=i,p.state=re,p.context=v,i=F):(typeof p.componentDidMount=="function"&&(r.flags|=4194308),i=!1)}else{p=r.stateNode,uc(e,r),v=r.memoizedProps,ue=ka(a,v),p.props=ue,fe=r.pendingProps,ne=p.context,re=a.contextType,F=Ga,typeof re=="object"&&re!==null&&(F=Vt(re)),O=a.getDerivedStateFromProps,(re=typeof O=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(v!==fe||ne!==F)&&Rp(r,p,i,F),Fs=!1,ne=r.memoizedState,p.state=ne,Qn(r,i,p,u),Jn();var ce=r.memoizedState;v!==fe||ne!==ce||Fs||e!==null&&e.dependencies!==null&&Zl(e.dependencies)?(typeof O=="function"&&(Mc(r,a,O,i),ce=r.memoizedState),(ue=Fs||Ep(r,a,ue,i,ne,ce,F)||e!==null&&e.dependencies!==null&&Zl(e.dependencies))?(re||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(i,ce,F),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(i,ce,F)),typeof p.componentDidUpdate=="function"&&(r.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof p.componentDidUpdate!="function"||v===e.memoizedProps&&ne===e.memoizedState||(r.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&ne===e.memoizedState||(r.flags|=1024),r.memoizedProps=i,r.memoizedState=ce),p.props=i,p.state=ce,p.context=F,i=ue):(typeof p.componentDidUpdate!="function"||v===e.memoizedProps&&ne===e.memoizedState||(r.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||v===e.memoizedProps&&ne===e.memoizedState||(r.flags|=1024),i=!1)}return p=i,xi(e,r),i=(r.flags&128)!==0,p||i?(p=r.stateNode,a=i&&typeof a.getDerivedStateFromError!="function"?null:p.render(),r.flags|=1,e!==null&&i?(r.child=Sa(r,e.child,null,u),r.child=Sa(r,null,a,u)):$t(e,r,a,u),r.memoizedState=p.state,e=r.child):e=xs(e,r,u),e}function Gp(e,r,a,i){return xa(),r.flags|=256,$t(e,r,a,i),r.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bc(e){return{baseLanes:e,cachePool:Mm()}}function Ic(e,r,a){return e=e!==null?e.childLanes&~a:0,r&&(e|=br),e}function Kp(e,r,a){var i=r.pendingProps,u=!1,p=(r.flags&128)!==0,v;if((v=p)||(v=e!==null&&e.memoizedState===null?!1:(kt.current&2)!==0),v&&(u=!0,r.flags&=-129),v=(r.flags&32)!==0,r.flags&=-33,e===null){if(Ye){if(u?Gs(r):Ks(),(e=xt)?(e=eg(e,Or),e=e!==null&&e.data!=="&"?e:null,e!==null&&(r.memoizedState={dehydrated:e,treeContext:Us!==null?{id:Jr,overflow:Qr}:null,retryLane:536870912,hydrationErrors:null},a=Nm(e),a.return=r,r.child=a,Kt=r,xt=null)):e=null,e===null)throw Bs(r);return ju(e)?r.lanes=32:r.lanes=536870912,null}var O=i.children;return i=i.fallback,u?(Ks(),u=r.mode,O=yi({mode:"hidden",children:O},u),i=ha(i,u,a,null),O.return=r,i.return=r,O.sibling=i,r.child=O,i=r.child,i.memoizedState=Bc(a),i.childLanes=Ic(e,v,a),r.memoizedState=_c,tl(null,i)):(Gs(r),Fc(r,O))}var F=e.memoizedState;if(F!==null&&(O=F.dehydrated,O!==null)){if(p)r.flags&256?(Gs(r),r.flags&=-257,r=Hc(e,r,a)):r.memoizedState!==null?(Ks(),r.child=e.child,r.flags|=128,r=null):(Ks(),O=i.fallback,u=r.mode,i=yi({mode:"visible",children:i.children},u),O=ha(O,u,a,null),O.flags|=2,i.return=r,O.return=r,i.sibling=O,r.child=i,Sa(r,e.child,null,a),i=r.child,i.memoizedState=Bc(a),i.childLanes=Ic(e,v,a),r.memoizedState=_c,r=tl(null,i));else if(Gs(r),ju(O)){if(v=O.nextSibling&&O.nextSibling.dataset,v)var re=v.dgst;v=re,i=Error(o(419)),i.stack="",i.digest=v,qn({value:i,source:null,stack:null}),r=Hc(e,r,a)}else if(Tt||Ya(e,r,a,!1),v=(a&e.childLanes)!==0,Tt||v){if(v=ut,v!==null&&(i=ge(v,a),i!==0&&i!==F.retryLane))throw F.retryLane=i,ga(e,i),dr(v,e,i),Lc;wu(O)||Ai(),r=Hc(e,r,a)}else wu(O)?(r.flags|=192,r.child=e.child,r=null):(e=F.treeContext,xt=Mr(O.nextSibling),Kt=r,Ye=!0,_s=null,Or=!1,e!==null&&Am(r,e),r=Fc(r,i.children),r.flags|=4096);return r}return u?(Ks(),O=i.fallback,u=r.mode,F=e.child,re=F.sibling,i=ds(F,{mode:"hidden",children:i.children}),i.subtreeFlags=F.subtreeFlags&65011712,re!==null?O=ds(re,O):(O=ha(O,u,a,null),O.flags|=2),O.return=r,i.return=r,i.sibling=O,r.child=i,tl(null,i),i=r.child,O=e.child.memoizedState,O===null?O=Bc(a):(u=O.cachePool,u!==null?(F=Et._currentValue,u=u.parent!==F?{parent:F,pool:F}:u):u=Mm(),O={baseLanes:O.baseLanes|a,cachePool:u}),i.memoizedState=O,i.childLanes=Ic(e,v,a),r.memoizedState=_c,tl(e.child,i)):(Gs(r),a=e.child,e=a.sibling,a=ds(a,{mode:"visible",children:i.children}),a.return=r,a.sibling=null,e!==null&&(v=r.deletions,v===null?(r.deletions=[e],r.flags|=16):v.push(e)),r.child=a,r.memoizedState=null,a)}function Fc(e,r){return r=yi({mode:"visible",children:r},e.mode),r.return=e,e.child=r}function yi(e,r){return e=gr(22,e,null,r),e.lanes=0,e}function Hc(e,r,a){return Sa(r,e.child,null,a),e=Fc(r,r.pendingProps.children),e.flags|=2,r.memoizedState=null,e}function Vp(e,r,a){e.lanes|=r;var i=e.alternate;i!==null&&(i.lanes|=r),sc(e.return,r,a)}function qc(e,r,a,i,u,p){var v=e.memoizedState;v===null?e.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:i,tail:a,tailMode:u,treeForkCount:p}:(v.isBackwards=r,v.rendering=null,v.renderingStartTime=0,v.last=i,v.tail=a,v.tailMode=u,v.treeForkCount=p)}function $p(e,r,a){var i=r.pendingProps,u=i.revealOrder,p=i.tail;i=i.children;var v=kt.current,O=(v&2)!==0;if(O?(v=v&1|2,r.flags|=128):v&=1,M(kt,v),$t(e,r,i,a),i=Ye?Hn:0,!O&&e!==null&&(e.flags&128)!==0)e:for(e=r.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Vp(e,a,r);else if(e.tag===19)Vp(e,a,r);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===r)break e;for(;e.sibling===null;){if(e.return===null||e.return===r)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(a=r.child,u=null;a!==null;)e=a.alternate,e!==null&&li(e)===null&&(u=a),a=a.sibling;a=u,a===null?(u=r.child,r.child=null):(u=a.sibling,a.sibling=null),qc(r,!1,u,a,p,i);break;case"backwards":case"unstable_legacy-backwards":for(a=null,u=r.child,r.child=null;u!==null;){if(e=u.alternate,e!==null&&li(e)===null){r.child=u;break}e=u.sibling,u.sibling=a,a=u,u=e}qc(r,!0,a,null,p,i);break;case"together":qc(r,!1,null,null,void 0,i);break;default:r.memoizedState=null}return r.child}function xs(e,r,a){if(e!==null&&(r.dependencies=e.dependencies),Ys|=r.lanes,(a&r.childLanes)===0)if(e!==null){if(Ya(e,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(e!==null&&r.child!==e.child)throw Error(o(153));if(r.child!==null){for(e=r.child,a=ds(e,e.pendingProps),r.child=a,a.return=r;e.sibling!==null;)e=e.sibling,a=a.sibling=ds(e,e.pendingProps),a.return=r;a.sibling=null}return r.child}function Gc(e,r){return(e.lanes&r)!==0?!0:(e=e.dependencies,!!(e!==null&&Zl(e)))}function hy(e,r,a){switch(r.tag){case 3:he(r,r.stateNode.containerInfo),Is(r,Et,e.memoizedState.cache),xa();break;case 27:case 5:ye(r);break;case 4:he(r,r.stateNode.containerInfo);break;case 10:Is(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,gc(r),null;break;case 13:var i=r.memoizedState;if(i!==null)return i.dehydrated!==null?(Gs(r),r.flags|=128,null):(a&r.child.childLanes)!==0?Kp(e,r,a):(Gs(r),e=xs(e,r,a),e!==null?e.sibling:null);Gs(r);break;case 19:var u=(e.flags&128)!==0;if(i=(a&r.childLanes)!==0,i||(Ya(e,r,a,!1),i=(a&r.childLanes)!==0),u){if(i)return $p(e,r,a);r.flags|=128}if(u=r.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),M(kt,kt.current),i)break;return null;case 22:return r.lanes=0,Bp(e,r,a,r.pendingProps);case 24:Is(r,Et,e.memoizedState.cache)}return xs(e,r,a)}function Yp(e,r,a){if(e!==null)if(e.memoizedProps!==r.pendingProps)Tt=!0;else{if(!Gc(e,a)&&(r.flags&128)===0)return Tt=!1,hy(e,r,a);Tt=(e.flags&131072)!==0}else Tt=!1,Ye&&(r.flags&1048576)!==0&&Cm(r,Hn,r.index);switch(r.lanes=0,r.tag){case 16:e:{var i=r.pendingProps;if(e=wa(r.elementType),r.type=e,typeof e=="function")Jo(e)?(i=ka(e,i),r.tag=1,r=qp(null,r,e,i,a)):(r.tag=0,r=Uc(null,r,e,i,a));else{if(e!=null){var u=e.$$typeof;if(u===B){r.tag=11,r=Lp(null,r,e,i,a);break e}else if(u===R){r.tag=14,r=Up(null,r,e,i,a);break e}}throw r=L(e)||e,Error(o(306,r,""))}}return r;case 0:return Uc(e,r,r.type,r.pendingProps,a);case 1:return i=r.type,u=ka(i,r.pendingProps),qp(e,r,i,u,a);case 3:e:{if(he(r,r.stateNode.containerInfo),e===null)throw Error(o(387));i=r.pendingProps;var p=r.memoizedState;u=p.element,uc(e,r),Qn(r,i,null,a);var v=r.memoizedState;if(i=v.cache,Is(r,Et,i),i!==p.cache&&ac(r,[Et],a,!0),Jn(),i=v.element,p.isDehydrated)if(p={element:i,isDehydrated:!1,cache:v.cache},r.updateQueue.baseState=p,r.memoizedState=p,r.flags&256){r=Gp(e,r,i,a);break e}else if(i!==u){u=Er(Error(o(424)),r),qn(u),r=Gp(e,r,i,a);break e}else{switch(e=r.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(xt=Mr(e.firstChild),Kt=r,Ye=!0,_s=null,Or=!0,a=Bm(r,null,i,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(xa(),i===u){r=xs(e,r,a);break e}$t(e,r,i,a)}r=r.child}return r;case 26:return xi(e,r),e===null?(a=lg(r.type,null,r.pendingProps,null))?r.memoizedState=a:Ye||(a=r.type,e=r.pendingProps,i=Pi(ee.current).createElement(a),i[dt]=r,i[Xt]=e,Yt(i,a,e),Bt(i),r.stateNode=i):r.memoizedState=lg(r.type,e.memoizedProps,r.pendingProps,e.memoizedState),null;case 27:return ye(r),e===null&&Ye&&(i=r.stateNode=sg(r.type,r.pendingProps,ee.current),Kt=r,Or=!0,u=xt,Ws(r.type)?(Su=u,xt=Mr(i.firstChild)):xt=u),$t(e,r,r.pendingProps.children,a),xi(e,r),e===null&&(r.flags|=4194304),r.child;case 5:return e===null&&Ye&&((u=i=xt)&&(i=Vy(i,r.type,r.pendingProps,Or),i!==null?(r.stateNode=i,Kt=r,xt=Mr(i.firstChild),Or=!1,u=!0):u=!1),u||Bs(r)),ye(r),u=r.type,p=r.pendingProps,v=e!==null?e.memoizedProps:null,i=p.children,yu(u,p)?i=null:v!==null&&yu(u,v)&&(r.flags|=32),r.memoizedState!==null&&(u=xc(e,r,iy,null,null,a),hl._currentValue=u),xi(e,r),$t(e,r,i,a),r.child;case 6:return e===null&&Ye&&((e=a=xt)&&(a=$y(a,r.pendingProps,Or),a!==null?(r.stateNode=a,Kt=r,xt=null,e=!0):e=!1),e||Bs(r)),null;case 13:return Kp(e,r,a);case 4:return he(r,r.stateNode.containerInfo),i=r.pendingProps,e===null?r.child=Sa(r,null,i,a):$t(e,r,i,a),r.child;case 11:return Lp(e,r,r.type,r.pendingProps,a);case 7:return $t(e,r,r.pendingProps,a),r.child;case 8:return $t(e,r,r.pendingProps.children,a),r.child;case 12:return $t(e,r,r.pendingProps.children,a),r.child;case 10:return i=r.pendingProps,Is(r,r.type,i.value),$t(e,r,i.children,a),r.child;case 9:return u=r.type._context,i=r.pendingProps.children,ba(r),u=Vt(u),i=i(u),r.flags|=1,$t(e,r,i,a),r.child;case 14:return Up(e,r,r.type,r.pendingProps,a);case 15:return _p(e,r,r.type,r.pendingProps,a);case 19:return $p(e,r,a);case 31:return gy(e,r,a);case 22:return Bp(e,r,a,r.pendingProps);case 24:return ba(r),i=Vt(Et),e===null?(u=ic(),u===null&&(u=ut,p=nc(),u.pooledCache=p,p.refCount++,p!==null&&(u.pooledCacheLanes|=a),u=p),r.memoizedState={parent:i,cache:u},cc(r),Is(r,Et,u)):((e.lanes&a)!==0&&(uc(e,r),Qn(r,null,null,a),Jn()),u=e.memoizedState,p=r.memoizedState,u.parent!==i?(u={parent:i,cache:i},r.memoizedState=u,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=u),Is(r,Et,i)):(i=p.cache,Is(r,Et,i),i!==u.cache&&ac(r,[Et],a,!0))),$t(e,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(o(156,r.tag))}function ys(e){e.flags|=4}function Kc(e,r,a,i,u){if((r=(e.mode&32)!==0)&&(r=!1),r){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(jf())e.flags|=8192;else throw ja=ri,oc}else e.flags&=-16777217}function Jp(e,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!dg(r))if(jf())e.flags|=8192;else throw ja=ri,oc}function bi(e,r){r!==null&&(e.flags|=4),e.flags&16384&&(r=e.tag!==22?He():536870912,e.lanes|=r,ln|=r)}function rl(e,r){if(!Ye)switch(e.tailMode){case"hidden":r=e.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?r||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function yt(e){var r=e.alternate!==null&&e.alternate.child===e.child,a=0,i=0;if(r)for(var u=e.child;u!==null;)a|=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;)a|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=a,r}function xy(e,r,a){var i=r.pendingProps;switch(Wo(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yt(r),null;case 1:return yt(r),null;case 3:return a=r.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),r.memoizedState.cache!==i&&(r.flags|=2048),fs(Et),ae(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&($a(r)?ys(r):e===null||e.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,tc())),yt(r),null;case 26:var u=r.type,p=r.memoizedState;return e===null?(ys(r),p!==null?(yt(r),Jp(r,p)):(yt(r),Kc(r,u,null,i,a))):p?p!==e.memoizedState?(ys(r),yt(r),Jp(r,p)):(yt(r),r.flags&=-16777217):(e=e.memoizedProps,e!==i&&ys(r),yt(r),Kc(r,u,e,i,a)),null;case 27:if(ie(r),a=ee.current,u=r.type,e!==null&&r.stateNode!=null)e.memoizedProps!==i&&ys(r);else{if(!i){if(r.stateNode===null)throw Error(o(166));return yt(r),null}e=q.current,$a(r)?Em(r):(e=sg(u,i,a),r.stateNode=e,ys(r))}return yt(r),null;case 5:if(ie(r),u=r.type,e!==null&&r.stateNode!=null)e.memoizedProps!==i&&ys(r);else{if(!i){if(r.stateNode===null)throw Error(o(166));return yt(r),null}if(p=q.current,$a(r))Em(r);else{var v=Pi(ee.current);switch(p){case 1:p=v.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:p=v.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":p=v.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":p=v.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":p=v.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof i.is=="string"?v.createElement("select",{is:i.is}):v.createElement("select"),i.multiple?p.multiple=!0:i.size&&(p.size=i.size);break;default:p=typeof i.is=="string"?v.createElement(u,{is:i.is}):v.createElement(u)}}p[dt]=r,p[Xt]=i;e:for(v=r.child;v!==null;){if(v.tag===5||v.tag===6)p.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===r)break e;for(;v.sibling===null;){if(v.return===null||v.return===r)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}r.stateNode=p;e:switch(Yt(p,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&&ys(r)}}return yt(r),Kc(r,r.type,e===null?null:e.memoizedProps,r.pendingProps,a),null;case 6:if(e&&r.stateNode!=null)e.memoizedProps!==i&&ys(r);else{if(typeof i!="string"&&r.stateNode===null)throw Error(o(166));if(e=ee.current,$a(r)){if(e=r.stateNode,a=r.memoizedProps,i=null,u=Kt,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[dt]=r,e=!!(e.nodeValue===a||i!==null&&i.suppressHydrationWarning===!0||Vf(e.nodeValue,a)),e||Bs(r,!0)}else e=Pi(e).createTextNode(i),e[dt]=r,r.stateNode=e}return yt(r),null;case 31:if(a=r.memoizedState,e===null||e.memoizedState!==null){if(i=$a(r),a!==null){if(e===null){if(!i)throw Error(o(318));if(e=r.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[dt]=r}else xa(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;yt(r),e=!1}else a=tc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return r.flags&256?(xr(r),r):(xr(r),null);if((r.flags&128)!==0)throw Error(o(558))}return yt(r),null;case 13:if(i=r.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=$a(r),i!==null&&i.dehydrated!==null){if(e===null){if(!u)throw Error(o(318));if(u=r.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[dt]=r}else xa(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;yt(r),u=!1}else u=tc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return r.flags&256?(xr(r),r):(xr(r),null)}return xr(r),(r.flags&128)!==0?(r.lanes=a,r):(a=i!==null,e=e!==null&&e.memoizedState!==null,a&&(i=r.child,u=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(u=i.alternate.memoizedState.cachePool.pool),p=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(p=i.memoizedState.cachePool.pool),p!==u&&(i.flags|=2048)),a!==e&&a&&(r.child.flags|=8192),bi(r,r.updateQueue),yt(r),null);case 4:return ae(),e===null&&pu(r.stateNode.containerInfo),yt(r),null;case 10:return fs(r.type),yt(r),null;case 19:if(U(kt),i=r.memoizedState,i===null)return yt(r),null;if(u=(r.flags&128)!==0,p=i.rendering,p===null)if(u)rl(i,!1);else{if(Nt!==0||e!==null&&(e.flags&128)!==0)for(e=r.child;e!==null;){if(p=li(e),p!==null){for(r.flags|=128,rl(i,!1),e=p.updateQueue,r.updateQueue=e,bi(r,e),r.subtreeFlags=0,e=a,a=r.child;a!==null;)Sm(a,e),a=a.sibling;return M(kt,kt.current&1|2),Ye&&ms(r,i.treeForkCount),r.child}e=e.sibling}i.tail!==null&&gt()>Ni&&(r.flags|=128,u=!0,rl(i,!1),r.lanes=4194304)}else{if(!u)if(e=li(p),e!==null){if(r.flags|=128,u=!0,e=e.updateQueue,r.updateQueue=e,bi(r,e),rl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!p.alternate&&!Ye)return yt(r),null}else 2*gt()-i.renderingStartTime>Ni&&a!==536870912&&(r.flags|=128,u=!0,rl(i,!1),r.lanes=4194304);i.isBackwards?(p.sibling=r.child,r.child=p):(e=i.last,e!==null?e.sibling=p:r.child=p,i.last=p)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=gt(),e.sibling=null,a=kt.current,M(kt,u?a&1|2:a&1),Ye&&ms(r,i.treeForkCount),e):(yt(r),null);case 22:case 23:return xr(r),fc(),i=r.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(r.flags|=8192):i&&(r.flags|=8192),i?(a&536870912)!==0&&(r.flags&128)===0&&(yt(r),r.subtreeFlags&6&&(r.flags|=8192)):yt(r),a=r.updateQueue,a!==null&&bi(r,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==a&&(r.flags|=2048),e!==null&&U(va),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),fs(Et),yt(r),null;case 25:return null;case 30:return null}throw Error(o(156,r.tag))}function yy(e,r){switch(Wo(r),r.tag){case 1:return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 3:return fs(Et),ae(),e=r.flags,(e&65536)!==0&&(e&128)===0?(r.flags=e&-65537|128,r):null;case 26:case 27:case 5:return ie(r),null;case 31:if(r.memoizedState!==null){if(xr(r),r.alternate===null)throw Error(o(340));xa()}return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 13:if(xr(r),e=r.memoizedState,e!==null&&e.dehydrated!==null){if(r.alternate===null)throw Error(o(340));xa()}return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 19:return U(kt),null;case 4:return ae(),null;case 10:return fs(r.type),null;case 22:case 23:return xr(r),fc(),e!==null&&U(va),e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 24:return fs(Et),null;case 25:return null;default:return null}}function Qp(e,r){switch(Wo(r),r.tag){case 3:fs(Et),ae();break;case 26:case 27:case 5:ie(r);break;case 4:ae();break;case 31:r.memoizedState!==null&&xr(r);break;case 13:xr(r);break;case 19:U(kt);break;case 10:fs(r.type);break;case 22:case 23:xr(r),fc(),e!==null&&U(va);break;case 24:fs(Et)}}function sl(e,r){try{var a=r.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var u=i.next;a=u;do{if((a.tag&e)===e){i=void 0;var p=a.create,v=a.inst;i=p(),v.destroy=i}a=a.next}while(a!==u)}}catch(O){rt(r,r.return,O)}}function Vs(e,r,a){try{var i=r.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var p=u.next;i=p;do{if((i.tag&e)===e){var v=i.inst,O=v.destroy;if(O!==void 0){v.destroy=void 0,u=r;var F=a,re=O;try{re()}catch(ue){rt(u,F,ue)}}}i=i.next}while(i!==p)}}catch(ue){rt(r,r.return,ue)}}function Xp(e){var r=e.updateQueue;if(r!==null){var a=e.stateNode;try{Fm(r,a)}catch(i){rt(e,e.return,i)}}}function Zp(e,r,a){a.props=ka(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(i){rt(e,r,i)}}function al(e,r){try{var a=e.ref;if(a!==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 a=="function"?e.refCleanup=a(i):a.current=i}}catch(u){rt(e,r,u)}}function Xr(e,r){var a=e.ref,i=e.refCleanup;if(a!==null)if(typeof i=="function")try{i()}catch(u){rt(e,r,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){rt(e,r,u)}else a.current=null}function Wp(e){var r=e.type,a=e.memoizedProps,i=e.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":a.autoFocus&&i.focus();break e;case"img":a.src?i.src=a.src:a.srcSet&&(i.srcset=a.srcSet)}}catch(u){rt(e,e.return,u)}}function Vc(e,r,a){try{var i=e.stateNode;Iy(i,e.type,a,r),i[Xt]=r}catch(u){rt(e,e.return,u)}}function ef(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ws(e.type)||e.tag===4}function $c(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ef(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&&Ws(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 Yc(e,r,a){var i=e.tag;if(i===5||i===6)e=e.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(e),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=cs));else if(i!==4&&(i===27&&Ws(e.type)&&(a=e.stateNode,r=null),e=e.child,e!==null))for(Yc(e,r,a),e=e.sibling;e!==null;)Yc(e,r,a),e=e.sibling}function vi(e,r,a){var i=e.tag;if(i===5||i===6)e=e.stateNode,r?a.insertBefore(e,r):a.appendChild(e);else if(i!==4&&(i===27&&Ws(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(vi(e,r,a),e=e.sibling;e!==null;)vi(e,r,a),e=e.sibling}function tf(e){var r=e.stateNode,a=e.memoizedProps;try{for(var i=e.type,u=r.attributes;u.length;)r.removeAttributeNode(u[0]);Yt(r,i,a),r[dt]=e,r[Xt]=a}catch(p){rt(e,e.return,p)}}var bs=!1,Ot=!1,Jc=!1,rf=typeof WeakSet=="function"?WeakSet:Set,It=null;function by(e,r){if(e=e.containerInfo,hu=Fi,e=fm(e),Ho(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var i=a.getSelection&&a.getSelection();if(i&&i.rangeCount!==0){a=i.anchorNode;var u=i.anchorOffset,p=i.focusNode;i=i.focusOffset;try{a.nodeType,p.nodeType}catch{a=null;break e}var v=0,O=-1,F=-1,re=0,ue=0,fe=e,ne=null;t:for(;;){for(var ce;fe!==a||u!==0&&fe.nodeType!==3||(O=v+u),fe!==p||i!==0&&fe.nodeType!==3||(F=v+i),fe.nodeType===3&&(v+=fe.nodeValue.length),(ce=fe.firstChild)!==null;)ne=fe,fe=ce;for(;;){if(fe===e)break t;if(ne===a&&++re===u&&(O=v),ne===p&&++ue===i&&(F=v),(ce=fe.nextSibling)!==null)break;fe=ne,ne=fe.parentNode}fe=ce}a=O===-1||F===-1?null:{start:O,end:F}}else a=null}a=a||{start:0,end:0}}else a=null;for(xu={focusedElem:e,selectionRange:a},Fi=!1,It=r;It!==null;)if(r=It,e=r.child,(r.subtreeFlags&1028)!==0&&e!==null)e.return=r,It=e;else for(;It!==null;){switch(r=It,p=r.alternate,e=r.flags,r.tag){case 0:if((e&4)!==0&&(e=r.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)u=e[a],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&p!==null){e=void 0,a=r,u=p.memoizedProps,p=p.memoizedState,i=a.stateNode;try{var Ce=ka(a.type,u);e=i.getSnapshotBeforeUpdate(Ce,p),i.__reactInternalSnapshotBeforeUpdate=e}catch(Me){rt(a,a.return,Me)}}break;case 3:if((e&1024)!==0){if(e=r.stateNode.containerInfo,a=e.nodeType,a===9)vu(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":vu(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=r.sibling,e!==null){e.return=r.return,It=e;break}It=r.return}}function sf(e,r,a){var i=a.flags;switch(a.tag){case 0:case 11:case 15:ws(e,a),i&4&&sl(5,a);break;case 1:if(ws(e,a),i&4)if(e=a.stateNode,r===null)try{e.componentDidMount()}catch(v){rt(a,a.return,v)}else{var u=ka(a.type,r.memoizedProps);r=r.memoizedState;try{e.componentDidUpdate(u,r,e.__reactInternalSnapshotBeforeUpdate)}catch(v){rt(a,a.return,v)}}i&64&&Xp(a),i&512&&al(a,a.return);break;case 3:if(ws(e,a),i&64&&(e=a.updateQueue,e!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{Fm(e,r)}catch(v){rt(a,a.return,v)}}break;case 27:r===null&&i&4&&tf(a);case 26:case 5:ws(e,a),r===null&&i&4&&Wp(a),i&512&&al(a,a.return);break;case 12:ws(e,a);break;case 31:ws(e,a),i&4&&lf(e,a);break;case 13:ws(e,a),i&4&&of(e,a),i&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Ey.bind(null,a),Yy(e,a))));break;case 22:if(i=a.memoizedState!==null||bs,!i){r=r!==null&&r.memoizedState!==null||Ot,u=bs;var p=Ot;bs=i,(Ot=r)&&!p?js(e,a,(a.subtreeFlags&8772)!==0):ws(e,a),bs=u,Ot=p}break;case 30:break;default:ws(e,a)}}function af(e){var r=e.alternate;r!==null&&(e.alternate=null,af(r)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(r=e.stateNode,r!==null&&ko(r)),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 vt=null,ir=!1;function vs(e,r,a){for(a=a.child;a!==null;)nf(e,r,a),a=a.sibling}function nf(e,r,a){if(ot&&typeof ot.onCommitFiberUnmount=="function")try{ot.onCommitFiberUnmount(Gt,a)}catch{}switch(a.tag){case 26:Ot||Xr(a,r),vs(e,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ot||Xr(a,r);var i=vt,u=ir;Ws(a.type)&&(vt=a.stateNode,ir=!1),vs(e,r,a),pl(a.stateNode),vt=i,ir=u;break;case 5:Ot||Xr(a,r);case 6:if(i=vt,u=ir,vt=null,vs(e,r,a),vt=i,ir=u,vt!==null)if(ir)try{(vt.nodeType===9?vt.body:vt.nodeName==="HTML"?vt.ownerDocument.body:vt).removeChild(a.stateNode)}catch(p){rt(a,r,p)}else try{vt.removeChild(a.stateNode)}catch(p){rt(a,r,p)}break;case 18:vt!==null&&(ir?(e=vt,Zf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),gn(e)):Zf(vt,a.stateNode));break;case 4:i=vt,u=ir,vt=a.stateNode.containerInfo,ir=!0,vs(e,r,a),vt=i,ir=u;break;case 0:case 11:case 14:case 15:Vs(2,a,r),Ot||Vs(4,a,r),vs(e,r,a);break;case 1:Ot||(Xr(a,r),i=a.stateNode,typeof i.componentWillUnmount=="function"&&Zp(a,r,i)),vs(e,r,a);break;case 21:vs(e,r,a);break;case 22:Ot=(i=Ot)||a.memoizedState!==null,vs(e,r,a),Ot=i;break;default:vs(e,r,a)}}function lf(e,r){if(r.memoizedState===null&&(e=r.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{gn(e)}catch(a){rt(r,r.return,a)}}}function of(e,r){if(r.memoizedState===null&&(e=r.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{gn(e)}catch(a){rt(r,r.return,a)}}function vy(e){switch(e.tag){case 31:case 13:case 19:var r=e.stateNode;return r===null&&(r=e.stateNode=new rf),r;case 22:return e=e.stateNode,r=e._retryCache,r===null&&(r=e._retryCache=new rf),r;default:throw Error(o(435,e.tag))}}function wi(e,r){var a=vy(e);r.forEach(function(i){if(!a.has(i)){a.add(i);var u=Ry.bind(null,e,i);i.then(u,u)}})}function or(e,r){var a=r.deletions;if(a!==null)for(var i=0;i<a.length;i++){var u=a[i],p=e,v=r,O=v;e:for(;O!==null;){switch(O.tag){case 27:if(Ws(O.type)){vt=O.stateNode,ir=!1;break e}break;case 5:vt=O.stateNode,ir=!1;break e;case 3:case 4:vt=O.stateNode.containerInfo,ir=!0;break e}O=O.return}if(vt===null)throw Error(o(160));nf(p,v,u),vt=null,ir=!1,p=u.alternate,p!==null&&(p.return=null),u.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)cf(r,e),r=r.sibling}var Fr=null;function cf(e,r){var a=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:or(r,e),cr(e),i&4&&(Vs(3,e,e.return),sl(3,e),Vs(5,e,e.return));break;case 1:or(r,e),cr(e),i&512&&(Ot||a===null||Xr(a,a.return)),i&64&&bs&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?i:a.concat(i))));break;case 26:var u=Fr;if(or(r,e),cr(e),i&512&&(Ot||a===null||Xr(a,a.return)),i&4){var p=a!==null?a.memoizedState:null;if(i=e.memoizedState,a===null)if(i===null)if(e.stateNode===null){e:{i=e.type,a=e.memoizedProps,u=u.ownerDocument||u;t:switch(i){case"title":p=u.getElementsByTagName("title")[0],(!p||p[Dt]||p[dt]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=u.createElement(i),u.head.insertBefore(p,u.querySelector("head > title"))),Yt(p,i,a),p[dt]=e,Bt(p),i=p;break e;case"link":var v=cg("link","href",u).get(i+(a.href||""));if(v){for(var O=0;O<v.length;O++)if(p=v[O],p.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&p.getAttribute("rel")===(a.rel==null?null:a.rel)&&p.getAttribute("title")===(a.title==null?null:a.title)&&p.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){v.splice(O,1);break t}}p=u.createElement(i),Yt(p,i,a),u.head.appendChild(p);break;case"meta":if(v=cg("meta","content",u).get(i+(a.content||""))){for(O=0;O<v.length;O++)if(p=v[O],p.getAttribute("content")===(a.content==null?null:""+a.content)&&p.getAttribute("name")===(a.name==null?null:a.name)&&p.getAttribute("property")===(a.property==null?null:a.property)&&p.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&p.getAttribute("charset")===(a.charSet==null?null:a.charSet)){v.splice(O,1);break t}}p=u.createElement(i),Yt(p,i,a),u.head.appendChild(p);break;default:throw Error(o(468,i))}p[dt]=e,Bt(p),i=p}e.stateNode=i}else ug(u,e.type,e.stateNode);else e.stateNode=og(u,i,e.memoizedProps);else p!==i?(p===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):p.count--,i===null?ug(u,e.type,e.stateNode):og(u,i,e.memoizedProps)):i===null&&e.stateNode!==null&&Vc(e,e.memoizedProps,a.memoizedProps)}break;case 27:or(r,e),cr(e),i&512&&(Ot||a===null||Xr(a,a.return)),a!==null&&i&4&&Vc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(or(r,e),cr(e),i&512&&(Ot||a===null||Xr(a,a.return)),e.flags&32){u=e.stateNode;try{Ua(u,"")}catch(Ce){rt(e,e.return,Ce)}}i&4&&e.stateNode!=null&&(u=e.memoizedProps,Vc(e,u,a!==null?a.memoizedProps:u)),i&1024&&(Jc=!0);break;case 6:if(or(r,e),cr(e),i&4){if(e.stateNode===null)throw Error(o(162));i=e.memoizedProps,a=e.stateNode;try{a.nodeValue=i}catch(Ce){rt(e,e.return,Ce)}}break;case 3:if(Ui=null,u=Fr,Fr=Di(r.containerInfo),or(r,e),Fr=u,cr(e),i&4&&a!==null&&a.memoizedState.isDehydrated)try{gn(r.containerInfo)}catch(Ce){rt(e,e.return,Ce)}Jc&&(Jc=!1,uf(e));break;case 4:i=Fr,Fr=Di(e.stateNode.containerInfo),or(r,e),cr(e),Fr=i;break;case 12:or(r,e),cr(e);break;case 31:or(r,e),cr(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,wi(e,i)));break;case 13:or(r,e),cr(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Si=gt()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,wi(e,i)));break;case 22:u=e.memoizedState!==null;var F=a!==null&&a.memoizedState!==null,re=bs,ue=Ot;if(bs=re||u,Ot=ue||F,or(r,e),Ot=ue,bs=re,cr(e),i&8192)e:for(r=e.stateNode,r._visibility=u?r._visibility&-2:r._visibility|1,u&&(a===null||F||bs||Ot||Ca(e)),a=null,r=e;;){if(r.tag===5||r.tag===26){if(a===null){F=a=r;try{if(p=F.stateNode,u)v=p.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{O=F.stateNode;var fe=F.memoizedProps.style,ne=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;O.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Ce){rt(F,F.return,Ce)}}}else if(r.tag===6){if(a===null){F=r;try{F.stateNode.nodeValue=u?"":F.memoizedProps}catch(Ce){rt(F,F.return,Ce)}}}else if(r.tag===18){if(a===null){F=r;try{var ce=F.stateNode;u?Wf(ce,!0):Wf(F.stateNode,!1)}catch(Ce){rt(F,F.return,Ce)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===e)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break e;for(;r.sibling===null;){if(r.return===null||r.return===e)break e;a===r&&(a=null),r=r.return}a===r&&(a=null),r.sibling.return=r.return,r=r.sibling}i&4&&(i=e.updateQueue,i!==null&&(a=i.retryQueue,a!==null&&(i.retryQueue=null,wi(e,a))));break;case 19:or(r,e),cr(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,wi(e,i)));break;case 30:break;case 21:break;default:or(r,e),cr(e)}}function cr(e){var r=e.flags;if(r&2){try{for(var a,i=e.return;i!==null;){if(ef(i)){a=i;break}i=i.return}if(a==null)throw Error(o(160));switch(a.tag){case 27:var u=a.stateNode,p=$c(e);vi(e,p,u);break;case 5:var v=a.stateNode;a.flags&32&&(Ua(v,""),a.flags&=-33);var O=$c(e);vi(e,O,v);break;case 3:case 4:var F=a.stateNode.containerInfo,re=$c(e);Yc(e,re,F);break;default:throw Error(o(161))}}catch(ue){rt(e,e.return,ue)}e.flags&=-3}r&4096&&(e.flags&=-4097)}function uf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var r=e;uf(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),e=e.sibling}}function ws(e,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)sf(e,r.alternate,r),r=r.sibling}function Ca(e){for(e=e.child;e!==null;){var r=e;switch(r.tag){case 0:case 11:case 14:case 15:Vs(4,r,r.return),Ca(r);break;case 1:Xr(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&Zp(r,r.return,a),Ca(r);break;case 27:pl(r.stateNode);case 26:case 5:Xr(r,r.return),Ca(r);break;case 22:r.memoizedState===null&&Ca(r);break;case 30:Ca(r);break;default:Ca(r)}e=e.sibling}}function js(e,r,a){for(a=a&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var i=r.alternate,u=e,p=r,v=p.flags;switch(p.tag){case 0:case 11:case 15:js(u,p,a),sl(4,p);break;case 1:if(js(u,p,a),i=p,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(re){rt(i,i.return,re)}if(i=p,u=i.updateQueue,u!==null){var O=i.stateNode;try{var F=u.shared.hiddenCallbacks;if(F!==null)for(u.shared.hiddenCallbacks=null,u=0;u<F.length;u++)Im(F[u],O)}catch(re){rt(i,i.return,re)}}a&&v&64&&Xp(p),al(p,p.return);break;case 27:tf(p);case 26:case 5:js(u,p,a),a&&i===null&&v&4&&Wp(p),al(p,p.return);break;case 12:js(u,p,a);break;case 31:js(u,p,a),a&&v&4&&lf(u,p);break;case 13:js(u,p,a),a&&v&4&&of(u,p);break;case 22:p.memoizedState===null&&js(u,p,a),al(p,p.return);break;case 30:break;default:js(u,p,a)}r=r.sibling}}function Qc(e,r){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(e=r.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Gn(a))}function Xc(e,r){e=null,r.alternate!==null&&(e=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==e&&(r.refCount++,e!=null&&Gn(e))}function Hr(e,r,a,i){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)df(e,r,a,i),r=r.sibling}function df(e,r,a,i){var u=r.flags;switch(r.tag){case 0:case 11:case 15:Hr(e,r,a,i),u&2048&&sl(9,r);break;case 1:Hr(e,r,a,i);break;case 3:Hr(e,r,a,i),u&2048&&(e=null,r.alternate!==null&&(e=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==e&&(r.refCount++,e!=null&&Gn(e)));break;case 12:if(u&2048){Hr(e,r,a,i),e=r.stateNode;try{var p=r.memoizedProps,v=p.id,O=p.onPostCommit;typeof O=="function"&&O(v,r.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(F){rt(r,r.return,F)}}else Hr(e,r,a,i);break;case 31:Hr(e,r,a,i);break;case 13:Hr(e,r,a,i);break;case 23:break;case 22:p=r.stateNode,v=r.alternate,r.memoizedState!==null?p._visibility&2?Hr(e,r,a,i):nl(e,r):p._visibility&2?Hr(e,r,a,i):(p._visibility|=2,sn(e,r,a,i,(r.subtreeFlags&10256)!==0||!1)),u&2048&&Qc(v,r);break;case 24:Hr(e,r,a,i),u&2048&&Xc(r.alternate,r);break;default:Hr(e,r,a,i)}}function sn(e,r,a,i,u){for(u=u&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var p=e,v=r,O=a,F=i,re=v.flags;switch(v.tag){case 0:case 11:case 15:sn(p,v,O,F,u),sl(8,v);break;case 23:break;case 22:var ue=v.stateNode;v.memoizedState!==null?ue._visibility&2?sn(p,v,O,F,u):nl(p,v):(ue._visibility|=2,sn(p,v,O,F,u)),u&&re&2048&&Qc(v.alternate,v);break;case 24:sn(p,v,O,F,u),u&&re&2048&&Xc(v.alternate,v);break;default:sn(p,v,O,F,u)}r=r.sibling}}function nl(e,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=e,i=r,u=i.flags;switch(i.tag){case 22:nl(a,i),u&2048&&Qc(i.alternate,i);break;case 24:nl(a,i),u&2048&&Xc(i.alternate,i);break;default:nl(a,i)}r=r.sibling}}var ll=8192;function an(e,r,a){if(e.subtreeFlags&ll)for(e=e.child;e!==null;)mf(e,r,a),e=e.sibling}function mf(e,r,a){switch(e.tag){case 26:an(e,r,a),e.flags&ll&&e.memoizedState!==null&&lb(a,Fr,e.memoizedState,e.memoizedProps);break;case 5:an(e,r,a);break;case 3:case 4:var i=Fr;Fr=Di(e.stateNode.containerInfo),an(e,r,a),Fr=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=ll,ll=16777216,an(e,r,a),ll=i):an(e,r,a));break;default:an(e,r,a)}}function pf(e){var r=e.alternate;if(r!==null&&(e=r.child,e!==null)){r.child=null;do r=e.sibling,e.sibling=null,e=r;while(e!==null)}}function il(e){var r=e.deletions;if((e.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var i=r[a];It=i,gf(i,e)}pf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ff(e),e=e.sibling}function ff(e){switch(e.tag){case 0:case 11:case 15:il(e),e.flags&2048&&Vs(9,e,e.return);break;case 3:il(e);break;case 12:il(e);break;case 22:var r=e.stateNode;e.memoizedState!==null&&r._visibility&2&&(e.return===null||e.return.tag!==13)?(r._visibility&=-3,ji(e)):il(e);break;default:il(e)}}function ji(e){var r=e.deletions;if((e.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var i=r[a];It=i,gf(i,e)}pf(e)}for(e=e.child;e!==null;){switch(r=e,r.tag){case 0:case 11:case 15:Vs(8,r,r.return),ji(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,ji(r));break;default:ji(r)}e=e.sibling}}function gf(e,r){for(;It!==null;){var a=It;switch(a.tag){case 0:case 11:case 15:Vs(8,a,r);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var i=a.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Gn(a.memoizedState.cache)}if(i=a.child,i!==null)i.return=a,It=i;else e:for(a=e;It!==null;){i=It;var u=i.sibling,p=i.return;if(af(i),i===a){It=null;break e}if(u!==null){u.return=p,It=u;break e}It=p}}}var wy={getCacheForType:function(e){var r=Vt(Et),a=r.data.get(e);return a===void 0&&(a=e(),r.data.set(e,a)),a},cacheSignal:function(){return Vt(Et).controller.signal}},jy=typeof WeakMap=="function"?WeakMap:Map,Ze=0,ut=null,qe=null,Ke=0,tt=0,yr=null,$s=!1,nn=!1,Zc=!1,Ss=0,Nt=0,Ys=0,Aa=0,Wc=0,br=0,ln=0,ol=null,ur=null,eu=!1,Si=0,hf=0,Ni=1/0,ki=null,Js=null,Lt=0,Qs=null,on=null,Ns=0,tu=0,ru=null,xf=null,cl=0,su=null;function vr(){return(Ze&2)!==0&&Ke!==0?Ke&-Ke:A.T!==null?cu():$r()}function yf(){if(br===0)if((Ke&536870912)===0||Ye){var e=sr;sr<<=1,(sr&3932160)===0&&(sr=262144),br=e}else br=536870912;return e=hr.current,e!==null&&(e.flags|=32),br}function dr(e,r,a){(e===ut&&(tt===2||tt===9)||e.cancelPendingCommit!==null)&&(cn(e,0),Xs(e,Ke,br,!1)),Je(e,a),((Ze&2)===0||e!==ut)&&(e===ut&&((Ze&2)===0&&(Aa|=a),Nt===4&&Xs(e,Ke,br,!1)),Zr(e))}function bf(e,r,a){if((Ze&6)!==0)throw Error(o(327));var i=!a&&(r&127)===0&&(r&e.expiredLanes)===0||Q(e,r),u=i?ky(e,r):nu(e,r,!0),p=i;do{if(u===0){nn&&!i&&Xs(e,r,0,!1);break}else{if(a=e.current.alternate,p&&!Sy(a)){u=nu(e,r,!1),p=!1;continue}if(u===2){if(p=r,e.errorRecoveryDisabledLanes&p)var v=0;else v=e.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){r=v;e:{var O=e;u=ol;var F=O.current.memoizedState.isDehydrated;if(F&&(cn(O,v).flags|=256),v=nu(O,v,!1),v!==2){if(Zc&&!F){O.errorRecoveryDisabledLanes|=p,Aa|=p,u=4;break e}p=ur,ur=u,p!==null&&(ur===null?ur=p:ur.push.apply(ur,p))}u=v}if(p=!1,u!==2)continue}}if(u===1){cn(e,0),Xs(e,r,0,!0);break}e:{switch(i=e,p=u,p){case 0:case 1:throw Error(o(345));case 4:if((r&4194048)!==r)break;case 6:Xs(i,r,br,!$s);break e;case 2:ur=null;break;case 3:case 5:break;default:throw Error(o(329))}if((r&62914560)===r&&(u=Si+300-gt(),10<u)){if(Xs(i,r,br,!$s),Br(i,0,!0)!==0)break e;Ns=r,i.timeoutHandle=Qf(vf.bind(null,i,a,ur,ki,eu,r,br,Aa,ln,$s,p,"Throttled",-0,0),u);break e}vf(i,a,ur,ki,eu,r,br,Aa,ln,$s,p,null,-0,0)}}break}while(!0);Zr(e)}function vf(e,r,a,i,u,p,v,O,F,re,ue,fe,ne,ce){if(e.timeoutHandle=-1,fe=r.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:cs},mf(r,p,fe);var Ce=(p&62914560)===p?Si-gt():(p&4194048)===p?hf-gt():0;if(Ce=ib(fe,Ce),Ce!==null){Ns=p,e.cancelPendingCommit=Ce(Ef.bind(null,e,r,p,a,i,u,v,O,F,ue,fe,null,ne,ce)),Xs(e,p,v,!re);return}}Ef(e,r,p,a,i,u,v,O,F)}function Sy(e){for(var r=e;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var i=0;i<a.length;i++){var u=a[i],p=u.getSnapshot;u=u.value;try{if(!fr(p(),u))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Xs(e,r,a,i){r&=~Wc,r&=~Aa,e.suspendedLanes|=r,e.pingedLanes&=~r,i&&(e.warmLanes|=r),i=e.expirationTimes;for(var u=r;0<u;){var p=31-bt(u),v=1<<p;i[p]=-1,u&=~v}a!==0&&pr(e,a,r)}function Ci(){return(Ze&6)===0?(ul(0),!1):!0}function au(){if(qe!==null){if(tt===0)var e=qe.return;else e=qe,ps=ya=null,vc(e),Za=null,Vn=0,e=qe;for(;e!==null;)Qp(e.alternate,e),e=e.return;qe=null}}function cn(e,r){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,qy(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Ns=0,au(),ut=e,qe=a=ds(e.current,null),Ke=r,tt=0,yr=null,$s=!1,nn=Q(e,r),Zc=!1,ln=br=Wc=Aa=Ys=Nt=0,ur=ol=null,eu=!1,(r&8)!==0&&(r|=r&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=r;0<i;){var u=31-bt(i),p=1<<u;r|=e[u],i&=~p}return Ss=r,$l(),a}function wf(e,r){_e=null,A.H=el,r===Xa||r===ti?(r=Lm(),tt=3):r===oc?(r=Lm(),tt=4):tt=r===Lc?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,yr=r,qe===null&&(Nt=1,gi(e,Er(r,e.current)))}function jf(){var e=hr.current;return e===null?!0:(Ke&4194048)===Ke?zr===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?e===zr:!1}function Sf(){var e=A.H;return A.H=el,e===null?el:e}function Nf(){var e=A.A;return A.A=wy,e}function Ai(){Nt=4,$s||(Ke&4194048)!==Ke&&hr.current!==null||(nn=!0),(Ys&134217727)===0&&(Aa&134217727)===0||ut===null||Xs(ut,Ke,br,!1)}function nu(e,r,a){var i=Ze;Ze|=2;var u=Sf(),p=Nf();(ut!==e||Ke!==r)&&(ki=null,cn(e,r)),r=!1;var v=Nt;e:do try{if(tt!==0&&qe!==null){var O=qe,F=yr;switch(tt){case 8:au(),v=6;break e;case 3:case 2:case 9:case 6:hr.current===null&&(r=!0);var re=tt;if(tt=0,yr=null,un(e,O,F,re),a&&nn){v=0;break e}break;default:re=tt,tt=0,yr=null,un(e,O,F,re)}}Ny(),v=Nt;break}catch(ue){wf(e,ue)}while(!0);return r&&e.shellSuspendCounter++,ps=ya=null,Ze=i,A.H=u,A.A=p,qe===null&&(ut=null,Ke=0,$l()),v}function Ny(){for(;qe!==null;)kf(qe)}function ky(e,r){var a=Ze;Ze|=2;var i=Sf(),u=Nf();ut!==e||Ke!==r?(ki=null,Ni=gt()+500,cn(e,r)):nn=Q(e,r);e:do try{if(tt!==0&&qe!==null){r=qe;var p=yr;t:switch(tt){case 1:tt=0,yr=null,un(e,r,p,1);break;case 2:case 9:if(Pm(p)){tt=0,yr=null,Cf(r);break}r=function(){tt!==2&&tt!==9||ut!==e||(tt=7),Zr(e)},p.then(r,r);break e;case 3:tt=7;break e;case 4:tt=5;break e;case 7:Pm(p)?(tt=0,yr=null,Cf(r)):(tt=0,yr=null,un(e,r,p,7));break;case 5:var v=null;switch(qe.tag){case 26:v=qe.memoizedState;case 5:case 27:var O=qe;if(v?dg(v):O.stateNode.complete){tt=0,yr=null;var F=O.sibling;if(F!==null)qe=F;else{var re=O.return;re!==null?(qe=re,Ei(re)):qe=null}break t}}tt=0,yr=null,un(e,r,p,5);break;case 6:tt=0,yr=null,un(e,r,p,6);break;case 8:au(),Nt=6;break e;default:throw Error(o(462))}}Cy();break}catch(ue){wf(e,ue)}while(!0);return ps=ya=null,A.H=i,A.A=u,Ze=a,qe!==null?0:(ut=null,Ke=0,$l(),Nt)}function Cy(){for(;qe!==null&&!Pt();)kf(qe)}function kf(e){var r=Yp(e.alternate,e,Ss);e.memoizedProps=e.pendingProps,r===null?Ei(e):qe=r}function Cf(e){var r=e,a=r.alternate;switch(r.tag){case 15:case 0:r=Hp(a,r,r.pendingProps,r.type,void 0,Ke);break;case 11:r=Hp(a,r,r.pendingProps,r.type.render,r.ref,Ke);break;case 5:vc(r);default:Qp(a,r),r=qe=Sm(r,Ss),r=Yp(a,r,Ss)}e.memoizedProps=e.pendingProps,r===null?Ei(e):qe=r}function un(e,r,a,i){ps=ya=null,vc(r),Za=null,Vn=0;var u=r.return;try{if(fy(e,u,r,a,Ke)){Nt=1,gi(e,Er(a,e.current)),qe=null;return}}catch(p){if(u!==null)throw qe=u,p;Nt=1,gi(e,Er(a,e.current)),qe=null;return}r.flags&32768?(Ye||i===1?e=!0:nn||(Ke&536870912)!==0?e=!1:($s=e=!0,(i===2||i===9||i===3||i===6)&&(i=hr.current,i!==null&&i.tag===13&&(i.flags|=16384))),Af(r,e)):Ei(r)}function Ei(e){var r=e;do{if((r.flags&32768)!==0){Af(r,$s);return}e=r.return;var a=xy(r.alternate,r,Ss);if(a!==null){qe=a;return}if(r=r.sibling,r!==null){qe=r;return}qe=r=e}while(r!==null);Nt===0&&(Nt=5)}function Af(e,r){do{var a=yy(e.alternate,e);if(a!==null){a.flags&=32767,qe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(e=e.sibling,e!==null)){qe=e;return}qe=e=a}while(e!==null);Nt=6,qe=null}function Ef(e,r,a,i,u,p,v,O,F){e.cancelPendingCommit=null;do Ri();while(Lt!==0);if((Ze&6)!==0)throw Error(o(327));if(r!==null){if(r===e.current)throw Error(o(177));if(p=r.lanes|r.childLanes,p|=$o,We(e,a,p,v,O,F),e===ut&&(qe=ut=null,Ke=0),on=r,Qs=e,Ns=a,tu=p,ru=u,xf=i,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Ty(ht,function(){return Mf(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||i){i=A.T,A.T=null,u=H.p,H.p=2,v=Ze,Ze|=4;try{by(e,r,a)}finally{Ze=v,H.p=u,A.T=i}}Lt=1,Rf(),Tf(),Of()}}function Rf(){if(Lt===1){Lt=0;var e=Qs,r=on,a=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||a){a=A.T,A.T=null;var i=H.p;H.p=2;var u=Ze;Ze|=4;try{cf(r,e);var p=xu,v=fm(e.containerInfo),O=p.focusedElem,F=p.selectionRange;if(v!==O&&O&&O.ownerDocument&&pm(O.ownerDocument.documentElement,O)){if(F!==null&&Ho(O)){var re=F.start,ue=F.end;if(ue===void 0&&(ue=re),"selectionStart"in O)O.selectionStart=re,O.selectionEnd=Math.min(ue,O.value.length);else{var fe=O.ownerDocument||document,ne=fe&&fe.defaultView||window;if(ne.getSelection){var ce=ne.getSelection(),Ce=O.textContent.length,Me=Math.min(F.start,Ce),lt=F.end===void 0?Me:Math.min(F.end,Ce);!ce.extend&&Me>lt&&(v=lt,lt=Me,Me=v);var W=mm(O,Me),$=mm(O,lt);if(W&&$&&(ce.rangeCount!==1||ce.anchorNode!==W.node||ce.anchorOffset!==W.offset||ce.focusNode!==$.node||ce.focusOffset!==$.offset)){var te=fe.createRange();te.setStart(W.node,W.offset),ce.removeAllRanges(),Me>lt?(ce.addRange(te),ce.extend($.node,$.offset)):(te.setEnd($.node,$.offset),ce.addRange(te))}}}}for(fe=[],ce=O;ce=ce.parentNode;)ce.nodeType===1&&fe.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<fe.length;O++){var pe=fe[O];pe.element.scrollLeft=pe.left,pe.element.scrollTop=pe.top}}Fi=!!hu,xu=hu=null}finally{Ze=u,H.p=i,A.T=a}}e.current=r,Lt=2}}function Tf(){if(Lt===2){Lt=0;var e=Qs,r=on,a=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||a){a=A.T,A.T=null;var i=H.p;H.p=2;var u=Ze;Ze|=4;try{sf(e,r.alternate,r)}finally{Ze=u,H.p=i,A.T=a}}Lt=3}}function Of(){if(Lt===4||Lt===3){Lt=0,Sr();var e=Qs,r=on,a=Ns,i=xf;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Lt=5:(Lt=0,on=Qs=null,zf(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Js=null),we(a),r=r.stateNode,ot&&typeof ot.onCommitFiberRoot=="function")try{ot.onCommitFiberRoot(Gt,r,void 0,(r.current.flags&128)===128)}catch{}if(i!==null){r=A.T,u=H.p,H.p=2,A.T=null;try{for(var p=e.onRecoverableError,v=0;v<i.length;v++){var O=i[v];p(O.value,{componentStack:O.stack})}}finally{A.T=r,H.p=u}}(Ns&3)!==0&&Ri(),Zr(e),u=e.pendingLanes,(a&261930)!==0&&(u&42)!==0?e===su?cl++:(cl=0,su=e):cl=0,ul(0)}}function zf(e,r){(e.pooledCacheLanes&=r)===0&&(r=e.pooledCache,r!=null&&(e.pooledCache=null,Gn(r)))}function Ri(){return Rf(),Tf(),Of(),Mf()}function Mf(){if(Lt!==5)return!1;var e=Qs,r=tu;tu=0;var a=we(Ns),i=A.T,u=H.p;try{H.p=32>a?32:a,A.T=null,a=ru,ru=null;var p=Qs,v=Ns;if(Lt=0,on=Qs=null,Ns=0,(Ze&6)!==0)throw Error(o(331));var O=Ze;if(Ze|=4,ff(p.current),df(p,p.current,v,a),Ze=O,ul(0,!1),ot&&typeof ot.onPostCommitFiberRoot=="function")try{ot.onPostCommitFiberRoot(Gt,p)}catch{}return!0}finally{H.p=u,A.T=i,zf(e,r)}}function Pf(e,r,a){r=Er(a,r),r=Dc(e.stateNode,r,2),e=qs(e,r,2),e!==null&&(Je(e,2),Zr(e))}function rt(e,r,a){if(e.tag===3)Pf(e,e,a);else for(;r!==null;){if(r.tag===3){Pf(r,e,a);break}else if(r.tag===1){var i=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Js===null||!Js.has(i))){e=Er(a,e),a=Pp(2),i=qs(r,a,2),i!==null&&(Dp(a,i,r,e),Je(i,2),Zr(i));break}}r=r.return}}function lu(e,r,a){var i=e.pingCache;if(i===null){i=e.pingCache=new jy;var u=new Set;i.set(r,u)}else u=i.get(r),u===void 0&&(u=new Set,i.set(r,u));u.has(a)||(Zc=!0,u.add(a),e=Ay.bind(null,e,r,a),r.then(e,e))}function Ay(e,r,a){var i=e.pingCache;i!==null&&i.delete(r),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,ut===e&&(Ke&a)===a&&(Nt===4||Nt===3&&(Ke&62914560)===Ke&&300>gt()-Si?(Ze&2)===0&&cn(e,0):Wc|=a,ln===Ke&&(ln=0)),Zr(e)}function Df(e,r){r===0&&(r=He()),e=ga(e,r),e!==null&&(Je(e,r),Zr(e))}function Ey(e){var r=e.memoizedState,a=0;r!==null&&(a=r.retryLane),Df(e,a)}function Ry(e,r){var a=0;switch(e.tag){case 31:case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(a=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(r),Df(e,a)}function Ty(e,r){return ft(e,r)}var Ti=null,dn=null,iu=!1,Oi=!1,ou=!1,Zs=0;function Zr(e){e!==dn&&e.next===null&&(dn===null?Ti=dn=e:dn=dn.next=e),Oi=!0,iu||(iu=!0,zy())}function ul(e,r){if(!ou&&Oi){ou=!0;do for(var a=!1,i=Ti;i!==null;){if(e!==0){var u=i.pendingLanes;if(u===0)var p=0;else{var v=i.suspendedLanes,O=i.pingedLanes;p=(1<<31-bt(42|e)+1)-1,p&=u&~(v&~O),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(a=!0,Bf(i,p))}else p=Ke,p=Br(i,i===ut?p:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(p&3)===0||Q(i,p)||(a=!0,Bf(i,p));i=i.next}while(a);ou=!1}}function Oy(){Lf()}function Lf(){Oi=iu=!1;var e=0;Zs!==0&&Hy()&&(e=Zs);for(var r=gt(),a=null,i=Ti;i!==null;){var u=i.next,p=Uf(i,r);p===0?(i.next=null,a===null?Ti=u:a.next=u,u===null&&(dn=a)):(a=i,(e!==0||(p&3)!==0)&&(Oi=!0)),i=u}Lt!==0&&Lt!==5||ul(e),Zs!==0&&(Zs=0)}function Uf(e,r){for(var a=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,p=e.pendingLanes&-62914561;0<p;){var v=31-bt(p),O=1<<v,F=u[v];F===-1?((O&a)===0||(O&i)!==0)&&(u[v]=je(O,r)):F<=r&&(e.expiredLanes|=O),p&=~O}if(r=ut,a=Ke,a=Br(e,e===r?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,a===0||e===r&&(tt===2||tt===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Mt(i),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Q(e,a)){if(r=a&-a,r===e.callbackPriority)return r;switch(i!==null&&Mt(i),we(a)){case 2:case 8:a=Qt;break;case 32:a=ht;break;case 268435456:a=Oe;break;default:a=ht}return i=_f.bind(null,e),a=ft(a,i),e.callbackPriority=r,e.callbackNode=a,r}return i!==null&&i!==null&&Mt(i),e.callbackPriority=2,e.callbackNode=null,2}function _f(e,r){if(Lt!==0&&Lt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Ri()&&e.callbackNode!==a)return null;var i=Ke;return i=Br(e,e===ut?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(bf(e,i,r),Uf(e,gt()),e.callbackNode!=null&&e.callbackNode===a?_f.bind(null,e):null)}function Bf(e,r){if(Ri())return null;bf(e,r,!0)}function zy(){Gy(function(){(Ze&6)!==0?ft(er,Oy):Lf()})}function cu(){if(Zs===0){var e=Ja;e===0&&(e=mr,mr<<=1,(mr&261888)===0&&(mr=256)),Zs=e}return Zs}function If(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Bl(""+e)}function Ff(e,r){var a=r.ownerDocument.createElement("input");return a.name=r.name,a.value=r.value,e.id&&a.setAttribute("form",e.id),r.parentNode.insertBefore(a,r),e=new FormData(e),a.parentNode.removeChild(a),e}function My(e,r,a,i,u){if(r==="submit"&&a&&a.stateNode===u){var p=If((u[Xt]||null).action),v=i.submitter;v&&(r=(r=v[Xt]||null)?If(r.formAction):v.getAttribute("formAction"),r!==null&&(p=r,v=null));var O=new ql("action","action",null,i,u);e.push({event:O,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Zs!==0){var F=v?Ff(u,v):new FormData(u);Rc(a,{pending:!0,data:F,method:u.method,action:p},null,F)}}else typeof p=="function"&&(O.preventDefault(),F=v?Ff(u,v):new FormData(u),Rc(a,{pending:!0,data:F,method:u.method,action:p},p,F))},currentTarget:u}]})}}for(var uu=0;uu<Vo.length;uu++){var du=Vo[uu],Py=du.toLowerCase(),Dy=du[0].toUpperCase()+du.slice(1);Ir(Py,"on"+Dy)}Ir(xm,"onAnimationEnd"),Ir(ym,"onAnimationIteration"),Ir(bm,"onAnimationStart"),Ir("dblclick","onDoubleClick"),Ir("focusin","onFocus"),Ir("focusout","onBlur"),Ir(Xx,"onTransitionRun"),Ir(Zx,"onTransitionStart"),Ir(Wx,"onTransitionCancel"),Ir(vm,"onTransitionEnd"),Da("onMouseEnter",["mouseout","mouseover"]),Da("onMouseLeave",["mouseout","mouseover"]),Da("onPointerEnter",["pointerout","pointerover"]),Da("onPointerLeave",["pointerout","pointerover"]),da("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),da("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),da("onBeforeInput",["compositionend","keypress","textInput","paste"]),da("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),da("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),da("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var dl="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(" "),Ly=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(dl));function Hf(e,r){r=(r&4)!==0;for(var a=0;a<e.length;a++){var i=e[a],u=i.event;i=i.listeners;e:{var p=void 0;if(r)for(var v=i.length-1;0<=v;v--){var O=i[v],F=O.instance,re=O.currentTarget;if(O=O.listener,F!==p&&u.isPropagationStopped())break e;p=O,u.currentTarget=re;try{p(u)}catch(ue){Vl(ue)}u.currentTarget=null,p=F}else for(v=0;v<i.length;v++){if(O=i[v],F=O.instance,re=O.currentTarget,O=O.listener,F!==p&&u.isPropagationStopped())break e;p=O,u.currentTarget=re;try{p(u)}catch(ue){Vl(ue)}u.currentTarget=null,p=F}}}}function Ge(e,r){var a=r[Pe];a===void 0&&(a=r[Pe]=new Set);var i=e+"__bubble";a.has(i)||(qf(r,e,2,!1),a.add(i))}function mu(e,r,a){var i=0;r&&(i|=4),qf(a,e,i,r)}var zi="_reactListening"+Math.random().toString(36).slice(2);function pu(e){if(!e[zi]){e[zi]=!0,Dd.forEach(function(a){a!=="selectionchange"&&(Ly.has(a)||mu(a,!1,e),mu(a,!0,e))});var r=e.nodeType===9?e:e.ownerDocument;r===null||r[zi]||(r[zi]=!0,mu("selectionchange",!1,r))}}function qf(e,r,a,i){switch(yg(r)){case 2:var u=ub;break;case 8:u=db;break;default:u=Eu}a=u.bind(null,r,a,e),u=void 0,!Mo||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(u=!0),i?u!==void 0?e.addEventListener(r,a,{capture:!0,passive:u}):e.addEventListener(r,a,!0):u!==void 0?e.addEventListener(r,a,{passive:u}):e.addEventListener(r,a,!1)}function fu(e,r,a,i,u){var p=i;if((r&1)===0&&(r&2)===0&&i!==null)e:for(;;){if(i===null)return;var v=i.tag;if(v===3||v===4){var O=i.stateNode.containerInfo;if(O===u)break;if(v===4)for(v=i.return;v!==null;){var F=v.tag;if((F===3||F===4)&&v.stateNode.containerInfo===u)return;v=v.return}for(;O!==null;){if(v=za(O),v===null)return;if(F=v.tag,F===5||F===6||F===26||F===27){i=p=v;continue e}O=O.parentNode}}i=i.return}$d(function(){var re=p,ue=Oo(a),fe=[];e:{var ne=wm.get(e);if(ne!==void 0){var ce=ql,Ce=e;switch(e){case"keypress":if(Fl(a)===0)break e;case"keydown":case"keyup":ce=Rx;break;case"focusin":Ce="focus",ce=Uo;break;case"focusout":Ce="blur",ce=Uo;break;case"beforeblur":case"afterblur":ce=Uo;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=Qd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=xx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=zx;break;case xm:case ym:case bm:ce=vx;break;case vm:ce=Px;break;case"scroll":case"scrollend":ce=gx;break;case"wheel":ce=Lx;break;case"copy":case"cut":case"paste":ce=jx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=Zd;break;case"toggle":case"beforetoggle":ce=_x}var Me=(r&4)!==0,lt=!Me&&(e==="scroll"||e==="scrollend"),W=Me?ne!==null?ne+"Capture":null:ne;Me=[];for(var $=re,te;$!==null;){var pe=$;if(te=pe.stateNode,pe=pe.tag,pe!==5&&pe!==26&&pe!==27||te===null||W===null||(pe=Mn($,W),pe!=null&&Me.push(ml($,pe,te))),lt)break;$=$.return}0<Me.length&&(ne=new ce(ne,Ce,null,a,ue),fe.push({event:ne,listeners:Me}))}}if((r&7)===0){e:{if(ne=e==="mouseover"||e==="pointerover",ce=e==="mouseout"||e==="pointerout",ne&&a!==To&&(Ce=a.relatedTarget||a.fromElement)&&(za(Ce)||Ce[nr]))break e;if((ce||ne)&&(ne=ue.window===ue?ue:(ne=ue.ownerDocument)?ne.defaultView||ne.parentWindow:window,ce?(Ce=a.relatedTarget||a.toElement,ce=re,Ce=Ce?za(Ce):null,Ce!==null&&(lt=d(Ce),Me=Ce.tag,Ce!==lt||Me!==5&&Me!==27&&Me!==6)&&(Ce=null)):(ce=null,Ce=re),ce!==Ce)){if(Me=Qd,pe="onMouseLeave",W="onMouseEnter",$="mouse",(e==="pointerout"||e==="pointerover")&&(Me=Zd,pe="onPointerLeave",W="onPointerEnter",$="pointer"),lt=ce==null?ne:zn(ce),te=Ce==null?ne:zn(Ce),ne=new Me(pe,$+"leave",ce,a,ue),ne.target=lt,ne.relatedTarget=te,pe=null,za(ue)===re&&(Me=new Me(W,$+"enter",Ce,a,ue),Me.target=te,Me.relatedTarget=lt,pe=Me),lt=pe,ce&&Ce)t:{for(Me=Uy,W=ce,$=Ce,te=0,pe=W;pe;pe=Me(pe))te++;pe=0;for(var ze=$;ze;ze=Me(ze))pe++;for(;0<te-pe;)W=Me(W),te--;for(;0<pe-te;)$=Me($),pe--;for(;te--;){if(W===$||$!==null&&W===$.alternate){Me=W;break t}W=Me(W),$=Me($)}Me=null}else Me=null;ce!==null&&Gf(fe,ne,ce,Me,!1),Ce!==null&&lt!==null&&Gf(fe,lt,Ce,Me,!0)}}e:{if(ne=re?zn(re):window,ce=ne.nodeName&&ne.nodeName.toLowerCase(),ce==="select"||ce==="input"&&ne.type==="file")var Qe=lm;else if(am(ne))if(im)Qe=Yx;else{Qe=Vx;var Te=Kx}else ce=ne.nodeName,!ce||ce.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?re&&Ro(re.elementType)&&(Qe=lm):Qe=$x;if(Qe&&(Qe=Qe(e,re))){nm(fe,Qe,a,ue);break e}Te&&Te(e,ne,re),e==="focusout"&&re&&ne.type==="number"&&re.memoizedProps.value!=null&&Eo(ne,"number",ne.value)}switch(Te=re?zn(re):window,e){case"focusin":(am(Te)||Te.contentEditable==="true")&&(Fa=Te,qo=re,Fn=null);break;case"focusout":Fn=qo=Fa=null;break;case"mousedown":Go=!0;break;case"contextmenu":case"mouseup":case"dragend":Go=!1,gm(fe,a,ue);break;case"selectionchange":if(Qx)break;case"keydown":case"keyup":gm(fe,a,ue)}var Ie;if(Bo)e:{switch(e){case"compositionstart":var Ve="onCompositionStart";break e;case"compositionend":Ve="onCompositionEnd";break e;case"compositionupdate":Ve="onCompositionUpdate";break e}Ve=void 0}else Ia?rm(e,a)&&(Ve="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ve="onCompositionStart");Ve&&(Wd&&a.locale!=="ko"&&(Ia||Ve!=="onCompositionStart"?Ve==="onCompositionEnd"&&Ia&&(Ie=Yd()):(Ls=ue,Po="value"in Ls?Ls.value:Ls.textContent,Ia=!0)),Te=Mi(re,Ve),0<Te.length&&(Ve=new Xd(Ve,e,null,a,ue),fe.push({event:Ve,listeners:Te}),Ie?Ve.data=Ie:(Ie=sm(a),Ie!==null&&(Ve.data=Ie)))),(Ie=Ix?Fx(e,a):Hx(e,a))&&(Ve=Mi(re,"onBeforeInput"),0<Ve.length&&(Te=new Xd("onBeforeInput","beforeinput",null,a,ue),fe.push({event:Te,listeners:Ve}),Te.data=Ie)),My(fe,e,re,a,ue)}Hf(fe,r)})}function ml(e,r,a){return{instance:e,listener:r,currentTarget:a}}function Mi(e,r){for(var a=r+"Capture",i=[];e!==null;){var u=e,p=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||p===null||(u=Mn(e,a),u!=null&&i.unshift(ml(e,u,p)),u=Mn(e,r),u!=null&&i.push(ml(e,u,p))),e.tag===3)return i;e=e.return}return[]}function Uy(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Gf(e,r,a,i,u){for(var p=r._reactName,v=[];a!==null&&a!==i;){var O=a,F=O.alternate,re=O.stateNode;if(O=O.tag,F!==null&&F===i)break;O!==5&&O!==26&&O!==27||re===null||(F=re,u?(re=Mn(a,p),re!=null&&v.unshift(ml(a,re,F))):u||(re=Mn(a,p),re!=null&&v.push(ml(a,re,F)))),a=a.return}v.length!==0&&e.push({event:r,listeners:v})}var _y=/\r\n?/g,By=/\u0000|\uFFFD/g;function Kf(e){return(typeof e=="string"?e:""+e).replace(_y,`
49
- `).replace(By,"")}function Vf(e,r){return r=Kf(r),Kf(e)===r}function nt(e,r,a,i,u,p){switch(a){case"children":typeof i=="string"?r==="body"||r==="textarea"&&i===""||Ua(e,i):(typeof i=="number"||typeof i=="bigint")&&r!=="body"&&Ua(e,""+i);break;case"className":Ul(e,"class",i);break;case"tabIndex":Ul(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Ul(e,a,i);break;case"style":Kd(e,i,p);break;case"data":if(r!=="object"){Ul(e,"data",i);break}case"src":case"href":if(i===""&&(r!=="a"||a!=="href")){e.removeAttribute(a);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(a);break}i=Bl(""+i),e.setAttribute(a,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(a,"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 p=="function"&&(a==="formAction"?(r!=="input"&&nt(e,r,"name",u.name,u,null),nt(e,r,"formEncType",u.formEncType,u,null),nt(e,r,"formMethod",u.formMethod,u,null),nt(e,r,"formTarget",u.formTarget,u,null)):(nt(e,r,"encType",u.encType,u,null),nt(e,r,"method",u.method,u,null),nt(e,r,"target",u.target,u,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(a);break}i=Bl(""+i),e.setAttribute(a,i);break;case"onClick":i!=null&&(e.onclick=cs);break;case"onScroll":i!=null&&Ge("scroll",e);break;case"onScrollEnd":i!=null&&Ge("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(a=i.__html,a!=null){if(u.children!=null)throw Error(o(60));e.innerHTML=a}}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}a=Bl(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);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(a,""+i):e.removeAttribute(a);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(a,""):e.removeAttribute(a);break;case"capture":case"download":i===!0?e.setAttribute(a,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(a,i):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(a,i):e.removeAttribute(a);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(a):e.setAttribute(a,i);break;case"popover":Ge("beforetoggle",e),Ge("toggle",e),Ll(e,"popover",i);break;case"xlinkActuate":os(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":os(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":os(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":os(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":os(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":os(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":os(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":os(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":os(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Ll(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=px.get(a)||a,Ll(e,a,i))}}function gu(e,r,a,i,u,p){switch(a){case"style":Kd(e,i,p);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(o(61));if(a=i.__html,a!=null){if(u.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"children":typeof i=="string"?Ua(e,i):(typeof i=="number"||typeof i=="bigint")&&Ua(e,""+i);break;case"onScroll":i!=null&&Ge("scroll",e);break;case"onScrollEnd":i!=null&&Ge("scrollend",e);break;case"onClick":i!=null&&(e.onclick=cs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ld.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(u=a.endsWith("Capture"),r=a.slice(2,u?a.length-7:void 0),p=e[Xt]||null,p=p!=null?p[a]:null,typeof p=="function"&&e.removeEventListener(r,p,u),typeof i=="function")){typeof p!="function"&&p!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(r,i,u);break e}a in e?e[a]=i:i===!0?e.setAttribute(a,""):Ll(e,a,i)}}}function Yt(e,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ge("error",e),Ge("load",e);var i=!1,u=!1,p;for(p in a)if(a.hasOwnProperty(p)){var v=a[p];if(v!=null)switch(p){case"src":i=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,r));default:nt(e,r,p,v,a,null)}}u&&nt(e,r,"srcSet",a.srcSet,a,null),i&&nt(e,r,"src",a.src,a,null);return;case"input":Ge("invalid",e);var O=p=v=u=null,F=null,re=null;for(i in a)if(a.hasOwnProperty(i)){var ue=a[i];if(ue!=null)switch(i){case"name":u=ue;break;case"type":v=ue;break;case"checked":F=ue;break;case"defaultChecked":re=ue;break;case"value":p=ue;break;case"defaultValue":O=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(o(137,r));break;default:nt(e,r,i,ue,a,null)}}Fd(e,p,O,F,re,v,u,!1);return;case"select":Ge("invalid",e),i=v=p=null;for(u in a)if(a.hasOwnProperty(u)&&(O=a[u],O!=null))switch(u){case"value":p=O;break;case"defaultValue":v=O;break;case"multiple":i=O;default:nt(e,r,u,O,a,null)}r=p,a=v,e.multiple=!!i,r!=null?La(e,!!i,r,!1):a!=null&&La(e,!!i,a,!0);return;case"textarea":Ge("invalid",e),p=u=i=null;for(v in a)if(a.hasOwnProperty(v)&&(O=a[v],O!=null))switch(v){case"value":i=O;break;case"defaultValue":u=O;break;case"children":p=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(o(91));break;default:nt(e,r,v,O,a,null)}qd(e,i,u,p);return;case"option":for(F in a)if(a.hasOwnProperty(F)&&(i=a[F],i!=null))switch(F){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:nt(e,r,F,i,a,null)}return;case"dialog":Ge("beforetoggle",e),Ge("toggle",e),Ge("cancel",e),Ge("close",e);break;case"iframe":case"object":Ge("load",e);break;case"video":case"audio":for(i=0;i<dl.length;i++)Ge(dl[i],e);break;case"image":Ge("error",e),Ge("load",e);break;case"details":Ge("toggle",e);break;case"embed":case"source":case"link":Ge("error",e),Ge("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 a)if(a.hasOwnProperty(re)&&(i=a[re],i!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,r));default:nt(e,r,re,i,a,null)}return;default:if(Ro(r)){for(ue in a)a.hasOwnProperty(ue)&&(i=a[ue],i!==void 0&&gu(e,r,ue,i,a,void 0));return}}for(O in a)a.hasOwnProperty(O)&&(i=a[O],i!=null&&nt(e,r,O,i,a,null))}function Iy(e,r,a,i){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,p=null,v=null,O=null,F=null,re=null,ue=null;for(ce in a){var fe=a[ce];if(a.hasOwnProperty(ce)&&fe!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":F=fe;default:i.hasOwnProperty(ce)||nt(e,r,ce,null,i,fe)}}for(var ne in i){var ce=i[ne];if(fe=a[ne],i.hasOwnProperty(ne)&&(ce!=null||fe!=null))switch(ne){case"type":p=ce;break;case"name":u=ce;break;case"checked":re=ce;break;case"defaultChecked":ue=ce;break;case"value":v=ce;break;case"defaultValue":O=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(o(137,r));break;default:ce!==fe&&nt(e,r,ne,ce,i,fe)}}Ao(e,v,O,F,re,ue,p,u);return;case"select":ce=v=O=ne=null;for(p in a)if(F=a[p],a.hasOwnProperty(p)&&F!=null)switch(p){case"value":break;case"multiple":ce=F;default:i.hasOwnProperty(p)||nt(e,r,p,null,i,F)}for(u in i)if(p=i[u],F=a[u],i.hasOwnProperty(u)&&(p!=null||F!=null))switch(u){case"value":ne=p;break;case"defaultValue":O=p;break;case"multiple":v=p;default:p!==F&&nt(e,r,u,p,i,F)}r=O,a=v,i=ce,ne!=null?La(e,!!a,ne,!1):!!i!=!!a&&(r!=null?La(e,!!a,r,!0):La(e,!!a,a?[]:"",!1));return;case"textarea":ce=ne=null;for(O in a)if(u=a[O],a.hasOwnProperty(O)&&u!=null&&!i.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:nt(e,r,O,null,i,u)}for(v in i)if(u=i[v],p=a[v],i.hasOwnProperty(v)&&(u!=null||p!=null))switch(v){case"value":ne=u;break;case"defaultValue":ce=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(o(91));break;default:u!==p&&nt(e,r,v,u,i,p)}Hd(e,ne,ce);return;case"option":for(var Ce in a)if(ne=a[Ce],a.hasOwnProperty(Ce)&&ne!=null&&!i.hasOwnProperty(Ce))switch(Ce){case"selected":e.selected=!1;break;default:nt(e,r,Ce,null,i,ne)}for(F in i)if(ne=i[F],ce=a[F],i.hasOwnProperty(F)&&ne!==ce&&(ne!=null||ce!=null))switch(F){case"selected":e.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:nt(e,r,F,ne,i,ce)}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 Me in a)ne=a[Me],a.hasOwnProperty(Me)&&ne!=null&&!i.hasOwnProperty(Me)&&nt(e,r,Me,null,i,ne);for(re in i)if(ne=i[re],ce=a[re],i.hasOwnProperty(re)&&ne!==ce&&(ne!=null||ce!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(o(137,r));break;default:nt(e,r,re,ne,i,ce)}return;default:if(Ro(r)){for(var lt in a)ne=a[lt],a.hasOwnProperty(lt)&&ne!==void 0&&!i.hasOwnProperty(lt)&&gu(e,r,lt,void 0,i,ne);for(ue in i)ne=i[ue],ce=a[ue],!i.hasOwnProperty(ue)||ne===ce||ne===void 0&&ce===void 0||gu(e,r,ue,ne,i,ce);return}}for(var W in a)ne=a[W],a.hasOwnProperty(W)&&ne!=null&&!i.hasOwnProperty(W)&&nt(e,r,W,null,i,ne);for(fe in i)ne=i[fe],ce=a[fe],!i.hasOwnProperty(fe)||ne===ce||ne==null&&ce==null||nt(e,r,fe,ne,i,ce)}function $f(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Fy(){if(typeof performance.getEntriesByType=="function"){for(var e=0,r=0,a=performance.getEntriesByType("resource"),i=0;i<a.length;i++){var u=a[i],p=u.transferSize,v=u.initiatorType,O=u.duration;if(p&&O&&$f(v)){for(v=0,O=u.responseEnd,i+=1;i<a.length;i++){var F=a[i],re=F.startTime;if(re>O)break;var ue=F.transferSize,fe=F.initiatorType;ue&&$f(fe)&&(F=F.responseEnd,v+=ue*(F<O?1:(O-re)/(F-re)))}if(--i,r+=8*(p+v)/(u.duration/1e3),e++,10<e)break}}if(0<e)return r/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var hu=null,xu=null;function Pi(e){return e.nodeType===9?e:e.ownerDocument}function Yf(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 Jf(e,r){if(e===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&r==="foreignObject"?0:e}function yu(e,r){return e==="textarea"||e==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var bu=null;function Hy(){var e=window.event;return e&&e.type==="popstate"?e===bu?!1:(bu=e,!0):(bu=null,!1)}var Qf=typeof setTimeout=="function"?setTimeout:void 0,qy=typeof clearTimeout=="function"?clearTimeout:void 0,Xf=typeof Promise=="function"?Promise:void 0,Gy=typeof queueMicrotask=="function"?queueMicrotask:typeof Xf<"u"?function(e){return Xf.resolve(null).then(e).catch(Ky)}:Qf;function Ky(e){setTimeout(function(){throw e})}function Ws(e){return e==="head"}function Zf(e,r){var a=r,i=0;do{var u=a.nextSibling;if(e.removeChild(a),u&&u.nodeType===8)if(a=u.data,a==="/$"||a==="/&"){if(i===0){e.removeChild(u),gn(r);return}i--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")i++;else if(a==="html")pl(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,pl(a);for(var p=a.firstChild;p;){var v=p.nextSibling,O=p.nodeName;p[Dt]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&p.rel.toLowerCase()==="stylesheet"||a.removeChild(p),p=v}}else a==="body"&&pl(e.ownerDocument.body);a=u}while(a);gn(r)}function Wf(e,r){var a=e;e=0;do{var i=a.nextSibling;if(a.nodeType===1?r?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(r?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),i&&i.nodeType===8)if(a=i.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=i}while(a)}function vu(e){var r=e.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":vu(a),ko(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Vy(e,r,a,i){for(;e.nodeType===1;){var u=a;if(e.nodeName.toLowerCase()!==r.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Dt])switch(r){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(p=e.getAttribute("rel"),p==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(p!==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(p=e.getAttribute("src"),(p!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&p&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(r==="input"&&e.type==="hidden"){var p=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===p)return e}else return e;if(e=Mr(e.nextSibling),e===null)break}return null}function $y(e,r,a){if(r==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Mr(e.nextSibling),e===null))return null;return e}function eg(e,r){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=Mr(e.nextSibling),e===null))return null;return e}function wu(e){return e.data==="$?"||e.data==="$~"}function ju(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Yy(e,r){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=r;else if(e.data!=="$?"||a.readyState!=="loading")r();else{var i=function(){r(),a.removeEventListener("DOMContentLoaded",i)};a.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function Mr(e){for(;e!=null;e=e.nextSibling){var r=e.nodeType;if(r===1||r===3)break;if(r===8){if(r=e.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return e}var Su=null;function tg(e){e=e.nextSibling;for(var r=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(r===0)return Mr(e.nextSibling);r--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||r++}e=e.nextSibling}return null}function rg(e){e=e.previousSibling;for(var r=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(r===0)return e;r--}else a!=="/$"&&a!=="/&"||r++}e=e.previousSibling}return null}function sg(e,r,a){switch(r=Pi(a),e){case"html":if(e=r.documentElement,!e)throw Error(o(452));return e;case"head":if(e=r.head,!e)throw Error(o(453));return e;case"body":if(e=r.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function pl(e){for(var r=e.attributes;r.length;)e.removeAttributeNode(r[0]);ko(e)}var Pr=new Map,ag=new Set;function Di(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ks=H.d;H.d={f:Jy,r:Qy,D:Xy,C:Zy,L:Wy,m:eb,X:rb,S:tb,M:sb};function Jy(){var e=ks.f(),r=Ci();return e||r}function Qy(e){var r=Ma(e);r!==null&&r.tag===5&&r.type==="form"?vp(r):ks.r(e)}var mn=typeof document>"u"?null:document;function ng(e,r,a){var i=mn;if(i&&typeof r=="string"&&r){var u=Cr(r);u='link[rel="'+e+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),ag.has(u)||(ag.add(u),e={rel:e,crossOrigin:a,href:r},i.querySelector(u)===null&&(r=i.createElement("link"),Yt(r,"link",e),Bt(r),i.head.appendChild(r)))}}function Xy(e){ks.D(e),ng("dns-prefetch",e,null)}function Zy(e,r){ks.C(e,r),ng("preconnect",e,r)}function Wy(e,r,a){ks.L(e,r,a);var i=mn;if(i&&e&&r){var u='link[rel="preload"][as="'+Cr(r)+'"]';r==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+Cr(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+Cr(a.imageSizes)+'"]')):u+='[href="'+Cr(e)+'"]';var p=u;switch(r){case"style":p=pn(e);break;case"script":p=fn(e)}Pr.has(p)||(e=y({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:e,as:r},a),Pr.set(p,e),i.querySelector(u)!==null||r==="style"&&i.querySelector(fl(p))||r==="script"&&i.querySelector(gl(p))||(r=i.createElement("link"),Yt(r,"link",e),Bt(r),i.head.appendChild(r)))}}function eb(e,r){ks.m(e,r);var a=mn;if(a&&e){var i=r&&typeof r.as=="string"?r.as:"script",u='link[rel="modulepreload"][as="'+Cr(i)+'"][href="'+Cr(e)+'"]',p=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=fn(e)}if(!Pr.has(p)&&(e=y({rel:"modulepreload",href:e},r),Pr.set(p,e),a.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(gl(p)))return}i=a.createElement("link"),Yt(i,"link",e),Bt(i),a.head.appendChild(i)}}}function tb(e,r,a){ks.S(e,r,a);var i=mn;if(i&&e){var u=Pa(i).hoistableStyles,p=pn(e);r=r||"default";var v=u.get(p);if(!v){var O={loading:0,preload:null};if(v=i.querySelector(fl(p)))O.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":r},a),(a=Pr.get(p))&&Nu(e,a);var F=v=i.createElement("link");Bt(F),Yt(F,"link",e),F._p=new Promise(function(re,ue){F.onload=re,F.onerror=ue}),F.addEventListener("load",function(){O.loading|=1}),F.addEventListener("error",function(){O.loading|=2}),O.loading|=4,Li(v,r,i)}v={type:"stylesheet",instance:v,count:1,state:O},u.set(p,v)}}}function rb(e,r){ks.X(e,r);var a=mn;if(a&&e){var i=Pa(a).hoistableScripts,u=fn(e),p=i.get(u);p||(p=a.querySelector(gl(u)),p||(e=y({src:e,async:!0},r),(r=Pr.get(u))&&ku(e,r),p=a.createElement("script"),Bt(p),Yt(p,"link",e),a.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},i.set(u,p))}}function sb(e,r){ks.M(e,r);var a=mn;if(a&&e){var i=Pa(a).hoistableScripts,u=fn(e),p=i.get(u);p||(p=a.querySelector(gl(u)),p||(e=y({src:e,async:!0,type:"module"},r),(r=Pr.get(u))&&ku(e,r),p=a.createElement("script"),Bt(p),Yt(p,"link",e),a.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},i.set(u,p))}}function lg(e,r,a,i){var u=(u=ee.current)?Di(u):null;if(!u)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=pn(a.href),a=Pa(u).hoistableStyles,i=a.get(r),i||(i={type:"style",instance:null,count:0,state:null},a.set(r,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=pn(a.href);var p=Pa(u).hoistableStyles,v=p.get(e);if(v||(u=u.ownerDocument||u,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(e,v),(p=u.querySelector(fl(e)))&&!p._p&&(v.instance=p,v.state.loading=5),Pr.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Pr.set(e,a),p||ab(u,e,a,v.state))),r&&i===null)throw Error(o(528,""));return v}if(r&&i!==null)throw Error(o(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=fn(a),a=Pa(u).hoistableScripts,i=a.get(r),i||(i={type:"script",instance:null,count:0,state:null},a.set(r,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function pn(e){return'href="'+Cr(e)+'"'}function fl(e){return'link[rel="stylesheet"]['+e+"]"}function ig(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function ab(e,r,a,i){e.querySelector('link[rel="preload"][as="style"]['+r+"]")?i.loading=1:(r=e.createElement("link"),i.preload=r,r.addEventListener("load",function(){return i.loading|=1}),r.addEventListener("error",function(){return i.loading|=2}),Yt(r,"link",a),Bt(r),e.head.appendChild(r))}function fn(e){return'[src="'+Cr(e)+'"]'}function gl(e){return"script[async]"+e}function og(e,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var i=e.querySelector('style[data-href~="'+Cr(a.href)+'"]');if(i)return r.instance=i,Bt(i),i;var u=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Bt(i),Yt(i,"style",u),Li(i,a.precedence,e),r.instance=i;case"stylesheet":u=pn(a.href);var p=e.querySelector(fl(u));if(p)return r.state.loading|=4,r.instance=p,Bt(p),p;i=ig(a),(u=Pr.get(u))&&Nu(i,u),p=(e.ownerDocument||e).createElement("link"),Bt(p);var v=p;return v._p=new Promise(function(O,F){v.onload=O,v.onerror=F}),Yt(p,"link",i),r.state.loading|=4,Li(p,a.precedence,e),r.instance=p;case"script":return p=fn(a.src),(u=e.querySelector(gl(p)))?(r.instance=u,Bt(u),u):(i=a,(u=Pr.get(p))&&(i=y({},a),ku(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),Bt(u),Yt(u,"link",i),e.head.appendChild(u),r.instance=u);case"void":return null;default:throw Error(o(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(i=r.instance,r.state.loading|=4,Li(i,a.precedence,e));return r.instance}function Li(e,r,a){for(var i=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=i.length?i[i.length-1]:null,p=u,v=0;v<i.length;v++){var O=i[v];if(O.dataset.precedence===r)p=O;else if(p!==u)break}p?p.parentNode.insertBefore(e,p.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(e,r.firstChild))}function Nu(e,r){e.crossOrigin==null&&(e.crossOrigin=r.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=r.referrerPolicy),e.title==null&&(e.title=r.title)}function ku(e,r){e.crossOrigin==null&&(e.crossOrigin=r.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=r.referrerPolicy),e.integrity==null&&(e.integrity=r.integrity)}var Ui=null;function cg(e,r,a){if(Ui===null){var i=new Map,u=Ui=new Map;u.set(a,i)}else u=Ui,i=u.get(a),i||(i=new Map,u.set(a,i));if(i.has(e))return i;for(i.set(e,null),a=a.getElementsByTagName(e),u=0;u<a.length;u++){var p=a[u];if(!(p[Dt]||p[dt]||e==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var v=p.getAttribute(r)||"";v=e+v;var O=i.get(v);O?O.push(p):i.set(v,[p])}}return i}function ug(e,r,a){e=e.ownerDocument||e,e.head.insertBefore(a,r==="title"?e.querySelector("head > title"):null)}function nb(e,r,a){if(a===1||r.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return e=r.disabled,typeof r.precedence=="string"&&e==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function dg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function lb(e,r,a,i){if(a.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=pn(i.href),p=r.querySelector(fl(u));if(p){r=p._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(e.count++,e=_i.bind(e),r.then(e,e)),a.state.loading|=4,a.instance=p,Bt(p);return}p=r.ownerDocument||r,i=ig(i),(u=Pr.get(u))&&Nu(i,u),p=p.createElement("link"),Bt(p);var v=p;v._p=new Promise(function(O,F){v.onload=O,v.onerror=F}),Yt(p,"link",i),a.instance=p}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,r),(r=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=_i.bind(e),r.addEventListener("load",a),r.addEventListener("error",a))}}var Cu=0;function ib(e,r){return e.stylesheets&&e.count===0&&Ii(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var i=setTimeout(function(){if(e.stylesheets&&Ii(e,e.stylesheets),e.unsuspend){var p=e.unsuspend;e.unsuspend=null,p()}},6e4+r);0<e.imgBytes&&Cu===0&&(Cu=62500*Fy());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Ii(e,e.stylesheets),e.unsuspend)){var p=e.unsuspend;e.unsuspend=null,p()}},(e.imgBytes>Cu?50:800)+r);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function _i(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ii(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Bi=null;function Ii(e,r){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Bi=new Map,r.forEach(ob,e),Bi=null,_i.call(e))}function ob(e,r){if(!(r.state.loading&4)){var a=Bi.get(e);if(a)var i=a.get(null);else{a=new Map,Bi.set(e,a);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<u.length;p++){var v=u[p];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(a.set(v.dataset.precedence,v),i=v)}i&&a.set(null,i)}u=r.instance,v=u.getAttribute("data-precedence"),p=a.get(v)||i,p===i&&a.set(null,u),a.set(v,u),this.count++,i=_i.bind(this),u.addEventListener("load",i),u.addEventListener("error",i),p?p.parentNode.insertBefore(u,p.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),r.state.loading|=4}}var hl={$$typeof:T,Provider:null,Consumer:null,_currentValue:J,_currentValue2:J,_threadCount:0};function cb(e,r,a,i,u,p,v,O,F){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=jt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jt(0),this.hiddenUpdates=jt(null),this.identifierPrefix=i,this.onUncaughtError=u,this.onCaughtError=p,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=F,this.incompleteTransitions=new Map}function mg(e,r,a,i,u,p,v,O,F,re,ue,fe){return e=new cb(e,r,a,v,F,re,ue,fe,O),r=1,p===!0&&(r|=24),p=gr(3,null,null,r),e.current=p,p.stateNode=e,r=nc(),r.refCount++,e.pooledCache=r,r.refCount++,p.memoizedState={element:i,isDehydrated:a,cache:r},cc(p),e}function pg(e){return e?(e=Ga,e):Ga}function fg(e,r,a,i,u,p){u=pg(u),i.context===null?i.context=u:i.pendingContext=u,i=Hs(r),i.payload={element:a},p=p===void 0?null:p,p!==null&&(i.callback=p),a=qs(e,i,r),a!==null&&(dr(a,e,r),Yn(a,e,r))}function gg(e,r){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<r?a:r}}function Au(e,r){gg(e,r),(e=e.alternate)&&gg(e,r)}function hg(e){if(e.tag===13||e.tag===31){var r=ga(e,67108864);r!==null&&dr(r,e,67108864),Au(e,67108864)}}function xg(e){if(e.tag===13||e.tag===31){var r=vr();r=oe(r);var a=ga(e,r);a!==null&&dr(a,e,r),Au(e,r)}}var Fi=!0;function ub(e,r,a,i){var u=A.T;A.T=null;var p=H.p;try{H.p=2,Eu(e,r,a,i)}finally{H.p=p,A.T=u}}function db(e,r,a,i){var u=A.T;A.T=null;var p=H.p;try{H.p=8,Eu(e,r,a,i)}finally{H.p=p,A.T=u}}function Eu(e,r,a,i){if(Fi){var u=Ru(i);if(u===null)fu(e,r,i,Hi,a),bg(e,i);else if(pb(u,e,r,a,i))i.stopPropagation();else if(bg(e,i),r&4&&-1<mb.indexOf(e)){for(;u!==null;){var p=Ma(u);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var v=ar(p.pendingLanes);if(v!==0){var O=p;for(O.pendingLanes|=2,O.entangledLanes|=2;v;){var F=1<<31-bt(v);O.entanglements[1]|=F,v&=~F}Zr(p),(Ze&6)===0&&(Ni=gt()+500,ul(0))}}break;case 31:case 13:O=ga(p,2),O!==null&&dr(O,p,2),Ci(),Au(p,2)}if(p=Ru(i),p===null&&fu(e,r,i,Hi,a),p===u)break;u=p}u!==null&&i.stopPropagation()}else fu(e,r,i,null,a)}}function Ru(e){return e=Oo(e),Tu(e)}var Hi=null;function Tu(e){if(Hi=null,e=za(e),e!==null){var r=d(e);if(r===null)e=null;else{var a=r.tag;if(a===13){if(e=m(r),e!==null)return e;e=null}else if(a===31){if(e=f(r),e!==null)return e;e=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;e=null}else r!==e&&(e=null)}}return Hi=e,null}function yg(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(Nr()){case er:return 2;case Qt:return 8;case ht:case Re:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var Ou=!1,ea=null,ta=null,ra=null,xl=new Map,yl=new Map,sa=[],mb="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 bg(e,r){switch(e){case"focusin":case"focusout":ea=null;break;case"dragenter":case"dragleave":ta=null;break;case"mouseover":case"mouseout":ra=null;break;case"pointerover":case"pointerout":xl.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":yl.delete(r.pointerId)}}function bl(e,r,a,i,u,p){return e===null||e.nativeEvent!==p?(e={blockedOn:r,domEventName:a,eventSystemFlags:i,nativeEvent:p,targetContainers:[u]},r!==null&&(r=Ma(r),r!==null&&hg(r)),e):(e.eventSystemFlags|=i,r=e.targetContainers,u!==null&&r.indexOf(u)===-1&&r.push(u),e)}function pb(e,r,a,i,u){switch(r){case"focusin":return ea=bl(ea,e,r,a,i,u),!0;case"dragenter":return ta=bl(ta,e,r,a,i,u),!0;case"mouseover":return ra=bl(ra,e,r,a,i,u),!0;case"pointerover":var p=u.pointerId;return xl.set(p,bl(xl.get(p)||null,e,r,a,i,u)),!0;case"gotpointercapture":return p=u.pointerId,yl.set(p,bl(yl.get(p)||null,e,r,a,i,u)),!0}return!1}function vg(e){var r=za(e.target);if(r!==null){var a=d(r);if(a!==null){if(r=a.tag,r===13){if(r=m(a),r!==null){e.blockedOn=r,Oa(e.priority,function(){xg(a)});return}}else if(r===31){if(r=f(a),r!==null){e.blockedOn=r,Oa(e.priority,function(){xg(a)});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function qi(e){if(e.blockedOn!==null)return!1;for(var r=e.targetContainers;0<r.length;){var a=Ru(e.nativeEvent);if(a===null){a=e.nativeEvent;var i=new a.constructor(a.type,a);To=i,a.target.dispatchEvent(i),To=null}else return r=Ma(a),r!==null&&hg(r),e.blockedOn=a,!1;r.shift()}return!0}function wg(e,r,a){qi(e)&&a.delete(r)}function fb(){Ou=!1,ea!==null&&qi(ea)&&(ea=null),ta!==null&&qi(ta)&&(ta=null),ra!==null&&qi(ra)&&(ra=null),xl.forEach(wg),yl.forEach(wg)}function Gi(e,r){e.blockedOn===r&&(e.blockedOn=null,Ou||(Ou=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,fb)))}var Ki=null;function jg(e){Ki!==e&&(Ki=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Ki===e&&(Ki=null);for(var r=0;r<e.length;r+=3){var a=e[r],i=e[r+1],u=e[r+2];if(typeof i!="function"){if(Tu(i||a)===null)continue;break}var p=Ma(a);p!==null&&(e.splice(r,3),r-=3,Rc(p,{pending:!0,data:u,method:a.method,action:i},i,u))}}))}function gn(e){function r(F){return Gi(F,e)}ea!==null&&Gi(ea,e),ta!==null&&Gi(ta,e),ra!==null&&Gi(ra,e),xl.forEach(r),yl.forEach(r);for(var a=0;a<sa.length;a++){var i=sa[a];i.blockedOn===e&&(i.blockedOn=null)}for(;0<sa.length&&(a=sa[0],a.blockedOn===null);)vg(a),a.blockedOn===null&&sa.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(i=0;i<a.length;i+=3){var u=a[i],p=a[i+1],v=u[Xt]||null;if(typeof p=="function")v||jg(a);else if(v){var O=null;if(p&&p.hasAttribute("formAction")){if(u=p,v=p[Xt]||null)O=v.formAction;else if(Tu(u)!==null)continue}else O=v.action;typeof O=="function"?a[i+1]=O:(a.splice(i,3),i-=3),jg(a)}}}function Sg(){function e(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(v){return u=v})},focusReset:"manual",scroll:"manual"})}function r(){u!==null&&(u(),u=null),i||setTimeout(a,20)}function a(){if(!i&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(a,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),u!==null&&(u(),u=null)}}}function zu(e){this._internalRoot=e}Vi.prototype.render=zu.prototype.render=function(e){var r=this._internalRoot;if(r===null)throw Error(o(409));var a=r.current,i=vr();fg(a,i,e,r,null,null)},Vi.prototype.unmount=zu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var r=e.containerInfo;fg(e.current,2,null,e,null,null),Ci(),r[nr]=null}};function Vi(e){this._internalRoot=e}Vi.prototype.unstable_scheduleHydration=function(e){if(e){var r=$r();e={blockedOn:null,target:e,priority:r};for(var a=0;a<sa.length&&r!==0&&r<sa[a].priority;a++);sa.splice(a,0,e),a===0&&vg(e)}};var Ng=n.version;if(Ng!=="19.2.1")throw Error(o(527,Ng,"19.2.1"));H.findDOMNode=function(e){var r=e._reactInternals;if(r===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=h(r),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var gb={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $i=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$i.isDisabled&&$i.supportsFiber)try{Gt=$i.inject(gb),ot=$i}catch{}}return wl.createRoot=function(e,r){if(!c(e))throw Error(o(299));var a=!1,i="",u=Tp,p=Op,v=zp;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onUncaughtError!==void 0&&(u=r.onUncaughtError),r.onCaughtError!==void 0&&(p=r.onCaughtError),r.onRecoverableError!==void 0&&(v=r.onRecoverableError)),r=mg(e,1,!1,null,null,a,i,null,u,p,v,Sg),e[nr]=r.current,pu(e),new zu(r)},wl.hydrateRoot=function(e,r,a){if(!c(e))throw Error(o(299));var i=!1,u="",p=Tp,v=Op,O=zp,F=null;return a!=null&&(a.unstable_strictMode===!0&&(i=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(p=a.onUncaughtError),a.onCaughtError!==void 0&&(v=a.onCaughtError),a.onRecoverableError!==void 0&&(O=a.onRecoverableError),a.formState!==void 0&&(F=a.formState)),r=mg(e,1,!0,r,a??null,i,u,F,p,v,O,Sg),r.context=pg(null),a=r.current,i=vr(),i=oe(i),u=Hs(i),u.callback=null,qs(a,u,i),a=i,r.current.lanes=a,Je(r,a),Zr(r),e[nr]=r.current,pu(e),new Vi(r)},wl.version="19.2.1",wl}var Pg;function Ab(){if(Pg)return Du.exports;Pg=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(n){console.error(n)}}return s(),Du.exports=Cb(),Du.exports}var Eb=Ab();const Dg=Ph(Eb);/**
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 Lg="popstate";function Rb(s={}){function n(o,c){let{pathname:d,search:m,hash:f}=o.location;return ed("",{pathname:d,search:m,hash:f},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function l(o,c){return typeof c=="string"?c:El(c)}return Ob(n,l,null,s)}function wt(s,n){if(s===!1||s===null||typeof s>"u")throw new Error(n)}function Lr(s,n){if(!s){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function Tb(){return Math.random().toString(36).substring(2,10)}function Ug(s,n){return{usr:s.state,key:s.key,idx:n}}function ed(s,n,l=null,o){return{pathname:typeof s=="string"?s:s.pathname,search:"",hash:"",...typeof n=="string"?Cn(n):n,state:l,key:n&&n.key||o||Tb()}}function El({pathname:s="/",search:n="",hash:l=""}){return n&&n!=="?"&&(s+=n.charAt(0)==="?"?n:"?"+n),l&&l!=="#"&&(s+=l.charAt(0)==="#"?l:"#"+l),s}function Cn(s){let n={};if(s){let l=s.indexOf("#");l>=0&&(n.hash=s.substring(l),s=s.substring(0,l));let o=s.indexOf("?");o>=0&&(n.search=s.substring(o),s=s.substring(0,o)),s&&(n.pathname=s)}return n}function Ob(s,n,l,o={}){let{window:c=document.defaultView,v5Compat:d=!1}=o,m=c.history,f="POP",g=null,h=b();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function b(){return(m.state||{idx:null}).idx}function y(){f="POP";let C=b(),z=C==null?null:C-h;h=C,g&&g({action:f,location:j.location,delta:z})}function w(C,z){f="PUSH";let E=ed(j.location,C,z);h=b()+1;let T=Ug(E,h),B=j.createHref(E);try{m.pushState(T,"",B)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;c.location.assign(B)}d&&g&&g({action:f,location:j.location,delta:1})}function N(C,z){f="REPLACE";let E=ed(j.location,C,z);h=b();let T=Ug(E,h),B=j.createHref(E);m.replaceState(T,"",B),d&&g&&g({action:f,location:j.location,delta:0})}function S(C){return zb(C)}let j={get action(){return f},get location(){return s(c,m)},listen(C){if(g)throw new Error("A history only accepts one active listener");return c.addEventListener(Lg,y),g=C,()=>{c.removeEventListener(Lg,y),g=null}},createHref(C){return n(c,C)},createURL:S,encodeLocation(C){let z=S(C);return{pathname:z.pathname,search:z.search,hash:z.hash}},push:w,replace:N,go(C){return m.go(C)}};return j}function zb(s,n=!1){let l="http://localhost";typeof window<"u"&&(l=window.location.origin!=="null"?window.location.origin:window.location.href),wt(l,"No window.location.(origin|href) available to create URL");let o=typeof s=="string"?s:El(s);return o=o.replace(/ $/,"%20"),!n&&o.startsWith("//")&&(o=l+o),new URL(o,l)}function Dh(s,n,l="/"){return Mb(s,n,l,!1)}function Mb(s,n,l,o){let c=typeof n=="string"?Cn(n):n,d=Ts(c.pathname||"/",l);if(d==null)return null;let m=Lh(s);Pb(m);let f=null;for(let g=0;f==null&&g<m.length;++g){let h=Kb(d);f=qb(m[g],h,o)}return f}function Lh(s,n=[],l=[],o="",c=!1){let d=(m,f,g=c,h)=>{let b={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:f,route:m};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(o)&&g)return;wt(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 y=Es([o,b.relativePath]),w=l.concat(b);m.children&&m.children.length>0&&(wt(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),Lh(m.children,n,w,y,g)),!(m.path==null&&!m.index)&&n.push({path:y,score:Fb(y,m.index),routesMeta:w})};return s.forEach((m,f)=>{var g;if(m.path===""||!((g=m.path)!=null&&g.includes("?")))d(m,f);else for(let h of Uh(m.path))d(m,f,!0,h)}),n}function Uh(s){let n=s.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=Uh(o.join("/")),f=[];return f.push(...m.map(g=>g===""?d:[d,g].join("/"))),c&&f.push(...m),f.map(g=>s.startsWith("/")&&g===""?"/":g)}function Pb(s){s.sort((n,l)=>n.score!==l.score?l.score-n.score:Hb(n.routesMeta.map(o=>o.childrenIndex),l.routesMeta.map(o=>o.childrenIndex)))}var Db=/^:[\w-]+$/,Lb=3,Ub=2,_b=1,Bb=10,Ib=-2,_g=s=>s==="*";function Fb(s,n){let l=s.split("/"),o=l.length;return l.some(_g)&&(o+=Ib),n&&(o+=Ub),l.filter(c=>!_g(c)).reduce((c,d)=>c+(Db.test(d)?Lb:d===""?_b:Bb),o)}function Hb(s,n){return s.length===n.length&&s.slice(0,-1).every((o,c)=>o===n[c])?s[s.length-1]-n[n.length-1]:0}function qb(s,n,l=!1){let{routesMeta:o}=s,c={},d="/",m=[];for(let f=0;f<o.length;++f){let g=o[f],h=f===o.length-1,b=d==="/"?n:n.slice(d.length)||"/",y=mo({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},b),w=g.route;if(!y&&h&&l&&!o[o.length-1].route.index&&(y=mo({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},b)),!y)return null;Object.assign(c,y.params),m.push({params:c,pathname:Es([d,y.pathname]),pathnameBase:Jb(Es([d,y.pathnameBase])),route:w}),y.pathnameBase!=="/"&&(d=Es([d,y.pathnameBase]))}return m}function mo(s,n){typeof s=="string"&&(s={path:s,caseSensitive:!1,end:!0});let[l,o]=Gb(s.path,s.caseSensitive,s.end),c=n.match(l);if(!c)return null;let d=c[0],m=d.replace(/(.)\/+$/,"$1"),f=c.slice(1);return{params:o.reduce((h,{paramName:b,isOptional:y},w)=>{if(b==="*"){let S=f[w]||"";m=d.slice(0,d.length-S.length).replace(/(.)\/+$/,"$1")}const N=f[w];return y&&!N?h[b]=void 0:h[b]=(N||"").replace(/%2F/g,"/"),h},{}),pathname:d,pathnameBase:m,pattern:s}}function Gb(s,n=!1,l=!0){Lr(s==="*"||!s.endsWith("*")||s.endsWith("/*"),`Route path "${s}" will be treated as if it were "${s.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${s.replace(/\*$/,"/*")}".`);let o=[],c="^"+s.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,f,g)=>(o.push({paramName:f,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return s.endsWith("*")?(o.push({paramName:"*"}),c+=s==="*"||s==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):l?c+="\\/*$":s!==""&&s!=="/"&&(c+="(?:(?=\\/|$))"),[new RegExp(c,n?void 0:"i"),o]}function Kb(s){try{return s.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Lr(!1,`The URL path "${s}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),s}}function Ts(s,n){if(n==="/")return s;if(!s.toLowerCase().startsWith(n.toLowerCase()))return null;let l=n.endsWith("/")?n.length-1:n.length,o=s.charAt(l);return o&&o!=="/"?null:s.slice(l)||"/"}var Vb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function $b(s,n="/"){let{pathname:l,search:o="",hash:c=""}=typeof s=="string"?Cn(s):s,d;return l?(l=l.replace(/\/\/+/g,"/"),l.startsWith("/")?d=Bg(l.substring(1),"/"):d=Bg(l,n)):d=n,{pathname:d,search:Qb(o),hash:Xb(c)}}function Bg(s,n){let l=n.replace(/\/+$/,"").split("/");return s.split("/").forEach(c=>{c===".."?l.length>1&&l.pop():c!=="."&&l.push(c)}),l.length>1?l.join("/"):"/"}function Bu(s,n,l,o){return`Cannot include a '${s}' 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 Yb(s){return s.filter((n,l)=>l===0||n.route.path&&n.route.path.length>0)}function hd(s){let n=Yb(s);return n.map((l,o)=>o===n.length-1?l.pathname:l.pathnameBase)}function xd(s,n,l,o=!1){let c;typeof s=="string"?c=Cn(s):(c={...s},wt(!c.pathname||!c.pathname.includes("?"),Bu("?","pathname","search",c)),wt(!c.pathname||!c.pathname.includes("#"),Bu("#","pathname","hash",c)),wt(!c.search||!c.search.includes("#"),Bu("#","search","hash",c)));let d=s===""||c.pathname==="",m=d?"/":c.pathname,f;if(m==null)f=l;else{let y=n.length-1;if(!o&&m.startsWith("..")){let w=m.split("/");for(;w[0]==="..";)w.shift(),y-=1;c.pathname=w.join("/")}f=y>=0?n[y]:"/"}let g=$b(c,f),h=m&&m!=="/"&&m.endsWith("/"),b=(d||m===".")&&l.endsWith("/");return!g.pathname.endsWith("/")&&(h||b)&&(g.pathname+="/"),g}var Es=s=>s.join("/").replace(/\/\/+/g,"/"),Jb=s=>s.replace(/\/+$/,"").replace(/^\/*/,"/"),Qb=s=>!s||s==="?"?"":s.startsWith("?")?s:"?"+s,Xb=s=>!s||s==="#"?"":s.startsWith("#")?s:"#"+s,Zb=class{constructor(s,n,l,o=!1){this.status=s,this.statusText=n||"",this.internal=o,l instanceof Error?(this.data=l.toString(),this.error=l):this.data=l}};function Wb(s){return s!=null&&typeof s.status=="number"&&typeof s.statusText=="string"&&typeof s.internal=="boolean"&&"data"in s}function ev(s){return s.map(n=>n.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var _h=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Bh(s,n){let l=s;if(typeof l!="string"||!Vb.test(l))return{absoluteURL:void 0,isExternal:!1,to:l};let o=l,c=!1;if(_h)try{let d=new URL(window.location.href),m=l.startsWith("//")?new URL(d.protocol+l):new URL(l),f=Ts(m.pathname,n);m.origin===d.origin&&f!=null?l=f+m.search+m.hash:c=!0}catch{Lr(!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 Ih=["POST","PUT","PATCH","DELETE"];new Set(Ih);var tv=["GET",...Ih];new Set(tv);var An=x.createContext(null);An.displayName="DataRouter";var yo=x.createContext(null);yo.displayName="DataRouterState";var rv=x.createContext(!1),Fh=x.createContext({isTransitioning:!1});Fh.displayName="ViewTransition";var sv=x.createContext(new Map);sv.displayName="Fetchers";var av=x.createContext(null);av.displayName="Await";var jr=x.createContext(null);jr.displayName="Navigation";var Ol=x.createContext(null);Ol.displayName="Location";var Ur=x.createContext({outlet:null,matches:[],isDataRoute:!1});Ur.displayName="Route";var yd=x.createContext(null);yd.displayName="RouteError";var Hh="REACT_ROUTER_ERROR",nv="REDIRECT",lv="ROUTE_ERROR_RESPONSE";function iv(s){if(s.startsWith(`${Hh}:${nv}:{`))try{let n=JSON.parse(s.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 ov(s){if(s.startsWith(`${Hh}:${lv}:{`))try{let n=JSON.parse(s.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 cv(s,{relative:n}={}){wt(En(),"useHref() may be used only in the context of a <Router> component.");let{basename:l,navigator:o}=x.useContext(jr),{hash:c,pathname:d,search:m}=zl(s,{relative:n}),f=d;return l!=="/"&&(f=d==="/"?l:Es([l,d])),o.createHref({pathname:f,search:m,hash:c})}function En(){return x.useContext(Ol)!=null}function ns(){return wt(En(),"useLocation() may be used only in the context of a <Router> component."),x.useContext(Ol).location}var qh="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Gh(s){x.useContext(jr).static||x.useLayoutEffect(s)}function ls(){let{isDataRoute:s}=x.useContext(Ur);return s?Nv():uv()}function uv(){wt(En(),"useNavigate() may be used only in the context of a <Router> component.");let s=x.useContext(An),{basename:n,navigator:l}=x.useContext(jr),{matches:o}=x.useContext(Ur),{pathname:c}=ns(),d=JSON.stringify(hd(o)),m=x.useRef(!1);return Gh(()=>{m.current=!0}),x.useCallback((g,h={})=>{if(Lr(m.current,qh),!m.current)return;if(typeof g=="number"){l.go(g);return}let b=xd(g,JSON.parse(d),c,h.relative==="path");s==null&&n!=="/"&&(b.pathname=b.pathname==="/"?n:Es([n,b.pathname])),(h.replace?l.replace:l.push)(b,h.state,h)},[n,l,d,c,s])}var dv=x.createContext(null);function mv(s){let n=x.useContext(Ur).outlet;return x.useMemo(()=>n&&x.createElement(dv.Provider,{value:s},n),[n,s])}function Kh(){let{matches:s}=x.useContext(Ur),n=s[s.length-1];return n?n.params:{}}function zl(s,{relative:n}={}){let{matches:l}=x.useContext(Ur),{pathname:o}=ns(),c=JSON.stringify(hd(l));return x.useMemo(()=>xd(s,JSON.parse(c),o,n==="path"),[s,c,o,n])}function pv(s,n){return Vh(s,n)}function Vh(s,n,l,o,c){var E;wt(En(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=x.useContext(jr),{matches:m}=x.useContext(Ur),f=m[m.length-1],g=f?f.params:{},h=f?f.pathname:"/",b=f?f.pathnameBase:"/",y=f&&f.route;{let T=y&&y.path||"";Yh(h,!y||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${T}">) 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="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let w=ns(),N;if(n){let T=typeof n=="string"?Cn(n):n;wt(b==="/"||((E=T.pathname)==null?void 0:E.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 "${T.pathname}" was given in the \`location\` prop.`),N=T}else N=w;let S=N.pathname||"/",j=S;if(b!=="/"){let T=b.replace(/^\//,"").split("/");j="/"+S.replace(/^\//,"").split("/").slice(T.length).join("/")}let C=Dh(s,{pathname:j});Lr(y||C!=null,`No routes matched location "${N.pathname}${N.search}${N.hash}" `),Lr(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${N.pathname}${N.search}${N.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 z=yv(C&&C.map(T=>Object.assign({},T,{params:Object.assign({},g,T.params),pathname:Es([b,d.encodeLocation?d.encodeLocation(T.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?b:Es([b,d.encodeLocation?d.encodeLocation(T.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),m,l,o,c);return n&&z?x.createElement(Ol.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...N},navigationType:"POP"}},z):z}function fv(){let s=Sv(),n=Wb(s)?`${s.status} ${s.statusText}`:s instanceof Error?s.message:JSON.stringify(s),l=s instanceof Error?s.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:",s),m=x.createElement(x.Fragment,null,x.createElement("p",null,"💿 Hey developer 👋"),x.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",x.createElement("code",{style:d},"ErrorBoundary")," or"," ",x.createElement("code",{style:d},"errorElement")," prop on your route.")),x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},n),l?x.createElement("pre",{style:c},l):null,m)}var gv=x.createElement(fv,null),$h=class extends x.Component{constructor(s){super(s),this.state={location:s.location,revalidation:s.revalidation,error:s.error}}static getDerivedStateFromError(s){return{error:s}}static getDerivedStateFromProps(s,n){return n.location!==s.location||n.revalidation!=="idle"&&s.revalidation==="idle"?{error:s.error,location:s.location,revalidation:s.revalidation}:{error:s.error!==void 0?s.error:n.error,location:n.location,revalidation:s.revalidation||n.revalidation}}componentDidCatch(s,n){this.props.onError?this.props.onError(s,n):console.error("React Router caught the following error during render",s)}render(){let s=this.state.error;if(this.context&&typeof s=="object"&&s&&"digest"in s&&typeof s.digest=="string"){const l=ov(s.digest);l&&(s=l)}let n=s!==void 0?x.createElement(Ur.Provider,{value:this.props.routeContext},x.createElement(yd.Provider,{value:s,children:this.props.component})):this.props.children;return this.context?x.createElement(hv,{error:s},n):n}};$h.contextType=rv;var Iu=new WeakMap;function hv({children:s,error:n}){let{basename:l}=x.useContext(jr);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let o=iv(n.digest);if(o){let c=Iu.get(n);if(c)throw c;let d=Bh(o.location,l);if(_h&&!Iu.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 Iu.set(n,m),m}return x.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return s}function xv({routeContext:s,match:n,children:l}){let o=x.useContext(An);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(Ur.Provider,{value:s},l)}function yv(s,n=[],l=null,o=null,c=null){if(s==null){if(!l)return null;if(l.errors)s=l.matches;else if(n.length===0&&!l.initialized&&l.matches.length>0)s=l.matches;else return null}let d=s,m=l==null?void 0:l.errors;if(m!=null){let b=d.findIndex(y=>y.route.id&&(m==null?void 0:m[y.route.id])!==void 0);wt(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 f=!1,g=-1;if(l)for(let b=0;b<d.length;b++){let y=d[b];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(g=b),y.route.id){let{loaderData:w,errors:N}=l,S=y.route.loader&&!w.hasOwnProperty(y.route.id)&&(!N||N[y.route.id]===void 0);if(y.route.lazy||S){f=!0,g>=0?d=d.slice(0,g+1):d=[d[0]];break}}}let h=l&&o?(b,y)=>{var w,N;o(b,{location:l.location,params:((N=(w=l.matches)==null?void 0:w[0])==null?void 0:N.params)??{},unstable_pattern:ev(l.matches),errorInfo:y})}:void 0;return d.reduceRight((b,y,w)=>{let N,S=!1,j=null,C=null;l&&(N=m&&y.route.id?m[y.route.id]:void 0,j=y.route.errorElement||gv,f&&(g<0&&w===0?(Yh("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),S=!0,C=null):g===w&&(S=!0,C=y.route.hydrateFallbackElement||null)));let z=n.concat(d.slice(0,w+1)),E=()=>{let T;return N?T=j:S?T=C:y.route.Component?T=x.createElement(y.route.Component,null):y.route.element?T=y.route.element:T=b,x.createElement(xv,{match:y,routeContext:{outlet:b,matches:z,isDataRoute:l!=null},children:T})};return l&&(y.route.ErrorBoundary||y.route.errorElement||w===0)?x.createElement($h,{location:l.location,revalidation:l.revalidation,component:j,error:N,children:E(),routeContext:{outlet:null,matches:z,isDataRoute:!0},onError:h}):E()},null)}function bd(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function bv(s){let n=x.useContext(An);return wt(n,bd(s)),n}function vv(s){let n=x.useContext(yo);return wt(n,bd(s)),n}function wv(s){let n=x.useContext(Ur);return wt(n,bd(s)),n}function vd(s){let n=wv(s),l=n.matches[n.matches.length-1];return wt(l.route.id,`${s} can only be used on routes that contain a unique "id"`),l.route.id}function jv(){return vd("useRouteId")}function Sv(){var o;let s=x.useContext(yd),n=vv("useRouteError"),l=vd("useRouteError");return s!==void 0?s:(o=n.errors)==null?void 0:o[l]}function Nv(){let{router:s}=bv("useNavigate"),n=vd("useNavigate"),l=x.useRef(!1);return Gh(()=>{l.current=!0}),x.useCallback(async(c,d={})=>{Lr(l.current,qh),l.current&&(typeof c=="number"?await s.navigate(c):await s.navigate(c,{fromRouteId:n,...d}))},[s,n])}var Ig={};function Yh(s,n,l){!n&&!Ig[s]&&(Ig[s]=!0,Lr(!1,l))}x.memo(kv);function kv({routes:s,future:n,state:l,onError:o}){return Vh(s,void 0,l,o,n)}function po({to:s,replace:n,state:l,relative:o}){wt(En(),"<Navigate> may be used only in the context of a <Router> component.");let{static:c}=x.useContext(jr);Lr(!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}=x.useContext(Ur),{pathname:m}=ns(),f=ls(),g=xd(s,hd(d),m,o==="path"),h=JSON.stringify(g);return x.useEffect(()=>{f(JSON.parse(h),{replace:n,state:l,relative:o})},[f,h,o,n,l]),null}function Jh(s){return mv(s.context)}function Ft(s){wt(!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 Cv({basename:s="/",children:n=null,location:l,navigationType:o="POP",navigator:c,static:d=!1,unstable_useTransitions:m}){wt(!En(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=s.replace(/^\/*/,"/"),g=x.useMemo(()=>({basename:f,navigator:c,static:d,unstable_useTransitions:m,future:{}}),[f,c,d,m]);typeof l=="string"&&(l=Cn(l));let{pathname:h="/",search:b="",hash:y="",state:w=null,key:N="default"}=l,S=x.useMemo(()=>{let j=Ts(h,f);return j==null?null:{location:{pathname:j,search:b,hash:y,state:w,key:N},navigationType:o}},[f,h,b,y,w,N,o]);return Lr(S!=null,`<Router basename="${f}"> is not able to match the URL "${h}${b}${y}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:x.createElement(jr.Provider,{value:g},x.createElement(Ol.Provider,{children:n,value:S}))}function Av({children:s,location:n}){return pv(td(s),n)}function td(s,n=[]){let l=[];return x.Children.forEach(s,(o,c)=>{if(!x.isValidElement(o))return;let d=[...n,c];if(o.type===x.Fragment){l.push.apply(l,td(o.props.children,d));return}wt(o.type===Ft,`[${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>`),wt(!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=td(o.props.children,d)),l.push(m)}),l}var ao="get",no="application/x-www-form-urlencoded";function bo(s){return typeof HTMLElement<"u"&&s instanceof HTMLElement}function Ev(s){return bo(s)&&s.tagName.toLowerCase()==="button"}function Rv(s){return bo(s)&&s.tagName.toLowerCase()==="form"}function Tv(s){return bo(s)&&s.tagName.toLowerCase()==="input"}function Ov(s){return!!(s.metaKey||s.altKey||s.ctrlKey||s.shiftKey)}function zv(s,n){return s.button===0&&(!n||n==="_self")&&!Ov(s)}function rd(s=""){return new URLSearchParams(typeof s=="string"||Array.isArray(s)||s instanceof URLSearchParams?s:Object.keys(s).reduce((n,l)=>{let o=s[l];return n.concat(Array.isArray(o)?o.map(c=>[l,c]):[[l,o]])},[]))}function Mv(s,n){let l=rd(s);return n&&n.forEach((o,c)=>{l.has(c)||n.getAll(c).forEach(d=>{l.append(c,d)})}),l}var Yi=null;function Pv(){if(Yi===null)try{new FormData(document.createElement("form"),0),Yi=!1}catch{Yi=!0}return Yi}var Dv=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Fu(s){return s!=null&&!Dv.has(s)?(Lr(!1,`"${s}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${no}"`),null):s}function Lv(s,n){let l,o,c,d,m;if(Rv(s)){let f=s.getAttribute("action");o=f?Ts(f,n):null,l=s.getAttribute("method")||ao,c=Fu(s.getAttribute("enctype"))||no,d=new FormData(s)}else if(Ev(s)||Tv(s)&&(s.type==="submit"||s.type==="image")){let f=s.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=s.getAttribute("formaction")||f.getAttribute("action");if(o=g?Ts(g,n):null,l=s.getAttribute("formmethod")||f.getAttribute("method")||ao,c=Fu(s.getAttribute("formenctype"))||Fu(f.getAttribute("enctype"))||no,d=new FormData(f,s),!Pv()){let{name:h,type:b,value:y}=s;if(b==="image"){let w=h?`${h}.`:"";d.append(`${w}x`,"0"),d.append(`${w}y`,"0")}else h&&d.append(h,y)}}else{if(bo(s))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');l=ao,o=null,c=no,m=s}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 wd(s,n){if(s===!1||s===null||typeof s>"u")throw new Error(n)}function Uv(s,n,l,o){let c=typeof s=="string"?new URL(s,typeof window>"u"?"server://singlefetch/":window.location.origin):s;return l?c.pathname.endsWith("/")?c.pathname=`${c.pathname}_.${o}`:c.pathname=`${c.pathname}.${o}`:c.pathname==="/"?c.pathname=`_root.${o}`:n&&Ts(c.pathname,n)==="/"?c.pathname=`${n.replace(/\/$/,"")}/_root.${o}`:c.pathname=`${c.pathname.replace(/\/$/,"")}.${o}`,c}async function _v(s,n){if(s.id in n)return n[s.id];try{let l=await import(s.module);return n[s.id]=l,l}catch(l){return console.error(`Error loading route module \`${s.module}\`, reloading page...`),console.error(l),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Bv(s){return s==null?!1:s.href==null?s.rel==="preload"&&typeof s.imageSrcSet=="string"&&typeof s.imageSizes=="string":typeof s.rel=="string"&&typeof s.href=="string"}async function Iv(s,n,l){let o=await Promise.all(s.map(async c=>{let d=n.routes[c.route.id];if(d){let m=await _v(d,l);return m.links?m.links():[]}return[]}));return Gv(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 Fg(s,n,l,o,c,d){let m=(g,h)=>l[h]?g.route.id!==l[h].route.id:!0,f=(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)||f(g,h)):d==="data"?n.filter((g,h)=>{var y;let b=o.routes[g.route.id];if(!b||!b.hasLoader)return!1;if(m(g,h)||f(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:((y=l[0])==null?void 0:y.params)||{},nextUrl:new URL(s,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof w=="boolean")return w}return!0}):[]}function Fv(s,n,{includeHydrateFallback:l}={}){return Hv(s.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 Hv(s){return[...new Set(s)]}function qv(s){let n={},l=Object.keys(s).sort();for(let o of l)n[o]=s[o];return n}function Gv(s,n){let l=new Set;return new Set(n),s.reduce((o,c)=>{let d=JSON.stringify(qv(c));return l.has(d)||(l.add(d),o.push({key:d,link:c})),o},[])}function Qh(){let s=x.useContext(An);return wd(s,"You must render this element inside a <DataRouterContext.Provider> element"),s}function Kv(){let s=x.useContext(yo);return wd(s,"You must render this element inside a <DataRouterStateContext.Provider> element"),s}var jd=x.createContext(void 0);jd.displayName="FrameworkContext";function Xh(){let s=x.useContext(jd);return wd(s,"You must render this element inside a <HydratedRouter> element"),s}function Vv(s,n){let l=x.useContext(jd),[o,c]=x.useState(!1),[d,m]=x.useState(!1),{onFocus:f,onBlur:g,onMouseEnter:h,onMouseLeave:b,onTouchStart:y}=n,w=x.useRef(null);x.useEffect(()=>{if(s==="render"&&m(!0),s==="viewport"){let j=z=>{z.forEach(E=>{m(E.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return w.current&&C.observe(w.current),()=>{C.disconnect()}}},[s]),x.useEffect(()=>{if(o){let j=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(j)}}},[o]);let N=()=>{c(!0)},S=()=>{c(!1),m(!1)};return l?s!=="intent"?[d,w,{}]:[d,w,{onFocus:jl(f,N),onBlur:jl(g,S),onMouseEnter:jl(h,N),onMouseLeave:jl(b,S),onTouchStart:jl(y,N)}]:[!1,w,{}]}function jl(s,n){return l=>{s&&s(l),l.defaultPrevented||n(l)}}function $v({page:s,...n}){let{router:l}=Qh(),o=x.useMemo(()=>Dh(l.routes,s,l.basename),[l.routes,s,l.basename]);return o?x.createElement(Jv,{page:s,matches:o,...n}):null}function Yv(s){let{manifest:n,routeModules:l}=Xh(),[o,c]=x.useState([]);return x.useEffect(()=>{let d=!1;return Iv(s,n,l).then(m=>{d||c(m)}),()=>{d=!0}},[s,n,l]),o}function Jv({page:s,matches:n,...l}){let o=ns(),{future:c,manifest:d,routeModules:m}=Xh(),{basename:f}=Qh(),{loaderData:g,matches:h}=Kv(),b=x.useMemo(()=>Fg(s,n,h,d,o,"data"),[s,n,h,d,o]),y=x.useMemo(()=>Fg(s,n,h,d,o,"assets"),[s,n,h,d,o]),w=x.useMemo(()=>{if(s===o.pathname+o.search+o.hash)return[];let j=new Set,C=!1;if(n.forEach(E=>{var B;let T=d.routes[E.route.id];!T||!T.hasLoader||(!b.some(D=>D.route.id===E.route.id)&&E.route.id in g&&((B=m[E.route.id])!=null&&B.shouldRevalidate)||T.hasClientLoader?C=!0:j.add(E.route.id))}),j.size===0)return[];let z=Uv(s,f,c.unstable_trailingSlashAwareDataRequests,"data");return C&&j.size>0&&z.searchParams.set("_routes",n.filter(E=>j.has(E.route.id)).map(E=>E.route.id).join(",")),[z.pathname+z.search]},[f,c.unstable_trailingSlashAwareDataRequests,g,o,d,b,n,s,m]),N=x.useMemo(()=>Fv(y,d),[y,d]),S=Yv(y);return x.createElement(x.Fragment,null,w.map(j=>x.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...l})),N.map(j=>x.createElement("link",{key:j,rel:"modulepreload",href:j,...l})),S.map(({key:j,link:C})=>x.createElement("link",{key:j,nonce:l.nonce,...C,crossOrigin:C.crossOrigin??l.crossOrigin})))}function Qv(...s){return n=>{s.forEach(l=>{typeof l=="function"?l(n):l!=null&&(l.current=n)})}}var Xv=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Xv&&(window.__reactRouterVersion="7.13.0")}catch{}function Zv({basename:s,children:n,unstable_useTransitions:l,window:o}){let c=x.useRef();c.current==null&&(c.current=Rb({window:o,v5Compat:!0}));let d=c.current,[m,f]=x.useState({action:d.action,location:d.location}),g=x.useCallback(h=>{l===!1?f(h):x.startTransition(()=>f(h))},[l]);return x.useLayoutEffect(()=>d.listen(g),[d,g]),x.createElement(Cv,{basename:s,children:n,location:m.location,navigationType:m.action,navigator:d,unstable_useTransitions:l})}var Zh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wh=x.forwardRef(function({onClick:n,discover:l="render",prefetch:o="none",relative:c,reloadDocument:d,replace:m,state:f,target:g,to:h,preventScrollReset:b,viewTransition:y,unstable_defaultShouldRevalidate:w,...N},S){let{basename:j,unstable_useTransitions:C}=x.useContext(jr),z=typeof h=="string"&&Zh.test(h),E=Bh(h,j);h=E.to;let T=cv(h,{relative:c}),[B,D,Y]=Vv(o,N),R=t1(h,{replace:m,state:f,target:g,preventScrollReset:b,relative:c,viewTransition:y,unstable_defaultShouldRevalidate:w,unstable_useTransitions:C});function _(V){n&&n(V),V.defaultPrevented||R(V)}let P=x.createElement("a",{...N,...Y,href:E.absoluteURL||T,onClick:E.isExternal||d?n:_,ref:Qv(S,D),target:g,"data-discover":!z&&l==="render"?"true":void 0});return B&&!z?x.createElement(x.Fragment,null,P,x.createElement($v,{page:T})):P});Wh.displayName="Link";var e0=x.forwardRef(function({"aria-current":n="page",caseSensitive:l=!1,className:o="",end:c=!1,style:d,to:m,viewTransition:f,children:g,...h},b){let y=zl(m,{relative:h.relative}),w=ns(),N=x.useContext(yo),{navigator:S,basename:j}=x.useContext(jr),C=N!=null&&i1(y)&&f===!0,z=S.encodeLocation?S.encodeLocation(y).pathname:y.pathname,E=w.pathname,T=N&&N.navigation&&N.navigation.location?N.navigation.location.pathname:null;l||(E=E.toLowerCase(),T=T?T.toLowerCase():null,z=z.toLowerCase()),T&&j&&(T=Ts(T,j)||T);const B=z!=="/"&&z.endsWith("/")?z.length-1:z.length;let D=E===z||!c&&E.startsWith(z)&&E.charAt(B)==="/",Y=T!=null&&(T===z||!c&&T.startsWith(z)&&T.charAt(z.length)==="/"),R={isActive:D,isPending:Y,isTransitioning:C},_=D?n:void 0,P;typeof o=="function"?P=o(R):P=[o,D?"active":null,Y?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let V=typeof d=="function"?d(R):d;return x.createElement(Wh,{...h,"aria-current":_,className:P,ref:b,style:V,to:m,viewTransition:f},typeof g=="function"?g(R):g)});e0.displayName="NavLink";var Wv=x.forwardRef(({discover:s="render",fetcherKey:n,navigate:l,reloadDocument:o,replace:c,state:d,method:m=ao,action:f,onSubmit:g,relative:h,preventScrollReset:b,viewTransition:y,unstable_defaultShouldRevalidate:w,...N},S)=>{let{unstable_useTransitions:j}=x.useContext(jr),C=n1(),z=l1(f,{relative:h}),E=m.toLowerCase()==="get"?"get":"post",T=typeof f=="string"&&Zh.test(f),B=D=>{if(g&&g(D),D.defaultPrevented)return;D.preventDefault();let Y=D.nativeEvent.submitter,R=(Y==null?void 0:Y.getAttribute("formmethod"))||m,_=()=>C(Y||D.currentTarget,{fetcherKey:n,method:R,navigate:l,replace:c,state:d,relative:h,preventScrollReset:b,viewTransition:y,unstable_defaultShouldRevalidate:w});j&&l!==!1?x.startTransition(()=>_()):_()};return x.createElement("form",{ref:S,method:E,action:z,onSubmit:o?g:B,...N,"data-discover":!T&&s==="render"?"true":void 0})});Wv.displayName="Form";function e1(s){return`${s} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function t0(s){let n=x.useContext(An);return wt(n,e1(s)),n}function t1(s,{target:n,replace:l,state:o,preventScrollReset:c,relative:d,viewTransition:m,unstable_defaultShouldRevalidate:f,unstable_useTransitions:g}={}){let h=ls(),b=ns(),y=zl(s,{relative:d});return x.useCallback(w=>{if(zv(w,n)){w.preventDefault();let N=l!==void 0?l:El(b)===El(y),S=()=>h(s,{replace:N,state:o,preventScrollReset:c,relative:d,viewTransition:m,unstable_defaultShouldRevalidate:f});g?x.startTransition(()=>S()):S()}},[b,h,y,l,o,n,s,c,d,m,f,g])}function r1(s){Lr(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=x.useRef(rd(s)),l=x.useRef(!1),o=ns(),c=x.useMemo(()=>Mv(o.search,l.current?null:n.current),[o.search]),d=ls(),m=x.useCallback((f,g)=>{const h=rd(typeof f=="function"?f(new URLSearchParams(c)):f);l.current=!0,d("?"+h,g)},[d,c]);return[c,m]}var s1=0,a1=()=>`__${String(++s1)}__`;function n1(){let{router:s}=t0("useSubmit"),{basename:n}=x.useContext(jr),l=jv(),o=s.fetch,c=s.navigate;return x.useCallback(async(d,m={})=>{let{action:f,method:g,encType:h,formData:b,body:y}=Lv(d,n);if(m.navigate===!1){let w=m.fetcherKey||a1();await o(w,l,m.action||f,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:y,formMethod:m.method||g,formEncType:m.encType||h,flushSync:m.flushSync})}else await c(m.action||f,{unstable_defaultShouldRevalidate:m.unstable_defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:y,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 l1(s,{relative:n}={}){let{basename:l}=x.useContext(jr),o=x.useContext(Ur);wt(o,"useFormAction must be used inside a RouteContext");let[c]=o.matches.slice(-1),d={...zl(s||".",{relative:n})},m=ns();if(s==null){d.search=m.search;let f=new URLSearchParams(d.search),g=f.getAll("index");if(g.some(b=>b==="")){f.delete("index"),g.filter(y=>y).forEach(y=>f.append("index",y));let b=f.toString();d.search=b?`?${b}`:""}}return(!s||s===".")&&c.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),l!=="/"&&(d.pathname=d.pathname==="/"?l:Es([l,d.pathname])),El(d)}function i1(s,{relative:n}={}){let l=x.useContext(Fh);wt(l!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:o}=t0("useViewTransitionState"),c=zl(s,{relative:n});if(!l.isTransitioning)return!1;let d=Ts(l.currentLocation.pathname,o)||l.currentLocation.pathname,m=Ts(l.nextLocation.pathname,o)||l.nextLocation.pathname;return mo(c.pathname,m)!=null||mo(c.pathname,d)!=null}const o1=()=>window.__MCPHUB_CONFIG__||{basePath:"",version:"dev",name:"mcphub"},Ml=()=>{const n=o1().basePath||"";return n&&!n.startsWith("/")?"/"+n:n},c1=()=>Ml()+"/api",Sd=s=>{const n=c1(),l=s.startsWith("/")?s:"/"+s;return n+l},u1=async()=>{try{const s=window.location.pathname,n=[s.replace(/\/[^/]*$/,"")+"/config","/config",...s.includes("/")?[s.split("/")[1]?`/${s.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(s){return console.error("Error loading runtime config:",s),{basePath:"",version:"dev",name:"mcphub"}}},lo=[],d1=s=>{lo.push(s)},Nd=async(s,n={})=>{let l=s.toString(),o={...n};try{for(const d of lo)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 lo)d.response&&(c=await d.response(c));return c}catch(c){let d=c;for(const m of lo)m.error&&(d=await m.error(d));throw d}},vo=async(s,n={})=>{try{const l=Sd(s),o=await Nd(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"}}},Be=(s,n={})=>vo(s,{...n,method:"GET"}),pt=(s,n,l={})=>vo(s,{...l,method:"POST",headers:{"Content-Type":"application/json",...l.headers},body:n?JSON.stringify(n):void 0}),At=(s,n,l={})=>vo(s,{...l,method:"PUT",headers:{"Content-Type":"application/json",...l.headers},body:n?JSON.stringify(n):void 0}),Kr=(s,n={})=>vo(s,{...n,method:"DELETE"}),kd="mcphub_token",Rn=()=>localStorage.getItem(kd),r0=s=>{localStorage.setItem(kd,s)},fo=()=>{localStorage.removeItem(kd)},m1={request:async(s,n)=>{const l=new Headers(n.headers),o=localStorage.getItem("i18nextLng")||"en";l.set("Accept-Language",o);const c=Rn();return c&&l.set("x-auth-token",c),{url:s,config:{...n,headers:l,credentials:n.credentials??"include"}}},response:async s=>(s.status===401&&fo(),s),error:async s=>(console.error("Auth interceptor error:",s),s)},p1=()=>{d1(m1)};var f1={},Hg={};const io=Object.create(null),Sl=s=>{var n;return f1||((n=globalThis.Deno)==null?void 0:n.env.toObject())||globalThis.__env__||(s?io:globalThis)},Dr=new Proxy(io,{get(s,n){return Sl()[n]??io[n]},has(s,n){return n in Sl()||n in io},set(s,n,l){const o=Sl(!0);return o[n]=l,!0},deleteProperty(s,n){if(!n)return!1;const l=Sl(!0);return delete l[n],!0},ownKeys(){const s=Sl(!0);return Object.keys(s)}});function zt(s,n){return typeof process<"u"&&Hg?Hg[s]??n:typeof Deno<"u"?Deno.env.get(s)??n:typeof Bun<"u"?Bun.env[s]??n:n}const Nl=1,Ht=4,rs=8,wr=24,qg={eterm:Ht,cons25:Ht,console:Ht,cygwin:Ht,dtterm:Ht,gnome:Ht,hurd:Ht,jfbterm:Ht,konsole:Ht,kterm:Ht,mlterm:Ht,mosh:wr,putty:Ht,st:Ht,"rxvt-unicode-24bit":wr,terminator:wr,"xterm-kitty":wr},g1=new Map(Object.entries({APPVEYOR:rs,BUILDKITE:rs,CIRCLECI:wr,DRONE:rs,GITEA_ACTIONS:wr,GITHUB_ACTIONS:wr,GITLAB_CI:rs,TRAVIS:rs})),h1=[/ansi/,/color/,/linux/,/direct/,/^con[0-9]*x[0-9]/,/^rxvt/,/^screen/,/^xterm/,/^vt100/,/^vt220/];function x1(){if(zt("FORCE_COLOR")!==void 0)switch(zt("FORCE_COLOR")){case"":case"1":case"true":return Ht;case"2":return rs;case"3":return wr;default:return Nl}if(zt("NODE_DISABLE_COLORS")!==void 0&&zt("NODE_DISABLE_COLORS")!==""||zt("NO_COLOR")!==void 0&&zt("NO_COLOR")!==""||zt("TERM")==="dumb")return Nl;if(zt("TMUX"))return wr;if("TF_BUILD"in Dr&&"AGENT_NAME"in Dr)return Ht;if("CI"in Dr){for(const{0:s,1:n}of g1)if(s in Dr)return n;return zt("CI_NAME")==="codeship"?rs:Nl}if("TEAMCITY_VERSION"in Dr)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(zt("TEAMCITY_VERSION"))!==null?Ht:Nl;switch(zt("TERM_PROGRAM")){case"iTerm.app":return!zt("TERM_PROGRAM_VERSION")||/^[0-2]\./.exec(zt("TERM_PROGRAM_VERSION"))!==null?rs:wr;case"HyperTerm":case"MacTerm":return wr;case"Apple_Terminal":return rs}if(zt("COLORTERM")==="truecolor"||zt("COLORTERM")==="24bit")return wr;if(zt("TERM")){if(/truecolor/.exec(zt("TERM"))!==null)return wr;if(/^xterm-256/.exec(zt("TERM"))!==null)return rs;const s=zt("TERM").toLowerCase();if(qg[s])return qg[s];if(h1.some(n=>n.exec(s)!==null))return Ht}return zt("COLORTERM")?Ht:Nl}const ss={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"}},sd=["debug","info","success","warn","error"];function y1(s,n){return sd.indexOf(n)>=sd.indexOf(s)}const b1={info:ss.fg.blue,success:ss.fg.green,warn:ss.fg.yellow,error:ss.fg.red,debug:ss.fg.magenta},v1=(s,n,l)=>{const o=new Date().toISOString();return l?`${ss.dim}${o}${ss.reset} ${b1[s]}${s.toUpperCase()}${ss.reset} ${ss.bright}[Better Auth]:${ss.reset} ${n}`:`${o} ${s.toUpperCase()} [Better Auth]: ${n}`},w1=s=>{const n="error",l=x1()!==1,o=(c,d,m=[])=>{if(!y1(n,c))return;const f=v1(c,d,l);{c==="error"?console.error(f,...m):c==="warn"?console.warn(f,...m):console.log(f,...m);return}};return{...Object.fromEntries(sd.map(c=>[c,(...[d,...m])=>o(c,d,m)])),get level(){return n}}};w1();function j1(s){return s.charAt(0).toUpperCase()+s.slice(1)}var oo=class extends Error{constructor(s,n){super(s,n),this.name="BetterAuthError",this.message=s,this.stack=""}};function S1(s){try{return(new URL(s).pathname.replace(/\/+$/,"")||"/")!=="/"}catch{throw new oo(`Invalid base URL: ${s}. Please provide a valid base URL.`)}}function N1(s){try{const n=new URL(s);if(n.protocol!=="http:"&&n.protocol!=="https:")throw new oo(`Invalid base URL: ${s}. URL must include 'http://' or 'https://'`)}catch(n){throw n instanceof oo?n:new oo(`Invalid base URL: ${s}. Please provide a valid base URL.`,{cause:n})}}function Hu(s,n="/api/auth"){if(N1(s),S1(s))return s;const l=s.replace(/\/+$/,"");return!n||n==="/"?l:(n=n.startsWith("/")?n:`/${n}`,`${l}${n}`)}function k1(s,n,l,o,c){if(s)return Hu(s,n);{const d=Dr.BETTER_AUTH_URL||Dr.NEXT_PUBLIC_BETTER_AUTH_URL||Dr.PUBLIC_BETTER_AUTH_URL||Dr.NUXT_PUBLIC_BETTER_AUTH_URL||Dr.NUXT_PUBLIC_AUTH_URL||(Dr.BASE_URL!=="/"?Dr.BASE_URL:void 0);if(d)return Hu(d,n)}if(typeof window<"u"&&window.location)return Hu(window.location.origin,n)}const C1={id:"redirect",name:"Redirect",hooks:{onSuccess(s){var n,l;if((n=s.data)!=null&&n.url&&((l=s.data)!=null&&l.redirect)&&typeof window<"u"&&window.location&&window.location)try{window.location.href=s.data.url}catch{}}}},A1={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*:/},E1=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,Gg={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:Number.POSITIVE_INFINITY,"-infinity":Number.NEGATIVE_INFINITY},R1=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function T1(s){return s instanceof Date&&!isNaN(s.getTime())}function O1(s){const n=R1.exec(s);if(!n)return null;const[,l,o,c,d,m,f,g,h,b,y]=n,w=new Date(Date.UTC(parseInt(l,10),parseInt(o,10)-1,parseInt(c,10),parseInt(d,10),parseInt(m,10),parseInt(f,10),g?parseInt(g.padEnd(3,"0"),10):0));if(h){const N=(parseInt(b,10)*60+parseInt(y,10))*(h==="+"?-1:1);w.setUTCMinutes(w.getUTCMinutes()+N)}return T1(w)?w:null}function z1(s,n={}){const{strict:l=!1,warnings:o=!1,reviver:c,parseDates:d=!0}=n;if(typeof s!="string")return s;const m=s.trim();if(m.length>0&&m[0]==='"'&&m.endsWith('"')&&!m.slice(1,-1).includes('"'))return m.slice(1,-1);const f=m.toLowerCase();if(f.length<=9&&f in Gg)return Gg[f];if(!E1.test(m)){if(l)throw new SyntaxError("[better-json] Invalid JSON");return s}if(Object.entries(A1).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 y=O1(b);if(y)return y}return c?c(h,b):b})}catch(g){if(l)throw g;return s}}function M1(s,n={strict:!0}){return z1(s,n)}let qr=[],na=0;const Ji=4,s0=s=>{let n=[],l={get(){return l.lc||l.listen(()=>{})(),l.value},lc:0,listen(o){return l.lc=n.push(o),()=>{for(let d=na+Ji;d<qr.length;)qr[d]===o?qr.splice(d,Ji):d+=Ji;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(na=0;na<qr.length;na+=Ji)qr[na](qr[na+1],qr[na+2],qr[na+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:s};return l},P1=5,Qi=6,Xi=10;let D1=(s,n,l,o)=>(s.events=s.events||{},s.events[l+Xi]||(s.events[l+Xi]=o(c=>{s.events[l].reduceRight((d,m)=>(m(d),d),{shared:{},...c})})),s.events[l]=s.events[l]||[],s.events[l].push(n),()=>{let c=s.events[l],d=c.indexOf(n);c.splice(d,1),c.length||(delete s.events[l],s.events[l+Xi](),delete s.events[l+Xi])}),L1=1e3,a0=(s,n)=>D1(s,o=>{let c=n(o);c&&s.events[Qi].push(c)},P1,o=>{let c=s.listen;s.listen=(...m)=>(!s.lc&&!s.active&&(s.active=!0,o()),c(...m));let d=s.off;return s.events[Qi]=[],s.off=()=>{d(),setTimeout(()=>{if(s.active&&!s.lc){s.active=!1;for(let m of s.events[Qi])m();s.events[Qi]=[]}},L1)},()=>{s.listen=c,s.off=d}});function U1(s,n,l){let o=new Set(n).add(void 0);return s.listen((c,d,m)=>{o.has(m)&&l(c,d,m)})}const _1=()=>typeof window>"u",B1=(s,n,l,o)=>{const c=s0({data:null,error:null,isPending:!0,isRefetching:!1,refetch:f=>d(f)}),d=async f=>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,...f==null?void 0:f.query},async onSuccess(b){var y;c.set({data:b.data,error:null,isPending:!1,isRefetching:!1,refetch:c.value.refetch}),await((y=h==null?void 0:h.onSuccess)==null?void 0:y.call(h,b))},async onError(b){var S,j;const{request:y}=b,w=typeof y.retry=="number"?y.retry:(S=y.retry)==null?void 0:S.attempts,N=y.retryAttempt||0;w&&N<w||(c.set({error:b.error,data:null,isPending:!1,isRefetching:!1,refetch:c.value.refetch}),await((j=h==null?void 0:h.onError)==null?void 0:j.call(h,b)))},async onRequest(b){var w;const y=c.get();c.set({isPending:y.data===null,data:y.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)})});s=Array.isArray(s)?s:[s];let m=!1;for(const f of s)f.subscribe(async()=>{_1()||(m?await d():a0(c,()=>{const g=setTimeout(async()=>{m||(await d(),m=!0)},0);return()=>{c.off(),f.off(),clearTimeout(g)}}))});return c},qu=Symbol.for("better-auth:broadcast-channel"),I1=()=>Math.floor(Date.now()/1e3);var F1=class{constructor(s="better-auth.message"){Wr(this,"listeners",new Set);Wr(this,"name");this.name=s}subscribe(s){return this.listeners.add(s),()=>{this.listeners.delete(s)}}post(s){if(!(typeof window>"u"))try{localStorage.setItem(this.name,JSON.stringify({...s,timestamp:I1()}))}catch{}}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const s=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",s),()=>{window.removeEventListener("storage",s)}}};function Gu(s="better-auth.message"){return globalThis[qu]||(globalThis[qu]=new F1(s)),globalThis[qu]}const Ku=Symbol.for("better-auth:focus-manager");var H1=class{constructor(){Wr(this,"listeners",new Set)}subscribe(s){return this.listeners.add(s),()=>{this.listeners.delete(s)}}setFocused(s){this.listeners.forEach(n=>n(s))}setup(){if(typeof window>"u"||typeof document>"u"||typeof window.addEventListener>"u")return()=>{};const s=()=>{document.visibilityState==="visible"&&this.setFocused(!0)};return document.addEventListener("visibilitychange",s,!1),()=>{document.removeEventListener("visibilitychange",s,!1)}}};function Kg(){return globalThis[Ku]||(globalThis[Ku]=new H1),globalThis[Ku]}const Vu=Symbol.for("better-auth:online-manager");var q1=class{constructor(){Wr(this,"listeners",new Set);Wr(this,"isOnline",typeof navigator<"u"?navigator.onLine:!0)}subscribe(s){return this.listeners.add(s),()=>{this.listeners.delete(s)}}setOnline(s){this.isOnline=s,this.listeners.forEach(n=>n(s))}setup(){if(typeof window>"u"||typeof window.addEventListener>"u")return()=>{};const s=()=>this.setOnline(!0),n=()=>this.setOnline(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",s,!1),window.removeEventListener("offline",n,!1)}}};function $u(){return globalThis[Vu]||(globalThis[Vu]=new q1),globalThis[Vu]}const hn=()=>Math.floor(Date.now()/1e3),G1=5;function K1(s){var E,T,B;const{sessionAtom:n,sessionSignal:l,$fetch:o,options:c={}}=s,d=((E=c.sessionOptions)==null?void 0:E.refetchInterval)??0,m=((T=c.sessionOptions)==null?void 0:T.refetchOnWindowFocus)??!0,f=((B=c.sessionOptions)==null?void 0:B.refetchWhenOffline)??!1,g={lastSync:0,lastSessionRequest:0,cachedSession:void 0},h=()=>f||$u().isOnline,b=D=>{if(!h())return;if((D==null?void 0:D.event)==="storage"){g.lastSync=hn(),l.set(!l.get());return}const Y=n.get();if((D==null?void 0:D.event)==="poll"){g.lastSessionRequest=hn(),o("/get-session").then(R=>{R.error?n.set({...Y,data:null,error:R.error}):n.set({...Y,data:R.data,error:null}),g.lastSync=hn(),l.set(!l.get())}).catch(()=>{});return}if((D==null?void 0:D.event)==="visibilitychange"){if(hn()-g.lastSessionRequest<G1)return;g.lastSessionRequest=hn()}((Y==null?void 0:Y.data)===null||(Y==null?void 0:Y.data)===void 0||(D==null?void 0:D.event)==="visibilitychange")&&(g.lastSync=hn(),l.set(!l.get()))},y=D=>{Gu().post({event:"session",data:{trigger:D},clientId:Math.random().toString(36).substring(7)})},w=()=>{d&&d>0&&(g.pollInterval=setInterval(()=>{var D;(D=n.get())!=null&&D.data&&b({event:"poll"})},d*1e3))},N=()=>{g.unsubscribeBroadcast=Gu().subscribe(()=>{b({event:"storage"})})},S=()=>{m&&(g.unsubscribeFocus=Kg().subscribe(()=>{b({event:"visibilitychange"})}))},j=()=>{g.unsubscribeOnline=$u().subscribe(D=>{D&&b({event:"visibilitychange"})})};return{init:()=>{w(),N(),S(),j(),Gu().setup(),Kg().setup(),$u().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:y}}function V1(s,n){const l=s0(!1),o=B1(l,"/get-session",s,{method:"GET"});return a0(o,()=>{const c=K1({sessionAtom:o,sessionSignal:l,$fetch:s,options:n});return c.init(),()=>{c.cleanup()}}),{session:o,$sessionSignal:l}}var $1=Object.defineProperty,Y1=Object.defineProperties,J1=Object.getOwnPropertyDescriptors,Vg=Object.getOwnPropertySymbols,Q1=Object.prototype.hasOwnProperty,X1=Object.prototype.propertyIsEnumerable,$g=(s,n,l)=>n in s?$1(s,n,{enumerable:!0,configurable:!0,writable:!0,value:l}):s[n]=l,Gr=(s,n)=>{for(var l in n||(n={}))Q1.call(n,l)&&$g(s,l,n[l]);if(Vg)for(var l of Vg(n))X1.call(n,l)&&$g(s,l,n[l]);return s},ts=(s,n)=>Y1(s,J1(n)),Z1=class extends Error{constructor(s,n,l){super(n||s.toString(),{cause:l}),this.status=s,this.statusText=n,this.error=l,Error.captureStackTrace(this,this.constructor)}},W1=async(s,n)=>{var l,o,c,d,m,f;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:s,options:g,hooks:h};for(const b of(n==null?void 0:n.plugins)||[]){if(b.init){const y=await((l=b.init)==null?void 0:l.call(b,s.toString(),n));g=y.options||g,s=y.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((f=b.hooks)==null?void 0:f.onRetry)}return{url:s,options:g,hooks:h}},Yg=class{constructor(s){this.options=s}shouldAttemptRetry(s,n){return this.options.shouldRetry?Promise.resolve(s<this.options.attempts&&this.options.shouldRetry(n)):Promise.resolve(s<this.options.attempts)}getDelay(){return this.options.delay}},e2=class{constructor(s){this.options=s}shouldAttemptRetry(s,n){return this.options.shouldRetry?Promise.resolve(s<this.options.attempts&&this.options.shouldRetry(n)):Promise.resolve(s<this.options.attempts)}getDelay(s){return Math.min(this.options.maxDelay,this.options.baseDelay*2**s)}};function t2(s){if(typeof s=="number")return new Yg({type:"linear",attempts:s,delay:1e3});switch(s.type){case"linear":return new Yg(s);case"exponential":return new e2(s);default:throw new Error("Invalid retry strategy")}}var r2=async s=>{const n={},l=async o=>typeof o=="function"?await o():o;if(s!=null&&s.auth){if(s.auth.type==="Bearer"){const o=await l(s.auth.token);if(!o)return n;n.authorization=`Bearer ${o}`}else if(s.auth.type==="Basic"){const[o,c]=await Promise.all([l(s.auth.username),l(s.auth.password)]);if(!o||!c)return n;n.authorization=`Basic ${btoa(`${o}:${c}`)}`}else if(s.auth.type==="Custom"){const[o,c]=await Promise.all([l(s.auth.prefix),l(s.auth.value)]);if(!c)return n;n.authorization=`${o??""} ${c}`}}return n},s2=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function a2(s){const n=s.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 s2.test(o)?"json":l.has(o)||o.startsWith("text/")?"text":"blob"}function n2(s){try{return JSON.parse(s),!0}catch{return!1}}function ad(s){if(s===void 0)return!1;const n=typeof s;return n==="string"||n==="number"||n==="boolean"||n===null?!0:n!=="object"?!1:Array.isArray(s)?!0:s.buffer?!1:s.constructor&&s.constructor.name==="Object"||typeof s.toJSON=="function"}function Jg(s){try{return JSON.parse(s)}catch{return s}}function Qg(s){return typeof s=="function"}function l2(s){if(s!=null&&s.customFetchImpl)return s.customFetchImpl;if(typeof globalThis<"u"&&Qg(globalThis.fetch))return globalThis.fetch;if(typeof window<"u"&&Qg(window.fetch))return window.fetch;throw new Error("No fetch implementation found")}async function i2(s){const n=new Headers(s==null?void 0:s.headers),l=await r2(s);for(const[o,c]of Object.entries(l||{}))n.set(o,c);if(!n.has("content-type")){const o=o2(s==null?void 0:s.body);o&&n.set("content-type",o)}return n}function o2(s){return ad(s)?"application/json":null}function c2(s){if(!(s!=null&&s.body))return null;const n=new Headers(s==null?void 0:s.headers);if(ad(s.body)&&!n.has("content-type")){for(const[l,o]of Object.entries(s==null?void 0:s.body))o instanceof Date&&(s.body[l]=o.toISOString());return JSON.stringify(s.body)}return n.has("content-type")&&n.get("content-type")==="application/x-www-form-urlencoded"&&ad(s.body)?new URLSearchParams(s.body).toString():s.body}function u2(s,n){var l;if(n!=null&&n.method)return n.method.toUpperCase();if(s.startsWith("@")){const o=(l=s.split("@")[1])==null?void 0:l.split("/")[0];return l0.includes(o)?o.toUpperCase():n!=null&&n.body?"POST":"GET"}return n!=null&&n.body?"POST":"GET"}function d2(s,n){let l;return!(s!=null&&s.signal)&&(s!=null&&s.timeout)&&(l=setTimeout(()=>n==null?void 0:n.abort(),s==null?void 0:s.timeout)),{abortTimeout:l,clearTimeout:()=>{l&&clearTimeout(l)}}}var m2=class n0 extends Error{constructor(n,l){super(l||JSON.stringify(n,null,2)),this.issues=n,Object.setPrototypeOf(this,n0.prototype)}};async function co(s,n){const l=await s["~standard"].validate(n);if(l.issues)throw new m2(l.issues);return l.value}var l0=["get","post","put","patch","delete"],p2=s=>({id:"apply-schema",name:"Apply Schema",version:"1.0.0",async init(n,l){var o,c,d,m;const f=((c=(o=s.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)||s.schema;if(f){let g=n;(d=f.config)!=null&&d.prefix&&g.startsWith(f.config.prefix)&&(g=g.replace(f.config.prefix,""),f.config.baseURL&&(n=n.replace(f.config.prefix,f.config.baseURL))),(m=f.config)!=null&&m.baseURL&&g.startsWith(f.config.baseURL)&&(g=g.replace(f.config.baseURL,""));const h=f.schema[g];if(h){let b=ts(Gr({},l),{method:h.method,output:h.output});return l!=null&&l.disableValidation||(b=ts(Gr({},b),{body:h.input?await co(h.input,l==null?void 0:l.body):l==null?void 0:l.body,params:h.params?await co(h.params,l==null?void 0:l.params):l==null?void 0:l.params,query:h.query?await co(h.query,l==null?void 0:l.query):l==null?void 0:l.query})),{url:n,options:b}}}return{url:n,options:l}}}),f2=s=>{async function n(l,o){const c=ts(Gr(Gr({},s),o),{plugins:[...(s==null?void 0:s.plugins)||[],p2(s||{}),...(o==null?void 0:o.plugins)||[]]});if(s!=null&&s.catchAllError)try{return await nd(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 nd(l,c)}return n};function g2(s,n){const{baseURL:l,params:o,query:c}=n||{query:{},params:{},baseURL:""};let d=s.startsWith("http")?s.split("/").slice(0,3).join("/"):l||"";if(s.startsWith("@")){const y=s.toString().split("@")[1].split("/")[0];l0.includes(y)&&(s=s.replace(`@${y}/`,"/"))}d.endsWith("/")||(d+="/");let[m,f]=s.replace(d,"").split("?");const g=new URLSearchParams(f);for(const[y,w]of Object.entries(c||{})){if(w==null)continue;let N;if(typeof w=="string")N=w;else if(Array.isArray(w)){for(const S of w)g.append(y,S);continue}else N=JSON.stringify(w);g.set(y,N)}if(o)if(Array.isArray(o)){const y=m.split("/").filter(w=>w.startsWith(":"));for(const[w,N]of y.entries()){const S=o[w];m=m.replace(N,S)}}else for(const[y,w]of Object.entries(o))m=m.replace(`:${y}`,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 nd=async(s,n)=>{var l,o,c,d,m,f,g,h;const{hooks:b,url:y,options:w}=await W1(s,n),N=l2(w),S=new AbortController,j=(l=w.signal)!=null?l:S.signal,C=g2(y,w),z=c2(w),E=await i2(w),T=u2(y,w);let B=ts(Gr({},w),{url:C,headers:E,body:z,method:T,signal:j});for(const I of b.onRequest)if(I){const L=await I(B);typeof L=="object"&&L!==null&&(B=L)}("pipeTo"in B&&typeof B.pipeTo=="function"||typeof((o=n==null?void 0:n.body)==null?void 0:o.pipe)=="function")&&("duplex"in B||(B.duplex="half"));const{clearTimeout:D}=d2(w,S);let Y=await N(B.url,B);D();const R={response:Y,request:B};for(const I of b.onResponse)if(I){const L=await I(ts(Gr({},R),{response:(c=n==null?void 0:n.hookOptions)!=null&&c.cloneResponse?Y.clone():Y}));L instanceof Response?Y=L:typeof L=="object"&&L!==null&&(Y=L.response)}if(Y.ok){if(!(B.method!=="HEAD"))return{data:"",error:null};const L=a2(Y),Z={data:null,response:Y,request:B};if(L==="json"||L==="text"){const A=await Y.text(),H=(d=B.jsonParser)!=null?d:Jg;Z.data=await H(A)}else Z.data=await Y[L]();B!=null&&B.output&&B.output&&!B.disableValidation&&(Z.data=await co(B.output,Z.data));for(const A of b.onSuccess)A&&await A(ts(Gr({},Z),{response:(m=n==null?void 0:n.hookOptions)!=null&&m.cloneResponse?Y.clone():Y}));return n!=null&&n.throw?Z.data:{data:Z.data,error:null}}const _=(f=n==null?void 0:n.jsonParser)!=null?f:Jg,P=await Y.text(),V=n2(P),K=V?await _(P):null,G={response:Y,responseText:P,request:B,error:ts(Gr({},K),{status:Y.status,statusText:Y.statusText})};for(const I of b.onError)I&&await I(ts(Gr({},G),{response:(g=n==null?void 0:n.hookOptions)!=null&&g.cloneResponse?Y.clone():Y}));if(n!=null&&n.retry){const I=t2(n.retry),L=(h=n.retryAttempt)!=null?h:0;if(await I.shouldAttemptRetry(L,Y)){for(const A of b.onRetry)A&&await A(R);const Z=I.getDelay(L);return await new Promise(A=>setTimeout(A,Z)),await nd(s,ts(Gr({},n),{retryAttempt:L+1}))}}if(n!=null&&n.throw)throw new Z1(Y.status,Y.statusText,V?K:P);return{data:null,error:ts(Gr({},K),{status:Y.status,statusText:Y.statusText})}};const h2=(s,n)=>{var B,D,Y,R,_,P,V;const l="credentials"in Request.prototype,o=k1(s==null?void 0:s.baseURL,s==null?void 0:s.basePath)??"/api/auth",c=((B=s==null?void 0:s.plugins)==null?void 0:B.flatMap(K=>K.fetchPlugins).filter(K=>K!==void 0))||[],d={id:"lifecycle-hooks",name:"lifecycle-hooks",hooks:{onSuccess:(D=s==null?void 0:s.fetchOptions)==null?void 0:D.onSuccess,onError:(Y=s==null?void 0:s.fetchOptions)==null?void 0:Y.onError,onRequest:(R=s==null?void 0:s.fetchOptions)==null?void 0:R.onRequest,onResponse:(_=s==null?void 0:s.fetchOptions)==null?void 0:_.onResponse}},{onSuccess:m,onError:f,onRequest:g,onResponse:h,...b}=(s==null?void 0:s.fetchOptions)||{},y=f2({baseURL:o,...l?{credentials:"include"}:{},method:"GET",jsonParser(K){return K?M1(K,{strict:!1}):null},customFetchImpl:fetch,...b,plugins:[d,...b.plugins||[],...s!=null&&s.disableDefaultFetchPlugins?[]:[C1],...c]}),{$sessionSignal:w,session:N}=V1(y,s),S=(s==null?void 0:s.plugins)||[],j={},C={$sessionSignal:w,session:N},z={"/sign-out":"POST","/revoke-sessions":"POST","/revoke-other-sessions":"POST","/delete-user":"POST"},E=[{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 S)K.getAtoms&&Object.assign(C,(P=K.getAtoms)==null?void 0:P.call(K,y)),K.pathMethods&&Object.assign(z,K.pathMethods),K.atomListeners&&E.push(...K.atomListeners);const T={notify:K=>{C[K].set(!C[K].get())},listen:(K,G)=>{C[K].subscribe(G)},atoms:C};for(const K of S)K.getActions&&Object.assign(j,(V=K.getActions)==null?void 0:V.call(K,y,T,s));return{get baseURL(){return o},pluginsActions:j,pluginsAtoms:C,pluginPathMethods:z,atomListeners:E,$fetch:y,$store:T}};function x2(s){return typeof s=="object"&&s!==null&&"get"in s&&typeof s.get=="function"&&"lc"in s&&typeof s.lc=="number"}function y2(s,n,l){const o=n[s],{fetchOptions:c,query:d,...m}=l||{};return o||(c!=null&&c.method?c.method:m&&Object.keys(m).length>0?"POST":"GET")}function b2(s,n,l,o,c){function d(m=[]){return new Proxy(function(){},{get(f,g){if(typeof g!="string"||g==="then"||g==="catch"||g==="finally")return;const h=[...m,g];let b=s;for(const y of h)if(b&&typeof b=="object"&&y in b)b=b[y];else{b=void 0;break}return typeof b=="function"||x2(b)?b:d(h)},apply:async(f,g,h)=>{const b="/"+m.map(E=>E.replace(/[A-Z]/g,T=>`-${T.toLowerCase()}`)).join("/"),y=h[0]||{},w=h[1]||{},{query:N,fetchOptions:S,...j}=y,C={...w,...S},z=y2(b,l,y);return await n(b,{...C,body:z==="GET"?void 0:{...j,...(C==null?void 0:C.body)||{}},query:N||(C==null?void 0:C.query),method:z,async onSuccess(E){var D;if(await((D=C==null?void 0:C.onSuccess)==null?void 0:D.call(C,E)),!c||C.disableSignal)return;const T=c.filter(Y=>Y.matcher(b));if(!T.length)return;const B=new Set;for(const Y of T){const R=o[Y.signal];if(!R)return;if(B.has(Y.signal))continue;B.add(Y.signal);const _=R.get();setTimeout(()=>{R.set(!_)},10)}}})}})}return d()}function v2(s,n={}){const l=x.useRef(s.get()),{keys:o,deps:c=[s,o]}=n,d=x.useCallback(f=>{const g=h=>{l.current!==h&&(l.current=h,f())};return g(s.value),o!=null&&o.length?U1(s,o,g):s.listen(g)},c),m=()=>l.current;return x.useSyncExternalStore(d,m,m)}function w2(s){return`use${j1(s)}`}function j2(s){const{pluginPathMethods:n,pluginsActions:l,pluginsAtoms:o,$fetch:c,$store:d,atomListeners:m}=h2(s),f={};for(const[g,h]of Object.entries(o))f[w2(g)]=()=>v2(h);return b2({...l,...f,$fetch:c,$store:d},c,n,o,m)}const S2=s=>s?s.startsWith("/")?s:`/${s}`:"/api/auth/better",N2=s=>{if(typeof window>"u")return"";const n=Ml(),l=S2(s||"/api/auth/better");return`${window.location.origin}${n}${l}`},i0=s=>j2({baseURL:N2(s),fetchOptions:{credentials:"include"}}),k2=i0(),C2=async s=>{try{const n=await pt("/auth/login",s);return n.success&&n.token?(r0(n.token),n):{success:!1,message:n.message||"Login failed"}}catch(n){return console.error("Login error",{error:n}),{success:!1,message:n instanceof Error?n.message:"An error occurred during login"}}},A2=async s=>{try{const n=await pt("/auth/register",s);return n.success&&n.token?(r0(n.token),n):{success:!1,message:n.message||"Registration failed"}}catch(n){return console.error("Register error",{error:n}),{success:!1,message:"An error occurred during registration"}}},E2=async()=>{if(!Rn())return{success:!1,message:"No authentication token"};try{return await Be("/auth/user")}catch(n){return console.error("Get current user error",{error:n}),{success:!1,message:"An error occurred while fetching user data"}}},Yu=async()=>{try{return await Be("/better-auth/user")}catch(s){return console.error("Get Better Auth user error",{error:s}),{success:!1,message:"An error occurred while fetching user data"}}},R2=async s=>{if(!Rn())return{success:!1,message:"No authentication token"};try{return await pt("/auth/change-password",s)}catch(l){return console.error("Change password error",{error:l}),{success:!1,message:"An error occurred while changing password"}}},T2=()=>{fo(),k2.signOut().catch(s=>{console.debug("Better Auth sign out failed",{error:s})})},o0=async()=>{var s,n,l;try{const o=Ml(),c=await Nd(`${o}/public-config`,{method:"GET",headers:{"Content-Type":"application/json"}});if(c.ok){const d=await c.json();return{skipAuth:((s=d.data)==null?void 0:s.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}}},es={isAuthenticated:!1,loading:!0,user:null,error:null},c0=x.createContext({auth:es,login:async()=>({success:!1}),register:async()=>!1,logout:()=>{}}),O2=({children:s})=>{const[n,l]=x.useState(es);x.useEffect(()=>{(async()=>{const{skipAuth:f,permissions:g}=await o0();if(f){l({isAuthenticated:!0,loading:!1,user:{username:"guest",isAdmin:!0,permissions:g},error:null});return}if(!Rn()){const b=await Yu();if(b.success&&b.user){l({isAuthenticated:!0,loading:!1,user:b.user,error:null});return}l({...es,loading:!1});return}try{const b=await E2();if(b.success&&b.user)l({isAuthenticated:!0,loading:!1,user:b.user,error:null});else{fo();const y=await Yu();y.success&&y.user?l({isAuthenticated:!0,loading:!1,user:y.user,error:null}):l({...es,loading:!1})}}catch{fo();const y=await Yu();y.success&&y.user?l({isAuthenticated:!0,loading:!1,user:y.user,error:null}):l({...es,loading:!1})}})()},[]);const o=async(m,f)=>{try{const g=await C2({username:m,password:f});return g.success&&g.token&&g.user?(l({isAuthenticated:!0,loading:!1,user:g.user,error:null}),{success:!0,isUsingDefaultPassword:g.isUsingDefaultPassword}):(l({...es,loading:!1,error:g.message||"Authentication failed"}),{success:!1,message:g.message})}catch(g){return l({...es,loading:!1,error:"Authentication failed"}),{success:!1,message:g instanceof Error?g.message:void 0}}},c=async(m,f,g=!1)=>{try{const h=await A2({username:m,password:f,isAdmin:g});return h.success&&h.token&&h.user?(l({isAuthenticated:!0,loading:!1,user:h.user,error:null}),!0):(l({...es,loading:!1,error:h.message||"Registration failed"}),!1)}catch{return l({...es,loading:!1,error:"Registration failed"}),!1}},d=()=>{T2(),l({...es,loading:!1})};return t.jsx(c0.Provider,{value:{auth:n,login:o,register:c,logout:d},children:s})},is=()=>x.useContext(c0),z2=(s,n,l,o)=>{var d,m,f,g;const c=[l,{code:n,...o||{}}];if((m=(d=s==null?void 0:s.services)==null?void 0:d.logger)!=null&&m.forward)return s.services.logger.forward(c,"warn","react-i18next::",!0);Ra(c[0])&&(c[0]=`react-i18next:: ${c[0]}`),(g=(f=s==null?void 0:s.services)==null?void 0:f.logger)!=null&&g.warn?s.services.logger.warn(...c):console!=null&&console.warn&&console.warn(...c)},Xg={},ld=(s,n,l,o)=>{Ra(l)&&Xg[l]||(Ra(l)&&(Xg[l]=new Date),z2(s,n,l,o))},u0=(s,n)=>()=>{if(s.isInitialized)n();else{const l=()=>{setTimeout(()=>{s.off("initialized",l)},0),n()};s.on("initialized",l)}},id=(s,n,l)=>{s.loadNamespaces(n,u0(s,l))},Zg=(s,n,l,o)=>{if(Ra(l)&&(l=[l]),s.options.preload&&s.options.preload.indexOf(n)>-1)return id(s,l,o);l.forEach(c=>{s.options.ns.indexOf(c)<0&&s.options.ns.push(c)}),s.loadLanguages(n,u0(s,o))},M2=(s,n,l={})=>!n.languages||!n.languages.length?(ld(n,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:n.languages}),!0):n.hasLoadedNamespace(s,{lng:l.lng,precheck:(o,c)=>{if(l.bindI18n&&l.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!c(o.isLanguageChangingTo,s))return!1}}),Ra=s=>typeof s=="string",P2=s=>typeof s=="object"&&s!==null,D2=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,L2={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},U2=s=>L2[s],_2=s=>s.replace(D2,U2);let od={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:_2};const B2=(s={})=>{od={...od,...s}},I2=()=>od;let d0;const F2=s=>{d0=s},H2=()=>d0,q2={type:"3rdParty",init(s){B2(s.options.react),F2(s)}},G2=x.createContext();class K2{constructor(){this.usedNamespaces={}}addUsedNamespaces(n){n.forEach(l=>{this.usedNamespaces[l]||(this.usedNamespaces[l]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const V2=(s,n)=>{const l=x.useRef();return x.useEffect(()=>{l.current=s},[s,n]),l.current},m0=(s,n,l,o)=>s.getFixedT(n,l,o),$2=(s,n,l,o)=>x.useCallback(m0(s,n,l,o),[s,n,l,o]),ve=(s,n={})=>{var B,D,Y,R;const{i18n:l}=n,{i18n:o,defaultNS:c}=x.useContext(G2)||{},d=l||o||H2();if(d&&!d.reportNamespaces&&(d.reportNamespaces=new K2),!d){ld(d,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const _=(V,K)=>Ra(K)?K:P2(K)&&Ra(K.defaultValue)?K.defaultValue:Array.isArray(V)?V[V.length-1]:V,P=[_,{},!1];return P.t=_,P.i18n={},P.ready=!1,P}(B=d.options.react)!=null&&B.wait&&ld(d,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const m={...I2(),...d.options.react,...n},{useSuspense:f,keyPrefix:g}=m;let h=c||((D=d.options)==null?void 0:D.defaultNS);h=Ra(h)?[h]:h||["translation"],(R=(Y=d.reportNamespaces).addUsedNamespaces)==null||R.call(Y,h);const b=(d.isInitialized||d.initializedStoreOnce)&&h.every(_=>M2(_,d,m)),y=$2(d,n.lng||null,m.nsMode==="fallback"?h:h[0],g),w=()=>y,N=()=>m0(d,n.lng||null,m.nsMode==="fallback"?h:h[0],g),[S,j]=x.useState(w);let C=h.join();n.lng&&(C=`${n.lng}${C}`);const z=V2(C),E=x.useRef(!0);x.useEffect(()=>{const{bindI18n:_,bindI18nStore:P}=m;E.current=!0,!b&&!f&&(n.lng?Zg(d,n.lng,h,()=>{E.current&&j(N)}):id(d,h,()=>{E.current&&j(N)})),b&&z&&z!==C&&E.current&&j(N);const V=()=>{E.current&&j(N)};return _&&(d==null||d.on(_,V)),P&&(d==null||d.store.on(P,V)),()=>{E.current=!1,d&&_&&(_==null||_.split(" ").forEach(K=>d.off(K,V))),P&&d&&P.split(" ").forEach(K=>d.store.off(K,V))}},[d,C]),x.useEffect(()=>{E.current&&b&&j(w)},[d,g,b]);const T=[S,d,b];if(T.t=S,T.i18n=d,T.ready=b,b||!b&&!f)return T;throw new Promise(_=>{n.lng?Zg(d,n.lng,h,()=>_()):id(d,h,()=>_())})};/**
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 Y2=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),J2=s=>s.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,l,o)=>o?o.toUpperCase():l.toLowerCase()),Wg=s=>{const n=J2(s);return n.charAt(0).toUpperCase()+n.slice(1)},p0=(...s)=>s.filter((n,l,o)=>!!n&&n.trim()!==""&&o.indexOf(n)===l).join(" ").trim(),Q2=s=>{for(const n in s)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 X2={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=x.forwardRef(({color:s="currentColor",size:n=24,strokeWidth:l=2,absoluteStrokeWidth:o,className:c="",children:d,iconNode:m,...f},g)=>x.createElement("svg",{ref:g,...X2,width:n,height:n,stroke:s,strokeWidth:o?Number(l)*24/Number(n):l,className:p0("lucide",c),...!d&&!Q2(f)&&{"aria-hidden":"true"},...f},[...m.map(([h,b])=>x.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 et=(s,n)=>{const l=x.forwardRef(({className:o,...c},d)=>x.createElement(Z2,{ref:d,iconNode:n,className:p0(`lucide-${Y2(Wg(s))}`,`lucide-${s}`,o),...c}));return l.displayName=Wg(s),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 W2=[["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"}]],f0=et("book-open",W2);/**
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 ew=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Os=et("check",ew);/**
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 tw=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ca=et("chevron-down",tw);/**
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 rw=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],wo=et("chevron-right",rw);/**
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 sw=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],g0=et("chevron-up",sw);/**
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 aw=[["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"}]],Cd=et("circle-alert",aw);/**
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 nw=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],h0=et("circle-check-big",nw);/**
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 lw=[["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"}]],x0=et("circle-x",lw);/**
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 iw=[["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"}]],jn=et("copy",iw);/**
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 ow=[["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"}]],cw=et("download",ow);/**
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 uw=[["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"}]],dw=et("file-code",uw);/**
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 mw=[["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 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Sn=et("file-text",mw);/**
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 pw=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],fw=et("info",pw);/**
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 gw=[["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"}]],hw=et("link",gw);/**
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 xw=[["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"}]],y0=et("loader",xw);/**
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 yw=[["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"}]],bw=et("log-out",yw);/**
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 vw=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Nn=et("message-square",vw);/**
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 ww=[["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"}]],jw=et("moon",ww);/**
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 Sw=[["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"}]],b0=et("play",Sw);/**
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 Nw=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Ad=et("plus",Nw);/**
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 kw=[["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"}]],Cw=et("refresh-cw",kw);/**
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 Aw=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Ew=et("rotate-ccw",Aw);/**
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 Rw=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Tw=et("settings",Rw);/**
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 Ow=[["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"}]],ua=et("square-pen",Ow);/**
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 zw=[["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"}]],Mw=et("sun",zw);/**
206
- * @license lucide-react v0.552.0 - ISC
207
- *
208
- * This source code is licensed under the ISC license.
209
- * See the LICENSE file in the root directory of this source tree.
210
- */const Pw=[["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"}]],Dw=et("trash-2",Pw);/**
211
- * @license lucide-react v0.552.0 - ISC
212
- *
213
- * This source code is licensed under the ISC license.
214
- * See the LICENSE file in the root directory of this source tree.
215
- */const Lw=[["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"}]],jo=et("trash",Lw);/**
216
- * @license lucide-react v0.552.0 - ISC
217
- *
218
- * This source code is licensed under the ISC license.
219
- * See the LICENSE file in the root directory of this source tree.
220
- */const Uw=[["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"}]],v0=et("user",Uw);/**
221
- * @license lucide-react v0.552.0 - ISC
222
- *
223
- * This source code is licensed under the ISC license.
224
- * See the LICENSE file in the root directory of this source tree.
225
- */const _w=[["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"}]],Ed=et("wrench",_w);/**
226
- * @license lucide-react v0.552.0 - ISC
227
- *
228
- * This source code is licensed under the ISC license.
229
- * See the LICENSE file in the root directory of this source tree.
230
- */const Bw=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],zs=et("x",Bw);function w0(s){var n,l,o="";if(typeof s=="string"||typeof s=="number")o+=s;else if(typeof s=="object")if(Array.isArray(s)){var c=s.length;for(n=0;n<c;n++)s[n]&&(l=w0(s[n]))&&(o&&(o+=" "),o+=l)}else for(l in s)s[l]&&(o&&(o+=" "),o+=l);return o}function Iw(){for(var s,n,l=0,o="",c=arguments.length;l<c;l++)(s=arguments[l])&&(n=w0(s))&&(o&&(o+=" "),o+=n);return o}const Rd="-",Fw=s=>{const n=qw(s),{conflictingClassGroups:l,conflictingClassGroupModifiers:o}=s;return{getClassGroupId:m=>{const f=m.split(Rd);return f[0]===""&&f.length!==1&&f.shift(),j0(f,n)||Hw(m)},getConflictingClassGroupIds:(m,f)=>{const g=l[m]||[];return f&&o[m]?[...g,...o[m]]:g}}},j0=(s,n)=>{var m;if(s.length===0)return n.classGroupId;const l=s[0],o=n.nextPart.get(l),c=o?j0(s.slice(1),o):void 0;if(c)return c;if(n.validators.length===0)return;const d=s.join(Rd);return(m=n.validators.find(({validator:f})=>f(d)))==null?void 0:m.classGroupId},eh=/^\[(.+)\]$/,Hw=s=>{if(eh.test(s)){const n=eh.exec(s)[1],l=n==null?void 0:n.substring(0,n.indexOf(":"));if(l)return"arbitrary.."+l}},qw=s=>{const{theme:n,classGroups:l}=s,o={nextPart:new Map,validators:[]};for(const c in l)cd(l[c],o,c,n);return o},cd=(s,n,l,o)=>{s.forEach(c=>{if(typeof c=="string"){const d=c===""?n:th(n,c);d.classGroupId=l;return}if(typeof c=="function"){if(Gw(c)){cd(c(o),n,l,o);return}n.validators.push({validator:c,classGroupId:l});return}Object.entries(c).forEach(([d,m])=>{cd(m,th(n,d),l,o)})})},th=(s,n)=>{let l=s;return n.split(Rd).forEach(o=>{l.nextPart.has(o)||l.nextPart.set(o,{nextPart:new Map,validators:[]}),l=l.nextPart.get(o)}),l},Gw=s=>s.isThemeGetter,Kw=s=>{if(s<1)return{get:()=>{},set:()=>{}};let n=0,l=new Map,o=new Map;const c=(d,m)=>{l.set(d,m),n++,n>s&&(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)}}},ud="!",dd=":",Vw=dd.length,$w=s=>{const{prefix:n,experimentalParseClassName:l}=s;let o=c=>{const d=[];let m=0,f=0,g=0,h;for(let S=0;S<c.length;S++){let j=c[S];if(m===0&&f===0){if(j===dd){d.push(c.slice(g,S)),g=S+Vw;continue}if(j==="/"){h=S;continue}}j==="["?m++:j==="]"?m--:j==="("?f++:j===")"&&f--}const b=d.length===0?c:c.substring(g),y=Yw(b),w=y!==b,N=h&&h>g?h-g:void 0;return{modifiers:d,hasImportantModifier:w,baseClassName:y,maybePostfixModifierPosition:N}};if(n){const c=n+dd,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},Yw=s=>s.endsWith(ud)?s.substring(0,s.length-1):s.startsWith(ud)?s.substring(1):s,Jw=s=>{const n=Object.fromEntries(s.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}},Qw=s=>({cache:Kw(s.cacheSize),parseClassName:$w(s),sortModifiers:Jw(s),...Fw(s)}),Xw=/\s+/,Zw=(s,n)=>{const{parseClassName:l,getClassGroupId:o,getConflictingClassGroupIds:c,sortModifiers:d}=n,m=[],f=s.trim().split(Xw);let g="";for(let h=f.length-1;h>=0;h-=1){const b=f[h],{isExternal:y,modifiers:w,hasImportantModifier:N,baseClassName:S,maybePostfixModifierPosition:j}=l(b);if(y){g=b+(g.length>0?" "+g:g);continue}let C=!!j,z=o(C?S.substring(0,j):S);if(!z){if(!C){g=b+(g.length>0?" "+g:g);continue}if(z=o(S),!z){g=b+(g.length>0?" "+g:g);continue}C=!1}const E=d(w).join(":"),T=N?E+ud:E,B=T+z;if(m.includes(B))continue;m.push(B);const D=c(z,C);for(let Y=0;Y<D.length;++Y){const R=D[Y];m.push(T+R)}g=b+(g.length>0?" "+g:g)}return g};function Ww(){let s=0,n,l,o="";for(;s<arguments.length;)(n=arguments[s++])&&(l=S0(n))&&(o&&(o+=" "),o+=l);return o}const S0=s=>{if(typeof s=="string")return s;let n,l="";for(let o=0;o<s.length;o++)s[o]&&(n=S0(s[o]))&&(l&&(l+=" "),l+=n);return l};function ej(s,...n){let l,o,c,d=m;function m(g){const h=n.reduce((b,y)=>y(b),s());return l=Qw(h),o=l.cache.get,c=l.cache.set,d=f,f(g)}function f(g){const h=o(g);if(h)return h;const b=Zw(g,l);return c(g,b),b}return function(){return d(Ww.apply(null,arguments))}}const Ut=s=>{const n=l=>l[s]||[];return n.isThemeGetter=!0,n},N0=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,k0=/^\((?:(\w[\w-]*):)?(.+)\)$/i,tj=/^\d+\/\d+$/,rj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sj=/\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$/,aj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,nj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xn=s=>tj.test(s),Fe=s=>!!s&&!Number.isNaN(Number(s)),la=s=>!!s&&Number.isInteger(Number(s)),Ju=s=>s.endsWith("%")&&Fe(s.slice(0,-1)),Cs=s=>rj.test(s),ij=()=>!0,oj=s=>sj.test(s)&&!aj.test(s),C0=()=>!1,cj=s=>nj.test(s),uj=s=>lj.test(s),dj=s=>!Ae(s)&&!Ee(s),mj=s=>Tn(s,R0,C0),Ae=s=>N0.test(s),Ea=s=>Tn(s,T0,oj),Qu=s=>Tn(s,xj,Fe),rh=s=>Tn(s,A0,C0),pj=s=>Tn(s,E0,uj),Zi=s=>Tn(s,O0,cj),Ee=s=>k0.test(s),kl=s=>On(s,T0),fj=s=>On(s,yj),sh=s=>On(s,A0),gj=s=>On(s,R0),hj=s=>On(s,E0),Wi=s=>On(s,O0,!0),Tn=(s,n,l)=>{const o=N0.exec(s);return o?o[1]?n(o[1]):l(o[2]):!1},On=(s,n,l=!1)=>{const o=k0.exec(s);return o?o[1]?n(o[1]):l:!1},A0=s=>s==="position"||s==="percentage",E0=s=>s==="image"||s==="url",R0=s=>s==="length"||s==="size"||s==="bg-size",T0=s=>s==="length",xj=s=>s==="number",yj=s=>s==="family-name",O0=s=>s==="shadow",bj=()=>{const s=Ut("color"),n=Ut("font"),l=Ut("text"),o=Ut("font-weight"),c=Ut("tracking"),d=Ut("leading"),m=Ut("breakpoint"),f=Ut("container"),g=Ut("spacing"),h=Ut("radius"),b=Ut("shadow"),y=Ut("inset-shadow"),w=Ut("text-shadow"),N=Ut("drop-shadow"),S=Ut("blur"),j=Ut("perspective"),C=Ut("aspect"),z=Ut("ease"),E=Ut("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...B(),Ee,Ae],Y=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],_=()=>[Ee,Ae,g],P=()=>[xn,"full","auto",..._()],V=()=>[la,"none","subgrid",Ee,Ae],K=()=>["auto",{span:["full",la,Ee,Ae]},la,Ee,Ae],G=()=>[la,"auto",Ee,Ae],I=()=>["auto","min","max","fr",Ee,Ae],L=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Z=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",..._()],H=()=>[xn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",..._()],J=()=>[s,Ee,Ae],me=()=>[...B(),sh,rh,{position:[Ee,Ae]}],le=()=>["no-repeat",{repeat:["","x","y","space","round"]}],k=()=>["auto","cover","contain",gj,mj,{size:[Ee,Ae]}],U=()=>[Ju,kl,Ea],M=()=>["","none","full",h,Ee,Ae],q=()=>["",Fe,kl,Ea],de=()=>["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"],X=()=>[Fe,Ju,sh,rh],he=()=>["","none",S,Ee,Ae],ae=()=>["none",Fe,Ee,Ae],ye=()=>["none",Fe,Ee,Ae],ie=()=>[Fe,Ee,Ae],se=()=>[xn,"full",..._()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Cs],breakpoint:[Cs],color:[ij],container:[Cs],"drop-shadow":[Cs],ease:["in","out","in-out"],font:[dj],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Cs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Cs],shadow:[Cs],spacing:["px",Fe],text:[Cs],"text-shadow":[Cs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xn,Ae,Ee,C]}],container:["container"],columns:[{columns:[Fe,Ae,Ee,f]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:D()}],overflow:[{overflow:Y()}],"overflow-x":[{"overflow-x":Y()}],"overflow-y":[{"overflow-y":Y()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:P()}],"inset-x":[{"inset-x":P()}],"inset-y":[{"inset-y":P()}],start:[{start:P()}],end:[{end:P()}],top:[{top:P()}],right:[{right:P()}],bottom:[{bottom:P()}],left:[{left:P()}],visibility:["visible","invisible","collapse"],z:[{z:[la,"auto",Ee,Ae]}],basis:[{basis:[xn,"full","auto",f,..._()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Fe,xn,"auto","initial","none",Ae]}],grow:[{grow:["",Fe,Ee,Ae]}],shrink:[{shrink:["",Fe,Ee,Ae]}],order:[{order:[la,"first","last","none",Ee,Ae]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":I()}],"auto-rows":[{"auto-rows":I()}],gap:[{gap:_()}],"gap-x":[{"gap-x":_()}],"gap-y":[{"gap-y":_()}],"justify-content":[{justify:[...L(),"normal"]}],"justify-items":[{"justify-items":[...Z(),"normal"]}],"justify-self":[{"justify-self":["auto",...Z()]}],"align-content":[{content:["normal",...L()]}],"align-items":[{items:[...Z(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Z(),{baseline:["","last"]}]}],"place-content":[{"place-content":L()}],"place-items":[{"place-items":[...Z(),"baseline"]}],"place-self":[{"place-self":["auto",...Z()]}],p:[{p:_()}],px:[{px:_()}],py:[{py:_()}],ps:[{ps:_()}],pe:[{pe:_()}],pt:[{pt:_()}],pr:[{pr:_()}],pb:[{pb:_()}],pl:[{pl:_()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":_()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":_()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[f,"screen",...H()]}],"min-w":[{"min-w":[f,"screen","none",...H()]}],"max-w":[{"max-w":[f,"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,kl,Ea]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,Ee,Qu]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ju,Ae]}],"font-family":[{font:[fj,Ae,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,Ee,Ae]}],"line-clamp":[{"line-clamp":[Fe,"none",Ee,Qu]}],leading:[{leading:[d,..._()]}],"list-image":[{"list-image":["none",Ee,Ae]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ee,Ae]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:J()}],"text-color":[{text:J()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[Fe,"from-font","auto",Ee,Ea]}],"text-decoration-color":[{decoration:J()}],"underline-offset":[{"underline-offset":[Fe,"auto",Ee,Ae]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:_()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee,Ae]}],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",Ee,Ae]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:me()}],"bg-repeat":[{bg:le()}],"bg-size":[{bg:k()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},la,Ee,Ae],radial:["",Ee,Ae],conic:[la,Ee,Ae]},hj,pj]}],"bg-color":[{bg:J()}],"gradient-from-pos":[{from:U()}],"gradient-via-pos":[{via:U()}],"gradient-to-pos":[{to:U()}],"gradient-from":[{from:J()}],"gradient-via":[{via:J()}],"gradient-to":[{to:J()}],rounded:[{rounded:M()}],"rounded-s":[{"rounded-s":M()}],"rounded-e":[{"rounded-e":M()}],"rounded-t":[{"rounded-t":M()}],"rounded-r":[{"rounded-r":M()}],"rounded-b":[{"rounded-b":M()}],"rounded-l":[{"rounded-l":M()}],"rounded-ss":[{"rounded-ss":M()}],"rounded-se":[{"rounded-se":M()}],"rounded-ee":[{"rounded-ee":M()}],"rounded-es":[{"rounded-es":M()}],"rounded-tl":[{"rounded-tl":M()}],"rounded-tr":[{"rounded-tr":M()}],"rounded-br":[{"rounded-br":M()}],"rounded-bl":[{"rounded-bl":M()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:J()}],"border-color-x":[{"border-x":J()}],"border-color-y":[{"border-y":J()}],"border-color-s":[{"border-s":J()}],"border-color-e":[{"border-e":J()}],"border-color-t":[{"border-t":J()}],"border-color-r":[{"border-r":J()}],"border-color-b":[{"border-b":J()}],"border-color-l":[{"border-l":J()}],"divide-color":[{divide:J()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Fe,Ee,Ae]}],"outline-w":[{outline:["",Fe,kl,Ea]}],"outline-color":[{outline:J()}],shadow:[{shadow:["","none",b,Wi,Zi]}],"shadow-color":[{shadow:J()}],"inset-shadow":[{"inset-shadow":["none",y,Wi,Zi]}],"inset-shadow-color":[{"inset-shadow":J()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:J()}],"ring-offset-w":[{"ring-offset":[Fe,Ea]}],"ring-offset-color":[{"ring-offset":J()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":J()}],"text-shadow":[{"text-shadow":["none",w,Wi,Zi]}],"text-shadow-color":[{"text-shadow":J()}],opacity:[{opacity:[Fe,Ee,Ae]}],"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":[Fe]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":J()}],"mask-image-linear-to-color":[{"mask-linear-to":J()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":J()}],"mask-image-t-to-color":[{"mask-t-to":J()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":J()}],"mask-image-r-to-color":[{"mask-r-to":J()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":J()}],"mask-image-b-to-color":[{"mask-b-to":J()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":J()}],"mask-image-l-to-color":[{"mask-l-to":J()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":J()}],"mask-image-x-to-color":[{"mask-x-to":J()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":J()}],"mask-image-y-to-color":[{"mask-y-to":J()}],"mask-image-radial":[{"mask-radial":[Ee,Ae]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":J()}],"mask-image-radial-to-color":[{"mask-radial-to":J()}],"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":B()}],"mask-image-conic-pos":[{"mask-conic":[Fe]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":J()}],"mask-image-conic-to-color":[{"mask-conic-to":J()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:me()}],"mask-repeat":[{mask:le()}],"mask-size":[{mask:k()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ee,Ae]}],filter:[{filter:["","none",Ee,Ae]}],blur:[{blur:he()}],brightness:[{brightness:[Fe,Ee,Ae]}],contrast:[{contrast:[Fe,Ee,Ae]}],"drop-shadow":[{"drop-shadow":["","none",N,Wi,Zi]}],"drop-shadow-color":[{"drop-shadow":J()}],grayscale:[{grayscale:["",Fe,Ee,Ae]}],"hue-rotate":[{"hue-rotate":[Fe,Ee,Ae]}],invert:[{invert:["",Fe,Ee,Ae]}],saturate:[{saturate:[Fe,Ee,Ae]}],sepia:[{sepia:["",Fe,Ee,Ae]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,Ae]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[Fe,Ee,Ae]}],"backdrop-contrast":[{"backdrop-contrast":[Fe,Ee,Ae]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Fe,Ee,Ae]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Fe,Ee,Ae]}],"backdrop-invert":[{"backdrop-invert":["",Fe,Ee,Ae]}],"backdrop-opacity":[{"backdrop-opacity":[Fe,Ee,Ae]}],"backdrop-saturate":[{"backdrop-saturate":[Fe,Ee,Ae]}],"backdrop-sepia":[{"backdrop-sepia":["",Fe,Ee,Ae]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":_()}],"border-spacing-x":[{"border-spacing-x":_()}],"border-spacing-y":[{"border-spacing-y":_()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ee,Ae]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Fe,"initial",Ee,Ae]}],ease:[{ease:["linear","initial",z,Ee,Ae]}],delay:[{delay:[Fe,Ee,Ae]}],animate:[{animate:["none",E,Ee,Ae]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[j,Ee,Ae]}],"perspective-origin":[{"perspective-origin":D()}],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:ie()}],"skew-x":[{"skew-x":ie()}],"skew-y":[{"skew-y":ie()}],transform:[{transform:[Ee,Ae,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:se()}],"translate-x":[{"translate-x":se()}],"translate-y":[{"translate-y":se()}],"translate-z":[{"translate-z":se()}],"translate-none":["translate-none"],accent:[{accent:J()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:J()}],"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",Ee,Ae]}],"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":_()}],"scroll-mx":[{"scroll-mx":_()}],"scroll-my":[{"scroll-my":_()}],"scroll-ms":[{"scroll-ms":_()}],"scroll-me":[{"scroll-me":_()}],"scroll-mt":[{"scroll-mt":_()}],"scroll-mr":[{"scroll-mr":_()}],"scroll-mb":[{"scroll-mb":_()}],"scroll-ml":[{"scroll-ml":_()}],"scroll-p":[{"scroll-p":_()}],"scroll-px":[{"scroll-px":_()}],"scroll-py":[{"scroll-py":_()}],"scroll-ps":[{"scroll-ps":_()}],"scroll-pe":[{"scroll-pe":_()}],"scroll-pt":[{"scroll-pt":_()}],"scroll-pr":[{"scroll-pr":_()}],"scroll-pb":[{"scroll-pb":_()}],"scroll-pl":[{"scroll-pl":_()}],"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",Ee,Ae]}],fill:[{fill:["none",...J()]}],"stroke-w":[{stroke:[Fe,kl,Ea,Qu]}],stroke:[{stroke:["none",...J()]}],"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"]}},vj=ej(bj);function Rs(...s){return vj(Iw(s))}const wj=({message:s,type:n="info",duration:l=3e3,onClose:o,visible:c})=>{const{t:d}=ve();x.useEffect(()=>{if(c){const b=setTimeout(()=>{o()},l);return()=>clearTimeout(b)}},[c,l,o]);const m={success:t.jsx(Os,{className:"w-5 h-5 text-green-500"}),error:t.jsx(zs,{className:"w-5 h-5 text-red-500"}),info:t.jsx("svg",{className:"w-5 h-5 text-blue-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.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:t.jsx("svg",{className:"w-5 h-5 text-yellow-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.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"})})},f={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"},h={success:"border-l-4 border-l-green-500",error:"border-l-4 border-l-red-600",info:"border-l-4 border-l-blue-500",warning:"border-l-4 border-l-yellow-500"};return t.jsx("div",{className:Rs("fixed top-4 right-4 z-50 max-w-sm p-4 rounded-md shadow-lg border",f[n],h[n],"transform transition-all duration-300 ease-in-out",c?"translate-x-0 opacity-100":"translate-x-full opacity-0"),children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"flex-shrink-0",children:m[n]}),t.jsx("div",{className:"ml-3",children:t.jsx("p",{className:Rs("text-sm font-medium",g[n]),children:s})}),t.jsx("div",{className:"ml-auto pl-3",children:t.jsx("div",{className:"-mx-1.5 -my-1.5",children:t.jsxs("button",{onClick:o,className:Rs("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:[t.jsx("span",{className:"sr-only",children:d("common.dismiss")}),t.jsx(zs,{className:"h-5 w-5"})]})})})]})})},z0=x.createContext(void 0),Ms=()=>{const s=x.useContext(z0);if(!s)throw new Error("useToast must be used within a ToastProvider");return s},jj=({children:s})=>{const[n,l]=x.useState({message:"",type:"info",visible:!1,duration:3e3}),o=x.useCallback((d,m="info",f=3e3)=>{l({message:d,type:m,visible:!0,duration:f})},[]),c=x.useCallback(()=>{l(d=>({...d,visible:!1}))},[]);return t.jsxs(z0.Provider,{value:{showToast:o},children:[s,t.jsx(wj,{message:n.message,type:n.type,duration:n.duration,onClose:c,visible:n.visible})]})},M0=x.createContext(void 0),Sj=()=>{const s=x.useContext(M0);if(!s)throw new Error("useTheme must be used within a ThemeProvider");return s},Nj=({children:s})=>{const[n,l]=x.useState(()=>localStorage.getItem("theme")||"system"),[o,c]=x.useState("light"),d=m=>{l(m),localStorage.setItem("theme",m)};return x.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="")},f=window.matchMedia("(prefers-color-scheme: dark)");return f.addEventListener("change",m),m(),()=>{f.removeEventListener("change",m)}},[n]),t.jsx(M0.Provider,{value:{theme:n,setTheme:d,resolvedTheme:o},children:s})},P0="mcphub_servers_per_page",uo=5,D0=new Set([5,10,20,50]),kj=()=>{if(typeof window>"u")return uo;const s=window.localStorage.getItem(P0);if(!s)return uo;const n=Number(s);return D0.has(n)?n:uo},eo={startup:{maxAttempts:60,pollingInterval:3e3},normal:{pollingInterval:1e4}},L0=x.createContext(void 0),Cj=({children:s})=>{const{t:n}=ve(),{auth:l}=is(),[o,c]=x.useState([]),[d,m]=x.useState([]),[f,g]=x.useState(null),[h,b]=x.useState(0),[y,w]=x.useState(!0),[N,S]=x.useState(0),[j,C]=x.useState(null),[z,E]=x.useState(1),[T,B]=x.useState(kj),D=x.useRef(null),Y=x.useRef(0),R=x.useRef(0),_=3e3,P=()=>{D.current&&(clearInterval(D.current),D.current=null)},V=x.useCallback(k=>{const U=(k==null?void 0:k.immediate)??!0;P();const M=async()=>{try{console.log("[ServerContext] Fetching servers from API...");const q=new URLSearchParams;q.append("page",z.toString()),q.append("limit",T.toString());const[de,ee]=await Promise.all([Be(`/servers?${q.toString()}`),Be("/servers")]);R.current=Date.now(),de&&de.success&&Array.isArray(de.data)?(c(de.data),de.pagination?C(de.pagination):C(null)):de&&Array.isArray(de)?(c(de),C(null)):(console.error("Invalid server data format",{paginatedData:de}),c([]),C(null)),ee&&ee.success&&Array.isArray(ee.data)?m(ee.data):ee&&Array.isArray(ee)?m(ee):m([]),g(null)}catch(q){console.error("Error fetching servers during normal polling",{err:q}),navigator.onLine?q instanceof TypeError&&(q.message.includes("NetworkError")||q.message.includes("Failed to fetch"))?g(n("errors.serverConnection")):g(n("errors.serverFetch")):g(n("errors.network"))}};U&&M(),D.current=setInterval(M,eo.normal.pollingInterval)},[n,z,T]);x.useEffect(()=>{l.isAuthenticated?(console.log("[ServerContext] User authenticated, triggering refresh"),b(k=>k+1)):(console.log("[ServerContext] User not authenticated, clearing data and stopping polling"),P(),c([]),m([]),w(!1),g(null))},[l.isAuthenticated]),x.useEffect(()=>{if(!l.isAuthenticated){console.log("[ServerContext] User not authenticated, skipping polling setup");return}h>0&&(Y.current=0,S(0));const k=async()=>{try{console.log("[ServerContext] Initial fetch - attempt",Y.current+1);const U=new URLSearchParams;U.append("page",z.toString()),U.append("limit",T.toString());const[M,q]=await Promise.all([Be(`/servers?${U.toString()}`),Be("/servers")]);return R.current=Date.now(),M&&M.success&&Array.isArray(M.data)?(c(M.data),M.pagination?C(M.pagination):C(null)):M&&Array.isArray(M)?(c(M),C(null)):(console.error("Invalid server data format",{paginatedData:M}),c([]),C(null)),q&&q.success&&Array.isArray(q.data)?m(q.data):q&&Array.isArray(q)?m(q):m([]),w(!1),V({immediate:!1}),!0}catch(U){return Y.current+=1,console.error("Initial loading attempt failed",{attempt:Y.current,err:U}),S(Y.current),navigator.onLine?g(n("errors.initialStartup")):g(n("errors.network")),Y.current>=eo.startup.maxAttempts&&(console.log("Maximum startup attempts reached, switching to normal polling"),w(!1),P(),V()),!1}};return y?(P(),k(),D.current=setInterval(k,eo.startup.pollingInterval),console.log(`Started initial polling with interval: ${eo.startup.pollingInterval}ms`)):V(),()=>{P()}},[h,n,y,V,z,T]),x.useEffect(()=>{if(!j)return;const k=Math.max(1,j.totalPages||1);z>k&&E(k)},[j,z]);const K=x.useCallback(()=>{P(),y&&(w(!0),Y.current=0,S(0)),b(k=>k+1)},[y]),G=x.useCallback(()=>{const U=Date.now()-R.current;console.log("[ServerContext] refreshIfNeeded called",{timeSinceLastFetch:U}),U>=_?(console.log("[ServerContext] Triggering refresh after minimum interval",{minRefreshInterval:_}),K()):console.log("[ServerContext] Skipping refresh because minimum interval not reached",{minRefreshInterval:_,timeSinceLastFetch:U})},[K]),I=x.useCallback(()=>{b(k=>k+1)},[]),L=x.useCallback(async k=>{try{const U=encodeURIComponent(k.name),M=await Be(`/servers/${U}`);return M&&M.success&&M.data?{name:M.data.name,status:M.data.status,tools:M.data.tools||[],config:M.data.config}:(console.error("Failed to get server config",{serverName:k.name,serverData:M}),g(n("server.invalidConfig",{serverName:k.name})),null)}catch(U){return console.error("Error fetching server config",{serverName:k.name,err:U}),g(U instanceof Error?U.message:String(U)),null}},[n]),Z=x.useCallback(async k=>{try{const U=encodeURIComponent(k),M=await Kr(`/servers/${U}`);return!M||!M.success?(g((M==null?void 0:M.message)||n("server.deleteError",{serverName:k})),!1):(b(q=>q+1),!0)}catch(U){return g(n("errors.general")+": "+(U instanceof Error?U.message:String(U))),!1}},[n]),A=x.useCallback(async(k,U)=>{try{const M=encodeURIComponent(k.name),q=await pt(`/servers/${M}/toggle`,{enabled:U});return!q||!q.success?(console.error("Failed to toggle server",{serverName:k.name,result:q}),g((q==null?void 0:q.message)||n("server.toggleError",{serverName:k.name})),!1):(b(de=>de+1),!0)}catch(M){return console.error("Error toggling server",{serverName:k.name,err:M}),g(M instanceof Error?M.message:String(M)),!1}},[n]),H=x.useCallback(async k=>{try{const U=encodeURIComponent(k.name),M=await pt(`/servers/${U}/reload`,{});return!M||!M.success?(console.error("Failed to reload server",{serverName:k.name,result:M}),g(n("server.reloadError",{serverName:k.name})),!1):(K(),!0)}catch(U){return console.error("Error reloading server",{serverName:k.name,err:U}),g(U instanceof Error?U.message:String(U)),!1}},[n,K]),J=x.useCallback(k=>{E(k)},[]),me=x.useCallback(k=>{const U=D0.has(k)?k:uo;typeof window<"u"&&window.localStorage.setItem(P0,String(U)),B(U),E(1)},[]),le={servers:o,allServers:d,error:f,setError:g,isLoading:y,fetchAttempts:N,pagination:j,currentPage:z,serversPerPage:T,setCurrentPage:J,setServersPerPage:me,triggerRefresh:K,refreshIfNeeded:G,handleServerAdd:I,handleServerEdit:L,handleServerRemove:Z,handleServerToggle:A,handleServerReload:H};return t.jsx(L0.Provider,{value:le,children:s})},U0=()=>{const s=x.useContext(L0);if(s===void 0)throw new Error("useServerContext must be used within a ServerProvider");return s},Xu=()=>({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}}),_0=x.createContext(void 0),Aj=()=>{const s=x.useContext(_0);if(!s)throw new Error("useSettings must be used within a SettingsProvider");return s},Ej=({children:s})=>{const{t:n}=ve(),{showToast:l}=Ms(),{auth:o}=is(),[c,d]=x.useState({enableGlobalRoute:!0,enableGroupNameRoute:!0,enableBearerAuth:!0,bearerAuthKey:"",bearerAuthHeaderName:"Authorization",jsonBodyLimit:"1mb",skipAuth:!1}),[m,f]=x.useState({bearerAuthKey:"",bearerAuthHeaderName:"Authorization",jsonBodyLimit:"1mb"}),[g,h]=x.useState({pythonIndexUrl:"",npmRegistry:"",baseUrl:"http://localhost:3000"}),[b,y]=x.useState({enabled:!1,dbUrl:"",basePacingDelayMs:void 0,embeddingProvider:"openai",embeddingEncodingFormat:"auto",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:"",azureOpenaiEndpoint:"",azureOpenaiApiKey:"",azureOpenaiApiVersion:"",azureOpenaiEmbeddingDeployment:"",progressiveDisclosure:!1,embeddingMaxTokens:void 0}),[w,N]=x.useState({apiKey:"",referer:"https://www.mcphub.app",title:"MCPHub",baseUrl:"https://api.mcprouter.to/v1"}),[S,j]=x.useState(Xu()),[C,z]=x.useState("-"),[E,T]=x.useState(!1),[B,D]=x.useState([]),[Y,R]=x.useState(!1),[_,P]=x.useState(null),[V,K]=x.useState(0),G=x.useCallback(()=>{K(ie=>ie+1)},[]),I=x.useCallback(async()=>{var ie,se,be,Ne,xe,ke,Se,Le,st,ft,Mt,Pt,Sr,gt,Nr,er,Qt,ht;R(!0),P(null);try{const Re=await Be("/settings");if(Re.success&&((se=(ie=Re.data)==null?void 0:ie.systemConfig)!=null&&se.routing)&&d({enableGlobalRoute:Re.data.systemConfig.routing.enableGlobalRoute??!0,enableGroupNameRoute:Re.data.systemConfig.routing.enableGroupNameRoute??!0,enableBearerAuth:Re.data.systemConfig.routing.enableBearerAuth??!0,bearerAuthKey:Re.data.systemConfig.routing.bearerAuthKey||"",bearerAuthHeaderName:Re.data.systemConfig.routing.bearerAuthHeaderName||"Authorization",jsonBodyLimit:Re.data.systemConfig.routing.jsonBodyLimit||"1mb",skipAuth:Re.data.systemConfig.routing.skipAuth??!1}),Re.success&&((Ne=(be=Re.data)==null?void 0:be.systemConfig)!=null&&Ne.install)&&h({pythonIndexUrl:Re.data.systemConfig.install.pythonIndexUrl||"",npmRegistry:Re.data.systemConfig.install.npmRegistry||"",baseUrl:Re.data.systemConfig.install.baseUrl||"http://localhost:3000"}),Re.success&&((ke=(xe=Re.data)==null?void 0:xe.systemConfig)!=null&&ke.smartRouting)&&y({enabled:Re.data.systemConfig.smartRouting.enabled??!1,dbUrl:Re.data.systemConfig.smartRouting.dbUrl||"",basePacingDelayMs:Re.data.systemConfig.smartRouting.basePacingDelayMs,embeddingProvider:Re.data.systemConfig.smartRouting.embeddingProvider==="azure_openai"?"azure_openai":"openai",embeddingEncodingFormat:Re.data.systemConfig.smartRouting.embeddingEncodingFormat==="base64"?"base64":Re.data.systemConfig.smartRouting.embeddingEncodingFormat==="float"?"float":"auto",openaiApiBaseUrl:Re.data.systemConfig.smartRouting.openaiApiBaseUrl||"",openaiApiKey:Re.data.systemConfig.smartRouting.openaiApiKey||"",openaiApiEmbeddingModel:Re.data.systemConfig.smartRouting.openaiApiEmbeddingModel||"",azureOpenaiEndpoint:Re.data.systemConfig.smartRouting.azureOpenaiEndpoint||"",azureOpenaiApiKey:Re.data.systemConfig.smartRouting.azureOpenaiApiKey||"",azureOpenaiApiVersion:Re.data.systemConfig.smartRouting.azureOpenaiApiVersion||"",azureOpenaiEmbeddingDeployment:Re.data.systemConfig.smartRouting.azureOpenaiEmbeddingDeployment||"",progressiveDisclosure:Re.data.systemConfig.smartRouting.progressiveDisclosure??!1,embeddingMaxTokens:Re.data.systemConfig.smartRouting.embeddingMaxTokens}),Re.success&&((Le=(Se=Re.data)==null?void 0:Se.systemConfig)!=null&&Le.mcpRouter)&&N({apiKey:Re.data.systemConfig.mcpRouter.apiKey||"",referer:Re.data.systemConfig.mcpRouter.referer||"https://www.mcphub.app",title:Re.data.systemConfig.mcpRouter.title||"MCPHub",baseUrl:Re.data.systemConfig.mcpRouter.baseUrl||"https://api.mcprouter.to/v1"}),Re.success)if((ft=(st=Re.data)==null?void 0:st.systemConfig)!=null&&ft.oauthServer){const Oe=Re.data.systemConfig.oauthServer,it=Xu(),qt=it.dynamicRegistration,Gt=Array.isArray(Oe.allowedScopes)?[...Oe.allowedScopes]:[...it.allowedScopes],ot=Array.isArray((Mt=Oe.dynamicRegistration)==null?void 0:Mt.allowedGrantTypes)?[...Oe.dynamicRegistration.allowedGrantTypes]:[...qt.allowedGrantTypes];j({enabled:Oe.enabled??it.enabled,accessTokenLifetime:Oe.accessTokenLifetime??it.accessTokenLifetime,refreshTokenLifetime:Oe.refreshTokenLifetime??it.refreshTokenLifetime,authorizationCodeLifetime:Oe.authorizationCodeLifetime??it.authorizationCodeLifetime,requireClientSecret:Oe.requireClientSecret??it.requireClientSecret,requireState:Oe.requireState??it.requireState,allowedScopes:Gt,dynamicRegistration:{enabled:((Pt=Oe.dynamicRegistration)==null?void 0:Pt.enabled)??qt.enabled,allowedGrantTypes:ot,requiresAuthentication:((Sr=Oe.dynamicRegistration)==null?void 0:Sr.requiresAuthentication)??qt.requiresAuthentication}})}else j(Xu());Re.success&&((Nr=(gt=Re.data)==null?void 0:gt.systemConfig)==null?void 0:Nr.nameSeparator)!==void 0&&z(Re.data.systemConfig.nameSeparator),Re.success&&((Qt=(er=Re.data)==null?void 0:er.systemConfig)==null?void 0:Qt.enableSessionRebuild)!==void 0&&T(Re.data.systemConfig.enableSessionRebuild),Re.success&&Array.isArray((ht=Re.data)==null?void 0:ht.bearerKeys)&&D(Re.data.bearerKeys)}catch(Re){console.error("Failed to fetch settings",{error:Re}),P(Re instanceof Error?Re.message:"Failed to fetch settings"),l(n("errors.failedToFetchSettings"))}finally{R(!1)}},[n,l]),L=async(ie,se)=>{R(!0),P(null);try{const be=await At("/system-config",{routing:{[ie]:se}});return be.success?(d({...c,[ie]:se}),l(n("settings.systemConfigUpdated")),!0):(P(be.error||"Failed to update routing config"),l(be.error||n("errors.failedToUpdateRoutingConfig")),!1)}catch(be){return console.error("Failed to update routing config",{key:ie,value:se,error:be}),P(be instanceof Error?be.message:"Failed to update routing config"),l(n("errors.failedToUpdateRoutingConfig")),!1}finally{R(!1)}},Z=async(ie,se)=>{R(!0),P(null);try{const be=await At("/system-config",{install:{[ie]:se}});return be.success?(h({...g,[ie]:se}),l(n("settings.systemConfigUpdated")),!0):(P(be.error||"Failed to update install config"),l(be.error||n("errors.failedToUpdateInstallConfig")),!1)}catch(be){return console.error("Failed to update install config",{key:ie,value:se,error:be}),P(be instanceof Error?be.message:"Failed to update install config"),l(n("errors.failedToUpdateInstallConfig")),!1}finally{R(!1)}},A=async(ie,se)=>{R(!0),P(null);try{const be=await At("/system-config",{smartRouting:{[ie]:se}});return be.success?(y({...b,[ie]:se}),l(n("settings.systemConfigUpdated")),!0):(P(be.error||"Failed to update smart routing config"),l(be.error||n("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(be){return console.error("Failed to update smart routing config",{key:ie,value:se,error:be}),P(be instanceof Error?be.message:"Failed to update smart routing config"),l(n("errors.failedToUpdateSmartRoutingConfig")),!1}finally{R(!1)}},H=async ie=>{R(!0),P(null);try{const se=await At("/system-config",{smartRouting:ie});return se.success?(y({...b,...ie}),l(n("settings.systemConfigUpdated")),!0):(P(se.error||"Failed to update smart routing config"),l(se.error||n("errors.failedToUpdateSmartRoutingConfig")),!1)}catch(se){return console.error("Failed to batch update smart routing config",{updates:ie,error:se}),P(se instanceof Error?se.message:"Failed to update smart routing config"),l(n("errors.failedToUpdateSmartRoutingConfig")),!1}finally{R(!1)}},J=async ie=>{R(!0),P(null);try{const se=await At("/system-config",{routing:ie});return se.success?(d({...c,...ie}),l(n("settings.systemConfigUpdated")),!0):(P(se.error||"Failed to update routing config"),l(se.error||n("errors.failedToUpdateRoutingConfig")),!1)}catch(se){return console.error("Failed to batch update routing config",{updates:ie,error:se}),P(se instanceof Error?se.message:"Failed to update routing config"),l(n("errors.failedToUpdateRoutingConfig")),!1}finally{R(!1)}},me=async(ie,se)=>{R(!0),P(null);try{const be=await At("/system-config",{mcpRouter:{[ie]:se}});return be.success?(N({...w,[ie]:se}),l(n("settings.systemConfigUpdated")),!0):(P(be.error||"Failed to update MCP Router config"),l(be.error||n("errors.failedToUpdateMCPRouterConfig")),!1)}catch(be){return console.error("Failed to update MCP Router config",{key:ie,value:se,error:be}),P(be instanceof Error?be.message:"Failed to update MCP Router config"),l(n("errors.failedToUpdateMCPRouterConfig")),!1}finally{R(!1)}},le=async ie=>{R(!0),P(null);try{const se=await At("/system-config",{mcpRouter:ie});return se.success?(N({...w,...ie}),l(n("settings.systemConfigUpdated")),!0):(P(se.error||"Failed to update MCP Router config"),l(se.error||n("errors.failedToUpdateMCPRouterConfig")),!1)}catch(se){return console.error("Failed to batch update MCP Router config",{updates:ie,error:se}),P(se instanceof Error?se.message:"Failed to update MCP Router config"),l(n("errors.failedToUpdateMCPRouterConfig")),!1}finally{R(!1)}},k=async(ie,se)=>{R(!0),P(null);try{const be=await At("/system-config",{oauthServer:{[ie]:se}});return be.success?(j({...S,[ie]:se}),l(n("settings.systemConfigUpdated")),!0):(P(be.error||"Failed to update OAuth server config"),l(be.error||n("errors.failedToUpdateOAuthServerConfig")),!1)}catch(be){return console.error("Failed to update OAuth server config",{key:ie,value:se,error:be}),P(be instanceof Error?be.message:"Failed to update OAuth server config"),l(n("errors.failedToUpdateOAuthServerConfig")),!1}finally{R(!1)}},U=async ie=>{R(!0),P(null);try{const se=await At("/system-config",{oauthServer:ie});return se.success?(j({...S,...ie}),l(n("settings.systemConfigUpdated")),!0):(P(se.error||"Failed to update OAuth server config"),l(se.error||n("errors.failedToUpdateOAuthServerConfig")),!1)}catch(se){return console.error("Failed to batch update OAuth server config",{updates:ie,error:se}),P(se instanceof Error?se.message:"Failed to update OAuth server config"),l(n("errors.failedToUpdateOAuthServerConfig")),!1}finally{R(!1)}},M=async ie=>{R(!0),P(null);try{const se=await At("/system-config",{nameSeparator:ie});return se.success?(z(ie),l(n("settings.systemConfigUpdated")),!0):(P(se.error||"Failed to update name separator"),l(se.error||n("errors.failedToUpdateNameSeparator")),!1)}catch(se){return console.error("Failed to update name separator",{value:ie,error:se}),P(se instanceof Error?se.message:"Failed to update name separator"),l(n("errors.failedToUpdateNameSeparator")),!1}finally{R(!1)}},q=async ie=>{R(!0),P(null);try{const se=await At("/system-config",{enableSessionRebuild:ie});return se.success?(T(ie),l(n("settings.systemConfigUpdated")),!0):(P(se.error||"Failed to update session rebuild setting"),l(se.error||n("errors.failedToUpdateSessionRebuild")),!1)}catch(se){return console.error("Failed to update session rebuild setting",{value:ie,error:se}),P(se instanceof Error?se.message:"Failed to update session rebuild setting"),l(n("errors.failedToUpdateSessionRebuild")),!1}finally{R(!1)}},de=async ie=>{R(!0),P(null);try{return await Be(`/mcp-settings/export?serverName=${ie||""}`)}catch(se){console.error("Failed to export MCP settings",{serverName:ie,error:se});const be=se instanceof Error?se.message:"Failed to export MCP settings";P(be),l(be)}finally{R(!1)}},ee=async()=>{try{const ie=await Be("/auth/keys");ie.success&&Array.isArray(ie.data)&&D(ie.data)}catch(ie){console.error("Failed to refresh bearer keys",{error:ie}),l(n("errors.failedToFetchSettings"))}},X=async ie=>{try{const se=await pt("/auth/keys",ie);return se.success&&se.data?(await ee(),l(n("settings.systemConfigUpdated")),se.data):(l(se.message||n("errors.failedToUpdateRoutingConfig")),null)}catch(se){return console.error("Failed to create bearer key",{error:se}),l(n("errors.failedToUpdateRoutingConfig")),null}},he=async(ie,se)=>{try{const be=await At(`/auth/keys/${ie}`,se);return be.success&&be.data?(await ee(),l(n("settings.systemConfigUpdated")),be.data):(l(be.message||n("errors.failedToUpdateRoutingConfig")),null)}catch(be){return console.error("Failed to update bearer key",{id:ie,error:be}),l(n("errors.failedToUpdateRoutingConfig")),null}},ae=async ie=>{try{const se=await Kr(`/auth/keys/${ie}`);return se.success?(await ee(),l(n("settings.systemConfigUpdated")),!0):(l(se.message||n("errors.failedToUpdateRoutingConfig")),!1)}catch(se){return console.error("Failed to delete bearer key",{id:ie,error:se}),l(n("errors.failedToUpdateRoutingConfig")),!1}};x.useEffect(()=>{I()},[I,V]),x.useEffect(()=>{o.isAuthenticated&&(console.log("[SettingsContext] User authenticated, triggering settings refresh"),G())},[o.isAuthenticated,G]),x.useEffect(()=>{c&&f({bearerAuthKey:c.bearerAuthKey,bearerAuthHeaderName:c.bearerAuthHeaderName,jsonBodyLimit:c.jsonBodyLimit})},[c]);const ye={routingConfig:c,tempRoutingConfig:m,setTempRoutingConfig:f,installConfig:g,smartRoutingConfig:b,mcpRouterConfig:w,oauthServerConfig:S,nameSeparator:C,enableSessionRebuild:E,bearerKeys:B,loading:Y,error:_,setError:P,triggerRefresh:G,fetchSettings:I,updateRoutingConfig:L,updateInstallConfig:Z,updateSmartRoutingConfig:A,updateSmartRoutingConfigBatch:H,updateRoutingConfigBatch:J,updateMCPRouterConfig:me,updateMCPRouterConfigBatch:le,updateOAuthServerConfig:k,updateOAuthServerConfigBatch:U,updateNameSeparator:M,updateSessionRebuild:q,exportMCPSettings:de,refreshBearerKeys:ee,createBearerKey:X,updateBearerKey:he,deleteBearerKey:ae};return t.jsx(_0.Provider,{value:ye,children:s})},B0=()=>{const{t:s}=ve(),{theme:n,setTheme:l}=Sj(),o=()=>{l(n==="light"?"dark":"light")};return t.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:s(n==="light"?"theme.dark":"theme.light"),"aria-label":s(n==="light"?"theme.dark":"theme.light"),children:n==="light"?t.jsx(jw,{className:"h-5 w-5"}):t.jsx(Mw,{className:"h-5 w-5"})})},Rj=s=>{const{t:n}=ve();return t.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,...s,children:[t.jsx("title",{children:n("common.language")}),t.jsx("circle",{cx:"12",cy:"12",r:"10"}),t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2 12h20"}),t.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"})]})},I0=()=>{const{i18n:s}=ve(),[n,l]=x.useState(!1),[o,c]=x.useState(s.language),d=[{code:"en",label:"English"},{code:"zh",label:"中文"},{code:"fr",label:"Français"},{code:"tr",label:"Türkçe"}];x.useEffect(()=>{c(s.language)},[s.language]),x.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()},f=()=>{l(!n)};return t.jsxs("div",{className:"relative language-dropdown",children:[t.jsx("button",{onClick:f,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:t.jsx(Rj,{className:"h-5 w-5"})}),n&&t.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:t.jsx("div",{children:d.map(g=>t.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))})})]})},Tj=s=>{const{t:n}=ve();return t.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[t.jsx("title",{children:n("common.github")}),t.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"})]})},Oj=async()=>{try{const s=await Be("/logs");if(!s.success)throw new Error(s.error||"Failed to fetch logs");return s.data}catch(s){throw console.error("Error fetching logs",{error:s}),s}},zj=async()=>{try{const s=await Kr("/logs");if(!s.success)throw new Error(s.error||"Failed to clear logs")}catch(s){throw console.error("Error clearing logs",{error:s}),s}};class Mj{constructor(){Wr(this,"eventSource",null);Wr(this,"subscribers",new Set);Wr(this,"reconnectTimer",null);Wr(this,"openAttempts",0)}subscribe(n){return this.subscribers.add(n),this.subscribers.size===1&&(this.openAttempts=0,this.openEventSource()),()=>{this.subscribers.delete(n),this.subscribers.size===0&&this.close()}}openEventSource(){this.closeEventSource();const n=Rn();if(!n){console.warn("[LogStreamManager] No token available, scheduling reconnect..."),this.scheduleReconnect();return}try{const l=Sd(`/logs/stream?token=${n}`);let o=l;try{const c=new URL(l);c.search="",o=c.toString()}catch{o=l.split("?")[0]||l}console.log("[LogStreamManager] Opening EventSource:",o),this.eventSource=new EventSource(l),this.eventSource.onmessage=c=>{this.subscribers.forEach(d=>d(c))},this.eventSource.onerror=()=>{console.warn("[LogStreamManager] EventSource error, attempting reconnect..."),this.closeEventSource(),this.subscribers.size>0&&this.scheduleReconnect()},this.openAttempts=0,console.log("[LogStreamManager] EventSource opened successfully")}catch(l){console.error("[LogStreamManager] Failed to open EventSource:",l),this.closeEventSource(),this.subscribers.size>0&&this.scheduleReconnect()}}closeEventSource(){this.eventSource&&(this.eventSource.close(),this.eventSource=null)}scheduleReconnect(){if(this.reconnectTimer!==null)return;const n=Math.min(1e3*Math.pow(2,this.openAttempts),8e3);this.openAttempts++,console.log(`[LogStreamManager] Scheduling reconnect in ${n}ms (attempt ${this.openAttempts})`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.subscribers.size>0&&this.openEventSource()},n)}close(){this.closeEventSource(),this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}const Td=new Mj,Pj=()=>{const[s,n]=x.useState([]),[l,o]=x.useState(!0),[c,d]=x.useState(null);return x.useEffect(()=>{let f=!0;(async()=>{try{const y=await Oj();f&&(n(y),o(!1))}catch(y){f&&(d(y instanceof Error?y:new Error("Failed to fetch logs")),o(!1))}})();const h=y=>{if(f)try{const w=JSON.parse(y.data);if(w.type==="initial")return;w.type==="log"&&n(N=>[...N,w.log])}catch(w){console.error("Error parsing SSE message",{err:w})}},b=Td.subscribe(h);return()=>{f=!1,b()}},[]),{logs:s,loading:l,error:c,clearLogs:async()=>{try{await zj(),n([])}catch(f){d(f instanceof Error?f:new Error("Failed to clear logs"))}}}},Dj=5e3,F0=x.createContext(void 0),Lj=s=>!!s&&typeof s.serverName=="string"&&typeof s.current=="number"&&typeof s.total=="number"&&s.total>0&&s.current>=0&&s.current<=s.total&&["started","in_progress","completed","error"].includes(String(s.status)),Uj=({children:s})=>{const[n,l]=x.useState([]),o=x.useRef(new Map);x.useEffect(()=>{const d=y=>{const w=o.current.get(y);w&&(clearTimeout(w),o.current.delete(y))},m=()=>{o.current.forEach(y=>clearTimeout(y)),o.current.clear()},f=y=>{l(w=>{const N=w.findIndex(j=>j.serverName===y.serverName);if(N===-1)return[...w,y];const S=[...w];return S[N]=y,S})},g=y=>{l(w=>w.filter(N=>N.serverName!==y))},h=y=>{try{const w=JSON.parse(y.data);if((w==null?void 0:w.type)!=="embedding-sync-progress"||!Lj(w.progress))return;if(d(w.progress.serverName),w.progress.status==="error"){g(w.progress.serverName);return}const N={serverName:w.progress.serverName,current:w.progress.current,total:w.progress.total,status:w.progress.status};if(f(N),w.progress.status==="completed"){const S=setTimeout(()=>{g(w.progress.serverName),o.current.delete(w.progress.serverName)},Dj);o.current.set(w.progress.serverName,S)}}catch{}},b=Td.subscribe(h);return()=>{m(),b()}},[]);const c=x.useMemo(()=>({activeSyncs:n}),[n]);return t.jsx(F0.Provider,{value:c,children:s})},_j=()=>{const s=x.useContext(F0);if(!s)throw new Error("useEmbeddingSync must be used within an EmbeddingSyncProvider");return s},Bj=({onToggleSidebar:s})=>{const{t:n}=ve(),{activeSyncs:l}=_j();return t.jsx("header",{className:"bg-white dark:bg-gray-800 shadow-sm z-10",children:t.jsxs("div",{className:"flex items-center gap-4 px-3 py-3",children:[t.jsxs("div",{className:"flex items-center shrink-0",children:[t.jsx("button",{onClick:s,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:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),t.jsx("h1",{className:"ml-4 text-xl font-bold text-gray-900 dark:text-white",children:n("app.title")})]}),t.jsx("div",{className:"flex flex-1 justify-center px-2 min-w-0",children:l.length>0&&t.jsx("div",{className:"flex max-w-full flex-wrap justify-center gap-2",children:l.map(o=>t.jsxs("div",{className:"flex min-w-0 w-56 max-w-full flex-col rounded-md bg-blue-50 px-3 py-2 text-xs text-blue-900 dark:bg-gray-700 dark:text-blue-100",title:n("app.embeddingSyncProgressAriaLabel",{serverName:o.serverName,current:o.current,total:o.total}),children:[t.jsx("span",{className:"truncate font-medium",children:n("app.embeddingSyncProgress",{serverName:o.serverName})}),t.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[t.jsx("progress",{className:"h-2 flex-1",value:o.current,max:o.total,"aria-label":n("app.embeddingSyncProgressAriaLabel",{serverName:o.serverName,current:o.current,total:o.total})}),t.jsxs("span",{className:"shrink-0 tabular-nums",children:[o.current,"/",o.total]})]})]},o.serverName))})}),t.jsxs("div",{className:"flex items-center space-x-1 shrink-0",children:[t.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400 mr-2",children:"v0.12.12"}),t.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:t.jsx(Tj,{className:"h-5 w-5"})}),t.jsx("a",{href:"https://docs.mcphub.app",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:t.jsx(f0,{className:"h-5 w-5"})}),t.jsx(B0,{}),t.jsx(I0,{})]})]})})},ia=({permissions:s,fallback:n=null,children:l})=>H0(s)?t.jsx(t.Fragment,{children:l}):t.jsx(t.Fragment,{children:n}),H0=s=>{const{auth:n}=is();if(!n.isAuthenticated||!n.user)return!1;const l=n.user.permissions||[];return s==="x"&&!l.includes("x")?!1:l.includes("*")||n.user.isAdmin?!0:(Array.isArray(s)?s:[s]).some(c=>l.includes(c))},Ij="https://registry.npmjs.org",Fj="@samanhappy/mcphub",q0=async()=>{try{const s=await fetch(`${Ij}/${Fj}/latest`);if(!s.ok)throw new Error(`Failed to fetch latest version: ${s.status}`);return(await s.json()).version||null}catch(s){return console.error("Error checking for latest version:",s),null}},G0=(s,n)=>{if(s==="dev")return-1;const l=s.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},Hj=({isOpen:s,onClose:n,version:l})=>{const{t:o}=ve(),[c,d]=x.useState(!1),[m,f]=x.useState(""),[g,h]=x.useState(!1),b=async()=>{h(!0);try{const y=await q0();y&&(f(y),d(G0(l,y)>0))}catch(y){console.error("Failed to check for updates:",y)}finally{h(!1)}};return x.useEffect(()=>{s&&b()},[s,l]),s?t.jsx("div",{className:"fixed inset-0 bg-black/50 bg-opacity-30 z-50 flex items-center justify-center p-4",children:t.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:t.jsxs("div",{className:"p-6 relative",children:[t.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:t.jsx(zs,{className:"h-5 w-5"})}),t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:o("about.title")}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("span",{className:"text-gray-700 dark:text-gray-300",children:[o("about.currentVersion"),":"]}),t.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:l})]}),c&&m&&t.jsx("div",{className:"bg-blue-50 dark:bg-blue-900 p-3 rounded",children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"flex-shrink-0",children:t.jsx("svg",{className:"h-5 w-5 text-blue-600 dark:text-blue-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.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"})})}),t.jsxs("div",{className:"ml-3 flex-1 text-sm text-blue-700 dark:text-blue-300",children:[t.jsx("p",{children:o("about.newVersionAvailable",{version:m})}),t.jsx("p",{className:"mt-1",children:t.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")})})]})]})}),t.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
231
- ${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:[t.jsx(Cw,{className:`h-4 w-4 mr-2 ${g?"animate-spin":""}`}),o(g?"about.checking":"about.checkForUpdates")]})]})]})})}):null},qj=({open:s,onOpenChange:n})=>{const{i18n:l,t:o}=ve();return s?t.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:t.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:t.jsxs("div",{className:"p-6 relative",children:[t.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:t.jsx(zs,{className:"h-5 w-5"})}),t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:o("sponsor.title")}),t.jsx("div",{className:"flex flex-col items-center justify-center py-4",children:l.language==="zh"?t.jsx("img",{src:"./assets/reward.png",alt:o("sponsor.rewardAlt"),className:"max-w-full h-auto",style:{maxHeight:"400px"}}):t.jsxs("div",{className:"text-center",children:[t.jsx("p",{className:"mb-4 text-gray-700 dark:text-gray-300",children:o("sponsor.supportMessage")}),t.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},Gj=({open:s,onOpenChange:n})=>{const{t:l}=ve();return s?t.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:t.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md w-full",children:t.jsxs("div",{className:"p-6 relative",children:[t.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:t.jsx(zs,{className:"h-5 w-5"})}),t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-gray-100 mb-4",children:l("wechat.title")}),t.jsxs("div",{className:"flex flex-col items-center justify-center py-4",children:[t.jsx("img",{src:"./assets/wexin.png",alt:l("wechat.qrCodeAlt"),className:"max-w-full h-auto",style:{maxHeight:"400px"}}),t.jsx("p",{className:"mt-4 text-center text-gray-700 dark:text-gray-300",children:l("wechat.scanMessage")})]})]})})}):null},Kj=s=>{const{t:n}=ve();return t.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[t.jsx("title",{children:n("common.wechat")}),t.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"})]})},Vj=s=>{const{t:n}=ve();return t.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[t.jsx("title",{children:n("common.discord")}),t.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"})]})},$j=s=>{const{t:n}=ve();return t.jsxs("svg",{role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"currentColor",...s,children:[t.jsx("title",{children:n("sponsor.label")}),t.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"})]})},Yj=({collapsed:s,version:n})=>{var R;const{t:l,i18n:o}=ve(),c=ls(),{auth:d,logout:m}=is(),[f,g]=x.useState(!1),[h,b]=x.useState(!1),[y,w]=x.useState(!1),[N,S]=x.useState(!1),[j,C]=x.useState(!1),z=x.useRef(null);x.useEffect(()=>{(async()=>{try{const P=await q0();P&&b(G0(n,P)>0)}catch(P){console.error("Error checking for new version:",P)}})()},[n]),x.useEffect(()=>{const _=P=>{z.current&&!z.current.contains(P.target)&&g(!1)};return document.addEventListener("mousedown",_),()=>{document.removeEventListener("mousedown",_)}},[]);const E=()=>{c("/settings"),g(!1)},T=()=>{m(),c("/login")},B=()=>{w(!0),g(!1)},D=()=>{S(!0),g(!1)},Y=()=>{C(!0),g(!1)};return t.jsxs("div",{ref:z,className:"relative",children:[t.jsxs("button",{onClick:()=>g(!f),className:`flex ${s?"justify-center":"items-center"} w-full p-2 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors rounded-md ${f?"bg-gray-100 dark:bg-gray-700":""}`,children:[t.jsxs("div",{className:"flex-shrink-0 relative",children:[t.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:t.jsx(v0,{className:"h-4 w-4 text-gray-700 dark:text-gray-300"})}),h&&t.jsx("span",{className:"absolute -top-1 -right-1 block w-2 h-2 bg-red-500 rounded-full"})]}),!s&&t.jsx("div",{className:"ml-3 flex flex-col items-start",children:t.jsx("span",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:((R=d.user)==null?void 0:R.username)||l("auth.user")})})]}),f&&t.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:[t.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",children:[t.jsx($j,{className:"h-4 w-4 mr-2"}),l("sponsor.label")]}),o.language==="zh"?t.jsxs("button",{onClick:Y,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:[t.jsx(Kj,{className:"h-4 w-4 mr-2"}),l("wechat.label")]}):t.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:[t.jsx(Vj,{className:"h-4 w-4 mr-2"}),l("discord.label")]}),t.jsxs("button",{onClick:E,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:[t.jsx(Tw,{className:"h-4 w-4 mr-2"}),l("nav.settings")]}),t.jsxs("button",{onClick:B,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:[t.jsx(fw,{className:"h-4 w-4 mr-2"}),l("about.title"),h&&t.jsx("span",{className:"absolute top-2 right-4 block w-2 h-2 bg-red-500 rounded-full"})]}),t.jsx("div",{className:"border-t border-gray-200 dark:border-gray-600"}),t.jsxs("button",{onClick:T,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:[t.jsx(bw,{className:"h-4 w-4 mr-2"}),l("app.logout")]})]}),t.jsx(Hj,{isOpen:y,onClose:()=>w(!1),version:n}),t.jsx(qj,{open:N,onOpenChange:S}),t.jsx(Gj,{open:j,onOpenChange:C})]})},Jj=async()=>{var s;try{const n=await Be("/activities/available");return((s=n==null?void 0:n.data)==null?void 0:s.available)||!1}catch(n){return console.error("Error checking activity availability:",n),!1}},Qj=(s,n,l)=>{const o=new URLSearchParams;return o.append("page",s.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()},Xj=async(s,n,l)=>{const o=Qj(s,n,l);return await Be(`/activities?${o}`)},Zj=async s=>await Be(`/activities/${s}`),Wj=async s=>{const n=new URLSearchParams;s!=null&&s.server&&n.append("server",s.server),s!=null&&s.tool&&n.append("tool",s.tool),s!=null&&s.status&&n.append("status",s.status),s!=null&&s.group&&n.append("group",s.group),s!=null&&s.keyId&&n.append("keyId",s.keyId),s!=null&&s.keyName&&n.append("keyName",s.keyName),s!=null&&s.startDate&&n.append("startDate",s.startDate),s!=null&&s.endDate&&n.append("endDate",s.endDate);const l=n.toString();return await Be(`/activities/stats${l?`?${l}`:""}`)},eS=async()=>await Be("/activities/filters"),tS=async(s=30)=>await Kr(`/activities/cleanup?daysOld=${s}`),rS=({collapsed:s})=>{var f,g;const{t:n}=ve(),{auth:l}=is(),[o,c]=x.useState(!1),d="0.12.12";x.useEffect(()=>{Jj().then(c).catch(()=>c(!1))},[]);const m=[{path:"/",label:n("nav.dashboard"),icon:t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:[t.jsx("path",{d:"M2 10a8 8 0 018-8v8h8a8 8 0 11-16 0z"}),t.jsx("path",{d:"M12 2.252A8.014 8.014 0 0117.748 8H12V2.252z"})]})},{path:"/servers",label:n("nav.servers"),icon:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:t.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:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:t.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:"/prompts",label:n("nav.prompts"),icon:t.jsx(Nn,{className:"h-4 w-4"})},{path:"/resources",label:n("nav.resources"),icon:t.jsx(Sn,{className:"h-5 w-5"})},{path:"/market",label:n("nav.market"),icon:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:t.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"})})},...(f=l.user)!=null&&f.isAdmin&&H0("x")?[{path:"/users",label:n("nav.users"),icon:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:t.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:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:t.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:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:t.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 t.jsxs("aside",{className:`bg-white dark:bg-gray-800 shadow-sm transition-all duration-300 ease-in-out flex flex-col h-full relative ${s?"w-16":"w-64"}`,children:[t.jsx("div",{className:"overflow-y-auto flex-grow",children:t.jsx("nav",{className:"p-3 space-y-1",children:m.map(h=>t.jsxs(e0,{to:h.path,className:({isActive:b})=>`flex items-center px-2.5 py-2 rounded-lg transition-colors duration-200
232
- ${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:[t.jsx("span",{className:"flex-shrink-0",children:h.icon}),!s&&t.jsx("span",{className:"ml-3",children:h.label})]},h.path))})}),t.jsx("div",{className:"p-3 bg-white dark:bg-gray-800",children:t.jsx(Yj,{collapsed:s,version:d})})]})},sS=({children:s})=>t.jsx("main",{className:"flex-1 overflow-auto p-6 bg-gray-100 dark:bg-gray-900",children:t.jsx("div",{className:"container mx-auto",children:s})}),aS=()=>{const[s,n]=As.useState(!1),l=()=>{n(!s)};return t.jsx(Uj,{children:t.jsxs("div",{className:"flex flex-col h-screen bg-gray-100 dark:bg-gray-900",children:[t.jsx(Bj,{onToggleSidebar:l}),t.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[t.jsx(rS,{collapsed:s}),t.jsx(sS,{children:t.jsx(Jh,{})})]})]})})},nS=({redirectPath:s="/login"})=>{const{t:n}=ve(),{auth:l}=is();return l.loading?t.jsx("div",{className:"flex items-center justify-center h-screen",children:n("app.loading")}):l.isAuthenticated?t.jsx(Jh,{}):t.jsx(po,{to:s,replace:!0})},lS=({isOpen:s,onClose:n})=>{const{t:l}=ve(),o=ls();if(!s)return null;const c=()=>{n(),o("/settings"),setTimeout(()=>{const f=document.querySelector('[data-section="password"]');if(f){f.scrollIntoView({behavior:"smooth",block:"start"});const g=f.querySelector('[role="button"]');g&&!f.querySelector(".mt-4")&&g.click()}},100)},d=f=>{f.target===f.currentTarget&&n()},m=f=>{f.key==="Escape"&&n()};return t.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:t.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:t.jsxs("div",{className:"p-6",children:[t.jsxs("div",{className:"flex items-start space-x-3",children:[t.jsx("div",{className:"flex-shrink-0",children:t.jsx("svg",{className:"w-6 h-6 text-yellow-600 dark:text-yellow-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.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"})})}),t.jsxs("div",{className:"flex-1",children:[t.jsx("h3",{id:"password-warning-title",className:"text-lg font-medium text-gray-900 dark:text-white mb-2",children:l("auth.defaultPasswordWarning")}),t.jsx("p",{id:"password-warning-message",className:"text-gray-600 dark:text-gray-300 leading-relaxed",children:l("auth.defaultPasswordMessage")})]})]}),t.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[t.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")}),t.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")})]})]})})})},iS=s=>{if(!s)return null;try{const n=typeof window<"u"?window.location.origin:"http://localhost",l=new URL(s,n);return l.origin!==n?null:`${l.pathname}${l.search}${l.hash}`||"/"}catch{return s.startsWith("/")&&!s.startsWith("//")?s:null}},oS=()=>{const{t:s}=ve(),[n,l]=x.useState(""),[o,c]=x.useState(""),[d,m]=x.useState(null),[f,g]=x.useState(!1),[h,b]=x.useState(null),[y,w]=x.useState(null),[N,S]=x.useState(void 0),[j,C]=x.useState({google:!1,github:!1}),[z,E]=x.useState(!1),{login:T,auth:B}=is(),D=ns(),Y=ls(),R=x.useMemo(()=>{const L=new URLSearchParams(D.search);return iS(L.get("returnUrl"))},[D.search]),_=x.useCallback(L=>{if(!L)return!1;const Z=L.toLowerCase();return Z.includes("failed to fetch")||Z.includes("networkerror")||Z.includes("network error")||Z.includes("connection refused")||Z.includes("unable to connect")||Z.includes("fetch error")||Z.includes("econnrefused")||Z.includes("http 500")||Z.includes("internal server error")||Z.includes("proxy error")},[]),P=x.useCallback(()=>{if(!R)return"/";if(!R.startsWith("/oauth/authorize"))return R;const L=Rn();if(!L)return R;try{const Z=window.location.origin,A=new URL(R,Z);return A.searchParams.set("token",L),`${A.pathname}${A.search}${A.hash}`}catch{const Z=R.includes("?")?"&":"?";return`${R}${Z}token=${encodeURIComponent(L)}`}},[R]),V=x.useCallback(()=>{R?window.location.assign(P()):Y("/")},[P,Y,R]);x.useEffect(()=>{!B.loading&&B.isAuthenticated&&V()},[B.isAuthenticated,B.loading,V]),x.useEffect(()=>{(async()=>{var H,J,me,le;const A=(await o0()).betterAuth;if(!(A!=null&&A.enabled)){C({google:!1,github:!1});return}S(A.basePath),C({google:((J=(H=A.providers)==null?void 0:H.google)==null?void 0:J.enabled)===!0,github:((le=(me=A.providers)==null?void 0:me.github)==null?void 0:le.enabled)===!0})})()},[]);const K=async L=>{L.preventDefault(),m(null),w(null),g(!0);try{if(!n||!o){m(s("auth.emptyFields")),g(!1);return}const Z=await T(n,o);if(Z.success)Z.isUsingDefaultPassword?E(!0):V();else{const A=Z.message;_(A)?m(s("auth.serverUnavailable")):m(s("auth.loginFailed"))}}catch(Z){const A=Z instanceof Error?Z.message:void 0;_(A)?m(s("auth.serverUnavailable")):m(s("auth.loginError"))}finally{g(!1)}},G=async L=>{w(null),b(L);try{await i0(N).signIn.social({provider:L,callbackURL:R||"/",errorCallbackURL:`${Ml()}/login`})}catch(Z){console.error("Social login error:",Z),w(s("auth.socialLoginFailed")),b(null)}},I=()=>{E(!1),V()};return t.jsxs("div",{className:"relative min-h-screen w-full overflow-hidden bg-gray-50 dark:bg-gray-950",children:[t.jsxs("div",{className:"absolute top-4 right-4 z-20 flex items-center gap-2",children:[t.jsx("a",{href:"https://docs.mcphub.app",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:t.jsx(f0,{className:"h-5 w-5"})}),t.jsx(B0,{}),t.jsx(I0,{})]}),t.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)"}}),t.jsx("div",{className:"pointer-events-none absolute inset-0 -z-10",children:t.jsxs("svg",{className:"h-full w-full opacity-[0.08] dark:opacity-[0.12]",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("defs",{children:t.jsx("pattern",{id:"grid",width:"32",height:"32",patternUnits:"userSpaceOnUse",children:t.jsx("path",{d:"M 32 0 L 0 0 0 32",fill:"none",stroke:"currentColor",strokeWidth:"0.5"})})}),t.jsx("rect",{width:"100%",height:"100%",fill:"url(#grid)",className:"text-gray-400 dark:text-gray-300"})]})}),t.jsx("div",{className:"relative mx-auto flex min-h-screen w-full max-w-md items-center justify-center px-6 py-16",children:t.jsxs("div",{className:"w-full space-y-16",children:[t.jsx("div",{className:"flex justify-center w-full",children:t.jsx("h1",{className:"text-5xl sm:text-5xl font-extrabold leading-tight tracking-tight text-gray-900 dark:text-white whitespace-nowrap",children:t.jsx("span",{className:"bg-gradient-to-r from-indigo-400 via-cyan-400 to-emerald-400 bg-clip-text text-transparent",children:s("auth.slogan")})})}),t.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:[t.jsx("div",{className:"absolute -top-24 right-12 h-40 w-40 -translate-y-6 rounded-full bg-indigo-500/30 blur-3xl"}),t.jsx("div",{className:"absolute -bottom-24 -left-12 h-40 w-40 translate-y-6 rounded-full bg-cyan-500/20 blur-3xl"}),t.jsxs("form",{className:"mt-4 space-y-4",onSubmit:K,children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:"username",className:"sr-only",children:s("auth.username")}),t.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:s("auth.username"),value:n,onChange:L=>l(L.target.value)})]}),t.jsxs("div",{children:[t.jsx("label",{htmlFor:"password",className:"sr-only",children:s("auth.password")}),t.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:s("auth.password"),value:o,onChange:L=>c(L.target.value)})]})]}),d&&t.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}),t.jsx("div",{children:t.jsx("button",{type:"submit",disabled:f,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:s(f?"auth.loggingIn":"auth.login")})})]}),(j.google||j.github)&&t.jsxs("div",{className:"mt-6 space-y-4",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("div",{className:"h-px flex-1 bg-gray-200/80 dark:bg-gray-700/80"}),t.jsx("span",{className:"text-xs uppercase tracking-widest text-gray-500 dark:text-gray-400",children:s("auth.orContinue")}),t.jsx("div",{className:"h-px flex-1 bg-gray-200/80 dark:bg-gray-700/80"})]}),y&&t.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:y}),t.jsxs("div",{className:"space-y-3",children:[j.google&&t.jsx("button",{type:"button",onClick:()=>G("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:s(h==="google"?"auth.loggingIn":"auth.loginWithGoogle")}),j.github&&t.jsx("button",{type:"button",onClick:()=>G("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:s(h==="github"?"auth.loggingIn":"auth.loginWithGithub")})]})]})]})]})}),t.jsx(lS,{isOpen:z,onClose:I})]})},Pl=s=>{const n=U0(),{refreshIfNeeded:l}=n;return x.useEffect(()=>{s!=null&&s.refreshOnMount&&l()},[s==null?void 0:s.refreshOnMount,l]),n},cS=()=>{const{t:s}=ve(),{allServers:n,error:l,setError:o,isLoading:c}=Pl({refreshOnMount:!0}),[d,m]=As.useState(!1),f=As.useRef(!1);As.useEffect(()=>{if(c){f.current=!0;return}if(f.current){m(!0);return}(n.length>0||l)&&m(!0)},[c,n.length,l]);const g=!d,h={total:n.length,online:n.filter(y=>y.status==="connected").length,disabled:n.filter(y=>y.enabled===!1).length,offline:n.filter(y=>y.status==="disconnected"&&y.enabled!==!1).length,connecting:n.filter(y=>y.status==="connecting").length,oauthRequired:n.filter(y=>y.status==="oauth_required").length},b={connected:"status.online",disconnected:"status.offline",connecting:"status.connecting",oauth_required:"status.oauthRequired"};return t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-8",children:s("pages.dashboard.title")}),l&&t.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm error-box",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-status-red text-lg font-medium",children:s("app.error")}),t.jsx("p",{className:"text-gray-600 mt-1",children:l})]}),t.jsx("button",{onClick:()=>o(null),className:"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200","aria-label":s("app.closeButton"),children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:t.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&&t.jsxs("div",{className:"space-y-8","aria-busy":"true","aria-live":"polite",children:[t.jsx("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-5",children:Array.from({length:5}).map((y,w)=>t.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"h-14 w-14 rounded-full bg-gray-200 animate-pulse"}),t.jsxs("div",{className:"ml-4 flex-1 space-y-3",children:[t.jsx("div",{className:"h-4 w-32 rounded bg-gray-200 animate-pulse"}),t.jsx("div",{className:"h-8 w-20 rounded bg-gray-200 animate-pulse"})]})]})},`stats-skeleton-${w}`))}),t.jsxs("div",{children:[t.jsx("div",{className:"h-6 w-40 rounded bg-gray-200 animate-pulse mb-4"}),t.jsx("div",{className:"bg-white shadow rounded-lg overflow-hidden table-container",children:t.jsx("div",{className:"divide-y divide-gray-200",children:Array.from({length:5}).map((y,w)=>t.jsx("div",{className:"px-6 py-4",children:t.jsxs("div",{className:"grid grid-cols-6 gap-6",children:[t.jsx("div",{className:"h-4 w-28 rounded bg-gray-200 animate-pulse"}),t.jsx("div",{className:"h-4 w-24 rounded bg-gray-200 animate-pulse"}),t.jsx("div",{className:"h-4 w-12 rounded bg-gray-200 animate-pulse"}),t.jsx("div",{className:"h-4 w-12 rounded bg-gray-200 animate-pulse"}),t.jsx("div",{className:"h-4 w-12 rounded bg-gray-200 animate-pulse"}),t.jsx("div",{className:"h-4 w-10 rounded bg-gray-200 animate-pulse"})]})},`row-skeleton-${w}`))})})]})]}),!g&&t.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-5",children:[t.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-3 rounded-full bg-blue-100 text-blue-800 icon-container status-icon-blue",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.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"})})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-700",children:s("pages.dashboard.totalServers")}),t.jsx("p",{className:"text-3xl font-bold text-gray-900",children:h.total})]})]})}),t.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-3 rounded-full bg-green-100 text-green-800 icon-container status-icon-green",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.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"})})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-700",children:s("pages.dashboard.onlineServers")}),t.jsx("p",{className:"text-3xl font-bold text-gray-900",children:h.online})]})]})}),t.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-3 rounded-full bg-gray-100 text-gray-700 icon-container",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z"})})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-700",children:s("pages.dashboard.disabledServers")}),t.jsx("p",{className:"text-3xl font-bold text-gray-900",children:h.disabled})]})]})}),t.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-3 rounded-full bg-red-100 text-red-800 icon-container status-icon-red",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.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"})})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-700",children:s("pages.dashboard.offlineServers")}),t.jsx("p",{className:"text-3xl font-bold text-gray-900",children:h.offline})]})]})}),t.jsx("div",{className:"bg-white rounded-lg shadow p-6 dashboard-card",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"p-3 rounded-full bg-yellow-100 text-yellow-800 icon-container status-icon-yellow",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})}),t.jsxs("div",{className:"ml-4",children:[t.jsx("h2",{className:"text-lg font-semibold text-gray-700",children:s("pages.dashboard.connectingServers")}),t.jsx("p",{className:"text-3xl font-bold text-gray-900",children:h.connecting})]})]})})]}),n.length>0&&!g&&t.jsxs("div",{className:"mt-8",children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-4",children:s("pages.dashboard.recentServers")}),t.jsx("div",{className:"bg-white shadow rounded-lg overflow-hidden table-container",children:t.jsxs("table",{className:"min-w-full",children:[t.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:t.jsxs("tr",{children:[t.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("server.name")}),t.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("server.status")}),t.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("server.tools")}),t.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("server.prompts")}),t.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("nav.resources")}),t.jsx("th",{scope:"col",className:"px-6 py-5 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("server.enabled")})]})}),t.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:n.slice(0,5).map((y,w)=>{var N,S,j;return t.jsxs("tr",{children:[t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:y.name}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:t.jsxs("span",{className:`px-2 py-1 inline-flex text-xs leading-5 font-semibold rounded-full ${y.status==="connected"?"status-badge-online":y.status==="disconnected"?"status-badge-offline":y.status==="oauth_required"?"status-badge-oauth-required":"status-badge-connecting"}`,children:[y.status==="oauth_required"&&"🔐 ",s(b[y.status]||y.status)]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:((N=y.tools)==null?void 0:N.length)||0}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:((S=y.prompts)==null?void 0:S.length)||0}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:((j=y.resources)==null?void 0:j.length)||0}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:y.enabled!==!1?t.jsx("span",{className:"text-green-600",children:"✓"}):t.jsx("span",{className:"text-gray-500","aria-label":s("pages.dashboard.disabledServers"),children:"⏸"})})]},w)})})]})})]})]})},uS="modulepreload",dS=function(s,n){return new URL(s,n).href},ah={},to=function(n,l,o){let c=Promise.resolve();if(l&&l.length>0){let m=function(b){return Promise.all(b.map(y=>Promise.resolve(y).then(w=>({status:"fulfilled",value:w}),w=>({status:"rejected",reason:w}))))};const f=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=dS(b,o),b in ah)return;ah[b]=!0;const y=b.endsWith(".css"),w=y?'[rel="stylesheet"]':"";if(!!o)for(let j=f.length-1;j>=0;j--){const C=f[j];if(C.href===b&&(!y||C.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${w}`))return;const S=document.createElement("link");if(S.rel=y?"stylesheet":uS,y||(S.as="script"),S.crossOrigin="",S.href=b,h&&S.setAttribute("nonce",h),document.head.appendChild(S),y)return new Promise((j,C)=>{S.addEventListener("load",j),S.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${b}`)))})}))}function d(m){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=m,window.dispatchEvent(f),!f.defaultPrevented)throw m}return c.then(m=>{for(const f of m||[])f.status==="rejected"&&d(f.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 ro({children:s,variant:n="default",className:l,onClick:o}){return t.jsx("span",{className:Rs("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:s})}const pS=({status:s,onAuthClick:n})=>{const{t:l}=ve(),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=s==="oauth_required";return t.jsxs("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${o[s]} ${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[s]||s)]})},K0=async(s,n)=>{try{const l=n?`/tools/${encodeURIComponent(n)}/${encodeURIComponent(s.toolName)}`:"/tools/call",o=await pt(l,s.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",{toolName:s.toolName,server:n,error:l}),{success:!1,error:l instanceof Error?l.message:"Unknown error occurred"}}},fS=async(s,n,l)=>{try{const o=await pt(`/servers/${encodeURIComponent(s)}/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",{serverName:s,toolName:n,enabled:l,error:o}),{success:!1,error:o instanceof Error?o.message:"Unknown error occurred"}}},V0=async(s,n,l)=>{try{const o=await At(`/servers/${encodeURIComponent(s)}/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",{serverName:s,toolName:n,error:o}),{success:!1,error:o instanceof Error?o.message:"Unknown error occurred"}}},$0=async(s,n)=>{var l;try{const o=await Kr(`/servers/${encodeURIComponent(s)}/tools/${encodeURIComponent(n)}/description`,{headers:{Authorization:`Bearer ${localStorage.getItem("mcphub_token")}`}});return{success:o.success,error:o.success?void 0:o.message,description:(l=o.data)==null?void 0:l.description}}catch(o){return console.error("Error resetting tool description",{serverName:s,toolName:n,error:o}),{success:!1,error:o instanceof Error?o.message:"Unknown error occurred"}}},gS=Object.freeze(Object.defineProperty({__proto__:null,callTool:K0,resetToolDescription:$0,toggleTool:fS,updateToolDescription:V0},Symbol.toStringTag,{value:"Module"})),Ta=()=>Aj(),Jt=({checked:s,onCheckedChange:n,disabled:l=!1})=>t.jsx("button",{type:"button",role:"switch","aria-checked":s,disabled:l,className:Rs("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",s?"bg-blue-200":"bg-gray-100",l?"opacity-50 cursor-not-allowed":"cursor-pointer"),onClick:()=>!l&&n(!s),children:t.jsx("span",{className:Rs("inline-block h-4 w-4 transform rounded-full bg-white transition-transform",s?"translate-x-6":"translate-x-1")})}),Y0=({schema:s,onSubmit:n,onCancel:l,loading:o=!1,storageKey:c,title:d})=>{const{t:m}=ve(),[f,g]=x.useState({}),[h,b]=x.useState({}),[y,w]=x.useState(!1),[N,S]=x.useState(""),[j,C]=x.useState(""),z=x.useMemo(()=>(G=>{const I=L=>{if(typeof L=="object"&&L!==null){const Z=L;return{type:Z.type||"string",description:Z.description,enum:Z.enum,default:Z.default,properties:Z.properties?Object.fromEntries(Object.entries(Z.properties).map(([A,H])=>[A,I(H)])):void 0,required:Z.required,items:Z.items?I(Z.items):void 0}}return{type:"string"}};return{type:G.type,properties:G.properties?Object.fromEntries(Object.entries(G.properties).map(([L,Z])=>[L,I(Z)])):void 0,required:G.required}})(s),[s]);x.useEffect(()=>{const K=(I,L="")=>{const Z={};return I.type==="object"&&I.properties&&Object.entries(I.properties).forEach(([A,H])=>{const J=L?`${L}.${A}`:A;H.default!==void 0?Z[A]=H.default:H.type==="string"?Z[A]="":H.type==="number"||H.type==="integer"?Z[A]=0:H.type==="boolean"?Z[A]=!1:H.type==="array"?Z[A]=[]:H.type==="object"&&(H.properties?Z[A]=K(H,J):Z[A]={})}),Z};let G=K(z);if(c)try{const I=localStorage.getItem(c);if(I){const L=JSON.parse(I);G={...G,...L}}}catch(I){console.warn("Failed to load saved form data:",I)}g(G)},[z,c]),x.useEffect(()=>{y&&Object.keys(f).length>0&&(S(JSON.stringify(f,null,2)),C(""))},[y,f]);const E=K=>{S(K),C("");try{const G=JSON.parse(K);if(g(G),c)try{localStorage.setItem(c,JSON.stringify(G))}catch(I){console.warn("Failed to save form data to localStorage:",I)}}catch{C(m("tool.invalidJsonFormat"))}},T=()=>{S(JSON.stringify(f,null,2)),C(""),w(!0)},B=()=>{if(N.trim())try{const K=JSON.parse(N);g(K),C(""),w(!1)}catch{C(m("tool.fixJsonBeforeSwitching"));return}else w(!1)},D=(K,G)=>{g(I=>{const L={...I},Z=K.split(".");let A=L;for(let H=0;H<Z.length-1;H++)A[Z[H]]||(A[Z[H]]={}),A=A[Z[H]];if(A[Z[Z.length-1]]=G,c)try{localStorage.setItem(c,JSON.stringify(L))}catch(H){console.warn("Failed to save form data to localStorage:",H)}return L}),h[K]&&b(I=>{const L={...I};return delete L[K],L})},Y=()=>{const K={},G=(I,L,Z="")=>{I.type==="object"&&I.properties&&Object.entries(I.properties).forEach(([A,H])=>{var le;const J=Z?`${Z}.${A}`:A,me=L==null?void 0:L[A];if((le=I.required)!=null&&le.includes(A)&&(me==null||me===""||Array.isArray(me)&&me.length===0)){K[J]=`${A} is required`;return}me!=null&&me!==""&&(H.type==="string"&&typeof me!="string"?K[J]=`${A} must be a string`:H.type==="number"&&typeof me!="number"?K[J]=`${A} must be a number`:H.type==="integer"&&(!Number.isInteger(me)||typeof me!="number")?K[J]=`${A} must be an integer`:H.type==="boolean"&&typeof me!="boolean"?K[J]=`${A} must be a boolean`:H.type==="array"&&Array.isArray(me)?H.items&&me.forEach((k,U)=>{var M;((M=H.items)==null?void 0:M.type)==="object"&&H.items.properties&&G(H.items,k,`${J}.${U}`)}):H.type==="object"&&typeof me=="object"&&G(H,me,J))})};return G(z,f),b(K),Object.keys(K).length===0},R=K=>{K.preventDefault(),Y()&&n(f)},_=(K,G)=>G.split(".").reduce((I,L)=>I==null?void 0:I[L],K),P=(K,G,I,L)=>{const Z=I==null?void 0:I[K];return G.type==="string"?G.enum?t.jsxs("select",{value:Z||"",onChange:A=>L(A.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:[t.jsx("option",{value:"",children:m("tool.selectOption")}),G.enum.map((A,H)=>t.jsx("option",{value:A,children:A},H))]}):t.jsx("input",{type:"text",value:Z||"",onChange:A=>L(A.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:G.description||m("tool.enterKey",{key:K})}):G.type==="number"||G.type==="integer"?t.jsx("input",{type:"number",step:G.type==="integer"?"1":"any",value:Z??"",onChange:A=>{const H=A.target.value===""?"":G.type==="integer"?parseInt(A.target.value):parseFloat(A.target.value);L(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"}):G.type==="boolean"?t.jsx("input",{type:"checkbox",checked:Z||!1,onChange:A=>L(A.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}):t.jsx("input",{type:"text",value:Z||"",onChange:A=>L(A.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:G.description||m("tool.enterKey",{key:K})})},V=(K,G,I="")=>{var H,J,me,le,k,U,M,q,de,ee,X,he,ae,ye;const L=I?`${I}.${K}`:K,Z=_(f,L),A=h[L];if(G.type==="array"){const ie=_(f,L)||[];return t.jsxs("div",{className:"mb-6",children:[t.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[K,(I?(J=(H=_(z,I))==null?void 0:H.required)==null?void 0:J.includes(K):(me=z.required)==null?void 0:me.includes(K))&&t.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),G.description&&t.jsx("p",{className:"text-xs text-gray-500 mb-2",children:G.description}),t.jsxs("div",{className:"border border-gray-200 rounded-md p-3 bg-gray-50",children:[ie.map((se,be)=>{var Ne,xe,ke;return t.jsxs("div",{className:"mb-3 p-3 bg-white border border-gray-200 rounded-md",children:[t.jsxs("div",{className:"flex justify-between items-center mb-2",children:[t.jsx("span",{className:"text-sm font-medium text-gray-600",children:m("tool.item",{index:be+1})}),t.jsx("button",{type:"button",onClick:()=>{const Se=[...ie];Se.splice(be,1),D(L,Se)},className:"text-status-red hover:text-red-700 text-sm",children:m("common.remove")})]}),((Ne=G.items)==null?void 0:Ne.type)==="string"&&G.items.enum?t.jsxs("select",{value:se||"",onChange:Se=>{const Le=[...ie];Le[be]=Se.target.value,D(L,Le)},className:"w-full border rounded-md px-3 py-2 border-gray-300 focus:outline-none focus:ring-2 focus:ring-blue-500",children:[t.jsx("option",{value:"",children:m("tool.selectOption")}),G.items.enum.map((Se,Le)=>t.jsx("option",{value:Se,children:Se},Le))]}):((xe=G.items)==null?void 0:xe.type)==="object"&&G.items.properties?t.jsx("div",{className:"space-y-3",children:Object.entries(G.items.properties).map(([Se,Le])=>{var st,ft;return t.jsxs("div",{children:[t.jsxs("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[Se,((ft=(st=G.items)==null?void 0:st.required)==null?void 0:ft.includes(Se))&&t.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),P(Se,Le,se,Mt=>{const Pt=[...ie];Pt[be]={...Pt[be],[Se]:Mt},D(L,Pt)})]},Se)})}):t.jsx("input",{type:"text",value:se||"",onChange:Se=>{const Le=[...ie];Le[be]=Se.target.value,D(L,Le)},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:((ke=G.items)==null?void 0:ke.type)||"value"})})]},be)}),t.jsx("button",{type:"button",onClick:()=>{var be;const se=((be=G.items)==null?void 0:be.type)==="object"?{}:"";D(L,[...ie,se])},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})})]}),A&&t.jsx("p",{className:"text-status-red text-xs mt-1",children:A})]},L)}return G.type==="object"?G.properties?t.jsxs("div",{className:"mb-6",children:[t.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[K,(I?(k=(le=_(z,I))==null?void 0:le.required)==null?void 0:k.includes(K):(U=z.required)==null?void 0:U.includes(K))&&t.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),G.description&&t.jsx("p",{className:"text-xs text-gray-500 mb-2",children:G.description}),t.jsx("div",{className:"border border-gray-200 rounded-md p-4 bg-gray-50",children:Object.entries(G.properties).map(([ie,se])=>V(ie,se,L))}),A&&t.jsx("p",{className:"text-status-red text-xs mt-1",children:A})]},L):t.jsxs("div",{className:"mb-4",children:[t.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[K,(I?(q=(M=_(z,I))==null?void 0:M.required)==null?void 0:q.includes(K):(de=z.required)==null?void 0:de.includes(K))&&t.jsx("span",{className:"text-status-red ml-1",children:"*"}),t.jsx("span",{className:"text-xs text-gray-500 ml-1",children:"(JSON object)"})]}),G.description&&t.jsx("p",{className:"text-xs text-gray-500 mb-2",children:G.description}),t.jsx("textarea",{value:typeof Z=="object"?JSON.stringify(Z,null,2):Z||"{}",onChange:ie=>{try{const se=JSON.parse(ie.target.value);D(L,se)}catch{D(L,ie.target.value)}},placeholder:`{
233
- "key": "value"
234
- }`,className:`w-full border rounded-md px-3 py-2 font-mono text-sm ${A?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`,rows:4}),A&&t.jsx("p",{className:"text-status-red text-xs mt-1",children:A})]},L):G.type==="string"?G.enum?t.jsxs("div",{className:"mb-4",children:[t.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[K,(I?!1:(ee=z.required)==null?void 0:ee.includes(K))&&t.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),G.description&&t.jsx("p",{className:"text-xs text-gray-500 mb-2",children:G.description}),t.jsxs("select",{value:Z||"",onChange:ie=>D(L,ie.target.value),className:`w-full border rounded-md px-3 py-2 ${A?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`,children:[t.jsx("option",{value:"",children:m("tool.selectOption")}),G.enum.map((ie,se)=>t.jsx("option",{value:ie,children:ie},se))]}),A&&t.jsx("p",{className:"text-status-red text-xs mt-1",children:A})]},L):t.jsxs("div",{className:"mb-4",children:[t.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[K,(I?!1:(X=z.required)==null?void 0:X.includes(K))&&t.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),G.description&&t.jsx("p",{className:"text-xs text-gray-500 mb-2",children:G.description}),t.jsx("input",{type:"text",value:Z||"",onChange:ie=>D(L,ie.target.value),className:`w-full border rounded-md px-3 py-2 ${A?"border-red":"border-gray-200"} focus:outline-none form-input`}),A&&t.jsx("p",{className:"text-status-red text-xs mt-1",children:A})]},L):G.type==="number"||G.type==="integer"?t.jsxs("div",{className:"mb-4",children:[t.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[K,(I?!1:(he=z.required)==null?void 0:he.includes(K))&&t.jsx("span",{className:"text-status-red ml-1",children:"*"})]}),G.description&&t.jsx("p",{className:"text-xs text-gray-500 mb-2",children:G.description}),t.jsx("input",{type:"number",step:G.type==="integer"?"1":"any",value:Z??"",onChange:ie=>{const se=ie.target.value===""?"":G.type==="integer"?parseInt(ie.target.value):parseFloat(ie.target.value);D(L,se)},className:`w-full border rounded-md px-3 py-2 form-input ${A?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),A&&t.jsx("p",{className:"text-status-red text-xs mt-1",children:A})]},L):G.type==="boolean"?t.jsxs("div",{className:"mb-4",children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("input",{type:"checkbox",checked:Z||!1,onChange:ie=>D(L,ie.target.checked),className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}),t.jsxs("label",{className:"ml-2 block text-sm text-gray-700",children:[K,(I?!1:(ae=z.required)==null?void 0:ae.includes(K))&&t.jsx("span",{className:"text-status-red ml-1",children:"*"})]})]}),G.description&&t.jsx("p",{className:"text-xs text-gray-500 mt-1",children:G.description}),A&&t.jsx("p",{className:"text-status-red text-xs mt-1",children:A})]},L):t.jsxs("div",{className:"mb-4",children:[t.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[K,(I?!1:(ye=z.required)==null?void 0:ye.includes(K))&&t.jsx("span",{className:"text-status-red ml-1",children:"*"}),t.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",G.type,")"]})]}),G.description&&t.jsx("p",{className:"text-xs text-gray-500 mb-2",children:G.description}),t.jsx("input",{type:"text",value:Z||"",onChange:ie=>D(L,ie.target.value),placeholder:m("tool.enterValue",{type:G.type}),className:`w-full border rounded-md px-3 py-2 ${A?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500 form-input`}),A&&t.jsx("p",{className:"text-status-red text-xs mt-1",children:A})]},L)};return z.properties?t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex justify-between items-center pb-3",children:[t.jsx("h6",{className:"text-md font-medium text-gray-900",children:d}),t.jsxs("div",{className:"flex space-x-2",children:[t.jsx("button",{type:"button",onClick:B,className:`px-3 py-1 text-sm rounded-md transition-colors ${y?"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")}),t.jsx("button",{type:"button",onClick:T,className:`px-3 py-1 text-sm rounded-md transition-colors ${y?"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")})]})]}),y?t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:m("tool.jsonConfiguration")}),t.jsx("textarea",{value:N,onChange:K=>E(K.target.value),placeholder:`{
235
- "key": "value"
236
- }`,className:`w-full h-64 border rounded-md px-3 py-2 font-mono text-sm resize-y form-input ${j?"border-red-500":"border-gray-300"} focus:outline-none focus:ring-2 focus:ring-blue-500`}),j&&t.jsx("p",{className:"text-status-red text-xs mt-1",children:j})]}),t.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[t.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")}),t.jsx("button",{onClick:()=>{try{const K=JSON.parse(N);n(K)}catch{C(m("tool.invalidJsonFormat"))}},disabled:o||!!j,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")})]})]}):t.jsxs("form",{onSubmit:R,className:"space-y-4",children:[Object.entries(z.properties||{}).map(([K,G])=>V(K,G)),t.jsxs("div",{className:"flex justify-end space-x-2 pt-4",children:[t.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")}),t.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")})]})]})]}):t.jsxs("div",{className:"p-4 bg-gray-50 rounded-md",children:[t.jsx("p",{className:"text-sm text-gray-600",children:m("tool.noParameters")}),t.jsxs("div",{className:"flex justify-end space-x-2 mt-4",children:[t.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")}),t.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")})]})]})},hS=({result:s,onClose:n})=>{const{t:l}=ve(),o=s.content,c=b=>b?b.startsWith("image/")?b:`image/${b}`:"image/png",d=b=>{if(!b)return[];if(Array.isArray(b))return b.flatMap(N=>d(N));if(typeof b!="object")return[];const y=[];b.type==="image"&&b.data&&y.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&&y.push({data:String(w),mimeType:c(b.image_mimeType||b.image_mime_type||b.mimeType||b.mime_type)}),b.image&&typeof b.image=="object"&&y.push(...d(b.image)),Array.isArray(b.images)&&y.push(...d(b.images)),Array.isArray(b.content)&&y.push(...d(b.content)),y},m=b=>{const y=[];try{const S=JSON.parse(b);if(y.push(...d(S)),y.length>0)return y}catch{}const w=/data:image\/(png|jpe?g|gif|webp);base64,([A-Za-z0-9+/=]+)/g;let N;for(;(N=w.exec(b))!==null;){const S=`image/${N[1]==="jpg"?"jpeg":N[1]}`;y.push({data:N[2],mimeType:S})}return y},f=b=>{try{const y=JSON.parse(b),w=N=>{if(Array.isArray(N))return N.map(w);if(N&&typeof N=="object"){const S={};for(const[j,C]of Object.entries(N))typeof C=="string"&&j.toLowerCase().includes("base64")?S[j]="[base64 omitted]":S[j]=w(C);return S}return N};return JSON.stringify(w(y),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((y,w)=>t.jsx("div",{className:"mb-3 last:mb-0",children:h(y)},w)):h(b),h=b=>{if(typeof b=="string"){const y=m(b),w=f(b);return t.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[y.length>0&&t.jsx("div",{className:"mb-3 space-y-3",children:y.map((N,S)=>t.jsx("img",{src:`data:${N.mimeType||"image/png"};base64,${N.data}`,alt:l("tool.toolResult"),className:"max-w-full h-auto rounded-md"},S))}),t.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 y=m(b.text),w=f(b.text);return t.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[y.length>0&&t.jsx("div",{className:"mb-3 space-y-3",children:y.map((N,S)=>t.jsx("img",{src:`data:${N.mimeType||"image/png"};base64,${N.data}`,alt:l("tool.toolResult"),className:"max-w-full h-auto rounded-md"},S))}),t.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:w})]})}if(b.type==="image"&&b.data)return t.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:t.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 y=typeof b=="string"?JSON.parse(b):b;return t.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[t.jsx("div",{className:"text-xs text-gray-500 mb-2",children:l("tool.jsonResponse")}),t.jsx("pre",{className:"text-sm text-gray-800 overflow-auto",children:JSON.stringify(y,null,2)})]})}catch{return t.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:t.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(b)})})}}return t.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:t.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(b)})})};return t.jsxs("div",{className:"border border-gray-300 rounded-lg bg-white shadow-sm",children:[t.jsx("div",{className:"border-b border-gray-300 px-4 py-3 bg-gray-50 rounded-t-lg",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[s.success?t.jsx(h0,{size:20,className:"text-status-green"}):t.jsx(x0,{size:20,className:"text-status-red"}),t.jsx("div",{children:t.jsxs("h4",{className:"text-sm font-medium text-gray-900",children:[l("tool.execution")," ",s.success?l("tool.successful"):l("tool.failed")]})})]}),t.jsx("button",{onClick:n,className:"text-gray-400 hover:text-gray-600 text-sm",children:"✕"})]})}),t.jsx("div",{className:"p-4",children:s.success?t.jsx("div",{children:s.content&&s.content.length>0?t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-gray-600 mb-3",children:l("tool.result")}),g(s.content)]}):t.jsx("div",{className:"text-sm text-gray-500 italic",children:l("tool.noContent")})}):t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[t.jsx(Cd,{size:16,className:"text-red-500"}),t.jsx("span",{className:"text-sm font-medium text-red-700",children:l("tool.error")})]}),o&&o.length>0?t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-gray-600 mb-3",children:l("tool.errorDetails")}),g(o)]}):t.jsx("div",{className:"bg-red-50 border border-red-300 rounded-md p-3",children:t.jsx("pre",{className:"text-sm text-red-800 whitespace-pre-wrap",children:s.error||s.message||l("tool.unknownError")})})]})})]})},kn=({title:s,onClick:n,disabled:l=!1,loading:o=!1})=>t.jsx("button",{type:"button",className:"ml-2 p-1 text-amber-600 hover:text-amber-700 cursor-pointer transition-colors disabled:opacity-60 disabled:cursor-not-allowed",onClick:n,disabled:l,title:s,"aria-label":s,children:t.jsx(Ew,{size:14,className:o?"animate-spin":""})});function xS(s){return s==null?!0:typeof s=="string"?s.trim()==="":Array.isArray(s)?s.length===0:typeof s=="object"?Object.keys(s).length===0:!1}const yS=({tool:s,server:n,onToggle:l,onDescriptionUpdate:o})=>{const{t:c}=ve(),{showToast:d}=Ms(),{nameSeparator:m}=Ta(),[f,g]=x.useState(!1),[h,b]=x.useState(!1),[y,w]=x.useState(!1),[N,S]=x.useState(null),[j,C]=x.useState(!1),[z,E]=x.useState(!1),[T,B]=x.useState(s.description||""),D=x.useRef(null),Y=x.useRef(null),[R,_]=x.useState(0),[P,V]=x.useState(!1);x.useEffect(()=>{j&&D.current&&(D.current.focus(),R>0&&(D.current.style.width=`${R+20}px`))},[j,R]),x.useEffect(()=>{!j&&Y.current&&_(Y.current.offsetWidth)},[j,T]),x.useEffect(()=>{B(s.description||"")},[s.description]);const K=x.useCallback(()=>`mcphub_tool_form_${n?`${n}_`:""}${s.name}`,[s.name,n]),G=x.useCallback(()=>{localStorage.removeItem(K())},[K]),I=M=>{l&&l(s.name,M)},L=()=>{C(!0)},Z=async()=>{try{const M=await V0(n,s.name,T);M.success?(C(!1),o&&o(s.name,T)):(B(s.description||""),console.error("Failed to update tool description:",M.error))}catch(M){console.error("Error updating tool description:",M),B(s.description||""),C(!1)}},A=M=>{B(M.target.value)},H=async()=>{E(!0);try{const M=await $0(n,s.name);if(M.success){const q=M.description||"";B(q),C(!1),o==null||o(s.name,q,{restored:!0})}else d(M.error||c("tool.restoreDefaultFailed"),"error")}catch(M){console.error("Error resetting tool description:",M),d(c("tool.restoreDefaultFailed"),"error")}finally{E(!1)}},J=M=>{M.key==="Enter"?Z():M.key==="Escape"&&(B(s.description||""),C(!1))},me=async M=>{M.stopPropagation();try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(s.name),V(!0),d(c("common.copySuccess"),"success"),setTimeout(()=>V(!1),2e3);else{const q=document.createElement("textarea");q.value=s.name,q.style.position="fixed",q.style.left="-9999px",document.body.appendChild(q),q.focus(),q.select();try{document.execCommand("copy"),V(!0),d(c("common.copySuccess"),"success"),setTimeout(()=>V(!1),2e3)}catch(de){d(c("common.copyFailed"),"error"),console.error("Copy to clipboard failed:",de)}document.body.removeChild(q)}}catch(q){d(c("common.copyFailed"),"error"),console.error("Copy to clipboard failed:",q)}},le=async M=>{w(!0);try{M=Object.fromEntries(Object.entries(M).filter(([de,ee])=>!xS(ee)));const q=await K0({toolName:s.name,arguments:M},n);S(q)}catch(q){S({success:!1,error:q instanceof Error?q.message:"Unknown error occurred"})}finally{w(!1)}},k=()=>{b(!1),G(),S(null)},U=()=>{S(null)};return t.jsxs("div",{className:"bg-white border border-gray-200 shadow rounded-lg mb-4",children:[t.jsxs("div",{className:"flex justify-between items-center cursor-pointer p-2",onClick:M=>{M.stopPropagation(),g(!f)},children:[t.jsx("div",{className:"flex-1",children:t.jsxs("h3",{className:"text-lg font-medium text-gray-900 inline-flex items-center",children:[s.name.replace(n+m,""),t.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:me,title:c("common.copy"),children:P?t.jsx(Os,{size:16,className:"text-green-500"}):t.jsx(jn,{size:16})}),t.jsx("span",{className:"ml-2 text-sm font-normal text-gray-600 inline-flex items-center",children:j?t.jsxs(t.Fragment,{children:[t.jsx("input",{ref:D,type:"text",className:"px-2 py-1 border border-blue-300 rounded bg-white text-sm focus:outline-none form-input",value:T,onChange:A,onKeyDown:J,onClick:M=>M.stopPropagation(),style:{minWidth:"100px",width:R>0?`${R+20}px`:"auto"}}),t.jsx("button",{className:"ml-2 p-1 text-green-600 hover:text-green-800 cursor-pointer transition-colors",onClick:M=>{M.stopPropagation(),Z()},disabled:z,children:t.jsx(Os,{size:16})}),t.jsx(kn,{title:c("tool.restoreDefault"),onClick:M=>{M.stopPropagation(),H()},disabled:z,loading:z})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{ref:Y,children:T||c("tool.noDescription")}),t.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:M=>{M.stopPropagation(),L()},children:t.jsx(ua,{size:14})}),t.jsx(kn,{title:c("tool.restoreDefault"),onClick:M=>{M.stopPropagation(),H()},disabled:z,loading:z})]})})]})}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"flex items-center space-x-2",onClick:M=>M.stopPropagation(),children:t.jsx(Jt,{checked:s.enabled??!0,onCheckedChange:I,disabled:y})}),t.jsxs("button",{onClick:M=>{M.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:y||!s.enabled,children:[y?t.jsx(y0,{size:14,className:"animate-spin"}):t.jsx(b0,{size:14}),t.jsx("span",{children:c(y?"tool.running":"tool.run")})]}),t.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:f?t.jsx(ca,{size:18}):t.jsx(wo,{size:18})})]})]}),f&&t.jsxs("div",{className:"mt-4 space-y-4",children:[!h&&t.jsxs("div",{className:"bg-gray-50 rounded p-3 border border-gray-300",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:c("tool.inputSchema")}),t.jsx("pre",{className:"text-xs text-gray-600 overflow-auto",children:JSON.stringify(s.inputSchema,null,2)})]}),h&&t.jsxs("div",{className:"border border-gray-300 rounded-lg p-4",children:[t.jsx(Y0,{schema:s.inputSchema||{type:"object"},onSubmit:le,onCancel:k,loading:y,storageKey:K(),title:c("tool.runToolWithName",{name:s.name.replace(n+m,"")})}),N&&t.jsx("div",{className:"mt-4",children:t.jsx(hS,{result:N,onClose:U})})]})]})]})},bS=async(s,n)=>{try{const l=n?`/prompts/call/${n}`:"/prompts/call",o=await pt(l,{promptName:s.promptName,arguments:s.arguments});return o.success?{success:!0,data:o.data}:{success:!1,error:o.message||"Prompt call failed"}}catch(l){return console.error("Error calling prompt",{promptName:s.promptName,server:n,error:l}),{success:!1,error:l instanceof Error?l.message:"Unknown error occurred"}}},J0=async(s,n)=>{try{const l=await pt(`/mcp/${encodeURIComponent(n||"")}/prompts/${encodeURIComponent(s.promptName)}`,{name:s.promptName,arguments:s.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",{promptName:s.promptName,server:n,error:l}),{success:!1,error:l instanceof Error?l.message:"Unknown error occurred"}}},vS=async(s,n,l)=>{try{const o=await pt(`/servers/${encodeURIComponent(s)}/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",{serverName:s,promptName:n,enabled:l,error:o}),{success:!1,error:o instanceof Error?o.message:"Unknown error occurred"}}},Q0=async(s,n,l)=>{try{const o=await At(`/servers/${encodeURIComponent(s)}/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",{serverName:s,promptName:n,error:o}),{success:!1,error:o instanceof Error?o.message:"Unknown error occurred"}}},X0=async(s,n)=>{var l;try{const o=await Kr(`/servers/${encodeURIComponent(s)}/prompts/${encodeURIComponent(n)}/description`,{headers:{Authorization:`Bearer ${localStorage.getItem("mcphub_token")}`}});return{success:o.success,error:o.success?void 0:o.message,description:(l=o.data)==null?void 0:l.description}}catch(o){return console.error("Error resetting prompt description",{serverName:s,promptName:n,error:o}),{success:!1,error:o instanceof Error?o.message:"Unknown error occurred"}}},wS=Object.freeze(Object.defineProperty({__proto__:null,callPrompt:bS,getPrompt:J0,resetPromptDescription:X0,togglePrompt:vS,updatePromptDescription:Q0},Symbol.toStringTag,{value:"Module"})),nh=({result:s,onClose:n})=>{const{t:l}=ve(),o=c=>{if(typeof c=="string")return t.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:t.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 t.jsxs("div",{className:"space-y-4",children:[c.description&&t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:l("prompt.description")}),t.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:t.jsx("p",{className:"text-sm text-gray-800",children:c.description})})]}),c.messages&&t.jsxs("div",{children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:l("prompt.messages")}),t.jsx("div",{className:"space-y-3",children:c.messages.map((d,m)=>t.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[t.jsx("div",{className:"flex items-center mb-2",children:t.jsxs("span",{className:"inline-block w-16 text-xs font-medium text-gray-500",children:[d.role,":"]})}),typeof d.content=="string"?t.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:d.content}):typeof d.content=="object"&&d.content.type==="text"?t.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:d.content.text}):t.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 t.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[t.jsx("div",{className:"text-xs text-gray-500 mb-2",children:l("prompt.jsonResponse")}),t.jsx("pre",{className:"text-sm text-gray-800 overflow-auto",children:JSON.stringify(d,null,2)})]})}catch{return t.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:t.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(c)})})}}return t.jsx("div",{className:"bg-gray-50 rounded-md p-3",children:t.jsx("pre",{className:"whitespace-pre-wrap text-sm text-gray-800 font-mono",children:String(c)})})};return t.jsxs("div",{className:"border border-gray-300 rounded-lg bg-white shadow-sm",children:[t.jsx("div",{className:"border-b border-gray-300 px-4 py-3 bg-gray-50 rounded-t-lg",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[s.success?t.jsx(h0,{size:20,className:"text-status-green"}):t.jsx(x0,{size:20,className:"text-status-red"}),t.jsx("div",{children:t.jsxs("h4",{className:"text-sm font-medium text-gray-900",children:[l("prompt.execution")," ",s.success?l("prompt.successful"):l("prompt.failed")]})})]}),t.jsx("button",{onClick:n,className:"text-gray-400 hover:text-gray-600 text-sm",children:"✕"})]})}),t.jsx("div",{className:"p-4",children:s.success?t.jsx("div",{children:s.data?t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-gray-600 mb-3",children:l("prompt.result")}),o(s.data)]}):t.jsx("div",{className:"text-sm text-gray-500 italic",children:l("prompt.noContent")})}):t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[t.jsx(Cd,{size:16,className:"text-red-500"}),t.jsx("span",{className:"text-sm font-medium text-red-700",children:l("prompt.error")})]}),t.jsx("div",{className:"bg-red-50 border border-red-300 rounded-md p-3",children:t.jsx("pre",{className:"text-sm text-red-800 whitespace-pre-wrap",children:s.error||s.message||l("prompt.unknownError")})})]})})]})},jS=({prompt:s,server:n,onToggle:l,onDescriptionUpdate:o})=>{const{t:c}=ve(),{showToast:d}=Ms(),{nameSeparator:m}=Ta(),[f,g]=x.useState(!1),[h,b]=x.useState(!1),[y,w]=x.useState(!1),[N,S]=x.useState(null),[j,C]=x.useState(!1),[z,E]=x.useState(!1),[T,B]=x.useState(s.description||""),D=x.useRef(null),Y=x.useRef(null),[R,_]=x.useState(0);x.useEffect(()=>{j&&D.current&&(D.current.focus(),R>0&&(D.current.style.width=`${R+20}px`))},[j,R]),x.useEffect(()=>{!j&&Y.current&&_(Y.current.offsetWidth)},[j,T]),x.useEffect(()=>{B(s.description||"")},[s.description]);const P=x.useCallback(()=>`mcphub_prompt_form_${n?`${n}_`:""}${s.name}`,[s.name,n]),V=x.useCallback(()=>{localStorage.removeItem(P())},[P]),K=k=>{l&&l(s.name,k)},G=()=>{C(!0)},I=async()=>{C(!1);try{const k=await Q0(n,s.name,T);k.success?o&&o(s.name,T):(d(k.error||c("prompt.descriptionUpdateFailed"),"error"),B(s.description||""))}catch(k){console.error("Error updating prompt description:",k),d(c("prompt.descriptionUpdateFailed"),"error"),B(s.description||"")}},L=async()=>{E(!0);try{const k=await X0(n,s.name);if(k.success){const U=k.description||"";B(U),C(!1),o==null||o(s.name,U,{restored:!0})}else d(k.error||c("prompt.restoreDefaultFailed"),"error")}catch(k){console.error("Error resetting prompt description:",k),d(c("prompt.restoreDefaultFailed"),"error")}finally{E(!1)}},Z=k=>{B(k.target.value)},A=k=>{k.key==="Enter"?I():k.key==="Escape"&&(B(s.description||""),C(!1))},H=async k=>{w(!0);try{const U=await J0({promptName:s.name,arguments:k},n);console.log("GetPrompt result:",U),S({success:U.success,data:U.data,error:U.error})}catch(U){S({success:!1,error:U instanceof Error?U.message:"Unknown error occurred"})}finally{w(!1)}},J=()=>{b(!1),V(),S(null)},me=()=>{S(null)},le=()=>{if(!s.arguments||s.arguments.length===0)return{type:"object",properties:{},required:[]};const k={},U=[];return s.arguments.forEach(M=>{k[M.name]={type:"string",description:M.description||""},M.required&&U.push(M.name)}),{type:"object",properties:k,required:U}};return t.jsxs("div",{className:"bg-white border border-gray-200 shadow rounded-lg mb-4",children:[t.jsxs("div",{className:"flex justify-between items-center p-2 cursor-pointer",onClick:()=>g(!f),children:[t.jsx("div",{className:"flex-1",children:t.jsxs("h3",{className:"text-lg font-medium text-gray-900",children:[s.name.replace(n+m,""),s.title&&t.jsx("span",{className:"ml-2 text-sm font-normal text-gray-600",children:s.title}),t.jsx("span",{className:"ml-2 text-sm font-normal text-gray-500 inline-flex items-center",children:j?t.jsxs(t.Fragment,{children:[t.jsx("input",{ref:D,type:"text",className:"px-2 py-1 border border-blue-300 rounded bg-white text-sm focus:outline-none form-input",value:T,onChange:Z,onKeyDown:A,onClick:k=>k.stopPropagation(),style:{minWidth:"100px",width:R>0?`${R+20}px`:"auto"}}),t.jsx("button",{className:"ml-2 p-1 text-green-600 hover:text-green-800 cursor-pointer transition-colors",onClick:k=>{k.stopPropagation(),I()},disabled:z,children:t.jsx(Os,{size:16})}),t.jsx(kn,{title:c("prompt.restoreDefault"),onClick:k=>{k.stopPropagation(),L()},disabled:z,loading:z})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{ref:Y,children:T||c("tool.noDescription")}),t.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:k=>{k.stopPropagation(),G()},children:t.jsx(ua,{size:14})}),t.jsx(kn,{title:c("prompt.restoreDefault"),onClick:k=>{k.stopPropagation(),L()},disabled:z,loading:z})]})})]})}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"flex items-center space-x-2",onClick:k=>k.stopPropagation(),children:s.enabled!==void 0&&t.jsx(Jt,{checked:s.enabled,onCheckedChange:K,disabled:y})}),t.jsxs("button",{onClick:k=>{k.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:y||!s.enabled,children:[y?t.jsx(y0,{size:14,className:"animate-spin"}):t.jsx(b0,{size:14}),t.jsx("span",{children:c(y?"tool.running":"tool.run")})]}),t.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:f?t.jsx(ca,{size:18}):t.jsx(wo,{size:18})})]})]}),f&&t.jsxs("div",{className:"mt-4 space-y-4",children:[h&&t.jsxs("div",{className:"border border-gray-300 rounded-lg p-4",children:[t.jsx(Y0,{schema:le(),onSubmit:H,onCancel:J,loading:y,storageKey:P(),title:c("prompt.runPromptWithName",{name:s.name.replace(n+m,"")})}),N&&t.jsx("div",{className:"mt-4",children:t.jsx(nh,{result:N,onClose:me})})]}),!h&&s.arguments&&s.arguments.length>0&&t.jsxs("div",{className:"bg-gray-50 rounded p-3 border border-gray-300",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:c("tool.parameters")}),t.jsx("div",{className:"space-y-2",children:s.arguments.map((k,U)=>t.jsxs("div",{className:"flex items-start",children:[t.jsxs("div",{className:"flex-1",children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("span",{className:"font-medium text-gray-700",children:k.name}),k.required&&t.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),k.description&&t.jsx("p",{className:"text-sm text-gray-600 mt-1",children:k.description})]}),t.jsx("div",{className:"text-xs text-gray-500 ml-2",children:k.title||""})]},U))})]}),!h&&N&&t.jsx("div",{className:"mt-4",children:t.jsx(nh,{result:N,onClose:me})})]})]})},SS=({resource:s,onToggle:n,onDescriptionUpdate:l})=>{const{t:o}=ve(),[c,d]=x.useState(!1),[m,f]=x.useState(!1),[g,h]=x.useState(!1),[b,y]=x.useState(s.description||""),w=x.useRef(null),N=x.useRef(null),[S,j]=x.useState(0);x.useEffect(()=>{m&&w.current&&(w.current.focus(),S>0&&(w.current.style.width=`${S+20}px`))},[m,S]),x.useEffect(()=>{!m&&N.current&&j(N.current.offsetWidth)},[m,b]),x.useEffect(()=>{y(s.description||"")},[s.description]);const C=B=>{n&&n(s.uri,B)},z=async()=>{f(!1),l&&await l(s.uri,b)},E=async()=>{h(!0);try{await(l==null?void 0:l(s.uri,"",{restored:!0})),f(!1)}finally{h(!1)}},T=B=>{B.key==="Enter"?z():B.key==="Escape"&&(y(s.description||""),f(!1))};return t.jsxs("div",{className:"bg-white border border-gray-200 shadow rounded-lg mb-4",children:[t.jsxs("div",{className:"flex justify-between items-center p-2 cursor-pointer",onClick:()=>d(!c),children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 truncate",children:s.name||s.uri}),t.jsx("div",{className:"text-sm text-gray-500 truncate",children:s.uri}),t.jsx("span",{className:"text-sm font-normal text-gray-500 inline-flex items-center mt-1",children:m?t.jsxs(t.Fragment,{children:[t.jsx("input",{ref:w,type:"text",className:"px-2 py-1 border border-blue-300 rounded bg-white text-sm focus:outline-none form-input",value:b,onChange:B=>y(B.target.value),onKeyDown:T,onClick:B=>B.stopPropagation(),style:{minWidth:"100px",width:S>0?`${S+20}px`:"auto"}}),t.jsx("button",{className:"ml-2 p-1 text-green-600 hover:text-green-800 cursor-pointer transition-colors",onClick:B=>{B.stopPropagation(),z()},disabled:g,children:t.jsx(Os,{size:16})}),t.jsx(kn,{title:o("builtinResources.restoreDefault"),onClick:B=>{B.stopPropagation(),E()},disabled:g,loading:g})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{ref:N,children:b||o("tool.noDescription")}),t.jsx("button",{className:"ml-2 p-1 text-gray-500 hover:text-blue-600 cursor-pointer transition-colors",onClick:B=>{B.stopPropagation(),f(!0)},children:t.jsx(ua,{size:14})}),t.jsx(kn,{title:o("builtinResources.restoreDefault"),onClick:B=>{B.stopPropagation(),E()},disabled:g,loading:g})]})})]}),t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:"flex items-center space-x-2",onClick:B=>B.stopPropagation(),children:t.jsx(Jt,{checked:s.enabled!==!1,onCheckedChange:C})}),t.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:c?t.jsx(ca,{size:18}):t.jsx(wo,{size:18})})]})]}),c&&t.jsx("div",{className:"mt-2 px-3 pb-3 text-sm text-gray-600 border-t border-gray-100",children:t.jsxs("div",{className:"pt-2",children:[t.jsxs("span",{className:"font-medium",children:[o("builtinResources.mimeType"),":"]})," ",s.mimeType||"text/plain"]})})]})},Od=({isOpen:s,onClose:n,onConfirm:l,serverName:o,isGroup:c=!1,isUser:d=!1})=>{const{t:m}=ve();return s?t.jsx("div",{className:"fixed inset-0 bg-black/50 bg-opacity-30 z-50 flex items-center justify-center p-4",children:t.jsx("div",{className:"bg-white rounded-lg shadow-lg max-w-md w-full",children:t.jsxs("div",{className:"p-6",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-3",children:m(d?"users.confirmDelete":c?"groups.confirmDelete":"server.confirmDelete")}),t.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})}),t.jsxs("div",{className:"flex justify-end space-x-3",children:[t.jsx("button",{onClick:n,className:"px-4 py-2 text-gray-600 hover:text-gray-800 btn-secondary",children:m("common.cancel")}),t.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},NS=({server:s,onRemove:n,onEdit:l,onToggle:o,onRefresh:c,onReload:d})=>{var X,he,ae,ye,ie,se,be,Ne;const{t:m}=ve(),{showToast:f}=Ms(),[g,h]=x.useState(null),[b,y]=x.useState(!1),[w,N]=x.useState(!1),[S,j]=x.useState(!1),[C,z]=x.useState(!1),[E,T]=x.useState(!1),B=x.useRef(null);x.useEffect(()=>{const xe=ke=>{B.current&&!B.current.contains(ke.target)&&z(!1)};return document.addEventListener("mousedown",xe),()=>{document.removeEventListener("mousedown",xe)}},[]);const{exportMCPSettings:D}=Ta(),Y=((X=s.tools)==null?void 0:X.length)||0,R=((he=s.tools)==null?void 0:he.filter(xe=>xe.enabled!==!1).length)||0,_=((ae=s.prompts)==null?void 0:ae.length)||0,P=((ye=s.prompts)==null?void 0:ye.filter(xe=>xe.enabled!==!1).length)||0,V=((ie=s.resources)==null?void 0:ie.length)||0,K=((se=s.resources)==null?void 0:se.filter(xe=>xe.enabled!==!1).length)||0,G=xe=>{xe.stopPropagation(),y(!0)},I=xe=>{xe.stopPropagation(),l(s)},L=async xe=>{if(xe.stopPropagation(),!(w||!o)){N(!0);try{await o(s,s.enabled===!1)}finally{N(!1)}}},Z=async xe=>{if(xe.stopPropagation(),!(S||!d)){j(!0);try{await d(s)?f(m("server.reloadSuccess")||"Server reloaded successfully","success"):f(m("server.reloadError",{serverName:s.name})||"Failed to reload server","error")}finally{j(!1)}}},A=xe=>{xe.stopPropagation(),z(!C)},H=xe=>{if(xe.stopPropagation(),!!s.error)if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(s.error).then(()=>{T(!0),f(m("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>T(!1),2e3)});else{const ke=document.createElement("textarea");ke.value=s.error,ke.style.position="fixed",ke.style.left="-9999px",document.body.appendChild(ke),ke.focus(),ke.select();try{document.execCommand("copy"),T(!0),f(m("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>T(!1),2e3)}catch(Se){f(m("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",Se)}document.body.removeChild(ke)}},J=async xe=>{xe.stopPropagation();try{const ke=await D(s.name);if(!ke||!ke.success||!ke.data){f((ke==null?void 0:ke.message)||m("common.copyFailed")||"Copy failed","error");return}const Se=JSON.stringify(ke.data,null,2);if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(Se),f(m("common.copySuccess")||"Copied to clipboard","success");else{const Le=document.createElement("textarea");Le.value=Se,Le.style.position="fixed",Le.style.left="-9999px",document.body.appendChild(Le),Le.focus(),Le.select();try{document.execCommand("copy"),f(m("common.copySuccess")||"Copied to clipboard","success")}catch(st){f(m("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",st)}document.body.removeChild(Le)}}catch(ke){console.error("Error copying server configuration:",ke),f(m("common.copyFailed")||"Copy failed","error")}},me=()=>{n(s.name),y(!1)},le=async(xe,ke)=>{try{const{toggleTool:Se}=await to(async()=>{const{toggleTool:st}=await Promise.resolve().then(()=>gS);return{toggleTool:st}},[],import.meta.url),Le=await Se(s.name,xe,ke);Le.success?(f(m(ke?"tool.enableSuccess":"tool.disableSuccess",{name:xe}),"success"),c&&c()):f(Le.error||m("tool.toggleFailed"),"error")}catch(Se){console.error("Error toggling tool:",Se),f(m("tool.toggleFailed"),"error")}},k=async(xe,ke)=>{try{const{togglePrompt:Se}=await to(async()=>{const{togglePrompt:st}=await Promise.resolve().then(()=>wS);return{togglePrompt:st}},void 0,import.meta.url),Le=await Se(s.name,xe,ke);Le.success?(f(m(ke?"tool.enableSuccess":"tool.disableSuccess",{name:xe}),"success"),c&&c()):f(Le.error||m("tool.toggleFailed"),"error")}catch(Se){console.error("Error toggling prompt:",Se),f(m("tool.toggleFailed"),"error")}},U=(xe,ke,Se)=>{f(Se!=null&&Se.restored?m("tool.restoreDefaultSuccess"):m("tool.descriptionUpdateSuccess"),"success"),c&&c()},M=(xe,ke,Se)=>{f(Se!=null&&Se.restored?m("prompt.restoreDefaultSuccess"):m("prompt.descriptionUpdateSuccess"),"success"),c&&c()},q=xe=>{var ke;if(xe.stopPropagation(),(ke=s.oauth)!=null&&ke.authorizationUrl){const st=window.screen.width/2-300,ft=window.screen.height/2-700/2;window.open(s.oauth.authorizationUrl,"OAuth Authorization",`width=600,height=700,left=${st},top=${ft}`),f(m("status.oauthWindowOpened"),"info")}},de=async(xe,ke)=>{try{const{toggleResource:Se}=await to(async()=>{const{toggleResource:st}=await import("./resourceService-CVrdQC8j.js");return{toggleResource:st}},[],import.meta.url),Le=await Se(s.name,xe,ke);Le.success?(f(m(ke?"tool.enableSuccess":"tool.disableSuccess",{name:xe}),"success"),c&&c()):f(Le.error||m("tool.toggleFailed"),"error")}catch(Se){console.error("Error toggling resource:",Se),f(m("tool.toggleFailed"),"error")}},ee=async(xe,ke,Se)=>{try{const{updateResourceDescription:Le,resetResourceDescription:st}=await to(async()=>{const{updateResourceDescription:Mt,resetResourceDescription:Pt}=await import("./resourceService-CVrdQC8j.js");return{updateResourceDescription:Mt,resetResourceDescription:Pt}},[],import.meta.url),ft=Se!=null&&Se.restored?await st(s.name,xe):await Le(s.name,xe,ke);ft.success?(f(Se!=null&&Se.restored?m("builtinResources.restoreDefaultSuccess"):m("builtinResources.descriptionUpdateSuccess"),"success"),c&&c()):f(ft.error||(Se!=null&&Se.restored?m("builtinResources.restoreDefaultFailed"):m("builtinResources.descriptionUpdateFailed")),"error")}catch(Le){console.error("Error updating resource description:",Le),f(Se!=null&&Se.restored?m("builtinResources.restoreDefaultFailed"):m("builtinResources.descriptionUpdateFailed"),"error")}};return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"bg-white shadow rounded-lg mb-6 page-card transition-all duration-200",children:[t.jsxs("div",{className:"flex justify-between items-center p-4",children:[t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("h2",{className:`text-xl font-semibold ${s.enabled===!1?"text-gray-600":"text-gray-900"}`,children:s.name}),((be=s.config)==null?void 0:be.description)&&t.jsxs("span",{className:"text-sm text-gray-500",children:["(",s.config.description,")"]}),t.jsx(pS,{status:s.status,onAuthClick:q}),((Ne=s.config)==null?void 0:Ne.type)&&t.jsx("div",{className:"flex items-center px-2 py-1 bg-gray-100 text-gray-700 rounded-full text-xs",children:t.jsxs("span",{children:[s.config.type==="stdio"&&m("server.typeStdio"),s.config.type==="sse"&&m("server.typeSse"),s.config.type==="streamable-http"&&m("server.typeStreamableHttp"),s.config.type==="openapi"&&m("server.typeOpenapi")]})}),t.jsxs("div",{className:`flex items-center px-2 py-1 rounded-full text-sm cursor-pointer transition-colors ${g==="tools"?"bg-blue-100 text-blue-800":"bg-blue-50 text-blue-700 hover:bg-blue-100"}`,onClick:xe=>{xe.stopPropagation(),h(ke=>ke==="tools"?null:"tools")},children:[t.jsx(Ed,{className:"w-4 h-4 mr-1"}),t.jsxs("span",{children:[Y===0?"0":`${R}/${Y}`," ",m("server.tools")]})]}),t.jsxs("div",{className:`flex items-center px-2 py-1 rounded-full text-sm cursor-pointer transition-colors ${g==="prompts"?"bg-purple-100 text-purple-800":"bg-purple-50 text-purple-700 hover:bg-purple-100"}`,onClick:xe=>{xe.stopPropagation(),h(ke=>ke==="prompts"?null:"prompts")},children:[t.jsx(Nn,{className:"w-4 h-4 mr-1"}),t.jsxs("span",{children:[_===0?"0":`${P}/${_}`," ",m("server.prompts")]})]}),t.jsxs("div",{className:`flex items-center px-2 py-1 rounded-full text-sm cursor-pointer transition-colors ${g==="resources"?"bg-emerald-100 text-emerald-800":"bg-emerald-50 text-emerald-700 hover:bg-emerald-100"}`,onClick:xe=>{xe.stopPropagation(),h(ke=>ke==="resources"?null:"resources")},children:[t.jsx(Sn,{className:"w-4 h-4 mr-1"}),t.jsxs("span",{children:[V===0?"0":`${K}/${V}`," ",m("nav.resources")]})]}),s.error&&t.jsxs("div",{className:"relative",children:[t.jsx("div",{className:"cursor-pointer",onClick:A,"aria-label":m("server.viewErrorDetails"),children:t.jsx(Cd,{className:"text-red-500 hover:text-red-600",size:18})}),C&&t.jsxs("div",{ref:B,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:xe=>xe.stopPropagation(),children:[t.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:[t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("h4",{className:"text-sm font-medium text-red-600",children:m("server.errorDetails")}),t.jsx("button",{onClick:H,className:"p-1 text-gray-400 hover:text-gray-600 transition-colors btn-secondary",title:m("common.copy"),children:E?t.jsx(Os,{size:14,className:"text-green-500"}):t.jsx(jn,{size:14})})]}),t.jsx("button",{onClick:xe=>{xe.stopPropagation(),z(!1)},className:"text-gray-400 hover:text-gray-600",children:"✕"})]}),t.jsx("div",{className:"p-4 pt-2",children:t.jsx("pre",{className:"text-sm text-gray-700 break-words whitespace-pre-wrap",children:s.error})})]})]})]}),t.jsxs("div",{className:"flex space-x-2",children:[t.jsx("button",{onClick:J,className:"px-3 py-1 btn-secondary",children:m("server.copy")}),t.jsx("button",{onClick:I,className:"px-3 py-1 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 text-sm btn-primary",children:m("server.edit")}),t.jsx("div",{className:"flex items-center",children:t.jsx("button",{onClick:L,className:`px-3 py-1 text-sm rounded transition-colors ${w?"bg-gray-200 text-gray-500":s.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||S,children:w?m("common.processing"):s.enabled!==!1?m("server.disable"):m("server.enable")})}),d&&t.jsx("button",{onClick:Z,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:S||w||s.enabled===!1,children:m(S?"common.processing":"server.reload")}),t.jsx("button",{onClick:G,className:"px-3 py-1 bg-red-100 text-red-800 rounded hover:bg-red-200 text-sm btn-danger",children:m("server.delete")}),t.jsx("button",{className:"text-gray-400 hover:text-gray-600 btn-secondary",children:g?t.jsx(ca,{size:18}):t.jsx(wo,{size:18})})]})]}),g==="tools"&&s.tools&&t.jsxs("div",{className:"px-4",children:[t.jsx("h6",{className:`font-medium ${s.enabled===!1?"text-gray-600":"text-gray-900"} mb-2`,children:m("server.tools")}),t.jsx("div",{className:"space-y-4",children:s.tools.map((xe,ke)=>t.jsx(yS,{server:s.name,tool:xe,onToggle:le,onDescriptionUpdate:U},ke))})]}),g==="prompts"&&s.prompts&&t.jsxs("div",{className:"px-4 pb-2",children:[t.jsx("h6",{className:`font-medium ${s.enabled===!1?"text-gray-600":"text-gray-900"}`,children:m("server.prompts")}),t.jsx("div",{className:"space-y-4",children:s.prompts.map((xe,ke)=>t.jsx(jS,{server:s.name,prompt:xe,onToggle:k,onDescriptionUpdate:M},ke))})]}),g==="resources"&&s.resources&&t.jsxs("div",{className:"px-4 pb-2",children:[t.jsx("h6",{className:`font-medium ${s.enabled===!1?"text-gray-600":"text-gray-900"}`,children:m("nav.resources")}),s.resources.length===0?t.jsx("div",{className:"text-sm text-gray-500 py-2",children:m("builtinResources.noResources")}):t.jsx("div",{className:"space-y-4",children:s.resources.map((xe,ke)=>t.jsx(SS,{resource:xe,onToggle:de,onDescriptionUpdate:ee},`${xe.uri}-${ke}`))})]})]}),t.jsx(Od,{isOpen:b,onClose:()=>y(!1),onConfirm:me,serverName:s.name})]})},lh=s=>{const n={};return s.forEach(({key:l,value:o})=>{const c=l.trim();c&&(n[c]=o)}),n},Z0=s=>s?s.split(",").map(n=>n.trim()).filter(n=>n.length>0):[],kS=s=>{const n={};return s!=null&&s.timeout&&s.timeout!==6e4&&(n.timeout=s.timeout),s!=null&&s.resetTimeoutOnProgress&&(n.resetTimeoutOnProgress=s.resetTimeoutOnProgress),s!=null&&s.maxTotalTimeout&&(n.maxTotalTimeout=s.maxTotalTimeout),n},CS=s=>{var b,y,w,N,S,j,C,z;if(!s)return{};const n={},l=(b=s.clientId)==null?void 0:b.trim(),o=(y=s.clientSecret)==null?void 0:y.trim(),c=(w=s.scopes)==null?void 0:w.trim(),d=(N=s.accessToken)==null?void 0:N.trim(),m=(S=s.refreshToken)==null?void 0:S.trim(),f=(j=s.authorizationEndpoint)==null?void 0:j.trim(),g=(C=s.tokenEndpoint)==null?void 0:C.trim(),h=(z=s.resource)==null?void 0:z.trim();if(l&&(n.clientId=l),o&&(n.clientSecret=o),c){const E=c.split(/[\s,]+/).map(T=>T.trim()).filter(T=>T.length>0);E.length>0&&(n.scopes=E)}return d&&(n.accessToken=d),m&&(n.refreshToken=m),f&&(n.authorizationEndpoint=f),g&&(n.tokenEndpoint=g),h&&(n.resource=h),n},AS=s=>{var l,o,c,d,m,f,g;const n={version:((l=s.openapi)==null?void 0:l.version)||"3.1.0",passthroughHeaders:Z0((o=s.openapi)==null?void 0:o.passthroughHeaders)};if(((c=s.openapi)==null?void 0:c.inputMode)==="url")n.url=((d=s.openapi)==null?void 0:d.url)||"";else if(((m=s.openapi)==null?void 0:m.inputMode)==="schema"&&((f=s.openapi)!=null&&f.schema))try{n.schema=JSON.parse(s.openapi.schema)}catch{throw new Error("Invalid JSON schema format")}return(g=s.openapi)!=null&&g.securityType&&s.openapi.securityType!=="none"&&(n.security={type:s.openapi.securityType,...s.openapi.securityType==="apiKey"&&{apiKey:{name:s.openapi.apiKeyName||"",in:s.openapi.apiKeyIn||"header",value:s.openapi.apiKeyValue||""}},...s.openapi.securityType==="http"&&{http:{scheme:s.openapi.httpScheme||"bearer",credentials:s.openapi.httpCredentials||""}},...s.openapi.securityType==="oauth2"&&{oauth2:{token:s.openapi.oauth2Token||""}},...s.openapi.securityType==="openIdConnect"&&{openIdConnect:{url:s.openapi.openIdConnectUrl||"",token:s.openapi.openIdConnectToken||""}}}),n},ES=({formData:s,serverType:n,envVars:l,headerVars:o})=>{var h,b,y;const c=lh(l),d=lh(o),m=kS(s.options),f=((h=s.description)==null?void 0:h.trim())||"",g={type:n,description:f,options:m};return n==="openapi"?(g.headers=d,g.openapi=AS(s)):n==="sse"||n==="streamable-http"?(g.url=s.url.trim(),g.env=c,g.headers=d,g.passthroughHeaders=Z0(s.passthroughHeaders),g.oauth=CS(s.oauth),g.enableKeepAlive=((b=s.keepAlive)==null?void 0:b.enabled)||!1,g.keepAliveInterval=(y=s.keepAlive)!=null&&y.enabled?s.keepAlive.interval||6e4:void 0):(g.command=s.command.trim(),g.args=s.args,g.env=c),{name:s.name.trim(),config:g}},Dl=({onSubmit:s,onCancel:n,initialData:l=null,modalTitle:o,formError:c=null})=>{var U,M,q,de,ee,X,he,ae,ye,ie,se,be,Ne,xe,ke,Se,Le,st,ft,Mt,Pt,Sr,gt,Nr,er,Qt,ht,Re,Oe,it,qt,Gt,ot,_t,bt,Vr,Ps,Ds,mr,sr,_r,ar,Br,Q,je,He,jt,Je,We,pr,tr;const{t:d}=ve(),m=()=>!l||!l.config?"stdio":l.config.type?l.config.type:l.config.url?"sse":"stdio",f=ge=>!ge||!ge.config||!ge.config.env?[]:Object.entries(ge.config.env).map(([oe,we])=>({key:oe,value:we,description:""})),g=ge=>{var we;const oe=(we=ge==null?void 0:ge.config)==null?void 0:we.oauth;return{clientId:(oe==null?void 0:oe.clientId)||"",clientSecret:(oe==null?void 0:oe.clientSecret)||"",scopes:oe!=null&&oe.scopes?oe.scopes.join(" "):"",accessToken:(oe==null?void 0:oe.accessToken)||"",refreshToken:(oe==null?void 0:oe.refreshToken)||"",authorizationEndpoint:(oe==null?void 0:oe.authorizationEndpoint)||"",tokenEndpoint:(oe==null?void 0:oe.tokenEndpoint)||"",resource:(oe==null?void 0:oe.resource)||""}},[h,b]=x.useState(m()),[y,w]=x.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:f(l),headers:[],passthroughHeaders:((M=(U=l==null?void 0:l.config)==null?void 0:U.passthroughHeaders)==null?void 0:M.join(", "))||"",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:((q=l==null?void 0:l.config)==null?void 0:q.enableKeepAlive)||!1,interval:((de=l==null?void 0:l.config)==null?void 0:de.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:((ee=l.config.openapi.security)==null?void 0:ee.type)||"none",apiKeyName:((he=(X=l.config.openapi.security)==null?void 0:X.apiKey)==null?void 0:he.name)||"",apiKeyIn:((ye=(ae=l.config.openapi.security)==null?void 0:ae.apiKey)==null?void 0:ye.in)||"header",apiKeyValue:((se=(ie=l.config.openapi.security)==null?void 0:ie.apiKey)==null?void 0:se.value)||"",httpScheme:((Ne=(be=l.config.openapi.security)==null?void 0:be.http)==null?void 0:Ne.scheme)||"bearer",httpCredentials:((ke=(xe=l.config.openapi.security)==null?void 0:xe.http)==null?void 0:ke.credentials)||"",oauth2Token:((Le=(Se=l.config.openapi.security)==null?void 0:Se.oauth2)==null?void 0:Le.token)||"",openIdConnectUrl:((ft=(st=l.config.openapi.security)==null?void 0:st.openIdConnect)==null?void 0:ft.url)||"",openIdConnectToken:((Pt=(Mt=l.config.openapi.security)==null?void 0:Mt.openIdConnect)==null?void 0:Pt.token)||"",passthroughHeaders:l.config.openapi.passthroughHeaders?l.config.openapi.passthroughHeaders.join(", "):""}:{inputMode:"url",url:"",schema:"",version:"3.1.0",securityType:"none",passthroughHeaders:""}}),[N,S]=x.useState(l&&l.config&&l.config.env?Object.entries(l.config.env).map(([ge,oe])=>({key:ge,value:oe})):[]),[j,C]=x.useState(l&&l.config&&l.config.headers?Object.entries(l.config.headers).map(([ge,oe])=>({key:ge,value:oe})):[]),[z,E]=x.useState(!1),[T,B]=x.useState(!1),[D,Y]=x.useState(!1),[R,_]=x.useState(null),P=!!l,V=ge=>{const{name:oe,value:we}=ge.target;w({...y,[oe]:we})},K=ge=>{const oe=ge.split(" ").filter(we=>we.trim()!=="");w({...y,arguments:ge,args:oe})},G=ge=>{b(ge),w(oe=>({...oe,type:ge}))},I=(ge,oe,we)=>{const $r=[...N];$r[ge][oe]=we,S($r)},L=()=>{S([...N,{key:"",value:""}])},Z=ge=>{const oe=[...N];oe.splice(ge,1),S(oe)},A=(ge,oe,we)=>{const $r=[...j];$r[ge][oe]=we,C($r)},H=()=>{C([...j,{key:"",value:""}])},J=ge=>{const oe=[...j];oe.splice(ge,1),C(oe)},me=(ge,oe)=>{w(we=>({...we,oauth:{...we.oauth||{},[ge]:oe}}))},le=(ge,oe)=>{w(we=>({...we,options:{...we.options,[ge]:oe}}))},k=async ge=>{ge.preventDefault(),_(null);try{const oe=ES({formData:y,serverType:h,envVars:N,headerVars:j});s(oe)}catch(oe){_(`Error: ${oe instanceof Error?oe.message:String(oe)}`)}};return t.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-3xl max-h-screen overflow-y-auto",children:[t.jsxs("div",{className:"flex justify-between items-center mb-4",children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:o}),t.jsx("button",{onClick:n,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),(R||c)&&t.jsx("div",{className:"bg-red-50 text-red-700 p-3 rounded mb-4",children:c||R}),t.jsxs("form",{onSubmit:k,children:[t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:d("server.name")}),t.jsx("input",{type:"text",name:"name",id:"name",value:y.name,onChange:V,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})]}),t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"description",children:d("server.description")}),t.jsx("input",{type:"text",name:"description",id:"description",value:y.description||"",onChange:V,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")})]}),t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:d("server.type")}),t.jsxs("div",{className:"flex space-x-4",children:[t.jsxs("div",{children:[t.jsx("input",{type:"radio",id:"command",name:"serverType",value:"command",checked:h==="stdio",onChange:()=>G("stdio"),className:"mr-1"}),t.jsx("label",{htmlFor:"command",children:d("server.typeStdio")})]}),t.jsxs("div",{children:[t.jsx("input",{type:"radio",id:"url",name:"serverType",value:"url",checked:h==="sse",onChange:()=>G("sse"),className:"mr-1"}),t.jsx("label",{htmlFor:"url",children:d("server.typeSse")})]}),t.jsxs("div",{children:[t.jsx("input",{type:"radio",id:"streamable-http",name:"serverType",value:"streamable-http",checked:h==="streamable-http",onChange:()=>G("streamable-http"),className:"mr-1"}),t.jsx("label",{htmlFor:"streamable-http",children:d("server.typeStreamableHttp")})]}),t.jsxs("div",{children:[t.jsx("input",{type:"radio",id:"openapi",name:"serverType",value:"openapi",checked:h==="openapi",onChange:()=>G("openapi"),className:"mr-1"}),t.jsx("label",{htmlFor:"openapi",children:d("server.typeOpenapi")})]})]})]}),h==="openapi"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:d("server.openapi.inputMode")}),t.jsxs("div",{className:"flex space-x-4",children:[t.jsxs("div",{children:[t.jsx("input",{type:"radio",id:"input-mode-url",name:"inputMode",value:"url",checked:((Sr=y.openapi)==null?void 0:Sr.inputMode)==="url",onChange:()=>w(ge=>({...ge,openapi:{...ge.openapi,inputMode:"url"}})),className:"mr-1"}),t.jsx("label",{htmlFor:"input-mode-url",children:d("server.openapi.inputModeUrl")})]}),t.jsxs("div",{children:[t.jsx("input",{type:"radio",id:"input-mode-schema",name:"inputMode",value:"schema",checked:((gt=y.openapi)==null?void 0:gt.inputMode)==="schema",onChange:()=>w(ge=>({...ge,openapi:{...ge.openapi,inputMode:"schema"}})),className:"mr-1"}),t.jsx("label",{htmlFor:"input-mode-schema",children:d("server.openapi.inputModeSchema")})]})]})]}),((Nr=y.openapi)==null?void 0:Nr.inputMode)==="url"&&t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"openapi-url",children:d("server.openapi.specUrl")}),t.jsx("input",{type:"url",name:"openapi-url",id:"openapi-url",value:((er=y.openapi)==null?void 0:er.url)||"",onChange:ge=>w(oe=>({...oe,openapi:{...oe.openapi,url:ge.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"&&((Qt=y.openapi)==null?void 0:Qt.inputMode)==="url"})]}),((ht=y.openapi)==null?void 0:ht.inputMode)==="schema"&&t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"openapi-schema",children:d("server.openapi.schema")}),t.jsx("textarea",{name:"openapi-schema",id:"openapi-schema",rows:10,value:((Re=y.openapi)==null?void 0:Re.schema)||"",onChange:ge=>w(oe=>({...oe,openapi:{...oe.openapi,schema:ge.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:`{
237
- "openapi": "3.1.0",
238
- "info": {
239
- "title": "API",
240
- "version": "1.0.0"
241
- },
242
- "servers": [
243
- {
244
- "url": "https://api.example.com"
245
- }
246
- ],
247
- "paths": {
248
- ...
249
- }
250
- }`,required:h==="openapi"&&((Oe=y.openapi)==null?void 0:Oe.inputMode)==="schema"}),t.jsx("p",{className:"text-xs text-gray-500 mt-1",children:d("server.openapi.schemaHelp")})]}),t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:d("server.openapi.security")}),t.jsxs("select",{value:((it=y.openapi)==null?void 0:it.securityType)||"none",onChange:ge=>w(oe=>{var we;return{...oe,openapi:{...oe.openapi,securityType:ge.target.value,url:((we=oe.openapi)==null?void 0:we.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:[t.jsx("option",{value:"none",children:d("server.openapi.securityNone")}),t.jsx("option",{value:"apiKey",children:d("server.openapi.securityApiKey")}),t.jsx("option",{value:"http",children:d("server.openapi.securityHttp")}),t.jsx("option",{value:"oauth2",children:d("server.openapi.securityOAuth2")}),t.jsx("option",{value:"openIdConnect",children:d("server.openapi.securityOpenIdConnect")})]})]}),((qt=y.openapi)==null?void 0:qt.securityType)==="apiKey"&&t.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:d("server.openapi.apiKeyConfig")}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.apiKeyName")}),t.jsx("input",{type:"text",value:((Gt=y.openapi)==null?void 0:Gt.apiKeyName)||"",onChange:ge=>w(oe=>{var we;return{...oe,openapi:{...oe.openapi,apiKeyName:ge.target.value,url:((we=oe.openapi)==null?void 0:we.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm form-input focus:outline-none",placeholder:"Authorization"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.apiKeyIn")}),t.jsxs("select",{value:((ot=y.openapi)==null?void 0:ot.apiKeyIn)||"header",onChange:ge=>w(oe=>{var we;return{...oe,openapi:{...oe.openapi,apiKeyIn:ge.target.value,url:((we=oe.openapi)==null?void 0:we.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[t.jsx("option",{value:"header",children:d("server.openapi.apiKeyInHeader")}),t.jsx("option",{value:"query",children:d("server.openapi.apiKeyInQuery")}),t.jsx("option",{value:"cookie",children:d("server.openapi.apiKeyInCookie")})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.apiKeyValue")}),t.jsx("input",{type:"password",value:((_t=y.openapi)==null?void 0:_t.apiKeyValue)||"",onChange:ge=>w(oe=>{var we;return{...oe,openapi:{...oe.openapi,apiKeyValue:ge.target.value,url:((we=oe.openapi)==null?void 0:we.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"your-api-key"})]})]})]}),((bt=y.openapi)==null?void 0:bt.securityType)==="http"&&t.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:d("server.openapi.httpAuthConfig")}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.httpScheme")}),t.jsxs("select",{value:((Vr=y.openapi)==null?void 0:Vr.httpScheme)||"bearer",onChange:ge=>w(oe=>{var we;return{...oe,openapi:{...oe.openapi,httpScheme:ge.target.value,url:((we=oe.openapi)==null?void 0:we.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",children:[t.jsx("option",{value:"basic",children:d("server.openapi.httpSchemeBasic")}),t.jsx("option",{value:"bearer",children:d("server.openapi.httpSchemeBearer")}),t.jsx("option",{value:"digest",children:d("server.openapi.httpSchemeDigest")})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.httpCredentials")}),t.jsx("input",{type:"password",value:((Ps=y.openapi)==null?void 0:Ps.httpCredentials)||"",onChange:ge=>w(oe=>{var we;return{...oe,openapi:{...oe.openapi,httpCredentials:ge.target.value,url:((we=oe.openapi)==null?void 0:we.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:((Ds=y.openapi)==null?void 0:Ds.httpScheme)==="basic"?"base64-encoded-credentials":"bearer-token"})]})]})]}),((mr=y.openapi)==null?void 0:mr.securityType)==="oauth2"&&t.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:d("server.openapi.oauth2Config")}),t.jsx("div",{className:"grid grid-cols-1 gap-3",children:t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.oauth2Token")}),t.jsx("input",{type:"password",value:((sr=y.openapi)==null?void 0:sr.oauth2Token)||"",onChange:ge=>w(oe=>{var we;return{...oe,openapi:{...oe.openapi,oauth2Token:ge.target.value,url:((we=oe.openapi)==null?void 0:we.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"access-token"})]})})]}),((_r=y.openapi)==null?void 0:_r.securityType)==="openIdConnect"&&t.jsxs("div",{className:"mb-4 p-4 border border-gray-200 rounded bg-gray-50",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-3",children:d("server.openapi.openIdConnectConfig")}),t.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.openIdConnectUrl")}),t.jsx("input",{type:"url",value:((ar=y.openapi)==null?void 0:ar.openIdConnectUrl)||"",onChange:ge=>w(oe=>{var we;return{...oe,openapi:{...oe.openapi,openIdConnectUrl:ge.target.value,url:((we=oe.openapi)==null?void 0:we.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"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.openapi.openIdConnectToken")}),t.jsx("input",{type:"password",value:((Br=y.openapi)==null?void 0:Br.openIdConnectToken)||"",onChange:ge=>w(oe=>{var we;return{...oe,openapi:{...oe.openapi,openIdConnectToken:ge.target.value,url:((we=oe.openapi)==null?void 0:we.url)||""}}}),className:"w-full border rounded px-2 py-1 text-sm focus:outline-none form-input",placeholder:"id-token"})]})]})]}),t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:d("server.openapi.passthroughHeaders")}),t.jsx("input",{type:"text",value:((Q=y.openapi)==null?void 0:Q.passthroughHeaders)||"",onChange:ge=>w(oe=>{var we;return{...oe,openapi:{...oe.openapi,passthroughHeaders:ge.target.value,url:((we=oe.openapi)==null?void 0:we.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"}),t.jsx("p",{className:"text-xs text-gray-500 mt-1",children:d("server.openapi.passthroughHeadersHelp")})]}),t.jsxs("div",{className:"mb-4",children:[t.jsxs("div",{className:"flex justify-between items-center mb-2",children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:d("server.headers")}),t.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:"+"})]}),j.map((ge,oe)=>t.jsxs("div",{className:"flex items-center mb-2",children:[t.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[t.jsx("input",{type:"text",value:ge.key,onChange:we=>A(oe,"key",we.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"}),t.jsx("span",{className:"flex items-center",children:":"}),t.jsx("input",{type:"text",value:ge.value,onChange:we=>A(oe,"value",we.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..."})]}),t.jsx("button",{type:"button",onClick:()=>J(oe),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:"-"})]},oe))]})]}):h==="sse"||h==="streamable-http"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"url",children:d("server.url")}),t.jsx("input",{type:"url",name:"url",id:"url",value:y.url,onChange:V,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"})]}),t.jsxs("div",{className:"mb-4",children:[t.jsxs("div",{className:"flex justify-between items-center mb-2",children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:d("server.headers")}),t.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:"+"})]}),j.map((ge,oe)=>t.jsxs("div",{className:"flex items-center mb-2",children:[t.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[t.jsx("input",{type:"text",value:ge.key,onChange:we=>A(oe,"key",we.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"}),t.jsx("span",{className:"flex items-center",children:":"}),t.jsx("input",{type:"text",value:ge.value,onChange:we=>A(oe,"value",we.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..."})]}),t.jsx("button",{type:"button",onClick:()=>J(oe),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:"-"})]},oe))]}),t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:d("server.openapi.passthroughHeaders")}),t.jsx("input",{type:"text",value:y.passthroughHeaders||"",onChange:ge=>w(oe=>({...oe,passthroughHeaders:ge.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:"Authorization, X-Custom-User-Id"}),t.jsx("p",{className:"text-xs text-gray-500 mt-1",children:d("server.openapi.passthroughHeadersHelp")})]}),t.jsxs("div",{className:"mb-4",children:[t.jsxs("div",{className:"flex justify-between items-center mb-2",children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:d("server.envVars")}),t.jsx("button",{type:"button",onClick:L,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:"+"})]}),N.map((ge,oe)=>t.jsxs("div",{className:"flex items-center mb-2",children:[t.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[t.jsx("input",{type:"text",value:ge.key,onChange:we=>I(oe,"key",we.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")}),t.jsx("span",{className:"flex items-center",children:":"}),t.jsx("input",{type:"text",value:ge.value,onChange:we=>I(oe,"value",we.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")})]}),t.jsx("button",{type:"button",onClick:()=>Z(oe),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:"-"})]},oe))]}),t.jsxs("div",{className:"mb-4",children:[t.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:()=>B(!T),children:[t.jsx("label",{className:"text-gray-700 text-sm font-bold",children:d("server.oauth.sectionTitle")}),t.jsx("span",{className:"text-gray-500 text-sm",children:T?"▼":"▶"})]}),T&&t.jsxs("div",{className:"border border-gray-200 rounded-b p-4 bg-gray-50 border-t-0",children:[t.jsx("p",{className:"text-xs text-gray-500 mb-3",children:d("server.oauth.sectionDescription")}),t.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.oauth.clientId")}),t.jsx("input",{type:"text",value:((je=y.oauth)==null?void 0:je.clientId)||"",onChange:ge=>me("clientId",ge.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"})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs text-gray-600 mb-1",children:d("server.oauth.clientSecret")}),t.jsx("input",{type:"password",value:((He=y.oauth)==null?void 0:He.clientSecret)||"",onChange:ge=>me("clientSecret",ge.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"})]})]})]})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"command",children:d("server.command")}),t.jsx("input",{type:"text",name:"command",id:"command",value:y.command,onChange:V,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"})]}),t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"arguments",children:d("server.arguments")}),t.jsx("input",{type:"text",name:"arguments",id:"arguments",value:y.arguments,onChange:ge=>K(ge.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"})]}),t.jsxs("div",{className:"mb-4",children:[t.jsxs("div",{className:"flex justify-between items-center mb-2",children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold",children:d("server.envVars")}),t.jsx("button",{type:"button",onClick:L,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:"+"})]}),N.map((ge,oe)=>t.jsxs("div",{className:"flex items-center mb-2",children:[t.jsxs("div",{className:"flex items-center space-x-2 flex-grow",children:[t.jsx("input",{type:"text",value:ge.key,onChange:we=>I(oe,"key",we.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")}),t.jsx("span",{className:"flex items-center",children:":"}),t.jsx("input",{type:"text",value:ge.value,onChange:we=>I(oe,"value",we.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")})]}),t.jsx("button",{type:"button",onClick:()=>Z(oe),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:"-"})]},oe))]})]}),h!=="openapi"&&t.jsxs("div",{className:"mb-4",children:[t.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:()=>E(!z),children:[t.jsx("label",{className:"text-gray-700 text-sm font-bold",children:d("server.requestOptions")}),t.jsx("span",{className:"text-gray-500 text-sm",children:z?"▼":"▶"})]}),z&&t.jsxs("div",{className:"border border-gray-200 rounded-b p-4 bg-gray-50 border-t-0",children:[t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"timeout",children:d("server.timeout")}),t.jsx("input",{type:"number",id:"timeout",value:((jt=y.options)==null?void 0:jt.timeout)||6e4,onChange:ge=>le("timeout",parseInt(ge.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"}),t.jsx("p",{className:"text-xs text-gray-500 mt-1",children:d("server.timeoutDescription")})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"maxTotalTimeout",children:d("server.maxTotalTimeout")}),t.jsx("input",{type:"number",id:"maxTotalTimeout",value:((Je=y.options)==null?void 0:Je.maxTotalTimeout)||"",onChange:ge=>le("maxTotalTimeout",ge.target.value?parseInt(ge.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"}),t.jsx("p",{className:"text-xs text-gray-500 mt-1",children:d("server.maxTotalTimeoutDescription")})]})]}),t.jsxs("div",{className:"mt-3",children:[t.jsxs("label",{className:"flex items-center",children:[t.jsx("input",{type:"checkbox",checked:((We=y.options)==null?void 0:We.resetTimeoutOnProgress)||!1,onChange:ge=>le("resetTimeoutOnProgress",ge.target.checked),className:"mr-2"}),t.jsx("span",{className:"text-gray-600 text-sm",children:d("server.resetTimeoutOnProgress")})]}),t.jsx("p",{className:"text-xs text-gray-500 mt-1 ml-6",children:d("server.resetTimeoutOnProgressDescription")})]})]})]}),(h==="sse"||h==="streamable-http")&&t.jsxs("div",{className:"mb-4",children:[t.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:()=>Y(!D),children:[t.jsx("label",{className:"text-gray-700 text-sm font-bold",children:d("server.keepAlive","Keep-Alive")}),t.jsx("span",{className:"text-gray-500 text-sm",children:D?"▼":"▶"})]}),D&&t.jsxs("div",{className:"border border-gray-200 rounded-b p-4 bg-gray-50 border-t-0",children:[t.jsxs("div",{className:"flex items-center mb-3",children:[t.jsx("input",{type:"checkbox",id:"enableKeepAlive",checked:((pr=y.keepAlive)==null?void 0:pr.enabled)||!1,onChange:ge=>w(oe=>({...oe,keepAlive:{...oe.keepAlive,enabled:ge.target.checked}})),className:"mr-2"}),t.jsx("label",{htmlFor:"enableKeepAlive",className:"text-gray-600 text-sm",children:d("server.enableKeepAlive","Enable Keep-Alive")})]}),t.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.")}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-gray-600 text-sm font-medium mb-1",htmlFor:"keepAliveInterval",children:d("server.keepAliveInterval","Interval (ms)")}),t.jsx("input",{type:"number",id:"keepAliveInterval",value:((tr=y.keepAlive)==null?void 0:tr.interval)||6e4,onChange:ge=>w(oe=>({...oe,keepAlive:{...oe.keepAlive,interval:parseInt(ge.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"}),t.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)")})]})]})]}),t.jsxs("div",{className:"flex justify-end mt-6",children:[t.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")}),t.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(P?"server.save":"server.add")})]})]})]})},W0=s=>{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((f,g)=>c(f,`${m}[${g}]`)):d&&typeof d=="object"&&Object.entries(d).forEach(([f,g])=>{c(g,m?`${m}.${f}`:f)})};return c(s),Array.from(n)},RS=({onAdd:s})=>{const{t:n}=ve(),[l,o]=x.useState(!1),[c,d]=x.useState(null),[m,f]=x.useState(!1),[g,h]=x.useState(null),[b,y]=x.useState([]),w=()=>{o(!l),d(null),f(!1),h(null)},N=async()=>{g&&(await S(g),f(!1),h(null))},S=async C=>{try{d(null);const z=await pt("/servers",C);if(!z.success){z&&z.message?d(z.message):d(n("server.addError"));return}o(!1),s()}catch(z){console.error("Error adding server:",z),navigator.onLine?z instanceof TypeError&&(z.message.includes("NetworkError")||z.message.includes("Failed to fetch"))?d(n("errors.serverConnection")):d(n("errors.serverAdd")):d(n("errors.network"))}},j=async C=>{try{const z=W0(C);z.length>0?(y(z),h(C),f(!0)):await S(C)}catch(z){console.error("Error processing server submission:",z),d(n("errors.serverAdd"))}};return t.jsxs("div",{children:[t.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:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:t.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&&t.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:t.jsx(Dl,{onSubmit:j,onCancel:w,modalTitle:n("server.addServer"),formError:c})}),m&&t.jsx("div",{className:"fixed inset-0 bg-black/50 z-[60] flex items-center justify-center p-4",children:t.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-md",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:n("server.confirmVariables")}),t.jsx("p",{className:"text-gray-600 mb-4",children:n("server.variablesDetected")}),t.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded p-3 mb-4",children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"flex-shrink-0",children:t.jsx("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:t.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"})})}),t.jsxs("div",{className:"ml-3",children:[t.jsxs("h4",{className:"text-sm font-medium text-yellow-800",children:[n("server.detectedVariables"),":"]}),t.jsx("ul",{className:"mt-1 text-sm text-yellow-700",children:b.map((C,z)=>t.jsxs("li",{className:"font-mono",children:["$",`{${C}}`]},z))})]})]})}),t.jsx("p",{className:"text-gray-600 text-sm mb-6",children:n("server.confirmVariablesMessage")}),t.jsxs("div",{className:"flex justify-end space-x-3",children:[t.jsx("button",{onClick:()=>{f(!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")}),t.jsx("button",{onClick:N,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 btn-primary",children:n("server.confirmAndAdd")})]})]})})]})},TS=({server:s,onEdit:n,onCancel:l})=>{const{t:o}=ve(),[c,d]=x.useState(null),m=async f=>{try{d(null);const g=encodeURIComponent(s.name),h=f.name&&f.name!==s.name,b={config:f.config,...h?{newName:f.name}:{}},y=await At(`/servers/${g}`,b);if(!y.success){y&&y.message?d(y.message):d(o("server.updateError",{serverName:s.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:s.name})):d(o("errors.network"))}};return t.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:t.jsx(Dl,{onSubmit:m,onCancel:l,initialData:s,modalTitle:o("server.editTitle",{serverName:s.name}),formError:c})})},zd=({isOpen:s,onClose:n,onConfirm:l,title:o,message:c,confirmText:d,cancelText:m,variant:f="warning"})=>{const{t:g}=ve();if(!s)return null;const h=()=>{switch(f){case"danger":return{icon:t.jsx("svg",{className:"w-6 h-6 text-red-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.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:t.jsx("svg",{className:"w-6 h-6 text-yellow-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.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:t.jsx("svg",{className:"w-6 h-6 text-blue-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.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:y}=h(),w=S=>{S.target===S.currentTarget&&n()},N=S=>{S.key==="Escape"?n():S.key==="Enter"&&l()};return t.jsx("div",{className:"fixed inset-0 bg-black/50 z-[100] flex items-center justify-center p-4",onClick:w,onKeyDown:N,tabIndex:-1,children:t.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:t.jsxs("div",{className:"p-6",children:[t.jsxs("div",{className:"flex items-start space-x-3",children:[b&&t.jsx("div",{className:"flex-shrink-0",children:b}),t.jsxs("div",{className:"flex-1",children:[o&&t.jsx("h3",{id:"confirm-dialog-title",className:"text-lg font-medium text-gray-900 mb-2",children:o}),t.jsx("p",{id:"confirm-dialog-message",className:"text-gray-600 leading-relaxed",children:c})]})]}),t.jsxs("div",{className:"flex justify-end space-x-3 mt-6",children:[t.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")}),t.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 ${y} ${f==="danger"?"btn-danger":f==="warning"?"btn-warning":"btn-primary"}`,children:d||g("common.confirm")})]})]})})})},OS=({onSuccess:s,onCancel:n})=>{const{t:l}=ve(),[o,c]=x.useState(!1),[d,m]=x.useState(!1),[f,g]=x.useState(null),[h,b]=x.useState(null),[y,w]=x.useState(!1),[N,S]=x.useState(null),[j,C]=x.useState(""),[z,E]=x.useState(!1),[T,B]=x.useState(""),D=L=>{L.preventDefault(),c(!0)},Y=L=>{L.preventDefault(),c(!1)},R=L=>{L.preventDefault(),c(!1);const Z=L.dataTransfer.files;if(Z.length>0){const A=Z[0];A.name.endsWith(".mcpb")?(b(A),g(null)):g(l("mcpb.invalidFileType"))}},_=L=>{const Z=L.target.files;if(Z&&Z.length>0){const A=Z[0];A.name.endsWith(".mcpb")?(b(A),g(null)):g(l("mcpb.invalidFileType"))}},P=async()=>{if(!h){g(l("mcpb.noFileSelected"));return}m(!0),g(null);try{const L=new FormData;L.append("mcpbFile",h);const Z=await Nd(Sd("/mcpb/upload"),{method:"POST",body:L}),A=await Z.json();if(!Z.ok)throw new Error(A.message||`HTTP error! Status: ${Z.status}`);if(A.success&&A.data)S(A.data.manifest),C(A.data.extractDir),w(!0);else throw new Error(A.message||l("mcpb.uploadFailed"))}catch(L){console.error("MCPB upload error:",L),g(L instanceof Error?L.message:l("mcpb.uploadFailed"))}finally{m(!1)}},V=async(L,Z=!1)=>{var A;m(!0),g(null);try{const H=I(N,j,L);if(!Z){const me=await Be("/servers");if(me.success&&((A=me.data)==null?void 0:A.find(k=>k.name===L))){B(L),E(!0),m(!1);return}}let J;if(Z?J=await At(`/servers/${encodeURIComponent(L)}`,{name:L,config:H}):J=await pt("/servers",{name:L,config:H}),J.success)s(H);else throw new Error(J.message||l("mcpb.installFailed"))}catch(H){console.error("MCPB install error:",H),g(H instanceof Error?H.message:l("mcpb.installFailed")),m(!1)}},K=()=>{E(!1),T&&V(T,!0)},G=()=>{E(!1),B(""),m(!1)},I=(L,Z,A)=>{var me;const H=((me=L.server)==null?void 0:me.mcp_config)||{},J={type:"stdio",command:H.command||"node",args:(H.args||[]).map(le=>le.replace("${__dirname}",Z))};return H.env&&Object.keys(H.env).length>0&&(J.env={...H.env},Object.keys(J.env).forEach(le=>{typeof J.env[le]=="string"&&(J.env[le]=J.env[le].replace("${__dirname}",Z))})),J};return y&&N?t.jsxs(t.Fragment,{children:[t.jsx(zd,{isOpen:z,onClose:G,onConfirm:K,title:l("mcpb.serverExistsTitle"),message:l("mcpb.serverExistsConfirm",{serverName:T}),confirmText:l("mcpb.override"),cancelText:l("common.cancel"),variant:"warning"}),t.jsx("div",{className:`fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4 ${z?"opacity-50 pointer-events-none":""}`,children:t.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-3xl max-h-screen overflow-y-auto",children:[t.jsxs("div",{className:"flex justify-between items-center mb-6",children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:l("mcpb.installServer")}),t.jsx("button",{onClick:n,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),f&&t.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:t.jsx("p",{className:"text-red-700",children:f})}),t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[t.jsx("h3",{className:"font-medium text-gray-900 mb-2",children:l("mcpb.extensionInfo")}),t.jsxs("div",{className:"space-y-2 text-sm",children:[t.jsxs("div",{children:[t.jsxs("strong",{children:[l("mcpb.name"),":"]})," ",N.display_name||N.name]}),t.jsxs("div",{children:[t.jsxs("strong",{children:[l("mcpb.version"),":"]})," ",N.version]}),t.jsxs("div",{children:[t.jsxs("strong",{children:[l("mcpb.description"),":"]})," ",N.description]}),N.author&&t.jsxs("div",{children:[t.jsxs("strong",{children:[l("mcpb.author"),":"]})," ",N.author.name]}),N.tools&&N.tools.length>0&&t.jsxs("div",{children:[t.jsxs("strong",{children:[l("mcpb.tools"),":"]}),t.jsx("ul",{className:"list-disc list-inside ml-4",children:N.tools.map((L,Z)=>t.jsxs("li",{children:[L.name," - ",L.description]},Z))})]})]})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:l("mcpb.serverName")}),t.jsx("input",{type:"text",id:"serverName",defaultValue:N.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")})]}),t.jsxs("div",{className:"flex justify-end space-x-4",children:[t.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")}),t.jsx("button",{onClick:()=>{const L=document.getElementById("serverName"),Z=(L==null?void 0:L.value.trim())||N.name;V(Z)},disabled:d,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center btn-primary",children:d?t.jsxs(t.Fragment,{children:[t.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:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.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")})]})]})]})})]}):t.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:t.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-lg",children:[t.jsxs("div",{className:"flex justify-between items-center mb-6",children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:l("mcpb.uploadTitle")}),t.jsx("button",{onClick:n,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),f&&t.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:t.jsx("p",{className:"text-red-700",children:f})}),t.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:D,onDragLeave:Y,onDrop:R,children:[h?t.jsxs("div",{className:"space-y-2",children:[t.jsx("svg",{className:"mx-auto h-12 w-12 text-green-200",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.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"})}),t.jsx("p",{className:"text-sm text-gray-900 font-medium",children:h.name}),t.jsxs("p",{className:"text-xs text-gray-500",children:[(h.size/1024/1024).toFixed(2)," MB"]})]}):t.jsxs("div",{className:"space-y-2",children:[t.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.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"})}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm text-gray-900",children:l("mcpb.dropFileHere")}),t.jsx("p",{className:"text-xs text-gray-500",children:l("mcpb.orClickToSelect")})]})]}),t.jsx("input",{type:"file",accept:".mcpb",onChange:_,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer"})]}),t.jsxs("div",{className:"mt-6 flex justify-end space-x-4",children:[t.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")}),t.jsx("button",{onClick:P,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?t.jsxs(t.Fragment,{children:[t.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:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.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")})]})]})})},zS=({onSuccess:s,onCancel:n})=>{const{t:l}=ve(),[o,c]=x.useState(""),[d,m]=x.useState(null),[f,g]=x.useState(!1),[h,b]=x.useState(null),y=`{
251
- "mcpServers": {
252
- "stdio-server-example": {
253
- "command": "npx",
254
- "args": ["-y", "mcp-server-example"]
255
- },
256
- "sse-server-example": {
257
- "type": "sse",
258
- "url": "http://localhost:3000"
259
- },
260
- "http-server-example": {
261
- "type": "streamable-http",
262
- "url": "http://localhost:3001",
263
- "headers": {
264
- "Content-Type": "application/json",
265
- "Authorization": "Bearer your-token"
266
- }
267
- },
268
- "openapi-server-example": {
269
- "type": "openapi",
270
- "openapi": {
271
- "url": "https://petstore.swagger.io/v2/swagger.json"
272
- }
273
- }
274
- }
275
- }
276
-
277
- Supports: STDIO, SSE, HTTP (streamable-http), OpenAPI
278
- All servers will be imported in a single efficient batch operation.`,w=j=>{try{const C=JSON.parse(j.trim());return!C.mcpServers||typeof C.mcpServers!="object"?(m(l("jsonImport.invalidFormat")),null):C}catch{return m(l("jsonImport.parseError")),null}},N=()=>{m(null);const j=w(o);if(!j)return;const C=Object.entries(j.mcpServers).map(([z,E])=>{const T={};return E.type==="sse"||E.type==="streamable-http"?(T.type=E.type,T.url=E.url,E.headers&&(T.headers=E.headers)):E.type==="openapi"?(T.type="openapi",T.openapi=E.openapi):(T.type="stdio",T.command=E.command,T.args=E.args||[],E.env&&(T.env=E.env)),{name:z,config:T}});b(C)},S=async()=>{if(h){g(!0),m(null);try{const j=await pt("/servers/batch",{servers:h});if(j.success&&j.data){const{successCount:C,failureCount:z,results:E}=j.data;if(z>0){const T=E.filter(B=>!B.success).map(B=>`${B.name}: ${B.message||l("jsonImport.addFailed")}`);m(l("jsonImport.partialSuccess",{count:C,total:h.length})+`
279
- `+T.join(`
280
- `))}C>0&&s()}else m(j.message||l("jsonImport.importFailed"))}catch(j){console.error("Import error:",j),m(l("jsonImport.importFailed"))}finally{g(!1)}}};return t.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:t.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[t.jsxs("div",{className:"flex justify-between items-center mb-6",children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:l("jsonImport.title")}),t.jsx("button",{onClick:n,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),d&&t.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:t.jsx("p",{className:"text-red-700 whitespace-pre-wrap",children:d})}),h?t.jsxs("div",{children:[t.jsxs("div",{className:"mb-4",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-3",children:l("jsonImport.previewTitle")}),t.jsx("div",{className:"space-y-3",children:h.map((j,C)=>t.jsx("div",{className:"bg-gray-50 p-4 rounded-lg border border-gray-200",children:t.jsx("div",{className:"flex items-start justify-between",children:t.jsxs("div",{className:"flex-1",children:[t.jsx("h4",{className:"font-medium text-gray-900",children:j.name}),t.jsxs("div",{className:"mt-2 space-y-1 text-sm text-gray-600",children:[t.jsxs("div",{children:[t.jsxs("strong",{children:[l("server.type"),":"]})," ",j.config.type||"stdio"]}),j.config.command&&t.jsxs("div",{children:[t.jsxs("strong",{children:[l("server.command"),":"]})," ",j.config.command]}),j.config.args&&j.config.args.length>0&&t.jsxs("div",{children:[t.jsxs("strong",{children:[l("server.arguments"),":"]})," ",j.config.args.join(" ")]}),j.config.url&&t.jsxs("div",{children:[t.jsxs("strong",{children:[l("server.url"),":"]})," ",j.config.url]}),j.config.env&&Object.keys(j.config.env).length>0&&t.jsxs("div",{children:[t.jsxs("strong",{children:[l("server.envVars"),":"]})," ",Object.keys(j.config.env).join(", ")]}),j.config.headers&&Object.keys(j.config.headers).length>0&&t.jsxs("div",{children:[t.jsxs("strong",{children:[l("server.headers"),":"]})," ",Object.keys(j.config.headers).join(", ")]})]})]})})},C))})]}),t.jsxs("div",{className:"flex justify-end space-x-4",children:[t.jsx("button",{onClick:()=>b(null),disabled:f,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")}),t.jsx("button",{onClick:S,disabled:f,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center btn-primary",children:f?t.jsxs(t.Fragment,{children:[t.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:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.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")})]})]}):t.jsxs("div",{children:[t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:l("jsonImport.inputLabel")}),t.jsx("textarea",{value:o,onChange:j=>c(j.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:y}),t.jsx("p",{className:"text-xs text-gray-500 mt-2",children:l("jsonImport.inputHelp")})]}),t.jsxs("div",{className:"flex justify-end space-x-4",children:[t.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")}),t.jsx("button",{onClick:N,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")})]})]})]})})},Md=({currentPage:s,totalPages:n,onPageChange:l,disabled:o=!1})=>{const{t:c}=ve(),d=()=>{const m=[];m.push(t.jsx("button",{onClick:()=>l(1),className:`px-3 py-1 mx-1 rounded ${s===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,s-Math.floor(5/2));g>2&&m.push(t.jsx("span",{className:"px-3 py-1",children:"..."},"ellipsis1"));for(let h=g;h<=Math.min(n-1,g+5-3);h++)m.push(t.jsx("button",{onClick:()=>l(h),className:`px-3 py-1 mx-1 rounded ${s===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(t.jsx("span",{className:"px-3 py-1",children:"..."},"ellipsis2")),n>1&&m.push(t.jsx("button",{onClick:()=>l(n),className:`px-3 py-1 mx-1 rounded ${s===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:t.jsxs("div",{className:"flex justify-center items-center my-6",children:[t.jsxs("button",{onClick:()=>l(Math.max(1,s-1)),disabled:o||s===1,className:`px-3 py-1 rounded mr-2 ${o||s===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")]}),t.jsx("div",{className:"flex",children:d()}),t.jsxs("button",{onClick:()=>l(Math.min(n,s+1)),disabled:o||s===n,className:`px-3 py-1 rounded ml-2 ${o||s===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")," »"]})]})},MS=()=>{const{t:s}=ve(),n=ls(),{servers:l,error:o,setError:c,isLoading:d,pagination:m,currentPage:f,serversPerPage:g,setCurrentPage:h,setServersPerPage:b,handleServerAdd:y,handleServerEdit:w,handleServerRemove:N,handleServerToggle:S,handleServerReload:j,triggerRefresh:C}=Pl({refreshOnMount:!0}),[z,E]=x.useState(null),[T,B]=x.useState(!1),[D,Y]=x.useState(!1),[R,_]=x.useState(!1),P=async L=>{const Z=await w(L);Z&&E(Z)},V=()=>{E(null),C()},K=async()=>{B(!0);try{C(),await new Promise(L=>setTimeout(L,500))}finally{B(!1)}},G=L=>{Y(!1),C()},I=()=>{_(!1),C()};return t.jsxs("div",{children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:s("pages.servers.title")}),t.jsxs("div",{className:"flex space-x-4",children:[t.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:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:t.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"})}),s("nav.market")]}),t.jsx(RS,{onAdd:y}),t.jsxs("button",{onClick:()=>_(!0),className:"px-4 py-2 bg-blue-100 text-blue-800 rounded hover:bg-blue-200 flex items-center btn-primary transition-all duration-200",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:t.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"})}),s("jsonImport.button")]}),t.jsxs("button",{onClick:()=>Y(!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:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:t.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"})}),s("mcpb.upload")]}),t.jsxs("button",{onClick:K,disabled:T,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 ${T?"opacity-70 cursor-not-allowed":""}`,children:[T?t.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:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.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"})]}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:t.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"})}),s("common.refresh")]})]})]}),o&&t.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm error-box",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{children:t.jsx("p",{className:"text-gray-600 mt-1",children:o})}),t.jsx("button",{onClick:()=>c(null),className:"ml-4 text-gray-500 hover:text-gray-700 transition-colors duration-200 btn-secondary","aria-label":s("app.closeButton"),children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:t.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?t.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center loading-container",children:t.jsxs("div",{className:"flex flex-col items-center",children:[t.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:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.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"})]}),t.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}):l.length===0?t.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state",children:t.jsx("p",{className:"text-gray-600",children:s("app.noServers")})}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"space-y-6",children:l.map((L,Z)=>t.jsx(NS,{server:L,onRemove:N,onEdit:P,onToggle:S,onRefresh:C,onReload:j},Z))}),t.jsxs("div",{className:"flex items-center mb-4",children:[t.jsx("div",{className:"flex-[2] text-sm text-gray-500",children:m?s("common.showing",{start:(m.page-1)*m.limit+1,end:Math.min(m.page*m.limit,m.total),total:m.total}):s("common.showing",{start:1,end:l.length,total:l.length})}),t.jsx("div",{className:"flex-[4] flex justify-center",children:m&&m.totalPages>1&&t.jsx(Md,{currentPage:f,totalPages:m.totalPages,onPageChange:h,disabled:d})}),t.jsxs("div",{className:"flex-[2] flex items-center justify-end space-x-2",children:[t.jsxs("label",{htmlFor:"perPage",className:"text-sm text-gray-600",children:[s("common.itemsPerPage"),":"]}),t.jsxs("select",{id:"perPage",value:g,onChange:L=>b(Number(L.target.value)),disabled:d,className:"border rounded p-1 text-sm btn-secondary outline-none disabled:opacity-50 disabled:cursor-not-allowed",children:[t.jsx("option",{value:5,children:"5"}),t.jsx("option",{value:10,children:"10"}),t.jsx("option",{value:20,children:"20"}),t.jsx("option",{value:50,children:"50"})]})]})]})]}),z&&t.jsx(TS,{server:z,onEdit:V,onCancel:()=>E(null)}),D&&t.jsx(OS,{onSuccess:G,onCancel:()=>Y(!1)}),R&&t.jsx(zS,{onSuccess:I,onCancel:()=>_(!1)})]})},So=()=>{const{t:s}=ve(),[n,l]=x.useState([]),[o,c]=x.useState(!0),[d,m]=x.useState(null),[f,g]=x.useState(0),h=x.useCallback(async()=>{try{c(!0);const z=await Be("/groups");z&&z.success&&Array.isArray(z.data)?l(z.data):(console.error("Invalid group data format:",z),l([])),m(null)}catch(z){console.error("Error fetching groups:",z),m(z instanceof Error?z.message:"Failed to fetch groups"),l([])}finally{c(!1)}},[]),b=x.useCallback(()=>{g(z=>z+1)},[]),y=async(z,E,T=[])=>{try{const B=await pt("/groups",{name:z,description:E,servers:T});return console.log("Group created successfully:",B),!B||!B.success?(m((B==null?void 0:B.message)||s("groups.createError")),B):(b(),B||null)}catch(B){return m(B instanceof Error?B.message:"Failed to create group"),null}},w=async(z,E)=>{try{const T=await At(`/groups/${z}`,E);return!T||!T.success?(m((T==null?void 0:T.message)||s("groups.updateError")),T):(b(),T||null)}catch(T){return m(T instanceof Error?T.message:"Failed to update group"),null}},N=async(z,E)=>{try{const T=await At(`/groups/${z}/servers/batch`,{servers:E});return!T||!T.success?(m((T==null?void 0:T.message)||s("groups.updateError")),null):(b(),T.data||null)}catch(T){return m(T instanceof Error?T.message:"Failed to update group servers"),null}},S=async z=>{try{const E=await Kr(`/groups/${z}`);return!E||!E.success?(m((E==null?void 0:E.message)||s("groups.deleteError")),E):(b(),E)}catch(E){return m(E instanceof Error?E.message:"Failed to delete group"),null}},j=async(z,E)=>{try{const T=await pt(`/groups/${z}/servers`,{serverName:E});return!T||!T.success?(m((T==null?void 0:T.message)||s("groups.serverAddError")),null):(b(),T.data||null)}catch(T){return m(T instanceof Error?T.message:"Failed to add server to group"),null}},C=async(z,E)=>{try{const T=await Kr(`/groups/${z}/servers/${E}`);return!T||!T.success?(m((T==null?void 0:T.message)||s("groups.serverRemoveError")),null):(b(),T.data||null)}catch(T){return m(T instanceof Error?T.message:"Failed to remove server from group"),null}};return x.useEffect(()=>{h()},[h,f]),{groups:n,loading:o,error:d,setError:m,triggerRefresh:b,createGroup:y,updateGroup:w,updateGroupServers:N,deleteGroup:S,addServerToGroup:j,removeServerFromGroup:C}},PS={tools:[],prompts:[],resources:[]},ih={tools:"all",prompts:"all",resources:"all"},ex=({servers:s,value:n,onChange:l,className:o})=>{const{t:c}=ve(),{nameSeparator:d}=Ta(),[m,f]=x.useState(new Set),g=As.useMemo(()=>n.map(R=>typeof R=="string"?{name:R,...ih}:{...R,tools:R.tools||"all",prompts:R.prompts||"all",resources:R.resources||"all"}),[n]),h=As.useMemo(()=>s.filter(R=>R.enabled!==!1),[s]);As.useEffect(()=>{const R=new Set(g.map(P=>P.name)),_=new Set(h.map(P=>P.name));f(P=>{const V=new Set;return P.forEach(K=>{(R.has(K)||_.has(K))&&V.add(K)}),V})},[g,h]);const b=R=>{if(g.findIndex(P=>P.name===R)>=0){const P=g.filter(V=>V.name!==R);l(P)}else{const P=[...g,{name:R,...ih}];l(P)}},y=R=>{f(_=>{const P=new Set(_);return P.has(R)?P.delete(R):P.add(R),P})},w=R=>["tools","prompts","resources"].some(_=>{const P=R[_];return P==="all"||Array.isArray(P)&&P.length>0}),N=(R,_,P,V=!1)=>{const K=g.find(L=>L.name===R),I={...K?{...K}:{name:R,...PS},[_]:P};if(!w(I)){const L=g.filter(Z=>Z.name!==R);l(L),V||f(Z=>{const A=new Set(Z);return A.delete(R),A});return}if(K){l(g.map(L=>L.name===R?I:L));return}l([...g,I])},S=(R,_)=>{const P=`${R}${d}`;return _.startsWith(P)?_.slice(P.length):_},j=(R,_)=>_==="tools"?(R.tools||[]).filter(P=>P.enabled!==!1).map(P=>({key:P.name,value:S(R.name,P.name),description:P.description})):_==="prompts"?(R.prompts||[]).filter(P=>P.enabled!==!1).map(P=>({key:P.name,value:S(R.name,P.name),description:P.description})):(R.resources||[]).filter(P=>P.enabled!==!1).map(P=>({key:P.uri,value:P.uri,description:P.description})),C=(R,_,P)=>{const V=h.find(L=>L.name===R);if(!V)return;const K=j(V,_).map(L=>L.value),G=g.find(L=>L.name===R);if(!G){N(R,_,[P]);return}const I=G[_];if(I==="all"){const L=K.filter(Z=>Z!==P);N(R,_,L);return}if(Array.isArray(I)){if(I.includes(P)){N(R,_,I.filter(Z=>Z!==P));return}const L=[...I,P];N(R,_,L.length===K.length?"all":L);return}N(R,_,[P])},z=R=>{const _=g.find(P=>P.name===R);return!!(_&&w(_))},E=R=>{const _=g.find(P=>P.name===R);return _?["tools","prompts","resources"].some(P=>{const V=_[P];return Array.isArray(V)&&V.length>0}):!1},T=(R,_,P)=>{const V=g.find(G=>G.name===R);if(!V)return!1;const K=V[_];return K==="all"?!0:Array.isArray(K)?K.includes(P):!1},B=(R,_)=>{const P=g.find(G=>G.name===R.name);if(!P)return 0;const V=j(R,_),K=P[_];if(K==="all")return V.length;if(Array.isArray(K)){const G=new Set(V.map(I=>I.value));return K.filter(I=>G.has(I)).length}return 0},D=[{key:"tools",titleKey:"groups.toolSelection",countKey:"groups.toolsSelected",allKey:"groups.allTools"},{key:"prompts",titleKey:"groups.promptSelection",countKey:"groups.promptsSelected",allKey:"groups.allPrompts"},{key:"resources",titleKey:"groups.resourceSelection",countKey:"groups.resourcesSelected",allKey:"groups.allResources"}],Y=R=>D.map(({key:_})=>({key:_,count:B(R,_)})).filter(_=>_.count>0);return t.jsxs("div",{className:Rs("space-y-4",o),children:[t.jsx("div",{className:"space-y-3",children:h.map(R=>{const _=z(R.name),P=E(R.name),V=m.has(R.name),K=g.find(L=>L.name===R.name),G=Y(R),I=D.filter(({key:L})=>j(R,L).length>0);return t.jsxs("div",{className:"border border-gray-200 rounded-lg hover:border-gray-300 hover:bg-gray-50 transition-colors",children:[t.jsxs("div",{className:"flex items-center justify-between p-3 cursor-pointer rounded-lg transition-colors",onClick:()=>y(R.name),children:[t.jsxs("div",{className:"flex items-center space-x-3",onClick:L=>{L.stopPropagation(),b(R.name)},children:[t.jsx("input",{type:"checkbox",checked:_||P,onChange:()=>b(R.name),className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"}),t.jsx("span",{className:"font-medium text-gray-900 cursor-pointer select-none",children:R.name})]}),t.jsxs("div",{className:"flex items-center space-x-3",children:[G.map(({key:L,count:Z})=>t.jsxs("span",{className:"text-sm text-green-600 flex items-center gap-1",children:[L==="tools"?t.jsx(Ed,{size:14}):L==="prompts"?t.jsx(Nn,{size:14}):t.jsx(Sn,{size:14})," ",Z]},L)),I.length>0&&t.jsx("button",{type:"button",className:"p-1 text-gray-400 hover:text-gray-600 transition-colors",children:t.jsx("svg",{className:Rs("w-5 h-5 transition-transform",V&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]})]}),V&&I.length>0&&t.jsx("div",{className:"border-t border-gray-200 bg-gray-50 p-3",children:t.jsx("div",{className:"space-y-4",children:I.map(({key:L,titleKey:Z,countKey:A,allKey:H})=>{const J=j(R,L),me=B(R,L),le=(K==null?void 0:K[L])==="all"||me===J.length;return t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsx("span",{className:"text-sm font-medium text-gray-700",children:c(Z)}),t.jsxs("div",{className:"flex items-center gap-3",children:[K&&t.jsx("span",{className:"text-xs text-green-600",children:le?`(${c(H)} ${J.length}/${J.length})`:`(${c(A)} ${me}/${J.length})`}),t.jsx("button",{type:"button",onClick:()=>{N(R.name,L,le?[]:"all",!0)},className:"text-sm text-blue-600 hover:text-blue-800 transition-colors",children:c(le?"groups.selectNone":"groups.selectAll")})]})]}),t.jsx("div",{className:"grid grid-cols-1 gap-2 max-h-32 overflow-y-auto",children:J.map(k=>{const U=T(R.name,L,k.value);return t.jsxs("label",{className:"flex items-center space-x-2 text-sm",children:[t.jsx("input",{type:"checkbox",checked:U,onChange:()=>C(R.name,L,k.value),className:"w-3 h-3 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500"}),t.jsx("span",{className:"text-gray-700 break-all whitespace-nowrap",children:k.value}),k.description&&t.jsx("span",{className:"text-gray-400 text-xs truncate",children:k.description})]},k.key)})})]},L)})})})]},R.name)})}),h.length===0&&t.jsx("p",{className:"text-gray-500 text-sm",children:c("groups.noServerOptions")})]})},DS=({onAdd:s,onCancel:n})=>{const{t:l}=ve(),{createGroup:o}=So(),{allServers:c}=Pl(),[d,m]=x.useState([]),[f,g]=x.useState(null),[h,b]=x.useState(!1),[y,w]=x.useState({name:"",description:"",servers:[]});x.useEffect(()=>{m(c.filter(j=>j.enabled!==!1))},[c]);const N=j=>{const{name:C,value:z}=j.target;w(E=>({...E,[C]:z}))},S=async j=>{j.preventDefault(),b(!0),g(null);try{if(!y.name.trim()){g(l("groups.nameRequired")),b(!1);return}const C=await o(y.name,y.description,y.servers);if(!C||!C.success){g((C==null?void 0:C.message)||l("groups.createError")),b(!1);return}s()}catch(C){g(C instanceof Error?C.message:String(C)),b(!1)}};return t.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:t.jsxs("div",{className:"bg-white rounded-lg shadow-lg max-w-3xl w-full max-h-[90vh] flex flex-col",children:[t.jsxs("div",{className:"p-6 flex-shrink-0",children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:l("groups.addNew")}),f&&t.jsx("div",{className:"mb-4 p-3 bg-red-100 text-red-700 rounded-md border border-gray-200",children:f})]}),t.jsxs("form",{onSubmit:S,className:"flex flex-col flex-1 min-h-0",children:[t.jsx("div",{className:"flex-1 overflow-y-auto px-6",children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsxs("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:[l("groups.name")," *"]}),t.jsx("input",{type:"text",id:"name",name:"name",value:y.name,onChange:N,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})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:l("groups.configureCapabilities")}),t.jsx(ex,{servers:d,value:y.servers,onChange:j=>w(C=>({...C,servers:j})),className:"border border-gray-200 rounded-lg p-4 bg-gray-50"})]})]})}),t.jsxs("div",{className:"flex justify-end space-x-3 p-6 pt-4 border-t border-gray-200 flex-shrink-0",children:[t.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")}),t.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")})]})]})]})})},LS=({group:s,onEdit:n,onCancel:l})=>{const{t:o}=ve(),{updateGroup:c}=So(),{allServers:d}=Pl(),[m,f]=x.useState([]),[g,h]=x.useState(null),[b,y]=x.useState(!1),[w,N]=x.useState({name:s.name,description:s.description||"",servers:s.servers||[]});x.useEffect(()=>{f(d.filter(C=>C.enabled!==!1))},[d]);const S=C=>{const{name:z,value:E}=C.target;N(T=>({...T,[z]:E}))},j=async C=>{C.preventDefault(),y(!0),h(null);try{if(!w.name.trim()){h(o("groups.nameRequired")),y(!1);return}const z=await c(s.id,{name:w.name,description:w.description,servers:w.servers});if(!z||!z.success){h((z==null?void 0:z.message)||o("groups.updateError")),y(!1);return}n()}catch(z){h(z instanceof Error?z.message:String(z)),y(!1)}};return t.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:t.jsxs("div",{className:"bg-white rounded-lg shadow-lg max-w-3xl w-full max-h-[90vh] flex flex-col",children:[t.jsxs("div",{className:"p-6 flex-shrink-0",children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-800 mb-4",children:o("groups.edit")}),g&&t.jsx("div",{className:"mb-4 p-3 bg-red-100 text-red-700 rounded-md border border-gray-200",children:g})]}),t.jsxs("form",{onSubmit:j,className:"flex flex-col flex-1 min-h-0",children:[t.jsx("div",{className:"flex-1 overflow-y-auto px-6",children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsxs("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"name",children:[o("groups.name")," *"]}),t.jsx("input",{type:"text",id:"name",name:"name",value:w.name,onChange:S,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})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",children:o("groups.configureCapabilities")}),t.jsx(ex,{servers:m,value:w.servers,onChange:C=>N(z=>({...z,servers:C})),className:"border border-gray-200 rounded-lg p-4 bg-gray-50"})]})]})}),t.jsxs("div",{className:"flex justify-end space-x-3 p-6 pt-4 border-t border-gray-200 flex-shrink-0",children:[t.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")}),t.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")})]})]})]})})},US=({group:s,servers:n,onEdit:l,onDelete:o})=>{const{t:c}=ve(),{showToast:d}=Ms(),{installConfig:m,nameSeparator:f}=Ta(),[g,h]=x.useState(!1),[b,y]=x.useState(!1),[w,N]=x.useState(!1),[S,j]=x.useState(null),C=x.useRef(null);x.useEffect(()=>{const G=I=>{C.current&&!C.current.contains(I.target)&&N(!1)};return document.addEventListener("mousedown",G),()=>{document.removeEventListener("mousedown",G)}},[]);const z=()=>{l(s)},E=()=>{h(!0)},T=()=>{o(s.id),h(!1)},B=G=>{if(navigator.clipboard&&window.isSecureContext)navigator.clipboard.writeText(G).then(()=>{y(!0),N(!1),d(c("common.copySuccess"),"success"),setTimeout(()=>y(!1),2e3)});else{const I=document.createElement("textarea");I.value=G,I.style.position="fixed",I.style.left="-9999px",document.body.appendChild(I),I.focus(),I.select();try{document.execCommand("copy"),y(!0),N(!1),d(c("common.copySuccess"),"success"),setTimeout(()=>y(!1),2e3)}catch(L){d(c("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",L)}document.body.removeChild(I)}},D=()=>{B(s.id)},Y=()=>{B(`${m.baseUrl}/mcp/${s.id}`)},R=()=>{const G={mcpServers:{mcphub:{url:`${m.baseUrl}/mcp/${s.id}`,headers:{Authorization:"Bearer <your-access-token>"}}}};B(JSON.stringify(G,null,2))},_=G=>G.map(I=>typeof I=="string"?I:I.name),P=G=>{const I=s.servers.find(L=>typeof L=="string"?L===G:L.name===G);return typeof I=="string"?{name:I,tools:"all",prompts:"all",resources:"all"}:I},V=_(s.servers),K=n.filter(G=>V.includes(G.name));return t.jsxs("div",{className:"bg-white shadow rounded-lg p-4",children:[t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-800",children:s.name}),t.jsxs("div",{className:"flex items-center ml-3",children:[t.jsx("span",{className:"text-xs text-gray-500 mr-1",children:s.id}),t.jsxs("div",{className:"relative",ref:C,children:[t.jsxs("button",{onClick:()=>N(!w),className:"p-1 text-gray-400 hover:text-gray-600 transition-colors flex items-center",title:c("common.copy"),children:[b?t.jsx(Os,{size:14,className:"text-green-500"}):t.jsx(jn,{size:14}),t.jsx(ca,{size:12,className:"ml-1"})]}),w&&t.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:[t.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:[t.jsx(jn,{size:12,className:"mr-2"}),c("common.copyId")]}),t.jsxs("button",{onClick:Y,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[t.jsx(hw,{size:12,className:"mr-2"}),c("common.copyUrl")]}),t.jsxs("button",{onClick:R,className:"w-full px-3 py-2 text-left text-sm text-gray-700 hover:bg-gray-100 flex items-center",children:[t.jsx(dw,{size:12,className:"mr-2"}),c("common.copyJson")]})]})]})]})]}),s.description&&t.jsx("p",{className:"text-gray-600 text-sm mt-1",children:s.description})]}),t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("div",{className:"bg-blue-50 text-blue-700 px-3 py-1 rounded-full text-sm btn-secondary",children:c("groups.serverCount",{count:s.servers.length})}),t.jsx("button",{onClick:z,className:"text-gray-500 hover:text-gray-700",title:c("groups.edit"),children:t.jsx(ua,{size:18})}),t.jsx("button",{onClick:E,className:"text-gray-500 hover:text-red-600",title:c("groups.delete"),children:t.jsx(jo,{size:18})})]})]}),t.jsx("div",{className:"",children:K.length===0?t.jsx("p",{className:"text-gray-500 italic",children:c("groups.noServers")}):t.jsx("div",{className:"flex flex-wrap gap-2",children:K.map(G=>{const I=P(G.name),L=I&&I.tools!=="all"&&Array.isArray(I.tools),Z=I&&I.prompts!=="all"&&Array.isArray(I.prompts),A=I&&I.resources!=="all"&&Array.isArray(I.resources),H=(G.tools||[]).filter(Ne=>Ne.enabled!==!1),J=(G.prompts||[]).filter(Ne=>Ne.enabled!==!1),me=(G.resources||[]).filter(Ne=>Ne.enabled!==!1),le=Ne=>{const xe=`${G.name}${f}`;return Ne.startsWith(xe)?Ne.slice(xe.length):Ne},k=Ne=>{const xe=`${G.name}${f}`;return Ne.startsWith(xe)?Ne.slice(xe.length):Ne},U=H.map(Ne=>le(Ne.name)),M=J.map(Ne=>k(Ne.name)),q=me.map(Ne=>Ne.uri),de=new Set(U),ee=new Set(M),X=new Set(q),he=L&&Array.isArray(I==null?void 0:I.tools)?I.tools.filter(Ne=>de.has(Ne)).length:U.length,ae=Z&&Array.isArray(I==null?void 0:I.prompts)?I.prompts.filter(Ne=>ee.has(Ne)).length:M.length,ye=A&&Array.isArray(I==null?void 0:I.resources)?I.resources.filter(Ne=>X.has(Ne)).length:q.length,ie=S===G.name,se=Ne=>Ne==="tools"?L&&Array.isArray(I==null?void 0:I.tools)?I.tools.filter(xe=>de.has(xe)):U:Ne==="prompts"?Z&&Array.isArray(I==null?void 0:I.prompts)?I.prompts.filter(xe=>ee.has(xe)):M:A&&Array.isArray(I==null?void 0:I.resources)?I.resources.filter(xe=>X.has(xe)):q,be=()=>{j(ie?null:G.name)};return t.jsxs("div",{className:"relative",children:[t.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:be,children:[t.jsx("span",{className:"font-medium text-gray-700 text-sm",children:G.name}),t.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${G.status==="connected"?"bg-green-500":G.status==="connecting"?"bg-yellow-500":"bg-red-500"}`}),he>0&&t.jsxs("span",{className:"text-xs text-blue-600 bg-blue-100 px-2 py-0.5 rounded flex items-center gap-1",children:[t.jsx(Ed,{size:12}),he]}),ae>0&&t.jsxs("span",{className:"text-xs text-purple-600 bg-purple-100 px-2 py-0.5 rounded flex items-center gap-1",children:[t.jsx(Nn,{size:12}),ae]}),ye>0&&t.jsxs("span",{className:"text-xs text-emerald-600 bg-emerald-100 px-2 py-0.5 rounded flex items-center gap-1",children:[t.jsx(Sn,{size:12}),ye]})]}),ie&&t.jsx("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:t.jsxs("div",{className:"space-y-3",children:[he>0&&t.jsxs("div",{children:[t.jsxs("div",{className:"text-gray-600 text-xs mb-2",children:[c(L?"groups.selectedTools":"groups.allTools"),":"]}),t.jsx("div",{className:"flex flex-wrap gap-1",children:se("tools").map((Ne,xe)=>t.jsx("span",{className:"inline-block bg-gray-100 text-gray-700 px-2 py-1 rounded text-xs",children:Ne},`tool-${xe}`))})]}),ae>0&&t.jsxs("div",{children:[t.jsxs("div",{className:"text-gray-600 text-xs mb-2",children:[c(Z?"groups.selectedPrompts":"groups.allPrompts"),":"]}),t.jsx("div",{className:"flex flex-wrap gap-1",children:se("prompts").map((Ne,xe)=>t.jsx("span",{className:"inline-block bg-purple-50 text-purple-700 px-2 py-1 rounded text-xs",children:Ne},`prompt-${xe}`))})]}),ye>0&&t.jsxs("div",{children:[t.jsxs("div",{className:"text-gray-600 text-xs mb-2",children:[c(A?"groups.selectedResources":"groups.allResources"),":"]}),t.jsx("div",{className:"flex flex-wrap gap-1",children:se("resources").map((Ne,xe)=>t.jsx("span",{className:"inline-block bg-emerald-50 text-emerald-700 px-2 py-1 rounded text-xs break-all",children:Ne},`resource-${xe}`))})]})]})})]},G.name)})})}),t.jsx(Od,{isOpen:g,onClose:()=>h(!1),onConfirm:T,serverName:s.name,isGroup:!0})]})},_S=({onSuccess:s,onCancel:n})=>{const{t:l}=ve(),[o,c]=x.useState(""),[d,m]=x.useState(null),[f,g]=x.useState(!1),[h,b]=x.useState(null),y=`{
281
- "groups": [
282
- {
283
- "name": "AI Assistants",
284
- "servers": ["openai-server", "anthropic-server"]
285
- },
286
- {
287
- "name": "Development Tools",
288
- "servers": [
289
- {
290
- "name": "github-server",
291
- "tools": ["create_issue", "list_repos"],
292
- "prompts": ["triage_prompt"],
293
- "resources": ["resource://docs/repo-guide"]
294
- },
295
- {
296
- "name": "gitlab-server",
297
- "tools": "all",
298
- "prompts": "all",
299
- "resources": "all"
300
- }
301
- ]
302
- }
303
- ]
304
- }
305
-
306
- Supports:
307
- - Simple server list: ["server1", "server2"]
308
- - Advanced server config: [{"name": "server1", "tools": ["tool1"], "prompts": ["prompt1"], "resources": ["resource://docs/guide"]}]
309
- - All groups will be imported in a single efficient batch operation.`,w=E=>{try{const T=JSON.parse(E.trim());if(!T.groups||!Array.isArray(T.groups))return m(l("groupImport.invalidFormat")),null;for(const B of T.groups)if(!B.name||typeof B.name!="string")return m(l("groupImport.missingName")),null;return T}catch{return m(l("groupImport.parseError")),null}},N=()=>{m(null);const E=w(o);E&&b(E.groups)},S=async()=>{if(h){g(!0),m(null);try{const E=await pt("/groups/batch",{groups:h});if(E.success){const{successCount:T,failureCount:B,results:D}=E;if(B>0){const Y=D.filter(R=>!R.success).map(R=>`${R.name}: ${R.message||l("groupImport.addFailed")}`);m(l("groupImport.partialSuccess",{count:T,total:h.length})+`
310
- `+Y.join(`
311
- `))}T>0&&s()}else m(E.message||l("groupImport.importFailed"))}catch(E){console.error("Import error:",E),m(l("groupImport.importFailed"))}finally{g(!1)}}},j=E=>t.jsx("span",{className:"text-gray-500 ml-2",children:l(`groups.${E}`)}),C=(E,T)=>{if(!T||T==="all")return null;const B=Array.isArray(T)?T.join(", "):T;return t.jsx("span",{className:"text-gray-500 ml-2",children:l(`groups.${E}`,{items:B})})},z=E=>!E||E.length===0?t.jsx("span",{className:"text-gray-500",children:l("groups.noServers")}):t.jsx("div",{className:"space-y-1",children:E.map((T,B)=>typeof T=="string"?t.jsxs("div",{className:"text-sm",children:["• ",T]},B):t.jsxs("div",{className:"text-sm",children:["• ",T.name,T.tools&&T.tools!=="all"&&t.jsxs("span",{className:"text-gray-500 ml-2",children:["(",Array.isArray(T.tools)?T.tools.join(", "):T.tools,")"]}),T.tools==="all"&&j("previewAllTools"),C("previewPrompts",T.prompts),T.prompts==="all"&&j("previewAllPrompts"),C("previewResources",T.resources),T.resources==="all"&&j("previewAllResources")]},B))});return t.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:t.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[t.jsxs("div",{className:"flex justify-between items-center mb-6",children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:l("groupImport.title")}),t.jsx("button",{onClick:n,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),d&&t.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:t.jsx("p",{className:"text-red-700 whitespace-pre-wrap",children:d})}),h?t.jsxs("div",{children:[t.jsxs("div",{className:"mb-4",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-3",children:l("groupImport.previewTitle")}),t.jsx("div",{className:"space-y-3",children:h.map((E,T)=>t.jsx("div",{className:"bg-gray-50 p-4 rounded-lg border border-gray-200",children:t.jsx("div",{className:"flex items-start justify-between",children:t.jsxs("div",{className:"flex-1",children:[t.jsx("h4",{className:"font-medium text-gray-900",children:E.name}),E.description&&t.jsx("p",{className:"text-sm text-gray-600 mt-1",children:E.description}),t.jsxs("div",{className:"mt-2 text-sm text-gray-600",children:[t.jsxs("strong",{children:[l("groups.servers"),":"]}),t.jsx("div",{className:"mt-1",children:z(E.servers)})]})]})})},T))})]}),t.jsxs("div",{className:"flex justify-end space-x-4",children:[t.jsx("button",{onClick:()=>b(null),disabled:f,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")}),t.jsx("button",{onClick:S,disabled:f,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 flex items-center btn-primary",children:f?t.jsxs(t.Fragment,{children:[t.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:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.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")})]})]}):t.jsxs("div",{children:[t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:l("groupImport.inputLabel")}),t.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:y}),t.jsx("p",{className:"text-xs text-gray-500 mt-2",children:l("groupImport.inputHelp")})]}),t.jsxs("div",{className:"flex justify-end space-x-4",children:[t.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")}),t.jsx("button",{onClick:N,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")})]})]})]})})},BS=({groups:s,onCancel:n})=>{const{t:l}=ve(),[o,c]=x.useState(""),[d,m]=x.useState(""),[f,g]=x.useState([]),[h,b]=x.useState(!1),[y,w]=x.useState(!1),[N,S]=x.useState(null),j=E=>{g(T=>T.includes(E)?T.filter(B=>B!==E):[...T,E])},C=()=>{f.length===s.length?g([]):g(s.map(E=>E.id))},z=async()=>{if(!o.trim()){S(l("template.nameRequired"));return}w(!0),S(null);try{const E=await pt("/templates/export",{name:o.trim(),description:d.trim()||void 0,groupIds:f.length>0?f:void 0,includeDisabledServers:h});if(E.success&&E.data){const T=E.data,B=new Blob([JSON.stringify(T,null,2)],{type:"application/json"}),D=URL.createObjectURL(B),Y=document.createElement("a");Y.href=D,Y.download=`${T.name.replace(/[^a-zA-Z0-9-_]/g,"_")}.mcphub-template.json`,document.body.appendChild(Y),Y.click(),document.body.removeChild(Y),URL.revokeObjectURL(D),n()}else S(E.message||l("template.exportFailed"))}catch(E){console.error("Export error:",E),S(l("template.exportFailed"))}finally{w(!1)}};return t.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:t.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-3xl max-h-[90vh] overflow-y-auto",children:[t.jsxs("div",{className:"flex justify-between items-center mb-6",children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:l("template.exportTitle")}),t.jsx("button",{onClick:n,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),N&&t.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:t.jsx("p",{className:"text-red-700",children:N})}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[l("template.name")," *"]}),t.jsx("input",{type:"text",value:o,onChange:E=>c(E.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:l("template.namePlaceholder")})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:l("template.description")}),t.jsx("input",{type:"text",value:d,onChange:E=>m(E.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",placeholder:l("template.descriptionPlaceholder")})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex justify-between items-center mb-2",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700",children:l("template.selectGroups")}),t.jsx("button",{onClick:C,className:"text-sm text-blue-600 hover:text-blue-800",children:f.length===s.length?l("template.deselectAll"):l("template.selectAll")})]}),t.jsx("p",{className:"text-xs text-gray-500 mb-2",children:l("template.selectGroupsHelp")}),t.jsx("div",{className:"border border-gray-200 rounded-md max-h-48 overflow-y-auto",children:s.map(E=>t.jsxs("label",{className:"flex items-center px-3 py-2 hover:bg-gray-50 cursor-pointer",children:[t.jsx("input",{type:"checkbox",checked:f.includes(E.id),onChange:()=>j(E.id),className:"mr-3 h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),t.jsxs("div",{children:[t.jsx("span",{className:"text-sm font-medium text-gray-900",children:E.name}),E.description&&t.jsx("span",{className:"text-xs text-gray-500 ml-2",children:E.description})]})]},E.id))})]}),t.jsxs("label",{className:"flex items-center space-x-2 cursor-pointer",children:[t.jsx("input",{type:"checkbox",checked:h,onChange:E=>b(E.target.checked),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"}),t.jsx("span",{className:"text-sm text-gray-700",children:l("template.includeDisabled")})]})]}),t.jsx("div",{className:"mt-4 p-3 bg-blue-50 border border-blue-200 rounded-md",children:t.jsx("p",{className:"text-sm text-blue-700",children:l("template.exportNote")})}),t.jsxs("div",{className:"flex justify-end space-x-4 mt-6",children:[t.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")}),t.jsx("button",{onClick:z,disabled:y||!o.trim(),className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed btn-primary",children:l(y?"template.exporting":"template.export")})]})]})})},IS=({onSuccess:s,onCancel:n})=>{const{t:l}=ve(),[o,c]=x.useState(null),[d,m]=x.useState(null),[f,g]=x.useState(!1),[h,b]=x.useState(null),y=x.useRef(null),w=j=>{var E;m(null),c(null),b(null);const C=(E=j.target.files)==null?void 0:E[0];if(!C)return;const z=new FileReader;z.onload=T=>{var B;try{const D=JSON.parse((B=T.target)==null?void 0:B.result);if(!D.version||!D.name||!D.servers||!D.groups){m(l("template.invalidFormat"));return}c(D)}catch{m(l("template.parseError"))}},z.readAsText(C)},N=j=>{if(m(null),c(null),b(null),!!j.trim())try{const C=JSON.parse(j.trim());if(!C.version||!C.name||!C.servers||!C.groups){m(l("template.invalidFormat"));return}c(C)}catch{m(l("template.parseError"))}},S=async()=>{if(o){g(!0),m(null);try{const j=await pt("/templates/import",o);j.data?(b(j.data),j.data.success&&s()):m(j.message||l("template.importFailed"))}catch(j){console.error("Import error:",j),m(l("template.importFailed"))}finally{g(!1)}}};return t.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:t.jsxs("div",{className:"bg-white shadow rounded-lg p-6 w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[t.jsxs("div",{className:"flex justify-between items-center mb-6",children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:l("template.importTitle")}),t.jsx("button",{onClick:n,className:"text-gray-500 hover:text-gray-700",children:"✕"})]}),d&&t.jsx("div",{className:"mb-4 bg-red-50 border-l-4 border-red-500 p-4 rounded",children:t.jsx("p",{className:"text-red-700",children:d})}),h&&t.jsxs("div",{className:`mb-4 p-4 rounded border-l-4 ${h.success?"bg-green-50 border-green-500":"bg-yellow-50 border-yellow-500"}`,children:[t.jsx("p",{className:h.success?"text-green-700":"text-yellow-700",children:l("template.importResult",{serversCreated:h.serversCreated,serversSkipped:h.serversSkipped,groupsCreated:h.groupsCreated,groupsSkipped:h.groupsSkipped})}),h.requiredEnvVars.length>0&&t.jsxs("div",{className:"mt-2 p-2 bg-orange-50 border border-orange-200 rounded",children:[t.jsx("p",{className:"text-sm font-medium text-orange-800",children:l("template.envVarsNeeded")}),t.jsx("ul",{className:"mt-1 text-sm text-orange-700",children:h.requiredEnvVars.map(j=>t.jsx("li",{className:"font-mono",children:j},j))})]})]}),o?t.jsxs("div",{children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsx("h3",{className:"font-medium text-gray-900",children:o.name}),o.description&&t.jsx("p",{className:"text-sm text-gray-600 mt-1",children:o.description}),t.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:[l("template.version"),": ",o.version," | ",l("template.createdAt"),":"," ",new Date(o.createdAt).toLocaleDateString()]})]}),t.jsxs("div",{children:[t.jsxs("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:[l("template.servers")," (",Object.keys(o.servers).length,")"]}),t.jsx("div",{className:"border border-gray-200 rounded-md divide-y divide-gray-200 max-h-40 overflow-y-auto",children:Object.entries(o.servers).map(([j,C])=>t.jsxs("div",{className:"px-3 py-2",children:[t.jsx("span",{className:"text-sm font-medium text-gray-900",children:j}),t.jsx("span",{className:"text-xs text-gray-500 ml-2",children:C.type||"stdio"})]},j))})]}),t.jsxs("div",{children:[t.jsxs("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:[l("template.groups")," (",o.groups.length,")"]}),t.jsx("div",{className:"border border-gray-200 rounded-md divide-y divide-gray-200 max-h-40 overflow-y-auto",children:o.groups.map((j,C)=>t.jsxs("div",{className:"px-3 py-2",children:[t.jsx("span",{className:"text-sm font-medium text-gray-900",children:j.name}),j.description&&t.jsx("span",{className:"text-xs text-gray-500 ml-2",children:j.description}),t.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:[j.servers.length," ",l("template.serversInGroup")]})]},C))})]}),o.requiredEnvVars.length>0&&t.jsxs("div",{className:"p-3 bg-orange-50 border border-orange-200 rounded-md",children:[t.jsx("h4",{className:"text-sm font-medium text-orange-800",children:l("template.envVarsNeeded")}),t.jsx("ul",{className:"mt-1 text-sm text-orange-700 font-mono",children:o.requiredEnvVars.map(j=>t.jsx("li",{children:j},j))})]})]}),t.jsxs("div",{className:"flex justify-end space-x-4 mt-6",children:[t.jsx("button",{onClick:()=>{c(null),b(null),y.current&&(y.current.value="")},className:"px-4 py-2 text-gray-700 bg-gray-200 rounded hover:bg-gray-300 btn-secondary",children:l("common.back")}),t.jsx("button",{onClick:S,disabled:f,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed btn-primary",children:l(f?"template.importing":"template.import")})]})]}):t.jsxs("div",{children:[t.jsxs("div",{className:"mb-4",children:[t.jsx("div",{className:"flex items-center justify-between mb-2",children:t.jsx("label",{className:"block text-sm font-medium text-gray-700",children:l("template.uploadFile")})}),t.jsx("div",{className:"flex items-center space-x-4",children:t.jsx("input",{ref:y,type:"file",accept:".json",onChange:w,className:"block text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-md file:border-0 file:text-sm file:font-semibold file:bg-blue-50 file:text-blue-700 hover:file:bg-blue-100"})})]}),t.jsxs("div",{className:"relative my-4",children:[t.jsx("div",{className:"absolute inset-0 flex items-center",children:t.jsx("div",{className:"w-full border-t border-gray-300"})}),t.jsx("div",{className:"relative flex justify-center text-sm",children:t.jsx("span",{className:"bg-white px-2 text-gray-500",children:l("template.or")})})]}),t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:l("template.pasteJson")}),t.jsx("textarea",{className:"w-full h-64 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:l("template.pastePlaceholder"),onChange:j=>N(j.target.value)})]}),t.jsx("div",{className:"flex justify-end space-x-4",children:t.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")})})]})]})})},FS=()=>{const{t:s}=ve(),{groups:n,loading:l,error:o,setError:c,deleteGroup:d,triggerRefresh:m}=So(),{allServers:f}=Pl({refreshOnMount:!0}),[g,h]=x.useState(null),[b,y]=x.useState(!1),[w,N]=x.useState(!1),[S,j]=x.useState(!1),[C,z]=x.useState(!1),E=P=>{h(P)},T=()=>{h(null),m()},B=async P=>{const V=await d(P);(!V||!V.success)&&c((V==null?void 0:V.message)||s("groups.deleteError"))},D=()=>{y(!0)},Y=()=>{y(!1),m()},R=()=>{N(!1),m()},_=()=>{z(!1),m()};return t.jsxs("div",{children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:s("pages.groups.title")}),t.jsxs("div",{className:"flex space-x-4",children:[t.jsxs("button",{onClick:D,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:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:t.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"})}),s("groups.add")]}),t.jsxs("button",{onClick:()=>N(!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:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:t.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"})}),s("groupImport.button")]}),t.jsxs("button",{onClick:()=>j(!0),className:"px-4 py-2 bg-green-100 text-green-800 rounded hover:bg-green-200 flex items-center btn-primary transition-all duration-200",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:t.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"})}),s("template.exportButton")]}),t.jsxs("button",{onClick:()=>z(!0),className:"px-4 py-2 bg-green-100 text-green-800 rounded hover:bg-green-200 flex items-center btn-primary transition-all duration-200",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:t.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"})}),s("template.importButton")]})]})]}),o&&t.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6 error-box rounded-lg",children:t.jsx("p",{children:o})}),l?t.jsx("div",{className:"bg-white shadow rounded-lg p-6 loading-container",children:t.jsxs("div",{className:"flex flex-col items-center justify-center",children:[t.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:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.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"})]}),t.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}):n.length===0?t.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state",children:t.jsx("p",{className:"text-gray-600",children:s("groups.noGroups")})}):t.jsx("div",{className:"space-y-6",children:n.map(P=>t.jsx(US,{group:P,servers:f,onEdit:E,onDelete:B},P.id))}),b&&t.jsx(DS,{onAdd:Y,onCancel:Y}),w&&t.jsx(_S,{onSuccess:R,onCancel:()=>N(!1)}),g&&t.jsx(LS,{group:g,onEdit:T,onCancel:()=>h(null)}),S&&t.jsx(BS,{groups:n,onCancel:()=>j(!1)}),C&&t.jsx(IS,{onSuccess:_,onCancel:()=>z(!1)})]})},Pd=()=>{const{t:s}=ve(),[n,l]=x.useState([]),[o,c]=x.useState(!0),[d,m]=x.useState(null),[f,g]=x.useState(0),h=x.useCallback(async()=>{try{c(!0);const S=await Be("/users");if(!S.success){m(S.message||s("users.fetchError"));return}S&&S.success&&Array.isArray(S.data)?l(S.data):(console.error("Invalid user data format:",S),l([])),m(null)}catch(S){console.error("Error fetching users:",S),m(S instanceof Error?S.message:"Failed to fetch users"),l([])}finally{c(!1)}},[]),b=x.useCallback(()=>{g(S=>S+1)},[]),y=async S=>{try{const j=await pt("/users",S);return b(),j}catch(j){return m(j instanceof Error?j.message:"Failed to create user"),null}},w=async(S,j)=>{try{const C=await At(`/users/${S}`,j);return b(),C||null}catch(C){return m(C instanceof Error?C.message:"Failed to update user"),null}},N=async S=>{try{const j=await Kr(`/users/${S}`);return j!=null&&j.success?(b(),j):(m((j==null?void 0:j.message)||s("users.deleteError")),j)}catch(j){return m(j instanceof Error?j.message:"Failed to delete user"),!1}};return x.useEffect(()=>{h()},[h,f]),{users:n,loading:o,error:d,setError:m,triggerRefresh:b,createUser:y,updateUser:w,deleteUser:N}},HS=({onAdd:s,onCancel:n})=>{const{t:l}=ve(),{createUser:o}=Pd(),[c,d]=x.useState(null),[m,f]=x.useState(!1),[g,h]=x.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}f(!0);try{const N=await o(g);N!=null&&N.success?s():d((N==null?void 0:N.message)||l("users.createError"))}catch(N){d(N instanceof Error?N.message:l("users.createError"))}finally{f(!1)}},y=w=>{const{name:N,value:S,type:j,checked:C}=w.target;h(z=>({...z,[N]:j==="checkbox"?C:S}))};return t.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:t.jsx("div",{className:"bg-white p-8 rounded-xl shadow-2xl max-w-md w-full mx-4 border border-gray-100",children:t.jsxs("form",{onSubmit:b,children:[t.jsx("h2",{className:"text-xl font-bold text-gray-900 mb-6",children:l("users.addNew")}),c&&t.jsx("div",{className:"bg-red-50 border-l-4 border-red-500 text-red-700 p-4 mb-6 rounded-md",children:t.jsx("p",{className:"text-sm font-medium",children:c})}),t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{children:[t.jsxs("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-700 mb-1",children:[l("users.username")," ",t.jsx("span",{className:"text-red-500",children:"*"})]}),t.jsx("input",{type:"text",id:"username",name:"username",value:g.username,onChange:y,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})]}),t.jsxs("div",{children:[t.jsxs("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 mb-1",children:[l("users.password")," ",t.jsx("span",{className:"text-red-500",children:"*"})]}),t.jsx("input",{type:"password",id:"password",name:"password",value:g.password,onChange:y,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})]}),t.jsxs("div",{className:"flex items-center pt-2",children:[t.jsx("input",{type:"checkbox",id:"isAdmin",name:"isAdmin",checked:g.isAdmin,onChange:y,className:"h-5 w-5 text-blue-600 focus:ring-blue-500 border-gray-300 rounded transition-colors duration-200",disabled:m}),t.jsx("label",{htmlFor:"isAdmin",className:"ml-3 block text-sm font-medium text-gray-700 cursor-pointer select-none",children:l("users.adminRole")})]})]}),t.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[t.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")}),t.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&&t.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:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.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")]})]})]})})})},qS=({user:s,onEdit:n,onCancel:l})=>{const{t:o}=ve(),{updateUser:c}=Pd(),[d,m]=x.useState(null),[f,g]=x.useState(!1),[h,b]=x.useState({isAdmin:s.isAdmin,newPassword:"",confirmPassword:""}),y=async N=>{if(N.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 S={isAdmin:h.isAdmin};h.newPassword&&(S.newPassword=h.newPassword);const j=await c(s.username,S);j!=null&&j.success?n():m((j==null?void 0:j.message)||o("users.updateError"))}catch(S){m(S instanceof Error?S.message:o("users.updateError"))}finally{g(!1)}},w=N=>{const{name:S,value:j,type:C,checked:z}=N.target;b(E=>({...E,[S]:C==="checkbox"?z:j}))};return t.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:t.jsx("div",{className:"bg-white p-8 rounded-xl shadow-2xl max-w-md w-full mx-4 border border-gray-100",children:t.jsxs("form",{onSubmit:y,children:[t.jsxs("h2",{className:"text-xl font-bold text-gray-900 mb-6",children:[o("users.edit")," - ",t.jsx("span",{className:"text-blue-600",children:s.username})]}),d&&t.jsx("div",{className:"bg-red-50 border-l-4 border-red-500 text-red-700 p-4 mb-6 rounded-md",children:t.jsx("p",{className:"text-sm font-medium",children:d})}),t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{className:"flex items-center pt-2",children:[t.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:f}),t.jsx("label",{htmlFor:"isAdmin",className:"ml-3 block text-sm font-medium text-gray-700 cursor-pointer select-none",children:o("users.adminRole")})]}),t.jsxs("div",{className:"border-t border-gray-100 pt-4 mt-2",children:[t.jsx("p",{className:"text-xs text-gray-500 uppercase font-semibold tracking-wider mb-3",children:o("users.changePassword")}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("label",{htmlFor:"newPassword",className:"block text-sm font-medium text-gray-700 mb-1",children:o("users.newPassword")}),t.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:f,minLength:6})]}),h.newPassword&&t.jsxs("div",{className:"animate-fadeIn",children:[t.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-gray-700 mb-1",children:o("users.confirmPassword")}),t.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:f,minLength:6})]})]})]})]}),t.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[t.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:f,children:o("common.cancel")}),t.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:f,children:[f&&t.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:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.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(f?"common.updating":"users.update")]})]})]})})})},GS=()=>{const{t:s}=ve(),{auth:n}=is(),l=n.user,{users:o,loading:c,error:d,setError:m,deleteUser:f,triggerRefresh:g}=Pd(),[h,b]=x.useState(null),[y,w]=x.useState(!1),[N,S]=x.useState(null);if(!(l!=null&&l.isAdmin))return t.jsx("div",{className:"bg-white shadow rounded-lg p-6 dashboard-card",children:t.jsx("p",{className:"text-red-600",children:s("users.adminRequired")})});const j=D=>{b(D)},C=()=>{b(null),g()},z=D=>{S(D)},E=async()=>{if(N){const D=await f(N);D!=null&&D.success||m((D==null?void 0:D.message)||s("users.deleteError")),S(null)}},T=()=>{w(!0)},B=()=>{w(!1),g()};return t.jsxs("div",{className:"container mx-auto",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:s("pages.users.title")}),t.jsx("div",{className:"flex space-x-4",children:t.jsxs("button",{onClick:T,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:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:t.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"})}),s("users.add")]})})]}),d&&t.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:t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("p",{children:d}),t.jsx("button",{onClick:()=>m(null),className:"text-red-500 hover:text-red-700",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:t.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?t.jsx("div",{className:"bg-white shadow rounded-lg p-6 loading-container flex justify-center items-center h-64",children:t.jsxs("div",{className:"flex flex-col items-center justify-center",children:[t.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:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.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"})]}),t.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}):o.length===0?t.jsx("div",{className:"bg-white shadow rounded-lg p-6 empty-state dashboard-card",children:t.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[t.jsx("div",{className:"p-4 bg-gray-100 rounded-full mb-4",children:t.jsx(v0,{className:"h-8 w-8 text-gray-400"})}),t.jsx("p",{className:"text-gray-600 text-lg font-medium",children:s("users.noUsers")}),t.jsx("button",{onClick:T,className:"mt-4 text-blue-600 hover:text-blue-800 font-medium",children:s("users.addFirst")})]})}):t.jsx("div",{className:"bg-white shadow rounded-lg overflow-hidden table-container dashboard-card",children:t.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[t.jsx("thead",{className:"bg-gray-50",children:t.jsxs("tr",{children:[t.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("users.username")}),t.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("users.role")}),t.jsx("th",{scope:"col",className:"px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("users.actions")})]})}),t.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:o.map(D=>{const Y=(l==null?void 0:l.username)===D.username;return t.jsxs("tr",{className:"hover:bg-gray-50 transition-colors duration-150",children:[t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:"flex-shrink-0 h-10 w-10",children:t.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:D.username.charAt(0).toUpperCase()})}),t.jsx("div",{className:"ml-4",children:t.jsxs("div",{className:"text-sm font-medium text-gray-900 flex items-center",children:[D.username,Y&&t.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:s("users.currentUser")})]})})]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:t.jsx("span",{className:`px-2 py-1 inline-flex text-xs leading-5 font-semibold rounded-full ${D.isAdmin?"bg-purple-100 text-purple-800 border border-purple-200":"bg-gray-100 text-gray-800 border border-gray-200"}`,children:D.isAdmin?s("users.admin"):s("users.user")})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium",children:t.jsxs("div",{className:"flex justify-end space-x-3",children:[t.jsx("button",{onClick:()=>j(D),className:"text-blue-600 hover:text-blue-900 p-1 rounded hover:bg-blue-50 transition-colors",title:s("users.edit"),children:t.jsx(ua,{size:18})}),!Y&&t.jsx("button",{onClick:()=>z(D.username),className:"text-red-600 hover:text-red-900 p-1 rounded hover:bg-red-50 transition-colors",title:s("users.delete"),children:t.jsx(jo,{size:18})})]})})]},D.username)})})]})}),y&&t.jsx(HS,{onAdd:B,onCancel:B}),h&&t.jsx(qS,{user:h,onEdit:C,onCancel:()=>b(null)}),t.jsx(Od,{isOpen:!!N,onClose:()=>S(null),onConfirm:E,serverName:N||"",isGroup:!1,isUser:!0})]})},oh=s=>{const n=[];return s.length<8&&n.push("passwordMinLength"),/[a-zA-Z]/.test(s)||n.push("passwordRequireLetter"),/\d/.test(s)||n.push("passwordRequireNumber"),/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/.test(s)||n.push("passwordRequireSpecial"),{isValid:n.length===0,errors:n}},KS=({onSuccess:s,onCancel:n})=>{const{t:l}=ve(),[o,c]=x.useState({currentPassword:"",newPassword:""}),[d,m]=x.useState(""),[f,g]=x.useState(!1),[h,b]=x.useState(null),[y,w]=x.useState(!1),[N,S]=x.useState([]),j=z=>{const{name:E,value:T}=z.target;if(E==="confirmPassword")m(T);else if(c(B=>({...B,[E]:T})),E==="newPassword"){const B=oh(T);S(B.errors)}},C=async z=>{z.preventDefault(),b(null);const E=oh(o.newPassword);if(!E.isValid){b(l("auth.passwordStrengthError")),S(E.errors);return}if(o.newPassword!==d){b(l("auth.passwordsNotMatch"));return}g(!0);try{const T=await R2(o);T.success?(w(!0),s&&s()):b(T.message||l("auth.changePasswordError"))}catch{b(l("auth.changePasswordError"))}finally{g(!1)}};return t.jsxs("div",{className:"p-6 bg-white rounded-lg shadow-md",children:[t.jsx("h2",{className:"text-xl font-bold mb-4",children:l("auth.changePassword")}),y?t.jsx("div",{className:"bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded mb-4",children:l("auth.changePasswordSuccess")}):t.jsxs("form",{onSubmit:C,children:[h&&t.jsx("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-4",children:h}),t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"currentPassword",children:l("auth.currentPassword")}),t.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:j,required:!0})]}),t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"newPassword",children:l("auth.newPassword")}),t.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:j,required:!0,minLength:8}),o.newPassword&&N.length>0&&t.jsxs("div",{className:"mt-2 text-sm text-gray-600",children:[t.jsx("p",{className:"font-semibold mb-1",children:l("auth.passwordStrengthHint")}),t.jsx("ul",{className:"list-disc list-inside space-y-1",children:N.map(z=>t.jsx("li",{className:"text-red-600",children:l(`auth.${z}`)},z))})]}),o.newPassword&&N.length===0&&t.jsxs("p",{className:"mt-2 text-sm text-green-600",children:["✓ ",l("auth.passwordStrengthHint")]})]}),t.jsxs("div",{className:"mb-6",children:[t.jsx("label",{className:"block text-gray-700 text-sm font-bold mb-2",htmlFor:"confirmPassword",children:l("auth.confirmPassword")}),t.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:j,required:!0,minLength:8})]}),t.jsxs("div",{className:"flex justify-end space-x-2",children:[n&&t.jsx("button",{type:"button",onClick:n,disabled:f,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")}),t.jsx("button",{type:"submit",disabled:f,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:f?t.jsxs("span",{className:"flex items-center",children:[t.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:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.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:s,selected:n,onChange:l,placeholder:o="Select items...",disabled:c=!1,className:d=""})=>{const[m,f]=x.useState(!1),[g,h]=x.useState(""),b=x.useRef(null),y=x.useRef(null);x.useEffect(()=>{const z=E=>{b.current&&!b.current.contains(E.target)&&(f(!1),h(""))};return document.addEventListener("mousedown",z),()=>document.removeEventListener("mousedown",z)},[]);const w=s.filter(z=>z.label.toLowerCase().includes(g.toLowerCase())),N=z=>{if(c)return;const E=n.includes(z)?n.filter(T=>T!==z):[...n,z];l(E)},S=(z,E)=>{E.stopPropagation(),!c&&l(n.filter(T=>T!==z))},j=()=>{c||(f(!m),m||setTimeout(()=>{var z;return(z=y.current)==null?void 0:z.focus()},0))},C=()=>n.map(z=>{var E;return((E=s.find(T=>T.value===z))==null?void 0:E.label)||z}).filter(Boolean);return t.jsxs("div",{ref:b,className:`relative ${d}`,children:[t.jsxs("div",{onClick:j,className:`
312
- min-h-[38px] w-full px-3 py-1.5 border rounded-md shadow-sm
313
- flex flex-wrap items-center gap-1.5 cursor-pointer
314
- transition-all duration-200
315
- ${c?"bg-gray-100 cursor-not-allowed":"bg-white hover:border-blue-400"}
316
- ${m?"border-blue-500 ring-1 ring-blue-500":"border-gray-300"}
317
- `,children:[n.length>0?t.jsx(t.Fragment,{children:C().map((z,E)=>t.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-blue-100 text-blue-800",children:[z,!c&&t.jsx("button",{type:"button",onClick:T=>S(n[E],T),className:"ml-1 hover:bg-blue-200 rounded-full p-0.5 transition-colors",children:t.jsx(zs,{className:"h-3 w-3"})})]},n[E]))}):t.jsx("span",{className:"text-gray-400 text-sm",children:o}),t.jsx("div",{className:"flex-1"}),t.jsx(ca,{className:`h-4 w-4 text-gray-400 transition-transform duration-200 ${m?"transform rotate-180":""}`})]}),m&&!c&&t.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:[t.jsx("div",{className:"p-2 border-b border-gray-200",children:t.jsx("input",{ref:y,type:"text",value:g,onChange:z=>h(z.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:z=>z.stopPropagation()})}),t.jsx("div",{className:"max-h-48 overflow-y-auto",children:w.length>0?w.map(z=>{const E=n.includes(z.value);return t.jsxs("div",{onClick:()=>N(z.value),className:`
318
- px-3 py-2 cursor-pointer flex items-center justify-between
319
- transition-colors duration-150
320
- ${E?"bg-blue-50 text-blue-700":"hover:bg-gray-100"}
321
- `,children:[t.jsx("span",{className:"text-sm",children:z.label}),E&&t.jsx(Os,{className:"h-4 w-4 text-blue-600"})]},z.value)}):t.jsx("div",{className:"px-3 py-2 text-sm text-gray-500 text-center",children:g?"No results found":"No options available"})})]})]})};function VS(s=32){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",l=new Uint8Array(s);return crypto.getRandomValues(l),Array.from(l).map(o=>n.charAt(o%n.length)).join("")}const oa={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"},$S=({keyData:s,loading:n,availableServers:l,availableGroups:o,onSave:c,onDelete:d})=>{const{t:m}=ve(),{showToast:f}=Ms(),[g,h]=x.useState(!1),[b,y]=x.useState(s.name),[w,N]=x.useState(s.token),[S,j]=x.useState(s.enabled),[C,z]=x.useState(s.accessType||"all"),[E,T]=x.useState(s.allowedGroups||[]),[B,D]=x.useState(s.allowedServers||[]),[Y,R]=x.useState(!1),[_,P]=x.useState(!1);x.useEffect(()=>{g||(y(s.name),N(s.token),j(s.enabled),z(s.accessType||"all"),T(s.allowedGroups||[]),D(s.allowedServers||[]))},[s,g]);const V=async()=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(s.token),f(m("common.copySuccess")||"Copied to clipboard","success");else{const A=document.createElement("textarea");A.value=s.token,A.style.position="fixed",A.style.left="-9999px",document.body.appendChild(A),A.focus(),A.select();try{document.execCommand("copy"),f(m("common.copySuccess")||"Copied to clipboard","success")}catch{f(m("common.copyFailed")||"Copy failed","error")}document.body.removeChild(A)}}catch(A){console.error("Failed to copy",A),f(m("common.copyFailed")||"Copy failed","error")}},K=async()=>{if(C==="groups"&&E.length===0){f(m("settings.selectAtLeastOneGroup")||"Please select at least one group","error");return}if(C==="servers"&&B.length===0){f(m("settings.selectAtLeastOneServer")||"Please select at least one server","error");return}if(C==="custom"&&E.length===0&&B.length===0){f(m("settings.selectAtLeastOneGroupOrServer")||"Please select at least one group or server","error");return}R(!0);try{await c(s.id,{name:b,token:w,enabled:S,accessType:C,allowedGroups:E.join(", "),allowedServers:B.join(", ")}),h(!1)}finally{R(!1)}},G=async()=>{if(window.confirm(m("settings.deleteBearerKeyConfirm")||"Delete this key?")){P(!0);try{await d(s.id)}finally{P(!1)}}},I=C==="groups",L=C==="custom",Z=A=>{if(A.accessType==="all")return m("settings.bearerKeyAccessAll")||"All Resources";if(A.accessType==="groups")return`${m("settings.bearerKeyAccessGroups")||"Groups"}: ${A.allowedGroups}`;if(A.accessType==="servers")return`${m("settings.bearerKeyAccessServers")||"Servers"}: ${A.allowedServers}`;if(A.accessType==="custom"){const H=[];return A.allowedGroups&&A.allowedGroups.length>0&&H.push(`${m("settings.bearerKeyAccessGroups")||"Groups"}: ${A.allowedGroups}`),A.allowedServers&&A.allowedServers.length>0&&H.push(`${m("settings.bearerKeyAccessServers")||"Servers"}: ${A.allowedServers}`),`${m("settings.bearerKeyAccessCustom")||"Custom"}: ${H.join("; ")}`}return""};return g?t.jsx("tr",{children:t.jsx("td",{colSpan:5,className:"p-0 border-b border-gray-200",children:t.jsxs("div",{className:"bg-gray-50 p-5",children:[t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-4 mb-4",children:[t.jsxs("div",{className:"md:col-span-3",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:m("settings.bearerKeyName")||"Name"}),t.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:A=>y(A.target.value),disabled:n})]}),t.jsxs("div",{className:"md:col-span-9",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:m("settings.bearerKeyToken")||"Token"}),t.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:A=>N(A.target.value),disabled:n})]})]}),t.jsxs("div",{className:"flex flex-wrap items-end gap-4",children:[t.jsxs("div",{className:"w-40",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:m("settings.bearerKeyEnabled")||"Status"}),t.jsxs("div",{className:"flex items-center h-[38px] px-3 bg-white border border-gray-300 rounded-md",children:[t.jsx("span",{className:`text-sm mr-3 ${S?"text-green-600 font-medium":"text-gray-500"}`,children:S?"Active":"Inactive"}),t.jsx(Jt,{disabled:n,checked:S,onCheckedChange:A=>j(A)})]})]}),t.jsxs("div",{className:"w-48",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:m("settings.bearerKeyAccessType")||"Access scope"}),t.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:C,onChange:A=>z(A.target.value),disabled:n,children:[t.jsx("option",{value:"all",children:m("settings.bearerKeyAccessAll")||"All Resources"}),t.jsx("option",{value:"groups",children:m("settings.bearerKeyAccessGroups")||"Specific Groups"}),t.jsx("option",{value:"servers",children:m("settings.bearerKeyAccessServers")||"Specific Servers"}),t.jsx("option",{value:"custom",children:m("settings.bearerKeyAccessCustom")||"Custom (Groups & Servers)"})]})]}),!L&&t.jsxs("div",{className:"flex-1 min-w-[200px]",children:[t.jsx("label",{className:`block text-sm font-medium mb-1 ${C==="all"?"text-gray-400":"text-gray-700"}`,children:I?m("settings.bearerKeyAllowedGroups")||"Allowed groups":m("settings.bearerKeyAllowedServers")||"Allowed servers"}),t.jsx(wn,{options:I?o:l,selected:I?E:B,onChange:I?T:D,placeholder:I?m("settings.selectGroups")||"Select groups...":m("settings.selectServers")||"Select servers...",disabled:n||C==="all"})]}),L&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex-1 min-w-[200px]",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:m("settings.bearerKeyAllowedGroups")||"Allowed groups"}),t.jsx(wn,{options:o,selected:E,onChange:T,placeholder:m("settings.selectGroups")||"Select groups...",disabled:n})]}),t.jsxs("div",{className:"flex-1 min-w-[200px]",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:m("settings.bearerKeyAllowedServers")||"Allowed servers"}),t.jsx(wn,{options:l,selected:B,onChange:D,placeholder:m("settings.selectServers")||"Select servers...",disabled:n})]})]}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.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"}),t.jsx("button",{type:"button",onClick:K,disabled:n||Y,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:Y?m("common.saving")||"Saving...":m("common.save")||"Save"})]})]})]})})}):t.jsxs("tr",{className:"hover:bg-gray-50",children:[t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:s.name}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500 font-mono",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{children:s.token.length>12?`${s.token.substring(0,8)}...${s.token.substring(s.token.length-4)}`:s.token}),t.jsx("button",{onClick:V,className:"text-gray-400 hover:text-gray-600 transition-colors",title:m("common.copy")||"Copy",children:t.jsx(jn,{className:"h-3.5 w-3.5"})})]})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:t.jsx("span",{className:`px-2 inline-flex text-xs leading-5 font-semibold rounded-full ${s.enabled?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800"}`,children:s.enabled?m("common.active")||"Active":m("common.inactive")||"Inactive"})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:Z(s)}),t.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium",children:[t.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:t.jsx(ua,{className:"h-4 w-4"})}),t.jsx("button",{onClick:G,disabled:_,className:"text-red-600 hover:text-red-900 inline-flex items-center",title:m("common.delete")||"Delete",children:t.jsx(Dw,{className:"h-4 w-4"})})]})]})};function YS(s){const n=s.toLowerCase(),l=[["text-embedding-3-small",8191],["text-embedding-3-large",8191],["text-embedding-ada-002",8191],["gemini-embedding-001",2048],["bge-m3",8192]];for(const[o,c]of l)if(n.includes(o))return c;return n.includes("bge"),512}function ch(s,n){const l=s.trim(),o=l?parseInt(l,10):NaN,c=l&&!isNaN(o)?o:null;return c!==(n??null)?c:void 0}function uh(s,n){const l=s.trim(),o=l?parseInt(l,10):NaN,c=l&&!isNaN(o)&&o>=0?o:null;return c!==(n??null)?c:void 0}const JS=()=>{const{t:s}=ve(),n=ls(),{showToast:l}=Ms(),{allServers:o}=U0(),{groups:c}=So(),[d,m]=x.useState({pythonIndexUrl:"",npmRegistry:"",baseUrl:"http://localhost:3000"}),[f,g]=x.useState({dbUrl:"",basePacingDelayMs:"",embeddingProvider:"openai",embeddingEncodingFormat:"auto",openaiApiBaseUrl:"",openaiApiKey:"",openaiApiEmbeddingModel:"",azureOpenaiEndpoint:"",azureOpenaiApiKey:"",azureOpenaiApiVersion:"2024-02-15-preview",azureOpenaiEmbeddingDeployment:"",azureOpenaiEmbeddingModel:"",embeddingMaxTokens:""}),[h,b]=x.useState({apiKey:"",referer:"https://www.mcphub.app",title:"MCPHub",baseUrl:"https://api.mcprouter.to/v1"}),[y,w]=x.useState({accessTokenLifetime:"3600",refreshTokenLifetime:"1209600",authorizationCodeLifetime:"300",allowedScopes:"read, write",dynamicRegistrationAllowedGrantTypes:"authorization_code, refresh_token"}),[N,S]=x.useState("-"),[j,C]=x.useState(!1),{routingConfig:z,tempRoutingConfig:E,setTempRoutingConfig:T,installConfig:B,smartRoutingConfig:D,mcpRouterConfig:Y,oauthServerConfig:R,nameSeparator:_,enableSessionRebuild:P,loading:V,bearerKeys:K,updateRoutingConfig:G,updateInstallConfig:I,updateSmartRoutingConfig:L,updateSmartRoutingConfigBatch:Z,updateMCPRouterConfig:A,updateOAuthServerConfig:H,updateNameSeparator:J,updateSessionRebuild:me,exportMCPSettings:le,createBearerKey:k,updateBearerKey:U,deleteBearerKey:M,refreshBearerKeys:q}=Ta();x.useEffect(()=>{B&&m(B)},[B]),x.useEffect(()=>{D&&g({dbUrl:D.dbUrl||"",basePacingDelayMs:D.basePacingDelayMs!=null?String(D.basePacingDelayMs):"",embeddingProvider:D.embeddingProvider==="azure_openai"?"azure_openai":"openai",embeddingEncodingFormat:D.embeddingEncodingFormat==="base64"?"base64":D.embeddingEncodingFormat==="float"?"float":"auto",openaiApiBaseUrl:D.openaiApiBaseUrl||"",openaiApiKey:D.openaiApiKey||"",openaiApiEmbeddingModel:D.openaiApiEmbeddingModel||"",azureOpenaiEndpoint:D.azureOpenaiEndpoint||"",azureOpenaiApiKey:D.azureOpenaiApiKey||"",azureOpenaiApiVersion:D.azureOpenaiApiVersion||"2024-02-15-preview",azureOpenaiEmbeddingDeployment:D.azureOpenaiEmbeddingDeployment||"",azureOpenaiEmbeddingModel:D.azureOpenaiEmbeddingModel||"",embeddingMaxTokens:D.embeddingMaxTokens!=null?String(D.embeddingMaxTokens):""})},[D]),x.useEffect(()=>{Y&&b({apiKey:Y.apiKey||"",referer:Y.referer||"https://www.mcphub.app",title:Y.title||"MCPHub",baseUrl:Y.baseUrl||"https://api.mcprouter.to/v1"})},[Y]),x.useEffect(()=>{var Q,je;R&&w({accessTokenLifetime:R.accessTokenLifetime!==void 0?String(R.accessTokenLifetime):"",refreshTokenLifetime:R.refreshTokenLifetime!==void 0?String(R.refreshTokenLifetime):"",authorizationCodeLifetime:R.authorizationCodeLifetime!==void 0?String(R.authorizationCodeLifetime):"",allowedScopes:R.allowedScopes&&R.allowedScopes.length>0?R.allowedScopes.join(", "):"",dynamicRegistrationAllowedGrantTypes:(je=(Q=R.dynamicRegistration)==null?void 0:Q.allowedGrantTypes)!=null&&je.length?R.dynamicRegistration.allowedGrantTypes.join(", "):""})},[R]),x.useEffect(()=>{S(_)},[_]),x.useEffect(()=>{q()},[]);const[de,ee]=x.useState({routingConfig:!1,installConfig:!1,smartRoutingConfig:!1,oauthServerConfig:!1,mcpRouterConfig:!1,nameSeparator:!1,password:!1,exportConfig:!1,bearerKeys:!1}),X=Q=>{ee(je=>({...je,[Q]:!je[Q]}))},he=async(Q,je)=>{await G(Q,je)},ae=(Q,je)=>{T(He=>({...He,[Q]:je}))},ye=(Q,je)=>{m({...d,[Q]:je})},ie=async Q=>{await I(Q,d[Q])},se=(Q,je)=>{g({...f,[Q]:je})},be=(Q,je)=>{b({...h,[Q]:je})},Ne=async Q=>{await A(Q,h[Q])},xe=(Q,je)=>{w(He=>({...He,[Q]:je}))},ke=(Q,je)=>{w(He=>({...He,[Q]:je}))},Se=async Q=>{const je=y[Q];if(!je||je.trim()===""){l(s("settings.invalidNumberInput")||"Please enter a valid number","error");return}const He=Number(je);if(Number.isNaN(He)||He<0){l(s("settings.invalidNumberInput")||"Please enter a valid number","error");return}await H(Q,He)},Le=async()=>{const Q=y.allowedScopes.split(",").map(je=>je.trim()).filter(je=>je.length>0);await H("allowedScopes",Q)},st=async()=>{const Q=y.dynamicRegistrationAllowedGrantTypes.split(",").map(je=>je.trim()).filter(je=>je.length>0);await H("dynamicRegistration",{...R.dynamicRegistration,allowedGrantTypes:Q})},ft=async(Q,je)=>{await H(Q,je)},Mt=async Q=>{await H("dynamicRegistration",{...R.dynamicRegistration,...Q})},Pt=async()=>{await J(N)},Sr=async Q=>{if(Q){const je=f.dbUrl||D.dbUrl,He=[];if(je||He.push(s("settings.dbUrl")||"Database URL"),f.embeddingProvider==="azure_openai"){const pr=f.azureOpenaiEndpoint||D.azureOpenaiEndpoint,tr=f.azureOpenaiApiKey||D.azureOpenaiApiKey,ge=f.azureOpenaiApiVersion||D.azureOpenaiApiVersion,oe=f.azureOpenaiEmbeddingDeployment||D.azureOpenaiEmbeddingDeployment;(!pr||!tr||!ge||!oe)&&He.push(s("settings.azureOpenaiEndpoint")||"Azure OpenAI Endpoint",s("settings.azureOpenaiApiKey")||"Azure OpenAI API Key",s("settings.azureOpenaiApiVersion")||"Azure OpenAI API Version",s("settings.azureOpenaiEmbeddingDeployment")||"Azure Embedding Deployment")}else{const pr=(typeof f.openaiApiKey=="string"?f.openaiApiKey:D.openaiApiKey||"").trim(),tr=(typeof f.openaiApiBaseUrl=="string"?f.openaiApiBaseUrl:D.openaiApiBaseUrl||"").trim(),ge=(typeof f.openaiApiEmbeddingModel=="string"?f.openaiApiEmbeddingModel:D.openaiApiEmbeddingModel||"").trim();pr||He.push(s("settings.openaiApiKey")||"OpenAI API Key"),tr||He.push(s("settings.openaiApiBaseUrl")||"OpenAI API Base URL"),ge||He.push(s("settings.openaiApiEmbeddingModel")||"OpenAI Embedding Model")}if(He.length>0){l(s("settings.smartRoutingValidationError",{fields:He.join(", ")}));return}const jt={enabled:Q};f.dbUrl!==D.dbUrl&&(jt.dbUrl=f.dbUrl);const Je=uh(f.basePacingDelayMs,D.basePacingDelayMs);Je!==void 0&&(jt.basePacingDelayMs=Je),f.embeddingProvider!==D.embeddingProvider&&(jt.embeddingProvider=f.embeddingProvider),f.embeddingEncodingFormat!==D.embeddingEncodingFormat&&(jt.embeddingEncodingFormat=f.embeddingEncodingFormat),f.openaiApiBaseUrl!==D.openaiApiBaseUrl&&(jt.openaiApiBaseUrl=f.openaiApiBaseUrl),f.openaiApiKey!==D.openaiApiKey&&(jt.openaiApiKey=f.openaiApiKey),f.openaiApiEmbeddingModel!==D.openaiApiEmbeddingModel&&(jt.openaiApiEmbeddingModel=f.openaiApiEmbeddingModel),f.azureOpenaiEndpoint!==D.azureOpenaiEndpoint&&(jt.azureOpenaiEndpoint=f.azureOpenaiEndpoint),f.azureOpenaiApiKey!==D.azureOpenaiApiKey&&(jt.azureOpenaiApiKey=f.azureOpenaiApiKey),f.azureOpenaiApiVersion!==D.azureOpenaiApiVersion&&(jt.azureOpenaiApiVersion=f.azureOpenaiApiVersion),f.azureOpenaiEmbeddingDeployment!==D.azureOpenaiEmbeddingDeployment&&(jt.azureOpenaiEmbeddingDeployment=f.azureOpenaiEmbeddingDeployment),f.azureOpenaiEmbeddingModel!==D.azureOpenaiEmbeddingModel&&(jt.azureOpenaiEmbeddingModel=f.azureOpenaiEmbeddingModel);const We=ch(f.embeddingMaxTokens,D.embeddingMaxTokens);We!==void 0&&(jt.embeddingMaxTokens=We),await Z(jt)}else await L("enabled",Q)},gt=async()=>{const Q={};f.dbUrl!==D.dbUrl&&(Q.dbUrl=f.dbUrl);const je=uh(f.basePacingDelayMs,D.basePacingDelayMs);je!==void 0&&(Q.basePacingDelayMs=je),f.embeddingProvider!==D.embeddingProvider&&(Q.embeddingProvider=f.embeddingProvider),f.embeddingEncodingFormat!==D.embeddingEncodingFormat&&(Q.embeddingEncodingFormat=f.embeddingEncodingFormat),f.openaiApiBaseUrl!==D.openaiApiBaseUrl&&(Q.openaiApiBaseUrl=f.openaiApiBaseUrl),f.openaiApiKey!==D.openaiApiKey&&(Q.openaiApiKey=f.openaiApiKey),f.openaiApiEmbeddingModel!==D.openaiApiEmbeddingModel&&(Q.openaiApiEmbeddingModel=f.openaiApiEmbeddingModel),f.azureOpenaiEndpoint!==D.azureOpenaiEndpoint&&(Q.azureOpenaiEndpoint=f.azureOpenaiEndpoint),f.azureOpenaiApiKey!==D.azureOpenaiApiKey&&(Q.azureOpenaiApiKey=f.azureOpenaiApiKey),f.azureOpenaiApiVersion!==D.azureOpenaiApiVersion&&(Q.azureOpenaiApiVersion=f.azureOpenaiApiVersion),f.azureOpenaiEmbeddingDeployment!==D.azureOpenaiEmbeddingDeployment&&(Q.azureOpenaiEmbeddingDeployment=f.azureOpenaiEmbeddingDeployment),f.azureOpenaiEmbeddingModel!==D.azureOpenaiEmbeddingModel&&(Q.azureOpenaiEmbeddingModel=f.azureOpenaiEmbeddingModel);const He=ch(f.embeddingMaxTokens,D.embeddingMaxTokens);He!==void 0&&(Q.embeddingMaxTokens=He),Object.keys(Q).length>0?await Z(Q):l(s("settings.noChanges")||"No changes to save","info")},Nr=()=>{setTimeout(()=>{n("/")},2e3)},[er,Qt]=x.useState(!1),[ht,Re]=x.useState(""),[Oe,it]=x.useState({name:"",token:"",enabled:!0,accessType:"all",allowedGroups:"",allowedServers:""}),[qt,Gt]=x.useState([]),[ot,_t]=x.useState([]),bt=o.map(Q=>({value:Q.name,label:Q.name})),Vr=c.map(Q=>({value:Q.name,label:Q.name}));x.useEffect(()=>{Oe.accessType!=="groups"&&Oe.accessType!=="custom"&&Gt([]),Oe.accessType!=="servers"&&Oe.accessType!=="custom"&&_t([])},[Oe.accessType]);const Ps=async()=>{try{const Q=await le();console.log("Fetched MCP settings:",Q);const je=JSON.stringify(Q.data,null,2);Re(je)}catch(Q){console.error("Error fetching MCP settings:",Q),l(s("settings.exportError")||"Failed to fetch settings","error")}};x.useEffect(()=>{de.exportConfig&&!ht&&Ps()},[de.exportConfig]);const Ds=async()=>{if(ht)try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(ht),Qt(!0),l(s("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>Qt(!1),2e3);else{const Q=document.createElement("textarea");Q.value=ht,Q.style.position="fixed",Q.style.left="-9999px",document.body.appendChild(Q),Q.focus(),Q.select();try{document.execCommand("copy"),Qt(!0),l(s("common.copySuccess")||"Copied to clipboard","success"),setTimeout(()=>Qt(!1),2e3)}catch(je){l(s("common.copyFailed")||"Copy failed","error"),console.error("Copy to clipboard failed:",je)}document.body.removeChild(Q)}}catch(Q){console.error("Error copying configuration:",Q),l(s("common.copyFailed")||"Copy failed","error")}},mr=()=>{if(!ht)return;const Q=new Blob([ht],{type:"application/json"}),je=URL.createObjectURL(Q),He=document.createElement("a");He.href=je,He.download="mcp_settings.json",document.body.appendChild(He),He.click(),document.body.removeChild(He),URL.revokeObjectURL(je),l(s("settings.exportSuccess")||"Settings exported successfully","success")},sr=Q=>{const je=Q.split(",").map(He=>He.trim()).filter(He=>He.length>0);return je.length>0?je:void 0},_r=async()=>{if(!Oe.name||!Oe.token){l(s("settings.bearerKeyRequired")||"Name and token are required","error");return}if(Oe.accessType==="groups"&&qt.length===0){l(s("settings.selectAtLeastOneGroup")||"Please select at least one group","error");return}if(Oe.accessType==="servers"&&ot.length===0){l(s("settings.selectAtLeastOneServer")||"Please select at least one server","error");return}if(Oe.accessType==="custom"&&qt.length===0&&ot.length===0){l(s("settings.selectAtLeastOneGroupOrServer")||"Please select at least one group or server","error");return}await k({name:Oe.name,token:Oe.token,enabled:Oe.enabled,accessType:Oe.accessType,allowedGroups:(Oe.accessType==="groups"||Oe.accessType==="custom")&&qt.length>0?qt:void 0,allowedServers:(Oe.accessType==="servers"||Oe.accessType==="custom")&&ot.length>0?ot:void 0}),it({name:"",token:"",enabled:!0,accessType:"all",allowedGroups:"",allowedServers:""}),Gt([]),_t([]),await q()},ar=async(Q,je)=>{await U(Q,{name:je.name,token:je.token,enabled:je.enabled,accessType:je.accessType,allowedGroups:sr(je.allowedGroups),allowedServers:sr(je.allowedServers)}),await q()},Br=async Q=>{await M(Q),await q()};return t.jsxs("div",{className:"container mx-auto",children:[t.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-8",children:s("pages.settings.title")}),t.jsx(ia,{permissions:oa.SETTINGS_ROUTE_CONFIG,children:t.jsxs("div",{className:"bg-white shadow rounded-lg mb-6 page-card dashboard-card",children:[t.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600 py-4 px-6",onClick:()=>X("bearerKeys"),children:[t.jsx("h2",{className:"font-semibold text-gray-800",children:s("settings.bearerKeysSectionTitle")||"Bearer authentication keys"}),t.jsx("span",{className:"text-gray-500 transition-transform duration-200",children:de.bearerKeys?"▼":"►"})]}),de.bearerKeys&&t.jsxs("div",{className:"space-y-4 pb-4 px-6",children:[t.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableBearerAuth")||"Enable Bearer Authentication"}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableBearerAuthDescription")||"Require bearer token authentication for MCP requests"})]}),t.jsx(Jt,{disabled:V,checked:z.enableBearerAuth,onCheckedChange:Q=>he("enableBearerAuth",Q)})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{className:"mb-2",children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.bearerAuthHeaderName")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.bearerAuthHeaderNameDescription")})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("input",{type:"text",value:E.bearerAuthHeaderName,onChange:Q=>ae("bearerAuthHeaderName",Q.target.value),placeholder:s("settings.bearerAuthHeaderNamePlaceholder"),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:V}),t.jsx("button",{onClick:()=>he("bearerAuthHeaderName",E.bearerAuthHeaderName),disabled:V,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:s("common.save")})]})]}),t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("p",{className:"text-sm text-gray-600",children:s("settings.bearerKeysSectionDescription")||"Manage multiple bearer authentication keys with different access scopes."}),!j&&t.jsxs("button",{type:"button",onClick:()=>C(!0),className:"flex items-center text-blue-600 hover:text-blue-800 font-medium transition-colors duration-200",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5 mr-1",viewBox:"0 0 20 20",fill:"currentColor",children:t.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"})}),s("settings.addBearerKey")||"Add bearer key"]})]}),K.length===0?t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.noBearerKeys")||"No bearer keys configured yet."}):t.jsx("div",{className:"mt-2 overflow-x-auto",children:t.jsxs("table",{className:"min-w-full divide-y divide-gray-200 border border-gray-200 rounded-lg",children:[t.jsx("thead",{className:"bg-gray-50",children:t.jsxs("tr",{children:[t.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("settings.bearerKeyName")||"Name"}),t.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("settings.bearerKeyToken")||"Token"}),t.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("settings.bearerKeyEnabled")||"Status"}),t.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("settings.bearerKeyAccessType")||"Access Scope"}),t.jsx("th",{scope:"col",className:"px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("common.actions")||"Actions"})]})}),t.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:K.map(Q=>t.jsx($S,{keyData:Q,loading:V,availableServers:bt,availableGroups:Vr,onSave:ar,onDelete:Br},Q.id))})]})}),j&&t.jsx("div",{className:"mt-6 border-t border-gray-200 pt-6",children:t.jsxs("div",{className:"bg-gray-50 rounded-lg p-5 border border-gray-200",children:[t.jsxs("h3",{className:"font-medium text-gray-900 mb-4 flex items-center gap-2",children:[t.jsx("span",{className:"bg-blue-100 text-blue-600 p-1 rounded",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:t.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"})})}),s("settings.addBearerKey")||"Add bearer key"]}),t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-4 mb-4",children:[t.jsxs("div",{className:"md:col-span-3",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:s("settings.bearerKeyName")||"Name"}),t.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:Oe.name,onChange:Q=>it(je=>({...je,name:Q.target.value})),disabled:V})]}),t.jsxs("div",{className:"md:col-span-9",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:s("settings.bearerKeyToken")||"Token"}),t.jsxs("div",{className:"flex rounded-md shadow-sm",children:[t.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:Oe.token,onChange:Q=>it(je=>({...je,token:Q.target.value})),disabled:V}),t.jsx("button",{type:"button",onClick:()=>it(Q=>({...Q,token:VS()})),disabled:V,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:s("settings.generate")||"Generate"})]})]})]}),t.jsxs("div",{className:"flex flex-wrap items-end gap-4 mb-2",children:[t.jsxs("div",{className:"w-40",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:s("settings.bearerKeyEnabled")||"Status"}),t.jsxs("div",{className:"flex items-center h-[38px] px-3 bg-white border border-gray-300 rounded-md",children:[t.jsx("span",{className:`text-sm mr-3 ${Oe.enabled?"text-green-600 font-medium":"text-gray-500"}`,children:Oe.enabled?"Active":"Inactive"}),t.jsx(Jt,{disabled:V,checked:Oe.enabled,onCheckedChange:Q=>it(je=>({...je,enabled:Q}))})]})]}),t.jsxs("div",{className:"w-48",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:s("settings.bearerKeyAccessType")||"Access scope"}),t.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:Oe.accessType,onChange:Q=>it(je=>({...je,accessType:Q.target.value})),disabled:V,children:[t.jsx("option",{value:"all",children:s("settings.bearerKeyAccessAll")||"All Resources"}),t.jsx("option",{value:"groups",children:s("settings.bearerKeyAccessGroups")||"Specific Groups"}),t.jsx("option",{value:"servers",children:s("settings.bearerKeyAccessServers")||"Specific Servers"}),t.jsx("option",{value:"custom",children:s("settings.bearerKeyAccessCustom")||"Custom (Groups & Servers)"})]})]}),Oe.accessType!=="custom"&&t.jsxs("div",{className:"flex-1 min-w-[200px]",children:[t.jsx("label",{className:`block text-sm font-medium mb-1 ${Oe.accessType==="all"?"text-gray-400":"text-gray-700"}`,children:Oe.accessType==="groups"?s("settings.bearerKeyAllowedGroups")||"Allowed groups":s("settings.bearerKeyAllowedServers")||"Allowed servers"}),t.jsx(wn,{options:Oe.accessType==="groups"?Vr:bt,selected:Oe.accessType==="groups"?qt:ot,onChange:Oe.accessType==="groups"?Gt:_t,placeholder:Oe.accessType==="groups"?s("settings.selectGroups")||"Select groups...":s("settings.selectServers")||"Select servers...",disabled:V||Oe.accessType==="all"})]}),Oe.accessType==="custom"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex-1 min-w-[200px]",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:s("settings.bearerKeyAllowedGroups")||"Allowed groups"}),t.jsx(wn,{options:Vr,selected:qt,onChange:Gt,placeholder:s("settings.selectGroups")||"Select groups...",disabled:V})]}),t.jsxs("div",{className:"flex-1 min-w-[200px]",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:s("settings.bearerKeyAllowedServers")||"Allowed servers"}),t.jsx(wn,{options:bt,selected:ot,onChange:_t,placeholder:s("settings.selectServers")||"Select servers...",disabled:V})]})]}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx("button",{type:"button",onClick:()=>C(!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:s("common.cancel")||"Cancel"}),t.jsx("button",{type:"button",onClick:_r,disabled: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:s("settings.addBearerKeyButton")||"Create Key"})]})]})]})})]})]})}),t.jsx(ia,{permissions:oa.SETTINGS_SMART_ROUTING,children:t.jsxs("div",{className:"bg-white shadow rounded-lg mb-6 page-card dashboard-card",children:[t.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600 py-4 px-6",onClick:()=>X("smartRoutingConfig"),children:[t.jsx("h2",{className:"font-semibold text-gray-800",children:s("pages.settings.smartRouting")}),t.jsx("span",{className:"text-gray-500 transition-transform duration-200",children:de.smartRoutingConfig?"▼":"►"})]}),de.smartRoutingConfig&&t.jsxs("div",{className:"space-y-4 pb-4 px-6",children:[t.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableSmartRouting")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableSmartRoutingDescription")})]}),t.jsx(Jt,{disabled:V,checked:D.enabled,onCheckedChange:Q=>Sr(Q)})]}),t.jsx("div",{className:"p-3 bg-blue-300 border border-blue-200 rounded-md",children:t.jsx("p",{className:"text-sm text-blue-800",children:s("settings.smartRoutingRequiredFields")})}),D.dbUrl!=="${DB_URL}"&&t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsx("div",{className:"mb-2",children:t.jsxs("h3",{className:"font-medium text-gray-700",children:[t.jsx("span",{className:"text-red-500 px-1",children:"*"}),s("settings.dbUrl")]})}),t.jsx("div",{className:"flex items-center gap-3",children:t.jsx("input",{type:"text",value:f.dbUrl,onChange:Q=>se("dbUrl",Q.target.value),placeholder:s("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:V})})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsx("div",{className:"mb-2",children:t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.embeddingProvider")||"Embedding Provider"})}),t.jsx("div",{className:"flex items-center gap-3",children:t.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:f.embeddingProvider,onChange:Q=>se("embeddingProvider",Q.target.value),disabled:V,children:[t.jsx("option",{value:"openai",children:"OpenAI (or compatible)"}),t.jsx("option",{value:"azure_openai",children:"Azure OpenAI"})]})})]}),f.embeddingProvider==="openai"?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsx("div",{className:"mb-2",children:t.jsxs("h3",{className:"font-medium text-gray-700",children:[t.jsx("span",{className:"text-red-500 px-1",children:"*"}),s("settings.openaiApiKey")]})}),t.jsx("div",{className:"flex items-center gap-3",children:t.jsx("input",{type:"password",value:f.openaiApiKey,onChange:Q=>se("openaiApiKey",Q.target.value),placeholder:s("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:V})})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsx("div",{className:"mb-2",children:t.jsxs("h3",{className:"font-medium text-gray-700",children:[t.jsx("span",{className:"text-red-500 px-1",children:"*"}),s("settings.openaiApiBaseUrl")]})}),t.jsx("div",{className:"flex items-center gap-3",children:t.jsx("input",{type:"text",value:f.openaiApiBaseUrl,onChange:Q=>se("openaiApiBaseUrl",Q.target.value),placeholder:s("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:V,required:!0})})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsx("div",{className:"mb-2",children:t.jsxs("h3",{className:"font-medium text-gray-700",children:[t.jsx("span",{className:"text-red-500 px-1",children:"*"}),s("settings.openaiApiEmbeddingModel")]})}),t.jsx("div",{className:"flex items-center gap-3",children:t.jsx("input",{type:"text",value:f.openaiApiEmbeddingModel,onChange:Q=>se("openaiApiEmbeddingModel",Q.target.value),placeholder:s("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:V,required:!0})})]})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsx("div",{className:"mb-2",children:t.jsxs("h3",{className:"font-medium text-gray-700",children:[t.jsx("span",{className:"text-red-500 px-1",children:"*"}),s("settings.azureOpenaiEndpoint")||"Azure OpenAI Endpoint"]})}),t.jsx("div",{className:"flex items-center gap-3",children:t.jsx("input",{type:"text",value:f.azureOpenaiEndpoint,onChange:Q=>se("azureOpenaiEndpoint",Q.target.value),placeholder:s("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:V})})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsx("div",{className:"mb-2",children:t.jsxs("h3",{className:"font-medium text-gray-700",children:[t.jsx("span",{className:"text-red-500 px-1",children:"*"}),s("settings.azureOpenaiApiKey")||"Azure OpenAI API Key"]})}),t.jsx("div",{className:"flex items-center gap-3",children:t.jsx("input",{type:"password",value:f.azureOpenaiApiKey,onChange:Q=>se("azureOpenaiApiKey",Q.target.value),placeholder:s("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:V})})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsx("div",{className:"mb-2",children:t.jsxs("h3",{className:"font-medium text-gray-700",children:[t.jsx("span",{className:"text-red-500 px-1",children:"*"}),s("settings.azureOpenaiApiVersion")||"Azure OpenAI API Version"]})}),t.jsx("div",{className:"flex items-center gap-3",children:t.jsx("input",{type:"text",value:f.azureOpenaiApiVersion,onChange:Q=>se("azureOpenaiApiVersion",Q.target.value),placeholder:s("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:V})})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsx("div",{className:"mb-2",children:t.jsxs("h3",{className:"font-medium text-gray-700",children:[t.jsx("span",{className:"text-red-500 px-1",children:"*"}),s("settings.azureOpenaiEmbeddingDeployment")||"Azure Embedding Deployment"]})}),t.jsx("div",{className:"flex items-center gap-3",children:t.jsx("input",{type:"text",value:f.azureOpenaiEmbeddingDeployment,onChange:Q=>se("azureOpenaiEmbeddingDeployment",Q.target.value),placeholder:s("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:V})})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{className:"mb-2",children:[t.jsxs("h3",{className:"font-medium text-gray-700",children:[t.jsx("span",{className:"text-red-500 px-1",children:"*"}),s("settings.azureOpenaiEmbeddingModel")||"Azure Embedding Model Name"]}),t.jsx("p",{className:"text-xs text-gray-500 mt-1",children:s("settings.azureOpenaiEmbeddingModelDescription")||"The actual OpenAI model name deployed in Azure (e.g. text-embedding-3-small). Used for accurate token counting."})]}),t.jsx("div",{className:"flex items-center gap-3",children:t.jsx("input",{type:"text",value:f.azureOpenaiEmbeddingModel,onChange:Q=>se("azureOpenaiEmbeddingModel",Q.target.value),placeholder:s("settings.azureOpenaiEmbeddingModelPlaceholder")||"text-embedding-3-small",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:V,required:!0})})]})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{className:"mb-2",children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.basePacingDelayMs")}),t.jsx("p",{className:"text-xs text-gray-500 mt-1",children:s("settings.basePacingDelayMsDescription")})]}),t.jsx("div",{className:"flex items-center gap-3",children:t.jsx("input",{type:"number",min:"0",step:"1000",value:f.basePacingDelayMs,onChange:Q=>se("basePacingDelayMs",Q.target.value),placeholder:s("settings.basePacingDelayMsPlaceholder")||"Empty = default 0 ms",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:V})}),t.jsx("p",{className:"text-xs text-gray-500 mt-2",children:(()=>{const Q=f.basePacingDelayMs.trim();return Q?s(Q==="0"?"settings.basePacingDelayMsZero":"settings.basePacingDelayMsOverride"):s("settings.basePacingDelayMsAuto",{value:0})})()})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{className:"mb-2",children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.embeddingEncodingFormat")}),t.jsx("p",{className:"text-xs text-gray-500 mt-1",children:s("settings.embeddingEncodingFormatDescription")})]}),t.jsx("div",{className:"flex items-center gap-3",children:t.jsxs("select",{value:f.embeddingEncodingFormat,onChange:Q=>se("embeddingEncodingFormat",Q.target.value),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-select",disabled:V,children:[t.jsx("option",{value:"auto",children:s("settings.embeddingEncodingFormatAuto")||"Auto"}),t.jsx("option",{value:"base64",children:"Base64"}),t.jsx("option",{value:"float",children:"Float"})]})})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{className:"mb-2",children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.embeddingMaxTokens")}),t.jsx("p",{className:"text-xs text-gray-500 mt-1",children:s("settings.embeddingMaxTokensDescription")})]}),t.jsx("div",{className:"flex items-center gap-3",children:t.jsx("input",{type:"number",min:"1",value:f.embeddingMaxTokens,onChange:Q=>se("embeddingMaxTokens",Q.target.value),placeholder:s("settings.embeddingMaxTokensPlaceholder")||"Empty = auto by model",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:V})}),t.jsx("p",{className:"text-xs text-gray-500 mt-2",children:(()=>{const Q=(f.embeddingProvider==="azure_openai"?f.azureOpenaiEmbeddingModel||D.azureOpenaiEmbeddingModel:f.openaiApiEmbeddingModel||D.openaiApiEmbeddingModel)||"text-embedding-3-small";return f.embeddingMaxTokens.trim()?s("settings.embeddingMaxTokensOverride"):s("settings.embeddingMaxTokensAuto",{limit:YS(Q),model:Q})})()})]}),t.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.progressiveDisclosure")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.progressiveDisclosureDescription")})]}),t.jsx(Jt,{disabled:V||!D.enabled,checked:D.progressiveDisclosure,onCheckedChange:Q=>L("progressiveDisclosure",Q)})]}),t.jsx("div",{className:"flex justify-end pt-2",children:t.jsx("button",{onClick:gt,disabled: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",children:s("common.save")})})]})]})}),t.jsx(ia,{permissions:oa.SETTINGS_OAUTH_SERVER,children:t.jsxs("div",{className:"bg-white shadow rounded-lg mb-6 dashboard-card",children:[t.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600 py-4 px-6",onClick:()=>X("oauthServerConfig"),children:[t.jsx("h2",{className:"font-semibold text-gray-800",children:s("pages.settings.oauthServer")}),t.jsx("span",{className:"text-gray-500",children:de.oauthServerConfig?"▼":"►"})]}),de.oauthServerConfig&&t.jsxs("div",{className:"space-y-4 pb-4 px-6",children:[t.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableOauthServer")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableOauthServerDescription")})]}),t.jsx(Jt,{disabled:V,checked:R.enabled,onCheckedChange:Q=>ft("enabled",Q)})]}),t.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.requireClientSecret")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.requireClientSecretDescription")})]}),t.jsx(Jt,{disabled:V||!R.enabled,checked:R.requireClientSecret,onCheckedChange:Q=>ft("requireClientSecret",Q)})]}),t.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.requireState")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.requireStateDescription")})]}),t.jsx(Jt,{disabled:V||!R.enabled,checked:R.requireState,onCheckedChange:Q=>ft("requireState",Q)})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{className:"mb-2",children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.accessTokenLifetime")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.accessTokenLifetimeDescription")})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("input",{type:"number",value:y.accessTokenLifetime,onChange:Q=>xe("accessTokenLifetime",Q.target.value),placeholder:s("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:V}),t.jsx("button",{onClick:()=>Se("accessTokenLifetime"),disabled:V,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:s("common.save")})]})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{className:"mb-2",children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.refreshTokenLifetime")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.refreshTokenLifetimeDescription")})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("input",{type:"number",value:y.refreshTokenLifetime,onChange:Q=>xe("refreshTokenLifetime",Q.target.value),placeholder:s("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:V}),t.jsx("button",{onClick:()=>Se("refreshTokenLifetime"),disabled:V,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:s("common.save")})]})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{className:"mb-2",children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.authorizationCodeLifetime")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.authorizationCodeLifetimeDescription")})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("input",{type:"number",value:y.authorizationCodeLifetime,onChange:Q=>xe("authorizationCodeLifetime",Q.target.value),placeholder:s("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:V}),t.jsx("button",{onClick:()=>Se("authorizationCodeLifetime"),disabled:V,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:s("common.save")})]})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{className:"mb-2",children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.allowedScopes")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.allowedScopesDescription")})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("input",{type:"text",value:y.allowedScopes,onChange:Q=>ke("allowedScopes",Q.target.value),placeholder:s("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:V}),t.jsx("button",{onClick:Le,disabled:V,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:s("common.save")})]})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md space-y-4",children:[t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableDynamicRegistration")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.dynamicRegistrationDescription")})]}),t.jsx(Jt,{disabled:V||!R.enabled,checked:R.dynamicRegistration.enabled,onCheckedChange:Q=>Mt({enabled:Q})})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"mb-2",children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.dynamicRegistrationAllowedGrantTypes")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.dynamicRegistrationAllowedGrantTypesDescription")})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("input",{type:"text",value:y.dynamicRegistrationAllowedGrantTypes,onChange:Q=>ke("dynamicRegistrationAllowedGrantTypes",Q.target.value),placeholder:s("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:V||!R.enabled||!R.dynamicRegistration.enabled}),t.jsx("button",{onClick:st,disabled:V||!R.enabled||!R.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:s("common.save")})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.dynamicRegistrationAuth")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.dynamicRegistrationAuthDescription")})]}),t.jsx(Jt,{disabled:V||!R.enabled||!R.dynamicRegistration.enabled,checked:R.dynamicRegistration.requiresAuthentication,onCheckedChange:Q=>Mt({requiresAuthentication:Q})})]})]})]})]})}),t.jsx(ia,{permissions:oa.SETTINGS_INSTALL_CONFIG,children:t.jsxs("div",{className:"bg-white shadow rounded-lg mb-6 page-card dashboard-card",children:[t.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600 py-4 px-6",onClick:()=>X("mcpRouterConfig"),children:[t.jsx("h2",{className:"font-semibold text-gray-800",children:s("settings.mcpRouterConfig")}),t.jsx("span",{className:"text-gray-500 transition-transform duration-200",children:de.mcpRouterConfig?"▼":"►"})]}),de.mcpRouterConfig&&t.jsxs("div",{className:"space-y-4 pb-4 px-6",children:[t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{className:"mb-2",children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.mcpRouterApiKey")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.mcpRouterApiKeyDescription")})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("input",{type:"password",value:h.apiKey,onChange:Q=>be("apiKey",Q.target.value),placeholder:s("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:V}),t.jsx("button",{onClick:()=>Ne("apiKey"),disabled:V,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:s("common.save")})]})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{className:"mb-2",children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.mcpRouterBaseUrl")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.mcpRouterBaseUrlDescription")})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("input",{type:"text",value:h.baseUrl,onChange:Q=>be("baseUrl",Q.target.value),placeholder:s("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:V}),t.jsx("button",{onClick:()=>Ne("baseUrl"),disabled:V,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:s("common.save")})]})]})]})]})}),t.jsx(ia,{permissions:oa.SETTINGS_SYSTEM_CONFIG,children:t.jsxs("div",{className:"bg-white shadow rounded-lg mb-6 dashboard-card",children:[t.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600 py-4 px-6",onClick:()=>X("nameSeparator"),children:[t.jsx("h2",{className:"font-semibold text-gray-800",children:s("settings.systemSettings")}),t.jsx("span",{className:"text-gray-500",children:de.nameSeparator?"▼":"►"})]}),de.nameSeparator&&t.jsxs("div",{className:"space-y-4 pb-4 px-6",children:[t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{className:"mb-2",children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.nameSeparatorLabel")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.nameSeparatorDescription")})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("input",{type:"text",value:N,onChange:Q=>S(Q.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:V,maxLength:5}),t.jsx("button",{onClick:Pt,disabled:V,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:s("common.save")})]})]}),t.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableSessionRebuild")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableSessionRebuildDescription")})]}),t.jsx(Jt,{disabled:V,checked:P,onCheckedChange:Q=>me(Q)})]})]})]})}),t.jsx(ia,{permissions:oa.SETTINGS_ROUTE_CONFIG,children:t.jsxs("div",{className:"bg-white shadow rounded-lg mb-6 dashboard-card",children:[t.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600 py-4 px-6",onClick:()=>X("routingConfig"),children:[t.jsx("h2",{className:"font-semibold text-gray-800",children:s("pages.settings.routeConfig")}),t.jsx("span",{className:"text-gray-500",children:de.routingConfig?"▼":"►"})]}),de.routingConfig&&t.jsxs("div",{className:"space-y-4 pb-4 px-6",children:[t.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableGlobalRoute")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableGlobalRouteDescription")})]}),t.jsx(Jt,{disabled:V,checked:z.enableGlobalRoute,onCheckedChange:Q=>he("enableGlobalRoute",Q)})]}),t.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.enableGroupNameRoute")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.enableGroupNameRouteDescription")})]}),t.jsx(Jt,{disabled:V,checked:z.enableGroupNameRoute,onCheckedChange:Q=>he("enableGroupNameRoute",Q)})]}),t.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.skipAuth")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.skipAuthDescription")})]}),t.jsx(Jt,{disabled:V,checked:z.skipAuth,onCheckedChange:Q=>he("skipAuth",Q)})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{className:"mb-2",children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.jsonBodyLimit")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.jsonBodyLimitDescription")})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("input",{type:"text",value:E.jsonBodyLimit,onChange:Q=>ae("jsonBodyLimit",Q.target.value),placeholder:s("settings.jsonBodyLimitPlaceholder"),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:V}),t.jsx("button",{onClick:()=>he("jsonBodyLimit",E.jsonBodyLimit),disabled:V,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:s("common.save")})]})]})]})]})}),t.jsx(ia,{permissions:oa.SETTINGS_INSTALL_CONFIG,children:t.jsxs("div",{className:"bg-white shadow rounded-lg mb-6 dashboard-card",children:[t.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600 py-4 px-6",onClick:()=>X("installConfig"),children:[t.jsx("h2",{className:"font-semibold text-gray-800",children:s("settings.installConfig")}),t.jsx("span",{className:"text-gray-500",children:de.installConfig?"▼":"►"})]}),de.installConfig&&t.jsxs("div",{className:"space-y-4 pb-4 px-6",children:[t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{className:"mb-2",children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.baseUrl")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.baseUrlDescription")})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("input",{type:"text",value:d.baseUrl,onChange:Q=>ye("baseUrl",Q.target.value),placeholder:s("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:V}),t.jsx("button",{onClick:()=>ie("baseUrl"),disabled:V,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:s("common.save")})]})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{className:"mb-2",children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.pythonIndexUrl")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.pythonIndexUrlDescription")})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("input",{type:"text",value:d.pythonIndexUrl,onChange:Q=>ye("pythonIndexUrl",Q.target.value),placeholder:s("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:V}),t.jsx("button",{onClick:()=>ie("pythonIndexUrl"),disabled:V,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:s("common.save")})]})]}),t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{className:"mb-2",children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.npmRegistry")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.npmRegistryDescription")})]}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("input",{type:"text",value:d.npmRegistry,onChange:Q=>ye("npmRegistry",Q.target.value),placeholder:s("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:V}),t.jsx("button",{onClick:()=>ie("npmRegistry"),disabled:V,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:s("common.save")})]})]})]})]})}),t.jsxs("div",{className:"bg-white shadow rounded-lg mb-6 dashboard-card","data-section":"password",children:[t.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600 py-4 px-6",onClick:()=>X("password"),role:"button",children:[t.jsx("h2",{className:"font-semibold text-gray-800",children:s("auth.changePassword")}),t.jsx("span",{className:"text-gray-500",children:de.password?"▼":"►"})]}),de.password&&t.jsx("div",{className:"max-w-lg pb-4 px-6",children:t.jsx(KS,{onSuccess:Nr})})]}),t.jsx(ia,{permissions:oa.SETTINGS_EXPORT_CONFIG,children:t.jsxs("div",{className:"bg-white shadow rounded-lg mb-6 dashboard-card",children:[t.jsxs("div",{className:"flex justify-between items-center cursor-pointer transition-colors duration-200 hover:text-blue-600 py-4 px-6",onClick:()=>X("exportConfig"),children:[t.jsx("h2",{className:"font-semibold text-gray-800",children:s("settings.exportMcpSettings")}),t.jsx("span",{className:"text-gray-500",children:de.exportConfig?"▼":"►"})]}),de.exportConfig&&t.jsx("div",{className:"space-y-4 pb-4 px-6",children:t.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[t.jsxs("div",{className:"mb-4",children:[t.jsx("h3",{className:"font-medium text-gray-700",children:s("settings.mcpSettingsJson")}),t.jsx("p",{className:"text-sm text-gray-500",children:s("settings.mcpSettingsJsonDescription")})]}),t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsxs("button",{onClick:Ds,disabled:!ht,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:[er?t.jsx(Os,{size:16}):t.jsx(jn,{size:16}),s(er?"common.copied":"settings.copyToClipboard")]}),t.jsxs("button",{onClick:mr,disabled:!ht,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:[t.jsx(cw,{size:16}),s("settings.downloadJson")]})]}),ht&&t.jsx("div",{className:"mt-3",children:t.jsx("pre",{className:"bg-gray-900 text-gray-100 p-4 rounded-md overflow-x-auto text-xs max-h-96",children:ht})})]})]})})]})})]})},QS=()=>{const{t:s}=ve(),[n,l]=x.useState([]),[o,c]=x.useState([]),[d,m]=x.useState([]),[f,g]=x.useState([]),[h,b]=x.useState(""),[y,w]=x.useState(""),[N,S]=x.useState(""),[j,C]=x.useState(!0),[z,E]=x.useState(null),[T,B]=x.useState(null),[D,Y]=x.useState([]),[R,_]=x.useState(1),[P,V]=x.useState(9),[K,G]=x.useState(1),I=x.useCallback(async()=>{try{C(!0);const ee=await Be("/market/servers");ee&&ee.success&&Array.isArray(ee.data)?(c(ee.data),L(ee.data,R)):(console.error("Invalid market servers data format",{data:ee}),E(s("market.fetchError")))}catch(ee){console.error("Error fetching market servers",{err:ee}),E(ee instanceof Error?ee.message:String(ee))}finally{C(!1)}},[s]),L=x.useCallback((ee,X,he=P)=>{const ae=ee.length,ye=Math.ceil(ae/he);G(ye);const ie=Math.max(1,Math.min(X,ye));ie!==X&&_(ie);const se=(ie-1)*he,be=ee.slice(se,se+he);l(be)},[P]),Z=x.useCallback(ee=>{_(ee),L(o,ee,P)},[o,L,P]),A=x.useCallback(async()=>{try{const ee=await Be("/market/categories");ee&&ee.success&&Array.isArray(ee.data)?m(ee.data):console.error("Invalid categories data format",{data:ee})}catch(ee){console.error("Error fetching categories",{err:ee})}},[]),H=x.useCallback(async()=>{try{const ee=await Be("/market/tags");ee&&ee.success&&Array.isArray(ee.data)?g(ee.data):console.error("Invalid tags data format",{data:ee})}catch(ee){console.error("Error fetching tags",{err:ee})}},[]),J=x.useCallback(async ee=>{try{C(!0);const X=await Be(`/market/servers/${ee}`);return X&&X.success&&X.data?(B(X.data),X.data):(console.error("Invalid market server data format",{name:ee,data:X}),E(s("market.serverNotFound")),null)}catch(X){return console.error("Error fetching market server",{name:ee,err:X}),E(X instanceof Error?X.message:String(X)),null}finally{C(!1)}},[s]),me=x.useCallback(async ee=>{try{if(C(!0),S(ee),!ee.trim()){I();return}const X=await Be(`/market/servers/search?query=${encodeURIComponent(ee)}`);X&&X.success&&Array.isArray(X.data)?(c(X.data),_(1),L(X.data,1)):(console.error("Invalid market search results format",{query:ee,data:X}),E(s("market.searchError")))}catch(X){console.error("Error searching market servers",{query:ee,err:X}),E(X instanceof Error?X.message:String(X))}finally{C(!1)}},[s,o,L,I]),le=x.useCallback(async ee=>{try{if(C(!0),b(ee),w(""),!ee){I();return}const X=await Be(`/market/categories/${encodeURIComponent(ee)}`);X&&X.success&&Array.isArray(X.data)?(c(X.data),_(1),L(X.data,1)):(console.error("Invalid market category filter results format",{category:ee,data:X}),E(s("market.filterError")))}catch(X){console.error("Error filtering market servers by category",{category:ee,err:X}),E(X instanceof Error?X.message:String(X))}finally{C(!1)}},[s,I,L]),k=x.useCallback(async ee=>{try{if(C(!0),w(ee),b(""),!ee){I();return}const X=await Be(`/market/tags/${encodeURIComponent(ee)}`);X&&X.success&&Array.isArray(X.data)?(c(X.data),_(1),L(X.data,1)):(console.error("Invalid market tag filter results format",{tag:ee,data:X}),E(s("market.tagFilterError")))}catch(X){console.error("Error filtering market servers by tag",{tag:ee,err:X}),E(X instanceof Error?X.message:String(X))}finally{C(!1)}},[s,I,L]),U=x.useCallback(async()=>{try{const ee=await Be("/servers");if(ee&&ee.success&&Array.isArray(ee.data)){const X=ee.data.map(he=>he.name);Y(X)}}catch(ee){console.error("Error fetching installed servers",{err:ee})}},[]),M=x.useCallback(ee=>D.includes(ee),[D]),q=x.useCallback(async(ee,X)=>{var he,ae;try{const ye=(he=ee.installations)!=null&&he.npm?"npm":Object.keys(ee.installations||{}).length>0?Object.keys(ee.installations)[0]:null;if(!ye||!((ae=ee.installations)!=null&&ae[ye]))return E(s("market.noInstallationMethod")),!1;const ie=ee.installations[ye],se={name:ee.name,config:X.type==="stdio"?{command:X.command||ie.command||"",args:X.args||ie.args||[],env:{...ie.env,...X.env}}:X},be=await pt("/servers",se);if(!be.success)throw new Error(be.message||"Failed to install server");return await U(),!0}catch(ye){return console.error("Error installing market server",{serverName:ee.name,err:ye}),E(ye instanceof Error?ye.message:String(ye)),!1}},[s,U]),de=x.useCallback(ee=>{V(ee),_(1),L(o,1,ee)},[o,L]);return x.useEffect(()=>{I(),A(),H(),U()},[I,A,H,U]),{servers:n,allServers:o,categories:d,tags:f,selectedCategory:h,selectedTag:y,searchQuery:N,loading:j,error:z,setError:E,currentServer:T,fetchMarketServers:I,fetchServerByName:J,searchServers:me,filterByCategory:le,filterByTag:k,installServer:q,currentPage:R,totalPages:K,serversPerPage:P,changePage:Z,changeServersPerPage:de,isServerInstalled:M}},XS=()=>{const{t:s}=ve(),[n,l]=x.useState([]),[o,c]=x.useState([]),[d,m]=x.useState([]),[f,g]=x.useState([]),[h,b]=x.useState(""),[y,w]=x.useState(""),[N,S]=x.useState(""),[j,C]=x.useState(!0),[z,E]=x.useState(null),[T,B]=x.useState(null),[D,Y]=x.useState(1),[R,_]=x.useState(9),[P,V]=x.useState(1),K=x.useCallback(async()=>{try{C(!0);const M=await Be("/cloud/servers");M&&M.success&&Array.isArray(M.data)?(c(M.data),G(M.data,D)):(console.error("Invalid cloud market servers data format",{data:M}),E(s("cloud.fetchError")))}catch(M){console.error("Error fetching cloud market servers",{err:M});const q=M instanceof Error?M.message:String(M);q==="MCPROUTER_API_KEY_NOT_CONFIGURED"||q.toLowerCase().includes("mcprouter api key not configured"),E(q)}finally{C(!1)}},[s]),G=x.useCallback((M,q,de=R)=>{const ee=M.length,X=Math.ceil(ee/de);V(X);const he=Math.max(1,Math.min(q,X));he!==q&&Y(he);const ae=(he-1)*de,ye=M.slice(ae,ae+de);l(ye)},[R]),I=x.useCallback(M=>{Y(M),G(o,M,R)},[o,G,R]),L=x.useCallback(async()=>{try{const M=await Be("/cloud/categories");M&&M.success&&Array.isArray(M.data)?m(M.data):console.error("Invalid cloud market categories data format",{data:M})}catch(M){console.error("Error fetching cloud market categories",{err:M})}},[]),Z=x.useCallback(async()=>{try{const M=await Be("/cloud/tags");M&&M.success&&Array.isArray(M.data)?g(M.data):console.error("Invalid cloud market tags data format",{data:M})}catch(M){console.error("Error fetching cloud market tags",{err:M})}},[]),A=x.useCallback(async M=>{try{C(!0);const q=await Be(`/cloud/servers/${M}`);return q&&q.success&&q.data?(B(q.data),q.data):(console.error("Invalid cloud server data format",{name:M,data:q}),E(s("cloud.serverNotFound")),null)}catch(q){console.error("Error fetching cloud server",{name:M,err:q});const de=q instanceof Error?q.message:String(q);return de==="MCPROUTER_API_KEY_NOT_CONFIGURED"||de.toLowerCase().includes("mcprouter api key not configured"),E(de),null}finally{C(!1)}},[s]),H=x.useCallback(async M=>{try{if(C(!0),S(M),!M.trim()){K();return}const q=await Be(`/cloud/servers/search?query=${encodeURIComponent(M)}`);q&&q.success&&Array.isArray(q.data)?(c(q.data),Y(1),G(q.data,1)):(console.error("Invalid cloud search results format",{query:M,data:q}),E(s("cloud.searchError")))}catch(q){console.error("Error searching cloud servers",{query:M,err:q}),E(q instanceof Error?q.message:String(q))}finally{C(!1)}},[s,o,G,K]),J=x.useCallback(async M=>{try{if(C(!0),b(M),w(""),!M){K();return}const q=await Be(`/cloud/categories/${encodeURIComponent(M)}`);q&&q.success&&Array.isArray(q.data)?(c(q.data),Y(1),G(q.data,1)):(console.error("Invalid cloud category filter results format",{category:M,data:q}),E(s("cloud.filterError")))}catch(q){console.error("Error filtering cloud servers by category",{category:M,err:q}),E(q instanceof Error?q.message:String(q))}finally{C(!1)}},[s,K,G]),me=x.useCallback(async M=>{try{if(C(!0),w(M),b(""),!M){K();return}const q=await Be(`/cloud/tags/${encodeURIComponent(M)}`);q&&q.success&&Array.isArray(q.data)?(c(q.data),Y(1),G(q.data,1)):(console.error("Invalid cloud tag filter results format",{tag:M,data:q}),E(s("cloud.tagFilterError")))}catch(q){console.error("Error filtering cloud servers by tag",{tag:M,err:q}),E(q instanceof Error?q.message:String(q))}finally{C(!1)}},[s,K,G]),le=x.useCallback(async M=>{try{const q=await Be(`/cloud/servers/${M}/tools`);if(!q.success)throw console.error("Failed to fetch cloud server tools",{serverName:M,data:q}),new Error(q.message||"Failed to fetch cloud server tools");return q&&q.success&&Array.isArray(q.data)?q.data:(console.error("Invalid cloud server tools data format",{serverName:M,data:q}),[])}catch(q){console.error("Error fetching tools for cloud server",{serverName:M,err:q});const de=q instanceof Error?q.message:String(q);if(de==="MCPROUTER_API_KEY_NOT_CONFIGURED"||de.toLowerCase().includes("mcprouter api key not configured"))throw q;return[]}},[]),k=x.useCallback(async(M,q,de)=>{try{const ee=await pt(`/cloud/servers/${encodeURIComponent(M)}/tools/${encodeURIComponent(q)}/call`,{arguments:de});if(ee&&ee.success)return ee.data;throw new Error(ee.message||"Failed to call tool")}catch(ee){throw console.error("Error calling tool on cloud server",{serverName:M,toolName:q,err:ee}),ee}},[]),U=x.useCallback(M=>{_(M),Y(1),G(o,1,M)},[o,G]);return x.useEffect(()=>{K(),L(),Z()},[K,L,Z]),{servers:n,allServers:o,categories:d,tags:f,selectedCategory:h,selectedTag:y,searchQuery:N,loading:j,error:z,setError:E,currentServer:T,fetchCloudServers:K,fetchServerByName:A,searchServers:H,filterByCategory:J,filterByTag:me,fetchServerTools:le,callServerTool:k,currentPage:D,totalPages:P,serversPerPage:R,changePage:I,changeServersPerPage:U}},ZS=()=>{const{t:s}=ve(),[n,l]=x.useState([]),[o,c]=x.useState([]),[d,m]=x.useState(!0),[f,g]=x.useState(null),[h,b]=x.useState(""),[y,w]=x.useState(1),[N,S]=x.useState(9),[j,C]=x.useState(null),[z,E]=x.useState(!1),[T,B]=x.useState([]),[D]=x.useState(1),Y=x.useCallback(async(A,H)=>{try{m(!0),g(null);const J=new URLSearchParams;J.append("limit",N.toString()),A&&J.append("cursor",A);const me=H!==void 0?H:h;me.trim()&&J.append("search",me.trim());const le=await Be(`/registry/servers?${J.toString()}`);if(le&&le.success&&le.data){const k=le.data;if(k.servers&&Array.isArray(k.servers)){l(k.servers);const U=k.metadata.count===N&&!!k.metadata.nextCursor;E(U),C(k.metadata.nextCursor||null),c(A?M=>[...M,...k.servers]:k.servers)}else console.error("Invalid registry servers data format",{data:k}),g(s("registry.fetchError"))}else g(s("registry.fetchError"))}catch(J){console.error("Error fetching registry servers",{cursor:A,search:H,err:J});const me=J instanceof Error?J.message:String(J);g(me)}finally{m(!1)}},[s,N]),R=x.useCallback(async()=>{if(!z||!j)return;const A=T[T.length-1]||"";B(H=>[...H,A]),w(H=>H+1),await Y(j,h)},[z,j,T,h,Y]),_=x.useCallback(async()=>{if(y<=1)return;const A=[...T];A.pop();const H=A[A.length-1];B(A),w(J=>J-1),await Y(H||void 0,h)},[y,T,h,Y]),P=x.useCallback(async A=>{A!==y&&(A>y&&z?await R():A<y&&y>1&&await _())},[y,z,R,_]),V=x.useCallback(async A=>{S(A),w(1),B([]),c([]),await Y(void 0,h)},[h,Y]),K=x.useCallback(async A=>{try{m(!0),g(null);const H=encodeURIComponent(A),J=await Be(`/registry/servers/${H}/versions`);if(J&&J.success&&J.data){const me=J.data;return me.servers&&Array.isArray(me.servers)&&me.servers.length>0?me.servers[0]:(console.error("Invalid registry server data format",{serverName:A,data:me}),g(s("registry.serverNotFound")),null)}else return g(s("registry.serverNotFound")),null}catch(H){console.error("Error fetching registry server",{serverName:A,err:H});const J=H instanceof Error?H.message:String(H);return g(J),null}finally{m(!1)}},[s]),G=x.useCallback(async A=>{try{g(null);const H=encodeURIComponent(A),J=await Be(`/registry/servers/${H}/versions`);if(J&&J.success&&J.data){const me=J.data;return me.servers&&Array.isArray(me.servers)?me.servers:(console.error("Invalid registry server versions data format",{serverName:A,data:me}),[])}else return[]}catch(H){console.error("Error fetching versions for registry server",{serverName:A,err:H});const J=H instanceof Error?H.message:String(H);return g(J),[]}},[]),I=x.useCallback(async(A,H)=>{try{g(null);const J=encodeURIComponent(A),me=encodeURIComponent(H),le=await Be(`/registry/servers/${J}/versions/${me}`);if(le&&le.success&&le.data){const k=le.data;return k&&k.server?k:(console.error("Invalid registry server version data format",{serverName:A,version:H,data:k}),null)}else return null}catch(J){console.error("Error fetching specific registry server version",{serverName:A,version:H,err:J});const me=J instanceof Error?J.message:String(J);return g(me),null}},[]),L=x.useCallback(async A=>{console.log("Searching registry servers",{query:A}),b(A),w(1),B([]),c([]),await Y(void 0,A)},[Y]),Z=x.useCallback(async()=>{b(""),w(1),B([]),c([]),await Y(void 0,"")},[Y]);return x.useEffect(()=>{Y(void 0,h)},[]),{servers:n,allServers:o,loading:d,error:f,setError:g,searchQuery:h,searchServers:L,clearSearch:Z,fetchServerByName:K,fetchServerVersions:G,fetchServerVersion:I,currentPage:y,totalPages:D,hasNextPage:z,hasPreviousPage:y>1,changePage:P,goToNextPage:R,goToPreviousPage:_,serversPerPage:N,changeServersPerPage:V}},WS=({server:s,onClick:n})=>{var g,h,b,y;const{t:l}=ve(),o=w=>w.split(" ").map(N=>N.charAt(0)).join("").toUpperCase().slice(0,2),c=()=>{if(!s.tags||s.tags.length===0)return{tagsToShow:[],hasMore:!1,moreCount:0};const w=28,N=T=>T.length+3;let S=0,j=0;const C=[...s.tags].sort((T,B)=>T.length-B.length);for(j=0;j<C.length;j++){const T=N(C[j]);if(S+T>w)break;if(S+=T,j===C.length-1)return{tagsToShow:C,hasMore:!1,moreCount:0}}j===0&&C.length>0&&(j=1);const z=C.length-j,E=3+String(z).length+l("market.moreTags").length;return S+E<=w||j<1?{tagsToShow:C.slice(0,j),hasMore:!0,moreCount:z}:{tagsToShow:C.slice(0,Math.max(1,j-1)),hasMore:!0,moreCount:z+1}},{tagsToShow:d,hasMore:m,moreCount:f}=c();return t.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(s),children:[t.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"}),t.jsxs("div",{className:"relative z-10 flex-1 flex flex-col",children:[t.jsxs("div",{className:"flex items-start justify-between mb-2",children:[t.jsxs("div",{className:"flex-1",children:[t.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:s.display_name}),t.jsxs("div",{className:"flex items-center space-x-2 mb-1",children:[t.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=s.author)==null?void 0:g.name)||l("market.unknown"))}),t.jsx("div",{children:t.jsx("p",{className:"text-xs font-medium text-gray-700",children:((h=s.author)==null?void 0:h.name)||l("market.unknown")})})]})]}),t.jsx("div",{className:"flex flex-col items-end space-y-2",children:s.is_official&&t.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")})})]}),t.jsx("div",{className:"mb-2 flex-1",children:t.jsx("p",{className:"text-gray-600 text-sm leading-relaxed line-clamp-2 min-h-[36px]",children:s.description})}),t.jsx("div",{className:"mb-2",children:t.jsx("div",{className:"flex flex-wrap gap-1 min-h-[24px]",children:((b=s.categories)==null?void 0:b.length)>0?s.categories.map((w,N)=>t.jsx("span",{className:"bg-gray-100 text-gray-800 text-xs px-2 py-1 rounded whitespace-nowrap",children:w},N)):t.jsx("span",{className:"text-xs text-gray-400 py-1",children:"-"})})}),t.jsx("div",{className:"mb-2",children:t.jsx("div",{className:"relative min-h-[24px] overflow-x-auto",children:((y=s.tags)==null?void 0:y.length)>0?t.jsxs("div",{className:"flex gap-1 items-center whitespace-nowrap",children:[d.map((w,N)=>t.jsxs("span",{className:"bg-green-50 text-green-700 text-xs px-2 py-1 rounded flex-shrink-0",children:["#",w]},N)),m&&t.jsxs("span",{className:"bg-gray-100 text-gray-600 text-xs px-1.5 py-1 rounded flex-shrink-0",children:["+",f," ",l("market.moreTags")]})]}):t.jsx("span",{className:"text-xs text-gray-400 py-1",children:"-"})})})]})]})},eN=({server:s,onBack:n,onInstall:l,installing:o=!1,isInstalled:c=!1})=>{var P,V,K;const{t:d}=ve(),[m,f]=x.useState(!1),[g,h]=x.useState(null),[b,y]=x.useState(!1),[w,N]=x.useState(null),[S,j]=x.useState([]),C=()=>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")},z=()=>{f(!m),h(null),y(!1),N(null)},E=async()=>{w&&(await T(w),y(!1),N(null))},T=async G=>{try{h(null),l(s,G.config),f(!1)}catch(I){console.error("Error installing server:",I),h(d("errors.serverInstall"))}},B=()=>{c||z()},D=()=>{if(!s.installations)return;if(s.installations.npm)return s.installations.npm;if(s.installations.uvx)return s.installations.uvx;if(s.installations.default)return s.installations.default;const G=Object.keys(s.installations);if(G.length>0)return s.installations[G[0]]},Y=async G=>{try{const I=W0(G);I.length>0?(j(I),N(G),y(!0)):await T(G)}catch(I){console.error("Error processing server installation:",I),h(d("errors.serverInstall"))}},R=C(),_=D();return t.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6",children:[t.jsx("div",{className:"mb-4",children:t.jsxs("button",{onClick:n,className:"text-gray-600 hover:text-gray-900 flex items-center",children:[t.jsx("svg",{className:"h-5 w-5 mr-1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:t.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")]})}),t.jsxs("div",{className:"flex justify-between items-start mb-4",children:[t.jsx("div",{children:t.jsxs("h2",{className:"text-2xl font-bold text-gray-900 flex items-center flex-wrap",children:[s.display_name,t.jsxs("span",{className:"text-sm font-normal text-gray-500 ml-2",children:["(",s.name,")"]}),t.jsxs("span",{className:"text-sm font-normal text-gray-600 ml-4",children:[d("market.author"),": ",((P=s.author)==null?void 0:P.name)||d("market.unknown")," •"," ",d("market.license"),": ",s.license," •",t.jsx("a",{href:s.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-500 hover:underline ml-1",children:d("market.repository")})]})]})}),t.jsxs("div",{className:"flex items-center",children:[s.is_official&&t.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")}),t.jsx("button",{onClick:B,disabled:R.disabled,className:R.className,children:R.text})]})]}),t.jsx("p",{className:"text-gray-700 mb-6",children:s.description}),t.jsxs("div",{className:"mb-6",children:[t.jsxs("h3",{className:"text-lg font-semibold mb-3",children:[d("market.categories")," & ",d("market.tags")]}),t.jsxs("div",{className:"flex flex-wrap gap-2",children:[(V=s.categories)==null?void 0:V.map((G,I)=>t.jsx("span",{className:"bg-gray-100 text-gray-800 px-3 py-1 rounded",children:G},`cat-${I}`)),s.tags&&s.tags.map((G,I)=>t.jsxs("span",{className:"bg-gray-100 text-green-700 px-2 py-1 rounded text-sm",children:["#",G]},`tag-${I}`))]})]}),s.arguments&&Object.keys(s.arguments).length>0&&t.jsxs("div",{className:"mb-6",children:[t.jsx("h3",{className:"text-lg font-semibold mb-3",children:d("market.arguments")}),t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[t.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:t.jsxs("tr",{children:[t.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")}),t.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")}),t.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")}),t.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")})]})}),t.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:Object.entries(s.arguments).map(([G,I],L)=>t.jsxs("tr",{children:[t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900",children:G}),t.jsx("td",{className:"px-6 py-4 text-sm text-gray-500",children:I.description}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:I.required?t.jsx("span",{className:"text-green-600",children:"✓"}):t.jsx("span",{className:"text-gray-600",children:"✗"})}),t.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:t.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded",children:I.example})})]},L))})]})})]}),t.jsxs("div",{className:"mb-6",children:[t.jsx("h3",{className:"text-lg font-semibold mb-3",children:d("market.tools")}),t.jsx("div",{className:"space-y-4",children:(K=s.tools)==null?void 0:K.map((G,I)=>t.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[t.jsxs("h4",{className:"font-medium mb-2",children:[G.name,t.jsx("button",{type:"button",onClick:()=>{const L=document.getElementById(`schema-${I}`);L&&L.classList.toggle("hidden")},className:"text-sm text-blue-500 font-normal hover:underline focus:outline-none ml-2",children:d("market.viewSchema")})]}),t.jsx("p",{className:"text-gray-600 mb-2",children:G.description}),t.jsx("div",{className:"mt-2",children:t.jsx("pre",{id:`schema-${I}`,className:"hidden bg-gray-50 p-3 rounded text-sm overflow-auto mt-2",children:JSON.stringify(G.inputSchema,null,2)})})]},I))})]}),s.examples&&s.examples.length>0&&t.jsxs("div",{className:"mb-6",children:[t.jsx("h3",{className:"text-lg font-semibold mb-3",children:d("market.examples")}),t.jsx("div",{className:"space-y-4",children:s.examples.map((G,I)=>t.jsxs("div",{className:"border border-gray-200 rounded p-4",children:[t.jsx("h4",{className:"font-medium mb-2",children:G.title}),t.jsx("p",{className:"text-gray-600 mb-2",children:G.description}),t.jsx("pre",{className:"bg-gray-50 p-3 rounded text-sm overflow-auto",children:G.prompt})]},I))})]}),t.jsx("div",{className:"mt-6 flex justify-end",children:t.jsx("button",{onClick:B,disabled:R.disabled,className:R.className,children:R.text})}),m&&t.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:t.jsx(Dl,{onSubmit:Y,onCancel:z,modalTitle:d("market.installServer",{name:s.display_name}),formError:g,initialData:{name:s.name,status:"disconnected",config:_?{command:_.command||"",args:_.args||[],env:_.env||{}}:void 0}})}),b&&t.jsx("div",{className:"fixed inset-0 bg-black/50 z-[60] flex items-center justify-center p-4",children:t.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-md",children:[t.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:d("server.confirmVariables")}),t.jsx("p",{className:"text-gray-600 mb-4",children:d("server.variablesDetected")}),t.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded p-3 mb-4",children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"flex-shrink-0",children:t.jsx("svg",{className:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor",children:t.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"})})}),t.jsxs("div",{className:"ml-3",children:[t.jsxs("h4",{className:"text-sm font-medium text-yellow-800",children:[d("server.detectedVariables"),":"]}),t.jsx("ul",{className:"mt-1 text-sm text-yellow-700",children:S.map((G,I)=>t.jsxs("li",{className:"font-mono",children:["$",`{${G}}`]},I))})]})]})}),t.jsx("p",{className:"text-gray-600 text-sm mb-6",children:d("market.confirmVariablesMessage")}),t.jsxs("div",{className:"flex justify-end space-x-3",children:[t.jsx("button",{onClick:()=>{y(!1),N(null)},className:"px-4 py-2 text-gray-600 border border-gray-300 rounded hover:bg-gray-50 btn-secondary",children:d("common.cancel")}),t.jsx("button",{onClick:E,className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 btn-primary",children:d("market.confirmAndInstall")})]})]})})]})},tN=({server:s,onClick:n})=>{const{t:l}=ve(),o=()=>{n(s)},c=()=>{if(s.description&&s.description.length<=150)return s.description;if(s.content){const f=s.content.split(`
322
- `).filter(g=>g.trim());for(const g of f)if(g.length>50&&g.length<=150)return g}return s.description?s.description.slice(0,150)+"...":l("cloud.noDescription")},d=f=>{try{const g=new Date(f),h=g.getFullYear(),b=(g.getMonth()+1).toString().padStart(2,"0"),y=g.getDate().toString().padStart(2,"0");return`${h}/${b}/${y}`}catch{return""}},m=f=>f.split(" ").map(g=>g.charAt(0)).join("").toUpperCase().slice(0,2);return t.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:[t.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"}),t.jsxs("div",{className:"relative z-10 flex-1 flex flex-col",children:[t.jsxs("div",{className:"flex items-start justify-between mb-3",children:[t.jsxs("div",{className:"flex-1",children:[t.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:s.title||s.name}),t.jsxs("div",{className:"flex items-center space-x-2 mb-2",children:[t.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(s.author_name)}),t.jsxs("div",{children:[t.jsx("p",{className:"text-sm font-medium text-gray-700",children:s.author_name}),s.updated_at&&t.jsxs("p",{className:"text-xs text-gray-500",children:[l("cloud.updated")," ",d(s.updated_at)]})]})]})]}),t.jsx("div",{className:"flex flex-col items-end space-y-2",children:t.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"})})]}),t.jsx("div",{className:"mb-3 flex-1",children:t.jsx("p",{className:"text-gray-600 text-sm leading-relaxed line-clamp-2",children:c()})}),s.tools&&s.tools.length>0&&t.jsx("div",{className:"mb-3",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsxs("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[t.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"}),t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),t.jsxs("span",{className:"text-sm text-gray-600 font-medium",children:[s.tools.length," ",s.tools.length===1?l("cloud.tool"):l("cloud.tools")]})]})}),t.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-gray-100 mt-auto",children:[t.jsxs("div",{className:"flex items-center space-x-2 text-xs text-gray-500",children:[t.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:t.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"})}),t.jsx("span",{children:d(s.created_at)})]}),t.jsxs("div",{className:"flex items-center text-blue-600 text-sm font-medium group-hover:text-blue-700 transition-colors",children:[t.jsx("span",{children:l("cloud.viewDetails")}),t.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:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]})]})},md=()=>{const{t:s}=ve(),n=ls(),l=()=>{n("/settings")},o=()=>{window.open("https://mcprouter.co","_blank","noopener,noreferrer")};return t.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-6 mb-6",children:t.jsxs("div",{className:"flex items-start",children:[t.jsx("div",{className:"flex-shrink-0",children:t.jsx("svg",{className:"h-5 w-5 text-amber-400",viewBox:"0 0 20 20",fill:"currentColor",children:t.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"})})}),t.jsxs("div",{className:"ml-3 flex-1",children:[t.jsx("h3",{className:"text-sm font-medium text-amber-800",children:s("cloud.apiKeyNotConfigured")}),t.jsx("div",{className:"mt-2 text-sm text-amber-700",children:t.jsx("p",{children:s("cloud.apiKeyNotConfiguredDescription")})}),t.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[t.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:[t.jsx("svg",{className:"w-4 h-4 mr-1.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.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"})}),s("cloud.getApiKey")]}),t.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:[t.jsxs("svg",{className:"w-4 h-4 mr-1.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[t.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"}),t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),s("cloud.configureInSettings")]})]})]})]})})},rN=({serverName:s,onBack:n,onCallTool:l,fetchServerTools:o,onInstall:c,installing:d=!1,isInstalled:m=!1})=>{const{t:f}=ve(),{mcpRouterConfig:g}=Ta(),[h,b]=x.useState(null),[y,w]=x.useState(!0),[N,S]=x.useState(null),[j,C]=x.useState([]),[z,E]=x.useState(!1),[T,B]=x.useState(!1),[D,Y]=x.useState(null),[R,_]=x.useState({}),[P,V]=x.useState({}),[K,G]=x.useState({}),[I,L]=x.useState(!1),[Z,A]=x.useState(null),H=X=>(console.error("Checking for MCPRouter API key error:",X),X==="MCPROUTER_API_KEY_NOT_CONFIGURED"||X.toLowerCase().includes("mcprouter api key not configured")),J=()=>m?{className:"bg-green-600 cursor-default px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:f("market.installed")}:d?{className:"bg-gray-400 cursor-not-allowed px-4 py-2 rounded text-sm font-medium text-white",disabled:!0,text:f("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:f("market.install")},me=()=>{!m&&c&&(L(!0),A(null))},le=()=>{L(!1),A(null)},k=async X=>{try{if(!h||!c)return;A(null),c(h,X.config),L(!1)}catch(he){console.error("Error installing server:",he),A(f("errors.serverInstall"))}};x.useEffect(()=>{(async()=>{try{w(!0),S(null);const he=await Be(`/cloud/servers/${s}`);he&&he.success&&he.data?(b(he.data),C(he.data.tools||[])):S(f("cloud.serverNotFound"))}catch(he){console.error("Failed to load server details:",he),S(he instanceof Error?he.message:String(he))}finally{w(!1)}})()},[s,f]),x.useEffect(()=>{(async()=>{if(h&&(!h.tools||h.tools.length===0)&&o){E(!0),B(!1);try{const he=await o(h.name);C(he)}catch(he){console.error("Failed to load tools:",he);const ae=he instanceof Error?he.message:String(he);H(ae)&&B(!0)}finally{E(!1)}}})()},[h==null?void 0:h.name,h==null?void 0:h.tools,o]);const U=X=>{try{const he=new Date(X),ae=he.getFullYear(),ye=String(he.getMonth()+1).padStart(2,"0"),ie=String(he.getDate()).padStart(2,"0"),se=String(he.getHours()).padStart(2,"0"),be=String(he.getMinutes()).padStart(2,"0"),Ne=String(he.getSeconds()).padStart(2,"0");return`${ae}-${ye}-${ie} ${se}:${be}:${Ne}`}catch{return X}},M=(X,he,ae)=>{V(ye=>({...ye,[X]:{...ye[X],[he]:ae}}))},q=async X=>{if(!(!l||!h)){Y(X);try{const he=P[X]||{},ae=await l(h.server_key,X,he);_(ye=>({...ye,[X]:ae}))}catch(he){console.error("Tool call failed:",he);const ae=he instanceof Error?he.message:String(he);_(ye=>({...ye,[X]:{error:ae}}))}finally{Y(null)}}},de=X=>{G(he=>({...he,[X]:!he[X]}))},ee=(X,he,ae)=>{var se;const ye=((se=P[X.name])==null?void 0:se[he])||"",ie=be=>{let Ne=be.target.value;ae.type==="number"||ae.type==="integer"?Ne=Ne===""?void 0:Number(Ne):ae.type==="boolean"&&(Ne=be.target.value==="true"),M(X.name,he,Ne)};return ae.type==="boolean"?t.jsxs("select",{value:ye===!0?"true":ye===!1?"false":"",onChange:ie,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:[t.jsx("option",{value:""}),t.jsx("option",{value:"true",children:f("common.true")}),t.jsx("option",{value:"false",children:f("common.false")})]}):ae.type==="number"||ae.type==="integer"?t.jsx("input",{type:"number",step:ae.type==="integer"?"1":"any",value:ye||"",onChange:ie,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"}):t.jsx("input",{type:"text",value:ye||"",onChange:ie,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 t.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6",children:[t.jsx("div",{className:"mb-6",children:t.jsxs("button",{onClick:n,className:"inline-flex items-center text-gray-600 hover:text-gray-900 transition-colors group",children:[t.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:t.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"})}),f("cloud.backToList")]})}),y?t.jsx("div",{className:"bg-white rounded-xl shadow-sm p-12",children:t.jsxs("div",{className:"flex flex-col items-center",children:[t.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:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.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"})]}),t.jsx("p",{className:"text-gray-600 text-lg",children:f("app.loading")})]})}):N&&!H(N)?t.jsx("div",{className:"bg-white rounded-xl shadow-sm p-6",children:t.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("svg",{className:"h-5 w-5 text-red-400 mr-3",fill:"currentColor",viewBox:"0 0 20 20",children:t.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"})}),t.jsx("p",{className:"text-red-700",children:N})]})})}):h?t.jsxs("div",{className:"space-y-6",children:[t.jsx("div",{className:"bg-white rounded-xl shadow-sm overflow-hidden",children:t.jsx("div",{className:"bg-gradient-to-r from-gray-100 to-gray-200 px-6 py-4",children:t.jsxs("div",{className:"flex justify-between items-end",children:[t.jsxs("div",{className:"flex-1",children:[t.jsx("h1",{className:"text-2xl font-bold text-gray-800 mb-2",children:h.title||h.name}),t.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-gray-600",children:[t.jsx("span",{className:"text-sm bg-white/60 text-gray-700 px-3 py-1 rounded-full",children:h.name}),t.jsxs("div",{className:"flex items-center",children:[t.jsx("svg",{className:"h-4 w-4 mr-1",fill:"currentColor",viewBox:"0 0 20 20",children:t.jsx("path",{fillRule:"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",clipRule:"evenodd"})}),f("cloud.by")," ",h.author_name]})]})]}),t.jsxs("div",{className:"text-right flex flex-col items-end gap-3",children:[t.jsxs("div",{className:"text-xs text-gray-500",children:[f("cloud.updated"),": ",U(h.updated_at)]}),c&&!H(N||"")&&!T&&t.jsx("button",{onClick:me,disabled:J().disabled,className:J().className,children:J().text})]})]})})}),t.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6",children:[t.jsxs("h2",{className:"text-xl font-semibold text-gray-900 mb-4 flex items-center",children:[t.jsx("svg",{className:"h-5 w-5 text-gray-500 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.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"})}),f("cloud.description")]}),t.jsx("p",{className:"text-gray-700 leading-relaxed",children:h.description})]}),h.content&&t.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6",children:[t.jsxs("h2",{className:"text-xl font-semibold text-gray-900 mb-4 flex items-center",children:[t.jsx("svg",{className:"h-5 w-5 text-gray-500 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.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"})}),f("cloud.details")]}),t.jsx("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4 overflow-auto",children:t.jsx("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap",children:h.content})})]}),t.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6",children:[t.jsxs("h2",{className:"text-xl font-semibold text-gray-900 mb-4 flex items-center",children:[t.jsxs("svg",{className:"h-5 w-5 text-gray-500 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[t.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"}),t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),f("cloud.tools"),j.length>0&&t.jsx("span",{className:"ml-2 bg-blue-100 text-blue-800 text-sm font-medium px-2.5 py-0.5 rounded-full",children:j.length})]}),T&&t.jsx(md,{}),z?t.jsxs("div",{className:"flex items-center justify-center py-12",children:[t.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:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.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"})]}),t.jsx("span",{className:"text-gray-600",children:f("cloud.loadingTools")})]}):j.length===0&&!T?t.jsxs("div",{className:"text-center py-12",children:[t.jsx("svg",{className:"h-12 w-12 text-gray-400 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.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"})}),t.jsx("p",{className:"text-gray-600",children:f("cloud.noTools")})]}):j.length>0?t.jsx("div",{className:"space-y-4",children:j.map((X,he)=>t.jsxs("div",{className:"border border-gray-200 rounded-lg p-6 hover:border-gray-300 transition-colors",children:[t.jsxs("div",{className:"flex justify-between items-start mb-4",children:[t.jsxs("div",{className:"flex-1",children:[t.jsxs("h3",{className:"text-lg font-medium text-gray-900 mb-2 flex items-center",children:[t.jsx("span",{className:"bg-blue-100 text-blue-800 text-xs font-medium px-2 py-1 rounded mr-3",children:"TOOL"}),X.name]}),t.jsx("p",{className:"text-gray-600 leading-relaxed whitespace-pre-wrap",children:X.description})]}),l&&t.jsx("button",{onClick:()=>q(X.name),disabled:D===X.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:D===X.name?t.jsxs(t.Fragment,{children:[t.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:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.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"})]}),f("cloud.calling")]}):t.jsxs(t.Fragment,{children:[t.jsx("svg",{className:"h-4 w-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.828 14.828a4 4 0 01-5.656 0M9 10h6m2 8l4-4H7l4 4z"})}),f("cloud.callTool")]})})]}),X.inputSchema&&X.inputSchema.properties&&Object.keys(X.inputSchema.properties).length>0&&t.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[t.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[t.jsx("h4",{className:"text-sm font-medium text-gray-700",children:f("cloud.parameters")}),t.jsxs("button",{onClick:()=>de(X.name),className:"text-sm text-blue-600 hover:text-blue-800 focus:outline-none flex items-center gap-1 transition-colors",children:[f("cloud.viewSchema"),t.jsx("svg",{className:`h-3 w-3 transition-transform duration-200 ${K[X.name]?"rotate-90":"rotate-0"}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:t.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[X.name]&&t.jsx("div",{className:"mb-4",children:t.jsx("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-3 overflow-auto",children:t.jsx("pre",{className:"text-sm text-gray-800",children:JSON.stringify(X.inputSchema,null,2)})})}),t.jsx("div",{className:"space-y-4",children:Object.entries(X.inputSchema.properties).map(([ae,ye])=>{var ie;return t.jsxs("div",{className:"space-y-2",children:[t.jsxs("label",{className:"block text-sm font-medium text-gray-700",children:[ae,((ie=X.inputSchema.required)==null?void 0:ie.includes(ae))&&t.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),ye.description&&t.jsx("p",{className:"text-xs text-gray-500",children:ye.description}),ee(X,ae,ye)]},ae)})})]}),R[X.name]&&t.jsx("div",{className:"border-t border-gray-100 pt-4 mt-4",children:R[X.name].error?t.jsx(t.Fragment,{children:H(R[X.name].error)?t.jsx(md,{}):t.jsxs(t.Fragment,{children:[t.jsxs("h4",{className:"text-sm font-medium text-red-600 mb-3 flex items-center",children:[t.jsx("svg",{className:"h-4 w-4 text-red-500 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:t.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"})}),f("cloud.error")]}),t.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:t.jsx("pre",{className:"text-sm text-red-800 whitespace-pre-wrap overflow-auto",children:R[X.name].error})})]})}):t.jsxs(t.Fragment,{children:[t.jsxs("h4",{className:"text-sm font-medium text-gray-700 mb-3 flex items-center",children:[t.jsx("svg",{className:"h-4 w-4 text-green-500 mr-2",fill:"currentColor",viewBox:"0 0 20 20",children:t.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"})}),f("cloud.result")]}),t.jsx("div",{className:"bg-gray-50 border border-gray-200 rounded-lg p-4",children:t.jsx("pre",{className:"text-sm text-gray-800 whitespace-pre-wrap overflow-auto",children:JSON.stringify(R[X.name],null,2)})})]})})]},he))}):null]})]}):t.jsx("div",{className:"bg-white rounded-xl shadow-sm p-12",children:t.jsxs("div",{className:"text-center",children:[t.jsx("svg",{className:"h-12 w-12 text-gray-400 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.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"})}),t.jsx("p",{className:"text-gray-600 text-lg",children:f("cloud.serverNotFound")})]})}),I&&h&&t.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:t.jsx(Dl,{onSubmit:k,onCancel:le,modalTitle:f("cloud.installServer",{name:h.title||h.name}),formError:Z,initialData:{name:h.name,status:"disconnected",config:{type:"streamable-http",url:h.server_url,headers:{Authorization:`Bearer ${g.apiKey||"<MCPROUTER_API_KEY>"}`,"HTTP-Referer":g.referer||"<YOUR_APP_URL>","X-Title":g.title||"<YOUR_APP_NAME>"}}}})})]})},sN=({serverEntry:s,onClick:n})=>{var z,E;const{t:l}=ve(),{server:o,_meta:c}=s,d=()=>{n(s)},m=()=>o.description&&o.description.length<=150?o.description:o.description?o.description.slice(0,150)+"...":l("registry.noDescription"),f=T=>{if(!T)return"";try{const B=new Date(T),D=B.getFullYear(),Y=(B.getMonth()+1).toString().padStart(2,"0"),R=B.getDate().toString().padStart(2,"0");return`${D}/${Y}/${R}`}catch{return""}},h=o.icons&&o.icons.length>0?o.icons.find(B=>!B.theme||B.theme==="light")||o.icons[0]:null,b=c==null?void 0:c["io.modelcontextprotocol.registry/official"],y=b==null?void 0:b.isLatest,w=b==null?void 0:b.publishedAt,N=b==null?void 0:b.updatedAt,S=((z=o.packages)==null?void 0:z.length)||0,j=((E=o.remotes)==null?void 0:E.length)||0,C=S+j;return t.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:[t.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"}),t.jsxs("div",{className:"relative z-10 flex-1 flex flex-col",children:[t.jsx("div",{className:"flex items-start justify-between mb-3",children:t.jsxs("div",{className:"flex items-start space-x-3 flex-1",children:[h?t.jsx("img",{src:h.src,alt:o.title,className:"w-12 h-12 rounded-lg object-cover flex-shrink-0",onError:T=>{T.currentTarget.style.display="none"}}):t.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"}),t.jsxs("div",{className:"flex-1 min-w-0",children:[t.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}),t.jsxs("div",{className:"flex flex-wrap gap-1 mb-1",children:[y&&t.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")}),t.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]})]})]})]})}),t.jsx("div",{className:"mb-3 flex-1",children:t.jsx("p",{className:"text-gray-600 text-sm leading-relaxed line-clamp-3",children:m()})}),C>0&&t.jsx("div",{className:"mb-3",children:t.jsxs("div",{className:"flex items-center space-x-4",children:[S>0&&t.jsxs("div",{className:"flex items-center space-x-1",children:[t.jsx("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.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"})}),t.jsxs("span",{className:"text-sm text-gray-600",children:[S," ",l(S===1?"registry.package":"registry.packages")]})]}),j>0&&t.jsxs("div",{className:"flex items-center space-x-1",children:[t.jsx("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.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"})}),t.jsxs("span",{className:"text-sm text-gray-600",children:[j," ",l(j===1?"registry.remote":"registry.remotes")]})]})]})}),t.jsxs("div",{className:"flex items-center justify-between pt-3 border-t border-gray-100 mt-auto",children:[t.jsx("div",{className:"flex items-center space-x-2 text-xs text-gray-500",children:(w||N)&&t.jsxs(t.Fragment,{children:[t.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:t.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"})}),t.jsx("span",{children:f(N||w)})]})}),t.jsxs("div",{className:"flex items-center text-blue-600 text-sm font-medium group-hover:text-blue-700 transition-colors",children:[t.jsx("span",{children:l("registry.viewDetails")}),t.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:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]})]})},aN=({serverEntry:s,onBack:n,onInstall:l,installing:o=!1,isInstalled:c=!1,fetchVersions:d})=>{const{t:m}=ve(),{server:f,_meta:g}=s,[h,b]=x.useState(f.version),[y,w]=x.useState([]),[N,S]=x.useState(!1),[j,C]=x.useState(!1),[z,E]=x.useState(null),[T,B]=x.useState(null),[D,Y]=x.useState(null),[R,_]=x.useState({packages:!0,remotes:!0,repository:!0}),P=g==null?void 0:g["io.modelcontextprotocol.registry/official"];x.useEffect(()=>{(async()=>{if(d){S(!0);try{const k=await d(f.name);w(k)}catch(k){console.error("Failed to load versions:",k)}finally{S(!1)}}})()},[f.name,d]);const K=f.icons&&f.icons.length>0?f.icons.find(k=>!k.theme||k.theme==="light")||f.icons[0]:null,G=le=>{if(!le)return"";try{return new Date(le).toLocaleDateString()}catch{return""}},I=le=>{_(k=>({...k,[le]:!k[le]}))},L=(le,k)=>{E(le),B(k),Y(null),C(!0)},Z=()=>{C(!1),Y(null)},A=async le=>{try{if(!l||!T||!z)return;Y(null);const k=le.config;l(f,k),C(!1)}catch(k){console.error("Error installing server:",k),Y(m("errors.serverInstall"))}},H=()=>{if(!T||!z)return null;if(console.log("Building initial form data for:",T),z==="package"&&"identifier"in T){const le=T,k={};le.environmentVariables&&le.environmentVariables.forEach(M=>{k[M.name]=M.default||""});const U=nN(le.registryType);return{name:f.name,status:"disconnected",config:{type:"stdio",command:U,args:lN(U,le),env:Object.keys(k).length>0?k:void 0}}}else if(z==="remote"&&"url"in T){const le=T,k={};le.headers&&le.headers.forEach(M=>{k[M.name]=M.default||M.value||""});const U=le.type==="sse"?"sse":"streamable-http";return{name:f.name,status:"disconnected",config:{type:U,url:le.url,headers:Object.keys(k).length>0?k:void 0}}}return null},J=(le,k)=>t.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 mb-3 hover:border-blue-400 transition-colors",children:[t.jsxs("div",{className:"flex items-start justify-between mb-3",children:[t.jsxs("div",{className:"flex-1",children:[t.jsx("h4",{className:"font-medium text-gray-900",children:le.identifier}),le.version&&t.jsxs("p",{className:"text-sm text-gray-500",children:["Version: ",le.version]}),le.runtimeHint&&t.jsx("p",{className:"text-sm text-gray-600 mt-1",children:le.runtimeHint})]}),t.jsx("button",{onClick:()=>L("package",le),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")})]}),le.registryType&&t.jsxs("div",{className:"text-sm text-gray-600 mb-2",children:[t.jsx("span",{className:"font-medium",children:"Registry:"})," ",le.registryType]}),le.transport&&t.jsxs("div",{className:"text-sm text-gray-600 mb-2",children:[t.jsx("span",{className:"font-medium",children:"Transport:"})," ",le.transport.type,le.transport.url&&t.jsxs("span",{className:"ml-2 text-gray-500",children:["(",le.transport.url,")"]})]}),le.environmentVariables&&le.environmentVariables.length>0&&t.jsxs("div",{className:"mt-3 border-t border-gray-200 pt-3",children:[t.jsxs("h5",{className:"text-sm font-medium text-gray-700 mb-2",children:[m("registry.environmentVariables"),":"]}),t.jsx("div",{className:"space-y-2",children:le.environmentVariables.map((U,M)=>t.jsxs("div",{className:"text-sm",children:[t.jsxs("div",{className:"flex items-start",children:[t.jsx("span",{className:"font-mono text-gray-900 font-medium",children:U.name}),U.isRequired&&t.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")}),U.isSecret&&t.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")})]}),U.description&&t.jsx("p",{className:"text-gray-600 mt-1",children:U.description}),U.default&&t.jsxs("p",{className:"text-gray-500 mt-1",children:[t.jsxs("span",{className:"font-medium",children:[m("common.default"),":"]})," ",t.jsx("span",{className:"font-mono",children:U.default})]})]},M))})]}),le.packageArguments&&le.packageArguments.length>0&&t.jsxs("div",{className:"mt-3 border-t border-gray-200 pt-3",children:[t.jsxs("h5",{className:"text-sm font-medium text-gray-700 mb-2",children:[m("registry.packageArguments"),":"]}),t.jsx("div",{className:"space-y-2",children:le.packageArguments.map((U,M)=>t.jsxs("div",{className:"text-sm",children:[t.jsxs("div",{className:"flex items-start",children:[t.jsx("span",{className:"font-mono text-gray-900 font-medium",children:U.name}),U.isRequired&&t.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")}),U.isSecret&&t.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")}),U.isRepeated&&t.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")})]}),U.description&&t.jsx("p",{className:"text-gray-600 mt-1",children:U.description}),U.type&&t.jsxs("p",{className:"text-gray-500 mt-1",children:[t.jsxs("span",{className:"font-medium",children:[m("common.type"),":"]})," ",t.jsx("span",{className:"font-mono",children:U.type})]}),U.default&&t.jsxs("p",{className:"text-gray-500 mt-1",children:[t.jsxs("span",{className:"font-medium",children:[m("common.default"),":"]})," ",t.jsx("span",{className:"font-mono",children:U.default})]}),U.value&&t.jsxs("p",{className:"text-gray-500 mt-1",children:[t.jsxs("span",{className:"font-medium",children:[m("common.value"),":"]})," ",t.jsx("span",{className:"font-mono",children:U.value})]}),U.valueHint&&t.jsxs("p",{className:"text-gray-500 mt-1",children:[t.jsxs("span",{className:"font-medium",children:[m("common.valueHint"),":"]})," ",t.jsx("span",{className:"font-mono",children:U.valueHint})]}),U.choices&&U.choices.length>0&&t.jsxs("p",{className:"text-gray-500 mt-1",children:[t.jsxs("span",{className:"font-medium",children:[m("common.choices"),":"]})," ",t.jsx("span",{className:"font-mono",children:U.choices.join(", ")})]})]},M))})]})]},k),me=(le,k)=>t.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 mb-3 hover:border-blue-400 transition-colors",children:[t.jsxs("div",{className:"flex items-start justify-between mb-3",children:[t.jsxs("div",{className:"flex-1",children:[t.jsx("h4",{className:"font-medium text-gray-900",children:le.type}),t.jsx("p",{className:"text-sm text-gray-600 mt-1 break-all",children:le.url})]}),t.jsx("button",{onClick:()=>L("remote",le),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")})]}),le.headers&&le.headers.length>0&&t.jsxs("div",{className:"mt-3 border-t border-gray-200 pt-3",children:[t.jsxs("h5",{className:"text-sm font-medium text-gray-700 mb-2",children:[m("registry.headers"),":"]}),t.jsx("div",{className:"space-y-2",children:le.headers.map((U,M)=>t.jsxs("div",{className:"text-sm",children:[t.jsxs("div",{className:"flex items-start",children:[t.jsx("span",{className:"font-mono text-gray-900 font-medium",children:U.name}),U.isRequired&&t.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")}),U.isSecret&&t.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")})]}),U.description&&t.jsx("p",{className:"text-gray-600 mt-1",children:U.description}),U.value&&t.jsxs("p",{className:"text-gray-500 mt-1",children:[t.jsxs("span",{className:"font-medium",children:[m("common.value"),":"]})," ",t.jsx("span",{className:"font-mono",children:U.value})]}),U.default&&t.jsxs("p",{className:"text-gray-500 mt-1",children:[t.jsxs("span",{className:"font-medium",children:[m("common.default"),":"]})," ",t.jsx("span",{className:"font-mono",children:U.default})]})]},M))})]})]},k);return t.jsxs("div",{className:"bg-white shadow rounded-lg p-6",children:[t.jsxs("div",{className:"mb-6",children:[t.jsxs("button",{onClick:n,className:"flex items-center text-blue-600 hover:text-blue-800 mb-4 transition-colors",children:[t.jsx("svg",{className:"w-5 h-5 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),m("registry.backToList")]}),t.jsxs("div",{className:"flex items-start space-x-4",children:[K?t.jsx("img",{src:K.src,alt:f.title,className:"w-20 h-20 rounded-lg object-cover flex-shrink-0",onError:le=>{le.currentTarget.style.display="none"}}):t.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"}),t.jsxs("div",{className:"flex-1",children:[t.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:f.name}),t.jsxs("div",{className:"flex flex-wrap gap-2 mb-3",children:[(P==null?void 0:P.isLatest)&&t.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")}),t.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",f.version]}),(P==null?void 0:P.status)&&t.jsx("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-gray-100 text-gray-800",children:P.status}),t.jsxs("span",{className:"flex flex-wrap items-center gap-4 text-sm text-gray-600",children:[(P==null?void 0:P.publishedAt)&&t.jsxs("div",{children:[t.jsxs("span",{className:"font-medium",children:[m("registry.published"),":"]})," ",G(P.publishedAt)]}),(P==null?void 0:P.updatedAt)&&t.jsxs("div",{children:[t.jsxs("span",{className:"font-medium",children:[m("registry.updated"),":"]})," ",G(P.updatedAt)]})]})]})]})]})]}),t.jsxs("div",{className:"mb-6",children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-3",children:m("registry.description")}),t.jsx("p",{className:"text-gray-700 leading-relaxed whitespace-pre-wrap",children:f.description})]}),f.websiteUrl&&t.jsxs("div",{className:"mb-6",children:[t.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-3",children:m("registry.website")}),t.jsx("a",{href:f.websiteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 hover:underline",children:f.websiteUrl})]}),f.packages&&f.packages.length>0&&t.jsxs("div",{className:"mb-6",children:[t.jsxs("button",{onClick:()=>I("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:[t.jsxs("span",{children:[m("registry.packages")," (",f.packages.length,")"]}),t.jsx("svg",{className:`w-5 h-5 transform transition-transform ${R.packages?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),R.packages&&t.jsx("div",{className:"space-y-3",children:f.packages.map(J)})]}),f.remotes&&f.remotes.length>0&&t.jsxs("div",{className:"mb-6",children:[t.jsxs("button",{onClick:()=>I("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:[t.jsxs("span",{children:[m("registry.remotes")," (",f.remotes.length,")"]}),t.jsx("svg",{className:`w-5 h-5 transform transition-transform ${R.remotes?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),R.remotes&&t.jsx("div",{className:"space-y-3",children:f.remotes.map(me)})]}),f.repository&&t.jsxs("div",{className:"mb-6",children:[t.jsxs("button",{onClick:()=>I("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:[t.jsx("span",{children:m("registry.repository")}),t.jsx("svg",{className:`w-5 h-5 transform transition-transform ${R.repository?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),R.repository&&t.jsxs("div",{className:"border border-gray-200 rounded-lg p-4",children:[f.repository.url&&t.jsxs("div",{className:"mb-2",children:[t.jsx("span",{className:"font-medium text-gray-700",children:"URL:"})," ",t.jsx("a",{href:f.repository.url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-800 hover:underline break-all",children:f.repository.url})]}),f.repository.source&&t.jsxs("div",{className:"mb-2",children:[t.jsx("span",{className:"font-medium text-gray-700",children:"Source:"})," ",f.repository.source]}),f.repository.subfolder&&t.jsxs("div",{className:"mb-2",children:[t.jsx("span",{className:"font-medium text-gray-700",children:"Subfolder:"})," ",f.repository.subfolder]}),f.repository.id&&t.jsxs("div",{children:[t.jsx("span",{className:"font-medium text-gray-700",children:"ID:"})," ",f.repository.id]})]})]}),j&&T&&z&&t.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:t.jsx(Dl,{onSubmit:A,onCancel:Z,modalTitle:m("registry.installServer",{name:f.title||f.name}),formError:D,initialData:H()})})]})};function nN(s){switch(s.toLowerCase()){case"pypi":case"python":return"uvx";case"npm":case"node":return"npx";case"oci":case"docker":return"docker";default:return""}}function lN(s,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)}}),s.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 iN=({currentPage:s,hasNextPage:n,hasPreviousPage:l,onNextPage:o,onPreviousPage:c})=>t.jsxs("div",{className:"flex items-center justify-center space-x-2 my-6",children:[t.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:[t.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:t.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"]}),t.jsxs("span",{className:"px-4 py-2 bg-blue-500 text-white rounded btn-primary",children:["Page ",s]}),t.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",t.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:t.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"})})]})]}),dh=()=>{const{t:s}=ve(),n=ls(),{serverName:l}=Kh(),{showToast:o}=Ms(),[c,d]=r1(),m=c.get("tab")||"cloud",{servers:f,allServers:g,categories:h,loading:b,error:y,setError:w,searchServers:N,filterByCategory:S,filterByTag:j,selectedCategory:C,selectedTag:z,installServer:E,fetchServerByName:T,isServerInstalled:B,currentPage:D,totalPages:Y,changePage:R,serversPerPage:_,changeServersPerPage:P}=QS(),{servers:V,allServers:K,loading:G,error:I,setError:L,fetchServerTools:Z,callServerTool:A,currentPage:H,totalPages:J,changePage:me,serversPerPage:le,changeServersPerPage:k}=XS(),{servers:U,allServers:M,loading:q,error:de,setError:ee,searchServers:X,clearSearch:he,fetchServerByName:ae,fetchServerVersions:ye,currentPage:ie,totalPages:se,hasNextPage:be,hasPreviousPage:Ne,changePage:xe,goToNextPage:ke,goToPreviousPage:Se,serversPerPage:Le,changeServersPerPage:st}=ZS(),[ft,Mt]=x.useState(null),[Pt,Sr]=x.useState(null),[gt,Nr]=x.useState(null),[er,Qt]=x.useState(""),[ht,Re]=x.useState(""),[Oe,it]=x.useState(!1),[qt,Gt]=x.useState(new Set),[ot,_t]=x.useState(new Set);x.useEffect(()=>{(async()=>{if(l)if(m==="cloud"){const $e=V.find(mt=>mt.name===l);$e?Sr($e):n("/market?tab=cloud")}else if(m==="registry"){console.log("Loading registry server details for:",l);const $e=await ae(l);$e?Nr($e):n("/market?tab=registry")}else{const $e=await T(l);$e?Mt($e):n("/market?tab=local")}else Mt(null),Sr(null),Nr(null)})()},[l,m,V,T,ae,n]);const bt=Pe=>{const $e=new URLSearchParams(c);$e.set("tab",Pe),d($e),l&&n("/market?"+$e.toString())},Vr=Pe=>{Pe.preventDefault(),m==="local"?N(er):m==="registry"&&X(ht)},Ps=Pe=>{m==="local"&&S(Pe)},Ds=()=>{m==="local"?(Qt(""),S(""),j("")):m==="registry"&&(Re(""),he())},mr=Pe=>{var $e;if(m==="cloud")n(`/market/${Pe.name}?tab=cloud`);else if(m==="registry"){const mt=Pe;console.log("Registry server clicked:",mt);const ct=($e=mt.server)==null?void 0:$e.name;if(console.log("Server name extracted:",ct),ct){const Dt=`/market/${encodeURIComponent(ct)}?tab=registry`;console.log("Navigating to:",Dt),n(Dt)}else console.error("Server name is undefined in registry server:",mt)}else n(`/market/${Pe.name}?tab=local`)},sr=()=>{n(`/market?tab=${m}`)},_r=async(Pe,$e)=>{try{it(!0),await E(Pe,$e)&&o(s("market.installSuccess",{serverName:Pe.display_name}),"success")}finally{it(!1)}},ar=async(Pe,$e)=>{try{it(!0);const mt={name:Pe.name,config:$e},ct=await pt("/servers",mt);if(!ct.success){const Dt=(ct==null?void 0:ct.message)||s("server.addError");o(Dt,"error");return}Gt(Dt=>new Set(Dt).add(Pe.name)),o(s("cloud.installSuccess",{name:Pe.title||Pe.name}),"success")}catch(mt){console.error("Error installing cloud server:",mt);const ct=mt instanceof Error?mt.message:String(mt);o(s("cloud.installError",{error:ct}),"error")}finally{it(!1)}},Br=async(Pe,$e)=>{try{it(!0);const mt={name:Pe.name,config:$e},ct=await pt("/servers",mt);if(!ct.success){const Dt=(ct==null?void 0:ct.message)||s("server.addError");o(Dt,"error");return}_t(Dt=>new Set(Dt).add(Pe.name)),o(s("registry.installSuccess",{name:Pe.title||Pe.name}),"success")}catch(mt){console.error("Error installing registry server:",mt);const ct=mt instanceof Error?mt.message:String(mt);o(s("registry.installError",{error:ct}),"error")}finally{it(!1)}},Q=async(Pe,$e,mt)=>{try{const ct=await A(Pe,$e,mt);return o(s("cloud.toolCallSuccess",{toolName:$e}),"success"),ct}catch(ct){const Dt=ct instanceof Error?ct.message:String(ct);throw je(Dt)||o(s("cloud.toolCallError",{toolName:$e,error:Dt}),"error"),ct}},je=Pe=>Pe==="MCPROUTER_API_KEY_NOT_CONFIGURED"||Pe.toLowerCase().includes("mcprouter api key not configured"),He=Pe=>{m==="local"?R(Pe):m==="registry"?xe(Pe):me(Pe),window.scrollTo({top:0,behavior:"smooth"})},jt=Pe=>{const $e=parseInt(Pe.target.value,10);m==="local"?P($e):m==="registry"?st($e):k($e)};if(ft)return t.jsx(eN,{server:ft,onBack:sr,onInstall:_r,installing:Oe,isInstalled:B(ft.name)});if(Pt)return t.jsx(rN,{serverName:Pt.name,onBack:sr,onCallTool:Q,fetchServerTools:Z,onInstall:ar,installing:Oe,isInstalled:qt.has(Pt.name)});if(gt)return t.jsx(aN,{serverEntry:gt,onBack:sr,onInstall:Br,installing:Oe,isInstalled:ot.has(gt.server.name),fetchVersions:ye});const Je=m==="local",We=m==="registry",pr=Je?f:We?U:V,tr=Je?g:We?M:K,ge=Je?h:[],oe=Je?b:We?q:G,we=Je?y:We?de:I,$r=Je?w:We?ee:L,Oa=Je?C:"",Yr=Je?z:"",dt=Je?D:We?ie:H,Xt=Je?Y:We?se:J,nr=Je?_:We?Le:le;return t.jsxs("div",{children:[t.jsx("div",{className:"mb-6",children:t.jsx("div",{className:"border-b border-gray-200",children:t.jsxs("nav",{className:"-mb-px flex space-x-3",children:[t.jsxs("button",{onClick:()=>bt("cloud"),className:`py-2 px-1 border-b-2 font-medium text-lg hover:cursor-pointer transition-colors duration-200 ${!Je&&!We?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:[s("cloud.title"),t.jsxs("span",{className:"text-xs text-gray-400 font-normal ml-1",children:["(",t.jsx("a",{href:"https://mcprouter.co",target:"_blank",rel:"noopener noreferrer",className:"external-link",children:"MCPRouter"}),")"]})]}),t.jsxs("button",{onClick:()=>bt("local"),className:`py-2 px-1 border-b-2 font-medium text-lg hover:cursor-pointer transition-colors duration-200 ${Je?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:[s("market.title"),t.jsxs("span",{className:"text-xs text-gray-400 font-normal ml-1",children:["(",t.jsx("a",{href:"https://mcpm.sh",target:"_blank",rel:"noopener noreferrer",className:"external-link",children:"MCPM"}),")"]})]}),t.jsxs("button",{onClick:()=>bt("registry"),className:`py-2 px-1 border-b-2 font-medium text-lg hover:cursor-pointer transition-colors duration-200 ${We?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:[s("registry.title"),t.jsxs("span",{className:"text-xs text-gray-400 font-normal ml-1",children:["(",t.jsx("a",{href:"https://registry.modelcontextprotocol.io",target:"_blank",rel:"noopener noreferrer",className:"external-link",children:s("registry.official")}),")"]})]})]})})}),we&&t.jsx(t.Fragment,{children:!Je&&je(we)?t.jsx(md,{}):t.jsx("div",{className:"bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6 error-box rounded-lg",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("p",{children:we}),t.jsx("button",{onClick:()=>$r(null),className:"text-red-700 hover:text-red-900 transition-colors duration-200",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:t.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"})})})]})})}),(Je||We)&&t.jsx("div",{className:"bg-white shadow rounded-lg p-6 mb-6 page-card",children:t.jsxs("form",{onSubmit:Vr,className:"flex space-x-4 mb-0",children:[t.jsx("div",{className:"flex-grow",children:t.jsx("input",{type:"text",value:We?ht:er,onChange:Pe=>{We?Re(Pe.target.value):Qt(Pe.target.value)},placeholder:s(We?"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"})}),t.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:s(We?"registry.search":"market.search")}),(Je&&(er||Oa||Yr)||We&&ht)&&t.jsx("button",{type:"button",onClick:Ds,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:s(We?"registry.clearFilters":"market.clearFilters")})]})}),t.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[Je&&t.jsx("div",{className:"md:w-48 flex-shrink-0",children:t.jsx("div",{className:"bg-white shadow rounded-lg p-4 mb-6 sticky top-4 page-card",children:ge.length>0?t.jsxs("div",{className:"mb-6",children:[t.jsxs("div",{className:"flex justify-between items-center mb-3",children:[t.jsx("h3",{className:"font-medium text-gray-900",children:s("market.categories")}),Oa&&t.jsx("span",{className:"text-xs text-blue-600 cursor-pointer hover:underline transition-colors duration-200",onClick:()=>S(""),children:s("market.clearCategoryFilter")})]}),t.jsx("div",{className:"flex flex-col gap-2",children:ge.map(Pe=>t.jsx("button",{onClick:()=>Ps(Pe),className:`px-3 py-2 rounded text-sm text-left transition-all duration-200 ${Oa===Pe?"bg-blue-100 text-blue-800 font-medium btn-primary":"bg-gray-100 text-gray-800 hover:bg-gray-200 btn-secondary"}`,children:Pe},Pe))})]}):oe?t.jsxs("div",{className:"mb-6",children:[t.jsx("div",{className:"mb-3",children:t.jsx("h3",{className:"font-medium text-gray-900",children:s("market.categories")})}),t.jsxs("div",{className:"flex flex-col gap-2 items-center py-4 loading-container",children:[t.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:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.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"})]}),t.jsx("p",{className:"text-sm text-gray-600",children:s("app.loading")})]})]}):t.jsxs("div",{className:"mb-6",children:[t.jsx("div",{className:"mb-3",children:t.jsx("h3",{className:"font-medium text-gray-900",children:s("market.categories")})}),t.jsx("p",{className:"text-sm text-gray-600 py-2",children:s("market.noCategories")})]})})}),t.jsx("div",{className:"flex-grow",children:oe?t.jsx("div",{className:"bg-white shadow rounded-lg p-6 flex items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center",children:[t.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:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.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"})]}),t.jsx("p",{className:"text-gray-600",children:s("app.loading")})]})}):pr.length===0?t.jsx("div",{className:"bg-white shadow rounded-lg p-6",children:t.jsx("p",{className:"text-gray-600",children:s(Je?"market.noServers":We?"registry.noServers":"cloud.noServers")})}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3 gap-6",children:pr.map((Pe,$e)=>Je?t.jsx(WS,{server:Pe,onClick:mr},$e):We?t.jsx(sN,{serverEntry:Pe,onClick:mr},$e):t.jsx(tN,{server:Pe,onClick:mr},$e))}),t.jsxs("div",{className:"flex items-center mb-4",children:[t.jsx("div",{className:"flex-[2] text-sm text-gray-500",children:Je?s("market.showing",{from:(dt-1)*nr+1,to:Math.min(dt*nr,tr.length),total:tr.length}):We?s("registry.showing",{from:(dt-1)*nr+1,to:(dt-1)*nr+pr.length,total:tr.length+(be?"+":"")}):s("cloud.showing",{from:(dt-1)*nr+1,to:Math.min(dt*nr,tr.length),total:tr.length})}),t.jsx("div",{className:"flex-[4] flex justify-center",children:We?t.jsx(iN,{currentPage:dt,hasNextPage:be,hasPreviousPage:Ne,onNextPage:ke,onPreviousPage:Se}):t.jsx(Md,{currentPage:dt,totalPages:Xt,onPageChange:He})}),t.jsxs("div",{className:"flex-[2] flex items-center justify-end space-x-2",children:[t.jsxs("label",{htmlFor:"perPage",className:"text-sm text-gray-600",children:[s(Je?"market.perPage":We?"registry.perPage":"cloud.perPage"),":"]}),t.jsxs("select",{id:"perPage",value:nr,onChange:jt,className:"border rounded p-1 text-sm btn-secondary outline-none",children:[t.jsx("option",{value:"6",children:"6"}),t.jsx("option",{value:"9",children:"9"}),t.jsx("option",{value:"12",children:"12"}),t.jsx("option",{value:"24",children:"24"})]})]})]})]})})]})]})},oN={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"},cN={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 uN({variant:s="default",size:n="default",className:l,disabled:o,children:c,...d}){return t.jsx("button",{className:Rs("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",oN[s],cN[n],l),disabled:o,...d,children:c})}const dN=({logs:s,isLoading:n=!1,error:l=null,onClear:o})=>{const{t:c}=ve(),d=x.useRef(null),[m,f]=x.useState(!0),[g,h]=x.useState(""),[b,y]=x.useState(["info","error","warn","debug"]),[w,N]=x.useState(["main","child"]);x.useEffect(()=>{m&&d.current&&(d.current.scrollTop=d.current.scrollHeight)},[s,m]);const S=s.filter(E=>{const T=g?E.message.toLowerCase().includes(g.toLowerCase()):!0,B=b.includes(E.type),D=w.includes(E.source);return T&&B&&D}),j=E=>new Date(E).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),C=E=>{switch(E){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"}},z=E=>{switch(E){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 t.jsxs("div",{className:"flex flex-col h-full",children:[t.jsxs("div",{className:"bg-card p-3 rounded-t-md flex flex-wrap items-center justify-between gap-2",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsxs("span",{className:"font-semibold text-sm",children:[c("logs.filters"),":"]}),t.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:E=>h(E.target.value)}),t.jsx("div",{className:"flex gap-1 items-center",children:["debug","info","error","warn"].map(E=>t.jsx(ro,{variant:b.includes(E)?"default":"outline",className:`cursor-pointer ${b.includes(E)?C(E):""}`,onClick:()=>{b.includes(E)?y(T=>T.filter(B=>B!==E)):y(T=>[...T,E])},children:E},E))}),t.jsx("div",{className:"flex gap-1 items-center ml-2",children:["main","child"].map(E=>t.jsx(ro,{variant:w.includes(E)?"default":"outline",className:`cursor-pointer ${w.includes(E)?z(E):""}`,onClick:()=>{w.includes(E)?N(T=>T.filter(B=>B!==E)):N(T=>[...T,E])},children:c(E==="main"?"logs.mainProcess":"logs.childProcess")},E))})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("label",{className:"flex items-center gap-1 text-sm",children:[t.jsx("input",{type:"checkbox",checked:m,onChange:()=>f(!m),className:"form-checkbox h-4 w-4"}),c("logs.autoScroll")]}),t.jsx(uN,{variant:"outline",size:"sm",onClick:o,className:"btn-secondary",disabled:n||s.length===0,children:c("logs.clearLogs")})]})]}),t.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?t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx("span",{children:c("logs.loading")})}):l?t.jsx("div",{className:"text-red-500 p-2",children:l.message}):S.length===0?t.jsx("div",{className:"text-center text-muted-foreground p-8",children:g||b.length<4||w.length<2?c("logs.noMatch"):c("logs.noLogs")}):S.map((E,T)=>t.jsxs("div",{className:`py-1 ${E.type==="error"?"text-red-500":E.type==="warn"?"text-yellow-500":""}`,children:[t.jsxs("span",{className:"text-gray-400",children:["[",j(E.timestamp),"]"]}),t.jsx(ro,{className:`ml-2 mr-1 ${C(E.type)}`,children:E.type}),t.jsxs(ro,{variant:"default",className:`mr-2 ${z(E.source)}`,children:[E.source==="main"?c("logs.main"):c("logs.child"),E.processId?` (${E.processId})`:""]}),t.jsx("span",{className:"whitespace-pre-wrap",children:E.message})]},`${E.timestamp}-${T}`))})]})},mN=()=>{const{t:s}=ve(),{logs:n,loading:l,error:o,clearLogs:c}=Pj();return t.jsxs("div",{className:"container mx-auto p-4",children:[t.jsx("div",{className:"flex justify-between items-center mb-4",children:t.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:s("pages.logs.title")})}),t.jsx("div",{className:"bg-card rounded-md shadow-sm border border-gray-200 page-card",children:t.jsx(dN,{logs:n,isLoading:l,error:o,onClear:c})})]})},tx=["success","error"],pN=s=>tx.includes(s),fN=()=>{const{t:s}=ve(),[n,l]=x.useState([]),[o,c]=x.useState(null),[d,m]=x.useState(null),[f,g]=x.useState(null),[h,b]=x.useState(1),[y,w]=x.useState(10),[N,S]=x.useState(!0),[j,C]=x.useState(null),[z,E]=x.useState(null),[T,B]=x.useState(!1),[D,Y]=x.useState({}),[R,_]=x.useState(""),[P,V]=x.useState(""),[K,G]=x.useState(""),[I,L]=x.useState(""),[Z,A]=x.useState(""),H=x.useCallback(async()=>{S(!0),C(null);try{const ae={...D},[ye,ie,se]=await Promise.all([Xj(h,y,ae),Wj(ae),eS()]);ye!=null&&ye.success&&Array.isArray(ye.data)&&(l(ye.data),ye.pagination&&g(ye.pagination)),ie!=null&&ie.success&&ie.data&&c(ie.data),se!=null&&se.success&&se.data&&m(se.data)}catch(ae){console.error("Error fetching activity data:",ae),C(s("activity.fetchError"))}finally{S(!1)}},[h,y,D,s]);x.useEffect(()=>{H()},[H]),x.useEffect(()=>{if(!f)return;const ae=Math.max(1,f.totalPages||1);h>ae&&b(ae)},[f,h]);const J=async ae=>{try{const ye=await Zj(ae.id);ye!=null&&ye.success&&ye.data&&(E(ye.data),B(!0))}catch(ye){console.error("Error fetching activity details:",ye)}},me=async()=>{var ae;if(window.confirm(s("activity.confirmCleanup")))try{const ye=await tS(30);ye!=null&&ye.success&&(alert(s("activity.cleanupSuccess",{count:((ae=ye.data)==null?void 0:ae.deletedCount)||0})),H())}catch(ye){console.error("Error cleaning up activities:",ye),alert(s("activity.cleanupError"))}},le=()=>{const ae={};R&&(ae.server=R),P&&(ae.tool=P),K&&pN(K)&&(ae.status=K),I&&(ae.group=I),Z&&(ae.keyName=Z),Y(ae),b(1)},k=()=>{_(""),V(""),G(""),L(""),A(""),Y({}),b(1)},U=ae=>ae<1e3?`${ae}ms`:ae<6e4?`${(ae/1e3).toFixed(2)}s`:`${(ae/6e4).toFixed(2)}m`,M=ae=>new Date(ae).toLocaleString(),q=ae=>{if(!ae)return null;try{return JSON.parse(ae)}catch{return ae}},de=()=>o?t.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm px-4 py-3 mb-4",children:t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap",children:s("activity.totalCalls")}),t.jsx("div",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:o.totalCalls})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap",children:s("activity.successCount")}),t.jsx("div",{className:"text-lg font-semibold text-green-600",children:o.successCount})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap",children:s("activity.errorCount")}),t.jsx("div",{className:"text-lg font-semibold text-red-600",children:o.errorCount})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"text-sm text-gray-500 dark:text-gray-400 whitespace-nowrap",children:s("activity.avgDuration")}),t.jsx("div",{className:"text-lg font-semibold text-blue-600",children:U(o.avgDuration)})]})]})}):null,ee=()=>t.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm px-4 py-3 mb-4",children:t.jsxs("div",{className:"flex flex-wrap gap-3 items-end",children:[t.jsxs("div",{className:"flex-1 min-w-[140px]",children:[t.jsx("label",{className:"sr-only",htmlFor:"activity-server",children:s("activity.server")}),t.jsxs("div",{className:"relative",children:[t.jsx("input",{id:"activity-server",type:"text",value:R,onChange:ae=>_(ae.target.value),placeholder:s("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"}),R&&t.jsx("button",{onClick:()=>_(""),className:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300","aria-label":s("common.clear"),type:"button",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:t.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)&&t.jsx("datalist",{id:"server-options",children:d.servers.map(ae=>t.jsx("option",{value:ae},ae))})]}),t.jsxs("div",{className:"flex-1 min-w-[140px]",children:[t.jsx("label",{className:"sr-only",htmlFor:"activity-tool",children:s("activity.tool")}),t.jsxs("div",{className:"relative",children:[t.jsx("input",{id:"activity-tool",type:"text",value:P,onChange:ae=>V(ae.target.value),placeholder:s("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"}),P&&t.jsx("button",{onClick:()=>V(""),className:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300","aria-label":s("common.clear"),type:"button",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:t.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)&&t.jsx("datalist",{id:"tool-options",children:d.tools.map(ae=>t.jsx("option",{value:ae},ae))})]}),t.jsxs("div",{className:"flex-1 min-w-[140px]",children:[t.jsx("label",{className:"sr-only",htmlFor:"activity-status",children:s("activity.status")}),t.jsxs("div",{className:"relative",children:[t.jsx("input",{id:"activity-status",type:"text",value:K,onChange:ae=>G(ae.target.value.toLowerCase()),placeholder:s("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&&t.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":s("common.clear"),type:"button",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:t.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"})})})]}),t.jsx("datalist",{id:"activity-status-options",children:tx.map(ae=>t.jsx("option",{value:ae},ae))})]}),t.jsxs("div",{className:"flex-1 min-w-[140px]",children:[t.jsx("label",{className:"sr-only",htmlFor:"activity-group",children:s("activity.group")}),t.jsxs("div",{className:"relative",children:[t.jsx("input",{id:"activity-group",type:"text",value:I,onChange:ae=>L(ae.target.value),placeholder:s("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"}),I&&t.jsx("button",{onClick:()=>L(""),className:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300","aria-label":s("common.clear"),type:"button",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:t.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)&&t.jsx("datalist",{id:"group-options",children:d.groups.map(ae=>t.jsx("option",{value:ae},ae))})]}),t.jsxs("div",{className:"flex-1 min-w-[140px]",children:[t.jsx("label",{className:"sr-only",htmlFor:"activity-keyname",children:s("activity.keyName")}),t.jsxs("div",{className:"relative",children:[t.jsx("input",{id:"activity-keyname",type:"text",value:Z,onChange:ae=>A(ae.target.value),placeholder:s("activity.searchKeyName"),className:"w-full h-10 px-3 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white pr-9",list:"keyname-options"}),Z&&t.jsx("button",{onClick:()=>A(""),className:"absolute inset-y-0 right-2 flex items-center text-gray-400 hover:text-gray-600 dark:hover:text-gray-300","aria-label":s("common.clear"),type:"button",children:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4",viewBox:"0 0 20 20",fill:"currentColor",children:t.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)&&t.jsx("datalist",{id:"keyname-options",children:d.keyNames.map(ae=>t.jsx("option",{value:ae},ae))})]}),t.jsxs("div",{className:"flex-shrink-0 flex items-center gap-2",children:[t.jsxs("button",{onClick:le,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:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:t.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"})}),s("common.search")]}),t.jsxs("button",{onClick:k,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:[t.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:[t.jsx("circle",{cx:"12",cy:"12",r:"9"}),t.jsx("path",{strokeLinecap:"round",d:"M9 9l6 6M15 9l-6 6"})]}),s("common.clear")]})]})]})}),X=()=>n.length===0?t.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow p-8 text-center text-gray-500 dark:text-gray-400",children:s("activity.noData")}):t.jsx("div",{className:"bg-white dark:bg-gray-800 rounded-lg shadow overflow-hidden",children:t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-700",children:[t.jsx("thead",{className:"bg-gray-50 dark:bg-gray-700",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:s("activity.timestamp")}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:s("activity.server")}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:s("activity.tool")}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:s("activity.duration")}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:s("activity.status")}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:s("activity.group")}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:s("activity.key")}),t.jsx("th",{className:"px-4 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-300 uppercase tracking-wider",children:s("common.actions")})]})}),t.jsx("tbody",{className:"bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700",children:n.map(ae=>t.jsxs("tr",{className:"hover:bg-gray-50 dark:hover:bg-gray-700",children:[t.jsx("td",{className:"px-4 py-3 text-sm text-gray-900 dark:text-gray-200 whitespace-nowrap",children:M(ae.timestamp)}),t.jsx("td",{className:"px-4 py-3 text-sm text-gray-900 dark:text-gray-200",children:t.jsx("span",{className:"font-mono bg-gray-100 dark:bg-gray-700 px-2 py-1 rounded text-xs",children:ae.server})}),t.jsx("td",{className:"px-4 py-3 text-sm text-gray-900 dark:text-gray-200",children:t.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})}),t.jsx("td",{className:"px-4 py-3 text-sm text-gray-900 dark:text-gray-200 whitespace-nowrap",children:U(ae.duration)}),t.jsx("td",{className:"px-4 py-3 text-sm whitespace-nowrap",children:t.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"?s("activity.statusSuccess"):s("activity.statusError")})}),t.jsx("td",{className:"px-4 py-3 text-sm text-gray-500 dark:text-gray-400",children:ae.group||"-"}),t.jsx("td",{className:"px-4 py-3 text-sm text-gray-500 dark:text-gray-400",children:ae.keyName||"-"}),t.jsx("td",{className:"px-4 py-3 text-sm",children:t.jsx("button",{onClick:()=>J(ae),className:"text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300",children:s("common.view")})})]},ae.id))})]})})}),he=()=>{if(!T||!z)return null;const ae=q(z.input),ye=q(z.output);return t.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:t.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:[t.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700",children:[t.jsx("h3",{className:"text-lg font-medium text-gray-900 dark:text-white",children:s("activity.details")}),t.jsx("button",{onClick:()=>B(!1),className:"text-gray-400 hover:text-gray-500 dark:hover:text-gray-300",children:t.jsx("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),t.jsxs("div",{className:"px-6 py-4 overflow-y-auto max-h-[calc(90vh-120px)]",children:[t.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:s("activity.timestamp")}),t.jsx("p",{className:"text-gray-900 dark:text-white",children:M(z.timestamp)})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:s("activity.duration")}),t.jsx("p",{className:"text-gray-900 dark:text-white",children:U(z.duration)})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:s("activity.server")}),t.jsx("p",{className:"text-gray-900 dark:text-white font-mono",children:z.server})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:s("activity.tool")}),t.jsx("p",{className:"text-gray-900 dark:text-white font-mono",children:z.tool})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:s("activity.status")}),t.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${z.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:z.status==="success"?s("activity.statusSuccess"):s("activity.statusError")})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:s("activity.group")}),t.jsx("p",{className:"text-gray-900 dark:text-white",children:z.group||"-"})]}),z.keyName&&t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:s("activity.key")}),t.jsx("p",{className:"text-gray-900 dark:text-white",children:z.keyName})]})]}),z.errorMessage&&t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-sm font-medium text-red-500 mb-1",children:s("activity.errorMessage")}),t.jsx("div",{className:"bg-red-50 dark:bg-red-900/20 rounded p-3 text-sm text-red-800 dark:text-red-200",children:z.errorMessage})]}),ae&&t.jsxs("div",{className:"mb-4",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:s("activity.input")}),t.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&&t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-500 dark:text-gray-400 mb-1",children:s("activity.output")}),t.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 t.jsxs("div",{children:[t.jsxs("div",{className:"flex justify-between items-center mb-6",children:[t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:s("activity.title")}),t.jsx("div",{className:"flex space-x-4",children:t.jsxs("button",{onClick:me,className:"px-4 py-2 bg-red-100 text-red-800 rounded hover:bg-red-200 flex items-center transition-all duration-200",children:[t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-2",viewBox:"0 0 20 20",fill:"currentColor",children:t.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"})}),s("activity.cleanup")]})})]}),j&&t.jsx("div",{className:"mb-6 bg-red-50 border-l-4 border-red-500 p-4 rounded shadow-sm",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("p",{className:"text-red-700",children:j}),t.jsx("button",{onClick:()=>C(null),className:"ml-4 text-gray-500 hover:text-gray-700",children:t.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:[t.jsx("circle",{cx:"12",cy:"12",r:"9"}),t.jsx("path",{strokeLinecap:"round",d:"M9 9l6 6M15 9l-6 6"})]})})]})}),N&&n.length===0?t.jsx("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg p-6 flex items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center",children:[t.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:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.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"})]}),t.jsx("p",{className:"text-gray-500 dark:text-gray-400",children:s("app.loading")})]})}):t.jsxs(t.Fragment,{children:[de(),ee(),X(),t.jsxs("div",{className:"flex items-center mt-6",children:[t.jsx("div",{className:"flex-[2] text-sm text-gray-500 dark:text-gray-400",children:f&&s("common.showing",{start:(f.page-1)*f.limit+1,end:Math.min(f.page*f.limit,f.total),total:f.total})}),t.jsx("div",{className:"flex-[4] flex justify-center",children:f&&f.totalPages>1&&t.jsx(Md,{currentPage:h,totalPages:f.totalPages,onPageChange:b,disabled:N})}),t.jsxs("div",{className:"flex-[2] flex items-center justify-end space-x-2",children:[t.jsxs("label",{htmlFor:"perPage",className:"text-sm text-gray-500 dark:text-gray-400",children:[s("common.itemsPerPage"),":"]}),t.jsxs("select",{id:"perPage",value:y,onChange:ae=>{w(Number(ae.target.value)),b(1)},disabled:N,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:[t.jsx("option",{value:10,children:"10"}),t.jsx("option",{value:20,children:"20"}),t.jsx("option",{value:50,children:"50"}),t.jsx("option",{value:100,children:"100"})]})]})]})]}),he()]})},gN=async()=>{const s=await Be("/prompts");if(!s.success)throw new Error(s.message||"Failed to fetch built-in prompts");return s.data||[]},hN=async s=>{const n=await pt("/prompts",s);if(!n.success)throw new Error(n.message||"Failed to create built-in prompt");return n.data},xN=async(s,n)=>{const l=await At(`/prompts/${s}`,n);if(!l.success)throw new Error(l.message||"Failed to update built-in prompt");return l.data},yN=async s=>{const n=await Kr(`/prompts/${s}`);if(!n.success)throw new Error(n.message||"Failed to delete built-in prompt")},bN=()=>{const{t:s}=ve(),[n,l]=x.useState([]),[o,c]=x.useState(!0),[d,m]=x.useState(null),[f,g]=x.useState(0),h=x.useCallback(async()=>{try{c(!0);const S=await gN();l(S),m(null)}catch(S){console.error("Error fetching built-in prompts:",S),m(S instanceof Error?S.message:s("builtinPrompts.fetchError")),l([])}finally{c(!1)}},[s]),b=x.useCallback(()=>{g(S=>S+1)},[]),y=async S=>{try{const j=await hN(S);return b(),{success:!0,data:j}}catch(j){const C=j instanceof Error?j.message:s("builtinPrompts.createError");return m(C),{success:!1,message:C}}},w=async(S,j)=>{try{const C=await xN(S,j);return b(),{success:!0,data:C}}catch(C){const z=C instanceof Error?C.message:s("builtinPrompts.updateError");return m(z),{success:!1,message:z}}},N=async S=>{try{return await yN(S),b(),{success:!0}}catch(j){const C=j instanceof Error?j.message:s("builtinPrompts.deleteError");return m(C),{success:!1,message:C}}};return x.useEffect(()=>{h()},[h,f]),{prompts:n,loading:o,error:d,setError:m,triggerRefresh:b,addPrompt:y,editPrompt:w,removePrompt:N}},mh=({prompt:s,onSave:n,onCancel:l})=>{const{t:o}=ve(),[c,d]=x.useState(null),[m,f]=x.useState(!1),[g,h]=x.useState((s==null?void 0:s.name)||""),[b,y]=x.useState((s==null?void 0:s.title)||""),[w,N]=x.useState((s==null?void 0:s.description)||""),[S,j]=x.useState((s==null?void 0:s.template)||""),[C,z]=x.useState((s==null?void 0:s.enabled)!==!1),[E,T]=x.useState((s==null?void 0:s.arguments)||[]),B=()=>{T([...E,{name:"",description:"",required:!1}])},D=_=>{T(E.filter((P,V)=>V!==_))},Y=(_,P,V)=>{T(E.map((K,G)=>G===_?{...K,[P]:V}:K))},R=async _=>{if(_.preventDefault(),d(null),!g.trim()){d(o("builtinPrompts.nameRequired"));return}if(!S.trim()){d(o("builtinPrompts.templateRequired"));return}f(!0);try{const P=await n({name:g.trim(),title:b.trim()||void 0,description:w.trim()||void 0,template:S,arguments:E.length>0?E.filter(V=>V.name.trim()):void 0,enabled:C});P.success||d(P.message||o("builtinPrompts.saveError"))}catch(P){d(P instanceof Error?P.message:o("builtinPrompts.saveError"))}finally{f(!1)}};return t.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:t.jsx("div",{className:"bg-white dark:bg-gray-800 p-8 rounded-xl shadow-2xl max-w-3xl w-full mx-4 border border-gray-100 dark:border-gray-700 max-h-[90vh] overflow-y-auto",children:t.jsxs("form",{onSubmit:R,children:[t.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-gray-100 mb-6",children:o(s?"builtinPrompts.edit":"builtinPrompts.addNew")}),c&&t.jsx("div",{className:"bg-red-50 border-l-4 border-red-500 text-red-700 p-4 mb-6 rounded-md",children:t.jsx("p",{className:"text-sm font-medium",children:c})}),t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{children:[t.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:[o("builtinPrompts.name")," ",t.jsx("span",{className:"text-red-500",children:"*"})]}),t.jsx("input",{type:"text",value:g,onChange:_=>h(_.target.value),placeholder:o("builtinPrompts.namePlaceholder"),className:"w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 transition-all duration-200",required:!0,disabled:m})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:o("builtinPrompts.title")}),t.jsx("input",{type:"text",value:b,onChange:_=>y(_.target.value),placeholder:o("builtinPrompts.titlePlaceholder"),className:"w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 transition-all duration-200",disabled:m})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:o("builtinPrompts.description")}),t.jsx("input",{type:"text",value:w,onChange:_=>N(_.target.value),placeholder:o("builtinPrompts.descriptionPlaceholder"),className:"w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 transition-all duration-200",disabled:m})]}),t.jsxs("div",{children:[t.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:[o("builtinPrompts.template")," ",t.jsx("span",{className:"text-red-500",children:"*"})]}),t.jsx("textarea",{value:S,onChange:_=>j(_.target.value),placeholder:o("builtinPrompts.templatePlaceholder"),rows:6,className:"w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 font-mono text-sm transition-all duration-200",required:!0,disabled:m}),t.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:o("builtinPrompts.templateHint")})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300",children:o("builtinPrompts.arguments")}),t.jsxs("button",{type:"button",onClick:B,className:"text-blue-600 hover:text-blue-800 text-sm flex items-center",disabled:m,children:[t.jsx(Ad,{size:14,className:"mr-1"}),o("builtinPrompts.addArgument")]})]}),E.map((_,P)=>t.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[t.jsx("input",{type:"text",value:_.name,onChange:V=>Y(P,"name",V.target.value),placeholder:o("builtinPrompts.argName"),className:"flex-1 px-3 py-1.5 border border-gray-300 dark:border-gray-600 rounded-lg text-sm bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-blue-500",disabled:m}),t.jsx("input",{type:"text",value:_.description||"",onChange:V=>Y(P,"description",V.target.value),placeholder:o("builtinPrompts.argDescription"),className:"flex-1 px-3 py-1.5 border border-gray-300 dark:border-gray-600 rounded-lg text-sm bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:outline-none focus:ring-2 focus:ring-blue-500",disabled:m}),t.jsxs("label",{className:"flex items-center text-sm text-gray-600 dark:text-gray-400 whitespace-nowrap",children:[t.jsx("input",{type:"checkbox",checked:_.required||!1,onChange:V=>Y(P,"required",V.target.checked),className:"mr-1",disabled:m}),o("builtinPrompts.argRequired")]}),t.jsx("button",{type:"button",onClick:()=>D(P),className:"text-red-500 hover:text-red-700 p-1",disabled:m,children:t.jsx(zs,{size:16})})]},P))]}),t.jsxs("div",{className:"flex items-center pt-2",children:[t.jsx("input",{type:"checkbox",id:"enabled",checked:C,onChange:_=>z(_.target.checked),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500",disabled:m}),t.jsx("label",{htmlFor:"enabled",className:"ml-2 block text-sm text-gray-700 dark:text-gray-300",children:o("builtinPrompts.enabled")})]})]}),t.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[t.jsx("button",{type:"button",onClick:l,className:"px-4 py-2 text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200 btn-secondary",disabled:m,children:o("common.cancel")}),t.jsx("button",{type:"submit",disabled:m,className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 btn-primary transition-all duration-200 shadow-sm disabled:opacity-50",children:o(m?"common.saving":"common.save")})]})]})})})},vN=()=>{var Y;const{t:s}=ve(),{auth:n}=is(),{prompts:l,loading:o,error:c,setError:d,addPrompt:m,editPrompt:f,removePrompt:g}=bN(),[h,b]=x.useState(!1),[y,w]=x.useState(null),[N,S]=x.useState(null),[j,C]=x.useState(new Set),z=(Y=n.user)==null?void 0:Y.isAdmin,E=R=>{C(_=>{const P=new Set(_);return P.has(R)?P.delete(R):P.add(R),P})},T=async R=>{const _=await m(R);return _.success&&b(!1),_},B=async R=>{if(!y)return{success:!1,message:"No prompt selected"};const _=await f(y.id,R);return _.success&&w(null),_},D=async()=>{N&&(await g(N.id),S(null))};return t.jsxs("div",{className:"container mx-auto",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:s("pages.prompts.title")}),z&&t.jsxs("button",{onClick:()=>b(!0),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:[t.jsx(Ad,{size:16,className:"mr-2"}),s("builtinPrompts.add")]})]}),c&&t.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:t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("p",{children:c}),t.jsx("button",{onClick:()=>d(null),className:"text-red-500 hover:text-red-700",children:t.jsx(zs,{size:20})})]})}),o?t.jsx("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg p-6 loading-container flex justify-center items-center h-64",children:t.jsxs("div",{className:"flex flex-col items-center justify-center",children:[t.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:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.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"})]}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:s("app.loading")})]})}):l.length===0?t.jsx("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg p-6 empty-state dashboard-card",children:t.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[t.jsx("div",{className:"p-4 bg-gray-100 dark:bg-gray-700 rounded-full mb-4",children:t.jsx(Nn,{className:"h-8 w-8 text-gray-400"})}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-lg font-medium",children:s("builtinPrompts.noPrompts")}),z&&t.jsx("button",{onClick:()=>b(!0),className:"mt-4 text-blue-600 hover:text-blue-800 font-medium",children:s("builtinPrompts.addFirst")})]})}):t.jsx("div",{className:"space-y-3",children:l.map(R=>{const _=j.has(R.id);return t.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg overflow-hidden dashboard-card",children:[t.jsxs("div",{className:"flex items-center justify-between px-6 py-4 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-750",onClick:()=>E(R.id),children:[t.jsxs("div",{className:"flex items-center flex-1 min-w-0",children:[t.jsx(Nn,{size:18,className:`mr-3 flex-shrink-0 ${R.enabled!==!1?"text-blue-500":"text-gray-400"}`}),t.jsxs("div",{className:"min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100 truncate",children:R.title||R.name}),t.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 font-mono",children:R.name}),t.jsx("span",{className:`px-2 py-0.5 text-xs rounded-full ${R.enabled!==!1?"bg-green-100 text-green-800 border border-green-200":"bg-gray-100 text-gray-600 border border-gray-200"}`,children:R.enabled!==!1?s("builtinPrompts.active"):s("builtinPrompts.inactive")})]}),R.description&&t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-0.5 truncate",children:R.description})]})]}),t.jsxs("div",{className:"flex items-center ml-4 gap-2",children:[z&&t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:P=>{P.stopPropagation(),w(R)},className:"text-blue-600 hover:text-blue-900 p-1 rounded hover:bg-blue-50 transition-colors",title:s("builtinPrompts.edit"),children:t.jsx(ua,{size:18})}),t.jsx("button",{onClick:P=>{P.stopPropagation(),S(R)},className:"text-red-600 hover:text-red-900 p-1 rounded hover:bg-red-50 transition-colors",title:s("builtinPrompts.delete"),children:t.jsx(jo,{size:18})})]}),_?t.jsx(g0,{size:18,className:"text-gray-400"}):t.jsx(ca,{size:18,className:"text-gray-400"})]})]}),_&&t.jsxs("div",{className:"px-6 pb-4 border-t border-gray-100 dark:border-gray-700",children:[t.jsxs("div",{className:"mt-3",children:[t.jsx("h4",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase mb-1",children:s("builtinPrompts.template")}),t.jsx("pre",{className:"text-sm text-gray-800 dark:text-gray-200 bg-gray-50 dark:bg-gray-900 rounded p-3 overflow-x-auto whitespace-pre-wrap font-mono",children:R.template})]}),R.arguments&&R.arguments.length>0&&t.jsxs("div",{className:"mt-3",children:[t.jsx("h4",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase mb-1",children:s("builtinPrompts.arguments")}),t.jsx("div",{className:"space-y-1",children:R.arguments.map((P,V)=>t.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.jsx("code",{className:"px-1.5 py-0.5 bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300 rounded text-xs font-mono",children:"{{"+P.name+"}}"}),P.required&&t.jsx("span",{className:"text-red-500 text-xs",children:"*"}),P.description&&t.jsxs("span",{className:"text-gray-500 dark:text-gray-400 text-xs",children:["— ",P.description]})]},V))})]})]})]},R.id)})}),h&&t.jsx(mh,{onSave:T,onCancel:()=>b(!1)}),y&&t.jsx(mh,{prompt:y,onSave:B,onCancel:()=>w(null)}),t.jsx(zd,{isOpen:!!N,onClose:()=>S(null),onConfirm:D,title:s("builtinPrompts.confirmDelete"),message:s("builtinPrompts.deleteWarning",{name:(N==null?void 0:N.name)||""}),variant:"danger"})]})},wN=async()=>{const s=await Be("/resources");if(!s.success)throw new Error(s.message||"Failed to fetch built-in resources");return s.data||[]},jN=async s=>{const n=await pt("/resources",s);if(!n.success)throw new Error(n.message||"Failed to create built-in resource");return n.data},SN=async(s,n)=>{const l=await At(`/resources/${s}`,n);if(!l.success)throw new Error(l.message||"Failed to update built-in resource");return l.data},NN=async s=>{const n=await Kr(`/resources/${s}`);if(!n.success)throw new Error(n.message||"Failed to delete built-in resource")},kN=()=>{const{t:s}=ve(),[n,l]=x.useState([]),[o,c]=x.useState(!0),[d,m]=x.useState(null),[f,g]=x.useState(0),h=x.useCallback(async()=>{try{c(!0);const S=await wN();l(S),m(null)}catch(S){console.error("Error fetching built-in resources:",S),m(S instanceof Error?S.message:s("builtinResources.fetchError")),l([])}finally{c(!1)}},[s]),b=x.useCallback(()=>{g(S=>S+1)},[]),y=async S=>{try{const j=await jN(S);return b(),{success:!0,data:j}}catch(j){const C=j instanceof Error?j.message:s("builtinResources.createError");return m(C),{success:!1,message:C}}},w=async(S,j)=>{try{const C=await SN(S,j);return b(),{success:!0,data:C}}catch(C){const z=C instanceof Error?C.message:s("builtinResources.updateError");return m(z),{success:!1,message:z}}},N=async S=>{try{return await NN(S),b(),{success:!0}}catch(j){const C=j instanceof Error?j.message:s("builtinResources.deleteError");return m(C),{success:!1,message:C}}};return x.useEffect(()=>{h()},[h,f]),{resources:n,loading:o,error:d,setError:m,triggerRefresh:b,addResource:y,editResource:w,removeResource:N}},ph=({resource:s,onSave:n,onCancel:l})=>{const{t:o}=ve(),[c,d]=x.useState(null),[m,f]=x.useState(!1),[g,h]=x.useState((s==null?void 0:s.uri)||""),[b,y]=x.useState((s==null?void 0:s.name)||""),[w,N]=x.useState((s==null?void 0:s.description)||""),[S,j]=x.useState((s==null?void 0:s.mimeType)||"text/plain"),[C,z]=x.useState((s==null?void 0:s.content)||""),[E,T]=x.useState((s==null?void 0:s.enabled)!==!1),B=async D=>{if(D.preventDefault(),d(null),!g.trim()){d(o("builtinResources.uriRequired"));return}if(!C.trim()){d(o("builtinResources.contentRequired"));return}f(!0);try{const Y=await n({uri:g.trim(),name:b.trim()||void 0,description:w.trim()||void 0,mimeType:S.trim()||"text/plain",content:C,enabled:E});Y.success||d(Y.message||o("builtinResources.saveError"))}catch(Y){d(Y instanceof Error?Y.message:o("builtinResources.saveError"))}finally{f(!1)}};return t.jsx("div",{className:"fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4",children:t.jsx("div",{className:"bg-white dark:bg-gray-800 p-8 rounded-xl shadow-2xl max-w-3xl w-full mx-4 border border-gray-100 dark:border-gray-700 max-h-[90vh] overflow-y-auto",children:t.jsxs("form",{onSubmit:B,children:[t.jsx("h2",{className:"text-xl font-bold text-gray-900 dark:text-gray-100 mb-6",children:o(s?"builtinResources.edit":"builtinResources.addNew")}),c&&t.jsx("div",{className:"bg-red-50 border-l-4 border-red-500 text-red-700 p-4 mb-6 rounded-md",children:t.jsx("p",{className:"text-sm font-medium",children:c})}),t.jsxs("div",{className:"space-y-5",children:[t.jsxs("div",{children:[t.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:[o("builtinResources.uri")," ",t.jsx("span",{className:"text-red-500",children:"*"})]}),t.jsx("input",{type:"text",value:g,onChange:D=>h(D.target.value),placeholder:o("builtinResources.uriPlaceholder"),className:"w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 font-mono text-sm transition-all duration-200",required:!0,disabled:m})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:o("builtinResources.name")}),t.jsx("input",{type:"text",value:b,onChange:D=>y(D.target.value),placeholder:o("builtinResources.namePlaceholder"),className:"w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 transition-all duration-200",disabled:m})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:o("builtinResources.description")}),t.jsx("input",{type:"text",value:w,onChange:D=>N(D.target.value),placeholder:o("builtinResources.descriptionPlaceholder"),className:"w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 transition-all duration-200",disabled:m})]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:o("builtinResources.mimeType")}),t.jsx("input",{type:"text",value:S,onChange:D=>j(D.target.value),placeholder:"text/plain",className:"w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 transition-all duration-200",disabled:m})]}),t.jsxs("div",{children:[t.jsxs("label",{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:[o("builtinResources.content")," ",t.jsx("span",{className:"text-red-500",children:"*"})]}),t.jsx("textarea",{value:C,onChange:D=>z(D.target.value),placeholder:o("builtinResources.contentPlaceholder"),rows:8,className:"w-full px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 font-mono text-sm transition-all duration-200",required:!0,disabled:m})]}),t.jsxs("div",{className:"flex items-center pt-2",children:[t.jsx("input",{type:"checkbox",id:"enabled",checked:E,onChange:D=>T(D.target.checked),className:"h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500",disabled:m}),t.jsx("label",{htmlFor:"enabled",className:"ml-2 block text-sm text-gray-700 dark:text-gray-300",children:o("builtinResources.enabled")})]})]}),t.jsxs("div",{className:"flex justify-end space-x-3 mt-8",children:[t.jsx("button",{type:"button",onClick:l,className:"px-4 py-2 text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200 btn-secondary",disabled:m,children:o("common.cancel")}),t.jsx("button",{type:"submit",disabled:m,className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 btn-primary transition-all duration-200 shadow-sm disabled:opacity-50",children:o(m?"common.saving":"common.save")})]})]})})})},CN=()=>{var Y;const{t:s}=ve(),{auth:n}=is(),{resources:l,loading:o,error:c,setError:d,addResource:m,editResource:f,removeResource:g}=kN(),[h,b]=x.useState(!1),[y,w]=x.useState(null),[N,S]=x.useState(null),[j,C]=x.useState(new Set),z=(Y=n.user)==null?void 0:Y.isAdmin,E=R=>{C(_=>{const P=new Set(_);return P.has(R)?P.delete(R):P.add(R),P})},T=async R=>{const _=await m(R);return _.success&&b(!1),_},B=async R=>{if(!y)return{success:!1,message:"No resource selected"};const _=await f(y.id,R);return _.success&&w(null),_},D=async()=>{N&&(await g(N.id),S(null))};return t.jsxs("div",{className:"container mx-auto",children:[t.jsxs("div",{className:"flex justify-between items-center mb-8",children:[t.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:s("pages.resources.title")}),z&&t.jsxs("button",{onClick:()=>b(!0),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:[t.jsx(Ad,{size:16,className:"mr-2"}),s("builtinResources.add")]})]}),c&&t.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:t.jsxs("div",{className:"flex justify-between items-center",children:[t.jsx("p",{children:c}),t.jsx("button",{onClick:()=>d(null),className:"text-red-500 hover:text-red-700",children:t.jsx(zs,{size:20})})]})}),o?t.jsx("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg p-6 loading-container flex justify-center items-center h-64",children:t.jsxs("div",{className:"flex flex-col items-center justify-center",children:[t.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:[t.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),t.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"})]}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400",children:s("app.loading")})]})}):l.length===0?t.jsx("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg p-6 empty-state dashboard-card",children:t.jsxs("div",{className:"flex flex-col items-center justify-center py-12",children:[t.jsx("div",{className:"p-4 bg-gray-100 dark:bg-gray-700 rounded-full mb-4",children:t.jsx(Sn,{className:"h-8 w-8 text-gray-400"})}),t.jsx("p",{className:"text-gray-600 dark:text-gray-400 text-lg font-medium",children:s("builtinResources.noResources")}),z&&t.jsx("button",{onClick:()=>b(!0),className:"mt-4 text-blue-600 hover:text-blue-800 font-medium",children:s("builtinResources.addFirst")})]})}):t.jsx("div",{className:"space-y-3",children:l.map(R=>{const _=j.has(R.id);return t.jsxs("div",{className:"bg-white dark:bg-gray-800 shadow rounded-lg overflow-hidden dashboard-card",children:[t.jsxs("div",{className:"flex items-center justify-between px-6 py-4 cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-750",onClick:()=>E(R.id),children:[t.jsxs("div",{className:"flex items-center flex-1 min-w-0",children:[t.jsx(Sn,{size:18,className:`mr-3 flex-shrink-0 ${R.enabled!==!1?"text-green-500":"text-gray-400"}`}),t.jsxs("div",{className:"min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100 truncate",children:R.name||R.uri}),R.name&&t.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 font-mono truncate",children:R.uri}),t.jsx("span",{className:`px-2 py-0.5 text-xs rounded-full flex-shrink-0 ${R.enabled!==!1?"bg-green-100 text-green-800 border border-green-200":"bg-gray-100 text-gray-600 border border-gray-200"}`,children:R.enabled!==!1?s("builtinResources.active"):s("builtinResources.inactive")}),R.mimeType&&t.jsx("span",{className:"px-2 py-0.5 text-xs bg-blue-50 text-blue-700 rounded-full border border-blue-200 flex-shrink-0",children:R.mimeType})]}),R.description&&t.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-0.5 truncate",children:R.description})]})]}),t.jsxs("div",{className:"flex items-center ml-4 gap-2",children:[z&&t.jsxs(t.Fragment,{children:[t.jsx("button",{onClick:P=>{P.stopPropagation(),w(R)},className:"text-blue-600 hover:text-blue-900 p-1 rounded hover:bg-blue-50 transition-colors",title:s("builtinResources.edit"),children:t.jsx(ua,{size:18})}),t.jsx("button",{onClick:P=>{P.stopPropagation(),S(R)},className:"text-red-600 hover:text-red-900 p-1 rounded hover:bg-red-50 transition-colors",title:s("builtinResources.delete"),children:t.jsx(jo,{size:18})})]}),_?t.jsx(g0,{size:18,className:"text-gray-400"}):t.jsx(ca,{size:18,className:"text-gray-400"})]})]}),_&&t.jsx("div",{className:"px-6 pb-4 border-t border-gray-100 dark:border-gray-700",children:t.jsxs("div",{className:"mt-3",children:[t.jsx("h4",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase mb-1",children:s("builtinResources.content")}),t.jsx("pre",{className:"text-sm text-gray-800 dark:text-gray-200 bg-gray-50 dark:bg-gray-900 rounded p-3 overflow-x-auto whitespace-pre-wrap font-mono max-h-64 overflow-y-auto",children:R.content})]})})]},R.id)})}),h&&t.jsx(ph,{onSave:T,onCancel:()=>b(!1)}),y&&t.jsx(ph,{resource:y,onSave:B,onCancel:()=>w(null)}),t.jsx(zd,{isOpen:!!N,onClose:()=>S(null),onConfirm:D,title:s("builtinResources.confirmDelete"),message:s("builtinResources.deleteWarning",{name:(N==null?void 0:N.name)||(N==null?void 0:N.uri)||""}),variant:"danger"})]})},fh="[EMBED_SYNC_ERROR]",AN=8e3,gh=3e4,EN=()=>{const{showToast:s}=Ms(),n=x.useRef(new Map);return x.useEffect(()=>{const l=f=>{const g=Date.now();n.current.forEach((b,y)=>{g-b>=gh&&n.current.delete(y)});const h=n.current.get(f);return h&&g-h<gh?!0:(n.current.set(f,g),!1)},o=f=>{const g=f.match(/server\s+"([^"]+)"/i);return(g==null?void 0:g[1])||null},c=(f,g)=>{l(f)||s(g,"error",AN)},d=f=>{const g=f.replace(fh,"").trim(),h=o(g);if(g.includes("Full embeddings resync failed")){c("embedding-resync-failed","Embedding resynchronization failed. Check smart routing logs and provider limits.");return}if(h){c(`embedding-sync-error:${h}`,`Embedding synchronization failed for server "${h}". Check logs for details.`);return}c(`embedding-sync-error:${g}`,g||"Embedding synchronization failed. Check smart routing logs and provider rate limits.")},m=f=>{var g,h,b;try{const y=JSON.parse(f.data);if((y==null?void 0:y.type)==="embedding-sync-progress"){const N=typeof((g=y.progress)==null?void 0:g.serverName)=="string"?y.progress.serverName:"";(typeof((h=y.progress)==null?void 0:h.status)=="string"?y.progress.status:"")==="error"&&N&&c(`embedding-sync-error:${N}`,`Embedding synchronization failed for server "${N}". Check logs for details.`);return}if((y==null?void 0:y.type)!=="log")return;const w=String(((b=y==null?void 0:y.log)==null?void 0:b.message)||"");if(!w.includes(fh))return;d(w)}catch{}};return Td.subscribe(m)},[s]),null},RN=()=>{const{serverName:s}=Kh();return t.jsx(po,{to:`/market/${s}?tab=cloud`,replace:!0})};function hh(){const s=Ml();return t.jsx(Nj,{children:t.jsx(O2,{children:t.jsx(Cj,{children:t.jsx(jj,{children:t.jsx(Ej,{children:t.jsxs(Zv,{basename:s,children:[t.jsx(EN,{}),t.jsxs(Av,{children:[t.jsx(Ft,{path:"/login",element:t.jsx(oS,{})}),t.jsx(Ft,{element:t.jsx(nS,{}),children:t.jsxs(Ft,{element:t.jsx(aS,{}),children:[t.jsx(Ft,{path:"/",element:t.jsx(cS,{})}),t.jsx(Ft,{path:"/servers",element:t.jsx(MS,{})}),t.jsx(Ft,{path:"/groups",element:t.jsx(FS,{})}),t.jsx(Ft,{path:"/prompts",element:t.jsx(vN,{})}),t.jsx(Ft,{path:"/resources",element:t.jsx(CN,{})}),t.jsx(Ft,{path:"/users",element:t.jsx(GS,{})}),t.jsx(Ft,{path:"/market",element:t.jsx(dh,{})}),t.jsx(Ft,{path:"/market/:serverName",element:t.jsx(dh,{})}),t.jsx(Ft,{path:"/cloud",element:t.jsx(po,{to:"/market?tab=cloud",replace:!0})}),t.jsx(Ft,{path:"/cloud/:serverName",element:t.jsx(RN,{})}),t.jsx(Ft,{path:"/logs",element:t.jsx(mN,{})}),t.jsx(Ft,{path:"/activity",element:t.jsx(fN,{})}),t.jsx(Ft,{path:"/settings",element:t.jsx(JS,{})})]})}),t.jsx(Ft,{path:"*",element:t.jsx(po,{to:"/"})})]})]})})})})})})}const De=s=>typeof s=="string",Cl=()=>{let s,n;const l=new Promise((o,c)=>{s=o,n=c});return l.resolve=s,l.reject=n,l},xh=s=>s==null?"":""+s,TN=(s,n,l)=>{s.forEach(o=>{n[o]&&(l[o]=n[o])})},ON=/###/g,yh=s=>s&&s.indexOf("###")>-1?s.replace(ON,"."):s,bh=s=>!s||De(s),Al=(s,n,l)=>{const o=De(n)?n.split("."):n;let c=0;for(;c<o.length-1;){if(bh(s))return{};const d=yh(o[c]);!s[d]&&l&&(s[d]=new l),Object.prototype.hasOwnProperty.call(s,d)?s=s[d]:s={},++c}return bh(s)?{}:{obj:s,k:yh(o[c])}},vh=(s,n,l)=>{const{obj:o,k:c}=Al(s,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),f=Al(s,m,Object);for(;f.obj===void 0&&m.length;)d=`${m[m.length-1]}.${d}`,m=m.slice(0,m.length-1),f=Al(s,m,Object),f!=null&&f.obj&&typeof f.obj[`${f.k}.${d}`]<"u"&&(f.obj=void 0);f.obj[`${f.k}.${d}`]=l},zN=(s,n,l,o)=>{const{obj:c,k:d}=Al(s,n,Object);c[d]=c[d]||[],c[d].push(l)},go=(s,n)=>{const{obj:l,k:o}=Al(s,n);if(l&&Object.prototype.hasOwnProperty.call(l,o))return l[o]},MN=(s,n,l)=>{const o=go(s,l);return o!==void 0?o:go(n,l)},rx=(s,n,l)=>{for(const o in n)o!=="__proto__"&&o!=="constructor"&&(o in s?De(s[o])||s[o]instanceof String||De(n[o])||n[o]instanceof String?l&&(s[o]=n[o]):rx(s[o],n[o],l):s[o]=n[o]);return s},yn=s=>s.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var PN={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const DN=s=>De(s)?s.replace(/[&<>"'\/]/g,n=>PN[n]):s;class LN{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 UN=[" ",",","?","!",";"],_N=new LN(20),BN=(s,n,l)=>{n=n||"",l=l||"";const o=UN.filter(m=>n.indexOf(m)<0&&l.indexOf(m)<0);if(o.length===0)return!0;const c=_N.getRegExp(`(${o.map(m=>m==="?"?"\\?":m).join("|")})`);let d=!c.test(s);if(!d){const m=s.indexOf(l);m>0&&!c.test(s.substring(0,m))&&(d=!0)}return d},pd=(s,n,l=".")=>{if(!s)return;if(s[n])return Object.prototype.hasOwnProperty.call(s,n)?s[n]:void 0;const o=n.split(l);let c=s;for(let d=0;d<o.length;){if(!c||typeof c!="object")return;let m,f="";for(let g=d;g<o.length;++g)if(g!==d&&(f+=l),f+=o[g],m=c[f],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},Rl=s=>s==null?void 0:s.replace("_","-"),IN={type:"logger",log(s){this.output("log",s)},warn(s){this.output("warn",s)},error(s){this.output("error",s)},output(s,n){var l,o;(o=(l=console==null?void 0:console[s])==null?void 0:l.apply)==null||o.call(l,console,n)}};class ho{constructor(n,l={}){this.init(n,l)}init(n,l={}){this.prefix=l.prefix||"i18next:",this.logger=n||IN,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:(De(n[0])&&(n[0]=`${o}${this.prefix} ${n[0]}`),this.logger[l](n))}create(n){return new ho(this.logger,{prefix:`${this.prefix}:${n}:`,...this.options})}clone(n){return n=n||this.options,n.prefix=n.prefix||this.prefix,new ho(this.logger,n)}}var as=new ho;class No{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 wh extends No{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 f;n.indexOf(".")>-1?f=n.split("."):(f=[n,l],o&&(Array.isArray(o)?f.push(...o):De(o)&&d?f.push(...o.split(d)):f.push(o)));const g=go(this.data,f);return!g&&!l&&!o&&n.indexOf(".")>-1&&(n=f[0],l=f[1],o=f.slice(2).join(".")),g||!m||!De(o)?g:pd((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 f=[n,l];o&&(f=f.concat(m?o.split(m):o)),n.indexOf(".")>-1&&(f=n.split("."),c=l,l=f[1]),this.addNamespaces(l),vh(this.data,f,c),d.silent||this.emit("added",n,l,o,c)}addResources(n,l,o,c={silent:!1}){for(const d in o)(De(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 f=[n,l];n.indexOf(".")>-1&&(f=n.split("."),c=o,o=l,l=f[1]),this.addNamespaces(l);let g=go(this.data,f)||{};m.skipCopy||(o=JSON.parse(JSON.stringify(o))),c?rx(g,o,d):g={...g,...o},vh(this.data,f,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 sx={processors:{},addPostProcessor(s){this.processors[s.name]=s},handle(s,n,l,o,c){return s.forEach(d=>{var m;n=((m=this.processors[d])==null?void 0:m.process(n,l,o,c))??n}),n}};const ax=Symbol("i18next/PATH_KEY");function FN(){const s=[],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===ax?s:(s.push(c),l=Proxy.revocable(o,n),l.proxy)},Proxy.revocable(Object.create(null),n).proxy}function fd(s,n){const{[ax]:l}=s(FN());return l.join((n==null?void 0:n.keySeparator)??".")}const jh={},Zu=s=>!De(s)&&typeof s!="boolean"&&typeof s!="number";class xo extends No{constructor(n,l={}){super(),TN(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],n,this),this.options=l,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=as.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=Zu(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,f=!this.options.userDefinedKeySeparator&&!l.keySeparator&&!this.options.userDefinedNsSeparator&&!l.nsSeparator&&!BN(n,o,c);if(m&&!f){const g=n.match(this.interpolator.nestingRegexp);if(g&&g.length>0)return{key:n,namespaces:De(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:De(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=fd(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:f,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 y=c.lng||this.language,w=c.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((y==null?void 0:y.toLowerCase())==="cimode")return w?d?{res:`${h}${b}${f}`,usedKey:f,exactUsedKey:f,usedLng:y,usedNS:h,usedParams:this.getUsedParamsDetails(c)}:`${h}${b}${f}`:d?{res:f,usedKey:f,exactUsedKey:f,usedLng:y,usedNS:h,usedParams:this.getUsedParamsDetails(c)}:f;const N=this.resolve(n,c);let S=N==null?void 0:N.res;const j=(N==null?void 0:N.usedKey)||f,C=(N==null?void 0:N.exactUsedKey)||f,z=["[object Number]","[object Function]","[object RegExp]"],E=c.joinArrays!==void 0?c.joinArrays:this.options.joinArrays,T=!this.i18nFormat||this.i18nFormat.handleAsObject,B=c.count!==void 0&&!De(c.count),D=xo.hasDefaultValue(c),Y=B?this.pluralResolver.getSuffix(y,c.count,c):"",R=c.ordinal&&B?this.pluralResolver.getSuffix(y,c.count,{ordinal:!1}):"",_=B&&!c.ordinal&&c.count===0,P=_&&c[`defaultValue${this.options.pluralSeparator}zero`]||c[`defaultValue${Y}`]||c[`defaultValue${R}`]||c.defaultValue;let V=S;T&&!S&&D&&(V=P);const K=Zu(V),G=Object.prototype.toString.apply(V);if(T&&V&&K&&z.indexOf(G)<0&&!(De(E)&&Array.isArray(V))){if(!c.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const I=this.options.returnedObjectHandler?this.options.returnedObjectHandler(j,V,{...c,ns:g}):`key '${f} (${this.language})' returned an object instead of string.`;return d?(N.res=I,N.usedParams=this.getUsedParamsDetails(c),N):I}if(m){const I=Array.isArray(V),L=I?[]:{},Z=I?C:j;for(const A in V)if(Object.prototype.hasOwnProperty.call(V,A)){const H=`${Z}${m}${A}`;D&&!S?L[A]=this.translate(H,{...c,defaultValue:Zu(P)?P[A]:void 0,joinArrays:!1,ns:g}):L[A]=this.translate(H,{...c,joinArrays:!1,ns:g}),L[A]===H&&(L[A]=V[A])}S=L}}else if(T&&De(E)&&Array.isArray(S))S=S.join(E),S&&(S=this.extendTranslation(S,n,c,o));else{let I=!1,L=!1;!this.isValidLookup(S)&&D&&(I=!0,S=P),this.isValidLookup(S)||(L=!0,S=f);const A=(c.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&L?void 0:S,H=D&&P!==S&&this.options.updateMissing;if(L||I||H){if(this.logger.log(H?"updateKey":"missingKey",y,h,f,H?P:S),m){const k=this.resolve(f,{...c,keySeparator:!1});k&&k.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 J=[];const me=this.languageUtils.getFallbackCodes(this.options.fallbackLng,c.lng||this.language);if(this.options.saveMissingTo==="fallback"&&me&&me[0])for(let k=0;k<me.length;k++)J.push(me[k]);else this.options.saveMissingTo==="all"?J=this.languageUtils.toResolveHierarchy(c.lng||this.language):J.push(c.lng||this.language);const le=(k,U,M)=>{var de;const q=D&&M!==S?M:A;this.options.missingKeyHandler?this.options.missingKeyHandler(k,h,U,q,H,c):(de=this.backendConnector)!=null&&de.saveMissing&&this.backendConnector.saveMissing(k,h,U,q,H,c),this.emit("missingKey",k,h,U,S)};this.options.saveMissing&&(this.options.saveMissingPlurals&&B?J.forEach(k=>{const U=this.pluralResolver.getSuffixes(k,c);_&&c[`defaultValue${this.options.pluralSeparator}zero`]&&U.indexOf(`${this.options.pluralSeparator}zero`)<0&&U.push(`${this.options.pluralSeparator}zero`),U.forEach(M=>{le([k],f+M,c[`defaultValue${M}`]||P)})}):le(J,f,P))}S=this.extendTranslation(S,n,c,N,o),L&&S===f&&this.options.appendNamespaceToMissingKey&&(S=`${h}${b}${f}`),(L||I)&&this.options.parseMissingKeyHandler&&(S=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${b}${f}`:f,I?S:void 0,c))}return d?(N.res=S,N.usedParams=this.getUsedParamsDetails(c),N):S}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=De(n)&&(((h=o==null?void 0:o.interpolation)==null?void 0:h.skipOnVariables)!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let y;if(b){const N=n.match(this.interpolator.nestingRegexp);y=N&&N.length}let w=o.replace&&!De(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 N=n.match(this.interpolator.nestingRegexp),S=N&&N.length;y<S&&(o.nest=!1)}!o.lng&&c&&c.res&&(o.lng=this.language||c.usedLng),o.nest!==!1&&(n=this.interpolator.nest(n,(...N)=>(d==null?void 0:d[0])===N[0]&&!o.context?(this.logger.warn(`It seems you are nesting recursively key: ${N[0]} in key: ${l[0]}`),null):this.translate(...N,l),o)),o.interpolation&&this.interpolator.reset()}const m=o.postProcess||this.options.postProcess,f=De(m)?[m]:m;return n!=null&&(f!=null&&f.length)&&o.applyPostProcessor!==!1&&(n=sx.handle(f,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,f;return De(n)&&(n=[n]),n.forEach(g=>{if(this.isValidLookup(o))return;const h=this.extractFromKey(g,l),b=h.key;c=b;let y=h.namespaces;this.options.fallbackNS&&(y=y.concat(this.options.fallbackNS));const w=l.count!==void 0&&!De(l.count),N=w&&!l.ordinal&&l.count===0,S=l.context!==void 0&&(De(l.context)||typeof l.context=="number")&&l.context!=="",j=l.lngs?l.lngs:this.languageUtils.toResolveHierarchy(l.lng||this.language,l.fallbackLng);y.forEach(C=>{var z,E;this.isValidLookup(o)||(f=C,!jh[`${j[0]}-${C}`]&&((z=this.utils)!=null&&z.hasLoadedNamespace)&&!((E=this.utils)!=null&&E.hasLoadedNamespace(f))&&(jh[`${j[0]}-${C}`]=!0,this.logger.warn(`key "${c}" for languages "${j.join(", ")}" won't get resolved as namespace "${f}" 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!!!")),j.forEach(T=>{var Y;if(this.isValidLookup(o))return;m=T;const B=[b];if((Y=this.i18nFormat)!=null&&Y.addLookupKeys)this.i18nFormat.addLookupKeys(B,b,T,C,l);else{let R;w&&(R=this.pluralResolver.getSuffix(T,l.count,l));const _=`${this.options.pluralSeparator}zero`,P=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(w&&(l.ordinal&&R.indexOf(P)===0&&B.push(b+R.replace(P,this.options.pluralSeparator)),B.push(b+R),N&&B.push(b+_)),S){const V=`${b}${this.options.contextSeparator||"_"}${l.context}`;B.push(V),w&&(l.ordinal&&R.indexOf(P)===0&&B.push(V+R.replace(P,this.options.pluralSeparator)),B.push(V+R),N&&B.push(V+_))}}let D;for(;D=B.pop();)this.isValidLookup(o)||(d=D,o=this.getResource(T,C,D,l))}))})}),{res:o,usedKey:c,exactUsedKey:d,usedLng:m,usedNS:f}}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&&!De(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 Sh{constructor(n){this.options=n,this.supportedLngs=this.options.supportedLngs||!1,this.logger=as.create("languageUtils")}getScriptPartFromCode(n){if(n=Rl(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=Rl(n),!n||n.indexOf("-")<0)return n;const l=n.split("-");return this.formatLanguageCode(l[0])}formatLanguageCode(n){if(De(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)),De(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 De(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))):De(n)&&d(this.formatLanguageCode(n)),o.forEach(m=>{c.indexOf(m)<0&&d(this.formatLanguageCode(m))}),c}}const Nh={zero:0,one:1,two:2,few:3,many:4,other:5},kh={select:s=>s===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class HN{constructor(n,l={}){this.languageUtils=n,this.options=l,this.logger=as.create("pluralResolver"),this.pluralRulesCache={}}addRule(n,l){this.rules[n]=l}clearCache(){this.pluralRulesCache={}}getRule(n,l={}){const o=Rl(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!"),kh;if(!n.match(/-|_/))return kh;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)=>Nh[c]-Nh[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 Ch=(s,n,l,o=".",c=!0)=>{let d=MN(s,n,l);return!d&&c&&De(l)&&(d=pd(s,l,o),d===void 0&&(d=pd(n,l,o))),d},Wu=s=>s.replace(/\$/g,"$$$$");class qN{constructor(n={}){var l;this.logger=as.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:f,suffixEscaped:g,formatSeparator:h,unescapeSuffix:b,unescapePrefix:y,nestingPrefix:w,nestingPrefixEscaped:N,nestingSuffix:S,nestingSuffixEscaped:j,nestingOptionsSeparator:C,maxReplaces:z,alwaysFormat:E}=n.interpolation;this.escape=l!==void 0?l:DN,this.escapeValue=o!==void 0?o:!0,this.useRawValueToEscape=c!==void 0?c:!1,this.prefix=d?yn(d):m||"{{",this.suffix=f?yn(f):g||"}}",this.formatSeparator=h||",",this.unescapePrefix=b?"":y||"-",this.unescapeSuffix=this.unescapePrefix?"":b||"",this.nestingPrefix=w?yn(w):N||yn("$t("),this.nestingSuffix=S?yn(S):j||yn(")"),this.nestingOptionsSeparator=C||",",this.maxReplaces=z||1e3,this.alwaysFormat=E!==void 0?E:!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 N;let d,m,f;const g=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=S=>{if(S.indexOf(this.formatSeparator)<0){const E=Ch(l,g,S,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,o,{...c,...l,interpolationkey:S}):E}const j=S.split(this.formatSeparator),C=j.shift().trim(),z=j.join(this.formatSeparator).trim();return this.format(Ch(l,g,C,this.options.keySeparator,this.options.ignoreJSONStructure),z,o,{...c,...l,interpolationkey:C})};this.resetRegExp();const b=(c==null?void 0:c.missingInterpolationHandler)||this.options.missingInterpolationHandler,y=((N=c==null?void 0:c.interpolation)==null?void 0:N.skipOnVariables)!==void 0?c.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:S=>Wu(S)},{regex:this.regexp,safeValue:S=>this.escapeValue?Wu(this.escape(S)):Wu(S)}].forEach(S=>{for(f=0;d=S.regex.exec(n);){const j=d[1].trim();if(m=h(j),m===void 0)if(typeof b=="function"){const z=b(n,d,c);m=De(z)?z:""}else if(c&&Object.prototype.hasOwnProperty.call(c,j))m="";else if(y){m=d[0];continue}else this.logger.warn(`missed to pass in variable ${j} for interpolating ${n}`),m="";else!De(m)&&!this.useRawValueToEscape&&(m=xh(m));const C=S.safeValue(m);if(n=n.replace(d[0],C),y?(S.regex.lastIndex+=m.length,S.regex.lastIndex-=d[0].length):S.regex.lastIndex=0,f++,f>=this.maxReplaces)break}}),n}nest(n,l,o={}){let c,d,m;const f=(g,h)=>{const b=this.nestingOptionsSeparator;if(g.indexOf(b)<0)return g;const y=g.split(new RegExp(`${b}[ ]*{`));let w=`{${y[1]}`;g=y[0],w=this.interpolate(w,m);const N=w.match(/'/g),S=w.match(/"/g);(((N==null?void 0:N.length)??0)%2===0&&!S||S.length%2!==0)&&(w=w.replace(/'/g,'"'));try{m=JSON.parse(w),h&&(m={...h,...m})}catch(j){return this.logger.warn(`failed parsing options string in nesting for key ${g}`,j),`${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&&!De(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(f.call(this,c[1].trim(),m),m),d&&c[0]===n&&!De(d))return d;De(d)||(d=xh(d)),d||(this.logger.warn(`missed to resolve ${c[1]} for nesting ${n}`),d=""),g.length&&(d=g.reduce((b,y)=>this.format(b,y,o.lng,{...o,interpolationkey:c[1].trim()}),d.trim())),n=n.replace(c[0],d),this.regexp.lastIndex=0}return n}}const GN=s=>{let n=s.toLowerCase().trim();const l={};if(s.indexOf("(")>-1){const o=s.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[f,...g]=m.split(":"),h=g.join(":").trim().replace(/^'+|'+$/g,""),b=f.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}},Ah=s=>{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 f=n[m];return f||(f=s(Rl(o),c),n[m]=f),f(l)}},KN=s=>(n,l,o)=>s(Rl(l),o)(n);class VN{constructor(n={}){this.logger=as.create("formatter"),this.options=n,this.init(n)}init(n,l={interpolation:{}}){this.formatSeparator=l.interpolation.formatSeparator||",";const o=l.cacheInBuiltFormats?Ah:KN;this.formats={number:o((c,d)=>{const m=new Intl.NumberFormat(c,{...d});return f=>m.format(f)}),currency:o((c,d)=>{const m=new Intl.NumberFormat(c,{...d,style:"currency"});return f=>m.format(f)}),datetime:o((c,d)=>{const m=new Intl.DateTimeFormat(c,{...d});return f=>m.format(f)}),relativetime:o((c,d)=>{const m=new Intl.RelativeTimeFormat(c,{...d});return f=>m.format(f,d.range||"day")}),list:o((c,d)=>{const m=new Intl.ListFormat(c,{...d});return f=>m.format(f)})}}add(n,l){this.formats[n.toLowerCase().trim()]=l}addCached(n,l){this.formats[n.toLowerCase().trim()]=Ah(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(f=>f.indexOf(")")>-1)){const f=d.findIndex(g=>g.indexOf(")")>-1);d[0]=[d[0],...d.splice(1,f)].join(this.formatSeparator)}return d.reduce((f,g)=>{var y;const{formatName:h,formatOptions:b}=GN(g);if(this.formats[h]){let w=f;try{const N=((y=c==null?void 0:c.formatParams)==null?void 0:y[c.interpolationkey])||{},S=N.locale||N.lng||c.locale||c.lng||o;w=this.formats[h](f,S,{...b,...c,...N})}catch(N){this.logger.warn(N)}return w}else this.logger.warn(`there was no format function for ${h}`);return f},n)}}const $N=(s,n)=>{s.pending[n]!==void 0&&(delete s.pending[n],s.pendingCount--)};class YN extends No{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=as.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={},f={},g={};return n.forEach(h=>{let b=!0;l.forEach(y=>{const w=`${h}|${y}`;!o.reload&&this.store.hasResourceBundle(h,y)?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[y]===void 0&&(g[y]=!0)))}),b||(f[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(f),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 f={};this.queue.forEach(g=>{zN(g.loaded,[d],m),$N(g,n),l&&g.errors.push(l),g.pendingCount===0&&!g.done&&(Object.keys(g.loaded).forEach(h=>{f[h]||(f[h]={});const b=g.loaded[h];b.length&&b.forEach(y=>{f[h][y]===void 0&&(f[h][y]=!0)})}),g.done=!0,g.errors.length?g.callback(g.errors):g.callback())}),this.emit("loaded",f),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 f=(h,b)=>{if(this.readingCalls--,this.waitingReads.length>0){const y=this.waitingReads.shift();this.read(y.lng,y.ns,y.fcName,y.tried,y.wait,y.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=>f(null,b)).catch(f):f(null,h)}catch(h){f(h)}return}return g(n,l,f)}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();De(n)&&(n=this.languageUtils.toResolveHierarchy(n)),De(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,f)=>{m&&this.logger.warn(`${l}loading namespace ${d} for language ${c} failed`,m),!m&&f&&this.logger.log(`${l}loaded namespace ${d} for language ${c}`,f),this.loaded(n,m,f)})}saveMissing(n,l,o,c,d,m={},f=()=>{}){var g,h,b,y,w;if((h=(g=this.services)==null?void 0:g.utils)!=null&&h.hasLoadedNamespace&&!((y=(b=this.services)==null?void 0:b.utils)!=null&&y.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 N={...m,isUpdate:d},S=this.backend.create.bind(this.backend);if(S.length<6)try{let j;S.length===5?j=S(n,l,o,c,N):j=S(n,l,o,c),j&&typeof j.then=="function"?j.then(C=>f(null,C)).catch(f):f(null,j)}catch(j){f(j)}else S(n,l,o,c,f,N)}!n||!n[0]||this.store.addResource(n[0],l,o,c)}}}const Eh=()=>({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:s=>{let n={};if(typeof s[1]=="object"&&(n=s[1]),De(s[1])&&(n.defaultValue=s[1]),De(s[2])&&(n.tDescription=s[2]),typeof s[2]=="object"||typeof s[3]=="object"){const l=s[3]||s[2];Object.keys(l).forEach(o=>{n[o]=l[o]})}return n},interpolation:{escapeValue:!0,format:s=>s,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Rh=s=>{var n,l;return De(s.ns)&&(s.ns=[s.ns]),De(s.fallbackLng)&&(s.fallbackLng=[s.fallbackLng]),De(s.fallbackNS)&&(s.fallbackNS=[s.fallbackNS]),((l=(n=s.supportedLngs)==null?void 0:n.indexOf)==null?void 0:l.call(n,"cimode"))<0&&(s.supportedLngs=s.supportedLngs.concat(["cimode"])),typeof s.initImmediate=="boolean"&&(s.initAsync=s.initImmediate),s},so=()=>{},JN=s=>{Object.getOwnPropertyNames(Object.getPrototypeOf(s)).forEach(l=>{typeof s[l]=="function"&&(s[l]=s[l].bind(s))})};class Tl extends No{constructor(n={},l){if(super(),this.options=Rh(n),this.services={},this.logger=as,this.modules={external:[]},JN(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&&(De(n.ns)?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const o=Eh();this.options={...o,...this.options,...Rh(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?as.init(c(this.modules.logger),this.options):as.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=VN;const b=new Sh(this.options);this.store=new wh(this.options.resources,this.options);const y=this.services;y.logger=as,y.resourceStore=this.store,y.languageUtils=b,y.pluralResolver=new HN(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)&&(y.formatter=c(h),y.formatter.init&&y.formatter.init(y,this.options),this.options.interpolation.format=y.formatter.format.bind(y.formatter)),y.interpolator=new qN(this.options),y.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},y.backendConnector=new YN(c(this.modules.backend),y.resourceStore,y,this.options),y.backendConnector.on("*",(N,...S)=>{this.emit(N,...S)}),this.modules.languageDetector&&(y.languageDetector=c(this.modules.languageDetector),y.languageDetector.init&&y.languageDetector.init(y,this.options.detection,this.options)),this.modules.i18nFormat&&(y.i18nFormat=c(this.modules.i18nFormat),y.i18nFormat.init&&y.i18nFormat.init(this)),this.translator=new xo(this.services,this.options),this.translator.on("*",(N,...S)=>{this.emit(N,...S)}),this.modules.external.forEach(N=>{N.init&&N.init(this)})}if(this.format=this.options.interpolation.format,l||(l=so),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 f=Cl(),g=()=>{const h=(b,y)=>{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),f.resolve(y),l(b,y)};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),f}loadResources(n,l=so){var d,m;let o=l;const c=De(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 f=[],g=h=>{if(!h||h==="cimode")return;this.services.languageUtils.toResolveHierarchy(h).forEach(y=>{y!=="cimode"&&f.indexOf(y)<0&&f.push(y)})};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(f,this.options.ns,h=>{!h&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),o(h)})}else o(null)}reloadResources(n,l,o){const c=Cl();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=so),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"&&sx.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=Cl();this.emit("languageChanging",n);const c=f=>{this.language=f,this.languages=this.services.languageUtils.toResolveHierarchy(f),this.resolvedLanguage=void 0,this.setResolvedLanguage(f)},d=(f,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(f,(...h)=>this.t(...h))},m=f=>{var b,y;!n&&!f&&this.services.languageDetector&&(f=[]);const g=De(f)?f:f&&f[0],h=this.store.hasLanguageSomeTranslations(g)?g:this.services.languageUtils.getBestMatchFromCodes(De(f)?[f]:f);h&&(this.language||c(h),this.translator.language||this.translator.changeLanguage(h),(y=(b=this.services.languageDetector)==null?void 0:b.cacheUserLanguage)==null||y.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,...f)=>{let g;typeof m!="object"?g=this.options.overloadTranslationOptionHandler([d,m].concat(f)):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(y=>(typeof y=="function"&&(y=fd(y,{...this.options,...m})),`${g.keyPrefix}${h}${y}`)):(typeof d=="function"&&(d=fd(d,{...this.options,...m})),b=g.keyPrefix?`${g.keyPrefix}${h}${d}`:d),this.t(b,g)};return De(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=(f,g)=>{const h=this.services.backendConnector.state[`${f}|${g}`];return h===-1||h===0||h===2};if(l.precheck){const f=l.precheck(this,m);if(f!==void 0)return f}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=Cl();return this.options.ns?(De(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=Cl();De(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 f=m.getTextInfo();if(f&&f.direction)return f.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 Sh(Eh());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 Tl(n,l)}cloneInstance(n={},l=so){const o=n.forkResourceStore;o&&delete n.forkResourceStore;const c={...this.options,...n,isClone:!0},d=new Tl(c);if((n.debug!==void 0||n.prefix!==void 0)&&(d.logger=d.logger.clone(n)),["store","services","language"].forEach(f=>{d[f]=this[f]}),d.services={...this.services},d.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},o){const f=Object.keys(this.store.data).reduce((g,h)=>(g[h]={...this.store.data[h]},g[h]=Object.keys(g[h]).reduce((b,y)=>(b[y]={...g[h][y]},b),g[h]),g),{});d.store=new wh(f,c),d.services.resourceStore=d.store}return d.translator=new xo(d.services,c),d.translator.on("*",(f,...g)=>{d.emit(f,...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 Wt=Tl.createInstance();Wt.createInstance=Tl.createInstance;Wt.createInstance;Wt.dir;Wt.init;Wt.loadResources;Wt.reloadResources;Wt.use;Wt.changeLanguage;Wt.getFixedT;Wt.t;Wt.exists;Wt.setDefaultNamespace;Wt.hasLoadedNamespace;Wt.loadNamespaces;Wt.loadLanguages;const{slice:QN,forEach:XN}=[];function ZN(s){return XN.call(QN.call(arguments,1),n=>{if(n)for(const l in n)s[l]===void 0&&(s[l]=n[l])}),s}function WN(s){return typeof s!="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(s))}const Th=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,ek=function(s,n){const o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},c=encodeURIComponent(n);let d=`${s}=${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(!Th.test(o.domain))throw new TypeError("option domain is invalid");d+=`; Domain=${o.domain}`}if(o.path){if(!Th.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},Oh={create(s,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=ek(s,n,c)},read(s){const n=`${s}=`,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(s,n){this.create(s,"",-1,n)}};var tk={name:"cookie",lookup(s){let{lookupCookie:n}=s;if(n&&typeof document<"u")return Oh.read(n)||void 0},cacheUserLanguage(s,n){let{lookupCookie:l,cookieMinutes:o,cookieDomain:c,cookieOptions:d}=n;l&&typeof document<"u"&&Oh.create(l,s,o,c,d)}},rk={name:"querystring",lookup(s){var o;let{lookupQuerystring:n}=s,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 f=0;f<m.length;f++){const g=m[f].indexOf("=");g>0&&m[f].substring(0,g)===n&&(l=m[f].substring(g+1))}}return l}},sk={name:"hash",lookup(s){var c;let{lookupHash:n,lookupFromHashIndex:l}=s,o;if(typeof window<"u"){const{hash:d}=window.location;if(d&&d.length>2){const m=d.substring(1);if(n){const f=m.split("&");for(let g=0;g<f.length;g++){const h=f[g].indexOf("=");h>0&&f[g].substring(0,h)===n&&(o=f[g].substring(h+1))}}if(o)return o;if(!o&&l>-1){const f=d.match(/\/([a-zA-Z-]*)/g);return Array.isArray(f)?(c=f[typeof l=="number"?l:0])==null?void 0:c.replace("/",""):void 0}}}return o}};let bn=null;const zh=()=>{if(bn!==null)return bn;try{if(bn=typeof window<"u"&&window.localStorage!==null,!bn)return!1;const s="i18next.translate.boo";window.localStorage.setItem(s,"foo"),window.localStorage.removeItem(s)}catch{bn=!1}return bn};var ak={name:"localStorage",lookup(s){let{lookupLocalStorage:n}=s;if(n&&zh())return window.localStorage.getItem(n)||void 0},cacheUserLanguage(s,n){let{lookupLocalStorage:l}=n;l&&zh()&&window.localStorage.setItem(l,s)}};let vn=null;const Mh=()=>{if(vn!==null)return vn;try{if(vn=typeof window<"u"&&window.sessionStorage!==null,!vn)return!1;const s="i18next.translate.boo";window.sessionStorage.setItem(s,"foo"),window.sessionStorage.removeItem(s)}catch{vn=!1}return vn};var nk={name:"sessionStorage",lookup(s){let{lookupSessionStorage:n}=s;if(n&&Mh())return window.sessionStorage.getItem(n)||void 0},cacheUserLanguage(s,n){let{lookupSessionStorage:l}=n;l&&Mh()&&window.sessionStorage.setItem(l,s)}},lk={name:"navigator",lookup(s){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}},ik={name:"htmlTag",lookup(s){let{htmlTag:n}=s,l;const o=n||(typeof document<"u"?document.documentElement:null);return o&&typeof o.getAttribute=="function"&&(l=o.getAttribute("lang")),l}},ok={name:"path",lookup(s){var c;let{lookupFromPathIndex:n}=s;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}},ck={name:"subdomain",lookup(s){var c,d;let{lookupFromSubdomainIndex:n}=s;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 nx=!1;try{document.cookie,nx=!0}catch{}const lx=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];nx||lx.splice(1,1);const uk=()=>({order:lx,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:s=>s});class ix{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=ZN(l,this.options||{},uk()),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(tk),this.addDetector(rk),this.addDetector(ak),this.addDetector(nk),this.addDetector(lk),this.addDetector(ik),this.addDetector(ok),this.addDetector(ck),this.addDetector(sk)}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&&!WN(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)}))}}ix.type="languageDetector";const dk={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",embeddingSyncProgress:"Embeddings for {{serverName}}",embeddingSyncProgressAriaLabel:"Creating embeddings for {{serverName}}: {{current}} of {{total}} completed"},mk={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..."},pk={viewProfile:"View profile",userCenter:"User Center"},fk={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"},gk={label:"WeChat",title:"Connect via WeChat",qrCodeAlt:"WeChat QR Code",scanMessage:"Scan this QR code to connect with us on WeChat"},hk={label:"Discord",title:"Join our Discord server",community:"Join our growing community on Discord for support, discussions, and updates!"},xk={title:"Theme",light:"Light",dark:"Dark",system:"System"},yk={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"},bk={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 incoming MCP requests to upstream server requests (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"}},vk={online:"Online",offline:"Offline",connecting:"Connecting",oauthRequired:"OAuth Required",clickToAuthorize:"Click to authorize with OAuth",oauthWindowOpened:"OAuth authorization window opened. Please complete the authorization."},wk={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"},jk={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"},Sk={rowsPerPage:"Rows per page",showing:"Showing {{from}}-{{to}} of {{total}}"},Nk={dashboard:"Dashboard",servers:"Servers",groups:"Groups",prompts:"Prompts",resources:"Resources",users:"Users",settings:"Settings",changePassword:"Change Password",market:"Market",cloud:"Cloud Market",logs:"Logs",activity:"Activity"},kk={dashboard:{title:"Dashboard",totalServers:"Total",onlineServers:"Online",disabledServers:"Disabled",offlineServers:"Offline",connectingServers:"Connecting",recentServers:"Recent Servers"},servers:{title:"Server Management"},groups:{title:"Group Management"},prompts:{title:"Built-in Prompts"},resources:{title:"Built-in Resources"},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"}},Ck={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"},Ak={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",promptSelection:"Prompt Selection",resourceSelection:"Resource Selection",toolsSelected:"Selected",promptsSelected:"Selected",resourcesSelected:"Selected",allTools:"All",allPrompts:"All prompts",allResources:"All resources",selectedTools:"Selected tools",selectedPrompts:"Selected prompts",selectedResources:"Selected resources",selectAll:"Select All",selectNone:"Select None",configureTools:"Configure Tools",configureCapabilities:"Configure Tools, Prompts, and Resources",previewPrompts:"[prompts: {{items}}]",previewResources:"[resources: {{items}}]",previewAllTools:"(all tools)",previewAllPrompts:"(all prompts)",previewAllResources:"(all resources)"},Ek={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"},Rk={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."}},Tk={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}}"},Ok={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"},zk={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",descriptionUpdateSuccess:"Tool description updated successfully",descriptionUpdateFailed:"Failed to update tool description",restoreDefault:"Restore default",restoreDefaultSuccess:"Tool description restored to default",restoreDefaultFailed:"Failed to restore the default tool description",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}}"},Mk={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",restoreDefault:"Restore default",restoreDefaultSuccess:"Prompt description restored to default",restoreDefaultFailed:"Failed to restore the default prompt description"},Pk={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",bearerAuthHeaderName:"Bearer Auth Header Name",bearerAuthHeaderNameDescription:"Header name used to receive MCP bearer credentials. Change this when upstream passthrough headers also use Authorization.",bearerAuthHeaderNamePlaceholder:"e.g. Authorization or X-MCP-Authorization",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)",jsonBodyLimit:"JSON Body Size Limit",jsonBodyLimitDescription:"Express JSON request size limit. This affects large OpenAPI schema uploads as well.",jsonBodyLimitPlaceholder:"e.g. 1mb, 5mb, 1024kb",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-compatible Base URL",openaiApiBaseUrlPlaceholder:"https://api.openai.com/v1",openaiApiKey:"LLM Provider API Key",openaiApiKeyPlaceholder:"Enter LLM provider API key",openaiApiEmbeddingModel:"Embedding Model Name",openaiApiEmbeddingModelPlaceholder:"text-embedding-3-small",basePacingDelayMs:"Base Pacing Delay (ms)",basePacingDelayMsDescription:"Baseline delay between embedding API requests. Defaults to 0 — the system manages rate limits automatically: it respects Retry-After headers, falls back to a 63-second cooldown, and increases the pacing delay after any 403/429 response. Set a non-zero value only if your provider enforces a fixed minimum interval between requests.",basePacingDelayMsPlaceholder:"Empty = default 0 ms",basePacingDelayMsAuto:"Default ({{value}} ms): rate limiting is managed automatically.",basePacingDelayMsZero:"0 ms (default): rate limiting is managed automatically via adaptive throttling and retry logic.",basePacingDelayMsOverride:"Custom value: overrides the default baseline pacing delay.",embeddingEncodingFormat:"Embedding Encoding Format",embeddingEncodingFormatDescription:"Encoding format for embedding vectors. Auto will detect based on provider support.",embeddingEncodingFormatAuto:"Auto (Recommended)",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",azureOpenaiEmbeddingModel:"Azure Embedding Model Name",azureOpenaiEmbeddingModelDescription:"The actual OpenAI model name deployed in Azure (e.g. text-embedding-3-small). Used for accurate token counting before sending text to the API.",azureOpenaiEmbeddingModelPlaceholder:"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.",embeddingMaxTokens:"Max Embedding Tokens",embeddingMaxTokensDescription:"Maximum tokens for text truncation before generating embeddings. Leave empty to use the model default automatically. A custom value always overrides the model default. Manually setting this value is especially useful when using local LLM providers to prevent truncation errors.",embeddingMaxTokensPlaceholder:"Empty = auto by model",embeddingMaxTokensAuto:"Auto: {{limit}} tokens (model default for {{model}})",embeddingMaxTokensOverride:"This value overrides the model default.",smartRoutingConfigUpdated:"Smart routing configuration updated successfully",smartRoutingRequiredFields:"Database URL is required to enable smart routing. An LLM Provider API Key is required for cloud-based providers (local LLMs usually don't require an API key, enter any value to pass the form validation)",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.mcphub.app",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"},Dk={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"},Lk={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:"},Uk={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:"},_k={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."},Bk={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"}},Ik={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"},Fk={add:"Add Prompt",addNew:"Add New Prompt",edit:"Edit Prompt",delete:"Delete",noPrompts:"No built-in prompts configured",addFirst:"Add your first prompt",name:"Name",namePlaceholder:"e.g. code-review",title:"Title",titlePlaceholder:"e.g. Code Review Prompt",description:"Description",descriptionPlaceholder:"Brief description of the prompt",template:"Template",templatePlaceholder:"Enter template text with {{parameter}} placeholders...",templateHint:"Use {{paramName}} for template parameters",arguments:"Arguments",addArgument:"Add Argument",argName:"Name",argDescription:"Description",argRequired:"Required",enabled:"Enabled",active:"Active",inactive:"Inactive",nameRequired:"Name is required",templateRequired:"Template is required",fetchError:"Failed to load built-in prompts",createError:"Failed to create prompt",updateError:"Failed to update prompt",deleteError:"Failed to delete prompt",saveError:"Failed to save prompt",confirmDelete:"Delete Prompt",deleteWarning:'Are you sure you want to delete the prompt "{{name}}"? This action cannot be undone.'},Hk={add:"Add Resource",addNew:"Add New Resource",edit:"Edit Resource",delete:"Delete",noResources:"No built-in resources configured",addFirst:"Add your first resource",uri:"URI",uriPlaceholder:"e.g. resource://docs/guide",name:"Name",namePlaceholder:"e.g. User Guide",description:"Description",descriptionPlaceholder:"Brief description of the resource",mimeType:"MIME Type",content:"Content",contentPlaceholder:"Enter the resource content...",enabled:"Enabled",active:"Active",inactive:"Inactive",descriptionUpdateSuccess:"Resource description updated successfully",descriptionUpdateFailed:"Failed to update resource description",restoreDefault:"Restore default",restoreDefaultSuccess:"Resource description restored to default",restoreDefaultFailed:"Failed to restore the default resource description",uriRequired:"URI is required",contentRequired:"Content is required",fetchError:"Failed to load built-in resources",createError:"Failed to create resource",updateError:"Failed to update resource",deleteError:"Failed to delete resource",saveError:"Failed to save resource",confirmDelete:"Delete Resource",deleteWarning:'Are you sure you want to delete the resource "{{name}}"? This action cannot be undone.'},qk={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"},Gk={exportButton:"Export Template",importButton:"Import Template",exportTitle:"Export Configuration Template",importTitle:"Import Configuration Template",name:"Template Name",nameRequired:"Template name is required",namePlaceholder:"e.g., Frontend Dev Tools",description:"Description",descriptionPlaceholder:"e.g., Standard MCP servers for frontend development",selectGroups:"Select Groups",selectGroupsHelp:"Leave empty to export all groups",selectAll:"Select All",deselectAll:"Deselect All",includeDisabled:"Include disabled servers",exportNote:"Secrets (API keys, tokens, passwords) will be replaced with ${PLACEHOLDER} references. Recipients must supply their own credentials.",export:"Export",exporting:"Exporting...",exportFailed:"Failed to export template",import:"Import",importing:"Importing...",importFailed:"Failed to import template",invalidFormat:"Invalid template format. Must contain version, name, servers, and groups fields.",parseError:"Failed to parse JSON. Please check the format and try again.",uploadFile:"Upload Template File",or:"or",pasteJson:"Paste Template JSON",pastePlaceholder:"Paste your .mcphub-template.json content here...",version:"Version",createdAt:"Created",servers:"Servers",groups:"Groups",serversInGroup:"server(s)",envVarsNeeded:"Required Environment Variables — set these before using the imported servers:",importResult:"Servers: {{serversCreated}} created, {{serversSkipped}} skipped. Groups: {{groupsCreated}} created, {{groupsSkipped}} skipped."},Kk={app:dk,about:mk,profile:pk,sponsor:fk,wechat:gk,discord:hk,theme:xk,auth:yk,server:bk,status:vk,errors:wk,common:jk,pagination:Sk,nav:Nk,pages:kk,logs:Ck,groups:Ak,market:Ek,oauthServer:Rk,cloud:Tk,registry:Ok,tool:zk,prompt:Mk,settings:Pk,mcpb:Dk,jsonImport:Lk,groupImport:Uk,users:_k,api:Bk,oauthCallback:Ik,builtinPrompts:Fk,builtinResources:Hk,activity:qk,template:Gk},Vk={title:"MCPHub 控制面板",error:"错误",closeButton:"关闭",noServers:"没有可用的 MCP 服务器",loading:"加载中...",logout:"退出登录",profile:"个人资料",changePassword:"修改密码",toggleSidebar:"切换侧边栏",welcomeUser:"欢迎, {{username}}",name:"MCPHub",embeddingSyncProgress:"正在为 {{serverName}} 创建嵌入",embeddingSyncProgressAriaLabel:"正在为 {{serverName}} 创建嵌入:已完成 {{current}}/{{total}}"},$k={title:"关于",versionInfo:"MCPHub 版本: {{version}}",newVersion:"有新版本可用!",currentVersion:"当前版本",newVersionAvailable:"新版本 {{version}} 已发布",viewOnGitHub:"在 GitHub 上查看",checkForUpdates:"检查更新",checking:"检查更新中..."},Yk={viewProfile:"查看个人中心",userCenter:"个人中心"},Jk={label:"赞助",title:"支持项目",rewardAlt:"赞赏码",supportMessage:"通过捐赠支持 MCPHub 的开发!",supportButton:"在 Ko-fi 上支持"},Qk={label:"微信",title:"微信联系",qrCodeAlt:"微信二维码",scanMessage:"扫描二维码添加微信"},Xk={label:"Discord",title:"加入我们的 Discord 服务器",community:"加入我们不断壮大的 Discord 社区,获取支持、参与讨论并了解最新动态!"},Zk={title:"主题",light:"浅色",dark:"深色",system:"系统"},Wk={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 个字符,且包含字母、数字和特殊字符"},e4={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:"要从传入的 MCP 请求透传到上游服务器请求的请求头名称列表,用逗号分隔(如:Authorization, X-API-Key)"},oauth:{sectionTitle:"OAuth 配置",sectionDescription:"为需要 OAuth 的服务器配置客户端凭据(可选)。",clientId:"客户端 ID",clientSecret:"客户端密钥",authorizationEndpoint:"授权端点",tokenEndpoint:"令牌端点",scopes:"权限范围(Scopes)",scopesPlaceholder:"scope1 scope2",resource:"资源 / 受众",accessToken:"访问令牌",refreshToken:"刷新令牌"}},t4={online:"在线",offline:"离线",connecting:"连接中",oauthRequired:"需要OAuth授权",clickToAuthorize:"点击进行OAuth授权",oauthWindowOpened:"OAuth授权窗口已打开,请完成授权。"},r4={general:"发生错误",network:"网络连接错误,请检查您的互联网连接",serverConnection:"无法连接到服务器,请检查服务器是否正在运行",serverAdd:"添加服务器失败,请检查服务器状态",serverUpdate:"编辑服务器 {{serverName}} 失败,请检查服务器状态",serverFetch:"获取服务器数据失败,请稍后重试",failedToReloadServer:"重载服务器失败",initialStartup:"服务器可能正在启动中。首次启动可能需要一些时间,请耐心等候...",serverInstall:"安装服务器失败",failedToFetchSettings:"获取设置失败",failedToUpdateSystemConfig:"更新系统配置失败",failedToUpdateRouteConfig:"更新路由配置失败",failedToUpdateSmartRoutingConfig:"更新智能路由配置失败"},s4={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:"未激活"},a4={rowsPerPage:"每页行数",showing:"显示第 {{from}}-{{to}} 条,共 {{total}} 条"},n4={dashboard:"仪表盘",servers:"服务器",settings:"设置",changePassword:"修改密码",groups:"分组",prompts:"提示词",resources:"资源",users:"用户",market:"市场",cloud:"云端市场",logs:"日志",activity:"活动"},l4={dashboard:{title:"仪表盘",totalServers:"总数",onlineServers:"在线",disabledServers:"禁用",offlineServers:"离线",connectingServers:"连接中",recentServers:"最近的服务器"},servers:{title:"服务器管理"},settings:{title:"设置",language:"语言",account:"账户设置",password:"修改密码",appearance:"外观",routeConfig:"安全配置",installConfig:"安装",smartRouting:"智能路由",oauthServer:"OAuth"},groups:{title:"分组管理"},prompts:{title:"内置提示词"},resources:{title:"内置资源"},users:{title:"用户管理"},market:{title:"市场中心 - 本地市场和云端市场"},logs:{title:"系统日志"}},i4={filters:"筛选",search:"搜索日志...",autoScroll:"自动滚动",clearLogs:"清除日志",loading:"加载日志中...",noLogs:"暂无日志。",noMatch:"没有匹配当前筛选条件的日志。",mainProcess:"主进程",childProcess:"子进程",main:"主",child:"子"},o4={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:"工具选择",promptSelection:"提示词选择",resourceSelection:"资源选择",toolsSelected:"选择",promptsSelected:"选择",resourcesSelected:"选择",allTools:"全部",allPrompts:"全部提示词",allResources:"全部资源",selectedTools:"选中的工具",selectedPrompts:"选中的提示词",selectedResources:"选中的资源",selectAll:"全选",selectNone:"全不选",configureTools:"配置工具",configureCapabilities:"配置工具、提示词和资源",previewPrompts:"[提示词: {{items}}]",previewResources:"[资源: {{items}}]",previewAllTools:"(全部工具)",previewAllPrompts:"(全部提示词)",previewAllResources:"(全部资源)"},c4={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:"确认并安装"},u4={authorizeTitle:"授权应用",authorizeSubtitle:"允许此应用访问您的 MCPHub 账号。",buttons:{approve:"允许访问",deny:"拒绝",approveSubtitle:"如果您信任此应用,建议选择允许。",denySubtitle:"您可以在之后随时再次授权。"}},d4={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}}"},m4={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:"请求头"},p4={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:"切换工具状态失败",descriptionUpdateSuccess:"工具描述更新成功",descriptionUpdateFailed:"更新工具描述失败",restoreDefault:"恢复默认值",restoreDefaultSuccess:"工具描述已恢复为默认值",restoreDefaultFailed:"恢复默认工具描述失败",parameters:"工具参数",formMode:"表单模式",jsonMode:"JSON 模式",jsonConfiguration:"JSON 配置",invalidJsonFormat:"无效的 JSON 格式",fixJsonBeforeSwitching:"请修复 JSON 格式后再切换到表单模式",item:"项目 {{index}}",addItem:"添加 {{key}} 项目",enterKey:"输入 {{key}}"},f4={run:"获取",running:"获取中...",result:"提示词结果",error:"提示词错误",execution:"提示词执行",successful:"成功",failed:"失败",errorDetails:"错误详情:",noContent:"提示词执行成功但未返回内容。",unknownError:"发生未知错误",jsonResponse:"JSON 响应:",description:"描述",messages:"消息",noDescription:"无描述信息",runPromptWithName:"获取提示词: {{name}}",descriptionUpdateSuccess:"提示词描述更新成功",descriptionUpdateFailed:"更新提示词描述失败",restoreDefault:"恢复默认值",restoreDefaultSuccess:"提示词描述已恢复为默认值",restoreDefaultFailed:"恢复默认提示词描述失败"},g4={enableGlobalRoute:"启用全局路由",enableGlobalRouteDescription:"允许不指定组 ID 就连接到 /sse 端点",enableGroupNameRoute:"启用组名路由",enableGroupNameRouteDescription:"允许使用组名而不仅仅是组 ID 连接到 /sse 端点",enableBearerAuth:"启用 Bearer 认证",enableBearerAuthDescription:"对 MCP 端点启用 Bearer 令牌认证(默认开启)",bearerAuthKey:"Bearer 认证密钥",bearerAuthKeyDescription:"Bearer 令牌中需要携带的认证密钥",bearerAuthKeyPlaceholder:"请输入 Bearer 认证密钥",bearerAuthHeaderName:"Bearer 认证请求头名称",bearerAuthHeaderNameDescription:"用于接收 MCP Bearer 凭证的请求头名称。当上游透传头也使用 Authorization 时,可改成其它名称以避免冲突。",bearerAuthHeaderNamePlaceholder:"例如:Authorization 或 X-MCP-Authorization",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 端点认证)",jsonBodyLimit:"JSON 请求体大小限制",jsonBodyLimitDescription:"Express JSON 请求体大小限制,大型 OpenAPI schema 上传也会受此配置影响。",jsonBodyLimitPlaceholder:"例如:1mb、5mb、1024kb",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 兼容基础地址",openaiApiBaseUrlPlaceholder:"https://api.openai.com/v1",openaiApiKey:"LLM 提供商 API 密钥",openaiApiKeyDescription:"用于访问嵌入服务的 API 密钥",openaiApiKeyPlaceholder:"请输入 LLM 提供商 API 密钥",openaiApiEmbeddingModel:"嵌入模型名称",openaiApiEmbeddingModelPlaceholder:"text-embedding-3-small",basePacingDelayMs:"基础节流延迟(毫秒)",basePacingDelayMsDescription:"向嵌入服务提供方发送请求之间的基础等待时间。默认为 0 — 系统自动管理限流:优先遵守 Retry-After 响应头,若无该头则等待 63 秒,并在每次 403/429 后自动提高节流延迟。仅当提供方要求固定最小请求间隔时才需设置非零值。",basePacingDelayMsPlaceholder:"留空 = 默认 0 毫秒",basePacingDelayMsAuto:"默认({{value}} 毫秒):限流由系统自动管理。",basePacingDelayMsZero:"0 毫秒(默认):限流通过自适应节流和重试逻辑自动管理。",basePacingDelayMsOverride:"自定义值:覆盖默认的基础节流延迟。",embeddingEncodingFormat:"嵌入编码格式",embeddingEncodingFormatDescription:"嵌入向量的编码格式。自动模式会根据服务商支持情况自动选择。",embeddingEncodingFormatAuto:"自动(推荐)",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",azureOpenaiEmbeddingModel:"Azure 嵌入模型名称",azureOpenaiEmbeddingModelDescription:"在 Azure 中部署的实际 OpenAI 模型名称(例如 text-embedding-3-small),用于在发送请求前准确进行 Token 计数。",azureOpenaiEmbeddingModelPlaceholder:"text-embedding-3-small",progressiveDisclosure:"渐进式披露",progressiveDisclosureDescription:"开启后,search_tools 只返回工具名称和描述,通过 describe_tool 获取完整参数定义,可减少 Token 消耗",embeddingMaxTokens:"最大嵌入 Token 数",embeddingMaxTokensDescription:"生成嵌入前截断文本的最大 Token 数。留空将自动使用模型默认值。设置自定义值将始终覆盖模型默认值。当使用本地 LLM 提供商时,手动设置此值特别有用,可防止截断错误。",embeddingMaxTokensPlaceholder:"留空 = 自动(按模型)",embeddingMaxTokensAuto:"自动:{{limit}} tokens({{model}} 的模型默认值)",embeddingMaxTokensOverride:"此值将覆盖模型默认值。",smartRoutingConfigUpdated:"智能路由配置更新成功",smartRoutingRequiredFields:"启用智能路由需要填写数据库连接地址。LLM 提供商 API 密钥仅在使用云端提供商时才需要(本地 LLM 通常不需要 API 密钥,可输入任意值通过表单验证)",smartRoutingValidationError:"启用智能路由前请先填写必要字段:{{fields}}",mcpRouterConfig:"云端市场",mcpRouterApiKey:"MCPRouter API 密钥",mcpRouterApiKeyDescription:"用于访问 MCPRouter 云端市场服务的 API 密钥",mcpRouterApiKeyPlaceholder:"请输入 MCPRouter API 密钥",mcpRouterReferer:"引用地址",mcpRouterRefererDescription:"MCPRouter API 请求的引用地址头",mcpRouterRefererPlaceholder:"https://www.mcphub.app",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:"请输入合法的非负数字"},h4={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:"覆盖"},x4={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}} 个服务器。部分服务器失败:"},y4={button:"导入",title:"从 JSON 导入分组",inputLabel:"分组配置 JSON",inputHelp:"粘贴您的分组配置 JSON。每个分组可以包含一个服务器列表。",preview:"预览",previewTitle:"预览要导入的分组",import:"导入",importing:"导入中...",invalidFormat:"无效的 JSON 格式。JSON 必须包含 'groups' 数组。",missingName:"每个分组必须有 'name' 字段。",parseError:"解析 JSON 失败。请检查格式后重试。",addFailed:"添加分组失败",importFailed:"导入分组失败",partialSuccess:"成功导入 {{count}} / {{total}} 个分组。部分分组失败:"},b4={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}}' 吗?此操作无法撤消。"},v4={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:"服务器工具更新成功"}},w4={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:"关闭窗口"},j4={add:"添加提示词",addNew:"添加新提示词",edit:"编辑提示词",delete:"删除",noPrompts:"暂无内置提示词",addFirst:"添加第一个提示词",name:"名称",namePlaceholder:"例如 code-review",title:"标题",titlePlaceholder:"例如 代码审查提示词",description:"描述",descriptionPlaceholder:"提示词的简要描述",template:"模板",templatePlaceholder:"输入包含 {{parameter}} 占位符的模板文本...",templateHint:"使用 {{paramName}} 作为模板参数",arguments:"参数",addArgument:"添加参数",argName:"名称",argDescription:"描述",argRequired:"必填",enabled:"启用",active:"已启用",inactive:"已禁用",nameRequired:"名称为必填项",templateRequired:"模板为必填项",fetchError:"加载内置提示词失败",createError:"创建提示词失败",updateError:"更新提示词失败",deleteError:"删除提示词失败",saveError:"保存提示词失败",confirmDelete:"删除提示词",deleteWarning:'确定要删除提示词 "{{name}}" 吗?此操作无法撤销。'},S4={add:"添加资源",addNew:"添加新资源",edit:"编辑资源",delete:"删除",noResources:"暂无内置资源",addFirst:"添加第一个资源",uri:"URI",uriPlaceholder:"例如 resource://docs/guide",name:"名称",namePlaceholder:"例如 用户指南",description:"描述",descriptionPlaceholder:"资源的简要描述",mimeType:"MIME 类型",content:"内容",contentPlaceholder:"输入资源内容...",enabled:"启用",active:"已启用",inactive:"已禁用",descriptionUpdateSuccess:"资源描述更新成功",descriptionUpdateFailed:"更新资源描述失败",restoreDefault:"恢复默认值",restoreDefaultSuccess:"资源描述已恢复为默认值",restoreDefaultFailed:"恢复默认资源描述失败",uriRequired:"URI 为必填项",contentRequired:"内容为必填项",fetchError:"加载内置资源失败",createError:"创建资源失败",updateError:"更新资源失败",deleteError:"删除资源失败",saveError:"保存资源失败",confirmDelete:"删除资源",deleteWarning:'确定要删除资源 "{{name}}" 吗?此操作无法撤销。'},N4={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:"活动跟踪功能仅在数据库模式下可用"},k4={exportButton:"导出模板",importButton:"导入模板",exportTitle:"导出配置模板",importTitle:"导入配置模板",name:"模板名称",nameRequired:"模板名称不能为空",namePlaceholder:"例如:前端开发工具",description:"描述",descriptionPlaceholder:"例如:前端开发标准 MCP 服务器集合",selectGroups:"选择分组",selectGroupsHelp:"留空则导出全部分组",selectAll:"全选",deselectAll:"取消全选",includeDisabled:"包含已禁用的服务器",exportNote:"密钥(API Key、Token、密码等)将被替换为 ${PLACEHOLDER} 占位符。接收者需要提供自己的凭据。",export:"导出",exporting:"导出中...",exportFailed:"导出模板失败",import:"导入",importing:"导入中...",importFailed:"导入模板失败",invalidFormat:"模板格式无效。必须包含 version、name、servers 和 groups 字段。",parseError:"JSON 解析失败,请检查格式后重试。",uploadFile:"上传模板文件",or:"或",pasteJson:"粘贴模板 JSON",pastePlaceholder:"在此粘贴 .mcphub-template.json 内容...",version:"版本",createdAt:"创建时间",servers:"服务器",groups:"分组",serversInGroup:"个服务器",envVarsNeeded:"所需环境变量 — 请在使用导入的服务器前设置这些变量:",importResult:"服务器:创建 {{serversCreated}} 个,跳过 {{serversSkipped}} 个。分组:创建 {{groupsCreated}} 个,跳过 {{groupsSkipped}} 个。"},C4={app:Vk,about:$k,profile:Yk,sponsor:Jk,wechat:Qk,discord:Xk,theme:Zk,auth:Wk,server:e4,status:t4,errors:r4,common:s4,pagination:a4,nav:n4,pages:l4,logs:i4,groups:o4,market:c4,oauthServer:u4,cloud:d4,registry:m4,tool:p4,prompt:f4,settings:g4,mcpb:h4,jsonImport:x4,groupImport:y4,users:b4,api:v4,oauthCallback:w4,builtinPrompts:j4,builtinResources:S4,activity:N4,template:k4},A4={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",embeddingSyncProgress:"Embeddings pour {{serverName}}",embeddingSyncProgressAriaLabel:"Création des embeddings pour {{serverName}} : {{current}} sur {{total}} terminés"},E4={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..."},R4={viewProfile:"Voir le profil",userCenter:"Centre utilisateur"},T4={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"},O4={label:"WeChat",title:"Se connecter via WeChat",qrCodeAlt:"QR Code WeChat",scanMessage:"Scannez ce QR code pour nous contacter sur WeChat"},z4={label:"Discord",title:"Rejoignez notre serveur Discord",community:"Rejoignez notre communauté grandissante sur Discord pour du support, des discussions et des mises à jour !"},M4={title:"Thème",light:"Clair",dark:"Sombre",system:"Système"},P4={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"},D4={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 MCP entrantes vers les requêtes du serveur 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"}},L4={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."},U4={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"},_4={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"},B4={rowsPerPage:"Lignes par page",showing:"Affichage de {{from}}-{{to}} sur {{total}}"},I4={dashboard:"Tableau de bord",servers:"Serveurs",groups:"Groupes",prompts:"Prompts",resources:"Ressources",users:"Utilisateurs",settings:"Paramètres",changePassword:"Changer le mot de passe",market:"Marché",cloud:"Marché Cloud",logs:"Journaux",activity:"Activité"},F4={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"},prompts:{title:"Prompts intégrés"},resources:{title:"Ressources intégrées"},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"}},H4={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"},q4={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",promptSelection:"Sélection des prompts",resourceSelection:"Sélection des ressources",toolsSelected:"Sélectionné",promptsSelected:"Sélectionné",resourcesSelected:"Sélectionné",allTools:"Tous",allPrompts:"Tous les prompts",allResources:"Toutes les ressources",selectedTools:"Outils sélectionnés",selectedPrompts:"Prompts sélectionnés",selectedResources:"Ressources sélectionnées",selectAll:"Tout sélectionner",selectNone:"Ne rien sélectionner",configureTools:"Configurer les outils",configureCapabilities:"Configurer les outils, prompts et ressources",previewPrompts:"[prompts : {{items}}]",previewResources:"[ressources : {{items}}]",previewAllTools:"(tous les outils)",previewAllPrompts:"(tous les prompts)",previewAllResources:"(toutes les ressources)"},G4={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"},K4={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."}},V4={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}}"},$4={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"},Y4={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",descriptionUpdateSuccess:"Description de l'outil mise à jour avec succès",descriptionUpdateFailed:"Échec de la mise à jour de la description de l'outil",restoreDefault:"Restaurer par défaut",restoreDefaultSuccess:"La description de l'outil a été restaurée à sa valeur par défaut",restoreDefaultFailed:"Échec de la restauration de la description par défaut 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}}"},J4={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",restoreDefault:"Restaurer par défaut",restoreDefaultSuccess:"La description de l'invite a été restaurée à sa valeur par défaut",restoreDefaultFailed:"Échec de la restauration de la description par défaut de l'invite"},Q4=JSON.parse(`{"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","bearerAuthHeaderName":"Nom de l'en-tête Bearer","bearerAuthHeaderNameDescription":"Nom de l'en-tête utilisé pour recevoir les identifiants Bearer MCP. Modifiez-le si les en-têtes transmis en amont utilisent aussi Authorization.","bearerAuthHeaderNamePlaceholder":"ex. Authorization ou X-MCP-Authorization","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)","jsonBodyLimit":"Limite de taille du corps JSON","jsonBodyLimitDescription":"Limite de taille des requêtes JSON Express. Les gros téléchargements de schémas OpenAPI utilisent aussi ce paramètre.","jsonBodyLimitPlaceholder":"ex. 1mb, 5mb, 1024kb","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 compatible OpenAI","openaiApiBaseUrlPlaceholder":"https://api.openai.com/v1","openaiApiKey":"Clé API du fournisseur LLM","openaiApiKeyPlaceholder":"Entrez la clé API du fournisseur LLM","openaiApiEmbeddingModel":"Nom du modèle d'intégration","openaiApiEmbeddingModelPlaceholder":"text-embedding-3-small","basePacingDelayMs":"Délai de pacing de base (ms)","basePacingDelayMsDescription":"Délai de base entre les requêtes d'embeddings envoyées au fournisseur. Par défaut 0 — le système gère les limites de débit automatiquement : il respecte les en-têtes Retry-After, applique un délai de 63 secondes en l'absence d'en-tête, et augmente le pacing après chaque réponse 403/429. Définissez une valeur non nulle uniquement si votre fournisseur impose un intervalle minimum fixe.","basePacingDelayMsPlaceholder":"Vide = valeur par défaut 0 ms","basePacingDelayMsAuto":"Par défaut ({{value}} ms) : la gestion des limites de débit est automatique.","basePacingDelayMsZero":"0 ms (par défaut) : la gestion des limites de débit est automatique via throttling adaptatif et logique de retry.","basePacingDelayMsOverride":"Valeur personnalisée : remplace le délai de pacing de base par défaut.","embeddingEncodingFormat":"Format d'encodage des embeddings","embeddingEncodingFormatDescription":"Format d'encodage pour les vecteurs d'embedding. Auto détectera en fonction du support du fournisseur.","embeddingEncodingFormatAuto":"Auto (Recommandé)","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","azureOpenaiEmbeddingModel":"Nom du modèle d'embedding Azure","azureOpenaiEmbeddingModelDescription":"Le nom réel du modèle OpenAI déployé dans Azure (ex. text-embedding-3-small). Utilisé pour le comptage précis des tokens avant l'envoi à l'API.","azureOpenaiEmbeddingModelPlaceholder":"text-embedding-3-small","smartRoutingConfigUpdated":"Configuration du routage intelligent mise à jour avec succès","progressiveDisclosure":"Divulgation progressive","progressiveDisclosureDescription":"Lorsqu'elle est activée, search_tools renvoie uniquement les noms et descriptions des outils. Utilisez describe_tool pour obtenir le schéma complet des paramètres, réduisant ainsi l'utilisation des tokens.","embeddingMaxTokens":"Tokens max pour les embeddings","embeddingMaxTokensDescription":"Nombre maximum de tokens pour la troncature du texte avant la génération des embeddings. Laissez vide pour utiliser automatiquement la valeur par défaut du modèle. Une valeur personnalisée remplace toujours la valeur par défaut du modèle. La configuration manuelle de cette valeur est particulièrement utile lors de l'utilisation de fournisseurs LLM locaux pour éviter les erreurs de troncature.","embeddingMaxTokensPlaceholder":"Vide = automatique selon le modèle","embeddingMaxTokensAuto":"Auto : {{limit}} tokens (valeur par défaut du modèle {{model}})","embeddingMaxTokensOverride":"Cette valeur remplace la valeur par défaut du modèle.","smartRoutingRequiredFields":"L'URL de la base de données est requise pour activer le routage intelligent. Une clé API du fournisseur LLM est requise pour les fournisseurs cloud (les LLM locaux ne nécessitent généralement pas de clé API, entrez n'importe quelle valeur pour passer la validation du formulaire)","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.mcphub.app","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"}`),X4={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"},Z4={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é :"},W4={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é :"},eC={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."},tC={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"}},rC={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"},sC={add:"Ajouter un prompt",addNew:"Ajouter un nouveau prompt",edit:"Modifier le prompt",delete:"Supprimer",noPrompts:"Aucun prompt intégré configuré",addFirst:"Ajoutez votre premier prompt",name:"Nom",namePlaceholder:"ex. code-review",title:"Titre",titlePlaceholder:"ex. Prompt de revue de code",description:"Description",descriptionPlaceholder:"Brève description du prompt",template:"Modèle",templatePlaceholder:"Entrez le texte du modèle avec des marqueurs {{paramètre}}...",templateHint:"Utilisez {{paramName}} pour les paramètres du modèle",arguments:"Arguments",addArgument:"Ajouter un argument",argName:"Nom",argDescription:"Description",argRequired:"Requis",enabled:"Activé",active:"Actif",inactive:"Inactif",nameRequired:"Le nom est requis",templateRequired:"Le modèle est requis",fetchError:"Échec du chargement des prompts intégrés",createError:"Échec de la création du prompt",updateError:"Échec de la mise à jour du prompt",deleteError:"Échec de la suppression du prompt",saveError:"Échec de l'enregistrement du prompt",confirmDelete:"Supprimer le prompt",deleteWarning:'Êtes-vous sûr de vouloir supprimer le prompt "{{name}}" ? Cette action est irréversible.'},aC={add:"Ajouter une ressource",addNew:"Ajouter une nouvelle ressource",edit:"Modifier la ressource",delete:"Supprimer",noResources:"Aucune ressource intégrée configurée",addFirst:"Ajoutez votre première ressource",uri:"URI",uriPlaceholder:"ex. resource://docs/guide",name:"Nom",namePlaceholder:"ex. Guide utilisateur",description:"Description",descriptionPlaceholder:"Brève description de la ressource",mimeType:"Type MIME",content:"Contenu",contentPlaceholder:"Entrez le contenu de la ressource...",enabled:"Activé",active:"Actif",inactive:"Inactif",descriptionUpdateSuccess:"Description de la ressource mise à jour avec succès",descriptionUpdateFailed:"Échec de la mise à jour de la description de la ressource",restoreDefault:"Restaurer par défaut",restoreDefaultSuccess:"La description de la ressource a été restaurée à sa valeur par défaut",restoreDefaultFailed:"Échec de la restauration de la description par défaut de la ressource",uriRequired:"L'URI est requis",contentRequired:"Le contenu est requis",fetchError:"Échec du chargement des ressources intégrées",createError:"Échec de la création de la ressource",updateError:"Échec de la mise à jour de la ressource",deleteError:"Échec de la suppression de la ressource",saveError:"Échec de l'enregistrement de la ressource",confirmDelete:"Supprimer la ressource",deleteWarning:'Êtes-vous sûr de vouloir supprimer la ressource "{{name}}" ? Cette action est irréversible.'},nC={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"},lC={exportButton:"Exporter le modèle",importButton:"Importer le modèle",exportTitle:"Exporter le modèle de configuration",importTitle:"Importer le modèle de configuration",name:"Nom du modèle",nameRequired:"Le nom du modèle est requis",namePlaceholder:"Ex. : Outils de développement frontend",description:"Description",descriptionPlaceholder:"Ex. : Serveurs MCP standards pour le développement frontend",selectGroups:"Sélectionner les groupes",selectGroupsHelp:"Laisser vide pour exporter tous les groupes",selectAll:"Tout sélectionner",deselectAll:"Tout désélectionner",includeDisabled:"Inclure les serveurs désactivés",exportNote:"Les secrets (clés API, tokens, mots de passe) seront remplacés par des références ${PLACEHOLDER}. Les destinataires devront fournir leurs propres identifiants.",export:"Exporter",exporting:"Exportation...",exportFailed:"Échec de l'exportation du modèle",import:"Importer",importing:"Importation...",importFailed:"Échec de l'importation du modèle",invalidFormat:"Format de modèle invalide. Doit contenir les champs version, name, servers et groups.",parseError:"Échec de l'analyse JSON. Veuillez vérifier le format et réessayer.",uploadFile:"Télécharger le fichier modèle",or:"ou",pasteJson:"Coller le JSON du modèle",pastePlaceholder:"Collez le contenu de votre fichier .mcphub-template.json ici...",version:"Version",createdAt:"Créé le",servers:"Serveurs",groups:"Groupes",serversInGroup:"serveur(s)",envVarsNeeded:"Variables d'environnement requises — définissez-les avant d'utiliser les serveurs importés :",importResult:"Serveurs : {{serversCreated}} créés, {{serversSkipped}} ignorés. Groupes : {{groupsCreated}} créés, {{groupsSkipped}} ignorés."},iC={app:A4,about:E4,profile:R4,sponsor:T4,wechat:O4,discord:z4,theme:M4,auth:P4,server:D4,status:L4,errors:U4,common:_4,pagination:B4,nav:I4,pages:F4,logs:H4,groups:q4,market:G4,oauthServer:K4,cloud:V4,registry:$4,tool:Y4,prompt:J4,settings:Q4,mcpb:X4,jsonImport:Z4,groupImport:W4,users:eC,api:tC,oauthCallback:rC,builtinPrompts:sC,builtinResources:aC,activity:nC,template:lC},oC={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",embeddingSyncProgress:"{{serverName}} için gömme oluşturuluyor",embeddingSyncProgressAriaLabel:"{{serverName}} için gömme oluşturuluyor: {{total}} adımdan {{current}} tamamlandı"},cC={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..."},uC={viewProfile:"Profili görüntüle",userCenter:"Kullanıcı Merkezi"},dC={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"},mC={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"},pC={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!"},fC={title:"Tema",light:"Açık",dark:"Koyu",system:"Sistem"},gC={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"},hC={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:"Gelen MCP isteklerinden yukarı akış sunucu isteklerine 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"}},xC={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."},yC={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"},bC={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"},vC={rowsPerPage:"Sayfa başına satır",showing:"Toplam {{total}} öğeden {{from}}-{{to}} gösteriliyor"},wC={dashboard:"Kontrol Paneli",servers:"Sunucular",groups:"Gruplar",prompts:"Promptlar",resources:"Kaynaklar",users:"Kullanıcılar",settings:"Ayarlar",changePassword:"Şifre Değiştir",market:"Market",cloud:"Bulut Market",logs:"Günlükler",activity:"Etkinlik"},jC={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"},prompts:{title:"Yerleşik Promptlar"},resources:{title:"Yerleşik Kaynaklar"},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"}},SC={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"},NC={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",promptSelection:"İstem Seçimi",resourceSelection:"Kaynak Seçimi",toolsSelected:"Seçildi",promptsSelected:"Seçildi",resourcesSelected:"Seçildi",allTools:"Tümü",allPrompts:"Tüm istemler",allResources:"Tüm kaynaklar",selectedTools:"Seçili araçlar",selectedPrompts:"Seçili istemler",selectedResources:"Seçili kaynaklar",selectAll:"Tümünü Seç",selectNone:"Hiçbirini Seçme",configureTools:"Araçları Yapılandır",configureCapabilities:"Araçları, istemleri ve kaynakları yapılandır",previewPrompts:"[istemler: {{items}}]",previewResources:"[kaynaklar: {{items}}]",previewAllTools:"(tüm araçlar)",previewAllPrompts:"(tüm istemler)",previewAllResources:"(tüm kaynaklar)"},kC={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"},CC={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."}},AC={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}}"},EC={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"},RC={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",descriptionUpdateSuccess:"Araç açıklaması başarıyla güncellendi",descriptionUpdateFailed:"Araç açıklaması güncellenemedi",restoreDefault:"Varsayılana dön",restoreDefaultSuccess:"Araç açıklaması varsayılan değere döndürüldü",restoreDefaultFailed:"Varsayılan araç açıklamasına dönülemedi",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"},TC={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",restoreDefault:"Varsayılana dön",restoreDefaultSuccess:"İstek açıklaması varsayılan değere döndürüldü",restoreDefaultFailed:"Varsayılan istek açıklamasına dönülemedi"},OC=JSON.parse(`{"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","bearerAuthHeaderName":"Bearer Kimlik Doğrulama Başlığı","bearerAuthHeaderNameDescription":"MCP bearer kimlik bilgilerinin alınacağı başlık adı. Yukarı akış passthrough başlıkları da Authorization kullanıyorsa bunu değiştirin.","bearerAuthHeaderNamePlaceholder":"örn. Authorization veya X-MCP-Authorization","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)","jsonBodyLimit":"JSON Gövde Boyutu Sınırı","jsonBodyLimitDescription":"Express JSON istek boyutu sınırı. Büyük OpenAPI şema yüklemeleri de bu ayardan etkilenir.","jsonBodyLimitPlaceholder":"örn. 1mb, 5mb, 1024kb","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 uyumlu Temel URL","openaiApiBaseUrlPlaceholder":"https://api.openai.com/v1","openaiApiKey":"LLM Sağlayıcı API Anahtarı","openaiApiKeyPlaceholder":"LLM sağlayıcı API anahtarını girin","openaiApiEmbeddingModel":"Entegrasyon Modeli Adı","openaiApiEmbeddingModelPlaceholder":"text-embedding-3-small","basePacingDelayMs":"Temel pacing gecikmesi (ms)","basePacingDelayMsDescription":"Sağlayıcıya gönderilen embedding istekleri arasındaki temel bekleme süresi. Varsayılan 0 — sistem hız sınırlarını otomatik olarak yönetir: Retry-After başlıklarına uyar, başlık yoksa 63 saniyelik bekleme uygular ve her 403/429 yanıtından sonra pacing gecikmesini artırır. Yalnızca sağlayıcınız sabit bir minimum aralık gerektiriyorsa sıfırdan farklı bir değer ayarlayın.","basePacingDelayMsPlaceholder":"Boş = varsayılan 0 ms","basePacingDelayMsAuto":"Varsayılan ({{value}} ms): hız sınırı yönetimi otomatiktir.","basePacingDelayMsZero":"0 ms (varsayılan): hız sınırı yönetimi, uyarlanabilir pacing ve retry mantığı aracılığıyla otomatik olarak yapılır.","basePacingDelayMsOverride":"Özel değer: varsayılan temel pacing gecikmesini geçersiz kılar.","embeddingEncodingFormat":"Embedding Kodlama Formatı","embeddingEncodingFormatDescription":"Embedding vektörleri için kodlama formatı. Otomatik, sağlayıcı desteğine göre algılar.","embeddingEncodingFormatAuto":"Otomatik (Önerilen)","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","azureOpenaiEmbeddingModel":"Azure Embedding Model Adı","azureOpenaiEmbeddingModelDescription":"Azure'da dağıtılan gerçek OpenAI model adı (örn. text-embedding-3-small). API'ye göndermeden önce doğru token sayımı için kullanılır.","azureOpenaiEmbeddingModelPlaceholder":"text-embedding-3-small","smartRoutingConfigUpdated":"Akıllı yönlendirme yapılandırması başarıyla güncellendi","progressiveDisclosure":"Aşamalı Açıklama","progressiveDisclosureDescription":"Etkinleştirildiğinde, search_tools yalnızca araç adlarını ve açıklamalarını döndürür. Tam parametre şemasını almak için describe_tool kullanın; bu da token kullanımını azaltır.","embeddingMaxTokens":"Maks. Embedding Token Sayısı","embeddingMaxTokensDescription":"Embedding oluşturmadan önce metin kesme için maksimum token sayısı. Model varsayılanını otomatik olarak kullanmak için boş bırakın. Özel bir değer her zaman model varsayılanını geçersiz kılar. Yerel LLM sağlayıcıları kullanırken bu değeri manuel olarak ayarlamak, kesme hatalarını önlemek için özellikle yararlıdır.","embeddingMaxTokensPlaceholder":"Boş = modele göre otomatik","embeddingMaxTokensAuto":"Otomatik: {{limit}} token ({{model}} model varsayılanı)","embeddingMaxTokensOverride":"Bu değer model varsayılanını geçersiz kılar.","smartRoutingRequiredFields":"Akıllı yönlendirmeyi etkinleştirmek için Veritabanı URL'si gereklidir. LLM Sağlayıcı API Anahtarı yalnızca bulut tabanlı sağlayıcılar için gereklidir (yerel LLM'ler genellikle API anahtarı gerektirmez, form doğrulamasını geçmek için herhangi bir değer girin)","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.mcphub.app","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"}`),zC={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"},MC={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:"},PC={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:"},DC={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."},LC={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"}},UC={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"},_C={add:"Prompt Ekle",addNew:"Yeni Prompt Ekle",edit:"Promptu Düzenle",delete:"Sil",noPrompts:"Yerleşik prompt yapılandırılmamış",addFirst:"İlk promptunuzu ekleyin",name:"Ad",namePlaceholder:"örn. code-review",title:"Başlık",titlePlaceholder:"örn. Kod İnceleme Promptu",description:"Açıklama",descriptionPlaceholder:"Promptun kısa açıklaması",template:"Şablon",templatePlaceholder:"{{parametre}} yer tutucularıyla şablon metni girin...",templateHint:"Şablon parametreleri için {{paramName}} kullanın",arguments:"Argümanlar",addArgument:"Argüman Ekle",argName:"Ad",argDescription:"Açıklama",argRequired:"Zorunlu",enabled:"Etkin",active:"Aktif",inactive:"İnaktif",nameRequired:"Ad zorunludur",templateRequired:"Şablon zorunludur",fetchError:"Yerleşik promptlar yüklenemedi",createError:"Prompt oluşturulamadı",updateError:"Prompt güncellenemedi",deleteError:"Prompt silinemedi",saveError:"Prompt kaydedilemedi",confirmDelete:"Promptu Sil",deleteWarning:'"{{name}}" promptunu silmek istediğinizden emin misiniz? Bu işlem geri alınamaz.'},BC={add:"Kaynak Ekle",addNew:"Yeni Kaynak Ekle",edit:"Kaynağı Düzenle",delete:"Sil",noResources:"Yerleşik kaynak yapılandırılmamış",addFirst:"İlk kaynağınızı ekleyin",uri:"URI",uriPlaceholder:"örn. resource://docs/guide",name:"Ad",namePlaceholder:"örn. Kullanıcı Kılavuzu",description:"Açıklama",descriptionPlaceholder:"Kaynağın kısa açıklaması",mimeType:"MIME Türü",content:"İçerik",contentPlaceholder:"Kaynak içeriğini girin...",enabled:"Etkin",active:"Aktif",inactive:"İnaktif",descriptionUpdateSuccess:"Kaynak açıklaması başarıyla güncellendi",descriptionUpdateFailed:"Kaynak açıklaması güncellenemedi",restoreDefault:"Varsayılana dön",restoreDefaultSuccess:"Kaynak açıklaması varsayılan değere döndürüldü",restoreDefaultFailed:"Varsayılan kaynak açıklamasına dönülemedi",uriRequired:"URI zorunludur",contentRequired:"İçerik zorunludur",fetchError:"Yerleşik kaynaklar yüklenemedi",createError:"Kaynak oluşturulamadı",updateError:"Kaynak güncellenemedi",deleteError:"Kaynak silinemedi",saveError:"Kaynak kaydedilemedi",confirmDelete:"Kaynağı Sil",deleteWarning:'"{{name}}" kaynağını silmek istediğinizden emin misiniz? Bu işlem geri alınamaz.'},IC={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"},FC={exportButton:"Şablon Dışa Aktar",importButton:"Şablon İçe Aktar",exportTitle:"Yapılandırma Şablonunu Dışa Aktar",importTitle:"Yapılandırma Şablonunu İçe Aktar",name:"Şablon Adı",nameRequired:"Şablon adı gereklidir",namePlaceholder:"Ör: Frontend Geliştirme Araçları",description:"Açıklama",descriptionPlaceholder:"Ör: Frontend geliştirme için standart MCP sunucuları",selectGroups:"Grupları Seç",selectGroupsHelp:"Tüm grupları dışa aktarmak için boş bırakın",selectAll:"Tümünü Seç",deselectAll:"Tümünü Kaldır",includeDisabled:"Devre dışı sunucuları dahil et",exportNote:"Gizli bilgiler (API anahtarları, tokenlar, parolalar) ${PLACEHOLDER} referanslarıyla değiştirilecektir. Alıcıların kendi kimlik bilgilerini sağlaması gerekir.",export:"Dışa Aktar",exporting:"Dışa aktarılıyor...",exportFailed:"Şablon dışa aktarılamadı",import:"İçe Aktar",importing:"İçe aktarılıyor...",importFailed:"Şablon içe aktarılamadı",invalidFormat:"Geçersiz şablon formatı. version, name, servers ve groups alanlarını içermelidir.",parseError:"JSON ayrıştırılamadı. Lütfen formatı kontrol edip tekrar deneyin.",uploadFile:"Şablon Dosyası Yükle",or:"veya",pasteJson:"Şablon JSON Yapıştır",pastePlaceholder:".mcphub-template.json içeriğinizi buraya yapıştırın...",version:"Sürüm",createdAt:"Oluşturulma",servers:"Sunucular",groups:"Gruplar",serversInGroup:"sunucu",envVarsNeeded:"Gerekli Ortam Değişkenleri — içe aktarılan sunucuları kullanmadan önce bunları ayarlayın:",importResult:"Sunucular: {{serversCreated}} oluşturuldu, {{serversSkipped}} atlandı. Gruplar: {{groupsCreated}} oluşturuldu, {{groupsSkipped}} atlandı."},HC={app:oC,about:cC,profile:uC,sponsor:dC,wechat:mC,discord:pC,theme:fC,auth:gC,server:hC,status:xC,errors:yC,common:bC,pagination:vC,nav:wC,pages:jC,logs:SC,groups:NC,market:kC,oauthServer:CC,cloud:AC,registry:EC,tool:RC,prompt:TC,settings:OC,mcpb:zC,jsonImport:MC,groupImport:PC,users:DC,api:LC,oauthCallback:UC,builtinPrompts:_C,builtinResources:BC,activity:IC,template:FC};Wt.use(ix).use(q2).init({resources:{en:{translation:Kk},zh:{translation:C4},fr:{translation:iC},tr:{translation:HC}},fallbackLng:"en",debug:!1,defaultNS:"translation",interpolation:{escapeValue:!1},detection:{order:["localStorage","cookie","htmlTag","navigator"],caches:["localStorage","cookie"]}});const qC=()=>{p1()};qC();async function GC(){try{console.log("Loading runtime configuration...");const s=await u1();console.log("Runtime configuration loaded:",s),window.__MCPHUB_CONFIG__=s,Dg.createRoot(document.getElementById("root")).render(t.jsx(As.StrictMode,{children:t.jsx(hh,{})}))}catch(s){console.error("Failed to initialize app:",s),console.log("Starting app with default configuration..."),window.__MCPHUB_CONFIG__={basePath:"",version:"dev",name:"mcphub"},Dg.createRoot(document.getElementById("root")).render(t.jsx(As.StrictMode,{children:t.jsx(hh,{})}))}}GC();export{Kr as a,pt as b,At as c};
323
- //# sourceMappingURL=index-dXv8v-Od.js.map